/* WICK design system: a calm trading terminal. Dark charcoal-teal surfaces, one restrained green, red only for losses
   and shorts. Tokens from the WICK handoff (README), contrast-checked: the bright brand green is for fills and dark-mode
   text; light mode uses the deeper accent for any green text on white. The wallet sheet reads the --ent-* aliases. */
:root {
  --page: #F7FAF9; --surface: #FFFFFF; --elevated: #EEF4F2; --border: #DCE6E3; --border-strong: #C9D6D2;
  --text: #0C1B1D; --muted: #586C6E; --faint: #6B7F81;
  --brand: #23F5A0; --brand-ink: #04120C; --accent: #00875A; /* green text on white: 4.9:1 */
  --pos: #00875A; --neg: #D92D3F; --pos-soft: #E2F7EE; --neg-soft: #FDE8EA;
  --warn: #8A5A00; --warn-soft: #FFF3D6;
  --r-lg: 14px; --r-md: 10px; --r-sm: 8px;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(12, 27, 29, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #061113; --surface: #0A181B; --elevated: #102024; --border: #213238; --border-strong: #2C4249;
    --text: #F4FAF8; --muted: #94A8A7; --faint: #7D9291;
    --accent: #23F5A0; --pos: #11C784; --neg: #FF4B5C; --pos-soft: #0D2B24; --neg-soft: #2E1418;
    --warn: #F2B544; --warn-soft: #2D2310; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #061113; --surface: #0A181B; --elevated: #102024; --border: #213238; --border-strong: #2C4249;
  --text: #F4FAF8; --muted: #94A8A7; --faint: #7D9291;
  --accent: #23F5A0; --pos: #11C784; --neg: #FF4B5C; --pos-soft: #0D2B24; --neg-soft: #2E1418;
  --warn: #F2B544; --warn-soft: #2D2310; --shadow: none;
  color-scheme: dark;
}
/* the names the rest of the app (and the wallet sheet) already use */
:root { --plate: var(--page); --sheet: var(--surface); --sheet2: var(--elevated); --rule: var(--border); --ink: var(--text); --ink2: var(--muted); --ink3: var(--faint);
  --long: var(--pos); --short: var(--neg); --long-soft: var(--pos-soft); --short-soft: var(--neg-soft); --act: var(--brand);
  --ent-plate: var(--page); --ent-sheet: var(--surface); --ent-ink: var(--text); --ent-ink-2: var(--muted); --ent-ink-3: var(--faint); --ent-rule: var(--border); --ent-photon: var(--brand); }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 84px; } /* focus and scrolled-to elements land below the sticky header */
body { background: var(--page); color: var(--text); font: 400 14.5px/1.5 var(--body); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--pos); } .down { color: var(--neg); } .muted { color: var(--faint); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── header: logo, nav, search, theme, wallet ─────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 30; background: var(--page); border-bottom: 1px solid var(--border); } /* solid: a blur over the live chart repaints every frame */
.top-in { max-width: 1440px; margin: 0 auto; height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.logo img { width: 30px; height: 30px; }
.logo b { font: 800 24px/1 var(--display); letter-spacing: -.03em; }
.nav { display: flex; gap: 4px; }
.nav a { position: relative; padding: 8px 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-radius: var(--r-sm); }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -12px; height: 2px; border-radius: 2px; background: var(--brand); }
.search { flex: 1; max-width: 440px; margin-left: auto; }
.search .field { min-height: 40px; border-radius: var(--r-md); background: var(--surface); }
.search input { font-size: 14px; }
.top-r { display: flex; align-items: center; gap: 10px; }
.balance { font-size: 13px; color: var(--muted); white-space: nowrap; }
.balance b { color: var(--text); }
.tabbar { display: none; }
.main { max-width: 1440px; margin: 0 auto; padding: 22px 28px 48px; min-width: 0; }
@media (max-width: 980px) {
  .nav, .search, .balance { display: none; }
  .top-in { height: 56px; padding: 0 16px; gap: 12px; justify-content: space-between; }
  .logo img { width: 24px; height: 24px; } .logo b { font-size: 20px; }
  /* phones: both bars FIXED (sticky comes loose in in-app browsers), each on its own compositing layer so iOS keeps them
     put while scrolling; the tab bar follows the visible bottom edge (--vv-bottom, set in app.js from visualViewport) */
  .top { position: fixed; left: 0; right: 0; top: 0; padding-top: env(safe-area-inset-top); transform: translateZ(0); }
  body { padding-top: calc(57px + env(safe-area-inset-top)); }
  html { scroll-padding-top: calc(72px + env(safe-area-inset-top)); }
  .main { padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: var(--vv-bottom, 0px); z-index: 30; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); transform: translateZ(0); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; text-decoration: none; color: var(--faint); font-size: 11.5px; font-weight: 600; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .mobile-search { display: block !important; margin-bottom: 14px; }
  #menu { display: inline-grid !important; }
  .top-r #connect { min-height: 36px; padding: 0 12px; font-size: 13px; }
}
.mobile-search { display: none; }
.menu-sheet { position: fixed; inset: 56px 0 auto 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px 16px; display: none; }
.menu-sheet.open { display: block; }
.menu-sheet a { display: block; padding: 12px 4px; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--border); }

/* ── controls ─────────────────────────────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(.95); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-md); padding: 0 12px; min-height: 44px; }
.field:focus-within { border-color: var(--brand); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.field .unit { color: var(--faint); font-weight: 600; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--elevated); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--pos-soft); color: var(--pos); } .pill.bad { background: var(--neg-soft); color: var(--neg); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel > header h2 { margin: 0; font: 700 16px/1.2 var(--display); }
.panel .body { padding: 16px 18px; }
.empty { padding: 26px 18px; text-align: center; color: var(--faint); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--r-md); background: var(--text); color: var(--page); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--neg); color: #fff; }
@media (max-width: 980px) { .toast { bottom: calc(88px + env(safe-area-inset-bottom)); } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { min-height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: transparent; }

/* ── home: hero + featured market ───────────────────────────────────────────────────────────────────── */
.home { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.4fr); gap: 32px; align-items: start; }
.hero { padding: 40px 4px 0; }
.kicker { display: inline-block; padding: 6px 12px; border-radius: 8px; background: var(--pos-soft); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.hero h1 { margin: 22px 0 0; font: 800 clamp(36px, 4.2vw, 66px)/1 var(--display); letter-spacing: -.04em; }
.hero h1 .h1-l1 { white-space: nowrap; } /* two lines: "Trade Both Sides" / "on Solana" */
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 18px 0 0; color: var(--muted); font-size: 17px; max-width: 34ch; }
.hero .ctas { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero .ctas .btn { min-height: 46px; padding: 0 22px; font-size: 15px; }
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-top: 40px; }
.feat { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.3; }
.feat i { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--elevated); display: grid; place-items: center; color: var(--accent); }
.feat i svg { width: 18px; height: 18px; }
.feat b { display: block; color: var(--text); font-weight: 600; }
.below { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 22px; }
@media (max-width: 1180px) { .home { grid-template-columns: minmax(0, 1fr); gap: 18px; } .hero { padding-top: 8px; } .below { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 980px) { .hero h1 { font-size: clamp(30px, 10.2vw, 46px); } .hero p { font-size: 15.5px; } .feats { margin-top: 26px; } }

/* ── a market: identity row, chart, ticket, entries ─────────────────────────────────────────────────── */
.mkt-line { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin: 0 0 14px; }
.mkt-line .coin-ic { width: 38px; height: 38px; border-radius: 50%; }
.mkt-line .mh-sym { font: 800 20px/1 var(--display); letter-spacing: -.01em; }
.mkt-line .mh-mc { font: 700 22px/1 var(--display); }
.mkt-line .mh-meta { color: var(--faint); font-size: 13px; }
.mkt-line .mh-ca { margin-left: auto; color: var(--faint); font-size: 12.5px; }
.metric { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--faint); }
.metric b { color: var(--text); font-size: 14px; font-weight: 700; }
@media (max-width: 720px) { .mkt-line .mh-ca { margin-left: 0; } }
.trade { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: 'chart ticket' 'mine ticket'; grid-template-rows: auto 1fr; gap: 16px; align-items: start; }
.trade .chart { grid-area: chart; } .trade .ticket { grid-area: ticket; position: sticky; top: 80px; } .trade .mine { grid-area: mine; }
@media (max-width: 1180px) { .trade { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'chart' 'ticket' 'mine'; } .trade .ticket { position: static; } }
.mframe { padding: 16px; min-width: 0; }
@media (max-width: 720px) { .mframe { padding: 12px; } }
.chart { height: min(56vh, 480px); min-height: 330px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
@media (max-width: 720px) { .chart { height: 340px; } }
.chart .chart-msg { height: 100%; display: grid; place-items: center; color: var(--faint); }

/* ticket */
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--elevated); border-radius: var(--r-md); }
.sides button { min-height: 42px; border: 0; border-radius: var(--r-sm); background: transparent; font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; }
.sides button[aria-pressed="true"].long { background: var(--brand); color: var(--brand-ink); }
.sides button[aria-pressed="true"].short { background: var(--neg); color: #fff; }
.levs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.levs button { min-height: 40px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.levs button[aria-pressed="true"] { border-color: var(--brand); color: var(--accent); background: var(--pos-soft); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lbl { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.what-if { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--elevated); font-size: 13.5px; }
.what-if p { margin: 0; } .what-if p + p { margin-top: 4px; }
.go { width: 100%; min-height: 50px; margin-top: 14px; border: 0; border-radius: var(--r-md); font: 700 16px/1 var(--body); cursor: pointer; }
.go.long { background: var(--brand); color: var(--brand-ink); } .go.short { background: var(--neg); color: #fff; }
.go[disabled] { opacity: .45; cursor: not-allowed; }
.facts { margin: 14px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13px; }
.facts dt { color: var(--faint); } .facts dd { margin: 0; text-align: right; font-weight: 600; }
details.auto { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
details.auto summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.oneclick { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.oneclick input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--brand); }
.round-now { margin-bottom: 14px; padding: 10px 12px; border-radius: var(--r-md); background: var(--elevated); font-size: 13.5px; }
.rn-row { display: flex; justify-content: space-between; gap: 10px; }
.rn-row + .rn-row { margin-top: 4px; }
.rn-next { padding-top: 6px; margin-top: 6px !important; border-top: 1px solid var(--border); font-weight: 600; }
.potbar { height: 6px; border-radius: 99px; background: var(--neg); overflow: hidden; margin-bottom: 6px; }
.potbar i { display: block; height: 100%; background: var(--pos); }
.pots .rn-row { font-size: 13px; font-weight: 700; }

/* tables */
.pos { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pos th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pos td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.pos tr:last-child td { border-bottom: 0; }
.pos tbody tr:hover { background: color-mix(in srgb, var(--elevated) 60%, transparent); }
.pos .side-tag { font-weight: 700; } .pos .side-tag.long { color: var(--pos); } .pos .side-tag.short { color: var(--neg); }
.pos .tok { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.pos .tok .coin-ic { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; }
.pos .tok small { display: block; color: var(--faint); font-size: 11.5px; }
.btn.long-o { border-color: var(--pos); color: var(--pos); } .btn.short-o { border-color: var(--neg); color: var(--neg); }
.scroll-x { overflow-x: auto; }
@media (max-width: 720px) { .pos .hide-sm { display: none; } .pos th, .pos td { padding: 10px; } }
.in-market .col-coin { display: none; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border); }
.rows li:first-child { border-top: 0; }
.rows a.row { display: contents; text-decoration: none; }
.coin-ic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--elevated); display: grid; place-items: center; font-weight: 800; color: var(--faint); flex: none; }
.coin-nm { min-width: 0; } .coin-nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-nm span { display: block; font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; }
.oi .bar { width: 100px; height: 5px; border-radius: 99px; background: var(--neg); overflow: hidden; }
.oi .bar i { display: block; height: 100%; background: var(--pos); }

/* pages */
.page-h { margin: 6px 0 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font: 800 clamp(26px, 3vw, 36px)/1.05 var(--display); letter-spacing: -.03em; }
.page-h p { margin: 6px 0 0; color: var(--muted); max-width: 64ch; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.stat > span { display: block; font-size: 12.5px; color: var(--faint); font-weight: 600; }
.stat b { display: block; margin-top: 4px; font: 700 22px/1.1 var(--display); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prose h3 { font: 700 17px/1.25 var(--display); margin: 0 0 6px; } .prose p { margin: 0 0 10px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cards .panel { padding: 18px; }
@media (max-width: 1100px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; text-align: right; }
.modal-back { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--page) 70%, transparent); }
.modal { width: min(640px, 100%); }
.ca-chip { display: flex; align-items: center; gap: 8px; margin: 18px 0 0 !important; font-size: 13.5px; }
.ca-chip code { font: 600 13px/1 ui-monospace, Menlo, monospace; color: var(--text); }
.wallet-menu { position: fixed; z-index: 50; display: flex; flex-direction: column; gap: 6px; padding: 10px; min-width: 180px; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
.wallet-menu .btn { justify-content: flex-start; min-height: 40px; }

/* home: the hottest coins, rotating, and the live log */
.hotpanel { min-width: 0; }
.hot { list-style: none; margin: 0; padding: 6px 8px; max-height: 420px; overflow: hidden; }
.hot li { transition: opacity .3s, transform .3s; }
.hot li.out { opacity: 0; transform: translateY(-10px); }
.hot-row { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: var(--r-md); background: transparent; text-align: left; cursor: pointer; }
.hot-row:hover, .hot-row:focus-visible { background: var(--elevated); }
.hot-row .coin-ic { width: 36px; height: 36px; }
.hot-r { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; font-weight: 700; }
.hotlog { padding: 12px 18px 14px; border-top: 1px solid var(--border); }
.hotlog .rows li { grid-template-columns: minmax(0, 1fr) auto; padding: 6px 0; border: 0; }
/* the trade pop-up: a wide sheet on desktop, full screen on phones */
.trade-pop { align-items: start; overflow-y: auto; padding: 32px 16px; z-index: 80; }
.trade-sheet { position: relative; width: min(1280px, 100%); padding: 18px; }
.pop-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.trade-sheet .mkt-line { padding-right: 48px; }
body.no-scroll { overflow: hidden; }
@media (max-width: 720px) { .trade-pop { padding: 0; } .trade-sheet { min-height: 100%; border-radius: 0; border: 0; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); } }

/* markets header: title, timeframe tabs, launchpad select */
.mf-head { flex-wrap: wrap; }
.mf-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mf-lp select { min-height: 32px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; }
.hot { max-height: 470px; }

/* ── How it works: the scroll story (public/story.js) ─────────────────────────────────────────────────────── */
#story { min-height: 100vh; }
.ws { --ws-top: 76px; }
.ws-steps { list-style: none; margin: 0; padding: 0; }
.ws-step { padding: 8px 0 34px; }
.ws-copy { max-width: 34em; }
.ws-num { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.ws-h { margin: 0; font: 800 clamp(26px, 2.2vw + 14px, 40px)/1.06 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.ws-p { margin: 12px 0 0; font-size: 16.5px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.ws-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ws-cta .btn { min-height: 46px; padding: 0 20px; }
.ws-fig { margin: 0 0 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ws-fig svg { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; }
.ws-stage { display: none; }
.ws[data-mode="pin"] .ws-track { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.ws[data-mode="pin"] .ws-step { min-height: 105vh; display: flex; align-items: center; padding: 0; }
.ws[data-mode="pin"] .ws-steps { padding-bottom: 30vh; }
.ws[data-mode="pin"] .ws-slot { display: none; }
.ws[data-mode="pin"] .ws-stage { display: flex; flex-direction: column; position: sticky; top: calc(50vh - min(calc(100vh - var(--ws-top) - 24px), 640px) / 2 + var(--ws-top) / 2);
  height: min(calc(100vh - var(--ws-top) - 24px), 640px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.ws-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; height: 44px; padding: 0 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; flex: none; }
.ws-bar span:last-child { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.ws-scenes { position: relative; flex: 1; min-height: 0; }
.ws[data-mode="pin"] .ws-fig { position: absolute; inset: 0; margin: 0; border: 0; border-radius: 0; visibility: hidden; background: transparent; }
.ws[data-mode="pin"] .ws-fig.ws-on { visibility: visible; }
.ws[data-mode="pin"] .ws-fig svg { width: 100%; height: 100%; aspect-ratio: auto; }
.ws-rail { display: flex; flex: none; border-top: 1px solid var(--border); }
.ws-rail button { position: relative; flex: 1; height: 46px; border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted); font: 600 13px/1 var(--body); cursor: pointer; overflow: hidden; }
.ws-rail button:first-child { border-left: 0; }
.ws-rail button:hover { color: var(--text); }
.ws-rail button[aria-current="step"] { color: var(--text); background: var(--elevated); }
.ws-rail i { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--brand); transform-origin: 0 50%; transform: scaleX(0); }
.ws-rail button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.how-rules { margin-top: 12px; }
.how-rules ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); }
/* diagram paint: shapes read currentColor, colour classes set it */
.ws-fig svg { color: var(--text); font-family: var(--body); }
.w-box { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.w-pill { stroke: var(--accent); stroke-width: 2; }
.w-well { fill: var(--elevated); stroke: none; }
.w-fill-ink { fill: var(--muted); } .w-fill-act { fill: var(--brand); }
.w-fill-side { fill: currentColor; }
.w-ln { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.w-ln2 { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.w-ln3 { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.w-dash { stroke-dasharray: 5 6; color: var(--faint); }
.w-rule { color: var(--border); stroke-width: 1; }
.w-dot { fill: currentColor; }
.w-c-act { color: var(--accent); } .w-c-ink { color: var(--text); } .w-c-long { color: var(--long); }
.w-long { color: var(--long); } .w-short { color: var(--short); }
.w-side { fill: var(--surface); stroke: currentColor; stroke-width: 2; }
.w-long .w-side { fill: var(--long-soft); } .w-short .w-side { fill: var(--short-soft); }
.w-side-ink { fill: currentColor; color: inherit; }
g.w-side-ink .w-ln2 { stroke: currentColor; }
.w-live { stroke: var(--accent); stroke-width: 2.5; } .w-open { stroke-dasharray: 6 5; } .w-dim { stroke-opacity: .5; }
.w-hl { fill: var(--brand); }
.w-on-act { fill: var(--brand-ink); }
.w-hatch { fill: var(--elevated); stroke: var(--faint); stroke-dasharray: 3 3; }
.w-scan { fill: var(--brand); fill-opacity: .18; }
.w-okbox { fill: var(--pos-soft); stroke: var(--pos); }
.w-feebox { fill: var(--elevated); }
.w-coin .w-cf { fill: currentColor; } .w-coin .w-cs { fill: none; stroke: var(--surface); stroke-width: 1.5; opacity: .7; }
.w-you { color: var(--brand); }
.w-ok .w-okc { fill: var(--pos); } .w-ok .w-okm { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.w-chipbox { fill: var(--elevated); stroke: var(--border-strong); }
.w-chip-act .w-chipbox { fill: var(--surface); stroke: var(--accent); }
.w-t { fill: var(--text); font-size: 15px; font-weight: 500; }
.w-t-strong { font-weight: 700; } .w-t-big { font-size: 20px; font-weight: 800; font-family: var(--display); }
.w-t-huge { font-size: 44px; font-weight: 800; font-family: var(--display); }
.w-t-small { font-size: 13px; } .w-t-mute { fill: var(--muted); } .w-t-chip { font-size: 13.5px; font-weight: 600; }
.w-t-act { fill: var(--accent); } .w-t-long { fill: var(--long); }
.w-long .w-t-big.w-side-ink, .w-short .w-t-big.w-side-ink, .w-long .w-t-huge, .w-short .w-t-huge { fill: currentColor; }
@media (max-width: 999px) { .ws-step { padding-bottom: 40px; } .ws-h { font-size: clamp(24px, 7vw, 32px); } }
