/* PrepBuddy learner: the conversation recipe, classes cv- (Chat 01 a thread with a buddy or a group, Chat 05 an Instructor thread). The bubble, its rows and meta, the day pill, the peer in the page bar,
   the sticky bars, quotes, attachments, reactions and the composer extras. Written once on 2026-10-19: Chat 05 had copied the bubble part of Chat 01 (and drifted: no ellipsis on the status line,
   no first-day margin). Page glue (the page-bar search field, the search results) stays in 01. Tokens only. Flutter: MessageBubble, ChatThread. */
/* peer in the page bar: avatar with the online dot, name, status line */
.cv-peer { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 48px; text-align: start; color: var(--text-primary); border-radius: 12px; }
.cv-peer .av { position: relative; flex-shrink: 0; display: inline-flex; } .cv-peer .av .pb-avatar { width: 36px; height: 36px; }
.cv-peer .pb-avatar { width: 36px; height: 36px; }   /* Chat 05 draws the avatar without the .av wrapper */
.cv-peer .on { position: absolute; inset-inline-end: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 999px; background: var(--success); border: 2px solid var(--bg); box-sizing: content-box; }
.cv-peer .tx { flex: initial; gap: 0; }
.cv-peer b { font-size: calc(16px * var(--font-scale)); font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-peer .cv-st { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); line-height: 1.2; overflow-wrap: anywhere; }   /* the status wraps to a second line: Tamil "last seen 3 h ago" ended in an ellipsis (2026-11-15) */
.cv-peer .cv-st.live { color: var(--success-text); font-weight: 600; }
/* pinned message bar and the offline notice stick under the page bar */
.cv-sticky { position: sticky; top: 56px; z-index: 15; margin: 0 -16px; background: var(--bg); }
@media (min-width: 600px) { .cv-sticky { top: 64px; margin: 0 -24px; } }
.cv-pin { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; text-align: start; box-shadow: inset 0 -1px 0 var(--border); color: var(--text-primary); }
.cv-pin .mi { font-size: 20px; color: var(--primary-text); flex-shrink: 0; }
.cv-pin .tx { gap: 0; }
.cv-pin small { font-size: calc(11px * var(--font-scale)); font-weight: 700; color: var(--primary-text); letter-spacing: .04em; }
.cv-pin span.sn { font-size: calc(13px * var(--font-scale)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.cv-pin .n { flex-shrink: 0; font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--text-secondary); }
.cv-off { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); background: color-mix(in srgb, var(--warning) 12%, var(--bg)); box-shadow: inset 0 -1px 0 var(--border); }
.cv-off .mi { font-size: 16px; color: var(--warning-text); }
/* the thread */
.cv-thread { display: flex; flex-direction: column; padding: 4px 0 24px; }
.cv-day { align-self: center; margin: 16px 0 8px; padding: 4px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); font-size: calc(12px * var(--font-scale)); font-weight: 600; color: var(--text-secondary); }
.cv-day:first-child { margin-top: 8px; }
.cv-sys { font-weight: 500; }   /* a group's system line */
.cv-from { display: block; margin-bottom: 2px; font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--accent-text, var(--accent)); }   /* the sender, on the first bubble of their run in a group */
.cv-b .lkcard { margin-bottom: 8px; }
.cv-unr { display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--primary-text); }
.cv-unr::before, .cv-unr::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--primary) 45%, transparent); }
.cv-row { position: relative; display: flex; flex-direction: column; align-items: flex-start; margin-top: 2px; touch-action: pan-y; }
.cv-row.me { align-items: flex-end; }
.cv-row.first { margin-top: 12px; }
.cv-row .rep { position: absolute; top: 50%; inset-inline-start: 4px; translate: 0 -50%; opacity: 0; width: 32px; height: 32px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); display: flex; align-items: center; justify-content: center; color: var(--primary-text); pointer-events: none; }
.cv-row .rep .mi { font-size: 18px; }
.cv-row .del { position: absolute; top: 50%; inset-inline-end: 4px; translate: 0 -50%; opacity: 0; width: 32px; height: 32px; border-radius: 999px; background: var(--error-container); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--error) 40%, transparent); display: flex; align-items: center; justify-content: center; color: var(--error-text); pointer-events: none; }
.cv-row .del .mi { font-size: 18px; }
/* the reactions: a strip above the bubble's inner corner, shown on hover (pointer), on tap (the bubble takes focus) or with keyboard focus */
.cv-hov { position: absolute; top: -36px; z-index: 3; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge), 0 6px 18px color-mix(in srgb, var(--shadow-ink) 14%, transparent); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity 150ms ease, transform 150ms ease; }
.cv-row:not(.me) .cv-hov { inset-inline-start: 8px; } .cv-row.me .cv-hov { inset-inline-end: 8px; }
.cv-hov button { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--rx); }
.cv-hov button .mi { font-size: 20px; }
.cv-hov button:hover { background: color-mix(in srgb, var(--rx) 16%, var(--surface)); }
.cv-hov button.on { background: color-mix(in srgb, var(--rx) 16%, var(--surface)); box-shadow: inset 0 0 0 2px var(--rx); }
.cv-row:focus-within .cv-hov { opacity: 1; pointer-events: auto; transform: none; }
@media (hover: hover) { .cv-row:hover .cv-hov { opacity: 1; pointer-events: auto; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cv-hov { transition: none; } .cv-b { transition: none; } }
.cv-b { position: relative; max-width: min(80%, 520px); padding: 8px 12px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); font-size: calc(15px * var(--font-scale)); line-height: 1.45; text-align: start; color: var(--text-primary); outline-offset: 2px; transition: transform 150ms ease; user-select: text; }
.cv-row.me .cv-b { background: var(--primary-grad); color: var(--on-primary); box-shadow: none; }
.cv-row.last .cv-b { border-end-start-radius: 6px; }
.cv-row.me.last .cv-b { border-end-start-radius: 20px; border-end-end-radius: 6px; }
.cv-b.sel { outline: 2px solid var(--primary); }
.cv-b p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cv-meta { float: inline-end; display: inline-flex; align-items: center; gap: 4px; margin: 8px 0 -4px; margin-inline-start: 12px; font-size: calc(11px * var(--font-scale)); line-height: 1; color: var(--text-secondary); white-space: nowrap; }
.cv-row.me .cv-meta { color: color-mix(in srgb, var(--on-primary) 75%, transparent); }
.cv-meta .mi { font-size: 14px; }
.cv-meta .rd { color: var(--on-primary); }
.cv-meta .cv-sw { font-weight: 700; }   /* the status word (Seen, Delivered); not .sw, which is theme.css's switch */
.cv-qt { display: block; width: 100%; margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; border-inline-start: 3px solid var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); text-align: start; color: inherit; }
.cv-row.me .cv-qt { border-color: var(--on-primary); background: color-mix(in srgb, var(--on-primary) 16%, transparent); }
.cv-qt b { display: block; font-size: calc(12px * var(--font-scale)); font-weight: 700; }
/* the story quote of a story reply (PbStoryQuote, 2026-10-12): the card the reply answered, as it was when it was sent */
.cv-sq { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 208px; margin: 0 0 8px; padding: 8px 12px 8px 8px; border-radius: 12px; border-inline-start: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); text-align: start; color: inherit; }
.cv-row.me .cv-sq { border-color: var(--on-primary); background: color-mix(in srgb, var(--on-primary) 16%, transparent); }
.cv-sq .sqi { width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); } .cv-sq .sqi .mi { font-size: 20px; color: var(--accent); }
.cv-row.me .cv-sq .sqi { background: color-mix(in srgb, var(--on-primary) 22%, transparent); } .cv-row.me .cv-sq .sqi .mi { color: var(--on-primary); }
.cv-sq .sqt { min-width: 0; display: flex; flex-direction: column; gap: 1px; } .cv-sq small { font-size: calc(12px * var(--font-scale)); font-weight: 700; opacity: .85; }
.cv-sq b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: calc(13px * var(--font-scale)); font-weight: 700; overflow-wrap: anywhere; }
.cv-qt span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: calc(13px * var(--font-scale)); opacity: .85; }
.cv-img { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--ca) 55%, var(--bg)), color-mix(in srgb, var(--cb) 40%, var(--bg))); }
.cv-img .mi { font-size: 48px; color: var(--ca); }
.cv-b.photo { padding: 4px; width: min(240px, 80%); }
.cv-b.photo p { padding: 8px 8px 0; }
.cv-b.photo .cv-meta { margin-inline: 12px 8px; margin-bottom: 2px; }
.cv-tr { display: block; clear: both; margin-top: 8px; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.cv-tr button { position: relative; } .cv-tr button::after { content: ""; position: absolute; inset: -8px 0; }   /* a 28 dp text line, a 44 dp touch target */
.cv-tr button { min-height: 28px; display: inline-flex; align-items: center; gap: 8px; color: var(--primary-text); font-weight: 600; font-size: inherit; }
.cv-tr .mi { font-size: 14px; }
.cv-b.gone { background: transparent; border: 1px dashed var(--outline); box-shadow: none; color: var(--text-secondary); font-style: italic; }
.cv-row.me .cv-b.gone { background: transparent; color: var(--text-secondary); box-shadow: none; }
.cv-b.gone .mi { font-size: 16px; vertical-align: -3px; margin-inline-end: 8px; }
.cv-row.failed .cv-b { background: color-mix(in srgb, var(--error) 14%, var(--bg)); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--error); }
.cv-row.failed .cv-meta, .cv-row.me.failed .cv-meta { color: var(--error-text); }
.cv-row.queued .cv-b, .cv-row.sending .cv-b { opacity: .72; }
/* the message check (AI surfaces M3 to M6): a refused send keeps its text and shows a notice above the bar; a message a person was asked to review waits greyed for the sender only; a declined one stays unsent with the reason */
.cv-row.held .cv-b, .cv-row.notsent .cv-b { opacity: .72; }
.cv-row.notsent .cv-b { box-shadow: inset 0 0 0 1px var(--outline); }
.cv-held { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: calc(12px * var(--font-scale)); font-weight: 600; }
.cv-held .mi { font-size: 16px; }
.cv-row.notsent .cv-held { color: var(--error-text); }
.cv-ref { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--error-container); color: var(--text-primary); font-size: calc(13px * var(--font-scale)); line-height: 1.5; }
.cv-ref[hidden] { display: none; }
.cv-ref b { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.cv-ref b .mi { font-size: 18px; color: var(--error-text); flex-shrink: 0; margin-top: 1px; }
.cv-ref .sub { color: var(--text-secondary); padding-inline-start: 26px; }
.cv-ref .btn { align-self: flex-start; margin-inline-start: 18px; color: var(--primary-text); }
.cv-retry { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; color: var(--error-text); font-size: calc(12px * var(--font-scale)); font-weight: 700; }
.cv-rx { margin-top: -6px; padding: 2px 8px 2px 4px; display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; background: var(--bg); box-shadow: 0 0 0 2px var(--bg), inset 0 0 0 1px var(--edge); font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--text-secondary); position: relative; z-index: 1; }
.cv-row.me .cv-rx { margin-inline-end: 12px; } .cv-row:not(.me) .cv-rx { margin-inline-start: 12px; }
.cv-row.hasrx .cv-b { padding-bottom: 12px; }
.cv-rx i { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; } .cv-rx i + i { margin-inline-start: -4px; }
.cv-rx i .mi { font-size: 16px; color: var(--rx); }
.cv-typing { display: inline-flex; align-items: center; gap: 4px; padding: 16px; border-radius: 20px; border-end-start-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); margin-top: 12px; align-self: flex-start; }
.cv-jump { position: sticky; bottom: 92px; align-self: flex-end; z-index: 6; width: 44px; height: 44px; margin-top: -44px; border-radius: 999px; background: var(--surface); box-shadow: 0 6px 18px color-mix(in srgb, var(--shadow-ink) 25%, transparent), inset 0 0 0 1px var(--edge); display: flex; align-items: center; justify-content: center; color: var(--primary-text); }
.cv-jump[hidden] { display: none; }
.cv-jump .mi { font-size: 22px; }
/* new buddy: nothing said yet */
.cv-new { margin: auto; padding: 40px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cv-new .ic { width: 88px; height: 88px; border-radius: 24px; background: color-mix(in srgb, var(--primary) 14%, transparent); display: flex; align-items: center; justify-content: center; } .cv-new .ic .mi { font-size: 48px; color: var(--primary-text); }
.cv-new h2 { margin: 8px 0 0; font-size: calc(18px * var(--font-scale)); } .cv-new p { margin: 0; color: var(--text-secondary); font-size: calc(14px * var(--font-scale)); max-width: 300px; line-height: 1.5; }
.cv-new .chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
/* composer states */
.cv-end { display: flex; align-items: center; gap: 12px; justify-content: space-between; font-size: calc(14px * var(--font-scale)); color: var(--text-secondary); }
/* message actions sheet */
.cv-prev { margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--bg); font-size: calc(13px * var(--font-scale)); color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* attachments in bubbles: document, video, voice note, test result */
.cv-doc, .cv-test { display: flex; align-items: center; gap: 12px; min-width: 200px; padding: 2px 0; text-align: start; color: inherit; }
.cv-doc .fi, .cv-test .fi { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--cat-red) 18%, var(--surface)); }
.cv-doc .fi .mi { font-size: 26px; color: var(--cat-red-text); }
.cv-row.me .cv-doc .fi, .cv-row.me .cv-test .fi { background: color-mix(in srgb, var(--on-primary) 22%, transparent); } .cv-row.me .cv-doc .fi .mi { color: var(--on-primary); }
.cv-doc b, .cv-test b { display: block; font-size: calc(14px * var(--font-scale)); font-weight: 700; overflow-wrap: anywhere; } .cv-doc small, .cv-test small { display: block; font-size: calc(12px * var(--font-scale)); opacity: .8; }
.cv-test .fi { position: relative; background: conic-gradient(var(--success) calc(var(--p) * 1%), color-mix(in srgb, var(--text-secondary) 25%, transparent) 0); border-radius: 999px; }
.cv-test .fi::after { content: ""; position: absolute; inset: 5px; border-radius: 999px; background: var(--surface); } .cv-row.me .cv-test .fi::after { background: color-mix(in srgb, var(--primary) 80%, var(--surface)); }
.cv-test .fi i { position: relative; z-index: 1; font-style: normal; font-size: 11px; font-weight: 800; }
.cv-vid { position: relative; }
.cv-vid .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; } .cv-vid .play .mi { font-size: 32px; color: var(--on-media); filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--media-ink) 45%, transparent)); }
.cv-vid .dur { position: absolute; inset-inline-end: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--media-ink) 55%, transparent); color: var(--on-media); font-size: 11px; font-weight: 700; }
.cv-voice { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.cv-voice .tbtn { width: 36px; height: 36px; } .cv-voice .tbtn::after { inset: -4px; } .cv-row.me .cv-voice .tbtn { background: var(--on-primary); color: var(--primary-text); box-shadow: none; }
.cv-wave { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 28px; overflow: hidden; }
.cv-wave i { flex: 0 0 3px; border-radius: 4px; background: currentColor; opacity: .55; }
.cv-voice small { font-size: calc(12px * var(--font-scale)); opacity: .8; }
/* the message bar's extra parts: pending attachment, recording */
.cv-pend { display: flex; align-items: center; gap: 12px; padding: 8px; margin-inline-start: 52px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); font-size: calc(13px * var(--font-scale)); }
.cv-pend .th { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--ca) 55%, var(--bg)), color-mix(in srgb, var(--cb) 40%, var(--bg))); }
.cv-pend .th .mi { font-size: 22px; color: var(--ca); }
.cv-pend span.l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-rec { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.cv-rec .tm { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; }
.cv-rec .cv-wave { color: var(--error-text); }
.cv-emo { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.cv-emo button { min-height: 44px; border-radius: 12px; font-size: 24px; } .cv-emo button:hover { background: var(--bg); }
.cv-gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cv-gal button { position: relative; aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--ca) 55%, var(--bg)), color-mix(in srgb, var(--cb) 40%, var(--bg))); }
.cv-gal button .mi { font-size: 32px; color: var(--ca); } .cv-gal button .dur { position: absolute; inset-inline-end: 6px; bottom: 6px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--media-ink) 55%, transparent); color: var(--on-media); font-size: 11px; font-weight: 700; }
/* photo viewer */
.cv-pv { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--media-ink) 92%, transparent); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 24px; color: var(--on-media); }
.cv-pv .big { width: min(92vw, 640px); aspect-ratio: 16 / 10; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--ca) 60%, var(--media-ink)), color-mix(in srgb, var(--cb) 45%, var(--media-ink))); }
.cv-pv .x { position: absolute; top: 12px; inset-inline-end: 12px; width: 48px; height: 48px; border-radius: 999px; background: color-mix(in srgb, var(--on-media) 12%, transparent); color: var(--on-media); display: flex; align-items: center; justify-content: center; } .cv-pv .x .mi { font-size: 24px; }
