/* LaunchTec Propellant UI. Brand tokens taken from launchtec.co: red #DA1F2C, black, white, #F7F7F7, text #404040, DM Sans.
   Charts pair brand red (the measure that matters) with ink (context). That is an emphasis pairing, not two categorical hues:
   validated for colour-blind separation (CVD dE 24 light / 28 dark) and >= 3:1 contrast on both surfaces. */
:root {
  color-scheme: light;
  --brand: #DA1F2C; --brand-dark: #B01822;
  --bg: #F7F7F7; --surface: #FFFFFF; --surface-2: #F0F0F0; --text: #111111; --text-2: #404040; --muted: #6B6B6B;
  --grid: #E6E6E6; --axis: #C7C7C7; --border: rgba(0,0,0,.10); --border-strong: rgba(0,0,0,.20);
  --accent: #DA1F2C; --accent-ink: #FFFFFF; --accent-soft: rgba(218,31,44,.08);
  --series-1: #DA1F2C; --series-2: #1A1A1A; --ink-bar: #1A1A1A;
  --good: #0CA30C; --good-text: #006300; --good-soft: rgba(12,163,12,.10); --warn: #FAB219; --warn-text: #8A5A00; --crit: #D03B3B;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.08);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0B0B; --surface: #151515; --surface-2: #1F1F1F; --text: #F2F2F2; --text-2: #C7C7C7; --muted: #8F8F8F;
  --grid: #2A2A2A; --axis: #3A3A3A; --border: rgba(255,255,255,.10); --border-strong: rgba(255,255,255,.20);
  --accent: #EF4B55; --accent-soft: rgba(239,75,85,.14);
  --series-1: #EF4B55; --series-2: #E8E8E8; --ink-bar: #E8E8E8;
  --good-text: #0CA30C; --good-soft: rgba(12,163,12,.16); --warn-text: #FAB219;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0B0B; --surface: #151515; --surface-2: #1F1F1F; --text: #F2F2F2; --text-2: #C7C7C7; --muted: #8F8F8F;
    --grid: #2A2A2A; --axis: #3A3A3A; --border: rgba(255,255,255,.10); --border-strong: rgba(255,255,255,.20);
    --accent: #EF4B55; --accent-soft: rgba(239,75,85,.14);
    --series-1: #EF4B55; --series-2: #E8E8E8; --ink-bar: #E8E8E8;
    --good-text: #0CA30C; --good-soft: rgba(12,163,12,.16); --warn-text: #FAB219;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; } h2 { font-size: 16px; font-weight: 700; } h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.col { display: flex; flex-direction: column; gap: 8px; } .spread { justify-content: space-between; } .end { justify-content: flex-end; }
.stack { display: grid; gap: 16px; } .stack > * { min-width: 0; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell: one top bar (logo, project, menu, everyday actions). No side menu, no hamburger. */
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 16px; height: 66px; padding: 0 22px; color: #fff;
  background: linear-gradient(90deg, #0A0A0A 0%, #12090A 55%, #3F0A10 140%); border-bottom: 1px solid rgba(255,255,255,.07); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.tb-brand { display: block; text-decoration: none; padding: 6px 0; }
.tb-logo { display: block; width: 138px; height: auto; }
.tb-sub, .wm-sub { display: block; margin-top: 5px; font-size: 9px; font-weight: 800; letter-spacing: .34em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.wm-sub.on-light { color: #6B6B6B; }
.wm-wrap { display: block; } .wm-logo { display: block; width: 100%; height: auto; }
.tb-project { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 240px; padding: 0 12px 0 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.06); color: #fff; font-weight: 700; cursor: pointer; }
.tb-project:hover { background: rgba(255,255,255,.12); }
.tb-project .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-project .plabel { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.topnav { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 8px 4px; }  /* overflow clips anything that bleeds out of it, so no big outer glows inside it */
.topnav::-webkit-scrollbar { display: none; }
.topnav a, .tb-link { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; white-space: nowrap; flex: none;
  color: rgba(255,255,255,.74); font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, color .15s, box-shadow .15s; }
.topnav a:hover, .tb-link:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.topnav a.active, .tb-link.active { color: #fff; background: linear-gradient(145deg, #EF3E49, #C3131F); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.35); }
.nav-short { display: none; }
.tb-actions { display: flex; align-items: center; gap: 8px; }
.tb-btn { height: 38px; min-width: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 0; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); cursor: pointer; font-weight: 600; }
.tb-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.tb-btn .uname { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-link { padding: 0 12px; } .tb-ver { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.12); }
.tb-link.active .tb-ver { background: rgba(255,255,255,.25); }
.tb-link .pip { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #120a0b; }
.tb-link.active .pip { display: none; }
.tb-status { display: inline-flex; align-items: center; gap: 7px; padding: 0 4px; font-size: 12px; color: rgba(255,255,255,.65); }
.ring { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.ring.ok { background: #2FD45A; animation: ring-ping 2.4s infinite; } .ring.bad { background: var(--crit); }
@keyframes ring-ping { 0% { box-shadow: 0 0 0 0 rgba(47,212,90,.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(47,212,90,0); } }
.main { padding: 26px 36px 64px; min-width: 0; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head > div:first-child { min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
@media (max-width: 1180px) { .live-lbl, .tb-btn .uname, .tb-project .plabel { display: none; } .topbar { gap: 10px; padding: 0 14px; } .topnav { gap: 2px; } .topnav a { padding: 0 10px; } .topnav a > svg { display: none; } .tb-project { max-width: 170px; } .tb-actions { gap: 6px; } }
@media (max-width: 1080px) { .tb-ver { display: none; } .tb-link { padding: 0 10px; } }
@media (max-width: 960px) { .tb-logo { width: 118px; } .topnav a { padding: 0 9px; } .tb-project { max-width: 150px; } }
@media (max-width: 880px) {  /* too narrow for one row: logo, project and buttons on top, the pages on a row of their own */
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; height: auto; row-gap: 2px; padding: 8px 12px 6px; }
  .tb-logo { width: 104px; } .topnav { grid-column: 1 / -1; grid-row: 2; padding: 4px 0 2px; gap: 0; justify-content: space-between; } .topnav a { height: 36px; padding: 0 8px; }
  .nav-long { display: none; } .nav-short { display: inline; }
  .tb-project { justify-self: start; max-width: 100%; min-width: 0; height: 36px; } .tb-project .plabel { display: none; }
  .tb-status { display: none; }
}
@media (max-width: 760px) { .main { padding: 16px 14px 48px; } h1 { font-size: 22px; } }

/* ---------- updates page */
.timeline { display: grid; gap: 16px; max-width: 880px; }
.rel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ver-badge { background: var(--brand); color: #fff; border-radius: 999px; padding: 2px 11px; font-weight: 800; font-size: 12px; letter-spacing: .02em; }
.rel-date { color: var(--muted); font-size: 12px; }
.rel-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rel-items li { display: flex; gap: 10px; align-items: baseline; }
.kind { flex: none; min-width: 74px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.kind.new { background: var(--accent-soft); color: var(--accent); } .kind.improved { background: var(--good-soft); color: var(--good-text); } .kind.fixed { background: var(--surface-2); color: var(--text-2); }
.card.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }

/* ---------- primitives */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; min-width: 0; }
.card h2 { margin-bottom: 2px; } .card .sub { color: var(--text-2); font-size: 12px; margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } .g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g-main, .g3, .g-4 { grid-template-columns: 1fr 1fr; } .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g-main { grid-template-columns: minmax(0, 1fr); } .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }  /* minmax(0,...) so a wide table scrolls inside its card instead of stretching the page */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; color: var(--text); text-decoration: none; transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { background: var(--surface-2); text-decoration: none; } .btn:disabled { opacity: .5; cursor: not-allowed; } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; border-color: transparent; } .btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--crit); } .btn.sm { padding: 4px 8px; font-size: 12px; } .btn.icon { padding: 6px; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn.working { position: relative; color: transparent !important; } .btn.working::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin .7s linear infinite; }
.btn.primary.working::after { border-color: #fff; border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.input, .select, .textarea { width: 100%; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; } .input.sm, .select.sm { padding: 4px 8px; font-size: 12px; width: auto; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; min-width: 0; }
label.field .hint { font-weight: 400; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; } label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; white-space: nowrap; border: 1px solid var(--border); max-width: 100%; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.chip.ok { background: var(--good-soft); color: var(--good-text); border-color: transparent; font-weight: 600; }
.chip.warn { color: var(--warn-text); background: rgba(250,178,25,.18); border-color: transparent; font-weight: 600; } .chip.bad { color: var(--crit); background: rgba(208,59,59,.10); border-color: transparent; font-weight: 600; }
.chip button { border: 0; background: transparent; padding: 0 0 0 2px; cursor: pointer; display: inline-flex; color: inherit; }
.tabs { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 8px; gap: 2px; flex-wrap: wrap; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 14px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.10); }
.empty { text-align: center; padding: 40px 16px; color: var(--text-2); } .empty h3 { margin-bottom: 6px; } .empty svg { color: var(--muted); opacity: .7; margin-bottom: 8px; } .empty p { max-width: 520px; margin: 0 auto 14px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.banner > svg { flex: none; margin-top: 1px; } .banner > div { min-width: 0; } .banner p:last-child { margin-bottom: 0; }
.banner.ok { background: var(--good-soft); border-color: transparent; } .banner.warn { background: rgba(250,178,25,.14); border-color: transparent; } .banner.bad { background: rgba(208,59,59,.10); border-color: transparent; }
.banner.warn > svg { color: var(--warn-text); } .banner.bad > svg { color: var(--crit); } .banner.ok > svg { color: var(--good-text); }
table.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; } .tbl tr:last-child td { border-bottom: 0; } .tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.tbl-wrap { overflow-x: auto; }
.tbl th.sortable { padding: 0; } .tbl th.sortable button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px; width: 100%; padding: 6px 10px; cursor: pointer; font: inherit; color: inherit; }
.tbl th.sortable.num button { justify-content: flex-end; } .tbl th.sortable button:hover { color: var(--text); } .tbl th.sorted button { color: var(--text); }
.tbl th.sortable button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.tbl td.kw { font-weight: 600; min-width: 180px; overflow-wrap: anywhere; }
.scorebar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; } .scorebar .meter { width: 44px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }

/* ---------- popover menus (project switcher, user menu, export, column chooser) */
.pop { position: absolute; z-index: 45; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto; padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-weight: 500; text-align: left; cursor: pointer; text-decoration: none; }
.pop-item:hover, .pop-item:focus-visible { background: var(--surface-2); text-decoration: none; } .pop-item.on { font-weight: 700; } .pop-item.on > svg { color: var(--accent); }
.pop-item > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pop-note { color: var(--muted); font-size: 12px; }
.pop-head { padding: 6px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.pop label.check { padding: 6px 10px; border-radius: 6px; } .pop label.check:hover { background: var(--surface-2); }

/* ---------- drawer / modal / toast */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; animation: fade .18s ease-out; } @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal { position: fixed; z-index: 52; top: 6vh; left: 50%; transform: translateX(-50%); width: min(760px, 94vw); max-height: 88vh; overflow-y: auto; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 12px; padding: 20px 24px; box-shadow: var(--shadow); }
.modal.narrow { width: min(520px, 94vw); } .modal h2 { font-size: 18px; margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: #111; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: slide .18s ease-out; border-left: 3px solid var(--brand); }
.toast.bad { background: var(--crit); border-left-color: #fff; }
.section { margin-top: 20px; } .section > h3 { margin-bottom: 8px; }

/* ---------- charts */
.chart { width: 100%; position: relative; } .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); } .chart .grid line { stroke: var(--grid); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; color: var(--text-2); font-size: 12px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; transform: translate(-50%, -100%); margin-top: -10px; }
.tip b { font-weight: 700; } .tip .r { display: flex; gap: 8px; align-items: center; } .tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kpi { padding: 14px 16px; border-top: 3px solid var(--brand); } .kpi .l { color: var(--text-2); font-size: 12px; font-weight: 600; } .kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; overflow-wrap: anywhere; } .kpi .d { font-size: 12px; color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ink-bar) 14%, var(--surface)); overflow: hidden; } .meter > i { display: block; height: 100%; border-radius: 4px; background: var(--ink-bar); }
.meter.warn > i { background: var(--warn); } .meter.bad > i { background: var(--crit); }
.table-toggle { float: right; } .spark { display: block; margin-left: auto; }

/* ---------- report shell */
.report-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.report-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .input { flex: 1 1 200px; max-width: 320px; height: 34px; padding-top: 0; padding-bottom: 0; }
.toolbar .select { width: auto; height: 34px; padding-top: 0; padding-bottom: 0; } .toolbar .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; margin-bottom: 12px; border-radius: 8px; background: var(--surface-2); }
.filter-form .select, .filter-form .input { width: auto; flex: 1 1 120px; max-width: 220px; height: 34px; padding-top: 0; padding-bottom: 0; }
.raw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tree { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; margin-top: 12px; max-height: 70vh; overflow-y: auto; }
.tree details { margin-left: 16px; } .tree > details { margin-left: 0; } .tree summary { cursor: pointer; white-space: nowrap; } .tree summary:hover { color: var(--accent); }
.tree .leaf { margin-left: 16px; padding-left: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tree .k { color: var(--text); font-weight: 600; } .tree .s { color: var(--good-text); } .tree .n { color: var(--accent); } .tree .z { color: var(--muted); } .tree .c { color: var(--muted); font-weight: 400; }
.pending { display: flex; gap: 14px; align-items: center; } .pending .ring { flex: none; }

/* ---------- login (echoes the site's deep-red hero) */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 30% 10%, #B3141F 0%, #7A0C14 45%, #2A0406 100%); }
.login { width: min(400px, 100%); padding: 28px; border: 0; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login.wide { width: min(520px, 100%); }
.login .wm-wrap { width: 210px; }
.keybox { font-family: var(--mono); font-size: 15px; letter-spacing: .04em; padding: 12px; border-radius: 10px; background: var(--surface-2); user-select: all; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-family: var(--mono); font-size: 14px; padding: 12px; border-radius: 10px; background: var(--surface-2); user-select: all; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- phone: finger-sized controls, no zoom-on-focus */
@media (max-width: 760px) {
  .btn { min-height: 44px; } .btn.sm { min-height: 38px; } .btn.icon { min-width: 44px; justify-content: center; }
  .input, .select, .textarea { font-size: 16px; min-height: 44px; } .textarea { min-height: 96px; }
  .tabs button { min-height: 40px; } .pop-item { min-height: 44px; }
  .toolbar .input { max-width: none; flex-basis: 100%; height: 44px; } .toolbar .select, .filter-form .select, .filter-form .input { height: 44px; max-width: none; }
  .toolbar .count { margin-left: 0; flex-basis: 100%; }
  .modal { padding: 16px; top: 3vh; max-height: 94vh; } .kv { grid-template-columns: 110px 1fr; }
  .report-bar .tabs { width: 100%; } .report-bar .tabs button { flex: 1; justify-content: center; }
}

/* ---------- print: the report on white paper, nothing else */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F3F3F3; --text: #000000; --text-2: #333333; --muted: #555555;
    --grid: #DDDDDD; --axis: #BBBBBB; --border: rgba(0,0,0,.25); --border-strong: rgba(0,0,0,.4);
    --accent: #B01822; --series-1: #DA1F2C; --series-2: #1A1A1A; --ink-bar: #1A1A1A; --good-text: #006300; --warn-text: #8A5A00; --shadow: none;
  }
  html, body { height: auto; background: #fff; }
  .topbar, .no-print, .toasts, .scrim, .modal, .pop, .table-toggle { display: none !important; }
  .main { padding: 0; max-width: none; } .card { border: 0; padding: 0; break-inside: avoid; } .card.kpi { border-top: 2px solid #000; padding-top: 6px; }
  .tbl-wrap, .tree { overflow: visible; max-height: none; } .tbl { font-size: 10px; } .tbl td, .tbl th { padding: 4px 6px; } .tbl tr { break-inside: avoid; } .tbl thead { display: table-header-group; }
  .tbl td.kw { min-width: 0; } a { color: inherit; }
  .print-only { display: block !important; }
  @page { margin: 14mm; }
}
.print-only { display: none; }
