/* ChainCheck Mini App (Stage H, part 2b visual direction).
   Palette from the bot's own logo (k-means over its profile photo, see
   "Stage H part 2b" in CLAUDE.md): a navy HERO gradient bleeding under
   Telegram's header, a neutral CANVAS of cards below it, one logo-blue
   ACCENT. Rating colours unchanged; on the hero (dark in both schemes) they
   always use their bright variants. Every pairing below was checked for
   contrast (numbers in CLAUDE.md). */

:root {
  /* ---- Logo palette (extracted) ---- */
  --logo-navy-deep: #0a1d32;  /* 26.9% of the logo */
  --logo-navy: #102942;       /* 42.2% */
  --logo-navy-light: #193d5d; /* 15.1% */
  --logo-steel: #2e6692;      /*  8.0% */
  --logo-sky: #62bcea;        /*  4.0%, most saturated */

  /* ---- Hero (same in both schemes) ---- */
  --hero: linear-gradient(135deg, var(--logo-navy-deep) 0%, var(--logo-navy) 55%, var(--logo-navy-light) 100%);
  --on-hero: #ffffff;
  --on-hero-muted: rgba(255, 255, 255, 0.75);
  --hero-tile: rgba(255, 255, 255, 0.15);
  --hero-sk: rgba(255, 255, 255, 0.14);
  --ring-track: rgba(255, 255, 255, 0.25);
  --accent-on-hero: #66bfeb; /* logo sky +1% lightness: pill text >= 4.53:1 over every gradient stop */

  /* ---- Accent ---- */
  --accent: #1e75ab;      /* logo blue hsl(203 70% 39.5%): 5.01:1 on white, 4.60:1 on canvas */
  --accent-fill: #1e75ab; /* MainButton + centre button, white text 5.01:1 (both schemes) */

  /* ---- Canvas (light) ---- */
  --canvas: #f4f5f9;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #667085;
  --hairline: rgba(16, 24, 40, 0.08);
  --soft: rgba(16, 24, 40, 0.05);
  --field: #f4f5f9;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);

  /* ---- Rating tones: canvas variants (light) and hero variants (bright) ---- */
  --tone-clean: #1a8a5a;   --tone-clean-hero: #3ccf8e;
  --tone-low: #0f8b8d;     --tone-low-hero: #2ec4c6;
  --tone-caution: #b7791f; --tone-caution-hero: #e8a84a;
  --tone-high: #c0392b;    --tone-high-hero: #ff6b5e;
  --danger: var(--tone-high);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --radius-card: 16px;
  --radius-field: 14px;
  --radius-pill: 9999px;
  --gutter: 16px;
  --section: 24px;
  --stack: 12px;
  --tabbar-h: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --safe-b: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-l: var(--tg-safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-r: var(--tg-safe-area-inset-right, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

/* Dark: deep grey-navy canvas, never black; cards lifted, no shadow. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --canvas: #0d1626; --card: #18233a; --ink: #eef2f8; --muted: #93a0b8; }
}
:root[data-theme="dark"] {
  --canvas: #0d1626;
  --card: #18233a;
  --ink: #eef2f8;
  --muted: #93a0b8;
  --hairline: rgba(255, 255, 255, 0.07);
  --soft: rgba(255, 255, 255, 0.06);
  --field: #0d1626;
  --shadow: none;
  --accent: var(--logo-sky); /* 7.4:1 on the dark card */
  --tone-clean: var(--tone-clean-hero);
  --tone-low: var(--tone-low-hero);
  --tone-caution: var(--tone-caution-hero);
  --tone-high: var(--tone-high-hero);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

/* ---- Type: 28 / 20 / 16 / 14 / 12, weights 700 / 600 / 400 ---- */
.t28 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.4px; }
.t20 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.2px; }
.t16 { font-size: 16px; line-height: 1.45; font-weight: 400; }
.t14 { font-size: 14px; line-height: 1.43; font-weight: 400; }
.t12 { font-size: 12px; line-height: 1.4; font-weight: 400; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }

/* ---- Layout ---- */
.screen { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--section)); animation: enter 180ms var(--ease) both; }
.has-fallback .screen { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 72px + var(--section)); }
.canvas {
  position: relative;
  max-width: 560px;
  margin: -24px auto 0; /* the first card overlaps the hero */
  padding: 0 calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
  display: flex; flex-direction: column; gap: var(--stack);
}
.fine { margin: var(--stack) 4px 0; line-height: 1.5; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Hero ---- */
.hero { background: var(--hero); color: var(--on-hero); }
.hero-inner {
  max-width: 560px; margin: 0 auto;
  padding: calc(12px + var(--safe-t)) calc(20px + var(--safe-r)) 48px calc(20px + var(--safe-l));
}
.hero-top { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.hero-chip { padding: 4px 12px; border-radius: var(--radius-pill); background: var(--hero-tile); }
.hero-big { margin-top: 20px; font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -1.5px; }
.hero-cap { margin-top: 6px; color: var(--on-hero-muted); }
.hero-title { margin-top: 16px; }
.on-hero-muted { color: var(--on-hero-muted); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border-radius: 14px; background: var(--hero-tile); }
.tile .t16 { overflow-wrap: anywhere; }
.hero-ring { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: var(--radius-pill); background: var(--hero-tile); color: var(--on-hero);
  transition: transform 150ms var(--ease);
}
/* Stage S: Copy + Share -- wraps at 320px in long locales instead of overflowing. */
.addr-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; }

/* Ring: white 25% track, rating stroke (bright variant), big number. */
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { display: block; }
.ring-track, .ring-fg { fill: none; stroke-width: 12; }
.ring-track { stroke: var(--ring-track); }
.ring-fg { stroke: var(--t-hero); stroke-linecap: round; transition: stroke-dashoffset 700ms var(--ease); }
.ring-fg.is-empty { stroke-opacity: 0; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 48px; line-height: 1; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ring-center .t12 { margin-top: 4px; }

/* Tinted pills: 10% background, full-colour text. */
.tone-clean { --t: var(--tone-clean); --t-hero: var(--tone-clean-hero); }
.tone-low { --t: var(--tone-low); --t-hero: var(--tone-low-hero); }
.tone-caution { --t: var(--tone-caution); --t-hero: var(--tone-caution-hero); }
.tone-high { --t: var(--tone-high); --t-hero: var(--tone-high-hero); }
.chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px;
  border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
}
.rating-chip { color: var(--t-hero); background: color-mix(in srgb, var(--t-hero) 10%, transparent); }
.chain-chip { color: #ffffff; background: rgba(255, 255, 255, 0.14); } /* Stage L: Bitcoin / Ethereum (Stage P: / Tron), on the hero */
.pill-accent { color: var(--accent-on-hero); background: color-mix(in srgb, var(--accent-on-hero) 10%, transparent); }
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .rating-chip, .pill-accent { background: rgba(255, 255, 255, 0.08); }
}

/* ---- Cards ---- */
.card {
  display: block;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px;
}
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: var(--stack); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-align: right; }
.state { text-align: center; padding: 28px 20px 24px; }
.state-icon {
  width: 44px; height: 44px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  background: var(--soft);
}
.state .t20 { margin-bottom: 8px; }
.state .t16 { margin: 0 auto; max-width: 34ch; }
.state .btn { margin-top: 20px; }
.ic { flex: none; display: block; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border: 0; border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 600; text-decoration: none;
  transition: transform 150ms var(--ease), opacity 150ms var(--ease);
}
.btn:active, .seg-btn:active, .tab:active, .icon-btn:active, .hero-btn:active, .fab:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-fill); color: #fff; }
.btn-quiet { background: var(--soft); color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; }
.icon-btn {
  flex: none; width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius-pill);
  background: var(--soft); color: var(--muted);
  transition: transform 150ms var(--ease);
}

/* ---- Address field: errors change colour, never layout ---- */
.field {
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 10px 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-field);
  background: var(--field); cursor: text;
  transition: border-color 150ms var(--ease);
}
.field:focus-within { border-color: var(--accent); }
.field.is-invalid { border-color: var(--danger); }
.field input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; padding: 0; background: transparent;
  font-family: var(--mono); font-size: 16px; line-height: 24px; /* >=16px: no iOS zoom */
  caret-color: var(--accent);
}
.field input::placeholder { color: var(--muted); font-family: var(--font); }
.field input:disabled { opacity: 0.6; }
.helper { margin: 8px 4px 0; min-height: calc(2 * 1.43em); }
.helper.is-error { color: var(--danger); }

/* Examples as a pill segmented control. */
.seg-label { margin: 8px 4px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--field); }
.seg-btn {
  min-height: 36px; padding: 0 8px; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink); font-size: 14px; font-weight: 600;
  transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}
.seg-btn.is-on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
:root[data-theme="dark"] .seg-btn.is-on { background: var(--soft); box-shadow: none; }
.seg-btn:disabled { opacity: 0.6; }
/* Stage P: five examples -> 3 + 2 (the Bitcoin examples on row one, ETH and
   Tron on row two) on a 6-column grid, so every label stays full size and
   tappable at 320px; the rounded rectangle replaces the one-row pill shape
   (Stage L's 2 x 2 .seg-4 is gone). */
.seg-5 { grid-template-columns: repeat(6, 1fr); border-radius: 20px; }
.seg-5 .seg-btn { grid-column: span 2; border-radius: 16px; }
.seg-5 .seg-btn:nth-child(n + 4) { grid-column: span 3; }
/* Stage T: fewer chips when a chain is switched off (4 keeps the 3 + 2 grid). */
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg-1 { grid-template-columns: 1fr; }

/* Stage T part 2: the maintenance banner -- the Caution tone (amber), readable
   in both schemes; sits above the hero, inside the top safe area. */
.maint-banner {
  position: relative; z-index: 3;
  margin: 0; padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: #fff4e0; color: #6b4400;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
:root[data-theme="dark"] .maint-banner { background: #3a2c10; color: #ffd98a; border-bottom-color: rgba(255, 255, 255, 0.08); }

/* ---- Result rows ---- */
.rows { display: flex; flex-direction: column; }
.rows > li + li { border-top: 1px solid var(--hairline); }
.reason { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.rows > li:first-child { padding-top: 0; }
.rows > li:last-child { padding-bottom: 0; }
.dot { flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--t); }
.metric { padding: 12px 0; }
.metric-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.metric-top .t16 { text-align: right; overflow-wrap: anywhere; }
.bar { height: 4px; margin-top: 8px; border-radius: var(--radius-pill); background: var(--soft); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.source { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
/* Stage L: "Partial coverage" / "Smart contract" notes above the result cards. */
/* Stage O: Help › Language */
.lang-list { display: flex; flex-direction: column; margin-bottom: 8px; }
.lang-btn { display: flex; align-items: center; justify-content: space-between; min-height: 48px; width: 100%; padding: 0 4px;
  border: 0; border-top: 1px solid var(--hairline); background: transparent; color: var(--ink); text-align: left; }
.lang-btn:first-child { border-top: 0; }
.lang-btn.is-on { color: var(--accent); font-weight: 600; }
.invite-link { margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--field); word-break: break-all; } /* Stage N */
.invite-stats { margin-top: 10px; }
.note { display: flex; gap: 12px; align-items: flex-start; }
.note-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--soft); }
.note p { margin-top: 4px; }
.source-ic { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--soft); }
.usage { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 4px 4px 0; }

/* ---- Skeletons (opacity pulse only) ---- */
.sk { background: var(--soft); border-radius: var(--radius-pill); animation: pulse 1.1s ease-in-out infinite alternate; }
.sk-on-hero { background: var(--hero-sk); }
.sk-big { width: 64px; height: 52px; margin-top: 22px; border-radius: 12px; }
.sk-cap { width: 180px; height: 14px; margin-top: 12px; }
.sk-tile { height: 62px; animation: pulse 1.1s ease-in-out infinite alternate; }
.sk-ring { width: 168px; height: 168px; border-radius: 50%; border: 12px solid var(--hero-sk); animation: pulse 1.1s ease-in-out infinite alternate; }
.sk-title { width: 40%; height: 16px; margin-bottom: 16px; }
.sk-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sk-dot { width: 8px; height: 8px; }
.sk-line { flex: 1; height: 14px; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* ---- Tab bar: Check · Plans · [new check] · Account · Help ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--card);
  border-top: 1px solid var(--hairline);
  transition: transform 180ms var(--ease), opacity 180ms var(--ease);
}
.tabbar.is-hidden { transform: translateY(100%); opacity: 0; pointer-events: none; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted);
  font-size: 12px; font-weight: 600;
  transition: transform 150ms var(--ease);
}
.tab.is-active { color: var(--accent); }
.tab-center { position: relative; display: flex; justify-content: center; }
.fab {
  position: absolute; top: -18px;
  width: 56px; height: 56px; display: grid; place-items: center;
  border: 4px solid var(--card); border-radius: 50%;
  background: var(--accent-fill); color: #fff;
  box-shadow: 0 6px 16px rgba(30, 117, 171, 0.35);
  transition: transform 150ms var(--ease);
}
:root[data-theme="dark"] .fab { box-shadow: none; }
.mainbar {
  position: fixed; left: 0; right: 0; z-index: 9;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  padding: 12px calc(var(--gutter) + var(--safe-r)) 12px calc(var(--gutter) + var(--safe-l));
  background: var(--canvas);
}

/* ---- Plans ---- */
.plan-now { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.plan-now .bar { margin-top: 12px; }
.bar-hero { background: var(--ring-track); }
.bar-hero > span { background: var(--on-hero); }
.plan { display: flex; flex-direction: column; gap: 4px; }
.plan.is-current { outline: 2px solid var(--accent); outline-offset: -2px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-price { margin-top: 4px; }
.plan-btn { margin-top: 12px; }
.plan-reason { margin-top: 4px; }
/* Stage Q: a paid card offers a subscription and a pass, one option each. */
.plan-option + .plan-option { margin-top: 4px; }
.plan-option > .t12.muted:not(.plan-reason) { margin-top: 4px; }
.sub-btn { margin-top: 12px; }
/* Stage R: the watchlist -- Watch under the address row; Account rows with Remove. */
.watch-row { display: flex; justify-content: center; margin-top: 8px; }
.hero-btn.is-on { background: rgba(255, 255, 255, 0.24); }
.watch-item { display: flex; align-items: center; gap: 8px; }
.watch-item .recent { flex: 1; min-width: 0; }
.watch-remove { flex-shrink: 0; color: var(--danger); }
.watch-changed { color: var(--accent); font-weight: 600; }
.watch-paused { margin-bottom: 8px; }
.chain-soft { background: var(--field); color: var(--ink); }
.pill-soft { min-height: 24px; font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pill-sm { min-height: 24px; padding: 0 10px; font-size: 12px; }
.rating-soft { color: var(--t); background: color-mix(in srgb, var(--t) 10%, transparent); }
@supports not (background: color-mix(in srgb, red 10%, transparent)) { .pill-soft, .rating-soft { background: var(--soft); } }
.center { text-align: center; }
.fine .link { font-weight: 600; }

/* ---- Purchase sheet ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 12, 24, 0.45); animation: fade 180ms var(--ease) both; }
.sheet {
  position: relative; width: 100%; max-width: 560px; overflow: hidden;
  padding: 28px 20px calc(20px + var(--safe-b));
  border-radius: 20px 20px 0 0; background: var(--card); text-align: center;
  display: flex; flex-direction: column; gap: 12px;
  animation: rise 200ms var(--ease) both;
}
.sheet .state-icon { margin-bottom: 4px; }
.state-icon.is-ok { color: #fff; background: var(--tone-clean); }
.sheet .t16 { max-width: 36ch; margin: 0 auto; }
.bar-indeterminate { position: relative; }
.bar-indeterminate > span { width: 40%; animation: slide 1.1s ease-in-out infinite alternate; }
@keyframes slide { from { transform: translateX(-10%); } to { transform: translateX(160%); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.confetti { position: absolute; inset: 0 0 auto; height: 0; pointer-events: none; }
.confetti i {
  position: absolute; top: 0; left: calc(8% + var(--i) * 6.2%);
  width: 6px; height: 10px; border-radius: 2px; opacity: 0;
  background: var(--accent);
  animation: confetti 1.2s var(--ease) calc(var(--i) * 30ms) 1 both;
}
.confetti i:nth-child(3n) { background: var(--tone-clean); }
.confetti i:nth-child(3n+1) { background: var(--tone-caution); }
@keyframes confetti {
  0% { opacity: 0; transform: translateY(0) rotate(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(120px) rotate(200deg); }
}

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; z-index: 40;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--card);
  animation: fade 150ms var(--ease) both;
}

/* ---- Account ---- */
.profile { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.avatar { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--hero-tile); font-weight: 700; }
.usage-cap { margin-top: 6px; }
.card .bar { margin-top: 12px; }
.recent-note { margin: -4px 0 8px; }
.recent {
  width: 100%; display: grid; grid-template-columns: 1fr auto auto 16px; align-items: center; gap: 10px;
  padding: 12px 0; border: 0; background: none; color: var(--ink); text-align: left;
  transition: transform 150ms var(--ease);
}
.recent:active { transform: scale(0.99); }
.recent .ic { color: var(--muted); }
.rows > li > .recent { padding: 12px 0; }
.rows > li:first-child > .recent { padding-top: 0; }
.rows > li:last-child > .recent { padding-bottom: 0; }
.recent-when { white-space: nowrap; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* ---- Help ---- */
.fold { padding: 0; }
.fold h2 { margin: 0; }
.fold-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left;
}
.fold-ic { color: var(--muted); transition: transform 180ms var(--ease); }
.fold-ic.is-open { transform: rotate(180deg); }
.fold-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; animation: fade 150ms var(--ease) both; }
.band { display: grid; grid-template-columns: 84px 56px 1fr; align-items: baseline; gap: 8px; padding: 10px 0; }
.band .pill { justify-self: start; }
.src { padding: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.terms { white-space: pre-wrap; }
.state .why { margin: 12px auto 0; max-width: 34ch; }
.support-row {
  width: 100%; display: grid; grid-template-columns: 24px 1fr 16px; align-items: center; gap: 12px;
  border: 0; color: var(--ink); text-align: left; font: inherit;
  transition: transform 150ms var(--ease);
}
.support-row:active { transform: scale(0.99); }
.support-row > .ic { color: var(--muted); }
.support-text { display: flex; flex-direction: column; gap: 2px; }

/* ---- Support (Stage U part 2) ---- */
.bubbles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; }
.bubble-row.is-mine { align-items: flex-end; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--soft); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-row.is-mine .bubble { border-radius: 18px 18px 6px 18px; background: var(--accent-fill); color: #fff; }
.bubble-meta { margin-top: 4px; }
.bubble-tag { font-weight: 600; }
.support-thread { display: flex; flex-direction: column; gap: 12px; }
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer-input {
  width: 100%; box-sizing: border-box; min-height: 104px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--hairline); border-radius: 16px; background: var(--soft); color: var(--ink); font-family: var(--font);
}
.composer-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer-input:disabled { opacity: 0.6; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-over { color: var(--danger); font-weight: 600; }
.support-note { margin: 0; }

/* ---- Market (Stage V part 3) -- neutral ▲/▼: no green/red, no good/bad framing ---- */
.hero-top-end { display: inline-flex; align-items: center; gap: 8px; }
.hero-help { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--hero-tile); color: #fff; }
.hero-help:active { transform: scale(0.95); }
.price-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; grid-template-areas: 'id spark num' 'vol vol vol';
  align-items: center; column-gap: 12px; row-gap: 2px; padding: 12px 0; border: 0; background: none; color: var(--ink); text-align: left; font: inherit;
}
.price-row.is-na { grid-template-columns: 1fr auto; grid-template-areas: 'id num'; }
.price-row:active { opacity: 0.7; }
.price-id { grid-area: id; display: flex; flex-direction: column; min-width: 0; }
.price-num { grid-area: num; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.price-vol { grid-area: vol; }
.price-row .spark, .price-row .spark-empty { grid-area: spark; }
.spark { display: block; overflow: visible; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.spark-lg { width: 100%; height: 96px; }
.spark-empty { display: block; width: 96px; height: 28px; }
.chg { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chg-up, .chg-down { color: var(--ink); }
.market-stale { background: var(--soft); border: 1px dashed var(--hairline); }
.market-stale-inline { color: var(--muted); margin: 0 0 4px; }
.market-foot { text-align: center; margin: 4px 0 8px; line-height: 1.5; }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.alert-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-row.is-fired .t14 { color: var(--muted); }
.alerts-sent { margin: 12px 0 0; }
.alerts-plans { display: block; margin-top: 12px; text-align: left; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-row p { margin: 0; }
.switch { flex: none; position: relative; width: 50px; height: 30px; border: 0; border-radius: 15px; background: var(--field); transition: background 150ms var(--ease); }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 150ms var(--ease); }
.switch.is-on { background: var(--accent-fill); }
.switch.is-on span { transform: translateX(20px); }
.switch:disabled { opacity: 0.6; }
.sheet-market { text-align: left; gap: 12px; max-height: 88vh; overflow-y: auto; }
.sheet-market .sheet-head { padding-right: 36px; }
.sheet-market .sheet-head .t20, .sheet-market .sheet-head .t28 { margin: 0; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); }
.sheet-chart-label { margin: 4px 0 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 4px 0; }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats dd { margin: 0; }
.stats .stats-wide { grid-column: 1 / -1; }
.field-label { margin: 4px 0 -4px; }
.field-input { width: 100%; box-sizing: border-box; height: 48px; padding: 0 14px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--field); color: var(--ink); font-size: 16px; font-family: var(--font); }
.field-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.watch-actions { display: inline-flex; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Stage Y part 4: analyst posts -- the one-time card and the Account switch. */
.bc-card { margin-bottom: 12px; border-color: var(--accent-fill); }
.bc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bc-card-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.bc-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bc-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bc-status { margin-top: 6px; }
