/* status.jam3ah.net: one stylesheet for the dashboard and the login page.
   CSP is style-src 'self': every rule lives here, never in style="" attributes.
   Contrast of every text/status token was computed (WCAG 2): text >= 4.5:1, marks >= 3:1. */

:root {
  color-scheme: light dark;
  --plane: #eef0f5;
  --surface: #fdfdff;
  --surface-2: #f3f4f9;
  --ink: #1a1b2e;
  --ink-2: #464862;
  --muted: #5f617a;
  --line: #dcdfe8;
  --line-strong: #c3c6d4;
  --accent: #2e3192;          /* Jam3ah brand indigo */
  --accent-ink: #ffffff;
  --focus: #2e3192;
  --series-1: #2a78d6;        /* dataviz slots 1-2, validated on --surface */
  --series-2: #eb6834;
  --good: #0ca30c;
  --warn: #b8790a;
  --crit: #d03b3b;
  --stopped: #8f92a8;
  --good-text: #006300;
  --warn-text: #7a4f00;
  --crit-text: #b42828;
  --live: #c22d2d;
  --live-halo: rgba(255, 214, 208, 0.9);
  --amber-bg: #f5b52e;
  --amber-ink: #1a1b2e;
  --track: #e2e5ee;
  --grid: #e6e8ef;
  --axis: #c3c6d4;
  --tint-red: #fbecec;
  --tint-amber: #fdf4e3;
  --radius: 14px;
  --top-h: 60px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --plane: #0d0e17;
    --surface: #161724;
    --surface-2: #1d1e2e;
    --ink: #ecedf6;
    --ink-2: #b8bad0;
    --muted: #9a9cb4;
    --line: #2a2c3f;
    --line-strong: #3b3e55;
    --accent: #a3a6f0;
    --accent-ink: #11122a;
    --focus: #a3a6f0;
    --series-1: #3987e5;
    --series-2: #d95926;
    --good: #0ca30c;
    --warn: #fab219;
    --crit: #e05252;
    --stopped: #7d8099;
    --good-text: #4cc44c;
    --warn-text: #f7c04a;
    --crit-text: #ff8f87;
    --track: #2a2c3f;
    --grid: #24263a;
    --axis: #3b3e55;
    --tint-red: #2a1619;
    --tint-amber: #2a2214;
  }
}

/* ---- base ------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  overflow-wrap: anywhere;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 30;
  padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
}
.skip:focus { top: 8px; }
.dim { color: var(--muted); }
.mono-path { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
.when { color: var(--muted); font-size: 13px; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom));
}
main:focus { outline: none; }

/* ---- sticky header --------------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--plane);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .top {
    background: color-mix(in srgb, var(--plane) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
  }
}
.top-in {
  max-width: 1120px; margin: 0 auto; min-height: var(--top-h);
  padding: 6px 8px 6px 16px;
  display: flex; align-items: center; gap: 8px;
}
.top-id { flex: 1; min-width: 0; }
.brand { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.updated { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.top-lamp { display: none; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.top-lamp-live { display: inline-block; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.top-lamp-class_mode, .top-lamp-unknown { display: inline-block; background: var(--amber-bg); }

.badge {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface);
}
.badge-stale { background: var(--crit-text); border-color: var(--crit-text); color: #fff; }
.badge[hidden] { display: none; }
.badge-up { color: var(--good-text); }
.badge-degraded { color: var(--warn-text); }
.badge-down { color: var(--crit-text); }
.badge-run { color: var(--accent); }

/* ---- buttons --------------------------------------------------------------------------- */
.btn {
  min-height: 44px; min-width: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--accent); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { background: var(--crit-text); border-color: var(--crit-text); color: #fff; }
.btn-block { width: 100%; }
.btn[aria-disabled="true"] {
  cursor: not-allowed; background: var(--surface-2); border-color: var(--line); color: var(--muted);
}
.btn[aria-busy="true"] { cursor: progress; color: var(--ink-2); }
@media (prefers-color-scheme: dark) {
  .btn-danger { background: #b42828; border-color: #b42828; }
  .badge-stale { background: #b42828; border-color: #b42828; }
}

/* ---- sections -------------------------------------------------------------------------- */
.sec { margin-top: 22px; scroll-margin-top: calc(var(--top-h) + 12px); }
.sec-class { margin-top: 12px; }
.sec-title { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 10px 2px; }
.sec-title .count {
  display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; text-align: center; vertical-align: 2px;
}
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-head .sec-title { margin-bottom: 0; }
.sub-title { font-size: 15px; font-weight: 650; margin: 16px 0 8px 2px; }
.calm { display: flex; align-items: center; gap: 8px; color: var(--ink-2); padding: 0 2px; }
.note { margin: 0 0 10px 2px; color: var(--ink-2); }

/* ---- the class banner: the on-air lamp ------------------------------------------------- */
.banner {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 18px 18px 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.bulb {
  flex: none; width: 26px; height: 26px; margin-top: 3px; border-radius: 50%;
  border: 3px solid var(--stopped); background: transparent;
}
.banner-text { min-width: 0; }
.banner-title { font: 650 26px/1.15 var(--round); letter-spacing: -0.015em; }
.banner-msg { margin-top: 6px; font-size: 16px; }
.banner-sub { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.banner-live {
  background: var(--live); color: #fff; border-color: transparent;
  box-shadow: 0 14px 34px -18px rgba(194, 45, 45, 0.85);
}
.banner-live .bulb {
  background: #fff; border-color: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2), 0 0 24px 8px var(--live-halo);
}
.banner-live .banner-sub { color: #fff; }
.banner-class_mode, .banner-unknown { background: var(--amber-bg); color: var(--amber-ink); border-color: transparent; }
.banner-class_mode .bulb, .banner-unknown .bulb { background: var(--amber-ink); border-color: var(--amber-ink); box-shadow: 0 0 0 6px rgba(26, 27, 46, 0.14); }
.banner-class_mode .banner-sub, .banner-unknown .banner-sub { color: var(--amber-ink); }
.banner-offline .bulb, .banner-nodata .bulb { border-style: dashed; }

/* ---- status lamps (shape + colour + text, never colour alone) -------------------------- */
.lamp { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--good); }
.lamp-degraded { width: 14px; height: 12px; border-radius: 0; background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.lamp-down { width: 11px; height: 11px; border-radius: 2px; background: var(--crit); }
.lamp-stopped { background: transparent; border: 2px solid var(--stopped); }
.lamp-unknown { background: transparent; border: 2px dashed var(--stopped); }
.lamp-run { background: transparent; border: 2px solid var(--accent); }
.st-word { font-weight: 650; }
.st-degraded { color: var(--warn-text); }
.st-down { color: var(--crit-text); }
.st-stopped, .st-unknown { color: var(--ink-2); }

/* ---- alerts ---------------------------------------------------------------------------- */
.alerts, .inline-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert { border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.alert-red { background: var(--tint-red); border-color: color-mix(in srgb, var(--crit) 35%, var(--line)); }
.alert-amber { background: var(--tint-amber); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.alert-link {
  display: flex; gap: 12px; align-items: flex-start; min-height: 44px;
  padding: 11px 14px; color: inherit; text-decoration: none; border-radius: 12px;
}
a.alert-link:hover .alert-row { text-decoration: underline; }
.alert-icon { flex: none; width: 14px; height: 14px; margin-top: 3px; }
.alert-icon-red { background: var(--crit); border-radius: 2px; }
.alert-icon-amber { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 16px; }
.alert-body { min-width: 0; display: grid; gap: 2px; }
.alert-row { font-weight: 650; color: var(--accent); }
.inline-alerts { margin: 4px 16px 10px; }
.ia { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 8px 10px; border-radius: 10px; }
.ia-red { background: var(--tint-red); }
.ia-amber { background: var(--tint-amber); }
.member .inline-alerts { margin: 6px 0 0; }

/* ---- box tiles ------------------------------------------------------------------------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { min-width: 0; padding: 12px 14px 13px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tile-wide { grid-column: 1 / -1; }
.t-label { font-size: 13.5px; color: var(--ink-2); font-weight: 550; }
.t-value { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; margin: 2px 0 6px; }
.t-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.lvl-word { font-size: 12.5px; font-weight: 650; vertical-align: 4px; margin-left: 4px; }
.lvl-word-red { color: var(--crit-text); }
.lvl-word-amber { color: var(--warn-text); }
.meter, .sbar { display: block; overflow: visible; }
.m-track { fill: var(--track); }
.m-fill { fill: var(--series-1); }
.lvl-amber .m-fill { fill: var(--warn); }
.lvl-red .m-fill { fill: var(--crit); }
.net-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.net-name { font-weight: 600; }
.net-io { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- grouped lists: rows, certs, backups, actions, storage ------------------------------- */
.rows, .list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.row + .row, .item + .item, .st-row + .st-row { border-top: 1px solid var(--line); }
.row { scroll-margin-top: calc(var(--top-h) + 12px); }
.row-sum { cursor: pointer; }
.row-h { font-size: inherit; font-weight: inherit; }
.row-toggle {
  display: block; width: 100%; min-height: 52px; padding: 12px 16px 6px;
  border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.rt-line { display: flex; align-items: center; gap: 10px; }
.row-name { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; }
.row-status { display: block; margin: 2px 0 0 22px; color: var(--ink-2); }
.chev {
  flex: none; margin-left: auto; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.15s ease;
}
.row-toggle[aria-expanded="true"] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.metrics {
  margin: 4px 16px 12px 38px; display: grid; gap: 6px 16px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.metrics .m { min-width: 0; }
.metrics dt { font-size: 12.5px; color: var(--muted); }
.metrics dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 550; }
.limits { margin: -4px 16px 10px 38px; font-size: 13px; color: var(--muted); }
.empty { margin: -2px 16px 12px 38px; color: var(--ink-2); font-style: italic; }
.unattributed { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.row > .restart { margin: 0 16px 14px 38px; }
.row-panel { padding: 0 16px 6px; }
.row-panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 4px 0 10px; }
.panel-note { color: var(--ink-2); font-size: 14px; }
.members { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.member { padding: 12px 0; }
.member + .member { border-top: 1px solid var(--line); }
.m-head { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.m-status { margin: 2px 0 0 20px; color: var(--ink-2); }
.m-detail { margin: 2px 0 0 20px; color: var(--muted); font-size: 13.5px; }
.member .metrics { margin: 8px 0 0 20px; }
.member .limits { margin: 6px 0 0 20px; }
.member .restart { margin: 10px 0 0 20px; }
.member .mcharts { margin: 10px 0 0 20px; }

/* ---- restart --------------------------------------------------------------------------- */
.restart { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.restart-why { flex-basis: 100%; font-size: 13.5px; color: var(--muted); }
.restart-result { flex-basis: 100%; font-size: 14px; font-weight: 550; }
.restart-result.ok { color: var(--good-text); }
.restart-result.err { color: var(--crit-text); }
.spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- range switch ---------------------------------------------------------------------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-b {
  min-height: 44px; min-width: 52px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.seg-b[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---- charts ---------------------------------------------------------------------------- */
.ch-status { color: var(--muted); font-size: 14px; margin: 0 0 8px 2px; }
.ch-status:empty { display: none; }
.charts-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.chart { margin: 0; min-width: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.ch-head { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.ch-title { font-weight: 650; }
.ch-sub { color: var(--muted); font-size: 13px; }
.ch-readout { min-height: 20px; margin: 2px 0 6px; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; flex: none; }
.key-line { width: 16px; height: 3px; border-radius: 2px; }
.key-area { width: 12px; height: 12px; border-radius: 3px; opacity: 1; }
.key.s1 { background: var(--series-1); }
.key.s2 { background: var(--series-2); }
.key-area.pk { background: color-mix(in srgb, var(--series-1) 30%, var(--surface)); }
.plot-slot { min-height: 40px; }
.plot { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.plot .gl { stroke: var(--grid); stroke-width: 1; }
.plot .base { stroke: var(--axis); stroke-width: 1; }
.plot text {
  font: 11px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round;
}
.plot .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .ln.s1, .plot .xh-dot.s1 { stroke: var(--series-1); }
.plot .ln.s2, .plot .xh-dot.s2 { stroke: var(--series-2); }
.plot .ar { stroke: none; fill-opacity: 0.12; }
.plot .ar.s1 { fill: var(--series-1); }
.plot .ar.s2 { fill: var(--series-2); }
.plot .ar.pk { fill-opacity: 0.22; }
.plot .dot, .plot .pt { stroke: var(--surface); stroke-width: 2; }
.plot .dot.s1, .plot .pt.s1 { fill: var(--series-1); }
.plot .dot.s2, .plot .pt.s2 { fill: var(--series-2); }
.plot .xh { stroke: var(--ink-2); stroke-width: 1; }
.plot .xh-dot { fill: var(--surface); stroke-width: 2.5; }
.collecting { display: flex; align-items: center; min-height: 72px; color: var(--muted); font-size: 14px; }
.ch-note { margin-top: 6px; font-size: 13px; color: var(--muted); }
.ch-table { margin-top: 6px; }
.ch-table summary, .st-row summary {
  min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--accent); font-weight: 600;
  list-style: none;
}
.ch-table summary::-webkit-details-marker, .st-row summary::-webkit-details-marker { display: none; }
.ch-table summary::before { content: ""; width: 7px; height: 7px; margin-right: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease; }
.ch-table[open] summary::before { transform: rotate(45deg); }
.tbl-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.ch-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ch-tbl th, .ch-tbl td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ch-tbl thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 650; }
.ch-tbl tbody th { font-weight: 500; color: var(--ink-2); }
.mcharts { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-sm { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.chart-sm .ch-readout { margin: 0 0 2px; font-size: 13px; }
.chart-sm .plot text { stroke: var(--surface-2); }
.chart-sm .plot .dot, .chart-sm .plot .pt { stroke: var(--surface-2); }
.chart-sm .collecting { min-height: 48px; font-size: 13px; }

/* ---- items (certs, backups, actions) --------------------------------------------------- */
.item { padding: 12px 16px; }
.item-tight { padding: 10px 16px; }
.i-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.i-name { font-weight: 650; }
.i-line { margin: 3px 0 0 20px; color: var(--ink); }
.i-sub { margin: 2px 0 0 20px; color: var(--muted); font-size: 13.5px; }

/* ---- storage --------------------------------------------------------------------------- */
.st-meta { margin: 0 0 6px 2px; color: var(--ink-2); font-size: 14px; }
.st-list { margin-top: 10px; }
.st-row details { padding: 4px 16px 8px; }
.st-row summary { display: block; padding: 8px 0 4px; color: inherit; font-weight: inherit; }
.st-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.st-name { font-weight: 650; color: var(--accent); }
.st-bytes { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.sbar { margin-top: 6px; }
.st-delta { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.paths { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 8px; }
.path { display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.p-label { font-weight: 600; }
.p-bytes { font-variant-numeric: tabular-nums; }
.p-path { color: var(--ink-2); }
.p-files { font-size: 13px; color: var(--muted); }

/* ---- footer ---------------------------------------------------------------------------- */
.foot { margin-top: 28px; padding: 0 2px; color: var(--muted); font-size: 13px; display: grid; gap: 2px; }

/* ---- confirm dialog -------------------------------------------------------------------- */
dialog.confirm {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(10, 11, 30, 0.55);
}
dialog.confirm::backdrop { background: rgba(10, 11, 25, 0.55); }
.dlg-body { padding: 22px 20px 18px; overflow: auto; }
.dlg-title { font: 650 20px/1.25 var(--round); }
.dlg-text { margin-top: 10px; color: var(--ink-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---- login page ------------------------------------------------------------------------ */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 400px; }
.login-card { padding: 28px 22px 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.bulb-brand { display: block; width: 30px; height: 30px; margin: 0 0 16px; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); }
.login-title { font: 650 24px/1.2 var(--round); letter-spacing: -0.015em; }
.login-lead { margin: 6px 0 20px; color: var(--ink-2); }
.field-label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; }
.field {
  display: block; width: 100%; height: 48px; padding: 0 14px;
  border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 16px var(--sans);
}
.field:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.form-error { min-height: 22px; margin: 12px 0 10px; color: var(--crit-text); font-weight: 550; }

/* ---- wider screens --------------------------------------------------------------------- */
@media (min-width: 760px) {
  .charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-panel { padding-left: 38px; }
  .banner { padding: 22px 24px 22px 22px; }
  .banner-title { font-size: 32px; }
  .banner-msg { font-size: 17px; }
  .bulb { width: 30px; height: 30px; }
}
@media (min-width: 960px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile-wide { grid-column: span 2; }
  .row-sum { display: grid; grid-template-columns: minmax(250px, 0.9fr) 2fr; align-items: start; }
  .row-sum .metrics { margin: 12px 16px 12px 0; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .member .metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mcharts { grid-template-columns: repeat(2, minmax(0, 320px)); }
}

@media (prefers-reduced-motion: reduce) {
  .chev, .ch-table summary::before { transition: none; }
  .spin { animation: none; border-right-color: currentColor; opacity: 0.7; }
}

@media (forced-colors: active) {
  .lamp, .alert-icon, .bulb, .top-lamp { forced-color-adjust: none; border: 2px solid CanvasText; }
  .seg-b[aria-pressed="true"] { outline: 2px solid Highlight; }
}
