/* A thought with a sticker (Friends → Chats): the row friends see, the card you write it in, and the
   sheet that opens when they tap it. Words: ⌨️ Typing · ☁️ Cloud · 🪧 Sign · ✨ Shimmer (thought-look.js).
   Seen: everything calms down (still sticker, one grey line). */

/* ---------- The row: the sticker where the photo was, no name, just the words ---------- */
.presence-cover.is-thought { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; cursor: pointer; }
.link-contact > .presence-cover.is-thought { grid-column: 1 / -1; margin: 0; padding: 0; border-radius: 0; background: none; }
.link-contact:has(> .presence-cover.is-thought:not([hidden])) > .link-contact-avatar { display: none; }
.link-contact:has(> .presence-cover.is-thought:not(.is-seen):not([hidden])) { background: linear-gradient(90deg, #fff7ec, #fff 70%); }
.presence-cover.is-thought > span { display: block; overflow: visible; -webkit-line-clamp: none; color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; }
.presence-cover.is-thought > .th-face { position: relative; width: 48px; height: 48px; }
.th-face svg { position: absolute; left: -6px; top: -10px; width: 60px; height: 62px; overflow: visible; }
.presence-cover.is-thought > .th-meta { display: grid; justify-items: end; gap: 6px; color: #9a9ea5; font-size: 11px; font-weight: 700; }
.th-dot { width: 8px; height: 8px; border-radius: 50%; background: #f26b4f; }
.th-lines { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; color: #2a2010; font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif; font-size: 16px; font-weight: 800; line-height: 1.3; letter-spacing: .1px; }
.presence-cover.is-thought > .th-type, .presence-cover.is-thought > .th-cloud,
.presence-cover.is-thought > .th-sign, .presence-cover.is-thought > .th-shine { justify-self: start; min-width: 0; max-width: 100%; }

/* ⌨️ Typing: the letters come one by one with a cursor, then a highlighter swipes under every line. */
.th-type { margin-left: 2px; }
.th-type i { position: relative; font-style: normal; opacity: 0; animation: thLetter 1ms forwards; animation-delay: calc(var(--i) * 55ms - var(--th-since, 0ms)); }
.th-type i::after { content: ""; position: absolute; top: .12em; right: -2px; bottom: .04em; width: 2px; background: #2a2010; opacity: 0; animation: thCaret 55ms; animation-delay: calc(var(--i) * 55ms - var(--th-since, 0ms)); }
.th-type i:last-child::after { animation: thBlink .8s steps(1) 3; animation-delay: calc(var(--i) * 55ms - var(--th-since, 0ms)); }
.th-typed { background: linear-gradient(transparent 56%, #ffe08a 56%, #ffe08a 92%, transparent 92%) no-repeat; background-size: 0% 100%; -webkit-box-decoration-break: clone; box-decoration-break: clone; animation: thMark .8s ease forwards; animation-delay: calc(var(--th-end, 0ms) - var(--th-since, 0ms) + 100ms); }
/* Whole keyframes at 1: a step timing can land a hair short of the end and stay hidden. */
@keyframes thLetter { from, to { opacity: 1; } }
@keyframes thCaret { from, to { opacity: 1; } }
@keyframes thBlink { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes thMark { to { background-size: 100% 100%; } }

/* ☁️ Cloud: a soft cloud, thought-dots puffing up from the sticker. */
.presence-cover.is-thought > .th-cloud { position: relative; z-index: 0; margin: 8px 0 0 10px; padding: 9px 15px; border-radius: 22px; background: linear-gradient(135deg, #eef6ff, #fff4fa); box-shadow: 0 6px 16px rgb(121 199 236 / .25), inset 0 0 0 1.5px #d8e9fb; animation: thFloat 3s ease-in-out infinite; }
.th-cloud::before, .th-cloud::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: inherit; box-shadow: inset 0 0 0 1.5px #d8e9fb; }
.th-cloud::before { left: 14px; top: -12px; width: 34px; height: 30px; }
.th-cloud::after { right: 18px; top: -15px; width: 44px; height: 36px; }
.th-puff { position: absolute; border-radius: 50%; background: #eef6ff; box-shadow: inset 0 0 0 1.5px #d8e9fb; animation: thPuff 2.4s ease-in-out infinite; }
.th-puff.p1 { left: -18px; bottom: 2px; width: 7px; height: 7px; }
.th-puff.p2 { left: -12px; bottom: 12px; width: 10px; height: 10px; animation-delay: .3s; }
.th-puff.p3 { left: -22px; bottom: -6px; width: 5px; height: 5px; animation-delay: .6s; }
@keyframes thFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes thPuff { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .7; } }

/* 🪧 Sign: a little paper note, tilted, taped, bobbing. */
.presence-cover.is-thought > .th-sign { position: relative; margin: 6px 0 2px 4px; padding: 10px 14px 9px; border: 1.5px solid #2a2010; border-radius: 6px; background: #fffdf5; box-shadow: 3px 3px 0 #2a2010; transform: rotate(-2.5deg); animation: thBob 1.8s ease-in-out infinite; }
.th-tape { position: absolute; top: -8px; left: 50%; width: 44px; height: 14px; margin-left: -22px; border-radius: 2px; background: rgb(242 107 79 / .75); transform: rotate(4deg); }
@keyframes thBob { 0%, 100% { transform: rotate(-2.5deg) translateY(0); } 50% { transform: rotate(-1deg) translateY(-3px); } }

/* ✨ Shimmer: the words in warm color with light sweeping across, sparkles twinkling. */
.presence-cover.is-thought > .th-shine { position: relative; margin-left: 2px; padding: 2px 4px; }
.th-shine .th-lines { background: linear-gradient(100deg, #e0912a 0%, #f26b4f 30%, #fff3c4 45%, #f26b4f 60%, #a99be0 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: thSweep 2.6s linear infinite; }
@keyframes thSweep { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.th-spk { position: absolute; color: #f7b733; font-size: 12px; font-style: normal; animation: thTwinkle 1.6s ease-in-out infinite; }
.th-spk.s1 { top: -8px; right: 6px; }
.th-spk.s2 { bottom: -6px; left: 30%; animation-delay: .5s; }
.th-spk.s3 { top: 40%; right: -12px; font-size: 9px; animation-delay: 1s; }
@keyframes thTwinkle { 0%, 100% { opacity: 0; transform: scale(.5); } 50% { opacity: 1; transform: scale(1.1); } }

/* Seen: everything settles. */
.is-seen .th-face svg * { animation-play-state: paused !important; }
.is-seen .th-dot, .is-seen .th-puff, .is-seen .th-spk, .is-seen .th-tape { display: none; }
.is-seen .th-lines { -webkit-line-clamp: 1; color: #8a8f98; font-size: 14px; font-weight: 650; }
.is-seen .th-type i { opacity: 1; animation: none; }
.is-seen .th-type i::after { display: none; }
.is-seen .th-typed { background: none; animation: none; }
.presence-cover.is-thought.is-seen > .th-cloud { margin-top: 0; padding: 5px 12px; background: #f4f4f6; box-shadow: none; animation: none; }
.is-seen .th-cloud::before, .is-seen .th-cloud::after { display: none; }
.presence-cover.is-thought.is-seen > .th-sign { margin: 0 0 0 2px; padding: 5px 10px; border-color: #d4d4da; box-shadow: none; transform: none; animation: none; }
.is-seen .th-shine .th-lines { background: none; color: #8a8f98; animation: none; }

@media (prefers-reduced-motion: reduce) {
  .th-cloud, .th-sign, .th-puff, .th-spk, .th-shine .th-lines { animation: none !important; }
}

/* ---------- Writing it: your sticker, two lines, the sticker rows, the style, the preview ---------- */
.presence-card.is-thought { max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.presence-card.is-thought::-webkit-scrollbar { display: none; }
.th-card { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 12px 10px; border-radius: 20px; background: linear-gradient(135deg, #fff1e6, #eef6ff); }
.th-card-stk { flex: none; width: 92px; height: 96px; }
.th-card-stk svg, .th-big svg { display: block; width: 100%; height: 100%; overflow: visible; }
.th-card textarea { flex: 1; min-width: 0; height: 64px; padding: 0; border: 0; outline: none; resize: none; background: none; color: #18181b; font: inherit; font-size: 18px; font-weight: 650; line-height: 1.35; }
.th-card textarea::placeholder { color: #b9ab9b; font-weight: 500; }
.th-count { display: block; margin: 4px 4px 0 auto; width: max-content; color: #8a8f98; font-size: 11.5px; }
.th-title { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 4px 4px; }
.th-title b { color: #8a8f98; font-size: 13px; }
.th-title small { color: #3f9b5a; font-size: 12px; font-weight: 700; }
.th-packs { display: flex; gap: 4px; margin: 0 2px 4px; }
.th-packs button { flex: 1; height: 34px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.th-packs svg { display: block; width: 28px; height: 29px; margin: 0 auto; overflow: visible; }
.th-packs svg * { animation: none !important; }
.th-packs button[aria-pressed="true"] { background: #f0f0f3; }
.th-picker { display: flex; gap: 2px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.th-picker::-webkit-scrollbar { display: none; }
.th-picker button { flex: 0 0 58px; height: 60px; padding: 0; border: 0; border-radius: 14px; background: none; cursor: pointer; }
.th-picker svg { display: block; width: 52px; height: 54px; margin: 0 auto; overflow: visible; }
.th-picker button[aria-pressed="true"] { background: #f0f0f3; box-shadow: inset 0 0 0 2px #18181b; }
.th-styles { display: flex; gap: 4px; margin: 0 0 8px; }
.th-styles button { flex: 1; min-width: 0; height: 34px; padding: 0 2px; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px #e3e3e7; color: #18181b; font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.th-styles button[aria-pressed="true"] { background: #18181b; color: #fff; }
.th-preview { min-height: 72px; padding: 12px; display: grid; align-items: center; border-radius: 16px; background: linear-gradient(90deg, #fff7ec, #fff 70%); box-shadow: 0 0 0 1px #ececef; }
.presence-card.is-thought .presence-main { margin-top: 12px; }

/* ---------- Tapped: big, with a reply box ---------- */
.presence-sheet.is-thought { text-align: center; }
.th-big { display: block; width: 150px; height: 156px; margin: 0 auto; }
.th-big-words { margin: 6px 12px 2px; color: #18181b; font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif; font-size: 19px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.th-big-who { color: #8a8f98; font-size: 12.5px; }
.presence-sheet.is-thought .presence-reply button { width: 44px; padding: 0; border-radius: 50%; font-size: 18px; }
