/* Error Tracker dashboard: monochrome, monospace, grid-panel look. Tokens → base → shell → components → pages. */

:root {
  --bg: #0b0b0c;
  --panel: #111112;
  --panel-2: #181819;
  --line: #262628;
  --line-strong: #3a3a3d;
  --fg: #f4f4f5;
  --fg-2: #c9c9cc;
  --muted: #84848a;
  --faint: #4a4a4f;
  --bar: #f4f4f5;
  --bar-dim: #3d3d41;
  --invert-bg: #f4f4f5;
  --invert-fg: #0b0b0c;
  --danger: #ff6b6b;
  --grid-dot: rgba(255, 255, 255, 0.05);
  --green: #5fd38d;
  --amber: #f0b44c;
  --modal-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  --font: var(--mono);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f3f5fb;
  --panel: #ffffff;
  --panel-2: #f6f8fd;
  --line: #e4e8f3;
  --line-strong: #d2d9ea;
  --fg: #0f1b3a;
  --fg-2: #39456a;
  --muted: #6a7596;
  --faint: #a9b2cc;
  --bar: #4b84e6;
  --bar-dim: #d3e0f8;
  --invert-bg: #12285a;
  --invert-fg: #ffffff;
  --danger: #d6313f;
  --accent: #3b72dc;
  --accent-soft: #e8f0ff;
  --green: #1f9d62;
  --green-soft: #e3f6ec;
  --red: #e0454f;
  --red-soft: #fdeaec;
  --amber: #c27a0a;
  --amber-soft: #fff1d9;
  --violet: #7a5af0;
  --violet-soft: #efeaff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 38, 90, 0.05), 0 8px 24px rgba(20, 38, 90, 0.05);
  --modal-shadow: 0 30px 80px rgba(20, 38, 90, 0.25);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font: 13px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--fg); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; }
code, .mono { font-family: var(--mono); font-size: 12px; }
h1 { font-size: 20px; line-height: 1.25; margin: 0; font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 11px; margin: 0 0 14px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
::selection { background: var(--fg); color: var(--bg); }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Shell: sidebar + content ---------- */
.shell { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar {
  position: sticky; top: 0; align-self: flex-start; height: 100vh; width: 232px; flex: none;
  display: flex; flex-direction: column; padding: 20px 14px; background: var(--panel); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 16px; height: 16px; background: var(--fg); flex: none; }
.nav { display: grid; gap: 2px; }
.nav a, .nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 4px;
  background: none; color: var(--muted); font: inherit; text-align: left; cursor: pointer; box-shadow: none;
}
.nav a:hover, .nav-btn:hover { color: var(--fg); background: var(--panel-2); text-decoration: none; }
.nav a.active { color: var(--fg); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--fg); }
.nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-bottom { margin-top: auto; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 32px; background: var(--bg); border-bottom: 1px solid var(--line); }
.crumbs { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--fg); }
.crumbs > :last-child { color: var(--fg); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; }
.crumbs > span:not(:last-child) { color: var(--faint); }
.theme-toggle { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.theme-toggle button { width: 30px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 3px; background: none; color: var(--muted); box-shadow: none; }
.theme-toggle button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle button.active { background: var(--invert-bg); color: var(--invert-fg); }
.theme-toggle button.active svg { fill: currentColor; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 32px 80px; }

/* ---------- Controls ---------- */
button, .button {
  font: inherit; cursor: pointer; border-radius: 4px; padding: 7px 14px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--fg); transition: background 0.12s, border-color 0.12s, color 0.12s;
}
button:hover:not(:disabled) { background: var(--panel-2); border-color: var(--muted); }
button.primary { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-fg); font-weight: 700; }
button.primary:hover:not(:disabled) { background: var(--fg-2); border-color: var(--fg-2); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { background: var(--panel-2); border-color: transparent; color: var(--fg); }
button.danger { color: var(--danger); }
button.danger:hover:not(:disabled) { border-color: var(--danger); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
input, select { font: inherit; padding: 8px 12px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--fg); }
input::placeholder { color: var(--faint); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
input[type='checkbox'] { accent-color: var(--fg); cursor: pointer; width: 15px; height: 15px; margin: 2px 0 0; padding: 0; }
select { cursor: pointer; }

/* ---------- Panels ---------- */
.card, .panel { background: var(--panel); border: 1px solid var(--line); position: relative; }
.card-body { padding: 22px; }
.section { margin-top: 20px; }
.panel { padding: 18px 20px; min-width: 0; }
.panel::before, .panel::after, .card.project::before, .card.project::after {
  content: '+'; position: absolute; width: 11px; height: 11px; line-height: 11px; text-align: center; font-size: 13px; color: var(--faint); background: var(--bg); z-index: 1;
}
.panel::before, .card.project::before { top: -6px; left: -6px; }
.panel::after, .card.project::after { bottom: -6px; right: -6px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.panel-title { font-size: 20px; color: var(--fg); margin: 2px 0 0; font-weight: 400; }
.big { font-size: 26px; line-height: 1.2; color: var(--fg); }
.big small { font-size: 13px; color: var(--muted); margin-left: 6px; }
.delta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty-state { padding: 60px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-state h2 { margin: 0; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--fg); }
.empty-state p { margin: 0; color: var(--muted); max-width: 460px; }
.empty-icon { width: 44px; height: 44px; border: 1px solid var(--line-strong); display: grid; place-items: center; margin-bottom: 12px; color: var(--fg); }
.empty-icon svg { width: 20px; height: 20px; }
.notice { padding: 11px 14px; border: 1px solid var(--line-strong); background: var(--panel-2); }
.notice.error { color: var(--danger); border-color: var(--danger); background: transparent; }
.page-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.page-sub { margin: 8px 0 22px; color: var(--muted); }

.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 48px 0; justify-content: center; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--fg); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } * { transition: none !important; } }

/* ---------- Dashboard overview ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--panel); color: var(--muted); padding: 8px 14px; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.active { background: var(--invert-bg); color: var(--invert-fg); font-weight: 700; }
.dash-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid .span-2 { grid-column: span 2; }
.dash-grid .span-3 { grid-column: span 3; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); font-size: 10px; fill: var(--muted); }
.chart .bar { fill: var(--bar); }
.chart .bar.dim { fill: var(--bar-dim); }
.chart .grid-line { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 14px; margin-bottom: 10px; font-size: 11.5px; color: var(--fg-2); }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--bar); }
.legend i.dim { background: var(--bar-dim); }
.ticks { display: flex; gap: 2px; height: 28px; margin: 14px 0 10px; }
.ticks i { flex: 1; background: var(--bar-dim); }
.ticks i.on { background: var(--bar); }
.tick-legend { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 14px; }
.list-lines { display: grid; gap: 8px; }
.list-lines a, .list-lines div { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--fg); }
.list-lines a:hover { text-decoration: none; background: var(--panel-2); }
.list-lines .k::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--bar); margin-right: 8px; }
.list-lines .k.off::before { background: var(--bar-dim); }
.hbars { display: grid; gap: 12px; }
.hbar-row { display: grid; gap: 5px; font-size: 11.5px; }
.hbar-row .top { display: flex; justify-content: space-between; gap: 10px; }
.hbar-row .top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { height: 8px; background: var(--bar-dim); }
.hbar i { display: block; height: 100%; background: var(--bar); }
a.hbar-row { color: var(--fg); }
a.hbar-row:hover { text-decoration: none; }
a.hbar-row:hover .top span:first-child { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Projects ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card.project { transition: border-color 0.15s; }
.card.project:hover { border-color: var(--fg); }
.project-card { display: block; color: var(--fg); padding: 20px; }
.project-card:hover { text-decoration: none; }
.project-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.project-top h2 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--fg); font-weight: 500; }
.avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--invert-fg); background: var(--invert-bg); }
.avatar.lg { width: 40px; height: 40px; font-size: 18px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--panel); padding: 12px; }
.stat b { display: block; font-size: 22px; line-height: 1.2; font-weight: 400; }
.key-hint { margin-top: 14px; color: var(--muted); font-size: 11.5px; }
.key-box { margin-top: 12px; padding: 14px; border: 1px dashed var(--line-strong); background: var(--panel-2); }
.key-box code { word-break: break-all; }

/* ---------- Tags (event type / status) ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 1px 7px; font-size: 10.5px; line-height: 1.6; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line-strong); color: var(--fg-2); white-space: nowrap; vertical-align: middle; border-radius: 2px;
}
.badge.crash, .badge.regressed { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-fg); font-weight: 700; }
.badge.error { border-color: var(--fg); color: var(--fg); }
.badge.performance { border-style: dashed; }
.badge.message, .badge.info { border-style: dotted; color: var(--muted); }
.badge.open { border-color: var(--fg); color: var(--fg); }
.badge.resolved, .badge.ignored { color: var(--muted); border-color: var(--line); }

/* ---------- Tabs & filters ---------- */
.tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 9px 16px; margin-bottom: -1px; }
.tabs button:hover:not(:disabled) { background: none; color: var(--fg); }
.tabs button.active { color: var(--fg); border-bottom-color: var(--fg); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type='search'] { flex: 1; min-width: 220px; padding-left: 36px; background-repeat: no-repeat; background-position: 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='none' stroke='%2384848a' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.bulk { margin: 0 0 12px; }

/* ---------- Issue list ---------- */
.issue-list { overflow: hidden; }
.list-head, .issue-row { display: grid; grid-template-columns: 28px 1fr 90px 120px; gap: 14px; }
.list-head { padding: 10px 20px; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; background: var(--panel-2); border-bottom: 1px solid var(--line); align-items: center; }
.list-head span:not(:first-of-type) { text-align: right; }
.list-head span:nth-child(2) { text-align: left; }
.issue-row { align-items: start; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--fg); position: relative; }
.issue-row:hover { background: var(--panel-2); text-decoration: none; }
.issue-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; }
.issue-row.sev-crash::before { background: var(--fg); width: 4px; }
.issue-row.sev-error::before { background: var(--fg); }
.issue-row.sev-performance::before { background: var(--muted); }
.issue-title { font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.issue-msg { color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.issue-meta { color: var(--muted); font-size: 11.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue-count { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.issue-when { text-align: right; color: var(--muted); font-size: 11.5px; }
.pager { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 16px; }

/* ---------- Issue detail ---------- */
.issue-header { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.issue-header .title { flex: 1; min-width: 260px; }
.issue-header h1 { margin-top: 14px; }
.issue-header .message { color: var(--fg-2); word-break: break-word; margin-top: 8px; font-size: 13.5px; }
.culprit { margin-top: 14px; padding: 5px 10px; border: 1px solid var(--line); background: var(--panel-2); display: inline-block; color: var(--muted); }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.meta div span { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.meta div b { font-weight: 400; font-size: 14px; }
.detail { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.detail > div > .section:first-child { margin-top: 0; }
.events-list { max-height: 72vh; overflow: auto; }
.events-list button { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 11px 16px; background: none; position: relative; }
.events-list button:first-child { border-top: 0; }
.events-list button:hover:not(:disabled) { background: var(--panel-2); }
.events-list button.active { background: var(--panel-2); }
.events-list button.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--fg); }
.frames { border: 1px solid var(--line); }
.frame { padding: 9px 14px; border-top: 1px solid var(--line); background: var(--panel); word-break: break-all; }
.frames > :first-child { border-top: 0; }
.frame.dim { background: var(--panel-2); }
.frame.dim .fn { color: var(--muted); }
.frame.focus { box-shadow: inset 2px 0 0 var(--fg); }
.frame-tag { display: inline-block; max-width: 100%; margin-left: 8px; padding: 0 6px; border: 1px solid var(--line-strong); font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.frame-group { border-top: 1px solid var(--line); background: var(--panel-2); }
.frame-group > summary { padding: 7px 14px; font-size: 11.5px; }
.frame-group[open] > summary { border-bottom: 1px solid var(--line); }
.frame-group > .frame:first-of-type { border-top: 0; }
/* "What happened" and "Last moments" (public/insights.js) */
.facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 9px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.timeline li > span:last-child { overflow-wrap: anywhere; }
.tone-bad, .moments li.tone-bad .moment-msg { color: var(--danger); }
.tone-warn, .moments li.tone-warn .moment-msg { color: var(--amber); }
.moments li.tone-user .moment-msg { font-weight: 600; }
.moments li.moment-error { color: var(--danger); font-weight: 600; }
.look { margin-top: 18px; padding: 10px 14px; background: var(--panel-2); border: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--fg); display: grid; gap: 4px; }
.look code, .look div { overflow-wrap: anywhere; }
.look-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.hint { margin-top: 12px; padding: 10px 14px; border: 1px dashed var(--line-strong); }
.hint p { margin: 4px 0 0; }
.field textarea { width: 100%; padding: 10px 12px; font: inherit; font-family: var(--mono); font-size: 12.5px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--fg); resize: vertical; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 84px 100px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); align-items: center; }
.timeline li:first-child { border-top: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
details summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
details summary:hover { color: var(--fg); }
details pre, .card pre.mono { margin-top: 8px; padding: 14px; background: var(--panel-2); border: 1px solid var(--line); max-height: 400px; overflow: auto; }
.key-box pre { padding: 0; margin: 0; background: none; border: 0; }
.stack-text { margin-top: 14px; }
.stack-text-bar { margin-top: 8px; }
/* Rows that jump to their item in the raw event JSON (showInJson in app.js). */
.jump { cursor: pointer; }
.timeline li.jump:hover, .frame.jump:hover, .look.jump:hover { background: var(--panel-2); }
.json-hit { background: var(--line-strong); color: var(--fg); }
:root[data-theme='light'] .json-hit { background: var(--accent-soft); color: var(--invert-bg); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid .span-3 { grid-column: span 2; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; }
  .brand { padding: 0 8px 0 0; font-size: 12px; }
  .nav { display: flex; gap: 2px; }
  .nav a, .nav-btn { padding: 7px 9px; width: auto; }
  .nav a svg, .nav-btn svg { display: none; }
  .nav a.active { box-shadow: none; }
  .nav-bottom { margin-left: auto; margin-top: 0; }
  .topbar { height: 54px; padding: 0 16px; }
  main { padding: 20px 16px 60px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span-2, .dash-grid .span-3 { grid-column: auto; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .events-list { max-height: 240px; }
  .issue-row, .list-head { grid-template-columns: 24px 1fr 60px; padding-left: 16px; padding-right: 16px; }
  .issue-when, .list-head span:last-child { display: none; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .timeline li { grid-template-columns: 74px minmax(0, 1fr); }
  .timeline li .bc-type { display: none; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}

/* ==========================================================================
   Light theme: soft, colourful, rounded (the dark theme above is untouched)
   ========================================================================== */
:root[data-theme='light'] .big,
:root[data-theme='light'] .stat b,
:root[data-theme='light'] .issue-count,
:root[data-theme='light'] .meta div b,
:root[data-theme='light'] .frame,
:root[data-theme='light'] .issue-meta,
:root[data-theme='light'] .key-hint,
:root[data-theme='light'] .list-lines,
:root[data-theme='light'] .hbar-row .top span:last-child,
:root[data-theme='light'] .kv dd,
:root[data-theme='light'] .timeline li > span:first-child { font-family: var(--mono); }
:root[data-theme='light'] h1 { font-weight: 700; letter-spacing: -0.02em; }
:root[data-theme='light'] h2,
:root[data-theme='light'] .panel-head,
:root[data-theme='light'] .list-head,
:root[data-theme='light'] .meta div span { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
:root[data-theme='light'] .panel-head { color: var(--fg-2); font-weight: 500; }
:root[data-theme='light'] .panel-title { font-weight: 600; font-size: 18px; }

/* shell */
:root[data-theme='light'] .brand { letter-spacing: 0.02em; }
:root[data-theme='light'] .brand-mark { border-radius: 8px; background: linear-gradient(135deg, #5b9bff, #2a55c9); box-shadow: 0 4px 10px rgba(42, 85, 201, 0.35); width: 24px; height: 24px; }
:root[data-theme='light'] .nav a, :root[data-theme='light'] .nav-btn { border-radius: var(--radius-sm); }
:root[data-theme='light'] .nav a.active { background: #fff; color: var(--fg); box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px rgba(20, 38, 90, 0.08); font-weight: 600; }
:root[data-theme='light'] .nav a.active svg { color: var(--accent); }
:root[data-theme='light'] .topbar { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px); }
:root[data-theme='light'] .crumbs > :last-child { font-weight: 700; }
:root[data-theme='light'] .theme-toggle { border-radius: 999px; }
:root[data-theme='light'] .theme-toggle button { border-radius: 999px; }

/* controls */
:root[data-theme='light'] button, :root[data-theme='light'] .button { border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgba(20, 38, 90, 0.05); }
:root[data-theme='light'] button.primary { background: var(--invert-bg); border-color: var(--invert-bg); font-weight: 600; box-shadow: 0 4px 12px rgba(18, 40, 90, 0.25); }
:root[data-theme='light'] button.primary:hover:not(:disabled) { background: #1c3a80; border-color: #1c3a80; }
:root[data-theme='light'] button.ghost,
:root[data-theme='light'] .tabs button,
:root[data-theme='light'] .theme-toggle button,
:root[data-theme='light'] .nav-btn,
:root[data-theme='light'] .events-list button { box-shadow: none; }
:root[data-theme='light'] input, :root[data-theme='light'] select { border-radius: var(--radius-sm); }
:root[data-theme='light'] input:focus, :root[data-theme='light'] select:focus,
:root[data-theme='light'] button:focus-visible, :root[data-theme='light'] a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
:root[data-theme='light'] input[type='checkbox'] { accent-color: var(--accent); }
:root[data-theme='light'] .seg { border-radius: 999px; padding: 3px; background: var(--panel); }
:root[data-theme='light'] .seg button { border-radius: 999px; border: 0; box-shadow: none; background: transparent; }
:root[data-theme='light'] .seg button + button { border-left: 0; }
:root[data-theme='light'] .seg button.active { background: var(--accent-soft); color: var(--accent); }
:root[data-theme='light'] .tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* panels */
:root[data-theme='light'] .card, :root[data-theme='light'] .panel { border-radius: var(--radius); box-shadow: var(--shadow); }
:root[data-theme='light'] .panel::before, :root[data-theme='light'] .panel::after,
:root[data-theme='light'] .card.project::before, :root[data-theme='light'] .card.project::after { display: none; }
:root[data-theme='light'] .panel { padding: 20px 22px; }
:root[data-theme='light'] .big { font-weight: 600; }
:root[data-theme='light'] .delta { color: var(--green); font-weight: 500; }
:root[data-theme='light'] .card.project:hover { border-color: var(--accent); box-shadow: 0 10px 28px rgba(59, 114, 220, 0.16); }
:root[data-theme='light'] .empty-icon { border: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }

/* charts */
:root[data-theme='light'] .chart .bar { rx: 3px; }
:root[data-theme='light'] .legend i { border-radius: 2px; }
:root[data-theme='light'] .ticks i { border-radius: 2px; background: var(--red-soft); }
:root[data-theme='light'] .ticks i.on { background: var(--green); }
:root[data-theme='light'] .hbar { border-radius: 999px; overflow: hidden; background: var(--accent-soft); }
:root[data-theme='light'] .hbar i { border-radius: 999px; background: linear-gradient(90deg, #6aa3ff, #3b72dc); }
:root[data-theme='light'] .type-error .hbar i { background: linear-gradient(90deg, #ff8a93, #e0454f); }
:root[data-theme='light'] .type-crash .hbar i { background: linear-gradient(90deg, #c2415b, #8e1f3a); }
:root[data-theme='light'] .type-performance .hbar i { background: linear-gradient(90deg, #ffc468, #f09a1a); }
:root[data-theme='light'] .type-error .hbar { background: var(--red-soft); }
:root[data-theme='light'] .type-crash .hbar { background: #f7e4ea; }
:root[data-theme='light'] .type-performance .hbar { background: var(--amber-soft); }
:root[data-theme='light'] .list-lines .k::before { background: var(--green); border-radius: 50%; }
:root[data-theme='light'] .list-lines .k.off::before { background: var(--faint); }
:root[data-theme='light'] .list-lines a { padding: 4px 6px; margin: 0 -6px; border-radius: 8px; }
:root[data-theme='light'] .list-lines a:hover { background: var(--accent-soft); }
:root[data-theme='light'] .stats { gap: 10px; background: none; border: 0; }
:root[data-theme='light'] .stat { border-radius: 12px; background: var(--accent-soft); }
:root[data-theme='light'] .stat:nth-child(2) { background: var(--violet-soft); }

/* avatars & tags */
:root[data-theme='light'] .avatar { border-radius: 12px; color: #fff; background: linear-gradient(135deg, #5b9bff, #2a55c9); }
:root[data-theme='light'] .badge { border: 0; border-radius: 999px; padding: 2px 10px; font-size: 11.5px; text-transform: capitalize; letter-spacing: 0; font-weight: 500; background: var(--panel-2); color: var(--fg-2); }
:root[data-theme='light'] .badge.error { background: var(--red-soft); color: var(--red); }
:root[data-theme='light'] .badge.crash, :root[data-theme='light'] .badge.regressed { background: var(--red); color: #fff; }
:root[data-theme='light'] .badge.performance { background: var(--amber-soft); color: var(--amber); }
:root[data-theme='light'] .badge.message, :root[data-theme='light'] .badge.info { background: var(--accent-soft); color: var(--accent); }
:root[data-theme='light'] .badge.open { background: var(--violet-soft); color: var(--violet); }
:root[data-theme='light'] .badge.resolved { background: var(--green-soft); color: var(--green); }
:root[data-theme='light'] .badge.ignored { background: var(--panel-2); color: var(--muted); }

/* issue list & detail */
:root[data-theme='light'] .issue-row.sev-error::before { background: var(--red); }
:root[data-theme='light'] .issue-row.sev-crash::before { background: #8e1f3a; }
:root[data-theme='light'] .issue-row.sev-performance::before { background: #f09a1a; }
:root[data-theme='light'] .issue-row.sev-message::before { background: var(--accent); }
:root[data-theme='light'] .issue-row:hover,
:root[data-theme='light'] .events-list button:hover:not(:disabled),
:root[data-theme='light'] .events-list button.active { background: var(--accent-soft); }
:root[data-theme='light'] .events-list button.active::before { background: var(--accent); }
:root[data-theme='light'] .culprit, :root[data-theme='light'] .key-box,
:root[data-theme='light'] details pre, :root[data-theme='light'] .card pre.mono { border-radius: var(--radius-sm); }
:root[data-theme='light'] .frames { border-radius: var(--radius-sm); overflow: hidden; }
:root[data-theme='light'] .frame.focus { background: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
:root[data-theme='light'] .notice { border-radius: var(--radius-sm); }
:root[data-theme='light'] .notice.error { background: var(--red-soft); border-color: transparent; }

/* ---------- Header refresh button ---------- */
.icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spinning svg { animation: spin 0.8s linear infinite; }
.icon-btn.spinning { opacity: 0.7; cursor: progress; }
:root[data-theme='light'] .icon-btn { border-radius: 999px; }
@media (max-width: 760px) { .icon-btn span { display: none; } .icon-btn { padding: 0 11px; } }

/* ==========================================================================
   Accounts: auth pages, forms, dialogs, toasts, settings, admin
   ========================================================================== */

/* ---------- Auth (login / sign-up): full-screen split layout ---------- */
body.auth-mode main { max-width: none; padding: 0; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-hero {
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 56px;
  background-color: var(--panel); border-right: 1px solid var(--line);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 22px 22px;
}
.auth-hero .brand { padding: 0; }
.auth-pitch { max-width: 520px; }
.eyebrow { margin: 0 0 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.auth-headline { margin: 0 0 32px; font-size: 32px; line-height: 1.18; letter-spacing: -0.02em; color: var(--fg); text-transform: none; font-weight: 500; }
.auth-features { list-style: none; padding: 0; margin: 0 0 34px; display: grid; gap: 18px; }
.auth-features li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start; }
.auth-features b { display: block; color: var(--fg); font-weight: 600; margin-bottom: 2px; }
.auth-features span { color: var(--muted); }
.feature-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--fg); }
.feature-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-code { max-width: 520px; border: 1px solid var(--line-strong); background: var(--bg); }
.auth-code-head { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.auth-code-head i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.auth-code-head span { margin-left: 8px; }
.auth-code pre { padding: 14px 16px; color: var(--fg-2); line-height: 1.7; }
.auth-foot { margin: 0; color: var(--muted); font-size: 11.5px; }
.auth-main { display: flex; flex-direction: column; min-width: 0; padding: 28px 40px 40px; }
.auth-top { display: flex; align-items: center; gap: 12px; }
.auth-brand-mobile { display: none; padding: 0; }
.auth-card { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 400px; margin: 0 auto; padding: 32px 0; }
.auth-card h1 { font-size: 26px; }
.auth-sub { margin: 8px 0 28px; color: var(--muted); }
.auth-form { display: grid; gap: 18px; }
.auth-switch { margin: 28px 0 0; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--fg); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Form fields ---------- */
.field { display: grid; gap: 7px; min-width: 0; }
.field-label { font-size: 12px; color: var(--fg-2); font-weight: 500; }
.field input { width: 100%; padding: 10px 12px; }
.field input[readonly] { color: var(--muted); background: var(--panel-2); cursor: default; }
.field input[aria-invalid='true'] { border-color: var(--danger); }
.field-hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.field-error { margin: 0; font-size: 12px; color: var(--danger); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 68px; }
.input-addon {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); padding: 4px 10px; font-size: 11.5px;
  border: 0; background: transparent; color: var(--muted); box-shadow: none !important;
}
.input-addon:hover:not(:disabled) { background: var(--panel-2); color: var(--fg); }
.strength { display: flex; align-items: center; gap: 10px; }
.strength-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-bars i { height: 4px; background: var(--line-strong); transition: background 0.15s; }
.strength[data-score='1'] i.on { background: var(--danger); }
.strength[data-score='2'] i.on { background: var(--amber); }
.strength[data-score='3'] i.on, .strength[data-score='4'] i.on { background: var(--green); }
.strength-label { min-width: 64px; text-align: right; font-size: 11.5px; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.create-form { display: grid; gap: 16px; max-width: 520px; }
.card-title { margin: 0 0 16px; font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--fg); }

/* ---------- Buttons: sizes, solid danger, busy spinner ---------- */
button.block { width: 100%; padding: 11px 14px; }
button.sm { padding: 4px 10px; font-size: 12px; }
button.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
button.danger.solid:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); filter: brightness(0.92); }
button.busy { position: relative; color: transparent !important; }
button.busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(128, 128, 128, 0.35); border-top-color: var(--fg); animation: spin 0.7s linear infinite;
}
button.primary.busy::after { border-top-color: var(--invert-fg); }
button.danger.solid.busy::after { border-top-color: #fff; }
button.busy:disabled { opacity: 0.85; cursor: progress; }

/* ---------- Dialog ---------- */
.modal { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); background: var(--panel); color: var(--fg); box-shadow: var(--modal-shadow); }
.modal::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in 0.16s ease-out; }
.modal-danger { border-top: 3px solid var(--danger); }
.modal-body { display: grid; gap: 14px; padding: 24px; }
.modal-title { margin: 0; font-size: 16px; line-height: 1.35; text-transform: none; letter-spacing: 0; color: var(--fg); font-weight: 600; }
.modal-text { margin: 0; color: var(--fg-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; width: max-content; max-width: min(400px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--invert-bg); color: var(--invert-fg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); animation: toast-in 0.2s ease-out; transition: opacity 0.25s, transform 0.25s;
}
.toast.leaving { opacity: 0; transform: translateY(6px); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.toast.error .toast-dot { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Sidebar user ---------- */
.nav a.user-chip { gap: 10px; padding: 8px 10px; margin-bottom: 4px; color: var(--fg); }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.user-meta { display: grid; min-width: 0; line-height: 1.3; }
.user-meta b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Getting started ---------- */
.welcome { padding: 36px; max-width: 860px; }
.welcome h1 { font-size: 26px; }
.welcome-sub { margin: 8px 0 26px; max-width: 580px; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; padding-bottom: 0; }
.step-n { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); font-weight: 700; }
.step b { display: block; font-size: 14px; margin-bottom: 4px; }
.step p { margin: 0 0 12px; }
.step .key-box { margin-top: 0; max-width: 460px; }
.usage-pill { padding: 4px 10px; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.usage-pill.full { color: var(--danger); border-color: var(--danger); }

/* ---------- Allowed origins ---------- */
button.ghost.warn { color: var(--amber); }
.notice.warn { margin: 0; color: var(--amber); border-color: var(--amber); background: transparent; }
:root[data-theme='light'] .notice.warn { background: var(--amber-soft); border-color: transparent; }
.origin-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.origin-list:empty { display: none; }
.origin-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--panel); min-width: 0; }
.origin-row code { overflow-wrap: anywhere; }
.origin-form { display: grid; gap: 12px; }

/* ---------- Account settings ---------- */
.settings { display: grid; gap: 16px; max-width: 820px; }
.settings-card { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; padding: 24px; }
.settings-head h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.settings-head p { margin: 0; font-size: 12px; }
.settings-body { display: grid; gap: 18px; min-width: 0; }
.settings-form { display: grid; gap: 16px; }
.profile-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.profile-row b { font-size: 14px; }
.usage { text-align: right; }
.usage b { display: block; font-size: 18px; font-weight: 500; }
.danger-zone { border-color: var(--danger); }
.danger-zone h3 { color: var(--danger); }

/* ---------- Admin ---------- */
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  padding: 10px 16px; text-align: left; white-space: nowrap; font-weight: 400; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: var(--panel-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-disabled td:not(.actions) { opacity: 0.55; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell b { font-weight: 600; margin-right: 6px; }
.row.nowrap { flex-wrap: nowrap; }

/* ---------- Performance ---------- */
.vitals-grid { display: grid; gap: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 14px; }
.vitals-grid .big { font-size: 22px; }
.rating { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; }
.rating.good { color: var(--green); }
.rating.needs-improvement { color: var(--amber); }
.rating.poor { color: var(--danger); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: middle; }
.dot.good { background: var(--green); }
.dot.needs-improvement { background: var(--amber); }
.dot.poor { background: var(--danger); }
.table-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; }
.table-title h3 { margin: 0; font-size: 13px; font-weight: 600; }
.table td.wrap { white-space: normal; word-break: break-all; min-width: 220px; }
.table td.warn { color: var(--amber); }
.table td a { color: var(--fg); }
.table td a .muted { margin-right: 2px; }
.method { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 5px; margin-right: 8px; border: 1px solid var(--line-strong); border-radius: 3px; }
.endpoint-title { font-size: 18px; word-break: break-all; }
.th-sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.th-sort.active { color: var(--fg); font-weight: 700; }
.pad { padding: 4px 16px 18px; margin: 0; }
.perf-head { margin: 2px 0 16px; }
.delta.neutral { color: var(--muted); }
:root[data-theme='light'] .delta.neutral { color: var(--muted); font-weight: 400; }
@media (max-width: 1200px) { .vitals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .vitals-grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Light theme for the above ---------- */
:root[data-theme='light'] .auth-hero {
  --fg: #ffffff; --fg-2: #dfe7ff; --muted: #a9bce8; --line: rgba(255, 255, 255, 0.12); --line-strong: rgba(255, 255, 255, 0.24);
  --bg: rgba(8, 22, 60, 0.35); --grid-dot: rgba(255, 255, 255, 0.07);
  background-color: #14306d; background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px), linear-gradient(155deg, #12285a 0%, #1f4bb0 100%);
  background-size: 22px 22px, auto; border-right: 0;
}
:root[data-theme='light'] .auth-hero .brand-mark { background: #fff; box-shadow: none; }
/* These are h2s; the light theme's generic h2 rule (12.5px panel headings) must not shrink them. */
:root[data-theme='light'] .auth-headline { font-size: 32px; letter-spacing: -0.02em; font-weight: 700; }
:root[data-theme='light'] .modal-title { font-size: 17px; font-weight: 700; }
:root[data-theme='light'] .feature-icon { border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.14); }
:root[data-theme='light'] .auth-code { border-radius: var(--radius); overflow: hidden; }
:root[data-theme='light'] .auth-code pre { font-family: var(--mono); }
:root[data-theme='light'] .auth-main { background: var(--bg); }
:root[data-theme='light'] .auth-card h1 { font-size: 28px; }
:root[data-theme='light'] .auth-switch a { color: var(--accent); text-decoration: none; }
:root[data-theme='light'] .auth-switch a:hover { text-decoration: underline; }
:root[data-theme='light'] .input-addon { border-radius: 8px; }
:root[data-theme='light'] .strength-bars i { border-radius: 999px; }
:root[data-theme='light'] .modal { border: 0; border-radius: 16px; }
:root[data-theme='light'] .modal-danger { border-top: 0; box-shadow: inset 0 3px 0 var(--danger), var(--modal-shadow); }
:root[data-theme='light'] .modal::backdrop { background: rgba(15, 27, 58, 0.45); }
:root[data-theme='light'] .toast { border-radius: 12px; }
:root[data-theme='light'] .nav a.user-chip { border-radius: var(--radius-sm); }
:root[data-theme='light'] .avatar.sm { border-radius: 9px; }
:root[data-theme='light'] .step-n { border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
:root[data-theme='light'] .usage-pill { border-radius: 999px; background: var(--panel); }
:root[data-theme='light'] .usage-pill.full { background: var(--red-soft); border-color: transparent; }
:root[data-theme='light'] .settings-head h3 { font-size: 15px; }
:root[data-theme='light'] .danger-zone { border-color: #f3c6cb; }
:root[data-theme='light'] .table th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; }
:root[data-theme='light'] .table tbody tr:hover td { background: var(--accent-soft); }
:root[data-theme='light'] .eyebrow { letter-spacing: 0.1em; font-weight: 600; }
:root[data-theme='light'] .welcome .eyebrow { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-hero { padding: 36px; }
  .auth-headline, :root[data-theme='light'] .auth-headline { font-size: 26px; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-brand-mobile { display: flex; }
  .auth-main { padding: 20px 16px 32px; }
  .settings-card { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
}
@media (max-width: 760px) {
  /* Phone: the sidebar becomes a top bar with icon-only navigation (labels stay for screen readers). */
  .sidebar .brand { font-size: 0; gap: 0; }
  .nav a, .nav-btn { font-size: 0; gap: 0; padding: 8px; }
  .nav a svg, .nav-btn svg { display: block; width: 18px; height: 18px; }
  .nav a.active { box-shadow: inset 0 -2px 0 var(--fg); }
  .nav-bottom { display: flex; align-items: center; gap: 2px; }
  .nav a.user-chip { margin: 0; padding: 4px; }
  .user-meta { display: none; }
  .kpi-grid { gap: 10px; }
  .welcome { padding: 22px 18px; }
  .step { grid-template-columns: 1fr; gap: 10px; }
  .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
  .profile-row .usage { text-align: left; }
  :root[data-theme='light'] .nav a.active { box-shadow: 0 0 0 1px var(--line-strong); }
}
