/* Opportunity Hub · v1.2 design system
   Navy desk, gold for opportunity, green/red only for price direction. */

:root {
  --paper: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --line: #e1e6ee;
  --line-strong: #cdd5e1;
  --ink: #12203a;
  --ink-2: #4b5a75;
  --ink-3: #7c889e;
  --navy: #0f1d33;
  --navy-2: #1a2c4a;
  --navy-ink: #c9d3e3;
  --gold: #d99a0b;
  --gold-strong: #b97f00;
  --gold-soft: #fcf3dc;
  --gold-ink: #6b4a00;
  --blue: #2f63c9;
  --sage: #4f8a78;
  --up: #11805a;
  --up-soft: #e3f4ec;
  --down: #c03a2b;
  --down-soft: #fbe9e6;
  --warn: #a96300;
  --focus: #2f63c9;
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 7px;
  --shadow-pop: 0 18px 50px -12px rgba(15, 29, 51, .35), 0 2px 6px rgba(15, 29, 51, .08);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif;
  --side-w: 236px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0a1322;
  --surface: #101c30;
  --surface-2: #16243b;
  --line: #213149;
  --line-strong: #2d405e;
  --ink: #e6ebf3;
  --ink-2: #a9b5c8;
  --ink-3: #75839b;
  --navy: #070e1b;
  --navy-2: #13213a;
  --gold: #f0b429;
  --gold-strong: #f6c450;
  --gold-soft: #2c2410;
  --gold-ink: #f6d58a;
  --blue: #6b97f0;
  --sage: #74b29e;
  --up: #3fcf95;
  --up-soft: #0f2a21;
  --down: #f2786a;
  --down-soft: #34171a;
  --warn: #f0b429;
  --focus: #6b97f0;
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a1322; --surface: #101c30; --surface-2: #16243b; --line: #213149; --line-strong: #2d405e;
    --ink: #e6ebf3; --ink-2: #a9b5c8; --ink-3: #75839b; --navy: #070e1b; --navy-2: #13213a;
    --gold: #f0b429; --gold-strong: #f6c450; --gold-soft: #2c2410; --gold-ink: #f6d58a; --blue: #6b97f0; --sage: #74b29e;
    --up: #3fcf95; --up-soft: #0f2a21; --down: #f2786a; --down-soft: #34171a; --warn: #f0b429; --focus: #6b97f0;
    --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--font); font-feature-settings: "tnum" 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.012em; line-height: 1.2; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
p { margin: 0 0 10px; }
small, .sm { font-size: 13px; }
.muted { color: var(--ink-3); }
.num, td.r, .price { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
pre.code { font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--r); overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 8px 0 14px; }
kbd { display: inline-block; font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--ink-2); background: var(--surface); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* ---------------------------------------------------------------- shell */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--navy); color: var(--navy-ink); display: flex; flex-direction: column; padding: 18px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 10px 18px; font: 700 15px/1.1 var(--display); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--gold); }
.side nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-group { margin-bottom: 16px; }
.nav-label { display: block; font-size: 12px; color: #7f8ca5; padding: 0 10px 6px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--navy-ink); font-size: 14.5px; margin-bottom: 1px; }
.side nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.side nav a.on { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side nav a.on .ic { color: var(--gold); }
.nav-count { margin-left: auto; font: 600 11.5px/1 var(--font); font-style: normal; background: var(--gold); color: #1d1300; border-radius: 999px; padding: 3px 7px; }
.setup-pill { display: block; margin: 0 2px 10px; padding: 10px 12px; border-radius: 10px; background: var(--navy-2); color: #fff; font-size: 13px; }
.setup-pill:hover { text-decoration: none; background: #213659; }
.setup-pill b { float: right; color: var(--gold); }
.setup-bar { display: block; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); margin-bottom: 8px; overflow: hidden; }
.setup-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.side-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.08); padding: 10px 6px 0; margin: 0; }
.side-foot .who { font-size: 13.5px; color: #fff; }
.side-foot .icon-btn { color: var(--navy-ink); }
.side-foot .icon-btn:hover { background: var(--navy-2); color: #fff; }

.frame { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-3); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger:hover { border-color: var(--line-strong); }
.top-actions { margin-left: auto; display: flex; gap: 4px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #1d1300; font: 700 10.5px/17px var(--font); font-style: normal; text-align: center; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: inline; } :root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .only-dark { display: inline; } :root:not([data-theme="light"]) .only-light { display: none; } }
.menu-btn { display: none; }
.main { flex: 1; width: 100%; max-width: 1320px; padding: 28px 28px 80px; }
.page-head { margin-bottom: 22px; max-width: 760px; }
.page-head p { color: var(--ink-2); margin: 6px 0 0; }
.tabbar, .scrim { display: none; }

/* ---------------------------------------------------------------- building blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head a { font-size: 13.5px; white-space: nowrap; }
.panel-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13.5px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.cols.side-right { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.stack > * + * { margin-top: 18px; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn.primary { background: var(--gold); border-color: var(--gold); color: #1d1300; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: var(--gold); border-color: var(--gold); color: #1d1300; } }
.btn.primary:hover { filter: brightness(1.12); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1d1300; }
.btn.gold:hover { background: var(--gold-strong); border-color: var(--gold-strong); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--down); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.busy { pointer-events: none; opacity: .7; }
.btn.busy::after { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
form.inline { display: inline-flex; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip.on { background: var(--ink); color: var(--navy); border-color: var(--ink); }
.chip em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.chip.on em { color: inherit; opacity: .7; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.ticker { display: inline-block; font: 700 11.5px/1 var(--font); letter-spacing: .02em; padding: 4px 6px; border-radius: 5px; background: var(--ink); color: var(--surface); }
.risk { display: inline-flex; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.r-low { background: var(--up-soft); color: var(--up); }
.r-med { background: var(--surface-2); color: var(--ink-2); }
.r-high { background: var(--gold-soft); color: var(--gold-ink); }
.r-scam { background: var(--down-soft); color: var(--down); }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.due .ic { width: 14px; height: 14px; vertical-align: -2px; }
.due.soon { color: var(--warn); }
.due.past { color: var(--ink-3); font-weight: 500; text-decoration: line-through; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--ink-3); }

/* score gauge */
.ring { position: relative; display: inline-grid; place-items: center; width: 46px; height: 46px; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 3.6; stroke-linecap: round; }
.ring-track { stroke: var(--line); }
.ring b { font: 700 14px/1 var(--display); font-variant-numeric: tabular-nums; margin-top: 2px; }
.ring-crit .ring-fill { stroke: var(--gold); } .ring-crit b { color: var(--gold-strong); }
.ring-high .ring-fill { stroke: var(--blue); }
.ring-mid .ring-fill { stroke: var(--sage); }
.ring-low .ring-fill { stroke: var(--ink-3); opacity: .55; } .ring-low b { color: var(--ink-3); }
.ring.ring-sm { width: 40px; height: 40px; } .ring.ring-sm b { font-size: 13px; }
.ring.ring-lg { width: 76px; height: 76px; } .ring.ring-lg b { font-size: 24px; } .ring.ring-lg circle { stroke-width: 3; }

/* empty states */
.empty { text-align: center; padding: 34px 20px; color: var(--ink-2); }
.empty-ic { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 14px; font-size: 14px; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow-pop); font-size: 14px; animation: toast-in .22s ease-out; }
.toast .ic { margin-top: 1px; color: var(--gold); }
.toast.err { background: var(--down); } .toast.err .ic { color: #fff; }
.toast span { flex: 1; }
.toast-x { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* forms */
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; color: var(--ink); }
label small { display: block; font-weight: 400; color: var(--ink-3); margin-top: 4px; font-size: 12.5px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: 400 14.5px/1.4 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 17px; height: 17px; margin: 0; accent-color: var(--navy); }
textarea { resize: vertical; min-height: 80px; }
input[type=file] { padding: 7px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { margin-top: 2px; flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form label { margin: 0; flex: 1; min-width: 180px; }

/* switch toggle for booleans */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); margin: 0; font-weight: 500; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; border: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--up); }
.switch input:checked::after { transform: translateX(17px); }
.switch small { font-weight: 400; }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 0 10px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl th.r { text-align: right; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tbl tr.off { opacity: .45; }
.tbl tr.hot td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.sym { font: 700 14.5px/1.2 var(--display); color: var(--ink); }
.sym:hover { color: var(--blue); }
.sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.mspark { display: block; }
.mspark polyline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mspark.up polyline { stroke: var(--up); } .mspark.down polyline { stroke: var(--down); }
.spark-none { font-size: 11.5px; color: var(--ink-3); }
.mult { display: inline-block; min-width: 46px; text-align: center; font-weight: 700; font-size: 13px; padding: 3px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.mult.hot { background: var(--gold-soft); color: var(--gold-ink); }

/* tabs (segmented) */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); gap: 2px; }
.seg a { padding: 6px 13px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15,29,51,.12); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1; max-width: 340px; min-width: 200px; }
.toolbar .search input { margin: 0; padding-left: 36px; height: 38px; }
.toolbar .search .ic { position: absolute; left: 11px; top: 10px; color: var(--ink-3); }
.pager { display: flex; justify-content: center; gap: 14px; align-items: center; padding: 16px 0 4px; font-size: 13.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- Today */
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.today-head .date { color: var(--ink-3); font-size: 14px; margin-top: 4px; }
.brief { position: relative; padding: 4px 0 26px 22px; margin-bottom: 24px; border-left: 3px solid var(--gold); max-width: 900px; }
.brief-text { font: 500 clamp(19px, 2.1vw, 24px)/1.5 var(--display); letter-spacing: -.01em; color: var(--ink); }
.brief-text p { margin: 0 0 12px; }
.brief-text strong { font-weight: 750; }
.brief-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 13px; color: var(--ink-3); }
.brief-foot .ic { color: var(--gold); }
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 18px; overflow: hidden; }
.glance a { padding: 16px 18px; border-left: 1px solid var(--line); color: var(--ink); display: block; }
.glance a:first-child { border-left: 0; }
.glance a:hover { background: var(--surface-2); text-decoration: none; }
.glance b { display: block; font: 700 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.glance span { font-size: 13px; color: var(--ink-2); }
.glance a.attn b { color: var(--gold-strong); }
.act { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.act-body { flex: 1; min-width: 0; }
.act-body a.t { color: var(--ink); font-weight: 600; display: block; line-height: 1.4; }
.act-body a.t:hover { color: var(--blue); text-decoration: none; }
.pulse-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.pulse-row .who { flex: 1; min-width: 0; }
.pipeline { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin: 6px 0 12px; }
.pipeline i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }
.health { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); }
.health span { display: inline-flex; align-items: center; gap: 6px; }
.health i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); display: inline-block; }
.health i.bad { background: var(--down); } .health i.idle { background: var(--line-strong); }

/* ---------------------------------------------------------------- Opportunities inbox */
.inbox { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); min-height: calc(100vh - 230px); overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 230px); }
.inbox-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--ink); position: relative; }
.inbox-item:hover { background: var(--surface-2); text-decoration: none; }
.inbox-item.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--gold); }
.inbox-item.starred::after { content: "★"; position: absolute; top: 10px; right: 12px; color: var(--gold); font-size: 13px; }
.inbox-item h3 { font: 600 14.5px/1.4 var(--font); margin: 2px 0 6px; letter-spacing: 0; padding-right: 14px; }
.inbox-item.read h3 { font-weight: 500; color: var(--ink-2); }
.inbox-panel { overflow-y: auto; max-height: calc(100vh - 230px); }
.inbox-panel .empty { padding-top: 80px; }
.detail { padding: 26px 30px 30px; max-width: 760px; }
.detail-top { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.detail h1 { font-size: 24px; line-height: 1.3; margin: 6px 0 0; }
.why { font-size: 16px; line-height: 1.6; color: var(--ink); margin: 0 0 14px; }
.window { display: inline-flex; gap: 8px; align-items: center; background: var(--gold-soft); color: var(--gold-ink); border-radius: 9px; padding: 8px 12px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.orig { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; font-size: 14px; color: var(--ink-2); }
.orig b { color: var(--ink); font-weight: 600; }
.detail .actions { margin: 18px 0 0; }
.ask { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: var(--surface-2); }
.ask-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.ask-head .ic { color: var(--gold); }
.ask-form { display: flex; gap: 8px; }
.ask-form input { margin: 0; }
.ask-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ask-sugg button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 5px 11px; font: 500 12.5px var(--font); cursor: pointer; }
.ask-sugg button:hover { color: var(--ink); border-color: var(--ink-3); }
.answer { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }
.answer.loading { color: var(--ink-3); }
.shortcut-hint { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------------------------------------------------------- Market detail */
.quote { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.quote .price { font: 700 34px/1 var(--display); }
.quote .chg { font-size: 17px; font-weight: 700; }
svg.chart { width: 100%; height: 190px; display: block; }
svg.chart .area { opacity: .12; }
svg.chart.up .line, svg.chart.up .area { stroke: var(--up); fill: none; } svg.chart.up .area { fill: var(--up); stroke: none; }
svg.chart.down .line { stroke: var(--down); fill: none; } svg.chart.down .area { fill: var(--down); stroke: none; }
svg.chart .line { stroke-width: 2; }
.chart-legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.signal { display: flex; gap: 12px; padding: 12px 0; }
.signal-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); flex: none; }
.explain { font-size: 13.5px; color: var(--ink-2); margin: 3px 0 0; }

/* ---------------------------------------------------------------- Ideas board */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.lane h3 { display: flex; justify-content: space-between; font-size: 14px; padding: 0 2px 10px; color: var(--ink-2); font-family: var(--font); font-weight: 600; }
.lane-body { display: flex; flex-direction: column; gap: 10px; min-height: 80px; border-radius: 12px; }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.idea h4 { font: 650 15px/1.35 var(--display); margin: 0 0 6px; }
.idea p { font-size: 13.5px; color: var(--ink-2); margin: 0 0 10px; }
.idea dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; margin: 0 0 10px; }
.idea dt { color: var(--ink-3); }
.idea dd { margin: 0; color: var(--ink); }
.idea-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.idea-foot select { width: auto; margin: 0; padding: 5px 8px; font-size: 12.5px; border-radius: 8px; }
.ai-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--gold-ink); background: var(--gold-soft); border-radius: 999px; padding: 2px 8px; margin-bottom: 8px; }
.ai-mark .ic { width: 12px; height: 12px; }

/* ---------------------------------------------------------------- Setup guide & settings */
.steps { counter-reset: st; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 4px; }
.step-n { counter-increment: st; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--display); background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong); }
.step-n::before { content: counter(st); }
.step.done .step-n { background: var(--up); border-color: var(--up); color: #fff; }
.step.done .step-n::before { content: "✓"; }
.step h2 { margin-bottom: 4px; }
.step > div > p { color: var(--ink-2); max-width: 640px; }
.step .status { font-size: 13px; font-weight: 600; color: var(--up); margin-left: 8px; }
.how { font-size: 13.5px; color: var(--ink-2); margin: 0 0 12px; padding-left: 18px; }
.how li { margin-bottom: 3px; }
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.settings-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.settings-nav a.on { background: var(--surface); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.settings-section { scroll-margin-top: 80px; }
.settings-section h2 { margin-bottom: 4px; }
.settings-section > p { color: var(--ink-3); font-size: 13.5px; margin-bottom: 16px; }
.savebar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); box-shadow: var(--shadow-pop); }
details.adv { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
details.adv summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv[open] summary .ic { transform: rotate(180deg); }
details.adv > div { margin-top: 14px; }

.log { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font: 12.5px/1.65 ui-monospace, Menlo, Consolas, monospace; max-height: 340px; overflow: auto; white-space: pre-wrap; }
.version-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; font-size: 13px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--gold-soft); color: var(--gold-ink); margin-bottom: 18px; font-size: 14px; }
.callout .ic { margin-top: 2px; }
.callout.bad { background: var(--down-soft); color: var(--down); }
.callout p { margin: 4px 0 0; }

/* ---------------------------------------------------------------- command palette */
.palette { position: fixed; inset: 0; z-index: 90; background: rgba(7, 14, 27, .5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-box { width: 100%; max-width: 620px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); overflow: hidden; border: 1px solid var(--line); animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.99); } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input input { border: 0; box-shadow: none !important; margin: 0; height: 56px; font-size: 16px; padding: 0; background: transparent; }
.palette-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 12px; color: var(--ink-3); padding: 10px 12px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ink); cursor: pointer; }
.palette-item .ic { color: var(--ink-3); }
.palette-item small { margin-left: auto; color: var(--ink-3); white-space: nowrap; }
.palette-item.on, .palette-item:hover { background: var(--surface-2); text-decoration: none; }
.palette-item.on .ic { color: var(--gold); }
.palette-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 14px; }
.palette-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }

/* ---------------------------------------------------------------- auth & installer */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px; padding: 30px; box-shadow: var(--shadow-pop); }
.auth-card.wide { max-width: 560px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 700 19px/1.1 var(--display); margin-bottom: 22px; color: var(--ink); }
.auth-brand .ic { width: 30px; height: 30px; color: var(--gold); }
.auth-card h2 { margin: 2px 0 12px; }
.auth-sub { color: var(--ink-3); font-size: 14px; margin: -14px 0 20px; }
ol.wizard { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; flex-wrap: wrap; }
ol.wizard li { counter-increment: s; font-size: 12.5px; color: var(--ink-3); padding: 4px 10px 4px 5px; border-radius: 999px; background: var(--surface-2); }
ol.wizard li::before { content: counter(s); display: inline-block; width: 19px; height: 19px; line-height: 19px; text-align: center; border-radius: 50%; background: var(--line-strong); color: var(--ink); margin-right: 6px; font-weight: 700; }
ol.wizard li.past::before { content: "✓"; background: var(--up); color: #fff; }
ol.wizard li.on { background: var(--gold-soft); color: var(--gold-ink); font-weight: 600; }
ol.wizard li.on::before { background: var(--gold); color: #1d1300; }
ul.checks { list-style: none; padding: 0; margin: 0 0 18px; }
ul.checks li { padding: 6px 0; font-size: 14px; }
ul.checks li > span:first-child { display: inline-block; width: 22px; font-weight: 700; }
ul.checks li.ok > span:first-child { color: var(--up); }
ul.checks li.todo > span:first-child { color: var(--warn); }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: var(--up-soft); color: var(--up); }
.flash.err { background: var(--down-soft); color: var(--down); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .cols, .cols.side-right { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
}
@media (max-width: 980px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-panel { display: none; }
  .inbox-list { border-right: 0; max-height: none; }
  .inbox.show-detail .inbox-list { display: none; }
  .inbox.show-detail .inbox-panel { display: block; max-height: none; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .settings-nav a { white-space: nowrap; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-pop); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(7,14,27,.45); }
  .frame { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .top { padding: 0 14px; gap: 6px; }
  .search-trigger kbd { display: none; }
  .main { padding: 20px 16px 96px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font: 500 11px/1 var(--font); color: var(--ink-3); background: none; border: 0; padding: 6px 0; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on .ic { color: var(--gold); }
  .tabbar .ic { width: 21px; height: 21px; }
  .toasts { bottom: 84px; right: 16px; left: 16px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance a:nth-child(3) { border-left: 0; }
  .glance a:nth-child(n+3) { border-top: 1px solid var(--line); }
  .form-grid { grid-template-columns: 1fr; }
  .today-head { flex-direction: column; align-items: flex-start; }
  .detail { padding: 20px 18px; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .lane { scroll-snap-align: start; }
  h1 { font-size: 24px; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- small helpers */
.hide-lg { display: none !important; }
@media (max-width: 980px) { .hide-lg { display: inline-flex !important; } }
.icon-btn.on .ic, .btn.on .ic { color: var(--gold); fill: var(--gold); }
.btn.on { border-color: var(--gold); }
.act-body > .sm, .act-body > .due { display: block; margin-top: 2px; }
.act-body b { font-weight: 600; }
.sub.up { color: var(--up); } .sub.down { color: var(--down); }
.panel > .rows:last-child, .panel > ul.rows:last-child { margin-bottom: -8px; }
.inbox-list .pager { border-top: 1px solid var(--line); }
.lane-body .idea h4 a:hover { color: var(--blue); text-decoration: none; }
.tbl .icon-btn { width: 32px; height: 32px; }
.answer.err { color: var(--down); }
[hidden] { display: none !important; }
.cols > .panel + .panel, .cols > .stack, .cols > section { margin-top: 0; }
.act-body > .due { display: flex; }
.brief { max-width: 860px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { background: var(--ink); color: var(--navy); border-color: var(--ink); } }
.search-trigger { min-width: 0; }
.top-actions { flex: none; }
@media (max-width: 860px) {
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .toolbar .chips::-webkit-scrollbar { display: none; }
  .toolbar .search { max-width: none; }
  .seg { overflow-x: auto; max-width: 100%; }
  .seg a { white-space: nowrap; }
  .search-trigger span { font-size: 13.5px; }
}
@media (max-width: 860px) { .detail h1 { font-size: 20px; } .ring.ring-lg { width: 60px; height: 60px; } .ring.ring-lg b { font-size: 19px; } }
.upload-progress { margin: 4px 0 14px; }
.upload-progress .bar { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.upload-progress .bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 6px; transition: width .15s; }
