/* Crown Telemetry dashboard. Dark by default, light by toggle; both from the same tokens. */
:root, [data-theme="dark"] {
  --bg: #0b0e14; --surface: #121722; --surface-2: #181f2c; --surface-3: #1f2737; --line: #222b3a; --line-strong: #2e394b;
  --text: #e7ebf2; --muted: #98a2b3; --faint: #677184;
  --accent: #8b9bff; --accent-2: #6c7cff; --accent-soft: rgba(124,140,255,.14); --on-accent: #0b0e14;
  --red: #ff6b70; --red-soft: rgba(255,107,112,.14); --orange: #f6a53a; --orange-soft: rgba(246,165,58,.14);
  --green: #3ccf86; --green-soft: rgba(60,207,134,.13); --purple: #b08cff; --purple-soft: rgba(176,140,255,.15);
  --blue: #63a4ff; --blue-soft: rgba(99,164,255,.14);
  --code-bg: #080a0f; --code-text: #d5dbe5; --code-own: #ffd479; --code-dim: #5f6b7d;
  --radius: 14px; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  --sidebar: 252px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f1f3f7; --surface-3: #e8ebf1; --line: #e3e7ee; --line-strong: #cfd5df;
  --text: #141821; --muted: #5b6474; --faint: #8a93a2;
  --accent: #5466f5; --accent-2: #3d50f0; --accent-soft: #eceefe; --on-accent: #ffffff;
  --red: #d93b41; --red-soft: #fdecec; --orange: #c9790a; --orange-soft: #fff3df; --green: #16884f; --green-soft: #e5f6ec;
  --purple: #7442d8; --purple-soft: #f1eafd; --blue: #2c6cdc; --blue-soft: #e8f0fd;
  --code-bg: #10141b; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 2px 8px rgba(16,24,40,.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 25px; line-height: 1.25; margin: 0; letter-spacing: -.015em; overflow-wrap: anywhere; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.005em; }
p { margin: 6px 0; }
code, .mono, pre { font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace; }
.mono { font-size: .93em; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .break { overflow-wrap: anywhere; }
.center { text-align: center; } .grow { flex: 1; min-width: 0; }
.ok-text { color: var(--green); }

/* ── sidebar layout ── */
.with-sidebar .page { margin-left: var(--sidebar); max-width: calc(1400px + var(--sidebar)); padding: 28px 36px 72px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; letter-spacing: -.01em; padding: 6px 10px 12px; font-size: 15.5px; }
.brand svg { color: var(--accent); } .brand:hover { text-decoration: none; }
.brand.big { font-size: 21px; padding: 0 0 4px; }
.search { position: relative; display: flex; align-items: center; margin: 0 4px 10px; }
.search svg { position: absolute; left: 10px; color: var(--faint); }
.search input { width: 100%; padding: 8px 32px; background: var(--surface-2); border-color: var(--line); }
.search kbd { position: absolute; right: 8px; font: 11px/1 inherit; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 550; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active .ico { color: var(--accent); }
.nav .ico { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 700; background: var(--red-soft); color: var(--red); padding: 1px 8px; border-radius: 99px; }
.nav a.add { color: var(--faint); font-size: 13.5px; }
.nav-section { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--text); flex: 1; min-width: 0; }
.me:hover, .me.active { background: var(--surface-2); text-decoration: none; }
.me b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--faint); font-size: 11.5px; }
.foot-actions { display: flex; } .foot-actions form { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.avatar.small { width: 24px; height: 24px; font-size: 11px; }
.game-dot { --game: var(--accent); width: 18px; height: 18px; border-radius: 6px; display: inline-grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--game) 22%, transparent); box-shadow: inset 0 0 0 1.5px var(--game); font-size: 11px; line-height: 1; }
.game-dot:empty::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--game); }
.game-dot.big { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.game-dot.big:empty::after { width: 11px; height: 11px; }
.game-tag { --game: var(--accent); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.game-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--game); }
.mobile-bar, .nav-toggle, .scrim { display: none; }
@media (max-width: 960px) {
  .with-sidebar .page { margin-left: 0; padding: 74px 16px 56px; }
  .mobile-bar { display: flex; position: fixed; inset: 0 0 auto 0; height: 56px; align-items: center; gap: 8px; padding: 0 10px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 20; }
  .mobile-bar .brand { padding: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 25; }
}

/* ── controls ── */
button, .button, input, select, textarea { font: inherit; color: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 8px 15px;
  border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s, filter .12s; }
button:hover, .button:hover { background: var(--surface-3); text-decoration: none; }
button:disabled, .button.disabled { opacity: .45; cursor: not-allowed; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.ghost, .button.ghost { background: transparent; }
button.ghost:hover, .button.ghost:hover { background: var(--surface-2); }
button.small, .button.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
button.danger, .button.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
button.danger:not(.ghost) { background: var(--red-soft); }
button.wide { width: 100%; padding: 11px; }
.icon-button { padding: 7px; border-color: transparent; background: transparent; color: var(--muted); border-radius: 9px; display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover { color: var(--text); background: var(--surface-2); }
input, select, textarea { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 11px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
input[type=color] { padding: 3px; height: 40px; width: 100%; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
textarea { width: 100%; resize: vertical; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); align-content: start; }
label input, label textarea, label select { color: var(--text); font-weight: 400; font-size: 14.5px; }
label small { font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 8px; }
legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.switch span { display: grid; gap: 2px; color: var(--text); font-weight: 500; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); position: relative; flex: none; margin-top: 1px; cursor: pointer; transition: background .15s; border: 0; padding: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

/* ── page ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head.detail { align-items: flex-start; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.actions, .inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-actions { margin-top: 12px; } .inline-actions.end { justify-content: flex-end; margin: 0; }
.actions form, .inline-actions form { margin: 0; }
.pager-inline { display: inline-flex; align-items: center; gap: 6px; }
.more { font-size: 13px; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.alert-panel { border-color: color-mix(in srgb, var(--purple) 40%, var(--line)); }
.danger-zone { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }
.empty-state { text-align: center; padding: 56px 20px; display: grid; gap: 8px; justify-items: center; }
.empty-icon { font-size: 34px; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); margin-bottom: 6px; }
.hint { color: var(--faint); font-size: 13px; margin: 8px 0 0; }
.error { color: var(--red); margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.ok-pill { background: var(--green-soft); color: var(--green); } .warn-pill { background: var(--orange-soft); color: var(--orange); } .muted-pill { background: var(--surface-3); color: var(--faint); }
.columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.columns.wide-left { grid-template-columns: minmax(0, 1fr) 360px; }
.columns.narrow-right { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.stack { display: grid; gap: 0; }
@media (max-width: 1180px) { .columns, .columns.wide-left, .columns.narrow-right { grid-template-columns: 1fr; } }

/* ── KPIs and charts ── */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)) minmax(220px, 2fr); gap: 12px; margin-bottom: 18px; }
.kpis.wide { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpis > div, .kpis > a { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; align-content: center; box-shadow: var(--shadow); color: var(--text); }
.kpis > a:hover { border-color: var(--line-strong); text-decoration: none; }
.kpis b { font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; }
.kpis span, .kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-label { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.kpi .swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: var(--faint); }
.kpi.crash .swatch { background: var(--red); } .kpi.error .swatch { background: var(--orange); } .kpi.player .swatch { background: var(--blue); }
.kpi.attention b { color: var(--orange); } .kpi.alert b { color: var(--purple); }
.trend { font-style: normal; font-weight: 700; margin-left: 4px; } .trend.up { color: var(--red); } .trend.down { color: var(--green); }
.kpi-trend .bars { max-height: 40px; }
.chart { display: block; width: 100%; height: auto; }
.card .chart .axis, .card .chart .grid { display: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .axis { fill: var(--faint); font-size: 11px; }
.chart .crash { fill: var(--red); } .chart .error { fill: var(--orange); } .chart .player { fill: var(--blue); } .chart .zero { fill: var(--line-strong); }
.chart .hit { fill: transparent; } .chart g:hover rect:not(.hit) { filter: brightness(1.15); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .crash::before { background: var(--red); } .legend .error::before { background: var(--orange); } .legend .player::before { background: var(--blue); }
.bars { display: block; width: 100%; height: auto; max-height: 48px; }
.bars rect.bar { fill: var(--accent); opacity: .85; } .bars rect.zero { fill: var(--line-strong); }
.bars.mini { width: 152px; max-height: 24px; }

/* ── cards ── */
.cards, .game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-bottom: 18px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--text);
  box-shadow: var(--shadow); position: relative; overflow: hidden; transition: border-color .15s, transform .15s; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--game); opacity: .9; }
.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--game) 50%, var(--line)); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 17px; }
.chev { color: var(--faint); font-size: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stats b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.stats .warn b { color: var(--orange); }
.tile-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 10px 0 8px; }

/* ── rows, badges ── */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.row-link { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; padding: 10px 6px; color: var(--text); align-items: center; border-radius: 8px; }
.row-link:hover { text-decoration: none; background: var(--surface-2); }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { grid-column: 2; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.row-bar { grid-column: 2; height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.row-bar i { display: block; height: 100%; background: var(--red); opacity: .75; border-radius: 99px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.badge.open { background: var(--red-soft); color: var(--red); } .badge.regressed { background: var(--purple-soft); color: var(--purple); }
.badge.resolved { background: var(--green-soft); color: var(--green); } .badge.ignored { background: var(--surface-3); color: var(--faint); }
.badge.kind-crash { background: var(--red-soft); color: var(--red); } .badge.kind-error { background: var(--orange-soft); color: var(--orange); }
.badge.kind-bug { background: var(--blue-soft); color: var(--blue); } .badge.kind-feedback { background: var(--green-soft); color: var(--green); }
.badge.kind-logs { background: var(--surface-3); color: var(--muted); }

/* ── filters, segmented ── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 260px; }
.narrow { width: 140px; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented a, .segmented label { padding: 5px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; display: block; }
.segmented a:hover, .segmented label:hover { color: var(--text); text-decoration: none; }
.segmented .on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.segmented.full { display: flex; } .segmented.full label { flex: 1; text-align: center; }
.segmented input { display: none; }

/* ── tables ── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); margin-bottom: 18px; }
.table-wrap.flat { box-shadow: none; border-radius: 10px; }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tbody tr { cursor: pointer; } .list tbody tr.static { cursor: default; }
.list tbody tr:hover { background: var(--surface-2); }
.list tbody tr:last-child td { border-bottom: 0; }
.list.compact td, .list.compact th { padding: 9px 12px; }
.panel .list.compact { margin: 0; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.list .check { width: 34px; padding-right: 0; }
.cell-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cell-title a { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.cell-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
.clip { max-width: 260px; overflow-wrap: anywhere; }
.trend-col { width: 170px; }
@media (max-width: 760px) { .trend-col { display: none; } }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; }
.inline { display: inline; margin: 0; }
.bulk-bar { position: sticky; top: 10px; z-index: 5; display: none; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
  background: var(--surface-3); border: 1px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow); }
.bulk-bar.show { display: flex; }

/* ── detail pages ── */
.message { margin: 0 0 12px; overflow-wrap: anywhere; }
pre.code { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 14px 16px; font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; border: 1px solid var(--line); }
pre.code.scroll { max-height: 560px; overflow: auto; }
pre.small-code { font-size: 12px; padding: 10px 12px; white-space: pre-wrap; margin: 6px 0 4px; }
pre.code .own { color: var(--code-own); font-weight: 600; } pre.code .frame { opacity: .75; }
pre.code .head { color: #ff9b9e; } pre.code .path { color: var(--code-dim); font-weight: 400; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.shot { display: block; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.triage { display: grid; gap: 14px; }
.spread { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.spread li { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.meter { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.frames { margin: 0; padding-left: 20px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── settings ── */
.settings { display: grid; gap: 14px; }
.settings .panel { margin-bottom: 4px; }
.form-stack { display: grid; gap: 14px; max-width: 460px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2.tight { gap: 10px; }
.span-2 { grid-column: span 2; }
.stack-sm { display: grid; gap: 14px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-actions.sticky { position: sticky; bottom: 12px; padding: 10px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(8px); border-radius: 12px; }
.form-actions.bottom { align-items: flex-end; }
.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.toc { position: sticky; top: 20px; display: grid; gap: 2px; font-size: 13.5px; }
.toc a { color: var(--muted); padding: 6px 10px; border-radius: 8px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
@media (max-width: 960px) { .settings-layout { grid-template-columns: 1fr; } .toc { display: none; } }
.secret { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret input { flex: 1 1 320px; }
.big-mono { font-size: 18px; letter-spacing: .05em; }
.handover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; color: var(--muted); }
.steps li::marker { color: var(--faint); font-weight: 700; }
.steps li.done { color: var(--text); } .steps li.done::marker { content: "✓  "; color: var(--green); }
details.hook { border: 1px solid var(--line); border-radius: 12px; padding: 0; margin-bottom: 10px; background: var(--surface-2); }
details.hook summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; }
details.hook summary::-webkit-details-marker { display: none; }
details.hook[open] summary { border-bottom: 1px solid var(--line); }
details.hook > form, details.hook > .inline-actions { padding: 0 14px 14px; }
details.hook > form { padding-top: 14px; }
details.hook.new summary { color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--faint); font-size: 12.5px; white-space: nowrap; }

/* ── toast ── */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: min(460px, calc(100vw - 40px)); display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px 12px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: 0 12px 40px rgba(0,0,0,.35);
  animation: toast-in .2s ease; }
.toast.ok { border-left: 4px solid var(--green); } .toast.error { border-left: 4px solid var(--red); } .toast.warn { border-left: 4px solid var(--orange); }
.toast button { background: none; border: 0; padding: 0 2px; color: var(--muted); font-size: 18px; line-height: 1; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ── login, setup ── */
.bare .page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; display: grid; place-items: center; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card.wide { width: min(520px, 100%); }
.login-card form { display: grid; gap: 14px; margin-top: 20px; }
.login-card form + form { margin-top: 10px; }

/* ── game logos ── */
.game-dot.logo { background: transparent; box-shadow: none; overflow: hidden; border-radius: 6px; }
.game-dot.logo::after { display: none; }
.game-dot.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.game-dot.huge { width: 56px; height: 56px; border-radius: 14px; font-size: 28px; }
.game-dot.huge:empty::after { width: 16px; height: 16px; }
.game-dot.big.logo, .game-dot.huge.logo { border-radius: 12px; }
.game-hero { display: flex; align-items: center; gap: 16px; }
.game-hero .eyebrow { margin-bottom: 2px; }
.logo-edit { display: flex; gap: 18px; align-items: flex-start; }
.logo-edit .game-dot.huge { width: 88px; height: 88px; border-radius: 18px; }
.logo-edit input[type=file] { padding: 6px; }

/* ── build channels ── */
.channel-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin: 0 4px 12px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.channel-switch a { text-align: center; font-size: 12px; font-weight: 650; padding: 5px 0; border-radius: 7px; color: var(--muted); }
.channel-switch a:hover { color: var(--text); text-decoration: none; }
.channel-switch a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.channel-switch a.on.ch-release { color: var(--green); } .channel-switch a.on.ch-playtest { color: var(--blue); } .channel-switch a.on.ch-dev { color: var(--orange); }
.ch-tag { display: inline-block; font: 600 11px/1.6 "JetBrains Mono", Consolas, monospace; padding: 0 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.ch-tag.ch-release { background: var(--green-soft); color: var(--green); } .ch-tag.ch-playtest { background: var(--blue-soft); color: var(--blue); } .ch-tag.ch-dev { background: var(--orange-soft); color: var(--orange); }
.ch-pill { background: var(--accent-soft); color: var(--accent); }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ── file viewers ── */
.viewer-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.viewer-tabs button { border: 0; background: transparent; padding: 4px 12px; font-size: 13px; color: var(--muted); border-radius: 7px; }
.viewer-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.shot-frame { overflow: auto; max-height: 80vh; border-radius: 8px; }
.shot.zoomable { cursor: zoom-in; } .shot.zoomed { max-width: none; cursor: zoom-out; }
.logview { display: grid; gap: 10px; }
.log-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log-toolbar input[type=search] { flex: 1 1 200px; padding: 6px 10px; font-size: 13px; }
.log-stats { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-right: 4px; }
.small-seg a { padding: 3px 10px; font-size: 12.5px; }
.lvl-chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.lvl-chip.error { background: var(--red-soft); color: var(--red); } .lvl-chip.warn { background: var(--orange-soft); color: var(--orange); }
button.on { background: var(--accent-soft); border-color: var(--accent); }
.findings { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.findings summary { cursor: pointer; padding: 10px 12px; font-weight: 650; font-size: 13.5px; }
.findings ul { list-style: none; margin: 0; padding: 0 12px 10px; display: grid; gap: 6px; }
.findings li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.findings .count { font-variant-numeric: tabular-nums; color: var(--text); }
.findings a { color: var(--text); overflow-wrap: anywhere; }
.loglines { max-height: 620px; overflow: auto; background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0;
  font: 12.5px/1.55 "JetBrains Mono", "Cascadia Code", Consolas, monospace; color: var(--code-text); position: relative; }
.ll { display: grid; grid-template-columns: 56px 1fr; padding: 0 12px 0 0; white-space: pre; }
.wrap .ll { white-space: pre-wrap; overflow-wrap: anywhere; }
.ll .ln { color: var(--code-dim); text-align: right; padding-right: 12px; user-select: none; }
.ll .ln:hover { color: var(--code-text); text-decoration: none; }
.ll.lvl-error { background: rgba(255,107,112,.10); } .ll.lvl-error .lt { color: #ff9b9e; }
.ll.lvl-trace .lt { color: #d7a8aa; } .ll.lvl-trace { background: rgba(255,107,112,.05); }
.ll.lvl-warn { background: rgba(246,165,58,.08); } .ll.lvl-warn .lt { color: #f8c27a; }
.ll.hit { background: rgba(139,155,255,.16); }
.ll.focus { outline: 1px solid var(--accent); background: rgba(139,155,255,.22); }
.json-tree { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; max-height: 620px; overflow: auto;
  font: 12.5px/1.6 "JetBrains Mono", Consolas, monospace; color: var(--code-text); }
.json-tree details > summary { cursor: pointer; list-style: none; }
.json-tree details > summary::before { content: "▸ "; color: var(--code-dim); }
.json-tree details[open] > summary::before { content: "▾ "; }
.json-tree .j-body { padding-left: 18px; border-left: 1px dashed var(--line-strong); margin-left: 4px; }
.json-tree .j-leaf { padding-left: 14px; overflow-wrap: anywhere; }
.j-key { color: #9cc4ff; } .j-str { color: #b8e986; } .j-num { color: #ffd479; } .j-bool { color: #ff9bd0; } .j-null { color: var(--code-dim); }
.j-brace { color: var(--code-dim); } .j-count { color: var(--code-dim); font-size: 11.5px; }
.scroll-x { overflow-x: auto; max-height: 560px; }
.data-table td { max-width: 320px; overflow-wrap: anywhere; }

/* ── context spread of a group ── */
.context-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.context-field { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: grid; gap: 6px; align-content: start; }
.context-field.striking { border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); }
.cf-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.cf-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; }
.cf-value { overflow-wrap: anywhere; }
.cf-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.context-field.striking .meter i { background: var(--orange); }

/* ── step-by-step setup (Discord) ── */
.setup-step { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface-2); display: grid; gap: 10px; }
.setup-step.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.step-head h3 { margin: 0; font-size: 15px; }
.step-no { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-3); color: var(--muted); flex: none; }
.setup-step.current .step-no { background: var(--accent); color: #fff; }
.setup-step.done .step-no { background: var(--green-soft); color: var(--green); font-size: 0; }
.setup-step.done .step-no::before { content: "✓"; font-size: 14px; }
.clicks { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.55; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .grow { flex: 1 1 260px; min-width: 0; }
.inline-form label.grow { display: grid; gap: 4px; }
details.more > summary { cursor: pointer; color: var(--accent); font-size: 13.5px; }
details.more[open] { display: grid; gap: 8px; }
.faq { margin: 4px 0 0; display: grid; }
.faq dt { font-weight: 650; margin-top: 8px; } .faq dd { margin: 0; color: var(--muted); }

/* ── report status ── */
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.status-tabs a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; background: var(--surface); }
.status-tabs a:hover { color: var(--text); text-decoration: none; }
.status-tabs a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.status-tabs .count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.st-pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.st-pill.st-new { background: var(--blue-soft); color: var(--blue); }
.st-pill.st-progress { background: var(--orange-soft); color: var(--orange); }
.st-pill.st-done { background: var(--green-soft); color: var(--green); }
.st-pill.st-dismissed { background: var(--surface-3); color: var(--faint); text-decoration: line-through; }
tr.dim td { opacity: .55; }
.status-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.status-bar .grow { flex: 1 1 260px; min-width: 0; }
.status-choice { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.status-choice .st-btn { border: 0; background: transparent; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--muted); border-radius: 7px; }
.status-choice .st-btn:hover { color: var(--text); }
.status-choice .st-btn.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); color: var(--text); }
.status-choice .st-btn.on.st-new { color: var(--blue); } .status-choice .st-btn.on.st-progress { color: var(--orange); }
.status-choice .st-btn.on.st-done { color: var(--green); } .status-choice .st-btn.on.st-dismissed { color: var(--faint); }

/* ── attachments of a report ── */
.attach-group { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 12px 0 6px; }
details.attachment { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--surface-2); }
details.attachment > summary { display: flex; gap: 8px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
details.attachment > summary::-webkit-details-marker { display: none; }
details.attachment > summary::before { content: "▸"; color: var(--faint); width: 10px; }
details.attachment[open] > summary::before { content: "▾"; }
details.attachment[open] > summary { border-bottom: 1px solid var(--line); }
details.attachment .name { overflow-wrap: anywhere; font-size: 13px; }
details.attachment .grow { flex: 1; }
.attachment-body { padding: 12px; }
.file-icon { width: 18px; height: 18px; border-radius: 4px; background: var(--surface-3); flex: none; position: relative; }
.file-icon::after { position: absolute; inset: 0; display: grid; place-items: center; font: 700 9px/1 "JetBrains Mono", monospace; color: var(--muted); }
.fi-log::after { content: "LOG"; font-size: 7px; } .fi-json::after { content: "{}"; } .fi-table::after { content: "▦"; font-size: 11px; }
.fi-save::after { content: "💾"; font-size: 10px; } .fi-commands::after { content: "⌘"; } .fi-text::after { content: "T"; } .fi-file::after { content: "·"; }
.fi-log { background: var(--orange-soft); } .fi-json, .fi-table { background: var(--blue-soft); }
pre.code.clamp { max-height: 340px; overflow: auto; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
button.danger-fill { background: var(--red); border-color: var(--red); color: #fff; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
