/* Bracket: a one-person NIFTY options terminal. Operate surface: dense, familiar controls, numbers first.
   World: Inter with tabular figures on a white page, Buy dark green / Sell dark coral, and one
   signature element, the bracket rail (stop, entry, live price, target on one scale). */
@font-face { font-family: Inter; src: url(vendor/fonts/inter-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(vendor/fonts/inter-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(vendor/fonts/inter-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --paper: #ffffff; --shell: #f4f6fa; --field: #f1f3f7; --rule: #e3e6ec; --rule-strong: #cfd4dc;
  --ink: #14171c; --slate: #586170; --faint: #6b7483;
  --buy: #2456d6; --buy-ink: #ffffff; --sell: #c2410c; --sell-ink: #ffffff;
  --up: #0c8446; --dn: #cf2638; --warn: #9a5b00; --warn-bg: #fff5e0;
  --sl: #cf2638; --tg: #0c8446; --en: #2456d6;
  --buy-wash: #eaf0fd; --sell-wash: #fdeee7; --up-wash: #e6f4ec; --dn-wash: #fbe9eb;
  --scrim: rgba(17, 22, 31, .42);
  --shadow: 0 8px 28px rgba(17, 22, 31, .16), 0 2px 6px rgba(17, 22, 31, .08);
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --t-11: .6875rem; --t-12: .78rem; --t-14: .875rem; --t-16: 1rem; --t-18: 1.15rem; --t-21: 1.32rem; --t-26: 1.62rem;
  --nav-h: 60px; --top-h: 52px; --act-h: 58px; --leg-h: 44px; --tools-h: 112px; --gx: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { margin: 0; min-height: 100%; background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink);
  font: 400 var(--t-14)/1.4 Inter, system-ui, sans-serif; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
::selection { background: var(--buy-wash); color: var(--ink); }
:focus-visible { outline: 2px solid var(--buy); outline-offset: 2px; border-radius: var(--r-sm); }
h1, h2, h3 { margin: 0; font-weight: 600; }
b { font-weight: 600; }
.num, input[type=number] { font-variant-numeric: tabular-nums; }
.sub { color: var(--slate); font-size: var(--t-12); }
.up { color: var(--up); } .dn { color: var(--dn); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { cursor: default; opacity: .4; }
input { font: inherit; color: var(--ink); caret-color: var(--buy); background: var(--field); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 12px; width: 100%; min-width: 0; min-height: 44px; transition: border-color .15s, background .15s; }
input:focus { outline: none; border-color: var(--buy); background: var(--paper); }
input::placeholder { color: var(--slate); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input:disabled { color: var(--faint); }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 42px; min-width: 42px; height: 24px; min-height: 0; padding: 0; border-radius: 12px; border: 0;
  background: var(--rule-strong); position: relative; cursor: pointer; transition: background .2s; }
input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
input[type=checkbox]:checked { background: var(--buy); }
input[type=checkbox]:checked::after { transform: translateX(18px); }

/* ---------- shell ---------- */
#banner { position: sticky; top: 0; z-index: 40; background: var(--warn-bg); color: var(--warn); padding: 10px var(--gx); font-size: var(--t-14); font-weight: 500; border-bottom: 1px solid var(--rule); }
#banner a { color: inherit; font-weight: 600; }
#top { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 var(--gx);
  position: sticky; top: 0; background: var(--paper); z-index: 20; border-bottom: 1px solid var(--rule); }
#top-title { font-size: var(--t-18); letter-spacing: -.01em; }
#top-right { display: flex; align-items: center; gap: 2px; }
#feed { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-12); color: var(--slate); padding: 4px 8px; border-radius: 12px; background: var(--shell); }
#feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
#feed[data-s=live] #feed-dot { background: var(--up); box-shadow: 0 0 0 3px var(--up-wash); }
#feed[data-s=live] { color: var(--up); }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--slate); }
.iconbtn:active { background: var(--field); }
.iconbtn.sm { width: 36px; height: 36px; } .iconbtn.sm svg { width: 20px; height: 20px; }

main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.view { display: none; } .view.on { display: block; }
#tabs { position: fixed; inset: auto 0 0 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--shell); border-top: 1px solid var(--rule); z-index: 30; }
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: var(--t-11); color: var(--slate); font-weight: 500; }
#tabs button svg { width: 22px; height: 22px; }
#tabs button.on { color: var(--buy); }
#tabs button.on svg { stroke-width: 2.1; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px var(--gx); min-height: 60px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.row:active { background: var(--shell); }
.row .l { flex: 1; min-width: 0; }
.row .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r { text-align: right; white-space: nowrap; }
.row .px { font-weight: 600; font-variant-numeric: tabular-nums; }
.row .sub { margin-top: 2px; }
.link { font: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; padding: 4px 0; margin: -4px 0; text-align: left; }
.link:active { color: var(--buy); text-decoration-color: var(--buy); }
.kind { font-size: var(--t-11); color: var(--slate); background: var(--field); border-radius: 4px; padding: 1px 5px; margin-left: 6px; font-weight: 500; vertical-align: 1px; }
.status { font-size: var(--t-11); font-weight: 600; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.status.ok { color: var(--up); background: var(--up-wash); } .status.bad { color: var(--dn); background: var(--dn-wash); }
.status.pend { color: var(--warn); background: var(--warn-bg); } .status.dry { color: var(--buy); background: var(--buy-wash); }
.add { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--buy); border: 1px solid var(--rule-strong); }
.add svg { width: 18px; height: 18px; }
.add.on { background: var(--buy); color: var(--buy-ink); border-color: var(--buy); }
.row-actions { display: flex; gap: 8px; padding: 10px var(--gx) 12px; border-bottom: 1px solid var(--rule); background: var(--shell); }
.row-actions .btn { flex: 1; min-height: 40px; }
.row-actions .iconbtn { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--rule-strong); }
.row.open { background: var(--shell); border-bottom-color: transparent; }
.empty { padding: 40px 28px; color: var(--slate); text-align: center; line-height: 1.55; }
.empty b { color: var(--ink); }
.searchbar { padding: 10px var(--gx); position: sticky; top: var(--top-h); background: var(--paper); z-index: 10; border-bottom: 1px solid var(--rule); }
.search { display: flex; align-items: center; gap: 8px; background: var(--field); border-radius: var(--r); padding: 0 12px; color: var(--faint); }
.search input { background: transparent; border: 0; padding-left: 0; }
.search input:focus { background: transparent; }
.search:focus-within { box-shadow: 0 0 0 2px var(--buy); }
.group-h { font-size: var(--t-12); font-weight: 600; color: var(--slate); padding: 14px var(--gx) 6px; background: var(--paper); }
.list.flush .row { padding-left: 0; padding-right: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r-sm); font-weight: 600; letter-spacing: .005em; transition: filter .15s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.buy { background: var(--buy); color: var(--buy-ink); } .btn.sell { background: var(--sell); color: var(--sell-ink); }
.btn.primary { background: var(--buy); color: var(--buy-ink); }
.btn.ghost { border: 1px solid var(--rule-strong); color: var(--ink); background: var(--paper); }
.btn.danger { border: 1px solid var(--dn); color: var(--dn); background: var(--paper); }
.btn.block { width: 100%; min-height: 52px; font-size: var(--t-16); }
.btn small { font-weight: 500; opacity: .85; font-size: var(--t-12); }
.seg { display: inline-flex; background: var(--field); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { padding: 6px 10px; min-height: 32px; border-radius: 4px; font-size: var(--t-12); font-weight: 500; color: var(--slate); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.lv-idx { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 12px; padding: 8px 10px; background: var(--paper); border-bottom: 1px solid var(--rule);
  max-width: 100%; box-sizing: border-box; }
.lv-idx-k { flex: 0 0 auto; font-size: var(--t-11); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--slate); }
.lv-idx button { flex: 0 1 auto; min-width: 0; white-space: nowrap; min-height: 44px; padding: 10px 16px; font-weight: 600; }
.lv-idx .seg { margin-left: 0; }
.lv-idx button.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.lv-idx button:not(.on):hover { color: var(--ink); }
.seg.full { display: flex; } .seg.full button { flex: 1; min-height: 38px; font-size: var(--t-14); }
.tabs-inline { display: flex; gap: 4px; padding: 10px calc(var(--gx) - 12px) 0; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs-inline button { padding: 10px 12px; font-weight: 500; color: var(--slate); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs-inline button.on { color: var(--buy); border-bottom-color: var(--buy); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button, .quick button { border: 1px solid var(--rule-strong); border-radius: 16px; padding: 6px 12px; min-height: 32px; font-size: var(--t-12); font-weight: 500; color: var(--slate); }
.chips button.on { border-color: var(--buy); color: var(--buy); background: var(--buy-wash); }
.chips button b, .quick button b { color: var(--ink); font-weight: 600; }

/* ---------- chart ---------- */
#ch-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 12px var(--gx) 4px; gap: 12px; }
#ch-sym { font-weight: 600; font-size: var(--t-16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-id { min-width: 0; }
.ch-quote { text-align: right; white-space: nowrap; }
#ch-ltp { font-size: var(--t-21); font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
#ch-chg { font-size: var(--t-12); font-weight: 500; }
#ch-tools { display: flex; justify-content: space-between; align-items: center; padding: 6px calc(var(--gx) - 4px) 6px var(--gx); gap: 8px; }
#ch-wrap { position: relative; }
#chart { height: calc(100svh - var(--top-h) - var(--nav-h) - var(--act-h) - var(--tools-h) - var(--leg-h) - env(safe-area-inset-bottom)); min-height: 300px; touch-action: none; }
#v-chart.has-bk #chart { height: calc(100svh - var(--top-h) - var(--nav-h) - var(--act-h) - var(--tools-h) - var(--leg-h) - 238px - env(safe-area-inset-bottom)); min-height: 220px; }
/* the candle readout: its own strip above the chart, so it never covers candles or the price axis */
#ch-legend { height: var(--leg-h); box-sizing: border-box; padding: 4px var(--gx) 5px; font-size: var(--t-12); color: var(--slate); font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; border-top: 1px solid var(--rule); white-space: nowrap; overflow: hidden; }
#ch-legend[data-pinned="1"] { background: var(--field); }
#ch-legend:empty { visibility: hidden; }
.lg-meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.lg-meta .when { color: var(--ink); font-weight: 600; }
.lg-note { margin-left: auto; color: var(--faint); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lg-ohlc { display: flex; justify-content: space-between; gap: 8px; }
.lg-ohlc b { color: var(--ink); font-weight: 500; }
#ch-zoom { position: absolute; right: 76px; top: 8px; z-index: 3; display: flex; background: var(--paper); border-radius: var(--r-sm);
  box-shadow: 0 1px 2px rgba(17,22,31,.12), 0 0 0 1px var(--rule); overflow: hidden; }
#ch-zoom button { min-width: 38px; height: 32px; padding: 0 10px; font-size: var(--t-16); font-weight: 600; color: var(--ink); }
#ch-zoom button + button { border-left: 1px solid var(--rule); }
#ch-zoom button[data-z=reset] { font-size: var(--t-12); color: var(--slate); }
#ch-zoom button:active { background: var(--field); }
.actionbar { display: flex; gap: 10px; padding: 8px var(--gx); position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--paper);
  border-top: 1px solid var(--rule); z-index: 5; }
.actionbar .btn { flex: 1; min-height: 42px; font-size: var(--t-16); }
#ch-setups .row { min-height: 0; flex: none; }

/* ---------- the bracket (signature: the rail) ---------- */
.bracket { padding: 12px var(--gx) 14px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--shell); }
.bk-top { display: flex; align-items: center; gap: 8px; }
.bk-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-12); font-weight: 600; }
.bk-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.bk-state[data-s=live] { color: var(--up); } .bk-state[data-s=live]::before { background: var(--up); box-shadow: 0 0 0 3px var(--up-wash); }
.bk-state[data-s=arm] { color: var(--warn); } .bk-state[data-s=arm]::before { background: var(--warn); }
.bk-state[data-s=err] { color: var(--dn); } .bk-state[data-s=err]::before { background: var(--dn); }
.bk-state[data-s=done] { color: var(--slate); }
.bk-pnl { margin-left: auto; font-weight: 600; font-size: var(--t-16); font-variant-numeric: tabular-nums; }
/* what the trailed stop already keeps, next to the live P&L */
.bk-lock { margin-left: 8px; font-size: var(--t-12); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-state + .bk-lock, .status + .bk-lock { margin-left: auto; }
.bk-sym { font-weight: 600; margin: 6px 0 2px; display: flex; justify-content: space-between; gap: 8px; }
.bk-sym .sub { font-weight: 400; }
.rail { position: relative; height: 72px; margin: 10px 4px 4px; }
.rail-track { position: absolute; left: 0; right: 0; top: 22px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--dn-wash), var(--field) 45%, var(--field) 55%, var(--up-wash)); }
.rail-fill { position: absolute; top: 22px; height: 6px; border-radius: 3px; transition: left .25s ease-out, width .25s ease-out; }
.rail-fill.gain { background: var(--up); } .rail-fill.loss { background: var(--dn); }
.rail-tick { position: absolute; top: 16px; width: 2px; height: 18px; margin-left: -1px; border-radius: 1px; }
.rail-tick.sl { background: var(--sl); } .rail-tick.tg { background: var(--tg); } .rail-tick.en { background: var(--en); }
.rail-lbl { position: absolute; top: 36px; transform: translateX(-50%); font-size: var(--t-11); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--slate); }
.rail-lbl b { display: block; font-weight: 600; color: var(--ink); font-size: var(--t-12); }
.rail-lbl.edge-l { transform: none; text-align: left; } .rail-lbl.edge-r { transform: translateX(-100%); text-align: right; }
.rail-lbl.row2 { top: 70px; }
.rail-lbl.sl b { color: var(--sl); } .rail-lbl.tg b { color: var(--tg); } .rail-lbl.en b { color: var(--en); }
.rail-now { position: absolute; top: 0; transform: translateX(-50%); transition: left .25s ease-out; display: flex; flex-direction: column; align-items: center; }
.rail-now span { font-size: var(--t-11); font-weight: 600; background: var(--ink); color: var(--paper); border-radius: 4px; padding: 1px 5px; font-variant-numeric: tabular-nums; }
.rail-now i { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--ink); }
.rail-h { position: absolute; top: 4px; width: 44px; height: 46px; margin-left: -22px; z-index: 2; touch-action: none; cursor: ew-resize; display: grid; place-items: center; }
.rail-h i { width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid currentColor; box-shadow: 0 1px 3px rgba(17,22,31,.25); margin-top: -12px; transition: transform .12s; }
.rail-h.sl { color: var(--sl); } .rail-h.tg { color: var(--tg); } .rail-h.en { color: var(--en); }
.rail-h.on i { transform: scale(1.35); background: currentColor; }
.bk-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.bk-legs.one { grid-template-columns: 1fr; }
.bk-leg { display: flex; align-items: center; justify-content: space-between; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 4px 4px 4px 10px; }
.bk-leg .k { font-size: var(--t-11); color: var(--slate); } .bk-leg .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-leg.sl .v { color: var(--sl); } .bk-leg.tg .v { color: var(--tg); } .bk-leg.en .v { color: var(--en); }
.bk-leg .ed { display: flex; }
.bk-leg .ed button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 4px; color: var(--slate); }
.bk-leg .ed button:active { background: var(--field); }
.bk-leg .ed svg { width: 18px; height: 18px; }
.bk-last { font-size: var(--t-12); color: var(--slate); margin-top: 8px; }
.bk-acts { display: flex; gap: 8px; margin-top: 10px; }
.bk-acts .btn { flex: 1; min-height: 40px; font-size: var(--t-14); white-space: nowrap; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; background: var(--scrim); z-index: 50; display: flex; align-items: flex-end; animation: fade .18s ease-out; }
.sheet-body { width: 100%; max-height: 92svh; overflow-y: auto; background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 4px var(--gx) 0;
  box-shadow: var(--shadow); animation: rise .22s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
.sheet-body.small { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-body, .rail-now, .rail-fill { animation: none; transition: none; } }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--rule-strong); margin: 6px auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.sheet-head h2 { font-size: var(--t-18); letter-spacing: -.01em; }
.sheet-head .iconbtn { margin: -6px -10px 0 0; }
.sheet-body h3 { font-size: var(--t-14); margin: 22px 0 8px; }
.side { display: flex; background: var(--field); border-radius: var(--r-sm); padding: 3px; margin-bottom: 14px; }
.side button { flex: 1; min-height: 40px; border-radius: 4px; font-weight: 600; color: var(--slate); }
.side button[data-v=BUY].on { background: var(--buy); color: var(--buy-ink); }
.side button[data-v=SELL].on { background: var(--sell); color: var(--sell-ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.lbl { font-size: var(--t-12); color: var(--slate); font-weight: 500; display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; }
.field.wrap .lbl { white-space: normal; line-height: 1.35; }   /* a long label wraps instead of running off a phone screen */
.lbl i { font-style: normal; color: var(--faint); font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stepper { display: flex; align-items: stretch; background: var(--field); border-radius: var(--r-sm); border: 1px solid transparent; }
.stepper:focus-within { border-color: var(--buy); background: var(--paper); }
.stepper input { text-align: center; background: transparent; border: 0; padding: 10px 2px; font-weight: 600; font-size: var(--t-16); }
.stepper input:focus { background: transparent; }
.stepper button { width: 40px; display: grid; place-items: center; color: var(--slate); }
.stepper button svg { width: 18px; height: 18px; }
.stepper button:active { color: var(--ink); background: var(--rule); }
.field.sl .stepper input { color: var(--sl); } .field.tg .stepper input { color: var(--tg); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 10px; }
.quick:empty { display: none; }
.risk { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: var(--r-sm); background: var(--shell); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.risk .rr { font-weight: 600; }
.risk[data-bad="1"] .rr { color: var(--dn); }
.risk[data-good="1"] .rr { color: var(--up); }
.note { font-size: var(--t-12); color: var(--slate); padding: 8px 12px; border-radius: var(--r-sm); background: var(--shell); margin-bottom: 8px; line-height: 1.45; }
.note.warn, .note[data-warn="1"] { color: var(--warn); background: var(--warn-bg); }
.trail { border: 1px solid var(--rule); border-radius: var(--r); margin: 8px 0 4px; }
.trail summary { list-style: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; cursor: pointer; font-weight: 500; }
.trail summary::-webkit-details-marker { display: none; }
.trail[open] summary { border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.trail > *:not(summary) { margin-left: 14px; margin-right: 14px; }
.trail .chips { margin-bottom: 12px; }
.o-armlv { margin: -2px 0 12px; }
.o-armlv .lbl { margin-bottom: 6px; }
.o-armlv .chips button { display: inline-flex; align-items: baseline; gap: 5px; }
.o-armlv .chips button .k { font-weight: 600; color: var(--slate); }
.o-armlv .chips button small { font-size: 11px; }
.o-armlv .chips button.near { border-color: var(--ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; }
.toggle span { display: flex; flex-direction: column; gap: 2px; }
.toggle small { color: var(--slate); font-size: var(--t-12); }
.sheet-body > .toggle { border-bottom: 1px solid var(--rule); }
.sheet-foot { position: sticky; bottom: 0; background: var(--paper); padding: 8px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 8px; border-top: 1px solid var(--rule); }
.toggle.compact { padding: 4px 0 10px; }
#o-dry:checked { background: var(--warn); }
.hint { font-size: var(--t-12); color: var(--dn); padding: 0 0 8px; line-height: 1.45; }
.hint.lock { color: var(--warn); }

/* ---------- modal + toast ---------- */
.modal { position: fixed; inset: 0; background: var(--scrim); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease-out; }
.modal-box { background: var(--paper); border-radius: var(--r-lg); padding: 20px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
#m-text { white-space: pre-wrap; margin-bottom: 16px; line-height: 1.5; }
#m-input { margin-bottom: 16px; font-size: var(--t-18); font-weight: 600; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--act-h) + env(safe-area-inset-bottom)); z-index: 70;
  background: var(--ink); color: var(--paper); padding: 12px 14px; border-radius: var(--r); box-shadow: var(--shadow); white-space: pre-wrap; animation: rise .2s ease-out; line-height: 1.45; }

/* ---------- positions ---------- */
.pnl-head { padding: 20px var(--gx) 16px; border-bottom: 1px solid var(--rule); background: var(--shell); }
.pnl-head .k { color: var(--slate); font-size: var(--t-12); font-weight: 500; }
.pnl-head .v { font-size: var(--t-26); font-weight: 600; letter-spacing: -.015em; margin-top: 2px; }
.pnl-head .s { font-size: var(--t-12); color: var(--slate); margin-top: 4px; line-height: 1.6; }
.pnl-parts { color: var(--faint); }

/* ---------- levels ---------- */
#lv { padding: 0 var(--gx) 24px; }
.lv-sec { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.lv-sec:last-child { border-bottom: 0; }
.lv-h { font-size: var(--t-14); font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lv-h .sub { font-weight: 400; }
.lv-verdict { font-weight: 600; font-size: var(--t-18); padding: 12px 14px; border-radius: var(--r); background: var(--shell); margin: 2px 0 10px; letter-spacing: -.01em; }
.lv-verdict small { display: block; font-size: var(--t-12); font-weight: 500; color: var(--slate); margin-top: 2px; letter-spacing: 0; }
.lv-verdict[data-v=buyers] { background: var(--up-wash); color: var(--up); }
.lv-verdict[data-v=sellers] { background: var(--dn-wash); color: var(--dn); }
.lv-why { font-size: var(--t-14); line-height: 1.6; }
.lv-why div { display: flex; gap: 8px; }
.lv-why i { font-style: normal; width: 14px; flex: none; text-align: center; }
.lv-why .ctx { color: var(--slate); font-size: var(--t-12); margin-top: 6px; display: block; }
.lv-row { display: grid; grid-template-columns: 64px 1fr 72px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.lv-row:last-child { border-bottom: 0; }
.lv-row span:nth-child(2) { font-weight: 500; }
.lv-row span:last-child { text-align: right; }
.lv-row[data-c=ltp] { color: var(--buy); font-weight: 600; }
.lv-mk { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.lv-mk:last-child { border-bottom: 0; }
.lv-mk .v { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; }
.lv-mk .v span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.lv-mk[data-tone=up] .v span:last-child { color: var(--up); } .lv-mk[data-tone=down] .v span:last-child { color: var(--dn); }
.lv-mk[data-tone=warn] .v span:last-child { color: var(--warn); }
.lv-m { font-size: var(--t-12); color: var(--slate); line-height: 1.5; margin-top: 2px; }
.lv-m[data-warn="1"] { color: var(--warn); }
.lv-fresh { color: #fff; background: var(--dn); padding: 10px 12px; border-radius: var(--r-sm); font-weight: 600; margin-bottom: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .62; } }
@media (prefers-reduced-motion: reduce) { .lv-fresh { animation: none; } }
.lv-hv { display: grid; grid-template-columns: 1fr 48px 64px 48px; font-size: var(--t-14); padding: 7px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.lv-hv span:not(:first-child) { text-align: right; }
.lv-hv span:first-child { font-weight: 500; }
.lv-hvsum { font-weight: 600; margin-bottom: 4px; }
.lv-sectors { margin-top: 10px; border-top: 1px solid var(--rule); }
.lv-sector { display: grid; grid-template-columns: 1fr 40px 96px 68px; align-items: center; width: 100%; text-align: left; padding: 10px 0; min-height: 44px; border-bottom: 1px solid var(--rule); gap: 6px; }
.lv-sector .nm { font-weight: 500; }
.lv-sector span:not(.nm) { text-align: right; }
.lv-sector[aria-expanded=true] { border-bottom-color: transparent; }
.lv-sector-rows { padding: 0 0 8px 12px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.lv-sector-rows .lv-hv { font-size: var(--t-12); padding: 5px 0; }
.lv-hvsum[data-tone=up] { color: var(--up); } .lv-hvsum[data-tone=down] { color: var(--dn); }
.lv-idea-h { font-weight: 600; font-size: var(--t-16); } .lv-idea-h[data-state=idea] { color: var(--up); }
.lv-check { font-size: var(--t-14); padding: 3px 0; display: flex; gap: 8px; }
.lv-check svg { width: 16px; height: 16px; margin-top: 2px; }
.lv-check[data-ok="1"] { color: var(--up); } .lv-check[data-ok="0"] { color: var(--slate); }
.lv-plan { background: var(--shell); border-radius: var(--r-sm); padding: 10px 12px; margin: 10px 0 8px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.lv-foot { font-size: var(--t-12); color: var(--slate); padding-top: 14px; }

/* ---------- wide screens: keep the phone column, centred ---------- */
@media (min-width: 620px) and (max-width: 899px) {
  body { max-width: 460px; margin: 0 auto; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); min-height: 100vh; }
  #tabs { left: 50%; right: auto; width: 460px; transform: translateX(-50%); }
  .sheet-body { max-width: 460px; margin: 0 auto; }
  #toast { left: 50%; right: auto; width: 436px; transform: translateX(-50%); }
  html { background: var(--shell); }
}

/* ---------- armed entries ---------- */
#or-armed { border-bottom: 1px solid var(--rule); }
.armed { display: flex; align-items: center; gap: 12px; padding: 10px var(--gx); border-bottom: 1px solid var(--rule); background: var(--warn-bg); }
.armed:last-child { border-bottom: 0; }
.armed .l { flex: 1; min-width: 0; }
.armed .nm { font-weight: 600; }
.armed .nm i { font-style: normal; color: var(--warn); margin-right: 6px; }
.armed.done { background: var(--paper); }
.armed.done .nm { font-weight: 500; color: var(--slate); }
#o-armbox { padding: 0 0 6px; }

/* ---------- 15-minute setup ---------- */
.su-card { border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 12px; margin-bottom: 8px; }
.su-card.go { border-color: var(--up); background: var(--up-wash); }
.su-h { font-weight: 600; font-size: var(--t-16); margin-bottom: 2px; }
.su-card.go .su-h { color: var(--up); }
.su-checks { margin: 8px 0; }
.su-watch { font-size: var(--t-14); padding: 8px 10px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); margin-bottom: 6px; }
.su-row { grid-template-columns: 1fr auto 80px; gap: 8px; }

/* ---------- small phones ---------- */
.opts { margin-top: 4px; }
.opts .toggle { border-top: 1px solid var(--rule); }
.opts.o-armtop { margin: 0 0 6px; }
.opts.o-armtop .toggle { border-top: 0; border-bottom: 1px solid var(--rule); }
.sheet-foot .hint { padding-top: 2px; }
.bk-sym > span:first-child { min-width: 0; }
.bk-acts { flex-wrap: wrap; }
@media (max-width: 480px) {
  /* the bracket panel: stop and target stacked, Exit now on its own row */
  .bk-legs { grid-template-columns: 1fr; gap: 6px; }
  .bk-sym { flex-direction: column; gap: 0; }
  .bk-acts .btn { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
  .bk-acts .btn.sell { flex-basis: 100%; }
}
@media (max-width: 360px) {
  :root { --t-14: .84rem; }
  .row { gap: 8px; }
  .grid2 { gap: 8px; }
  .stepper button { width: 32px; }
  .stepper input { font-size: var(--t-14); }
  .seg button { padding: 6px 7px; }
  #ch-iv button { padding: 6px 8px; }
  .tabs-inline button { padding: 10px 8px; }
  .quick button, .chips button { padding: 5px 9px; }
  .lv-sector { grid-template-columns: 1fr 34px 84px 50px; }
  .lv-hv { grid-template-columns: 1fr 42px 60px 44px; font-size: var(--t-12); }
}
/* short screens (small phones, landscape): the chart gives up height first, never the controls */
@media (max-height: 640px) {
  #chart { min-height: 220px; }
  .sheet-body { max-height: 96svh; }
}

/* ---------- the levels table: label, price and distance in aligned columns ---------- */
.lvt { font-variant-numeric: tabular-nums; }
.lvt-r { display: grid; grid-template-columns: minmax(0, 1fr) 96px 84px; align-items: baseline; column-gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.lvt-r:last-child { border-bottom: 0; }
.lvt-r span:nth-child(1) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvt-r span:nth-child(2) { text-align: right; font-weight: 500; }
.lvt-r span:nth-child(3) { text-align: right; }
.lvt-h { font-size: var(--t-12); color: var(--slate); font-weight: 500; padding-top: 0; padding-bottom: 6px; white-space: nowrap; }
.lvt-h span:nth-child(2) { font-weight: 500; }
.lvt-r[data-c=ltp] { background: var(--buy-wash); color: var(--buy); font-weight: 600; border-radius: var(--r-sm); border-bottom-color: transparent; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.lvt-r[data-c=ltp] span:nth-child(2) { font-weight: 600; }
@media (max-width: 360px) { .lvt-r { grid-template-columns: minmax(0, 1fr) 84px 72px; } }

/* ---------- in-trade bar, real vs dry, costs ---------- */
.actionbar .btn.intrade { flex: 1; justify-content: space-between; padding: 0 16px; }
.actionbar .btn.intrade b { font-variant-numeric: tabular-nums; }
.actionbar .btn.waiting { background: var(--shell); color: var(--ink); border: 1px solid var(--rule-strong); }
.mode { display: flex; background: var(--field); border-radius: var(--r-sm); padding: 3px; margin-bottom: 8px; }
.mode button { flex: 1; min-height: 38px; border-radius: 4px; font-weight: 600; color: var(--slate); }
.mode button[data-v=real].on { background: var(--sell); color: var(--sell-ink); }
.mode button[data-v=dry].on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.mode-note { font-size: var(--t-12); color: var(--slate); margin: -2px 0 8px; }
.mode-note b { color: var(--sell); }
.bracket.dry .rail-track { background: repeating-linear-gradient(90deg, var(--field) 0 6px, transparent 6px 10px); }
.bracket.dry .rail-fill { opacity: .55; }
.bracket.dry .bk-state[data-s=live] { color: var(--slate); }
.bracket.dry .bk-state[data-s=live]::before { background: var(--slate); box-shadow: none; }
.risk .net { display: block; font-size: var(--t-12); color: var(--slate); margin-top: 2px; }
.cost-warn { font-size: var(--t-12); color: var(--warn); background: var(--warn-bg); border-radius: var(--r-sm); padding: 8px 12px; margin-bottom: 8px; }
.today { font-size: var(--t-12); color: var(--slate); margin-top: 2px; }
#m-yes.danger-fill { background: var(--dn); color: #fff; }
.btn.block.dryrun { background: var(--shell); color: var(--ink); border: 1px dashed var(--rule-strong); }
#ch-bracket .bk-acts .btn.sell { display: none; }
@media (min-width: 620px) { .bk-legs { grid-template-columns: 1fr 1fr; } .bk-acts .btn { flex: 1; } .bk-acts .btn.sell { flex-basis: auto; } }
.bk-hint { font-size: var(--t-12); color: var(--slate); margin-top: 4px; }


/* positions: the charges as a two-column table, amounts right-aligned to the paisa */
.chg-t { margin-top: 10px; border-top: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.chg-r { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
.chg-r span:last-child { text-align: right; white-space: nowrap; font-weight: 500; }
.chg-r.part { padding: 4px 0 4px 12px; color: var(--slate); border-bottom-style: dashed; }
.chg-r.part span:last-child { font-weight: 400; }
.chg-r.sum { font-weight: 600; }
.chg-r.sum span:last-child { font-weight: 600; }
.chg-r i { display: block; font-style: normal; font-weight: 400; font-size: var(--t-12); color: var(--slate); }
.chg-foot { margin-top: 8px; }

/* analytics */
#st-range { position: sticky; top: var(--top-h); background: var(--paper); z-index: 4; }
.st-kinds { display: flex; gap: 6px; padding: 12px var(--gx) 2px; }
.st-kinds button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--rule); font-size: var(--t-12); color: var(--slate); font-weight: 500; }
.st-kinds button.on { background: var(--buy-wash); color: var(--buy); border-color: transparent; font-weight: 600; }
.st-sec { padding: 16px var(--gx) 6px; border-bottom: 1px solid var(--rule); }
.st-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.st-hd h3 { font-size: var(--t-14); font-weight: 600; margin: 0; }
.st-hd span { font-size: var(--t-12); color: var(--slate); }
.st-sec .list { margin: 0 calc(-1 * var(--gx)); }
.st-t { font-variant-numeric: tabular-nums; }
.st-r { display: grid; grid-template-columns: var(--cols); column-gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.st-r:last-child { border-bottom: 0; }
.st-r span:not(:first-child) { text-align: right; white-space: nowrap; }
.st-r span:first-child { min-width: 0; }
.st-r b { font-weight: 600; }
.st-r i { font-style: normal; color: var(--slate); font-size: var(--t-12); margin-left: 2px; }
.st-h { font-size: var(--t-12); color: var(--slate); font-weight: 500; padding-top: 0; }
.st-trade .kind { margin-left: 6px; }
.kind.st-o-target { background: var(--up-wash); color: var(--up); }
.kind.st-o-stop { color: var(--dn); }
.st-foot { font-size: var(--t-12); color: var(--slate); padding: 14px var(--gx) 24px; margin: 0; line-height: 1.5; }
.st-note { font-size: var(--t-12); color: var(--slate); margin: 6px 0 8px; }

/* the side gutter: 16px on phones, a little less only on the narrowest */
@media (max-width: 340px) { :root { --gx: 14px; } }
.risk .muted { font-style: normal; color: var(--slate); font-weight: 400; }

/* ---------- wide screens: a trading desk, not a stretched phone ----------
   900px and up: the navigation moves into the top bar and the open view fills the screen (the watchlist is a tab
   of its own, as on the phone; the chart has its own search).
   Sheets dock to the right edge so the chart stays in view while you fill an order. */
@media (min-width: 900px) {
  :root { --gx: 20px; --wl-w: 340px; --lv-w: 400px; }
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; }
  #top { flex: none; position: relative; padding-left: var(--gx); justify-content: flex-end; }
  #top-title { display: none; }
  #tabs { position: absolute; inset: 0 auto auto 0; height: var(--top-h); padding: 0 0 0 calc(var(--gx) - 10px); background: transparent; border: 0; z-index: 25; gap: 2px; }
  #tabs button { flex: none; flex-direction: row; gap: 8px; padding: 0 14px; font-size: var(--t-14); border-bottom: 2px solid transparent; margin-top: 1px; }
  #tabs button svg { width: 18px; height: 18px; }
  #tabs button.on { border-bottom-color: var(--buy); }
  #tabs button:hover:not(.on) { color: var(--ink); }
  main { flex: 1; min-height: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
  .view.on { display: block; overflow-y: auto; min-height: 0; overscroll-behavior: contain; grid-column: 1; grid-row: 1; }
  .searchbar, #st-range { top: 0; }
  .actionbar { bottom: 0; }
  #toast { left: auto; right: 24px; bottom: 24px; width: 380px; transform: none; }
  /* reading width for the list screens: centred in the column rather than stretched across a monitor */
  #v-watch, #v-orders, #v-pos, #v-stats, #v-levels { --pad: max(0px, calc((100% - 920px) / 2)); padding-left: var(--pad); padding-right: var(--pad); }
  #v-chart { display: none; }
  #v-chart.on { display: flex; flex-direction: column; overflow: hidden; }
  #ch-wrap { flex: 1; min-height: 0; }
  #chart, #v-chart.has-bk #chart { height: 100%; min-height: 240px; }
  #ch-bracket { flex: none; max-height: 45%; overflow-y: auto; }
  /* the candle readout on one line: there is room for it */
  #ch-legend { flex-direction: row; align-items: center; justify-content: flex-start; gap: 24px; height: 34px; }
  .lg-meta { display: contents; }
  .lg-meta .when { order: 0; } .lg-meta > span:nth-child(2) { order: 1; }
  .lg-ohlc { order: 2; justify-content: flex-start; gap: 18px; }
  .lg-note { order: 3; margin-left: auto; }
  /* the zoom buttons beside the price axis, clear of the setup tags on the left */
  #ch-zoom { right: 84px; top: 10px; }
  /* sheets: a panel docked to the right edge */
  .sheet { justify-content: flex-end; align-items: stretch; background: color-mix(in srgb, var(--scrim) 55%, transparent); }
  .sheet-body { width: 460px; max-width: 460px; max-height: none; height: 100%; margin: 0; border-radius: 0; padding: 12px 24px 0; animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
  .sheet-body .grab, .sheet-grab { display: none; }
  /* analytics: two columns of tables, the trade list across both */
  #st-body { columns: 2; column-gap: 0; column-rule: 1px solid var(--rule); }
  #st-body > .st-sec { break-inside: avoid; }
  #st-body > .st-sec:last-of-type, #st-body > .st-foot, #st-body > .empty { column-span: all; }
  #st-body > .st-sec:last-of-type { border-top: 1px solid var(--rule); }
  .chg-t, .chg-foot { max-width: 560px; }
  .row:hover { background: var(--shell); }
}
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-body { animation: none; } }

/* ---------- chart: timeframe strip, settings sheet, full screen ---------- */
#ch-tools { gap: 4px; }
#ch-iv { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; display: flex; }
#ch-iv::-webkit-scrollbar { display: none; }
#ch-iv button { flex: none; white-space: nowrap; }
.ov-h { font-size: var(--t-12) !important; color: var(--slate); font-weight: 600; margin: 18px 0 6px !important; }
.sheet-head + .ov-h { margin-top: 4px !important; }
.ov-type { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
.ov-type button { flex: 1 0 auto; white-space: nowrap; }
.ov-credit { font-size: var(--t-12); color: var(--slate); margin: 14px 0 18px; }
.ov-credit a { color: inherit; text-underline-offset: 2px; }
.lg-vol { color: var(--slate); }

/* full screen: the chart owns the screen; the app's bars and the order buttons step aside */
body.ch-full #top, body.ch-full #tabs, body.ch-full #banner, body.ch-full #ch-actions, body.ch-full #ch-setups, body.ch-full #ch-bracket { display: none !important; }
body.ch-full main { padding: 0; }
/* pinned to the real screen edges: viewport units (svh) assume the address bar is showing, so in true full
   screen, and most of all in landscape, they stop short of the bottom */
body.ch-full #v-chart.on { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 45; overflow: hidden; background: var(--paper);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
body.ch-full #ch-head { padding-top: 8px; padding-bottom: 2px; }
body.ch-full #ch-ltp { font-size: var(--t-18); }
body.ch-full #ch-wrap { flex: 1; min-height: 0; }
body.ch-full #chart, body.ch-full #v-chart.has-bk #chart { height: 100%; min-height: 0; }
#ch-full-btn[aria-pressed=true] { color: var(--buy); }
/* a phone on its side: the symbol header folds away, the strip and readout stay */
@media (max-height: 500px) and (orientation: landscape) {
  body.ch-full[data-view=chart] #ch-head { display: none; }
  body.ch-full .lg-note { display: inline; } body.ch-full .lg-meta > span:nth-child(2) { display: inline; } body.ch-full .when i { display: inline; }
  body.ch-full #ch-tools { padding-top: 4px; padding-bottom: 4px; }
  body.ch-full #ch-legend { height: 30px; flex-direction: row; align-items: center; gap: 16px; }
  body.ch-full .lg-meta { display: contents; }
  body.ch-full .lg-ohlc { gap: 12px; justify-content: flex-start; }
  body.ch-full .lg-note { margin-left: auto; order: 3; }
}
@media (min-width: 900px) {
  body.ch-full main { grid-template-columns: minmax(0, 1fr) !important; }
  body.ch-full #v-watch, body.ch-full #v-levels { display: none !important; }

}

/* ---------- phone chart: the instrument and its price live in the top bar, the readout is one line ----------
   (Kite's layout: no second header, so the candles get the height) */
#top-quote { display: none; }
.tq-id { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
#tq-sym { font-size: var(--t-16); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tq-sub { font-size: var(--t-11); color: var(--slate); }
.tq-px { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; flex: none; }
#tq-ltp { font-size: var(--t-16); font-weight: 600; }
#tq-chg { font-size: var(--t-11); font-weight: 500; }
@media (max-width: 899px) {
  body[data-view=chart] { --tools-h: 46px; --leg-h: 28px; }
  body[data-view=chart] #top-title { display: none; }
  body[data-view=chart] #top-quote { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; margin-right: 4px; }
  body[data-view=chart] #feed-txt { display: none; }
  body[data-view=chart] #feed { padding: 8px; background: transparent; }
  body[data-view=chart]:not(.ch-full) #ch-head { display: none; }
  #ch-tools { padding-top: 4px; padding-bottom: 4px; }
  #ch-tools .seg button { min-height: 30px; }
  #ch-legend { flex-direction: row; align-items: center; gap: 10px; padding-top: 0; padding-bottom: 0; font-size: var(--t-11); }
  #ch-legend .lg-meta { display: contents; }
  #ch-legend .when { order: 0; flex: none; }
  #ch-legend .when i { font-style: normal; display: none; }
  #ch-legend .lg-meta > span:nth-child(2), #ch-legend .lg-note { display: none; }
  /* the latest candle: O H L C and its volume; a touched or pinned candle: its time instead of the volume */
  #ch-legend[data-live="1"] .when, #ch-legend[data-live="0"] .lg-vol { display: none; }
  #ch-legend .lg-ohlc > span { white-space: nowrap; }
  #ch-legend .lg-ohlc { order: 1; flex: 1; min-width: 0; justify-content: space-between; gap: 6px; }
}
@media (max-width: 350px) { #ch-legend { font-size: 10.5px; gap: 6px; } #ch-legend .lg-ohlc { gap: 4px; } }
.when i { font-style: normal; }

/* the candle card (phones): replaces the readout line, so the chart gets that height too */
#ch-tip { position: absolute; top: 8px; z-index: 4; pointer-events: none; min-width: 132px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--paper); box-shadow: 0 2px 10px rgba(17,22,31,.16), 0 0 0 1px var(--rule);
  font-size: var(--t-12); font-variant-numeric: tabular-nums; }
/* the notch pointing at the candle's close */
#ch-tip::before { content: ''; position: absolute; top: calc(var(--ny, 20px) - 6px); left: -6px; width: 10px; height: 10px; background: inherit;
  transform: rotate(45deg); box-shadow: -1px 1px 0 0 var(--rule); }
#ch-tip.to-left::before { left: auto; right: -6px; box-shadow: 1px -1px 0 0 var(--rule); }
.tip-t { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.tip-g { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 1px; }
.tip-g span { color: var(--slate); }
.tip-g b { text-align: right; font-weight: 600; color: var(--ink); }
.tip-g b.up { color: var(--up); } .tip-g b.dn { color: var(--dn); }
.tip-n { margin-top: 4px; font-size: var(--t-11); color: var(--slate); }
@media (max-width: 899px) {
  body[data-view=chart] { --leg-h: 0px; }
  #ch-legend { display: none !important; }
}
@media (min-width: 900px) { #ch-tip { display: none; } }

/* day pulse (Levels) */
.pl-top { display: flex; align-items: stretch; gap: 10px; margin: 2px 0 8px; }
.pl-reg { flex: 1; min-width: 0; font-weight: 600; font-size: var(--t-18); padding: 10px 12px; border-radius: var(--r); background: var(--shell); letter-spacing: -.01em; }
.pl-reg small { display: block; font-size: var(--t-12); font-weight: 400; color: var(--slate); margin-top: 2px; letter-spacing: 0; }
.pl-reg[data-r=Trend] { background: var(--up-wash); color: var(--up); }
.pl-reg[data-r=Range] { background: var(--sell-wash); color: var(--sell); }
.pl-pts { flex: none; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding: 8px 12px; border-radius: var(--r); background: var(--shell); text-align: right; }
.pl-pts b { font-size: var(--t-21); line-height: 1.1; }
.pl-pts span { font-size: var(--t-11); color: var(--slate); max-width: 88px; }
.pl-votes { margin-top: 6px; }
.pl-votes i.pv { font-style: normal; font-size: var(--t-11); font-weight: 600; width: 18px; height: 18px; line-height: 18px; border-radius: 4px; text-align: center; background: var(--field); color: var(--slate); align-self: center; }
.pl-votes i.pv.t { background: var(--up-wash); color: var(--up); }
.pl-votes i.pv.r { background: var(--sell-wash); color: var(--sell); }
.pl-part { margin-top: 8px; font-size: var(--t-14); line-height: 1.5; border-top: 1px solid var(--rule); padding-top: 8px; }
.o-sstop { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.o-sstop button { border: 1px solid var(--rule-strong); border-radius: 16px; padding: 5px 10px; font-size: var(--t-12); color: var(--slate); background: var(--paper); }
.o-sstop button.on { border-color: var(--buy); color: var(--buy); }
.lv-top { font-style: normal; font-size: var(--t-11); color: var(--buy); background: var(--buy-wash); border-radius: 4px; padding: 0 4px; margin-left: 4px; }

/* watchlist: the auto strikes group */
.auto-h { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-align: left; }
.auto-h .sub { font-weight: 400; }
.kind.role { background: var(--buy-wash); color: var(--buy); }
/* a row's name truncates before its chips do: the chips (CE, ATM, 1 ITM...) always stay whole */
.row .nm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row .nm .nm-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm .kind { flex: none; white-space: nowrap; margin-left: 0; }
.row .l { min-width: 0; }

/* Levels: before the open (NSE) */
.nse-t .lvt-r { grid-template-columns: minmax(0, 1fr) 64px 72px 80px; }
.nse-ev { display: inline-block; font-size: var(--t-12); background: var(--field); border-radius: 4px; padding: 0 5px; margin: 2px 2px 0 0; }
.nse-ev.top { background: var(--buy-wash); color: var(--buy); font-weight: 600; }

/* Levels: the tabs (full width, sticky under the top bar) */
#lv .lv-tabs { margin: 0 calc(-1 * var(--gx)) 4px; position: sticky; top: var(--top-h); background: var(--paper); z-index: 6; }
@media (min-width: 900px) { #lv .lv-tabs { top: 0; } }

/* the order sheet: what the trade costs at the entry */
.o-cost { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--rule); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.o-cost b { font-weight: 600; }
.o-cost .sub { font-size: var(--t-12); color: var(--slate); }
.o-cost[data-bad="1"] { border-color: var(--dn); }
.o-cost[data-bad="1"] .sub { color: var(--dn); }

/* the live bracket: what happens at the target, and a typed exit price */
.bk-tgt { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bk-tgt .lbl { font-size: var(--t-12); color: var(--slate); }
.bk-tgt .seg button:disabled { opacity: .45; }
.bk-tgt .btn { margin-left: auto; min-height: 36px; padding: 0 12px; font-size: var(--t-14); }

/* wide screens: the chart header has its own instrument search */
.ch-search { display: none; }
@media (min-width: 900px) {
  #ch-head { align-items: center; }
  .ch-search { display: block; position: relative; flex: 0 1 360px; margin: 0 auto 0 24px; }
  .ch-search .search { min-height: 38px; }
  #ch-res { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: min(60vh, 520px); overflow-y: auto; background: var(--paper);
    border: 1px solid var(--rule); border-radius: var(--r-sm); box-shadow: 0 10px 28px rgba(0, 0, 0, .14); z-index: 40; }
  #ch-res .row { cursor: pointer; }
  #ch-res .row.on { background: var(--shell); }
}

/* the 15-minute setup: the option to buy, first */
.su-opt { font-weight: 600; font-size: var(--t-16); margin-bottom: 4px; }
.su-opt .sub { font-weight: 400; font-size: var(--t-12); margin-left: 4px; }

/* Levels, Options: the near-the-money OI table (four columns) */
.oin .oin-r { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr); }
.oin .oin-r span:nth-child(3) { text-align: right; }
.oin .oin-r span:nth-child(4) { text-align: right; font-size: var(--t-12); white-space: nowrap; }
.oin .oin-r small { display: block; font-size: var(--t-11); line-height: 1.3; }
.oin .oin-r span:nth-child(1) { white-space: normal; }
.oin .oin-r { align-items: start; }
.oin .oin-r span.up { color: var(--up); } .oin .oin-r span.dn { color: var(--dn); }

/* chart: the setups list opens over the chart from a toolbar button, so the candles keep the whole height */
.su-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--t-12); font-weight: 500; color: var(--slate); background: var(--field); white-space: nowrap; flex: none; }
.su-btn b { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--rule); color: var(--slate); font-size: var(--t-11); line-height: 18px; text-align: center; }
.su-btn.has b { background: var(--buy); color: #fff; }
.su-btn.on { color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-strong); }
#ch-setups { position: absolute; z-index: 6; left: 8px; right: 8px; bottom: 8px; max-height: 58%; overflow-y: auto; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r-sm); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
#ch-setups .su-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--paper); z-index: 1; padding-top: 4px; padding-bottom: 4px; }
@media (min-width: 900px) {
  #ch-setups { left: auto; bottom: auto; top: 52px; right: 84px; width: 400px; max-height: calc(100% - 64px); }
}
body.ch-full #ch-su-btn { display: none; }
@media (min-width: 900px) {
  #ch-head #ch-actions { position: static; flex: none; padding: 0; margin-right: 8px; gap: 8px; background: none; border: 0; box-shadow: none; }
  #ch-head #ch-actions .btn { flex: none; min-height: 38px; min-width: 96px; padding: 0 18px; font-size: var(--t-14); }
}

/* ---------- alerts: a card stack, the bell and the history ---------- */
#btn-notes { position: relative; }
#notes-n { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--dn); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
#notes { position: fixed; z-index: 75; top: calc(var(--top-h) + 8px + env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 900px) { #notes { left: auto; right: 16px; width: 380px; } }
.nc { pointer-events: auto; position: relative; overflow: hidden; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 12px 32px rgba(17, 22, 31, .16), 0 2px 6px rgba(17, 22, 31, .08); padding: 12px 14px 12px 16px; animation: nc-in .22s cubic-bezier(.2,.8,.2,1); }
.nc::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--slate); }
.nc[data-side=ce]::before { background: var(--up); } .nc[data-side=pe]::before { background: var(--dn); }
.nc[data-kind=warn]::before { background: var(--amber); } .nc[data-kind=info]::before { background: var(--buy); }
.nc.out { animation: nc-out .18s ease-in forwards; }
.nc-top { display: flex; align-items: center; gap: 8px; }
.nc-tag { font-size: var(--t-11); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--field); color: var(--slate); }
.nc-tag[data-side=ce] { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.nc-tag[data-side=pe] { background: color-mix(in srgb, var(--dn) 14%, transparent); color: var(--dn); }
.nc-tag[data-kind=warn] { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--warn); }
.nc-src { font-size: var(--t-12); color: var(--slate); font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-time { font-size: var(--t-11); color: var(--faint); margin-left: auto; }
.nc-x { width: 28px; height: 28px; margin: -6px -8px -6px 0; display: grid; place-items: center; color: var(--slate); border-radius: 6px; }
.nc-x svg { width: 16px; height: 16px; } .nc-x:hover { background: var(--field); }
.nc-title { font-size: var(--t-16); font-weight: 600; margin-top: 8px; letter-spacing: -.01em; }
.nc-title.sm { font-size: var(--t-14); }
.nc-msg { font-size: var(--t-13, 13px); color: var(--slate); margin-top: 4px; line-height: 1.45; white-space: pre-wrap; }
.nc-px { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.nc-chip { background: var(--shell); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; }
.nc-chip small { font-size: var(--t-11); color: var(--slate); } .nc-chip b { font-size: var(--t-14); font-weight: 600; }
.nc-why { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nc-why li { font-size: var(--t-11); color: var(--slate); background: var(--field); border-radius: 4px; padding: 2px 6px; }
.nc-exit { font-size: var(--t-12); color: var(--slate); margin-top: 8px; }
.nc-acts { display: flex; gap: 8px; margin-top: 12px; }
.nc-acts .btn { min-height: 38px; font-size: var(--t-14); } .nc-acts .btn:first-child { flex: 1; }
.nc-life { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: currentColor; opacity: .18; transform-origin: left; animation: nc-life var(--life) linear forwards; }
.nc.hold .nc-life { animation-play-state: paused; }
@keyframes nc-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nc-out { to { transform: translateX(16px); opacity: 0; } }
@keyframes nc-life { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .nc, .nc.out, .nc-life { animation: none; } }
#notes-panel { position: fixed; z-index: 76; top: calc(var(--top-h) + env(safe-area-inset-top)); right: 8px; left: 8px; max-height: min(70vh, 560px); display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 16px 40px rgba(17, 22, 31, .18); }
@media (min-width: 900px) { #notes-panel { left: auto; right: 16px; width: 400px; } }
.np-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--rule); }
.np-head .sub { margin-right: auto; }
#np-list { overflow-y: auto; }
.np-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.np-row:hover { background: var(--shell); }
.np-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--buy); }
.np-row[data-side=ce] .np-dot { background: var(--up); } .np-row[data-side=pe] .np-dot { background: var(--dn); } .np-row[data-kind=warn] .np-dot { background: var(--amber); }
.np-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.np-main b { font-size: var(--t-14); font-weight: 600; } .np-main small { font-size: var(--t-12); color: var(--slate); line-height: 1.4; }
.np-time { font-size: var(--t-11); color: var(--faint); margin-top: 2px; }
body.ch-full #notes { top: 8px; }

/* Levels, Setups: the strategies, today's signals and the forward test */
.st-ctx { font-size: var(--t-12); color: var(--slate); margin-bottom: 8px; }
.st-row { display: flex; align-items: center; gap: 10px; padding: 10px 0 10px 12px; border-bottom: 1px solid var(--rule); position: relative; }
.st-row::before { content: ''; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--up); }
.st-row[data-side=pe]::before { background: var(--dn); }
.st-row[data-skip]::before { background: var(--slate); }
.st-row[data-skip] .st-main { opacity: .62; }
/* her levels: the day's zones and what filters them */
.zn { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.zn-h { font-weight: 600; margin-bottom: 6px; } .zn-h .sub { font-weight: 400; }
.zn-ctx { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--t-12); color: var(--slate); margin-bottom: 6px; }
.zn-lv { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.zn-chip { background: var(--shell); border-radius: 6px; padding: 5px 8px; display: flex; flex-direction: column; min-width: 0; }
.zn-chip small { font-size: var(--t-11); color: var(--slate); } .zn-chip b { font-size: var(--t-13, 13px); font-weight: 600; }
.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-main b { font-size: var(--t-12); color: var(--slate); font-weight: 500; } .st-main span { font-weight: 600; } .st-main small { font-size: var(--t-12); color: var(--slate); }
.st-res { display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; } .st-res small { font-size: var(--t-11); color: var(--slate); font-weight: 400; }
.st-open { font-size: var(--t-12); color: var(--buy); }
.aplus { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--buy); color: var(--buy-ink); font-size: var(--t-11); font-weight: 600; letter-spacing: .02em; vertical-align: 1px; }
.st-fill { min-height: 34px; padding: 0 12px; }
.st-t { margin-top: 12px; }
.st-t .lvt-r { grid-template-columns: minmax(0, 1fr) 52px 44px 60px 56px; }
.st-t .lvt-r span:nth-child(n+2) { text-align: right; }
.lv-check[data-soft="1"] { opacity: .8; }
.st-t .lvt-r span:nth-child(1) { white-space: normal; line-height: 1.3; }

/* ---------- Levels, Pre-market ---------- */
.pm-k { font-size: var(--t-11); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); }
.pm-open { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 14px 16px; background: var(--shell); border-radius: var(--r); margin-top: 4px; }
.pm-gift, .pm-imp { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-gift b, .pm-imp b { font-size: var(--t-22, 22px); font-weight: 600; letter-spacing: -.02em; }
.pm-gift > span.num { font-size: var(--t-14); font-weight: 600; }
.pm-gap { align-self: flex-start; font-size: var(--t-11); font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--field); color: var(--slate); margin-top: 2px; }
.pm-gap[data-s=moderate] { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--warn); }
.pm-gap[data-s=large] { background: color-mix(in srgb, var(--dn) 14%, transparent); color: var(--dn); }
.pm-sub { grid-column: 1 / -1; font-size: var(--t-12); color: var(--slate); margin-top: 6px; }
.pm-h { display: flex; align-items: baseline; justify-content: space-between; font-weight: 600; margin: 20px 0 8px; }
.pm-h span { font-size: var(--t-12); font-weight: 400; color: var(--slate); }
.pm-plan { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.pm-plan-r { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.pm-plan-r:last-child { border-bottom: 0; }
.pm-plan-r i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-strong); flex: none; }
.pm-plan-r[data-on="1"] i { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent); }
.pm-plan-r span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pm-plan-r b { font-size: var(--t-14); font-weight: 600; } .pm-plan-r small { font-size: var(--t-12); color: var(--slate); line-height: 1.4; }
.pm-plan-r em { font-style: normal; font-size: var(--t-12); font-weight: 600; color: var(--faint); }
.pm-plan-r[data-on="1"] em { color: var(--up); }
.pm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm-tile { background: var(--shell); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pm-tile b { font-size: var(--t-18); font-weight: 600; } .pm-tile small { font-size: var(--t-11); color: var(--slate); }
.pm-part { margin-top: 12px; }
.pm-part-h, .pm-part-r { display: grid; grid-template-columns: 56px minmax(0, 1fr) 40px 76px; align-items: center; gap: 10px; }
.pm-part-h { font-size: var(--t-11); color: var(--slate); padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.pm-part-h span:nth-child(n+3), .pm-part-r span:nth-child(n+3) { text-align: right; }
.pm-part-r { padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-14); }
.pm-bar { position: relative; height: 22px; background: var(--field); border-radius: 4px; overflow: hidden; display: flex; align-items: center; }
.pm-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--up) 22%, transparent); }
.pm-bar b { position: relative; padding-left: 8px; font-size: var(--t-12); font-weight: 600; }
.pm-note { font-size: var(--t-12); color: var(--slate); margin-top: 8px; line-height: 1.45; }
.pm-cal { border-top: 1px solid var(--rule); }
.pm-cal-r { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.pm-date { flex: none; width: 52px; font-size: var(--t-12); font-weight: 600; color: var(--slate); }
.pm-evs { display: flex; flex-wrap: wrap; gap: 4px; }
.pm-evs i, .pm-note i { font-style: normal; font-size: var(--t-12); padding: 2px 7px; border-radius: 4px; background: var(--field); color: var(--ink); }
.pm-evs i.top, .pm-note i.top { background: color-mix(in srgb, var(--buy) 12%, transparent); color: var(--buy); font-weight: 600; }
.pm-cal-r.hol span:last-child { font-size: var(--t-13, 13px); }
@media (min-width: 900px) { .pm-open { grid-template-columns: 1fr 1fr 2fr; } .pm-sub { grid-column: auto; align-self: end; margin-top: 0; } }
.pm-sub-h { font-size: var(--t-11); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); margin: 14px 0 2px; }
.pm-cal { border-top: 0; }

/* ---------- Levels, Live: market read tabs, the day pulse ---------- */
.mr-seg { display: flex; width: 100%; margin-bottom: 10px; } .mr-seg button { flex: 1; min-height: 36px; font-size: var(--t-14); }
.dp-reg { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--shell); margin-top: 4px; }
.dp-reg > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dp-reg b { font-size: var(--t-20, 20px); font-weight: 600; letter-spacing: -.01em; } .dp-reg small { font-size: var(--t-12); color: var(--slate); }
.dp-reg[data-r=Trend] { background: color-mix(in srgb, var(--up) 10%, var(--shell)); } .dp-reg[data-r=Range] { background: color-mix(in srgb, var(--amber) 10%, var(--shell)); }
.dp-votes { display: flex; gap: 14px; } .dp-votes span { display: flex; flex-direction: column; align-items: center; font-size: var(--t-11); color: var(--slate); }
.dp-votes b { font-size: var(--t-20, 20px); font-weight: 600; color: var(--ink); }
.dp-tiles { margin-top: 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .dp-tiles, .nt-tiles { grid-template-columns: repeat(3, 1fr); } }
.dp-vote-list > div { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: var(--t-14); line-height: 1.4; }
.dp-pill { flex: none; width: 58px; text-align: center; font-style: normal; font-size: var(--t-11); font-weight: 600; padding: 2px 0; border-radius: 4px; background: var(--field); color: var(--slate); }
.dp-pill[data-v=trend] { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.dp-pill[data-v=range] { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--warn); }
/* Levels > Entry checklist: a call column and a put column, each item ticked live */
.ck-read { font-size: var(--t-12); color: var(--slate); margin-bottom: 8px; }
.ck-cols { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .ck-cols { grid-template-columns: 1fr 1fr; } }
.ck-col { background: var(--shell); border-radius: var(--r-sm); padding: 10px 12px; border: 1px solid transparent; }
.ck-col[data-pass="1"] { border-color: color-mix(in srgb, var(--up) 45%, transparent); }
.ck-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 2px; }
.ck-head b { font-size: var(--t-14); }
.ck-score { margin-left: auto; font-size: var(--t-16); font-weight: 600; }
.ck-col[data-pass="1"] .ck-score { color: var(--up); } .ck-col[data-pass="0"] .ck-score { color: var(--dn); }
.ck-head small { flex-basis: 100%; text-align: right; font-size: var(--t-11); color: var(--slate); }
.ck-line { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 6px 0; font-size: var(--t-13, 13px); line-height: 1.4; }
.ck-line b { font-weight: 600; display: block; } .ck-line small { font-size: var(--t-11); color: var(--slate); }
.ck-ctx { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--rule); font-size: var(--t-11); color: var(--slate); text-transform: uppercase; letter-spacing: .04em; }
.ck-line[data-ctx] { opacity: .7; }
.ck-m { font-style: normal; font-weight: 600; text-align: center; color: var(--faint); }
.ck-m[data-v=yes] { color: var(--up); } .ck-m[data-v=no] { color: var(--dn); }
.dp-part > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-13, 13px); line-height: 1.45; }
.dp-part > div span:first-child { font-size: var(--t-12); font-weight: 600; color: var(--slate); }
.dp-tl { display: flex; gap: 6px; flex-wrap: wrap; }
.dp-tl span { display: flex; flex-direction: column; padding: 6px 10px; border-radius: var(--r-sm); background: var(--shell); font-size: var(--t-12); font-weight: 600; }
.dp-tl span small { font-size: var(--t-11); font-weight: 400; color: var(--slate); }
.dp-tl span[data-r=Trend] { color: var(--up); } .dp-tl span[data-r=Range] { color: var(--warn); }
/* Options: the market notes as tiles */
.nt-tiles { grid-template-columns: 1fr 1fr; }
.nt-tiles .pm-tile b { font-size: var(--t-16); } .nt-tiles .pm-tile small { line-height: 1.35; }
.nt-tiles .pm-tile[data-tone=up] b { color: var(--up); } .nt-tiles .pm-tile[data-tone=down] b { color: var(--dn); }
@media (min-width: 900px) { .pm-bar { max-width: 420px; } }

/* Stocks: each sector's points as a badge, tinted deeper the bigger its share of the move */
.sx-pts { justify-self: end; padding: 3px 9px; border-radius: 12px; font-weight: 600; font-size: var(--t-13, 13px); }
.sx-pts.up { background: color-mix(in srgb, var(--up) calc(var(--a) * 100%), transparent); }
.sx-pts.dn { background: color-mix(in srgb, var(--dn) calc(var(--a) * 100%), transparent); }

/* chart: on a phone the Setups button is an icon with its count */
.su-btn svg { width: 16px; height: 16px; }
@media (max-width: 899px) { .su-btn .su-lab { display: none; } .su-btn { padding: 0 8px; gap: 4px; } }
#tq-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* zero-hero: the expiry-day last-hour ticket, one row an index */
.cas-row { display: grid; grid-template-columns: 84px 1fr; gap: 0 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.cas-row:last-of-type { border-bottom: 0; }
.cas-nm { font-weight: 600; font-size: var(--t-14); }
.cas-row[data-on="1"] .cas-nm { color: var(--warn); }
.cas-day { color: var(--faint); font-size: var(--t-12); }
.cas-tk { font-size: var(--t-14); margin-top: 2px; }
.cas-plan { color: var(--slate); font-size: var(--t-12); margin-top: 2px; }

/* long index names (BANKNIFTY) must wrap inside their column, never push the page sideways */
.lvt-r, .st-row, .cas-row, .lv-row, .su-card, .st-ctx, .lv-sec { min-width: 0; }
.lvt-r > span, .st-main, .cas-tk, .cas-plan, .su-h, .st-ctx, .lv-m, .st-res { min-width: 0; overflow-wrap: anywhere; }
.st-row { flex-wrap: wrap; }

/* variance premium gauge: India VIX against RV20, and whether the spread is above its one-year median */
.vrp { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; }
.vrp-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; min-width: 0; }
.vrp-row span { color: var(--slate); }
.vrp-row b { font-variant-numeric: tabular-nums; }
.vrp-gate { grid-column: 1 / -1; margin-top: 4px; padding: 6px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; text-align: center; }
.vrp-gate.on { background: var(--up-wash); color: var(--up); }
.vrp-gate.off { background: var(--dn-wash); color: var(--dn); }

/* ============================================================================
   Terminal layer: a dense trading desk rather than a set of cards.
   ========================================================================== */
html { background: var(--paper); }
body { font-size: 13px; -webkit-font-smoothing: antialiased; }
::selection { background: rgba(61, 139, 253, .32); }
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 0; }
*::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 1px solid var(--buy); outline-offset: 1px; }

/* numbers are data, so they get tabular figures; the face is --mono, which ui.css sets */
.num, .row .px, .lvt-r, .lv-row, .st-row, .cas-row, .tk-p, .tk-c, .tk-clock,
#pos-pnl, #ch-ltp, #ch-chg, .stepper input, .pnl-head .v, .lvt-r span { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- the ticker strip ---- */
#tickbar { position: sticky; top: 0; z-index: 32; display: flex; align-items: stretch; flex: 0 0 28px; height: 28px; min-height: 28px;
  background: var(--shell); border-bottom: 1px solid var(--rule); overflow-x: auto; overflow-y: hidden; }
#tickbar::-webkit-scrollbar { display: none; }
.tk { display: flex; align-items: center; gap: 7px; padding: 0 12px; border-right: 1px solid var(--rule); white-space: nowrap; }
.tk-s { color: var(--faint); font-size: 9.5px; font-weight: 600; letter-spacing: .11em; }
.tk-p { color: var(--ink); font-size: 11.5px; font-weight: 600; }
.tk-c { font-size: 9.5px; font-style: normal; color: var(--faint); }
.tk-c.up { color: var(--up); } .tk-c.dn { color: var(--dn); }
.tk-clock { margin-left: auto; display: flex; align-items: center; padding: 0 12px; color: var(--faint); font-size: 9.5px; letter-spacing: .08em; border-left: 1px solid var(--rule); }

/* ---- shell ---- */
#top { top: 28px; padding-left: 18px; background: var(--shell); border-bottom: 1px solid var(--rule); }
#top-title { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--slate); }
#feed { background: transparent; border: 1px solid var(--rule); border-radius: 2px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; }
.iconbtn { border-radius: 2px; width: 38px; height: 38px; }
.iconbtn.sm { width: 32px; height: 32px; }

/* ---- density ---- */
main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.row { min-height: 46px; padding: 7px var(--gx); }
.row:nth-child(even) { background: rgba(255, 255, 255, .015); }
.row:hover { background: var(--field); }
.btn { min-height: 34px; padding: 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; border-radius: 2px; }
.btn.block { min-height: 44px; font-size: 12px; }
.seg { padding: 0; background: transparent; border: 1px solid var(--rule); border-radius: 2px; }
.seg button { min-height: 26px; padding: 3px 9px; border-radius: 0; font-size: 10.5px; letter-spacing: .04em; }
.seg button.on { background: var(--field); box-shadow: none; color: var(--ink); box-shadow: inset 0 -2px 0 var(--buy); }
.seg.full button { min-height: 30px; font-size: 11px; }
.lv-sec .seg { display: inline-flex; }
.lv-sec .seg.full { display: inline-flex; }
.lv-sec .seg.full button { min-height: 24px; padding: 2px 12px; font-size: 10.5px; }
.stepper { border: 1px solid var(--rule); background: var(--field); }
.stepper input { font-size: 14px; padding: 7px 2px; }
.stepper button { width: 34px; }
.field .lbl, .lbl { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.sheet-body { border-radius: 4px 4px 0 0; border-top: 1px solid var(--rule-strong); }
.sheet-body h3 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 18px 0 8px; }
#tabs { background: var(--shell); }
#tabs button { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; }

/* ---- levels sections as desk panels ---- */
.lv-sec { padding: 10px 0 12px; }
.lv-h { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--slate);
  border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 8px; }
.lv-h .sub { font-size: 9.5px; font-weight: 500; letter-spacing: .06em; color: var(--faint); text-transform: none; }
.lv-row { padding: 5px 0; }
.pnl-head { padding: 12px var(--gx); background: var(--shell); border-bottom: 1px solid var(--rule); }
.pnl-head .k { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pnl-head .v { font-size: 22px; }

/* ---- desktop: a left rail, like a terminal's section strip ---- */
@media (min-width: 1000px) {
  #tickbar { height: 30px; min-height: 30px; flex: 0 0 30px; }
  #top { position: relative; top: 0; }
  #tabs { inset: 74px auto 0 0; width: 84px; height: auto; flex-direction: column; align-items: stretch;
    padding: 6px 0 0; border-top: 0; border-right: 1px solid var(--rule); background: var(--shell); }
  #tabs button { flex: 0 0 auto; height: 58px; gap: 4px; }
  #tabs button.on { color: var(--ink); background: var(--field); box-shadow: inset 2px 0 0 var(--buy); }
  main { margin-left: 84px; padding-bottom: 24px; min-height: calc(100vh - 74px); }
  .sheet-body { max-width: 460px; margin: 0 auto; }
  #v-levels #lv { max-width: 1180px; margin: 0 auto; padding: 0 18px 30px; }
}

/* ---- full-width desk ---- */
@media (min-width: 1000px) {
  #v-watch, #v-orders, #v-pos, #v-stats, #v-levels { --pad: 0px; padding-left: 18px; padding-right: 18px; }
  #v-levels #lv { max-width: none; padding: 0 0 28px; }
  .lv-tabs { top: 0; }
}
@media (min-width: 1280px) {
  #v-levels #lv { column-count: 2; column-gap: 30px; }
  #v-levels .lv-sec { break-inside: avoid; }
  #v-levels .lv-tabs { column-span: all; }
  #v-watch .list, #v-orders .list, #v-pos .list { max-width: none; }
}
/* tighter type across the desk */
.lv-sec .lv-m, .lv-sec .sub, .lv-sec small { font-size: 11px; line-height: 1.45; }
.lv-sec .lv-row, .lv-sec .lvt-r { font-size: 11.5px; }
.lv-sec .lv-h { margin-bottom: 7px; }

/* ---- phone: the ticker compresses, the clock steps aside ---- */
@media (max-width: 700px) {
  .tk { padding: 0 9px; gap: 5px; }
  .tk-s { font-size: 9px; letter-spacing: .08em; }
  .tk-p { font-size: 11px; }
  .tk-c { font-size: 9px; }
  .tk-clock { display: none; }
  #tickbar { height: 26px; min-height: 26px; flex: 0 0 26px; }
  #top { top: 26px; }
  .lv-sec { padding: 8px 0 10px; }
}

/* ---- the ticker takes real estate at the top: include it in every offset ---- */
:root { --tick-h: 28px; }
@media (max-width: 700px) { :root { --tick-h: 26px; } }
@media (min-width: 1000px) { :root { --tick-h: 30px; } }

.searchbar { top: calc(var(--top-h) + var(--tick-h)); }
#chart { height: calc(100svh - var(--top-h) - var(--tick-h) - var(--nav-h) - var(--act-h) - var(--tools-h) - var(--leg-h) - env(safe-area-inset-bottom)); }
#v-chart.has-bk #chart { height: calc(100svh - var(--top-h) - var(--tick-h) - var(--nav-h) - var(--act-h) - var(--tools-h) - var(--leg-h) - 238px - env(safe-area-inset-bottom)); }
.lv-tabs { top: calc(var(--top-h) + var(--tick-h)); }
@media (min-width: 900px) {
  .searchbar, #st-range { top: var(--tick-h); }
  .lv-tabs { top: var(--tick-h); }
}

/* ---- the index switch is a toolbar, not a sticky layer that hides under the header ---- */
.lv-idx { position: static; }
#watch .lv-idx { padding: 6px var(--gx); margin: 0; border-bottom: 1px solid var(--rule); background: var(--shell); }
#v-levels .lv-idx { padding: 6px 0; }
@media (min-width: 1000px) {
  .lv-idx button { min-height: 28px; padding: 2px 12px; font-size: 10.5px; letter-spacing: .05em; }
  #watch .lv-idx { padding-left: 0; }
}

/* the index switch, unmistakable at a glance */
#watch .lv-idx { padding: 8px var(--gx); margin: 0; gap: 6px; background: var(--paper);
  border-bottom: 1px solid var(--rule); position: relative; z-index: 12; }
#watch .lv-idx button { border: 1px solid var(--rule-strong); border-radius: 2px; min-height: 30px; padding: 4px 12px;
  background: var(--paper); color: var(--ink); font-size: 10.5px; letter-spacing: .06em; }
#watch .lv-idx button.on { background: var(--buy); border-color: var(--buy); color: #fff; }
#watch .lv-idx button:hover { border-color: var(--buy); }
/* the sticky search must paint over the list that scrolls beneath it */
.searchbar { z-index: 20; background: var(--paper); }
#watch .lv-idx { z-index: 1; }
/* no sticky search: it was painting over the index switch beneath it */
.searchbar { position: static; top: auto; }
#watch .lv-idx { margin-top: 0; }

/* ============================================================================
   The rail, rebuilt: a brand block, quieter labels, an active edge, room to breathe.
   ========================================================================== */
@media (min-width: 1000px) {
  #tabs { width: 96px; padding: 0; background: var(--shell); border-right: 1px solid var(--rule); }
  #tabs .rail-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    height: 86px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
  #tabs .rail-brand .mk { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--buy);
    color: var(--buy); font: 600 11px ui-monospace, Menlo, monospace; letter-spacing: .06em; }
  #tabs .rail-brand .wd { font-size: 8px; letter-spacing: .26em; color: var(--faint); }
  #tabs button { flex: 0 0 58px; height: 58px; gap: 5px; border-left: 2px solid transparent; border-radius: 0;
    color: var(--slate); font-size: 8.5px; letter-spacing: .13em; transition: background .12s, color .12s, border-color .12s; }
  #tabs button svg { width: 19px; height: 19px; stroke-width: 1.6; }
  #tabs button:hover { background: rgba(255, 255, 255, .035); color: var(--ink); }
  #tabs button.on { color: var(--ink); border-left-color: var(--buy);
    background: linear-gradient(90deg, rgba(61, 139, 253, .12), rgba(61, 139, 253, 0) 78%); box-shadow: none; }
  #tabs button.on svg { stroke-width: 1.9; }
  #tabs button + button { margin-top: 1px; }
  main { margin-left: 96px; }
}
.rail-brand { display: none; }
@media (min-width: 1000px) {
  #tabs { width: 104px; background: var(--shell); }
  #tabs button { font-size: 8px; letter-spacing: .07em; padding: 0 2px; white-space: nowrap; }
  #tabs button svg { width: 18px; height: 18px; }
  #tabs .rail-brand .wd { font-size: 7.5px; letter-spacing: .2em; }
  main { margin-left: 104px; }
  #tabs button.on { background: linear-gradient(90deg, rgba(61,139,253,.16), rgba(61,139,253,.02) 85%); }
}
#tabs .rail-brand .mk { width: 30px; height: 30px; border: 0; border-radius: 7px; object-fit: cover; }

/* ---- ultrawide: cap the desk so rows do not stretch into empty space ---- */
@media (min-width: 1600px) {
  #v-watch, #v-orders, #v-pos, #v-stats, #v-levels { max-width: 1460px; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }
  .searchbar { max-width: 1460px; margin: 0 auto; }
  #tickbar .tk { padding: 0 18px; }
  #tkclock { margin-left: auto; }
}
@media (min-width: 1600px) {
  #v-watch, #v-orders, #v-pos, #v-stats, #v-levels { max-width: 1500px; margin-left: 0; margin-right: auto; }
  .searchbar { max-width: 760px; margin-left: 0; margin-right: auto; }
  #v-levels #lv { column-count: 3; column-gap: 26px; }
}
@media (min-width: 1600px) {
  /* the desk itself takes the width; a list longer than 1500px is unreadable */
  #v-levels { max-width: none; }
  #v-levels #lv { column-count: 3; column-gap: 34px; }
  #v-watch, #v-orders, #v-pos, #v-stats { max-width: 1500px; }
}

/* ---- big screens: the same desk, drawn larger instead of drifting in empty space ---- */
@media (min-width: 2000px) {
  :root { --t-11: .78rem; --t-12: .9rem; --t-14: 1rem; --t-16: 1.1rem; --t-18: 1.2rem; --t-21: 1.4rem; --t-26: 1.8rem; --gx: 22px; }
  :root { --tick-h: 34px; }
  #tickbar { height: 34px; min-height: 34px; flex: 0 0 34px; }
  .tk { padding: 0 20px; gap: 10px; }
  .tk-s { font-size: 10.5px; } .tk-p { font-size: 13px; } .tk-c, .tk-clock { font-size: 10.5px; }
  .row { min-height: 54px; }
  .lv-sec .lv-row, .lv-sec .lvt-r { font-size: 13px; }
  .lv-h { font-size: 11px; }
  .btn { min-height: 38px; font-size: 12px; }
  #top { height: 52px; }
  #v-levels #lv { column-count: 3; column-gap: 40px; }
}

/* ---- phone: one column, a swipeable ticker, labels that are not clipped ---- */
@media (max-width: 999px) {
  #tickbar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #tickbar::-webkit-scrollbar { display: none; }
  #tkclock { position: sticky; right: 0; padding-left: 10px; background: var(--shell); box-shadow: -8px 0 10px -6px rgba(0,0,0,.18); }
  #tabs { height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  #tabs button { font-size: 8px; letter-spacing: .02em; gap: 3px; padding-top: 5px; }
  #tabs button svg { width: 19px; height: 19px; }
}

/* ---- the desk pane on the right, desktop only ---- */
#ctx { display: none; }
/* only beside the chart (the option chain, positions, orders); every other page takes the full width */
@media (min-width: 1380px) {
  body:not([data-view="chart"]) #ctx { display: none; }
  body:not([data-view="chart"]) main { margin-right: 0; }
}
@media (min-width: 1500px) {
  #ctx { display: flex; flex-direction: column; position: fixed; right: 0; bottom: 0; width: 320px;
    top: calc(var(--tick-h) + var(--top-h)); background: var(--shell); border-left: 1px solid var(--rule); z-index: 26; }
  main { margin-right: 320px; }
  #v-levels #lv { column-count: 2; }
  .ctx-top { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 12px;
    border-bottom: 1px solid var(--rule); }
  .ctx-k { font-size: 9px; letter-spacing: .2em; color: var(--faint); }
  .ctx-badge { font-size: 9px; letter-spacing: .08em; padding: 2px 7px; border: 1px solid var(--rule-strong); border-radius: 2px; color: var(--slate); }
  .ctx-badge.on { color: var(--up); border-color: var(--up); }
  .ctx-sec { border-bottom: 1px solid var(--rule); padding: 8px 0 4px; }
  .ctx-h { display: flex; justify-content: space-between; padding: 0 12px 6px; font-size: 9px; letter-spacing: .14em; color: var(--faint); }
  .ctx-h b { font-size: 11px; letter-spacing: 0; }
  .ctx-row { display: grid; grid-template-columns: 1fr 46px 62px 74px; align-items: center; gap: 6px;
    padding: 4px 12px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
  .ctx-row + .ctx-row { border-top: 1px solid rgba(127, 127, 127, .09); }
  .ctx-row .cs { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ctx-row .cq { color: var(--slate); text-align: right; }
  .ctx-row .cp { color: var(--ink); text-align: right; }
  .ctx-row .cv { text-align: right; }
  .ctx-row .cv.st { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
  .ctx-row .cv.up { color: var(--up); } .ctx-row .cv.dn { color: var(--dn); }
  .ctx-m { padding: 4px 12px 8px; font-size: 10.5px; color: var(--faint); }
  .ctx-foot { margin-top: auto; padding: 8px 12px; font-size: 9px; letter-spacing: .06em; color: var(--faint); border-top: 1px solid var(--rule); }
}
@media (min-width: 1380px) and (max-width: 1499px) {
  #ctx { display: flex; flex-direction: column; position: fixed; right: 0; bottom: 0; width: 300px;
    top: calc(var(--tick-h) + var(--top-h)); background: var(--shell); border-left: 1px solid var(--rule); z-index: 26; }
  main { margin-right: 300px; }
  .ctx-top { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--rule); }
  .ctx-k { font-size: 9px; letter-spacing: .2em; color: var(--faint); }
  .ctx-badge { font-size: 9px; letter-spacing: .08em; padding: 2px 7px; border: 1px solid var(--rule-strong); border-radius: 2px; color: var(--slate); }
  .ctx-badge.on { color: var(--up); border-color: var(--up); }
  .ctx-sec { border-bottom: 1px solid var(--rule); padding: 8px 0 4px; }
  .ctx-h { display: flex; justify-content: space-between; padding: 0 12px 6px; font-size: 9px; letter-spacing: .14em; color: var(--faint); }
  .ctx-h b { font-size: 11px; letter-spacing: 0; }
  .ctx-row { display: grid; grid-template-columns: 1fr 44px 58px 70px; align-items: center; gap: 6px; padding: 4px 12px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
  .ctx-row + .ctx-row { border-top: 1px solid rgba(127,127,127,.09); }
  .ctx-row .cs { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ctx-row .cq, .ctx-row .cp, .ctx-row .cv { text-align: right; }
  .ctx-row .cq { color: var(--slate); } .ctx-row .cp { color: var(--ink); }
  .ctx-row .cv.up { color: var(--up); } .ctx-row .cv.dn { color: var(--dn); }
  .ctx-row .cv.st { color: var(--faint); font-size: 9px; text-transform: uppercase; }
  .ctx-m { padding: 4px 12px 8px; font-size: 10.5px; color: var(--faint); }
  .ctx-foot { margin-top: auto; padding: 8px 12px; font-size: 9px; letter-spacing: .06em; color: var(--faint); border-top: 1px solid var(--rule); }
}
#chart { position: relative; }
#chart canvas.vp-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

/* ---- the desk strip above the chart ---- */
#ch-desk { display: flex; gap: 0; overflow-x: auto; overflow-y: hidden; background: var(--shell);
  border-bottom: 1px solid var(--rule); scrollbar-width: none; flex: 0 0 auto; }
#ch-desk::-webkit-scrollbar { display: none; }
#ch-desk .dk { flex: 1 1 0; min-width: 0; padding: 5px 12px 7px; border-right: 1px solid var(--rule); }
#ch-desk .dk:last-child { border-right: 0; }
#ch-desk .dk-h { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 4px;
  font-size: 8px; letter-spacing: .15em; color: var(--faint); }
#ch-desk .dk-h span:last-child { color: var(--slate); letter-spacing: .04em; }
#ch-desk .dk-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
#ch-desk .dk-r { display: flex; align-items: baseline; gap: 6px; font-size: 10px; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; }
#ch-desk .dk-r .k { color: var(--slate); min-width: 38px; }
#ch-desk .dk-r .v { color: var(--ink); font-weight: 500; flex: 1 1 auto; text-align: right; overflow: hidden; text-overflow: ellipsis; }
#ch-desk .dk-r .d { color: var(--faint); min-width: 46px; text-align: right; }
#ch-desk .dk-r .d.up { color: var(--up); } #ch-desk .dk-r .d.dn { color: var(--dn); }
@media (max-width: 899px) {
  #ch-desk .dk { flex: 0 0 76vw; }
  #v-chart #chart { height: calc(100svh - var(--top-h) - var(--tick-h) - var(--nav-h) - var(--act-h) - var(--tools-h) - var(--leg-h) - var(--desk-h, 0px) - env(safe-area-inset-bottom)); }
  #v-chart.has-bk #chart { height: calc(100svh - var(--top-h) - var(--tick-h) - var(--nav-h) - var(--act-h) - var(--tools-h) - var(--leg-h) - var(--desk-h, 0px) - 238px - env(safe-area-inset-bottom)); }
}
/* three columns per row, measured so nothing spills into the next card */
#ch-desk .dk { padding: 5px 10px 7px; }
#ch-desk .dk.wide { flex: 1.5 1 0; }
#ch-desk .dk-r { display: grid; grid-template-columns: 34px minmax(0, 1fr) 42px; align-items: baseline; gap: 5px;
  font-size: 9.5px; line-height: 1.55; white-space: nowrap; font-variant-numeric: tabular-nums; }
#ch-desk .dk-r .k { color: var(--slate); }
#ch-desk .dk-r .v { color: var(--ink); text-align: right; overflow: hidden; text-overflow: ellipsis; }
#ch-desk .dk-r .d { color: var(--faint); text-align: right; overflow: hidden; }
#ch-desk .dk-r .d.up { color: var(--up); } #ch-desk .dk-r .d.dn { color: var(--dn); }
#ch-desk .cut { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
#ch-desk .dk-2 { column-gap: 12px; }
@media (max-width: 899px) {
  #ch-desk .dk, #ch-desk .dk.wide { flex: 0 0 auto; width: 80vw; min-width: 270px; }
  #ch-desk .dk-r { font-size: 10.5px; grid-template-columns: 36px minmax(0, 1fr) 46px; }
  #ch-desk .dk-h { font-size: 8.5px; }
}

/* ---- the live flow read, bottom left of the chart ---- */
#ch-flow { position: absolute; left: 10px; bottom: 10px; z-index: 6; display: flex; align-items: center; gap: 10px;
  padding: 3px 8px; font-size: 9.5px; color: var(--slate); background: var(--shell);
  border: 1px solid var(--rule); border-radius: 2px; font-variant-numeric: tabular-nums; pointer-events: none; }
#ch-flow .fl-k { color: var(--faint); letter-spacing: .14em; font-size: 8px; }
#ch-flow b { color: var(--ink); font-weight: 500; }
#ch-flow b.up { color: var(--up); } #ch-flow b.dn { color: var(--dn); }
#ch-flow canvas { opacity: .9; }
#ch-flow button { pointer-events: auto; background: none; border: 1px solid var(--rule-strong); color: var(--faint);
  font-size: 8px; padding: 1px 5px; border-radius: 2px; cursor: pointer; letter-spacing: .06em; }
#ch-flow button:hover { color: var(--ink); border-color: var(--buy); }
@media (max-width: 600px) { #ch-flow { gap: 7px; font-size: 9px; left: 6px; bottom: 6px; } #ch-flow canvas { display: none; } }
#ch-flow { bottom: 26px; }
@media (max-width: 600px) { #ch-flow { bottom: 22px; } }

/* ---- market depth panel ---- */
#ch-depth { position: absolute; top: 6px; right: 6px; z-index: 8; width: 250px; background: var(--shell);
  border: 1px solid var(--rule-strong); border-radius: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.28); overflow: hidden; }
#ch-depth .dp-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--rule);
  font-size: 9px; letter-spacing: .16em; color: var(--faint); }
#ch-depth .dp-sym { flex: 1; letter-spacing: .02em; color: var(--slate); text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ch-depth .dp-h button { background: none; border: 0; color: var(--faint); font-size: 12px; cursor: pointer; padding: 0 2px; }
#ch-depth .dp-lad { padding: 4px 6px 6px; }
#ch-depth .dp-r { display: grid; grid-template-columns: 1fr 62px 28px; align-items: center; gap: 4px; position: relative;
  height: 18px; padding: 0 4px; font-size: 10px; font-variant-numeric: tabular-nums; }
#ch-depth .dp-r i { position: absolute; right: 34px; top: 2px; bottom: 2px; opacity: .16; pointer-events: none; }
#ch-depth .dp-r.bid i { background: var(--up); }
#ch-depth .dp-r.ask i { background: var(--dn); }
#ch-depth .dp-r .dp-p { position: relative; z-index: 1; }
#ch-depth .dp-r.bid .dp-p { color: var(--up); } #ch-depth .dp-r.ask .dp-p { color: var(--dn); }
#ch-depth .dp-r .dp-q { text-align: right; color: var(--ink); position: relative; z-index: 1; }
#ch-depth .dp-r .dp-o { text-align: right; color: var(--faint); font-size: 9px; position: relative; z-index: 1; }
#ch-depth .dp-spread { display: flex; justify-content: space-between; padding: 3px 4px; margin: 2px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 9px; color: var(--slate); }
#ch-depth .dp-spread i { font-style: normal; color: var(--faint); }
#ch-depth .dp-an { border-top: 1px solid var(--rule); padding: 5px 8px 7px; }
#ch-depth .dp-m-row { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; line-height: 1.65; }
#ch-depth .dp-m-row span { color: var(--slate); }
#ch-depth .dp-m-row b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
#ch-depth .dp-m-row b.up { color: var(--up); } #ch-depth .dp-m-row b.dn { color: var(--dn); }
#ch-depth .dp-m { padding: 10px; font-size: 10px; color: var(--faint); }
@media (max-width: 600px) { #ch-depth { width: 210px; right: 4px; top: 4px; } }

/* ---- option chain panel ---- */
#ch-chain { position: absolute; top: 6px; right: 6px; bottom: 6px; z-index: 9; width: 440px; max-width: calc(100% - 12px); display: flex; flex-direction: column;
  background: var(--shell); border: 1px solid var(--rule-strong); border-radius: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.28); overflow: hidden; }
#ch-chain[hidden] { display: none; }
#ch-chain .oc-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--rule); font-size: 12px; }
#ch-chain .oc-h > b { font-weight: 600; letter-spacing: .02em; }
#ch-chain .oc-h .num { color: var(--slate); font-size: 11px; } #ch-chain .oc-h em { font-style: normal; }
#ch-chain .oc-sp { flex: 1; }
#ch-chain .oc-mode button { padding: 3px 8px; font-size: 10px; }
#ch-chain .oc-exp { display: flex; gap: 4px; padding: 5px 8px; overflow-x: auto; border-bottom: 1px solid var(--rule); scrollbar-width: none; }
#ch-chain .oc-exp button { flex: none; border: 1px solid var(--rule); background: transparent; color: var(--slate); font-size: 10px; padding: 2px 8px; border-radius: 10px; cursor: pointer; }
#ch-chain .oc-exp button.on { color: var(--ink); border-color: var(--buy); background: var(--field); }
#ch-chain .oc-sum { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 5px 8px; font-size: 10px; color: var(--slate); border-bottom: 1px solid var(--rule); }
#ch-chain .oc-sum b { color: var(--ink); font-weight: 500; } #ch-chain .oc-note { margin-left: auto; color: var(--faint); }
#ch-chain .oc-r { display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: stretch; border-bottom: 1px solid var(--rule); font-size: 11px; }
#ch-chain .oc-th { font-size: 9px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
#ch-chain .oc-th > div { padding: 4px 6px; text-align: center; }
#ch-chain .oc-body { flex: 1; overflow-y: auto; position: relative; overscroll-behavior: contain; scrollbar-width: none; }
#ch-chain .oc-body::-webkit-scrollbar { display: none; }
#ch-chain .oc-c.oc-pe { padding-right: 8px; }
#ch-chain .oc-c, #ch-chain .oc-p { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 3px 6px; min-height: 30px; cursor: pointer; }
#ch-chain .oc-c.oc-ce, #ch-chain .oc-p.oc-ce { align-items: flex-start; } #ch-chain .oc-c.oc-pe, #ch-chain .oc-p.oc-pe { align-items: flex-end; }
#ch-chain .oc-c b, #ch-chain .oc-p b { font-weight: 500; color: var(--ink); position: relative; z-index: 1; }
#ch-chain small { font-size: 9px; color: var(--faint); position: relative; z-index: 1; }
#ch-chain small.up, #ch-chain em.up { color: var(--up); } #ch-chain small.dn, #ch-chain em.dn { color: var(--dn); }
#ch-chain .oc-c i { position: absolute; top: 4px; bottom: 4px; opacity: .18; pointer-events: none; }
#ch-chain .oc-c.oc-ce i { right: 0; background: var(--dn); } #ch-chain .oc-c.oc-pe i { left: 0; background: var(--up); }
#ch-chain .oc-r[data-itm-ce=true] .oc-ce, #ch-chain .oc-r[data-itm-pe=true] .oc-pe { background: color-mix(in srgb, var(--amber) 7%, transparent); }
#ch-chain .oc-k { display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; background: var(--field); color: var(--ink); }
#ch-chain .oc-r.atm .oc-k { color: var(--buy); }
#ch-chain [data-mine] { box-shadow: inset 0 0 0 2px var(--buy); }
#ch-chain .oc-c:hover, #ch-chain .oc-p:hover { background: var(--field); }
#ch-chain .oc-spot { position: relative; height: 0; border-top: 1px dashed var(--buy); }
#ch-chain .oc-spot span { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); z-index: 2; font-size: 9px; padding: 1px 6px; border-radius: 8px; background: var(--buy); color: #fff; }
#ch-chain .oc-m { padding: 12px; font-size: 11px; color: var(--faint); }
@media (max-width: 600px) { #ch-chain { top: 0; right: 0; bottom: 0; left: 0; width: auto; max-width: none; border-radius: 0; } #ch-chain .oc-r { grid-template-columns: 1fr 1fr 56px 1fr 1fr; } #ch-chain .oc-note { display: none; } }

/* ---- alerts, feed, clock and account now ride the ticker ---- */
#tickbar #top-right { display: flex; align-items: center; gap: 3px; margin-left: auto; padding: 0 4px 0 10px;
  height: 100%; background: var(--shell); position: sticky; right: 0; z-index: 3; }
#tickbar #top-right .iconbtn { height: 22px; width: 22px; padding: 0; }
#tickbar #top-right .iconbtn svg { width: 15px; height: 15px; }
#tickbar #top-right #feed { font-size: 9px; padding: 1px 6px; }
#tickbar #top-right #tkclock { padding: 0 8px 0 4px; margin: 0; font-size: 10px; }
#btn-account { padding: 0; }
.avatar-i { width: 21px; height: 21px; border-radius: 50%; background: var(--buy); color: #fff;
  display: grid; place-items: center; font-size: 9px; font-weight: 600; letter-spacing: .02em; }
#top.gone { display: none; }

/* ---- watchlist: strikes and list side by side on a wide desk ---- */
#watch .wl-cols { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  #watch .wl-cols { grid-template-columns: 1fr 1fr; column-gap: 30px; align-items: start; }
  #watch .wl-col { min-width: 0; }
}
#tickbar #top-right #tkclock { margin-left: 0; border-left: 0; }
#tickbar #top-right { padding-right: 8px; }
/* the chart has its own head; the global header is a duplicate there */
body[data-view=chart] #top { display: none; }

/* Math levels: five checks, each with its number, its tick and what the tick means */
.mlv { font-variant-numeric: tabular-nums; }
.mlv-r { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.mlv-r:last-child { border-bottom: 0; }
.mlv-t { font-weight: 600; text-align: center; line-height: 1.2; }
.mlv-t.ok { color: var(--up); }
.mlv-t.warn { color: var(--warn, #c98a00); }
.mlv-t.bad { color: var(--dn); }
.mlv-t.info { color: var(--muted, #8a8a8a); }
.mlv-t.off { color: var(--muted, #8a8a8a); }
.mlv-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlv-v { text-align: right; font-weight: 500; }
.mlv-m { grid-column: 2 / -1; color: var(--muted, #8a8a8a); font-size: 11.5px; line-height: 1.35; }
.mlv-r[data-s="fail"] .mlv-l, .mlv-r[data-s="fail"] .mlv-v { color: var(--dn); }
.mlv-leg { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 0 2px; color: var(--muted, #8a8a8a); font-size: 11px; }
.mlv-leg i { font-style: normal; font-weight: 600; margin-right: 3px; }
.mlv-leg i.ok { color: var(--up); }
.mlv-leg i.warn { color: var(--warn, #c98a00); }
.mlv-leg i.bad { color: var(--dn); }
.mlv-leg i.off { color: var(--muted, #8a8a8a); }

/* ---- the right pane on the chart: the charted underlying's option chain (panechain.js) ---- */
#ctx .ctx-chain { max-height: 58vh; overflow-y: auto; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.pc-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px var(--gx) 2px; }
.pc-h b { font-size: 13px; font-weight: 500; color: var(--ink); }
.pc-h span { font-size: 15px; font-weight: 500; color: var(--ink); }
.pc-h em { font-style: normal; font-size: 11px; margin-left: 4px; }
.pc-sub { display: flex; gap: 12px; padding: 0 var(--gx) 8px; font-size: 11px; color: var(--faint); }
.pc-r { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; min-height: 28px; border-top: 1px solid var(--rule); font-size: 12px; }
.pc-r.pc-th { position: sticky; top: 0; z-index: 1; background: var(--shell); min-height: 24px; font-size: 10.5px; color: var(--faint); }
.pc-r.pc-th > div { text-align: center; }
.pc-r.atm { background: var(--field); }
.pc-k { text-align: center; color: var(--slate); font-weight: 500; }
.pc-p { position: relative; height: 100%; display: flex; align-items: center; padding: 0 10px; cursor: pointer; }
.pc-p b { position: relative; font-weight: 500; color: var(--ink); }
.pc-ce { justify-content: flex-end; }
.pc-pe { justify-content: flex-start; }
.pc-p i { position: absolute; top: 5px; bottom: 5px; opacity: .14; border-radius: 2px; }
.pc-ce i { right: 0; background: var(--dn); }
.pc-pe i { left: 0; background: var(--up); }
.pc-p:hover { background: var(--hover); }
.pc-p[data-mine] { box-shadow: inset 0 0 0 1.5px var(--buy); }
.pc-spot { position: relative; height: 0; border-top: 1px dashed var(--buy); }
.pc-spot span { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); padding: 0 6px; font-size: 10.5px; color: var(--buy); background: var(--shell); }
.pc-m { padding: 14px var(--gx); font-size: 12px; color: var(--faint); }

/* ---- the Stocks tab: the stock scan's setups (stocks.js) ---- */

/* ---- Stocks: the screener (stocks.js) ---- */
.scr-sec { padding: 8px var(--gx); }
.scr-h { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.scr-h .sub { font-weight: 400; font-size: 12px; margin-left: 6px; }
.scr-chips button { display: inline-flex; align-items: center; gap: 6px; }
.scr-chips .x { color: var(--faint); font-size: 14px; line-height: 1; padding: 0 2px; }
.scr-c { max-width: 820px; display: grid; grid-template-columns: minmax(0, 1.4fr) 104px minmax(0, 1.2fr) minmax(64px, .7fr) 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.scr-c input[type=number] { min-width: 0; width: 100%; height: 36px; font-size: 13px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 0 10px; }
.scr-c:not(:has(input)) .dd-rf { grid-column: span 2; }
/* the pickers (stocks.js): shadcn's Select trigger and popover */
.dd { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; width: 100%; height: 36px; padding: 0 8px 0 10px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-sm); font-size: 13px; color: var(--ink); text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: border-color .12s, box-shadow .12s; }
.dd:hover { border-color: var(--rule-strong); }
.dd:focus-visible, .dd.open { outline: 0; border-color: color-mix(in srgb, var(--buy) 55%, transparent); box-shadow: 0 0 0 3px var(--buy-wash); }
.dd-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-ph { color: var(--slate); }
.dd-ch { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .5; }
.dd-pop { position: fixed; z-index: 200; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.06); overflow: hidden; animation: dd-in .12s ease-out; }
.dd-pop[hidden] { display: none; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dd-sh { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--rule); flex: none; }
.dd-sh svg { width: 15px; height: 15px; fill: none; stroke: var(--slate); stroke-width: 2; stroke-linecap: round; flex: none; }
.dd-q { flex: 1; min-width: 0; height: 38px; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0; font-size: 13px; outline: 0; }
.dd-list { overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.dd-g { padding: 8px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--slate); }
.dd-i { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px; font-size: 13px; color: var(--ink); cursor: pointer; user-select: none; }
.dd-i.act { background: var(--field); }
.dd-i.sel { font-weight: 500; }
.dd-sym { width: 16px; text-align: center; color: var(--slate); font-variant-numeric: tabular-nums; }
.dd-ck { width: 15px; height: 15px; margin-left: auto; flex: none; fill: none; stroke: var(--buy); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dd-none { padding: 18px 8px; text-align: center; font-size: 13px; color: var(--slate); }
.scr-act { max-width: 820px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.scr-save { display: inline-flex; gap: 6px; margin-left: auto; }
.scr-save input { width: 150px; height: 32px; font-size: var(--t-12); }
.scr-note { margin-top: 10px; font-size: 12px; }
.scr-count { padding: 10px var(--gx) 6px; font-size: 13px; color: var(--slate); }
.scr-count b { color: var(--ink); }
.scr-tw { overflow-x: auto; margin: 0 0 12px; }
.scr-t { width: 100%; border-collapse: collapse; font-size: var(--t-12); font-variant-numeric: tabular-nums; }
.scr-t th, .scr-t td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); }
.scr-t th:first-child, .scr-t td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); padding-left: var(--gx); }
.scr-t th { font-weight: 500; color: var(--slate); cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--paper); }
.scr-t th.on { color: var(--ink); }
.scr-t td.up { color: var(--up); } .scr-t td.dn { color: var(--dn); }
.scr-more { padding: 0 var(--gx) 12px; }
@media (max-width: 520px) {
  /* a filter as a small card: the reading and the remove button, then "is above" and what it is compared with */
  .scr-c { grid-template-columns: 104px minmax(0, 1fr) 30px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
  .scr-c .dd-f { grid-column: 1 / 3; grid-row: 1; }
  .scr-c [data-rm] { grid-column: 3; grid-row: 1; }
  .scr-c .dd-op { grid-column: 1; grid-row: 2; }
  .scr-c .dd-rf, .scr-c:not(:has(input)) .dd-rf { grid-column: 2 / 4; grid-row: 2; }
  .scr-c input { grid-column: 2 / 4; grid-row: 3; }
  .scr-save { margin-left: 0; width: 100%; } .scr-save input { flex: 1; }
}
