/* ==========================================================
   Ops Console — SWISS theme (a flat theme on theme-kit.css): the International Typographic Style.
   No boxes: content sits on the page under heavy black rules, with big lower-case headings and huge numbers in Inter,
   flush left, lots of white space. A red band at the top, red only for what matters (the active item, the main action,
   alerts). Text buttons underlined, black solid for the primary one, tabs underlined in red, square marks.
   Light = black on white paper; dark = off-white on near-black.
   ========================================================== */
@font-face { font-family: 'Inter'; src: url(/fonts/inter-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-500.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-700.woff2) format('woff2'); font-weight: 700 900; font-display: swap; }

/* ---------- light ---------- */
:root[data-theme="swiss"] {
  --cream: #ffffff;
  --paper: #ffffff;
  --fg: #111111;
  --hi: #000000;
  --ink: #111111;
  --on: #ffffff;
  --y: #e30613;
  --well: #f2f2f0;
  --blue: #1f5fbf; --red: #e30613; --green: #138a4a; --orange: #d97a00; --purple: #5b45c6; --mint: #0f8f80; --pink: #d0336f;
  --screen: #111111;
  --screen-fg: #f2f2f2;
  --k-bw-lg: 2px; --k-bw: 2px; --k-bw-sm: 1px; --k-bw-xs: 1px;
  --k-r: 0; --k-r-pill: 0; --k-move: 0;
  --sh-sm: none; --sh: none; --sh-lg: none; --sh-hover: none; --sh-hover-lg: none; --sh-press: none;
  --k-inset: none; --k-inset-on: none;
  --ui: 'Inter', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  --chart-line: #111111;
  --chart-alt: #e30613;
  --chart-font: 600 11px Inter, sans-serif;
  /* cursors: generated by tools/kit-cursors.mjs swiss */
  --cur-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='26' viewBox='0 0 24 26'%3E%3Cdefs%3E%3Cpath id='s' d='M3 3L20.5 12.2L12.3 13.8L9 22Z'/%3E%3C/defs%3E%3Cuse href='%23s' fill='%23ffffff' stroke='%23ffffff' stroke-width='2.6' stroke-linejoin='round'/%3E%3Cuse href='%23s' fill='%23111111'/%3E%3C/svg%3E") 3 3, default;
  --cur-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='%23e30613' stroke='%23ffffff' stroke-width='2'/%3E%3Crect x='10' y='10' width='4' height='4' fill='%23ffffff'/%3E%3C/svg%3E") 12 12, pointer;
  --cur-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='32' viewBox='0 0 20 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' fill='%23ffffff' stroke='%23ffffff' stroke-width='2.4' stroke-linejoin='miter'/%3E%3Cuse href='%23s' fill='%23111111'/%3E%3C/svg%3E") 10 16, text;
  color-scheme: light;
}

/* ---------- dark ---------- */
:root[data-theme="swiss"][data-mode="dark"] {
  --cream: #111111;
  --paper: #111111;
  --fg: #ededed;
  --hi: #ffffff;
  --ink: #ededed;
  --on: #ffffff;
  --y: #ff3b30;
  --well: #1c1c1c;
  --blue: #6ea0ff; --red: #ff3b30; --green: #4cc38a; --orange: #ffaa33; --purple: #a993ff; --mint: #4fd1c5; --pink: #ff6fa6;
  --chart-line: #ededed;
  --chart-alt: #ff3b30;
  --cur-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='26' viewBox='0 0 24 26'%3E%3Cdefs%3E%3Cpath id='s' d='M3 3L20.5 12.2L12.3 13.8L9 22Z'/%3E%3C/defs%3E%3Cuse href='%23s' fill='%23111111' stroke='%23111111' stroke-width='2.6' stroke-linejoin='round'/%3E%3Cuse href='%23s' fill='%23ededed'/%3E%3C/svg%3E") 3 3, default;
  --cur-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='%23ff3b30' stroke='%23111111' stroke-width='2'/%3E%3Crect x='10' y='10' width='4' height='4' fill='%23111111'/%3E%3C/svg%3E") 12 12, pointer;
  --cur-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='32' viewBox='0 0 20 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' fill='%23111111' stroke='%23111111' stroke-width='2.4' stroke-linejoin='miter'/%3E%3Cuse href='%23s' fill='%23ededed'/%3E%3C/svg%3E") 10 16, text;
  color-scheme: dark;
}

[data-theme="swiss"] {
  & body { font: 400 13.5px/1.45 var(--ui); letter-spacing: -0.01em; }

  /* the red band */
  .topbar { background: var(--y); color: #fff; border: 0; padding: 10px 18px; }
  .brand { font: 800 22px/1 var(--ui); letter-spacing: -0.04em; color: #fff; text-transform: lowercase; }
  .brand::before, .login-head::before { background: #fff; color: var(--y); border: 0; border-radius: 0; box-shadow: none; font-weight: 900; }
  .top-info span, .top-info span b { color: rgba(255, 255, 255, 0.85); }
  .top-info span b { color: #fff; }
  .clock { background: none; color: #fff; font: 800 16px/1 var(--ui); letter-spacing: -0.02em; padding: 0; }
  .topbar .btn { color: #fff; border-color: #fff; }
  .topbar .btn:hover { color: var(--y); background: #fff; }

  /* navigation: big type, a red square for the current item */
  .nav { background: var(--paper); border-right: 0; padding: 18px 16px; gap: 2px; }
  .nav a { font: 700 17px/1.15 var(--ui); letter-spacing: -0.025em; color: var(--fg); padding: 6px 0; border: 0; border-radius: 0; }
  .nav a kbd { order: 2; min-width: 0; padding: 0; margin-left: 4px; background: none; border: 0; box-shadow: none; color: var(--muted); font: 600 9.5px/1 var(--ui); align-self: flex-start; }
  .nav a:hover { background: none; color: var(--y); box-shadow: none; }
  .nav a.active { background: none; color: var(--y); box-shadow: none; }
  .nav a.active::after { content: ''; order: 3; margin-left: auto; width: 11px; height: 11px; background: var(--y); }
  .nav a.active kbd { color: var(--y); }
  .nav-gauges { border-top: 2px solid var(--ink); }
  .statusline { background: var(--paper); border-top: 2px solid var(--ink); font: 600 12px var(--ui); }
  .statusline .prompt { background: var(--y); color: #fff; border-radius: 0; }

  /* no boxes: heavy rules, big lower-case headings */
  .panel, .panel.agent-card.live { background: transparent; border: 0; border-top: 6px solid var(--ink); border-radius: 0; box-shadow: none; padding: 14px 0 6px; }
  .panel.agent-card.live { border-top-color: var(--green); }
  .panel > h2 { font: 800 21px/1.05 var(--ui); letter-spacing: -0.035em; text-transform: lowercase; margin-bottom: 16px; color: var(--hi); }
  .panel-flush > h2 { padding: 0 0 12px; }
  .panel.term-stage { border: 0; padding: 0; }

  /* buttons: underlined text; the main action black (red on hover) */
  .btn { background: none; color: var(--fg); border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; padding: 4px 1px 2px; font: 700 13px/1.25 var(--ui); letter-spacing: -0.01em; box-shadow: none; }
  .btn:hover, .btn:focus-visible { background: none; color: var(--y); border-bottom-color: var(--y); box-shadow: none; }
  .btn-primary, .btn.on, .btn-wide { background: var(--ink); color: var(--paper); border: 0; padding: 7px 14px; }
  .btn-primary:hover, .btn-primary:focus-visible, .btn-wide:hover { background: var(--y); color: #fff; }
  .btn-danger { color: var(--red); border-bottom-color: var(--red); background: none; }
  .btn-danger:hover, .btn-danger:focus-visible { background: var(--red); color: #fff; padding: 4px 6px 2px; }
  .btn-warn { color: var(--orange-text); border-bottom-color: var(--orange); background: none; }
  .btn-sm { font-size: 12px; padding: 2px 1px 1px; }
  .btn-primary.btn-sm { padding: 4px 9px; }
  .seg { background: none; border: 0; border-radius: 0; box-shadow: none; gap: 16px; }
  .seg button { padding: 4px 0; font: 700 13px var(--ui); letter-spacing: -0.01em; color: var(--muted); border-bottom: 3px solid transparent; }
  .seg button + button { border-left: 0; }
  .seg button:hover { background: none; color: var(--fg); }
  .seg button.on { background: none; color: var(--fg); border-bottom-color: var(--y); box-shadow: none; }
  .term-tab, .hx-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; box-shadow: none; font: 700 13px var(--ui); }
  .term-tab.active, .hx-tabs button.on { background: none; color: var(--fg); border-bottom-color: var(--y); transform: none; }

  /* fields: a grey band with a thick rule under it */
  .field, .search, .modal input[type=text], .hx-field input, .hx-field select, .launch input, .launch select, .hx-ask-side input,
  .pj-rem-form input, .sess-send input, .term-compose textarea, .hx-area, .hx-editor, & select {
    background: var(--well); border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; box-shadow: none;
  }
  .field:focus-within, .search:focus-within, .modal input[type=text]:focus, .hx-field input:focus, .hx-area:focus, .hx-editor:focus,
  .pj-rem-form input:focus, .sess-send input:focus, .term-compose textarea:focus, & select:focus { border-bottom-color: var(--y); box-shadow: none; transform: none; }
  .field span, .hx-field > span { font: 700 11px var(--ui); letter-spacing: 0; color: var(--fg); }
  .switch { background: var(--well); border: 2px solid var(--ink); border-radius: 0; }
  .switch i { background: var(--ink); border: 0; border-radius: 0; }
  .switch.on { background: var(--y); border-color: var(--y); }
  .switch.on i { background: #fff; }

  /* tables: bold header on a heavy rule, hairlines */
  .table th { background: none; color: var(--hi); font: 700 11.5px var(--ui); letter-spacing: 0; border-bottom: 2px solid var(--ink); }
  .table td { border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
  .table tbody tr:hover td { background: var(--well); }
  .table tbody tr.sel td, .table tbody tr.sel td b { background: var(--ink); color: var(--paper); }

  /* marks, gauges, numbers */
  .badge { background: none !important; border: 0; border-radius: 0; padding: 0; font: 700 11px/1.4 var(--ui); letter-spacing: 0; color: var(--fg); }
  .badge::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: currentColor; vertical-align: 0; }
  .badge.warn { color: var(--orange-text); }
  .state::before, .state.ok::before, .state.bad::before, .state.mid::before { content: '■'; font-size: 9px; }
  .state.off::before { content: '□'; }
  .bar { height: 6px; background: var(--well); border: 0; border-radius: 0; }
  .bar > i { background: var(--ink); box-shadow: none; }
  .bar.warn > i { background: var(--orange); }
  .bar.alert > i { background: var(--red); }
  .minibars i { background: var(--ink); border: 0; border-radius: 0; }
  .bignum { font: 800 66px/0.85 var(--ui); letter-spacing: -0.065em; }
  .bignum small { font-weight: 700; letter-spacing: -0.02em; }
  .sum-item .n, .hx-tile .n { font-weight: 800; letter-spacing: -0.05em; }
  .an-val, .pj-amount, .pj-name { font-weight: 800; letter-spacing: -0.04em; }
  .pj-group-title { font: 800 30px/1 var(--ui); letter-spacing: -0.045em; text-transform: lowercase; }
  .pj-group-rule { height: 6px; background: var(--ink); }
  .pj-group-count { background: var(--y); color: #fff; border: 0; border-radius: 0; }
  .sum-item, .hx-tile, .pj-card, .pj-bm-link, .theme-card, .sess-card, .alert-state {
    background: transparent; border: 0; border-top: 2px solid var(--ink); border-radius: 0; box-shadow: none;
  }
  .sum-item:hover, .pj-card:hover, .pj-card:focus-visible, .pj-bm-link:hover, .theme-card:hover { background: var(--well); transform: none; box-shadow: none; }
  .pj-card.alert { border-top: 6px solid var(--red); box-shadow: none; }
  .pj-card.warn { border-top: 6px solid var(--orange); }
  .theme-card.on { border-top: 6px solid var(--y); background: transparent; transform: none; box-shadow: none; }
  .pj-ev-dot { border-radius: 0; background: var(--ink); border: 0; box-shadow: none; }
  .pj-bm-mono { border: 0; border-radius: 0; box-shadow: none; color: #fff; }
  .modal { border: 0; border-top: 8px solid var(--y); border-radius: 0; box-shadow: 0 0 0 2px var(--ink); }
  .login-box { border: 0; border-top: 8px solid var(--y); border-radius: 0; box-shadow: none; background: var(--paper); }
  .login-title, .modal h3, .hx-title, .pj-name { letter-spacing: -0.04em; }
  .login-title { font-size: 34px; font-weight: 800; text-transform: lowercase; }
  .modal-back { background: color-mix(in srgb, var(--paper) 80%, transparent); }
  .chip { border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; }
  .chip:hover { background: none; color: var(--y); border-color: var(--y); }
  @media (max-width: 900px) {
    .tabbar { background: var(--paper); border-top: 2px solid var(--ink); }
    .tabbar .active b, .sheet a.active { background: none; color: var(--y); border-color: transparent; box-shadow: inset 0 3px 0 var(--y); }
    .brand { font-size: 18px; }
  }
}

/* lower case, like the headings */
[data-theme="swiss"] .nav-label { text-transform: lowercase; }

/* ---------- tabs and context menu: index words on a heavy rule, the active one underlined in red; a plain sheet ---------- */
[data-theme="swiss"] {
  .tabstrip { gap: 24px; padding: 12px 24px 0; background: var(--cream); border-bottom: 3px solid var(--ink); }
  .tab {
    height: 30px; margin-bottom: -3px; padding: 0; border: 0; border-bottom: 5px solid transparent; border-radius: 0;
    background: none; color: var(--muted); font: 700 14px/1 var(--ui); letter-spacing: -0.015em;
  }
  .tab .tl-view { text-transform: lowercase; }
  .tab:hover { background: none; color: var(--fg); }
  .tab.active { height: 30px; margin-bottom: -3px; background: none; color: var(--fg); border-bottom-color: var(--y); }
  .tab-x { width: 16px; color: var(--muted); font: 700 14px/1 var(--ui); }
  .tab-x:hover { background: none; color: var(--y); }
  .tab-new { width: 22px; height: 22px; margin: 0 0 7px; border: 0; border-radius: 0; background: var(--ink); color: var(--paper); font: 700 15px/1 var(--ui); }
  .tab-new:hover, .tab-new:focus-visible { border: 0; background: var(--y); color: #fff; }
  .tab.drop-before { box-shadow: -4px 0 0 var(--y); }
  .tab.drop-after { box-shadow: 4px 0 0 var(--y); }
  .tab:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }

  .ctx-menu {
    min-width: 240px; padding: 0 0 6px; border: 0; border-top: 6px solid var(--y); border-radius: 0; background: var(--paper);
    box-shadow: 0 0 0 2px var(--ink); font: 600 14px/1.2 var(--ui); letter-spacing: -0.01em;
  }
  .ctx-head { margin: 0 0 4px; padding: 10px 16px 9px; border-bottom: 2px solid var(--ink); color: var(--hi); font: 800 17px/1.1 var(--ui); letter-spacing: -0.03em; }
  .ctx-item { padding: 8px 16px; border-radius: 0; }
  .ctx-item:hover, .ctx-item:focus { background: none; color: var(--y); box-shadow: inset 6px 0 0 var(--y); }
  .ctx-item.danger { color: var(--red); }
  .ctx-item.danger:hover, .ctx-item.danger:focus { background: var(--red); color: #fff; box-shadow: none; }
  .ctx-kbd { font: 600 11px var(--ui); letter-spacing: 0; color: var(--muted); }
  .ctx-sep { height: 2px; margin: 4px 0; background: var(--ink); }
  .ctx-foot { margin: 4px 16px 0; padding: 6px 0 0; border-top: 0; color: var(--muted); font: 500 11px var(--ui); }
  .more-count { border-radius: 0; background: var(--y); color: #fff; font: 700 10px/16px var(--ui); }
  @media (max-width: 900px) {
    .sheet-tabs { gap: 0; border-bottom: 3px solid var(--ink); }
    .sheet-tab { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none; color: var(--fg); font: 700 18px/1 var(--ui); letter-spacing: -0.02em; }
    .sheet-tab .tl-view { text-transform: lowercase; }
    .sheet-tab.active { padding-left: 20px; background: none; color: var(--y); box-shadow: inset 6px 0 0 var(--y); }
  }
}

/* ---------- SETTINGS preview (shown in every theme) ---------- */
.tc-swiss { background: #ffffff; border: 1px solid #111111; border-radius: 0; }
.tc-swiss .tcp-top { background: #e30613; padding: 3px 6px; }
.tc-swiss .tcp-top b, .tc-swiss .tcp-top i { background: #ffffff; }
.tc-swiss b { background: #111111; }
.tc-swiss i { background: #d4d4d0; }
.tc-swiss .tcp-side i.on { background: #e30613; width: 60%; }
.tc-swiss .tcp-panel { background: transparent; border-top: 4px solid #111111; padding: 6px 0; }
.tc-swiss .tcp-btn { background: #111111; }
.tc-swiss.dark { background: #111111; border-color: #ededed; }
.tc-swiss.dark .tcp-top { background: #ff3b30; }
.tc-swiss.dark b, .tc-swiss.dark .tcp-btn { background: #ededed; }
.tc-swiss.dark i { background: #3a3a3a; }
.tc-swiss.dark .tcp-side i.on { background: #ff3b30; }
.tc-swiss.dark .tcp-panel { border-top-color: #ededed; }
