/* GSIP — design tokens + app styles */
:root {
  --accent: #5857D6;
  --bg: oklch(0.975 0.004 85);
  --surface: #ffffff;
  --surface-2: oklch(0.962 0.005 85);
  --ink: oklch(0.22 0.01 270);
  --muted: oklch(0.52 0.012 270);
  --faint: oklch(0.56 0.01 270); /* was 0.65 — 4.6:1 vs white (WCAG AA) */
  --line: oklch(0.91 0.006 85);
  --line-strong: oklch(0.85 0.008 85);
  --gain: oklch(0.55 0.14 155);
  --gain-bg: oklch(0.94 0.04 155);
  --loss: oklch(0.55 0.16 25);
  --loss-bg: oklch(0.94 0.04 25);
  --shadow: 0 1px 2px oklch(0.2 0.01 270 / 0.05), 0 4px 16px oklch(0.2 0.01 270 / 0.05);
  --radius: 14px;
  --cell-pad: 11px 14px;
  --font-display: "Bricolage Grotesque", "Helvetica Neue", sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
}
:root[data-theme="dark"] {
  --accent: oklch(0.7 0.15 283); /* brand hue brightened — 6.0:1 vs dark surface (light-theme #5857D6 was 2.98:1, WCAG fail) */
  --bg: oklch(0.19 0.012 270);
  --surface: oklch(0.235 0.014 270);
  --surface-2: oklch(0.27 0.015 270);
  --ink: oklch(0.93 0.005 270);
  --muted: oklch(0.68 0.01 270);
  --faint: oklch(0.7 0.01 270); /* was 0.55 — 6.2:1 vs surface (WCAG AA) */
  --line: oklch(0.32 0.014 270);
  --line-strong: oklch(0.4 0.015 270);
  --gain: oklch(0.72 0.14 155);
  --gain-bg: oklch(0.32 0.05 155);
  --loss: oklch(0.7 0.15 25);
  --loss-bg: oklch(0.32 0.05 25);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.25), 0 4px 16px oklch(0 0 0 / 0.25);
}
:root[data-density="compact"] { --cell-pad: 6px 12px; }

/* keyboard focus: visible ring on focusable rows/cards (a11y) */
.rowlink:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* BYOK AI setup (Pro) */
.ai-setup .req-fields { margin: 10px 0; }
.ai-setup select.sel { width: 100%; }

* { box-sizing: border-box; }
/* modern floating thin scrollbars across the app */
* { scrollbar-width: thin; scrollbar-color: color-mix(in oklch, var(--muted) 40%, transparent) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in oklch, var(--muted) 38%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; transition: background 0.15s; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in oklch, var(--muted) 60%, transparent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
#root, .app { height: 100vh; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.accent { color: var(--accent); }

/* ---------- layout ---------- */
.app { display: flex; }
.sidebar {
  width: 208px; flex: none; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 20px 14px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 10px 22px; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent);
  position: relative; flex: none;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 8px; border-radius: 3px;
  background: var(--surface); transform: rotate(45deg);
}
.logo-text { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 10px; color: var(--muted); font-weight: 500; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.on { background: color-mix(in oklch, var(--accent) 11%, transparent); color: var(--accent); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 10px 12px; font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.sidebar-foot p { margin: 0; }
.foot-link { display: block; color: var(--accent); text-decoration: none; font-size: 12px; font-weight: 550; margin-bottom: 8px; }
.foot-link:hover { text-decoration: underline; }
.foot-copy { margin-top: 8px !important; font-size: 10.5px; }

/* ---------- funds ---------- */
.fund-cell { display: flex; flex-direction: column; }
.fund-sym { font-weight: 600; font-size: 13px; }
.fund-name { font-size: 11.5px; color: var(--faint); }
.yrs { width: 100%; accent-color: var(--accent); margin: 10px 0 4px; }
.fee-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fee-row:last-of-type { border-bottom: none; }
.fee-rank { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.fee-id { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fee-name { font-weight: 550; font-size: 13px; }
.fee-cap { font-size: 11px; color: var(--faint); }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cov-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cov-row:last-child { border-bottom: none; }
.cov-state {
  flex: none; width: 76px; text-align: center; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 0; border-radius: 99px;
}
.cov-state.live { background: var(--gain-bg); color: var(--gain); }
.cov-state.indicative { background: oklch(0.94 0.04 85); color: oklch(0.5 0.1 75); }
.cov-state.model { background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent); }
.cov-state.locked { background: var(--surface-2); color: var(--faint); border: 1px solid var(--line); }
.cov-state.audit, .cov-state.owner { background: var(--loss-bg); color: var(--loss); }
.cov-state.go-live { background: var(--gain-bg); color: var(--gain); }
.cov-state.strategy, .cov-state.roadmap { background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent); }
.cov-id { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cov-layer { font-weight: 550; font-size: 13px; }
.cov-detail { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-bottom: 6px; }
.switch {
  flex: none; width: 34px; height: 20px; border-radius: 99px; background: var(--line-strong);
  position: relative; transition: background 0.15s;
}
.switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: white; transition: left 0.15s; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); }
.switch.on { background: var(--gain); }
.switch.on .knob { left: 16px; }
.feed-remove { font-size: 11.5px; color: var(--loss); flex: none; }
.feed-remove:hover { text-decoration: underline; }
.feed-add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.feed-add input { flex: 1 1 100%; min-width: 140px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); outline: none; font-size: 12.5px; }
.feed-json-opt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex: 1 1 100%; }
.feed-json-opt input { flex: none; accent-color: var(--accent); min-width: 0; }
.feed-add input:focus { border-color: var(--accent); }
@media (max-width: 1100px) { .admin-grid { grid-template-columns: 1fr; } }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-date { font-size: 13px; color: var(--muted); }
.mkt-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  color: var(--muted); padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px;
}
.mkt-chip .mkt-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--faint); }
.mkt-chip.open { color: var(--gain); border-color: color-mix(in oklch, var(--gain) 35%, transparent); }
.mkt-chip.open .mkt-dot { background: var(--gain); }

.main { flex: 1; overflow-y: auto; }
.screen { max-width: 1180px; margin: 0 auto; padding: 28px 28px 64px; }

/* ---------- search ---------- */
.gsearch { position: relative; width: 320px; }
.gsearch input, .search {
  width: 100%; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); outline: none; transition: border-color 0.15s;
}
.gsearch input:focus, .search:focus { border-color: var(--accent); }
.gsearch-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; padding: 4px;
}
.gsearch-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border-radius: 8px; text-align: left;
}
.gsearch-row:hover { background: var(--surface-2); }
.gsearch-sym { font-weight: 600; font-size: 12.5px; min-width: 64px; }
.gsearch-name { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- screen headers ---------- */
.screen-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.screen-head h1 { font-size: 30px; font-weight: 700; }
.screen-sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.head-stats { display: flex; gap: 26px; padding-bottom: 4px; }
.head-stat { display: flex; flex-direction: column; align-items: flex-end; }
.hs-num { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.hs-label { font-size: 12px; color: var(--muted); }

.block { margin-bottom: 30px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.block-head h2 { font-size: 19px; font-weight: 650; }
.block-note { font-size: 12.5px; color: var(--faint); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.two-col > * { min-width: 0; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 18px 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-note { font-size: 11.5px; color: var(--faint); }
.table-card { overflow-x: auto; overflow-y: visible; }
.table-card.scrollx { overflow-x: auto; }
.gtable.wide { min-width: 940px; }
.fineprint { font-size: 11.5px; color: var(--faint); margin: 10px 2px 0; line-height: 1.5; }

/* ---------- buy feature cards ---------- */
.buy-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.buy-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; transition: transform 0.15s, border-color 0.15s;
}
.buy-card:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.buy-card-top { display: flex; align-items: center; gap: 12px; }
.rank-medal {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 99px; background: var(--accent); color: white;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
}
.buy-card-id { flex: 1; min-width: 0; }
.buy-card-sym { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.buy-card-name { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buy-card-price-row { display: flex; align-items: baseline; gap: 10px; }
.buy-card-price { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.buy-card .spark { width: 100%; }
.buy-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.buy-card-stats > div { display: flex; flex-direction: column; gap: 2px; }
.bcs-label { font-size: 11px; color: var(--faint); }
.bcs-val { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.buy-card-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 10px; text-wrap: pretty; }

/* ---------- tables ---------- */
.gtable { width: 100%; border-collapse: collapse; }
.gtable th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--faint); padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.gtable th.num { text-align: right; }
.gtable th.sortable { cursor: pointer; user-select: none; }
.gtable th.sortable:hover { color: var(--ink); }
.gtable th.sorted { color: var(--accent); }
.gtable td { padding: var(--cell-pad); border-bottom: 1px solid var(--line); white-space: nowrap; }
.gtable tbody tr:last-child td { border-bottom: none; }
.gtable td.num { text-align: right; }
.rowlink { cursor: pointer; transition: background 0.12s; }
.rowlink:hover { background: var(--surface-2); }
.rank-num { color: var(--faint); font-family: var(--font-mono); }
.empty-row { text-align: center; color: var(--muted); padding: 28px !important; }

.ticker-cell { display: flex; align-items: center; gap: 10px; text-align: left; }
.ticker-ava {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border-radius: 9px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.ticker-ava.lg { width: 46px; height: 46px; font-size: 12px; border-radius: 13px; }
.ticker-ava[data-region="us"] { background: color-mix(in oklch, var(--accent) 9%, var(--surface-2)); }
.ticker-ava[data-region="uk"] { background: color-mix(in oklch, var(--gain) 9%, var(--surface-2)); }
.ticker-ava[data-region="in"] { background: color-mix(in oklch, oklch(0.66 0.13 50) 12%, var(--surface-2)); }
.ticker-ava[data-region="jp"] { background: color-mix(in oklch, oklch(0.6 0.13 0) 11%, var(--surface-2)); }
.ticker-ava[data-region="hk"] { background: color-mix(in oklch, oklch(0.6 0.13 20) 12%, var(--surface-2)); }
.ticker-ava[data-region="au"] { background: color-mix(in oklch, oklch(0.66 0.12 140) 12%, var(--surface-2)); }
.ticker-meta { display: flex; flex-direction: column; min-width: 0; }
.ticker-name { font-weight: 550; font-size: 13.5px; }
.ticker-sub { font-size: 11px; color: var(--faint); }

/* ---------- atoms ---------- */
.delta { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 550; }
.delta.sm { font-size: 11.5px; }
.delta.up { color: var(--gain); }
.delta.down { color: var(--loss); }
.delta.flat { color: var(--faint); }

.ctag {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; padding: 2px 6px;
  border-radius: 5px; letter-spacing: 0.04em;
}
.ctag.us { background: color-mix(in oklch, var(--accent) 13%, transparent); color: var(--accent); }
.ctag.uk { background: var(--gain-bg); color: var(--gain); }
.ctag.eu { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.ctag.in { background: color-mix(in oklch, oklch(0.62 0.14 50) 16%, transparent); color: oklch(0.5 0.13 50); }
.ctag.jp { background: color-mix(in oklch, oklch(0.58 0.16 5) 14%, transparent); color: oklch(0.52 0.16 5); }
.ctag.hk { background: color-mix(in oklch, oklch(0.58 0.15 20) 15%, transparent); color: oklch(0.5 0.14 20); }
.ctag.au { background: color-mix(in oklch, oklch(0.6 0.13 140) 16%, transparent); color: oklch(0.46 0.12 140); }
:root[data-theme="dark"] .ctag.in { color: oklch(0.78 0.12 50); }
:root[data-theme="dark"] .ctag.jp { color: oklch(0.76 0.13 5); }
:root[data-theme="dark"] .ctag.hk { color: oklch(0.76 0.13 20); }
:root[data-theme="dark"] .ctag.au { color: oklch(0.78 0.12 140); }
:root[data-theme="dark"] .ctag.in { color: oklch(0.78 0.12 50); }
:root[data-theme="dark"] .ctag.jp { color: oklch(0.76 0.13 5); }

/* ---------- exchange group sections ---------- */
.exch-group { margin-bottom: 8px; }
.exch-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px 9px;
  border-bottom: 1px solid var(--line);
}
.exch-head:not(:first-child) { border-top: 1px solid var(--line); }
.exch-flag {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 5px; flex: none;
}
.exch-flag.us { background: color-mix(in oklch, var(--accent) 13%, transparent); color: var(--accent); }
.exch-flag.uk { background: var(--gain-bg); color: var(--gain); }
.exch-flag.eu { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.exch-flag.in { background: color-mix(in oklch, oklch(0.62 0.14 50) 16%, transparent); color: oklch(0.5 0.13 50); }
.exch-flag.jp { background: color-mix(in oklch, oklch(0.58 0.16 5) 14%, transparent); color: oklch(0.52 0.16 5); }
.exch-flag.hk { background: color-mix(in oklch, oklch(0.58 0.15 20) 15%, transparent); color: oklch(0.5 0.14 20); }
.exch-flag.au { background: color-mix(in oklch, oklch(0.6 0.13 140) 16%, transparent); color: oklch(0.46 0.12 140); }
.exch-title { font-family: var(--font-display); font-weight: 650; font-size: 13.5px; }
.exch-count { font-size: 11.5px; color: var(--faint); }
.exch-senti { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.exch-senti .scorebar-track { width: 60px; }
.exch-trow td { padding: 0 !important; background: var(--surface-2); }
.exch-trow .exch-head { padding: 10px 16px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.exch-trow:first-child .exch-head { border-top: none; }

.rating-pill {
  display: inline-block; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
}
.rating-pill.sm { padding: 3px 9px; font-size: 11px; }
.rating-pill.strong-buy { background: var(--gain); color: white; }
.rating-pill.buy { background: var(--gain-bg); color: var(--gain); }
.rating-pill.hold { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.rating-pill.sell { background: var(--loss-bg); color: var(--loss); }
.rating-pill.strong-sell { background: var(--loss); color: white; }

.scorebar { display: inline-flex; align-items: center; gap: 8px; }
.scorebar-num { font-family: var(--font-mono); font-size: 13px; font-weight: 600; min-width: 22px; text-align: right; }
.scorebar-track { width: 54px; height: 5px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: inline-block; }
.scorebar-fill { display: block; height: 100%; border-radius: 99px; }
.scorebar-fill.good { background: var(--gain); }
.scorebar-fill.mid { background: oklch(0.72 0.13 75); }
.scorebar-fill.bad { background: var(--loss); }

.riskdots { display: inline-flex; align-items: center; gap: 3px; }
.rdot { width: 6px; height: 6px; border-radius: 99px; background: var(--line-strong); }
.riskdots.low .rdot.on { background: var(--gain); }
.riskdots.medium .rdot.on { background: oklch(0.72 0.13 75); }
.riskdots.high .rdot.on { background: var(--loss); }
.risk-text { font-size: 11.5px; color: var(--muted); margin-left: 5px; }

.ring-wrap { position: relative; flex: none; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-val { font-family: var(--font-mono); font-weight: 600; font-size: 14px; line-height: 1; }
.ring-label { font-size: 8.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.seg-btn { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); transition: all 0.15s; }
.seg.sm .seg-btn { padding: 4px 10px; font-size: 12px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px oklch(0.2 0.01 270 / 0.12); }

.chip {
  font-size: 11.5px; color: var(--muted); padding: 3px 9px; border: 1px solid var(--line);
  border-radius: 99px; background: var(--surface);
}
.chip-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.tradeable-chip { color: var(--gain); border-color: color-mix(in oklch, var(--gain) 35%, transparent); background: var(--gain-bg); }
.untradeable-chip { color: var(--loss); border-color: color-mix(in oklch, var(--loss) 35%, transparent); background: var(--loss-bg); }

/* ---------- filter row ---------- */
.filter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-row .search { width: 240px; background: var(--surface); }
.sel {
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  outline: none; cursor: pointer;
}
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--faint); }
.group-toggle {
  font-size: 12.5px; font-weight: 500; padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface); white-space: nowrap;
}
.group-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.group-toggle.on { background: color-mix(in oklch, var(--accent) 11%, transparent); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.remark-tag { font-size: 11px; font-weight: 550; padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.remark-tag.r-strong, .remark-tag.r-breakout, .remark-tag.r-accumulating { color: var(--gain); background: var(--gain-bg); border-color: color-mix(in oklch, var(--gain) 25%, transparent); }
.remark-tag.r-downtrend, .remark-tag.r-distributing { color: var(--loss); background: var(--loss-bg); border-color: color-mix(in oklch, var(--loss) 25%, transparent); }
.remark-tag.r-value, .remark-tag.r-near { color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, transparent); border-color: color-mix(in oklch, var(--accent) 25%, transparent); }
.remark-tag.r-high { color: oklch(0.55 0.12 75); background: oklch(0.95 0.05 75); border-color: oklch(0.6 0.12 75 / 0.3); }
.pf-table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.pf-table-title { font-family: var(--font-display); font-weight: 650; font-size: 14px; }
.gtable.wide .spark { display: block; }

/* ---------- stock detail ---------- */
.back-btn { color: var(--muted); font-weight: 500; margin-bottom: 14px; padding: 4px 0; }
.back-btn:hover { color: var(--accent); }
.stock-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.stock-head-id { flex: 1; min-width: 0; }
.stock-head h1 { font-size: 24px; font-weight: 700; }
.stock-sym { font-family: var(--font-mono); font-size: 15px; color: var(--faint); font-weight: 500; margin-left: 6px; }
.stock-head-price { text-align: right; }
.stock-price { font-family: var(--font-mono); font-size: 26px; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.chart-foot { display: flex; gap: 24px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.chart-foot strong { font-family: var(--font-mono); color: var(--ink); font-weight: 600; }

.horizon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.horizon-label { font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.horizon-val { font-family: var(--font-mono); font-size: 19px; font-weight: 650; }
.horizon-track { height: 5px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); margin: 8px 0 6px; overflow: hidden; }
.horizon-fill { display: block; height: 100%; border-radius: 99px; }
.horizon-fill.pos { background: var(--gain); }
.horizon-fill.neg { background: var(--loss); }
.horizon-target { font-size: 12px; color: var(--muted); }

.drivers { display: flex; flex-direction: column; gap: 9px; }
.driver-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 12px; }
.driver-label { font-size: 12.5px; color: var(--muted); }
.driver-track { position: relative; height: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; display: block; }
.driver-zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.driver-fill { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; }
.driver-fill.pos { background: var(--gain); }
.driver-fill.neg { background: var(--loss); }
.driver-val { font-size: 12px; text-align: right; }

.score-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.big-score { font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1; }
.big-score-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.subscore-list { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--line); padding-top: 14px; }
.subscore { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.risk-line { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }

.stat-list { margin: 0; display: flex; flex-direction: column; }
.stat-list > div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.stat-list > div:last-child { border-bottom: none; }
.stat-list dt { color: var(--muted); font-size: 13px; }
.stat-list dd { margin: 0; font-weight: 550; font-size: 13px; }

/* ---------- news ---------- */
.news-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px;
  border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--surface-2); }
.news-item.compact { padding: 10px 0; cursor: default; }
.news-item.compact:hover { background: none; }
.news-body { flex: 1; min-width: 0; }
.news-title { margin: 0; font-weight: 550; font-size: 13.5px; line-height: 1.4; text-wrap: pretty; }
.news-meta { margin: 3px 0 0; font-size: 11.5px; color: var(--faint); }
.news-scores { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; flex: none; }
.news-score { font-size: 11px; color: var(--muted); }
.tone-chip {
  flex: none; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 1px;
}
.tone-chip.bull { background: var(--gain-bg); color: var(--gain); }
.tone-chip.bear { background: var(--loss-bg); color: var(--loss); }
.tone-chip.neutral { background: var(--surface-2); color: var(--muted); }
.tone-dot { flex: none; width: 8px; height: 8px; border-radius: 99px; margin-top: 6px; }
.tone-dot.bull { background: var(--gain); }
.tone-dot.bear { background: var(--loss); }
.tone-dot.neutral { background: var(--faint); }

/* ---------- pulse ---------- */
.heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.heat-tile {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px; transition: transform 0.12s;
  border: 1px solid transparent;
}
.heat-tile:hover { transform: scale(1.04); }
.heat-sym { font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; }
.heat-val { font-size: 11px; opacity: 0.75; }
.heat-tile.s5 { background: var(--gain); color: white; }
.heat-tile.s4 { background: var(--gain-bg); color: var(--gain); border-color: color-mix(in oklch, var(--gain) 25%, transparent); }
.heat-tile.s3 { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.heat-tile.s2 { background: var(--loss-bg); color: var(--loss); border-color: color-mix(in oklch, var(--loss) 25%, transparent); }
.heat-tile.s1 { background: var(--loss); color: white; }
.heat-legend { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); }
.heat-swatch { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.heat-swatch.s5 { background: var(--gain); } .heat-swatch.s4 { background: var(--gain-bg); }
.heat-swatch.s3 { background: var(--surface-2); border: 1px solid var(--line); }
.heat-swatch.s2 { background: var(--loss-bg); } .heat-swatch.s1 { background: var(--loss); }

.pulse-cols { grid-template-columns: 1.5fr 1fr; }
.trend-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 18px;
  border-bottom: 1px solid var(--line); text-align: left;
}
.trend-row:last-child { border-bottom: none; }
.trend-row:hover { background: var(--surface-2); }
.trend-id { display: flex; flex-direction: column; min-width: 110px; }
.trend-sym { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.trend-name { font-size: 11px; color: var(--faint); }
.buzz-track { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.buzz-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.buzz-num { font-size: 12px; min-width: 24px; text-align: right; }

/* ---------- portfolio ---------- */
.pf-controls { display: grid; grid-template-columns: 1.2fr 1.3fr 1fr; gap: 28px; margin-bottom: 20px; }
.pf-field label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-bottom: 8px; }
.field-hint { margin: 8px 0 0; font-size: 12px; color: var(--faint); line-height: 1.45; text-wrap: pretty; }
.amount-wrap { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0 14px; }
.amount-wrap:focus-within { border-color: var(--accent); }
.amount-ccy { font-family: var(--font-mono); font-size: 20px; color: var(--faint); }
.amount-wrap input {
  width: 100%; border: none; background: none; outline: none; padding: 10px 8px;
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
}
.amount-wrap input::-webkit-outer-spin-button, .amount-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }
.amount-presets { display: flex; gap: 6px; margin-top: 8px; }
.preset { font-size: 12px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.preset:hover { border-color: var(--accent); color: var(--accent); }
.preset.on { background: color-mix(in oklch, var(--accent) 12%, transparent); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.pf-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.sum-card { display: flex; flex-direction: column; gap: 3px; }
.sum-label { font-size: 12px; color: var(--faint); }
.sum-val { font-family: var(--font-mono); font-size: 24px; font-weight: 650; }
.sum-sub { font-size: 11.5px; color: var(--faint); }
.fee-warn {
  margin-top: 6px; font-size: 11px; line-height: 1.45; color: var(--loss);
  background: var(--loss-bg); border-radius: 8px; padding: 5px 9px; text-wrap: pretty;
}

.pf-body { display: grid; grid-template-columns: 1.9fr 1fr; gap: 20px; align-items: start; }
.pf-body > * { min-width: 0; } /* clamp grid tracks so wide tables scroll internally instead of widening the page */
.pf-body .table-card { overflow-x: auto; }
@media (max-width: 1400px) { .pf-body { grid-template-columns: 1fr; } }
.donut { width: 150px; margin: 4px auto 12px; display: block; }
.alloc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.alloc-legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.dotsq { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.alloc-sym { font-family: var(--font-mono); font-weight: 550; flex: 1; }
.alloc-pct { color: var(--muted); }

/* ---------- live data ---------- */
.livectl { position: relative; }
.livechip { cursor: pointer; }
.livechip.live { color: var(--gain); border-color: color-mix(in oklch, var(--gain) 40%, transparent); background: var(--gain-bg); }
.livechip.live .mkt-dot { background: var(--gain); animation: livepulse 1.6s ease-in-out infinite; }
.livechip.connecting { color: oklch(0.62 0.13 75); border-color: oklch(0.62 0.13 75 / 0.4); }
.livechip.connecting .mkt-dot { background: oklch(0.72 0.13 75); animation: livepulse 0.8s ease-in-out infinite; }
.livechip.error { color: var(--loss); border-color: color-mix(in oklch, var(--loss) 40%, transparent); }
.livechip.error .mkt-dot { background: var(--loss); }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.live-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 340px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 16px 18px;
}
.live-pop h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 14px; }
.live-pop-sub { margin: 0 0 12px; font-size: 12px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.live-pop-sub a { color: var(--accent); }
.live-key-row { display: flex; gap: 8px; }
.live-key-row input {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); outline: none; font-family: var(--font-mono); font-size: 12px;
}
.live-key-row input:focus { border-color: var(--accent); }
.live-save {
  flex: none; padding: 8px 14px; border-radius: 9px; background: var(--accent); color: white;
  font-weight: 600; font-size: 13px;
}
.live-err { margin: 10px 0 0; font-size: 12px; color: var(--loss); }
.live-ok { margin: 10px 0 0; font-size: 12px; color: var(--gain); }
.live-disconnect { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); text-decoration: underline; }
.live-disconnect:hover { color: var(--loss); }
.live-badge {
  display: inline-block; vertical-align: 2px; margin-left: 8px; padding: 2px 8px; border-radius: 99px;
  background: var(--gain); color: white; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; font-family: var(--font-body);
}

/* ---------- sentiment engine ---------- */
.senti-engine .card-head { margin-bottom: 10px; }
.rescan-btn {
  padding: 6px 14px; border-radius: 9px; background: var(--accent); color: white;
  font-weight: 600; font-size: 12.5px;
}
.rescan-btn[disabled] { opacity: 0.55; cursor: default; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.rescan-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rescan-meta { font-size: 10.5px; color: var(--faint); }
.senti-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; }
.senti-source { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.senti-source.locked { opacity: 0.55; }
.src-dot { width: 8px; height: 8px; border-radius: 99px; flex: none; background: var(--line-strong); }
.src-dot.ok { background: var(--gain); }
.src-dot.busy { background: oklch(0.72 0.13 75); animation: livepulse 0.8s ease-in-out infinite; }
.src-dot.bad { background: var(--loss); }
.src-id { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.src-label { font-size: 13px; font-weight: 550; }
.src-sub { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-count { font-size: 11.5px; color: var(--muted); flex: none; }
.src-ms { color: var(--faint); }
.senti-totals { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.senti-totals strong { color: var(--ink); font-weight: 600; }
.live-badge.scanning { background: oklch(0.72 0.13 75); }
.senti-chip { font-size: 10px; font-weight: 600; color: var(--gain); letter-spacing: 0.03em; margin-left: 4px; font-family: var(--font-body); }
.senti-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--gain); margin-right: 7px; animation: livepulse 1.6s ease-in-out infinite; }
.sim-chip {
  display: inline-block; margin-top: 2px; font-size: 10px; font-weight: 600; color: var(--faint);
  border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; letter-spacing: 0.04em;
}
@media (max-width: 1100px) { .senti-sources { grid-template-columns: 1fr; } }

/* ---------- platforms ---------- */
.platform-block { margin-top: 6px; margin-bottom: 24px; }
.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.platform-card {
  display: block; position: relative; text-align: left; width: 100%; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.platform-card:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.platform-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}
.platform-suggest {
  position: absolute; top: -9px; left: 14px; padding: 2px 9px; border-radius: 99px;
  background: var(--gain); color: white; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.platform-radio {
  margin-left: auto; width: 18px; height: 18px; flex: none; border-radius: 99px;
  border: 2px solid var(--line-strong); position: relative;
}
.platform-radio.on { border-color: var(--accent); }
.platform-radio.on::after { content: ""; position: absolute; inset: 3px; border-radius: 99px; background: var(--accent); }
.platform-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.platform-top > div { display: flex; flex-direction: column; min-width: 0; }
.platform-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 11px; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: white;
}
.platform-mark.sm { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; }
.platform-mark[data-p="hl"] { background: oklch(0.45 0.13 270); }
.platform-mark[data-p="fid"] { background: oklch(0.5 0.12 200); }
.platform-mark[data-p="etoro"] { background: oklch(0.6 0.14 150); }
.platform-mark[data-p="ibkr"] { background: oklch(0.5 0.13 25); }
.platform-mark[data-p="t212"] { background: oklch(0.55 0.13 250); }
.platform-mark[data-p="zerodha"] { background: oklch(0.6 0.15 40); }
.platform-mark[data-p="groww"] { background: oklch(0.58 0.14 155); }
.platform-mark[data-p="sbi"] { background: oklch(0.5 0.14 0); }
.platform-mark[data-p="rakuten"] { background: oklch(0.55 0.16 15); }
.platform-mark[data-p="futu"] { background: oklch(0.55 0.16 25); }
.platform-mark[data-p="tiger"] { background: oklch(0.62 0.15 60); }
.platform-mark[data-p="commsec"] { background: oklch(0.5 0.14 250); }
.platform-mark[data-p="stake"] { background: oklch(0.55 0.14 300); }
.platform-mark[data-p="saxo"] { background: oklch(0.48 0.13 20); }
.platform-mark[data-p="schwab"] { background: oklch(0.5 0.14 235); }
.platform-mark[data-p="fidelityus"] { background: oklch(0.52 0.13 155); }
.platform-name { font-weight: 650; font-size: 14.5px; line-height: 1.25; }
.platform-domain { font-size: 11.5px; color: var(--accent); text-decoration: none; }
.platform-domain:hover { text-decoration: underline; }
.platform-nums { display: flex; align-items: baseline; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.platform-net { font-family: var(--font-mono); font-size: 20px; font-weight: 650; }
.platform-net-label { font-size: 11.5px; color: var(--faint); }
.platform-fees { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.platform-desc { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.platform-feeline { margin: 0; font-size: 11px; color: var(--faint); font-family: var(--font-mono); }
.venue-chip { display: inline-flex; align-items: center; gap: 7px; }
.venue-name { font-size: 12px; font-weight: 550; color: var(--muted); }
@media (max-width: 1100px) { .platform-grid { grid-template-columns: 1fr; } }

/* ---------- trade ticket ---------- */
.trade-btn {
  padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--accent); border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  white-space: nowrap; transition: background 0.15s;
}
.trade-btn:hover { background: color-mix(in oklch, var(--accent) 10%, transparent); }
.ticket-overlay {
  position: fixed; inset: 0; z-index: 100; background: oklch(0.15 0.01 270 / 0.45);
  display: grid; place-items: center; padding: 24px;
}
.ticket { width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; }
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.ticket-head h3 { font-size: 17px; }
.ticket-sub { font-size: 12px; color: var(--muted); }
.ticket-close { font-size: 22px; line-height: 1; color: var(--faint); padding: 2px 6px; }
.ticket-close:hover { color: var(--ink); }
.ticket-platforms { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 0; flex-wrap: wrap; }
.ticket-net { font-size: 13px; font-weight: 600; }
.ticket-steps { margin: 14px 0 0; padding: 0 20px; list-style: none; counter-reset: step; }
.ticket-steps li {
  counter-increment: step; position: relative; padding: 10px 0 10px 38px;
  border-bottom: 1px solid var(--line);
}
.ticket-steps li:last-child { border-bottom: none; }
.ticket-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 11px; width: 22px; height: 22px;
  display: grid; place-items: center; border-radius: 99px; font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent);
}
.ticket-steps li strong { display: block; font-size: 13px; font-weight: 650; margin-bottom: 2px; }
.ticket-steps li span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.ticket-link { font-size: 13px; font-weight: 550; color: var(--accent); }
.ticket-go {
  padding: 8px 16px; border-radius: 10px; background: var(--accent); color: white;
  font-weight: 600; font-size: 13px; text-decoration: none;
}

/* ---------- penny stocks ---------- */
.penny-warning {
  background: var(--loss-bg); border: 1px solid color-mix(in oklch, var(--loss) 30%, transparent);
  color: var(--loss); border-radius: var(--radius); padding: 12px 18px;
  font-size: 13px; line-height: 1.55; margin-bottom: 26px; text-wrap: pretty;
}
.penny-warning strong { font-weight: 700; }
.vol-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--loss); background: var(--loss-bg); border-radius: 99px; padding: 2px 8px; white-space: nowrap;
}
.penny-medal { background: var(--loss); }
.new-chip {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 99px;
  background: color-mix(in oklch, var(--accent) 14%, transparent); color: var(--accent);
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  vertical-align: 1px;
}
.buzz-track.sm { display: inline-block; width: 64px; vertical-align: middle; }

/* ---------- ticker tape ---------- */
.tape {
  flex: none; overflow: hidden; border-bottom: 1px solid var(--line);
  background: var(--surface); white-space: nowrap; position: relative;
}
.tape::before, .tape::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 2; pointer-events: none;
}
.tape::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.tape::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }
.tape-track { display: inline-flex; gap: 30px; padding: 7px 0; width: max-content; animation: tapescroll 70s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tapescroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } }
.tape-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; flex: none; }
.tape-item:hover .tape-sym { color: var(--accent); }
.tape-dot { width: 5px; height: 5px; border-radius: 99px; background: var(--gain); animation: livepulse 1.6s ease-in-out infinite; }
.tape-sym { font-weight: 600; color: var(--ink); }
.tape-px { color: var(--muted); }

/* ---------- license & analyst ---------- */
.lic-chip.trial { color: oklch(0.55 0.12 75); border-color: oklch(0.62 0.13 75 / 0.45); }
.lic-chip.trial .mkt-dot { background: oklch(0.72 0.13 75); }
.lic-chip.expired { color: var(--loss); border-color: color-mix(in oklch, var(--loss) 40%, transparent); background: var(--loss-bg); }
.lic-chip.expired .mkt-dot { background: var(--loss); }
.lic-chip.pro { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.lic-chip.pro .mkt-dot { background: var(--accent); }
.lic-screen { max-width: 820px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.pricing-region { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.founder-card { border-color: color-mix(in oklch, oklch(0.72 0.13 60) 45%, var(--line)); }
.founder-card.selected { box-shadow: 0 0 0 1px oklch(0.72 0.13 60), var(--shadow); border-color: oklch(0.72 0.13 60); }
.founder-badge { background: linear-gradient(95deg, oklch(0.72 0.14 60), oklch(0.68 0.15 35)) !important; }
.lic-chip.founder { color: oklch(0.55 0.14 55); border-color: color-mix(in oklch, oklch(0.7 0.13 55) 45%, transparent); background: oklch(0.95 0.05 70); }
.lic-chip.founder .mkt-dot { background: oklch(0.7 0.14 55); }
.founder-active { border-color: color-mix(in oklch, oklch(0.72 0.13 60) 35%, var(--line)); }
.upgrade-block { margin-top: 24px; }
.upgrade-h { font-size: 16px; margin: 0 0 4px; }
.upgrade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.upgrade-card { position: relative; display: flex; flex-direction: column; gap: 6px; }
.upgrade-perk { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 2px 0 10px; flex: 1; text-wrap: pretty; }
.upgrade-btn { width: 100%; }
@media (max-width: 760px) { .upgrade-grid { grid-template-columns: 1fr; } }
@media (max-width: 880px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { position: relative; text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.plan-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-badge { position: absolute; top: -9px; right: 14px; padding: 2px 9px; border-radius: 99px; background: var(--gain); color: white; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.plan-name { display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.plan-price { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 700; margin: 4px 0 10px; }
.plan-per { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.plan-points { margin: 0; padding: 0 0 0 18px; }
.plan-points li { font-size: 13px; color: var(--muted); margin: 4px 0; }
.lic-active { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.lic-active p { margin: 0; }
.weight-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 12px; padding: 5px 0; }
.weight-row input { accent-color: var(--accent); width: 100%; }
.weight-label { font-size: 13px; color: var(--muted); }
.weight-val { font-size: 12.5px; text-align: right; }
.analyst-loading { margin: 0; font-size: 13px; color: var(--muted); animation: livepulse 1.4s ease-in-out infinite; }
.analyst-text { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; text-wrap: pretty; }
@media (max-width: 1100px) { .plan-grid { grid-template-columns: 1fr; } }

.req-form { margin-bottom: 20px; border-color: color-mix(in oklch, var(--accent) 35%, var(--line)); }
.req-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.req-fields input { padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); outline: none; font-size: 13px; }
.req-fields input:focus { border-color: var(--accent); }
.req-sent { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.live-save[disabled] { opacity: 0.5; cursor: default; }
@media (max-width: 1100px) { .req-fields { grid-template-columns: 1fr; } }

/* ---------- source network ---------- */
.srcnet-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; font-size: 11.5px; color: var(--muted); }
.srcnet-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.srcnet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.srcnet-card h4 { font-family: var(--font-display); font-size: 13.5px; font-weight: 650; margin: 0 0 8px; }
.srcrow { display: flex; align-items: baseline; gap: 9px; padding: 3.5px 0; text-decoration: none; color: inherit; min-width: 0; }
.srcrow:hover .srcname { color: var(--accent); }
.srcname { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srcnote { font-size: 10.5px; color: var(--faint); margin-left: auto; flex: none; }
.src-chip { flex: none; width: 46px; text-align: center; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 99px; padding: 2px 0; }
.src-chip.live { background: var(--gain-bg); color: var(--gain); }
.src-chip.feed { background: color-mix(in oklch, var(--accent) 13%, transparent); color: var(--accent); }
.src-chip.open { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.src-chip.api { background: oklch(0.94 0.04 85); color: oklch(0.52 0.11 75); }
.src-chip.ent { background: var(--surface-2); color: var(--faint); border: 1px dashed var(--line-strong); }
.src-chip.locked { background: var(--loss-bg); color: var(--loss); }

/* ---------- appropriateness gate ---------- */
.ack-overlay {
  position: fixed; inset: 0; z-index: 200; background: oklch(0.15 0.01 270 / 0.6);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px;
}
.ack-card { width: 100%; max-width: 560px; padding: 28px 30px; max-height: 92vh; overflow-y: auto; }
.ack-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.ack-card h2 { font-size: 22px; margin: 0 0 6px; }
.ack-lead { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.ack-points { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.ack-point {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; cursor: pointer;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; transition: border-color 0.15s, background 0.15s;
}
.ack-point.on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 5%, transparent); }
.ack-point input { position: absolute; opacity: 0; pointer-events: none; }
.ack-box {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: white; transition: background 0.15s, border-color 0.15s;
}
.ack-point.on .ack-box { background: var(--accent); border-color: var(--accent); }
.ack-text { font-size: 13px; line-height: 1.5; color: var(--ink); }
.ack-btn {
  width: 100%; padding: 12px; border-radius: 11px; background: var(--accent); color: white;
  font-weight: 600; font-size: 14.5px; transition: opacity 0.15s;
}
.ack-btn[disabled] { opacity: 0.45; cursor: default; }
.ack-foot { margin: 14px 0 0; font-size: 11px; color: var(--faint); line-height: 1.5; text-align: center; }
.ack-foot a { color: var(--accent); }

/* ---------- IPO centre ---------- */
.pro-tag, .pro-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent); background: color-mix(in oklch, var(--accent) 13%, transparent); padding: 2px 8px; border-radius: 6px; vertical-align: 3px; }
.nav-pro { margin-left: auto; font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent); background: color-mix(in oklch, var(--accent) 14%, transparent); padding: 1px 5px; border-radius: 5px; }
.ipo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ipo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; }
.ipo-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ipo-name { font-family: var(--font-display); font-weight: 650; font-size: 15px; }
.ipo-meta { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.ipo-rating { flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 99px; }
.ipo-rating.hot { background: var(--gain); color: #fff; }
.ipo-rating.strong { background: var(--gain-bg); color: var(--gain); }
.ipo-rating.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.ipo-rating.cautious { background: var(--loss-bg); color: var(--loss); }
.ipo-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; }
.ipo-k { color: var(--muted); }
.ipo-v { font-weight: 600; }
.ipo-pred { border-top: 1px solid var(--line); padding-top: 9px; }
.ipo-pred-h { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.ipo-pred-h .mono { font-size: 14px; font-weight: 650; }
.ipo-bar { height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.ipo-bar-fill { display: block; height: 100%; background: var(--gain); border-radius: 99px; }
.ipo-stats { display: flex; gap: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.ipo-stats > div { display: flex; flex-direction: column; gap: 2px; }
.ipo-s-label { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.ipo-s-val { font-size: 13px; font-weight: 600; }
.ipo-note { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 9px; text-wrap: pretty; }

.mfa-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 460px; }
.mfa-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.mfa-secret2 { background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 9px; padding: 12px; text-align: center; font-size: 16px; letter-spacing: 0.08em; width: 100%; }
.mfa-uri2 { font-size: 12.5px; color: var(--accent); }
.mfa-code2 { width: 180px; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); outline: none; font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.3em; text-align: center; }
.mfa-code2:focus { border-color: var(--accent); }

/* ---------- super engine ---------- */
.sig-pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.sig-pill.sm { padding: 2px 7px; font-size: 9.5px; }
.sig-pill.verified { background: var(--gain-bg); color: var(--gain); }
.sig-pill.upgraded { background: color-mix(in oklch, var(--accent) 14%, transparent); color: var(--accent); }
.sig-pill.downgraded { background: var(--loss-bg); color: var(--loss); }
.sig-pill.review { background: oklch(0.95 0.06 75); color: oklch(0.5 0.12 70); }
.sig-verify { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 13px; }
.sig-verify-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 9px; }
.sig-verify-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.sig-verify-row .mono { font-weight: 600; font-size: 14px; color: var(--ink); }
.sig-verify-row .accent { color: var(--accent); }
.sig-arrow { color: var(--faint); }
.sig-verify-note { font-size: 11.5px; color: var(--faint); line-height: 1.5; text-wrap: pretty; }
.se-stats { display: flex; gap: 18px; margin-bottom: 12px; }
.se-stat { display: flex; flex-direction: column; }
.se-num { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; }
.se-lab { font-size: 11px; color: var(--faint); margin-top: 3px; }
.train-spark { width: 100%; height: 40px; display: block; margin: 4px 0 2px; }

/* ---------- toasts & error boundary ---------- */
.toaster { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-left-width: 3px; border-radius: 12px; box-shadow: 0 8px 28px oklch(0.2 0.01 270 / 0.18); padding: 12px 14px; animation: toastin 0.22s ease; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.error { border-left-color: var(--loss); }
.toast.warn { border-left-color: oklch(0.72 0.13 75); }
.toast.success { border-left-color: var(--gain); }
.toast.info { border-left-color: var(--accent); }
.toast-ic { flex: none; width: 19px; height: 19px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; margin-top: 1px; }
.toast.error .toast-ic { background: var(--loss); }
.toast.warn .toast-ic { background: oklch(0.72 0.13 75); }
.toast.success .toast-ic { background: var(--gain); }
.toast.info .toast-ic { background: var(--accent); }
.toast-msg { flex: 1; font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.toast-x { flex: none; color: var(--faint); font-size: 16px; line-height: 1; padding: 0 2px; }
.toast-x:hover { color: var(--ink); }
.err-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.err-card { max-width: 440px; text-align: center; padding: 34px 32px; }
.err-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--loss-bg); color: var(--loss); font-size: 24px; font-weight: 700; }
.err-card h2 { font-size: 20px; margin: 0 0 8px; }
.err-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 16px; }
.err-actions { margin-bottom: 14px; }
.err-reload { width: auto; padding: 11px 22px; }
.err-detail { font-size: 11px; color: var(--faint); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; word-break: break-word; }
@media (max-width: 560px) { .toaster { left: 14px; right: 14px; max-width: none; bottom: 78px; } }

/* ---------- home trust bar ---------- */
.home-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px; }
.trust-item { display: flex; gap: 11px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.trust-item span:last-child { font-size: 12px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.trust-item strong { color: var(--ink); font-weight: 650; }
.trust-dot { flex: none; width: 9px; height: 9px; border-radius: 99px; margin-top: 4px; }
.trust-dot.a { background: var(--accent); }
.trust-dot.g { background: var(--gain); }
.trust-dot.r { background: oklch(0.72 0.13 75); }
@media (max-width: 900px) { .home-trust { grid-template-columns: 1fr; } }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--faint); }
.pager-controls { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager-btn {
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.pager-btn:hover:not([disabled]) { color: var(--ink); border-color: var(--line-strong); }
.pager-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager-btn[disabled] { opacity: 0.4; cursor: default; }
.pager-ellipsis { color: var(--faint); padding: 0 2px; }

/* ---------- pro lock teaser ---------- */
.pro-lock-wrap { position: relative; }
.pro-lock-content { max-height: 80vh; overflow: hidden; filter: blur(5px) saturate(0.65); opacity: 0.5; pointer-events: none; user-select: none; }
.pro-lock-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; }
.pro-lock-card { max-width: 470px; text-align: center; padding: 34px 32px; box-shadow: 0 10px 40px oklch(0.2 0.01 270 / 0.18); }
.pro-lock-icon { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 16px; background: color-mix(in oklch, var(--accent) 13%, transparent); color: var(--accent); }
.pro-lock-card .pro-badge { display: inline-block; margin-bottom: 10px; }
.pro-lock-card h2 { font-size: 20px; margin: 0 0 8px; }
.pro-lock-card p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 18px; text-wrap: pretty; }
.pro-lock-btn { width: auto; padding: 11px 22px; }
.pro-lock-link { display: block; margin: 12px auto 0; font-size: 13px; color: var(--accent); font-weight: 550; }
.pro-lock-link:hover { text-decoration: underline; }
.pro-lock-trial { margin-top: 14px !important; font-size: 11.5px !important; color: var(--faint) !important; }

/* ---------- markets-today strip ---------- */
.market-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.market-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 16px; display: flex; flex-direction: column; gap: 11px; }
.market-card-head { display: flex; align-items: center; gap: 8px; }
.market-region { font-family: var(--font-display); font-weight: 650; font-size: 14px; }
.market-status { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); }
.market-status .mkt-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--faint); }
.market-status.open { color: var(--gain); }
.market-status.open .mkt-dot { background: var(--gain); animation: livepulse 1.6s ease-in-out infinite; }
.market-exch { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -4px; }
.market-metrics { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.market-metrics > div { display: flex; flex-direction: column; gap: 3px; }
.mm-label { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.market-metrics > div:nth-child(3) { flex: 1; min-width: 0; }
.mm-val { font-size: 14px; font-weight: 600; }
.market-top { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border-top: 1px solid var(--line); padding-top: 11px; }
.market-top:hover .mt-sym { color: var(--accent); }
.mt-label { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.mt-sym { font-weight: 600; font-size: 12.5px; }
.market-top .delta { margin-left: auto; }

/* ---------- backtest ---------- */
.bt-controls { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr; gap: 24px; margin-bottom: 20px; }
@media (max-width: 760px) { .bt-controls { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- daily brief ---------- */
.daily-brief { background: linear-gradient(160deg, color-mix(in oklch, var(--accent) 9%, var(--surface)), var(--surface)); border: 1px solid color-mix(in oklch, var(--accent) 22%, var(--line)); border-radius: 16px; padding: 18px 20px; margin-bottom: 26px; }
.brief-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brief-kicker { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.brief-head h2 { font-size: 19px; font-weight: 650; margin-top: 3px; }
.brief-controls { display: flex; align-items: center; gap: 8px; }
.brief-sel { padding: 6px 10px; font-size: 12.5px; }
.brief-x { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); color: var(--faint); font-size: 18px; line-height: 1; background: var(--surface); }
.brief-x:hover { color: var(--ink); border-color: var(--line-strong); }
.brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.brief-card { display: flex; flex-direction: column; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; transition: transform 0.15s, border-color 0.15s; position: relative; }
.brief-card:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.brief-rank { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 99px; background: color-mix(in oklch, var(--accent) 14%, transparent); color: var(--accent); font-family: var(--font-display); font-weight: 700; font-size: 12px; }
.brief-sym { font-family: var(--font-mono); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.brief-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brief-figs { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.brief-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 9px; }
.brief-score { font-size: 11.5px; color: var(--muted); }
.brief-btns { display: flex; gap: 5px; }
.brief-mini { padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface); }
.brief-mini:hover { border-color: var(--accent); color: var(--accent); }
.brief-mini.on { color: oklch(0.6 0.13 75); border-color: color-mix(in oklch, oklch(0.7 0.13 75) 45%, transparent); }
.brief-mini.paper { color: #fff; background: var(--accent); border-color: var(--accent); }
.brief-foot { margin: 12px 0 0; font-size: 11px; color: var(--faint); }
@media (max-width: 760px) { .brief-grid { grid-template-columns: 1fr; } }

/* ---------- watchlist & paper trade ---------- */
.explain-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.explain-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.explain-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); font-size: 15px; color: var(--muted); }
.explain-ic.accent { background: color-mix(in oklch, var(--accent) 14%, transparent); color: var(--accent); }
.explain-card strong { font-size: 13.5px; }
.explain-card p { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.explain-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, transparent); padding: 1px 6px; border-radius: 99px; vertical-align: 1px; margin-left: 4px; }
@media (max-width: 760px) { .explain-row { grid-template-columns: 1fr; } }
.stock-actions { display: flex; gap: 8px; }
.watch-btn, .paper-btn { padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; transition: all 0.15s; }
.watch-btn { color: var(--muted); background: var(--surface); }
.watch-btn:hover { border-color: var(--accent); color: var(--accent); }
.watch-btn.on { color: oklch(0.6 0.13 75); border-color: color-mix(in oklch, oklch(0.7 0.13 75) 45%, transparent); background: oklch(0.96 0.04 80); }
.paper-btn { color: #fff; background: var(--accent); border-color: var(--accent); }
.paper-btn:hover { filter: brightness(1.06); }
.paper-hint { font-weight: 500; opacity: 0.8; font-size: 11px; }
.share-btn { padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--muted); white-space: nowrap; transition: all 0.15s; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- onboarding ---------- */
.onb-card { max-width: 600px; }
.onb-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.onb-dot { width: 28px; height: 4px; border-radius: 99px; background: var(--line); transition: background 0.2s; }
.onb-dot.on { background: var(--accent); }
.onb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 20px; }
.onb-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.onb-opt { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: all 0.15s; }
.onb-opt:hover { border-color: var(--line-strong); }
.onb-opt.on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, transparent); box-shadow: 0 0 0 1px var(--accent); }
.onb-opt-label { font-weight: 650; font-size: 14px; }
.onb-opt-sub { font-size: 11.5px; color: var(--muted); }
.onb-amts { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 9px; margin-bottom: 20px; }
.onb-amt { padding: 13px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-family: var(--font-mono); font-weight: 600; font-size: 14px; transition: all 0.15s; }
.onb-amt:hover { border-color: var(--line-strong); }
.onb-amt.on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, transparent); box-shadow: 0 0 0 1px var(--accent); color: var(--accent); }
.onb-nav { display: flex; align-items: center; gap: 12px; }
.onb-nav .ack-btn { flex: 1; }
.onb-back { padding: 12px 16px; border-radius: 11px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13.5px; background: var(--surface); }
.onb-back:hover { color: var(--ink); border-color: var(--line-strong); }
.onb-skip { display: block; margin: 12px auto 0; font-size: 12.5px; color: var(--faint); text-decoration: underline; }
.onb-skip:hover { color: var(--muted); }
@media (max-width: 560px) { .onb-grid, .onb-grid-3, .onb-amts { grid-template-columns: 1fr 1fr; } }
.side-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 99px; }
.side-tag.buy { background: var(--gain-bg); color: var(--gain); }
.side-tag.sell { background: var(--loss-bg); color: var(--loss); }
.empty-cta { text-align: center; }
.empty-cta p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ---------- topbar bell ---------- */
.bell-btn {
  position: relative; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--line); transition: color 0.15s, border-color 0.15s;
}
.bell-btn:hover { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--loss); color: white; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface); font-family: var(--font-body);
}

/* ---------- alerts ---------- */
.alerts-body { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
.alerts-side { display: flex; flex-direction: column; gap: 20px; }
.alerts-list { overflow: hidden; }
.alert-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 13px 18px; border-bottom: 1px solid var(--line); transition: background 0.12s;
}
.alert-row:last-child { border-bottom: none; }
.alert-row:hover { background: var(--surface-2); }
.alert-row.unread { background: color-mix(in oklch, var(--accent) 5%, transparent); }
.alert-row.unread .alert-title { font-weight: 650; }
.alert-sev { flex: none; width: 9px; height: 9px; border-radius: 99px; background: var(--faint); }
.alert-sev.pos { background: var(--gain); } .alert-sev.neg { background: var(--loss); }
.alert-sev.warn { background: oklch(0.72 0.13 75); } .alert-sev.info { background: var(--accent); }
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-title { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-detail { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.alert-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 99px; }
.alert-tag.pos { background: var(--gain-bg); color: var(--gain); }
.alert-tag.neg { background: var(--loss-bg); color: var(--loss); }
.alert-tag.warn { background: oklch(0.94 0.04 85); color: oklch(0.52 0.11 75); }
.alert-tag.info { background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent); }
.alert-time { font-size: 10.5px; color: var(--faint); }

/* ---------- scorecard ---------- */
.outcome { font-size: 12px; font-weight: 600; }
.outcome.hit { color: var(--gain); } .outcome.miss { color: var(--loss); }
.cal-row { display: grid; grid-template-columns: 70px 1fr 42px; align-items: center; gap: 12px; padding: 7px 0; }
.cal-h { font-size: 12.5px; color: var(--muted); }
.cal-track { position: relative; height: 14px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.cal-fill { display: block; height: 100%; background: var(--accent); border-radius: 7px; }
.cal-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1.5px; background: var(--ink); opacity: 0.4; }
.cal-val { font-size: 12.5px; text-align: right; font-weight: 600; }

/* ---------- admin console (tabbed) ---------- */
.admin-screen { max-width: 1100px; }
.admin-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow); }
.kpi-dot { flex: none; width: 9px; height: 9px; border-radius: 99px; }
.kpi-dot.g { background: var(--gain); animation: livepulse 1.6s ease-in-out infinite; }
.kpi-dot.a { background: oklch(0.72 0.13 75); }
.kpi-dot.r { background: var(--loss); }
.kpi-val { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.05; }
.kpi-sub { font-size: 12px; color: var(--faint); font-weight: 500; }
.kpi-lab { font-size: 11px; color: var(--faint); margin-top: 2px; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.admin-tab { padding: 9px 16px; border-radius: 9px 9px 0 0; font-size: 13.5px; font-weight: 550; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tab:hover { color: var(--ink); }
.admin-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.crawler-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.crawler-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.crawler-row.disabled { opacity: 0.55; }
.crawler-row .cov-id { flex: 1; min-width: 0; }
.crawler-row .src-count { flex: none; }
@media (max-width: 1000px) { .admin-kpis { grid-template-columns: repeat(2, 1fr); } .admin-cols, .crawler-grid { grid-template-columns: 1fr; } }

/* ---------- internal report rows ---------- */
.report-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.report-row:last-of-type { border-bottom: none; }
.report-row:hover .cov-layer { color: var(--accent); }
.report-arrow { color: var(--faint); font-size: 14px; }

/* ---------- technical setup card ---------- */
.tech-pattern { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tech-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.tech-badge.bull { background: var(--gain-bg); color: var(--gain); }
.tech-badge.bear { background: var(--loss-bg); color: var(--loss); }
.tech-badge.neutral { background: var(--surface-2); color: var(--muted); }
.tech-pattern-name { font-family: var(--font-display); font-weight: 650; font-size: 15px; }
.tech-strength { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.tech-strength-track { width: 64px; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tech-strength-fill { display: block; height: 100%; border-radius: 99px; }
.tech-strength-fill.gain { background: var(--gain); } .tech-strength-fill.loss { background: var(--loss); } .tech-strength-fill.dim { background: var(--faint); }
.tech-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; text-wrap: pretty; }
.tech-levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.tech-levels > div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.tl-k { font-size: 12px; color: var(--faint); }
.tl-v { font-size: 12.5px; font-weight: 550; }

/* ---------- economic calendar ---------- */
.cal-day { margin-bottom: 18px; }
.cal-day-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cal-day-name { font-family: var(--font-display); font-weight: 650; font-size: 15px; }
.cal-day-sub { font-size: 12px; color: var(--faint); }
.cal-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 7px; cursor: default; transition: border-color 0.12s; }
.cal-row.clickable { cursor: pointer; }
.cal-row.clickable:hover { border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.cal-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); width: 48px; flex: none; }
.cal-imp { display: flex; gap: 2px; flex: none; }
.cal-imp i { width: 5px; height: 14px; border-radius: 2px; background: var(--line-strong); display: block; }
.cal-imp.i1 i:nth-child(1), .cal-imp.i2 i:nth-child(-n+2), .cal-imp.i3 i { background: var(--amber, oklch(0.66 0.13 75)); }
.cal-imp.i3 i { background: var(--loss); }
.cal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-title { display: block; font-weight: 600; font-size: 13.5px; }
.cal-detail { display: block; font-size: 11.5px; color: var(--faint); }
.cal-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 99px; flex: none; }
.cal-kind.macro { background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent); }
.cal-kind.rates { background: oklch(0.95 0.05 75); color: oklch(0.5 0.11 70); }
.cal-kind.earnings { background: var(--gain-bg); color: var(--gain); }
.cal-flag { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); flex: none; text-transform: uppercase; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .alerts-body { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { flex-direction: column-reverse; }
  .sidebar {
    width: 100%; flex-direction: row; padding: 0; border-right: none; border-top: 1px solid var(--line);
    position: sticky; bottom: 0; z-index: 40; overflow-x: auto;
  }
  /* topbar density: keep LSE chip only; other market chips hidden on phones */
  .topbar-right span.mkt-chip:not(:nth-of-type(1)) { display: none; }
  .logo, .sidebar-foot { display: none; }
  .nav-list { flex-direction: row; gap: 0; width: 100%; }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 12px; border-radius: 0; font-size: 10.5px; white-space: nowrap; min-width: 64px; justify-content: center; }
  .nav-item span { display: block; }
  .nav-item.on { background: transparent; color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .gsearch { width: 100%; order: 2; }
  .topbar-right { width: 100%; order: 1; justify-content: space-between; gap: 6px; }
  .topbar-date { display: none; }
  .screen { padding: 18px 14px 40px; }
  .screen-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .screen-head h1 { font-size: 24px; }
  .head-stats { display: flex; }
  .buy-feature-grid { grid-template-columns: 1fr; }
  .two-col, .detail-grid, .pf-body, .pulse-cols, .admin-grid, .srcnet-grid { grid-template-columns: 1fr !important; }
  .pf-summary { grid-template-columns: 1fr 1fr; }
  .table-card { overflow-x: auto; }
  .gtable { min-width: 560px; }
  .plan-grid { grid-template-columns: 1fr; }
}
/* Tablet-only icon rail. MUST be range-scoped: a plain max-width:1100px here
   also matches phones and, being later in the file, overrides the 760px
   bottom-nav rules above (cascade bug — phones got a 64px strip). */
@media (max-width: 1100px) {
  .two-col, .detail-grid, .pf-body, .pulse-cols { grid-template-columns: 1fr; }
  .buy-feature-grid { grid-template-columns: 1fr; }
  .pf-controls { grid-template-columns: 1fr; gap: 18px; }
  .pf-summary { grid-template-columns: repeat(2, 1fr); }
  .head-stats { display: none; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .sidebar { width: 64px; padding: 20px 8px; }
  .logo-text, .nav-item span, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; }
  .logo { justify-content: center; padding-bottom: 18px; }
}
