/* ============ tokens ============ */
:root {
  color-scheme: light;
  --page: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f3f3f0;
  --hover: #f0efeb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #ebeae5;
  --grid: #ebeae5;
  --axis: #c3c2b7;
  --call: #eb6834;          /* calls / resistance */
  --put: #2a78d6;           /* puts / support */
  --aux: #1baf7a;           /* max pain, secondary series */
  --call-wash: rgba(235, 104, 52, 0.07);
  --put-wash: rgba(42, 120, 214, 0.07);
  --up: #006300;
  --down: #d03b3b;
  --up-wash: rgba(12, 163, 12, 0.10);
  --down-wash: rgba(208, 59, 59, 0.10);
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --focus: rgba(42, 120, 214, 0.35);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 1px 1px rgba(11, 11, 11, 0.02);
  --shadow-lg: 0 24px 48px -12px rgba(11, 11, 11, 0.18);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #161615;
    --surface-2: #1f1f1d;
    --hover: #222220;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --line: #262624;
    --grid: #2c2c2a;
    --axis: #383835;
    --call: #d95926;
    --put: #3987e5;
    --aux: #199e70;
    --call-wash: rgba(217, 89, 38, 0.09);
    --put-wash: rgba(57, 135, 229, 0.09);
    --up: #0ca30c;
    --down: #e66767;
    --up-wash: rgba(12, 163, 12, 0.14);
    --down-wash: rgba(230, 103, 103, 0.14);
    --shadow: none;
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #161615;
  --surface-2: #1f1f1d;
  --hover: #222220;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --line: #262624;
  --grid: #2c2c2a;
  --axis: #383835;
  --call: #d95926;
  --put: #3987e5;
  --aux: #199e70;
  --call-wash: rgba(217, 89, 38, 0.09);
  --put-wash: rgba(57, 135, 229, 0.09);
  --up: #0ca30c;
  --down: #e66767;
  --up-wash: rgba(12, 163, 12, 0.14);
  --down-wash: rgba(230, 103, 103, 0.14);
  --shadow: none;
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}

/* ============ base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2 { margin: 0; letter-spacing: -0.015em; }
.num, td, .stat-value { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.desc { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* ============ shell ============ */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-mark { width: 24px; height: 24px; stroke: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--ink-2); font-weight: 500; text-align: left;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--ink); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; }
.status-line.muted { font-weight: 400; padding-left: 16px; margin-top: -6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-line.live .dot { background: var(--good); box-shadow: 0 0 0 3px var(--up-wash); }
.status-line.demo .dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(250, 178, 25, 0.18); }
.version { font-size: 11px; padding-left: 16px; margin-top: -4px; font-variant-numeric: tabular-nums; }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; margin-top: 8px; border-radius: 10px; background: var(--surface-2); width: max-content; }
.theme-switch button { display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--muted); }
.theme-switch button svg { width: 15px; height: 15px; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 16px 32px;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.page-title h1 { font-size: 20px; font-weight: 650; }
.page-title p { margin: 1px 0 0; font-size: 12.5px; }
.page-title h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.session-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; background: var(--surface-2); color: var(--ink-2); }
.session-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.session-pill.live { background: var(--up-wash); color: var(--up); }
.session-pill.live::before { background: var(--good); }
.session-pill[hidden] { display: none; }
.top-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.symbol-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.symbol-picker[hidden] { display: none; }
.chips { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.chips button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.chips button:hover { color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.search {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted);
}
.search:focus-within { border-color: var(--axis); }
.search svg { width: 15px; height: 15px; }
.search input { border: 0; outline: 0; background: none; width: 96px; color: var(--ink); text-transform: uppercase; font-size: 13px; }
.search input::placeholder { text-transform: none; color: var(--muted); }
.search.wide input { width: 180px; }
.select {
  height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  appearance: none; font-size: 13px; font-weight: 500;
}
.chart-btn { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 13px; }
.chart-btn svg { width: 15px; height: 15px; }
.refresh { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--axis); }
.icon-btn svg { width: 15px; height: 15px; }
#pause .i-play, #pause[aria-pressed="true"] .i-pause { display: none; }
#pause[aria-pressed="true"] .i-play { display: block; }
#pause[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.alert {
  margin: 16px 32px 0; padding: 12px 16px; border-radius: 12px;
  background: var(--down-wash); color: var(--ink); font-size: 13px;
}
.alert strong { color: var(--down); }
.alert.kite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.alert.kite.ok { background: var(--up-wash); border-color: transparent; box-shadow: none; }
.alert.kite strong { color: var(--ink); }
.alert.kite .btn { height: 34px; display: inline-flex; align-items: center; text-decoration: none; }
.alert[hidden] { display: none; }
.signout { text-decoration: none; }
.signed-in { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.page-title { display: flex; align-items: center; gap: 12px; }
.page-back { flex: none; }
.page-back[hidden] { display: none; }
.people-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.people-add .search { flex: 1; min-width: 220px; }
.people-add .search input { width: 100%; text-transform: none; }
.people-add .btn { height: 34px; }
.nav-item[hidden] { display: none; }
.access-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.access-mode label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.access-mode label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.access-mode input { margin-top: 3px; accent-color: var(--ink); }
.access-mode b { display: block; font-weight: 600; font-size: 13.5px; }
.access-mode small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.signout:hover { color: var(--ink); }

.ticker {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  margin: 20px 32px 0; padding: 4px 0;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ticker::-webkit-scrollbar { display: none; }
.tick { flex: 1 0 auto; min-width: 150px; padding: 10px 18px; border: 0; background: none; text-align: left; }
.tick + .tick { border-left: 1px solid var(--line); }
.tick[data-sym]:hover { background: var(--hover); }
.tick-name { font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tick-row { display: flex; align-items: baseline; gap: 8px; }
.tick-last { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tick-chg { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }

main { padding: 20px 32px 24px; }
.panel { display: flex; flex-direction: column; gap: 20px; }
.panel[hidden] { display: none; }
.footer { padding: 0 32px 32px; font-size: 12px; color: var(--muted); }

/* ============ cards ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.card-head.padded { padding: 18px 20px 0; margin-bottom: 14px; }
.card-head.wrap { align-items: flex-start; }
.card h2 { font-size: 15px; font-weight: 600; }
.count { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.legend i.ln { width: 12px; height: 2px; border-radius: 1px; vertical-align: 3px; }
.legend i.dash { width: 12px; height: 0; border-top: 2px dashed var(--ink); border-radius: 0; vertical-align: 3px; }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 230px; }
.chart-box.xs { height: 150px; }

/* ============ hero ============ */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; padding: 22px 24px; }
.hero-main { min-width: 200px; }
.hero-sym { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.hero-sym .pill { font-weight: 500; }
.hero-price { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hero-chg { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px 0; }
.stat { padding: 0 20px; border-left: 1px solid var(--line); }
.stat-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stat-value { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.stat-note { font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.bull { background: var(--up-wash); color: var(--up); }
.pill.bear { background: var(--down-wash); color: var(--down); }

/* ============ positioning ============ */
.tilt { margin-bottom: 14px; }
.tilt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.tilt-verdict { font-size: 15px; font-weight: 600; }
.tilt-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.tilt-bar span { display: block; border-radius: 2px; }
.tilt-key { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.tilt-key b { font-weight: 600; }
.evidence { list-style: none; margin: 0; padding: 0; }
.evidence li { border-top: 1px solid var(--line); }
.ev-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; width: 100%; padding: 11px 2px; border: 0; background: none; text-align: left; }
.ev-row:hover .ev-name { color: var(--ink); }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--axis); }
.ev-dot.bull { background: var(--good); }
.ev-dot.bear { background: var(--critical); }
.ev-name { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.ev-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ev-row svg { width: 14px; height: 14px; color: var(--muted); transition: transform 0.15s; }
.evidence li.open .ev-row svg { transform: rotate(180deg); }
.ev-note { display: none; padding: 0 2px 12px 24px; font-size: 12.5px; color: var(--muted); }
.evidence li.open .ev-note { display: block; }
.ev-note .pill { margin-right: 6px; }

/* ============ key levels ============ */
.lv { display: grid; grid-template-columns: 112px 80px minmax(0, 1fr) 96px; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 13px; }
.lv:first-child { border-top: 0; }
.lv-name { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.lv-name i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lv-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.lv-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.lv-bar span { display: block; height: 100%; border-radius: 3px; }
.lv-dist { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv.spot { margin: 2px -8px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--ink); color: var(--surface); }
.lv.spot + .lv { border-top: 0; }
.lv.spot .lv-name, .lv.spot .lv-dist { color: inherit; opacity: 0.8; }
.lv.spot .lv-bar { background: none; }

/* ============ controls ============ */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 0 20px 14px; }
.field { display: inline-flex; align-items: center; gap: 8px; }
.field > span { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); }
.toolbar .seg { background: var(--surface); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg.lg button { padding: 6px 14px; font-weight: 600; }
.seg.range button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 30px; height: 18px; margin: 0; border-radius: 999px; background: var(--axis); position: relative; cursor: pointer; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked { background: var(--ink); }
.toggle input:checked::after { transform: translateX(12px); background: var(--surface); }
.btn { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.progress { height: 3px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: -8px; }
.progress span { display: block; height: 100%; background: var(--put); transition: width 0.3s; }

/* ============ tables ============ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 14px; text-align: right; white-space: nowrap; }
.table th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface); border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 500; color: var(--muted);
}
.table td { border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-sym] { cursor: pointer; }
.table tbody tr:hover td { background: var(--hover); }
.table .l { text-align: left; }
.table .c { text-align: center; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover, .table th.sorted { color: var(--ink); }
.table td.sym { font-weight: 600; }
.table tr.selected td { background: var(--surface-2); }
.table .empty-row td { padding: 36px; text-align: center; color: var(--muted); white-space: normal; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.tag.bull { background: var(--up-wash); color: var(--up); }
.tag.bear { background: var(--down-wash); color: var(--down); }
.mini-range { position: relative; display: inline-block; width: 64px; height: 4px; border-radius: 2px; background: var(--surface-2); vertical-align: middle; }
.mini-range span { position: absolute; top: -3px; width: 3px; height: 10px; border-radius: 2px; background: var(--ink); }

/* option chain */
.chain th.ce-h { color: var(--call); font-weight: 600; }
.chain th.pe-h { color: var(--put); font-weight: 600; }
.chain thead tr:first-child th { border-bottom: 0; padding-bottom: 0; font-size: 12px; }
.chain td { padding: 8px 12px; }
.chain td.strike { text-align: center; font-weight: 650; background: var(--surface-2); min-width: 92px; }
.chain td.strike small { display: block; font-weight: 500; font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.chain td.itm-ce { background: var(--call-wash); }
.chain td.itm-pe { background: var(--put-wash); }
.chain tr.atm td.strike { background: var(--ink); color: var(--surface); }
.chain tr.atm td.strike small { color: inherit; opacity: 0.7; }
.chain tr.spot-row td { padding: 0; border: 0; height: 0; position: relative; }
.chain tr.spot-row td div { position: absolute; left: 0; right: 0; top: -1px; border-top: 2px solid var(--ink); }
.chain tr.spot-row td span { position: absolute; left: 50%; transform: translate(-50%, -50%); top: 0; z-index: 2; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: 10.5px; font-weight: 600; }
.chain td.oi { position: relative; min-width: 96px; }
.chain td.oi .fill { position: absolute; top: 9px; bottom: 9px; border-radius: 4px; opacity: 0.22; }
.chain td.oi.ce .fill { right: 6px; background: var(--call); }
.chain td.oi.pe .fill { left: 6px; background: var(--put); }
.chain td.oi span { position: relative; }
.chain td.oi.max span { font-weight: 700; }
.chain .ltp-chg { display: block; font-size: 11px; line-height: 1.2; }
.chain:not(.full) .x { display: none; }
.bu-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.bu-dot.bull { background: var(--good); }
.bu-dot.bear { background: var(--critical); }
.bu-dot.hollow { background: none; box-shadow: inset 0 0 0 2px currentColor; }
.bu-dot.hollow.bull { color: var(--good); }
.bu-dot.hollow.bear { color: var(--critical); }
.footnote { margin: -8px 0 0; font-size: 12px; color: var(--muted); }

/* ============ stocks ============ */
.bu-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bu-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; box-shadow: var(--shadow); }
.bu-card:hover { border-color: var(--axis); }
.bu-card[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bu-card .bu-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.bu-card .bu-n { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.bu-card .bu-desc { font-size: 12px; color: var(--muted); }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.heat .cell { padding: 10px; border: 0; border-radius: 8px; text-align: left; font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; transition: transform 0.1s; }
.heat .cell:hover { transform: scale(1.04); }
.heat .cell b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ intraday empty ============ */
.empty-state { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--axis); color: var(--ink-2); font-size: 13px; }
.empty-state svg { color: var(--muted); margin-top: 1px; }
.empty-state b { color: var(--ink); }

/* ============ drawer ============ */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.28); }
.scrim[hidden] { display: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(560px, 100vw); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px; background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform 0.22s ease; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-size: 20px; font-weight: 650; }
.drawer-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border-radius: 12px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.drawer-stats div { background: var(--surface); padding: 10px 12px; }
.drawer-stats b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.drawer-stats span { font-size: 11.5px; color: var(--muted); }
.drawer-actions { display: flex; gap: 8px; margin-top: 4px; }
#scan-price { cursor: zoom-in; }

/* ============ full-screen chart ============ */
.chart-modal { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--surface); }
.chart-modal[hidden] { display: none; }
.cm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.cm-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cm-title h2 { font-size: 20px; font-weight: 650; }
.cm-title { align-items: center; }
.back-btn { height: 32px; display: inline-flex; align-items: center; gap: 4px; padding: 0 12px 0 8px; }
.back-btn svg { width: 16px; height: 16px; }
.cm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cm-controls .btn { height: 32px; display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.cm-toggles { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-toggle { cursor: pointer; user-select: none; }
.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-toggle span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); }
.chip-toggle span i { width: 8px; height: 8px; border-radius: 2px; opacity: 0.35; }
.chip-toggle input:checked + span { color: var(--ink); border-color: var(--axis); background: var(--surface-2); }
.chip-toggle input:checked + span i { opacity: 1; }
.chip-toggle input:focus-visible + span { outline: 2px solid var(--focus); }
.cm-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cm-pane { position: relative; min-height: 0; }
.cm-price { flex: 1; }
.cm-rsi { height: 22%; min-height: 110px; border-top: 1px solid var(--line); }
.cm-canvas { position: absolute; inset: 0; }
.cm-legend { position: absolute; top: 8px; left: 12px; z-index: 3; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); pointer-events: none; font-variant-numeric: tabular-nums; }
.cm-legend b { color: var(--ink); font-weight: 600; }
.cm-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px; border-top: 1px solid var(--line); }
.cm-foot:empty { display: none; }
@media (max-width: 760px) {
  .cm-head { padding: 10px 12px; }
  .cm-foot { padding: 8px 12px; max-height: 84px; overflow-y: auto; }
}
.drawer-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-levels:empty { display: none; }
.lvl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lvl-chip i { width: 7px; height: 7px; border-radius: 50%; }
.lvl-chip small { font-weight: 500; color: var(--muted); }

/* ============ loading ============ */
.skeleton { list-style: none; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--hover) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.error-card { padding: 16px 20px; border-radius: var(--radius); background: var(--down-wash); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .drawer { transition: none; } }

/* ============ responsive ============ */
@media (max-width: 1180px) {
  .app { grid-template-columns: 68px minmax(0, 1fr); }
  .sidebar { padding: 20px 10px; align-items: center; }
  .brand span, .nav-item span, .sidebar-foot .status-line span:not(.dot), .status-line.muted, .version { display: none; }
  .brand { padding: 0; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-foot { align-items: center; padding: 0; }
  .theme-switch { flex-direction: column; }
}
@media (max-width: 980px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .bu-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 30; height: auto;
    flex-direction: row; justify-content: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-item { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 10.5px; }
  .nav-item span { display: block; }
  .topbar { padding: 12px 16px; position: static; }
  .alert, .ticker { margin-left: 16px; margin-right: 16px; }
  main { padding: 16px 16px 20px; }
  .footer { padding: 0 16px 96px; }
  .hero { padding: 18px; }
  .stat { padding: 0 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { flex-direction: column; align-items: stretch; gap: 16px; }
  .stats { gap: 14px 0; padding-top: 14px; border-top: 1px solid var(--line); }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .lv { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
  .lv-bar { display: none; }
  .ev-row { grid-template-columns: 12px minmax(0, 1fr) 16px; row-gap: 2px; }
  .ev-value { grid-column: 2; grid-row: 2; text-align: left; font-weight: 500; color: var(--ink-2); }
  .ev-row svg { grid-column: 3; grid-row: 1 / span 2; }
  .ev-note { padding-left: 24px; }
  .ticker .tick { min-width: 130px; padding: 10px 14px; }
  .top-controls, .symbol-picker { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .drawer-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; }
  .card-head.padded { padding: 16px 16px 0; }
  .filters { padding: 0 16px 12px; }
}
