/* Market Desk - design tokens first, components after. Colours are roles, swapped per theme. */
:root {
  color-scheme: light;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3; --hover: #f3f5f8;
  --border: rgba(11, 11, 11, .10); --border-strong: rgba(11, 11, 11, .18);
  --ink: #191919; --ink-2: #5a616c; --ink-3: #868d97;
  --grid: #e7e7e7; --axis: #c2c2c2;
  --accent: #1f5fbf; --accent-soft: #e4edfa; --accent-ink: #ffffff;
  /* direction */
  --up: #008a17; --up-ink: #006c10; --up-soft: #e2f3e5;
  --down: #ec4647; --down-ink: #bd2628; --down-soft: #fde7e7;
  /* futures build-up: cool = bullish, warm = bearish */
  --bu-long: #008a17; --bu-cover: #257de0; --bu-short: #ec4647; --bu-unwind: #f2a600; --bu-neutral: #9aa1aa;
  --bu-long-ink: #ffffff; --bu-cover-ink: #ffffff; --bu-short-ink: #ffffff; --bu-unwind-ink: #0b0b0b;
  /* options: calls / puts */
  --call: #ec4647; --put: #008a17; --call-soft: #fde7e7; --put-soft: #e2f3e5;
  /* heat map ramp: 4 steps per arm around a neutral midpoint */
  --h-u1: #d5eed9; --h-u2: #97d4a1; --h-u3: #3ba651; --h-u4: #0a7421;
  --h-d1: #f9d9d9; --h-d2: #f0a1a1; --h-d3: #df5858; --h-d4: #b32a2a;
  --h-0: #e9eaec;
  --h-ink-lo: #191919; --h-ink-hi: #ffffff; --h-ink-max: #ffffff;
  --warn: #8a5a00; --warn-soft: #fff3d6;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
  --radius: 10px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10; --surface: #16191e; --surface-2: #1f232a; --hover: #1c2026;
  --border: rgba(255, 255, 255, .10); --border-strong: rgba(255, 255, 255, .2);
  --ink: #efefef; --ink-2: #a5abb5; --ink-3: #7b828c;
  --grid: #2b3038; --axis: #474d57;
  --accent: #6aabf1; --accent-soft: #1b2b40; --accent-ink: #0b0d10;
  /* dark steps chosen with the palette validator: green is lighter and red darker so the
     two stay apart for red-green colour-blind readers (all pairs pass on this surface) */
  --up: #39b772; --up-ink: #53c556; --up-soft: #12301a;
  --down: #d24d47; --down-ink: #f28b8b; --down-soft: #3a1a1b;
  --bu-long: #39b772; --bu-cover: #338ced; --bu-short: #d24d47; --bu-unwind: #c58d04; --bu-neutral: #6d747e;
  --bu-long-ink: #0b0b0b; --bu-cover-ink: #0b0b0b; --bu-short-ink: #ffffff; --bu-unwind-ink: #0b0b0b;
  --call: #d24d47; --put: #39b772; --call-soft: #3a1a1b; --put-soft: #12301a;
  --h-u1: #17301c; --h-u2: #1d5629; --h-u3: #218238; --h-u4: #33b955;
  --h-d1: #3a1a1b; --h-d2: #672324; --h-d3: #a13232; --h-d4: #e45c5c;
  --h-0: #2a2e35;
  --h-ink-lo: #efefef; --h-ink-hi: #ffffff; --h-ink-max: #0b0b0b;
  --warn: #f3c260; --warn-soft: #3a2e12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
}
/* Colour-blind friendly option: blue / red-orange instead of green / red */
:root[data-cvd="1"] {
  --up: #257de0; --up-ink: #1757ac; --up-soft: #e1edfb;
  --bu-long: #257de0; --bu-cover: #00b894; --bu-cover-ink: #0b0b0b; --put: #257de0; --put-soft: #e1edfb;
  --call: #f47230; --call-soft: #fde9df;
  --h-u1: #cce3fd; --h-u2: #84b9f3; --h-u3: #338ced; --h-u4: #1757ac;
}
:root[data-theme="dark"][data-cvd="1"] {
  --up: #338ced; --up-ink: #84b9f3; --up-soft: #14263c;
  --bu-long: #338ced; --bu-cover: #00a888; --put: #338ced; --put-soft: #14263c;
  --call: #e76624; --call-soft: #3a2114;
  --h-u1: #14263c; --h-u2: #1b4a86; --h-u3: #2370cd; --h-u4: #6aabf1;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up-ink); } .down { color: var(--down-ink); } .flat { color: var(--ink-2); }
.muted { color: var(--ink-2); } .small { font-size: 12px; } .xs { font-size: 11px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 52px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--ink); margin-right: 14px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.nav { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-btn {
  background: none; border: 0; padding: 0 12px; height: 100%; cursor: pointer; color: var(--ink-2); font-weight: 600;
  display: flex; align-items: center; gap: 5px; border-bottom: 2px solid transparent; border-top: 2px solid transparent;
}
.nav-btn:hover { color: var(--ink); text-decoration: none; }
.nav-item.active > .nav-btn { color: var(--accent); border-bottom-color: var(--accent); }
.nav-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 50;
}
.nav-item:hover .nav-menu, .nav-item:focus-within .nav-menu { display: block; }
.nav-menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.nav-menu a:hover, .nav-menu a.on { background: var(--accent-soft); text-decoration: none; }
.nav-menu a small { display: block; color: var(--ink-2); font-size: 11.5px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; letter-spacing: .03em; border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.badge.live .dot { background: var(--up); } .badge.demo { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.demo .dot { background: currentColor; } .badge.err { background: var(--down-soft); color: var(--down-ink); border-color: transparent; }
.badge.err .dot { background: currentColor; }

.ticker { background: var(--surface); border-bottom: 1px solid var(--border); display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.tick { padding: 7px 16px; border-right: 1px solid var(--border); white-space: nowrap; display: flex; flex-direction: column; min-width: max-content; color: inherit; }
.tick:hover { background: var(--hover); text-decoration: none; }
.tick .lbl { font-size: 11px; color: var(--ink-2); font-weight: 600; letter-spacing: .02em; }
.tick .val { font-weight: 650; font-size: 14px; }
.tick .chg { font-size: 12px; margin-left: 6px; font-weight: 600; }
.banner { padding: 7px 16px; font-size: 12.5px; background: var(--warn-soft); color: var(--warn); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.banner.err { background: var(--down-soft); color: var(--down-ink); }
.banner a { color: inherit; text-decoration: underline; font-weight: 600; }

main { max-width: 1560px; margin: 0 auto; padding: 16px 16px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.crumb { color: var(--ink-2); font-size: 13px; } .crumb b { color: var(--ink); font-weight: 650; }
.asof { margin-left: auto; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 6px 14px; border-radius: 6px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; background: var(--hover); }
.tabs a.on { background: var(--accent); color: var(--accent-ink); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 14px 16px; }
.card h3 { font-size: 13px; font-weight: 650; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- controls ---------- */
.filters { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.fl { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.input, .select {
  height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); padding: 0 10px;
  min-width: 0; color: var(--ink);
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input.search { width: 190px; padding-left: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23868d97' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 9px center; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 11px; height: 32px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--hover); color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.btn { height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--ink); border: 1px solid transparent; }
.chip .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chip.btnlike { cursor: pointer; border-color: var(--border); background: var(--surface); padding: 5px 10px; font-size: 12.5px; }
.chip.btnlike:hover { background: var(--hover); }
.chip.btnlike.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip.btnlike.off { opacity: .45; }
.chip.bull { background: var(--up-soft); color: var(--up-ink); } .chip.bear { background: var(--down-soft); color: var(--down-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag.ce { background: var(--call-soft); color: var(--ink); } .tag.pe { background: var(--put-soft); color: var(--ink); }
.sw-long { background: var(--bu-long); } .sw-cover { background: var(--bu-cover); } .sw-short { background: var(--bu-short); }
.sw-unwind { background: var(--bu-unwind); } .sw-neutral { background: var(--bu-neutral); } .sw-na { background: var(--surface-2); border: 1px dashed var(--border-strong); }
.sw-call { background: var(--call); } .sw-put { background: var(--put); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- stat tiles ---------- */
.stat { padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--ink-2); }
.stat .v { font-size: 20px; font-weight: 650; letter-spacing: -.01em; margin-top: 2px; }
.stat .d { font-size: 12px; margin-top: 1px; color: var(--ink-2); }
.hero { font-size: 48px; font-weight: 650; letter-spacing: -.02em; line-height: 1.05; }
.split-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface); }
.split-bar i { display: block; height: 100%; border-radius: 999px; min-width: 2px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius); }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.t th { position: sticky; top: 0; background: var(--surface); z-index: 2; text-align: right; font-weight: 600; color: var(--ink-2); font-size: 11.5px; letter-spacing: .02em; padding: 9px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; user-select: none; }
.t th.l, .t td.l { text-align: left; } .t th.c, .t td.c { text-align: center; }
.t th[data-sort] { cursor: pointer; } .t th[data-sort]:hover { color: var(--ink); }
.t th .arr { font-size: 9px; margin-left: 3px; opacity: .9; }
.t td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t tbody tr:hover td { background: var(--hover); }
.t tr.click { cursor: pointer; }
.t .sym { font-weight: 650; color: var(--ink); }
.t .sub { color: var(--ink-2); font-size: 11.5px; font-weight: 400; }
.cellbar { position: relative; }
.cellbar i { position: absolute; top: 5px; bottom: 5px; border-radius: 3px; opacity: .22; pointer-events: none; }
.cellbar.r i { right: 4px; } .cellbar.lft i { left: 4px; }
.cellbar span { position: relative; }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.stale { opacity: .6; transition: opacity .2s; }

/* ---------- treemap ---------- */
.tm { position: relative; width: 100%; height: 620px; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tm-tile { position: absolute; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; overflow: hidden; font-weight: 700; }
.tm-tile:hover, .tm-tile:focus-visible { filter: brightness(1.12) saturate(1.1); z-index: 3; outline: 2px solid var(--ink); outline-offset: -2px; }
.tm-tile .s { letter-spacing: .01em; } .tm-tile .s.w { word-break: break-all; line-height: 1.05; padding: 0 2px; } .tm-tile .p { font-weight: 600; opacity: .95; } .tm-tile .x { font-weight: 500; opacity: .9; }
.tm-group { position: absolute; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.bu-LONG { background: var(--bu-long); color: var(--bu-long-ink); } .bu-SHORT_COVER { background: var(--bu-cover); color: var(--bu-cover-ink); }
.bu-SHORT { background: var(--bu-short); color: var(--bu-short-ink); } .bu-LONG_UNWIND { background: var(--bu-unwind); color: var(--bu-unwind-ink); }
.bu-NEUTRAL { background: var(--bu-neutral); color: #fff; } .bu-NA { background: var(--surface-2); color: var(--ink-2); }
.h-u1 { background: var(--h-u1); color: var(--h-ink-lo); } .h-u2 { background: var(--h-u2); color: var(--h-ink-lo); }
.h-u3 { background: var(--h-u3); color: var(--h-ink-hi); } .h-u4 { background: var(--h-u4); color: var(--h-ink-max); }
.h-d1 { background: var(--h-d1); color: var(--h-ink-lo); } .h-d2 { background: var(--h-d2); color: var(--h-ink-lo); }
.h-d3 { background: var(--h-d3); color: var(--h-ink-hi); } .h-d4 { background: var(--h-d4); color: var(--h-ink-max); }
.h-0 { background: var(--h-0); color: var(--ink); }
.ramp { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.ramp i { width: 22px; height: 10px; display: inline-block; }
.ramp .steps { display: inline-flex; gap: 2px; }

/* ---------- tooltip + drawer ---------- */
#tip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; max-width: 300px; display: none; }
#tip .tt { font-weight: 700; margin-bottom: 3px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
#tip table { border-collapse: collapse; } #tip td { padding: 1px 0; } #tip td:first-child { color: var(--ink-2); padding-right: 14px; } #tip td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
#tip .key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.scrim { position: fixed; inset: 0; background: rgba(8, 10, 14, .38); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); z-index: 61; box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 10px; }
.drawer-body { padding: 14px 16px 24px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.kv > div > span:first-child { display: block; font-size: 11.5px; color: var(--ink-2); } .kv div b { font-weight: 650; font-variant-numeric: tabular-nums; }
.range { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); margin: 6px 0 2px; }
.range i { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); transform: translateX(-50%); }
.sect-title { font-size: 11.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .05em; text-transform: uppercase; }

/* ---------- charts ---------- */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 11px system-ui, sans-serif; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .gridl { stroke: var(--grid); stroke-width: 1; } .chart .axisl { stroke: var(--axis); stroke-width: 1; }
.chart .band { fill: transparent; } .chart .band.on { fill: var(--ink); fill-opacity: .06; }
.chart .mark-line { stroke: var(--ink); stroke-width: 1; }
.chart .mark-lbl { fill: var(--ink); font-weight: 650; }
.spark { display: block; }

/* ---------- screen specific ---------- */
.lists4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.olist-head { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.olist-head .code { width: 26px; height: 22px; border-radius: 5px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; }
.olist-head.bull { border-top: 3px solid var(--up); border-radius: var(--radius) var(--radius) 0 0; }
.olist-head.bear { border-top: 3px solid var(--down); border-radius: var(--radius) var(--radius) 0 0; }
.olist-head.bull .code { background: var(--up-soft); color: var(--up-ink); } .olist-head.bear .code { background: var(--down-soft); color: var(--down-ink); }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); align-items: center; cursor: pointer; }
.orow:hover { background: var(--hover); } .orow:last-child { border-bottom: 0; }
.orow .s { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .orow .r { text-align: right; }
.orow .sub { grid-column: 1; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.pos { display: block; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; border: 2px solid currentColor; }
.st-solid .status-dot { background: currentColor; } .st-half .status-dot { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.st-up { color: var(--up-ink); } .st-down { color: var(--down-ink); } .st-none { color: var(--ink-3); }
.st-lbl { color: var(--ink); font-weight: 650; }
.count-tile { text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.count-tile:hover { background: var(--hover); } .count-tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.count-tile .n { display: block; font-size: 24px; font-weight: 650; line-height: 1.15; margin-bottom: 4px; color: var(--ink); }
.count-tile .d { font-size: 11.5px; color: var(--ink-2); margin-top: 5px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; border-radius: 3px; }
.sig-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 12px; align-items: start; }
.sig-list { max-height: calc(100vh - 250px); overflow: auto; }
.sig-row { padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.sig-row:hover { background: var(--hover); } .sig-row.on { background: var(--accent-soft); }
.sig-group { padding: 8px 12px; font-size: 12px; font-weight: 700; background: var(--surface-2); display: flex; justify-content: space-between; position: sticky; top: 0; z-index: 1; }
.oc td, .oc th { padding: 6px 8px; }
.oc td.k { text-align: center; font-weight: 700; background: var(--surface-2); position: sticky; left: 0; z-index: 1; }
.oc th.k { text-align: center; }
.oc tr.itm-c td.c-side, .oc tr.itm-p td.p-side { background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.oc tr.atm td { border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.oc .grp th { text-align: center; font-size: 12px; color: var(--ink); }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; padding-left: 30px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 21px; height: 21px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.log { font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; max-height: 220px; overflow: auto; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.log .error { color: var(--down-ink); } .log .warn { color: var(--warn); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(360px, 100%); padding: 24px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
label.field .input { height: 38px; font-weight: 400; }

/* ---------- mobile ---------- */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .lists4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sig-layout { grid-template-columns: 1fr; } .sig-list { max-height: 420px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .topbar { padding: 0 12px; height: 48px; }
  main { padding: 12px 10px 84px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .lists4 { grid-template-columns: 1fr; }
  .tm { height: 68vh; min-height: 380px; }
  .hero { font-size: 40px; }
  .input.search { width: 150px; }
  .asof { width: 100%; margin-left: 0; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
  .tabbar a.on { color: var(--accent); } .tabbar a:hover { text-decoration: none; }
  .drawer { width: 100vw; }
  .t td, .t th { padding: 7px 8px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
