/* Layout: one-screen app. Glass top bar, sector rail on wide screens, list in the
   middle, stock detail as an overlay sheet whose form changes with the screen. */
:root {
  --bg: #0a0d14;
  --bg-glow-a: rgba(64, 120, 255, 0.22);
  --bg-glow-b: rgba(48, 209, 88, 0.10);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(22, 26, 36, 0.72);
  --glass-border: rgba(255, 255, 255, 0.10);
  --fg: #f4f6fb;
  --fg-2: #aab2c5;
  --fg-3: #6f788e;
  --hairline: rgba(255, 255, 255, 0.08);
  --accent: #5ea3ff;
  --accent-soft: rgba(94, 163, 255, 0.16);
  --up: #30d158;
  --up-soft: rgba(48, 209, 88, 0.16);
  --down: #ff453a;
  --down-soft: rgba(255, 69, 58, 0.16);
  --warm: #ff9f0a;
  --warm-soft: rgba(255, 159, 10, 0.16);
  --row-hover: rgba(255, 255, 255, 0.045);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --tooltip-bg: rgba(16, 19, 28, 0.92);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Figtree", "Segoe UI", Roboto, sans-serif;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --sidebar-w: 300px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef1f7;
    --bg-glow-a: rgba(90, 140, 255, 0.28);
    --bg-glow-b: rgba(48, 209, 88, 0.16);
    --glass: rgba(255, 255, 255, 0.55);
    --glass-strong: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.75);
    --fg: #0d1220;
    --fg-2: #4d566b;
    --fg-3: #7e879c;
    --hairline: rgba(13, 18, 32, 0.08);
    --accent: #0a6cff;
    --accent-soft: rgba(10, 108, 255, 0.12);
    --up: #1aa64a;
    --up-soft: rgba(26, 166, 74, 0.14);
    --down: #e0362f;
    --down-soft: rgba(224, 54, 47, 0.13);
    --warm: #c96a00;
    --warm-soft: rgba(255, 159, 10, 0.16);
    --row-hover: rgba(13, 18, 32, 0.04);
    --shadow: 0 24px 60px rgba(30, 40, 70, 0.22);
    --tooltip-bg: rgba(255, 255, 255, 0.95);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef1f7;
  --bg-glow-a: rgba(90, 140, 255, 0.28);
  --bg-glow-b: rgba(48, 209, 88, 0.16);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.75);
  --fg: #0d1220;
  --fg-2: #4d566b;
  --fg-3: #7e879c;
  --hairline: rgba(13, 18, 32, 0.08);
  --accent: #0a6cff;
  --accent-soft: rgba(10, 108, 255, 0.12);
  --up: #1aa64a;
  --up-soft: rgba(26, 166, 74, 0.14);
  --down: #e0362f;
  --down-soft: rgba(224, 54, 47, 0.13);
  --warm: #c96a00;
  --warm-soft: rgba(255, 159, 10, 0.16);
  --row-hover: rgba(13, 18, 32, 0.04);
  --shadow: 0 24px 60px rgba(30, 40, 70, 0.22);
  --tooltip-bg: rgba(255, 255, 255, 0.95);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
body::before, body::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none; border-radius: 50%;
  filter: blur(90px);
}
body::before { width: 60vmax; height: 60vmax; left: -18vmax; top: -22vmax; background: var(--bg-glow-a); }
body::after { width: 50vmax; height: 50vmax; right: -16vmax; bottom: -20vmax; background: var(--bg-glow-b); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--fg-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.glass {
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
}

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; height: 100%; width: 100%; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-width: 0;
  border-width: 0 0 1px 0; border-radius: 0; position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--up));
  display: grid; place-items: center; color: #fff;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand h1 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -0.01em; white-space: nowrap; }
.brand .asof { font-size: 12px; color: var(--fg-3); margin: 0; white-space: nowrap; }
.search {
  flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 12px; min-width: 0;
}
.search svg { width: 16px; height: 16px; color: var(--fg-3); flex: none; }
.search input { flex: 1 1 0; width: 0; min-width: 0; background: none; border: 0; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--fg-3); }
.search .clear { color: var(--fg-3); display: none; line-height: 0; }
.search.has-value .clear { display: block; }

.refresh { flex: none; }
.refresh:disabled { opacity: .6; cursor: progress; }
.refresh.spin svg { animation: spin 1s linear infinite; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30; top: calc(64px + env(safe-area-inset-top, 0px));
  max-width: min(520px, calc(100% - 32px)); padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.4;
  background: var(--glass-strong); box-shadow: var(--shadow); color: var(--fg);
}
.seg { display: inline-flex; padding: 3px; border-radius: 11px; gap: 2px; }
.seg button {
  padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--fg-2);
  transition: background .15s, color .15s; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.seg.small button { padding: 4px 10px; font-size: 12px; }

.main { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 0; }
.rail { padding: 14px 10px 14px 16px; overflow-y: auto; border-right: 1px solid var(--hairline); }
.content { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.tabbar { display: none; }

/* ---------- sector rail ---------- */
.rail h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); margin: 6px 8px 8px; font-weight: 600; }
.rail-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 10px; color: var(--fg-2); font-size: 14px; font-weight: 500;
}
.rail-item:hover { background: var(--row-hover); color: var(--fg); }
.rail-item[aria-current="true"] { background: var(--accent-soft); color: var(--fg); }
.rail-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item .cnt { font-size: 12px; color: var(--fg-3); }
.rail-item .chg { font-size: 12px; font-weight: 600; min-width: 48px; text-align: right; }
.rail-item.all { font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.rail-sub { padding-left: 10px; margin: 2px 0 6px; border-left: 1px solid var(--hairline); margin-left: 14px; }
.rail-sub .rail-item { font-size: 13px; padding: 5px 10px; }
.rail-sub .rail-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); flex: none; }
.rail-item .chev { width: 14px; height: 14px; color: var(--fg-3); transition: transform .2s; flex: none; }
.rail-item[aria-expanded="true"] .chev { transform: rotate(90deg); }

/* ---------- chips (tablet / phone sector filter) ---------- */
.chips { display: none; min-width: 0; gap: 8px; overflow-x: auto; padding: 10px 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); padding-right: 40px; }
.chip {
  flex: none; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg-2);
  background: var(--glass); border: 1px solid var(--glass-border); display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--fg); border-color: transparent; }
.chip .chg { font-size: 12px; }
.chips.sub .chip { padding: 5px 11px; font-size: 12px; font-weight: 500; }

/* ---------- list header / controls ---------- */
.list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px 8px;
}
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.crumb h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.crumb .cnt { color: var(--fg-3); font-size: 14px; font-weight: 500; }
.crumb .sub { width: 100%; color: var(--fg-3); font-size: 13px; }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sort-label { font-size: 12px; color: var(--fg-3); }

.list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 24px; }
.cols {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 110px 96px 76px 96px 96px; gap: 14px;
  padding: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600;
  position: sticky; top: 0; z-index: 1;
}
.cols span:nth-child(n+3) { text-align: right; }
.row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 110px 96px 76px 96px 96px; gap: 14px; align-items: center;
  width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; border-bottom: 1px solid var(--hairline);
  transition: background .12s; cursor: pointer;
}
.news-list { display: flex; flex-direction: column; }
.news-item { display: block; padding: 10px 0; border-bottom: 1px solid var(--hairline); text-decoration: none; color: var(--fg); min-width: 0; }
.news-item:last-child { border-bottom: 0; }
.news-item .hl { font-size: 14px; font-weight: 500; line-height: 1.35; }
.news-item .src { font-size: 12px; color: var(--fg-3); margin-top: 3px; }
.news-item:hover .hl { color: var(--accent); }
.row:hover { background: var(--row-hover); }
.row .ident, .vrow .ident { min-width: 0; }
.row .tkline, .vrow .tkline { display: flex; align-items: center; gap: 7px; min-width: 0; }
.row .tk, .vrow .tk { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.row .sectag, .vrow .sectag {
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: 2px 7px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.row .nm, .vrow .nm { font-size: 12.5px; color: var(--fg-3); white-space: nowrap; display: flex; min-width: 0; }
.row .nm .nm-text, .vrow .nm .nm-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row .nm-fpe { flex: none; margin-left: 4px; }
.row .sec { font-size: 12.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .spark { height: 34px; width: 100%; display: block; }
.row .mcap, .row .fpe, .row .px { text-align: right; font-weight: 500; }
.row .fpe { color: var(--fg-2); }
.row .nm-fpe { display: none; }
.row .px { font-weight: 600; }
.row .pillwrap { display: flex; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 74px; padding: 4px 8px; border-radius: 8px;
  font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums;
}
.pill.up { background: var(--up-soft); color: var(--up); }
.pill.down { background: var(--down-soft); color: var(--down); }
.pill.flat { background: var(--glass); color: var(--fg-2); }
.row .mobile-px { display: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--fg-3); }

/* ---------- table by sector ---------- */
.tbl-wrap { overflow-x: auto; padding: 0 8px; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; white-space: nowrap; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl thead th {
  position: sticky; top: 0; z-index: 1; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600;
  background: var(--glass-strong); border-bottom: 1px solid var(--hairline);
}
.tbl thead th:first-child { border-radius: 10px 0 0 0; } .tbl thead th:last-child { border-radius: 0 10px 0 0; }
.th-btn { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.th-btn:hover, .th-btn[aria-sort] { color: var(--fg); }
.th-btn .arrow { font-size: 11px; }
.tbl .sec-row td { background: var(--glass); border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); padding-top: 10px; padding-bottom: 10px; }
.tbl tbody + tbody .sec-row td { border-top: 0; }
.tbl .sec-row.summary td { background: var(--accent-soft); border-color: transparent; }
.tbl .sec-row td.avg { font-weight: 700; color: var(--fg); }
.tbl .sec-row .avg-l { font-size: 10px; font-weight: 600; color: var(--fg-3); text-transform: uppercase; letter-spacing: .05em; margin-right: 3px; }
.tbl .sec-row .pill { font-weight: 700; }
.sec-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 0; min-width: 0;
  font-weight: 700; font-size: 14px; color: var(--fg);
}
.sec-btn .chev { width: 14px; height: 14px; color: var(--fg-3); transition: transform .2s; }
.sec-btn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.sec-btn .sec-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-btn .sec-meta { display: inline-flex; gap: 8px; align-items: baseline; flex: none; }
.sec-btn .cnt { color: var(--fg-3); font-weight: 500; font-size: 13px; }
.sec-btn .chg { font-size: 12.5px; font-weight: 600; }
.tbl tr.stk { cursor: pointer; border-bottom: 1px solid var(--hairline); transition: background .12s; }
.tbl tr.stk:hover { background: var(--row-hover); }
.tbl tr.stk:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tbl td.co { min-width: 0; }
.tbl td.co .tk { font-weight: 700; font-size: 14.5px; }
.tbl td.co .nm { font-size: 12.5px; color: var(--fg-3); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tbl td.num { font-weight: 500; }
.tbl td .pill { min-width: 70px; }

/* ---------- options ---------- */
.opt-host .loading.small { height: auto; padding: 18px 0; }
.opt-host .section-head .seg { flex-wrap: wrap; }
.opt-host .seg .days { color: var(--fg-3); font-weight: 500; font-size: 11px; }
.opt-summary { margin: 10px 0 8px; font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.opt-summary b { color: var(--fg); font-weight: 600; }
.opt-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass); }
.opt { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.opt th, .opt td { padding: 6px 10px; text-align: right; white-space: nowrap; }
.opt th.strike, .opt td.strike { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--glass-strong); }
.opt thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); font-weight: 600; border-bottom: 1px solid var(--hairline); background: var(--glass-strong); position: sticky; top: 0; }
.opt tbody tr { border-bottom: 1px solid var(--hairline); }
.opt tbody tr:last-child { border-bottom: 0; }
.opt tr.itm td { background: var(--accent-soft); }
.opt tr.itm td.strike { background: var(--glass-strong); box-shadow: inset 0 0 0 100px var(--accent-soft); }
.opt tr.atm td { font-weight: 700; color: var(--fg); box-shadow: inset 0 -1px 0 var(--accent), inset 0 1px 0 var(--accent); }
.opt-foot { margin-top: 8px; font-size: 11.5px; color: var(--fg-3); line-height: 1.4; }

/* ---------- vol ---------- */
.pill.rich { background: var(--warm-soft); color: var(--warm); }
.pill.cheap { background: var(--accent-soft); color: var(--accent); }
.vcols, .vrow { display: grid; grid-template-columns: minmax(0, 1.6fr) 96px 96px 104px 84px minmax(0, 1fr); gap: 14px; align-items: center; }
.vcols { padding: 6px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.vcols span:nth-child(n+2) { text-align: right; }
.vcols span:last-child, .vrow .vctx { text-align: left; }
.vrow { width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; border-bottom: 1px solid var(--hairline); cursor: pointer; transition: background .12s; }
.vrow:hover { background: var(--row-hover); }
.vrow .num { text-align: right; font-weight: 500; }
.vrow .sub { display: block; font-size: 11px; color: var(--fg-3); font-weight: 500; }
.vrow .vctx { font-size: 12px; color: var(--fg-3); min-width: 0; }
.vrow .flag { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; margin-right: 4px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--fg-2); white-space: nowrap; }
.vrow .flag.er { background: var(--warm-soft); color: var(--warm); border-color: transparent; }
.vrow .pillwrap { display: flex; justify-content: flex-end; }
.vrow .mobile-v { display: none; }
.ctrl .toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); cursor: pointer; padding: 5px 0; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; line-height: 1.3; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.vol-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.vol-chart svg { display: block; width: 100%; height: 200px; }
.vol-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--fg-2); margin: 8px 0 6px; }
.vol-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--fg-2); margin-right: 6px; vertical-align: 3px; }
.vol-legend i.iv { border-top: 2px dashed var(--accent); }

/* ---------- ideas ---------- */
.ideas-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 6px; }
.ideas-head h3 { margin: 0; font-size: 17px; }
.ideas-head .meta { color: var(--fg-3); font-size: 13px; }
.pb-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pb { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.pb.buy { background: var(--up-soft); color: var(--up); }
.pb.cc { background: var(--warm-soft); color: var(--warm); }
.pb.put { background: var(--down-soft); color: var(--down); }
.pb-legend .pb small { font-weight: 500; opacity: .85; }
.idea-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 4px 8px 24px; }
.idea { border-radius: var(--r-lg); padding: 16px 18px; cursor: pointer; display: grid; gap: 12px; min-width: 0; transition: transform .15s, background .15s; }
.idea:hover { background: var(--row-hover); }
.idea:focus-visible { outline: 2px solid var(--accent); }
.idea-top { display: grid; grid-template-columns: auto minmax(0, 1fr) 110px; gap: 12px; align-items: center; }
.idea .rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--glass); border: 1px solid var(--glass-border); }
.idea .who { min-width: 0; }
.idea .who .tkline { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.idea .who .tk { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.idea .who .nm { font-size: 12.5px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea .quote { text-align: right; }
.idea .quote .px { font-weight: 700; font-size: 16px; }
.idea .quote .pill { min-width: 0; padding: 2px 7px; font-size: 12px; margin-top: 3px; }
.idea .spark { height: 36px; width: 100%; display: block; }
.idea-strat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.idea-strat .score { font-size: 12px; color: var(--fg-3); }
.idea-strat .er { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--fg-2); }
.idea-strat .er.soon { background: var(--warm-soft); color: var(--warm); border-color: transparent; }
.why { display: grid; gap: 7px; }
.why .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; margin-bottom: -2px; }
.factor { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.factor .fl { font-size: 12.5px; font-weight: 600; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.factor .bar { height: 6px; border-radius: 3px; background: var(--hairline); position: relative; overflow: hidden; }
.factor .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.idea.buy .factor .bar i { background: var(--up); } .idea.cc .factor .bar i { background: var(--warm); } .idea.put .factor .bar i { background: var(--down); }
.factor .ft { grid-column: 2; font-size: 12px; color: var(--fg-3); line-height: 1.35; }
.plan { font-size: 13px; line-height: 1.45; color: var(--fg); padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-border); }
.plan b { font-weight: 700; }
.ideas-foot { font-size: 12px; color: var(--fg-3); padding: 0 8px 8px; line-height: 1.4; }

/* ---------- screener ---------- */
.screener { padding: 4px 20px 16px; display: grid; gap: 14px; }
.panel { border-radius: var(--r-lg); padding: 16px 18px; }
.panel h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.panel .hint { margin: 0 0 12px; color: var(--fg-3); font-size: 13px; }
.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; align-items: start; }
.ctrl label, .ctrl .lbl { display: block; font-size: 12px; color: var(--fg-3); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ctrl .seg { width: 100%; }
.ctrl .seg button { flex: 1; text-align: center; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.slider-row output { font-weight: 700; min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.preset { padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--fg-2); background: var(--glass); border: 1px solid var(--glass-border); display: inline-flex; gap: 8px; align-items: center; }
.preset:hover { color: var(--fg); }
.preset .n { background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 7px; font-size: 12px; }
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 8px; flex-wrap: wrap; }
.result-head h3 { margin: 0; font-size: 17px; }
.result-head .meta { color: var(--fg-3); font-size: 13px; }
.result-head .meta b { color: var(--fg); font-weight: 600; }
.result-head .note { width: 100%; font-size: 12.5px; }
.ctrl .seg { flex-wrap: wrap; }

/* ---------- detail sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--glass-strong); border-left: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow); transform: translateX(105%); transition: transform .32s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet.open { transform: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; padding-top: calc(18px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--hairline); }
.sheet-head .who { flex: 1; min-width: 0; }
.sheet-head .tk { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--fg-3); }
.sheet-head .nm { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.sheet-head .path { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--fg-2); }
.tag.sector { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.iconbtn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-2); background: var(--glass); border: 1px solid var(--glass-border); flex: none; }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn:hover { color: var(--fg); }
.grabber { display: none; width: 40px; height: 5px; border-radius: 3px; background: var(--fg-3); opacity: .5; margin: 8px auto 0; }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 20px 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.hero { margin-top: 14px; }
.hero .px { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.hero .chg { margin-top: 6px; font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.hero .chg .when { color: var(--fg-3); font-weight: 500; }
.chart-wrap { position: relative; margin-top: 14px; }
.chart-wrap svg { display: block; width: 100%; height: 220px; touch-action: pan-y; }
.tip {
  position: absolute; pointer-events: none; z-index: 2; padding: 6px 10px; border-radius: 9px; font-size: 12.5px;
  background: var(--tooltip-bg); border: 1px solid var(--glass-border); color: var(--fg); box-shadow: 0 6px 20px rgba(0,0,0,.25);
  white-space: nowrap; transform: translate(-50%, 0); top: 0; display: none;
}
.tip b { font-weight: 700; } .tip .d { color: var(--fg-3); margin-left: 6px; }
.ranges { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.range-ret { font-size: 13px; font-weight: 600; }
.range-ret .when { color: var(--fg-3); font-weight: 500; }

.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.section h3 { font-size: 15px; font-weight: 700; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-border); min-width: 0; }
.stat .k { font-size: 11px; color: var(--fg-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 16px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { font-size: 11.5px; color: var(--fg-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.wide { grid-column: span 3; }
.stats.more { margin-top: 10px; }
.disclose {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 7px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
}
.disclose:hover { filter: brightness(1.1); }
.disclose .chev { width: 14px; height: 14px; transition: transform .2s; }
.disclose[aria-expanded="true"] .chev { transform: rotate(90deg); }
.rng { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.rng .track { flex: 1; height: 5px; border-radius: 3px; background: var(--hairline); position: relative; }
.rng .track i { position: absolute; top: -3.5px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); transform: translateX(-50%); }

.earn-chart svg { display: block; width: 100%; height: 230px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--fg-2); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend i.est { background: var(--fg-3); opacity: .45; }
.legend i.act { background: var(--fg); }
.earn-note { margin-top: 10px; font-size: 13px; color: var(--fg-2); display: grid; gap: 4px; }
.earn-note b { color: var(--fg); font-weight: 600; }
.about { color: var(--fg-2); font-size: 14px; line-height: 1.5; margin: 0; }
.about + .links { margin-top: 8px; font-size: 13px; }
.about + .links a { color: var(--accent); text-decoration: none; }
.loading { display: grid; place-items: center; height: 100%; color: var(--fg-3); gap: 10px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--hairline); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: var(--down); }

/* ---------- tablet ---------- */
@media (max-width: 1199px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .chips { display: flex; }
  .cols, .row { grid-template-columns: minmax(0, 1.6fr) 110px 76px 100px 96px; }
  .cols span:nth-child(2), .row .sec, .cols span:nth-child(4), .row .mcap { display: none; }
  .tbl .wide { display: none; }
  .sheet {
    top: 50%; left: 50%; right: auto; bottom: auto; width: min(640px, calc(100% - 32px)); max-height: min(88vh, 900px); height: auto;
    border-radius: var(--r-lg); border: 1px solid var(--glass-border); transform: translate(-50%, -46%) scale(.97); opacity: 0;
    transition: transform .3s cubic-bezier(.32,.72,0,1), opacity .25s;
  }
  .sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet-head { padding-top: 18px; }
  .list { padding-bottom: 24px; }
}
/* ---------- phone ---------- */
@media (max-width: 699px) {
  body { font-size: 14px; }
  .topbar { padding: 8px 14px; }
  .brand .asof { display: none; }
  .topbar .seg.view { display: none; }
  .search { max-width: none; }
  .list-head { padding: 8px 14px 6px; gap: 6px; flex-direction: column; align-items: stretch; }
  .crumb { min-width: 0; flex-wrap: nowrap; align-items: baseline; }
  .crumb h2 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb .sub { display: none; }
  .sort-label { display: none; }
  .controls .seg { width: 100%; }
  .controls .seg.small button { flex: 1; text-align: center; padding: 6px 4px; font-size: 12px; min-height: 32px; }
  .chips { padding-top: 8px; }
  .tbl th, .tbl td { padding: 8px 4px; font-size: 13px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 8px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 8px; }
  .tbl thead th { font-size: 10px; letter-spacing: .03em; }
  .tbl td.co .tk { font-size: 14px; }
  .tbl td.co .nm { max-width: 88px; font-size: 11.5px; }
  .tbl td .pill { min-width: 52px; padding: 3px 5px; font-size: 11.5px; }
  .tbl td.co { width: 38%; max-width: 0; }
  .sec-btn { font-size: 13px; flex-wrap: wrap; gap: 3px 6px; }
  .sec-btn .sec-name { flex: 1 1 0; }
  .sec-btn .sec-meta { flex-basis: 100%; padding-left: 20px; font-size: 12px; }
  .sec-row.summary .sec-meta { padding-left: 0; }
  .tbl .sec-row .avg-l { display: none; }
  .list { padding: 0 8px 96px; }
  .cols { display: none; }
  .opt th, .opt td { padding: 6px 6px; font-size: 12px; }
  .vcols { display: none; }
  .vrow { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .vrow .viv, .vrow .vrv, .vrow .vratio, .vrow .vctx { display: none; }
  .vrow .mobile-v { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
  .vrow .mobile-v .sub { font-size: 11.5px; }
  .vol-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vol-stats .stat .v { font-size: 14px; }
  .idea { padding: 14px; }
  .idea-top { grid-template-columns: auto minmax(0, 1fr) 84px; }
  .factor { grid-template-columns: 96px minmax(0, 1fr); }
  .factor .fl { font-size: 12px; }
  .tabbar button { padding: 6px 10px; font-size: 10.5px; }
  .row { grid-template-columns: minmax(0, 1fr) 84px auto; gap: 10px; padding: 10px 10px; }
  .row .spark { height: 32px; }
  .row .px, .row .pillwrap, .row .fpe { display: none; }
  .row .nm-fpe { display: inline; color: var(--fg-2); }
  .row .mobile-px { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
  .row .mobile-px .px { display: block; font-weight: 600; font-size: 15px; }
  .row .mobile-px .pill { min-width: 68px; font-size: 12px; padding: 3px 7px; }
  .screener { padding: 4px 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .ctrl-grid { grid-template-columns: 1fr; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; justify-content: space-around;
    padding: 6px 12px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); border-width: 1px 0 0; border-radius: 0;
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 18px; font-size: 11px; font-weight: 600; color: var(--fg-3); border-radius: 10px; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button[aria-pressed="true"] { color: var(--accent); }
  .sheet {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: calc(100% - 44px - env(safe-area-inset-top, 0px)); max-height: none;
    border-radius: 24px 24px 0 0; transform: translateY(105%); opacity: 1; transition: transform .34s cubic-bezier(.32,.72,0,1);
  }
  .sheet.open { transform: none; }
  .grabber { display: block; }
  .sheet-head { padding: 10px 16px 12px; }
  .sheet-body { padding: 8px 16px 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
  .hero .px { font-size: 34px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat.wide { grid-column: span 2; }
  .chart-wrap svg { height: 190px; }
}
/* ---------- touch screens: 44px-class targets ---------- */
@media (pointer: coarse) {
  .seg button { padding: 8px 14px; min-height: 36px; }
  .seg.small button { padding: 7px 12px; min-height: 34px; }
  .chip { padding: 9px 14px; min-height: 38px; }
  .iconbtn { width: 38px; height: 38px; }
  .rail-item { padding: 10px 10px; }
  .preset { padding: 9px 14px; min-height: 38px; }
  .disclose { padding: 9px 14px; min-height: 38px; }
  .slider-row input[type="range"] { height: 32px; }
  .news-item { padding: 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- ideas: narrow screens ---------- */
@media (max-width: 1199px) {
  .idea-grid { grid-template-columns: 1fr; }
}
@media (max-width: 699px) {
  .idea { padding: 14px; }
  .idea-top { grid-template-columns: auto minmax(0, 1fr) 84px; }
  .factor { grid-template-columns: 96px minmax(0, 1fr); }
  .factor .fl { font-size: 12px; }
  .pb-legend .pb { display: block; }
  .tabbar button { padding: 6px 8px; font-size: 10.5px; }
}
