/* ai-compare-v12.css: the v12 #ai window (design-v12/ai/ai-compare-v12.mjs). Replaces kit-v7/app-ai-compare.css.
   Load after app-ui.css and app-ai.css. Every class is `cq-` under `.app`, so nothing here touches another window.
   Desktop (window ≥ 700 px): a fixed-height split. Left, the asker's pane: the question, then the records read for the answer
   (each line resolves from a skeleton bar into its label, with a tick). Right, the answer: the hook, the four-row schedule, and
   one draft open among the four holders. Under 700 px of window it stacks (phones); there is no wider form (v14).
   Motion: with no [data-play] on the figure everything is shown (poster, reduced motion, no script, static.html). The script
   sets [data-play] and poses t; a block with data-at="k" is a skeleton (bars where its text will be) until .is-in.
   The window ships in the page (assemble EAGER), so its box is its final size from the first paint; the reveal changes only colour and
   opacity inside boxes that are already laid out, so nothing moves (CLS 0). */

.app.a-window.cq { margin: 0; }
.app.cq .a-screen { position: relative; background: #fff; }

/* the app's slim header: the mark and where you are (the full app header is cropped away; it cost 56 px and said nothing here) */
.app .cq-top { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 18px; border-bottom: 1px solid hsl(var(--ink-200)); background: #fff; }
.app .cq-logo { width: 18px; height: 18px; flex-shrink: 0; }
.app .cq-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: hsl(var(--ink-500)); white-space: nowrap; min-width: 0; }
.app .cq-crumb b { color: hsl(var(--foreground)); font-weight: 600; }
.app .cq-crumb .a-i { width: 12px; height: 12px; color: hsl(var(--ink-400)); }

/* ---------- split ---------- */
.app .cq-split { display: grid; grid-template-columns: minmax(0, 258px) minmax(0, 1fr); }   /* v14: 258 so the longest record line (structural, acknowledged) stays inside the pane */
.app .cq-side { display: flex; flex-direction: column; gap: 18px; padding: 16px 14px 14px; background: hsl(var(--canvas)); border-right: 1px solid hsl(var(--ink-200)); min-width: 0; }

/* the asked turn (and, before it is sent, the composer it was typed into) */
.app .cq-ask { position: relative; border-radius: 10px; background: hsl(var(--ink-800)); color: #fff; padding: 9px 12px 11px; transition: background-color .25s, box-shadow .25s, color .25s; }
.app .cq-ask-h { margin: 0 0 3px; display: flex; gap: 8px; font-size: 11px; line-height: 15px; color: hsl(205 14% 78%); transition: opacity .2s; }
.app .cq-ask-h b { font-weight: 600; color: #fff; }
/* v15: plain wrapping (text-wrap: wrap) in the question and the draft, so Chrome, Firefox and WebKit break at the same words */
.app .cq-q { margin: 0; position: relative; font-size: 13.5px; line-height: 20px; text-wrap: wrap; }
.app .cq-q-typed, .app .cq-q-ph { display: none; }

.app .cq-h { margin: 0 0 8px; font-size: 11px; line-height: 15px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: hsl(var(--ink-600)); }
.app .cq-reads ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.app .cq-reads li { display: flex; align-items: center; gap: 7px; min-height: 26px; font-size: 12px; line-height: 16px; color: hsl(var(--ink-800)); white-space: nowrap; }
.app .cq-reads li > .a-i { width: 13px; height: 13px; color: hsl(var(--ink-500)); flex-shrink: 0; }
.app .cq-tick { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 99px; background: hsl(var(--brand)); color: #fff; flex-shrink: 0; transition: background-color .2s, box-shadow .2s; }
.app .cq-tick .a-i { width: 10px; height: 10px; stroke-width: 3; transition: opacity .2s; }
.app .cq-comp { margin-top: auto; display: flex; gap: 8px; }
.app .cq-in { flex: 1; display: flex; align-items: center; height: 32px; padding: 0 10px; border-radius: var(--radius-sm); background: #fff; box-shadow: inset 0 0 0 1px hsl(var(--input)); font-size: 12.5px; color: hsl(var(--ink-500)); white-space: nowrap; overflow: hidden; }

/* the sheet it compared, with the schedule's numbers ringed */
.app .cq-key-in { position: relative; border-radius: 8px; box-shadow: 0 0 0 1px hsl(var(--ink-200)); }
.app .cq-plan { display: block; width: 100%; height: auto; border-radius: 8px; }
.app .cq-ring { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; }
.app .cq-ring b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 99px; background: hsl(var(--brand)); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 0 0 2px #fff; }
.app .cq-ring.is-dashed b { background: #fff; color: hsl(var(--tone-attention-strong)); box-shadow: inset 0 0 0 1.5px hsl(var(--tone-attention-strong)), 0 0 0 2px #fff; }
.app .cq-plan .cq-cloud path { transition: stroke-dashoffset .6s ease-out, fill-opacity .3s .5s; }
.app .cq-thumb { margin: 0; }
.app .cq-thumb .cq-key-in { position: relative; border-radius: 6px; box-shadow: 0 0 0 1px hsl(var(--ink-200)); background: #fff; }
.app .cq-thumb .cq-plan { border-radius: 6px; }
.app .cq-thumb .cq-ring b { width: 16px; height: 16px; font-size: 11px; }

/* the answer */
.app .cq-ans { min-width: 0; padding: 16px 18px 16px; background: #fff; display: flex; flex-direction: column; }
.app .cq-ah { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; min-height: 22px; }
.app .cq-mark { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px hsl(var(--ink-200)); flex-shrink: 0; }
.app .cq-mark .a-i { width: 14px; height: 14px; }
.app .cq-status { margin-left: auto; position: relative; display: grid; justify-items: end; min-width: 0; }
.app .cq-status > * { grid-area: 1 / 1; }
.app .cq-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 16px; color: hsl(var(--ink-600)); white-space: nowrap; }
.app .cq-meta .a-i { width: 13px; height: 13px; color: hsl(var(--brand)); }
.app .cq-work { display: none; }

.app .cq-hook { margin: 12px 0 0; font-size: 17px; line-height: 24px; font-weight: 650; letter-spacing: -.01em; color: hsl(var(--foreground)); text-wrap: balance; }
.app .cq-sub { margin: 4px 0 0; font-size: 13px; line-height: 19px; color: hsl(var(--ink-600)); }

/* the schedule: the C → D → E hook made visible (the changed cell in brand ink, the unclouded one in attention) */
.app .cq-tbl { width: 100%; margin-top: 12px; border-collapse: collapse; table-layout: fixed; font-size: 13px; line-height: 18px; }
.app .cq-tbl .cq-c0 { width: 28px; }
.app .cq-tbl .cq-cr { width: 21%; }
.app .cq-tbl thead th { padding: 0 6px 6px; border-bottom: 1px solid hsl(var(--ink-200)); text-align: left; vertical-align: bottom; font-size: 11px; line-height: 15px; font-weight: 600; color: hsl(var(--ink-500)); white-space: nowrap; }
.app .cq-tbl thead th:first-child { padding-left: 0; }
.app .cq-tbl thead .a-revtag { font-size: 11px; line-height: 15px; padding: 1px 5px; }
.app .cq-tbl thead th.is-now .a-revtag { background: hsl(var(--brand-subtle)); color: hsl(var(--brand-ink)); }
.app .cq-d { margin-left: 6px; font-weight: 500; font-variant-numeric: tabular-nums; }
.app .cq-tbl td, .app .cq-tbl tbody th { padding: 7px 6px; border-bottom: 1px solid hsl(var(--ink-100)); vertical-align: top; text-align: left; font-weight: 400; color: hsl(var(--ink-600)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.app .cq-tbl tbody tr:last-child > * { border-bottom: 0; }
.app .cq-tbl td:first-child { padding-left: 0; }
.app .cq-what { display: block; color: hsl(var(--foreground)); font-weight: 500; }
.app .cq-what { display: inline !important; }
.app .cq-where { display: inline; margin-left: 7px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; line-height: 15px; color: hsl(var(--ink-500)); }
.app .cq-tbl td.is-chg b { font-weight: 600; color: hsl(var(--brand-ink)); }
.app .cq-tbl td.is-flag b { color: hsl(var(--tone-attention-strong)); }
.app .cq-nc { display: flex; align-items: center; gap: 3px; margin-top: 2px; font-size: 11px; line-height: 14px; font-weight: 600; color: hsl(var(--tone-attention-strong)); }
.app .cq-nc .a-i { width: 11px; height: 11px; }
.app .cq-tbl tbody tr.is-flagrow > * { background: hsl(var(--tone-attention-subtle) / .5); }   /* the unclouded change's row (v15: by class, not position) */
.app .cq-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 99px; background: hsl(var(--brand-subtle)); color: hsl(var(--brand-ink)); font-size: 11px; line-height: 1; font-weight: 700; }
.app .cq-n.is-dashed { background: #fff; color: hsl(var(--tone-attention-strong)); box-shadow: inset 0 0 0 1.5px hsl(var(--tone-attention-strong)); }

/* the drafts: the four holders listed beside the one open transmittal (a mail client's shape: who, then the message) */
.app .cq-drafts { margin-top: 14px; }
.app .cq-draft { display: grid; grid-template-columns: minmax(0, 172px) minmax(0, 1fr); border-radius: 10px; box-shadow: 0 0 0 1px hsl(var(--ink-200)); overflow: hidden; }
.app .cq-tabs { display: flex; flex-direction: column; background: hsl(var(--ink-50)); border-right: 1px solid hsl(var(--ink-200)); }
.app .cq-tab { position: relative; display: flex; align-items: flex-start; gap: 7px; padding: 9px 6px 8px 10px; min-width: 0; border-bottom: 1px solid hsl(var(--ink-200)); }
.app .cq-tab:last-child { border-bottom: 0; }
.app .cq-tab .a-av { margin-top: 1px; }
.app .cq-tab-t { display: grid; min-width: 0; }
.app .cq-tab-t b { font-size: 12px; line-height: 16px; font-weight: 600; color: hsl(var(--ink-700)); white-space: nowrap; }
.app .cq-tab-t > span { font-size: 11px; line-height: 15px; color: hsl(var(--ink-600)); white-space: nowrap; }
.app .cq-tab.is-on { background: #fff; margin-right: -1px; }
.app .cq-tab.is-on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: hsl(var(--brand)); }
.app .cq-tab.is-on .cq-tab-t b { color: hsl(var(--foreground)); }

.app .cq-card { padding: 10px 14px 0; background: #fff; min-width: 0; display: flex; flex-direction: column; }
.app .cq-card-f { margin-top: auto !important; }
.app .cq-card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.app .cq-card-k { display: flex; align-items: center; gap: 7px; font-size: 13px; line-height: 18px; }
.app .cq-card-k .a-i { color: hsl(var(--ink-500)); }
.app .cq-to, .app .cq-file { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; line-height: 20px; }
.app .cq-k { font-size: 12px; color: hsl(var(--ink-500)); }
.app .cq-pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 3px; border-radius: 99px; box-shadow: inset 0 0 0 1px hsl(var(--ink-200)); font-size: 12px; line-height: 18px; font-weight: 500; }
.app .cq-mute { font-size: 12px; line-height: 18px; color: hsl(var(--ink-500)); }
.app .cq-note { margin: 8px 0 0; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid hsl(var(--input)); font-size: 13px; line-height: 19px; color: hsl(var(--ink-800)); text-wrap: wrap; }
.app .cq-card-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; margin-top: 10px; padding: 9px 0 11px; border-top: 1px solid hsl(var(--ink-100)); }
.app .cq-acts { display: flex; gap: 8px; flex-shrink: 0; }
.app.cq .cq-send.is-hover { background: hsl(var(--brand-hover)); }
.app.cq .a-av-xxs { width: 20px; height: 20px; font-size: 11px; line-height: 1; letter-spacing: -.02em; }   /* the 11 px floor */

/* ---------- plan mode (concept B, not chosen; this block and bodyPlan() in the generator are the record, and may be deleted) ---------- */
.app .cq-planview { display: flex; flex-direction: column; }
.app .cq-askbar { padding: 12px 18px; background: hsl(var(--canvas)); border-bottom: 1px solid hsl(var(--ink-200)); }
.app .cq-planview .cq-ans { flex: 1; padding-top: 12px; }
.app .cq-pv { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; margin-top: 10px; align-items: start; }
.app .cq-pv .cq-hook { margin-top: 0; font-size: 16px; line-height: 22px; }
.app .cq-pv .cq-tbl .cq-cr { width: 22%; }
.app .cq-pv .cq-tbl td, .app .cq-pv .cq-tbl tbody th { padding: 5px 4px; }
.app .cq-pv .cq-d { display: none; }
.app .cq-key { margin: 0; }
.app .cq-tag { position: absolute; left: 22px; white-space: nowrap; padding: 1px 6px; border-radius: 5px; background: hsl(var(--foreground)); color: #fff; font-size: 11px; line-height: 16px; font-weight: 600; }
.app .cq-ring.is-dashed .cq-tag { background: hsl(var(--tone-attention-strong)); }
.app .cq-side-l .cq-tag { left: auto; right: 22px; }
.app .cq-planview .cq-drafts { margin-top: 12px; }

/* v14 (BRIEF-v14 R0): no wide form. The page draws this window at its 820 px design width and scales it to its column, so from
   700 px of window up it is always the split above; only the phone form below changes it. */

/* ---------- under 700 px of window: one column (phones, small tablets) ---------- */
@container awin (max-width: 699px) {
  .app.cq .a-viewport { max-height: none !important; overflow: hidden !important; }
  .app .cq-split, .app .cq-planview { display: block; height: auto; }
  .app .cq-thumb { display: none; }
  .app .cq-what { display: block !important; }
  .app .cq-where { display: block; margin-left: 0; }
  .app .cq-draft { display: block; }
  .app .cq-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 0; border-bottom: 1px solid hsl(var(--ink-200)); }
  .app .cq-tab { border-bottom: 0; }
  .app .cq-tab:nth-child(odd) { border-right: 1px solid hsl(var(--ink-200)); }
  .app .cq-tab:nth-child(-n+2) { border-bottom: 1px solid hsl(var(--ink-200)); }
  .app .cq-tab.is-on { margin-right: 0; }
  .app .cq-tab.is-on::before { top: auto; right: 0; width: auto; height: 2px; }
  .app .cq-tab-t b, .app .cq-tab-t > span { white-space: normal; }
  .app .cq-side { display: block; padding: 12px 12px 0; border-right: 0; background: #fff; }
  .app .cq-reads, .app .cq-comp { display: none; }
  .app .cq-ans { padding: 12px 12px 12px; }
  .app .cq-ah { flex-wrap: wrap; }
  .app .cq-hook { margin-top: 10px; font-size: 16px; line-height: 22px; text-wrap: wrap; }   /* v16 verify: in the narrow window `balance` breaks this answer at a different word in WebKit (it settles balance only once painted), so plain wrapping here: the same lines in Chrome, Firefox and WebKit */
  .app .cq-tbl { font-size: 12px; line-height: 17px; }
  .app .cq-tbl .cq-c0 { width: 24px; }
  .app .cq-tbl .cq-cr { width: 22%; }
  .app .cq-tbl td, .app .cq-tbl tbody th { padding: 6px 4px; white-space: normal; }
  .app .cq-tbl thead th { padding: 0 4px 6px; }
  .app .cq-d { display: block; margin: 2px 0 0; }
  .app .cq-card { padding: 10px 12px 0; }
  .app .cq-card-h { flex-wrap: wrap; }
  .app .cq-to .cq-mute { display: none; }

  .app .cq-pv { grid-template-columns: minmax(0, 1fr); }
  .app .cq-planview .cq-askbar { padding: 12px; }
}
@container awin (max-width: 380px) {
  .app .cq-crumb > span, .app .cq-crumb > .a-i { display: none; }
  .app .cq-tbl td, .app .cq-tbl tbody th { padding-left: 3px; padding-right: 3px; }
  .app .cq-tbl td { overflow-wrap: anywhere; }
  .app .cq-tbl .cq-c0 { width: 22px; }
  .app .cq-nc .a-i { display: none; }
  .app .cq-tab { padding: 7px 8px; }

}

/* ---------- motion (only when the script has set [data-play]) ---------- */
.app.cq .cq-cursor { display: none; }
/* skeleton: text in a block not yet in draws as bars where its lines will be; icons, badges and avatars wait as blanks */
.app.cq[data-play] .sk { -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 4px; transition: color .32s ease-out, background-color .32s ease-out; }
.app.cq[data-play] [data-at]:not(.is-in) .sk,
.app.cq[data-play] .cq-reads li:not(.is-in) .sk { color: transparent; background-color: hsl(var(--ink-100)); }
.app.cq[data-play] :is([data-at], .cq-reads li) :is(.a-i, .a-av, .a-badge, .a-revtag, .a-id, .cq-n, .cq-pill, .a-btn, .cq-ring b, .cq-tag) { transition: opacity .32s ease-out, background-color .32s, color .32s, box-shadow .32s; }
.app.cq[data-play] [data-at]:not(.is-in) :is(.a-i, .a-av, .a-badge, .a-revtag, .a-id, .cq-n, .cq-tag) { opacity: 0; }
.app.cq[data-play] [data-at]:not(.is-in) :is(.a-btn, .cq-pill) { color: transparent; background: hsl(var(--ink-100)); box-shadow: none; }
.app.cq[data-play] [data-at]:not(.is-in) .a-btn .a-i { opacity: 0; }
.app.cq[data-play] .cq-reads li:not(.is-in) > .a-i { opacity: 0; }
.app.cq[data-play] .cq-reads li:not(.is-in) .cq-tick { background: transparent; box-shadow: inset 0 0 0 1.5px hsl(var(--ink-200)); }
.app.cq[data-play] .cq-reads li:not(.is-in) .cq-tick .a-i { opacity: 0; }
.app.cq[data-play] .cq-ring[data-at] { transition: transform .4s cubic-bezier(.3,1.5,.5,1), opacity .2s; }
.app.cq[data-play] .cq-ring[data-at]:not(.is-in) { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
.app.cq[data-play] .cq-cloud path { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; }
.app.cq[data-play].t-clouds .cq-cloud path { stroke-dashoffset: 0; fill-opacity: 1; }
.app.cq[data-play] .cq-plan .cq-ink { transition: opacity .4s; }
.app.cq[data-play]:not(.t-plan) .cq-plan .cq-ink { opacity: .18; }
.app.cq[data-play] .cq-comp[data-at]:not(.is-in) .cq-in { box-shadow: inset 0 0 0 1px hsl(var(--ink-200)); }
/* the composer, before the question is sent: a white input with its placeholder, the question typing into the reserved box */
.app.cq[data-play].t-compose .cq-ask { background: #fff; color: hsl(var(--foreground)); box-shadow: inset 0 0 0 1px hsl(var(--input)), 0 0 0 3px hsl(var(--brand-subtle)); }
.app.cq[data-play].t-compose .cq-ask-h { opacity: 0; }
.app.cq[data-play].t-compose .cq-q-full { visibility: hidden; }
.app.cq[data-play].t-compose .cq-q-typed { display: block; position: absolute; inset: 0; }
.app.cq[data-play].t-compose .cq-q-typed:not(:empty)::after { content: ''; display: inline-block; width: 1.5px; height: 15px; margin-left: 1px; background: hsl(var(--brand)); vertical-align: -2px; }
.app.cq[data-play].t-empty .cq-q-ph { display: block; position: absolute; inset: 0; color: hsl(var(--ink-500)); }
.app.cq[data-play].t-empty .cq-q-ph::before { content: ''; display: inline-block; width: 1.5px; height: 15px; margin-right: 1px; background: hsl(var(--brand)); vertical-align: -2px; animation: cq-blink 1s steps(1) infinite; }
@keyframes cq-blink { 50% { opacity: 0; } }
/* the working state reads in the slot the meta line will take */
.app.cq[data-play] .cq-work { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: hsl(var(--ink-700)); font-weight: 500; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.app.cq[data-play] .cq-work.is-on { opacity: 1; }
.app.cq[data-play].t-working .cq-meta { visibility: hidden; }
.app .cq-spin { width: 12px; height: 12px; border-radius: 99px; border: 2px solid hsl(var(--ink-200)); border-top-color: hsl(var(--brand)); animation: cq-spin .8s linear infinite; }
@keyframes cq-spin { to { transform: rotate(360deg); } }
/* the cursor: one straight move onto Review & send, then rests (hover only, never a click) */
.app.cq[data-play] .cq-cursor { display: block; position: absolute; left: 0; top: 0; z-index: 3; opacity: 0; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .2s; pointer-events: none; }
.app.cq[data-play] .cq-cursor.is-in { opacity: 1; }
@container awin (max-width: 699px) { .app.cq[data-play] .cq-cursor { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .app.cq[data-play] .sk { color: inherit !important; background: none !important; transition: none !important; }
  .app.cq[data-play] * { transition: none !important; }
  .app.cq[data-play] .cq-cursor { display: none; }
}
