/* 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). A neutral palette: never the buyer's logo or colours ("<Buyer> branding applied on award").
   A demo may change ONLY --accent / --accent-ink / --accent-soft (both themes), and must keep 4.5:1 contrast.
   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;
  --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;
  --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;
}
[data-theme="dark"] {
  --bg: #0c0e11; --surface: #15181d; --surface2: #1c2026; --ink: #eef0f3; --muted: #a6adb8; --line: #2a2f37;
  --accent: #a9b4ff; --accent-ink: #0c0e11; --accent-soft: #232a52;
  --ok: #5fd88f; --ok-soft: #12301f; --late: #ff9a8a; --late-soft: #3a1712; --warn: #ffd27a; --warn-soft: #33270b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
*, *::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%; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: .25rem; }
.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(--ink); color: var(--bg); 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); color: var(--accent-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(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.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 .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(--ink); }
.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(--surface2); 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; } }
.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(--ink); 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; } }
