:root {
  color-scheme: light;
  --page: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f6f9f8;
  --ink: #0c1f1c;
  --ink-2: #4b5d59;
  --muted: #84948f;
  --line: #e3ebe8;
  --grid: #e8eeec;
  --axis: #cdd8d4;
  --brand: #0e6b5c;
  --brand-ink: #0a4f44;
  --mint: #e5f4ee;
  --mint-ink: #0e6b5c;
  --accent: #8fe3c5;
  --good: #0a7a3c;
  --good-bg: #e3f5ea;
  --bad: #b3362f;
  --bad-bg: #fbe9e7;
  --shadow: 0 1px 2px rgba(12, 31, 28, .04), 0 8px 24px rgba(12, 31, 28, .06);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #08110f;
    --surface: #101b19;
    --surface-2: #142220;
    --ink: #edf4f1;
    --ink-2: #b7c6c1;
    --muted: #7d8e89;
    --line: #20302c;
    --grid: #1c2a27;
    --axis: #2c3c38;
    --brand: #2fb08f;
    --brand-ink: #8fe3c5;
    --mint: #132e28;
    --mint-ink: #8fe3c5;
    --good: #3ccf7a;
    --good-bg: #12301f;
    --bad: #f07a70;
    --bad-bg: #3a1714;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--accent); }
.logo svg { width: 18px; height: 18px; stroke-width: 2.4; }
.tabs { display: flex; gap: 4px; margin: 0 auto; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.tabs button:hover { color: var(--ink); background: var(--surface-2); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.badge-pretend { font-size: 13px; font-weight: 500; color: var(--mint-ink); background: var(--mint); padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 720px) {
  .nav-inner { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .badge-pretend { margin-left: auto; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tabs button { flex: 1; padding: 8px 6px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; color: #fff; padding: 56px 0 40px;
  background:
    radial-gradient(1200px 380px at 75% -10%, rgba(143, 227, 197, .28), transparent 60%),
    radial-gradient(800px 300px at 0% 10%, rgba(19, 160, 133, .35), transparent 60%),
    linear-gradient(180deg, #072e29 0%, #0b4a41 45%, #0f6b5c 78%, var(--page) 100%);
}
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1px); background-size: 46px 46px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%); }
.hero .wrap { position: relative; }
.hero-text { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.06; font-weight: 500; letter-spacing: -0.035em; }
.hero h1 span { color: var(--accent); }
.hero-text p { color: rgba(255, 255, 255, .78); font-size: 16px; max-width: 46ch; }
.hero-small { padding: 44px 0 64px; }
.hero-small h1 { font-size: clamp(30px, 4vw, 44px); }
@media (max-width: 760px) { .hero-text { grid-template-columns: 1fr; gap: 14px; } .hero { padding-top: 36px; } }

.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 28px 0 28px; color: rgba(255, 255, 255, .88); font-size: 14px; }
.trust li { display: inline-flex; align-items: center; gap: 10px; }
.trust .ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); }
.trust svg { width: 16px; height: 16px; }

/* ---------- picker ---------- */
.picker { background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(4, 30, 26, .25); padding: 22px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; border: 1px solid var(--line); }
@media (max-width: 860px) { .picker { grid-template-columns: 1fr; gap: 22px; padding: 18px; } }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-head h2 { font-size: 18px; }
.step-head.outside { margin: 8px 0 -4px; }
.step-head.outside h2 { font-size: 22px; }
.num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 600; flex: none; }

.coin-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .coin-cards { grid-template-columns: 1fr; } }
.coin { text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-md); padding: 14px; display: grid; gap: 2px; transition: border-color .15s, transform .15s, background .15s; }
.coin:hover { border-color: var(--axis); transform: translateY(-1px); }
.coin .top { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.coin .sym { color: var(--muted); font-weight: 500; font-size: 13px; }
.coin .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.coin .price { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.coin .chg { font-size: 13px; color: var(--ink-2); }
.coin[aria-pressed="true"] { background: linear-gradient(160deg, #0f6b5c, #13a085); border-color: transparent; color: #fff; box-shadow: var(--shadow); }
.coin[aria-pressed="true"] .sym, .coin[aria-pressed="true"] .chg { color: rgba(255, 255, 255, .8); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 500; font-size: 15px; color: var(--ink); }
.chips button:hover { border-color: var(--axis); }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chips.small button { font-size: 14px; padding: 6px 12px; }
.year-pick { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; min-height: 36px; color: var(--ink); }
select.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.advanced summary { cursor: pointer; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.advanced .chips { margin-top: 10px; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ---------- layout + cards ---------- */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
main.wrap { padding-top: 24px; padding-bottom: 32px; }
.hero-small + main.wrap { margin-top: -44px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 + .sub, .card > h2 + .tiles, .card > h2 + .words { margin-top: 6px; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sub { color: var(--ink-2); font-size: 15px; margin-top: 4px; max-width: 70ch; }
.loading, .error { padding: 32px 0; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.error { color: var(--bad); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .coin { transition: none; } }
.tag { display: inline-block; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.tag.mint { background: var(--mint); color: var(--mint-ink); border-color: transparent; }

/* ---------- answer ---------- */
.answer { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; background: linear-gradient(135deg, var(--surface) 55%, var(--mint)); }
@media (max-width: 760px) { .answer { grid-template-columns: 1fr; } }
.answer .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--mint-ink); background: var(--mint); border-radius: 999px; padding: 4px 12px 4px 8px; }
.answer .eyebrow svg { width: 16px; height: 16px; }
.answer h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 12px; line-height: 1.15; }
.answer .money-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-variant-numeric: tabular-nums; }
.answer .from { font-size: 18px; color: var(--muted); }
.answer .arrow { color: var(--muted); }
.answer .to { font-size: clamp(34px, 5vw, 48px); font-weight: 600; letter-spacing: -0.03em; }
.answer .say { color: var(--ink-2); margin-top: 10px; max-width: 52ch; }
.answer .period { font-size: 13px; color: var(--muted); margin-top: 12px; }
.stats { display: grid; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stat .k { font-size: 14px; color: var(--ink-2); }
.stat .k small { display: block; font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- leaderboard ---------- */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board > li { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.board > li.open { border-color: var(--axis); box-shadow: var(--shadow); }
.row { width: 100%; border: 0; background: transparent; text-align: left; display: grid; grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.4fr) 112px 92px 20px; gap: 14px; align-items: center; padding: 12px 14px; }
button.row:hover { background: var(--surface-2); }
.rank { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.rank.gold { background: #f6d77a; border-color: #e6bf4c; color: #4a3500; }
.who { display: grid; min-width: 0; }
.who b { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who small { color: var(--ink-2); font-size: 13px; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.bar { position: relative; height: 12px; border-radius: 999px; background: var(--grid); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--brand); }
.bar i.bench { background: var(--muted); }
.bar i.win { background: linear-gradient(90deg, #0f6b5c, #2fd3a5); }
.bar i.lost { background: var(--bad); opacity: .75; }
.bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--ink); opacity: .55; }
.val { text-align: right; font-variant-numeric: tabular-nums; }
.val b { display: block; font-size: 17px; font-weight: 600; }
.val small { font-size: 13px; font-weight: 500; }
.up { color: var(--good); }
.down { color: var(--bad); }
.drop { justify-self: end; font-size: 13px; font-weight: 500; color: var(--bad); background: var(--bad-bg); border-radius: 999px; padding: 3px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.drop.calm { color: var(--ink-2); background: var(--surface-2); }
.chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
li.open .chev { transform: rotate(180deg); }
.board-head { display: grid; grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.4fr) 112px 92px 20px; gap: 14px; padding: 0 15px 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.board-head span:nth-child(4), .board-head span:nth-child(5) { text-align: right; }
@media (max-width: 760px) {
  .board-head { display: none; }
  .row { grid-template-columns: 30px minmax(0, 1fr) auto 18px; grid-template-areas: "rank who val chev" "rank bar bar bar" "rank drop drop drop"; row-gap: 8px; column-gap: 12px; }
  .row .rank { grid-area: rank; align-self: start; }
  .row .who { grid-area: who; }
  .row .bar { grid-area: bar; }
  .row .val { grid-area: val; }
  .row .drop { grid-area: drop; justify-self: start; }
  .row .chev { grid-area: chev; }
}

.detail { border-top: 1px solid var(--line); padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; background: var(--surface-2); }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; padding: 16px; } }
.detail p.how { color: var(--ink-2); margin-top: 6px; }
.now { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.now .pill { font-weight: 600; font-size: 13px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.in { background: var(--good-bg); color: var(--good); }
.pill.out { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail .chart-title { font-weight: 600; }
.detail .chart-sub { font-size: 14px; color: var(--ink-2); margin: 2px 0 10px; }

/* ---------- legend + toggle + charts ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.legend button, .legend span.key { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 9px; font-size: 13px; font-weight: 500; color: var(--ink); }
.legend button[aria-pressed="false"] { color: var(--muted); background: transparent; }
.legend button[aria-pressed="false"] .sw { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 38px; height: 22px; border-radius: 999px; background: var(--axis); position: relative; transition: background .2s; flex: none; }
.toggle .track i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .track { background: var(--brand); }
.toggle input:checked + .track i { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

.chart { position: relative; width: 100%; height: 360px; touch-action: pan-y; }
.chart.small { height: 210px; }
@media (max-width: 560px) { .chart { height: 280px; } }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; stroke: none; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; font-family: inherit; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .series path:not([fill]) { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.tooltip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); min-width: 200px; }
.tooltip .t-date { opacity: .65; font-size: 12px; margin-bottom: 6px; }
.tooltip .t-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 1px 0; }
.tooltip .t-row span:first-child { display: inline-flex; align-items: center; gap: 7px; opacity: .85; }
.tooltip .t-row b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- lucky or skilled ---------- */
.rounds { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); gap: 12px; align-items: stretch; margin-top: 16px; }
@media (max-width: 680px) { .rounds { grid-template-columns: 1fr; } .rounds .to-arrow { transform: rotate(90deg); justify-self: center; } }
.round { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }
.round .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.round .lbl span { font-weight: 400; color: var(--muted); }
.round .big { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.round p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.to-arrow { display: grid; place-items: center; color: var(--muted); }
.to-arrow svg { width: 24px; height: 24px; }
.verdict-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; }
.verdict-pill svg { width: 18px; height: 18px; stroke-width: 2.4; }
.verdict-pill.good { background: var(--good-bg); color: var(--good); }
.verdict-pill.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- race tab ---------- */
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--good); background: var(--good-bg); padding: 5px 12px; border-radius: 999px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.status-row .meta { color: var(--ink-2); font-size: 14px; }
.ai-head { display: flex; align-items: center; gap: 12px; }
.ai-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(160deg, #6250d6, #9085e9); color: #fff; flex: none; }
.ai-badge svg { width: 22px; height: 22px; }
.calls { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.call { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }
.call .lbl { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.call .pct { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; }
.call .pct small { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.meter { height: 8px; border-radius: 999px; background: var(--grid); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6250d6, #9085e9); }
.call p { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.notice { display: flex; gap: 12px; align-items: start; background: var(--surface-2); border: 1px dashed var(--axis); border-radius: var(--r-md); padding: 14px 16px; color: var(--ink-2); font-size: 15px; margin-top: 14px; }
.log { list-style: none; margin: 8px 0 0; padding: 0; }
.log li { border-top: 1px solid var(--line); padding: 12px 0; }
.log li:first-child { border-top: 0; }
.log summary { cursor: pointer; display: flex; gap: 8px 14px; flex-wrap: wrap; font-size: 15px; align-items: center; }
.log summary b { font-weight: 600; min-width: 100px; }
.log .reasons { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }

/* ---------- learn ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 16px !important; }
.tile { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }
.tile-head { display: flex; align-items: center; gap: 8px; }
.tile .ic { color: var(--brand); flex: none; display: inline-flex; }
.tile .ic svg { width: 20px; height: 20px; }
.tile p, .word p { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.words { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 16px !important; }
.word { border-top: 1px solid var(--line); padding-top: 12px; }
.word h3 { color: var(--brand-ink); }
.checklist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 36px; min-height: 26px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e6b5c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 36px; }

/* =========================================================
   Dashboard (first screen), after the reference app view
   ========================================================= */
#tab-dash { position: relative; z-index: 0; }
.band { position: absolute; left: 0; right: 0; top: 0; height: 250px; z-index: -1;
  background:
    radial-gradient(900px 260px at 80% -20%, rgba(143, 227, 197, .30), transparent 60%),
    linear-gradient(180deg, #072e29 0%, #0b4a41 55%, #0f6b5c 85%, var(--page) 100%); }
.dash { padding-top: 26px; padding-bottom: 32px; }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; color: #fff; margin-bottom: 20px; }
.hello { color: rgba(255, 255, 255, .7); font-size: 14px; }
.dash-title { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.dash-actions { display: flex; align-items: center; gap: 8px; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: rgba(255, 255, 255, .8); margin-right: 6px; }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.live-dot.stale i { background: #f0b44c; box-shadow: none; }

.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 18px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: #0f6b5c; color: #fff; }
.btn-primary:hover { background: #0b5a4d; }
.btn-light { background: #fff; color: #0c1f1c; border-color: rgba(12, 31, 28, .1); }
.btn-light:hover { background: #f1f5f4; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-main, .dash-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.dash .card { padding: 18px; border-radius: 16px; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.dash .card h2 { font-size: 16px; }
.muted-sm { font-size: 13px; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 13px; padding: 0; }

/* tickers */
.tickers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .tickers { grid-template-columns: 1fr; } }
.ticker { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 4px 10px; align-items: center; transition: border-color .15s, box-shadow .15s; }
.ticker:hover { border-color: var(--axis); }
.ticker[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.ticker .tk-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.ticker .tk-name small { color: var(--muted); font-weight: 500; }
.ticker .tk-price { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ticker svg.spark { grid-row: 1 / span 3; grid-column: 2; width: 96px; height: 44px; }
.coin-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.chg { display: inline-flex; align-items: center; justify-self: start; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.chg.up { background: var(--good-bg); color: var(--good); }
.chg.down { background: var(--bad-bg); color: var(--bad); }

/* price chart card */
.chart-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.price-head .lbl { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.price-head .big { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); padding: 3px; border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.seg-wide { display: flex; flex: 1; }
.seg-wide button { flex: 1; padding: 8px; font-size: 14px; }
.chart-split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .chart-split { grid-template-columns: 1fr; } .chart-split .signals { order: 2; } }
#price-chart { height: auto; min-height: 320px; }

/* signals */
.signals { border-right: 1px solid var(--line); padding-right: 18px; display: grid; align-content: start; gap: 10px; }
@media (max-width: 760px) { .signals { border-right: 0; padding-right: 0; border-top: 1px solid var(--line); padding-top: 14px; } }
.sig-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.info { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); cursor: help; font-weight: 600; }
.vote { display: flex; gap: 4px; }
.vote i { flex: 1; height: 8px; border-radius: 999px; background: var(--grid); }
.vote i.on { background: linear-gradient(90deg, #0f6b5c, #2fd3a5); }
.vote-text { font-size: 13px; color: var(--ink-2); }
.vote-text b { color: var(--ink); }
.sig { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid var(--line); }
.sig .nm { font-size: 13px; font-weight: 600; display: grid; min-width: 0; }
.sig .nm small { font-weight: 500; color: var(--muted); font-size: 12px; }
.sig .nm small.ok { color: var(--good); }
.state { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.state.own { background: var(--good-bg); color: var(--good); }
.state.wait { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.state.ai { background: color-mix(in srgb, var(--s7) 14%, transparent); color: var(--s7); }
.fine { font-size: 12px; color: var(--muted); }

/* wallet */
.dash .wallet { background: linear-gradient(160deg, #0b4a41, #0f6b5c 60%, #13a085); color: #fff; border: 0; position: relative; overflow: hidden; }
.wallet::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(rgba(143, 227, 197, .35), transparent 70%); pointer-events: none; }
.wallet .w-lbl { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(255, 255, 255, .75); }
.wallet .w-val { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.wallet .w-sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, .8); margin-top: 2px; flex-wrap: wrap; }
.wallet .chg.up { background: rgba(143, 227, 197, .18); color: #b8f2dc; }
.wallet .chg.down { background: rgba(255, 120, 110, .18); color: #ffc2bc; }
.wallet .w-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.wallet .w-split div { background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: rgba(255, 255, 255, .7); }
.wallet .w-split b { display: block; color: #fff; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet .w-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.wallet .w-btns .btn-primary { background: #fff; color: #0b4a41; }
.wallet .w-btns .btn-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .2); }
.wallet .reset { position: relative; z-index: 1; border: 0; background: none; color: rgba(255, 255, 255, .6); font-size: 12px; padding: 0; margin-top: 10px; text-decoration: underline; }

/* holdings + race lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; display: grid; }
.list .nm small { font-size: 12px; color: var(--muted); font-weight: 500; }
.list .rt { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; display: grid; }
.list .rt small { font-size: 12px; font-weight: 600; }
.list .pos { width: 22px; font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; }
.empty { font-size: 14px; color: var(--muted); padding: 6px 0; }

/* transactions */
.table-wrap { overflow-x: auto; contain: inline-size; }
table.tx { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.tx th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; background: var(--surface-2); }
.tx th:first-child { border-radius: 8px 0 0 8px; }
.tx th:last-child { border-radius: 0 8px 8px 0; }
.tx td { padding: 11px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx tr:last-child td { border-bottom: 0; }
.tx .r { text-align: right; }
.tx .side { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.tx .side.buy { background: var(--good-bg); color: var(--good); }
.tx .side.sell { background: var(--bad-bg); color: var(--bad); }
.coin-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.coin-cell .coin-ic { width: 20px; height: 20px; font-size: 10px; }

/* trade sheet */
dialog.sheet { border: 0; padding: 0; border-radius: 20px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
dialog.sheet::backdrop { background: rgba(4, 20, 17, .55); backdrop-filter: blur(3px); }
#trade-form { padding: 18px; display: grid; gap: 14px; }
.sheet-head { display: flex; gap: 10px; align-items: center; }
.icon-btn { border: 1px solid var(--line); background: var(--surface-2); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.coin-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.coin-pick button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 10px 8px; display: grid; justify-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.coin-pick button small { font-weight: 500; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.coin-pick button[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--mint); }
.amount { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.amount-box { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; background: var(--surface-2); }
.amount-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.amount-box b { font-size: 26px; color: var(--muted); font-weight: 500; }
.amount-box input { border: 0; background: transparent; outline: none; font-size: 30px; font-weight: 600; width: 100%; padding: 6px 0; letter-spacing: -0.02em; color: var(--ink); }
/* ---------- UX polish: welcome, popover, toast, action bar, skeletons ---------- */
.welcome { position: relative; display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 12px 56px 12px 14px; margin: -6px 0 16px; color: #fff; backdrop-filter: blur(6px); }
.welcome ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; flex: 1; }
@media (max-width: 760px) { .welcome ol { grid-template-columns: 1fr; gap: 10px; } }
.welcome li { display: flex; gap: 10px; align-items: start; }
.welcome li > span { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #0b3d36; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.welcome b { display: block; font-size: 14px; font-weight: 600; }
.welcome small { display: block; font-size: 13px; color: rgba(255, 255, 255, .72); }
.welcome-x { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; }

.info { background: none; padding: 0; }
button.info:hover { border-color: var(--axis); color: var(--ink); }
.info.on-dark { border-color: rgba(255, 255, 255, .3); color: rgba(255, 255, 255, .75); position: relative; z-index: 1; }
.info.on-dark:hover { color: #fff; border-color: #fff; }
.popover { position: fixed; z-index: 40; max-width: 280px; background: var(--ink); color: var(--surface); font-size: 13px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
.toast svg { width: 18px; height: 18px; color: var(--accent); stroke-width: 2.4; flex: none; }
@media (max-width: 760px) { .toast { bottom: 88px; } }

.action-bar { display: none; }
@media (max-width: 1000px) {
  body.on-dash .action-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  body.on-dash .action-bar .btn { padding: 12px; font-size: 15px; }
  body.on-dash .foot { padding-bottom: 96px; }
}

.skel { background: linear-gradient(90deg, var(--grid) 0%, var(--surface-2) 50%, var(--grid) 100%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; border-radius: 8px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.ticker.loading { display: grid; gap: 8px; grid-template-columns: 1fr; min-height: 98px; }

.ticker .tk-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.range-chg { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.range-chg b { font-weight: 600; }

/* signals: plain verdict + tap-to-explain rows */
.verdict { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.verdict .v-label { font-size: 15px; font-weight: 700; }
.verdict .v-label.own { color: var(--good); }
.verdict .v-label.wait { color: var(--ink-2); }
.verdict .v-label.mixed { color: #b77900; }
.verdict p { font-size: 13px; color: var(--ink-2); }
details.sig { display: block; padding-top: 0; }
details.sig summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0 0; cursor: pointer; }
details.sig summary::-webkit-details-marker { display: none; }
details.sig summary .nm::after { content: ""; }
details.sig .explain { font-size: 13px; color: var(--ink-2); margin: 6px 0 2px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
details.sig[open] summary .state { box-shadow: 0 0 0 1px var(--axis); }
.btn[aria-disabled="true"] { opacity: .5; }

/* ---------- 12 coins: scrolling ticker strip, compact pickers ---------- */
.tickers { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 2px 2px 8px; margin: -2px -2px -8px; }
.tickers > * { scroll-snap-align: start; }
.tickers { scrollbar-width: none; }
.tickers::-webkit-scrollbar { display: none; }
.strip-head { display: flex; justify-content: space-between; align-items: center; color: rgba(255, 255, 255, .8); font-size: 13px; margin-bottom: 8px; }
.strip-head b { color: #fff; font-weight: 600; }
.strip-nav { display: flex; gap: 6px; }
.strip-nav .icon-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.strip-nav .icon-btn:hover { background: rgba(255, 255, 255, .2); }
@media (max-width: 640px) { .tickers { grid-auto-columns: 78%; grid-template-columns: none; } }
.coin-pick { grid-template-columns: repeat(4, 1fr); max-height: 220px; overflow-y: auto; }
@media (max-width: 420px) { .coin-pick { grid-template-columns: repeat(3, 1fr); } }
.coin-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.coin-cards .coin { padding: 10px 12px; }
.coin-cards .coin .price { font-size: 17px; margin-top: 4px; }

/* ---------- alerts ---------- */
.with-ic { display: flex; align-items: center; gap: 8px; }
.bell { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--mint); color: var(--mint-ink); }
.bell svg { width: 16px; height: 16px; }
.alerts-pitch { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.alerts-on { display: flex; gap: 10px; align-items: start; margin-bottom: 12px; }
.alerts-on b { display: block; font-size: 14px; }
.alerts-on small { display: block; font-size: 13px; color: var(--ink-2); }
.on-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-top: 6px; flex: none; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed li.empty { display: block; }
.feed b { display: block; font-size: 14px; font-weight: 600; }
.feed small { display: block; font-size: 13px; color: var(--ink-2); }
.feed time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.feed-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.feed-ic.own { background: var(--good-bg); color: var(--good); border-color: transparent; }
.feed-ic.ai { color: var(--s7); }

.alerts-form { padding: 18px; display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field-lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row b { display: block; font-size: 15px; font-weight: 600; }
.switch-row small { display: block; font-size: 13px; color: var(--ink-2); }
.switch-row select { padding: 1px 6px; min-height: 0; font-size: 13px; border-radius: 6px; }
.targets { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.targets li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.targets li span:not(.coin-ic) { flex: 1; }
.targets li.empty { border: 0; background: none; padding: 0; color: var(--muted); }
.target-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.target-add select { flex: 0 0 auto; }
.target-add .amount-box { flex: 1 1 140px; min-width: 0; }
.target-add select { border-radius: 10px; }
.amount-box.small { padding: 0 10px; border-radius: 10px; }
.amount-box.small b { font-size: 15px; }
.amount-box.small input { font-size: 15px; padding: 8px 0; }
.icon-btn.small { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.small svg { width: 14px; height: 14px; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.link-btn.danger { color: var(--bad); }

.amount-box input::-webkit-outer-spin-button, .amount-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-box input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.trade-sum { font-size: 14px; color: var(--ink-2); min-height: 21px; }
.trade-sum.err { color: var(--bad); }
#trade-form .fine { text-align: center; margin-top: -4px; }
