/* ==========================================================
   Ops Console — POP theme: clean neobrutalism, in a light and a dark mode
   Thick ink outlines, flat colours, hard offset shadows; clickable things lift on hover and press in on click.
   Everything is scoped to [data-theme="pop"] (set by theme-boot.js) and overrides app.css (= the SILO theme).
   Light / dark = [data-mode] on <html>: the rules below only read the colour variables, and each mode defines them.
     --fg / --hi   body text / strong text (never a hard-coded #000 on a card: it would vanish in dark mode)
     --on          text on a bright accent (--y, --blue, --red…): black in both modes
     --*-soft      tinted surfaces; --*-text tinted text that stays readable on cards and on the matching soft colour
   Terminals, session previews and the kill switch stay "screens": dark, with the POP terminal palette from app.js.
   ========================================================== */
@font-face { font-family: 'Grotesk'; src: url(/fonts/grotesk-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Grotesk'; src: url(/fonts/grotesk-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Grotesk'; src: url(/fonts/grotesk-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

/* ---------- light mode (default) ---------- */
:root[data-theme="pop"] {
  --ink: #141414;         /* outlines and shadows */
  --fg: #141414;          /* text */
  --hi: #000;             /* strong text */
  --fg2: #2e2e2e;         /* secondary text that is not "muted" */
  --on: #000;             /* text on a bright accent */
  --cream: #fff4dc;       /* page */
  --paper: #ffffff;       /* cards */
  --tint: #fff8e4;        /* hover */
  --well: #fffdf7;        /* logs, chat, CLI output */
  --rule: #e9e0cd;        /* soft separators */
  --dash: #bdb4a1;        /* dashed / dotted outlines */
  --muted: #5f5a52;
  --faint: #a39a87;
  --screen: #16161d;      /* terminals and previews */
  --y: #ffd23f;  --y-soft: #fff1b8;
  --blue: #7aa5ff; --blue-soft: #dfe8ff;
  --red: #ff6b6b; --red-soft: #ffe1e1;
  --green: #5ad390; --green-soft: #d9f6e5;
  --orange: #ffb347; --orange-soft: #ffeccb;
  --purple: #b9a0ff; --purple-soft: #ece5ff;
  --mint: #72e3c9; --mint-soft: #d7f7ef;
  --pink: #ff9fcf;
  --neutral-soft: #efece5;
  --live-bg: #f3fff7;     /* running agent */
  --warm-bg: #fffaea;     /* busy session, project with a warning */
  --alert-bg: #fff3f3;
  --ok: #157a45;          /* readable "green" text */
  --link: #2453c9;
  --red-text: #9e1020;
  --orange-text: #6b3a00;
  --purple-text: #5b3fc9;
  --teal-text: #0b7a63;
  --dir: #c27a00;
  --checker: #f1e9d8;
  --switch-off: #e7dfcd;
  --thumb: var(--ink);
  --scrim: rgba(20, 20, 20, 0.45);
  --drop: rgba(255, 244, 220, 0.94);
  --sh-sm: 2px 2px 0 var(--ink);
  --sh: 4px 4px 0 var(--ink);
  --sh-lg: 8px 8px 0 var(--ink);

  /* SILO variables, remapped (rules not overridden below still read them) */
  --bg: var(--cream);
  --panel: var(--paper);
  --ph: var(--fg);
  --ph-hi: var(--hi);
  --ph-mid: #2b2b2b;
  --ph-dim: var(--muted);
  --ph-faint: #cfc6b3;
  --ph-ghost: var(--rule);
  --warn: #a35700;
  --alert: #c8202f;
  --glow: none;
  --glow-soft: none;
  --ui: 'Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: var(--ui);
  --radius: 10px;
  /* cursors: same shapes as the UI (flat face, ink outline, solid extrusion); the -down ones flatten while the mouse is pressed.
     Sources and preview generator: tools/pop-cursors.mjs */
  --cur-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='32' viewBox='0 0 26 32'%3E%3Cdefs%3E%3Cpath id='s' d='M4 3V22.5L8.7 18.3L12.2 26L16 24.3L12.6 16.7H19Z'/%3E%3C/defs%3E%3Cuse href='%23s' x='3' y='3' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='2' y='2' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='1' y='1' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='0' y='0' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' fill='%23ffd23f'/%3E%3Cpath d='M6.3 8.2V14.5' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E") 4 3, default;
  --cur-arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='32' viewBox='0 0 26 32'%3E%3Cdefs%3E%3Cpath id='s' d='M4 3V22.5L8.7 18.3L12.2 26L16 24.3L12.6 16.7H19Z'/%3E%3C/defs%3E%3Cuse href='%23s' x='1' y='1' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='0' y='0' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' fill='%23ffd23f'/%3E%3Cpath d='M6.3 8.2V14.5' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E") 4 3, default;
  --cur-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='32' viewBox='0 0 30 32'%3E%3Cdefs%3E%3Cg id='s'%3E%3Crect x='10' y='2.5' width='5.2' height='16' rx='2.6'/%3E%3Crect x='14.6' y='10.6' width='5' height='9' rx='2.5'/%3E%3Crect x='19' y='12' width='4.8' height='8.5' rx='2.4'/%3E%3Crect x='7.2' y='15' width='16.6' height='12.5' rx='4.6'/%3E%3Crect x='3.6' y='14.6' width='8.4' height='5' rx='2.5' transform='rotate(38 7.8 17.1)'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23s' x='3' y='3' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='2' y='2' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='1' y='1' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='0' y='0' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' fill='%23ffffff'/%3E%3Cpath d='M14.9 13.2V18.4M19.3 14.4V19.2' stroke='%23141414' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3Cpath d='M12 5.2V9.5' stroke='%23ffd23f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 12 3, pointer;
  --cur-hand-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='32' viewBox='0 0 30 32'%3E%3Cdefs%3E%3Cg id='s'%3E%3Crect x='10' y='2.5' width='5.2' height='16' rx='2.6'/%3E%3Crect x='14.6' y='10.6' width='5' height='9' rx='2.5'/%3E%3Crect x='19' y='12' width='4.8' height='8.5' rx='2.4'/%3E%3Crect x='7.2' y='15' width='16.6' height='12.5' rx='4.6'/%3E%3Crect x='3.6' y='14.6' width='8.4' height='5' rx='2.5' transform='rotate(38 7.8 17.1)'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23s' x='1' y='1' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='0' y='0' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' fill='%23ffffff'/%3E%3Cpath d='M14.9 13.2V18.4M19.3 14.4V19.2' stroke='%23141414' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3Cpath d='M12 5.2V9.5' stroke='%23ffd23f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 12 3, pointer;
  --cur-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='32' viewBox='0 0 21 32'%3E%3Cdefs%3E%3Cpath id='s' d='M5 3.5H15V6.5H11.5V25.5H15V28.5H5V25.5H8.5V6.5H5Z'/%3E%3C/defs%3E%3Cuse href='%23s' x='1' y='1' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' x='0' y='0' fill='%23141414' stroke='%23141414' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cuse href='%23s' fill='%23ffd23f'/%3E%3C/svg%3E") 10 16, text;

  --chart-line: #3f6fe8;
  --chart-alt: #f08a00;
  --chart-grid: #e6dcc8;
  --chart-text: #5f5a52;
  --chart-glow: 0;
  --chart-font: 600 11px Grotesk, sans-serif;
  color-scheme: light;
}

/* ---------- dark mode: same accents, charcoal surfaces, outlines and shadows stay ink ---------- */
:root[data-theme="pop"][data-mode="dark"] {
  --ink: #050507;
  --fg: #ece8df;
  --hi: #ffffff;
  --fg2: #d4d0c8;
  --cream: #24232d;
  --paper: #33323e;
  --tint: #3e3d4b;
  --well: #2a2934;
  --rule: #484656;
  --dash: #67647a;
  --muted: #aba6b8;
  --faint: #78748a;
  --screen: #121118;
  --y-soft: #4a3915;
  --blue-soft: #2b3a5e;
  --red-soft: #51262c;
  --green-soft: #21402f;
  --orange-soft: #4f3719;
  --purple-soft: #3a3060;
  --mint-soft: #1f463d;
  --neutral-soft: #444252;
  --live-bg: #283a31;
  --warm-bg: #3c3524;
  --alert-bg: #44282d;
  --ok: #5ad390;
  --link: #93b4ff;
  --red-text: #ff9d9d;
  --orange-text: #ffc477;
  --purple-text: #c9b6ff;
  --teal-text: #72e3c9;
  --dir: #ffc04d;
  --checker: #3a3946;
  --switch-off: #4c4a5a;
  --thumb: #6a6780;
  --scrim: rgba(0, 0, 0, 0.6);
  --drop: rgba(36, 35, 45, 0.94);

  --ph-mid: #d6d2c8;
  --ph-faint: #555366;
  --warn: #ffb347;
  --alert: #ff7b7b;

  --chart-line: #7aa5ff;
  --chart-alt: #ffb347;
  --chart-grid: #45434f;
  --chart-text: #aba6b8;
  color-scheme: dark;
}

[data-theme="pop"] {
  /* ---------- base ---------- */
  & body { background: var(--cream); color: var(--fg); font: 500 13.5px/1.45 var(--ui); }
  & *, & *::before, & *::after { text-shadow: none !important; }
  & ::selection { background: var(--y); color: var(--on); }
  & input::placeholder, & textarea::placeholder { color: var(--faint); }
  & input, & textarea { caret-color: var(--fg); }
  & * { scrollbar-color: var(--thumb) transparent; }
  & ::-webkit-scrollbar-thumb { background: var(--thumb); border: 2px solid var(--cream); border-radius: 99px; }

  .crt { background: var(--cream); }
  .crt.fx::before, .crt.fx::after { display: none; }
  .glyph { color: var(--fg); letter-spacing: 0; }
  .dim { color: var(--muted); }
  .hi { color: var(--hi); font-weight: 700; }
  .warn { color: var(--warn); }
  .alert { color: var(--alert); }
  .blink, .cursor { animation: none; }
  & code, .code-inline { font: 12px var(--mono); color: var(--hi); background: var(--y-soft); border: 1.5px solid var(--ink); border-radius: 5px; padding: 0 5px; }
  .link { color: var(--link); text-decoration: underline 2px; text-underline-offset: 2px; }
  .hint, .muted { color: var(--muted); }

  /* ---------- buttons: lift on hover, press in on click ---------- */
  .btn {
    background: var(--paper); color: var(--fg);
    border: 2.5px solid var(--ink); border-radius: 10px;
    padding: 5px 12px; font: 700 12px/1.25 var(--ui); letter-spacing: 0.03em;
    box-shadow: var(--sh-sm);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s;
  }
  .btn:hover, .btn:focus-visible { background: var(--y); color: var(--on); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); outline: none; }
  .btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
  .btn:disabled { opacity: 0.45; box-shadow: none; }
  .btn-ghost { border-color: var(--ink); }
  .btn-primary { background: var(--y); color: var(--on); }
  .btn-primary:hover, .btn-primary:focus-visible { background: #ffdf6b; }
  .btn-danger { background: var(--red-soft); color: var(--red-text); border-color: var(--ink); }
  .btn-danger:hover, .btn-danger:focus-visible { background: var(--red); color: var(--on); box-shadow: 3px 3px 0 var(--ink); }
  .btn-warn { background: var(--orange-soft); color: var(--orange-text); border-color: var(--ink); }
  .btn-warn:hover, .btn-warn:focus-visible { background: var(--orange); color: var(--on); box-shadow: 3px 3px 0 var(--ink); }
  .btn.on { background: var(--ink); color: var(--y); }
  .btn-sm { padding: 2px 8px; font-size: 11px; border-width: 2px; border-radius: 8px; }
  .btn-wide { padding: 11px; font-size: 15px; border-radius: 12px; box-shadow: var(--sh); }
  .btn-wide:hover { box-shadow: 5px 5px 0 var(--ink); }
  .btn-wide:active { box-shadow: 0 0 0 var(--ink); transform: translate(4px, 4px); }

  /* ---------- login ---------- */
  .boot { display: none; }
  .login-box {
    background: var(--paper); border: 3px solid var(--ink); border-radius: 22px;
    box-shadow: var(--sh-lg); padding: 28px 26px 24px; gap: 16px;
  }
  .login-head { border-bottom: 2.5px dashed var(--rule); padding-bottom: 16px; }
  .login-head .glyph { display: none; }
  .login-head::before {
    content: attr(data-initial); flex: none; display: grid; place-items: center; width: 48px; height: 48px;
    font: 700 28px/1 var(--ui); color: var(--on); background: var(--y);
    border: 3px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
  }
  .login-title { font: 700 30px/1 var(--ui); letter-spacing: -0.02em; color: var(--hi); text-transform: none; }
  .login-sub { margin-top: 5px; font: 700 10px/1.3 var(--ui); letter-spacing: 0.1em; color: var(--muted); }
  .login-msg { font: 700 13px/1.3 var(--ui); letter-spacing: 0.06em; min-height: 17px; color: var(--muted); }
  .login-msg.err { color: var(--alert); animation: none; }
  .login-msg.okk { color: var(--ok); }
  .field { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; padding: 9px 12px; transition: box-shadow 0.1s, transform 0.1s; }
  .field:focus-within { background: var(--tint); box-shadow: var(--sh); transform: translate(-2px, -2px); }
  .field span { font: 700 11px var(--ui); letter-spacing: 0.08em; color: var(--muted); }
  .field input { font: 600 18px/1.1 var(--mono); letter-spacing: 0.08em; color: var(--hi); }

  /* ---------- app shell ---------- */
  .app { animation: pop-in 0.25s ease-out; }
  .topbar { background: var(--paper); border-bottom: 2.5px solid var(--ink); padding: 8px 16px; gap: 18px; }
  .brand { display: flex; align-items: center; gap: 10px; font: 700 21px/1 var(--ui); letter-spacing: -0.02em; color: var(--hi); text-transform: none; }
  .brand .glyph { display: none; }
  .brand::before {
    content: attr(data-initial); display: grid; place-items: center; width: 30px; height: 30px;
    font: 700 18px/1 var(--ui); color: var(--on); background: var(--y);
    border: 2.5px solid var(--ink); border-radius: 9px; box-shadow: var(--sh-sm);
  }
  .top-info { font-size: 11.5px; letter-spacing: 0.02em; }
  .top-info span { color: var(--muted); }
  .top-info span b { color: var(--hi); font-weight: 700; }
  .clock {
    font: 700 15px/1 var(--ui); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
    color: var(--y); background: var(--ink); padding: 6px 10px; border-radius: 9px; margin-right: 6px;
  }
  #fx-toggle, #sheet-fx { display: none; }

  .nav { background: var(--cream); border-right: 2.5px solid var(--ink); padding: 16px 12px; gap: 7px; }
  .nav a {
    font: 700 13.5px/1 var(--ui); letter-spacing: 0.04em; color: var(--fg);
    padding: 8px 10px; border: 2.5px solid transparent; border-radius: 12px;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s;
  }
  .nav a kbd {
    min-width: 22px; text-align: center; font: 700 11px/1 var(--ui); color: var(--fg);
    padding: 3px 5px; background: var(--paper); border: 2px solid var(--ink); border-radius: 6px;
  }
  .nav a:hover { background: var(--paper); border-color: var(--ink); box-shadow: var(--sh-sm); transform: translate(-1px, -1px); }
  .nav a:active { transform: translate(2px, 2px); box-shadow: none; }
  .nav a.active { background: var(--y); color: var(--on); border-color: var(--ink); box-shadow: var(--sh-sm); }
  .nav a.active kbd { color: var(--hi); border-color: var(--ink); }
  .nav a.active::after { content: none; }
  .nav-gauges { border-top: 2.5px dashed var(--ph-faint); }
  .nav-foot { color: var(--faint); font-weight: 700; }
  .gauge { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
  .gauge-head span:first-child { color: var(--muted); }

  .statusline { background: var(--paper); border-top: 2.5px solid var(--ink); font: 600 12px var(--ui); letter-spacing: 0.01em; }
  .statusline .prompt { font-weight: 700; color: var(--y); background: var(--ink); padding: 1px 7px; border-radius: 6px; }
  .statusline .cursor { display: none; }
  #status-msg.ok { color: var(--ok); }
  #link-state { color: var(--ok); font-weight: 700; }
  #link-state.down { color: var(--alert); }

  /* ---------- panels: cards with a sticker title ---------- */
  .panel { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--sh); padding: 26px 18px 16px; }
  .panel::before, .panel::after { content: none; }
  .panel > h2 {
    top: -15px; left: 16px; padding: 6px 10px;
    font: 700 11.5px/1 var(--ui); letter-spacing: 0.08em; color: var(--on);
    background: var(--y); border: 2.5px solid var(--ink); border-radius: 9px; box-shadow: var(--sh-sm);
  }
  .panel > h2::before, .panel > h2::after { content: none; }
  .panel-flush { padding: 0; }
  .panel-flush > .table-wrap { border-radius: 13px; }
  .p-cpu > h2, .ag-sessions > h2, .p-sessions > h2 { background: var(--blue); }
  .p-mem > h2 { background: var(--pink); }
  .p-net > h2, .ag-procs > h2 { background: var(--mint); }
  .p-disk > h2 { background: var(--orange); }
  .p-sys > h2 { background: var(--purple); }
  .p-sum > h2 { background: var(--green); }
  .p-alerts > h2 { background: var(--red); }

  .bignum { font: 700 50px/0.95 var(--ui); letter-spacing: -0.04em; color: var(--hi); }
  .bignum small { font-size: 22px; color: var(--muted); margin-left: 3px; }
  .kv { font-size: 12.5px; }
  .kv dt, .kv .k { color: var(--muted); letter-spacing: 0.02em; }
  .kv .v { font-weight: 600; }
  .net-rates { font: 700 22px/1 var(--ui); letter-spacing: -0.02em; }
  .net-rates b { font-weight: 700; color: var(--hi); }
  .net-rates .dim { font-size: 12px; letter-spacing: 0.04em; }

  /* gauges: chunky rounded pills */
  .bar { height: 14px; padding: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
  .bar > i { background: var(--green); filter: none; box-shadow: 2px 0 0 var(--ink); }
  .bar.warn > i { background: var(--orange); filter: none; }
  .bar.alert > i { background: var(--red); filter: none; }
  .bar-sm { height: 11px; }
  .core span:first-child { color: var(--muted); font-weight: 600; }
  .disk-head b { font-weight: 700; color: var(--hi); }

  .sum-item {
    background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--sh-sm);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s;
  }
  .sum-item:hover { background: var(--tint); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
  .sum-item:active { transform: translate(2px, 2px); box-shadow: none; }
  .sum-item .n { font: 700 32px/1 var(--ui); letter-spacing: -0.03em; color: var(--hi); }
  .sum-item .n small { font-size: 15px; color: var(--muted); }
  .sum-item .l { margin-top: 4px; font: 700 10px var(--ui); letter-spacing: 0.08em; color: var(--muted); }
  .sum-item.bad { background: var(--red-soft); }
  .sum-item.bad .n { color: var(--alert); }

  /* ---------- tables ---------- */
  .table { font-size: 12.5px; }
  .table th {
    background: var(--y-soft); color: var(--hi); font: 700 10.5px var(--ui); letter-spacing: 0.07em;
    border-bottom: 2.5px solid var(--ink);
  }
  .table th.sortable:hover { color: var(--link); }
  .table td { border-bottom: 1.5px solid var(--rule); }
  .table tbody tr:hover td { background: var(--tint); }
  .table tbody tr.sel td { background: var(--y); color: var(--on); }
  .table tbody tr.sel td b { color: var(--on); }
  .table tbody tr.sel td .dim, .table tbody tr.sel td .muted { color: #3d3a35; }
  .group-row td { font: 700 12px/1 var(--ui); letter-spacing: 0.08em; color: var(--hi); }
  .state.ok { color: var(--ok); }
  .state.off { color: var(--muted); }
  .state.bad { color: var(--alert); }
  .state.bad::before { animation: none; }
  .state.mid { color: var(--warn); }

  /* ---------- toolbar ---------- */
  .seg { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: var(--sh-sm); }
  .seg button { padding: 5px 12px; font: 700 12px var(--ui); letter-spacing: 0.03em; color: var(--fg); }
  .seg button + button { border-left: 2.5px solid var(--ink); }
  .seg button:hover { background: var(--tint); }
  .seg button:active { box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.25); }
  .seg button.on { background: var(--y); color: var(--on); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.18); }
  .search { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 10px; padding: 5px 12px; box-shadow: var(--sh-sm); transition: box-shadow 0.1s, background-color 0.1s; }
  .search:focus-within { background: var(--tint); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
  .search span { color: var(--hi); font: 700 11px var(--ui); letter-spacing: 0.06em; }

  /* ---------- containers ---------- */
  .ct-cell-name b { font-weight: 700; color: var(--hi); }

  /* ---------- terminal: dark screen in a card ---------- */
  .term-tabs { margin-bottom: 10px; gap: 10px; }
  .term-tablist { gap: 6px; }
  .term-tab {
    background: var(--paper); color: var(--hi); font: 700 12px var(--ui); letter-spacing: 0.01em;
    border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--sh-sm); padding: 4px 6px 4px 12px;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
  }
  .term-tab:hover { background: var(--tint); }
  .term-tab:active { transform: translate(2px, 2px); box-shadow: none; }
  .term-tab.active { background: var(--y); color: var(--on); border-color: var(--ink); }
  .term-tab:not(.active) { color: var(--hi); }
  .term-tab.new { border-bottom-color: var(--ink); }
  .term-tab .x { color: var(--muted); font-weight: 700; }
  .term-tab.active .x { color: #3d3a35; }
  .term-tab .x:hover { color: var(--alert); }
  .term-tab .kind { border: 1.5px solid currentColor; border-radius: 5px; padding: 0 5px; font: 700 9.5px/1.5 var(--ui); color: var(--muted); }
  .term-tab.active .kind { color: #3d3a35; }
  .term-tab .kind.persist { color: var(--orange-text); background: var(--orange-soft); }
  .term-tab:not(.active) .kind.persist { opacity: 1; }
  .term-kill {
    background: var(--red-soft); color: var(--red-text); font: 700 11.5px var(--ui); letter-spacing: 0.04em;
    border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--sh-sm);
  }
  .term-kill:hover, .term-kill:focus-visible { background: var(--red); color: var(--on); box-shadow: 3px 3px 0 var(--ink); }
  .term-kill:active { transform: translate(2px, 2px); box-shadow: none; }
  .term-zoom { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: var(--sh-sm); }
  .term-zoom button { font-weight: 700; }
  .term-zoom button + button { border-left: 2.5px solid var(--ink); }
  .term-zoom button.size { color: var(--hi); font: 700 11px var(--ui); }
  .term-zoom button:hover, .term-zoom button:focus-visible { background: var(--y); color: var(--on); }
  .panel.term-stage { background: var(--screen); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--sh); }
  .term-pane .xterm-screen { text-shadow: none; }
  .term-keys button {
    background: var(--paper); color: var(--hi); font: 700 13px var(--ui);
    border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--sh-sm);
  }
  .term-keys button:active, .term-keys button.on { background: var(--y); color: var(--on); transform: translate(2px, 2px); box-shadow: none; }
  .term-compose textarea { background: var(--paper); color: var(--hi); border: 2.5px solid var(--ink); border-radius: 12px; font-family: var(--ui); }
  .term-compose textarea:focus { box-shadow: var(--sh-sm); }

  /* ---------- files ---------- */
  .f-icon { color: var(--muted); }
  .f-dir .f-name { color: var(--hi); font-weight: 700; }
  .f-dir .f-icon { color: var(--dir); }
  .f-link .f-name::after { color: var(--muted); }
  .table tr.sel .f-name, .table tr.sel .f-icon { color: var(--on); }
  .table tr.sel .f-name::after { color: #3d3a35; }
  .dropzone { background: var(--drop); border: 3px dashed var(--ink); border-radius: 14px; color: var(--hi); font: 700 22px/1 var(--ui); letter-spacing: 0.04em; }
  .pv-head { background: var(--y-soft); border-bottom: 2.5px solid var(--ink); }
  .pv-title { color: var(--hi); font-weight: 700; }
  .pv-meta { color: var(--muted); border-bottom: 2px dashed var(--rule); }
  .pv-empty { font: 700 15px/1.35 var(--ui); letter-spacing: 0.04em; color: var(--muted); }
  .pv-empty .big { font-size: 52px; color: var(--ph-faint); }
  .pv-media { background: repeating-conic-gradient(var(--checker) 0 25%, transparent 0 50%) 0 0 / 20px 20px; }
  .pv-media img, .pv-media video { border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--sh); }
  .code .ln { color: var(--faint); border-right: 2px solid var(--rule); }
  .code textarea { color: var(--hi); }
  .code.editing { background: var(--tint); }
  .hex { color: var(--fg2); }
  .notice { color: var(--warn); border-bottom: 2px dashed var(--rule); font-weight: 600; }

  /* ---------- security ---------- */
  .alert-state { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--sh-sm); }
  .alert-state .big { font: 700 18px/1 var(--ui); letter-spacing: 0.02em; }
  .policy .k { color: var(--muted); }
  .me { color: var(--ok); font-weight: 700; }

  /* ---------- modal ---------- */
  .modal-back { background: var(--scrim); }
  .modal { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--sh-lg); }
  .modal h3 { font: 700 19px/1.15 var(--ui); letter-spacing: 0; color: var(--hi); }
  .modal h3.danger { color: var(--alert); }
  .modal p { color: var(--fg2); }
  .modal input[type=text] { background: var(--paper); color: var(--hi); border: 2.5px solid var(--ink); border-radius: 10px; }
  .modal input[type=text]:focus { border-color: var(--ink); box-shadow: var(--sh-sm); }
  .logs { background: var(--well); color: var(--fg2); border: 2.5px solid var(--ink); border-radius: 12px; }

  /* ---------- agents ---------- */
  .panel.agent-card.live { background: var(--live-bg); border-color: var(--ink); box-shadow: var(--sh); }
  .panel.agent-card.live > h2 { background: var(--green); }
  .ag-glyph {
    display: grid; place-items: center; width: 46px; height: 46px; flex: none;
    font: 700 26px/1 var(--ui); color: var(--hi); background: var(--y-soft);
    border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--sh-sm);
  }
  .ag-vendor { font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
  .ag-ver { font: 700 16px/1.15 var(--ui); letter-spacing: -0.01em; }
  .ag-state { font-weight: 600; letter-spacing: 0.02em; }
  .ag-usage-head b { color: var(--hi); font-weight: 700; }
  .minibars { border-bottom: 2.5px solid var(--ink); }
  .minibars i { background: var(--blue); filter: none; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 3px 3px 0 0; }
  .sess-card { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--sh-sm); }
  .sess-card.busy { background: var(--warm-bg); border-color: var(--ink); box-shadow: var(--sh); }
  .sess-name { color: var(--hi); font-weight: 700; }
  .sess-preview { background: var(--screen); color: #e3e0d8; border: 2.5px solid var(--ink); border-radius: 12px; }
  .sess-preview-wrap:hover .sess-preview { border-color: var(--ink); box-shadow: var(--sh-sm); }
  .sess-send input { background: var(--paper); color: var(--hi); border: 2.5px solid var(--ink); border-radius: 10px; }
  .sess-send input:focus { border-color: var(--ink); box-shadow: var(--sh-sm); }
  .empty-note { font: 600 14px/1.4 var(--ui); letter-spacing: 0.02em; color: var(--muted); }
  .badge { padding: 1px 7px; font: 700 10.5px/1.45 var(--ui); letter-spacing: 0.04em; color: var(--hi); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 6px; }
  .b-claude { background: var(--orange-soft); color: var(--hi); }
  .b-codex { background: var(--mint-soft); color: var(--hi); }
  .b-opencode { background: var(--blue-soft); color: var(--hi); }
  .b-hermes { background: var(--purple-soft); color: var(--hi); }
  .b-shell { background: var(--neutral-soft); color: var(--hi); }
  .b-db { background: var(--blue-soft); color: var(--hi); }
  .badge.warn { background: var(--orange-soft); color: var(--orange-text); }
  .chat { background: var(--well); border: 2.5px solid var(--ink); border-radius: 12px; }
  .msg { border-left: 3px solid var(--rule); border-radius: 0 10px 10px 0; }
  .msg.user { border-left-color: var(--ink); background: var(--y-soft); }
  .msg .who { font: 700 10.5px/1 var(--ui); letter-spacing: 0.1em; color: var(--muted); }
  .msg.user .who { color: var(--hi); }
  .msg pre { color: var(--fg); }
  .msg.tool { color: var(--muted); }
  .chip { border: 2px dashed var(--dash); border-radius: 99px; padding: 2px 10px; font: 600 11px var(--ui); color: var(--fg2); }
  .chip:hover { border: 2px solid var(--ink); background: var(--y); color: var(--on); }
  .chip:active { transform: translate(1px, 1px); }

  /* ---------- hermes console & forms ---------- */
  & select { background: var(--paper); color: var(--hi); border: 2.5px solid var(--ink); border-radius: 10px; font: 600 12px var(--ui); }
  & select:focus { box-shadow: var(--sh-sm); }
  .hx-title { font: 700 24px/1 var(--ui); letter-spacing: -0.01em; color: var(--hi); }
  .hx-title .glyph { color: var(--purple-text); }
  .hx-meta { font-weight: 600; letter-spacing: 0.02em; }
  .hx-tabs { gap: 8px; border-bottom: 2.5px dashed var(--ph-faint); }
  .hx-tabs button {
    background: var(--paper); color: var(--hi); font: 700 12px var(--ui); letter-spacing: 0.03em;
    border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--sh-sm);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
  }
  .hx-tabs button:hover { background: var(--tint); border-color: var(--ink); color: var(--hi); }
  .hx-tabs button.on { background: var(--purple); border-color: var(--ink); color: var(--on); box-shadow: none; transform: translate(2px, 2px); }
  .hx-tile { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--sh-sm); }
  .hx-tile .l { font: 700 10px var(--ui); letter-spacing: 0.08em; color: var(--muted); }
  .hx-tile .n { font: 700 22px/1.1 var(--ui); letter-spacing: -0.02em; color: var(--hi); }
  .hx-tile .s { color: var(--muted); }
  .hx-tile.bad { background: var(--red-soft); }
  .hx-tile.bad .n { color: var(--alert); }
  .hx-tile.warn { background: var(--orange-soft); }
  .hx-tile.warn .n { color: var(--warn); }
  .hx-field > span { font: 700 10.5px var(--ui); letter-spacing: 0.06em; color: var(--muted); }
  .hx-field input, .hx-field select, .launch input, .launch select, .hx-ask-side input, .pj-rem-form input {
    background: var(--paper); color: var(--hi); border: 2.5px solid var(--ink); border-radius: 10px;
  }
  .hx-field input:focus, .hx-area:focus, .hx-editor:focus, .pj-rem-form input:focus { border-color: var(--ink); box-shadow: var(--sh-sm); }
  .hx-area, .hx-editor { background: var(--paper); color: var(--hi); border: 2.5px solid var(--ink); border-radius: 12px; }
  .hx-check { color: var(--hi); font-weight: 600; letter-spacing: 0.03em; }
  input.chk { accent-color: var(--ink); }
  .switch { width: 42px; height: 24px; background: var(--switch-off); border: 2.5px solid var(--ink); border-radius: 99px; transition: background-color 0.12s; }
  .switch i { top: 2px; left: 2px; width: 15px; height: 15px; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; }
  .switch.on { background: var(--green); border-color: var(--ink); box-shadow: none; }
  .switch.on i { left: 20px; background: #fff; box-shadow: none; }
  .hx-banner { background: var(--paper); border: 2.5px solid currentColor; border-radius: 12px; font-weight: 600; letter-spacing: 0.02em; }
  .hx-busy { color: var(--muted); font-weight: 700; }
  & pre.cli { background: var(--well); color: var(--fg2); border: 2px solid var(--ink); border-radius: 12px; }
  .cl-ok { color: var(--ok); }
  .cl-off { color: var(--muted); }
  .cl-bad { color: var(--alert); }
  .cl-warn { color: var(--warn); }
  .cl-head { color: var(--hi); font-weight: 700; }
  .cli-table { border: 2px solid var(--ink); border-radius: 12px; }
  .hx-tool { background: var(--paper); border: 2px solid var(--rule); border-radius: 12px; }
  .hx-tool.on { border-color: var(--ink); box-shadow: var(--sh-sm); }
  .hx-tool b { color: var(--hi); font-weight: 700; }
  .hx-plat > div { color: var(--muted); border-bottom: 2px dashed var(--rule); }
  .hx-plat > div.on { color: var(--ok); }
  .hx-cmd { border: 2px solid transparent; border-radius: 10px; }
  .hx-cmd b { color: var(--hi); font-weight: 700; }
  .hx-cmd:hover, .hx-cmd:focus-visible { background: var(--tint); border-color: var(--ink); }

  /* ---------- system ---------- */
  .ag-updstate { border: 2px solid currentColor; border-radius: 8px; font-weight: 700; }
  .ag-updstate.ok { color: var(--ok); }
  .ag-upd { color: var(--warn); }
  .sys-hist details { border-bottom: 2px dashed var(--rule); }
  .sys-hist summary::before { color: var(--muted); }

  /* ---------- projects ---------- */
  .pj-caret { color: var(--hi); }
  .pj-group-head:hover .pj-caret, .pj-group-head:focus-visible .pj-caret { color: var(--hi); }
  .pj-group-head:focus-visible { outline: 2.5px dashed var(--fg); border-radius: 8px; }
  .pj-group-title { font: 700 15px/1 var(--ui); letter-spacing: 0.08em; color: var(--hi); }
  .pj-group-count { padding: 1px 8px; font: 700 11px var(--ui); color: var(--on); background: var(--y); border: 2px solid var(--ink); border-radius: 99px; }
  .pj-group-rule { height: 2.5px; background: var(--fg); border-radius: 2px; }
  .pj-card {
    background: var(--paper); color: var(--fg); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--sh);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s;
  }
  .pj-card:hover, .pj-card:focus-visible { border-color: var(--ink); box-shadow: 6px 6px 0 var(--ink); transform: translate(-2px, -2px); outline: none; }
  .pj-card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
  .pj-card.warn { background: var(--warm-bg); border-color: var(--ink); }
  .pj-card.alert { background: var(--alert-bg); border-color: var(--ink); box-shadow: var(--sh), inset 0 5px 0 var(--red); }
  .pj-name { font: 700 20px/1.1 var(--ui); letter-spacing: -0.02em; color: var(--hi); }
  .pj-lines { border-top: 2px dashed var(--rule); }
  .pj-lines dt { font: 700 10px var(--ui); letter-spacing: 0.08em; color: var(--muted); }
  .pj-alerts { border-top: 2px dashed var(--rule); font-weight: 600; }
  .k-client { color: var(--teal-text); }
  .k-perso { color: var(--fg2); }
  .k-internal { color: var(--purple-text); }
  .s-live { color: var(--ok); }
  .s-dev { color: var(--link); }
  .s-paused { color: var(--muted); }
  .s-archived { color: var(--faint); }
  .pj-desc { color: var(--muted); }
  .pj-colhead { font: 700 12px/1 var(--ui); letter-spacing: 0.14em; color: var(--hi); border-bottom: 2.5px solid var(--ink); }
  .pj-big { font: 700 18px/1.1 var(--ui); letter-spacing: -0.01em; color: var(--hi); }
  .pj-amount { font: 700 20px/1 var(--ui); letter-spacing: -0.02em; color: var(--hi); }
  .pj-amount small { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
  .pj-dep { border-top: 2px dashed var(--rule); }
  .pj-hist { border-top: 2px dashed var(--rule); }
  .pj-hist-head { font: 700 10px var(--ui); letter-spacing: 0.08em; color: var(--muted); }
  .pj-hrow { border-top: 1.5px dotted var(--rule); }
  .pj-hrow .meta { color: var(--muted); }
  .pj-hrow .meta b { color: var(--fg); font-weight: 700; }
  .pj-dep-head b, .pj-svcname, .pj-bk .what b { color: var(--hi); font-weight: 700; }
  .pj-mono { color: var(--fg2); }
  .pj-info { color: var(--muted); }
  .copy { border-bottom: 2px dotted var(--dash); }
  .copy:hover { color: var(--hi); background: var(--y-soft); border-bottom-color: var(--fg); }
  .pj-bk { border-top: 2px dashed var(--rule); }
  .pj-bk .meta { color: var(--muted); }
  .pj-fs-title { font: 700 11px var(--ui); letter-spacing: 0.12em; color: var(--hi); border-bottom: 2.5px solid var(--ink); }
  .pj-pick { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; }
  .pj-pick-group { font: 700 10px var(--ui); letter-spacing: 0.1em; color: var(--muted); }
  .pj-pick label:hover { background: var(--tint); }
  .pj-pick b { font-weight: 700; }
  .pj-note, .pj-rem { border-top: 2px dashed var(--rule); }
  .pj-note.pinned { border-left: 4px solid var(--orange); }
  .pj-pin { color: var(--warn); }
  .pj-note-btn { font: 700 10px var(--ui); letter-spacing: 0.06em; color: var(--muted); }
  .pj-note-btn:hover, .pj-note-btn:focus-visible { color: var(--hi); }
  .pj-note-btn.danger:hover { color: var(--alert); }
  .pj-rem-off { background: var(--warm-bg); border: 2px dashed var(--warn); border-radius: 10px; color: var(--warn); }
  .pj-rem-off code { color: var(--hi); }
  .pj-ev::before { top: 31.5px; height: 3px; background: var(--fg); }
  .pj-ev.future::before { background: repeating-linear-gradient(90deg, var(--fg) 0 7px, transparent 7px 13px); }
  .pj-tl-today::before { background: linear-gradient(90deg, var(--fg) 0 50%, transparent 50%), repeating-linear-gradient(90deg, var(--fg) 0 7px, transparent 7px 13px); }
  .pj-ev-date { font: 700 10px var(--ui); letter-spacing: 0.06em; color: var(--muted); }
  .pj-ev-dot {
    width: 18px; height: 18px; border-radius: 50%; background: var(--y); border: 2.5px solid var(--ink); box-shadow: var(--sh-sm);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
  }
  .pj-ev.future .pj-ev-dot { background: var(--paper); border: 2.5px dashed var(--fg); box-shadow: none; }
  .pj-ev:hover .pj-ev-dot, .pj-ev:focus-visible .pj-ev-dot { transform: translate(-1px, -1px) scale(1.2); box-shadow: 3px 3px 0 var(--ink); background: var(--pink); }
  .pj-ev:active .pj-ev-dot { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
  .pj-ev-title { font: 700 13px/1.3 var(--ui); color: var(--hi); }
  .pj-ev.future .pj-ev-title { color: var(--fg2); font-weight: 500; }
  .pj-tl-today .pj-ev-dot { width: 4px; height: 24px; border: 0; border-radius: 2px; background: var(--red); box-shadow: none; }
  .pj-tl-today .pj-ev-title { padding: 1px 7px; font: 700 10px var(--ui); letter-spacing: 0.08em; color: var(--on); background: var(--red); border: 2px solid var(--ink); border-radius: 99px; }
  .pj-tl-pop {
    background: var(--paper); color: var(--fg); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--sh);
    font: 500 13px/1.5 var(--ui);
  }
  .pj-tl-pop-head b { font-weight: 700; color: var(--hi); }
  .pj-tl-pop-head span { font: 700 10.5px var(--ui); color: var(--muted); }
  .pj-tl-pop-none, .pj-tl-pop-hint { color: var(--muted); }
  .pj-tl-pop-hint { font: 700 10px var(--ui); letter-spacing: 0.08em; }
  .pj-bm-link {
    background: var(--paper); color: var(--fg); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--sh-sm);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s;
  }
  .pj-bm-link:hover, .pj-bm-link:focus-visible { background: var(--tint); border-color: var(--ink); box-shadow: var(--sh); transform: translate(-2px, -2px); outline: none; }
  .pj-bm-link:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
  .pj-bm-mono { font: 700 17px/1 var(--ui); letter-spacing: -0.02em; color: var(--on); text-shadow: none; border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: var(--sh-sm); background: var(--y); }
  .pj-bm-mono.t1 { background: var(--blue); }
  .pj-bm-mono.t2 { background: var(--pink); }
  .pj-bm-mono.t3 { background: var(--green); }
  .pj-bm-mono.t4 { background: var(--orange); }
  .pj-bm-mono.t5 { background: var(--purple); }
  .pj-bm-name { font: 700 14px/1.2 var(--ui); color: var(--hi); }
  .pj-bm-host { font: 500 11.5px var(--ui); color: var(--link); }
  .pj-bm-note { font: 500 11.5px/1.4 var(--ui); color: var(--muted); }
  .pj-bm-add { font: 700 12px var(--ui); letter-spacing: 0.06em; color: var(--muted); border: 2.5px dashed var(--dash); border-radius: 14px; }
  .pj-bm-add:hover, .pj-bm-add:focus-visible { color: var(--hi); border-color: var(--ink); background: var(--y-soft); }
  & input[type=datetime-local], & input[type=date] { color-scheme: light; }

  /* ---------- traffic (PROJECTS) ---------- */
  .an-panel .bignum { font-size: 44px; }
  .an-val { font: 700 26px/0.95 var(--ui); letter-spacing: -0.02em; color: var(--hi); }
  .an-label { color: var(--muted); font: 700 11px var(--ui); letter-spacing: 0.06em; }
  .an-delta { font: 600 12.5px var(--ui); }
  .an-delta b { color: var(--hi); font-weight: 700; }
  .an-upd { font: 600 11.5px var(--ui); letter-spacing: 0.02em; }
  .an-svg { filter: none; }
  .an-nodata { color: var(--muted); font: 700 12px var(--ui); letter-spacing: 0.04em; }
  .an-tip { background: var(--paper); color: var(--fg); border: 2px solid var(--ink); border-radius: 8px; box-shadow: var(--sh-sm); font: 600 12px/1.45 var(--ui); }
  .an-tip b { color: var(--hi); font-weight: 700; }

  /* ---------- settings ---------- */
  .set-label { font: 700 11px var(--ui); letter-spacing: 0.12em; color: var(--muted); }
  .theme-card {
    background: var(--paper); color: var(--fg); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: var(--sh);
    padding: 12px 12px 14px; transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s;
  }
  .theme-card:hover, .theme-card:focus-visible { border-color: var(--ink); box-shadow: 6px 6px 0 var(--ink); transform: translate(-2px, -2px); outline: none; }
  .theme-card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
  .theme-card.on { background: var(--y-soft); border-color: var(--ink); box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }
  .tc-name { font: 700 19px/1 var(--ui); letter-spacing: 0.02em; color: var(--hi); }
  .tc-state { font: 700 10.5px var(--ui); letter-spacing: 0.08em; color: var(--muted); }
  .theme-card.on .tc-state { color: var(--ok); }
  .tc-desc { font-size: 12.5px; color: var(--fg2); }
  .set-row { border-top: 2px dashed var(--rule); }
  .set-name { font: 700 13px var(--ui); letter-spacing: 0.04em; color: var(--hi); }
  .set-seg button:disabled { opacity: 0.4; }

  /* ---------- phones ---------- */
  @media (max-width: 900px) {
    .brand { font-size: 18px; }
    .brand::before { width: 26px; height: 26px; font-size: 15px; }
    .clock { font-size: 13px; padding: 5px 8px; margin-right: 0; }
    .tabbar { background: var(--paper); border-top: 2.5px solid var(--ink); }
    .tabbar a, .tabbar button { gap: 4px; font: 700 10.5px/1 var(--ui); letter-spacing: 0.04em; color: var(--fg); }
    .tabbar b { display: grid; place-items: center; width: 44px; height: 28px; font: 700 15px/1 var(--ui); border: 2px solid transparent; border-radius: 10px; }
    .tabbar .active { color: var(--hi); background: none; box-shadow: none; }
    .tabbar .active b { color: var(--on); background: var(--y); border-color: var(--ink); box-shadow: var(--sh-sm); }
    .tabbar a:active b, .tabbar button:active b { transform: translate(2px, 2px); box-shadow: none; }
    .statusline { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--sh); }
    .sheet-back { background: var(--scrim); }
    .sheet { background: var(--paper); border-top: 3px solid var(--ink); border-radius: 22px 22px 0 0; gap: 6px; }
    .sheet-grip { background: var(--faint); }
    .sheet a { padding: 12px 14px; font: 700 16px/1 var(--ui); letter-spacing: 0.04em; border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--sh-sm); }
    .sheet a.active { background: var(--y); color: var(--on); }
    .sheet a:active { transform: translate(2px, 2px); box-shadow: none; }
    .table-cards tr { border-bottom: 1.5px solid var(--rule); }
    .bignum { font-size: 44px; }
  }
}

/* the cursor presses in like the buttons: :active matches the pressed element and its ancestors, so the variables switch everywhere */
[data-theme="pop"] :active { --cur-arrow: var(--cur-arrow-down); --cur-hand: var(--cur-hand-down); }
[data-theme="pop"] body { cursor: var(--cur-arrow); } /* re-read here: <html> passes its own computed cursor down, not the variable */

/* ---------- dark mode: the few rules that are not just a colour variable ---------- */
[data-theme="pop"][data-mode="dark"] {
  input.chk { accent-color: var(--y); }
  & input[type=datetime-local], & input[type=date] { color-scheme: dark; }
  & ::-webkit-scrollbar-thumb { border-color: var(--cream); }
}

@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  [data-theme="pop"] .app { animation: none; }
}

/* ---------- tabs and context menu: stickers on a shelf, a card menu ---------- */
[data-theme="pop"] {
  .tabstrip { gap: 6px; padding: 10px 16px 0; background: var(--cream); border-bottom: 2.5px solid var(--ink); }
  .tab {
    height: 32px; padding: 0 6px 0 14px; border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0;
    background: var(--paper); color: var(--fg); font: 700 13px/1 var(--ui); letter-spacing: 0.02em;
    transition: transform 0.08s ease, background-color 0.12s;
  }
  .tab:hover { background: var(--tint); color: var(--hi); border-color: var(--ink); transform: translateY(-2px); }
  .tab.active { height: 36px; margin-bottom: -2.5px; background: var(--y); color: var(--on); text-shadow: none; transform: none; }
  .tab.active::before { content: none; }
  .tab:focus-visible { outline: 2.5px dashed var(--ink); outline-offset: 3px; }
  .tab-x { width: 22px; height: 22px; border-radius: 7px; font: 700 15px/1 var(--ui); opacity: 0.6; }
  .tab-x:hover { opacity: 1; color: var(--on); background: var(--red); }
  .tab-new {
    width: 32px; height: 28px; margin-bottom: 4px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--paper);
    color: var(--hi); font: 700 18px/1 var(--ui); box-shadow: var(--sh-sm); transition: transform 0.08s ease, box-shadow 0.08s ease;
  }
  .tab-new:hover, .tab-new:focus-visible { background: var(--y); color: var(--on); border-color: var(--ink); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
  .tab-new:active { transform: translate(2px, 2px); box-shadow: none; }
  .tab.drop-before { box-shadow: -4px 0 0 var(--pink); }
  .tab.drop-after { box-shadow: 4px 0 0 var(--pink); }
  @keyframes tab-flash { 0%, 30% { background: var(--pink); color: var(--hi); } }

  .ctx-menu { min-width: 230px; padding: 6px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--fg); box-shadow: var(--sh); font: 600 13.5px/1.2 var(--ui); letter-spacing: 0; }
  .ctx-head { margin: 0 0 6px; padding: 6px 10px 8px; border-bottom: 2px dashed var(--rule); color: var(--muted); font: 700 11px var(--ui); letter-spacing: 0.08em; text-transform: uppercase; }
  .ctx-item { padding: 8px 10px; border-radius: 9px; }
  .ctx-item:hover, .ctx-item:focus { background: var(--y); color: var(--on); }
  .ctx-item.danger { color: var(--red-text); }
  .ctx-item.danger:hover, .ctx-item.danger:focus { background: var(--red); color: var(--on); }
  .ctx-kbd { padding: 2px 6px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--paper); color: var(--hi); font: 700 10.5px var(--ui); }
  .ctx-item:hover .ctx-kbd, .ctx-item:focus .ctx-kbd { color: var(--hi); }
  .ctx-sep { height: 2px; margin: 5px 4px; background: var(--rule); border-radius: 1px; }
  .ctx-foot { border-top: 2px dashed var(--rule); color: var(--muted); font: 600 11px var(--ui); }
  .more-count { top: 1px; min-width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 9px; background: var(--pink); color: var(--hi); font: 700 10px/14px var(--ui); }
  @media (max-width: 900px) {
    .sheet-tabs { gap: 8px; border-bottom: 2.5px dashed var(--rule); }
    .sheet-tabs-head { color: var(--muted); font: 700 11px var(--ui); letter-spacing: 0.1em; }
    .sheet-tab { min-height: 46px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--hi); font: 700 15px/1 var(--ui); letter-spacing: 0.02em; box-shadow: var(--sh-sm); }
    .sheet-tab.active { background: var(--y); color: var(--on); text-shadow: none; box-shadow: var(--sh-sm); }
    .sheet-tab-x { font: 700 20px/1 var(--ui); }
  }
}
