/* FitTrader desktop UI ("desk") — shared design system for every desktop page.
   theme.js stamps data-theme on <html>; dark is the default palette.
   Layout: fixed left rail (nav) + top status bar; each page is a dense grid of panels on a quiet slate ground.
   Colour is reserved for state: up/down for P&L, amber for warnings and paper mode, red for live/halt. */
:root {
  --font-ui: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-num: "Geist Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  /* dark (default) */
  --bg: #0a0d12;
  --surface: #10141b;
  --surface-2: #151a23;
  --surface-3: #1b212c;
  --hover: #1a202a;
  --line: #1f2632;
  --line-2: #2a3241;
  --ink: #e7ebf1;
  --ink-2: #a7b0bf;
  --muted: #6c7686;
  --accent: #6d8cff;
  --accent-ink: #0a0d12;
  --accent-soft: rgba(109, 140, 255, .14);
  --brand: #f2b544;
  --brand-ink: #1b1306;
  --up: #2cc38c;
  --up-soft: rgba(44, 195, 140, .13);
  --dn: #f2596d;
  --dn-soft: rgba(242, 89, 109, .13);
  --warn: #e9a83c;
  --warn-soft: rgba(233, 168, 60, .14);
  --live: #f2596d;
  --chart-grid: #161c25;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .35);
  --scrim: rgba(4, 6, 10, .62);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --radius: 10px;
  --radius-sm: 7px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef1f5; --surface: #ffffff; --surface-2: #f7f9fb; --surface-3: #eef1f6; --hover: #f1f4f8;
    --line: #e2e6ed; --line-2: #d3d9e2; --ink: #111620; --ink-2: #444e5f; --muted: #737d8e;
    --accent: #3159e8; --accent-ink: #ffffff; --accent-soft: rgba(49, 89, 232, .09);
    --brand: #e8a52c; --brand-ink: #1b1306;
    --up: #0b9467; --up-soft: rgba(11, 148, 103, .1); --dn: #d7324b; --dn-soft: rgba(215, 50, 75, .09);
    --warn: #a86c06; --warn-soft: rgba(212, 140, 20, .13); --live: #d7324b; --chart-grid: #f0f2f6;
    --shadow: 0 18px 50px rgba(17, 22, 32, .14), 0 2px 8px rgba(17, 22, 32, .06); --scrim: rgba(17, 22, 32, .32);
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef1f5; --surface: #ffffff; --surface-2: #f7f9fb; --surface-3: #eef1f6; --hover: #f1f4f8;
  --line: #e2e6ed; --line-2: #d3d9e2; --ink: #111620; --ink-2: #444e5f; --muted: #737d8e;
  --accent: #3159e8; --accent-ink: #ffffff; --accent-soft: rgba(49, 89, 232, .09);
  --brand: #e8a52c; --brand-ink: #1b1306;
  --up: #0b9467; --up-soft: rgba(11, 148, 103, .1); --dn: #d7324b; --dn-soft: rgba(215, 50, 75, .09);
  --warn: #a86c06; --warn-soft: rgba(212, 140, 20, .13); --live: #d7324b; --chart-grid: #f0f2f6;
  --shadow: 0 18px 50px rgba(17, 22, 32, .14), 0 2px 8px rgba(17, 22, 32, .06); --scrim: rgba(17, 22, 32, .32);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  color-scheme: light;
}

/* ---------- base ---------- */
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font: 13px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.num, td.n, .mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.up { color: var(--up); } .dn { color: var(--dn); } .mut { color: var(--muted); } .warn-t { color: var(--warn); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg { flex: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.app { position: fixed; top: env(safe-area-inset-top, 0px); bottom: env(safe-area-inset-bottom, 0px); left: 0; right: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.rail { width: 216px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; padding: 14px 10px; transition: width .18s ease; overflow: hidden; }
.app.collapsed .rail { width: 60px; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; color: var(--ink); font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.rail-group { display: grid; gap: 2px; }
.rail-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 0 10px 6px; font-weight: 550; white-space: nowrap; }
.rail-link { display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); border: 0; background: none; width: 100%; text-align: left; white-space: nowrap; font-weight: 500; }
.rail-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-link:hover { background: var(--hover); color: var(--ink); }
.rail-link.active { background: var(--accent-soft); color: var(--ink); }
.rail-link.active svg { color: var(--accent); }
.rail-link kbd { margin-left: auto; font: 10.5px var(--font-num); color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; opacity: 0; }
.rail-link:hover kbd { opacity: 1; }
.rail-foot { margin-top: auto; display: grid; gap: 6px; }
.app.collapsed #railToggle svg { transform: rotate(180deg); }
.app.collapsed .rail-word, .app.collapsed .rail-label, .app.collapsed .rail-link span, .app.collapsed .rail-link kbd, .app.collapsed .rail-user-meta { display: none; }
.app.collapsed .rail-label { display: block; height: 1px; padding: 0; margin: 0 8px 6px; background: var(--line); font-size: 0; }
.rail-user { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; text-align: left; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink); font: 600 11px var(--font-ui); flex: none; border: 1px solid var(--line-2); }
.rail-user-meta { display: grid; line-height: 1.2; white-space: nowrap; }
.rail-user-meta b { font-weight: 600; font-size: 12.5px; } .rail-user-meta i { font-style: normal; color: var(--muted); font-size: 11px; }

/* top bar, optional banner, then the page takes the rest. Flex, not a 3-row grid: the banner is usually [hidden], and with a
   grid the page then fell into the auto row and was only as tall as its content (empty space below on a tall screen). */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main > .topbar, .main > .banner { flex: none; }
.main > .page-host { flex: 1 1 0; }
.topbar { display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 16px 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
/* R21: the title block gives way (ellipsis) before the right-hand cluster; PANIC must never leave the screen */
.tb-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.tb-title h1 { font-size: 16px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ticker { display: flex; gap: 2px; min-width: 0; flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tk { display: grid; grid-template-columns: auto auto; column-gap: 8px; padding: 4px 10px; border-radius: 7px; white-space: nowrap; cursor: pointer; border: 0; background: none; text-align: left; }
.tk:hover { background: var(--hover); }
.tk .tk-s { font-size: 10.5px; color: var(--muted); font-weight: 550; letter-spacing: .03em; grid-column: 1 / -1; }
.tk .tk-p { font: 500 12.5px var(--font-num); font-variant-numeric: tabular-nums; }
.tk .tk-c { font: 500 11.5px var(--font-num); }
.tb-right { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.search-btn { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.search-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.search-btn:hover { border-color: var(--line-2); color: var(--ink-2); }
kbd { font: 11px var(--font-num); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; background: var(--surface); }
.health { display: flex; align-items: center; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 11.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.chip.chip-btn { cursor: pointer; font-family: inherit; }
.chip.chip-btn:hover { color: var(--ink); border-color: var(--muted); }
.chip i.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.ok i.dot { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.chip.bad { color: var(--dn); border-color: color-mix(in srgb, var(--dn) 40%, transparent); background: var(--dn-soft); }
.chip.bad i.dot { background: var(--dn); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.chip.warn i.dot { background: var(--warn); }
.chip.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.chip.up { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); background: var(--up-soft); }
.chip.dn { color: var(--dn); border-color: color-mix(in srgb, var(--dn) 40%, transparent); background: var(--dn-soft); }
.chip.sm { height: 20px; padding: 0 7px; font-size: 10.5px; }
.chip.flat { border-color: transparent; }
/* status-bar dropdown buttons (system status, desk P&L): quiet when normal, tinted only when something is wrong */
.sbtn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-2); font-weight: 550; white-space: nowrap; transition: background .09s ease, border-color .09s ease; }
.sbtn:hover, .sbtn[aria-expanded="true"] { background: var(--hover); border-color: var(--line-2); color: var(--ink); }
.sbtn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; }
.sbtn.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.sbtn.warn .dot { background: var(--warn); }
.sbtn.bad { color: var(--dn); background: var(--dn-soft); border-color: color-mix(in srgb, var(--dn) 40%, transparent); }
.sbtn.bad .dot { background: var(--dn); }
.sbtn .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.sbtn.pnl .sbtn-k { font-size: 12px; color: var(--muted); font-weight: 500; }
.sbtn.pnl b { font: 600 14px var(--font-num); font-variant-numeric: tabular-nums; }
.spop { position: fixed; z-index: 75; width: 380px; max-width: calc(100vw - 16px); max-height: calc(100vh - 80px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; animation: spopIn .14s ease-out; }
.spop:focus { outline: none; }
@keyframes spopIn { from { opacity: 0; transform: translateY(-4px); } }
.spop-h { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); font-weight: 550; }
.spop-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; }
.spop-row:hover { background: var(--hover); }
.spop-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.spop-row .dot.warn { background: var(--warn); } .spop-row .dot.bad { background: var(--dn); } .spop-row .dot.off { background: var(--muted); }
.spop-row b, .spop-pr b { display: block; font-weight: 600; }
.spop-row em, .spop-pr em { display: block; font-style: normal; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.spop-pl { display: grid; padding: 2px 0; } .spop-pl + .spop-pl { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.spop-pr { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 10px; }
.spop-pr > b { font-size: 13px; white-space: nowrap; }
.spop-pr.muted > span b { color: var(--ink-2); font-weight: 500; }
.spop-pr.tot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.spop-pr.tot > b { font-size: 15px; }
.spop-f { padding: 8px 10px 6px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 12px; color: var(--muted); }
/* R26 alert inbox: header bell + its dropdown */
.icon-btn.bell { position: relative; }
.bell-n { position: absolute; top: -6px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--warn); color: #111; font: 650 10.5px/17px var(--font-num); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-n.crit { background: var(--dn); color: #fff; }
.spop.alerts { width: 440px; }
.al-tabs { display: flex; gap: 4px; padding: 0 8px 6px; }
.al-tabs button { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.al-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.al-row { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 7px; }
.al-row + .al-row { border-top: 1px solid var(--line); border-radius: 0; }
.al-row .dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--muted); }
.al-row .dot.critical { background: var(--dn); } .al-row .dot.warning { background: var(--warn); }
.al-row.new { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.al-row.new.critical { background: var(--dn-soft); }
.al-t { white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; line-height: 1.4; }
.al-m { margin-top: 3px; font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.al-empty { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .spop { animation: none; } }
.panic { position: relative; overflow: hidden; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--dn) 55%, transparent); background: var(--dn-soft); color: var(--dn); font-weight: 650; font-size: 11.5px; letter-spacing: .05em; }
.panic-fill { position: absolute; inset: 0; background: var(--dn); transform-origin: left; transform: scaleX(0); }
.panic.holding .panic-fill { transform: scaleX(1); transition: transform 1.4s linear; }
.panic-label { position: relative; }
.panic.holding .panic-label { color: #fff; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.banner { display: flex; align-items: center; gap: 12px; padding: 9px 20px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.banner.bad { background: var(--dn-soft); color: var(--ink); border-color: color-mix(in srgb, var(--dn) 35%, transparent); }
.banner.warn { background: var(--warn-soft); color: var(--ink); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner b { font-weight: 650; }
.banner .sp { flex: 1; }
.page-host { overflow: auto; min-height: 0; padding: 16px 20px 24px; }
.page-host.fill { overflow: hidden; padding: 12px; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }

/* ---------- primitives ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; min-height: 44px; }
.panel-h h2 { font-size: 13px; font-weight: 620; letter-spacing: -.005em; }
.panel-h .sub { color: var(--muted); font-size: 12px; }
.panel-h .sp, .sp { flex: 1; }
.panel-b { padding: 0 14px 14px; }
.eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 560; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-weight: 550; font-size: 12.5px; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 40px; font-size: 13.5px; padding: 0 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.buy { background: var(--up); border-color: var(--up); color: #fff; }
.btn.sell { background: var(--dn); border-color: var(--dn); color: #fff; }
.btn.buy:hover, .btn.sell:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { color: var(--dn); border-color: color-mix(in srgb, var(--dn) 45%, transparent); background: var(--dn-soft); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 550; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; }
.tabs button { border: 0; background: none; padding: 10px 10px 9px; color: var(--muted); font-weight: 560; font-size: 12.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.count { font: 500 10.5px var(--font-num); background: var(--surface-3); color: var(--ink-2); border-radius: 999px; padding: 1px 6px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 550; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); width: 100%; min-width: 0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.num { text-align: right; }
.input-wrap { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); height: 34px; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap input { border: 0; background: none; height: 100%; min-width: 0; flex: 1; padding: 0 10px; outline: none; font-family: var(--font-num); text-align: right; }
.input-wrap .unit { padding: 0 10px; color: var(--muted); font-size: 12px; border-left: 1px solid var(--line); height: 100%; display: flex; align-items: center; }
.switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); border: 0; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(14px); }

/* tables */
.tbl-wrap { overflow: auto; min-width: 0; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 550; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.n, .tbl td.n { text-align: right; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tbody tr.sel td { background: var(--accent-soft); }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; background: var(--surface-2); }
.tbl.compact td { padding: 6px 10px; }
.side { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font: 650 10.5px var(--font-num); }
.side.L { background: var(--up-soft); color: var(--up); } .side.S { background: var(--dn-soft); color: var(--dn); }
.reason { font-size: 11.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.reason i { width: 7px; height: 7px; border-radius: 2px; background: var(--muted); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--surface); padding: 12px 14px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.kpi .k { font-size: 11.5px; color: var(--muted); font-weight: 520; display: flex; gap: 6px; align-items: center; }
.kpi .v { font: 600 20px var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.kpi .d { font-size: 11.5px; color: var(--muted); }
.kpi svg.spark { width: 100%; height: 26px; margin-top: 2px; }

/* ---------- LIVE DESK ---------- */
@container (max-width: 270px) { .wl-row { grid-template-columns: minmax(0, 1fr) 78px; } .wl-row > svg { display: none; } }
.live { display: grid; grid-template-columns: var(--wl-w, 300px) 12px minmax(0, 1fr) 12px var(--tp-w, 348px); grid-template-rows: minmax(0, 1fr) 12px var(--dock-h, 248px); min-height: 0; min-width: 0; align-self: stretch; }
.live > .wl { grid-column: 1; grid-row: 1 / 4; }
.live > .gut[data-g="wl"] { grid-column: 2; grid-row: 1 / 4; }
.live > .chartp { grid-column: 3; grid-row: 1; }
.live > .gut[data-g="dock"] { grid-column: 3; grid-row: 2; }
.live > .dock { grid-column: 3; grid-row: 3; }
.live > .gut[data-g="tp"] { grid-column: 4; grid-row: 1 / 4; }
.live > .tp { grid-column: 5; grid-row: 1 / 4; }
.gut { position: relative; cursor: col-resize; touch-action: none; outline: none; }
.gut[data-g="dock"] { cursor: row-resize; }
.gut::before { content: ""; position: absolute; left: 5px; right: 5px; top: 0; bottom: 0; border-radius: 2px; transition: background .12s; }
.gut[data-g="dock"]::before { left: 0; right: 0; top: 5px; bottom: 5px; }
.gut::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 32px; margin: -16px 0 0 -2px; border-radius: 4px; background: var(--line-2); opacity: 0; transition: opacity .12s; }
.gut[data-g="dock"]::after { width: 32px; height: 4px; margin: -2px 0 0 -16px; }
.gut:hover::after, .gut:focus-visible::after { opacity: 1; }
.gut:hover::before, .gut:focus-visible::before { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.gut.drag::before { background: var(--accent); }
.gut.drag::after { opacity: 0; }
body.resizing-c, body.resizing-c * { cursor: col-resize !important; user-select: none; }
body.resizing-r, body.resizing-r * { cursor: row-resize !important; user-select: none; }
.wl { container-type: inline-size; display: flex; flex-direction: column; overflow: hidden; }
.wl-tools { display: grid; gap: 8px; padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
.wl-tools .seg { display: flex; }
.wl-tools .seg button { flex: 1; padding: 0 4px; }
.wl-search { position: relative; }
.wl-search svg { position: absolute; left: 9px; top: 9px; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 2; }
.wl-search input { padding-left: 30px; height: 32px; }
.wl-list { overflow: auto; flex: 1; min-height: 0; padding: 4px 6px 8px; }
.wl-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 8px 4px; font-weight: 560; display: flex; justify-content: space-between; }
.wl-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px 78px; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; position: relative; }
.wl-row:hover { background: var(--hover); }
.wl-row.sel { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.wl-row .nm { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.wl-row .nm span { overflow: hidden; text-overflow: ellipsis; }
.wl-row .meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-row .px { text-align: right; display: grid; line-height: 1.25; }
.wl-row .px b { font: 500 12.5px var(--font-num); font-variant-numeric: tabular-nums; }
.wl-row .px i { font: 500 11px var(--font-num); font-style: normal; }
.wl-row svg { width: 46px; height: 22px; }
.pos-tag { font: 650 9.5px var(--font-ui); letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; }
.pos-tag.L { background: var(--up-soft); color: var(--up); } .pos-tag.S { background: var(--dn-soft); color: var(--dn); }
.pos-tag.P { background: var(--warn-soft); color: var(--warn); } .pos-tag.H { background: var(--dn); color: #fff; }
.flash-up { animation: fu .6s ease; } .flash-dn { animation: fd .6s ease; }
@keyframes fu { from { background: var(--up-soft); } } @keyframes fd { from { background: var(--dn-soft); } }

.chartp { display: flex; flex-direction: column; overflow: hidden; }
.ch-head { display: flex; align-items: flex-start; gap: 18px; padding: 12px 14px 8px; flex-wrap: wrap; }
.ch-sym { display: grid; gap: 2px; }
.ch-sym h2 { font-size: 18px; font-weight: 650; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.ch-sym .sub { color: var(--muted); font-size: 12px; }
.ch-px { display: grid; gap: 0; }
.ch-px b { font: 600 24px var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }
.ch-px span { font: 500 12.5px var(--font-num); }
.ch-stats { display: flex; gap: 16px; align-self: center; flex-wrap: wrap; }
.ch-stats div { display: grid; line-height: 1.3; }
.ch-stats span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ch-stats b { font: 500 12.5px var(--font-num); }
.ch-tools { display: flex; align-items: center; gap: 8px; padding: 0 14px 8px; flex-wrap: wrap; }
.ch-tools .tg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 7px; height: 26px; padding: 0 9px; background: none; }
.ch-tools .tg i { width: 10px; height: 2px; border-radius: 2px; }
.ch-tools .tg.off { opacity: .45; }
.chart-box { position: relative; flex: 1; min-height: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); }
.chart-main { position: relative; min-width: 0; min-height: 0; }
.chart-main > div.lw { position: absolute; inset: 0; }
/* in a trade: index 2/3 · option legs 1/3 (CE above PE for a synthetic future) */
.chart-box.split { grid-template-columns: minmax(0, 1fr) 8px var(--optw, 33%); }
.optcol { display: flex; flex-direction: column; background: var(--line); min-width: 0; min-height: 0; }
.optcol[hidden] { display: none; }
.chart-box.split.stack { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.6fr) minmax(0, 1fr); }
.chart-box.split.stack .optcol { flex-direction: row; gap: 1px; border-top: 1px solid var(--line); }
.chart-box.split.stack .cgut, .chart-box.split.stack .cgut-h { display: none; }
/* resize handles: option column width, and CE / PE height */
.cgut { position: relative; cursor: col-resize; touch-action: none; outline: none; background: var(--surface); }
.cgut[hidden] { display: none; }
.cgut::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px; background: var(--line); transition: background .12s, width .12s; }
.cgut-h { flex: none; height: 7px; position: relative; cursor: row-resize; touch-action: none; background: var(--surface); }
.cgut-h::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; background: var(--line); transition: background .12s; }
.cgut::after, .cgut-h::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 4px; background: var(--line-2); opacity: 0; transition: opacity .12s; }
.cgut::after { width: 4px; height: 32px; margin: -16px 0 0 -2px; }
.cgut-h::after { width: 32px; height: 4px; margin: -2px 0 0 -16px; }
.cgut:hover::after, .cgut:focus-visible::after, .cgut.drag::after, .cgut-h:hover::after, .cgut-h.drag::after { opacity: 1; }
.cgut:hover::before, .cgut.drag::before, .cgut-h:hover::before, .cgut-h.drag::before { background: var(--accent); }
.optpane { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); container-type: inline-size; }
@container (max-width: 360px) { .opthead .ohlc .ohl { display: none; } }
.opthead { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font: 11px var(--font-num); color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.opthead .sym { font: 600 11.5px var(--font-num); color: var(--ink); flex: none; }
.opthead .txn { flex: none; }
.opthead .ohlc { display: flex; gap: 8px; overflow: hidden; min-width: 0; }
.opthead .lpnl { flex: none; }
.opthead .ohlc i { font-style: normal; color: var(--muted); margin-right: 2px; }
.opthead .lpnl b { font-weight: 600; }
.optchart { flex: 1; min-height: 0; position: relative; }
.optchart > div { position: absolute !important; inset: 0; }
.ch-legend { position: absolute; left: 12px; top: 8px; z-index: 3; flex-wrap: wrap; max-width: calc(100% - 90px); font: 11.5px var(--font-num); color: var(--ink-2); pointer-events: none; display: flex; gap: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 2px 6px; border-radius: 6px; }
.ch-legend b { color: var(--muted); font-weight: 500; margin-right: 3px; }

.dock { display: flex; flex-direction: column; overflow: hidden; }
.dock .tabs { padding-right: 12px; align-items: center; }
.dock .tabs .sp { flex: 1; }
.dock-body { overflow: auto; flex: 1; min-height: 0; }

.tp { display: flex; flex-direction: column; overflow: hidden; }
.tp-scroll { overflow: auto; flex: 1; min-height: 0; display: grid; align-content: start; gap: 0; }
.tp-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tp-head h2 { font-size: 14px; font-weight: 650; }
.tp-sec { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.tp-sec:last-child { border-bottom: 0; }
.tp-sec-h { display: flex; align-items: center; gap: 8px; }
.tp-sec-h h3 { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.pnl-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.pnl-hero .big { font: 600 28px var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.pnl-hero .small { font: 500 12px var(--font-num); color: var(--muted); margin-top: 6px; }
.rbadge { font: 600 12px var(--font-num); padding: 4px 8px; border-radius: 7px; background: var(--surface-3); }
.ladder { position: relative; height: 54px; margin: 2px 4px 0; }
.ladder .track { position: absolute; left: 0; right: 0; top: 22px; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--dn-soft), var(--surface-3) 30%, var(--surface-3) 70%, var(--up-soft)); }
.ladder .fill { position: absolute; top: 22px; height: 6px; border-radius: 6px; background: var(--up); opacity: .75; }
.ladder .fill.neg { background: var(--dn); }
.ladder .mk { position: absolute; top: 14px; width: 2px; height: 22px; background: var(--muted); border-radius: 2px; transform: translateX(-1px); }
.ladder .mk.stop { background: var(--dn); } .ladder .mk.tp { background: var(--up); } .ladder .mk.trail { background: var(--warn); }
.ladder .now { position: absolute; top: 17px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); transform: translateX(-8px); transition: left .4s ease; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.ladder .lb { position: absolute; font: 500 10.5px var(--font-num); color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.ladder .lb.t { top: 0; } .ladder .lb.b { top: 40px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.facts div { display: grid; gap: 1px; min-width: 0; }
.facts dt { font-size: 11px; color: var(--muted); }
.facts dd { margin: 0; font: 500 12.5px var(--font-num); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.legs td { padding: 6px 8px; font-size: 12px; }
.legs th { padding: 6px 8px; }
.txn { font: 650 10px var(--font-ui); padding: 2px 5px; border-radius: 4px; letter-spacing: .04em; }
.txn.B { background: var(--up-soft); color: var(--up); } .txn.S { background: var(--dn-soft); color: var(--dn); }
.txn.N { background: var(--surface-3); color: var(--ink-2); font-family: var(--font-num); font-weight: 550; letter-spacing: 0; }
.fee-toggle { cursor: pointer; }
.fee-toggle td:first-child::before { content: "▸ "; color: var(--muted); }
.fee-toggle.open td:first-child::before { content: "▾ "; }
.payoff svg { width: 100%; height: 130px; display: block; }
.ai-card { border: 1px solid var(--line); border-radius: 9px; padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.ai-verdict { display: flex; align-items: center; gap: 8px; }
.ai-verdict b { font-size: 15px; font-weight: 650; }
.ai-card p { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.levels { display: flex; flex-wrap: wrap; gap: 6px; }
.lvl { font: 500 11.5px var(--font-num); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); }
.lvl.s { color: var(--up); } .lvl.r { color: var(--dn); }
.news-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); align-items: start; }
.news-item time { font: 11.5px var(--font-num); color: var(--muted); padding-top: 1px; }
.news-item .t { font-weight: 500; }
.news-item .s { font-size: 11.5px; color: var(--muted); }
.evt-impact { font-size: 10.5px; font-weight: 650; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .05em; }
.evt-impact.high { background: var(--dn-soft); color: var(--dn); } .evt-impact.medium { background: var(--warn-soft); color: var(--warn); }
.audit-row td:nth-child(3) { font-weight: 550; }

/* ---------- page toolbars ---------- */
.pagebar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pagebar p { margin: 0; color: var(--ink-2); max-width: 80ch; }

/* ---------- analytics ---------- */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .field { display: flex; align-items: center; gap: 8px; }
.filters .field > label { color: var(--muted); font-weight: 500; }
.filters select.input { width: auto; height: 30px; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.viz { position: relative; }
.viz svg { display: block; width: 100%; }
.viz text { fill: var(--muted); font: 10.5px var(--font-num); }
.viz .grid-l { stroke: var(--chart-grid); stroke-width: 1; }
.viz .axis-l { stroke: var(--line-2); stroke-width: 1; }
.viz .zero-l { stroke: var(--line-2); stroke-width: 1; }
.viz .xh { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; pointer-events: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend i.line { height: 2px; border-radius: 2px; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; min-width: 120px; }
.tip .tt { font-weight: 600; margin-bottom: 4px; font-size: 11.5px; color: var(--ink-2); }
.tip .tr { display: flex; justify-content: space-between; gap: 14px; font-family: var(--font-num); }
.tip .tr span { color: var(--muted); font-family: var(--font-ui); display: inline-flex; align-items: center; gap: 6px; }
.tip .tr span i { width: 8px; height: 8px; border-radius: 2px; }
.tip .tr em { font-style: normal; font-weight: 400; color: var(--muted); }
.tip .tf { margin-top: 5px; font-size: 11px; color: var(--muted); }
.heat { display: grid; grid-template-columns: 44px repeat(12, minmax(0, 1fr)) 76px; gap: 3px; font: 11.5px var(--font-num); }
.heat .hh { color: var(--muted); text-align: center; font-family: var(--font-ui); font-size: 11px; padding-bottom: 2px; }
.heat .hy { color: var(--ink-2); display: flex; align-items: center; }
.heat .hc { height: 34px; border-radius: 5px; display: grid; place-items: center; color: var(--ink); cursor: default; font-size: 11px; }
.heat .ht { display: flex; align-items: center; justify-content: flex-end; font-weight: 600; }
.bars-h { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 118px; gap: 10px; align-items: center; font-size: 12px; }
.bar-row .bt { height: 10px; border-radius: 3px; background: var(--surface-3); position: relative; overflow: hidden; }
.bar-row .bt i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bar-row .bv { text-align: right; font-family: var(--font-num); white-space: nowrap; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.cmp > div { background: var(--surface); padding: 12px; display: grid; gap: 8px; }
.cmp .row { display: flex; justify-content: space-between; font-size: 12px; }
.cmp .row b { font: 500 12.5px var(--font-num); }
.drill tr.lvl0 td:first-child { font-weight: 600; }
.drill tr.lvl1 td:first-child { padding-left: 26px; }
.drill tr.lvl2 td:first-child { padding-left: 44px; color: var(--ink-2); }
.drill tr.exp { cursor: pointer; }
.drill .tw { display: inline-block; width: 12px; color: var(--muted); }
.att-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.att-card { border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; display: grid; gap: 3px; background: var(--surface-2); position: relative; overflow: hidden; }
.att-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-2); }
.att-card.good::before { background: var(--up); } .att-card.bad::before { background: var(--dn); }
.att-card b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.att-card.good b { color: var(--up); } .att-card.bad b { color: var(--dn); }
.att-card > span:last-child { font-size: 11.5px; color: var(--muted); }
.att-read { white-space: normal !important; min-width: 240px; max-width: 320px; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.an-notes { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); border-radius: 9px; padding: 9px 12px; margin-bottom: 14px; }
.an-notes summary { cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--warn); list-style: none; }
.an-notes summary span { font-size: 12px; }
.an-notes ul { margin: 8px 0 2px; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; font-size: 12.5px; }
.wl-split { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.mini-bar { display: inline-block; width: 44px; height: 5px; border-radius: 3px; background: var(--surface-3); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.mini-bar i { display: block; height: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 28px; }
.metric-grid div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.metric-grid div b { font: 500 12.5px var(--font-num); }
.metric-grid div span { color: var(--ink-2); }

/* ---------- report ---------- */
.report { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; height: 100%; }
.rp-list { display: flex; flex-direction: column; overflow: hidden; }
.rp-items { overflow: auto; padding: 4px 6px 8px; }
.rp-item { display: grid; gap: 6px; padding: 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.rp-item:hover { background: var(--hover); }
.rp-item.sel { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.rp-item .top { display: flex; justify-content: space-between; font-weight: 600; }
.rp-item .top b { font: 600 12.5px var(--font-num); }
.rp-item .sub { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.rp-item .bar { height: 4px; border-radius: 3px; background: var(--surface-3); position: relative; }
.rp-item .bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.rp-detail { display: flex; flex-direction: column; gap: 14px; overflow: auto; min-width: 0; }
button.rp-item { width: 100%; text-align: left; background: none; font: inherit; color: inherit; }
.rp-chart-wrap { position: relative; padding: 0 14px 14px; }
.rp-chart { height: 340px; }
.rp-legend { position: static; display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 8px; background: none; border: 0; padding: 0; font-size: 11.5px; color: var(--ink-2); }
.rp-legend i.ln { display: inline-block; width: 12px; height: 2px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
/* P&L report — calendar view (report.js calendar()); day cells take their heat colour from --c */
.rpc { --rpc-strong: var(--bg); min-width: 0; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .rpc { --rpc-strong: var(--ink); } }
:root[data-theme="light"] .rpc { --rpc-strong: var(--ink); }
.rpc-h { flex-wrap: wrap; row-gap: 8px; }
.rpc-range { display: flex; align-items: center; gap: 10px; }
.rpc-range label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rpc-range .input { height: 28px; width: 142px; font: 12.5px var(--font-num); }
.rpc-legend { display: flex; align-items: center; gap: 3px; padding: 0 16px 10px; font-size: 11.5px; color: var(--muted); }
.rpc-legend i { width: 16px; height: 10px; border-radius: 3px; }
.rpc-legend i.z { background: var(--surface-3); }
.rpc-legend > span:first-child { margin-right: 4px; } .rpc-legend > span:nth-child(9) { margin-left: 4px; }
.rpc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; padding: 0 14px 14px; }
.rpc-m { border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 10px; background: var(--surface-2); min-width: 0; }
.rpc-m h3 { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; text-align: center; color: var(--ink-2); }
.rpc-mnet { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 4px 0 10px; }
.rpc-mnet b { font: 600 14.5px var(--font-num); font-variant-numeric: tabular-nums; }
.rpc-mnet span { font-size: 11px; color: var(--muted); }
.rpc-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.rpc-w { text-align: center; font-size: 10.5px; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.rpc-d { aspect-ratio: 1; display: grid; place-items: center; border: 0; padding: 0; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font: 500 11.5px var(--font-num); }
.rpc-d.wk { background: transparent; color: var(--muted); }
.rpc-d.out { opacity: .35; }
.rpc-d.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.rpc-d.has { background: var(--c); color: var(--ink); font-weight: 650; cursor: pointer; }
.rpc-d.has.strong { color: var(--rpc-strong); }
.rpc-d.has:hover, .rpc-d.has:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 1px; }
.rpc-tip { width: 360px; max-width: calc(100vw - 40px); display: grid; gap: 6px; }
.rpc-tip-h { display: flex; justify-content: space-between; gap: 12px; font-weight: 650; font-size: 13px; color: var(--ink); }
.rpc-tip-h b { font: 650 13.5px var(--font-num); }
.rpc-tip-s { font-size: 11px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.rpc-tr { display: grid; gap: 3px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.rpc-tr:last-of-type { border-bottom: 0; }
.rpc-tr.grp { padding-left: 8px; border-left: 2px solid var(--line-2); border-bottom: 0; margin: 2px 0; }
.rpc-th { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 12px; }
.rpc-th em { font-style: normal; font-weight: 400; color: var(--muted); }
.rpc-th b, .rpc-leg b { font: 600 12px var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpc-leg { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rpc-leg .sym { font-family: var(--font-num); color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpc-leg.solo .sym { color: var(--ink); }
.rpc-leg .q { font: 500 10.5px var(--font-num); padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.rpc-leg .q.b { color: var(--up); background: var(--up-soft); } .rpc-leg .q.s { color: var(--dn); background: var(--dn-soft); }
.rpc-leg .px { font: 11.5px var(--font-num); color: var(--muted); white-space: nowrap; }
.rpc-meta { font-size: 11px; color: var(--muted); }
.rpc-more { font-size: 11px; color: var(--accent); padding-top: 2px; }
.modal.rpc-modal { width: min(640px, calc(100vw - 32px)); }
.rpc-pin { width: auto; max-width: none; }

/* ---------- premium / signals ---------- */
.pm-books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1180px) { .pm-books { grid-template-columns: minmax(0, 1fr); } }
.book { display: flex; flex-direction: column; }
.book-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.book-h h3 { font-size: 14px; font-weight: 650; }
.book-h .sub { color: var(--muted); font-size: 12px; }
/* per-short-leg adjust icons + the adjust ticket */
.lgact { display: inline-flex; gap: 4px; }
.lgact button { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.lgact button:hover { color: var(--ink); border-color: var(--line-2); }
.stopbtn { font: inherit; color: var(--ink-2); background: none; border: 1px dashed transparent; border-radius: 5px; padding: 1px 3px; cursor: pointer; }
.stopbtn:hover, .stopbtn:focus-visible { border-color: var(--line-2); color: var(--ink); }
.stopbtn.off { color: var(--warn, #b7791f); border-color: currentColor; }
.stop-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.stop-kv dt { color: var(--ink-2); } .stop-kv dd { margin: 0; text-align: right; }
.stop-in { display: inline-flex; align-items: center; gap: 8px; }
.lgact button[data-legact="close"]:hover { color: var(--dn); }
.lgact svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.adj-opts { display: grid; gap: 8px; }
.adj-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.adj-opt.on { border-color: var(--accent, var(--ink-2)); background: var(--surface-2); }
.adj-opt input { margin-top: 3px; }
.adj-opt b { display: block; font-size: 13.5px; }
.adj-opt small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.adj-tbl { width: 100%; }
.adj-tbl td, .adj-tbl th { padding-left: 8px; padding-right: 8px; }
.adj-tbl tr[data-strike] { cursor: pointer; }
.adj-tbl tr.sel td { background: var(--surface-2); }
.book-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.book-sum > div { padding: 10px 14px; display: grid; gap: 2px; border-right: 1px solid var(--line); }
.book-sum > div:last-child { border-right: 0; }
.book-sum span { font-size: 11px; color: var(--muted); }
.book-sum b { font: 600 14px var(--font-num); }
.stopbar { width: 90px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: inline-block; vertical-align: middle; }
.stopbar i { display: block; height: 100%; background: var(--up); border-radius: 4px; }
.stopbar.warm i { background: var(--warn); } .stopbar.hot i { background: var(--dn); }
.book-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); margin-top: auto; }
.book .payoff { padding: 6px 14px 4px; }
.book .payoff svg { height: 92px; }
.group-h { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; }
.group-h h2 { font-size: 13px; font-weight: 620; }
.group-h .ln { flex: 1; height: 1px; background: var(--line); }

.book-open { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; border-radius: 6px; }
.book-open:hover h3 { color: var(--accent); }
.pmd-h { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.pmd { padding-top: 14px; }
.pmd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pmd-chip { font: 500 11.5px var(--font-num); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); }
button.pmd-chip.edit { color: var(--accent); border-style: dashed; font-family: var(--font-ui); font-weight: 560; }
.pmd-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.pmd-strip > div { background: var(--surface); padding: 8px 12px; display: grid; gap: 1px; }
.pmd-strip span { font-size: 11px; color: var(--muted); }
.pmd-strip b { font-size: 13px; font-weight: 550; }
.pmd-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.pmd-grid h4 { margin: 0 0 8px; }
.pmd-leg { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pmd-type { display: inline-flex; align-items: center; justify-content: center; gap: 2px; height: 26px; border-radius: 6px; font: 650 11px var(--font-num); }
.pmd-type.CE { background: color-mix(in srgb, var(--s1) 16%, transparent); color: var(--s1); }
.pmd-type.PE { background: color-mix(in srgb, var(--s4) 18%, transparent); color: var(--s4); }
.pmd-type.wing { background: transparent; border: 1px dashed var(--line-2); }
.pmd-leg-m { display: grid; gap: 3px; min-width: 0; }
.pmd-prog { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 3px; }
.pmd-prog i { display: block; height: 100%; background: var(--up); border-radius: 4px; transition: width .4s; }
.pmd-prog i.warm { background: var(--warn); } .pmd-prog i.hot { background: var(--dn); }
.pmd-po { margin-top: 12px; }
.pmd-po svg { width: 100%; height: 120px; display: block; }
.pmd-today { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.modal.wide { width: min(1040px, calc(100vw - 32px)); }
@media (max-width: 860px) { .pmd-grid { grid-template-columns: minmax(0, 1fr); } }

.pbar { position: relative; display: inline-block; width: 150px; height: 8px; border-radius: 4px; background: var(--surface-3); vertical-align: middle; margin-right: 8px; }
.pbar.wide { width: min(100%, 360px); }
.pbar i { position: absolute; top: 0; bottom: 0; transition: width .6s ease; }
.pbar .kept { right: 50%; background: var(--up); border-radius: 4px 0 0 4px; }
.pbar .risk { left: 50%; border-radius: 0 4px 4px 0; background: var(--warn); }
.pbar .risk.hot { background: var(--dn); } .pbar .risk.rise { background: color-mix(in srgb, var(--warn) 70%, var(--surface-3)); }
.pbar b { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink-2); border-radius: 1px; }
.pbar em { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--up); transform: translate(-50%, -50%); transition: left .6s ease; }
.pbar em.warm, .pbar em.rise { border-color: var(--warn); } .pbar em.hot { border-color: var(--dn); }
.pbar em.tickp { animation: tickp .6s ease; }
@keyframes tickp { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); transform: translate(-50%, -50%) scale(1.35); } 100% { transform: translate(-50%, -50%) scale(1); } }
.pbar em.keep { color: var(--up); } .pbar em.hot { color: var(--dn); }
.pb-l { font: 500 11px var(--font-num); display: inline-block; min-width: 76px; }
.pb-l.keep { color: var(--up); } .pb-l.warm, .pb-l.rise { color: var(--warn); } .pb-l.hot { color: var(--dn); }
.pb-h { display: inline-flex; gap: 6px; }
.pb-h span { display: none; }
.pmd-pb { display: flex; align-items: center; margin-top: 4px; }

/* ---------- sentiment ---------- */
.gauge-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: center; }
.gauge svg { width: 100%; height: auto; }
.gauge .lbl { fill: var(--muted); font: 10.5px var(--font-ui); }
.dir-big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.sig-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 54px 46px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sig-row:last-child { border-bottom: 0; }
.sig-row .nm { font-weight: 600; text-transform: capitalize; }
.sig-row .dt { font-size: 11.5px; color: var(--muted); grid-column: 2 / -1; margin-top: -4px; }
.div-bar { height: 8px; background: var(--surface-3); border-radius: 4px; position: relative; }
.div-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.div-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.prob { display: grid; gap: 8px; }
.prob-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 42px; gap: 10px; align-items: center; font-size: 12px; }
.prob-row .bt { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.prob-row .bt i { display: block; height: 100%; border-radius: 4px; }
.chain td { padding: 5px 8px; font-size: 12px; }
.chain th { padding: 7px 8px; }
.chain td.k { text-align: center; font-weight: 600; background: var(--surface-2); }
.chain tr.atm td { background: var(--accent-soft); }
.chain tr.atm td.k { color: var(--accent); }
.oi-bar { position: relative; }
.oi-bar i { position: absolute; top: 4px; bottom: 4px; border-radius: 3px; opacity: .25; }
.oi-bar span { position: relative; }
.wall { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.wall .side-box { border: 1px solid var(--line); border-radius: 9px; padding: 12px; display: grid; gap: 3px; }
.wall .side-box b { font: 600 18px var(--font-num); }
.wall .spot { text-align: center; display: grid; gap: 2px; }
.wall .spot b { font: 600 15px var(--font-num); }

.sec-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }
.sec-h h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.sec-h .mut { font-size: 12px; }
.tr-verdict { font-size: 12.5px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); max-width: 110ch; }
.tr-verdict.bad { border-color: color-mix(in srgb, var(--dn) 35%, transparent); background: var(--dn-soft); }
.tr-verdict.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.tr-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .tr-split { grid-template-columns: minmax(0, 1fr); } }
.tr-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.hitbar { position: relative; display: inline-block; width: 140px; height: 8px; border-radius: 4px; background: var(--surface-3); vertical-align: middle; margin-right: 8px; }
.hitbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--muted); }
.hitbar i.good { background: var(--up); } .hitbar i.bad { background: var(--dn); }
.hitbar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; max-width: 1640px; }
.set-nav { position: sticky; top: 0; align-self: start; display: grid; gap: 2px; }
.set-nav a { padding: 7px 10px; border-radius: 7px; color: var(--ink-2); font-weight: 520; display: flex; justify-content: space-between; }
.set-nav a:hover { background: var(--hover); color: var(--ink); }
.set-nav a.on { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.set-body { display: grid; gap: 16px; min-width: 0; padding-bottom: 70px; }
.set-sec { scroll-margin-top: 8px; max-width: 1000px; }
#sec-books { max-width: none; }
.set-sec .panel-h { border-bottom: 1px solid var(--line); }
.set-sec .panel-h p { margin: 0; color: var(--muted); font-size: 12px; }
.set-rows { display: grid; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .l b { font-weight: 560; display: block; }
.set-row .l span { color: var(--muted); font-size: 12px; }
.set-row .l code { font: 11px var(--font-num); color: var(--muted); }
.set-row.dirty { background: var(--accent-soft); }
.set-row .ctl { display: flex; justify-content: flex-end; }
.savebar { position: sticky; bottom: 12px; margin-left: 224px; max-width: 1416px; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); z-index: 5; }
.savebar b { font-weight: 600; }
.code { font: 12px/1.55 var(--font-num); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 360px; white-space: pre; color: var(--ink-2); margin: 0; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-pick button { text-align: left; padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mode-pick button > b { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.mode-pick button > span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.mode-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode-pick button.on.live { border-color: var(--live); box-shadow: 0 0 0 3px var(--dn-soft); }

.bk-tools { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bk-wrap { max-height: 620px; }
.bk-tbl td { padding: 6px 8px; vertical-align: middle; }
.bk-tbl th { padding: 8px 8px; }
.bk-tbl .stick { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.bk-tbl thead .stick { z-index: 3; }
.bk-tbl tr.in-trade td { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.bk-tbl tr:hover td.stick, .bk-tbl tr.in-trade td.stick { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.bk-cell { display: inline-flex; align-items: center; gap: 4px; border-radius: 7px; padding: 1px; }
.bk-cell i { font-style: normal; font: 11px var(--font-num); color: var(--muted); min-width: 18px; text-align: left; }
.bk-in { height: 28px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 7px; font: 12px var(--font-num); text-align: right; }
select.bk-in { text-align: left; font-family: var(--font-ui); }
.bk-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-in:disabled { opacity: .4; }
.bk-cell.dirty .bk-in { border-color: var(--warn); background: var(--warn-soft); }
.bk-state { cursor: pointer; text-transform: none; }
.bk-state.dirty { outline: 2px solid var(--warn); outline-offset: 1px; }
.bk-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; }
.dc-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.dc-add label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.dc-add .mut { flex-basis: 100%; font-size: 12px; }
.bk-tbl tr.dc-main td { border-bottom: 0; }
.bk-tbl tr.dc-rule td { padding: 0 0 10px; font-size: 12px; color: var(--ink-2); white-space: normal; }
.bk-tbl tr.dc-rule td > div { position: sticky; left: 0; max-width: min(900px, 78vw); padding: 0 14px; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; max-width: 1180px; }
.about p { margin: 0 0 10px; color: var(--ink-2); max-width: 68ch; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rule { border: 1px solid var(--line); border-radius: 9px; padding: 12px; display: grid; gap: 4px; align-content: start; background: var(--surface-2); }
.rule b { font-weight: 600; }
.rule span { color: var(--ink-2); font-size: 12.5px; }
.rule code { font: 500 12px var(--font-num); color: var(--ink); }
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 1px; background: var(--line-2); }
.tl-item:last-child::before { display: none; }
.tl-item i { width: 13px; height: 13px; border-radius: 50%; border: 3px solid var(--accent); background: var(--surface); margin-top: 2px; }
.tl-item b { font-weight: 600; display: block; }
.tl-item ul { margin: 4px 0 0; padding-left: 16px; color: var(--ink-2); display: grid; gap: 3px; }

/* ---------- overlays ---------- */
.layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(2px); animation: fade .12s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); animation: pop .16s ease; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.modal-h h2 { font-size: 15px; font-weight: 650; }
.modal-b { padding: 4px 18px 16px; display: grid; gap: 14px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.side-toggle button { border: 0; background: var(--surface-2); height: 38px; font-weight: 650; color: var(--muted); }
.side-toggle button.on.L { background: var(--up); color: #fff; }
.side-toggle button.on.S { background: var(--dn); color: #fff; }
.stepper { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; height: 34px; }
.stepper button { border: 0; background: var(--surface-3); font-size: 16px; color: var(--ink-2); }
.stepper input { border: 0; background: var(--surface-2); text-align: center; font-family: var(--font-num); min-width: 0; outline: none; }
.summary-box { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.summary-box .r { display: flex; justify-content: space-between; padding: 7px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.summary-box .r:last-child { border-bottom: 0; }
.summary-box .r span { color: var(--ink-2); }
.summary-box .r b { font: 500 12.5px var(--font-num); }
.summary-box .r.tot { background: var(--surface-2); }
.summary-box .r.tot b { font-weight: 650; }
.note { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; display: flex; gap: 8px; }
.note.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.cmdk { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.cmdk-box { width: min(620px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; animation: pop .14s ease; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk-in svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; }
.cmdk-in input { flex: 1; height: 50px; border: 0; background: none; outline: none; font-size: 15px; }
.cmdk-list { max-height: 380px; overflow: auto; padding: 6px; }
.cmdk-g { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; font-weight: 560; }
.cmdk-it { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.cmdk-it.on { background: var(--accent-soft); }
.cmdk-it .ic { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; font: 600 11px var(--font-num); color: var(--ink-2); }
.cmdk-it .hint { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.menu { position: fixed; z-index: 70; min-width: 220px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: 7px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .mh { padding: 8px 10px; display: grid; }
.menu .mh span { color: var(--muted); font-size: 12px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; width: 340px; padding: 11px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .18s ease; font-size: 12.5px; }
.toast i { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--accent); flex: none; }
.toast.ok i { background: var(--up); } .toast.bad i { background: var(--dn); } .toast.warn i { background: var(--warn); }
.toast b { display: block; font-weight: 600; }
.toast span { color: var(--ink-2); }

/* login */
.login { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); background: var(--bg); }
.login-art { position: relative; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-art > * { position: relative; }
.login-art h2 { font-size: 34px; font-weight: 650; letter-spacing: -.03em; max-width: 14ch; line-height: 1.1; }
.login-art p { color: var(--ink-2); max-width: 46ch; }
.login-form { display: grid; place-items: center; padding: 24px; }
.login-form form { width: min(360px, 100%); display: grid; gap: 14px; }
.login-form h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }

@media (max-width: 1280px) {
  .ticker { display: none; }
}
@media (max-width: 1040px) {
  .live { grid-template-columns: minmax(0, 1fr); grid-template-rows: 300px 520px 320px auto; gap: 12px; height: auto; }
  .live > .wl, .live > .tp, .live > .chartp, .live > .dock { grid-row: auto; grid-column: auto; }
  .live > .gut { display: none; }
  .page-host.fill { overflow: auto; }
  .g-2, .g-3, .g-21, .g-12, .about, .report, .settings, .gauge-wrap { grid-template-columns: minmax(0, 1fr); }
  .savebar { margin-left: 0; }
  .set-nav { display: none; }
  .search-btn span, .search-btn kbd, .sbtn.pnl .sbtn-k, #hClock { display: none; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .tb-sub, #healthBtn .sbtn-l, .sbtn .chev { display: none; }
  .topbar { padding: 0 16px; gap: 10px; }
  .page-host { padding: 12px 16px 20px; }
  .pm-books { grid-template-columns: minmax(0, 1fr); }
  .set-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .book-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-sum > div:first-child { grid-column: span 2; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- shell additions for the real app ---------- */
.rail-user { position: relative; }
.rail-out { margin-left: auto; color: var(--muted); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.rail-out:hover { color: var(--dn); background: var(--hover); }
.rail-out svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app.collapsed .rail-out { display: none; }
a.tk { color: inherit; text-decoration: none; }
.chip.nodot i.dot { display: none; }
.toast { position: relative; padding-right: 30px; }
.toast-x { position: absolute; right: 6px; top: 6px; border: 0; background: none; color: var(--muted); font-size: 12px; width: 20px; height: 20px; border-radius: 5px; }
.toast-x:hover { background: var(--hover); color: var(--ink); }
.ro-note { margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 8px; padding: 8px 12px; }
.page-host.fill .ro-note { display: none; }
body.ro .needs-write { display: none !important; }
.empty.sm { padding: 18px 12px; font-size: 12px; }
.po-t { fill: var(--muted); font: 10px var(--font-num); }
.po-t.acc { fill: var(--accent); }
.po-hov { pointer-events: none; }
.po-hov .xh { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.po-hov circle { stroke: var(--surface); stroke-width: 1.5; }
.layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(2px); animation: fade .12s ease; }
.modal.xl { width: min(1180px, calc(100vw - 32px)); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.busy { pointer-events: none; opacity: .7; }

/* ---------- live desk (real app) ---------- */
.wl-head-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.wl-head-row b { font-weight: 620; }
.sw-l { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.switch[disabled] { opacity: .5; cursor: not-allowed; }
.note.bad { background: var(--dn-soft); border-color: color-mix(in srgb, var(--dn) 30%, transparent); }
.tp-p { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.po-stats { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.po-stats b { font-weight: 550; }
button.ai-card { text-align: left; width: 100%; cursor: pointer; color: inherit; font: inherit; }
button.ai-card:hover { border-color: var(--line-2); }
.ai-mini { font: 650 9.5px var(--font-ui); letter-spacing: .03em; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); text-transform: uppercase; }
.ai-mini.up { background: var(--up-soft); color: var(--up); } .ai-mini.dn { background: var(--dn-soft); color: var(--dn); } .ai-mini.warn { background: var(--warn-soft); color: var(--warn); }
.ai-list { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 3px; font-size: 12.5px; }
.lvl i { font-style: normal; color: var(--muted); }
.seg-fill { display: flex; height: 34px; align-items: stretch; }
.seg-fill button { flex: 1; height: auto; }
.seg-sm button { height: 20px; padding: 0 8px; font-size: 11px; }
.input.sm { height: 26px; font-size: 12px; padding: 0 8px; }
.dock-sh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 14px 4px; font-weight: 560; }
a.news-item { color: inherit; }
a.news-item:hover { background: var(--hover); }
.clickable { cursor: pointer; }
.tbl.log .datehdr td { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 7px 10px; }
.tbl.log .dh { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.tbl.log .dh .tw { width: 12px; color: var(--muted); }
.tbl.log tr.sub-h th { position: static; font-size: 10.5px; padding: 6px 10px; background: var(--surface); }
.tbl.log tr.expanded td { background: var(--accent-soft); }
.legrow > td { padding: 4px 10px 10px 34px !important; background: var(--surface-2); }
.legpad { padding: 8px 4px; font-size: 12px; }
.legs-in { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.legs-in th { position: static; }
.audit-d { white-space: normal !important; font-size: 11.5px; color: var(--ink-2); word-break: break-word; }
#chSrc .txn { padding: 0 4px; }
.ch-head { min-height: 64px; }
.dock .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.dock .tabs::-webkit-scrollbar { display: none; }
.dock .tabs #dockMeta { white-space: nowrap; }
.tabs button { white-space: nowrap; flex: none; }
#dockMeta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.ad-kv { display: inline-block; margin: 0 12px 2px 0; font: 11.5px var(--font-num); color: var(--ink); }
.ad-kv i { font-style: normal; color: var(--muted); font-family: var(--font-ui); }

/* ---------- analytics (real app) ---------- */
.viz-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; min-height: 26px; flex-wrap: wrap; }
.viz-h h2 { font-size: 13px; font-weight: 620; }
.viz-h .mut { font-size: 12px; }
.viz-h + .viz { margin-bottom: 8px; }
.conf { display: grid; grid-template-columns: auto 1fr 1fr; gap: 3px 10px; font-size: 11.5px; align-items: center; margin-top: 4px; }
.conf b { font: 600 15px var(--font-num); }
.metrics-t td { padding: 7px 12px; }
.metrics-t td:nth-child(2), .metrics-t td:nth-child(3) { text-align: right; }
.metrics-t tr.mh td { background: var(--surface-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 560; }
.an-notes summary span { color: var(--ink-2); }
#kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) { #kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { #kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- premium: halted card, inline banner, shared /m2 sheets restyled for the desk ---------- */
.book.halted { border-color: color-mix(in srgb, var(--dn) 45%, var(--line)); }
.pm-inline-banner { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 9px 14px; }
html:root {
  --pm-panel: var(--surface); --pm-panel2: var(--surface-2); --pm-line: var(--line); --pm-ink: var(--ink);
  --pm-muted: var(--muted); --pm-up: var(--up); --pm-dn: var(--dn); --pm-warn: var(--warn); --pm-blue: var(--accent);
  --font-mono: var(--font-num);
}
body.desk .pm-modal { z-index: 300; }
body.desk .pmc-top { z-index: 320; }
body.desk .pm-backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
body.desk .pm-sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 820px); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px 20px; font: 13px/1.45 var(--font-ui); }
body.desk .pmA-sheet { width: min(880px, calc(100vw - 32px)); }
body.desk .pm-x { top: 12px; right: 12px; border-radius: 7px; font-size: 15px; }
body.desk .pm-x:hover { background: var(--hover); color: var(--ink); }
body.desk .pm-name { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
body.desk .pm-badge { border-radius: 999px; padding: 3px 7px; }
body.desk .pm-btn { height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: 560 12.5px var(--font-ui); }
body.desk .pm-btn:hover:not(:disabled) { background: var(--hover); }
body.desk .pm-btn.ok { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
body.desk .pm-btn.bad { background: var(--dn); border-color: var(--dn); color: #fff; }
body.desk .pm-btn.warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); background: var(--warn-soft); }
body.desk .pm-btn.ghost { background: transparent; color: var(--ink-2); }
body.desk .pm-note { border-radius: var(--radius-sm); }
body.desk .pmc-in input[type=number], body.desk .pmc-in input[type=time], body.desk .pmc-in input[type=text], body.desk .pmc-in select, body.desk .pmc-typed input {
  height: 32px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface-2); font: 500 12.5px var(--font-num); }
body.desk .pmc-in input:focus, body.desk .pmc-in select:focus, body.desk .pmc-typed input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body.desk .pmc-sech { font: 650 10.5px var(--font-ui); letter-spacing: .08em; }
body.desk .pmc-row { border-bottom-style: dashed; }
body.desk .pmc-switch input:checked + i { background: var(--accent); } body.desk .pmc-switch input:checked + i::after { background: #fff; }
.book .pbar { width: 104px; }
.book .pb-l { min-width: 70px; }
.book .tbl th:first-child, .book .tbl td:first-child { padding-left: 14px; }
.book .tbl th:last-child, .book .tbl td:last-child { padding-right: 14px; }
body.desk .pmA-head { font-size: 16px; font-weight: 650; padding-right: 40px; }
body.desk .pmA-hint { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
body.desk .pmA-body { max-height: 66vh; overflow-y: auto; margin-top: 12px; border-top: 1px solid var(--line); }
body.desk .pmA-row { display: grid; grid-template-columns: 128px 118px auto minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 12px; }
body.desk .pmA-row:hover { background: var(--hover); }
body.desk .pmA-ts { font-family: var(--font-num); color: var(--muted); white-space: nowrap; }
body.desk .pmA-ev { font: 600 11.5px var(--font-num); color: var(--ink); }
body.desk .pmA-config .pmA-ev { color: var(--warn); }
body.desk .pmA-book { font-size: 10.5px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
body.desk .pmA-fields { font: 11.5px var(--font-num); color: var(--ink-2); overflow-wrap: anywhere; }
body.desk .pmA-empty { padding: 18px 0; color: var(--muted); }
body.desk .pmc-pickrow { background: none; color: var(--ink); font: inherit; }
body.desk .pm-sub { font: 12px/1.5 var(--font-ui); }

/* ---------- market read: trade ideas ---------- */
.idea-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); border-top: 1px solid var(--line); }
.idea { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; padding: 14px; display: grid; gap: 8px; align-content: start; }
.idea-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idea-h b { font-size: 13.5px; font-weight: 650; }
.idea p { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.idea-cav { font-size: 11.5px; color: var(--warn); padding-left: 14px; position: relative; }
.idea-cav::before { content: "!"; position: absolute; left: 0; font-weight: 700; }
.set-nav a i { min-width: 16px; text-align: right; color: var(--warn); }
.mode-pick.dirty button.on { box-shadow: 0 0 0 3px var(--warn-soft); }
.input-wrap .eye { border: 0; background: none; cursor: pointer; font: 500 11px var(--font-ui); color: var(--accent); }
textarea.input.code { height: auto; }

/* ---------- position panel: market news & events card ---------- */
.nc-list { display: grid; max-height: 300px; overflow: auto; margin: 0 -14px -14px; border-top: 1px solid var(--line); }
.nc-list > .mut { padding: 10px 14px !important; }
a.nc-item { display: grid; gap: 2px; padding: 9px 14px; border-bottom: 1px solid var(--line); color: inherit; }
a.nc-item:hover { background: var(--hover); }
.nc-item .t, .nc-ev .t { font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.nc-item .s { font-size: 11px; color: var(--muted); }
.nc-ev { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.nc-ev .s { font-size: 11px; color: var(--muted); white-space: nowrap; }
.nc-ev.hot { background: var(--dn-soft); }
.nc-list > :last-child { border-bottom: 0; }

/* ---------- premium: one book per row, payoff in a right-hand column ---------- */
.pm-books { grid-template-columns: minmax(0, 1fr) !important; }
.book { container-type: inline-size; }
.book-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); }
.book-body.flat { grid-template-columns: minmax(0, 1fr); }
.book-main { min-width: 0; }
.book-po { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.book-po .po-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; }
.book-po .po-h .legend { font-size: 11px; display: flex; gap: 10px; }
.book .book-po .payoff { flex: 1; min-height: 150px; padding: 6px 14px 0; }
.book .book-po .payoff svg { width: 100%; height: 100%; }
.book-po .po-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.book-po .po-stats > div { padding: 8px 14px; display: grid; gap: 1px; min-width: 0; }
.book-po .po-stats > div + div { border-left: 1px solid var(--line); }
.book-po .po-stats span { font-size: 11px; color: var(--muted); }
.book-po .po-stats b { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 980px) {
  .book-body { grid-template-columns: minmax(0, 1fr); }
  .book-po { border-left: 0; border-top: 1px solid var(--line); }
  .book .book-po .payoff { min-height: 140px; height: 140px; flex: none; }
}
@container (min-width: 1250px) { .book .pbar { width: 170px; } }

/* ---------- FitTrader brand ---------- */
.brand-ic { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.brand-word-img { height: 15px; width: auto; display: block; }
.brand-word-txt { display: none; font-weight: 750; letter-spacing: .01em; }
.brand-word-txt b { color: #16b884; font-weight: 750; }
[data-theme="light"] .brand-word-img { display: none; }
[data-theme="light"] .brand-word-txt { display: inline; }
#ft-splash { position: fixed; inset: 0; z-index: 5000; background: #111317; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; transition: opacity .3s ease; }
#ft-splash img:first-child { width: 128px; height: 128px; border-radius: 28px; }
#ft-splash img:last-child { width: 220px; height: auto; }
#ft-splash.out { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #ft-splash { transition: none; } }

/* ---- premium: whole-position payoff (open legs + what closed legs booked) ---- */
.pmd-hpnl { display: grid; justify-items: end; line-height: 1.1; }
.pmd-hpnl small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pmd-hpnl b { font-size: 18px; }
.pmd-strip small { font-size: 10.5px; }
.pmd-ponote { margin: 6px 2px 0; font-size: 11.5px; }
.po-booked { margin-left: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.po-booked b { font-weight: 550; }
.pmd-postrip > div, .book-po .po-stats > div { align-content: start; }
.book-po .po-stats > div:last-child b { white-space: normal; overflow: visible; text-overflow: clip; }

/* ---------- signal desk: collapsible settings (settings-page layout) ---------- */
.sg-set-h { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 48px; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.sg-set-h:hover { background: var(--hover); }
.sg-set-h h2 { font-size: 13px; font-weight: 620; white-space: nowrap; }
.sg-set-h .chev { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; flex: none; }
.sg-set-h[aria-expanded="true"] .chev { transform: rotate(90deg); }
.sg-set-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; min-width: 0; }
.sg-set-ro { font-size: 12px; white-space: nowrap; }
.sg-set-b { margin-top: 16px; }
.sg-set-b .set-body { padding-bottom: 16px; }
.sg-set-b .set-row { grid-template-columns: minmax(0, 1fr) minmax(200px, auto); }
.sg-set-b .set-row .ctl { font: 500 12.5px var(--font-num); text-align: right; }
@media (max-width: 900px) { .sg-set-ro { display: none; } }
#sg-body tr.sg-day td { background: var(--surface-2); padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12px; }
#sg-body tr.sg-day td b { font-weight: 620; margin-right: 12px; }
#sg-body tr.sg-day td span { color: var(--muted); }
#sg-body tr.sg-day:hover td { background: var(--surface-2); }

/* ---- (i) info icon + tooltip box (desk/infotip.js places the box; any page that loads it) ---- */
.info-tip { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted);
  font: italic 600 10px/1 Georgia, "Times New Roman", serif; cursor: help; flex: none; user-select: none; vertical-align: middle; }
.info-tip:hover, .info-tip:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.info-tip-box { position: fixed; z-index: 400; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; pointer-events: none; white-space: pre-line; overflow-wrap: anywhere; }
.info-tip-box:has(> *) { white-space: normal; }
.kpi .v .info-tip { margin-left: 6px; position: relative; top: -2px; }

/* ---- signal desk settings editor (signals-config.js) ---- */
.sgc-body { gap: 4px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.sgc-path { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 160px; }
.sgc-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 11.5px; padding-bottom: 6px; }
.sgc-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 10px 0 2px; }
.sgc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 0 16px; min-width: 0; }
.sgc-row { display: grid; gap: 6px; padding: 9px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.sgc-row.changed { background: var(--accent-soft); }
.sgc-k { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.sgc-k b { font-weight: 600; }
.sgc-v { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.sgc-v small { font-size: 11px; }
.sgc-in { display: inline-flex; align-items: center; gap: 6px; }
.sgc-in input { width: 110px; height: 30px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-family: var(--font-num); }
.sgc-in input:focus { border-color: var(--accent); outline: none; }
.sgc-in i { font-style: normal; color: var(--muted); font-size: 12px; }
.sgc-err { font-style: normal; font-size: 11.5px; }
.sgc-tag { font-size: 9.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.sgc-tag-live { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.sgc-tag-restart { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.seg button.sgc-live.on { color: var(--dn); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 11px; cursor: pointer; }
.sgc-foot { display: grid; gap: 8px; justify-content: stretch; }
.sgc-diff { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; max-height: 120px; overflow: auto; }
.sgc-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sgc-hist { margin-top: 10px; font-size: 12px; }
.sgc-hist summary { cursor: pointer; color: var(--ink-2); font-weight: 550; }
.sgc-hist ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; font-family: var(--font-num); font-size: 11.5px; }

/* ---- adjust ticket: wider dialog, today's options on the left, strategy builder on the right ---- */
.modal.adj { width: min(1280px, calc(100vw - 32px)); }
.adj-grid { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 20px; align-items: start; }
.adj-left { display: grid; gap: 14px; min-width: 0; align-content: start; }
.adj-build { display: grid; gap: 12px; min-width: 0; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.adj-build-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.adj-build-h .eyebrow { margin: 0; }
.adj-key { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.adj-key i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--accent); }
.adj-key i.k-now { border-top: 1.5px dashed var(--muted); }
.adj-key i.k-be { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--warn); }
.adj-chartbox, #adjChart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 2px; }
.adj-chart { display: block; width: 100%; height: auto; }
.adj-up { fill: var(--up-soft); } .adj-dn { fill: var(--dn-soft); }
.adj-zero { stroke: var(--line-2); } .adj-grid-l { stroke: var(--chart-grid); }
.adj-main { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.adj-now { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.adj-spot { stroke: var(--accent); stroke-dasharray: 3 3; opacity: .75; }
.adj-what { stroke: var(--ink); opacity: .3; }
.adj-what-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; }
.adj-be { fill: var(--warn); } .adj-be-now { fill: none; stroke: var(--warn); stroke-width: 1.4; }
.adj-t { font: 500 10.5px var(--font-num); fill: var(--muted); } .adj-t-spot { fill: var(--accent); }
.adj-what-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.adj-what-row input { flex: 1; accent-color: var(--accent); min-height: 28px; }
.adj-what-row b { min-width: 64px; text-align: right; font-size: 13px; color: var(--ink); }
.adj-cmp { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.adj-cmp-h, .adj-cmp-r { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)) minmax(0, .9fr); gap: 8px; padding: 8px 12px; align-items: center; }
.adj-cmp-h { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.adj-cmp-h span:not(:first-child), .adj-cmp-r > :not(:first-child) { text-align: right; }
.adj-cmp-r { border-bottom: 1px solid var(--chart-grid); font-size: 12.5px; }
.adj-cmp-r:last-child { border-bottom: 0; }
.adj-cmp-r > span:first-child { color: var(--ink-2); }
.adj-cmp-r .mut { color: var(--muted); } .adj-cmp-r .pos { color: var(--up); } .adj-cmp-r .neg { color: var(--dn); }
.adj-orders { display: grid; gap: 6px; }
.adj-orders .eyebrow { margin: 0 0 2px; }
.adj-ord { display: flex; align-items: center; gap: 10px; font-size: 12px; min-width: 0; }
.adj-ord .mono { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.adj-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; border-radius: 5px; padding: 2px 6px; min-width: 42px; text-align: center; flex: none; }
.adj-tag-open { color: var(--up); background: var(--up-soft); } .adj-tag-close { color: var(--warn); background: var(--warn-soft); }
.adj-tag-keep { color: var(--muted); background: var(--surface-3); }
.adj-foot { font-size: 11.5px; margin: 0; line-height: 1.45; }
@media (max-width: 1000px) { .adj-grid { grid-template-columns: minmax(0, 1fr); } }

/* next-signal board (live desk dock, R28) */
.nx-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 11.5px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tbl.nx td { vertical-align: middle; }
.tbl.nx .nx-ev { white-space: nowrap; }
.tbl.nx .nx-lv { font-size: 11px; margin-top: 1px; }
.tbl.nx .nx-lv b { color: var(--ink); font-weight: 600; }
.tbl.nx .nx-ev svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; fill: none; stroke: currentColor; stroke-width: 2; }
.tbl.nx tr.nx-fire td { background: var(--accent-soft); }
.nx-meter { display: inline-block; width: 46px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.nx-meter i { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.nx-meter.on i { background: var(--accent); }
.accent-t { color: var(--accent); }
