/* =====================================================================
   OTCBY — "The OTC Ledger"
   Editorial broadsheet × trading terminal. Paper, ink, two market colours
   and one signal accent. System fonts only (fast in mainland China).
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #ffffff;
  --paper-2: #f3f2ee;
  --card: #fbfbf9;
  --card-2: #f6f5f1;
  --ink: #11110f;
  --ink-2: #474540;
  --ink-3: #7f7b71;
  --ink-4: #a9a59a;
  --line: #e2dfd6;
  --line-soft: #eeece6;
  --buy: #0b6b47;
  --buy-2: #e3f0e8;
  --sell: #bf3a22;
  --sell-2: #f8e7e2;
  --brand: #1f47ff;
  --brand-2: #19c8ff;
  --brand-soft: #eef1ff;
  --on-brand: #ffffff;
  --logo: #1f47ff;
  --signal: #19c8ff;
  --signal-ink: #06204a;
  --link: #11110f;
  --shadow: 0 1px 0 rgba(17, 17, 15, 0.04), 0 12px 32px -18px rgba(17, 17, 15, 0.22);
  --shadow-pop: 0 18px 44px -18px rgba(17, 17, 15, 0.32), 0 2px 6px rgba(17, 17, 15, 0.06);
  --grain-opacity: 0;

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;

  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: clamp(24px, 2.4vw, 30px);
  --fs-display: clamp(34px, 5.2vw, 64px);

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --r: 4px;
  --r-lg: 10px;
  --header-h: 60px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.2s;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0e0c;
    --paper-2: #151513;
    --card: #161614;
    --card-2: #1c1c19;
    --ink: #f1efe7;
    --ink-2: #c4c0b4;
    --ink-3: #8f8b80;
    --ink-4: #64615a;
    --line: #2c2b27;
    --line-soft: #22221f;
    --buy: #4cc58f;
    --buy-2: rgba(76, 197, 143, 0.12);
    --sell: #f0765e;
    --sell-2: rgba(240, 118, 94, 0.12);
    --link: #f1efe7;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 36px -20px rgba(0, 0, 0, 0.8);
    --shadow-pop: 0 18px 44px -14px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --grain-opacity: 0.06;
    --brand: #4d6bff;
    --brand-2: #3fd4ff;
    --brand-soft: rgba(77, 107, 255, 0.12);
    --logo: #f1efe7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e0e0c;
  --paper-2: #151513;
  --card: #161614;
  --card-2: #1c1c19;
  --ink: #f1efe7;
  --ink-2: #c4c0b4;
  --ink-3: #8f8b80;
  --ink-4: #64615a;
  --line: #2c2b27;
  --line-soft: #22221f;
  --buy: #4cc58f;
  --buy-2: rgba(76, 197, 143, 0.12);
  --sell: #f0765e;
  --sell-2: rgba(240, 118, 94, 0.12);
  --link: #f1efe7;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 36px -20px rgba(0, 0, 0, 0.8);
  --shadow-pop: 0 18px 44px -14px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --grain-opacity: 0.06;
  --brand: #4d6bff;
  --brand-2: #3fd4ff;
  --brand-soft: rgba(77, 107, 255, 0.12);
  --logo: #f1efe7;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html.theme-anim body,
html.theme-anim body * {
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease), fill 0.35s var(--ease) !important;
}

/* Paper grain — a whisper of texture, never noise */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] body::before { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; } }

::selection { background: color-mix(in srgb, var(--brand-2) 40%, transparent); color: var(--ink); }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

img, svg { display: block; }
svg { flex-shrink: 0; }
code { font-family: var(--mono); font-size: 0.88em; }

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.is-buy { color: var(--buy); }
.is-sell { color: var(--sell); }
/* Price going up = more expensive (sell colour); down = cheaper (buy colour). */
.is-up { color: var(--sell); }
.is-down { color: var(--buy); }

/* ---------- 3. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark { height: 22px; width: auto; color: var(--logo); overflow: visible; }
.brand-arm { stroke: var(--brand-2); transition: transform 0.5s var(--ease); transform-origin: 116px 17px; }
.brand:hover .brand-arm { transform: rotate(-12deg); }
.footer-mark { display: block; height: 30px; width: auto; margin-bottom: 28px; color: #f1efe7; }
.footer-mark .brand-arm { stroke: #3fd4ff; }
.brand-sub {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.main-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: auto;
}
.nav-link {
  position: relative;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--r);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav-link.active { color: var(--ink); font-weight: 600; }
.nav-indicator {
  position: absolute;
  bottom: -11px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--brand);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.2s;
  opacity: 0;
}
.nav-indicator.is-ready { opacity: 1; }

.header-tools { display: flex; align-items: center; gap: 8px; }

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.live-dot {
  position: relative;
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--buy);
  flex-shrink: 0;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--buy);
  animation: pulse 2.4s var(--ease) infinite;
}
.is-demo .live-dot, .is-demo .live-dot::after { background: #c08a1c; animation: none; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(2.8); opacity: 0; }
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 0.15s var(--ease);
}
.icon-btn:hover { background: var(--card); border-color: var(--ink-4); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 16px; height: 16px; grid-area: 1 / 1; transition: transform 0.5s var(--ease), opacity 0.3s var(--ease); }
.i-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }
:root[data-theme="dark"] .i-sun { opacity: 0; transform: rotate(90deg) scale(0.6); }
:root[data-theme="dark"] .i-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { opacity: 0; transform: rotate(90deg) scale(0.6); }
  :root:not([data-theme="light"]) .i-moon { opacity: 1; transform: none; }
}

.menu-btn { display: none; }
.menu-lines { position: relative; width: 16px; height: 10px; grid-area: 1 / 1; }
.menu-lines span {
  position: absolute; left: 0; right: 0;
  height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.menu-lines span:first-child { top: 0; }
.menu-lines span:last-child { top: 8.5px; }
.menu-open .menu-lines span:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-open .menu-lines span:last-child { top: 4.25px; transform: rotate(-45deg); }

/* ---------- 4. Typography blocks ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.eyebrow .num { letter-spacing: 0.12em; color: var(--ink-2); font-weight: 600; }
.eyebrow-sep { width: 18px; height: 1px; background: var(--line); display: inline-block; }

.page-hero { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(20px, 3vw, 32px); }
.page-hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
}
.page-title {
  margin: 0;
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}
.page-lead {
  max-width: 62ch;
  margin: 18px 0 0;
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--ink-2);
  text-wrap: pretty;
}
.title-ico { display: flex; align-items: center; gap: 16px; }

/* Breadcrumbs */
.crumbs { margin-bottom: 22px; }
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs li + li::before { content: "/"; color: var(--ink-4); margin-right: 2px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] span { color: var(--ink-2); }

/* ---------- 5. Segmented control ---------- */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 2px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.seg-item .num { font-size: 11.5px; letter-spacing: 0.04em; }
.seg-item:hover { color: var(--ink); }
.seg-item.active {
  color: var(--on-brand);
  background: var(--brand);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.25);
}
.seg-sm .seg-item { height: 28px; padding: 0 12px; font-size: 12.5px; }

/* ---------- 6. Home hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(28px, 5vw, 64px);
  padding-bottom: 8px;
}
.hero::before {
  /* ledger grid wash behind the masthead */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 420px;
  z-index: -1;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 30% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 30% 0%, #000 20%, transparent 75%);
}
.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(24px, 3.5vw, 40px);
}
.hero-title {
  margin: 0;
  font-size: var(--fs-display);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .line > span { display: inline-block; }
.hero-title .line-sub { color: var(--ink-3); font-weight: 600; }
.js .hero-title .line > span { animation: rise 0.9s var(--ease) both; }
.js .hero-title .line-sub > span { animation-delay: 0.08s; }
@keyframes rise { from { transform: translateY(105%); } }

/* ---------- 7. Quote board ---------- */
.board {
  position: relative;
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.board::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0 72%, var(--brand-2) 72% 100%);
}
.board-cell {
  position: relative;
  padding: clamp(18px, 2.2vw, 28px) clamp(16px, 2vw, 26px) clamp(18px, 2vw, 24px);
  border-right: 1px solid var(--line-soft);
  min-width: 0;
  transition: background-color 0.25s var(--ease);
}
.board-cell:nth-child(4) { border-right: 0; }
.board-cell[data-copy] { cursor: copy; }
.board-cell[data-copy]:hover { background: var(--card-2); }
.board-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.board-label .num { font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-4); }
.board-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.board-value .num { letter-spacing: -0.045em; display: inline-block; }
.board-primary .board-value { font-size: clamp(44px, 6.4vw, 84px); font-weight: 700; }
.board-unit { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.board-sub { margin-top: 14px; font-size: var(--fs-xs); color: var(--ink-3); }
.board-sub .num { color: var(--ink-2); }
.copy-hint {
  position: absolute;
  right: 14px; bottom: 14px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--ink-3);
  border-radius: 999px;
  background: var(--paper-2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s var(--ease), transform 0.3s var(--ease);
}
.copy-hint svg { width: 13px; height: 13px; }
.board-cell[data-copy]:hover .copy-hint,
.board-cell[data-copy]:focus-visible .copy-hint { opacity: 1; transform: none; }

/* live value tick */
.tick-up { animation: tickUp 0.6s var(--ease); }
.tick-down { animation: tickDown 0.6s var(--ease); }
@keyframes tickUp { 0% { transform: translateY(40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes tickDown { 0% { transform: translateY(-40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
.board-cell.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0% { background: color-mix(in srgb, var(--brand-2) 22%, transparent); } 100% { background: transparent; } }

/* ---------- 8. Spread ruler (signature) ---------- */
.ruler {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px clamp(16px, 2vw, 26px) 16px;
  border-top: 1px solid var(--line-soft);
  background:
    repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), color-mix(in srgb, var(--line) 60%, transparent) calc(10% - 1px) 10%) 0 100% / 100% 6px no-repeat,
    var(--card-2);
}
.ruler-cap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 6px;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}
.ruler-cap .num { letter-spacing: 0.16em; color: var(--ink-2); font-weight: 600; }
.ruler-track {
  position: relative;
  height: 74px;
  margin: 0 8px;
}
.ruler-track::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--ink-4);
}
.ruler-band {
  position: absolute;
  top: calc(50% - 5px);
  height: 10px;
  left: calc(var(--at-sell) * 1%);
  width: calc((var(--at-buy) - var(--at-sell)) * 1%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sell) 55%, transparent), color-mix(in srgb, var(--buy) 55%, transparent));
  border-radius: 2px;
  transform-origin: center;
}
.js .ruler.is-in .ruler-band { animation: bandIn 1.1s var(--ease) both 0.15s; }
@keyframes bandIn { from { transform: scaleX(0); opacity: 0; } }

.ruler-mark {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--p) * 1%);
  width: 0;
}
.ruler-mark::before {
  content: "";
  position: absolute;
  left: -0.5px;
  top: 18px; bottom: 18px;
  width: 1px;
  background: currentColor;
}
.ruler-mark::after {
  content: "";
  position: absolute;
  left: -5px; top: calc(50% - 5px);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px var(--card-2);
}
.ruler-mark.is-buy { color: var(--buy); }
.ruler-mark.is-sell { color: var(--sell); }
.ruler-mark.is-fx { color: var(--ink-2); }
.ruler-mark.is-fx::before { top: 6px; bottom: 6px; background: repeating-linear-gradient(to bottom, currentColor 0 3px, transparent 3px 6px); }
.ruler-mark.is-fx::after { width: 8px; height: 8px; left: -4px; top: calc(50% - 4px); border-radius: 1px; transform: rotate(45deg); }
.ruler-tag {
  position: absolute;
  top: 0;
  font-size: var(--fs-2xs);
  line-height: 16px;
  white-space: nowrap;
  color: inherit;
}
.ruler-tag b { font-weight: 650; font-size: 12px; }
.ruler-mark.is-buy .ruler-tag { left: 6px; }
.ruler-mark.is-sell .ruler-tag { right: 6px; }
.ruler-mark.is-fx .ruler-tag { top: auto; bottom: 0; transform: translateX(-50%); color: var(--ink-2); }
.js .ruler.is-in .ruler-mark { animation: markIn 1.1s var(--ease) both; }
.js .ruler.is-in .ruler-mark.is-fx { animation-delay: 0.05s; }
.js .ruler.is-in .ruler-mark.is-buy { animation-delay: 0.12s; }
@keyframes markIn { from { left: 50%; opacity: 0; } }

.ruler-tick {
  position: absolute;
  top: 50%;
  left: calc(var(--p) * 1%);
  transform: translate(-50%, -50%);
  z-index: 1;
  padding: 2px;
  border-radius: 6px;
  background: var(--card-2);
  transition: transform 0.3s var(--ease);
}
.ruler-tick .ex-ico { width: 15px; height: 15px; border-radius: 4px; }
.ruler-tick:hover { z-index: 3; transform: translate(-50%, -50%) scale(1.35); }
.js .ruler.is-in .ruler-tick { animation: tickIn 0.7s var(--ease) both 0.5s; }
@keyframes tickIn { from { opacity: 0; transform: translate(-50%, -20%); } }
.ruler-scale {
  display: flex;
  justify-content: space-between;
  margin: 6px 8px 0;
  font-size: 10.5px;
  color: var(--ink-4);
}

/* ---------- 9. Answer-first summary (GEO) ---------- */
.answer {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 18px;
  margin-top: 20px;
  padding: 18px 22px;
  border-radius: var(--r-lg);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
}
.answer-tag {
  grid-row: 1 / span 4;
  align-self: start;
  padding: 2px 8px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--on-brand);
  background: var(--brand);
  border-radius: 3px;
  white-space: nowrap;
}
.answer p { grid-column: 2; margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--ink); text-wrap: pretty; }
.answer p + p { margin-top: 6px; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 16px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: var(--card);
  border: 1px dashed #c9a24a;
  border-radius: var(--r-lg);
}
.notice-tag {
  flex-shrink: 0;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #6b4e11;
  background: #f4e3b5;
  border-radius: 3px;
}

/* ---------- 10. Blocks / sections ---------- */
.stack { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 72px); padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(64px, 9vw, 120px); }
.stack > .answer, .stack > .notice { margin-top: 0; margin-bottom: 0; }
.hero + .stack { padding-top: clamp(40px, 6vw, 72px); }
.page-hero + .stack { padding-top: 8px; }

.block { min-width: 0; }
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--ink);
  margin-bottom: 4px;
}
.block-idx {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  min-width: 26px;
}
.block-title {
  margin: 0;
  margin-right: auto;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.block-meta { font-size: var(--fs-xs); color: var(--ink-3); }
.block-tools { display: flex; align-items: center; gap: 8px; }
.block-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.block-link svg { width: 14px; height: 14px; transition: transform 0.35s var(--ease); }
.block-link:hover { color: var(--ink); }
.block-link:hover svg { transform: translateX(3px); }
.block-note {
  margin: 14px 0 0;
  max-width: 88ch;
  font-size: var(--fs-xs);
  line-height: 1.75;
  color: var(--ink-3);
}
.block-note a { color: var(--ink-2); }
.block-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 4vw, 56px);
}
.split-tight { gap: 16px; margin-bottom: 20px; }

/* ---------- 11. Tables ---------- */
.table-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th, .tbl td {
  padding: 14px 14px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl thead th {
  padding-top: 8px;
  padding-bottom: 10px;
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.tbl tbody th { font-weight: 500; }
.tbl tbody tr { transition: background-color 0.15s var(--ease); }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--card) 70%, transparent); }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl strong { font-weight: 650; }
.tbl a { text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.tbl tr.is-muted > * { color: var(--ink-3); }
.tbl .empty { padding: 36px 0; text-align: center; color: var(--ink-3); white-space: normal; }

.ex-cell { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
a.ex-cell:hover .ex-name { text-decoration: underline; text-underline-offset: 3px; }
.ex-name { font-weight: 650; }
.ex-flag { color: var(--sell); font-weight: 700; margin-left: -4px; }
.th-ex { display: inline-flex; align-items: center; gap: 6px; }

.ex-ico { width: 22px; height: 22px; border-radius: 6px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent); }
.ex-ico.xs { width: 14px; height: 14px; border-radius: 3px; }
.ex-ico.sm { width: 16px; height: 16px; border-radius: 4px; }
.ex-ico.xl { width: clamp(34px, 4vw, 48px); height: clamp(34px, 4vw, 48px); border-radius: 10px; }
.pay-ico { width: 16px; height: 16px; border-radius: 4px; }
.pay-ico.lg { width: 28px; height: 28px; border-radius: 7px; }
.pay-ico.xl { width: clamp(34px, 4vw, 48px); height: clamp(34px, 4vw, 48px); border-radius: 10px; }
.pay-cell { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }

.meter { display: inline-flex; align-items: center; gap: 10px; }
.meter-track { width: 52px; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter-fill { display: block; height: 100%; width: calc(var(--w) * 1%); background: var(--ink); border-radius: 2px; transform-origin: left; }
.js [data-reveal].is-in .meter-fill { animation: grow 1s var(--ease) both 0.2s; }
@keyframes grow { from { transform: scaleX(0); } }

.heat {
  display: inline-block;
  min-width: 34px;
  padding: 2px 8px;
  text-align: center;
  border-radius: 3px;
  background: color-mix(in srgb, var(--buy) calc(var(--h) * 0.22%), transparent);
}

.go-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 14px;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.go-btn svg { width: 13px; height: 13px; transition: transform 0.35s var(--ease); }
.go-btn:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); text-decoration: none !important; }
.go-btn:hover svg { transform: translateX(3px); }

.merchant { display: inline-flex; align-items: center; gap: 10px; }
.merchant > span { display: flex; flex-direction: column; line-height: 1.35; }
.merchant-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.merchant-ex { font-size: var(--fs-2xs); color: var(--ink-3); font-weight: 400; }
.badge-v, .badge-best {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px 0 4px;
  height: 18px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--buy);
  background: var(--buy-2);
  border-radius: 3px;
}
.badge-v svg { width: 10px; height: 10px; }
.badge-best { padding: 0 6px; color: var(--on-brand); background: var(--brand); }
.pay-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pay-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 3px;
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  background: var(--paper-2);
  border-radius: 999px;
}
.pay-tag .pay-ico { width: 14px; height: 14px; border-radius: 999px; }

.range-cell { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; }
.range-bar { width: 36px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--buy), var(--sell)); opacity: 0.7; }

.tbl-prose { margin: 20px 0 24px; font-size: 14px; }
.tbl-prose th, .tbl-prose td { white-space: normal; vertical-align: top; line-height: 1.6; padding: 12px 12px; }
.tbl-prose tbody th { font-weight: 650; white-space: nowrap; }

/* ---------- 12. Chart ---------- */
.chart { position: relative; padding-top: 10px; }
.chart-svg { width: 100%; height: clamp(200px, 26vw, 280px); cursor: crosshair; touch-action: pan-y; overflow: visible; }
.chart-svg .ln { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.js .chart-svg .ln.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease-in-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart-svg .area { opacity: 0; animation: fadeIn 0.8s var(--ease) forwards 0.6s; }
@keyframes fadeIn { to { opacity: 1; } }
.chart-tip {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 5;
  min-width: 170px;
  padding: 10px 12px;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--paper);
  background: var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s var(--ease), transform 0.2s var(--ease);
}
.chart-tip.is-on { opacity: 1; transform: none; }
.chart-tip .t { opacity: 0.6; font-family: var(--mono); font-size: 11px; margin-bottom: 2px; }
.chart-tip .row { display: flex; justify-content: space-between; gap: 16px; }
.chart-tip .row b { font-family: var(--mono); font-weight: 600; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.chart-legend .block-link { margin-left: auto; }
.lg { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 16px; height: 2px; display: inline-block; border-radius: 2px; }
.sw-buy { background: var(--buy); height: 2.5px; }
.sw-sell { background: var(--sell); }
.sw-fx { background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 7px); }

/* ---------- 13. CTA band ---------- */
.cta-band {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px 48px;
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  color: #f1efe7;
  background: #11110f;
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
}
.cta-band::before {
  content: "";
  position: absolute;
  right: -10%; top: -60%;
  width: 70%; height: 220%;
  z-index: -1;
  background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, 0.035) 22px 23px);
}
:root[data-theme="dark"] .cta-band { background: #1b1b18; border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta-band { background: #1b1b18; border: 1px solid var(--line); } }
.cta-band-kicker { margin: 0 0 12px; font-size: var(--fs-2xs); letter-spacing: 0.16em; color: #3fd4ff; font-weight: 600; }
.cta-band-title { margin: 0 0 14px; font-size: clamp(20px, 2.3vw, 28px); font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; }
.cta-band-desc { margin: 0; font-size: var(--fs-sm); line-height: 1.75; color: #a9a59a; }
.cta-band-desc a { color: #f1efe7; }
.cta-band-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ex-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #f1efe7;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.03);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.ex-btn span { margin-right: auto; }
.ex-btn-go { width: 14px; height: 14px; opacity: 0.5; transition: transform 0.35s var(--ease), opacity 0.2s; }
.ex-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-2px); text-decoration: none; }
.ex-btn:hover .ex-btn-go { opacity: 1; transform: translate(2px, -2px); }

/* ---------- 14. FAQ ---------- */
.faq { border-top: 1px solid var(--line-soft); }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q { font-size: var(--fs-md); font-weight: 600; line-height: 1.5; transition: color var(--dur); }
.faq-item summary:hover .faq-q { color: var(--ink-2); }
.faq-ico {
  width: 30px; height: 30px; padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: transform 0.4s var(--ease), background-color 0.2s, color 0.2s;
}
.faq-item[open] .faq-ico { transform: rotate(45deg); background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.faq-a { padding: 0 48px 20px 0; }
.faq-a p { margin: 0; color: var(--ink-2); line-height: 1.85; max-width: 80ch; }
.js .faq-item[open] .faq-a { animation: faqIn 0.45s var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- 15. Cards / tiles ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  padding: 22px 22px 56px;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); border-color: var(--ink-4); }
.card-kicker { font-size: var(--fs-2xs); letter-spacing: 0.1em; color: var(--brand); font-weight: 600; }
.card-title { font-size: 17px; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em; text-wrap: balance; }
.card-desc {
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-go {
  position: absolute;
  left: 22px; bottom: 18px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s, transform 0.4s var(--ease);
}
.card-go svg { width: 14px; height: 14px; }
.card:hover .card-go { background: var(--brand); color: var(--on-brand); border-color: var(--brand); transform: translateX(4px); }
.cards-lg { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
.tiles-5 { grid-template-columns: repeat(5, 1fr); }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 0.3s var(--ease), transform 0.35s var(--ease), background-color 0.3s;
}
.tile:hover { border-color: var(--ink); transform: translateY(-2px); }
.tile-title { font-weight: 650; font-size: 15px; }
.tile-desc { font-size: var(--fs-xs); color: var(--ink-3); }
.tile-compact { flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 16px; }
.tile-compact .tile-title { font-size: 14px; }
.tile-go { width: 14px; height: 14px; color: var(--ink-3); transition: transform 0.35s var(--ease), color 0.2s; }
.tile:hover .tile-go { transform: translateX(3px); color: var(--ink); }

/* ---------- 16. Buttons & forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 0.15s var(--ease);
}
.btn svg { width: 15px; height: 15px; transition: transform 0.35s var(--ease); }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn:hover svg:last-child { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }
.btn-primary { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, #000); border-color: color-mix(in srgb, var(--brand) 86%, #000); }
.btn-primary .ex-ico { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }

.filter {
  position: relative;
  z-index: 5;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 20px;
}
.field { min-width: 0; }
.field label, .conv-field label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.field input, .field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none;
  appearance: none;
}
.field input:hover, .field select:hover { border-color: var(--ink-4); }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
.filter-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.filter-checks-label { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--ink-3); }
.filter-checks-label svg { width: 14px; height: 14px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.chk input {
  -webkit-appearance: none;
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 18px; height: 18px;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chk input::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--paper);
  clip-path: polygon(14% 52%, 0 66%, 40% 100%, 100% 22%, 86% 8%, 40% 72%);
  transform: scale(0);
  transition: transform 0.25s var(--ease);
}
.chk:hover input { border-color: var(--ink); }
.chk input:checked { background: var(--brand); border-color: var(--brand); }
.chk input:checked::before { transform: scale(1); }
.chk input:checked + span { color: var(--ink); }

/* Custom listbox (progressive enhancement from app.js) */
.ui-select { position: relative; }
.ui-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; overflow: hidden; }
.ui-select-btn {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.ui-select-btn:hover { border-color: var(--ink-4); }
.ui-select-btn:focus-visible, .ui-select.is-open .ui-select-btn { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
.ui-select-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-ico { width: 16px; height: 16px; border-radius: 4px; color: var(--ink-3); }
.ui-select-chev { width: 14px; height: 14px; color: var(--ink-3); transition: transform 0.3s var(--ease); }
.ui-select.is-open .ui-select-chev { transform: rotate(180deg); color: var(--ink); }
.ui-select-list {
  position: absolute;
  z-index: 30;
  left: 0; right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  max-height: 290px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.16s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.ui-select.drop-up .ui-select-list { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; transform: translateY(6px) scale(0.98); }
.ui-select.is-open .ui-select-list { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity 0.16s var(--ease), transform 0.25s var(--ease); }
.ui-select-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.ui-select-opt.is-active { background: var(--paper-2); color: var(--ink); }
.ui-select-opt[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.ui-select-check { width: 14px; height: 14px; color: var(--buy); opacity: 0; transform: scale(0.5); transition: opacity 0.15s, transform 0.25s var(--ease); }
.ui-select-opt[aria-selected="true"] .ui-select-check { opacity: 1; transform: none; }

/* ---------- 17. Converter ---------- */
.conv {
  padding: clamp(20px, 3vw, 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.conv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.conv-rate { font-size: var(--fs-sm); color: var(--ink-3); }
.conv-rate strong { color: var(--ink); font-size: 15px; }
.conv-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: end; }
.conv-input-wrap { position: relative; }
.conv-input {
  width: 100%;
  height: 72px;
  padding: 0 84px 0 18px;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color var(--dur), box-shadow var(--dur);
  -moz-appearance: textfield;
}
.conv-input::-webkit-outer-spin-button, .conv-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.conv-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 7%, transparent); }
.conv-unit { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.08em; color: var(--ink-3); }
.conv-swap {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.5s var(--ease), background-color 0.2s;
}
.conv-swap svg { width: 18px; height: 18px; }
.conv-swap:hover { transform: rotate(180deg); background: var(--card-2); }
.conv-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  height: 30px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.active { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.conv-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.conv-stats dt { font-size: var(--fs-xs); color: var(--ink-3); }
.conv-stats dd { margin: 4px 0 0; font-size: 17px; font-weight: 600; }

.kv { margin: 0; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.kv div:last-child { border-bottom: 0; }
.kv dt { font-size: var(--fs-sm); color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------- 18. Bars (exchange payment mix) ---------- */
.bars { list-style: none; margin: 8px 0 0; padding: 0; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.bar-label { display: inline-flex; align-items: center; gap: 8px; }
.bar-track { height: 8px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: calc(var(--w) * 1%); background: var(--ink); border-radius: 999px; transform-origin: left; }
.js [data-reveal].is-in .bar-fill { animation: grow 1.1s var(--ease) both 0.15s; }
.bar-val { text-align: right; color: var(--ink-2); }

/* ---------- 19. Prose ---------- */
.prose { max-width: 72ch; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.9; }
.prose-block .prose { margin-top: 8px; }
.prose h2 {
  margin: 56px 0 16px;
  padding-top: 16px;
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--ink);
  border-top: 1px solid var(--ink);
  text-wrap: balance;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 32px 0 10px; font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.prose p { margin: 0 0 18px; text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 1.3em; }
.prose li { margin-bottom: 10px; padding-left: 4px; }
.prose li::marker { color: var(--ink-4); }
.prose code { padding: 1px 6px; background: var(--paper-2); border-radius: 3px; color: var(--ink); overflow-wrap: anywhere; word-break: break-all; }
.prose a { color: var(--ink); }
.formula {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--ink) !important;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r);
}
.callout {
  margin: 20px 0;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
  background: var(--sell-2);
  border-left: 3px solid var(--sell);
  border-radius: var(--r);
}
.prose ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.prose ol.steps > li {
  position: relative;
  padding: 0 0 18px 52px;
  margin: 0;
  counter-increment: step;
}
.prose ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 2px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--on-brand);
  background: var(--brand);
  border-radius: 999px;
}
.prose ol.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px; top: 40px; bottom: 4px;
  width: 1px;
  background: var(--line);
}
.prose ul.checklist { list-style: none; padding-left: 0; }
.prose ul.checklist li { position: relative; padding-left: 30px; }
.prose ul.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 18px; height: 18px;
  border: 1.5px solid var(--buy);
  border-radius: 4px;
  background: linear-gradient(var(--buy), var(--buy)) center / 0 0 no-repeat;
}
.prose ul.checklist li::after {
  content: "";
  position: absolute;
  left: 6px; top: 10px;
  width: 6px; height: 10px;
  border: solid var(--buy);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.glossary { margin: 8px 0 24px; border-top: 1px solid var(--line-soft); }
.glossary div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.glossary dt { font-weight: 700; color: var(--ink); }
.glossary dd { margin: 0; }
.table-note { font-size: var(--fs-xs) !important; color: var(--ink-3); margin-top: -12px !important; }

.rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rules li { display: flex; gap: 16px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.rules-n { font-size: 28px; font-weight: 700; line-height: 1; color: var(--brand); }
.rules strong { display: block; margin-bottom: 6px; font-size: 16px; }
.rules p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); }

/* ---------- 20. Article / about layout ---------- */
.article-hero .page-title { max-width: 22ch; }
.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.byline > span:first-child { color: var(--ink); font-weight: 600; }
.article-grid, .about-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-top: 24px;
}
.about-grid { padding-top: 0; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: var(--fs-sm); }
.toc-h { margin: 0 0 10px; font-size: var(--fs-2xs); letter-spacing: 0.16em; color: var(--ink-3); font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 7px 0 7px 14px;
  margin-left: -1px;
  color: var(--ink-3);
  text-decoration: none;
  border-left: 2px solid transparent;
  line-height: 1.5;
  transition: color 0.2s, border-color 0.3s var(--ease);
}
.toc a .num { font-size: 10.5px; padding-top: 2px; color: var(--ink-4); }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--ink); border-left-color: var(--brand); font-weight: 600; }
.toc-live {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.toc-live-label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 4px; }
.toc-live-row { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--ink-3); }
.toc-live-row b { font-size: 18px; font-weight: 650; }
.toc-live .block-link { margin-top: 6px; }
.article-main { min-width: 0; }
.answer-article { margin: 0 0 40px; }
.prose-article { max-width: 70ch; }
.article-foot { max-width: 70ch; margin-top: 48px; padding: 18px 20px; font-size: var(--fs-sm); line-height: 1.8; color: var(--ink-3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.article-foot p { margin: 0; }
.article-foot a { color: var(--ink-2); }

/* 404 */
.nf { min-height: 46vh; display: flex; flex-direction: column; justify-content: center; }
.nf-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 24px; }
.nf-title .num { font-size: 1.6em; color: var(--ink-4); letter-spacing: -0.06em; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- 21. Footer ---------- */
.site-footer {
  position: relative;
  color: #c4c0b4;
  background: #0d0d0b;
  padding: clamp(48px, 7vw, 88px) 0 32px;
  overflow: hidden;
}
.site-footer a { color: #c4c0b4; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(36px, 5vw, 56px);
  border-bottom: 1px solid #262622;
}
.footer-statement {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #f1efe7;
}
.footer-statement em { font-style: normal; color: #3fd4ff; }
.footer-quote { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.footer-quote-label { font-size: var(--fs-2xs); letter-spacing: 0.14em; color: #7f7b71; }
.footer-quote-val { font-size: clamp(32px, 4vw, 48px); font-weight: 650; color: #f1efe7; letter-spacing: -0.04em; line-height: 1; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px 24px;
  padding: clamp(32px, 5vw, 48px) 0;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); }
.footer-h { margin: 0 0 6px; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0.14em; color: #7f7b71; }
.footer-base { padding-top: 24px; border-top: 1px solid #262622; }
.region-notice { max-width: 100ch; margin: 0 0 12px; padding: 12px 16px; border: 1px solid #34332e; border-left: 3px solid var(--brand-2); border-radius: 10px; font-size: var(--fs-xs); line-height: 1.8; color: #b9b5aa; }
.region-notice strong { color: #f2efe6; font-weight: 600; }
.disclaimer { max-width: 100ch; margin: 0 0 14px; font-size: var(--fs-xs); line-height: 1.8; color: #7f7b71; }
.copyright { margin: 0; font-size: var(--fs-xs); color: #64615a; }

/* ---------- Registration entry card ---------- */
.reg-card { margin: 28px 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--brand-soft), transparent 70%); }
.reg-card-kicker { margin: 0 0 4px; font-size: var(--fs-xs); letter-spacing: .08em; color: var(--brand); font-weight: 600; }
.reg-card-title { margin: 0 0 10px; font-size: 1.15rem; font-weight: 700; }
.reg-list { list-style: none; margin: 0; padding: 0; }
.reg-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; gap: 10px 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.reg-row:first-child { border-top: 0; }
.reg-ex { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.reg-ex small { font-weight: 400; opacity: .6; }
.reg-code { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; opacity: .9; white-space: nowrap; }
.code-chip { padding: 5px 12px; border: 1px dashed var(--brand); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; letter-spacing: .04em; cursor: copy; transition: background .2s var(--ease); }
.code-chip:hover { background: var(--brand-soft); }
.reg-actions { display: inline-flex; align-items: center; gap: 14px; justify-self: end; }
.reg-actions .btn { min-width: 176px; justify-content: center; white-space: nowrap; }
.reg-guide { min-width: 7.5em; font-size: .9rem; white-space: nowrap; }
.reg-note { margin: 12px 0 0; font-size: var(--fs-xs); line-height: 1.75; opacity: .7; }
.block .reg-card { margin: 0; }
@media (max-width: 720px) {
  .reg-row { grid-template-columns: 1fr auto; }
  .reg-actions { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
  .reg-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- 22. Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 90;
  padding: 10px 16px;
  font-size: var(--fs-sm);
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.4s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-family: var(--mono); color: var(--brand-2); margin-left: 6px; }

/* ---------- 23. Reveal motion ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .board { animation: boardIn 0.9s var(--ease) both 0.1s; }
@keyframes boardIn { from { transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- 24. Responsive ---------- */
@media (max-width: 1080px) {
  .main-nav .nav-link-sm { display: none; }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
  .tiles-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 920px) {
  :root { --header-h: 56px; }
  .menu-btn { display: inline-grid; }
  .brand-sub { display: none; }
  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.3);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path 0.5s var(--ease), visibility 0s linear 0.5s;
  }
  .menu-open .main-nav { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 0.5s var(--ease); }
  .main-nav .nav-link, .main-nav .nav-link-sm { display: block; padding: 14px 0; font-size: 17px; border-radius: 0; border-bottom: 1px solid var(--line-soft); }
  .main-nav .nav-link:hover { background: none; }
  .main-nav .nav-link.active::after { content: "●"; float: right; font-size: 8px; line-height: 2.6; color: var(--buy); }
  .nav-indicator { display: none; }
  .header-tools { margin-left: auto; }

  .board { grid-template-columns: 1fr 1fr 1fr; }
  .board-primary { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .board-cell:nth-child(4) { border-right: 0; }
  .split { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .article-grid, .about-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc-live { display: none; }
  .rules { grid-template-columns: 1fr; }
  .conv-stats { grid-template-columns: repeat(2, 1fr); }
  .tiles, .tiles-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .live-chip { display: none; }
  .board { grid-template-columns: 1fr 1fr; }
  .board-cell { border-bottom: 1px solid var(--line-soft); }
  .board-cell:nth-child(3) { border-right: 0; }
  .board-cell:nth-child(4) { grid-column: 1 / -1; border-bottom: 0; }
  .board-cell:nth-child(2) { border-right: 1px solid var(--line-soft); }
  .board-amount .board-cell:nth-child(4) { grid-column: auto; }
  .board-amount .board-cell:nth-child(3) { border-right: 1px solid var(--line-soft); border-bottom: 0; }
  .board-amount .board-cell:nth-child(2) { border-right: 0; }
  .ruler-track { height: 70px; }
  .ruler-cap span:last-child { display: none; }
  .filter-grid { grid-template-columns: 1fr 1fr; padding: 16px; }
  .filter-grid .btn { grid-column: 1 / -1; }
  .conv-grid { grid-template-columns: 1fr; }
  .conv-swap { margin: -4px auto; transform: rotate(90deg); }
  .conv-swap:hover { transform: rotate(270deg); }
  .cta-band-actions { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .footer-quote { align-items: flex-start; }
  .tiles, .tiles-4, .tiles-5 { grid-template-columns: 1fr; }
  .glossary div { grid-template-columns: 1fr; gap: 4px; }
  .answer { grid-template-columns: 1fr; padding: 16px; }
  .answer-tag { grid-row: auto; justify-self: start; }
  .answer p { grid-column: 1; }
  .bar-row { grid-template-columns: 100px 1fr 32px; }
  .faq-a { padding-right: 0; }

  /* Tables → stacked cards */
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody { display: block; }
  .tbl-cards tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .tbl-cards tbody tr:hover { background: none; }
  .tbl-cards tbody th, .tbl-cards tbody td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; }
  .tbl-cards tbody th { grid-column: 1 / -1; }
  .tbl-cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-family: var(--sans); font-size: var(--fs-2xs); color: var(--ink-3); letter-spacing: 0.04em; }
  .tbl-cards td.cell-act { grid-column: 1 / -1; }
  .tbl-cards td.cell-act .go-btn { width: 100%; justify-content: center; height: 38px; }
  .tbl-cards td.empty { grid-column: 1 / -1; text-align: center; }
  .tbl-cards .r { text-align: left; }
}

/* ---------- 25. Article screenshots ---------- */
.shot { margin: 28px 0 32px; }
.shot-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); background: var(--card-2); }
.shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.shot-bar span { margin-left: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 10px; font-size: var(--fs-xs); line-height: 1.7; color: var(--ink-3); }
.shot figcaption b { color: var(--ink-2); font-weight: 600; }
