/* LOOK: a NEUTRAL BASE only (Rob 11-10 ~3:00 PM ET: "AI is really good at, on its own, building a beautiful design...
   when you Frankenstein after the fact, it tends to struggle"). The look of a demo is DESIGNED PER DEMO in its own
   app.css from the buyer's site (palette + logo + their screenshot: protokit.py theme), PROTOTYPE.md s5.
   SUPERSEDED: "the look kit, painted per buyer with tokens" and THE BRAND COLOUR DOMINATES (filled bars, hero band,
   accent rules; 2:30 PM): Rob 2:57 PM "That looks awful". */
/* LAYER 3: THE LOOK PIECES. Pulled from the Wave demo (projects/wave/code/api/wwwroot/app.css, 11-10, 0 axe violations
   on 96 views). Neutral greys underneath; the BUYER'S COLOURS go on top through the brand + accent tokens below,
   written by `protokit.py theme DIR --from <buyer url>` into DIR/theme.css (Rob 11-10: "use their colors"). Never their logo.
   SUPERSEDED (Rob 11-10 ~1:55 PM ET): "a neutral palette: never the buyer's logo or colours ... a demo may change ONLY
   --accent". Colours now come from the buyer; the logo rule stands. Every text pair keeps 4.5:1 contrast.
   Unthemed, --brand falls back to the ink (the old black-and-white look).
   Sizes in rem, so every box grows with the reader's text size. Type is fluid: clamp(rem, rem + vw, rem). */
:root {
  --bg: #f6f6f4; --surface: #ffffff; --surface2: #f0f1f3; --ink: #111418; --muted: #545b66; --line: #dfe2e6;
  --accent: #3442b8; --accent-ink: #ffffff; --accent-soft: #e9ebfb;
  --brand: var(--ink); --brand-ink: var(--bg); --brand-text: var(--ink); --brand-soft: var(--surface2);
  --accent-fill: var(--accent); --accent-fill-ink: var(--accent-ink);
  --ok: #0a6b33; --ok-soft: #e3f4ea; --late: #a8200d; --late-soft: #fdeceb; --warn: #7a4b00; --warn-soft: #fff3d6;
  --shadow: 0 1px 2px rgba(16, 20, 24, .06), 0 4px 16px rgba(16, 20, 24, .06);
  --r: 1rem; --r-sm: .625rem;
  /* THE SPACING SCALE: a demo's own app.css spaces boxes with these only (protokit check: static), never ad-hoc rems.
     Also the names Tourney's layout.css reads (--space-*), so the live copy of it works here unchanged. */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step-0: clamp(1rem, .96rem + .2vw, 1.0625rem);
  --step-1: clamp(1.1rem, 1.02rem + .35vw, 1.25rem);
  --step-3: clamp(1.6rem, 1.25rem + 1.6vw, 2.4rem);
  --step-n: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  color-scheme: light;
}
/* LIGHT MODE ONLY (Rob 11-10 ~9:30 PM ET: "I think light mode looks better ... a new standard for all going forward"):
   SUPERSEDED the [data-theme="dark"] token block (deleted from the kit; demogates.py lightonly FAILs a demo that has one). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--step-0)/1.5 var(--font); overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
/* every picture, map and chart sits in a box of fixed shape before it loads (HOLD THE SPACE): give an <img> its
   width/height attributes, or wrap it in .box-media (default 16:9; set --ratio) */
img { height: auto; }
.box-media { display: block; inline-size: 100%; aspect-ratio: var(--ratio, 16 / 9); background: var(--surface2); border-radius: var(--r); overflow: hidden; }
.box-media > img, .box-media > iframe, .box-media > canvas { inline-size: 100%; block-size: 100%; object-fit: cover; border: 0; display: block; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: .25rem; }
[tabindex="-1"]:focus,[tabindex="-1"]:focus-visible { outline: none; } /* Rob 11-10 4:11 PM: a heading focused by the router (screen readers) never shows a ring; real controls keep :focus-visible */
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { line-height: 1.2; margin: 0; overflow-wrap: break-word; }
h1 { font-size: var(--step-3); letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: var(--step-1); font-weight: 750; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 60ch; }

/* card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }

/* buttons, chips, pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .55rem 1.1rem;
  border-radius: .8rem; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font-weight: 700; cursor: pointer;
  text-decoration: none; text-align: center; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.accent { background: var(--accent-fill); color: var(--accent-fill-ink); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 2.25rem; padding: .35rem .8rem; font-size: .9rem; border-radius: .65rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .45rem .85rem; cursor: pointer;
  font-size: .92rem; min-height: 2.5rem; color: var(--ink); }
.chip:hover { border-color: var(--brand-text); }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pill { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .12rem .5rem; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.late { background: var(--late-soft); color: var(--late); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.muted { background: var(--surface2); color: var(--muted); }
.pill.sample { background: var(--accent-soft); color: var(--accent); }

/* number tiles: the numbers up front */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; display: flex;
  flex-direction: column; gap: .1rem; text-decoration: none; color: var(--ink); min-width: 0; }
.tile { min-block-size: 6.75rem; }
.tile .n { font-size: var(--step-n); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { font-size: .9rem; font-weight: 600; }
.tile .s { font-size: .8rem; color: var(--muted); }

/* task links: the "what do you need" grid */
.task { display: flex; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: .85rem 1rem; text-decoration: none; color: var(--ink); font-weight: 700; min-height: 3.75rem; min-width: 0; }
.task:hover { border-color: var(--brand-text); }
.task small { display: block; font-weight: 500; color: var(--muted); font-size: .82rem; }
.ic { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.ic svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* lists and link rows */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .75rem 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.linkrow { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.linkrow:first-child { border-top: 0; }
.linkrow .grow { flex: 1 1 auto; min-width: 0; }
/* the icon gives way when the row is under 12em (= its text size): at 360px x 200% text a 2.4rem icon left the title
   89px and a 2-line row grew 627px tall, taller than the room above the pinned bar (HAC pilot 11-10, review D1) */
.linkrow { container: linkrow / inline-size; }
@container linkrow (max-width: 12em) { .linkrow > .ic { display: none; } }
/* a row with a right-side label (a status pill, a count) WRAPS instead of spilling: the title keeps at least 9em and the
   label drops under it when the row is narrower (320 px at 200% text spilled 2-27 px per row, arian prototype 11-11) */
.linkrow { flex-wrap: wrap; row-gap: .25rem; }
.linkrow > .grow { flex: 1 1 9em; }
.linkrow .t { font-weight: 700; }
.linkrow .sub { font-size: .85rem; color: var(--muted); }
.linkrow:hover .t { text-decoration: underline; }
.chev { flex: none; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: .3rem; min-height: 2.75rem; font-weight: 650; text-decoration: none; }

/* alerts */
.alert { display: flex; gap: .75rem; align-items: flex-start; border-radius: var(--r); padding: .85rem 1rem; background: var(--warn-soft);
  color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.alert.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* forms (few: defaults first) */
label { font-weight: 650; font-size: .95rem; display: block; margin-bottom: .3rem; }
.input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: .7rem; padding: .65rem .75rem; min-height: 2.75rem; }
textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
.hint { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: .4rem; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: .8rem; padding: .2rem; background: var(--surface2); max-width: 100%; }
.seg a, .seg button { border: 0; background: transparent; padding: .45rem .9rem; border-radius: .6rem; font-weight: 650; cursor: pointer; color: var(--muted); text-decoration: none; min-height: 2.5rem; display: inline-flex; align-items: center; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* bars (a chart that needs no library and reads as text) */
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.bars li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.bars .lab { flex: 1 1 8rem; min-width: 0; font-weight: 600; }
.bars .track { flex: 999 1 10rem; height: .75rem; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.bars .fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bars .val { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }

/* table: always inside a sideways scroller, never wider than the screen */
.tablewrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .55rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 700; }

/* timeline (status history) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: .4rem 0 .4rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: .45rem; top: 0; bottom: 0; width: .2rem; background: var(--line); }
.timeline li::after { content: ""; position: absolute; left: .2rem; top: .85rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }

/* the ask box: one line, chips, a labelled answer */
.ask { display: flex; flex-wrap: wrap; gap: .5rem; background: var(--surface); border: 2px solid var(--brand-text); border-radius: 1.1rem; padding: .35rem; box-shadow: var(--shadow); }
.ask input { flex: 999 1 12rem; min-width: 0; border: 0; background: transparent; padding: .7rem .75rem; font-size: var(--step-1); outline: none; }
.ask .btn { flex: 1 0 auto; }
.ask:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.ai-tag { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: .2rem .6rem; }
.answer:empty { display: none; }
.answer .say { font-size: var(--step-1); font-weight: 600; line-height: 1.45; }
.answer .src { font-size: .8rem; color: var(--muted); margin-top: .5rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
