/* ═══════════════════════════════════════════════════════════════════════
   Relay — Modernist design system.

   Ported from the Claude Design artifact. Tokens and component classes are
   verbatim from that system; the block at the bottom adds only what this app
   needs and the design didn't cover (log console, prompt banner, rule editor).

   Deliberately light-only: the source design ships no dark variant, and a
   hand-invented one would drift from it on the next update.
   ═══════════════════════════════════════════════════════════════════════ */

/* Archivo, self-hosted — no CDN, so the app still renders offline. One
   variable file per subset covers 400/600/800. */
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 100 900;
  font-stretch: 100%; font-display: swap;
  src: url('/static/fonts/archivo-latin.woff2') format('woff2');
  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: 'Archivo'; font-style: normal; font-weight: 100 900;
  font-stretch: 100%; font-display: swap;
  src: url('/static/fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 100 900;
  font-stretch: 100%; font-display: swap;
  src: url('/static/fonts/archivo-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
    U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329,
    U+1EA0-1EF9, U+20AB;
}

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #ec3013;
  --color-accent-2: #e15b47;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #fff2ef;
  --color-accent-200: #ffe0d9;
  --color-accent-300: #ffc4b8;
  --color-accent-400: #ff9783;
  --color-accent-500: #ff563c;
  --color-accent-600: #dd2b0f;
  --color-accent-700: #ae1800;
  --color-accent-800: #7c1405;
  --color-accent-900: #4d170e;

  --color-accent-2-100: #fff2ef;
  --color-accent-2-200: #ffe0da;
  --color-accent-2-300: #ffc4b9;
  --color-accent-2-400: #ff9784;
  --color-accent-2-500: #ef6853;
  --color-accent-2-600: #c94b39;
  --color-accent-2-700: #9e3526;
  --color-accent-2-800: #71261b;
  --color-accent-2-900: #471d16;

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

  /* Status roles. The system has one accent, but a run has outcomes that must
     read apart at a glance, so these are pinned to ramp steps rather than
     invented: success borrows the neutral ink, trouble the accent. */
  --color-ok: #2f6b45;
  --color-ok-bg: #e8f1ea;
  --color-warn: #8a5a00;
  --color-warn-bg: #fdf1da;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400;
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; letter-spacing: -0.035em; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
code { font-family: var(--font-mono); font-size: .92em; }
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.small { font-size: 13px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr { height: 2px; border: 0; margin: var(--space-4) 0; background: var(--color-divider); }

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-600); }
.btn-primary:active:not(:disabled) { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active:not(:disabled) { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-sm { font-size: 12px; padding: 4px 8px; }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
select.input { min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--color-accent); width: 15px; height: 15px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md);
  background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 17px; line-height: 1.2; }
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px; white-space: nowrap;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
.tag-ok { background: var(--color-ok-bg); color: var(--color-ok); }
.tag-warn { background: var(--color-warn-bg); color: var(--color-warn); }

/* — board picker, next to Run — */
.run-boards { display: flex; gap: 6px; align-items: center; }
.run-chip {
  font: inherit; font-size: 11px; letter-spacing: 0.02em;
  padding: 3px 10px; white-space: nowrap; cursor: pointer;
  border-radius: calc(var(--radius-md) * 0.75);
  border: 1px solid transparent;
  background: var(--color-neutral-100); color: var(--color-neutral-800);
}
/* Selected has to read as ON at a glance — this is the control that decides
   where real applications go. */
.run-chip[aria-pressed="true"] {
  background: var(--color-accent-100); color: var(--color-accent-800);
  border-color: var(--color-accent);
}
.run-chip:disabled { cursor: not-allowed; opacity: .5; }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: 14px 40px; border-bottom: 2px solid var(--color-divider);
  background: var(--color-bg); position: sticky; top: 0; z-index: 20;
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto; letter-spacing: -0.04em;
}
.nav nav { display: flex; gap: 22px; margin-right: 32px; min-width: 0; flex-wrap: wrap; row-gap: 6px; }
.nav a { color: inherit; text-decoration: none; font-size: 14px; cursor: pointer; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }
.nav-count { font-size: 11px; color: var(--color-accent); font-weight: 800; }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 2px solid var(--color-divider);
}
.table td { padding: var(--space-2); border-bottom: 1px solid var(--color-divider); }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.table .tick { width: 34px; }

/* ═══ Relay app layout ═══ */

.shell { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

.status-dot { width: 8px; height: 8px; background: var(--color-neutral-400); display: block; }
.status-dot.running { background: var(--color-accent); animation: pulse 1.6s ease-in-out infinite; }
.status-dot.waiting { background: var(--color-warn); animation: pulse .9s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.status-block {
  display: flex; align-items: center; gap: 10px;
  border-left: 1px solid var(--color-divider); padding-left: 20px;
}
.status-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }

/* Page header: kicker, headline, actions pinned right. */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-6); padding: 36px 40px 22px; flex-wrap: wrap;
}
.page-head h6 { color: var(--color-accent); margin: 0 0 8px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 8px 0 0; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* The stat strip — big numerals divided by rules, no card chrome. */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 2px solid var(--color-divider); }
.cell { padding: 20px 24px; border-right: 1px solid var(--color-divider); }
.cell:last-child { border-right: 0; }
.statnum { font-family: var(--font-heading); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.statlabel { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 10px; color: var(--color-neutral-700); }
.statnote { font-size: 12px; margin-top: 4px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.split { display: grid; grid-template-columns: 1.6fr 1fr; }
.split > * { min-width: 0; }
.split > :first-child { border-right: 1px solid var(--color-divider); }
@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
  .split > :first-child { border-right: 0; border-bottom: 1px solid var(--color-divider); }
}
.pane { padding: 24px 40px; }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-3); }
.section { padding: 0 40px 40px; }
.section + .section { padding-top: 8px; }

/* Prompt banner — the one thing that must interrupt you wherever you are. */
.prompt {
  display: flex; gap: var(--space-4); align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding: 20px 40px;
  background: var(--color-accent); color: var(--color-bg);
  border-bottom: 2px solid var(--color-accent-700);
}
.prompt h4 { margin: 0 0 4px; color: var(--color-bg); }
.prompt-kind { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: .8; margin-bottom: 6px; }
.prompt-body { flex: 1 1 24rem; }
.prompt-body p { margin: 0; font-size: 14px; }
.prompt-raw { font-size: 12px; opacity: .75; margin-top: 6px !important; font-family: var(--font-mono); }
.prompt-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.prompt .btn-primary { background: var(--color-bg); color: var(--color-accent); }
.prompt .btn-primary:hover:not(:disabled) { background: var(--color-accent-100); }
.prompt .btn-secondary { border-color: color-mix(in srgb, #f3f2f2 55%, transparent); color: var(--color-bg); }
.prompt .btn-secondary:hover:not(:disabled) { background: color-mix(in srgb, #f3f2f2 18%, transparent); }

/* Paywall banner. Shares the prompt's shape — same place, same rhythm — but
   deliberately NOT its accent red. A stopped run is an alarm; needing to pay is
   not, and dressing a billing message as an emergency reads as a threat. */
.paywall {
  display: flex; gap: var(--space-4); align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding: 20px 40px;
  background: var(--color-neutral-100); color: var(--color-text);
  border-bottom: 2px solid var(--color-divider);
}
.paywall h3 { margin: 0 0 4px; font-size: 18px; }
.paywall-kind {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  opacity: .7; margin-bottom: 6px;
}
.paywall-body { flex: 1 1 24rem; }
.paywall-body p { margin: 0; font-size: 14px; }
.paywall-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Live transcript — the only monospace surface in the app. Sits on the system's
   own surface tone rather than a terminal black: everything else here is light,
   and an idle run shouldn't leave a slab of void on the page. */
.log {
  min-height: 180px; max-height: 56vh; overflow: auto; padding: 14px 16px;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-divider);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.log .l { display: block; }
.log .ts { color: color-mix(in srgb, var(--color-text) 40%, transparent); margin-right: 10px; }
.log .ok { color: var(--color-ok); }
.log .warn { color: var(--color-warn); }
.log .err { color: var(--color-accent-700); }
.log .step { font-weight: 600; }
.log .say { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
/* Placeholder lives inside the scroller so it scrolls away with the first line. */
.log-empty {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 150px; text-align: center;
  font-family: var(--font-body); font-size: 14px;
  color: color-mix(in srgb, var(--color-text) 45%, transparent);
}
.log-empty b { font-family: var(--font-heading); font-weight: 800; display: block; margin-bottom: 4px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }

.kv { display: flex; justify-content: space-between; gap: var(--space-4); padding: 7px 0; border-bottom: 1px solid var(--color-divider); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.kv b { font-family: var(--font-heading); }

.queue { max-height: 340px; overflow-y: auto; }
.queue .j { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--color-divider); }
.queue .j.done { color: color-mix(in srgb, var(--color-text) 40%, transparent); text-decoration: line-through; }
.queue .j.now { color: var(--color-accent); font-weight: 600; }
.queue .u { font-size: 10px; letter-spacing: .08em; color: var(--color-accent); }

.empty { color: color-mix(in srgb, var(--color-text) 50%, transparent); font-size: 14px; padding: var(--space-3) 0; }

/* Config + résumé editors */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3) var(--space-6); }
.rows { display: flex; flex-direction: column; gap: var(--space-2); }
.row-edit { display: flex; gap: var(--space-2); align-items: center; }
.row-edit .input { flex: 1 1 0; }
.row-edit .ord { font-family: var(--font-heading); font-weight: 800; font-size: 13px; width: 18px; text-align: center; color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.row-edit.hit { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.row-edit .words { flex: 2 1 0; }
.rule-warn { font-size: 12px; color: var(--color-warn); margin: -2px 0 4px 26px; }
.verdict { font-size: 14px; }
.verdict b { color: var(--color-accent); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--color-neutral-900); color: var(--color-neutral-100);
  padding: 10px 18px; box-shadow: var(--shadow-lg); z-index: 50; font-size: 14px;
}
.toast.err { background: var(--color-accent-700); }

[hidden] { display: none !important; }
.panel { display: none; }
.panel.active { display: block; }


/* ══════════════════════════════════════════════════════════════════════════
   Cloud additions.

   Everything above this line is the LOCAL app's stylesheet, copied verbatim so
   both cockpits look identical — porting the markup but re-deriving the CSS is
   how two "same" designs drift apart. Only what the cloud has and the local app
   doesn't is defined below: the signed-out gate, pairing, and the résumé/role
   editors.
   ══════════════════════════════════════════════════════════════════════════ */

/* The `hidden` attribute works only through a UA rule that any author
   `display` declaration outranks — and `.btn { display: flex }` does, which
   left hidden buttons on screen. Restate it with enough weight to win. */
[hidden] { display: none !important; }

/* ---------------------------------------------------- signed-out screens */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 26rem; background: #fff;
  border-top: 3px solid var(--color-accent);
  padding: 32px; display: grid; gap: 14px;
}
.gate-brand { font-weight: 800; letter-spacing: .18em; font-size: .8125rem; }
.gate-brand .dot { color: var(--color-accent); }
.gate-card h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.gate-detail {
  margin: 0; font-size: .8125rem; line-height: 1.5; text-align: left;
  border-left: 3px solid var(--color-accent);
  background: #fff2ef; padding: 10px 12px;
}
.gate-steps { margin: 0; padding-left: 1.1rem; font-size: .875rem; color: #605d5d; }
.gate-steps li { margin-bottom: 6px; }
.gate-or {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; color: #9b9797; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .1em;
}
.gate-or::before, .gate-or::after { content: ""; height: 1px; background: #d7d3d3; }
.gate-row { display: flex; justify-content: space-between; gap: 12px; }
.btn-wide { width: 100%; justify-content: center; }
#form-email { display: grid; gap: 12px; }

.linkish {
  background: none; border: 0; padding: 0; font: inherit; font-size: .8125rem;
  color: #605d5d; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.linkish:hover { color: var(--color-accent); }

.note { margin: 0; padding: 10px 12px; font-size: .8125rem; border-left: 3px solid; }
.note-err { background: #fff2ef; border-color: var(--color-accent); }
.note-ok { background: #eef7f2; border-color: #1f7a4d; }

/* ------------------------------------------------------ signed-in extras */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 14px; font-size: .8125rem;
}
.avatar { width: 22px; height: 22px; border-radius: 50%; }

.dropzone {
  display: block; border: 1px dashed #bab6b6; padding: 28px; text-align: center;
  cursor: pointer; color: #605d5d; font-size: .9375rem; margin-bottom: 14px;
}
.dropzone:hover, .dropzone.dz-over {
  background: #fff2ef; border-color: var(--color-accent); color: #201e1d;
}

.filelist, .rolelist { list-style: none; margin: 0 0 14px; padding: 0; }
.filelist li, .rolelist li {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid #eae9e9; font-size: .875rem;
}
.rolelist li strong { min-width: 11rem; }
.filelist li > :last-child, .rolelist li > :last-child { margin-left: auto; }

.filterbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px;
}
.chip {
  font: inherit; font-size: .8125rem; font-weight: 600; padding: 4px 12px;
  border: 1px solid #d7d3d3; background: #fff; cursor: pointer; color: #605d5d;
}
.chip:hover { border-color: var(--color-accent); }
.chip.chip-on {
  background: var(--color-accent); border-color: var(--color-accent); color: #fff;
}
.filterbar .small { margin-left: auto; }

.token-row { display: flex; gap: 8px; align-items: stretch; margin: 10px 0 14px; }
.token {
  flex: 1; min-width: 0; background: #eae9e9; padding: 10px 12px;
  font-family: ui-monospace, Consolas, monospace; font-size: .8125rem;
  /* A token is one long unbroken string; without this it scrolls the page. */
  overflow-wrap: anywhere; user-select: all;
}

/* The status block now also carries the user chip; let it wrap before the
   nav collides with it on a narrow window. */
@media (max-width: 60rem) {
  .nav { flex-wrap: wrap; row-gap: 10px; }
  .user-chip { margin-left: 0; }
}

/* ---- design-system pieces the local sheet didn't need ---- */

/* Segmented filter, from the artifact's Queue and Tracker headers. */
.seg { display: inline-flex; border: 1px solid var(--color-divider); }
.seg-opt {
  position: relative; cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 7px 14px;
  color: var(--color-neutral-700); border-right: 1px solid var(--color-divider);
}
.seg-opt:last-child { border-right: 0; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:hover:not(:has(input:checked)) { background: var(--color-neutral-200); }

/* Full-bleed list rows, ruled rather than boxed — the system uses rules,
   not card borders. */
.row-rule { border-bottom: 1px solid var(--color-divider); }
.row-rule:hover { background: var(--color-neutral-100); }

.radio { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.radio input { accent-color: var(--color-accent); width: 15px; height: 15px; }

/* Page furniture: the artifact pads pages itself rather than using a card. */
.pg { padding: 36px 40px 22px; }
.pg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pg h1 { margin: 0; letter-spacing: -.035em; }
.pg h6 { color: var(--color-accent); margin: 0 0 8px; }
.pg-sub { margin: 8px 0 0; font-size: 14px; }
.pad { padding: 28px 40px; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; }
.split-2 > :first-child { border-right: 1px solid var(--color-divider); }
.split-16 { display: grid; grid-template-columns: 1.6fr 1fr; }
.split-16 > :first-child { border-right: 1px solid var(--color-divider); }
.tint { background: var(--color-surface); }

.strip {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-bottom: 2px solid var(--color-divider); border-top: 2px solid var(--color-divider);
}
.strip-4 { grid-template-columns: repeat(4, 1fr); }
.statlbl {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  margin-top: 10px; color: var(--color-neutral-700);
}
.statdelta { font-size: 12px; margin-top: 4px; }

/* Role throughput / progress bars. */
.bar { height: 8px; background: var(--color-neutral-200); }
.bar > i { display: block; height: 8px; background: var(--color-accent); }

/* Role cards, two per row, ruled. */
.rolegrid { display: grid; grid-template-columns: repeat(2, 1fr); }
.rolecard {
  padding: 24px 40px;
  border-bottom: 1px solid var(--color-divider);
  border-right: 1px solid var(--color-divider);
}
.rolecard h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.rolestats { display: flex; gap: 28px; padding-top: 12px; border-top: 1px solid var(--color-divider); }
.rolestats b { font-family: var(--font-heading); font-weight: 800; font-size: 20px; display: block; }
.rolestats span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

/* Board rows with the square initial badge. */
.board-initial {
  width: 44px; height: 44px; background: var(--color-neutral-200);
  display: grid; place-items: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 18px;
}

/* Résumé card: the parsed summary, boxed because it stands in for a document. */
.doc { border: 2px solid var(--color-divider); padding: 20px 22px; background: var(--color-surface); }
.doc-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--color-divider); font-size: 13px;
}
.doc-row .k { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }

.variant { padding: 16px 0; border-bottom: 1px solid var(--color-divider); }
.variant-sum { font-size: 13px; margin-top: 6px; padding-left: 14px; border-left: 2px solid var(--color-accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }

/* Answer bank entries. */
.qa { padding: 16px 0; border-bottom: 1px solid var(--color-divider); }
.qa-a { font-size: 14px; margin-top: 6px; }
.qa-src { font-size: 11px; margin-top: 6px; letter-spacing: .04em; text-transform: uppercase; }
.tx { margin-bottom: 20px; }
.tx-n { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--color-neutral-700); }
.tx-a { border-left: 2px solid var(--color-accent); padding: 6px 0 6px 14px; margin-top: 8px; font-size: 14px; }

/* Queue rows: company | role | progress | status. */
.qrow {
  display: grid; grid-template-columns: 220px 1fr 260px 170px;
  gap: 24px; padding: 20px 40px; align-items: center;
}
.qsteps { display: flex; align-items: center; gap: 6px; }
.qsteps i { flex: 1; height: 4px; background: var(--color-neutral-300); }
.qsteps i.on { background: var(--color-accent); }
.qstage {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  margin-left: 6px; min-width: 78px;
}

@media (max-width: 68rem) {
  .split-2, .split-16, .rolegrid { grid-template-columns: 1fr; }
  .split-2 > :first-child, .split-16 > :first-child { border-right: 0; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .qrow { grid-template-columns: 1fr; gap: 10px; }
  .pg, .pad, .rolecard { padding-left: 20px; padding-right: 20px; }
}
