/* FOMO Desk v2 — design system (Apple-light). Spec: docs/design/desk-v2.md §2–3.
 *
 * Pages add their own v2/pages/<id>.css and must build from these tokens and
 * components — no new colours, radii or shadows. Money is the only thing that
 * wears colour (up/down/warn); the accent colours links, selection and focus,
 * never a number.
 *
 *   layout      .wrap .grid .span-N (12 cols; all 12 ≤ 760 px) .stack .row .sec .sec-h
 *   type        .t-display .t-title .t-section .t-headline .t-body .t-cap .t-cap2 .num .up .down .warn .muted
 *   surfaces    .card (.card-h .card-t .card-sub .card-f) .card.link .inset .tile .kpi
 *   controls    .btn (.btn-2 .btn-ghost .btn-sm) .link .seg (+ .seg-ind) .tabs (+ .tabs-ind) .icon-btn
 *   marks       .chip (.up .down .warn .accent .ghost) .badge .dot .meter .ring .rp (R progress)
 *   data        .tbl (.tbl-stack on phones) .dl (label/value grid) .ex (TP / stop outcome table)
 *   states      .sk (skeleton) .empty .error .stale · body.is-offline dims [data-live]
 *   overlays    .sheet-host .sheet .toast-host .toast
 *   phone chrome .tabbar (.tb-tabs .tb-lens .tb-tab .tb-mini, .mini) .nav-gear .nav-title .tb-fade — driven by core.js
 *   motion      .reveal (+ .in) .flash-up .flash-down · prefers-reduced-motion respected
 */

/* ── tokens ────────────────────────────────────────────────────────────── */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f2f2f5;          /* wells, segmented track */
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --hair: rgba(0, 0, 0, .08);
  --hair-2: rgba(0, 0, 0, .14);
  --track: rgba(0, 0, 0, .065);   /* meter / ring / rail track */

  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-fill: rgba(0, 113, 227, .10);
  --focus: 0 0 0 3px rgba(0, 113, 227, .35);

  --up: #0a8a43;       --up-fill: rgba(52, 199, 89, .14);   --up-mark: #34c759;
  --down: #d7263d;     --down-fill: rgba(255, 59, 48, .12); --down-mark: #ff453a;
  --warn: #b25e00;     --warn-fill: rgba(255, 159, 10, .14); --warn-mark: #ff9f0a;
  --ok-mark: #34c759;

  --font: "Inter", "Anuphan", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Noto Sans Thai", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, "Anuphan", "Noto Sans Thai", monospace;

  --r-card: 22px;
  --r-sm: 14px;
  --r-xs: 10px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .06);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .05), 0 18px 44px rgba(0, 0, 0, .10);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06);
  --shadow-sheet: 0 40px 100px rgba(0, 0, 0, .24);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --t-fast: .18s;
  --t: .35s;
  /* real springs (damped oscillators sampled into linear(); fallbacks below for old engines)
   *   --spring-lens  ζ .68, overshoot 5%  — tab lens, page slide
   *   --spring-pop   ζ .62, overshoot 8%  — press release, gear, mini pill content
   *   --spring-soft  ζ .75, overshoot 3%  — tab bar minimise / expand morph */
  --spring-lens: cubic-bezier(.34, 1.3, .64, 1);
  --spring-pop: cubic-bezier(.34, 1.45, .64, 1);
  --spring-soft: cubic-bezier(.3, 1.15, .6, 1);

  --max: 1200px;
  --pad: 32px;            /* card padding */
  --gutter: 28px;         /* page side padding */
  --gap: 20px;            /* grid gap */
  --nav-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* /charts.js reads these once (tok()). --panel is the ring behind chart dots. */
  --panel: #ffffff;
  --chart-grid: rgba(0, 0, 0, .06);
  --chart-axis: rgba(0, 0, 0, .16);
  --chart-label: #86868b;
  --chart-ink: #1d1d1f;
  --chart-series: #0071e3;
  --chart-up: #0a8a43;
  --chart-down: #d7263d;
  --chart-warn: #b25e00;
  --chart-entry: rgba(29, 29, 31, .42);
  --chart-tag: #ececf0;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-lens: linear(0, .0574 4.5%, .1919 9.1%, .359 13.6%, .528 18.2%, .6803 22.7%, .8063 27.3%, .9031 31.8%, .972 36.4%, 1.0166 40.9%, 1.0419 45.5%, 1.0528 50%, 1.0538 54.5%, 1.0487 59.1%, 1.0404 63.6%, 1.0312 68.2%, 1.0222 72.7%, 1.0145 77.3%, 1.0083 81.8%, 1.0036 86.4%, 1.0004 90.9%, .9985 95.5%, 1);
    --spring-pop: linear(0, .0689 4.5%, .2291 9.1%, .4241 13.6%, .6153 18.2%, .78 22.7%, .9077 27.3%, .9967 31.8%, 1.0509 36.4%, 1.0773 40.9%, 1.0834 45.5%, 1.0765 50%, 1.0626 54.5%, 1.0462 59.1%, 1.0304 63.6%, 1.017 68.2%, 1.0067 72.7%, .9996 77.3%, .9954 81.8%, .9934 86.4%, .9931 90.9%, .9937 95.5%, 1);
    --spring-soft: linear(0, .0474 4.5%, .1593 9.1%, .3004 13.6%, .447 18.2%, .584 22.7%, .7032 27.3%, .8013 31.8%, .878 36.4%, .9351 40.9%, .9753 45.5%, 1.0018 50%, 1.0176 54.5%, 1.0257 59.1%, 1.0283 63.6%, 1.0274 68.2%, 1.0245 72.7%, 1.0206 77.3%, 1.0164 81.8%, 1.0125 86.4%, 1.009 90.9%, 1.0061 95.5%, 1);
  }
}

/* ── base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.47 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
::selection { background: rgba(0, 113, 227, .18); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip:focus { left: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── type ──────────────────────────────────────────────────────────────── */
.t-display { font-size: clamp(48px, 6.4vw, 72px); line-height: 1.02; font-weight: 600; letter-spacing: -.03em; }
.t-title   { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -.022em; margin: 0; }
.t-section { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.2; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.t-headline{ font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -.012em; margin: 0; }
.t-body    { font-size: 17px; line-height: 1.47; }
.t-cap     { font-size: 13px; line-height: 1.38; color: var(--text-2); }
.t-cap2    { font-size: 12px; line-height: 1.33; color: var(--text-3); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.unit { font-size: .5em; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-left: .18em; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* ── layout ────────────────────────────────────────────────────────────── */
.page-host { display: block; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 96px; outline: none; }
.page { animation: page-in .42s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-12 { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.sec { margin-top: 56px; }
.sec:first-child { margin-top: 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 4px 18px; }
.sec-h .t-cap { margin-left: 10px; }
.page-head { margin: 12px 4px 32px; }
.page-head .t-cap { margin-top: 8px; font-size: 17px; }

/* ── nav ───────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
.nav-in { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; height: 100%; padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -.01em; justify-self: start; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { position: relative; color: var(--text); opacity: .72; font-size: 13.5px; padding: 6px 12px; border-radius: var(--r-pill); transition: opacity var(--t-fast), background var(--t-fast); }
.nav-links a:hover { opacity: 1; text-decoration: none; background: rgba(0, 0, 0, .04); }
.nav-links a[aria-current="page"] { opacity: 1; font-weight: 600; }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--text); }
.nav-status { justify-self: end; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 7px; }
.live-age { font-variant-numeric: tabular-nums; }
.live.stale .live-age { color: var(--warn); }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-mark); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok-mark); opacity: 0; }
.live.pulse .live-dot::after { animation: live-pulse 1.1s var(--ease); }
@keyframes live-pulse { 0% { opacity: .7; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.6); } }
.live.stale .live-dot { background: var(--warn-mark); }
body.is-offline .live-dot { background: var(--text-3); }
.reconnect { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: var(--r-pill); background: var(--warn-fill); color: var(--warn); font-weight: 500; animation: pill-in .3s var(--spring); }
@keyframes pill-in { from { opacity: 0; transform: scale(.9); } }
.spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.nav-console { color: var(--accent); font-weight: 500; font-size: 13px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--accent-fill); }
.nav-console:hover { text-decoration: none; background: rgba(0, 113, 227, .16); }

/* ── phones (≤ 760 px): iOS 26 "Liquid Glass" chrome ─────────────────────
 * Top bar: clear at rest; its glass (--nav-glass 0→1) and the page's large
 * title folding into it (--nav-t 0→1) follow the scroll (core.js chrome).
 * ระบบ moves to the gear. Tab bar: floating capsule of 5 tabs, a glass lens
 * that springs to the active tab, outline → filled glyphs, squish on press,
 * minimises to a centred pill while scrolling down (.mini), steps aside for
 * sheets and the on-screen keyboard (body.sheet-open / body.kb-open). */
.tabbar, .nav-gear, .nav-title, .tb-fade { display: none; }
@media (max-width: 760px) {
  :root {
    --gutter: 16px; --pad: 18px; --gap: 14px; --nav-h: 48px;
    --tb-h: 62px; --tb-mini-h: 46px; --tb-side: 12px;
    --tb-b: max(12px, calc(var(--safe-b) - 6px));
    --tb-full: min(calc(var(--vw, 100vw) - 2 * var(--tb-side)), 500px);
    --glass-rim: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -.5px 0 rgba(255, 255, 255, .3);
  }
  html { scroll-padding-bottom: calc(var(--tb-h) + var(--tb-b) + 16px); }

  /* top bar */
  .nav { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--nav-glass, 0);
    background: rgba(248, 248, 250, .76); box-shadow: 0 .5px 0 rgba(0, 0, 0, .13);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  }
  .nav-in { position: relative; z-index: 1; grid-template-columns: 1fr auto; }
  .nav-links, .nav-console, .live-age { display: none; }
  .brand span { font-size: 16px; opacity: calc(1 - 2 * var(--nav-t, 0)); } /* gone by mid-fold, so it never overlaps a long title (MINA/USDT at 360 px) */
  body.is-offline .brand span { display: none; }
  .nav-status { gap: 12px; }
  .nav-title {
    display: block; position: absolute; z-index: 1; left: 50%; top: 0; height: var(--nav-h); max-width: calc(100% - 184px);
    font-size: 16px; line-height: var(--nav-h); font-weight: 600; letter-spacing: -.014em; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
    opacity: var(--nav-t, 0); transform: translate(-50%, calc((1 - var(--nav-t, 0)) * 8px));
  }
  body.is-offline .nav-title { visibility: hidden; } /* the reconnect pill holds the centre while offline */
  .nav-gear {
    position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; margin-right: -3px; border-radius: 50%;
    color: var(--text); background: rgba(255, 255, 255, .66);
    -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
    box-shadow: var(--glass-rim), 0 0 0 .5px rgba(0, 0, 0, .08), 0 3px 12px rgba(0, 0, 0, .08);
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
    transition: transform .55s var(--spring-pop), color .2s var(--ease), background .2s var(--ease);
  }
  .nav-gear::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; } /* 46 px hit area */
  .nav-gear:hover { text-decoration: none; }
  .nav-gear svg { width: 21px; height: 21px; }
  .nav-gear .f, .nav-gear[aria-current] .o { display: none; }
  .nav-gear[aria-current] .f { display: block; }
  .nav-gear[aria-current] { color: var(--accent); background: rgba(255, 255, 255, .88); }
  .nav-gear.press { transform: scale(.88); transition: transform .12s var(--ease); }
  .nav-gear:focus-visible { border-radius: 50%; }

  /* tab bar: the capsule is the glass; tabs and the mini pill are two layers inside it */
  .tabbar {
    display: block; position: fixed; z-index: 45; left: 50%; bottom: var(--tb-b);
    width: var(--tb-full); height: var(--tb-h); border-radius: 999px;
    transform: translate3d(-50%, 0, 0);
    background: linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .56));
    -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%);
    box-shadow: var(--glass-rim), 0 0 0 .5px rgba(0, 0, 0, .1), 0 14px 34px -10px rgba(0, 0, 0, .26), 0 3px 10px rgba(0, 0, 0, .07);
    overflow: hidden; isolation: isolate;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
    transition: width .62s var(--spring-soft), height .62s var(--spring-soft), transform .62s var(--spring-soft), opacity .3s var(--ease);
  }
  /* liquid rim: bright top-left edge fading round to a softer bottom-right catchlight */
  .tabbar::before {
    content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(155deg, rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .4) 28%, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, .55) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  .tb-tabs {
    position: absolute; left: 50%; top: 50%; width: var(--tb-full); height: var(--tb-h); padding: 0 5px;
    display: grid; grid-template-columns: repeat(var(--tb-n, 5), minmax(0, 1fr));
    transform: translate(-50%, -50%);
    transition: opacity .26s var(--ease), transform .62s var(--spring-soft), filter .3s var(--ease);
  }
  .tb-lens {
    position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 0; width: 0; pointer-events: none;
    transition: transform .5s var(--spring-lens), width .5s var(--spring-lens), opacity .22s var(--ease);
  }
  .tb-lens > i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(180deg, rgba(120, 120, 128, .1), rgba(120, 120, 128, .16));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 0 0 .5px rgba(0, 0, 0, .035);
  }
  .tb-lens.off { opacity: 0; }
  .tabbar.no-anim, .tabbar.no-anim * { transition: none !important; }
  .tb-tab {
    position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-width: 44px; height: 100%;
    color: #3a3a3c; text-decoration: none !important; outline: none;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-touch-callout: none;
  }
  .tb-it { display: flex; flex-direction: column; align-items: center; gap: 1px; transition: transform .55s var(--spring-pop); }
  .tb-tab.press .tb-it { transform: scale(.88); transition: transform .12s var(--ease); }
  .tb-ico { position: relative; width: 27px; height: 27px; }
  .tb-ico svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .16s var(--ease), transform .5s var(--spring-pop); }
  .tb-ico .f { opacity: 0; transform: scale(.55); }
  .tb-tab[aria-current] { color: var(--accent); }
  .tb-tab[aria-current] .tb-ico .o { opacity: 0; transform: scale(1.12); }
  .tb-tab[aria-current] .tb-ico .f { opacity: 1; transform: none; }
  .tb-l { font-size: 10.5px; line-height: 14px; font-weight: 500; letter-spacing: .005em; white-space: nowrap; color: rgba(60, 60, 67, .6); transition: color .2s var(--ease); }
  .tb-tab[aria-current] .tb-l { color: var(--accent); font-weight: 600; }
  .tb-tab:focus-visible { box-shadow: none; }
  .tb-tab:focus-visible::after { content: ""; position: absolute; inset: 6px 1px; border-radius: 999px; box-shadow: var(--focus); }

  /* minimised: a centred pill with the active tab's glyph + name */
  .tb-mini {
    position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; border: 0; background: none;
    color: var(--accent); cursor: pointer; opacity: 0; pointer-events: none; transform: scale(.7);
    transition: opacity .16s var(--ease), transform .5s var(--spring-pop);
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }
  .tb-mini-in { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; transition: transform .5s var(--spring-pop); }
  .tb-mini svg { width: 21px; height: 21px; }
  .tb-mini.press .tb-mini-in { transform: scale(.88); transition: transform .12s var(--ease); }
  .tb-mini:focus-visible { box-shadow: none; }
  .tb-mini:focus-visible .tb-mini-in { box-shadow: var(--focus); border-radius: 999px; }
  .tabbar.mini { width: var(--tb-mini-w, 128px); height: var(--tb-mini-h); }
  .tabbar.mini .tb-tabs { opacity: 0; transform: translate(-50%, -50%) scale(.84); filter: blur(3px); pointer-events: none; }
  .tabbar.mini .tb-mini { opacity: 1; transform: none; pointer-events: auto; transition-delay: .07s, .03s; }

  /* out of the way for a sheet or the on-screen keyboard */
  body.sheet-open .tabbar, body.kb-open .tabbar {
    transform: translate3d(-50%, calc(100% + var(--tb-b) + 24px), 0); opacity: 0; pointer-events: none;
    transition: transform .42s var(--ease), opacity .28s var(--ease);
  }
  /* soft scroll-edge under the bar (iOS 26): content dissolves instead of butting into the glass */
  .tb-fade {
    display: block; position: fixed; z-index: 44; left: 0; right: 0; bottom: 0; height: calc(var(--tb-h) + var(--tb-b) + 22px); pointer-events: none;
    background: linear-gradient(to top, rgba(245, 245, 247, .9) 0%, rgba(245, 245, 247, .55) 45%, rgba(245, 245, 247, 0) 100%);
    transition: opacity .3s var(--ease);
  }
  body.sheet-open .tb-fade, body.kb-open .tb-fade { opacity: 0; }

  .page-host { padding: 18px var(--gutter) calc(var(--tb-h) + var(--tb-b) + 28px); }
  .grid > [class*="span-"] { grid-column: 1 / -1; }
  .sec { margin-top: 40px; }
}

/* ── page transitions: core.js wraps tab switches in document.startViewTransition.
 * The bars are lifted out of the snapshot (html.fx-vt names them only for the
 * duration — a permanent view-transition-name would cut their backdrop blur)
 * so they stay live while the page slides toward the tab you picked. */
html.fx-vt .nav { view-transition-name: fx-nav; }
html.fx-vt .tabbar { view-transition-name: fx-tabbar; }
html.fx-vt .tb-fade { view-transition-name: fx-fade; }
::view-transition { background: var(--bg); }
::view-transition-group(fx-nav), ::view-transition-group(fx-tabbar), ::view-transition-group(fx-fade),
::view-transition-new(fx-nav), ::view-transition-new(fx-tabbar), ::view-transition-new(fx-fade) { animation: none; }
::view-transition-old(fx-nav), ::view-transition-old(fx-tabbar), ::view-transition-old(fx-fade) { display: none; }
::view-transition-old(root) { animation: vt-out .22s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .5s var(--spring-lens) both; }
html[data-vt="back"]::view-transition-old(root) { animation-name: vt-out-back; }
html[data-vt="back"]::view-transition-new(root) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-24px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(32px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(24px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-32px); } }
.page.vt-in { animation: none; }

/* ── cards & tiles ─────────────────────────────────────────────────────── */
.card { position: relative; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--pad); min-width: 0; }
.card.tight { padding: 20px; }
.card.link { cursor: pointer; transition: transform var(--t) var(--spring), box-shadow var(--t) var(--ease); }
.card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.card.link:active { transform: translateY(0) scale(.99); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-t { font-size: 17px; font-weight: 600; letter-spacing: -.012em; margin: 0; line-height: 1.3; }
.card-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.card-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 13px; color: var(--text-2); }
.inset { background: var(--surface-2); border-radius: var(--r-sm); padding: 16px; box-shadow: inset 0 0 0 1px var(--hair); }
.kpi { min-width: 0; }
.kpi-l { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.kpi-v { font-size: 28px; line-height: 1.12; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v.sm { font-size: 21px; }
.kpi-s { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.divider { height: 1px; background: var(--hair); margin: 18px 0; border: 0; }

/* ── buttons & links ───────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 20px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background var(--t-fast), transform .15s var(--spring); text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.97); }
.btn-2 { background: rgba(0, 0, 0, .05); color: var(--text); }
.btn-2:hover { background: rgba(0, 0, 0, .08); }
.btn-ghost { background: transparent; color: var(--accent); padding: 0 10px; }
.btn-ghost:hover { background: var(--accent-fill); }
.btn-sm { height: 30px; padding: 0 14px; font-size: 13px; }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 14px; font-weight: 400; cursor: pointer; background: none; border: 0; padding: 0; white-space: nowrap; }
.link::after { content: "›"; font-size: 1.25em; line-height: 1; margin-left: 3px; transform: translateY(-.04em); transition: transform var(--t-fast) var(--ease); }
.link:hover::after { transform: translate(2px, -.04em); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .05); color: var(--text); cursor: pointer; transition: background var(--t-fast), transform .15s var(--spring), opacity var(--t-fast); }
.icon-btn:hover { background: rgba(0, 0, 0, .09); }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

/* ── segmented control (sliding pill) ──────────────────────────────────── */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .055); isolation: isolate; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > button, .seg > a { position: relative; z-index: 1; border: 0; background: none; padding: 7px 16px; border-radius: var(--r-pill); color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color var(--t-fast); text-decoration: none !important; }
.seg > [aria-selected="true"] { color: var(--text); }
.seg-ind { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--r-pill); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04); transition: transform .4s var(--spring), width .4s var(--spring); }
.seg.no-anim .seg-ind { transition: none; }
.seg.full { display: flex; }
.seg.full > button, .seg.full > a { flex: 1; }

/* tabs (underline, slides) */
.tabs { position: relative; display: flex; gap: 26px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > button, .tabs > a { border: 0; background: none; padding: 12px 0; color: var(--text-2); font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.tabs > [aria-selected="true"] { color: var(--text); }
.tabs .count { font-size: 12px; color: var(--text-3); margin-left: 5px; font-weight: 400; }
.tabs-ind { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; border-radius: 2px; background: var(--text); transition: transform .4s var(--spring), width .4s var(--spring); }

/* ── chips, badges, dots ───────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .05); color: var(--text); font-size: 12.5px; font-weight: 500; white-space: nowrap; letter-spacing: 0; line-height: 1; }
.chip.sm { height: 22px; padding: 0 9px; font-size: 11.5px; }
.chip.up { background: var(--up-fill); color: var(--up); }
.chip.down { background: var(--down-fill); color: var(--down); }
.chip.warn { background: var(--warn-fill); color: var(--warn); }
.chip.accent { background: var(--accent-fill); color: var(--accent); }
.chip.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--text-2); }
.chip.solid { background: var(--text); color: #fff; }
a.chip:hover, button.chip:hover { text-decoration: none; filter: brightness(.97); }
button.chip { border: 0; cursor: pointer; }
.chip svg { width: 13px; height: 13px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .07); color: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok, .dot.up { background: var(--ok-mark); }
.dot.warn { background: var(--warn-mark); }
.dot.down, .dot.bad { background: var(--down-mark); }
.side { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 3px 7px; border-radius: 6px; }
.side.long { background: var(--up-fill); color: var(--up); }
.side.short { background: var(--down-fill); color: var(--down); }

/* ── meter (bar vs cap, optional ticks) ────────────────────────────────── */
.meter { position: relative; margin-top: 10px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.meter-top b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-bar { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--track); }
.meter-bar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--ok-mark); transition: width .9s var(--spring), background var(--t); }
.meter.warn .meter-bar > i { background: var(--warn-mark); }
.meter.down .meter-bar > i { background: var(--down-mark); }
.meter.neutral .meter-bar > i { background: var(--text-2); }
.meter-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(0, 0, 0, .28); }
.meter-ticks { position: relative; height: 16px; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.meter-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter-ticks span.end { transform: translateX(-100%); }

/* ── ring ──────────────────────────────────────────────────────────────── */
.ring { position: relative; flex: none; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); overflow: visible; }
.ring .r-track { stroke: var(--track); }
.ring .r-val { stroke: var(--ok-mark); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--spring), stroke var(--t); }
.ring.warn .r-val { stroke: var(--warn-mark); }
.ring.down .r-val { stroke: var(--down-mark); }
.ring .r-cap { stroke: var(--text); stroke-width: 2; }
.ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.05; }
.ring-c b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring-c small { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

/* ── R progress: stop ◀ entry ▶ target ─────────────────────────────────── */
.rp { position: relative; padding-top: 16px; }
.rp-rail { position: relative; height: 6px; border-radius: var(--r-pill); background: linear-gradient(to right, var(--down-fill) 0 var(--e), var(--up-fill) var(--e) 100%); }
.rp-fill { position: absolute; top: 0; bottom: 0; border-radius: var(--r-pill); background: var(--up-mark); transition: left .9s var(--spring), width .9s var(--spring); }
.rp.losing .rp-fill { background: var(--down-mark); }
.rp-entry { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); left: var(--e); }
.rp-mark { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--up-mark); box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(0, 0, 0, .25); transition: left .9s var(--spring); }
.rp.losing .rp-mark { background: var(--down-mark); }
.rp-mark.over { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; }
.rp-r { position: absolute; top: -2px; transform: translateX(-50%); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition: left .9s var(--spring); }
.rp-legs { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rp-legs span:nth-child(2) { position: absolute; left: var(--e); transform: translateX(-50%); color: var(--text-2); padding: 0 6px; background: var(--surface); }
.rp-legs { position: relative; }
.rp-legs b { font-weight: 500; color: var(--text-2); }
.rp.compact .rp-legs span:nth-child(2) { display: none; }
.rp.big .rp-rail { height: 10px; }
.rp.big .rp-mark { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.rp.big .rp-legs { font-size: 12.5px; }
.rp.big .rp-r { font-size: 13px; top: -6px; }
.rp.big { padding-top: 22px; }
/* high-water tick: the best mark the leg reached (FX.mfe) */
.rp-best { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--up-mark); opacity: .9; }
.rp.big .rp-best { top: -6px; bottom: -6px; }
/* max profit reached + give-back — ui.mfeLine */
.mfe-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 12.5px; color: var(--text-2); }
.mfe-line b { font-weight: 600; }
.mfe-line small { font-size: 11.5px; color: var(--text-3); }
.mfe-line .warn { color: var(--warn); }
.mfe-line .warn b { color: var(--warn); }
.dl-fit .dl { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }   /* few items: no empty cells */
@media (max-width: 760px) { .dl-fit .dl { grid-template-columns: minmax(0, 1fr); } }

/* ── table ─────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 0 12px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr.click { cursor: pointer; }
@media (max-width: 760px) {
  .tbl-stack thead { display: none; }
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
  .tbl-stack tr { padding: 12px 0; border-bottom: 1px solid var(--hair); }
  .tbl-stack tr:last-child { border-bottom: 0; }
  .tbl-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0 !important; text-align: right; }
  .tbl-stack td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; text-align: left; }
  .tbl-stack td:first-child { font-weight: 600; font-size: 15px; }
  .tbl-stack td:first-child::before { content: none; }
}

/* label / value grid (sheets, detail) */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--hair); border-radius: var(--r-sm); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); }
.dl > div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.dl dt, .dl .l { font-size: 12px; color: var(--text-3); margin: 0 0 3px; }
.dl dd, .dl .v { margin: 0; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dl .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* leg exits: "if the TP / the stop fills" — FX.ui.exits (one leg) and ui.exitsTotal (every leg) */
.ex { display: grid; gap: 8px; min-width: 0; }
.ex-t { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; font-variant-numeric: tabular-nums; }
.ex-t .ex-c-l { width: 40%; }
.ex-t th, .ex-t td { padding: 7px 0 7px 8px; border-top: 1px solid var(--hair); vertical-align: top; text-align: right; }
.ex-t th[scope="row"] { padding-left: 0; text-align: left; font-weight: 500; color: var(--text); }
.ex-t small { display: block; margin-top: 1px; font-size: 11px; font-weight: 400; line-height: 1.3; color: var(--text-3); }
.ex-t td { font-weight: 600; white-space: nowrap; }
.ex-t thead th { border-top: 0; padding-top: 0; padding-bottom: 8px; vertical-align: bottom; }
.ex-h { font-size: 12px; font-weight: 500; color: var(--text-2); }
.ex-t thead .ex-h:first-child { text-align: left; padding-left: 0; }
.ex-h span { display: inline-flex; align-items: center; gap: 6px; }
.ex-h i { width: 12px; height: 0; border-top: 2px solid; }
.ex-h.tp i { border-color: var(--up); }
.ex-h.sl i { border-color: var(--down); }
.ex-h b { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; color: var(--text); }
.ex-h .chip { margin-top: 4px; }
.ex-net td { font-size: 18px; letter-spacing: -.01em; }
.ex-mv { display: block; font-weight: 500; color: var(--text-2); }
.ex-sub th[scope="row"], .ex-sub td { font-size: 12.5px; font-weight: 400; color: var(--text-2); }
.ex-note { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-3); }
.ex-note.warn { color: var(--warn); }
.ex-note b { font-weight: 600; color: var(--text-2); }
.ex-tot { padding: 12px 14px 10px; border-radius: var(--r-sm); background: var(--surface-3); }

/* ── states ────────────────────────────────────────────────────────────── */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, #ececf0 0%, #f7f7f9 40%, #ececf0 80%); background-size: 240% 100%; animation: sk 1.5s ease-in-out infinite; }
.sk + .sk { margin-top: 10px; }
.sk.line { height: 12px; }
.sk.title { height: 22px; width: 45%; }
.sk.big { height: 56px; width: 60%; border-radius: 12px; }
.sk.block { height: 120px; border-radius: 14px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -140% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--text-2); font-size: 14px; }
.empty .e-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); margin-bottom: 6px; }
.empty .e-ico svg { width: 22px; height: 22px; }
.empty b { color: var(--text); font-weight: 600; font-size: 15px; }
.empty.left { align-items: flex-start; text-align: left; padding: 8px 0; }
.error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-fill); color: var(--warn); font-size: 13.5px; }
[data-live] { transition: opacity .4s var(--ease), filter .4s var(--ease); }
body.is-offline [data-live] { opacity: .55; filter: saturate(.4); }
.stale { opacity: .6; }

/* ── motion ────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease), transform .4s var(--ease); transition-delay: calc(var(--i, 0) * 40ms); }
.reveal.in { opacity: 1; transform: none; }
.flash-up, .flash-down { border-radius: 6px; animation: flash-up 1.4s var(--ease); }
.flash-down { animation-name: flash-down; }
@keyframes flash-up { 0% { background: rgba(52, 199, 89, .28); } 100% { background: transparent; } }
@keyframes flash-down { 0% { background: rgba(255, 59, 48, .22); } 100% { background: transparent; } }

/* ── sheet: bottom sheet on phones, centred modal on desktop ───────────── */
.sheet-host { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.sheet-host.open { pointer-events: auto; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s var(--ease); }
.sheet-host.open .sheet-bg { opacity: 1; }
.sheet {
  position: absolute; left: 50%; top: 50%; width: min(680px, calc(100vw - 48px)); max-height: min(86vh, 900px);
  display: flex; flex-direction: column; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-sheet);
  transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .45s var(--spring), opacity .3s var(--ease); outline: none;
}
.sheet-host.open .sheet { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 14px; padding: 24px 24px 14px 28px; }
.sheet-head .sheet-tt { flex: 1; min-width: 0; }
.sheet-title { font-size: 24px; font-weight: 600; letter-spacing: -.018em; line-height: 1.2; margin: 0; }
.sheet-sub { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.sheet-nav { display: flex; gap: 6px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 28px 28px; overscroll-behavior: contain; }
.sheet-body > * + * { margin-top: 20px; }
@media (max-width: 760px) {
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 90vh; border-radius: 22px 22px 0 0;
    transform: translateY(104%); opacity: 1; padding-bottom: var(--safe-b);
  }
  .sheet-host.open .sheet { transform: translateY(0); }
  .sheet.dragging { transition: none; }
  .sheet-grab { display: block; width: 100%; padding: 8px 0 0; touch-action: none; cursor: grab; }
  .sheet-grab::before { content: ""; display: block; width: 38px; height: 5px; margin: 0 auto; border-radius: 3px; background: rgba(0, 0, 0, .18); }
  .sheet-head { padding: 10px 16px 10px 20px; touch-action: none; }
  .sheet-title { font-size: 21px; }
  .sheet-body { padding: 4px 20px 24px; }
  .sheet-nav .prev, .sheet-nav .next { display: none; }
}

/* ── toast ─────────────────────────────────────────────────────────────── */
.toast-host { position: fixed; z-index: 90; top: calc(var(--nav-h) + 12px); right: 20px; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px 13px 13px; border-radius: 18px;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-float), inset 0 0 0 1px rgba(0, 0, 0, .05);
  animation: toast-in .5s var(--spring) both; cursor: pointer;
}
.toast.out { animation: toast-out .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
.toast-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.toast-ico svg { width: 17px; height: 17px; }
.toast.tone-up .toast-ico { background: var(--up-fill); color: var(--up); }
.toast.tone-down .toast-ico { background: var(--down-fill); color: var(--down); }
.toast.tone-warn .toast-ico { background: var(--warn-fill); color: var(--warn); }
.toast.tone-accent .toast-ico { background: var(--accent-fill); color: var(--accent); }
.toast-t { font-size: 14px; font-weight: 600; line-height: 1.3; }
.toast-x { font-size: 13px; color: var(--text-2); line-height: 1.35; margin-top: 2px; }
@media (max-width: 760px) {
  .toast-host { left: 50%; right: auto; transform: translateX(-50%); top: calc(var(--nav-h) + 8px); }
}

/* ── placeholder page (pages still being built) ────────────────────────── */
.soon { max-width: 760px; margin: 8vh auto 0; text-align: center; }
.soon-ico { width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 22px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.soon-ico svg { width: 34px; height: 34px; }
.soon .t-cap { font-size: 17px; margin: 12px auto 0; max-width: 52ch; }
.soon-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; text-align: left; }
@media (max-width: 760px) { .soon-list { grid-template-columns: 1fr; } }
.soon-list li { background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 16px 18px; font-size: 14px; color: var(--text-2); }
.soon-list li b { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.soon .row { justify-content: center; margin-top: 28px; }

/* ── charts (/charts.js) in light ──────────────────────────────────────── */
.fc { position: relative; height: var(--fc-h, 240px); outline: none; }
.fc:focus-visible { box-shadow: var(--focus); border-radius: 10px; }
.fc-svg { width: 100%; height: 100%; display: block; font: 11px var(--font); font-variant-numeric: tabular-nums; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.fc.stale .fc-svg { opacity: .55; transition: opacity .2s; }
.fc-tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-radius: 12px; padding: 8px 12px; font: 12px/1.45 var(--font); color: var(--text-2); white-space: nowrap; box-shadow: var(--shadow-float), inset 0 0 0 1px rgba(0, 0, 0, .05); }
.fc-tip b { display: block; font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.fc-tip[hidden], .fc-msg[hidden] { display: none; }
.fc-msg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--text-3); pointer-events: none; text-align: center; padding: 0 12px; }
.fc-msg.corner { inset: 4px auto auto 8px; display: block; padding: 0; font-size: 11.5px; color: var(--warn); }

@media (hover: none) {
  .card.link:hover { transform: none; box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .tb-tab.press .tb-it, .tb-mini.press .tb-mini-in, .nav-gear.press { transform: none; opacity: .55; } /* press dims instead of squishing */
  .reveal { opacity: 1; transform: none; }
}
