/* Parity — design system (V3: density pass).
   Deep-navy terminal chrome over a cool light workspace; the scanner table fills the viewport.
   Colour is semantic: green = gain/credit/return, red = loss, blue = strikes,
   violet = curve distance, amber = closed/attention, navy/indigo = brand. */
:root {
  --navy-950: #070f24; --navy-900: #0b1736; --navy-800: #12214a;
  --ink: #0f1b3d; --ink-2: #334166; --muted: #64748b; --faint: #94a3b8;
  --page: #eef2f8; --card: #ffffff; --line: #e3e8f1; --line-2: #eef1f7; --hover: #eef3ff;
  --brand: #4f46e5; --brand-2: #6366f1; --brand-soft: #eef0ff;
  --up: #16a34a; --up-ink: #0e7a37; --up-soft: #e8f7ee;
  --dn: #dc2626; --dn-ink: #b91c1c; --dn-soft: #fdecec;
  --amber: #d97706; --amber-soft: #fff4e2;
  --strike: #1d4ed8; --gap: #7c3aed;
  --shadow: 0 1px 2px rgba(15,27,61,.05), 0 6px 20px rgba(15,27,61,.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;
  --field: #ffffff; --field-2: #f8fafd; --thead: #f5f7fc; --thead-2: #fafbfe; --row-alt: #fbfcfe; --row-sel: #e8ecff;
  --chip: #f1f4fa; --rk3: #f4f5ff; --box-line: #c3cad8; --rom-strong: #0b5a2a; --sk1: #eef1f6; --sk2: #f7f9fc;
  color-scheme: light;
  --row: 29px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--page); color: var(--ink); height: 100%; }
body { font: 12.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1, 'cv11' 1;
  display: flex; flex-direction: column; overflow: hidden; }
button, select, input { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .dn { color: var(--dn); }
.hidden { display: none !important; }

/* ================================================================ HEADER */
.hdr { flex: none; z-index: 30; color: #e7ecf8; border-bottom: 1px solid rgba(255,255,255,.06);
  background: radial-gradient(900px 220px at 0% 0%, rgba(99,102,241,.28), transparent 60%),
              linear-gradient(180deg, var(--navy-900), var(--navy-950)); }
.hdr-in { display: flex; align-items: center; gap: 16px; padding: 9px 22px; flex-wrap: wrap; row-gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: 4px; }
.brand img { width: 32px; height: 32px; filter: drop-shadow(0 4px 10px rgba(79,70,229,.45)); }
.brand b { display: block; font-size: 16px; font-weight: 800; letter-spacing: .22em; color: #fff; line-height: 1.1; }
.brand small { display: block; font-size: 10px; color: #93a3c9; margin-top: 2px; white-space: nowrap; }
.hgroup { display: flex; flex-direction: column; gap: 3px; }
.hlabel { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8193bd; }
.spacer { flex: 1; }

.exp-select { position: relative; }
.exp-select select { appearance: none; -webkit-appearance: none; cursor: pointer; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 8px; padding: 5px 30px 5px 11px;
  font-weight: 650; font-size: 12.5px; transition: border-color .15s, background .15s; }
.exp-select select:hover { border-color: rgba(129,140,248,.7); background: rgba(255,255,255,.09); }
.exp-select select option { color: var(--ink); }
.exp-select::after { content: ''; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 2px solid #a5b4fc; border-bottom: 2px solid #a5b4fc; transform: rotate(45deg); pointer-events: none; }

.seg { display: inline-flex; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; color: #b8c4e3; padding: 4px 12px; border-radius: 7px; cursor: pointer;
  font-weight: 700; font-size: 12.5px; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover:not(.on) { background: rgba(255,255,255,.08); color: #fff; }
.seg button.on { background: linear-gradient(180deg, #6366f1, #4f46e5); color: #fff; box-shadow: 0 2px 10px rgba(79,70,229,.55), inset 0 1px 0 rgba(255,255,255,.2); }

.idx { display: flex; flex-direction: column; gap: 0; padding: 4px 10px; border-radius: 9px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); }
.idx .hlabel { display: flex; justify-content: space-between; gap: 8px; }
.idx .tag { font-size: 7.5px; letter-spacing: .08em; color: #8193bd; }
.idx .tag.live { color: #4ade80; }
.idx-row { display: flex; align-items: baseline; gap: 7px; }
.idx-v { font: 700 14px var(--mono); color: #fff; }
.idx-c { font: 600 10.5px var(--mono); }
.idx-c.up { color: #4ade80; } .idx-c.dn { color: #f87171; }

.mkt { display: flex; flex-direction: column; gap: 2px; padding-left: 4px; }
.mkt-state { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 11.5px; letter-spacing: .08em; white-space: nowrap; }
.mkt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.mkt.open .mkt-state { color: #4ade80; }
.mkt.open .mkt-dot { background: #22c55e; animation: pulse 2s infinite; }
.mkt.closed .mkt-state { color: #fbbf24; }
.mkt.closed .mkt-dot { background: #f59e0b; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.mkt-time { font: 600 11px var(--mono); color: #c7d2ee; white-space: nowrap; }
.mkt-time .clk { color: #fff; }
.mkt-time .dim { color: #7d8db4; }
.lat { display: flex; flex-direction: column; gap: 2px; cursor: help; padding-left: 12px; flex: none; border-left: 1px solid rgba(255,255,255,.08); }
.lat-v { font: 700 12.5px var(--mono); color: #fde68a; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.lat-v svg { width: 11px; height: 11px; fill: #fbbf24; }

.auth { display: flex; align-items: center; gap: 8px; }
.auth:empty { display: none; }
.auth .who { font-size: 11px; font-weight: 700; color: #93a3c9; white-space: nowrap; letter-spacing: .02em; }
.auth .who.admin { color: #a5b4fc; }
.auth-btn { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: #fff; border-radius: 8px;
  padding: 4px 10px; font-weight: 700; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.auth-btn:hover { border-color: rgba(129,140,248,.8); background: rgba(99,102,241,.25); }
.seg.ro button, .exp-select.ro select { cursor: not-allowed; opacity: .55; }
.seg.ro button.on { opacity: .85; }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(7,15,36,.55); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(520px, 100%); background: var(--card); border-radius: 14px; box-shadow: 0 20px 60px rgba(7,15,36,.35); padding: 18px 20px 20px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; }
.modal-h b { font-size: 15px; letter-spacing: .02em; }
.modal-x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-sub { color: var(--muted); margin: 4px 0 14px; }
.adm-add { display: flex; gap: 8px; }
.adm-add input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--field); color: var(--ink); }
.adm-add input:focus { outline: 0; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.btn-pri { border: 0; background: linear-gradient(180deg, #6366f1, #4f46e5); color: #fff; font-weight: 700; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
.adm-msg { min-height: 18px; margin: 8px 0 4px; font-size: 12px; color: var(--up-ink); }
.adm-msg.err { color: var(--dn-ink); }
.adm-list { border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow: auto; }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.adm-row:last-child { border-bottom: 0; }
.adm-mail { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.adm-by { color: var(--faint); font-size: 11px; white-space: nowrap; }
.adm-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }

.theme-tg { display: flex; align-items: flex-end; align-self: flex-end; padding-bottom: 1px; }
.theme-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
  display: grid; place-items: center; cursor: pointer; transition: border-color .15s, background .15s; }
.theme-btn:hover { border-color: rgba(129,140,248,.7); background: rgba(255,255,255,.1); }
.theme-btn svg { width: 15px; height: 15px; fill: none; stroke: #fde68a; stroke-width: 2; stroke-linecap: round; }

/* ---------------------------------------------------------------- WHITE THEME (header + movers) */
:root[data-theme='light'] .hdr { background: #ffffff; color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15,27,61,.05); }
:root[data-theme='light'] .brand b { color: var(--ink); }
:root[data-theme='light'] .brand small, :root[data-theme='light'] .hlabel { color: var(--muted); }
:root[data-theme='light'] .exp-select select { background: #f6f8fc; border-color: var(--line); color: var(--ink); }
:root[data-theme='light'] .exp-select select:hover { border-color: #c7cdf9; background: #fff; }
:root[data-theme='light'] .exp-select::after { border-color: var(--brand); }
:root[data-theme='light'] .seg { background: #f1f4fa; border-color: var(--line); }
:root[data-theme='light'] .seg button { color: var(--ink-2); }
:root[data-theme='light'] .seg button:hover:not(.on) { background: #e6eaf4; color: var(--ink); }
:root[data-theme='light'] .seg button.on { color: #fff; }
:root[data-theme='light'] .theme-btn { background: #f1f4fa; border-color: var(--line); }
:root[data-theme='light'] .theme-btn svg { stroke: var(--brand); }
:root[data-theme='light'] .idx { background: #f7f9fd; border-color: var(--line); }
:root[data-theme='light'] .idx .tag { color: var(--faint); }
:root[data-theme='light'] .idx .tag.live { color: var(--up); }
:root[data-theme='light'] .idx-v { color: var(--ink); }
:root[data-theme='light'] .idx-c.up { color: var(--up); } :root[data-theme='light'] .idx-c.dn { color: var(--dn); }
:root[data-theme='light'] .mkt.open .mkt-state { color: var(--up); }
:root[data-theme='light'] .mkt.closed .mkt-state { color: var(--amber); }
:root[data-theme='light'] .mkt-time { color: var(--ink-2); }
:root[data-theme='light'] .mkt-time .clk { color: var(--ink); }
:root[data-theme='light'] .mkt-time .dim { color: var(--faint); }
:root[data-theme='light'] .lat { border-left-color: var(--line); }
:root[data-theme='light'] .lat-v { color: #b45309; }
:root[data-theme='light'] .lat-v svg { fill: #d97706; }
:root[data-theme='light'] .auth .who { color: var(--muted); }
:root[data-theme='light'] .auth-btn { background: #f1f4fa; border-color: var(--line); color: var(--ink); }
:root[data-theme='light'] .auth-btn:hover { background: var(--brand-soft); border-color: #c7cdf9; color: var(--brand); }
:root[data-theme='light'] .movers { background: #f7f9fd; color: var(--ink); border-bottom: 1px solid var(--line); }
:root[data-theme='light'] .mv-row + .mv-row { border-top-color: var(--line-2); }
:root[data-theme='light'] .mv-lbl { background: #eef2f8; border-right-color: var(--line); }
:root[data-theme='light'] .mv-lbl.g { color: var(--up); } :root[data-theme='light'] .mv-lbl.l { color: var(--dn); }
:root[data-theme='light'] .mv .s { color: var(--ink); }
:root[data-theme='light'] .mv .p { color: var(--muted); }
:root[data-theme='light'] .mv .c.up { color: var(--up); } :root[data-theme='light'] .mv .c.dn { color: var(--dn); }

/* ================================================================ MOVERS (2 static rows) */
.movers { flex: none; background: linear-gradient(180deg, #101e44, #0d1939); color: #dbe3f7; border-bottom: 1px solid rgba(255,255,255,.06); }
.mv-row { display: flex; align-items: center; height: 30px; overflow-x: auto; scrollbar-width: none; }
.mv-row + .mv-row { border-top: 1px solid rgba(255,255,255,.05); }
.mv-row::-webkit-scrollbar { display: none; }
.mv-lbl { flex: none; width: 82px; display: flex; align-items: center; gap: 4px; padding: 0 10px; height: 100%; white-space: nowrap;
  font-size: 9px; font-weight: 800; letter-spacing: .12em; background: rgba(255,255,255,.04); border-right: 1px solid rgba(255,255,255,.07); }
.mv-lbl.g { color: #4ade80; } .mv-lbl.l { color: #f87171; }
.mv-items { display: flex; align-items: center; flex: 1; justify-content: space-between; padding: 0 4px; gap: 0; min-width: max-content; }
.mv { display: inline-flex; align-items: baseline; gap: 3px; padding: 0 3px; white-space: nowrap; font-size: 10.5px; }
.mv .r { font: 600 9px var(--mono); color: #6f80aa; }
.mv .s { font-weight: 750; color: #fff; }
.mv .p { font: 500 10px var(--mono); color: #aeb9d6; }
.mv .c { font: 700 10px var(--mono); }
.mv .c.up { color: #4ade80; } .mv .c.dn { color: #fb7185; }
.mv-state { margin-left: 2px; font-size: 8px; letter-spacing: .1em; color: #8193bd; font-weight: 700; }

/* ================================================================ BANNERS */
.banner { display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 12px; font-weight: 600; }
.banner.err { background: var(--dn-soft); color: var(--dn-ink); border-bottom: 1px solid var(--line); }
.banner.warn { background: var(--amber-soft); color: var(--warn-ink, #8a4b05); border-bottom: 1px solid var(--line); }
.banner button { margin-left: auto; border: 1px solid currentColor; background: var(--field); border-radius: 6px; padding: 2px 9px; cursor: pointer; font-weight: 700; color: inherit; }

/* ================================================================ WORKSPACE */
.wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 22px 16px; gap: 10px; }
.board { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }

/* compact summary + controls strip (one line) */
.strip { flex: none; display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.strip > * { flex: none; }
.strip > .spacer { flex: 1 1 auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill .mkt-dot { width: 6px; height: 6px; }
.pill.live { background: var(--up-soft); color: var(--up-ink); } .pill.live .mkt-dot { background: var(--up); animation: pulse 2s infinite; }
.pill.closed { background: var(--amber-soft); color: #92530a; } .pill.closed .mkt-dot { background: var(--amber); }
.pill.busy { background: var(--brand-soft); color: var(--brand); } .pill.busy .mkt-dot { background: var(--brand); }
.pill.stale { background: var(--dn-soft); color: var(--dn-ink); } .pill.stale .mkt-dot { background: var(--dn); }
.kpi { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.kpi .k { font-size: 9px; font-weight: 800; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.kpi .v { font-weight: 800; font-size: 13px; color: var(--ink); }
.kpi .v small { font-weight: 600; color: var(--faint); font-size: 11px; }
.kpi .mini { width: 56px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.kpi .mini i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--brand)); transition: width .4s; }
.vsep { width: 1px; height: 18px; background: var(--line); }
.strip .tools { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.search { position: relative; }
.search svg { position: absolute; left: 9px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; stroke: var(--faint); fill: none; stroke-width: 2.2; }
.search input { width: 190px; border: 1px solid var(--line); background: var(--field-2); border-radius: 8px; padding: 4px 24px 4px 28px;
  font-weight: 600; letter-spacing: .03em; transition: border-color .15s, box-shadow .15s, background .15s; }
.search input::placeholder { font-weight: 500; letter-spacing: 0; color: var(--faint); }
.search input:focus { outline: 0; border-color: var(--brand-2); background: var(--field); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.search .clear { position: absolute; right: 5px; top: 50%; margin-top: -8px; width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: var(--line); color: var(--muted); cursor: pointer; font-size: 11px; line-height: 16px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; padding: 3px 9px 3px 6px;
  border: 1px solid var(--line); border-radius: 8px; font-weight: 600; color: var(--ink-2); background: var(--field); white-space: nowrap; }
.toggle:hover { border-color: #c7cdf9; }
.toggle input { display: none; }
.toggle .box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--box-line); display: grid; place-items: center; }
.toggle .box svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.toggle.on { background: var(--brand-soft); border-color: #c7cdf9; color: var(--brand); }
.toggle.on .box { background: var(--brand); border-color: var(--brand); }
.toggle.on .box svg { opacity: 1; }
.btn-sm { border: 1px solid var(--line); background: var(--field); border-radius: 8px; padding: 3px 9px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.btn-sm.active { color: var(--brand); border-color: #c7cdf9; background: var(--brand-soft); }
.btn-sm:disabled { opacity: .55; cursor: default; }
.presets { display: inline-flex; align-items: center; gap: 6px; }
.pre-sel { border: 1px solid var(--line); background: var(--field); border-radius: 8px; padding: 3px 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; max-width: 200px; }
.pre-new { display: inline-flex; gap: 5px; }
.pre-name { border: 1px solid var(--brand-2); border-radius: 8px; padding: 3px 8px; width: 170px; background: var(--field); color: var(--ink); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.pre-name:focus { outline: 0; }
.ctl-note { color: var(--muted); white-space: nowrap; }
.ctl-note b { color: var(--ink); }

/* ================================================================ TABLE */
.tbl { flex: 1; min-height: 0; overflow: auto; position: relative; }
.tbl.stale tbody { filter: grayscale(.85); opacity: .65; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1080px; }
thead th { position: sticky; z-index: 3; background: var(--thead); padding: 0 8px; font-size: 9.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: #5a6788; text-align: center; white-space: nowrap; user-select: none; }
thead tr.h th { top: 0; height: 32px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
thead tr.f th { top: 32px; height: 32px; cursor: default; border-bottom: 1px solid var(--line); background: var(--thead-2); }
thead th.l { text-align: left; }
thead tr.h th:hover { color: var(--brand); }
thead th.on { color: var(--brand); }
thead th .ar { display: inline-block; width: 9px; margin-left: 2px; }
thead th.c-rom, thead th.c-mrom { color: var(--up-ink); }
.flt { display: inline-flex; gap: 3px; justify-content: center; align-items: center; position: relative; }
.flt input { width: 42px; height: 21px; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font: 600 10.5px var(--font);
  text-align: center; background: var(--field); color: var(--ink); letter-spacing: 0; text-transform: none; }
.flt input.w { width: 56px; }
.flt input.q { width: 104px; text-align: left; padding: 0 7px; font-weight: 700; letter-spacing: .03em; }
.fx { width: 14px; height: 14px; border: 0; border-radius: 50%; background: transparent; color: transparent; font: 700 12px/15px var(--font);
  cursor: pointer; flex: none; padding: 0; visibility: hidden; }
.fx.on { visibility: visible; background: var(--brand-soft); color: var(--brand); }
.fx.on:hover { background: var(--brand); color: #fff; }
.bst { display: inline-grid; place-items: center; cursor: pointer; }
.bst input { display: none; }
.bst .box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--box-line); display: grid; place-items: center; background: var(--field); transition: all .15s; }
.bst .box svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.bst input:checked + .box { background: var(--brand); border-color: var(--brand); }
.bst input:checked + .box svg { opacity: 1; }
.flt input::placeholder { color: #b6bfd0; font-weight: 500; }
.flt input:focus { outline: 0; border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(99,102,241,.15); }
.flt input.set { border-color: var(--brand-2); background: var(--brand-soft); }
tbody td { height: var(--row); padding: 0 8px; border-bottom: 1px solid var(--line-2); text-align: center; white-space: nowrap; font-size: 12.5px; }
tbody td.l, thead th.l { padding-left: 16px; }
tbody td.l { text-align: left; }
tbody tr.row:nth-child(even) td { background: var(--row-alt); }
tbody tr.row:hover td { background: var(--hover); }
tbody tr.row:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand-2); }
tbody tr.row.sel td { background: var(--row-sel); }
tbody tr.row.sel td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.rk { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 4px; border-radius: 5px; font: 700 10.5px var(--mono); color: var(--muted); }
.rk.r1 { background: linear-gradient(180deg, #6366f1, #4338ca); color: #fff; }
.rk.r2 { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px #c7cdf9; }
.rk.r3 { background: var(--rk3); color: #5b5fe0; box-shadow: inset 0 0 0 1px #dde0fb; }
.stk { font-weight: 800; letter-spacing: .02em; color: var(--ink); }
.stk .tri { font-size: 7px; margin-left: 4px; vertical-align: 1px; }
.lot { font-weight: 600; color: var(--ink-2); }
.v { font-weight: 650; color: var(--ink); }
.s { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.s.up { color: var(--up-ink); } .s.dn { color: var(--dn-ink); }
.al { display: inline-grid; grid-auto-flow: column; align-items: baseline; column-gap: 5px; font-variant-numeric: tabular-nums; }
.al > :first-child { text-align: right; }
.al > :nth-child(2) { text-align: left; }
.al > :nth-child(3) { text-align: right; }
.al .s, .al .pr { margin-left: 0; }
.a-lot { grid-template-columns: 6.5ch; }
.a-ltp { grid-template-columns: 9ch 8.5ch; }
.a-stk { grid-template-columns: 6.5ch 7.5ch 5.5ch; }
.a-gap { grid-template-columns: 5.5ch 8ch; }
.a-one { grid-template-columns: 7ch; }
.pr { font-size: 10px; font-weight: 600; color: var(--muted); margin-left: 5px; padding: 0 4px; border-radius: 3px; background: var(--chip); }
.sk-b { font-weight: 800; color: var(--strike); }
.sk-b.far { color: #1e40af; }
.gapv { font-weight: 800; color: var(--gap); }
.cred { font-weight: 800; color: var(--up-ink); background: var(--up-soft); padding: 1px 7px; border-radius: 5px; }
.marg { font-weight: 700; color: var(--ink-2); }
.marg.pend { color: var(--faint); font-weight: 600; font-style: italic; }
.rom { display: inline-block; min-width: 56px; padding: 1px 7px; border-radius: 5px; font-weight: 850; color: var(--up-ink); }
.mrom { font-weight: 750; color: var(--up); }
.na { color: var(--faint); }
td.flash-up, .pr.flash-up { animation: flashUp 1s ease-out; }
td.flash-dn, .pr.flash-dn { animation: flashDn 1s ease-out; }
.pr.flash-up { color: var(--up-ink); } .pr.flash-dn { color: var(--dn-ink); }
@keyframes flashUp { from { background: rgba(22,163,74,.22); } to { background: transparent; } }
@keyframes flashDn { from { background: rgba(220,38,38,.2); } to { background: transparent; } }
.sk td { height: var(--row); }
.sk span { display: inline-block; height: 9px; border-radius: 4px; background: linear-gradient(90deg, var(--sk1) 25%, var(--sk2) 50%, var(--sk1) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 4px; }

/* ================================================================ SPLASH */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(900px 500px at 30% 20%, rgba(99,102,241,.25), transparent 60%), linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #dbe3f7; transition: opacity .4s; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-in { text-align: center; width: 320px; }
.splash img { width: 64px; height: 64px; filter: drop-shadow(0 10px 30px rgba(79,70,229,.6)); }
.splash h2 { font-size: 22px; letter-spacing: .3em; font-weight: 800; color: #fff; margin-top: 16px; }
.splash p { color: #8fa0c9; margin: 6px 0 22px; font-size: 12.5px; }
.steps { list-style: none; text-align: left; display: grid; gap: 9px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #6c7da8; }
.steps li .ic { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #34437a; flex: none; }
.steps li.done { color: #a7f3c9; } .steps li.done .ic { background: #22c55e; border-color: #22c55e; }
.steps li.now { color: #fff; font-weight: 600; } .steps li.now .ic { border-color: #818cf8; border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================ RESPONSIVE */
@media (max-width: 1440px) {
  .hdr-in { gap: 10px; padding: 9px 16px; }
  .idx { padding: 4px 8px; }
  .idx .hlabel { gap: 5px; }
  .lat { padding-left: 9px; }
  .seg button { padding: 4px 10px; }
  .auth { gap: 6px; }
  .auth-btn { padding: 4px 8px; }
}
@media (max-width: 1280px) {
  .brand small { display: none; }
  .strip { gap: 12px; }
  .kpi .mini, .vsep { display: none; }
  .kpi .k { letter-spacing: .06em; }
}
@media (max-width: 900px) {
  body { overflow: auto; display: block; height: auto; }
  .wrap { display: block; }
  .board { display: block; }
  .tbl { height: 75vh; }
  .strip .tools { margin-left: 0; }
}

/* ================================================================ NIGHT THEME (default): everything dark */
:root:not([data-theme='light']) {
  color-scheme: dark;
  --page: #0a1226; --card: #0f1a33; --line: #22304f; --line-2: #18233f; --hover: #17264b;
  --ink: #e6ecf8; --ink-2: #bcc7e0; --muted: #8b99ba; --faint: #63719a;
  --brand: #8b93ff; --brand-2: #818cf8; --brand-soft: rgba(99,102,241,.2);
  --up: #34d399; --up-ink: #6ee7b7; --up-soft: rgba(52,211,153,.14);
  --dn: #f87171; --dn-ink: #fca5a5; --dn-soft: rgba(248,113,113,.14);
  --amber: #fbbf24; --amber-soft: rgba(251,191,36,.13); --warn-ink: #fde68a;
  --strike: #8db4ff; --gap: #c4a5ff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --field: #0b1530; --field-2: #0b1530; --thead: #12203f; --thead-2: #0e1a36; --row-alt: #0d1731; --row-sel: #1e2c5c;
  --chip: #18264a; --rk3: rgba(99,102,241,.14); --box-line: #3a4a70; --rom-strong: #d1fae5; --sk1: #142142; --sk2: #1b2b52;
}
:root:not([data-theme='light']) .sk-b.far { color: #a9c4ff; }
:root:not([data-theme='light']) .modal { background: rgba(0,0,0,.6); }
:root:not([data-theme='light']) .pill.closed { color: #fcd34d; }
:root:not([data-theme='light']) .cred { color: #86efac; }
