/* Stock Research — visual identity matched to 1000xStocks:
   white base, near-black ink, and their signature gold gradient
   (#B46A11 -> #D68D15 -> #E7AC18 -> #F8C73D) with amber accents. */
/* No text selection anywhere (Justin's ask, 2026-11-18: a long-press
 * on the price chart selected half the screen and popped the iOS
 * Copy/Look Up callout). Only fields the user types into stay
 * selectable/editable. */
* { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
:root {
  --gold-grad: linear-gradient(90deg, #B46A11 0.24%, #D68D15 33.21%, #E7AC18 67.67%, #F8C73D 98.67%);
  --gold: #F8C73D;
  --gold-mid: #E7AC18;
  --gold-deep: #B46A11;
  --amber: #F89E22;
  --amber2: #FFB800;
  --gold-soft: #FFD24D;
  --gold-pale: #FDEAA0;
  --cream: #FFF9E9;
  --ink: #141414;
  --ink2: #313131;
  --muted: #77705f;
  --line: rgb(110 92 25 / .18);
  --bg: #ffffff;
  --card: #ffffff;
  --elev: #ffffff;
  --good: #1e9e52;
  --bad: #d33a2c;
  --neon-up: #00c853;
  --neon-dn: #ff1744;
  --warn: #b46a11;
  --radius: 16px;
  --tabbar-h: 62px;
  --field: #ffffff;
  --topbar: rgba(255,255,255,.92);
  --shadow: rgba(180, 106, 17, .06);
  --row-line: rgb(110 92 25 / .10);
  --accent-text: #B46A11;
  --chip-bg: #FFF9E9;
  --chip-pass-bg: #effaf2; --chip-pass-line: #bfe6cd;
  --chip-fail-bg: #fdf1ef; --chip-fail-line: #f3d2cd;
  --alert-warn-bg: #fdf3e0; --alert-warn-ink: #6d4a08;
  --alert-ok-bg: #effaf2; --alert-ok-line: #bfe6cd; --alert-ok-ink: #14532d;
  --score-track: #f3ead2;
  --pill-far-bg: #f1ead6;
  --sw-text: #44403a;
  --sw-s-bg: #f0f7ea; --sw-w-bg: #fbf0ef; --sw-o-bg: #edf3fa; --sw-t-bg: #fdf6e3;
  --chart-line: #141414;
  --chart-actual: #141414; --chart-val: #141414;
  --val-l: 38%;
  --nav-bg: rgba(255,255,255,.68); --nav-active: rgba(20,20,20,.09); --nav-shadow: rgba(20,20,20,.18); --nav-edge: rgba(255,255,255,.65);
  /* Emil review 2026-10-30: strong custom easing curves (Kowalski's
   * standards) replace weak built-in ease/ease-in-out app-wide. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  /* Onboarding primary-button anchor (Justin's direction,
   * 2026-11-29): the primary button's bottom edge sits EXACTLY
   * this far above the viewport bottom on every onboarding screen
   * — the welcome page's GET STARTED and every quiz Next / Enter
   * the app — so the button never jumps as the flow advances.
   * Measured on the welcome page in the harness at 390x844 and
   * 402x874: GET STARTED's bottom edge renders 97.9px above the
   * viewport bottom at both sizes (safe-area inset excluded; each
   * overlay adds env(safe-area-inset-bottom) inside its own bottom
   * padding, so the match holds on device too). Both overlays
   * derive their bottom spacing from this ONE value — the welcome
   * page subtracts --gs-under-btn, the quiz subtracts its own
   * fixed pieces — so the positions can't drift apart. */
  --cta-bottom: 98px;
  /* Welcome only: the stack rendered under GET STARTED — actions
   * gap 6 + sign-in row 40 + beta margin-top 10 + beta text 31.9
   * (two lines at the reference widths) = 87.9 ≈ 88. .gs-inner's
   * bottom padding is the anchor minus this stack, which works out
   * to the page's original 10px: the welcome page does not move,
   * its button is on the anchor by construction. */
  --gs-under-btn: 88px;
}
:root[data-theme="dark"] {
  --ink: #f4efe3;
  --ink2: #cfc9b8;
  --muted: #a79f8c;
  --line: rgb(255 250 230 / .20);
  --bg: #000000;
  --card: #000000;
  --elev: #202023;
  --field: #1e1e20;
  --topbar: rgba(0,0,0,.92);
  --shadow: rgba(0,0,0,.45);
  --row-line: rgb(255 250 230 / .13);
  --accent-text: #f0b93e;
  --good: #2fbf6b;
  --bad: #ff6b57;
  --neon-up: #2bff88;
  --neon-dn: #ff3b5c;
  --warn: #e8b34b;
  --chip-bg: #1e1c16;
  --chip-pass-bg: #12271a; --chip-pass-line: #1f4630;
  --chip-fail-bg: #2c1714; --chip-fail-line: #57291f;
  --alert-warn-bg: #2b2110; --alert-warn-ink: #f0c268;
  --alert-ok-bg: #12271a; --alert-ok-line: #1f4630; --alert-ok-ink: #7fd79b;
  --score-track: #2a2a2c;
  --pill-far-bg: #26241f;
  --sw-text: #d8d2c2;
  --sw-s-bg: #152410; --sw-w-bg: #2a1512; --sw-o-bg: #101e2c; --sw-t-bg: #2a2110;
  --chart-line: #F8C73D;
  --chart-actual: #E9E2D0; --chart-val: #F2EDE3;
  --val-l: 62%;
  --nav-bg: rgba(28,28,31,.66); --nav-active: rgba(255,255,255,.13); --nav-shadow: rgba(0,0,0,.5); --nav-edge: rgba(255,255,255,.36);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  /* App shell: a full-height column -- header, a scrolling main, and the
   * tab bar as the last row. The page itself never scrolls (html/body are
   * locked); only <main> scrolls, between the static header and tab bar. */
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; height: var(--app-h, 100dvh);
}
h2, h3 { font-weight: 800; letter-spacing: -0.01em; }
.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- header ---------- */
/* Splash (markup in index.html): covers the first paint with the
 * brand mark, fades when the app is ready. */
#splash { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; transition: opacity .6s var(--ease-out); }
#splash.splash-done { opacity: 0; pointer-events: none; }
#splash.splash-done .splash-mark { transform: scale(1.07); }
.splash-mark { animation: splash-in .45s var(--ease-out); transition: transform .6s var(--ease-out); }
.splash-name { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: .38em; margin-right: -.38em; }
@keyframes splash-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.topbar {
  /* The status-bar zone + the gold line at its bottom edge. Fixed since
   * 2026-11-24 (Justin's ask): content now scrolls UNDER this
   * strip and blurs behind it (backdrop-filter), while the gold
   * line -- the strip's own border, not part of the backdrop --
   * stays crisp. Main carries matching top padding so at rest
   * the first content still sits below the line. */
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: calc(env(safe-area-inset-top) + 3px);
  /* Gold bar tried 2026-11-24 and reverted the next day at
   * Justin's word: back to the plain frosted strip with only
   * the 3px gold line at its bottom edge. */
  background: rgba(10, 10, 12, .55);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  /* Blur softened and the rest gap widened 2026-11-26 (Justin's
   * screenshot): with only 10px between the strip and the first
   * content, the 14px blur kept catching the gold Research button
   * and smearing it across the top of the page at rest. The blur
   * now lives further up -- smaller radius, and main's top padding
   * holds the first content 23px below the strip's bottom edge,
   * beyond the blur's reach. */
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 3px solid transparent; border-image: var(--gold-grad) 1;
}

/* ---------- layout ---------- */
main { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; width: 100%; max-width: 860px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 26px) 14px calc(88px + env(safe-area-inset-bottom)); }
.tab { display: none; }
.tab.active { display: block; }
.tab-title { font-size: 24px; margin: 6px 0 14px; text-transform: uppercase; letter-spacing: .02em; }
.card {
  /* 2026-11-18 redesign (Justin's ask): no boxes — sections sit on the
   * page separated by space and hairlines. Headings unchanged. */
  background: transparent; border: none; border-radius: 0;
  padding: 16px 0; margin: 0 0 10px; box-shadow: none;
}
.fineprint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 12px 0 0; overflow-wrap: anywhere; }
.status { font-size: 13px; color: var(--muted); min-height: 18px; margin: 8px 2px; font-weight: 600; }
.status.err { color: var(--bad); }
.empty-note { text-align: center; padding: 42px 18px; color: var(--muted); }
.empty-note h2 { color: var(--ink); margin: 0 0 8px; }
.empty-note p { max-width: 460px; margin: 0 auto; line-height: 1.55; font-size: 14px; }
.ex-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }

/* ---------- forms & buttons ---------- */
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--field);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold-mid); box-shadow: 0 0 0 3px rgba(248,199,61,.25); }
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink2); margin: 0 0 10px; }
label input, label textarea { margin-top: 5px; font-weight: 500; }
.btn-gold {
  background: var(--gold); color: #141414; border: none; cursor: pointer;
  font-weight: 900; letter-spacing: .03em; text-transform: uppercase; font-size: 14px;
  border-radius: 12px; padding: 12px 20px; box-shadow: none;
  /* Emil review 2026-10-30: press feedback gets his 160ms ease-out
   * transition instead of snapping in and out instantly. */
  transition: transform .16s var(--ease-out);
}
.btn-gold:active { transform: scale(.97); }
.btn-gold.wide { width: 100%; margin-top: 4px; }
.btn-ghost {
  background: var(--field); color: var(--accent-text); border: 1.5px solid var(--gold-mid);
  font-weight: 800; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px;
  transition: transform .15s ease-out;
}
.btn-ghost:active { transform: scale(.97); }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; font-size: 17px; font-weight: 700; text-transform: uppercase; }
.compare-inputs, .wl-inputs { display: flex; gap: 8px; flex-wrap: wrap; }
.compare-inputs input, .wl-inputs input { flex: 1 1 100px; text-transform: uppercase; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* Form explainers span the full row (Justin's ask, 2026-11-10: 'the
 * explanation can fill the screen left to right'). In the Projection
 * Builder the info text lives OUTSIDE its label as a direct grid
 * child: it takes a full-width row under its field's row, and dense
 * flow lets the remaining fields backfill their rows. Row gap is 0,
 * so a closed explainer (max-height 0) adds no space. */
.grid2:has(> .info-text) { grid-auto-flow: dense; }
.grid2 > .info-text { grid-column: 1 / -1; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-gap { display: flex; gap: 10px; align-items: center; }

/* ---------- scorecard ---------- */
.sc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sc-name { font-size: 22px; font-weight: 900; line-height: 1.15; }
.sc-sub { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.sc-about { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 8px; }
.sc-about.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-about-btn { background: none; border: none; color: var(--accent-text); font-size: 12.5px; font-weight: 800; padding: 4px 0 0; cursor: pointer; }
.sc-price { text-align: right; }
.sc-price .p { font-size: 26px; font-weight: 900; }
.sc-price .chg { font-size: 13.5px; font-weight: 800; }
.up { color: var(--good); } .down { color: var(--bad); }
.verdict {
  /* 2026-11-18 late: Justin asked for the verdict banner colors back
   * (the redesign's flat row lasted one evening) — original gradients
   * restored; the rest of the flat redesign stays. */
  margin: 14px 0; border-radius: 14px; padding: 14px 16px; color: #141414;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.verdict.undervalued { background: var(--gold-grad); }
.verdict.fair { background: linear-gradient(90deg, #f3d98b, #fdeaa0); }
.verdict.overpriced { background: linear-gradient(90deg, #2b2b2b, #141414); color: #f8c73d; }
.verdict .v-label { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.verdict .v-word { font-size: 24px; font-weight: 900; line-height: 1.05; }
.verdict .v-score { font-size: 30px; font-weight: 900; white-space: nowrap; }
.verdict .v-score small { font-size: 13px; font-weight: 700; opacity: .7; }
.score-bar { height: 10px; border-radius: 99px; background: var(--score-track); overflow: hidden; margin: 4px 0 14px; }
.score-bar > div { height: 100%; background: var(--gold-grad); border-radius: 99px; }
table.factors, table.cmp, table.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.factors td, table.factors th, table.cmp td, table.cmp th { padding: 7px 6px; border-bottom: 1px solid var(--row-line); text-align: left; vertical-align: top; }
table.factors th, table.cmp th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.num, th.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.factor-note { color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { }
.chip {
  border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--chip-bg); display: flex; justify-content: space-between; gap: 8px;
}
.chip.pass { border-color: var(--chip-pass-line); background: var(--chip-pass-bg); }
.chip.fail { border-color: var(--chip-fail-line); background: var(--chip-fail-bg); }
.chip .mark { font-weight: 900; }
.chip.pass .mark { color: var(--good); } .chip.fail .mark { color: var(--bad); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin-top: 6px; }
.kv-item .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.kv-item .v { font-size: 16px; font-weight: 800; margin-top: 1px; font-variant-numeric: tabular-nums; }
/* Info dots pinned to the same spot in every metric cell
 * (2026-11-07, Justin's ask): the dot used to sit inline after the
 * label text, so it landed wherever the label happened to end and
 * wrapped onto its own line for long labels. Now every dot lives
 * in the cell's top-right corner, and the label gets a reserved
 * lane so its text never runs underneath the dot. */
.kv-item { position: relative; }
.kv-item .info-dot { position: absolute; top: -2px; right: 0; margin-left: 0; }
.kv-item:has(.info-dot) .k { padding-right: 24px; }
/* The same alignment for every other section's info dots: factor
 * tables pin the dot to the top-right of the label cell (a clean
 * vertical rail down the table, label text gets a reserved lane),
 * and headings pin theirs to the section's right edge on the first
 * line, so the dots line up within each section instead of trailing
 * wherever the text happened to end. */
table.factors td:first-child { position: relative; }
table.factors td:first-child .info-dot { position: absolute; top: 7px; right: 2px; margin-left: 0; }
table.factors td:first-child:has(.info-dot) { padding-right: 28px; }
.fv-head, .section-h, .scan-h { position: relative; }
.fv-head .info-dot, .section-h .info-dot, .scan-h .info-dot { position: absolute; top: 1px; right: 0; margin-left: 0; }
.fv-head:has(.info-dot), .section-h:has(.info-dot), .scan-h:has(.info-dot) { padding-right: 24px; }
.section-h { font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px; }
.section-h .gold-text { letter-spacing: .05em; }
.alert {
  border-radius: 12px; padding: 11px 13px; font-size: 13.5px; font-weight: 600; line-height: 1.5; margin: 10px 0;
}
.alert.warn { background: var(--alert-warn-bg); border: 1.5px solid var(--amber2); color: var(--alert-warn-ink); }
.alert.ok { background: var(--alert-ok-bg); border: 1.5px solid var(--alert-ok-line); color: var(--alert-ok-ink); }
.chart-wrap { width: 100%; }
.px-range-h { display: flex; align-items: center; }
.px-range-wrap { position: relative; margin-left: auto; }
.px-range-btn { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--gold); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.px-range-chev { font-size: 10px; opacity: .8; }
.px-range-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 136px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.px-range-opt { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 12px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; border-radius: 9px; cursor: pointer; text-align: left; }
.px-range-opt.on { color: var(--gold); }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.nav-back { position: fixed; left: 14px; top: calc(10px + env(safe-area-inset-top)); z-index: 65; width: 40px; height: 40px; border-radius: 50%; background: var(--elev); border: 1.5px solid var(--line); color: var(--accent-text); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.35); cursor: pointer; padding: 0; }
.nav-back svg { width: 20px; height: 20px; display: block; }
.nav-back[hidden] { display: none; }
.qm-zoomer { overflow: hidden; touch-action: none; }
.qm-zoomer-in { transform-origin: 0 0; will-change: transform; }
.qm-zoomer-in.qm-zoom-anim { transition: transform .25s cubic-bezier(0.23, 1, 0.32, 1); }
/* Similar stocks tiles (2026-11-21): a Robinhood-style horizontal
 * row at the bottom of the scorecard -- name at the top, ticker and
 * Overall score at the bottom. */
.sim-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sim-row::-webkit-scrollbar { display: none; }
.sim-tile { flex: 0 0 126px; height: 148px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; background: var(--field); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; font: inherit; color: var(--ink); cursor: pointer; transition: transform .16s var(--ease-out); }
.sim-tile:active { transform: scale(.97); }
.sim-name { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sim-bot { display: flex; flex-direction: column; gap: 1px; }
.sim-tick { font-size: 15px; font-weight: 900; letter-spacing: .02em; }
.sim-score-line { display: flex; align-items: baseline; gap: 5px; }
.sim-score { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sim-score-wait { color: var(--muted); }
.sim-score-lab { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
/* Analyst-target bar + at-a-glance snowflake + scan NEW pill (2026-10-30) */
.fv-wrap { margin: 16px 0 2px; overflow-x: clip; }
.fv-head { font-size: 13.5px; font-weight: 800; color: var(--ink); margin-bottom: 2px; }
.earn-line { font-size: 13px; font-weight: 700; color: var(--ink2); margin: 2px 0 8px; }
.earn-line.today { color: var(--gold); }
.ceo-line b { color: var(--ink); }
.ceo-bio { font-size: 13px; color: var(--ink2); line-height: 1.45; margin: 0 0 8px; }
.ceo-perf { font-size: 13px; font-weight: 700; color: var(--ink2); margin: 0 0 8px; }
.ceo-prev { font-size: 13px; color: var(--ink2); line-height: 1.45; margin: 0 0 8px; }
.ceo-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; padding: 0; margin: 2px 0 8px; cursor: pointer; font: inherit; text-align: left; }
.ceo-toggle .ceo-line { margin: 0; }
.ceo-chev { color: var(--gold); font-size: 12px; flex: none; margin-left: 10px; transition: transform 160ms ease-out; }
.ceo-toggle[aria-expanded="true"] .ceo-chev { transform: rotate(180deg); }
/* Main-vs-sub dropdown hierarchy (2026-11-19): the scorecard's
 * "More" toggle PARENTS the Moat / Competitors / Market size
 * toggles nested in its body, so it alone gets the strong
 * treatment — bigger, heavier, gold, a full-size tap target and
 * a separator above it — while the subs keep the small muted
 * treatment and sit slightly indented, so the nesting reads at
 * a glance. One highlighted level only. */
.ceo-toggle.more-toggle { min-height: 48px; padding: 12px 2px; margin: 12px 0 2px; border-top: 1px solid var(--line); }
.ceo-toggle.more-toggle .ceo-line { font-size: 17px; font-weight: 800; color: var(--gold); letter-spacing: .01em; }
.ceo-toggle.more-toggle .ceo-chev { font-size: 17px; }
.more-body .ceo-toggle { padding-left: 10px; }
.more-body .ceo-body { margin-left: 10px; }
.ceo-meta { font-size: 13px; font-weight: 700; color: var(--ink2); margin: 0 0 8px; }
.ceo-body { margin-bottom: 2px; }
.more-sec + .more-sec { border-top: 1px solid var(--row-line); margin-top: 8px; padding-top: 8px; }
.biz-line { font-size: 14.5px; line-height: 1.45; color: var(--ink); margin: 2px 0 9px; }
/* Moat / Competitors / TAM dropdown bodies (2026-11-15) */
.moat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.moat-chip { font-size: 12px; font-weight: 700; color: var(--accent-text); background: var(--field); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.moat-verdict { font-size: 14px; margin: 8px 0 4px; }
.moat-line { font-size: 13.5px; line-height: 1.45; color: var(--ink); margin: 2px 0; }
.comp-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 2px; background: none; border: none; border-bottom: 1px solid var(--row-line); cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.comp-row:last-of-type { border-bottom: none; }
.comp-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-tick { color: var(--accent-text); font-weight: 700; }
.comp-nums { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.comp-chev { color: var(--accent-text); font-size: 18px; font-weight: 700; }
.tam-big { font-size: 21px; font-weight: 800; margin: 2px 0 2px; }
.tam-per { font-size: 13px; font-weight: 600; color: var(--muted); }
.tam-market { font-size: 14px; color: var(--ink); margin: 0 0 8px; }
/* Sign-in popup sheet (2026-11-15) */
.sheet-note { font-size: 14px; line-height: 1.5; color: var(--ink); margin: 0 0 14px; }
.sheet-btns { display: flex; gap: 8px; }
.sheet-btns .btn-gold { flex: 1; }
.sheet-btns .btn-ghost { flex: 1; }
.biz-row { margin: 7px 0; }
.biz-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 3px; }
.biz-mgn { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.biz-bar { height: 5px; border-radius: 3px; background: var(--field); overflow: hidden; }
.biz-bar > div { height: 100%; border-radius: 3px; background: linear-gradient(90deg in oklch, #d9a92c, var(--gold)); }
.fv-labs { position: relative; height: 17px; }
.fv-lab { position: absolute; bottom: 1px; transform: translateX(-50%); font-size: 11px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.fv-labs:last-child .fv-lab { bottom: auto; top: 2px; }
.fv-lab.l { transform: none; }
.fv-lab.r { transform: translateX(-100%); }
.fv-lab.now { color: var(--ink); }
.fv-lab.tgt { color: var(--gold); }
.fv-track { position: relative; height: 8px; border-radius: 999px; background: var(--score-track); }
.fv-gap { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--gold-grad); opacity: .55; }
.fv-gap.dn { background: var(--bad); opacity: .65; }
.fv-dot { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); }
.fv-dot.price { background: #fff; border: 2.5px solid var(--ink2); z-index: 2; }
.fv-dot.target { background: var(--gold); border: 2.5px solid var(--gold-deep); z-index: 1; }
.radar-flex { display: flex; align-items: center; gap: 16px; }
.radar-flex > svg { flex: 0 0 auto; }
.radar-svg { animation: radar-in .24s var(--ease-out); transform-origin: center; }
@keyframes radar-in { from { opacity: 0; transform: scale(.96); } }
.radar-grid { fill: none; stroke: var(--score-track); stroke-width: 1; }
.radar-poly { fill: rgba(248, 199, 61, .26); stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--gold); }
.radar-dot.cliff { fill: var(--bad); }
.radar-leg { flex: 1; min-width: 0; }
.radar-leg-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3.5px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.radar-leg-row:last-child { border-bottom: 0; }
.radar-leg-name { color: var(--ink2); font-weight: 700; }
.radar-leg-num { font-weight: 900; font-variant-numeric: tabular-nums; }
.radar-cliff-tag { color: var(--bad); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.radar-flex.mini .radar-leg-row { font-size: 12px; padding: 2.5px 0; }
.scan-row .scan-new { background: var(--gold-grad); color: #141414; font-size: 9px; font-weight: 900; letter-spacing: .06em; padding: 1.5px 6px; border-radius: 999px; vertical-align: 2px; white-space: nowrap; }
.scan-cyc { background: rgba(248,199,61,.16); color: #F8C73D; font-size: 9px; font-weight: 900; letter-spacing: .06em; padding: 1.5px 6px; border-radius: 999px; vertical-align: 2px; white-space: nowrap; }
.scan-cyc.partial { background: rgba(160,160,160,.14); color: var(--ink3, #9a958a); }
/* Estimated-return strip at the top of the scorecard and the
   watchlist overview (2026-11-13 evening): the projected 4-yr CAGR
   lives here, big and readable, instead of as a cramped tag on the
   daily scan rows. */
.sc-proj { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 0; background: none; border: none; border-top: 1px solid var(--row-line); border-radius: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none; }
.sc-overall { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 0; padding: 12px 0; background: none; border: none; border-top: 1px solid var(--row-line); border-radius: 0; }
.sc-overall-v { font-size: 26px; font-weight: 800; line-height: 1; }
.sc-proj-r { display: flex; align-items: center; gap: 3px; }
.sc-proj-chev { color: var(--muted); font-size: 22px; font-weight: 700; line-height: 1; }
.sc-proj-l { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sc-proj-l b { font-size: 13.5px; font-weight: 900; color: var(--ink); }
.sc-proj-l span { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sc-proj-v { font-size: 20px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-proj-v.sc-proj-wait { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.wl-proj.stale { opacity: .5; }
.sc-proj-v.sc-proj-stale { opacity: .55; }
/* Custom screener panel (2026-10-30) */
.scr-saved { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.scr-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--chip-bg); border-radius: 999px; overflow: hidden; }
.scr-chip-load { background: none; border: 0; color: inherit; font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 3px 5px 11px; cursor: pointer; }
.scr-controls { padding: 12px 14px 6px; margin-bottom: 6px; }
.scr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 3px 0; font-size: 13.5px; }
.scr-row > span { flex: 1; }
.scr-row input, .scr-row select { width: 118px; flex: 0 0 118px; padding: 7px 10px; border-radius: 10px; text-align: right; }
.scr-row select { text-align: left; }
.scr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; }
.scr-actions .btn-gold { flex: 1; }
.src-line { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.sc-actions { margin-top: 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 2px 16px; }
.sc-act { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 0; background: none; border: none; border-bottom: 1px solid var(--row-line); font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.sc-act:last-child { border-bottom: none; }
.sc-act:active { opacity: .5; }
.sc-act-arrow { color: var(--accent-text); font-size: 21px; font-weight: 700; line-height: 1; flex: none; }
.sc-ext .sc-act-arrow { font-size: 16px; }
.sc-actions-flat { background: none; border: none; border-top: 1px solid var(--row-line); border-radius: 0; padding: 2px 0; margin-top: 10px; }

/* ---------- compare ---------- */
table.cmp td.best { font-weight: 900; }
table.cmp .star { color: var(--accent-text); }
table.cmp td.rowh { font-weight: 800; color: var(--ink2); }

/* ---------- tools ---------- */
.tool-result { margin-top: 14px; }
.tool-big { font-size: 20px; font-weight: 900; overflow-wrap: anywhere; }
table.scen td { padding: 8px 6px; }
/* Scenario results: the old auto layout, untouched at normal sizes;
 * the font steps down a tier when a big-money stock's values get long,
 * so nothing ever runs off the right edge (SNDK-sized numbers,
 * 2026-11-01). */
table.factors.scen.tight { font-size: 11.5px; }
table.factors.scen.tight td, table.factors.scen.tight th { padding: 7px 4px; }
table.factors.scen.micro { font-size: 10.5px; }
table.factors.scen.micro td, table.factors.scen.micro th { padding: 7px 3px; }
.pj-math-toggle { background: none; border: 0; color: var(--gold); font: inherit; font-size: 13px; font-weight: 700; padding: 8px 0 2px; cursor: pointer; }
.pj-math-chev { display: inline-block; transition: transform 160ms ease-out; }
.pj-math-toggle[aria-expanded="true"] .pj-math-chev { transform: rotate(180deg); }
.pj-math { display: none; }
.pj-math.open { display: block; }
.pj-math p { margin: 6px 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.pj-math strong { color: var(--ink); }

/* ---------- watchlist / journal ---------- */
.wl-row, .j-row {
  /* 2026-11-18 redesign: hairline rows instead of boxed cards. */
  background: transparent; border: none; border-bottom: 1px solid var(--row-line); border-radius: 0;
  padding: 13px 0; margin: 0; box-shadow: none;
}
.wl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wl-t { font-size: 18px; font-weight: 900; }
.wl-meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wl-price { font-size: 18px; font-weight: 900; text-align: right; }
.pill { display: inline-block; padding: 2.5px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; }
.pill.hit { background: var(--gold-grad); color: #141414; }
.pill.near { background: var(--gold-pale); color: var(--gold-deep); }
.pill.far { background: var(--pill-far-bg); color: var(--muted); }
.j-row h4 { margin: 0 0 4px; font-size: 16px; }
.j-row .j-meta { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.j-row p { margin: 4px 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.j-row .j-lab { font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.link-btn { background: none; border: none; color: var(--accent-text); font-weight: 800; cursor: pointer; padding: 4px 2px; font-size: 13px; }
.link-btn.danger { color: var(--bad); }

/* ---------- glossary ---------- */
#gloss-search { margin-bottom: 12px; }
.g-item { border-bottom: 1px solid var(--row-line); padding: 11px 2px; }
.g-item .g-term { font-weight: 900; font-size: 15px; }
.g-item .g-def { font-size: 13.5px; color: var(--ink2); line-height: 1.55; margin-top: 3px; }
.g-link { background: none; border: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; gap: 2px;
  margin: 0;
  padding: 6px;
  /* Liquid Glass material (Justin's ask, 2026-11-26): translucent
   * fill, the page blurs and saturates behind the bar, and a
   * specular edge -- a bright hairline along the top inside --
   * over the drop shadow. The sliding lens below keeps its own
   * lighter fill and edge so it reads as glass on glass. */
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: url(#lg-refract) blur(3px) saturate(1.8);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 10px 28px var(--nav-shadow), inset 0 1px 0 var(--nav-edge), inset 0 -1px 0 rgba(0,0,0,.06);
  transition: padding .28s var(--ease-out), transform .28s var(--ease-out);
}
.tabbar button {
  flex: 1; background: none; border: none; color: var(--muted); cursor: pointer;
  height: 46px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s var(--ease-out), color .18s var(--ease-out), height .28s var(--ease-out);
}
.tabbar button .tab-ico { line-height: 1; display: flex; }
.tabbar button .tab-ico .ico { width: 24px; height: 24px; transition: width .28s var(--ease-out), height .28s var(--ease-out); }
.tabbar button.active { background: var(--nav-active); color: var(--gold); }
/* Sliding selection pill (Justin's ask, 2026-11-19, modelled on
 * the iOS App Store's Liquid Glass bar): one raised lens that
 * physically slides to the active tab instead of the highlight
 * fading in place. Positioned by placeTabPill() in app.js. The
 * transition only exists once .pill-on lands (first placement
 * snaps), and while the pill is live the buttons' own active
 * background steps aside so the lens is the highlight. */
.tab-pill { position: absolute; left: 0; top: 7px; height: 46px; border-radius: 999px; background: var(--nav-active); box-shadow: 0 2px 10px var(--nav-shadow), inset 0 0 0 1px var(--line), inset 0 1px 0 var(--nav-edge); pointer-events: none; opacity: 0; }
.tabbar.mini .tab-pill { top: 5px; height: 36px; }
.tabbar.pill-on .tab-pill { opacity: 1; transition: transform .34s cubic-bezier(.30, 1.15, .36, 1), width .34s cubic-bezier(.30, 1.15, .36, 1), height .28s var(--ease-out), top .28s var(--ease-out), opacity .2s ease; }
.tabbar.pill-on button { position: relative; z-index: 1; }
.tabbar.pill-on button.active { background: transparent; }

/* Projection Builder: year-by-year EPS path editor */
.pj-path-head { font-size: 12.5px; font-weight: 700; color: var(--ink2); margin: 2px 0 8px; }
.pj-path-head span { font-weight: 500; }
.pj-yrow { display: grid; grid-template-columns: 78px 1fr 1fr; gap: 8px; align-items: end; margin-bottom: 6px; }
.pj-yrow .pj-ylab { font-size: 13.5px; font-weight: 800; color: var(--ink); padding-bottom: 11px; white-space: nowrap; }
.pj-yrow label { margin: 0; }

/* SWOT grid (auto-generated from scorecard numbers) */
.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.swot-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.swot-box h5 { margin: 0 0 6px; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.swot-box ul { margin: 0; padding-left: 16px; }
.swot-box li { font-size: 12.5px; line-height: 1.45; margin: 3px 0; color: var(--sw-text); }
.swot-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; }
.sw-s { background: var(--sw-s-bg); } .sw-s .swot-badge { background: #5b8a3c; }
.sw-w { background: var(--sw-w-bg); } .sw-w .swot-badge { background: #b04a44; }
.sw-o { background: var(--sw-o-bg); } .sw-o .swot-badge { background: #3d6a99; }
.sw-t { background: var(--sw-t-bg); } .sw-t .swot-badge { background: #a97e14; }
@media (max-width: 640px) { .swot-grid { grid-template-columns: 1fr; } }

/* ---------- settings (gear + dropdown) ---------- */
/* Settings live in the Profile (portfolio) tab now, behind the
 * hamburger at its top (Justin, 2026-10-29): the old dropdown menu
 * becomes a full-width inline card when it opens there. */
.pf-head { display: flex; align-items: center; justify-content: space-between; }
/* Settings is its own page now (Justin's ask, 2026-11-18): the menu
 * block lives in #tab-settings and renders flat, full-width. */
#tab-settings .settings-menu { position: static; width: auto; max-height: none; overflow: visible; box-shadow: none; margin: 0; background: transparent; border: none; border-radius: 0; padding: 0; }
/* While the floating back arrow is up, the page makes room for it:
 * main gains top clearance so the first row (search field, Tools seg
 * bar, a page title) never starts underneath the arrow (Justin's WDH
 * screenshot, 2026-11-18: the arrow covered the W of the ticker in
 * the search box). The arrow is 40px at top:10px + safe-area, and
 * main's own top padding is 10px — 56px total puts the first row
 * just below the arrow's bottom edge. Applies on every tab at once,
 * and lifts the moment the arrow goes away, so scroll positions
 * captured without the arrow still restore exactly. */
/* The back button's bottom edge sits at safe-area + 50px (top
 * safe-area + 10, height 40), so with the button armed the page
 * must start below it: at rest the button never covers the top
 * of the page (Justin's rule, 2026-11-26). Once the page scrolls,
 * the floating button may overlap content as it passes. The old
 * flat 56px was less than a modern safe-area + 13, so titles
 * actually slid UP under the button. */
body.nav-back-on main { padding-top: calc(env(safe-area-inset-top) + 68px); }
.gear-btn {
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; line-height: 1;
  border: 1.5px solid var(--line); background: var(--field); color: var(--ink); font-size: 19px;
}
.gear-btn:active { transform: translateY(1px); }
.settings-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: min(340px, 88vw); max-height: 72vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.30); padding: 14px; text-align: left;
}
.set-h { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 8px; }
.set-h:first-child { margin-top: 0; }
.seg { display: flex; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; border: none; background: none; color: var(--muted); cursor: pointer;
  font-weight: 800; font-size: 13.5px; padding: 8px 0; border-radius: 9px;
}
.seg button.active { background: var(--gold-grad); color: #141414; }
.seg button[disabled] { opacity: .38; pointer-events: none; }
#backup-text { width: 100%; box-sizing: border-box; margin-top: 8px; font-size: 12px; }
.settings-menu .status { margin: 6px 0 0; min-height: 0; }
.settings-menu .status:empty { display: none; }

/* ---------- watchlist tools & quiet buttons ---------- */
.btn-mini {
  background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 700; border-radius: 8px; padding: 4px 9px; white-space: nowrap;
}
.btn-mini:active { transform: translateY(1px); }
#qm-gline.active, #qm-pair.active, #qm-mline.active { background: var(--gold-grad); border-color: transparent; color: #141414; }
#qm-gline:disabled { opacity: .38; cursor: default; }
.qm-avg { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.qm-avg b { color: var(--gold); font-size: 14px; }
.wl-tools { margin: 0 0 10px; flex-wrap: wrap; gap: 6px 10px; }
.wl-tools .status { margin: 0; flex: 1 1 110px; min-width: 0; }
.wl-tools-r { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.wl-sort-lab { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); }
.wl-sort-lab select { width: auto; max-width: 44vw; padding: 5px 8px; font-size: 12.5px; font-weight: 700; border-radius: 9px; text-overflow: ellipsis; }
.wl-actions { text-align: right; margin-top: 3px; }
.wl-actions .link-btn { font-size: 11.5px; font-weight: 700; padding: 2px 3px; color: var(--muted); }
.wl-actions .link-btn.danger { color: var(--bad); opacity: .8; }
.wl-val b { color: var(--ink2); font-weight: 900; }

/* ---------- ticker autocomplete ---------- */
.ac-list {
  position: fixed; z-index: 80; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.30); overflow-y: auto; max-height: 302px;
}
.ac-item {
  display: flex; flex-direction: column; align-items: stretch; gap: 1px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--row-line);
  padding: 9px 12px; cursor: pointer; color: var(--ink); font: inherit;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:active { background: var(--chip-bg); }
.ac-top { display: flex; align-items: baseline; gap: 10px; width: 100%; }
.ac-sym { font-weight: 900; font-size: 14.5px; }
.ac-exch { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.ac-name { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.35; white-space: normal; }

/* Watchlist rows: locked two-column layout — the price column can never
   wrap under the ticker column (long valuation lines truncate instead). */
.wl-row { flex-wrap: nowrap; }
.wl-left { flex: 1 1 auto; min-width: 0; }
.wl-right { flex: 0 1 auto; min-width: 0; max-width: 64%; text-align: right; }
.wl-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-actions { white-space: normal; }
.wl-price { font-variant-numeric: tabular-nums; }

/* ---------- portfolio ---------- */
.pf-sum-v { font-size: 30px; font-weight: 900; letter-spacing: -.01em; line-height: 1.1; }
.pf-sum-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 13.5px; font-weight: 600; }

/* ---------- portfolio donut + holdings (Blossom-style) ---------- */
.pf-donut { position: relative; width: 100%; max-width: 440px; margin: 16px auto 4px; aspect-ratio: 1 / 1; }
.pf-donut svg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80%; height: 80%; display: block; }
.pf-pill { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 6px; background: var(--chip-bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12.5px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.pf-pill-dot { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #141414; font-size: 11px; font-weight: 900; }
.pf-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 2px; box-sizing: border-box; }
.pf-c-v { font-size: 21px; font-weight: 900; fill: var(--ink); }
.pf-c-l { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; fill: var(--muted); }
.pf-avatar { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #141414; font-size: 16px; font-weight: 900; flex: 0 0 auto; }
.pf-avatar .pf-logo { padding: 4px; }
/* ---------- company logo tiles (scorecard, watchlist, scan, overview, compare) ---------- */
.logo-tile { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px; background: #fff; color: #141414; font-size: 16px; font-weight: 900; flex: 0 0 auto; }
.logo-tile .pf-logo { padding: 4px; }
.logo-txt { letter-spacing: -.02em; line-height: 1; }
.logo-tile.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.logo-tile.lg { width: 48px; height: 48px; border-radius: 13px; font-size: 19px; }
.sc-head-l { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
#wl-list .wl-row { justify-content: flex-start; }
#wl-list .wl-right { margin-left: auto; }
.cmp-th { display: inline-flex; align-items: center; gap: 7px; }
.pf-name { display: block; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.pf-alloc { font-size: 15px; font-weight: 800; text-align: right; flex: 0 0 auto; min-width: 50px; }
.pf-valpill { display: inline-block; background: none; border: none; border-radius: 0; padding: 0; font-weight: 900; font-size: 15px; }

/* ---------- portfolio rows (collapsible) ---------- */
.pf-row { flex-direction: column; align-items: stretch; }
.pf-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; }
.pf-head .wl-left { flex: 1 1 0%; min-width: 0; overflow: hidden; }
.pf-head .wl-right { margin-left: auto; flex: 0 0 auto; max-width: none; }
.pf-head .wl-price, .pf-head .wl-meta { display: block; }
.pf-chev { color: var(--muted); font-size: 13px; flex: 0 0 auto; transition: transform .15s var(--ease-out); }
.pf-row.open .pf-chev { transform: rotate(180deg); }
.pf-detail { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pf-kv { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13.5px; }
.pf-kv > span { color: var(--muted); font-weight: 600; }
.pf-kv > b { font-weight: 800; text-align: right; }
.pf-detail .wl-actions { justify-content: flex-end; margin-top: 8px; }

.pf-donut circle[data-slice] { cursor: pointer; transition: opacity .15s ease; }
.pf-pop { margin-top: 10px; text-align: center; background: var(--chip-bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.pf-pop b { display: block; font-size: 15.5px; font-weight: 900; }
.pf-pop span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.pf-add-card { border-top: 1px solid var(--row-line); border-bottom: 1px solid var(--row-line); padding: 14px 0; }
.pf-add-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: none; border: none; color: inherit; font: inherit; font-size: 16.5px; font-weight: 900; text-align: left; padding: 0; cursor: pointer; }
.pf-add-card.open .pf-chev { transform: rotate(180deg); }
#pf-add-body { margin-top: 12px; }

/* ---------- portfolio vs S&P 500 ---------- */
.pf-bench-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pf-bench-title { font-size: 16.5px; font-weight: 900; }
.pf-bench-legend { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; gap: 12px; }
.pf-bench-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.pf-bench-seg { margin: 10px 0 6px; }
.pf-bench-chart { width: 100%; height: auto; display: block; }
.pf-bench-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; font-weight: 700; margin-top: 8px; }/* ---------- purchases + Other dropdown ---------- */

.pf-buy-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; padding: 2px 0; }
.pf-pop.clickable { cursor: pointer; }
.pf-pop-hint { display: block; margin-top: 5px; font-size: 11.5px; color: var(--gold); font-weight: 800; letter-spacing: .03em; }
.pf-pop-list { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 7px; text-align: left; }
.pf-pop-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.pf-pop-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.pf-pop-row-n { color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-pop-row > span:last-child { margin-left: auto; white-space: nowrap; }

/* ---------- vector icons (stroke style, inherit text color) ---------- */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; flex: 0 0 auto; }
.tab-ico .ico { width: 23px; height: 23px; vertical-align: 0; }
.gear-btn .ico { width: 21px; height: 21px; vertical-align: 0; }
.btn-gold .ico, .btn-ghost .ico, .seg .ico { margin-right: 2px; }
.ico-sm { width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }
.chip .mark .ico-sm { margin-right: 0; vertical-align: -3px; }
.chip .mark .ico-sm + span { margin-left: 4px; }
.ico-fill { fill: currentColor; stroke: none; }
.ico-xs { width: 11px; height: 11px; vertical-align: -1px; margin-right: 0; }

.ico { stroke-width: 2.1; }
.ico-f { fill: currentColor; stroke: none; }
.pf-buy-txt { display: flex; gap: 10px; align-items: baseline; background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.pf-buy-txt span:first-child { color: var(--gold); font-weight: 800; }
.pj-save-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pf-bench-read { font-size: 12.5px; color: var(--muted); min-height: 18px; margin: 4px 0 0;  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-bench-read .pf-read-date { color: var(--text); }
.pf-pop-list[hidden] { display: none; }
.scan-card { margin-bottom: 12px; }
.scan-h { font-size: 17px; font-weight: 900; letter-spacing: .01em; margin-bottom: 6px; }
.scan-date { color: var(--muted); font-size: 12px; font-weight: 700; margin-left: 6px; }
.scan-group { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin: 10px 0 4px; }
.scan-count { color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 700; }
.scan-ixname { cursor: pointer; -webkit-tap-highlight-color: transparent; }
#ix-pop { position: fixed; z-index: 120; display: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.38); padding: 10px 12px; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--ink); }
#ix-pop .ix-pop-caret { position: absolute; top: -5.5px; width: 10px; height: 10px; background: var(--card); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.scan-row { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 2px; color: inherit; text-align: left; cursor: pointer; }
.scan-row:last-of-type { border-bottom: 0; }
.scan-rank { color: var(--muted); font-weight: 900; width: 16px; text-align: center; }
.scan-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.scan-id b { font-size: 15px; font-weight: 900; }
.scan-id span { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Ticker line carries the pills (Justin's call, 2026-11-13 evening):
   NEW and Cyclical sit next to the ticker, and the name line below
   is name-only, so every thumbnail is exactly two lines tall no
   matter which pills a stock carries. Pills stay flex:none (the
   2026-11-01 rule: never drop or clip them). */
.scan-id .scan-tline { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: visible; flex-wrap: nowrap; }
/* Ticker-line pills run a touch smaller and the Cyclical pill drops
   its warning glyph (scan rows only) so a NEW + Cyclical pair fits
   beside the ticker without reaching the price column. */
.scan-tline .scan-new, .scan-tline .scan-cyc { font-size: 8.5px; padding: 1px 5px; letter-spacing: .03em; }
.scan-id .scan-sub { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: visible; flex-wrap: nowrap; }
/* CAGR gets its own third line in every scan thumbnail (Justin's
   call, 2026-11-13 evening, reversing the strip-only move an hour
   earlier): rows without an estimate show "CAGR —" so all
   thumbnails stay the same three-line height. */
.scan-id .scan-cagr-line { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 1px; line-height: 15px; }
.scan-id .scan-nm { min-width: 0; }
.scan-row .scan-new, .scan-row .scan-cyc { flex: none; }
.scan-px { font-weight: 800; font-size: 13px; }
.scan-score { font-size: 15px; font-weight: 900; border: none; background: none; border-radius: 0; padding: 0; white-space: nowrap; }
.scan-bar { height: 6px; border-radius: 3px; background: var(--chip-bg); overflow: hidden; margin-top: 8px; }
.scan-bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width .3s; }
#tab-portfolio.news-mode .pf-ov { display: none; }
.pf-view-switch { display: flex; gap: 4px; background: var(--chip-bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.pf-view-switch button { flex: 1; border: 0; background: none; color: var(--muted); font-weight: 900; font-size: 14px; padding: 8px 0; border-radius: 999px; cursor: pointer; }
.pf-view-switch button.on { background: var(--gold-grad); color: #191204; }
.news-card { padding: 6px 0; }
.news-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.news-row:last-child { border-bottom: 0; }
.news-ava { flex: 0 0 auto; margin-top: 1px; width: 30px; height: 30px; font-size: 12px; }
.news-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.news-main b { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.news-main span { color: var(--muted); font-size: 12px; font-weight: 700; }
.verdict.risk-low { background: linear-gradient(90deg, #a8d8b9, #d7f0de); }
.verdict.risk-mod { background: linear-gradient(90deg, #f3d98b, #fdeaa0); }
.verdict.risk-elev { background: linear-gradient(90deg, #f5b971, #f8cf8f); }
.verdict.risk-high { background: linear-gradient(90deg, #2b2b2b, #141414); color: #ff8a75; }
/* Risk-bar fill color is set inline from the score scale
 * (scoreBarBg in app.js), flipped so low risk renders green. */
.pj-saved-head { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; padding: 6px 0; font: inherit; font-size: 13.5px; font-weight: 800; color: var(--ink); cursor: pointer; text-align: left; }
.pj-saved-chev { color: var(--gold); font-size: 13px; }
.qm-picker-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--field); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; margin: 2px 0 8px; }
.qm-picker-btn .qm-chev { color: var(--gold); transition: transform 160ms ease-out; }
.qm-picker-btn[aria-expanded="true"] .qm-chev { transform: rotate(180deg); }
.qm-picker-list { border: 1px solid var(--line); border-radius: 12px; padding: 6px; margin: 0 0 12px; }
.qm-group { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
/* Chart grid: the Charts tool's home view — every metric as a small
 * multiples card, tap to open the full chart. */
/* Chart popup: tapping a grid card opens the full chart in an
 * almost-full-screen sheet over the grid (2026-11-05, Justin's ask)
 * instead of swapping the page under his scroll position. */
#qm-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.62); overscroll-behavior: contain; }
/* Bottom padding mirrors <main>'s nav clearance (88px + safe area):
 * the floating pill nav floats over this sheet too, and with only a
 * small pad the last content (the chart note) could never scroll out
 * from under it (Justin's report, 2026-11-09). */
#qm-detail { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 10px calc(88px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; animation: dlg-in .25s var(--ease-drawer); }
.qm-sheet-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#holders-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.62); overscroll-behavior: contain; }
#tx-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.62); overscroll-behavior: contain; }
/* Pro (2026-11-26): the entitlement sheet sits above every other
 * sheet (opened from locks inside the transcript reader too), and
 * the lock + summary blocks live in the scorecard / reader. */
#pro-overlay { position: fixed; inset: 0; z-index: 260; background: rgba(0,0,0,.62); overscroll-behavior: contain; }
#pro-sheet { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; animation: dlg-in .25s var(--ease-drawer); }
.pro-sheet-kicker { font-size: 17px; font-weight: 900; letter-spacing: .02em; color: var(--accent-text); }
.pro-pill { background: var(--gold); color: #141414; font-size: 10px; font-weight: 900; letter-spacing: .07em; padding: 3px 7px; border-radius: 999px; flex: none; }
.pro-lock-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pro-lock-title { font-weight: 800; font-size: 15px; }
.pro-lock .btn-ghost { margin-top: 8px; }
.more-lock { margin-top: 12px; }
.more-lock .btn-ghost { margin-top: 8px; }
.pro-inc { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 16px; }
.pro-inc-t { font-weight: 800; font-size: 15px; margin-bottom: 2px; }
.tx-sum { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; background: var(--elev); }
.tx-sum-h { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.tx-sum-head { font-size: 16px; font-weight: 800; margin: 4px 0 6px; }
.tx-sum-sec { font-size: 12.5px; font-weight: 800; margin-top: 9px; }
.tx-sum-list { margin: 4px 0 0; padding-left: 18px; }
.tx-sum-list li { margin: 3px 0; line-height: 1.45; }
.tx-sum-lock { display: flex; align-items: center; gap: 8px; border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; }
.tx-sum-lock-t { font-weight: 800; font-size: 14.5px; }
.tx-sum-lock .btn-ghost { margin-left: auto; flex: none; }
.fil-sum-h { display: flex; align-items: center; gap: 8px; }
.fil-sum-h .fil-listen, .fil-sum-h .tx-listen { margin-left: auto; flex: none; }
.fil-sum-meta { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
#tx-sheet { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; animation: dlg-in .25s var(--ease-drawer); }
/* Back-to-top triangle in the transcript reader: a gold up-triangle
 * on a dark round button, floating over the sheet's bottom-right
 * corner; app.js shows it once the reader scrolls in. */
#tx-top { position: absolute; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); width: 44px; height: 44px; border-radius: 50%; background: rgba(18,18,18,.86); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; z-index: 5; cursor: pointer; padding: 0; }
#tx-top svg path { fill: var(--gold); }
#tx-top[hidden] { display: none; }
.tx-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.tx-open { width: 100%; }
.tx-turn { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tx-sum-link { background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer; }
.tx-hl { background: rgba(248, 199, 61, .32); border-radius: 4px; padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.tx-turn:last-of-type { border-bottom: none; }
.tx-spk { font-weight: 800; font-size: 13.5px; margin-bottom: 3px; }
.tx-turn p { margin: 0; font-size: 14.5px; line-height: 1.55; }
#holders-sheet { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; animation: dlg-in .25s var(--ease-drawer); }
#stmt-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.62); overscroll-behavior: contain; }
#stmt-sheet { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; animation: dlg-in .25s var(--ease-drawer); }
.stmt-seg { display: flex; gap: 6px; margin: 12px 0 8px; }
.stmt-seg button { flex: 1; padding: 8px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.stmt-seg button.on { background: var(--gold); border-color: var(--gold); color: #141414; }
.stmt-per { margin-top: 0; }
.stmt-per button { flex: 0 0 auto; padding: 5px 14px; font-size: 12px; }
.stmt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 2px; }
.stmt-table { border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; min-width: 100%; }
.stmt-table th, .stmt-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.stmt-table th:first-child, .stmt-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg); font-weight: 600; z-index: 1; max-width: 168px; white-space: normal; }
.stmt-table td:not(:first-child), .stmt-table th:not(:first-child) { min-width: 84px; }
.stmt-table thead th { color: var(--muted); font-size: 12px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.stmt-table thead th:first-child { z-index: 3; }
.stmt-table tr.stmt-total td { font-weight: 800; }
.stmt-table tr.stmt-dates td { color: var(--muted); font-size: 11.5px; }
.stmt-ext { font-size: 13px; margin: 12px 0 4px; }
.stmt-ext a { color: var(--accent-text); font-weight: 700; text-decoration: none; }
.hld-title { font-size: 22px; font-weight: 800; }
.hld-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hld-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.hld-chip { background: var(--field); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.hld-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.hld-name { font-weight: 700; font-size: 15px; min-width: 0; }
.hld-date { color: var(--muted); font-size: 12px; margin-top: 2px; }
.hld-shares { color: var(--muted); font-size: 12px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.hld-right { text-align: right; flex: 0 0 auto; }
.hld-pct { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.hld-chg { font-size: 12px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hld-chg.mut { color: var(--muted); }
.qm-x { background: var(--field); border: 1.5px solid var(--line); color: var(--ink); width: 38px; height: 38px; border-radius: 50%; font-size: 15px; font-weight: 800; cursor: pointer; flex: 0 0 auto; }
/* The real scroll lock for open sheets: <main> is the app's only
   scroller, so this is what stops the tab behind a sheet. */
main.scroll-lock { overflow-y: hidden; }
#qm-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.qm-grid-group { grid-column: 1 / -1; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 2px 0; }
.qm-card { background: var(--field); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 12px 8px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); box-sizing: border-box; min-width: 0; }
.qm-card.wide { grid-column: 1 / -1; }
.qm-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.qm-card-name { font-size: 14px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-card-val { font-size: 17px; font-weight: 800; white-space: nowrap; }
.qm-card svg { width: 100%; max-width: 100%; height: auto; display: block; }
.qm-grid-group { min-width: 0; }
.qm-legend { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.qm-flow-take { margin-top: 12px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--field); font-size: 14.5px; line-height: 1.5; font-weight: 600; color: var(--ink); }
.qm-leg-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.qm-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.qm-leg-name { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-leg-val { color: var(--muted); margin-left: auto; font-weight: 700; white-space: nowrap; }
.qm-opt { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; color: var(--ink); padding: 10px; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; border-radius: 8px; text-align: left; }
.qm-opt.on { color: var(--gold); }
.qm-opt.on::after { content: '\2713'; font-weight: 800; }/* Factor tables: fixed layout so the points column never wraps mid-number ("25 / 25" splitting across lines) — Justin flagged the right column 2026-10-26. */
/* Horizontal-scroll wrapper for genuinely wide tables (Compare). */

table.factors:not(.scen) { table-layout: fixed; }
table.factors:not(.scen) th:nth-child(2), table.factors:not(.scen) td:nth-child(2) { width: 100px; }
table.factors:not(.scen) th.num, table.factors:not(.scen) td.num { width: 78px; white-space: nowrap; }

/* Share-amount sheet (purchases/sales) */
.pf-sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.pf-sheet-bg[hidden] { display: none; }
.pf-sheet { background: var(--elev); border: 1.5px solid var(--line); border-bottom: none; border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); width: 100%; max-width: 480px; animation: sheet-in .28s var(--ease-drawer); }
.pf-sheet h4 { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.pf-sheet-row { display: flex; gap: 8px; align-items: stretch; }
.pf-sheet input { flex: 1; min-width: 0; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 17px; font-weight: 700; padding: 11px 12px; }
.pf-sh-save { background: var(--gold-grad); color: #141414; border: none; border-radius: 12px; font-size: 15px; font-weight: 800; padding: 11px 12px; cursor: pointer; }
.ap-body { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
/* Smart install prompt sheet (srInstallPrompt in app.js). */
.ip-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.ip-icon { width: 54px; height: 54px; border-radius: 14px; flex: 0 0 auto; }
.ip-benefit { margin-top: 3px; color: var(--muted); }
.ip-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ip-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.ip-num { flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%; background: var(--gold-grad); color: #141414; font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }

.wl-row { cursor: pointer; }

/* ---------- onboarding: The 5% Quiz ---------- */
/* Fixed full-screen layer above the whole app shell (tabbar is z 30,
 * sheets are z 90, so the quiz sits at 200). NO SCROLLING anywhere in
 * the quiz (Justin, 2026-10-31): every page fits the viewport by
 * construction. The overlay is a flex column pinned to the app shell
 * height (same --app-h cascade as body, so it follows fitShell()).
 * The flow is SEVEN one-idea pages (2026-11-28): setup 1, question 1,
 * reveal 1, setup 2, question 2, reveal 2, final — exactly one
 * .ob-page is unhidden at a time. Setup/reveal pages anchor their
 * single idea (.ob-page-main) at the shared top offset (see the
 * placement note at .ob-page) with the Next button pinned to the
 * bottom; the final page's chart card is flex:1 1 auto with a 110px
 * floor and absorbs all slack/shrinkage (the SVG scales into
 * whatever height the card gives it — viewBox + preserveAspectRatio
 * letterbox; the dash-draw animation is resolution-independent).
 * Theme vars keep it matched to the black-and-gold identity in both
 * themes. */
.ob-overlay { position: fixed; inset: 0; z-index: 200; background: var(--bg); color: var(--ink); height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); max-height: 100dvh; }
.ob-overlay[hidden] { display: none; }
/* Top padding clears the frosted top strip with room to spare:
 * at 8px the quiz kicker sat ~5px under the strip's gold line
 * and read as blurred on device (Justin's screenshot,
 * 2026-11-26). 24px puts the title fully below the blur. */
.ob-scroll { height: 100%; overflow: hidden; display: flex; flex-direction: column; padding: calc(24px + env(safe-area-inset-top)) 14px calc(8px + env(safe-area-inset-bottom)); }
.ob-inner { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }
.ob-top { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.ob-kicker { font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.ob-skip { background: none; border: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); padding: 4px 2px; cursor: pointer; }
.ob-overlay.ob-locked .ob-skip { display: none; }
/* Placement (Justin's screenshot pass, 2026-11-28): every one-idea
 * page shares ONE spacing scale — the content group starts at a
 * fixed offset below the progress header, clamp(24px, 9vh, 88px):
 * it grows modestly with screen height and then caps, so on tall
 * phones the block sits in the upper-middle instead of floating at
 * center (the old justify-content:center left it adrift between
 * two cavernous gaps). The Next button stays pinned to the bottom:
 * header+content and button are the two anchors. The final page
 * keeps a 0 offset — its chart card flexes to fill the screen, so
 * it has no void to distribute. */
.ob-page { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: clamp(24px, 9vh, 88px); }
#ob-page-final { padding-top: 0; }
.ob-page[hidden] { display: none; }
.ob-page-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; }
/* Raised onto the shared button anchor (--cta-bottom, see :root):
 * the Next button's bottom edge must land exactly where the
 * welcome page's GET STARTED sits. .ob-scroll's bottom padding
 * contributes the first 8px, so the margin supplies the rest —
 * 8 + (98 - 8) = 98 = the anchor. */
.ob-next { flex: 0 0 auto; margin-bottom: calc(var(--cta-bottom) - 8px); }
.ob-verdict { font-size: 22px; font-weight: 900; text-align: center; margin: 0 0 4px; }
.ob-verdict.good { color: var(--good); }
.ob-picked { font-size: 14px; font-weight: 700; color: var(--muted); text-align: center; margin: 0 0 10px; }
.ob-reveal-big { font-size: 42px; text-align: center; margin: 0 0 12px; }
.ob-setup-big { font-size: 42px; text-align: center; margin: 0 0 8px; }
.ob-setup-line { font-size: 15.5px; font-weight: 700; line-height: 1.38; color: var(--ink2); text-align: center; margin: 0; }
/* The final body flexes to fill the page so Enter the app can
 * anchor at the bottom on the shared --cta-bottom line, while
 * the punchline and disclaimer stay up under the chart. */
.ob-final-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ob-h { font-size: 23px; line-height: 1.22; margin: 2px 0 6px; }
.ob-context { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 8px; box-shadow: 0 2px 14px var(--shadow); }
.ob-context p { margin: 0; font-size: 13.5px; line-height: 1.42; color: var(--ink2); }
.ob-big { font-size: 28px; font-weight: 900; letter-spacing: -.01em; line-height: 1.08; margin: 3px 0; }
.ob-context .ob-small { font-size: 12px; color: var(--muted); }
.ob-chart-card { flex: 1 1 auto; min-height: 110px; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px 6px; margin: 0 0 8px; box-shadow: 0 2px 14px var(--shadow); }
#ob-chart { display: block; flex: 1 1 auto; min-height: 0; width: 100%; }
#ob-axis { stroke: var(--line); }
.ob-axis-txt { font-size: 9.5px; font-weight: 600; fill: var(--muted); }
#ob-ymax { font-size: 10.5px; font-weight: 800; fill: var(--ink2); }
.ob-line { vector-effect: non-scaling-stroke; }
.ob-legend { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 2px 0; }
.ob-leg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--ink2); }
.ob-leg i { display: inline-block; width: 18px; height: 3.5px; border-radius: 99px; flex: 0 0 auto; }
.ob-q { font-size: 15.5px; font-weight: 700; line-height: 1.38; margin: 0 0 8px; }
.ob-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ob-opt { font: inherit; font-size: 16px; font-weight: 800; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--field); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .16s var(--ease-out), min-height .2s var(--ease-out); }
.ob-opt:active { transform: scale(.98); }
.ob-opts.locked .ob-opt { pointer-events: none; cursor: default; min-height: 38px; font-size: 15px; }
.ob-opt.dim { opacity: .4; }
.ob-opt.right { border-color: var(--good); background: var(--chip-pass-bg); color: var(--good); opacity: 1; }
.ob-opt.wrong { border-color: var(--bad); background: var(--chip-fail-bg); color: var(--bad); opacity: 1; }
.ob-callout { font-size: 14px; font-weight: 700; line-height: 1.4; background: var(--chip-bg); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 8px 11px; margin: 0 0 8px; }
.ob-punch { font-size: 13.5px; line-height: 1.36; color: var(--ink2); margin: 0 0 8px; }
.ob-disclaimer { font-size: 11px; line-height: 1.4; color: var(--muted); margin: 0 0 8px; }
.ob-progress { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; margin: 2px 0 6px; }
.ob-bar { flex: 1; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ob-bar-fill { height: 100%; width: 14.29%; border-radius: 99px; background: var(--gold); transition: width .45s ease; }
.ob-step-label { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ob-hint { font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: center; margin: 8px 0 0; }
.ob-hint[hidden] { display: none; }
/* Final page (decluttered 2026-11-28 at Justin's word — "too many
 * words here"): the verdict banner and the tie-in line are GONE
 * (reveal 2 already delivered both ideas one screen earlier), so
 * the screen is chart -> punchline -> disclaimer -> CTA. The
 * chart card no longer flexes to fill: it takes a compact
 * fixed height (~55-65% of its old flexed height) so it stops
 * reading as a half-screen of mostly empty black. */
#ob-page-final .ob-chart-card { flex: 0 0 auto; height: clamp(190px, 30vh, 270px); min-height: 0; }
#ob-page-final .ob-punch { margin-bottom: 6px; }
/* The auto top margin pushes the CTA down to the shared button
 * anchor, and its own bottom margin sets the exact offset now
 * that the CTA is the last element on the page (the start-choice
 * row under it was removed 2026-11-29 at Justin's word — in the
 * first-run flow all three choices funneled into the stock-pick
 * grid anyway). Same formula as .ob-next: .ob-scroll's bottom
 * padding (8) + this margin (98 - 8) = 98 = --cta-bottom. */
#ob-cta { margin-top: auto; margin-bottom: calc(var(--cta-bottom) - 8px); }

/* Get started welcome page (2026-11-28): the first-run front door.
 * Same full-screen layer treatment as the quiz (fixed, theme bg,
 * app-height aware), content centered in a narrow column: brand
 * mark + outcome headline up top, actions pinned low, the beta
 * line quiet at the foot. Black-and-gold in both themes via the
 * shared vars; the mark itself is always the gold splash SVG. */
.gs-overlay { position: fixed; inset: 0; z-index: 205; background: var(--bg); color: var(--ink); height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); max-height: 100dvh; }
.gs-overlay[hidden] { display: none; }
.gs-inner { height: 100%; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: none; padding: calc(24px + env(safe-area-inset-top)) 22px calc(var(--cta-bottom) - var(--gs-under-btn) + env(safe-area-inset-bottom)); }
.gs-brand { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 4vh 0 26px; }
.gs-wordmark { color: var(--gold); font-size: 14px; font-weight: 700; letter-spacing: .38em; margin-right: -.38em; }
.gs-h { font-size: 25px; line-height: 1.24; font-weight: 900; letter-spacing: -.01em; text-align: center; margin: 0 0 12px; }
.gs-sub { font-size: 15px; line-height: 1.45; color: var(--ink2); text-align: center; margin: 0 0 8px; }
.gs-effort { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; margin: 0; }
.gs-actions { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.gs-signin { background: none; border: none; font: inherit; font-size: 14.5px; font-weight: 700; color: var(--ink2); padding: 12px 4px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gs-signin:active { transform: scale(.98); }
.gs-beta { font-size: 11px; line-height: 1.45; color: var(--muted); text-align: center; margin: 10px 0 0; }
/* Height safety (Justin's screenshot, 2026-11-28): in standalone,
 * fitShell pins --app-h to max(innerHeight, screen.height), but iOS
 * can report innerHeight SHORT while screen.height stays physical —
 * the overlay then stood taller than the area iOS actually paints,
 * and because .gs-actions is bottom-pinned (margin-top:auto) the
 * excess landed on the beta line, clipping its last line(s) below
 * the visible edge. The max-height:100dvh clamp on .gs-overlay caps
 * the box at the real visible viewport (a no-op when --app-h is
 * correct; the strip it can expose below is body bg, same color),
 * .gs-inner scrolls internally as a backstop on very short screens,
 * and below 700px tall the brand block and headline tighten so the
 * whole page fits with room to spare. */
/* Short screens: tighten the top of the page so everything through
 * the beta line fits without the backstop scroll. */
@media (max-height: 700px) {
  .gs-brand { margin: 10px 0 18px; gap: 10px; }
  .gs-brand svg { width: 60px; height: 60px; }
  .gs-h { font-size: 22px; margin-bottom: 10px; }
}
/* Detour affordance while the welcome flow is parked on the Cloud
 * sync sign-in: a quiet fixed chip back to the Get started page.
 * Only ever visible in that state (srWelcome toggles [hidden]). */
.gs-back { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; z-index: 150; font: inherit; font-size: 14px; font-weight: 800; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; cursor: pointer; box-shadow: 0 2px 14px var(--shadow); }
.gs-back[hidden] { display: none; }
/* Full-screen stock overview: a panel that pans in from the right
 * over the watchlist and slides back out to the right on close
 * (Justin's ask, 2026-10-29). Lives outside the tab system so the
 * watchlist underneath never unloads. */
.ov-panel { position: fixed; inset: 0; z-index: 85; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: calc(12px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); transform: translateX(103%); transition: transform .28s var(--ease-drawer); pointer-events: none; }
.ov-panel.open { transform: translateX(0); pointer-events: auto; }

/* Compact state while scrolling down (Instagram-style shrink):
 * the pill compacts AND slides down toward the home bar, then
 * slides back up as it restores (strengthened 2026-11-19 so the
 * motion is unmistakable). */
.tabbar.mini { padding: 4px; transform: translateY(5px); }
.tabbar.mini button { height: 36px; }
.tabbar.mini button .tab-ico .ico { width: 20px; height: 20px; }

/* Beginner info dots: small i buttons that smoothly unfold a
 * plain-English explainer under the label (Justin, 2026-10-29). */
.info-dot { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); background: none; font-size: 11px; font-weight: 800; font-style: italic; font-family: Georgia, 'Times New Roman', serif; line-height: 1; cursor: pointer; vertical-align: 2px; margin-left: 5px; padding: 0; transition: transform .16s var(--ease-out); }
.info-dot:active { transform: scale(.9); }
.info-text { display: block; max-height: 0; opacity: 0; overflow: hidden; transition: opacity .35s var(--ease-out), margin .35s var(--ease-out); font-size: 12.5px; line-height: 1.5; color: var(--muted); font-weight: 500; }
.info-text.open { max-height: 460px; opacity: 1; margin-top: 5px; }
/* The scan explainer is sectioned and longer than most (2026-11-18) — it gets a taller cap so the last section never clips. */
.info-text.open[data-info-text="scanscore"] { max-height: 720px; }

/* Return chip shown on Scorecard/Tools after jumping there from a
 * stock overview (Justin, 2026-10-29). */
.back-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--accent-text); background: var(--field); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; margin-bottom: 10px; cursor: pointer; }
.back-chip[hidden] { display: none; }
.back-chip:active { transform: translateY(1px); }

/* Little pop-up bubble for gentle "not yet" messages. */
.toast-bubble { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); z-index: 120; background: var(--field); color: var(--ink); border: 1px solid var(--gold); border-radius: 14px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; line-height: 1.4; max-width: min(88vw, 420px); text-align: center; box-shadow: 0 12px 32px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.toast-bubble.show { opacity: 1; transform: translate(-50%, 0); }
.field-warn { border-color: var(--bad) !important; box-shadow: 0 0 0 2px rgba(255,80,60,.35) !important; }

/* Glossary diagrams: two-tone line art under each term. */
.gloss-art { color: var(--ink2); margin: 8px 0 4px; }
.gloss-art svg { width: 100%; max-width: 330px; height: auto; display: block; }
.gloss-art .ga { stroke: var(--gold); }
.gloss-art .gaf { fill: var(--gold); stroke: none; }
.gloss-art .gab { fill: var(--gold); fill-opacity: .30; stroke: none; }
.gloss-art text { font-family: inherit; }
.gloss-art .gt { fill: var(--ink2); stroke: none; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.gloss-art .gtf { fill: var(--gold); stroke: none; font-size: 11px; font-weight: 800; }

/* "See in Glossary" link inside expanded info explainers, and the
 * landing flash when a glossary jump highlights its term. */
.info-gloss-link { display: inline-block; margin-top: 6px; background: none; border: none; padding: 0; color: var(--gold); font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.g-item.flash { animation: gflash 1.8s ease; border-radius: 10px; }
@keyframes gflash { 0% { background: rgba(232,178,60,.30); } 100% { background: transparent; } }

/* Short newcomer intro under a tool's title. */
.tool-intro { color: var(--ink2); font-size: 14px; line-height: 1.55; margin: 0 0 12px; overflow: hidden; }

/* ---------- legal pages ---------- */
.legal-doc { font-size: 14.5px; line-height: 1.65; color: var(--ink2); }
.legal-doc .legal-updated { color: var(--accent-text); font-size: 12px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 14px; }
.legal-doc h3 { color: var(--ink); font-size: 16px; line-height: 1.35; margin: 20px 0 7px; }
.legal-doc h3:first-of-type { margin-top: 16px; }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul { margin: 2px 0 14px; padding-left: 21px; }
.legal-doc li { margin: 4px 0; }
.legal-doc strong { color: var(--ink); }
.legal-contact { color: var(--accent-text); font-weight: 800; overflow-wrap: anywhere; }



/* Tools sub-page bar: a sliding gold pill moves between the three
 * tools; each tool gets its own page. */
.toolseg { position: relative; display: flex; background: var(--field); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.toolseg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 5); background: var(--gold-grad); border-radius: 999px; transition: transform .28s var(--ease-in-out); }
.toolseg button { flex: 1; position: relative; background: none; border: none; padding: 9px 0; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; transition: color .2s ease; white-space: nowrap; }
.toolseg button.active { color: #1a1405; }
.tool-page { display: none; }
.tool-page.active { display: block; animation: toolpage-in .25s var(--ease-out); }
@keyframes toolpage-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* Reduced motion (Emil review 2026-10-30 — the app had none): gentler,
 * not zero. Opacity/color fades that aid comprehension stay; slides,
 * travels and unfolds become effectively instant. Color-only effects
 * (the glossary gold flash) is intentionally untouched. */
@media (prefers-reduced-motion: reduce) {
  .ov-panel { transition: none; }
  .toolseg-pill, .tab-pill, .tabbar, .tabbar button, .tabbar button .tab-ico .ico,
  .info-text, .pf-chev, .scan-bar i { transition-duration: .01s; }
  .toast-bubble { transition: opacity .2s ease; }
  .tool-page.active { animation: none; }
  .radar-svg { animation: none; }
  .pf-sheet, #qm-detail, #holders-sheet, #tx-sheet, .shake, .splash-mark { animation: none; }
  #splash { transition-duration: .01s; }
}

/* Tappable points: exact math behind every factor score */
.pts-btn { background: none; border: 0; border-bottom: 1px dotted rgba(248,199,61,.55); color: inherit; font: inherit; cursor: pointer; padding: 0 0 1px; text-align: inherit; }
.pts-btn[aria-expanded="true"] { border-bottom: 1px solid var(--gold); color: var(--gold); }
button.v-score.pts-btn { border-bottom: 1px dotted rgba(0,0,0,.35); }
button.v-score.pts-btn[aria-expanded="true"] { border-bottom: 1px solid currentColor; color: inherit; }
table.factors tr.math-row td { border-bottom: 1px solid var(--row-line); padding: 2px 6px 10px; }
/* Info text in a factor table gets its own full-width row (Justin's
 * ask, 2026-11-08): inside the narrow first column the long blurbs
 * ran past the unfold cap and clipped mid-sentence. Closed rows
 * take no space; the taller cap fits the longest explainer. */
table.factors tr.info-row td { padding: 0 6px; border-bottom: none; }
table.factors tr.info-row:has(.info-text.open) td { border-bottom: 1px solid var(--row-line); padding-bottom: 8px; }
table.factors .info-row .info-text.open { max-height: 900px; }
.math-box { background: var(--field); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; line-height: 1.55; }
.banner-math { margin: 10px 0 4px; }


/* Projection headline: one big glanceable line under the cases table */
.pj-headline { text-align: center; font-size: 25px; font-weight: 800; letter-spacing: .01em; margin: 16px 0 4px; overflow-wrap: anywhere; }
.pj-headline.sm { font-size: 20px; }
.pj-hl-price { color: var(--gold); }

/* Scoring weights panel (Profile settings) */
.w-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.w-chip { border: 1px solid var(--line); background: var(--field); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.w-chip.on { background: var(--gold); color: #141414; border-color: var(--gold); }
.w-group { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 4px; }
.w-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.w-row:last-child { border-bottom: none; }
.w-name { font-size: 14px; font-weight: 600; min-width: 0; }
.w-step { display: flex; align-items: center; gap: 8px; flex: none; }
.w-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font-size: 17px; font-weight: 800; line-height: 1; cursor: pointer; transition: transform .15s ease-out; }
.w-btn:active { transform: scale(.97); }
.w-val { min-width: 26px; text-align: center; font-weight: 800; font-size: 15px; }
.w-val.off { color: var(--muted); }

/* ===== Market tab (2026-11-15): one full-width panel per gauge ===== */
.mkt-sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 2px 0 14px; }
.mkt-panel { background: transparent; border: none; border-bottom: 1px solid var(--row-line); border-radius: 0; padding: 18px 0 16px; margin: 0 0 6px; }
.mkt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mkt-name { font-weight: 800; font-size: 15px; letter-spacing: .01em; }
.mkt-asof { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mkt-big { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.mkt-big .mkt-big-sub { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.mkt-read { font-size: 13.5px; line-height: 1.5; margin: 2px 0 10px; }
.mkt-chart { margin: 4px 0 2px; }
.mkt-chart svg { display: block; width: 100%; height: auto; }
.mkt-ax { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.mkt-note { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 10px 0 0; }
.mkt-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.mkt-legend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.mkt-gauge { position: relative; height: 10px; border-radius: 5px; margin: 12px 0 4px; background: linear-gradient(90deg in oklch, #d33f2e 0%, #ef8f3c 25%, #e7c948 50%, #8bc34a 75%, #2e9e5b 100%); }
.mkt-gauge .mkt-pin { position: absolute; top: -5px; width: 4px; height: 20px; border-radius: 2px; background: var(--ink); transform: translateX(-2px); }
.mkt-gauge-labs { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.mkt-aaii-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 12.5px; }
.mkt-aaii-lab { width: 52px; flex: none; font-weight: 700; }
.mkt-aaii-track { position: relative; flex: 1; height: 16px; background: var(--field); border-radius: 4px; }
.mkt-aaii-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.mkt-aaii-avg { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; }
.mkt-aaii-val { width: 76px; flex: none; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.mkt-chart { position: relative; touch-action: pan-y; cursor: crosshair; }
.mkt-chart, .mkt-chart * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mkt-scrub-line { position: absolute; top: 0; bottom: 0; width: 1.5px; margin-left: -0.75px; background: var(--muted); opacity: .55; pointer-events: none; }
.mkt-scrub-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2.5px var(--card); pointer-events: none; }
.mkt-scrub-track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--line); }
/* Range slider (2026-11-26): the log time-window control that
 * replaced the pills and the scrub strip. Same track + grip thumb
 * language, plus the current window at the right. */
.mkt-rangebar { display: flex; align-items: center; gap: 10px; height: 34px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mkt-range-trackwrap { position: relative; flex: 1; height: 34px; }
.mkt-range-thumb { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 22px; border-radius: 11px; background: var(--card); border: 1.5px solid var(--gold); pointer-events: none; }
.mkt-range-thumb::after { content: ''; position: absolute; top: 5px; bottom: 5px; left: 10px; right: 10px; background: repeating-linear-gradient(90deg, var(--muted) 0 2px, transparent 2px 5px); opacity: .75; }
.mkt-range-lab { flex: none; min-width: 32px; text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ==== Vibe-code tells pass (2026-11-19, from the @lincolndevine reel) ====
 * Skeleton loaders: content-shaped shimmer blocks instead of a blank
 * screen under a loader (scorecard cold research, Market first paint). */
.skl-wrap { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.skl { position: relative; overflow: hidden; background: var(--chip-bg); border-radius: 10px; flex: none; }
.skl::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(100deg, transparent 30%, rgba(140,140,140,.28) 50%, transparent 70%); animation: skl-shimmer 1.4s ease-in-out infinite; }
@keyframes skl-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skl::after { animation: none; } }
.skl-name { width: 62%; height: 30px; }
.skl-sub { width: 45%; height: 14px; }
.skl-price { width: 38%; height: 42px; }
.skl-strip { width: 100%; height: 54px; }
.skl-chart { width: 100%; height: 220px; }
.skl-banner { width: 100%; height: 64px; }
.skl-mktname { width: 40%; height: 18px; }
.skl-mktval { width: 26%; height: 34px; }
.skl-mktchart { width: 100%; height: 120px; margin-bottom: 10px; }
/* No-spinners pass (2026-11-22): shapes for the small and mid-size
 * loading spots -- status lines, scan rows, news lines, SWOT boxes,
 * holder rows, QM card charts, the scan footer bar. */
.skl-status { width: 55%; height: 14px; }
.skl-scanrow { width: 100%; height: 64px; }
.skl-newsline { width: 92%; height: 15px; }
.skl-newssub { width: 58%; height: 11px; margin-top: -8px; }
.skl-swotwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.skl-swotbox { height: 74px; }
.skl-holdrow { width: 100%; height: 34px; }
.skl-qmchart { width: 100%; height: 74px; margin: 2px 0 4px; }

/* Labor-illusion pass (2026-11-29): real-work steps on the scorecard
 * cold load, and named work notes where a single server-side job is
 * the wait. Gold checks tick in order; the active step pulses. */
.ws-panel { padding: 18px 2px 6px; }
.ws-title { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.ws-step { display: flex; align-items: center; gap: 11px; padding: 7px 0; color: var(--muted); }
.ws-step .ws-lb { font-size: 14.5px; font-weight: 600; }
.ws-step .ws-ic { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; }
.ws-step.done { color: var(--text); }
.ws-step.done .ws-ic { background: var(--gold); border-color: var(--gold); }
.ws-step.active { color: var(--text); }
.ws-step.active .ws-ic { border-color: var(--gold); }
.ws-step.active .ws-ic::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: ws-pulse 1.1s ease-in-out infinite; }
@keyframes ws-pulse { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ws-step.active .ws-ic::after, .ws-note .ws-pulse { animation: none; } }
.ws-banner { font-size: 12.5px; }
.ws-b { opacity: .55; font-weight: 600; }
.ws-b.done { opacity: 1; color: var(--gold-deep); }
.ws-b.active { opacity: 1; font-weight: 700; }
.ws-note { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0 10px; }
.ws-note .ws-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; margin-top: 5px; animation: ws-pulse 1.1s ease-in-out infinite; }
.ws-note-t { font-size: 14px; font-weight: 700; }
.ws-note-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.ws-mktcap { font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 0 2px; }

/* Tap feedback for the tappables that lacked it: the press should
 * register instantly, before anything loads. */
.tabbar button { transition: transform .18s var(--ease-out); }
.tabbar button:active { transform: scale(.97); }
.toolseg button:active { opacity: .5; }
.seg button:active { transform: translateY(1px); }
.wl-row:active, .j-row:active { opacity: .5; }
[data-qmopen]:active { opacity: .6; }
[data-mktrange]:active { transform: translateY(1px); }

/* Offline pill: floats above the tab bar while the connection is
 * down. The app itself keeps working from on-device data; this just
 * says so, and that sync resumes when the connection returns. */
.offline-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 66; max-width: calc(100vw - 32px); background: var(--elev); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; text-align: center; box-shadow: 0 6px 24px var(--shadow); }
.offline-bar[hidden] { display: none; }

/* Flags (2026-11-19): the guardrail warnings that replaced the value
 * and risk screens. Only fired flags render; rows are hairline-flat
 * like the rest of the scorecard, icon in the bad-news color. */
.flag-list { margin-bottom: 4px; }
.flag-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--row-line); }
.flag-row .ico { color: var(--bad); flex: none; margin-top: 2px; }
.flag-row strong { font-size: 14.5px; }

/* Charles Liu pass (2026-11-19): icons inside gold/ghost buttons sit
 * beside bold labels, so their stroke steps up to match the text
 * weight (base icons stay 2.1). */
.btn-gold .ico, .btn-ghost .ico { stroke-width: 2.4; }

/* Charles Liu animation pass (2026-11-19): entrances never start
 * from scale 0 — sheets rise, dialogs grow from .97 with a fade;
 * errors shake (his exact keyframes, 360ms); theme flips suppress
 * transitions so colors land all at once; interpolate-size lets
 * height: auto animate where CSS drives it. */
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes dlg-in { from { opacity: 0; transform: scale(.97); } }
@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  55% { transform: translateX(-6px); }
  70% { transform: translateX(6px); }
  85% { transform: translateX(-3px); }
}
.shake { animation: shake-x .36s ease; }
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
:root { interpolate-size: allow-keywords; }

/* Caleb Henry pass (2026-11-19): undo toasts carry a real Undo
 * button (so the bubble takes taps while it is up); the big price
 * gets tabular figures like the rest of the money in the app;
 * headlines balance; the tiny info dots get a finger-sized target
 * without growing visually. */
.toast-bubble.has-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; text-align: left; }
.toast-undo { background: none; border: none; color: var(--gold); font: inherit; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; padding: 4px 2px; flex: none; }
.sc-price .p { font-variant-numeric: tabular-nums; }
/* Balanced titles: multi-line headings wrap evenly instead of
 * stranding an orphan word on the last line. Was h2-only from
 * the polish pass; extended app-wide at Justin's word
 * (2026-11-19) to every heading level plus the scorecard's
 * company name and the quiz question. */
h1, h2, h3, h4, .ob-q, .sc-name { text-wrap: balance; }
.info-dot { position: relative; }
.info-dot::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }

/* ===== Dropdown kit (2026-11-21): Justin's five dropdown rules =====
 * 1) Obvious triggers -- caret (already on the toggles), hover
 *    feedback below, and 48px minimum touch targets.
 * 2) Flip on edge -- the overlay dropdowns (autocomplete, index
 *    bubbles) open upward near the screen edge; in-flow panels
 *    can't be cut off, so they don't need it.
 * 3) Keyboard -- native on buttons/selects; arrows/Enter/Escape
 *    added in app.js for the autocomplete, metric picker, bubbles.
 * 4) 10+ items get search -- the Charts metric picker (17 items)
 *    has the filter box; no list in the app reaches 100 items, so
 *    virtualization is N/A everywhere.
 * 5) ~150ms open/close -- ddAnimBody and setInfoOpen in app.js. */
.ceo-toggle { min-height: 48px; border-radius: 10px; }
.ceo-chev { transition-duration: 150ms; }
select { min-height: 48px; }
.qm-picker-btn { min-height: 48px; }
.qm-opt { min-height: 48px; }
.ac-item.ac-on { background: var(--chip-bg); }
.info-text { transition-duration: .15s; }
.info-dot::after { inset: -15px; }
#ix-pop.ix-pop-up .ix-pop-caret { top: auto; bottom: -5.5px; transform: rotate(225deg); }
.scan-ixname { cursor: pointer; border-radius: 6px; }
.scan-ixname:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#qm-metric-filter { width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 10px 12px; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: inherit; font-size: 14px; }
@media (hover: hover) {
  .ceo-toggle:hover { background: var(--chip-bg); }
  .ac-item:hover { background: var(--chip-bg); }
  select:hover { border-color: var(--gold); }
  .info-dot:hover { color: var(--gold); border-color: var(--gold); }
  .scan-ixname:hover { text-decoration: underline; }
  .comp-row:hover { border-color: var(--gold); }
  .sim-tile:hover { border-color: var(--gold); }
  .qm-picker-btn:hover { border-color: var(--gold); }
  .qm-opt:hover { background: var(--chip-bg); }
}

/* Scan list pager (2026-11-22): the three index lists as swipeable
 * pages instead of a dropdown. Native scroll-snap paging; dots track
 * the scroll position. */
.scan-pager { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scan-pager::-webkit-scrollbar { display: none; }
.scan-page { flex: 0 0 100%; min-width: 100%; scroll-snap-align: start; }
.scan-dots { display: flex; justify-content: center; gap: 2px; padding: 6px 0 0; }
.scan-dot { width: 26px; height: 26px; padding: 0; border: 0; background: transparent; position: relative; cursor: pointer; }
.scan-dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--line); transition: background .15s ease; }
.scan-dot.on::after { background: var(--gold); }

/* Polish pass (2026-11-24, from Caleb's 20-details list): smooth
 * continuous corners (squircle) on the main surfaces where the
 * browser supports them -- border-radius stays as the fallback --
 * and balanced wrapping for the scan card's headline. */
@supports (corner-shape: squircle) {
  .card, .btn-gold, .btn-ghost, .btn-mini, .qm-card, .sim-tile, .logo-tile,
  .sheet, .tabbar, .scan-dot, input, select, textarea { corner-shape: squircle; }
}
.scan-h { text-wrap: balance; }

/* Projection form labels (2026-11-24): the info dot stays on the
 * label's own line even when the text wraps -- Flat growth's dot
 * was dropping to a line of its own. The input takes the full
 * second row. */
#tool-pj .grid2 .lbl-row { display: flex; flex-wrap: nowrap; align-items: flex-start; column-gap: 6px; }
#tool-pj .grid2 .lbl-t { flex: 0 1 auto; min-width: 0; }
#tool-pj .grid2 .info-dot { flex: none; }

/* Flat growth hidden outright while an analyst forecast path
 * drives the builder (2026-11-24). */
#tool-pj label.pj-gone { display: none !important; }

.qm-combo-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 0 2px 8px; font-size: 12.5px; color: var(--muted); }
.qm-combo-legend span { display: inline-flex; align-items: center; }
.qm-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.qm-sw-line { width: 14px; height: 3px; border-radius: 2px; }

/* Settings stack nav (2026-11-26): root rows + drill-in panels. */
#tab-settings [hidden] { display: none !important; }
.set-list { display: flex; flex-direction: column; gap: 10px; }
.set-row { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 52px; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); font-size: 15.5px; font-weight: 600; text-align: left; cursor: pointer; }
.set-row:active { transform: scale(.99); }
.set-row .set-val { margin-left: auto; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.set-row .set-chev { margin-left: auto; color: var(--muted); flex: none; }
.set-row .set-val + .set-chev { margin-left: 0; }
.set-panel-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.set-back { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.set-crumb { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.set-panel-title { font-size: 21px; font-weight: 800; line-height: 1.15; }

/* Statement numbers: the research tab's dotted underline (same
 * recipe as .pts-btn); tapping shows growth vs the period before
 * in the readout line above the table. */
.stmt-num { background: none; border: 0; border-bottom: 1px dotted rgba(248,199,61,.55); color: inherit; font: inherit; cursor: pointer; padding: 0 0 1px; }
.stmt-num.on { background: rgba(248,199,61,.22); border-radius: 3px; }
.stmt-read { font-size: 13px; padding: 8px 2px 0; }

/* Account deletion (Account panel danger zone). */
#acct-danger { margin-top: 18px; }
.btn-danger { background: none; border: 1px solid var(--bad); color: var(--bad); border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-danger:disabled { opacity: .5; cursor: default; }
/* EPS trajectory bars: tap a bar for its analyst count. */
.eps-hit { fill: transparent; cursor: pointer; }
.eps-bar.on { stroke: var(--gold); stroke-width: 2.5; }
.eps-read { font-size: 13px; padding: 8px 2px 0; }

/* Delete-account confirmation popup: a centered dialog over a
 * dimmed backdrop, in the app's sheet language. */
#del-overlay { position: fixed; inset: 0; z-index: 160; background: rgba(0,0,0,.62); display: flex; align-items: center; justify-content: center; padding: 20px; overscroll-behavior: contain; }
#del-overlay[hidden] { display: none; }
#del-sheet { background: var(--bg); border: 1.5px solid var(--line); border-radius: 20px; padding: 20px; width: 100%; max-width: 340px; animation: dlg-in .25s var(--ease-drawer); }
.del-title { font-size: 19px; font-weight: 800; margin: 0 0 10px; }
.del-error { color: var(--bad); font-size: 13px; margin: 0 0 12px; }
#del-sheet .sheet-btns .btn-ghost { flex: 1; }
.btn-danger-fill { flex: 1; background: var(--bad); border: 1px solid var(--bad); color: #fff; border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-danger-fill:disabled { opacity: .5; cursor: default; }

/* ==== First-run picks + building moment, trial gate (2026-11-28) ==== */
/* max-height: 100dvh is the same clamp that fixed .gs-overlay
 * (build ...194706): in standalone, --app-h can overshoot the
 * visible webview by ~60px, and without the cap the overlay stands
 * that much too tall and its bottom-pinned footer (grid count /
 * Continue / skip link) loses its last line below the edge. The
 * trial gate (#tg-overlay) shares this class, so it gets the same
 * protection. .fr-scroll stays the only scrollable region, and its
 * bottom padding already carries the safe-area inset. */
.fr-overlay { position: fixed; inset: 0; z-index: 210; background: var(--bg); color: var(--ink); height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); max-height: 100dvh; }
.fr-overlay[hidden] { display: none; }
.fr-scroll { height: 100%; overflow-y: auto; overscroll-behavior: none; display: flex; flex-direction: column; padding: calc(24px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); }
/* Grid stage only (:has on the rendered .fr-grid): the outer
 * scroller stops and the GRID becomes the only scrollable region,
 * so the footer under it — count line, Continue, skip link — is
 * pinned fully on screen instead of living at the bottom of a
 * 1,200px scroll (where the --app-h overshoot used to eat its last
 * line). The building stage and the trial gate render no .fr-grid
 * and keep the plain .fr-scroll behavior above. */
.fr-scroll:has(.fr-grid) { overflow: hidden; }
.fr-inner:has(.fr-grid) { min-height: 0; }
.fr-inner:has(.fr-grid) .fr-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: none; padding-bottom: 4px; }
.fr-inner { flex: 1 1 auto; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }
.fr-kicker { font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 6px; }
.fr-h { font-size: 24px; font-weight: 800; line-height: 1.2; margin: 0 0 6px; }
.fr-sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.fr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fr-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px 9px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; font: inherit; cursor: pointer; color: var(--ink); transition: border-color .15s ease, transform .1s ease; }
.fr-pick:active { transform: scale(.96); }
.fr-pick .fr-t { font-size: 13px; font-weight: 800; }
.fr-pick .fr-n { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.25; }
.fr-pick.sel { border-color: var(--gold-deep); background: var(--chip-bg); }
.fr-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #141414; font-size: 13px; font-weight: 900; line-height: 20px; text-align: center; display: none; }
.fr-pick.sel .fr-check { display: block; }
.fr-foot { margin-top: auto; padding-top: 16px; }
.fr-count { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 10px; }
.fr-count b { color: var(--gold-deep); }
.fr-continue { width: 100%; }
.fr-continue:disabled { opacity: .45; cursor: default; }
.fr-skip { display: block; margin: 12px auto 0; background: none; border: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 4px; }
.fr-stage { display: flex; align-items: center; gap: 10px; padding: 13px 2px; font-size: 16px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--row-line); }
.fr-stage .fr-dot { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; color: transparent; }
.fr-stage.on { color: var(--ink); }
.fr-stage.on .fr-dot { border-color: var(--gold-deep); }
.fr-stage.on .fr-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); animation: fr-pulse 0.9s ease-in-out infinite; }
.fr-stage.done { color: var(--ink); }
.fr-stage.done .fr-dot { border-color: var(--good); background: var(--good); color: #fff; }
.fr-stage.done .fr-dot::after { content: none; }
@keyframes fr-pulse { 0%, 100% { transform: scale(.7); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fr-stage.on .fr-dot::after { animation: none; } }
/* Trial gate screens */
.tg-preview { background: var(--alert-warn-bg); color: var(--alert-warn-ink); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; margin-bottom: 14px; text-align: center; }
.tg-chart-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px 6px; margin: 6px 0 14px; }
.tg-big { font-size: 30px; text-align: center; margin: 18px 0 8px; }
.tg-center { text-align: center; }
.tg-tl { margin: 8px 0 4px; }
.tg-tl-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--row-line); }
.tg-tl-row:last-child { border-bottom: none; }
.tg-tl-ico { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--chip-bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--gold-deep); }
.tg-tl-t { font-weight: 800; font-size: 15px; }
.tg-tl-d { color: var(--muted); font-size: 13px; margin-top: 1px; }
.tg-plans { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.tg-plan { position: relative; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; font: inherit; color: var(--ink); cursor: pointer; width: 100%; }
.tg-plan.sel { border-color: var(--gold-deep); background: var(--chip-bg); }
.tg-plan-top { display: flex; justify-content: space-between; align-items: baseline; }
.tg-plan-name { font-size: 17px; font-weight: 800; }
.tg-plan-price { font-size: 17px; font-weight: 800; }
.tg-plan-price span { font-size: 12px; color: var(--muted); font-weight: 600; }
.tg-plan-d { color: var(--muted); font-size: 13px; margin-top: 3px; }
.tg-badge { position: absolute; top: -10px; left: 12px; background: var(--gold); color: #141414; font-size: 10.5px; font-weight: 900; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; }
.tg-cycle-link { display: block; margin: 4px auto 0; background: none; border: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--accent-text); text-decoration: underline; cursor: pointer; }
.tg-due { text-align: center; font-size: 13.5px; font-weight: 700; margin: 10px 0 8px; }
.tg-fine { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; line-height: 1.5; }
.tg-guar { text-align: center; font-size: 13px; font-weight: 700; color: var(--gold-deep); margin-top: 10px; line-height: 1.5; }

/* ==== Spotlight tour (srTour, 2026-11-28) ==== */
.tour-layer { position: fixed; inset: 0; z-index: 320; height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); touch-action: none; overscroll-behavior: none; }
.tour-dim { position: fixed; background: rgba(18, 18, 18, .62); }
.tour-ring { position: fixed; border: 3px solid var(--gold); border-radius: 12px; box-shadow: 0 0 0 4px rgba(248, 199, 61, .18); pointer-events: none; box-sizing: border-box; }
.tour-card { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; background: var(--elev); color: var(--ink); border-radius: 16px; padding: 16px 16px 13px; box-shadow: 0 14px 40px rgba(0,0,0,.4); box-sizing: border-box; }
.tour-card.top { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
.tour-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: none; background: none; font-size: 19px; line-height: 1; color: var(--muted); cursor: pointer; }
.tour-title { font-size: 17px; font-weight: 800; margin: 0 26px 5px 0; }
.tour-body { font-size: 14px; line-height: 1.5; color: var(--ink2); margin: 0 0 14px; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-skip { background: none; border: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 6px 2px; }
.tour-count { font-size: 13px; font-weight: 700; color: var(--muted); }
.tour-next { padding: 10px 22px; }
.tour-next:disabled { opacity: .5; cursor: default; }
