/* ==========================================================================
   Hoster — shared UI design system
   --------------------------------------------------------------------------
   One file, every host / admin / console page. Dark-first, light-ready,
   inspired by Linear + Raycast: near-black surfaces, 1px hairline borders,
   one accent, tight type scale, tabular numerals for anything countable.

   Link it first, before any page stylesheet:

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
     <link rel="stylesheet" href="/static/theme.css">

   Theme switch: <html data-theme="light"> forces light; no attribute follows
   the OS. .theme-toggle (see JS below) flips it and remembers the choice.
   ========================================================================== */

/* ---- tokens: dark (default) --------------------------------------------- */
:root {
  color-scheme: dark;

  /* surfaces, darkest -> lightest */
  --bg-base: #0a0b0d;
  --bg-surface: #111216;
  --bg-elevated: #17191e;
  --bg-raised: #1d2026;
  --bg-hover: #22252c;
  --bg-scrim: rgba(5, 6, 8, .72);

  /* hairlines */
  --border-subtle: rgba(255, 255, 255, .07);
  --border-default: rgba(255, 255, 255, .11);
  --border-strong: rgba(255, 255, 255, .18);

  /* text */
  --text-primary: #ecedf1;
  --text-secondary: #b4b9c3;
  --text-muted: #8a8f9b;
  --text-faint: #666b76;

  /* accent */
  --accent-primary: #7c7cf9;
  --accent-hover: #9b9bfb;
  --accent-active: #6a68e8;
  --accent-fg: #ffffff;
  --accent-soft: rgba(124, 124, 249, .14);
  --accent-border: rgba(124, 124, 249, .38);

  /* semantic */
  --success: #3ecf8e;
  --success-soft: rgba(62, 207, 142, .14);
  --warning: #f2c14e;
  --warning-soft: rgba(242, 193, 78, .13);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, .13);

  /* shape */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .38);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, .55);

  /* type */
  --font-ui: "Inter", "Inter var", -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono",
    Consolas, monospace;

  /* rhythm */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 48px;

  --header-h: 52px;
  --radius-input: var(--r-sm);
  --ring: 0 0 0 3px var(--accent-soft);
}

/* ---- tokens: light ------------------------------------------------------ */
:root[data-theme="light"] {
  color-scheme: light;

  --bg-base: #fbfbfc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-raised: #f4f4f6;
  --bg-hover: #eeeef1;
  --bg-scrim: rgba(24, 24, 27, .35);

  --border-subtle: rgba(9, 9, 11, .08);
  --border-default: rgba(9, 9, 11, .12);
  --border-strong: rgba(9, 9, 11, .2);

  --text-primary: #16171b;
  --text-secondary: #45474f;
  --text-muted: #6c6f79;
  --text-faint: #9a9da6;

  --accent-primary: #5b5bd6;
  --accent-hover: #4a48c4;
  --accent-active: #3f3db0;
  --accent-fg: #ffffff;
  --accent-soft: rgba(91, 91, 214, .1);
  --accent-border: rgba(91, 91, 214, .32);

  --success: #12855b;
  --success-soft: rgba(18, 133, 91, .1);
  --warning: #9a6b00;
  --warning-soft: rgba(154, 107, 0, .1);
  --danger: #d2353b;
  --danger-soft: rgba(210, 53, 59, .09);

  --shadow-sm: 0 1px 2px rgba(9, 9, 11, .07);
  --shadow-md: 0 6px 20px rgba(9, 9, 11, .09);
  --shadow-lg: 0 20px 56px rgba(9, 9, 11, .14);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg-base: #fbfbfc;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-raised: #f4f4f6;
    --bg-hover: #eeeef1;
    --bg-scrim: rgba(24, 24, 27, .35);

    --border-subtle: rgba(9, 9, 11, .08);
    --border-default: rgba(9, 9, 11, .12);
    --border-strong: rgba(9, 9, 11, .2);

    --text-primary: #16171b;
    --text-secondary: #45474f;
    --text-muted: #6c6f79;
    --text-faint: #9a9da6;

    --accent-primary: #5b5bd6;
    --accent-hover: #4a48c4;
    --accent-active: #3f3db0;
    --accent-soft: rgba(91, 91, 214, .1);
    --accent-border: rgba(91, 91, 214, .32);

    --success: #12855b;
    --success-soft: rgba(18, 133, 91, .1);
    --warning: #9a6b00;
    --warning-soft: rgba(154, 107, 0, .1);
    --danger: #d2353b;
    --danger-soft: rgba(210, 53, 59, .09);

    --shadow-sm: 0 1px 2px rgba(9, 9, 11, .07);
    --shadow-md: 0 6px 20px rgba(9, 9, 11, .09);
    --shadow-lg: 0 20px 56px rgba(9, 9, 11, .14);
  }
}

/* ---- reset + base ------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-hover); }
code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--sp-4) 0; }

::selection { background: var(--accent-soft); color: var(--text-primary); }

/* Numeric data (scores, counters, ranks, timers) always lines up. */
.num,
.tnum { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Scrollbars: thin, unobtrusive, themed. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* ---- app shell ---------------------------------------------------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.app-main,
.app-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.scroll { overflow: auto; min-height: 0; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.grow { flex: 1; min-width: 0; min-height: 0; }

/* The one header. Compact, hairline-separated, blur-backed. */
.app-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--header-h);
  padding: 0 var(--sp-4);
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 20;
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.01em;
  color: var(--text-primary);
  white-space: nowrap;
}
.app-header .brand .brand-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-xs);
  background: var(--accent-primary);
  color: var(--accent-fg);
  font-size: 12px;
  font-weight: 700;
}
.app-header .brand .brand-sub { color: var(--text-faint); font-weight: 400; }
.header-sep {
  width: 1px;
  align-self: stretch;
  margin: var(--sp-3) 0;
  background: var(--border-subtle);
  flex: none;
}
.spacer, .push { flex: 1; }

/* Left navigation rail (question lists, deck lists, view switchers). */
.sidebar {
  flex: none;
  width: 264px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
}
.sidebar-head {
  flex: none;
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
}
.sidebar-body { flex: 1; min-height: 0; overflow: auto; padding: 0 var(--sp-2) var(--sp-3); }
.sidebar-foot {
  flex: none;
  padding: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

/* Right rail (scoreboard, live state, meta). */
.rail {
  flex: none;
  width: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
}
.rail-body { flex: 1; min-height: 0; overflow: auto; padding: var(--sp-3); }

/* Generic responsive grid helpers. */
.grid { display: grid; gap: var(--sp-3); min-width: 0; min-height: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); min-height: 0; }
@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .rail { width: 300px; }
}
@media (max-width: 900px) {
  .app-main,
  .app-body { flex-direction: column; overflow: auto; }
  .sidebar, .rail { width: auto; border: 0; border-bottom: 1px solid var(--border-subtle); }
  .split, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- surfaces ----------------------------------------------------------- */
.card,
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  min-width: 0;
}
.card + .card,
/* .panel + .panel { margin-top: var(--sp-3); } changed by hannu to zero*/
.panel + .panel { margin-top: 0; }
.card.raised,
.panel.raised { background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
.card.flush,
.panel.flush { padding: 0; overflow: hidden; }

/* Card/panel header: title left, actions right, hairline under. */
.card-head,
.panel-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  padding: 0 0 var(--sp-2);
  min-height: 32px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-head h2,
.panel-head h2,
.card-head h3,
.panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .005em; }
.card-head .head-actions,
.panel-head .head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
/* A flush container has no padding of its own, so the header supplies it and
   runs edge to edge. Never use negative margins for this: it bleeds the header
   out of unpadded parents (rails, sidebars) instead of filling them. */
.card.flush > .card-head,
.panel.flush > .panel-head {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  min-height: 44px;
}
/* Rails and sidebars have no padding of their own. */
.rail > .panel-head,
.sidebar > .panel-head {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  min-height: 44px;
  background: var(--bg-surface);
}

/* Section label — small caps above a group of rows. */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Page-level title block. */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.page-head h1 { font-size: 19px; }
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-body { padding: var(--sp-5) var(--sp-6); }

/* Auth gate — full-bleed, centred, one card. */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background:
    radial-gradient(900px 480px at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg-base);
}
.auth-card {
  width: min(380px, 100%);
  padding: var(--sp-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 18px; margin-bottom: var(--sp-1); }
.auth-card p { color: var(--text-muted); font-size: 13px; margin-bottom: var(--sp-4); }
.auth-card input { margin-bottom: var(--sp-3); }
.auth-card button { width: 100%; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  --btn-bg: var(--bg-raised);
  --btn-fg: var(--text-primary);
  --btn-bd: var(--border-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 30px;
  padding: 0 var(--sp-3);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .06s ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled,
.btn[disabled] { opacity: .4; cursor: default; transform: none; }
.btn:disabled:hover { background: var(--btn-bg); border-color: var(--btn-bd); }

.btn-primary {
  --btn-bg: var(--accent-primary);
  --btn-fg: var(--accent-fg);
  --btn-bd: transparent;
  font-weight: 600;
}
.btn-primary:hover { --btn-bg: var(--accent-hover); --btn-bd: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--text-secondary); }
.btn-ghost:hover { --btn-bg: var(--bg-hover); --btn-bd: transparent; color: var(--text-primary); }
.btn-outline { --btn-bg: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-success { --btn-bg: var(--success); --btn-fg: #05130d; --btn-bd: transparent; font-weight: 600; }
.btn-success:hover { --btn-bg: var(--success); filter: brightness(1.08); }

.btn-sm { height: 26px; padding: 0 var(--sp-2); font-size: 12px; border-radius: var(--r-xs); }
.btn-lg { height: 40px; padding: 0 var(--sp-5); font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-icon { width: 28px; padding: 0; }
.btn-group { display: inline-flex; gap: var(--sp-1); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* Segmented control — a pill of mutually exclusive choices. */
.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
}
.seg > button,
.seg > .seg-item {
  height: 24px;
  padding: 0 var(--sp-3);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: var(--r-xs);
  cursor: pointer;
  white-space: nowrap;
}
.seg > button:hover { color: var(--text-primary); background: var(--bg-hover); }
.seg > button.active,
.seg > .seg-item.active {
  color: var(--text-primary);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
}

/* Tabs (header nav) — flat, underline-free, pill-on-active. */
.tab {
  height: 28px;
  padding: 0 var(--sp-3);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab.active { color: var(--text-primary); background: var(--bg-raised); box-shadow: var(--shadow-sm); }
.tabpane { min-height: 0; }

/* ---- form controls ------------------------------------------------------ */
.input,
.select,
.textarea,
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  height: 30px;
  padding: 0 var(--sp-3);
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-input);
  transition: border-color .12s ease, box-shadow .12s ease;
  min-width: 0;
}
textarea { height: auto; padding: var(--sp-2) var(--sp-3); line-height: 1.5; resize: vertical; }
.input:hover, .select:hover, input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--ring);
}
::placeholder { color: var(--text-faint); }
select.select,
select {
  appearance: none;
  padding-right: var(--sp-6);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-3); min-width: 0; }
.field > label, .flabel {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.field .hintline, .hintline { font-size: 11px; color: var(--text-faint); }
.field-row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }

/* Checkbox / radio rows. */
.check,
.check-row,
.hint-check-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  flex: none;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--accent-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center/11px no-repeat;
  border-color: var(--accent-primary);
}
input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 3px var(--bg-base);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible { box-shadow: var(--ring); }

/* Toggle switch (label wraps input + .switch). */
.switch,
.toggle {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: background .15s ease;
}
.switch::after,
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}
input:checked + .switch,
input:checked + .toggle { background: var(--accent-primary); }
input:checked + .switch::after,
input:checked + .toggle::after { transform: translateX(14px); }
input:focus-visible + .switch,
input:focus-visible + .toggle { box-shadow: var(--ring); }

/* ---- pills, badges, status ---------------------------------------------- */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 var(--sp-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
}
.badge.accent, .pill.accent {
  color: var(--accent-primary);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.badge.success, .pill.success { color: var(--success); background: var(--success-soft); border-color: transparent; }
.badge.warning, .pill.warning { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.badge.danger, .pill.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.mono, .pill.mono { font-family: var(--font-mono); font-weight: 500; }

/* Status dot (connection, presence). JS overwrites className on #conn*, so the
   base .dot must be part of every string it writes. */
.dot {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.dot-on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot-off { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot-err { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.pulse { animation: hoster-pulse 1.7s ease-in-out infinite; }
@keyframes hoster-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* Small metric tile. */
.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  height: 24px;
  padding: 0 var(--sp-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
}

/* ---- lists, feeds, tables ----------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-row,
.feed-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-3);
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.list-row:last-child,
.feed-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--bg-hover); }

.feed { display: flex; flex-direction: column; }
.feed-time {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}
.feed-who { flex: 1; min-width: 0; color: var(--text-secondary); }
.feed-who b { color: var(--text-primary); font-weight: 600; }
.feed-rank {
  flex: none;
  min-width: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--warning);
}

.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
  position: sticky;
  top: 0;
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
table.table td {
  padding: 7px var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
table.table tbody tr:hover td { background: var(--bg-hover); }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- selectable list rows (sidebar navigation) --------------------------- */
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 7px var(--sp-2);
  font: inherit;
  font-size: 13px;
  text-align: left;
  color: var(--text-secondary);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
.nav-item .nav-num {
  flex: none;
  min-width: 24px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}
.nav-item.active .nav-num { color: var(--accent-primary); }
.nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-meta { flex: none; font-size: 11px; color: var(--text-faint); }

/* ---- misc utilities ----------------------------------------------------- */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.strong, b { font-weight: 600; }
.error { color: var(--danger); font-size: 12px; }
.success-text { color: var(--success); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.center { display: grid; place-items: center; }
.row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--sp-2); min-height: 0; }
.empty,
.empty-note {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}
.muted-note { font-size: 12px; color: var(--text-muted); }
.divider { height: 1px; background: var(--border-subtle); margin: var(--sp-3) 0; }
.mono { font-family: var(--font-mono); }
.sronly {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Preview / stage frame — a 16:9 viewport onto a client screen. */
.preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.preview-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* Theme toggle button glyph */
.theme-toggle { font-size: 13px; line-height: 1; }

/* Thin row of small controls used inside score rows. */
.chip-controls {
  display: inline-flex;
  flex: none;
  padding: 1px;
  gap: 1px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
}
.chip-controls button {
  height: 21px;
  min-width: 26px;
  padding: 0 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
}
.chip-controls button:hover { background: var(--bg-hover); color: var(--text-primary); }
.chip-controls button:active { background: var(--accent-soft); color: var(--accent-primary); }
.chip-controls button.is-neg:hover { background: var(--danger-soft); color: var(--danger); }