/* /aidemo (§G, CC-1004..1006): the hidden AI annotation demo. House palette and type, desktop first, holds at phone width. */
:root { --serif: "Source Serif 4", Georgia, serif; --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #FDFCF9; --ink: #1A1A1A; --secondary: #6F6D67; --rule: #D9D5CB; --card: #F4F1EA; --gold: #C5950E; --gold-text: #8A6708;
  --no: #B5543C; --yes: #2F6F9F; --evalbg: #FBF3DC; }
[data-theme="dark"] { --bg: #0E0E10; --ink: #F3EEE3; --secondary: #8A867D; --rule: #2B2B2E; --card: #18181B; --gold: #E0B83A; --gold-text: #E0B83A;
  --no: #E07A5F; --yes: #6BA8D6; --evalbg: #221C0E; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: hidden; }
body.aidemo { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 56px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 0; display: flex; align-items: center; gap: 9px; }
.puck-dot { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--gold); }
.cta, .ghost { display: inline-block; border-radius: 999px; padding: 11px 22px; font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; }
.cta { background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.cta.big { padding: 15px 34px; font-size: 1.05rem; }
.small { padding: 8px 16px; font-size: .88rem; }
.cta:focus-visible, .ghost:focus-visible, .set:focus-visible, .arc:focus-visible { outline: 3px solid var(--gold-text); outline-offset: 3px; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 14px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.35rem, 3vw, 1.8rem); margin: 0 0 6px; }
h3 { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin: 0 0 10px; }
.lede { font-size: 1.08rem; line-height: 1.6; color: var(--secondary); max-width: 760px; margin: 0; }
.hero { margin: 44px 0 30px; }
.demo { margin: 44px 0 0; padding: 26px 0 0; border-top: 1px solid var(--rule); }
.demo-head p { color: var(--secondary); margin: 0 0 18px; }
.rig { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
@media (max-width: 820px) { .rig { grid-template-columns: 1fr; } }
.screen { border: 1px solid var(--rule); border-radius: 14px; background: var(--card); overflow: hidden; display: flex; flex-direction: column; min-height: 360px; }
.screen-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.screen-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.screen-body { padding: 16px; flex: 1; overflow: auto; max-height: 460px; }
.rig.try .screen-body { max-height: 560px; }
.phone { border: 1px solid var(--rule); border-radius: 26px; padding: 18px 16px 14px; background: var(--bg); display: flex; flex-direction: column; justify-content: center; box-shadow: 0 14px 40px rgba(0,0,0,.08); }
.ph-count { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--secondary); margin: 0 0 6px; }
.ph-q, .q { font-family: var(--serif); font-size: 1.12rem; line-height: 1.4; margin: 0 0 6px; min-height: 3.2em; }
.ph-label, .live { text-align: center; font-weight: 700; margin: 2px 0 0; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.arc { width: 100%; height: auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.arc .track { fill: none; stroke: var(--rule); stroke-width: 10; stroke-linecap: round; }
.arc .fill-no { fill: none; stroke: var(--no); stroke-width: 10; stroke-linecap: round; }
.arc .fill-yes { fill: none; stroke: var(--yes); stroke-width: 10; stroke-linecap: round; }
.arc .tick { stroke: var(--secondary); stroke-width: 2; opacity: .5; }
.arc .pole { font: 700 22px var(--sans); fill: var(--secondary); letter-spacing: .08em; }
.arc .knob { fill: var(--gold); stroke: var(--bg); stroke-width: 4; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.arc.interactive .knob { cursor: grab; } .arc.dragging .knob { cursor: grabbing; }
.arc.big { max-width: 520px; margin: 0 auto; }
.bubble-row { display: flex; margin: 0 0 10px; } .bubble-row.user { justify-content: flex-end; }
.bubble { white-space: pre-line; max-width: 86%; border-radius: 14px; padding: 10px 13px; font-size: .95rem; line-height: 1.5; background: var(--bg); border: 1px solid var(--rule); }
.bubble-row.user .bubble { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.who { display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin: 0 0 3px; }
.eval { position: relative; border: 2px solid transparent; border-radius: 16px; padding: 6px; margin: 0 0 10px; transition: border-color .25s, background .25s; }
.eval.active { border-color: var(--gold); background: var(--evalbg); }
.eval .tag { position: absolute; top: -11px; left: 14px; background: var(--gold); color: #1A1A1A; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; display: none; }
.eval.active .tag { display: inline-block; }
.eval .bubble-row { margin: 0; }
.media { display: block; max-width: 100%; max-height: 380px; margin: 0 auto; border-radius: 10px; }
.rig.try .media { max-height: 470px; }
.media-title { font-weight: 700; margin: 10px 0 2px; text-align: center; }
.credit { font-size: .75rem; color: var(--secondary); text-align: center; margin: 4px 0 0; }
.credit a { color: inherit; }
.svg-img svg { width: 100%; max-width: 440px; height: auto; border-radius: 10px; display: block; margin: 8px auto 0; }
.caption { font-size: .82rem; color: var(--secondary); margin: 6px 0 0; }
.flow { margin: 18px 0 0; border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px; }
.flow-row, .res-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) 92px 150px; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule); }
.flow-row:first-child, .res-row:first-child { border-top: 0; }
@media (max-width: 820px) { .flow-row, .res-row { grid-template-columns: 1fr 1fr; } }
.fr-what { font-size: .88rem; line-height: 1.35; } .fr-what b { display: block; font-size: .92rem; }
.fr-what .sub { color: var(--secondary); }
.trace { width: 100%; height: 54px; display: block; }
.trace .mid { stroke: var(--rule); stroke-width: 1; } .trace .line { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linejoin: round; }
.trace .end { fill: var(--gold); }
.fr-val { font-weight: 700; font-variant-numeric: tabular-nums; } .fr-val.no { color: var(--no); } .fr-val.yes { color: var(--yes); }
.fr-stats { font-size: .8rem; color: var(--secondary); line-height: 1.45; font-variant-numeric: tabular-nums; }
.try-band { margin: 56px 0 0; padding: 30px; border-radius: 18px; background: var(--card); text-align: center; }
.try-band p { color: var(--secondary); max-width: 640px; margin: 0 auto 18px; line-height: 1.55; }
.pick { margin: 40px 0 0; }
.sets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 26px 0 0; }
.set { text-align: left; border: 1px solid var(--rule); border-radius: 16px; padding: 18px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.set:hover { border-color: var(--gold-text); }
.set-t { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; margin: 0 0 6px; }
.set-d { display: block; color: var(--secondary); font-size: .92rem; line-height: 1.45; }
.run { margin: 28px 0 0; }
.run-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; gap: 12px; }
.count { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--secondary); margin: 0; }
.panel { display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--rule); border-radius: 14px; padding: 20px; }
.hint { font-size: .85rem; color: var(--secondary); text-align: center; margin: 8px 0 0; min-height: 1.3em; }
.run-actions { display: flex; gap: 10px; justify-content: center; margin: 14px 0 0; }
.results { margin: 36px 0 0; }
.res-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 22px 0; }
.res-card { border: 1px solid var(--rule); border-radius: 14px; padding: 16px; }
.res-card .k { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--secondary); margin: 0 0 6px; }
.res-card .v { font-family: var(--serif); font-size: 1.15rem; margin: 0; line-height: 1.35; }
.res-rows { border: 1px solid var(--rule); border-radius: 14px; padding: 8px 18px; }
.res-row .thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; float: left; margin: 0 10px 0 0; }
.replay { margin-top: 4px; }
.res-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 0; }
.clip-wrap video { width: 100%; max-height: 470px; border-radius: 10px; background: #000; display: block; }
.foot { margin-top: 60px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--secondary); display: flex; gap: 18px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .eval { transition: none; } }
/* QA walk 2 (CC-1145). (d) a button label never wraps; the header's button shrinks on a phone. */
.cta, .ghost { white-space: nowrap; }
@media (max-width: 480px) { .top .cta, .top .ghost { padding: 8px 14px; font-size: .85rem; } .brand { font-size: 1.15rem; } }
/* (a) on a phone the item and the puck share one screen: the media is capped to about a third of the viewport, the
   card never scrolls on its own (only a conversation does, inside its card), and the panel is compact. */
@media (max-width: 820px) {
  .run { margin: 10px 0 0; } .run-head { margin: 0 0 8px; }
  .rig.try { gap: 10px; }
  .rig.try .screen { min-height: 0; }
  .rig.try .screen-body { max-height: none; overflow: visible; padding: 8px; }
  .rig.try .screen-body.chat-run { max-height: 34vh; max-height: 34svh; overflow: auto; }
  .rig.try .media { width: auto; height: auto; max-height: 30vh; max-height: 30svh; }
  .rig.try .clip-wrap video { max-height: 30vh; max-height: 30svh; }
  .rig.try .media-title { margin: 6px 0 0; font-size: .92rem; }
  .rig.try .eval { padding: 4px; margin: 0; }
  .rig.try .panel { padding: 10px 12px; }
  .rig.try .q { min-height: 0; font-size: 1.02rem; margin: 0 0 4px; }
  .rig.try .arc.big { max-width: 340px; }
  .rig.try .hint { margin: 4px 0 0; min-height: 0; font-size: .8rem; }
  .rig.try .run-actions { margin: 8px 0 0; }
}
/* CW-274 (CC-1290): /aidemo/run, the guided run. The stage line, the parameter of each clip play (above the puck and
   over the clip), and the end screen's three plays on one timeline. */
.run.guided { margin: 34px 0 0; }
.run-title { margin: 0 0 6px; }
.stage { color: var(--secondary); font-size: 1rem; margin: 0 0 14px; }
.param { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: var(--gold-text); margin: 0 0 4px; }
.param-tag { display: inline-block; background: var(--gold); color: #1A1A1A; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin: 0 0 8px; }
.clip3 { border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px; margin: 22px 0; }
.clip3-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; margin: 4px 0 10px; }
.clip3-legend .lg i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 7px 0 0; background: currentColor; }
.clip3-svg { width: 100%; height: 160px; display: block; }
.clip3-svg .mid { stroke: var(--rule); stroke-width: 1; }
.clip3-svg polyline { fill: none; stroke-width: 2.4; stroke-linejoin: round; }
.clip3-svg .p0, .clip3-legend .p0 { stroke: var(--gold); color: var(--gold-text); }
.clip3-svg .p1, .clip3-legend .p1 { stroke: var(--yes); color: var(--yes); }
.clip3-svg .p2, .clip3-legend .p2 { stroke: var(--no); color: var(--no); }
.clip3-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--secondary); font-variant-numeric: tabular-nums; margin: 4px 0 0; }
@media (max-width: 820px) {
  .run.guided { margin: 10px 0 0; }
  .run-title { font-size: 1.5rem; margin: 0 0 2px; }
  .stage { font-size: .88rem; margin: 0 0 8px; }
  .rig.try .param { font-size: 1.05rem; margin: 0 0 2px; }
  .rig.try .param-tag { margin: 0 0 4px; }
  .clip3-svg { height: 120px; }
}
.results h1[tabindex="-1"]:focus { outline: none; }   /* focus moves here for screen readers; no ring around the title */
