/* Agentrix WebAgent Platform · Brick 1 console and public pages.
   Tokens from concept/styles.css (Zavora lineage), plus a dark theme. Phone first; WCAG 2.2 AA.
   Fonts are the concepts' own, self-hosted by agentrix-ui under /static/ui/fonts (SIL OFL): no
   third-party font requests. Buttons follow the concepts: 12 px corners, indigo primary. */

@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/static/ui/fonts/manrope-latin-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-display: swap; font-weight: 100 1000; src: url(/static/ui/fonts/dm-sans-latin-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800; src: url(/static/ui/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light dark;
  --indigo: #38356d; --indigo-900: #1f1d3d; --indigo-100: #ecebf6; --indigo-50: #f6f6fb;
  --coral: #de4060; --coral-strong: #b72d50;
  --ink: #23223a; --ink-2: #4a4960; --muted: #5f5e73;
  --line: #e3e2ec; --line-strong: #cfcedd;
  --paper: #ffffff; --surface: #f6f6fa; --surface-2: #efeff5;
  --ok: #11734a; --ok-bg: #e6f5ee; --wait: #8a5300; --wait-bg: #fff4dd;
  --risk: #a3302a; --risk-bg: #fdecea; --info: #2f55c4; --info-bg: #eaf0ff;
  --sealed: #3b3a78; --sealed-bg: #eeedfb;
  --head: var(--indigo-900); --link: var(--indigo); --primary: var(--indigo); --on-primary: #fff;
  --font-display: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-12: .75rem; --fs-13: .8125rem; --fs-14: .875rem; --fs-16: 1rem; --fs-18: 1.125rem; --fs-20: 1.25rem; --fs-24: 1.5rem; --fs-32: 2rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 12px; --r-lg: 18px;
  --shadow-1: 0 1px 2px rgba(31,29,61,.06), 0 1px 1px rgba(31,29,61,.04);
  --shadow-2: 0 8px 24px -10px rgba(31,29,61,.18), 0 2px 6px rgba(31,29,61,.06);
  --focus: 0 0 0 3px rgba(222,64,96,.45);
}
/* Dark: AA contrast on every text token against --paper and --surface. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --indigo: #a9a6f0; --indigo-900: #e9e8ff; --indigo-100: #2a2850; --indigo-50: #1d1c38;
    --coral: #ff7a95; --coral-strong: #ff8aa2;
    --ink: #ecebf6; --ink-2: #c9c8dc; --muted: #a9a8bf;
    --line: #2e2d4a; --line-strong: #43425f;
    --paper: #17162c; --surface: #0f0e20; --surface-2: #1f1e38;
    --ok: #6fdcaa; --ok-bg: #12301f; --wait: #f2c46a; --wait-bg: #33260b;
    --risk: #ff9b93; --risk-bg: #3a1714; --info: #9db4ff; --info-bg: #182446;
    --sealed: #c3c1ff; --sealed-bg: #232251;
    --head: #f2f1ff; --link: #b9b6ff; --primary: #6b66c9; --on-primary: #ffffff;
    --shadow-1: none; --shadow-2: 0 8px 24px -12px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --indigo: #a9a6f0; --indigo-900: #e9e8ff; --indigo-100: #2a2850; --indigo-50: #1d1c38;
  --coral: #ff7a95; --coral-strong: #ff8aa2;
  --ink: #ecebf6; --ink-2: #c9c8dc; --muted: #a9a8bf;
  --line: #2e2d4a; --line-strong: #43425f;
  --paper: #17162c; --surface: #0f0e20; --surface-2: #1f1e38;
  --ok: #6fdcaa; --ok-bg: #12301f; --wait: #f2c46a; --wait-bg: #33260b;
  --risk: #ff9b93; --risk-bg: #3a1714; --info: #9db4ff; --info-bg: #182446;
  --sealed: #c3c1ff; --sealed-bg: #232251;
  --head: #f2f1ff; --link: #b9b6ff; --primary: #6b66c9; --on-primary: #ffffff;
  --shadow-1: none; --shadow-2: 0 8px 24px -12px rgba(0,0,0,.6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 var(--fs-16)/1.55 var(--font-text); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--coral-strong); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--head); margin: 0; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
h2 { font-size: var(--fs-20); }
h3 { font-size: var(--fs-16); }
p { margin: 0; }
/* Long domains and digests must wrap on a phone, never widen the page. */
h1, h2, h3, p, li, dd, summary { overflow-wrap: anywhere; }
.page > *, .stack > *, .card > *, .sheet > * { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--primary); color: var(--on-primary); }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-14); }
.mono { font-family: var(--font-mono); font-size: .92em; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Chrome ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 8px 16px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 800 var(--fs-18)/1 var(--font-display); color: var(--head); text-decoration: none; }
.brand i { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--coral), #38356d); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.page { width: min(100%, 760px); margin: 0 auto; padding: var(--s5) 16px var(--s7); display: grid; gap: var(--s5); }
.page.wide { width: min(100%, 1080px); }
.foot { padding: var(--s5) 16px calc(var(--s7) + 64px); text-align: center; font-size: var(--fs-13); color: var(--muted); }
.lead { font-size: var(--fs-18); color: var(--ink-2); }
.eyebrow { font: 700 var(--fs-12)/1.2 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--coral-strong); }
.stack { display: grid; gap: var(--s3); }
.row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; align-items: center; }

/* ---------- Controls (44 px targets, WCAG 2.5.8) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 700 var(--fs-14)/1 var(--font-text); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--indigo); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--risk); }
.btn-wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.field { display: grid; gap: 6px; font: 600 var(--fs-14)/1.3 var(--font-text); color: var(--ink-2); }
.field input, .field textarea, .field select { min-height: 48px; width: 100%; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 500 var(--fs-16)/1.3 var(--font-text); }
.field textarea { min-height: 96px; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--coral-strong); outline-offset: 1px; }
.hint { font-size: var(--fs-13); color: var(--muted); }
.error { padding: 10px 14px; border-radius: 12px; background: var(--risk-bg); color: var(--risk); font-weight: 600; }
.notice { padding: 10px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-weight: 600; }
.okline { padding: 10px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.waitline { padding: 10px 14px; border-radius: 12px; background: var(--wait-bg); color: var(--wait); font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 700 var(--fs-12)/1.3 var(--font-text); background: var(--surface-2); color: var(--ink-2); max-width: 100%; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.wait { background: var(--wait-bg); color: var(--wait); }
.chip.risk { background: var(--risk-bg); color: var(--risk); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.sealed { background: var(--sealed-bg); color: var(--sealed); }
.fixture { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; border: 1.5px dashed var(--wait); color: var(--wait); font: 700 var(--fs-12)/1.3 var(--font-text); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.tabs a, .tabs button { flex: 1; min-height: 40px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 700 var(--fs-14)/1.2 var(--font-text); text-decoration: none; cursor: pointer; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { background: var(--paper); color: var(--head); box-shadow: var(--shadow-1); }

/* ---------- Cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-1); display: grid; gap: var(--s3); }
.card.tight { gap: var(--s2); }
.card h2 { font-size: var(--fs-18); }
.card .from { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 700 var(--fs-13)/1.2 var(--font-text); color: var(--head); }
.card .from .chip { margin-left: auto; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: var(--fs-14); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.effects { margin: 0; padding: 12px 12px 12px 30px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; font-size: var(--fs-14); color: var(--ink-2); }
.effects-title { font: 700 var(--fs-12)/1 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- The mark: a squircle, never a circle (ADR-031). Brick 1 draws the static layers. ---------- */
.mark { --c: var(--indigo); --s: 32px; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: 30%; background: var(--c); color: #fff; font: 800 calc(var(--s) * .4)/1 var(--font-display); }
.mark.lg { --s: 40px; } .mark.sm { --s: 24px; }
.mark[data-state="waiting"]::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #b26b00; box-shadow: 0 0 0 2px var(--paper); }
.mark[data-state="working"]::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 2px; border-radius: 2px; background: var(--c); animation: trace 1s linear infinite; }
@keyframes trace { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .2; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { box-shadow: 0 0 0 2px #e9e7ff; } }
:root[data-theme="dark"] .mark { box-shadow: 0 0 0 2px #e9e7ff; }

/* ---------- Live receipt (Assess, the Move) ---------- */
.ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.tick { padding: 12px; border-radius: 14px; background: var(--sealed-bg); color: var(--sealed); }
.tick b { display: block; font: 800 var(--fs-24)/1.1 var(--font-display); color: var(--sealed); font-variant-numeric: tabular-nums; }
.tick span { font-size: var(--fs-13); font-weight: 600; }
@media (min-width: 640px) { .ticks { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.frame { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 9 / 16; max-height: 420px; }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.frame .label { position: absolute; left: 8px; top: 8px; }
.frame .empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); font-size: var(--fs-14); }
@media (min-width: 640px) { .frame { aspect-ratio: 16 / 10; } }

/* ---------- Findings ---------- */
.finding { display: grid; gap: 6px; }
.finding .sev { justify-self: start; }
.finding details { font-size: var(--fs-14); color: var(--ink-2); }
.finding summary { cursor: pointer; font-weight: 700; color: var(--link); min-height: 32px; display: flex; align-items: center; }
.evidence { margin: 6px 0 0; padding: 10px; border-radius: 10px; background: var(--surface-2); font: 500 var(--fs-13)/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* ---------- The Move ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step .dot { width: 22px; height: 22px; margin-top: 1px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--paper); }
.step[data-state="done"] .dot { background: var(--ok); border-color: var(--ok); }
.step[data-state="running"] .dot { border-color: var(--info); background: var(--info-bg); animation: trace 1.2s ease-in-out infinite; }
.step[data-state="waiting"] .dot { border-color: var(--wait); background: var(--wait-bg); }
.step[data-state="failed"] .dot { border-color: var(--risk); background: var(--risk-bg); }
.step b { display: block; color: var(--head); }
.step .what { font-size: var(--fs-14); color: var(--ink-2); }
.step .took { font: 600 var(--fs-13)/1.4 var(--font-mono); color: var(--muted); white-space: nowrap; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }

/* ---------- Decisions, ladder ---------- */
.levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.levels li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: var(--fs-14); }
.levels li[aria-current="true"] { border-color: var(--indigo); background: var(--indigo-50); font-weight: 700; color: var(--head); }
.levels li.locked { color: var(--muted); background: var(--surface); border-style: dashed; }
.levels li.locked::before { content: "🔒"; font-size: 12px; }
.levels .why { margin-left: auto; font-size: var(--fs-12); color: var(--muted); text-align: right; }
.fp { font: 500 var(--fs-13)/1.5 var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; }
.sheet { display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--r-lg); background: var(--indigo-50); border: 1px solid var(--indigo-100); }

/* ---------- Console shell: bottom nav on phones, side nav from 900 px ---------- */
.console { min-height: 100vh; }
.c-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--paper); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
.c-nav a { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding-top: 6px; border-radius: 10px; color: var(--muted); font: 700 11px/1.2 var(--font-text); text-decoration: none; }
.c-nav a svg { width: 22px; height: 22px; }
.c-nav a[aria-current="page"] { color: var(--head); background: var(--indigo-50); }
.c-nav .badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--coral-strong); color: #fff; font: 800 10.5px/18px var(--font-text); text-align: center; }
.site-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font: 700 var(--fs-14)/1.2 var(--font-text); color: var(--head); }
.site-chip small { display: block; font-weight: 500; color: var(--muted); font-size: var(--fs-12); }
@media (min-width: 900px) {
  .console { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .c-nav { position: sticky; top: 56px; height: calc(100vh - 56px); grid-template-columns: 1fr; align-content: start; gap: 4px; border-top: 0; border-right: 1px solid var(--line); padding: 16px 12px; }
  .c-nav a { grid-template-columns: 22px 1fr; justify-items: start; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; font-size: var(--fs-14); }
  .c-nav .badge { position: static; margin-left: auto; }
  .foot { padding-bottom: var(--s6); }
}
