/* Liberty Guard dashboard.
   Dark only, like the app icon. Structure follows the GuardaOne dashboard: fixed glass
   top bar, sidebar with a per-server sub-menu, glass cards on an aurora wash. The type
   and spacing follow the Apple design system: one accent (the Liberty Guard pink),
   weights 400 / 600 / 700, hairlines rather than borders, no drop shadows. State is
   written in words, never in coloured badges. */

/* Inter (OFL 1.1, rsms.me/inter), served from this host so no visitor data goes to a font
   CDN. Variable weight: only 400, 600 and 700 are used. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/static/fonts/inter-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/static/fonts/inter-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  --bg: #07070b;
  --text: #ffffff;
  --text-2: #c7c7d1;
  --text-3: #8e8e9a;

  /* The brand pink is #fb047f (the logo). On this ground text steps lighter and fills
     step darker, so both clear 4.5:1. */
  --accent: #fb047f;
  --accent-2: #ff5ca8;             /* links and active text: 6.9:1 on --bg */
  --accent-deep: #c80063;
  --accent-tint: rgba(251, 4, 127, 0.14);
  --accent-fill: linear-gradient(160deg, #e0036f, #9e004e);   /* white text 4.8:1 and up */

  --danger: #ff7b72;
  --danger-tint: rgba(255, 123, 114, 0.13);
  --warn: #e3b341;
  --warn-tint: rgba(227, 179, 65, 0.13);
  --info: #79c0ff;
  --info-tint: rgba(121, 192, 255, 0.13);
  --ok: #56d364;
  --ok-tint: rgba(86, 211, 100, 0.13);

  --sev-1: #56d364;
  --sev-2: #e3b341;
  --sev-3: #ff9f43;
  --sev-4: #ff7b72;
  --sev-5: #d2a8ff;

  --hairline: rgba(255, 255, 255, 0.11);
  --hairline-2: rgba(255, 255, 255, 0.2);
  --raised: rgba(255, 255, 255, 0.06);
  --field: rgba(6, 4, 12, 0.45);

  --glass: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  --glass-head: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  --glass-rim: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -18px 34px rgba(10, 4, 18, 0.28);
  --aurora:
    radial-gradient(1200px 820px at 12% -12%, #3e0a2b 0%, rgba(7, 7, 11, 0) 62%),
    radial-gradient(1000px 780px at 96% 2%, #23124d 0%, rgba(7, 7, 11, 0) 56%),
    radial-gradient(1000px 760px at 55% 104%, #0d2a44 0%, rgba(7, 7, 11, 0) 58%);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;
  --top: 56px;
  --side: 256px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--aurora);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-2);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss03';  /* single-storey a, rounder quotes: Inter's display look */
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(251, 4, 127, 0.3); color: var(--text); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: var(--r-sm); }
h1, h2, h3 { color: var(--text); letter-spacing: -0.022em; margin: 0; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 600; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only, .sr-table {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* Scrollbars: thin and quiet. */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }

/* ── Top progress bar and toasts ─────────────────────────────────────── */
#progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 200; pointer-events: none; }
#progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent-2)); transition: width 0.25s ease, opacity 0.4s ease; }
#progress.busy .bar { width: 85%; transition: width 6s cubic-bezier(0.1, 0.7, 0.2, 1); }
#progress.done .bar { width: 100%; opacity: 0; }

#toasts { position: fixed; top: 16px; right: 16px; z-index: 150; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; min-width: 240px; max-width: 380px;
  padding: 10px 14px; border-radius: var(--r-md); color: var(--text); font-weight: 600;
  background: rgba(20, 14, 28, 0.82); border: 1px solid var(--hairline-2); box-shadow: var(--glass-rim);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  animation: toast-in 0.22s ease-out;
}
.toast .ic { width: 20px; height: 20px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; }
.toast.ok .ic { background: var(--accent-tint); color: var(--accent-2); }
.toast.err .ic { background: var(--danger-tint); color: var(--danger); }
.toast.leaving { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ── Chrome ──────────────────────────────────────────────────────────── */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--glass-head); border-bottom: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--accent-tint); border: 1px solid var(--hairline); }
.brand .mark img { width: 18px; height: auto; display: block; }
.topbar .spacer { flex: 1; }
.search-btn {
  display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 7px 12px;
  border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--field);
  color: var(--text-3); font: inherit; font-size: 13px; cursor: pointer;
}
.search-btn:hover { color: var(--text-2); border-color: var(--hairline-2); }
.search-btn svg { width: 15px; height: 15px; }
.search-btn .kbd { margin-left: auto; }
.kbd { font: 11px var(--mono); padding: 1px 6px; border-radius: var(--r-sm); border: 1px solid var(--hairline); color: var(--text-3); }
.burger { display: none; width: 38px; height: 38px; border: 0; background: none; color: var(--text); cursor: pointer; border-radius: var(--r-md); }
.burger svg { width: 22px; height: 22px; }

.sidebar {
  position: fixed; top: var(--top); left: 0; bottom: 0; width: var(--side); z-index: 45;
  display: flex; flex-direction: column;
  background: var(--glass); border-right: 1px solid var(--hairline);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  transition: transform 0.2s ease;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.side-section { padding: 18px 20px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 7px 20px; color: var(--text-2); font-size: 14px; }
.side-link svg { width: 18px; height: 18px; flex: none; }
.side-link:hover { color: var(--text); text-decoration: none; }
.side-link.active { color: var(--accent-2); font-weight: 600; }
.side-link .kbd { margin-left: auto; }
.side-server { padding: 2px 20px 6px; }
.side-server .name { color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-server .meta { color: var(--text-3); font-size: 12px; }
.subnav { margin: 4px 12px 4px 22px; padding-left: 10px; border-left: 1px solid var(--hairline); }
.sub-link { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: var(--r-md); font-size: 13px; color: var(--text-2); }
.sub-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.sub-link:hover { color: var(--text); background: var(--raised); text-decoration: none; }
.sub-link.active { color: var(--accent-2); font-weight: 600; }
.sub-link.active .dot { background: var(--accent); }
.sub-link .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-user { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--hairline); }
.side-user img, .side-user .avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.side-user .avatar { display: grid; place-items: center; background: var(--raised); color: var(--text); font-weight: 700; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { color: var(--text-3); font-size: 12px; }
.overlay { display: none; position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.6); }

main.page { margin-left: var(--side); padding: calc(var(--top) + 28px) 32px 48px; }
main.page.bare { margin-left: 0; max-width: 1180px; margin-inline: auto; }
footer.foot { margin-top: 40px; color: var(--text-3); font-size: 12px; }

/* ── Page header ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--text-3); font-size: 14px; }
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text-2); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Grids ───────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--glass-rim); min-width: 0; margin-bottom: 14px;
}
.grid > .card { margin-bottom: 0; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
  background: var(--glass-head); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.card-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.card-body { padding: 16px; }
.card-flush { overflow-x: auto; }
.card-control { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 8px; border-radius: var(--r-md); border: 1px solid transparent; white-space: nowrap; }
.card-control:hover { color: var(--text); background: var(--raised); border-color: var(--hairline); text-decoration: none; }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--hairline-2); transform: translateY(-2px); }
a.card { transition: transform 0.15s, border-color 0.15s; }

/* Stat tile: round tinted icon, big number, quiet label. */
.stat { display: flex; align-items: center; gap: 14px; padding: 16px; }
.stat .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.stat .ic svg { width: 20px; height: 20px; }
.stat .value { color: var(--text); font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; color: var(--text-3); font-weight: 600; }
.stat .label { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.tone-pink { background: var(--accent-tint); color: var(--accent-2); }
.tone-blue { background: var(--info-tint); color: var(--info); }
.tone-amber { background: var(--warn-tint); color: var(--warn); }
.tone-red { background: var(--danger-tint); color: var(--danger); }
.tone-green { background: var(--ok-tint); color: var(--ok); }
.tone-grey { background: var(--raised); color: var(--text-2); }

/* The one saturated panel per page. */
.accent-card {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 16px; color: #fff;
  background: linear-gradient(135deg, #8c0047 0%, #c80063 50%, #e0036f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); display: flex; flex-direction: column;
}
.accent-card .value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.accent-card .label { color: rgba(255, 255, 255, 0.82); font-size: 13px; margin-top: 6px; }
.accent-card .foot { margin-top: auto; padding-top: 12px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: rgba(255, 255, 255, 0.82); }
.accent-card svg { display: block; width: 100%; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 9px 16px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
.table td { padding: 10px 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; color: var(--text-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; color: var(--text); font-weight: 600; }
.table .strong { color: var(--text); font-weight: 600; }
.table .empty { text-align: center; padding: 36px 16px; color: var(--text-3); }
.table .wrap { white-space: normal; min-width: 220px; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: rgba(251, 4, 127, 0.16); } to { background: transparent; } }

/* Words, not badges: a small dot and the word, coloured only by meaning. */
.state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.state.open { color: var(--accent-2); }
.state.acknowledged { color: var(--info); }
.state.closed { color: var(--text-3); }
.sev-1 { color: var(--sev-1); } .sev-2 { color: var(--sev-2); } .sev-3 { color: var(--sev-3); }
.sev-4 { color: var(--sev-4); } .sev-5 { color: var(--sev-5); }
.lvl { font-weight: 700; font-variant-numeric: tabular-nums; }
.lvl-0 { color: var(--text-3); } .lvl-1 { color: var(--info); } .lvl-2 { color: var(--warn); }
.lvl-3 { color: var(--sev-3); } .lvl-4 { color: var(--danger); }
.trust { font-weight: 700; font-variant-numeric: tabular-nums; }
.trust.t-hi { color: var(--ok); } .trust.t-mid { color: var(--text); } .trust.t-watch { color: var(--warn); }
.trust.t-risk { color: var(--sev-3); } .trust.t-crit { color: var(--danger); }
.who-cell { display: flex; flex-direction: column; }
.who-cell b { color: var(--text); font-weight: 600; }
.who-cell span { font: 12px var(--mono); color: var(--text-3); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--r-pill); font: 600 14px var(--font); cursor: pointer;
  border: 1px solid var(--hairline); color: var(--text-2); background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); transition: transform 0.12s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--hairline-2); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { color: #fff; border-color: transparent; background: var(--accent-fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn.danger { color: var(--danger); border-color: rgba(255, 123, 114, 0.35); }
.btn.danger:hover { background: var(--danger-tint); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); font-weight: 400; }
.input, .select, textarea.input {
  width: 100%; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--hairline);
  background: var(--field); color: var(--text); font: inherit; font-size: 14px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(251, 4, 127, 0.18); }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: #141018; color: var(--text); }
textarea.input { min-height: 84px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.filters .field { min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }

/* Setting row: label and help left, control right. */
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.row:last-child { border-bottom: 0; }
.row .what { min-width: 0; }
.row .what b { display: block; color: var(--text); font-weight: 600; font-size: 14px; }
.row .what span { font-size: 12px; color: var(--text-3); }
.row .ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.row .ctl .input { width: 180px; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.18); cursor: pointer; transition: background 0.18s; }
.switch .track::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform 0.18s; }
.switch input:checked + .track { background: var(--accent-deep); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.45; cursor: not-allowed; }

/* Segmented control for detector modes. */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--field); border: 1px solid var(--hairline); }
.seg button { border: 0; background: none; color: var(--text-3); font: 600 12px var(--font); padding: 5px 12px; border-radius: var(--r-pill); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: #fff; background: var(--accent-fill); }
.seg button:disabled { cursor: not-allowed; }

/* ── Notices (a banner across the page, not a badge) ─────────────────── */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-lg); margin-bottom: 14px; border: 1px solid var(--hairline); background: var(--glass); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.notice b { color: var(--text); }
.notice.warn { border-color: rgba(227, 179, 65, 0.35); background: var(--warn-tint); }
.notice.warn svg { color: var(--warn); }
.notice.danger { border-color: rgba(255, 123, 114, 0.35); background: var(--danger-tint); }
.notice.danger svg { color: var(--danger); }
.notice.info svg { color: var(--accent-2); }

/* ── Details lists, timelines, evidence ──────────────────────────────── */
.dl { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 10px 20px; margin: 0; font-size: 14px; }
.dl dt { color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--hairline); }
.timeline li:last-child::after { display: none; }
.timeline li.k-flag::before { background: var(--accent); }
.timeline li.k-action::before { background: var(--danger); }
.timeline li.k-verdict::before { background: var(--info); }
.timeline .when { display: block; font-size: 12px; color: var(--text-3); }
pre.code { margin: 0; padding: 14px 16px; max-height: 380px; overflow: auto; font: 12px/1.55 var(--mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

/* ── Charts ──────────────────────────────────────────────────────────── */
.chart { display: block; width: 100%; height: auto; }
/* Charts stretch sideways with the page but keep a fixed height, so bars and text never
   grow to fill a wide screen. Labels live outside the drawing for the same reason. */
.chart.stretch { height: 200px; }
.axis-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.axis-row span:nth-child(2):not(:last-child) { text-align: center; }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.08); stroke-dasharray: 4 6; }
.chart .bar-live { fill: var(--accent); }
.chart .bar-shadow { fill: rgba(255, 255, 255, 0.22); }
.chart .axis { fill: var(--text-3); font: 11px var(--font); }
.chart .line { fill: none; stroke: var(--accent-2); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#trust-fill); }
.chart .zone { fill: rgba(255, 123, 114, 0.06); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .centre { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .centre b { display: block; color: var(--text); font-size: 24px; font-weight: 700; }
.donut .centre span { font-size: 11px; color: var(--text-3); }
.donut-legend { display: grid; gap: 6px; font-size: 13px; min-width: 150px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.donut-legend span { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter.ok i { background: var(--ok); } .meter.warn i { background: var(--warn); } .meter.bad i { background: var(--danger); }

/* Movement replay */
.replay svg { width: 100%; height: auto; max-height: 420px; display: block; border-radius: var(--r-md); background: rgba(0, 0, 0, 0.25); }
.replay .trail { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.replay .flagged { fill: none; stroke: var(--danger); stroke-width: 4; stroke-linecap: round; }
.replay .start { fill: var(--ok); }
.replay .marker { fill: #fff; }
.replay .controls { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.replay input[type=range] { flex: 1; accent-color: var(--accent); }

/* ── Detector cards ──────────────────────────────────────────────────── */
.det-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; }
.det-head h2 { font-size: 16px; }
.det-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-3); max-width: 56ch; }
.det-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 16px 14px; }
.det-stats div { padding: 10px 12px; border-radius: var(--r-md); background: rgba(0, 0, 0, 0.18); }
.det-stats b { display: block; color: var(--text); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.det-stats span { font-size: 12px; color: var(--text-3); }
.det-hint { padding: 0 16px 14px; font-size: 13px; }
details.params { border-top: 1px solid var(--hairline); }
details.params summary { cursor: pointer; padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--text-2); list-style: none; }
details.params summary::-webkit-details-marker { display: none; }
details.params summary::after { content: 'Show'; float: right; color: var(--text-3); font-weight: 400; }
details.params[open] summary::after { content: 'Hide'; }
details.params .row .ctl .input { width: 150px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Pager, empty states, servers ────────────────────────────────────── */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--text-3); }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 20px; }
.empty-state .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text-3); margin-bottom: 12px; }
.empty-state .ic svg { width: 22px; height: 22px; }
.empty-state b { color: var(--text); }
.empty-state p { margin: 6px 0 0; font-size: 13px; color: var(--text-3); max-width: 42ch; }
.server-card .card-body { display: flex; gap: 14px; align-items: center; }
.server-card .gicon { width: 48px; height: 48px; border-radius: var(--r-lg); flex: none; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-2); font-weight: 700; font-size: 18px; overflow: hidden; }
.server-card .gicon img { width: 100%; height: 100%; object-fit: cover; }
.server-card h2 { font-size: 16px; }
.server-card .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--hairline); }
.server-card .facts div { padding: 10px 16px; }
.server-card .facts div + div { border-left: 1px solid var(--hairline); }
.server-card .facts b { display: block; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.server-card .facts span { font-size: 12px; color: var(--text-3); }

/* ── Login ───────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 36px 32px; text-align: center; border-radius: var(--r-xl); }
.login-card img.logo { width: 72px; height: auto; display: block; margin: 0 auto 22px; }
.login-card h1 { font-size: 28px; }
.login-card p { color: var(--text-3); margin: 10px 0 24px; }
.login-card .btn { width: 100%; padding: 12px 18px; font-size: 15px; }
.login-card .fine { margin: 18px 0 0; font-size: 12px; }
.error-text { color: var(--danger); font-weight: 600; }

/* ── Command palette ─────────────────────────────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 120; }
.palette .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.palette .box {
  position: relative; margin: 12vh auto 0; width: min(620px, calc(100vw - 32px)); border-radius: var(--r-lg); overflow: hidden;
  background: rgba(22, 14, 30, 0.86); border: 1px solid var(--hairline-2); box-shadow: var(--glass-rim);
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
}
.palette .bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.palette .bar svg { width: 16px; height: 16px; color: var(--accent-2); }
.palette input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 15px; }
.palette .list { max-height: 52vh; overflow-y: auto; padding: 6px 0; }
.palette .group { padding: 10px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.palette .item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; text-align: left; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.palette .item span.hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.palette .item.sel { background: rgba(251, 4, 127, 0.12); }
.palette .none { padding: 24px; text-align: center; color: var(--text-3); font-size: 13px; }
.palette .foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--hairline); font-size: 12px; color: var(--text-3); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .burger { display: grid; place-items: center; }
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; }
  main.page { margin-left: 0; padding: calc(var(--top) + 20px) 16px 40px; }
  .search-btn { min-width: 0; }
  .search-btn .label, .search-btn .kbd { display: none; }
}
@media (max-width: 720px) {
  .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat .ic { width: 36px; height: 36px; }
  .stat .ic svg { width: 17px; height: 17px; }
  .stat .value { font-size: 24px; }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .row { flex-wrap: wrap; }
  .row .ctl .input { width: 100%; }
  .det-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .sidebar, .palette .box, .toast { backdrop-filter: none; -webkit-backdrop-filter: none; background: #120d18; }
}
