/* UNIMATRIx Explorer · same identity as the platform's home and Society Lab (dark, gold accent,
   layered glowing panels, system fonts only). Mobile first. Self-contained: no external resources. */
:root {
  color-scheme: dark;
  --bg: #121212;
  --bg-deep: #0d0d0d;
  --panel: #1c1c1c;
  --panel-2: #222222;
  --panel-3: #2a2a2a;
  --ink: #dedede;
  --ink-strong: #f4f4f4;
  --dim: #a3a3a3;
  --faint: #8a8a8a;
  --line: #3a3a3a;
  --line-soft: rgba(255, 255, 255, 0.07);
  --accent: #b59a00;
  --accent-hi: #e2c21c;
  --accent-ink: #121212;
  --accent-soft: rgba(181, 154, 0, 0.13);
  --accent-glow: rgba(226, 194, 28, 0.32);
  --good: #7cc47f;
  --watch: #e0b030;
  --bad: #ef6a5b;
  --event: #4aa3df;
  --crisis: #ff9f43;
  --branch: #b388ff;
  --collapse: #ef5350;
  --flourish: #66bb6a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -22px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --top-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  accent-color: var(--accent);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 10px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  background:
    radial-gradient(1100px 520px at 0% -8%, rgba(181, 154, 0, 0.11), transparent 62%),
    radial-gradient(900px 560px at 105% 0%, rgba(74, 163, 223, 0.07), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(179, 136, 255, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: var(--safe-b);
  overflow-x: hidden;
}
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
a { color: var(--accent-hi); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: var(--ink); }
code, pre { font-family: var(--mono); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; font-weight: 650; }
.skip-link:focus { top: 10px; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.pad { padding: 8px 2px; }
.spacer { flex: 1; }
[hidden] { display: none !important; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }
.ic.sm { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ controls (as on the platform) */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 8px 15px; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)), var(--panel-2);
  border: 1px solid var(--line); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); font-size: 14px;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease), transform .12s var(--ease), color .16s;
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled), .button:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--ink-strong); }
button:active:not(:disabled), .button:active { transform: translateY(1px) scale(0.99); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary, .button.primary {
  background: linear-gradient(180deg, #d4b40c, var(--accent)); border-color: #c9ab06; color: var(--accent-ink); font-weight: 650;
  box-shadow: 0 6px 18px -8px var(--accent-glow);
}
button.primary:hover:not(:disabled), .button.primary:hover { color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 24px -8px var(--accent-glow); }
button.small, .button.small { min-height: 36px; padding: 5px 11px; font-size: 13px; }
button.danger-ghost { color: #ffb3aa; border-color: rgba(239, 106, 91, 0.5); background: rgba(239, 106, 91, 0.08); }
button.danger-ghost:hover:not(:disabled) { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(239, 106, 91, 0.15); color: #ffd4cf; }
.big { min-height: 52px; padding: 12px 22px; font-size: 16px; border-radius: 12px; }
.big .ic { width: 22px; height: 22px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; color: var(--dim); background: transparent; border: 1px solid transparent; text-decoration: none; }
.icon-btn:hover:not(:disabled) { color: var(--ink-strong); background: var(--panel-2); border-color: var(--line); box-shadow: none; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 8px 11px; border-radius: var(--radius-sm);
  background: #161616; border: 1px solid var(--line); font-size: 15px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
input:hover, select:hover { border-color: #4d4d4d; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible, .button:focus-visible, [tabindex]:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; font-size: 14px; color: var(--ink); min-height: 44px; }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 22px; background: #3a3a3a; position: relative; cursor: pointer; transition: background .18s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d6d6d6; transition: transform .18s var(--ease), background .18s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: #fff7d6; }
.switch.small { font-size: 12.5px; color: var(--dim); gap: 8px; }
.switch.small input { width: 30px; height: 18px; }
.switch.small input::after { width: 12px; height: 12px; }
.switch.small input:checked::after { transform: translateX(12px); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: #161616; border: 1px solid var(--line); }
.segmented label { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 13px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--dim); transition: background .16s, color .16s; }
.segmented label:hover { color: var(--ink-strong); background: var(--panel-3); }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.segmented label.seg-bad:not(:has(input:checked)) { color: #ffb3aa; }
.segmented em { font-style: normal; font-size: 12px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.label { font-size: 12.5px; color: var(--dim); letter-spacing: 0.2px; }
.hint { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* range: the replay scrubber */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 4px; background: linear-gradient(90deg, rgba(226, 194, 28, 0.5), rgba(226, 194, 28, 0.12)), #2a2a2a; }
input[type=range]::-moz-range-track { height: 6px; border-radius: 4px; background: #2a2a2a; }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 4px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff3b0, var(--accent-hi) 55%, #8a6f00); border: 2px solid #1a1a1a; box-shadow: 0 0 0 1px rgba(226, 194, 28, 0.6), 0 0 14px var(--accent-glow); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff3b0, var(--accent-hi) 55%, #8a6f00); border: 2px solid #1a1a1a; box-shadow: 0 0 14px var(--accent-glow); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-hi), 0 0 18px var(--accent-glow); }

/* badges, pills, chips */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 30px; font-size: 12px; border: 1px solid var(--line); color: var(--dim); background: #171717; white-space: nowrap; line-height: 1.5; }
.badge .ic { width: 14px; height: 14px; }
.badge.gold { color: var(--accent-hi); border-color: rgba(181, 154, 0, 0.5); background: var(--accent-soft); }
.badge.good { color: var(--good); border-color: rgba(124, 196, 127, 0.4); background: rgba(124, 196, 127, 0.08); }
.badge.bad { color: #ffb3aa; border-color: rgba(239, 106, 91, 0.5); background: rgba(239, 106, 91, 0.1); }
.badge.watch { color: var(--watch); border-color: rgba(224, 176, 48, 0.45); background: rgba(224, 176, 48, 0.08); }
.badge.info { color: #a9d4f2; border-color: rgba(74, 163, 223, 0.45); background: rgba(74, 163, 223, 0.08); }
.ruins { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 8px; font-size: 11.5px; font-weight: 750; letter-spacing: 1px; color: #ffe3df; background: repeating-linear-gradient(135deg, rgba(239, 83, 80, 0.2) 0 7px, rgba(239, 83, 80, 0.1) 7px 14px), #2a1513; border: 1px solid rgba(239, 83, 80, 0.6); text-transform: uppercase; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); white-space: nowrap; }
.ruins .ic { width: 15px; height: 15px; color: #ff8a80; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; font-weight: 800; font-size: 14px; color: #111; background: var(--av, var(--accent-hi)); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 18px -6px var(--av, var(--accent-glow)); }
.avatar .ic { width: 60%; height: 60%; }
.avatar.xs { width: 28px; height: 28px; border-radius: 8px; font-size: 10.5px; }
.avatar.lg { width: 50px; height: 50px; border-radius: 14px; font-size: 17px; }

/* ------------------------------------------------------------------ top bar */
.app-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px var(--gutter); min-height: var(--top-h);
  background: rgba(16, 16, 16, 0.86); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line-soft); box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.8); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 1; text-decoration: none; color: var(--ink-strong); border-radius: 10px; min-height: 44px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: radial-gradient(circle at 50% 30%, rgba(226, 194, 28, 0.18), transparent 70%), #191919; border: 1px solid var(--line-soft); flex: none; }
.brand-mark svg { transition: transform .5s var(--bounce); }
.brand:hover .brand-mark svg { transform: rotate(120deg); }
.brand-text { font-size: 17px; font-weight: 650; letter-spacing: 0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand-text span { font-size: 10px; letter-spacing: 3px; color: var(--accent-hi); margin-left: 6px; font-weight: 600; }
.top-nav { margin-right: auto; display: flex; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; justify-content: center; padding: 6px 12px; border-radius: 12px; color: var(--faint); text-decoration: none; font-size: 14px; font-weight: 550; position: relative; }
.nav-link:hover { color: var(--ink-strong); background: rgba(255, 255, 255, 0.04); }
.nav-link[aria-current="page"] { color: var(--accent-hi); background: linear-gradient(180deg, var(--accent-soft), rgba(181, 154, 0, 0.02)); }
.nav-link[aria-current="page"] .ic { filter: drop-shadow(0 0 6px var(--accent-glow)); }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.cta-top { min-height: 44px; padding: 8px 12px; }
.cta-top span { display: none; }
.source-pill { min-height: 44px; padding: 4px 12px; border-radius: 30px; font-size: 12px; font-weight: 650; gap: 7px; background: #171717; color: var(--dim); }
.source-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.source-pill[data-kind=data] i { background: #2fd14a; box-shadow: 0 0 8px rgba(47, 209, 74, 0.6); }
.source-pill[data-kind=files] i { background: var(--event); box-shadow: 0 0 8px rgba(74, 163, 223, 0.6); }
.source-pill[data-kind=loading] i { background: var(--accent-hi); animation: breathe 0.9s ease-in-out infinite; }
.source-pill[data-kind=none] { color: #ffc4bd; }
.source-pill[data-kind=none] i { background: var(--bad); }
@keyframes breathe { 50% { opacity: 0.35; } }

/* ------------------------------------------------------------------ layout */
main { display: block; max-width: 1440px; margin: 0 auto; padding: 16px var(--gutter) 32px; outline: none; min-width: 0; }
.view { animation: view-in .38s var(--ease); min-width: 0; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 6px 0 16px; }
.section-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.eyebrow { color: var(--accent-hi); letter-spacing: 2.2px; font-size: 11.5px; text-transform: uppercase; font-weight: 650; margin-bottom: 6px; }
.section-head h1, .section-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.2px; color: var(--ink-strong); line-height: 1.15; overflow-wrap: anywhere; }
.lead { color: var(--dim); max-width: 780px; margin-top: 8px; font-size: 15px; }
.alert { padding: 12px 14px; border-radius: 12px; background: rgba(239, 106, 91, 0.1); border: 1px solid rgba(239, 106, 91, 0.45); color: #ffd4cf; font-size: 13.5px; margin: 12px 0; animation: drop .25s var(--ease); overflow-wrap: anywhere; }
.alert.warn { background: rgba(224, 176, 48, 0.09); border-color: rgba(224, 176, 48, 0.45); color: #f3e2b0; }
.alert b { color: #fff; display: block; margin-bottom: 3px; }
.err-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--dim); text-decoration: none; font-size: 13.5px; margin: -6px 0 2px; border-radius: 8px; padding-right: 6px; }
.back-link:hover { color: var(--accent-hi); }
.card { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0) 120px), var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 18px; font-weight: 700; color: var(--ink-strong); display: flex; align-items: center; gap: 10px; }
.card h2 > .ic { color: var(--accent-hi); width: 22px; height: 22px; }
.card h3 { font-size: 14px; font-weight: 650; color: var(--accent-hi); letter-spacing: 0.3px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 .h3-note { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 500; letter-spacing: 0; }
.card h3.mt { margin-top: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head.tight { margin: 16px 0 6px; }
.card-head h3 { margin-bottom: 0; }
.empty-note { padding: 26px 16px; text-align: center; color: var(--dim); border: 1px dashed var(--line); border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.empty-note > .ic { width: 32px; height: 32px; color: var(--faint); }
.empty-note b { color: var(--ink-strong); font-size: 15.5px; }
.empty-note p { max-width: 520px; font-size: 14px; }
.skeleton { position: relative; overflow: hidden; background: #1a1a1a; border-radius: 12px; border: 1px solid var(--line-soft); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent-hi); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bump { animation: bump .45s var(--bounce); }
@keyframes bump { 40% { transform: scale(1.14); } }

/* ------------------------------------------------------------------ empty state */
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.how { display: flex; flex-direction: column; gap: 10px; }
.how h2 { font-size: 17px; }
.how p { font-size: 14px; color: #c9c9c9; }
.how-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-hi); color: var(--accent-ink); font-size: 14px; font-weight: 800; flex: none; }
.cmd { margin: 0; padding: 10px 12px; border-radius: 10px; background: #111; border: 1px solid var(--line); color: #f1e3a6; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.how > button { align-self: flex-start; }
.load-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

/* ------------------------------------------------------------------ leaderboard */
.board-controls { display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: flex-end; margin: 0 0 14px; }
.board-controls .ctl { min-width: 0; max-width: 100%; }
.board-controls legend { margin-bottom: 6px; }
.board-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--dim); margin-bottom: 10px; }
.bm-title { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-right: 4px; }
.bm-title b { color: var(--ink-strong); font-size: 16px; }
.board-card { padding: 0; overflow: hidden; }
.board-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.board-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 600; padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(0, 0, 0, 0.18); }
.board-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.board-table tbody tr:last-child td { border-bottom: 0; }
.board-table tbody tr { cursor: pointer; transition: background .15s; animation: row-in .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }
.board-table tbody tr:hover { background: rgba(226, 194, 28, 0.045); }
.board-table tbody tr:hover .c-go { color: var(--accent-hi); }
.board-table tr.older { opacity: 0.72; }
.c-rank { width: 46px; text-align: center !important; }
.rank { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-strong); background: #232323; border: 1px solid var(--line); font-size: 13.5px; }
tr.top .rank { color: var(--accent-ink); background: linear-gradient(180deg, #e8cc2c, var(--accent)); border-color: #c9ab06; box-shadow: 0 0 14px -4px var(--accent-glow); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.who-link { color: var(--ink-strong); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; line-height: 1.25; }
.who-link:hover { color: var(--accent-hi); text-decoration: underline; }
.who-text small { color: var(--faint); font-size: 12px; overflow-wrap: anywhere; }
.c-score, .c-rel, .c-seeds, .c-wb { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-score { display: table-cell; }
.score { display: block; font-size: 17px; font-weight: 750; color: var(--ink-strong); }
tr.top .score { color: var(--accent-hi); text-shadow: 0 0 16px var(--accent-glow); }
.score.zero { color: #ffb3aa; }
.c-score .ruins { margin-top: 3px; }
.c-score small { display: block; font-size: 12px; color: var(--accent-hi); }
.c-rel { color: var(--accent-hi); }
.c-seeds small { display: block; }
.bad-txt { color: #ff9d92; font-size: 11.5px; }
.c-dom { width: 150px; }
.c-date { color: var(--faint); font-size: 13px; white-space: nowrap; }
.c-go { width: 34px; color: var(--faint); }
.c-go .ic { width: 18px; height: 18px; }
.only-phone, .c-score small.only-phone { display: none; }
.eq { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; align-items: end; height: 30px; position: relative; }
.eq-bar { position: relative; height: 100%; display: flex; align-items: flex-end; border-radius: 3px; background: rgba(255, 255, 255, 0.04); }
.eq-bar i { display: block; width: 100%; border-radius: 3px 3px 1px 1px; background: linear-gradient(0deg, var(--c), color-mix(in srgb, var(--c) 55%, white)); height: 0; transition: height .9s var(--ease); transition-delay: calc(var(--k, 0) * 45ms); }
.eq-bar u { position: absolute; left: -1px; right: -1px; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.7); text-decoration: none; transform: translateY(1px); pointer-events: none; }
.skills { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 4px; }
.skill { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.skill-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 70%, white); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); grid-row: span 2; }
.skill-icon .ic { width: 16px; height: 16px; }
.skill-name { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-val { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; white-space: nowrap; }
.skill-val small { color: var(--faint); font-weight: 400; margin-left: 4px; }
.skill-track { grid-column: 2 / -1; position: relative; height: 8px; border-radius: 5px; background: #151515; border: 1px solid var(--line-soft); }
.skill-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, white)); width: 0; transition: width .9s var(--ease); box-shadow: 0 0 10px -3px var(--c); }
.skill-track u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: rgba(255, 255, 255, 0.6); text-decoration: none; transform: translateX(-1px); border-radius: 1px; }

/* ------------------------------------------------------------------ run explorer: head */
.run-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rh-main { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1 1 320px; }
.rh-text { min-width: 0; }
.rh-text h1 { font-size: clamp(22px, 5.6vw, 30px); line-height: 1.12; color: var(--ink-strong); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.rh-sub { color: var(--faint); font-size: 12.5px; margin-top: 4px; overflow-wrap: anywhere; }
.rh-side { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.rh-score { display: flex; flex-direction: column; line-height: 1.15; }
.rh-score strong { font-size: 26px; font-weight: 800; color: var(--ink-strong); font-variant-numeric: tabular-nums; text-shadow: 0 0 22px var(--accent-glow); }
.rh-score span { font-size: 12px; color: var(--accent-hi); }
.rh-bar { flex: 1 1 100%; display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.rh-bar:not(:has(> :not([hidden]))) { display: none; }
.seed-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ run explorer: layout */
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.col-stage, .col-inspect { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dim-until-ready { opacity: 0.35; pointer-events: none; }
.run-view > .card { margin-top: 14px; }

/* stage */
.stage-card { padding: 0; overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.stage-card.is-playing { border-color: rgba(181, 154, 0, 0.35); box-shadow: var(--shadow), 0 0 40px -22px var(--accent-glow); }
.stage-card.collapsing { border-color: rgba(239, 83, 80, 0.7); animation: collapse-pulse 1.6s ease-in-out infinite; }
@keyframes collapse-pulse { 50% { box-shadow: var(--shadow), 0 0 0 2px rgba(239, 83, 80, 0.35), 0 0 46px -12px rgba(239, 83, 80, 0.6); } }
.stage { position: relative; background: #141915; }
.village-box { width: 100%; aspect-ratio: 5 / 3; min-height: 220px; background: #141915; }
.stage .hud { position: absolute; z-index: 3; right: 10px; top: 10px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; pointer-events: none; max-width: 62%; }
.hud-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 12px; background: rgba(12, 12, 12, 0.72); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--ink); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-variant-numeric: tabular-nums; }
.hud-chip b { color: var(--ink-strong); font-weight: 650; display: inline-block; }
.hud-chip .ic { width: 14px; height: 14px; color: var(--dim); }
.hud-points { border-color: rgba(181, 154, 0, 0.45); }
.hud-points .ic { color: var(--accent-hi); }
.hud-points b { color: var(--accent-hi); }
.hud-points span { color: var(--faint); }
.stage-loading { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--dim); font-size: 14px; padding: 16px;
  background: radial-gradient(circle at 50% 45%, rgba(226, 194, 28, 0.08), transparent 60%), #141915; transition: opacity .5s var(--ease); }
.stage-loading.done { opacity: 0; pointer-events: none; }
.stage-loading.failed { background: #161616; position: relative; min-height: 260px; }
.progress { width: min(260px, 70%); height: 6px; border-radius: 4px; background: #2a2a2a; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6d5c00, var(--accent-hi)); box-shadow: 0 0 10px var(--accent-glow); transition: width .2s; }
.stage-loading.indeterminate .progress i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.endscreen { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px 16px 16px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(34, 32, 22, 0.97), rgba(18, 18, 18, 0.98)); border: 1px solid rgba(181, 154, 0, 0.45); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95), 0 0 50px -20px var(--accent-glow); animation: pop-in .45s var(--bounce); max-height: 70vh; overflow-y: auto; }
.endscreen.lost { border-color: rgba(239, 83, 80, 0.55); background: repeating-linear-gradient(135deg, rgba(239, 83, 80, 0.08) 0 10px, transparent 10px 20px), linear-gradient(180deg, rgba(42, 18, 16, 0.97), rgba(18, 18, 18, 0.98)); }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(0.92); } }
.es-close { position: absolute; right: 6px; top: 6px; }
.es-kicker { font-size: 11.5px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--accent-hi); font-weight: 700; }
.endscreen.lost .es-kicker { color: #ff9d92; }
.es-title { font-size: 30px; font-weight: 850; letter-spacing: 1px; text-transform: uppercase; background: linear-gradient(180deg, #fff 30%, #f1dc7c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; line-height: 1.1; }
.endscreen.lost .es-title { background: linear-gradient(180deg, #ffe3df 20%, #ef5350); -webkit-background-clip: text; background-clip: text; }
.es-cause { color: #f3d6d2; font-size: 14px; max-width: 420px; }
.es-score { display: flex; flex-direction: column; align-items: center; }
.es-total { font-size: 40px; font-weight: 850; color: var(--ink-strong); font-variant-numeric: tabular-nums; text-shadow: 0 0 30px var(--accent-glow); line-height: 1.05; display: inline-block; }
.endscreen.lost .es-total { color: #ffb3aa; text-shadow: 0 0 30px rgba(239, 83, 80, 0.4); }
.es-score span { font-size: 12.5px; color: var(--dim); }
.es-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* transport */
.playbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "btn tools" "scrub scrub"; gap: 2px 10px; align-items: center; padding: 8px 12px 4px; border-top: 1px solid var(--line-soft); background: rgba(0, 0, 0, 0.25); }
.pb-buttons { grid-area: btn; display: flex; align-items: center; gap: 4px; min-width: 0; }
.pb-tools { grid-area: tools; display: flex; align-items: center; gap: 4px; }
.pb-scrub { grid-area: scrub; position: relative; min-width: 0; }
.pb-week { display: flex; flex-direction: column; line-height: 1.2; margin-left: 6px; min-width: 0; font-variant-numeric: tabular-nums; }
.pb-week b { color: var(--ink-strong); font-size: 14px; white-space: nowrap; }
.pb-week span { color: var(--faint); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-btn { width: 48px; min-height: 48px; height: 48px; border-radius: 50%; padding: 0; background: linear-gradient(180deg, #d4b40c, var(--accent)); color: var(--accent-ink); border-color: #c9ab06; box-shadow: 0 6px 18px -6px var(--accent-glow); }
.play-btn .play-ic { display: grid; place-items: center; }
.play-btn .ic { width: 20px; height: 20px; }
.play-btn.playing { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px -4px var(--accent-glow); }
.play-btn:hover:not(:disabled) { color: var(--accent-ink); }
.icon-btn.tb { color: var(--ink); }
.icon-btn.tb:disabled { opacity: 0.35; }
.icon-btn[aria-pressed="true"] { color: var(--accent-hi); }
select.speed { width: auto; min-height: 44px; padding: 4px 8px; font-variant-numeric: tabular-nums; }
.pb-ticks { position: absolute; left: 11px; right: 11px; bottom: 6px; height: 6px; pointer-events: none; }
.tick { position: absolute; top: 0; width: 6px; height: 6px; border-radius: 50%; transform: translateX(-50%); background: var(--event); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.tick.crisis { background: var(--crisis); } .tick.branch { background: var(--branch); } .tick.flourish { background: var(--flourish); }
.tick.collapse { background: var(--collapse); width: 9px; height: 9px; top: -1.5px; box-shadow: 0 0 0 1px #000, 0 0 8px var(--collapse); }
.playbar.disabled { opacity: 0.5; }

/* score HUD */
.score-card { padding: 12px 14px; }
.score-card.collapsed { border-color: rgba(239, 83, 80, 0.45); background: repeating-linear-gradient(135deg, rgba(239, 83, 80, 0.06) 0 10px, transparent 10px 20px), var(--panel); }
.tk-head { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tk-head > .ic { color: var(--accent-hi); align-self: center; }
.tk-total { font-size: 30px; font-weight: 850; color: var(--ink-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; text-shadow: 0 0 26px var(--accent-glow); display: inline-block; line-height: 1.05; }
.score-card.collapsed .tk-total { color: #ffb3aa; text-shadow: 0 0 26px rgba(239, 83, 80, 0.4); }
.tk-sub { color: var(--faint); font-size: 13px; }
.tk-sub s { color: #ff9d92; }
.tk-delta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; margin-left: auto; }
.tk-delta.up span { color: var(--good); font-weight: 700; }
.tk-delta.down span { color: var(--bad); font-weight: 700; }
.tk-domains { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 18px; }
.tk-row { display: grid; grid-template-columns: 18px minmax(0, 96px) minmax(0, 1fr) 66px; gap: 8px; align-items: center; font-size: 12px; }
.tk-ic { color: color-mix(in srgb, var(--c) 70%, white); display: grid; place-items: center; }
.tk-ic .ic { width: 15px; height: 15px; }
.tk-name { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-bar { height: 7px; border-radius: 4px; background: #151515; overflow: hidden; }
.tk-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, white)); transition: width .5s var(--ease); }
.tk-val { text-align: right; color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; line-height: 1.1; }
.tk-val small { display: block; color: var(--good); font-weight: 500; font-size: 10.5px; }

/* ------------------------------------------------------------------ inspector (tabs) */
.inspector { padding: 0; display: flex; flex-direction: column; }
.insp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; padding: 8px 10px 0; border-bottom: 1px solid var(--line-soft); background: rgba(0, 0, 0, 0.18); border-radius: var(--radius) var(--radius) 0 0; }
.tabs { display: flex; gap: 2px; min-width: 0; flex: 1 1 auto; }
.tab { position: relative; flex: 1 1 auto; min-width: 0; min-height: 46px; gap: 6px; padding: 6px 8px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--faint); font-size: 13.5px; font-weight: 600; }
.tab span { overflow: hidden; text-overflow: ellipsis; }
.tab:hover:not(:disabled) { box-shadow: none; color: var(--ink-strong); background: rgba(255, 255, 255, 0.04); }
.tab[aria-selected="true"] { color: var(--accent-hi); background: linear-gradient(180deg, var(--accent-soft), rgba(181, 154, 0, 0.02)); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent-hi); box-shadow: 0 0 12px var(--accent-glow); }
.tab-count { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 10px; background: #2a2a2a; color: var(--dim); font-variant-numeric: tabular-nums; }
.tab-count:empty { display: none; }
.tab.warn .tab-count { background: rgba(239, 106, 91, 0.25); color: #ffb3aa; }
.tab-panel { padding: 14px; min-width: 0; outline: none; }
.tab-panel:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-hi); border-radius: 0 0 var(--radius) var(--radius); }
.insp-title { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 12px; }
.insp-title h2 { font-size: 16px; font-weight: 700; color: var(--ink-strong); }

/* steward actions */
.acts { display: flex; flex-direction: column; gap: 6px; }
.act { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02); transition: border-color .2s, background .2s, box-shadow .2s, transform .2s var(--ease); }
.act.acting { border-color: var(--accent-hi); background: rgba(181, 154, 0, 0.12); box-shadow: 0 0 0 1px rgba(226, 194, 28, 0.25), 0 0 22px -8px var(--accent-glow); transform: translateX(3px); }
.act.rejected { border-color: rgba(239, 106, 91, 0.4); background: rgba(239, 106, 91, 0.05); }
.act.compact { padding: 6px 8px; border: 0; background: transparent; }
.act-icon { font-size: 17px; line-height: 1.45; text-align: center; }
.act-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; font-size: 13.5px; }
.act-head b { font-weight: 650; color: var(--ink-strong); overflow-wrap: anywhere; }
.status { flex: none; font-size: 10.5px; font-weight: 750; letter-spacing: 0.8px; text-transform: uppercase; padding: 1px 7px; border-radius: 6px; border: 1px solid; }
.status.ok { color: var(--good); border-color: rgba(124, 196, 127, 0.4); background: rgba(124, 196, 127, 0.08); }
.status.bad { color: #ffb3aa; border-color: rgba(239, 106, 91, 0.55); background: rgba(239, 106, 91, 0.12); }
.act-who { font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.act-say { position: relative; align-self: flex-start; max-width: 100%; font-style: italic; color: #f5e9b8; font-size: 13px; margin-top: 3px; padding: 5px 10px; border-radius: 10px 10px 10px 2px; background: rgba(226, 194, 28, 0.09); border: 1px solid rgba(226, 194, 28, 0.25); overflow-wrap: anywhere; }
.act-out { font-size: 12.5px; color: var(--dim); margin-top: 2px; border-left: 2px solid rgba(255, 255, 255, 0.12); padding-left: 8px; overflow-wrap: anywhere; }
.act-out b { color: var(--ink); font-weight: 600; }
.act-out.why { border-left-color: rgba(239, 106, 91, 0.6); color: #f3c9c3; }
.act-out.why > b:first-child { color: #ffb3aa; }
.act-code { font-size: 11px; color: var(--faint); overflow-wrap: anywhere; margin-top: 3px; }
.notebook-box { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(22, 20, 12, 0.9); border: 1px solid rgba(181, 154, 0, 0.45); color: #ece3c0; font-size: 13.5px; box-shadow: 0 0 26px -16px var(--accent-glow); }
.nb-head { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent-hi); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 4px; }
.nb-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.nb-fc { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.fc { display: grid; grid-template-columns: minmax(0, 1fr) 90px 42px; gap: 8px; align-items: center; font-size: 12.5px; color: #c9e6ff; font-variant-numeric: tabular-nums; }
.fc b { font-weight: 600; overflow-wrap: anywhere; }
.fc-bar { height: 6px; border-radius: 4px; background: #2a2a2a; overflow: hidden; }
.fc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2a6f9e, #8cc8f0); }
.nb-err { display: flex; gap: 6px; align-items: center; margin-top: 6px; color: #ffb3aa; }
.chronicle h3 { margin: 16px 0 6px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; }
.chronicle ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.chronicle li { font-size: 12.5px; padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line-soft); overflow-wrap: anywhere; animation: drop .3s var(--ease); }
.chronicle li.bad { border-color: rgba(239, 106, 91, 0.35); background: rgba(239, 106, 91, 0.07); }
.chronicle li.good { border-color: rgba(124, 196, 127, 0.3); background: rgba(124, 196, 127, 0.06); }

/* mind: the raw decision */
.mind-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mstat { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 9px; background: #181818; border: 1px solid var(--line-soft); font-size: 12px; color: var(--faint); }
.mstat b { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-size: 13px; }
.pipeline { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.pipe { flex: 1 1 0; min-width: 0; gap: 6px; padding: 6px 10px; border-radius: 10px; font-size: 13px; color: var(--dim); background: #161616; }
.pipe-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #2a2a2a; font-size: 11px; font-weight: 800; color: var(--dim); flex: none; }
.pipe[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hi); font-weight: 650; }
.pipe[aria-checked="true"] .pipe-n { background: var(--accent-hi); color: var(--accent-ink); }
.pipe.empty { border-style: dashed; }
.pipe-arrow { color: var(--faint); font-size: 14px; }
.mind-pane h3 { margin: 12px 0 6px; }
.mind-text { margin: 0; padding: 12px; border-radius: 10px; background: #111; border: 1px solid var(--line); color: #d8d8d8; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow: auto; }
.mind-text.thought { color: #d9cdf7; border-color: rgba(179, 136, 255, 0.35); }
.mind-text.code { color: #f1e3a6; }
.asked-box { padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(181, 154, 0, 0.3); background: rgba(181, 154, 0, 0.05); }
.asked-box h3 { margin-top: 0; }
.asked { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.asked b { color: var(--ink-strong); }
.asked-say { font-style: italic; color: #f5e9b8; }
.asked-note { margin-top: 8px; font-size: 13px; color: #ece3c0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* people */
.people-sum { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ps { font-size: 12px; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line-soft); background: #181818; color: var(--dim); }
.ps b { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.ps.bad { border-color: rgba(239, 106, 91, 0.45); } .ps.bad b { color: #ffb3aa; }
.ps.watch { border-color: rgba(224, 176, 48, 0.4); } .ps.watch b { color: var(--watch); }
.ps.info { border-color: rgba(74, 163, 223, 0.4); } .ps.info b { color: #a9d4f2; }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.p-btn { width: 100%; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; grid-template-areas: "dot main fate" "dot now now" "dot flags flags"; gap: 2px 10px; align-items: center; justify-content: stretch; text-align: left; white-space: normal; min-height: 48px; padding: 8px 10px; background: rgba(255, 255, 255, 0.02); border-color: var(--line-soft); }
.p-dot { grid-area: dot; align-self: start; margin-top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--wb, #888); box-shadow: 0 0 0 2px var(--fc, #888), 0 0 10px -2px var(--wb, #888); transition: background .4s; }
.p-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.p-main b { font-size: 13.5px; color: var(--ink-strong); overflow-wrap: anywhere; font-weight: 650; }
.p-main small { font-size: 11.5px; color: var(--faint); overflow-wrap: anywhere; }
.p-new { font-style: normal; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #ffc4a6; border: 1px solid rgba(255, 138, 101, 0.45); border-radius: 5px; padding: 0 5px; margin-left: 6px; vertical-align: middle; font-weight: 700; }
.p-now { grid-area: now; font-size: 12px; color: #e0c84a; overflow-wrap: anywhere; }
.p-flags { grid-area: flags; display: flex; gap: 4px; flex-wrap: wrap; }
.p-flags:empty { display: none; }
.p-fate { grid-area: fate; }
.p-fate .badge { font-size: 11px; padding: 1px 7px; }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--dim); }
.flag .ic { width: 12px; height: 12px; }
.flag.bad { color: #ff9d92; border-color: rgba(239, 106, 91, 0.45); }
.flag.watch { color: var(--watch); border-color: rgba(224, 176, 48, 0.4); }
.flag.concern { color: #c7b8ff; border-color: rgba(179, 136, 255, 0.4); }
.person.absent .p-btn { opacity: 0.5; }
.person[data-status=dead] .p-now { color: #ff9d92; }
.person.selected .p-btn { border-color: var(--accent-hi); background: rgba(181, 154, 0, 0.1); box-shadow: 0 0 0 1px rgba(226, 194, 28, 0.25); }
.person-detail { display: flex; flex-direction: column; gap: 12px; }
.back-btn { align-self: flex-start; }
.pd-head { display: flex; gap: 12px; align-items: center; }
.pd-head h2 { font-size: 19px; color: var(--ink-strong); overflow-wrap: anywhere; }
.pd-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; background: var(--fc); box-shadow: 0 0 12px -2px var(--fc); }
.pd-bio { font-size: 13.5px; color: #c9c9c9; font-style: italic; }
.pd-now { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line-soft); }
.pd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pd-cell { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pd-cell b { color: var(--ink-strong); font-size: 13.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pd-cell span { font-size: 11px; color: var(--faint); }
.pd-fate { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; color: var(--ink); }
.pd-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px 16px; }
.pd-concerns { display: flex; flex-direction: column; gap: 6px; }
.concern-strip { display: flex; height: 16px; border-radius: 6px; overflow: hidden; background: #151515; border: 1px solid var(--line-soft); }
.concern-strip i { flex: 1 1 0; min-width: 0; cursor: pointer; border-right: 1px solid rgba(0, 0, 0, 0.25); }
.pd-talks { display: flex; flex-direction: column; gap: 4px; }
.talk { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 4px; align-items: start; justify-content: stretch; text-align: left; white-space: normal; padding: 4px 6px; background: rgba(255, 255, 255, 0.02); border-color: var(--line-soft); }
.talk .q-week { padding-top: 8px; }

/* story graph */
.story-graph { position: relative; overflow: auto; max-height: 460px; border-radius: 12px; background: radial-gradient(500px 300px at 20% 0%, rgba(74, 163, 223, 0.06), transparent 70%), #131313; border: 1px solid var(--line-soft); overscroll-behavior: contain; }
.story-svg { display: block; }
.s-edge path { fill: none; stroke: #3d3d3d; stroke-width: 1.4; transition: stroke .3s; }
.s-edge text { fill: #6f6f6f; font-size: 10px; font-family: var(--font); }
.s-edge.on path { stroke: var(--accent-hi); stroke-width: 2.6; filter: drop-shadow(0 0 4px rgba(226, 194, 28, 0.5)); }
.s-edge.on text { fill: #f1e3a6; font-weight: 600; }
.s-node rect { fill: #1d1d1d; stroke: #3a3a3a; stroke-width: 1.2; transition: fill .3s, stroke .3s; }
.s-node text { fill: #9a9a9a; font-size: 12px; font-family: var(--font); font-weight: 600; }
.s-node .s-week { fill: var(--accent-hi); font-size: 10.5px; font-weight: 800; }
.s-node.k-event rect { stroke: rgba(74, 163, 223, 0.45); }
.s-node.k-crisis rect { stroke: rgba(255, 159, 67, 0.45); }
.s-node.k-flourish rect { stroke: rgba(102, 187, 106, 0.45); }
.s-node.k-collapse rect { stroke: rgba(239, 83, 80, 0.5); }
.s-node.on text { fill: #f4f4f4; }
.s-node.on.k-event rect { fill: rgba(74, 163, 223, 0.22); stroke: var(--event); }
.s-node.on.k-crisis rect { fill: rgba(255, 159, 67, 0.22); stroke: var(--crisis); }
.s-node.on.k-flourish rect { fill: rgba(102, 187, 106, 0.24); stroke: var(--flourish); }
.s-node.on.k-collapse rect { fill: rgba(239, 83, 80, 0.3); stroke: var(--collapse); }
.s-node.now rect { stroke-width: 3; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35)); animation: node-pop .6s var(--bounce); }
.s-node.future rect { stroke-dasharray: 4 3; }
@keyframes node-pop { 40% { stroke-width: 5; } }
.story-legend { margin-bottom: 8px; }
.story-legend i.k-event { background: var(--event); } .story-legend i.k-crisis { background: var(--crisis); } .story-legend i.k-flourish { background: var(--flourish); }
.story-legend i.k-collapse { background: var(--collapse); } .story-legend i.k-path { background: var(--accent-hi); box-shadow: 0 0 6px var(--accent-glow); }
.quest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.q-btn { width: 100%; display: grid; grid-template-columns: 38px 30px minmax(0, 1fr) auto; gap: 8px; align-items: start; justify-content: stretch; text-align: left; white-space: normal; padding: 8px 10px; min-height: 48px; background: rgba(255, 255, 255, 0.02); border-color: var(--line-soft); }
.q-week { font-size: 11.5px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--faint); padding-top: 5px; }
.q-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(74, 163, 223, 0.12); color: #8cc8f0; }
.q-icon .ic { width: 17px; height: 17px; }
.q-icon.crisis { background: rgba(255, 159, 67, 0.13); color: var(--crisis); }
.q-icon.branch { background: rgba(179, 136, 255, 0.13); color: #cdb4ff; }
.q-icon.flourish { background: rgba(102, 187, 106, 0.14); color: var(--good); }
.q-icon.collapse { background: rgba(239, 83, 80, 0.16); color: #ff8a80; }
.q-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; gap: 1px; }
.q-kind { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); }
.q-body b { color: var(--ink-strong); font-size: 13.5px; overflow-wrap: anywhere; }
.q-text { font-size: 12.5px; color: var(--dim); overflow-wrap: anywhere; }
.q-rewards { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.q-reward { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 5px; color: color-mix(in srgb, var(--c) 70%, white); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); font-variant-numeric: tabular-nums; }
.q-lock { display: none; color: var(--faint); padding-top: 5px; }
.q-lock .ic { width: 15px; height: 15px; }
.quest.locked .q-lock { display: block; }
.quest.locked .q-body b, .quest.locked .q-text, .quest.locked .q-rewards { filter: blur(5px); opacity: 0.6; user-select: none; }
.quest.locked .q-icon { filter: grayscale(1); opacity: 0.5; }
.quest:not(.reached) .q-btn { border-style: dashed; }
.quest.reached .q-week { color: var(--accent-hi); }
.quest.now .q-btn { border-color: var(--accent-hi); background: rgba(181, 154, 0, 0.1); box-shadow: 0 0 22px -10px var(--accent-glow); }
.quest.collapse.reached .q-btn { border-color: rgba(239, 83, 80, 0.5); background: rgba(239, 83, 80, 0.07); }

/* ------------------------------------------------------------------ quest log (every action) */
.ql-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.ql-filters input[type=search] { flex: 1 1 220px; width: auto; }
.ql-filters select { flex: 0 1 230px; width: auto; }
.ql-list { display: flex; flex-direction: column; gap: 10px; max-height: 75vh; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.ql-group { border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.015); padding: 4px 8px 8px; transition: opacity .3s, border-color .3s; }
.ql-group.now { border-color: rgba(226, 194, 28, 0.55); background: rgba(181, 154, 0, 0.06); box-shadow: 0 0 26px -16px var(--accent-glow); }
.ql-group.future { opacity: 0.55; }
.ql-group.collapse { border-color: rgba(239, 83, 80, 0.5); }
.ql-group > .acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 6px; align-items: start; }
.ql-week { width: 100%; justify-content: flex-start; gap: 10px; min-height: 40px; padding: 4px 6px; border: 0; background: transparent; font-size: 13px; }
.ql-week:hover:not(:disabled) { box-shadow: none; }
.ql-week b { color: var(--ink-strong); }
.ql-week span { color: var(--faint); text-transform: capitalize; }
.ql-week .ql-count { margin-left: auto; text-transform: none; }
.ql-week > .ic { color: var(--faint); }

/* ------------------------------------------------------------------ vitals */
.vitals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px 20px; }
.lc { min-width: 0; }
.lc.wide { grid-column: 1 / -1; }
.lc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.lc-name { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-name .ic { color: var(--faint); }
.lc-now { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; display: inline-flex; gap: 8px; }
.lc-now small { color: var(--faint); font-weight: 400; }
.lc-plot { position: relative; border-radius: 6px; background: rgba(255, 255, 255, 0.015); border-bottom: 1px solid rgba(255, 255, 255, 0.12); touch-action: pan-y; }
.lc-plot.seekable { cursor: crosshair; }
.lc-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.lc-grid { stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lc-cross { position: absolute; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, 0.55); transform: translateX(-0.5px); pointer-events: none; }
.lc-plot.hovering .lc-cross { background: var(--accent-hi); }
.lc-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--dc); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #151515, 0 0 8px var(--dc); pointer-events: none; }
.lc-marker { position: absolute; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); background: var(--mc); opacity: 0.65; pointer-events: none; }
.lc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--dim); margin-top: 6px; }
.lc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lc-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------------ results */
.results { scroll-margin-top: calc(var(--top-h) + 12px); }
.sb-headline { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 6px 0 18px; }
.sb-main, .sb-run { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02); min-width: 0; }
.sb-main { border-color: rgba(226, 194, 28, 0.35); background: radial-gradient(400px 160px at 0% 0%, rgba(226, 194, 28, 0.1), transparent 70%), rgba(255, 255, 255, 0.02); }
.sb-main.lost { border-color: rgba(239, 83, 80, 0.45); background: repeating-linear-gradient(135deg, rgba(239, 83, 80, 0.06) 0 10px, transparent 10px 20px), rgba(255, 255, 255, 0.02); }
.sb-total { font-size: 44px; font-weight: 850; color: var(--ink-strong); letter-spacing: -1px; font-variant-numeric: tabular-nums; text-shadow: 0 0 30px var(--accent-glow); line-height: 1.05; }
.sb-total.collapse { color: #ffb3aa; letter-spacing: 3px; text-transform: uppercase; text-shadow: 0 0 30px rgba(239, 83, 80, 0.4); font-size: 36px; }
.sb-cause { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #f3d6d2; font-size: 14px; }
.sb-cause.good { color: var(--good); }
.sb-retained { font-size: 13px; color: var(--faint); }
.sb-run { align-items: flex-start; }
.sb-run b { font-size: 26px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.sb-run > span:not(.label):not(.muted) { color: var(--accent-hi); font-size: 13px; }
.sb-seeds { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sb-seed { flex-direction: column; gap: 0; min-height: 52px; padding: 6px 12px; line-height: 1.2; }
.sb-seed b { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.sb-seed small { font-size: 11px; color: var(--faint); }
.sb-seed span { font-size: 11.5px; color: var(--dim); }
.sb-seed.on { border-color: var(--accent); background: var(--accent-soft); }
.sb-seed.dead small { color: #ff9d92; }
.sb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.sb-narrative { color: #d0d0d0; font-size: 14.5px; }
.sb-outcomes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sb-outcomes li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(124, 196, 127, 0.3); background: rgba(124, 196, 127, 0.05); font-size: 13px; }
.sb-outcomes li.bad { border-color: rgba(239, 106, 91, 0.4); background: rgba(239, 106, 91, 0.06); }
.sb-outcomes .q-week { padding: 0; color: var(--accent-hi); }
.sb-outcomes b { color: var(--ink-strong); font-weight: 600; min-width: 0; overflow-wrap: anywhere; flex: 1 1 200px; }
.ev-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line-soft); background: #181818; font-size: 12.5px; color: var(--dim); }
.ev-chip b { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.ev-chip .ic { color: var(--faint); }
.diag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.diag { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02); border-left: 3px solid var(--lvl, var(--line)); }
.diag.good { --lvl: var(--good); } .diag.watch { --lvl: var(--watch); } .diag.bad { --lvl: var(--bad); }
.diag h4 { margin: 0 0 4px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; color: var(--ink-strong); }
.diag .lvl { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #111; background: var(--lvl); flex: none; }
.diag p { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.diag .basis { font-size: 11.5px; color: var(--faint); margin-top: 6px; font-style: italic; }
.sb-usage { margin-top: 18px; font-size: 12px; color: var(--faint); font-family: var(--mono); overflow-wrap: anywhere; }
.kbd-hint { display: none; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--faint); }

/* ------------------------------------------------------------------ footer, toasts, dialog, drop */
.app-foot { max-width: 1440px; margin: 10px auto 0; padding: 18px var(--gutter) 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; font-size: 13px; color: var(--faint); border-top: 1px solid var(--line-soft); }
.toasts { position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(14px + var(--safe-b)); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: stretch; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 14px; border-radius: 12px; background: rgba(26, 26, 26, 0.97); border: 1px solid var(--line); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.85); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .32s var(--bounce); }
.toast.good { border-color: rgba(124, 196, 127, 0.5); }
.toast.bad { border-color: rgba(239, 106, 91, 0.6); }
.toast.gold { border-color: rgba(226, 194, 28, 0.6); }
.toast.leaving { animation: toast-out .25s var(--ease) forwards; }
.toast > i { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--accent-hi); }
.toast.good > i { background: var(--good); }
.toast.bad > i { background: var(--bad); }
.toast .t-body { flex: 1; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.toast .t-detail { color: var(--faint); font-size: 12.5px; }
.toast .t-close { min-height: 28px; width: 28px; padding: 0; border: 0; background: transparent; color: var(--faint); font-size: 18px; line-height: 1; margin: -4px -6px 0 0; }
.toast .t-close:hover { color: var(--ink-strong); box-shadow: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
dialog { color: var(--ink); border: 1px solid #4a4a4a; background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 120px), #1c1c1c; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9); padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); }
dialog h2 { font-size: 20px; color: var(--ink-strong); }
.panel-dialog { width: calc(100% - 24px); max-width: 560px; border-radius: 16px; padding: 18px; max-height: calc(100dvh - 24px); overflow-y: auto; }
.panel-dialog[open] { animation: pop-in .25s var(--ease); }
.panel-dialog #data-body { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.dd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.data-now { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-soft); }
.data-now > .ic { width: 26px; height: 26px; color: var(--accent-hi); }
.data-now div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.data-now b { color: var(--ink-strong); overflow-wrap: anywhere; }
.data-now span { color: var(--faint); font-size: 13px; overflow-wrap: anywhere; }
.drop-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(8, 10, 12, 0.78); backdrop-filter: blur(6px); pointer-events: none; }
.drop-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 34px 28px; border-radius: 22px; border: 2px dashed var(--accent-hi); background: rgba(26, 24, 12, 0.92); color: #f1e3a6; max-width: 440px; box-shadow: 0 0 60px -10px var(--accent-glow); animation: pop-in .3s var(--bounce); }
.drop-box .ic { width: 46px; height: 46px; color: var(--accent-hi); }
.drop-box b { font-size: 19px; color: var(--ink-strong); }
.drop-box span { font-size: 13.5px; color: #d9cd9c; }
.noscript { padding: 40px; text-align: center; }

/* ================================================================== ≥ 480px */
@media (min-width: 480px) {
  .tk-domains { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .load-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ================================================================== ≥ 600px */
@media (min-width: 600px) {
  :root { --gutter: 22px; }
  .toasts { left: auto; right: var(--gutter); width: min(420px, calc(100% - 2 * var(--gutter))); }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
  .sb-headline { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .endscreen { position: absolute; inset: 0; border-radius: 0; justify-content: center; max-height: none; z-index: 6; background: radial-gradient(circle at 50% 40%, rgba(40, 36, 16, 0.86), rgba(10, 10, 10, 0.9)); backdrop-filter: blur(3px); border: 0; box-shadow: none; }
  .endscreen.lost { background: repeating-linear-gradient(135deg, rgba(239, 83, 80, 0.08) 0 12px, transparent 12px 24px), radial-gradient(circle at 50% 40%, rgba(60, 16, 14, 0.88), rgba(10, 10, 10, 0.92)); }
  .playbar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "btn scrub tools"; padding: 8px 14px; gap: 10px 14px; }
  .pb-week { min-width: 96px; }
  .pd-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ================================================================== ≥ 768px */
@media (min-width: 768px) {
  .section-head h1 { font-size: 30px; }
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kbd-hint { display: flex; }
  .sb-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .es-title { font-size: 40px; }
  .nav-link span { display: inline; }
}
/* ================================================================== ≥ 1024px */
@media (min-width: 1024px) {
  :root { --gutter: 30px; }
}
/* ================================================================== ≥ 1100px: stage and inspector side by side */
@media (min-width: 1100px) {
  .run-grid { grid-template-columns: minmax(0, 1.12fr) minmax(400px, 1fr); }
  .col-inspect { position: sticky; top: calc(var(--top-h) + 12px); }
  .inspector { max-height: calc(100vh - var(--top-h) - 28px); }
  .tab-panel { overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
  .mind-text { max-height: none; }
  .story-graph { max-height: 52vh; }
}
@media (min-width: 1200px) {
  .cta-top span { display: inline; }
}
/* ================================================================== 768–1099px: fewer leaderboard columns */
@media (min-width: 768px) and (max-width: 1099px) {
  .board-table .c-dom, .board-table .c-wb { display: none; }
}
/* ================================================================== < 768px: the leaderboard as compact rows */
@media (max-width: 767px) {
  .board-table .c-rel, .board-table .c-seeds, .board-table .c-wb, .board-table .c-dom, .board-table .c-date { display: none; }
  .board-table td, .board-table th { padding: 10px 8px; }
  .only-phone { display: inline; }
  .c-score small.only-phone { display: block; }
  .c-go { width: 22px; padding-left: 0 !important; }
  .c-rank { width: 36px; padding-right: 0 !important; }
  button.small, .button.small { min-height: 44px; }
  .segmented label { min-height: 44px; }
}
@media (max-width: 479px) {
  .brand-text span { display: none; }
  .nav-link span { display: none; }
  .source-pill span { display: none; }
  .source-pill { padding: 0; width: 44px; justify-content: center; }
  .source-pill i { width: 10px; height: 10px; }
  .stage .hud .hud-chip:not(.hud-points) { display: none; }
  .tab { font-size: 12.5px; gap: 4px; padding: 6px 4px; }
  .tab .ic { display: none; }
  .tab:not(.warn) .tab-count { display: none; }
  .pb-week span { display: none; }
  .pd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-btn { grid-template-columns: 34px 28px minmax(0, 1fr) auto; gap: 6px; padding: 8px; }
  .pipe { font-size: 12px; padding: 6px; }
  .pipe .ic { display: none; }
  .tk-total { font-size: 26px; }
  .who .avatar { display: none; }
  .fc { grid-template-columns: minmax(0, 1fr) 60px 38px; }
}
@media (max-width: 380px) {
  .brand-text { font-size: 15px; }
  .app-top { gap: 6px; }
}
@media (hover: none) {
  .board-table tbody tr:hover { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
