/* LogSonar — interface */
:root {
  color-scheme: light;
  --page: #f6f6f4;
  --surface: #fcfcfb;
  --surface-2: #f1f1ee;
  --surface-3: #e8e7e2;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-soft: #e6f0fc;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --info: #6b7a90;
  --good-soft: #e5f5e5;
  --warning-soft: #fdf3dc;
  --serious-soft: #fcebe3;
  --critical-soft: #fae6e6;
  --info-soft: #eceff3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --term-bg: #121211;
  --term-text: #d6d5cf;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f0efec; --text-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
    --accent: #3987e5; --accent-ink: #86b6ef; --accent-soft: #16263b;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --good-ink: #0ca30c;
    --good-soft: #142614; --warning-soft: #2e2510; --serious-soft: #301d15; --critical-soft: #331616; --info-soft: #23262b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
    --term-bg: #0a0a0a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2c2c2a;
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f0efec; --text-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
  --accent: #3987e5; --accent-ink: #86b6ef; --accent-soft: #16263b;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --good-ink: #0ca30c;
  --good-soft: #142614; --warning-soft: #2e2510; --serious-soft: #301d15; --critical-soft: #331616; --info-soft: #23262b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  --term-bg: #0a0a0a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.hidden { display: none !important; }
svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.icon-lg svg.lucide, svg.lucide.icon-lg { width: 20px; height: 20px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--text); color: var(--surface); display: grid; place-items: center; }
.brand-mark svg.lucide { width: 18px; height: 18px; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--critical); color: #fff; }
.nav .count.warn { background: var(--warning); color: #0b0b0b; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-chip .name { font-weight: 600; font-size: 13px; }
.user-chip .role { font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; }
.topbar .sub { color: var(--muted); font-size: 12.5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live.on .dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.live.off .dot { background: var(--critical); }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.btn.menu-btn { display: none; }

/* ---------- Building blocks ---------- */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.break { word-break: break-all; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; min-height: 36px; }
.card-head h3 { font-size: 14px; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px 18px 18px; }
.card-body.flush { padding: 8px 0 0; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi .foot { font-size: 12px; color: var(--muted); }

.meter { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.meter.warning > i { background: var(--warning); }
.meter.critical > i { background: var(--critical); }
.meter.good > i { background: var(--good); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.badge svg.lucide { width: 12px; height: 12px; }
.sev-critical { background: var(--critical-soft); color: var(--critical); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }
.sev-high { background: var(--serious-soft); color: color-mix(in srgb, var(--serious) 70%, var(--text)); border-color: color-mix(in srgb, var(--serious) 35%, transparent); }
.sev-medium, .sev-warning { background: var(--warning-soft); color: color-mix(in srgb, var(--warning) 55%, var(--text)); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.sev-low, .sev-info, .sev-unknown { background: var(--info-soft); color: var(--text-2); border-color: var(--border); }
.sev-good { background: var(--good-soft); color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); font-family: var(--mono); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--critical); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }

.input, select.input, textarea.input {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: 13px; min-width: 0;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { width: 32px; height: 18px; appearance: none; background: var(--surface-3); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 16px; }

.seg { display: inline-flex; padding: 2px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; font-weight: 550; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.tabs .count { font-size: 11px; color: var(--muted); margin-left: 4px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table td.path { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; font-size: 13.5px; }
.list-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--info); }
.sev-dot.critical { background: var(--critical); }
.sev-dot.high { background: var(--serious); }
.sev-dot.warning, .sev-dot.medium { background: var(--warning); }
.sev-dot.good { background: var(--good); }

.empty { padding: 32px 18px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg.lucide { width: 28px; height: 28px; opacity: .6; }
.empty .title { color: var(--text-2); font-weight: 600; }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.callout.warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.callout.danger { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }
.callout.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- Score ---------- */
.score { display: flex; align-items: center; gap: 20px; }
.score-ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.score-ring svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.score-ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .big { font-size: 30px; font-weight: 750; line-height: 1; }
.score-ring .grade { font-size: 12px; color: var(--muted); margin-top: 2px; }
.penalties { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; flex: 1; min-width: 0; }
.penalties .p { display: flex; gap: 8px; justify-content: space-between; }
.penalties .p span:last-child { color: var(--critical); font-weight: 600; white-space: nowrap; }

/* ---------- Host gauges ---------- */
.gauge { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.gauge .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gauge .label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.gauge .value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.gauge .foot { font-size: 12px; color: var(--muted); }

/* ---------- Charts ---------- */
.chart { position: relative; height: 220px; }
.chart.sm { height: 150px; }
.chart.lg { height: 280px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 12.5px; }
.hbar .bar { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.hbar .bar i { display: block; height: 100%; background: var(--series-1); border-radius: 999px; }

/* ---------- Terminal ---------- */
.terminal { background: var(--term-bg); color: var(--term-text); border-radius: var(--radius); font-family: var(--mono); font-size: 12px; line-height: 1.6; height: calc(100vh - 290px); min-height: 360px; overflow-y: auto; padding: 10px 0; border: 1px solid var(--border); }
.terminal .ln { padding: 0 14px; white-space: pre-wrap; word-break: break-all; }
.terminal .ln:hover { background: rgba(255,255,255,.04); }
.terminal .ln.attack { background: rgba(208, 59, 59, .14); border-left: 3px solid var(--critical); padding-left: 11px; }
.terminal .t { color: #6f6e69; }
.terminal .c { color: #86b6ef; }
.terminal .ip { color: #e7c46a; }
.terminal .s2 { color: #5fc95f; } .terminal .s3 { color: #86b6ef; } .terminal .s4 { color: #e7c46a; } .terminal .s5 { color: #ff7b7b; }
.terminal .a { color: #ff8f8f; font-weight: 700; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 80; display: flex; justify-content: flex-end; animation: fade .15s ease; }
.overlay.center { align-items: center; justify-content: center; padding: 16px; }
.drawer { width: min(560px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto; animation: slide .2s ease; display: flex; flex-direction: column; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.overlay-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.overlay-head h3 { font-size: 15px; flex: 1; min-width: 0; }
.overlay-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.overlay-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
pre.raw { margin: 0; background: var(--term-bg); color: var(--term-text); padding: 12px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }
pre.msg { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: .5; } }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; animation: fade .2s ease; }
.toast.error { background: var(--critical); color: #fff; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .5s ease; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.container-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.container-card .name { font-weight: 650; font-size: 13.5px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container-card .img { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.mini { display: grid; grid-template-columns: 52px 1fr 64px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.mini .v { text-align: right; font-variant-numeric: tabular-nums; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.state.running::before { background: var(--good); }
.state.unhealthy::before, .state.restarting::before { background: var(--warning); }
.state.exited::before, .state.dead::before { background: var(--critical); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); }
.auth-card .card { padding: 28px; }
.auth-card .brand { justify-content: center; padding-bottom: 6px; }
.auth h2 { font-size: 20px; text-align: center; }
.auth p.lead { text-align: center; color: var(--text-2); margin: 6px 0 22px; font-size: 13.5px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth .input { height: 40px; font-size: 14px; }
.auth .btn { height: 40px; }
.otp-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: .5em; text-align: center; }
.qr { background: #fff; padding: 10px; border-radius: var(--radius-sm); width: 200px; height: 200px; margin: 0 auto; display: grid; place-items: center; border: 1px solid var(--border); }
.qr svg { width: 180px; height: 180px; }
.secret { font-family: var(--mono); font-size: 12.5px; text-align: center; word-break: break-all; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); user-select: all; }
.error-msg { color: var(--critical); font-size: 13px; text-align: center; min-height: 18px; }
.auth-foot { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 40px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .topbar .sub { display: none; }
  .score { flex-direction: column; align-items: stretch; }
  .score-ring { margin: 0 auto; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 6px; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .live .txt { display: none; }
}
