/* Lab: the HQ look. Light paper, ink type, hairline rules, one accent per page; marks and numbers carry the meaning. */

@font-face { font-family: "Plex Sans"; font-weight: 300; font-display: swap; src: url("fonts/ibm-plex-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --gate: #a6a8aa; --gate-ink: #101112; --gate-line: rgba(16, 17, 18, 0.38); --gate-dim: rgba(16, 17, 18, 0.56); --gate-err: #6a1a0d;
  --paper: #ecedec; --surface: #f5f5f4; --ink: #131415; --ink-2: #4b4f53; --label: #6a6e72; --faint: #9a9ea1;
  --rule: #d2d4d5; --hair: #dfe0e0; --bar: #2a2d30; --track: #d9dbdb;
  --c-board: #2a78d6; --c-queue: #1baf7a; --c-team: #e87ba4; --c-compute: #6250d6; --c-skills: #131415;
  --good: #0ca30c; --warn: #fab219; --bad: #d03b3b;
  --good-ink: #08780a; --warn-ink: #8f5d00; --bad-ink: #b42f2f;
  --sans: "Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1); --ease-lift: cubic-bezier(0.76, 0, 0.24, 1);
}
@media (prefers-color-scheme: dark) {
  body.is-dash {
    --paper: #151617; --surface: #1c1d1f; --ink: #e8e9e9; --ink-2: #b2b5b7; --label: #8c9093; --faint: #5e6265;
    --rule: #2b2d2f; --hair: #222426; --bar: #d6d8d9; --track: #2e3032;
    --c-board: #3987e5; --c-queue: #199e70; --c-team: #d55181; --c-compute: #9085e9; --c-skills: #e8e9e9;
    --good-ink: #2fbf2f; --warn-ink: #fab219; --bad-ink: #e66767;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ic { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic-check { color: var(--good-ink); }
.ic-cross { color: var(--bad-ink); }
.ic-clock { color: var(--warn-ink); }
.ic-ring { color: var(--faint); }
.ic-crown { width: 22px; height: 15px; color: var(--accent, var(--ink)); }

/* ---------- faces ---------- */
.face { display: inline-grid; place-items: center; width: var(--fs, 24px); height: var(--fs, 24px); border-radius: 50%; flex: 0 0 auto;
  background: var(--surface); border: 1px solid var(--rule); color: var(--ink); font: 500 calc(var(--fs, 24px) * 0.38)/1 var(--mono); letter-spacing: 0.02em; vertical-align: middle; }
.face-empty { background: transparent; border: 1px dashed var(--faint); color: var(--faint); }

/* ---------- gate ---------- */
body.is-gate { background: var(--paper); color: var(--gate-ink); }
.gate { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--gate); transition: transform 720ms var(--ease-lift); }
.gate.is-open { transform: translateY(-100%); }
.gate-mid { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-box { width: min(400px, 100%); animation: rise 600ms var(--ease) both; }
.gate-mark { font: 500 11px/1 var(--mono); letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 44px; }
.gate-mark span { margin-left: 0.9em; color: var(--gate-dim); font-weight: 400; }
.gate-line { display: flex; align-items: center; gap: 12px; height: 56px; border-bottom: 1px solid var(--gate-line); transition: border-color 200ms ease; }
.gate-line:focus-within { border-bottom-color: var(--gate-ink); }
.gate-line.is-err { border-bottom-color: var(--gate-err); animation: shake 380ms ease; }
.gate-line input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font: 300 22px/1 var(--sans); color: var(--gate-ink); }
.gate-line input::placeholder { color: var(--gate-dim); opacity: 1; }
.gate-line input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--gate) inset; -webkit-text-fill-color: var(--gate-ink); }
.gate-line button { flex: 0 0 auto; height: 32px; padding: 0 2px; border: 0; background: transparent; font: 400 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gate-dim); }
.gate-line button:hover, .gate-line button:focus-visible { color: var(--gate-ink); outline: 0; }
.gate-faces { display: flex; flex-wrap: wrap; gap: 22px; animation: rise 420ms var(--ease) both; }
.gate-faces button, .who-faces button { display: grid; justify-items: center; gap: 10px; padding: 6px; border: 0; background: none; font: 400 11px var(--mono); letter-spacing: 0.08em; color: var(--gate-dim); }
.gate-faces button:hover .face, .gate-faces button:focus-visible .face { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gate-ink); }
.gate-faces .face { transition: transform 160ms var(--ease), box-shadow 160ms ease; }
.gate-faces button:focus-visible { outline: 0; }
.gate-status { min-height: 18px; margin-top: 14px; font: 400 12px/18px var(--mono); color: var(--gate-dim); }
.gate-status.is-err { color: var(--gate-err); }
.gate-foot { display: flex; justify-content: space-between; gap: 16px; padding: 22px 28px; font: 400 11px var(--mono); letter-spacing: 0.06em; color: var(--gate-dim); }

/* ---------- frame ---------- */
body.is-dash { background: var(--paper); color: var(--ink); }
.top { --gutter: clamp(16px, 3vw, 40px); display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px max(var(--gutter), calc((100% - 1560px) / 2 + var(--gutter))); border-bottom: 1px solid var(--rule); }
.brand { font: 500 11px/1 var(--mono); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { margin-left: 0.9em; color: var(--label); font-weight: 400; }
.nav { display: flex; gap: clamp(14px, 2vw, 28px); margin-right: auto; margin-left: clamp(20px, 3vw, 48px); }
.nav a { position: relative; padding: 6px 0; font: 400 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); text-decoration: none; transition: color 140ms ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -19px; height: 2px; background: var(--ink); }
.top-meta { display: flex; align-items: center; gap: 16px; font: 400 11px var(--mono); color: var(--label); }
.me { padding: 0; border: 0; background: none; border-radius: 50%; }
.me:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.linkish { font: 400 13px var(--mono); color: var(--label); text-decoration: none; }
.linkish:hover { color: var(--ink); }
.who { padding: 28px 32px; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); color: var(--ink); }
.who::backdrop { background: rgba(16, 17, 18, 0.32); }
.who-faces { display: flex; flex-wrap: wrap; gap: 20px; }
.who-faces button { color: var(--label); }
.who-faces button[aria-pressed="true"] .face { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.who-token { display: flex; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--hair); }
.who-token input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); font: 400 12px var(--mono); }
.who-token input:focus-visible { outline: 0; border-color: var(--ink); }
.who-note { max-width: 32ch; margin-top: 8px; font: 400 11px/1.5 var(--mono); color: var(--faint); }
.who-note.is-err { color: var(--bad-ink); }
.me.is-proven .face { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--good); }

.tone-board { --accent: var(--c-board); } .tone-queue { --accent: var(--c-queue); } .tone-team { --accent: var(--c-team); }
.tone-compute { --accent: var(--c-compute); } .tone-skills, .tone-docs { --accent: var(--c-skills); }
.dash { max-width: 1560px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px) 24px; }
.sec { padding: clamp(28px, 4vw, 44px) 0 clamp(32px, 4vw, 48px); animation: rise 560ms var(--ease) both; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: clamp(24px, 3vw, 36px); }
.sec-tools { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sec-note { font: 400 11px var(--mono); color: var(--faint); }
.kicker { display: flex; align-items: center; gap: 12px; font: 500 12px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
.kicker::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--accent, var(--ink)); }
.lbl { font: 400 10px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--label); }
.range { display: flex; gap: 2px; }
.rb { display: inline-flex; align-items: center; height: 28px; padding: 0 8px; border: 0; background: none; font: 400 11px var(--mono); color: var(--faint); text-decoration: none; box-shadow: inset 0 -2px 0 transparent; transition: color 140ms ease, box-shadow 140ms ease; }
.rb:hover { color: var(--ink-2); }
.rb[aria-current="true"], .rb[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent, var(--ink)); }
.btn-ink { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: var(--paper); font: 500 12px var(--mono); transition: opacity 140ms ease; }
.btn-ink:hover { opacity: 0.86; }
.btn-ink .ic { color: var(--paper); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--rule); border-radius: 2px; background: none; color: var(--ink-2); transition: border-color 140ms ease, color 140ms ease; }
.icon-btn:hover, .icon-btn:focus-visible { border-color: var(--ink); color: var(--ink); outline: 0; }
.icon-btn.is-done { border-color: var(--good); color: var(--good-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 11px; font: 400 11px var(--mono); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
a.chip[href]:hover { border-color: var(--ink); color: var(--ink); }
.chip .ic { width: 12px; height: 12px; vertical-align: 0; }
.chip-dim { color: var(--faint); }
.empty { padding: 24px 0; font: 400 12px var(--mono); color: var(--faint); }

/* ---------- board ---------- */
.crown { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; padding-top: 18px; border-top: 2px solid var(--accent); }
.crown .lbl { display: block; margin-bottom: 10px; }
.crown-num { display: flex; align-items: center; gap: 14px; font: 300 clamp(56px, 9vw, 120px)/0.95 var(--sans); letter-spacing: -0.045em; }
.crown-num small { align-self: flex-start; margin: 0.18em 0 0 -0.32em; font-size: 0.22em; letter-spacing: 0; color: var(--label); }
.crown-num .ic { width: clamp(26px, 3vw, 40px); height: clamp(26px, 3vw, 40px); stroke-width: 1.2; }
.crown-num.is-empty { color: var(--faint); }
.crown-ring .ic { width: clamp(26px, 3vw, 40px); height: clamp(26px, 3vw, 40px); }
.crown-who { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.crown-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.crown-side { padding-bottom: 6px; }
.side-num { font: 300 clamp(34px, 4.4vw, 56px)/1 var(--sans); letter-spacing: -0.035em; color: var(--ink-2); }
.side-num small { margin-left: 0.1em; font-size: 0.36em; color: var(--label); }
.crown-stats { display: flex; justify-content: flex-end; gap: clamp(16px, 2.4vw, 32px); padding-bottom: 8px; }
.crown-stats div { display: grid; justify-items: center; gap: 8px; }
.crown-stats dd { font-size: 20px; font-weight: 400; }

.steps-wrap { margin: clamp(36px, 4vw, 56px) 0 clamp(36px, 4vw, 52px); }
.steps { position: relative; height: clamp(140px, 18vh, 220px); }
.steps svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.steps .base { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.steps .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.steps .ln.dev { stroke-dasharray: 4 4; opacity: 0.55; stroke-width: 1.5; }
.steps .ln.ver { stroke: var(--good); }
.dots-layer { position: absolute; inset: 0; pointer-events: none; }
.dots-layer .pt { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--paper); }
.chart-axis { position: absolute; left: 0; right: 0; bottom: -22px; display: flex; justify-content: space-between; font: 400 10px var(--mono); color: var(--faint); }
.chart-peak { position: absolute; left: 0; top: -20px; font: 400 10px var(--mono); color: var(--faint); }
.chart-none { font: 400 11px var(--mono); color: var(--faint); }

.lb { border-top: 1px solid var(--rule); }
.lb-who { position: relative; display: inline-flex; }
.face-sub { position: absolute; right: -6px; bottom: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--paper); display: inline-flex; }
.lb-row { display: grid; grid-template-columns: 34px 22px 72px 64px minmax(0, 1fr) 30px minmax(70px, auto) 40px; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--hair); transition: background 120ms ease; }
.lb-row:hover { background: var(--surface); }
.lb-rank { font-size: 11px; color: var(--faint); text-align: right; }
.lb-mark { display: grid; place-items: center; }
.lb-score { font-size: 15px; color: var(--ink); text-align: right; }
.lb-held { font-size: 12px; color: var(--good-ink); text-align: right; }
.lb-label { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-ref { justify-self: end; }
.lb-age { font-size: 11px; color: var(--faint); text-align: right; }
.s-failed .lb-score, .s-failed .lb-label { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--rule); }
.lb-row:first-child .lb-score { font-weight: 500; }

/* ---------- queue ---------- */
.propose { display: grid; gap: 12px; margin-bottom: 26px; padding: 18px 0 20px; border-top: 2px solid var(--accent); border-bottom: 1px solid var(--rule); animation: rise 320ms var(--ease) both; }
.pf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.propose input, .propose select, .propose textarea { min-width: 0; padding: 8px 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; outline: 0; font-size: 15px; }
.propose input:focus, .propose textarea:focus, .propose select:focus { border-bottom-color: var(--ink); }
.propose input[name="title"] { flex: 1 1 320px; font-weight: 300; font-size: 20px; }
.propose input[name="command"] { flex: 1 1 360px; font-size: 13px; }
.propose textarea { width: 100%; resize: vertical; font-size: 14px; line-height: 1.5; }
.propose select { font: 400 12px var(--mono); }
.pf-short { flex: 0 1 140px; font-size: 13px !important; } .pf-tiny { flex: 0 0 64px; font-size: 13px !important; }
.pf-status { min-height: 16px; font-size: 11px; color: var(--bad-ink); }
.check { display: inline-flex; align-items: center; gap: 6px; font: 400 12px var(--mono); color: var(--ink-2); }
.check input { accent-color: var(--ink); }

.q { border-top: 1px solid var(--rule); }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 18px; border-bottom: 1px solid var(--hair); }
.q-head { display: grid; grid-template-columns: 10px minmax(0, 1fr) 26px minmax(0, auto); align-items: center; gap: 14px; min-width: 0; padding: 14px 0; border: 0; background: none; text-align: left; }
.q-head:focus-visible { outline: 1px solid var(--ink); outline-offset: -1px; }
.q-dot, .q-dot.st-ready { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--c-queue)); }
.st-proposed .q-dot, .q-dot.st-proposed { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.st-running .q-dot, .q-dot.st-running { background: var(--c-board); animation: beat 1.6s ease-in-out infinite; }
.st-done .q-dot, .q-dot.st-done { background: var(--faint); }
.st-failed .q-dot { background: var(--bad); }
.q-title { min-width: 0; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.q-title .ic { margin-right: 8px; }
.q-title small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--faint); }
.q-state { font-size: 11px; color: var(--label); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.st-done .q-title, .st-failed .q-title { color: var(--ink-2); }
.q-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 10px 0; }
.chip-res { display: inline-flex; align-items: baseline; gap: 7px; height: 28px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 14px; background: none; font: 400 11px/26px var(--mono); color: var(--ink-2); white-space: nowrap; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.chip-res b { font-weight: 500; color: var(--ink); }
.chip-res em { font-style: normal; color: var(--label); }
button.chip-res:not(:disabled):hover { border-color: var(--ink); }
.chip-res.is-on { border-color: var(--accent, var(--ink)); background: color-mix(in oklab, var(--accent, var(--ink)) 12%, transparent); }
.chip-res:disabled { opacity: 0.55; cursor: default; }
.chip-res.is-static { cursor: default; }
.chip-res.is-live b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--good); vertical-align: 1px; }
.q-body { grid-column: 1 / -1; padding: 0 0 22px 24px; animation: fade 220ms ease both; }
.q-desc { max-width: 84ch; font-size: 14px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; }
.q-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 26px; margin-top: 16px; }
.q-facts .wide { grid-column: 1 / -1; }
.q-facts dt { font: 400 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.q-facts dd { margin-top: 4px; font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }
.is-verify .q-title { color: var(--good-ink); }

/* ---------- team and compute ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.card { padding: 18px 0 20px; border-top: 2px solid var(--accent); }
.pc-top { display: flex; align-items: center; gap: 14px; }
.pc-name { font: 300 22px/1.1 var(--sans); letter-spacing: -0.01em; }
.pc-git { margin-top: 4px; font-size: 11px; color: var(--faint); }
.pc-stats { display: flex; gap: 22px; margin: 22px 0 18px; }
.pc-stats div { display: grid; justify-items: start; gap: 6px; }
.pc-stats dt { height: 16px; display: grid; align-items: center; }
.pc-stats dd { font-size: 20px; }
.pc-res { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-run { margin-top: 14px; display: grid; gap: 6px; }
.pc-run li { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rc-name { display: flex; align-items: center; gap: 10px; font: 300 26px/1 var(--sans); letter-spacing: -0.02em; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.is-live .live { background: var(--good); }
.rc-owners { display: flex; gap: 4px; }
.rc-hw { margin-top: 8px; font-size: 11px; color: var(--label); }
.rc-strip { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 2px; height: 26px; margin: 20px 0 12px; }
.rc-strip i { border-radius: 1px; background: color-mix(in oklab, var(--accent) calc(var(--b) * 100%), var(--track)); }
.rc-free .mono { font-size: 13px; color: var(--ink-2); }
.rc-free .is-free { color: var(--good-ink); }

.q-pri { font-size: 10.5px; color: var(--accent); }
.pri-in { width: 76px; height: 28px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); }
.pri-in:focus-visible { outline: 0; border-color: var(--ink); }
.pc-git span + span { margin-left: 10px; }
.res-add { display: grid; padding: 0; border-top: 0; }
.res-add a { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 150px; border: 1px dashed var(--rule); color: var(--label); font: 400 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; transition: color 140ms ease, border-color 140ms ease; }
.res-add a:hover, .res-add a:focus-visible { color: var(--ink); border-color: var(--ink); outline: 0; }

/* ---------- docs ---------- */
.doc { max-width: 100ch; min-width: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.doc > :not(pre) { max-width: 74ch; }  /* prose keeps a reading measure; commands get the room to show whole lines */
.doc h1 { margin-bottom: 18px; font: 300 clamp(28px, 4vw, 40px)/1.15 var(--sans); letter-spacing: -0.015em; color: var(--ink); }
.doc h2 { margin: 44px 0 14px; padding-top: 16px; border-top: 1px solid var(--rule); font: 500 11px/1.2 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); scroll-margin-top: 24px; }
.doc h3 { margin: 26px 0 8px; font: 500 14px/1.3 var(--sans); color: var(--ink); }
.doc p, .doc ul, .doc ol, .doc table, .doc pre { margin: 0 0 14px; }
.doc ul { list-style: disc; padding-left: 20px; }
.doc ol { list-style: decimal; padding-left: 22px; }
.doc li { margin: 5px 0; padding-left: 2px; }
.doc li::marker { color: var(--faint); }
.doc strong { font-weight: 500; color: var(--ink); }
.doc em { font-style: normal; color: var(--ink); }
.doc a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--ink); }
.doc code { padding: 1px 5px; border: 1px solid var(--hair); border-radius: 2px; background: var(--surface); font: 400 0.84em var(--mono); color: var(--ink); }
.doc pre { padding: 12px 14px; border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); overflow-x: auto; }
.doc pre code { padding: 0; border: 0; background: none; font-size: 12.5px; line-height: 1.6; white-space: pre; overflow-wrap: normal; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
.doc th { font: 400 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.doc td:first-child { white-space: nowrap; color: var(--ink); }

/* ---------- skills ---------- */
.mcp { display: grid; gap: 10px; margin-bottom: clamp(28px, 3vw, 40px); padding-top: 16px; border-top: 2px solid var(--accent); }
.mcp-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mcp-line code { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 2px; background: var(--surface); font-size: 12px; color: var(--ink); overflow-x: auto; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.tile { position: relative; display: grid; align-content: start; gap: 10px; min-height: 150px; padding: 20px 20px 56px; background: var(--paper); transition: background 140ms ease; }
.tile:hover { background: var(--surface); }
.tile-name { font-size: 13px; font-weight: 500; letter-spacing: 0.04em; }
.tile-line { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.tile-dl { position: absolute; right: 16px; bottom: 16px; }

.foot { max-width: 1560px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 3vw, 40px) 44px; font: 400 11px var(--mono); color: var(--faint); }
.tip { position: fixed; z-index: 10; pointer-events: none; width: max-content; max-width: min(340px, calc(100vw - 32px)); padding: 7px 9px; background: var(--ink); color: var(--paper); font: 400 11px/1.4 var(--mono); transform: translate(-50%, calc(-100% - 10px)); }
.tip.is-below { transform: translate(-50%, 20px); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; row-gap: 12px; }
  .nav { order: 3; flex-basis: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .nav a[aria-current="page"]::after { bottom: -13px; }
  .crown { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .crown-main { grid-column: 1 / -1; }
  .crown-stats { justify-content: flex-start; }
  .q-row { grid-template-columns: minmax(0, 1fr); }
  .q-chips { justify-content: flex-start; padding: 0 0 14px 24px; }
}
@media (max-width: 640px) {
  .lb-row { grid-template-columns: 22px 20px 58px minmax(0, 1fr) 24px; gap: 10px; }
  .lb-held, .lb-ref, .lb-age { display: none; }
  .q-head { grid-template-columns: 10px minmax(0, 1fr) 24px; }
  .q-state { grid-column: 2 / -1; }
  .q-body { padding-left: 0; }
  .crown { grid-template-columns: minmax(0, 1fr); }
  .gate-foot { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* ---------- knowledge base in the propose form, findings owed, join ---------- */
.pf-kb { display: grid; gap: 8px; }
.pf-kb input { font-size: 13px; }
.pf-kb-hits { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.pf-kb-hits:empty { display: none; }
.pf-kb-hits b { font-weight: 500; color: var(--ink); }
.owed { display: grid; gap: 4px; margin-bottom: 26px; }
.owed-form { margin-bottom: 0; }
.owed-x { font-size: 12px; color: var(--ink-2); }
.owed-form input[name="evidence"] { flex: 1 1 320px; font-size: 13px; }
.join { max-width: 820px; }
.join-lead, .join-note { font-size: 14px; line-height: 1.55; color: var(--ink-2); max-width: 74ch; }
.join input[name="name"], .join input[name="agent"] { flex: 1 1 260px; font-size: 18px; font-weight: 300; }
.join-out { display: grid; gap: 10px; max-width: 820px; margin-bottom: 26px; }
.join-note a, .who-join a { color: var(--ink); }
.who-join { margin-top: 8px; font: 400 11px var(--mono); color: var(--label); }
.gate-join { display: grid; justify-items: center; gap: 10px; padding: 6px; font: 400 11px var(--mono); letter-spacing: 0.08em; color: var(--gate-dim); text-decoration: none; }
.gate-join .face { border-color: var(--gate-line); color: var(--gate-ink); }
.gate-join:hover .face, .gate-join:focus-visible .face { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gate-ink); }
