  :root {
    color-scheme: dark;
    --bg:        #0e0f11;
    --bg-grad:   radial-gradient(1400px 900px at 100% -10%, #1a1410 0%, #0e0f11 60%);
    --surface:   #16181c;
    --surface-2: #1c1f24;
    --surface-3: #232730;
    --line:      #25282e;
    --line-soft: #1f2227;
    --text:      #e8e3d8;
    --muted:     #7a7a78;
    --dim:       #4d4e52;
    --accent:    #d4631e;
    --accent-2:  #f0a45e;
    --green:     #6fb56b;
    --amber:     #e1b04a;
    --blue:      #6f8db5;
    --red:       #c64a3c;
    --purple:    #b079f0;
    --kick:      #53e7a4;
    --header-bg: rgba(14,15,17,.82);
  }

  /* Light theme — applied when <html data-theme="light"> (set pre-paint from
     localStorage in _layout.html). Warm cream palette to match the brand
     orange; brand/status colors darkened for contrast on a light surface. */
  html[data-theme="light"] {
    color-scheme: light;
    --bg:        #f6f2ea;
    --bg-grad:   radial-gradient(1400px 900px at 100% -10%, #fbeede 0%, #f6f2ea 60%);
    --surface:   #ffffff;
    --surface-2: #f1ebe0;
    --surface-3: #e8e1d3;
    --line:      #e0d8c9;
    --line-soft: #ece5d8;
    --text:      #2a2620;
    --muted:     #6f6a61;
    --dim:       #a59f93;
    --accent:    #c25812;
    --accent-2:  #d9853a;
    --green:     #4e9a4a;
    --amber:     #b2841c;
    --blue:      #4f6e96;
    --red:       #c2402f;
    --purple:    #8b4fd0;
    --kick:      #16a574;
    --header-bg: rgba(246,242,234,.82);
  }

  * { box-sizing: border-box; }

  /* Thin, themed scrollbars — replace the heavy default OS bars (especially
     ugly on Windows) with a subtle dark handle that matches the UI. */
  * { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  ::-webkit-scrollbar { width: 9px; height: 9px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
  ::-webkit-scrollbar-corner { background: transparent; }

  /* Global <select> theming — native dropdowns pick up the surface color
     so they don't flash white in dark mode. color-scheme on :root handles
     the popup chrome; these rules handle the visible button area. */
  select {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 8px;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    cursor: pointer;
  }
  select:hover, select:focus { border-color: var(--accent); }
  select option {
    background-color: var(--surface-2);
    color: var(--text);
  }

  html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    background-image: var(--bg-grad);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-feature-settings: 'ss03', 'cv11';
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.45;
    min-height: 100vh;
  }
  /* body::before grain overlay removed (optional nice-to-have) */

  /* TOP BAR */
  header.top {
    position: sticky; top: 0; z-index: 10;
    border-bottom: 1px solid var(--line);
    background: var(--header-bg);
    backdrop-filter: blur(14px) saturate(120%);
  }
  /* Theme toggle button in the top bar. */
  .theme-toggle {
    appearance: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    width: 26px; height: 26px;
    border-radius: 7px;
    font-size: 13px; line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color .15s, border-color .15s, background .15s;
  }
  .theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
  .topbar {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 24px;
  }
  .brand {
    display: flex; align-items: center; gap: 9px;
  }
  .brand-logo { display: block; width: 32px; height: 32px; }
  .brand .mark {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-variation-settings: 'opsz' 96, 'wdth' 200;
    letter-spacing: -0.02em;
    font-size: 20px;
  }
  .brand .mark span { color: var(--accent); }
  .brand .tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 3px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
  }
  .nav { display: flex; gap: 4px; justify-self: center; }
  .nav a {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 2px;
    transition: color .15s, background .15s;
  }
  .nav a:hover { color: var(--text); background: var(--surface); }
  .nav a.active {
    color: var(--text);
    background: var(--surface);
    box-shadow: inset 0 -2px 0 var(--accent);
  }
  .user {
    justify-self: end;
    display: flex; align-items: center; gap: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--muted);
  }
  .user .clock { color: var(--text); }
  .user .pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 1.8s ease-in-out infinite;
  }
  @keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .4 } }
  /* Update available: pulse dot turns amber, plus a small pill by the GitHub icon. */
  .user .pulse.update { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
  /* GitHub icon + (when an update exists) a tiny version pill stacked under it. */
  .user .gh-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1; }
  .update-pill {
    font-family: 'JetBrains Mono', monospace; font-size: 8px; line-height: 1;
    padding: 1px 5px; border-radius: 8px;
    color: var(--amber); border: 1px solid var(--amber);
    text-decoration: none; letter-spacing: 0.02em; white-space: nowrap;
  }
  .update-pill:hover { background: var(--amber); color: #1a1a1a; }
  .user .gh-link {
    display: inline-flex; align-items: center;
    color: var(--muted); transition: color .15s;
  }
  .user .gh-link:hover { color: var(--text); }

  /* LAYOUT */
  main {
    position: relative; z-index: 1;
    max-width: 1640px; margin: 0 auto;
    padding: 24px 24px 80px;
  }

  /* PAGE HEAD compact */
  .page-head {
    display: grid; grid-template-columns: 1fr auto;
    gap: 24px; align-items: end;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
  }
  .page-head .kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.2em;
    margin-bottom: 8px;
  }
  .page-head .sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.15em;
    margin-top: 8px;
  }
  .apply-form { display: inline; }
  .page-head h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-variation-settings: 'opsz' 96, 'wdth' 90;
    font-weight: 500;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 0.98;
    letter-spacing: -0.03em;
    margin: 0;
  }
  .page-head h1 em {
    font-style: italic;
    color: var(--accent);
    background: linear-gradient(105deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .page-head .actions { display: flex; gap: 8px; }

  /* BUTTON SYSTEM — global secondary (.btn) + primary (.btn.primary) pair.
     Shared geometry; the secondary reads as a quiet ghost, the primary is
     the single accent-forward action. Both get tactile :active and a
     visible :focus-visible ring. Sizing/colors live here only — never
     inline padding/font/border on a button. */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 9px 15px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    border-radius: 2px;
    transition: color .15s, border-color .15s, background-color .15s, transform .06s;
    cursor: pointer;
  }
  /* Secondary hover: lift the muted text to full, warm the border, faint tint. */
  .btn:hover {
    border-color: var(--accent);
    color: var(--text);
    background: rgba(212, 99, 30, 0.06);
  }
  .btn:active { transform: translateY(1px); }
  .btn:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
  }

  /* Primary: the one accent-filled action. Dark ink on accent, a hairline
     top highlight (accent-2) gives it dimension without reading heavy. */
  .btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a0d04;
    box-shadow: inset 0 1px 0 rgba(240, 164, 94, 0.45);
  }
  .btn.primary:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #1a0d04;
  }
  .btn.primary:focus-visible {
    outline-color: var(--accent-2);
    outline-offset: 2px;
  }

  .btn.sm { padding: 5px 9px; font-size: 10px; letter-spacing: 0.12em; }
  /* Ghost: borderless quiet variant (nav logout, BACK link). */
  .btn.ghost { background: transparent; border-color: transparent; }
  .btn.ghost:hover { border-color: transparent; background: var(--surface); color: var(--text); }

  /* ALERT BANNER — surfaces accounts that need attention (needs_auth,
     needs_drops). Single-line callout with kind tag + body + CTA. */
  .alerts {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
  }
  /* Flat alert row — accent left tick + soft tint, no full box border
     (matches the kind-colored row accent used everywhere else). */
  .alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    box-shadow: inset 3px 0 0 var(--accent);
    background: rgba(212, 99, 30, 0.06);
  }
  .alert-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .alert-body {
    font-size: 12.5px;
    color: var(--text);
    flex: 1;
    line-height: 1.45;
  }
  /* CTA reads as a line action, not a box (the .btn classes on the
     element are overridden here so the template stays platform-agnostic). */
  .alert-cta {
    border: none;
    background: none;
    padding: 4px 2px;
    letter-spacing: 0.16em;
    color: var(--accent);
  }
  .alert-cta:hover { color: var(--text); background: none; border: none; }

  /* TELEMETRY STRIP — 6 stats */
  /* Flat stat strip — no boxed grid; cards separated by space, the strip
     closed by a dashed rule (matches /drops + the rest of the app). */
  .telemetry {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 22px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--line);
  }
  .stat {
    padding: 6px 2px 0;
    position: relative;
  }
  .stat::after {
    content: ""; position: absolute; top: 0; left: 0;
    width: 28px; height: 2px;
    background: var(--accent);
  }
  .stat .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.16em;
    margin-bottom: 8px;
  }
  .stat .value {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-variation-settings: 'opsz' 96;
    font-weight: 500;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.025em;
  }
  .stat .value sup {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 6px;
    letter-spacing: 0;
    vertical-align: middle;
  }
  .stat .delta {
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--green);
  }
  .stat .delta.flat { color: var(--muted); }
  .stat .delta.bad { color: var(--red); }

  /* GRID: primary + side */
  .layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
  }
  @media (max-width: 1200px) { .layout { grid-template-columns: 1fr; } }

  /* SECTION HEADER */
  .section {
    margin-bottom: 24px;
  }
  .sec-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    gap: 14px;
    margin: 0 0 12px;
  }
  .sec-head h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin: 0;
  }
  .sec-head .rule { border-bottom: 1px dashed var(--line); align-self: end; margin-bottom: 6px; }
  .sec-head .meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.15em;
  }
  .sec-head .meta b { color: var(--text); }

  /* Full-width sections (used for currently-mining and live-pair below
     the 2-col upper layout). Breaks out of any narrower wrapper above
     while still respecting the page's max-width via main's padding. */
  .section-wide {
    grid-column: 1 / -1;
  }

  /* CURRENTLY MINING — compact two-column platform layout. The wrapper
     splits the row into a TWITCH column and a KICK column; each column
     holds one .account-row per account. Old .mcard grid removed. */
  .mining-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  @media (max-width: 1100px) {
    .mining-columns { grid-template-columns: 1fr; }
  }
  .mining-col {
    display: flex;
    flex-direction: column;
  }
  .mining-col-head {
    display: grid;
    grid-template-columns: 10px auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 0 4px 8px;
    border-bottom: 1px dashed var(--line);
  }
  .mining-col-head .pip {
    width: 8px; height: 8px; border-radius: 50%;
  }
  .mining-col-head .pip.twitch { background: var(--purple); box-shadow: 0 0 6px rgba(176, 121, 240, 0.5); }
  .mining-col-head .pip.kick   { background: var(--kick);   box-shadow: 0 0 6px rgba(83, 231, 164, 0.4); }
  .mining-col-head h3 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text);
  }
  .mining-col-head .count {
    grid-column: 4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 1px 7px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
  }
  /* Bubble next to the KICK header showing the active accrual path. */
  /* Per-account live watch-path pill (WS green / Chrome blue). Small, sits
     under the name in the .who flex column. align-self:flex-start so it hugs
     its text instead of stretching to the column width. */
  .watch-mode {
    align-self: flex-start;
    margin-top: 6px; /* gap under the name; lands the pill near the avatar's bottom edge */
    font-family: 'JetBrains Mono', monospace;
    font-size: 7px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 4px;
    border-radius: 999px;
    border: 1px solid transparent;
    opacity: 0.75;
    cursor: help;
  }
  .watch-mode.ws     { color: var(--green); border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
  .watch-mode.chrome { color: var(--blue);  border-color: var(--blue);  background: color-mix(in srgb, var(--blue) 12%, transparent); }
  /* Each account-row is an <a> so the whole row is a click-target into
     the account detail page. Grid lays out: avatar · who · state pill ·
     activity · progress bar. Progress bar slot is empty unless the row
     is in the watching state — keeps the column rhythm consistent. */
  .account-row {
    display: grid;
    grid-template-columns: 28px minmax(120px, 1fr) minmax(0, 2fr) max-content max-content;
    grid-template-areas: "av who activity pill reload";
    gap: 12px;
    align-items: center;
    padding: 9px 14px;
    /* border-top lives on .account-row-d; don't double it on the summary. */
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
  }
  .account-row .av { grid-area: av; }
  .account-row .who { grid-area: who; }
  .account-row .activity {
    grid-area: activity;
    text-align: right;
    min-width: 0;
    overflow: hidden; /* clip long meta so it can't run under the pill */
    margin-right: auto; /* keep text pushed left of the pill */
    margin-left: auto;
  }
  .account-row .state-pill {
    grid-area: pill;
    justify-self: end;
  }
  .account-row .pbar.mini {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 6px;
  }

  /* Per-account reload arrow — a subtle icon button at the end of each row.
     Reuses .btn.sm sizing but renders as a borderless glyph until hovered,
     so it reads as a quiet line action (like the global Reload, but scoped
     to one account). gap:8px between it and the pill is via the grid. */
  .account-row .row-reload {
    grid-area: reload;
    justify-self: end;
    padding: 2px 6px;
    min-width: 0;
    line-height: 1;
    font-size: 13px;
    letter-spacing: 0;
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    opacity: 0.55;
    transition: opacity 0.12s, color 0.12s, border-color 0.12s, background 0.12s;
  }
  .account-row-d:hover .row-reload { opacity: 1; }
  .account-row .row-reload:hover {
    color: var(--text);
    border-color: var(--line);
    background: var(--surface);
  }

  /* <details> wrapper around each row — click-to-expand inline. */
  .account-row-d { border-top: 1px dashed var(--line); }
  .mining-col .account-row-d:first-of-type { border-top: none; }
  .account-row-d > summary {
    list-style: none;
    cursor: pointer;
    /* re-apply the grid layout the bare .account-row had since
       <summary> resets some user-agent display values. */
    border-top: none;
  }
  .account-row-d > summary::-webkit-details-marker { display: none; }
  .account-row-d > summary::marker { display: none; }
  .account-row-d[open] > summary { background: var(--surface-2); }

  .account-row-expand {
    padding: 10px 14px 14px;
    background: var(--surface-2);
    border-top: 1px dashed var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
  }
  .acc-exp-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    align-items: baseline;
  }
  .acc-exp-k {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
  }
  .acc-exp-v {
    color: var(--text);
    word-break: break-word;
  }
  .acc-exp-v a { color: var(--accent); text-decoration: none; }
  .acc-exp-v a:hover { text-decoration: underline; }
  .acc-exp-next .acc-exp-v {
    display: flex; flex-direction: column; gap: 3px;
  }
  .acc-exp-queue-item small {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    margin-left: 6px;
  }
  /* Drops page: expanded campaign item list — row style consistent with the
     app's other tables (icon · name · required). */
  /* Borderless item list — matches the app's row aesthetic (no table
     chrome). Columns align via grid; rows separate by spacing + a hover
     tint, not borders. */
  .drop-items {
    margin: 4px 18px 12px;
  }
  .drop-items-head,
  .drop-item {
    display: grid;
    grid-template-columns: 32px minmax(120px, 1.3fr) minmax(80px, 1.4fr) auto;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
  }
  .drop-items-head {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .drop-items-head span:last-child { text-align: right; }
  .drop-item { border-radius: 4px; }
  .drop-item:hover { background: var(--surface-2); }
  .drop-item-icon { display: inline-flex; }
  .drop-item-icon img,
  .drop-item-icon .ph {
    width: 28px; height: 28px;
    border-radius: 4px;
    object-fit: contain;
    background: var(--bg);
    border: 1px solid var(--line);
    display: inline-block;
  }
  .drop-item-name { color: var(--text); font-size: 13px; word-break: break-word; }
  .drop-item-type { text-align: right; }
  .dtype {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid var(--line);
    white-space: nowrap;
  }
  .dtype-watch { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
  .dtype-action { color: var(--muted); }

  /* Campaign connected (account-linked) status chip. */
  .link-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid transparent;
  }
  .link-ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
  .link-warn { color: var(--accent); border-color: var(--accent); background: rgba(212, 99, 30, 0.08); }

  /* Drops header: the // kicker carries the Twitch/Kick drops-page links. */
  .kicker-link { color: var(--accent); text-decoration: none; }
  .kicker-link:hover { text-decoration: underline; }

  /* Per-campaign collection chips in the drops row's right column.
     One chip per account that has claimed; green tick = all watch-time
     drops collected, yellow = partial. Cross = action-only campaign. */
  .ac.collect { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
  .ccol {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 3px;
    border: 1px solid var(--line);
    white-space: nowrap;
    color: var(--muted);
  }
  .ccol.tw { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 35%, transparent); }
  .ccol.kk { color: var(--kick); border-color: color-mix(in srgb, var(--kick) 35%, transparent); }
  .ccol .tk { color: var(--green); }
  .ccol .tk.partial { color: var(--amber); }
  .ccross { color: var(--red); font-family: 'JetBrains Mono', monospace; font-size: 13px; }

  /* Collection marks: one bordered box holding a green ✓ per collector
     (no @login — account identity doesn't matter), or an orange ✗ for
     action-required campaigns that can't be auto-mined. Shared style so
     every page renders collection the same way. */
  .collect-box {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--line);
    line-height: 1;
  }
  .collect-box .tk { color: var(--green); font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; }
  .collect-box .tk.partial { color: var(--amber); }
  .collect-box .tk.cross { color: var(--accent); }

  /* Non-watch-time drops/items (reward / 0-min action) render at default
     opacity — the ✗ action mark already signals they can't be auto-mined. */

  /* Discoverable row: add-to-whitelist control, secondary under the contents. */
  .disc-add {
    border-top: 1px dashed var(--line);
    margin: 4px 16px 12px;
    padding-top: 10px;
    display: flex;
  }
  .disc-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .disc-add-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .disc-add-label strong { color: var(--text); font-weight: 600; }
  .disc-add-form select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    padding: 4px 7px;
    max-width: 220px;
  }
  /* auth-health pill on the accounts list */
  .auth-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    white-space: nowrap;
  }
  .auth-pill.ok      { color: var(--green);  border: 1px solid rgba(111, 181, 107, 0.4); }
  .auth-pill.bad     { color: var(--accent); border: 1px solid rgba(212, 99, 30, 0.5); background: rgba(212, 99, 30, 0.08); }
  .auth-pill.unknown { color: var(--dim);    border: 1px solid var(--line); }
  /* Per-account enable/disable toggle — boxed pill that reads as a switch:
     green-bordered when the account is ON (button disables it), muted when
     OFF (button enables it). */
  .row-toggle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 11px;
    border-radius: 4px;
    margin-left: 10px;
    background: transparent;
    cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
  }
  .row-toggle.on        { color: var(--green); border: 1px solid rgba(111, 181, 107, 0.4); }
  .row-toggle.on:hover  { background: rgba(111, 181, 107, 0.10); border-color: var(--green); }
  .row-toggle.off       { color: var(--dim);   border: 1px solid var(--line); }
  .row-toggle.off:hover { color: var(--text);  border-color: var(--accent); background: rgba(212, 99, 30, 0.06); }
  /* not-linked row actions: "connect account →" link + "I've linked it"
     override button, kept on one line, right-aligned in the .ac cell. */
  /* per-account connect chips on a not-linked row */
  .conn-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--line);
    white-space: nowrap;
    text-decoration: none;
  }
  .conn-chip.ok   { color: var(--green); }
  .conn-chip.need { color: var(--accent); border-color: rgba(212, 99, 30, 0.5); }
  .conn-chip.need:hover { background: rgba(212, 99, 30, 0.1); }
  .dl-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
  .link-actions { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; white-space: nowrap; }
  .link-actions > a { white-space: nowrap; }
  .link-actions form { display: inline; margin: 0; }
  /* Matches the .collect-box tick style: neutral border, green ✓, no fill.
     Scoped under .link-actions so it out-specifies .btn.sm (padding 5px 9px),
     which would otherwise make the row taller than the whitelisted rows. */
  .link-actions .linked-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 7px;
    white-space: nowrap;
    color: var(--green);
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
  }
  .linked-btn:hover { border-color: color-mix(in srgb, var(--green) 45%, transparent); }
  .linked-btn:disabled { opacity: 0.5; cursor: default; }
  /* Discoverable row right-cell whitelist control (compact select + button). */
  .whitelist-add { display: inline-flex; justify-content: flex-end; }
  .whitelist-add .disc-add-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
  /* Fixed height so discoverable rows match the whitelisted rows: a native
     select floors ~21px at any padding, so pin the box height explicitly. */
  .whitelist-add select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    line-height: 1;
    height: 17px;
    padding: 0 4px;
    box-sizing: border-box;
    max-width: 160px;
  }
  .whitelist-add .btn.sm { white-space: nowrap; font-size: 9.5px; line-height: 1; height: 17px; padding: 0 6px; box-sizing: border-box; }
  /* COLLECTED marks — one chip per account that claimed the benefit. */
  .drop-item-collected { display: flex; flex-wrap: wrap; gap: 5px; }
  .cmark {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 3px;
    border: 1px solid var(--line);
    color: var(--muted);
    white-space: nowrap;
  }
  .cmark::before { content: "✓ "; color: var(--green); }
  .cmark-twitch { color: var(--purple); border-color: color-mix(in srgb, var(--purple) 35%, transparent); }
  .cmark-kick { color: var(--kick); border-color: color-mix(in srgb, var(--kick) 35%, transparent); }
  .cmark-none { color: var(--dim); font-size: 12px; }
  /* Clickable collected mark — manual un-collect escape hatch. Looks like
     the static chip; reveals it's actionable only on hover (no visible X). */
  button.cmark-btn { background: transparent; cursor: pointer; transition: opacity .12s, border-color .12s; }
  button.cmark-btn:hover { opacity: .65; border-color: color-mix(in srgb, var(--red) 55%, transparent); }
  /* Manual "mark collected" add menu on a benefit row. */
  .cmark-add { position: relative; display: inline-block; }
  .cmark-add-btn { cursor: pointer; display: inline-block; list-style: none; padding: 1px 7px;
    border: 1px dashed var(--muted); border-radius: 10px; color: var(--muted); font-size: 11px; }
  .cmark-add-btn::-webkit-details-marker { display: none; }
  .cmark-add-btn::marker { content: ""; }
  .cmark-add[open] .cmark-add-btn { color: var(--accent); border-color: var(--accent); }
  .cmark-add-menu { position: absolute; right: 0; z-index: 20; margin-top: 4px; padding: 6px;
    background: var(--panel, #161616); border: 1px solid var(--border, #2a2a2a); border-radius: 8px;
    display: flex; flex-direction: column; gap: 4px; min-width: 140px; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
  .cmark-add-head { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
  .cmark-add-opt { cursor: pointer; text-align: left; padding: 3px 6px; border-radius: 6px;
    border: 1px solid transparent; background: transparent; color: var(--text, #e8e8e8); font-size: 11px; }
  .cmark-add-opt:hover { border-color: var(--accent); }

  /* Watching expand: detail rows on the left, the drop's item icon on the
     right, vertically centered in the free space beside the rows. */
  .acc-exp-grid {
    display: flex;
    gap: 20px;
    align-items: center;
  }
  .acc-exp-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .acc-exp-img {
    margin: 0;
    flex: 0 0 auto;
    align-self: center;
  }
  .acc-exp-img img {
    display: block;
    width: auto;
    height: auto;
    max-height: 112px;
    max-width: 160px;
    object-fit: contain;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px;
  }
  .acc-exp-views {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
  }
  .mining-col .account-row:first-of-type { border-top: none; }
  .account-row:hover { background: var(--surface-2); }
  .account-row.disabled { opacity: 0.45; }
  .account-row.empty {
    padding: 18px 14px;
    text-align: center;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  .account-row .av {
    position: relative;
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--surface-3), var(--dim));
    border-radius: 50%;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    overflow: hidden;
  }
  /* Real avatar fills the circle; the letter underneath shows through if the
     image is absent or fails to load (onerror removes the <img>). */
  .account-row .av img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 1; /* opaque image covers the letter fallback beneath it */
  }
  .account-row .av .av-i {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .mining-col-twitch .account-row .av { border-color: rgba(176, 121, 240, 0.5); }
  .mining-col-kick   .account-row .av { border-color: rgba(83, 231, 164, 0.5); }
  .account-row .who { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; min-width: 0; min-height: 30px; }
  .account-row .who .login {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .account-row .who .name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* State pills — share the .state-pill base from the accounts table
     so the visual vocabulary is consistent. Per-state overrides give
     each kind a distinct color. */
  .account-row .state-pill {
    display: inline-block;
    text-align: center;
    padding: 3px 6px;
    font-size: 9.5px;
    line-height: 1.2;
    letter-spacing: 0.12em;
    border-radius: 2px;
  }
  .pill-watching,
  .pill-force_watch { color: var(--green);  border-color: rgba(111, 181, 107, 0.45); background: rgba(111, 181, 107, 0.06); }
  .pill-claiming   { color: var(--amber);  border-color: rgba(225, 176, 74, 0.45);  background: rgba(225, 176, 74, 0.06); }
  .pill-pick_stream,
  .pill-pick_campaign { color: var(--blue); border-color: rgba(111, 141, 181, 0.45); background: rgba(111, 141, 181, 0.06); }
  .pill-sleeping   { color: var(--muted);  border-color: var(--line); }
  .pill-awaiting_connect { color: #e8d44d; border-color: rgba(232, 212, 77, 0.5); background: rgba(232, 212, 77, 0.08); }
  .pill-needs_auth { color: var(--accent); border-color: rgba(212, 99, 30, 0.5);    background: rgba(212, 99, 30, 0.08); }
  .pill-idle,
  .pill-stopped    { color: var(--dim);    border-color: var(--line); }
  .account-row .activity {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* right-align the drop/meta lines */
    line-height: 1.2;
    min-width: 0;
    overflow: hidden; /* clip so a long campaign name can't reach the pill */
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
  }
  /* The drop/meta lines are flex-column children; without an explicit max-width
     a nowrap line keeps its full intrinsic width and slides under the state
     pill. Cap at the container width so text-overflow:ellipsis actually fires. */
  .account-row .activity .drop {
    color: var(--text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .account-row .activity .meta {
    color: var(--muted);
    font-size: 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Compact progress bar shown only on the watching row. Empty grid
     cell when absent keeps the row alignment stable across states. */
  .account-row .pbar.mini {
    position: relative;
    width: 100%;
    height: 3px;
    background: var(--surface-3);
    overflow: hidden;
  }
  .account-row .pbar.mini .fill {
    position: absolute; inset: 0 auto 0 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
  }
  @media (max-width: 720px) {
    .account-row {
      grid-template-columns: 28px 1fr auto;
      grid-template-areas:
        "av who pill"
        "av act act"
        "av bar bar";
      row-gap: 4px;
    }
    .account-row .av       { grid-area: av; }
    .account-row .who      { grid-area: who; }
    .account-row .state-pill { grid-area: pill; }
    .account-row .activity { grid-area: act; }
    .account-row .pbar.mini { grid-area: bar; }
  }

  /* Legacy .mining-grid + .mcard styles kept below for any pages that
     still reference them (none currently — dashboard moved to the
     compact account-row layout above). Safe to delete once nothing
     else points at them. */
  .mining-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }
  .mcard {
    background: var(--surface);
    padding: 16px 18px 14px;
    position: relative;
    overflow: hidden;
  }
  .mcard:hover { background: var(--surface-2); }
  .mcard.disabled { opacity: .42; }

  .mcard-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 12px;
  }
  .mcard .name {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-variation-settings: 'opsz' 60;
    font-size: 19px;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0 0 2px;
  }
  .mcard .handle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
  }
  .mcard .plat {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--muted);
    height: fit-content;
    white-space: nowrap;
  }
  .plat.twitch { color: var(--purple); border-color: #4a3970; background: rgba(122,75,176,.08); }
  .plat.kick   { color: var(--kick);   border-color: #2d5c44; background: rgba(83,231,164,.06); }

  .mcard .state-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center; gap: 10px;
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
  }
  .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--muted);
  }
  .dot.watching { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s ease-in-out infinite; }
  .dot.claiming { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
  .dot.pick     { background: var(--blue);  box-shadow: 0 0 8px var(--blue); animation: pulse 2.2s ease-in-out infinite; }
  .dot.sleeping { background: var(--dim); }
  .dot.error    { background: var(--red);   box-shadow: 0 0 10px var(--red); animation: pulse 1.2s ease-in-out infinite; }
  .state-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }
  .state-label .sub { color: var(--muted); margin-left: 6px; letter-spacing: 0.08em; }
  .uptime { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }

  /* now-playing strip */
  .nowp {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 12px;
    background: var(--surface-2);
    border-left: 2px solid var(--purple);
    font-size: 12.5px;
  }
  .nowp.kick { border-left-color: var(--kick); }
  .nowp .av {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--surface-3), var(--dim));
    border-radius: 50%;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
  }
  .nowp .meta1 { line-height: 1.25; }
  .nowp .meta1 .ch { font-weight: 600; }
  .nowp .meta1 .game { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); }
  .nowp .views {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
  }
  .nowp .views::before { content: "●"; color: var(--red); margin-right: 4px; }

  /* drop block */
  .drop {
    border-top: 1px dashed var(--line);
    padding-top: 11px;
    margin-bottom: 10px;
  }
  .drop .meta {
    display: flex; justify-content: space-between;
    margin-bottom: 6px;
    align-items: baseline;
  }
  .drop .meta .nm {
    font-size: 13px;
    font-weight: 500;
  }
  .drop .meta .nm .campaign {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    margin-left: 6px;
  }
  .drop .meta .progress {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .drop .meta .progress b { color: var(--text); }
  .pbar {
    height: 4px; background: var(--surface-3); position: relative;
    overflow: hidden;
  }
  .pbar .fill {
    position: absolute; inset: 0 auto 0 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
  }
  .pbar .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
  .drop .eta {
    margin-top: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
  }
  .drop .eta b { color: var(--accent); }

  /* queue mini-list inside card */
  .qmini {
    border-top: 1px dashed var(--line);
    padding-top: 10px;
    margin-top: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
  }
  .qmini .h {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 5px;
    color: var(--muted);
  }
  .qmini ul { list-style: none; margin: 0; padding: 0; }
  .qmini li {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 8px;
    padding: 3px 0;
    align-items: baseline;
  }
  .qmini li .n { color: var(--dim); }
  .qmini li .name { color: var(--text); font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; }
  .qmini li .name small { color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-left: 4px; }
  .qmini li .req { color: var(--muted); }

  .mcard-foot {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  .mcard-foot a {
    color: var(--accent); text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }
  .mcard-foot .row { display: flex; gap: 14px; }

  /* PENDING CLAIMS */
  .pending {
    display: grid;
    /* Fill the row regardless of count, capped at 4 columns. Less than
       four cards spread out evenly; more than four wrap. */
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-bottom: 24px;
  }
  .pending:has(> :nth-child(5)) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .pcard {
    background: linear-gradient(180deg, rgba(225,176,74,.06), transparent 70%) var(--surface);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
  }
  .pcard .sprite {
    width: 36px; height: 36px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    display: grid; place-items: center;
    color: var(--amber);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 18px;
  }
  .pcard .meta { line-height: 1.25; }
  .pcard .nm { font-size: 13px; font-weight: 500; }
  .pcard .nm .ac {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    margin-left: 6px;
  }
  .pcard .sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
  }
  .pcard .claim {
    background: var(--amber);
    color: #1a1305;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 10px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: 1px solid var(--amber);
    transition: all .15s;
  }
  .pcard .claim:hover { background: var(--accent-2); border-color: var(--accent-2); }
  .pcard .sprite.muted { color: var(--muted); }
  /* Future-claim pill — pending ETAs are not yet actionable so the
     amber call-to-action becomes a neutral outline. */
  .pcard .claim.future {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
  }
  .pcard .claim.future:hover {
    background: transparent;
    border-color: var(--line);
  }

  /* EVENTS BOTTOM DRAWER — flat (no border/fill); dashed-rule header. */
  .drawer {
    margin-top: 20px;
  }
  .subnav {
    display: flex;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
  }
  .subnav-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
    background: transparent;
  }
  .subnav-link:hover { color: var(--text); border-color: var(--text); }
  .subnav-link.on {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(212, 99, 30, 0.08);
  }

  .drawer-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 0 2px 10px;
    border-bottom: 1px dashed var(--line);
    min-width: 0;
    box-sizing: border-box;
  }
  /* Both drawer-heads inside .live-pair sit on the same subgrid row,
     so they grow to whichever side has more content. Pin the channels
     side to top alignment so its single-row content doesn't centre
     vertically inside the inherited row height. */
  .live-pair-channels .drawer-head {
    align-content: flex-start;
  }
  .drawer-head .filter { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
  .drawer-head .ev-account { flex: 0 0 auto; }
  .drawer-head .live { flex: 0 0 auto; margin-left: auto; }
  .drawer-head h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0;
  }
  .drawer-head .filter {
    display: flex; gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }
  .drawer-head .filter a {
    color: var(--muted);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  .drawer-head .filter a.on { color: var(--text); background: var(--surface-2); border-color: var(--surface-2); }
  /* Per-kind filter color — applied by data-kind so the dashboard
     template doesn't need inline color styles. */
  .drawer-head .filter a[data-kind="claim"]    { color: var(--green); }
  .drawer-head .filter a[data-kind="progress"] { color: var(--amber); }
  .drawer-head .filter a[data-kind="state"]    { color: var(--blue); }
  .drawer-head .filter a[data-kind="auth"]     { color: var(--accent); }
  .drawer-head .filter a[data-kind="error"]    { color: var(--red); }
  .drawer-head .filter a.on { color: var(--text); }
  .drawer-head .live-meta {
    margin-left: auto;
    color: var(--muted);
  }
  .drawer-head .live-meta::before { display: none; }
  .drawer-head .live {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--green); display: flex; align-items: center; gap: 6px;
  }
  .drawer-head .live::before { content: "●"; animation: pulse 1.5s ease-in-out infinite; }

  .drawer-head .ev-account {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 2px 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    max-width: 220px;
  }
  .drawer-head .ev-account:focus { outline: 1px solid var(--accent); }

  .events { padding: 4px 0; }
  /* Only the dashboard live-events drawer is a fixed scrollable feed; the
     /history + /drops lists grow with content (no black dead-space). */
  .drawer .events { max-height: 530px; overflow: auto; }
  /* Each .ev is a <details> element so the operator can click to
     reveal the structured fields from the underlying log line. One
     tight summary row: chevron · timestamp · kind-colored dot · body
     (with inline <em>kind</em> upcased) · account handle. The
     color-coded inset left border encodes the event kind so the eye
     can scan vertically without reading. */
  .ev {
    position: relative;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
  }
  .ev > summary {
    display: grid;
    grid-template-columns: 14px minmax(64px, max-content) 10px 1fr 160px;
    gap: 10px;
    align-items: center;
    padding: 5px 16px 5px 20px;
    cursor: pointer;
    list-style: none;
    line-height: 1.3;
  }
  /* Long lists (Discoverable) scroll inside the pane instead of stretching
     the page to thousands of px. Capped + scrollable; other panes stay
     uncapped. */
  .drops-rows.scroll-cap { max-height: 520px; overflow-y: auto; }

  /* Wider time column variant — used by /drops + /history rows where
     the timestamp includes the date (16 chars vs the dashboard
     drawer's 8 chars). Override the second grid track explicitly. */
  .drops-rows .ev > summary,
  .events .ev > summary {
    grid-template-columns: 14px 160px 10px 1fr 160px;
  }
  /* not-linked rows pack "connect account →" + "✓ I've linked it" into the
     last cell — give it room so they stay on one line. */
  .drops-rows .ev-linkrow > summary {
    grid-template-columns: 14px 160px 10px 1fr 240px;
  }
  /* Uniform row height across every /drops section regardless of the
     right-cell control (collect box, connect chip, or whitelist select). */
  .drops-rows .ev > summary { min-height: 27px; }
  .ev > summary::-webkit-details-marker,
  .ev > summary::marker { display: none; content: ""; }
  .ev:hover { background: var(--surface-2); }
  .ev[open] { background: var(--surface-2); border-color: var(--line); }
  .ev .chev {
    display: inline-block;
    width: 14px;
    color: var(--dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    transition: transform 0.12s ease, color 0.12s;
    transform-origin: 50% 50%;
  }
  .ev[open] > summary .chev { transform: rotate(90deg); color: var(--accent); }
  .ev > summary:hover .chev { color: var(--text); }
  .ev .t { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .ev .body {
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .ev .body em {
    color: var(--muted);
    font-style: normal;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-right: 6px;
  }
  .ev .ac {
    color: var(--muted);
    font-size: 10.5px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ev .ac-twitch { color: var(--purple); }
  .ev .ac-kick   { color: var(--kick); }
  .ev .lvl { font-size: 10px; line-height: 1; }
  .ev.empty { padding: 12px 18px; color: var(--muted); }
  .ev-detail {
    padding: 4px 18px 10px 132px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 10.5px;
  }
  .ev-detail .kv {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--bg);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
  }
  .ev-detail .kv .k {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 9.5px;
  }
  .ev-detail .kv .eq { display: none; }
  .ev-detail .kv .v {
    color: var(--text);
    font-size: 10.5px;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ev-detail .kv .v a {
    color: var(--accent);
    text-decoration: none;
  }
  .ev-detail .kv .v a:hover { text-decoration: underline; }

  /* Items table inside drops campaign expand — match the card style
     of other tabular surfaces. */
  .ev-detail + .tbl.items,
  .tbl.items {
    width: auto;
    min-width: 320px;
    margin: 8px 18px 14px;
    font-size: 11.5px;
  }
  .tbl.items thead th {
    font-size: 9.5px;
    letter-spacing: 0.14em;
  }
  .tbl.items tbody td { padding: 6px 12px; }

  /* Color-coded left border per event kind. Both `.ev-<kind>` (legacy)
     and `.kind-<kind>` (current template) selectors are honored so
     templates can drift without breaking the visual cue. The inset
     shadow lives in front of the row background so :hover keeps it
     visible. */
  /* Static row variant — same visual as .ev but no <details>/expand.
     Used on the accounts list where rows don't have extra detail. */
  .ev.static { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; border-top:1px solid transparent; border-bottom:1px solid transparent; }
  .ev.static .ev-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 10px minmax(0, 2fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 16px 8px 20px;
  }
  /* Accounts list reuses the .ev.static row chrome but prepends an avatar
     cell, so it needs its own 5-column track (avatar · name · ● · body ·
     state). Without this the avatar lands in the name column and the name
     gets shoved into the 10px ● column, where it overflows and appears to
     float mid-row. Scoped to .accounts-rows so the shared .ev.static grid
     (live-channels etc.) is untouched. */
  .accounts-rows .ev.static .ev-row {
    grid-template-columns: auto minmax(120px, 1fr) 10px minmax(0, 2fr) auto;
  }
  .accounts-rows .ev.static .list-av { justify-self: start; }

  .ev.static .row-link {
    margin-left: 10px;
    color: var(--accent);
    text-decoration: none;
    font-size: 11px;
  }
  .ev.static .row-link:hover { text-decoration: underline; }
  .ev.static:hover { background: var(--surface-2); }

  .ev.kind-claim,    .ev.ev-claim    { box-shadow: inset 3px 0 0 var(--green);  }
  .ev.kind-progress, .ev.ev-progress { box-shadow: inset 3px 0 0 var(--amber);  }
  .ev.kind-state,    .ev.ev-state    { box-shadow: inset 3px 0 0 var(--blue);   }
  .ev.kind-discovery,.ev.ev-discovery{ box-shadow: inset 3px 0 0 var(--dim);    }
  .ev.kind-error,    .ev.ev-error    { box-shadow: inset 3px 0 0 var(--red);    }
  .ev.kind-auth,     .ev.ev-auth     { box-shadow: inset 3px 0 0 var(--accent); }

  /* Live-channel rows reuse the .ev row chrome but render as a flat
     anchor (no <details>) since clicking opens the broadcaster in a
     new tab. Match the grid track sizes drops-rows already uses so
     the chevron / time / dot / body / accessory columns align. */
  .events .live-row {
    display: grid;
    grid-template-columns: 14px 130px 10px 1fr 160px;
    gap: 10px;
    align-items: center;
    padding: 5px 16px 5px 20px;
    text-decoration: none;
    color: inherit;
  }
  .events .live-row:hover { background: var(--surface-2); }
  .events .live-row .chev { color: var(--green); }
  .ev.kind-info,     .ev.ev-info     { box-shadow: inset 3px 0 0 var(--line);   }

  /* SIDE PANEL */
  aside {
    display: flex; flex-direction: column; gap: 18px;
  }
  .panel {
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .panel-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
  }
  .panel-head h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0;
  }
  .panel-head .meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
  }
  .panel-body { padding: 8px 0; }

  /* Active campaigns */
  .camp {
    display: grid;
    grid-template-columns: 8px 1fr auto;
    gap: 10px;
    padding: 9px 14px;
    align-items: start;
    border-top: 1px dashed transparent;
  }
  .camp + .camp { border-top-color: var(--line); }
  .camp:hover { background: var(--surface-2); }
  .camp .pip {
    width: 8px; height: 8px; border-radius: 50%;
    margin-top: 5px;
  }
  .camp .pip.twitch { background: var(--purple); }
  .camp .pip.kick { background: var(--kick); }
  .camp .body { line-height: 1.3; }
  .camp .name {
    font-size: 12.5px; font-weight: 500;
  }
  .camp .sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
  }
  .camp .sub b { color: var(--text); }
  .camp .right {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    line-height: 1.4;
  }
  .camp .right .ends { color: var(--amber); }
  .camp .right .pct { color: var(--text); }

  /* PRIORITY LIST */
  .prio-item {
    display: grid;
    grid-template-columns: 22px 22px 1fr auto;
    gap: 10px;
    padding: 8px 14px;
    border-top: 1px dashed transparent;
    align-items: center;
    cursor: grab;
  }
  .prio-item + .prio-item { border-top-color: var(--line); }
  .prio-item:hover { background: var(--surface-2); }
  .prio-item .rank {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
  }
  .prio-item .grip {
    color: var(--dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
  }
  .prio-item .name {
    font-size: 12.5px;
  }
  .prio-item .name small {
    font-family: 'JetBrains Mono', monospace;
    color: var(--muted);
    font-size: 10px;
    margin-left: 6px;
  }
  .prio-item .toggle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }
  .prio-item.off .toggle { color: var(--muted); }
  .prio-item.off .name { opacity: .5; }

  /* CHANNEL ALLOW-LIST */
  .ch-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    padding: 0 8px;
    gap: 0;
  }
  .ch-tabs a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 2px solid transparent;
  }
  .ch-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
  .ch-list {
    padding: 6px 0;
    max-height: 280px;
    overflow: auto;
  }
  .ch {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    padding: 7px 14px;
    align-items: center;
  }
  .ch:hover { background: var(--surface-2); }
  .ch .av {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--surface-3), var(--dim));
    border-radius: 50%;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 12px;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
  }
  .ch.live .av { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
  .ch .meta { line-height: 1.25; }
  .ch .name { font-size: 12.5px; font-weight: 500; }
  .ch .sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
  }
  .ch .sub .live-tag { color: var(--red); }
  .ch .views {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .ch .views.off { color: var(--dim); }

  /* LIVE PAIR — Live Events drawer + Live Channels grid, side by side
     full-width. Stacks on narrow viewports so neither column gets
     squeezed. */
  .live-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Heads share row 1 via chained subgrid so both bodies start at
       the same y-coord even when left filter row wraps. Row 2 is
       auto so each body sizes to its own content — the right column
       doesn't stretch to match a tall left-side events list. */
    grid-template-rows: auto auto;
    gap: 16px;
    margin-top: 8px;
    align-items: start;
  }
  @media (max-width: 1200px) {
    .live-pair {
      grid-template-columns: 1fr;
      grid-template-rows: auto auto auto auto;
    }
    .live-pair-col, .live-pair .drawer { display: block; }
  }
  .live-pair-col {
    min-width: 0;
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    align-self: start;
  }
  .live-pair .drawer {
    margin-top: 0;
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    align-self: start;
  }
  /* Channel cards shouldn't stretch to fill the grid row when there's
     only one of them. */
  .live-pair-channels .live-channels-grid { align-content: start; }
  .live-pair-channels .lch { align-self: start; }
  /* Cap the events drawer height to roughly match the live-channels
     column so the two columns visually align. Internal .events
     already scrolls past max-height: 320px. */
  .live-pair-events .events { max-height: 360px; }
  .live-pair-channels .live-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
  }

  /* WIDE LIVE-CHANNELS GRID (under live events drawer) */
  .live-channels {
    margin-top: 24px;
  }
  .live-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
  }
  .live-channels-empty {
    border: 1px dashed var(--line);
    background: var(--surface);
    padding: 24px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .lch {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s, background 0.12s;
  }
  .lch:hover {
    background: var(--surface-2);
    border-color: var(--accent);
  }
  .lch .av {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--surface-3), var(--dim));
    border-radius: 50%;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 14px;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
  }
  .lch.twitch .av { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple); }
  .lch.kick .av { border-color: var(--kick); box-shadow: 0 0 0 1px var(--kick); }
  .lch .meta {
    line-height: 1.3;
    min-width: 0;
  }
  .lch .name {
    font-size: 12.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lch .sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lch .tag {
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lch .views {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    align-self: start;
  }

  /* ---- AUTH / FORM CARDS ---- */
  .auth-wrap {
    /* center the auth card in the viewport (main has 24/80 padding) */
    min-height: calc(100vh - 104px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
  }
  .auth-card {
    width: 100%;
    max-width: 460px;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 36px 36px 32px;
  }
  .auth-card h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-variation-settings: 'opsz' 96, 'wdth' 90;
    font-weight: 500;
    font-size: 32px;
    letter-spacing: -0.03em;
    margin: 0 0 18px;
    line-height: 1;
  }
  .auth-card .kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 24px;
  }
  .auth-card p {
    color: var(--muted);
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.55;
  }
  .auth-card p.intro {
    color: var(--text);
  }
  .auth-card label {
    display: block;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
  }
  .auth-card input[type="text"],
  .auth-card input[type="password"],
  .auth-card input[type="url"],
  .auth-card input[type="number"],
  .auth-card input[type="email"],
  .auth-card select,
  .auth-card textarea {
    display: block;
    width: 100%;
    margin-top: 8px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    padding: 11px 13px;
    border-radius: 2px;
    outline: none;
    transition: border-color .15s;
  }
  .auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus {
    border-color: var(--accent);
  }
  .auth-card textarea { min-height: 80px; resize: vertical; }
  .auth-card .submit-row,
  .auth-wrap > .submit-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 22px;
  }
  .auth-wrap > .submit-row { width: 100%; max-width: 460px; }
  .auth-wrap.wide > .submit-row { max-width: 760px; }
  /* solo: a lone cancel link, centered with a little breathing room above */
  .auth-wrap > .submit-row.solo { justify-content: center; padding-top: 10px; }
  .auth-card .submit-row .alt,
  .auth-wrap > .submit-row .alt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .auth-card .submit-row .alt:hover,
  .auth-wrap > .submit-row .alt:hover { color: var(--accent); }
  .auth-card .err {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-left: 2px solid var(--red);
    padding: 8px 12px;
    background: rgba(198,74,60,.06);
    margin-bottom: 22px;
  }
  .auth-card .ok {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  /* Device-code display */
  .device-code {
    text-align: center;
    margin: 24px 0;
    padding: 22px;
    background: var(--bg);
    border: 1px dashed var(--line);
  }
  .device-code .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 12px;
  }
  .device-code .code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent);
  }
  .device-code .url {
    display: inline-block;
    margin-top: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text);
  }
  .device-code .url:hover { color: var(--accent); }

  /* Wider auth card for richer flows (Kick cookie paste, Twitch login) */
  .auth-wrap.wide { max-width: 620px; margin: 0 auto; }
  .auth-wrap.wide .auth-card + .auth-card { margin-top: 16px; }

  /* Method cards used by twitch paste page — one card per auth method
     (helper CLI vs manual paste). The preferred card glows orange so
     the eye is steered toward the safer flow. */
  .auth-card.method .method-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }
  .auth-card.method h2 {
    margin: 0;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: 20px;
    letter-spacing: -0.02em;
  }
  .auth-card.method.preferred {
    border-color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .method-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: rgba(212,99,30,0.06);
    border-radius: 2px;
  }
  .method-tag.muted {
    border-color: var(--line);
    color: var(--muted);
    background: transparent;
  }
  .auth-card.method p {
    color: var(--muted);
    margin: 0 0 14px;
    line-height: 1.55;
  }
  .auth-card.method code {
    background: var(--surface-2);
    padding: 1px 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent);
  }
  .auth-card.method .hint {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    margin: 0;
  }
  .method-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .method-cta .hint {
    flex: 1 1 200px;
    min-width: 0;
  }

  /* paste form helper spans */
  .auth-card .req { color: var(--accent); }
  .auth-card .opt { color: var(--muted); font-weight: 400; }
  .auth-card .raw-paste {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    width: 100%;
  }
  .auth-flash {
    max-width: 620px;
    margin: 0 auto 0;
    padding: 0 24px;
  }

  /* Step list (used by Kick login) */
  .steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0 0 22px;
  }
  .steps li {
    counter-increment: step;
    position: relative;
    padding: 8px 0 8px 36px;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.55;
  }
  .steps li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 8px;
    width: 22px; height: 22px;
    background: var(--surface-2);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
  }
  .steps li code {
    background: var(--surface-2);
    padding: 1px 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent);
  }
  /* Instruction links inside the numbered steps — match the app's accent
     link treatment (no default browser blue); underline only on hover. */
  .steps li a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  }
  .steps li a:hover {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
  }

  /* ---- PAGE SHELLS (non-dashboard pages) ---- */
  .shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 80px;
  }
  .shell .ph {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: end;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
  }
  .shell .ph .kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 8px;
  }
  .shell .ph h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-variation-settings: 'opsz' 96, 'wdth' 90;
    font-weight: 500;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 0.98;
    letter-spacing: -0.03em;
    margin: 0;
  }
  .shell .ph .actions { display: flex; gap: 8px; }
  /* Narrow shell for single-column forms (account login). */
  .shell.narrow { max-width: 640px; }

  /* Page lede — intro prose under a .ph; flat, no box. */
  .lede {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 24px;
    max-width: 60ch;
  }
  .lede.sm { font-size: 13px; margin: 0 0 14px; }

  /* Accent variant of the section-h meta tag (e.g. "recommended"). */
  .section-h .meta.rec { color: var(--accent); }

  /* Inline flash above a flat form — red left accent, no panel. */
  .login-flash {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: inset 3px 0 0 var(--red);
    background: rgba(198,74,60,.06);
    padding: 9px 14px;
    margin: 0 0 24px;
  }

  /* Helper text inside a numbered step — normal prose, not the step label. */
  .steps li .step-hint {
    display: block;
    margin-top: 5px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
  }

  /* required / optional markers on flat form labels */
  .settings-card .req,
  .settings-card .opt {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 10px;
  }
  .settings-card .req { color: var(--accent); }
  .settings-card .opt { color: var(--muted); }

  /* flash */
  .flash-ok {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-left: 2px solid var(--green);
    background: rgba(111,181,107,.06);
    padding: 10px 14px;
    margin-bottom: 18px;
  }

  /* table */
  .tbl {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .tbl thead th {
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
  }
  .tbl tbody td {
    padding: 14px 16px;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
    vertical-align: middle;
  }
  .tbl tbody tr:last-child td { border-bottom: none; }
  .tbl tbody tr:hover { background: var(--surface-2); }
  .tbl td.name { font-weight: 500; }
  .tbl td.handle { font-family: 'JetBrains Mono', monospace; color: var(--muted); font-size: 12.5px; }
  .tbl td.plat span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 3px 7px;
    border: 1px solid var(--line);
    color: var(--muted);
  }
  .tbl td.plat .twitch { color: var(--purple); border-color: #4a3970; background: rgba(122,75,176,.08); }
  .tbl td.plat .kick   { color: var(--kick);   border-color: #2d5c44; background: rgba(83,231,164,.06); }
  .tbl td.enabled.yes { color: var(--green); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

  .state-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 9px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    white-space: nowrap;
  }
  .state-pill.state-green  { color: var(--green); border-color: rgba(90, 209, 154, 0.4); background: rgba(90, 209, 154, 0.06); }
  .state-pill.state-orange { color: var(--accent); border-color: rgba(212, 99, 30, 0.4); background: rgba(212, 99, 30, 0.06); }
  .state-pill.state-grey   { color: var(--muted); }
  .tbl td.enabled.no  { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
  .tbl td.act a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-decoration: none;
  }
  .tbl td.act a:hover { color: var(--accent-2); }

  /* detail form layout */
  /* Flat forms — no card border/fill; fields carry the only surface. */
  .form-card {
    padding: 4px 0 0;
    max-width: 560px;
  }
  .form-card.wide { max-width: none; }

  /* Re-auth row on accounts_detail — primary CTA on top, collapsible
     helper CLI block below. The expanded helper section pushes users
     toward the safer flow without burying the manual button. */
  .reauth-row {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .reauth-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
  }
  /* Section header used inside settings + future config pages.
     Mirrors the .drops-pane-h pattern but lives outside the
     two-column drops grid so the page can have multiple sections
     stacked vertically. See docs/DESIGN.md. */
  .section-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
  }
  .section-h h3 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
  }
  .section-h .meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }
  .settings-block { margin-bottom: 28px; }
  /* Card stack — each section in its own surface card. Replaces the
     single wide form-card so sections are visually distinct and easy
     to find. Spacing between cards lets the eye rest. */
  .settings-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  /* Flat settings sections — no card box; the section-h dashed rule + fields
     carry structure (matches the console/drops/forms redesign). */
  .settings-card {
    padding: 4px 0 8px;
  }
  .settings-card form { margin: 0; }
  .settings-card .section-h { margin-bottom: 18px; }
  .settings-sub-h {
    margin: 22px 0 12px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
  }
  /* Add-by-name lives as a single kvedit STATUS row; the form just adds a
     dashed separator from the priority columns above. */
  .add-by-name {
    margin-top: 14px;
    border-top: 1px dashed var(--line);
  }
  .settings-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
  /* Both priority columns share the row height (= the taller "Selected"
     list); "Available" fills it and scrolls internally so the two columns
     line up instead of the right one stopping short. */
  .settings-grid-2 > div { display: flex; flex-direction: column; min-height: 0; }
  .settings-grid-2 > div > .kicker { flex: 0 0 auto; }
  .settings-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  /* KV-style status read-out used in settings status panel. */
  .kvlist {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    display: grid;
    gap: 6px;
  }
  .kvlist .kvrow {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 6px;
  }
  .kvlist .kvrow:last-child { border-bottom: none; }
  .kvlist .k { color: var(--muted); }
  .kvlist .v { color: var(--text); }

  /* Editable STATUS-style rows: same dashed-leader table as .kvlist, but the
     value is a compact inline input. Matches the read-only Status panel's
     density (12px mono, tight rows) instead of full-width form boxes. */
  .kvedit { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
  .kvedit .row {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px dashed var(--line);
    padding: 9px 0;
  }
  .kvedit .row:last-child { border-bottom: none; }
  /* Right-align numeric values so the digits hug the unit at the right edge
     (e.g. "21600 s") instead of floating at the left of the input box. */
  .kvedit .v input[type="number"] { text-align: right; }
  .kvedit .k { color: var(--text); font-weight: 600; white-space: nowrap; }
  .kvedit .d {
    flex: 1;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    line-height: 1.3;
    color: #586068;
  }
  .kvedit .d b { color: var(--muted); font-weight: 600; }
  .kvedit .v {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex: 0 0 auto;
    color: var(--text);
  }
  /* The value reads like the Status value text — plain, no box. Underline
     only on hover/focus to signal it's editable. Prefixed with .settings-card
     so it beats the generic .settings-card input[type=number] box style. */
  .settings-card .kvedit .v input,
  .settings-card .kvedit .v select {
    width: auto;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-align: right;
    padding: 1px 0;
    margin: 0;
    border-radius: 0;
    outline: none;
    transition: border-color .12s;
  }
  .settings-card .kvedit .v input { width: 3.2em; }
  /* Kill the native number-input spinner arrows — they break the flat
     STATUS-row look. Value still editable by typing / arrow keys. */
  .settings-card input[type="number"]::-webkit-inner-spin-button,
  .settings-card input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .settings-card input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
  .settings-card .kvedit .v input:hover,
  .settings-card .kvedit .v select:hover { border-bottom-color: var(--line); }
  .settings-card .kvedit .v input:focus,
  .settings-card .kvedit .v select:focus { border-bottom-color: var(--accent); background: transparent; }
  .kvedit .v .u { color: var(--muted); font-size: 10.5px; min-width: 26px; }
  /* Wide-value rows (URLs, passwords, free text): add .grow to the .v so
     the input fills the row. Same bare style as every other value input —
     transparent background, right-aligned, with the accent underline showing
     only on focus (see the generic .v input rule above). Skip .d on these. */
  .kvedit .v.grow { flex: 1 1 auto; }
  /* Right-aligned, anchored to the right edge, and grows LEFT to fit its
     content (field-sizing) instead of being a full-width line. Capped at the
     row width so it never overflows; min-width keeps an empty field usable.
     Where field-sizing isn't supported, width:auto falls back to the input's
     default intrinsic size (still right-anchored, not full-width). */
  .settings-card .kvedit .v.grow input {
    field-sizing: content;
    width: auto;
    min-width: 12ch;
    max-width: 100%;
    margin-left: auto;
  }
  .settings-card .kvedit .v.grow input::placeholder { color: var(--dim); }
  /* Inline checkbox group as a STATUS-row value (notify kinds). */
  .kvedit .v.cbs { gap: 22px; flex-wrap: wrap; }
  .kvedit .v.cbs label.cb {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
  }
  .kvedit .v.cbs label.cb input[type="checkbox"] {
    width: 13px; height: 13px;
    accent-color: var(--accent);
    margin: 0;
  }
  /* Read-only kvlist value with an inline copy action (SSO callback). */
  .kvlist .v code { background: none; border: none; padding: 0; font: inherit; color: inherit; }
  .kvlist .v .btn-linear { padding: 0; margin-left: 12px; font-size: 10px; }
  @media (max-width: 560px) {
    .kvedit .row { flex-wrap: wrap; gap: 4px 12px; }
    .kvedit .d { flex-basis: 100%; order: 3; }
  }

  /* Linear (text + arrow) action button — matches the .back-link treatment,
     used for Save so it reads as a line action, not a filled box. */
  .btn-linear {
    background: none;
    border: none;
    text-decoration: none;
    display: inline-block;
    padding: 4px 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    cursor: pointer;
    transition: color .12s;
  }
  .btn-linear:hover { color: var(--text); }
  /* Destructive linear action (Delete account). */
  .btn-linear.red { color: var(--red); }
  .btn-linear.red:hover { color: var(--text); }

  /* Flat danger zone — dashed-rule strip, red mono label + linear action,
     replaces the boxed .form-card .danger. */
  .danger-zone {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .danger-zone .danger-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--red);
  }
  .danger-zone form { margin-left: auto; }

  /* Drag-reorder rank picker. Shared by per-account whitelist editor
     + Settings global priority list. */
  .rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px dashed var(--line);
    min-height: 160px;
    max-height: 360px;
    overflow-y: auto;
  }
  .rank-list.rank-available { flex: 1 1 auto; min-height: 0; max-height: 360px; overflow-y: auto; }
  .rank-list li {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    background: var(--surface-2);
    font-size: 12px;
  }
  .rank-list.rank-available li { cursor: default; background: transparent; }
  .rank-list li:last-child { border-bottom: none; }
  .rank-list li.dragging { opacity: 0.4; }
  .rank-list li.drag-over-top { box-shadow: inset 0 2px 0 0 var(--accent); }
  .rank-list li.drag-over-bot { box-shadow: inset 0 -2px 0 0 var(--accent); }
  .rank-list .rank-empty {
    cursor: default;
    color: var(--muted);
    font-size: 11.5px;
    justify-content: center;
    background: transparent;
  }
  .rank-list .rank-rm, .rank-list .rank-add {
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
  }
  .rank-list .rank-add { color: var(--accent); }
  .rank-list .rank-rm:hover { color: var(--red); }
  .hint {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
  }
  .form-card h2 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: 22px;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
  }
  .form-card .platrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 22px;
    display: flex; gap: 14px;
  }
  .form-card .platrow code {
    color: var(--text);
    background: var(--surface-2);
    padding: 1px 6px;
    font-size: 11px;
  }
  .form-card label,
  .settings-card label {
    display: block;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
  }
  /* Inline "optional" marker + multi-line helper text under a field label.
     Reset the label's uppercase/mono/tracking so hints read as normal prose. */
  .form-card .opt {
    color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0;
  }
  .form-card .field-hint {
    display: block;
    margin-top: 7px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11.5px;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
  }
  .form-card label.cb,
  .settings-card label.cb {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 22px;
  }
  .form-card label.cb input[type="checkbox"],
  .settings-card label.cb input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
  }
  .form-card input[type="text"],
  .form-card input[type="url"],
  .form-card input[type="password"],
  .form-card input[type="number"],
  .form-card select,
  .settings-card input[type="text"],
  .settings-card input[type="url"],
  .settings-card input[type="password"],
  .settings-card input[type="number"],
  .settings-card select,
  .settings-card textarea {
    display: block;
    width: 100%;
    margin-top: 8px;
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 4px 4px 0 0;
    outline: none;
    transition: border-color .15s, background .15s;
  }
  .form-card input:focus, .form-card select:focus,
  .settings-card input:focus, .settings-card select:focus,
  .settings-card textarea:focus { border-bottom-color: var(--accent); background: var(--surface-2); }
  .settings-card textarea { min-height: 120px; resize: vertical; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
  /* Numeric inputs hold a handful of digits — don't stretch them to the full
     column like text/URL fields. Keep them compact + left-aligned. */
  .form-card input[type="number"],
  .settings-card input[type="number"] {
    width: 8.5em;
    max-width: 100%;
    font-family: 'JetBrains Mono', monospace;
  }
  /* Helper text under settings fields (the rule above only covered .form-card).
     Reset the label's uppercase/mono so hints read as normal prose. */
  .settings-card .field-hint {
    display: block;
    margin-top: 7px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11.5px;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
    color: var(--muted);
    max-width: 46ch;
  }
  .settings-card .field-hint b { color: var(--text); font-weight: 600; }
  .form-card .row,
  .settings-card .row {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px;
  }
  .form-card .danger {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed var(--line);
  }
  .form-card .danger h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--red);
    margin: 0 0 12px;
  }
  .form-card .danger button {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 9px 14px;
    border: 1px solid var(--red);
    background: transparent;
    color: var(--red);
    cursor: pointer;
    border-radius: 2px;
    transition: all .15s;
  }
  .form-card .danger button:hover { background: var(--red); color: #1a0d04; }
  .back-link {
    display: inline-block;
    margin-top: 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }
  .back-link:hover { color: var(--accent); }
  .empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
  }
  .empty a { color: var(--accent); }

  /* /drops tab strip — refinery pill row. Each tab is an anchor
     styled as a monospace caps pill with a thin border; the active
     tab gets an orange underline and accent-colored text + count.
     `text-decoration: none` and explicit `color` defeat the browser
     default blue underline when the stylesheet's later rules don't
     win on specificity. */
  .drops-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin: 16px 0 0;
    padding: 0;
  }
  /* Drops two-pane layout — stacked vertically (whitelisted on top,
     discoverable below). Single column so the wide table doesn't
     have to fight for width with a narrower neighbour. */
  .drops-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 16px;
  }
  .drops-pane { min-width: 0; }
  .drops-pane-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line);
  }
  .drops-pane-h h3 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text);
  }
  .drops-pane-h .meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }
  .drops-tab,
  a.drops-tab,
  a.drops-tab:link,
  a.drops-tab:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--muted);
    background: transparent;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
  }
  .drops-tab:hover,
  a.drops-tab:hover {
    color: var(--text);
    background: var(--surface-2);
  }
  .drops-tab.on,
  a.drops-tab.on {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
  }
  .drops-tab .count {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.4;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .drops-tab.on .count { color: var(--accent); border-color: var(--accent); }
  .drops-tabpanel { margin-top: 16px; }

  /* CAMPAIGN MODAL — opened from .camp.clickable rows in the
     Active Campaigns sidebar. Centered overlay with backdrop click
     and ESC dismiss (wired in dashboard.html). */
  .camp.clickable { cursor: pointer; }
  .camp.clickable:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: -2px;
  }

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 40px 24px;
    overflow-y: auto;
  }
  .modal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  }
  .modal-list { margin: 0; padding-left: 20px; }
  .modal-list li { padding: 3px 0; font-size: 13px; }
  .modal-list .rank {
    display: inline-block;
    min-width: 28px;
    margin-right: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
  }
  .modal-list ol, .modal-list ol li { list-style-position: inside; }
  .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--line);
    gap: 16px;
  }
  .modal-head-id {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  /* Account avatar in the modal head — larger sibling of the mining-row .av,
     same letter-circle fallback (image fills it, letter shows through). */
  .modal-av {
    position: relative;
    flex: 0 0 auto;
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--surface-3), var(--dim));
    border-radius: 50%;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    overflow: hidden;
  }
  .modal-av.twitch { border-color: rgba(176, 121, 240, 0.5); }
  .modal-av.kick   { border-color: rgba(83, 231, 164, 0.5); }
  .modal-av img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 1;
  }
  .modal-av .av-i {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
  }
  /* Account avatar in the accounts-list rows — small circle before the name,
     same letter-circle fallback as the mining rows. */
  .list-av {
    position: relative;
    flex: 0 0 auto;
    width: 22px; height: 22px;
    margin-right: 8px;
    background: linear-gradient(135deg, var(--surface-3), var(--dim));
    border-radius: 50%;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    vertical-align: middle;
    border: 1px solid var(--line);
    overflow: hidden;
  }
  .list-av.twitch { border-color: rgba(176, 121, 240, 0.5); }
  .list-av.kick   { border-color: rgba(83, 231, 164, 0.5); }
  .list-av img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 1;
  }
  .list-av .av-i {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
  }
  .modal-sub {
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .modal-sub .pip {
    width: 8px; height: 8px; border-radius: 50%;
  }
  .modal-sub .pip.twitch { background: var(--purple); }
  .modal-sub .pip.kick { background: var(--kick); }
  .modal-close {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    width: 28px;
    height: 28px;
    border-radius: 2px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }
  .modal-close:hover { color: var(--text); border-color: var(--text); }
  .modal-body { padding: 16px 20px 20px; }
  .modal-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 14px;
  }
  .modal-row .kv { display: flex; flex-direction: column; gap: 2px; }
  .modal-row .kv .k {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
  }
  .modal-row .kv .v {
    font-size: 12.5px;
    color: var(--text);
    word-break: break-all;
  }
  .modal-row .kv .v small.muted { color: var(--muted); }
  .modal-section { margin-top: 14px; }
  .modal-section h4 {
    margin: 0 0 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .modal-section h4 .meta {
    color: var(--accent);
    font-size: 10px;
  }
  .modal-section summary {
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    padding: 6px 0;
  }
  .modal-section summary:hover { color: var(--text); }
  .modal-empty {
    padding: 8px 0;
    font-size: 12px;
    color: var(--muted);
  }
  .modal-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .modal-benefits li {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface-2);
    border-radius: 3px;
    align-items: center;
  }
  .modal-benefits .benefit-img {
    width: 36px; height: 36px;
    object-fit: contain;
    background: var(--bg);
    border-radius: 2px;
  }
  .modal-benefits .benefit-name {
    font-size: 12.5px;
    color: var(--text);
  }
  .modal-benefits .benefit-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
  }
  .modal-accounts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .modal-accounts li {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 3px 8px;
    border-radius: 2px;
  }
  .modal-json {
    margin: 8px 0 0;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }

/* ── Discord notification test result (settings page) ───────────── */
.notify-test-result { font-size: 13px; }
.notify-test-result.ok { color: #23a55a; }
.notify-test-result.err { color: #e74c3c; }

/* --- login SSO --- */
/* centered auth card */
.auth-centered { text-align: center; }
.auth-logo { display: block; width: 96px; height: 96px; margin: 4px auto 10px; }
.auth-centered .login-row { text-align: left; }
.auth-centered .login-row input::placeholder { color: var(--muted); }
/* C: borderless, floats on the page, square corners */
.auth-bare { border-color: transparent; background: transparent; padding-top: 10px; }
.auth-bare .btn-sso,
.auth-bare .btn-arrow,
.auth-bare .login-row input { border-radius: 0; }
/* login wordmark — matches the nav GRUB·DROPS mark (uppercase, wide, accent dot) */
.auth-card h1.auth-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-variation-settings: 'opsz' 96, 'wdth' 200;
  font-size: 28px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 22px;
}
.auth-name .dot {
  display: inline-block;
  width: .26em; height: .26em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  margin: 0 .22em .12em;
}

.btn-sso {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin-top: 8px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 2px;
  text-decoration: none;
  transition: background .15s, color .15s, transform .05s;
}
.btn-sso:hover { background: var(--accent); color: #1a1006; }
.btn-sso:active { transform: translateY(1px); }
/* SSO disabled (OIDC not configured) — faded, non-interactive, keeps layout */
.btn-sso.is-disabled {
  color: var(--dim);
  border-color: var(--line);
  background: transparent;
  cursor: not-allowed;
  pointer-events: none;
  opacity: .65;
}

/* password + square arrow submit, side by side */
.login-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}
.login-row input[type="password"] {
  flex: 1;
  margin-top: 0;
}
.btn-arrow {
  flex: 0 0 auto;
  width: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-arrow:hover { background: var(--accent); color: #1a1006; }
.btn-arrow:active { transform: translateY(1px); }

.sso-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sso-divider::before,
.sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-secondary label { color: var(--muted); }

/* --- settings: SSO status card --- */
.sso-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--line);
}
.sso-status-pill.on  { color: var(--green); border-color: var(--green); }
.sso-status-pill.off { color: var(--muted); }
.copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.copy-field code {
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}
.copy-field button {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}
.copy-field button:hover { color: var(--text); }

/* ===== MOBILE (phone-width) =====
   Consolidated small-screen pass. Desktop-first file, so these override
   at the end. Two breakpoints: 720px (tablet/large phone) and 560px
   (phone). Targets the overflow culprits found at 390px viewport:
   topbar nav (forced 700px page width), 6-col telemetry, and the
   event-row grid whose 1fr body track collapsed to 0. */
@media (max-width: 720px) {
  /* Topbar: brand + user on row 1, nav gets its own full-width row. */
  .topbar {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
    padding: 10px 14px;
  }
  .topbar .brand { grid-row: 1; grid-column: 1; }
  .topbar .user  { grid-row: 1; grid-column: 2; justify-self: end; gap: 10px; }
  .topbar .nav {
    grid-row: 2; grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar .nav a { padding: 7px 10px; white-space: nowrap; }
  .user .clock { display: none; }

  main { padding: 18px 14px 64px; }

  /* Auth cards (device-code login): long handles/URLs break instead of
     widening the page. */
  .auth-card h1 { overflow-wrap: anywhere; }
  .device-code .url { overflow-wrap: anywhere; }

  /* Expanded event detail: long kv chips (campaign names) wrap inside
     the chip instead of overflowing. */
  .ev-detail .kv { max-width: 100%; white-space: normal; word-break: break-word; }

  /* Settings tab strip: horizontal scroll instead of widening the page. */
  .subnav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .subnav-link { white-space: nowrap; flex: 0 0 auto; }

  /* Page heads (both variants): actions drop under the title instead of
     squeezing it. */
  .page-head,
  .shell .ph { grid-template-columns: 1fr; gap: 12px; align-items: start; }
  .shell { padding: 20px 14px 64px; }

  /* Campaign item rows: type chip stays beside the name, collected marks
     get their own full-width second row. Header row hidden (labels are
     obvious from content at this size). */
  .drop-items { margin: 4px 6px 12px; }
  .drop-items-head { display: none; }
  .drop-item {
    grid-template-columns: 28px 1fr auto;
    grid-template-areas:
      "icon name type"
      "icon collected collected";
    row-gap: 4px;
  }
  .drop-item-icon      { grid-area: icon; }
  .drop-item-name      { grid-area: name; }
  .drop-item-collected { grid-area: collected; }
  .drop-item-type      { grid-area: type; }

  /* Telemetry: 6 cols -> 3. */
  .telemetry { grid-template-columns: repeat(3, 1fr); gap: 16px 14px; }

  /* Event rows: meta on row 1 (chev · time · dot · account), message on
     its own full-width row 2 so the 1fr track can't collapse to zero. */
  .events .ev > summary,
  .drops-rows .ev > summary,
  .drops-rows .ev-linkrow > summary {
    grid-template-columns: 14px auto 10px 1fr;
    grid-template-areas:
      "chev t lvl ac"
      "chev body body body";
    row-gap: 1px;
    padding: 3px 12px 3px 14px;
  }
  .ev .chev { grid-area: chev; }
  .ev .t    { grid-area: t; }
  .ev .lvl  { grid-area: lvl; }
  .ev .body { grid-area: body; }
  .ev .ac   { grid-area: ac; justify-self: end; }
  .ev-detail { padding-left: 38px; }

  /* Static rows (accounts list): name+dot+state on row 1, links/pills on
     row 2. Without this the minmax(120px,1fr)+2fr grid collapses and the
     text renders overlapped. */
  .ev.static .ev-row {
    grid-template-columns: auto 10px 1fr;
    grid-template-areas:
      "t lvl ac"
      "body body body";
    row-gap: 4px;
    padding: 8px 12px 8px 14px;
  }
  .ev.static .ev-row .t    { grid-area: t; white-space: normal; }
  .ev.static .ev-row .lvl  { grid-area: lvl; }
  .ev.static .ev-row .body { grid-area: body; white-space: normal; }
  .ev.static .ev-row .ac   { grid-area: ac; justify-self: end; }
}

@media (max-width: 560px) {
  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .stat .value { font-size: 22px; }
  /* Wide-value settings rows (webhook/avatar URLs): input gets its own
     full-width line instead of a sliver next to the label. */
  .kvedit .row { flex-wrap: wrap; }
  .kvedit .v.grow { flex-basis: 100%; order: 2; }
  .kvedit .row .d { order: 3; }
}

/* ── Language dropdown (custom, not native <select>) ─────── */
.lang-dd { position: relative; display: inline-block; margin-left: 6px; }
.lang-dd-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: 500 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 8px 5px 10px;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: border-color .15s;
}
.lang-dd-btn:hover, .lang-dd-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--text); }
.lang-dd-arrow { font-size: 8px; opacity: .6; }
.lang-dd-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  list-style: none; margin: 0; padding: 4px 0;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 900;
}
.lang-dd-menu li {
  padding: 7px 14px;
  font: 500 12px/1.4 'JetBrains Mono', monospace;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s;
}
.lang-dd-menu li:hover { background: var(--surface-2); }
.lang-dd-menu li.selected { color: var(--accent); }

/* Flash toast — transient feedback after an action (whitelist add, etc.).
   Fixed bottom-right, fades out on its own so it reads as a popup. */
.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  padding: 9px 16px;
  background: var(--surface-2, #1a1a1a);
  color: var(--green, #6fb56b);
  border: 1px solid rgba(111, 181, 107, 0.45);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  animation: toast-life 4s ease forwards;
  pointer-events: none;
}
@keyframes toast-life {
  0%   { opacity: 0; transform: translateY(8px); }
  10%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(8px); }
}

/* Removable whitelist chip (✓ login ✕) in the drops null-game + promoted rows.
   Sized to the row text, compact, with a little left gap from the name. */
button.chip-rm {
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  line-height: 1.2;
  padding: 1px 5px;
  margin-left: 5px;
  border-radius: 3px;
  background: rgba(111, 181, 107, 0.06);
  border: 1px solid rgba(111, 181, 107, 0.4);
  color: var(--green, #6fb56b);
  white-space: nowrap;
  vertical-align: middle;
}
button.chip-rm:hover {
  background: rgba(212, 99, 30, 0.1);
  border-color: rgba(212, 99, 30, 0.5);
  color: var(--accent, #d4631e);
}
