/* Trading Desk. Tokens match the bot dashboard so both read as one product. */
:root {
  --bg: #eef0f5; --panel: #ffffff; --panel-2: #f6f7fb; --ink: #151a2d; --muted: #5d6582; --line: #dde1ec;
  --accent: #c8721c; --accent-ink: #ffffff;
  --up: #11805b; --down: #c23f37; --warn: #a86f12; --calm: #4e5cc4; --shock: #a8408c; --idle: #7b819a;
  --up-soft: #e3f3ec; --down-soft: #fbe8e6; --warn-soft: #f8efdc; --calm-soft: #e8eafb; --shock-soft: #f6e5f1; --idle-soft: #eceef4;
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1120; --panel: #151a2c; --panel-2: #1b2136; --ink: #e8eaf3; --muted: #8f96b3; --line: #262d47;
  --accent: #f0a04b; --accent-ink: #1a1206;
  --up: #3cc48f; --down: #f2685d; --warn: #e3b14a; --calm: #8d98f5; --shock: #e07fc6; --idle: #9097b0;
  --up-soft: #15302a; --down-soft: #3a1c1f; --warn-soft: #352a14; --calm-soft: #1f2447; --shock-soft: #35203a; --idle-soft: #22273a;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0d1120; --panel: #151a2c; --panel-2: #1b2136; --ink: #e8eaf3; --muted: #8f96b3; --line: #262d47;
  --accent: #f0a04b; --accent-ink: #1a1206;
  --up: #3cc48f; --down: #f2685d; --warn: #e3b14a; --calm: #8d98f5; --shock: #e07fc6; --idle: #9097b0;
  --up-soft: #15302a; --down-soft: #3a1c1f; --warn-soft: #352a14; --calm-soft: #1f2447; --shock-soft: #35203a; --idle-soft: #22273a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45; margin: 0; overflow-x: hidden; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1480px; margin: 0 auto; padding-inline: 16px; padding-block: 0 48px; }
a { color: var(--calm); }

/* header + tabs */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1480px; margin: 0 auto; padding: 10px 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.brand { font-family: var(--f-display); font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.live { color: var(--down); background: var(--down-soft); }
.chip.sandbox { color: var(--calm); background: var(--calm-soft); }
.chip.demo { color: var(--warn); background: var(--warn-soft); }
.chip.ok { color: var(--up); background: var(--up-soft); }
.chip.bad { color: var(--down); background: var(--down-soft); }
.chip.muted { color: var(--idle); background: var(--idle-soft); }
.chip.sm { font-size: 10.5px; padding: 1px 7px; }
.bar-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 13px; }
.bar-meta b { color: var(--ink); font-weight: 600; }
.spacer { flex: 1; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; width: 100%; margin-top: 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { font: 600 13.5px var(--f-body); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px 10px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .cnt { font: 500 11px var(--f-mono); color: var(--muted); margin-left: 4px; }
.theme-btn { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 4px 8px; cursor: pointer; font: 12px var(--f-body); }
.tape { min-height: 46px; border-bottom: 1px solid var(--line); background: var(--panel); }

/* layout */
.page { display: none; }
.page.on { display: block; }
.intro { margin: 18px 0 4px; color: var(--muted); max-width: 90ch; }
.intro b { color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: span 12; }
@media (max-width: 1080px) { .s3, .s4, .s5, .s6, .s7, .s8, .s9 { grid-column: span 12; } }
.h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; margin-bottom: 12px; }
.h h2 { margin: 0; font-family: var(--f-display); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.h .sub { color: var(--muted); font-size: 12px; }
.help { color: var(--muted); font-size: 12.5px; margin: -4px 0 12px; max-width: 80ch; }
.banner { margin-top: 14px; padding: 10px 14px; border-radius: var(--r); background: var(--warn-soft); font-size: 13px; }
.banner b { color: var(--warn); }
.empty { color: var(--muted); font-size: 13px; padding: 18px 4px; }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); } .mut { color: var(--muted); }
.btn { font: 600 13px var(--f-body); border-radius: 8px; padding: 8px 13px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.danger { background: var(--down); border-color: var(--down); color: var(--panel); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .tab:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select, input[type="search"], input[type="text"], input[type="password"] { font: 13px var(--f-body); padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); max-width: 100%; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: 600 12.5px var(--f-body); background: var(--panel); color: var(--muted); border: 0; padding: 6px 10px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--calm-soft); color: var(--ink); }
.foot { margin-top: 18px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* story */
.story { font-size: 15px; line-height: 1.6; }
.story p { margin: 0 0 8px; }
.story b { font-weight: 600; }

/* index cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.card { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.card .lab { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.card .val { font: 600 18px var(--f-mono); margin-top: 2px; }
.card canvas { width: 100%; height: 28px; display: block; margin-top: 6px; }

/* stat facts */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fact { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.fact b { display: block; color: var(--ink); font-size: 16px; font-weight: 600; font-family: var(--f-mono); }
.fact small { display: block; margin-top: 2px; }

/* market mode (from bot dashboard) */
.mode-top { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; }
.mode-name { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.mode-why { color: var(--muted); max-width: 60ch; margin-top: 8px; }
.mode-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.mode-facts .fact b { font-size: 14px; font-family: var(--f-body); }
.inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin-top: 18px; }
@media (max-width: 640px) { .inputs { grid-template-columns: minmax(0, 1fr); } }
.inp label, .meter label { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.inp label .num, .meter label .num { color: var(--ink); text-align: right; }
.track { position: relative; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.track .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line); }
.track .fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.dots { display: flex; gap: 4px; }
.dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-2); }
.ribbon { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: var(--panel-2); margin-top: 18px; }
.ribbon span { height: 100%; position: relative; }
.ribbon span em { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 6px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--panel); white-space: nowrap; overflow: hidden; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
@media (max-width: 520px) { .ticks .opt { display: none; } }

/* risk */
.pnl { font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 4.4vw, 48px); line-height: 1; }
.pnl-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.pnl-split { color: var(--muted); font-size: 13px; }
.meters { display: grid; gap: 12px; margin-top: 16px; }
.meter .track { height: 8px; }
.kill { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kill-note { font-size: 12px; color: var(--muted); flex: 1 1 200px; }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; padding: 10px; border-radius: 8px; background: var(--down-soft); font-size: 13px; }

/* charts */
.chart { width: 100%; height: 280px; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 5px; }
.legend i.sq { height: 10px; width: 10px; border-radius: 2px; }
.lwc { width: 100%; height: 460px; position: relative; }
.lwc.rsi { height: 130px; margin-top: 6px; }
@media (max-width: 640px) { .lwc { height: 340px; } }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: 12px var(--f-mono); color: var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.12); white-space: nowrap; }
.tv { height: 560px; position: relative; }
@media (max-width: 640px) { .tv { height: 480px; } }
.tv.short { min-height: 300px; }
.tv-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 20px; background: var(--panel-2); border-radius: 8px; }

/* watchlist */
.wl { display: grid; gap: 2px; max-height: 520px; overflow-y: auto; }
.wl-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 70px minmax(0, .9fr) 54px; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.wl-row:hover { background: var(--panel-2); }
.wl-row.in { background: var(--calm-soft); }
.sym { font-weight: 600; font-size: 13px; }
.sec { font-size: 11px; color: var(--muted); }
.wl-row canvas { width: 70px; height: 24px; }
.px { text-align: right; font-size: 13px; }
.chg { display: block; font-size: 11px; }
.push { font-size: 11px; text-align: center; border-radius: 4px; padding: 2px 0; }
.flash-up { animation: fu .7s; } .flash-down { animation: fd .7s; }
@keyframes fu { from { color: var(--up); } } @keyframes fd { from { color: var(--down); } }

/* positions */
.pos { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; }
.pos + .pos { margin-top: 10px; }
.pos-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.pos-top .sym { font-size: 16px; }
.pos-pnl { margin-left: auto; font-family: var(--f-display); font-weight: 700; font-size: 22px; }
.ladder { position: relative; height: 34px; }
.ladder .rail { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--down-soft), var(--panel-2) 40%, var(--up-soft)); }
.ladder .tick { position: absolute; top: 9px; width: 2px; height: 16px; background: var(--muted); }
.ladder .tick b { position: absolute; top: 18px; transform: translateX(-50%); font: 500 10px var(--f-mono); color: var(--muted); white-space: nowrap; }
.ladder .tick.l b { transform: none; left: 0; }
.ladder .tick.rt b { transform: translateX(-100%); left: 2px; }
.ladder .now { position: absolute; top: 6px; width: 12px; height: 22px; margin-left: -6px; border-radius: 4px; background: var(--ink); }
.pos-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.pos-facts b { color: var(--ink); font-weight: 500; font-family: var(--f-mono); }

/* tables */
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.tbl-wrap.tall { max-height: 560px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
th.sort { cursor: pointer; }
th.sort:hover { color: var(--ink); }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }
tfoot td { border-bottom: 0; font-weight: 600; }
tr.atm td { background: var(--warn-soft); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }

/* news + events */
.news { display: grid; max-height: 520px; overflow-y: auto; }
.nrow { display: grid; grid-template-columns: 46px 52px minmax(0, 1fr); gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); align-items: start; }
.nrow:last-child { border-bottom: 0; }
.ntime { color: var(--muted); font-size: 12px; padding-top: 1px; }
.score { font-size: 12px; text-align: center; border-radius: 4px; padding: 1px 0; font-family: var(--f-mono); }
.ntitle { font-size: 13.5px; overflow-wrap: anywhere; }
.ntitle a { color: inherit; text-decoration: none; }
.ntitle a:hover { text-decoration: underline; }
.ntags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.tag { background: var(--panel-2); border-radius: 4px; padding: 0 6px; }
.nrow.strong .ntitle { font-weight: 600; }
.ev { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); align-items: center; }
.ev:last-child { border-bottom: 0; }
.ev .when { font-size: 12px; }
.ev .when small, .ev .what small { display: block; color: var(--muted); font-size: 11.5px; }
.ev.active { background: var(--warn-soft); border-radius: 6px; }

/* heatmap */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.tile { border-radius: 8px; padding: 10px; min-height: 76px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); border: 1px solid transparent; }
.tile .t-name { font-weight: 600; font-size: 13px; }
.tile .t-val { font: 600 17px var(--f-mono); }
.tile .t-sub { font-size: 11px; color: var(--muted); }
.scale { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.scale .bar-g { flex: 0 1 220px; height: 8px; border-radius: 4px; }

/* options */
.oi { display: grid; gap: 3px; font-size: 12px; }
.oi-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); gap: 8px; align-items: center; }
.oi-row .side { display: flex; height: 14px; position: relative; }
.oi-row .side.l { justify-content: flex-end; }
.oi-row .side i { display: block; height: 100%; border-radius: 3px; }
.oi-row .side.l i { border-radius: 3px 0 0 3px; }
.oi-row .side.r i { border-radius: 0 3px 3px 0; }
.oi-row .k { text-align: center; font-family: var(--f-mono); color: var(--muted); }
.oi-row.atm .k { color: var(--ink); font-weight: 600; background: var(--warn-soft); border-radius: 4px; }
.oi-row.spot-line { height: 0; border-top: 2px dashed var(--accent); margin: 2px 0; }
.oi-row:hover .k { color: var(--ink); }

/* participants */
.who { display: grid; grid-template-columns: 70px minmax(0, 1fr) 90px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.who:last-child { border-bottom: 0; }
.ls { display: flex; height: 12px; border-radius: 3px; overflow: hidden; gap: 2px; }

/* AI decisions */
.ai { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.ai + .ai { margin-top: 10px; }
.ai-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.ai-top .ttl { font-weight: 600; }
.ai-act { font: 700 13px var(--f-display); letter-spacing: .03em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; }
.ai .why { font-size: 14px; }
.ai .meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.conf { display: inline-flex; align-items: center; gap: 6px; }
.conf .track { width: 70px; }
details.raw summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.raw pre { font: 11.5px var(--f-mono); background: var(--panel-2); padding: 10px; border-radius: 8px; overflow-x: auto; max-height: 300px; }

/* markdown reports */
.md { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.md h1 { font-family: var(--f-display); font-size: 22px; margin: 0 0 10px; }
.md h2 { font-family: var(--f-display); font-size: 17px; margin: 22px 0 8px; }
.md h3 { font-size: 15px; margin: 18px 0 6px; }
.md table { margin: 10px 0; display: block; overflow-x: auto; }
.md td, .md th { white-space: normal; position: static; }
.md code { font: 12.5px var(--f-mono); background: var(--panel-2); padding: 1px 4px; border-radius: 4px; }
.md pre { background: var(--panel-2); padding: 10px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.rep-list { display: grid; gap: 4px; }
.rep-list button { text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); font: 13px var(--f-body); }
.rep-list button:hover { background: var(--panel-2); }
.rep-list button[aria-pressed="true"] { background: var(--calm-soft); border-color: var(--line); }
.rep-list small { display: block; color: var(--muted); font-size: 11.5px; }

/* sources + glossary */
.src { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.src:last-child { border-bottom: 0; }
.src small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
dl.gloss { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13.5px; }
dl.gloss dt { font-weight: 600; }
dl.gloss dd { margin: 0; color: var(--muted); }
@media (max-width: 640px) { dl.gloss { grid-template-columns: minmax(0, 1fr); } dl.gloss dd { margin-bottom: 8px; } }
@media (prefers-reduced-motion: reduce) { .flash-up, .flash-down { animation: none; } }
.ai > .ai-act { justify-self: start; }

.meter-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.meter-h .mut { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
#optMeters { margin-top: 6px; }

.spark-cell canvas { width: 110px; height: 26px; display: block; }

/* phone: P&L and the stop button come first, and a bar at the bottom keeps them in reach */
.mbar { display: none; }
@media (max-width: 760px) {
  #storyPanel { order: -2; } #pnlPanel { order: -1; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .mbar { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
  .mbar-pnl { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; font-size: 13px; }
  .mbar-pnl b { font: 700 18px var(--f-mono); }
  .mbar-pnl #mbNote { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar .btn { flex: none; }
  body { padding-bottom: 76px; }
}

.ctl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ctl-row .btn[disabled] { opacity: .45; cursor: not-allowed; }
.phone-status { width: 100%; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 10px; border-top: 1px dashed var(--line); }
.confirm select, .confirm input { font: inherit; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }

.sel-now { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sel-pick { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.sel-pick .lab { font-size: 12px; color: var(--muted); }
.sel-pick b { font: 700 17px var(--f-display); }
.sel-now .help { grid-column: 1 / -1; }
.sel-tbl td { vertical-align: top; }
.sel-tbl tr.sel-on td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sel-tbl tr.sel-on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 640px) { .sel-now { grid-template-columns: minmax(0, 1fr); } #selPanel { order: -1; } }
.sel-tbl .sec { white-space: normal; }
@media (max-width: 640px) {
  .sel-tbl thead { display: none; }
  .sel-tbl, .sel-tbl tbody, .sel-tbl tr, .sel-tbl td { display: block; width: 100%; }
  .sel-tbl tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .sel-tbl td { border: 0; padding: 4px 10px; }
  .sel-tbl td:nth-child(2)::before { content: "Stocks: "; color: var(--muted); font-size: 12px; }
  .sel-tbl td:nth-child(3)::before { content: "Sensex options: "; color: var(--muted); font-size: 12px; }
}
.btn.sm { font-size: 12px; padding: 4px 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.st-confirm { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--warn-soft); font-size: 13px; }
.st-confirm ul { margin: 6px 0 10px; padding-left: 18px; }
.st-confirm.ok { background: var(--up-soft); }
.st-confirm.bad { background: var(--down-soft); }
.st-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.st-pick fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 8px 12px 10px; min-width: 0; }
.st-pick legend { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.st-pick label { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13px; cursor: pointer; }
.st-pick label .sec { margin-left: auto; text-align: right; }
.st-now .fact b { font-family: var(--f-body); font-size: 14px; }
.st-how { max-width: 100ch; }
.st-how-lead { margin: 0 0 14px; font-size: 15px; }
.st-how-step { padding-block: 12px; border-top: 1px solid var(--line); }
.st-how-step h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.st-how-step p { margin: 0 0 8px; }
.st-how-step ul { margin: 0; padding-left: 18px; }
.st-how-step li { margin-bottom: 6px; }
.st-how-step .tbl-wrap { margin-bottom: 8px; }
.st-how-eg { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); }
.st-tbl td { vertical-align: top; white-space: normal; }
.st-tbl td:nth-child(2) { min-width: 220px; max-width: 440px; }
.st-tbl td.r { min-width: 200px; }
.st-tbl .res + .res { margin-top: 6px; }
.st-tbl tr.on td { background: var(--up-soft); }
.st-tbl .chip + .sec { margin-top: 4px; }
@media (max-width: 640px) {
  .st-tbl thead { display: none; }
  .st-tbl tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .st-tbl td { display: block; border: 0; min-width: 0 !important; max-width: none !important; padding: 3px 8px; }
  .st-tbl td.r { text-align: left; }
  .st-tbl td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
}
.ichi-tbl td { vertical-align: top; white-space: normal; }
.ichi-tbl td:nth-child(2) { max-width: 300px; }
.ichi-tbl td.r { min-width: 230px; }
.ichi-tbl td:nth-child(2) { min-width: 180px; }
@media (max-width: 640px) {
  .ichi-tbl thead { display: none; }
  .ichi-tbl tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .ichi-tbl td { display: block; border: 0; min-width: 0 !important; max-width: none !important; padding: 3px 8px; }
  .ichi-tbl td.r { text-align: left; }
  .ichi-tbl td.r::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
}

/* tools tab */
.sz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; margin-top: 12px; }
.sz-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.sz-grid input, .sz-grid select { font: 13px var(--f-body); padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-width: 0; }
.sz-grid input[type="number"] { font-family: var(--f-mono); }
.fact.warn { background: var(--down-soft); }
.fact.good { background: var(--up-soft); }
.pf-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 8px 0 6px; }
.pf-bars { display: grid; grid-template-columns: minmax(70px, max-content) minmax(0, 1fr) max-content; gap: 4px 8px; align-items: center; font-size: 12.5px; }
.pf-bars .bar { height: 10px; border-radius: 3px; background: var(--panel-2); position: relative; overflow: hidden; }
.pf-bars .bar i { position: absolute; top: 0; bottom: 0; }
.pf-bars .bar i.up { background: var(--up); } .pf-bars .bar i.down { background: var(--down); }
.pf-bars .v { font-family: var(--f-mono); text-align: right; }
.pf-bars .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-log { max-height: 220px; overflow: auto; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; font: 11.5px/1.45 var(--f-mono); white-space: pre-wrap; margin: 10px 0 0; }
.tl-tbl .tags { white-space: normal; min-width: 140px; }
.tl-tbl .tags .chip { margin: 0 4px 2px 0; }
.how-steps { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.how-steps li { line-height: 1.5; }
.how-steps li b.t { display: block; margin-bottom: 2px; }
