/* ==========================================================================
   Foizing — user Mini App styles
   Dark-first "night sky" with the brand violet→pink gradient as an accent.
   Spacing on an 8 px grid (4 px for fine adjustments). Radius 20 cards / 16 buttons.
   Each test passes its accent via inline --accent / --accent-rgb / --accent-dark /
   --on-accent (see ui.js accentVars).
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0B0B14;
  --bg-glass: rgba(11, 11, 20, 0.82);
  --surface: #151526;
  --surface-2: #1D1D33;
  --surface-3: #26264A;
  --text: #F4F3FF;
  --text-2: #D9D7F0;
  --muted: #A3A1C2;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --brand: #7C5CFF;
  --brand-2: #FF5CA8;
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --ok: #2BD67B;
  --warn: #FFB547;
  --bad: #FF5C6C;
  --toast-bg: #24243F;
  --shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  --img-bg: #FFFFFF;

  --accent: var(--brand);
  --accent-rgb: 124, 92, 255;
  --accent-dark: #4D39A0;
  --on-accent: #FFFFFF;
  --accent-ink: var(--brand);

  --r-card: 20px;
  --r-btn: 16px;
  --r-sm: 12px;
  --gutter: 16px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px),
    calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
  --vh: var(--tg-viewport-stable-height, 100vh);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F5F4FA;
  --bg-glass: rgba(245, 244, 250, 0.86);
  --surface: #FFFFFF;
  --surface-2: #F0EEF9;
  --surface-3: #E4E0F6;
  --text: #16142A;
  --text-2: #34314F;
  --muted: #5F5C7E;
  --line: rgba(22, 20, 42, 0.08);
  --line-2: rgba(22, 20, 42, 0.14);
  --brand: #6A48F5;
  --brand-2: #EC4899;
  --ok: #10A35B;
  --warn: #C77C00;
  --bad: #E5484D;
  --toast-bg: #FFFFFF;
  --shadow: 0 16px 40px -18px rgba(40, 30, 90, 0.28);
  --accent-ink: var(--brand);
  color-scheme: light;
}

/* accent text: the raw accent on dark, a darker shade on light backgrounds */
[style*="--accent-rgb"] { --accent-ink: var(--accent); }
[data-theme="light"] [style*="--accent-rgb"] { --accent-ink: var(--accent-dark); }

@media (min-width: 400px) {
  :root { --gutter: 20px; }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

html.is-locked, html.is-locked body { overflow: hidden; }

/* The page colour lives on <html>; body stays transparent so the fixed sky layers
   (z-index -1 pseudo-elements in the root stacking context) are not painted over. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--vh);
  background: transparent;
  color: var(--text);
  font: 500 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

/* night sky: soft brand glows + a star field fading downwards */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    radial-gradient(90% 55% at 85% -8%, rgba(124, 92, 255, 0.26), transparent 62%),
    radial-gradient(70% 45% at -10% 8%, rgba(255, 92, 168, 0.12), transparent 60%),
    radial-gradient(80% 50% at 50% 115%, rgba(124, 92, 255, 0.10), transparent 60%);
}
body::after {
  background: url("../img/stars.svg") repeat;
  background-size: 420px 420px;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(90% 55% at 85% -8%, rgba(106, 72, 245, 0.14), transparent 62%),
    radial-gradient(70% 45% at -10% 8%, rgba(236, 72, 153, 0.08), transparent 60%);
}
[data-theme="light"] body::after { display: none; }

h1, h2, h3, p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
button:disabled { cursor: default; }
ul, ol { margin: 0; padding: 0; }
:focus-visible {
  outline: 2.5px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 8px;
}

.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }
.center { text-align: center; }
.noscript { padding: 32px var(--gutter); text-align: center; }

/* ------------------------------------------------------------------ typography */
.display {
  font: 800 36px/1.08 var(--font);
  letter-spacing: -0.03em;
}
.display-sm {
  font: 800 28px/1.15 var(--font);
  letter-spacing: -0.02em;
}
.h1 { font: 800 26px/1.2 var(--font); letter-spacing: -0.02em; }
.h2 { font: 800 21px/1.25 var(--font); letter-spacing: -0.01em; }
.h3 { font: 800 18px/1.3 var(--font); }
.lead { font-size: 16px; line-height: 1.5; color: var(--muted); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 800 14px/1 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------------ app & screens */
.app {
  position: relative;
  min-height: var(--vh);
}

.screen {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  min-height: var(--vh);
  margin: 0 auto;
  padding: calc(var(--safe-top) + 16px) var(--gutter) calc(var(--safe-bottom) + 24px);
}

.screen.in-fwd { animation: scrInFwd 0.24s var(--ease) both; }
.screen.in-back { animation: scrInBack 0.24s var(--ease) both; }
.screen.screen-out {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
}
.screen.out-fwd { animation: scrOutFwd 0.22s ease both; }
.screen.out-back { animation: scrOutBack 0.22s ease both; }

@keyframes scrInFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes scrInBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes scrOutFwd { to { opacity: 0; transform: translateX(-28px); } }
@keyframes scrOutBack { to { opacity: 0; transform: translateX(28px); } }

/* ------------------------------------------------------------------ buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font: 800 16px/1.2 var(--font);
  text-align: center;
  transition: transform 0.12s var(--ease), filter 0.2s, background-color 0.2s, opacity 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn[aria-busy="true"] { opacity: 1; }
.btn[aria-busy="true"] > * { visibility: hidden; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

.btn-primary {
  background: var(--grad);
  color: #FFFFFF;
  box-shadow: 0 12px 28px -12px rgba(255, 92, 168, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.8));
  color: var(--on-accent);
  box-shadow: 0 14px 32px -14px rgba(var(--accent-rgb), 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-secondary { background: var(--surface-2); border-color: var(--line-2); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn-danger { background: var(--bad); color: #FFFFFF; }
.btn-lg { min-height: 58px; font-size: 17px; border-radius: 18px; }
.btn-sm { width: auto; min-height: 44px; padding: 0 16px; font-size: 15px; gap: 6px; }
.btn-sm .ic { width: 18px; height: 18px; }

.btn-gift {
  background: rgba(43, 214, 123, 0.12);
  border-color: rgba(43, 214, 123, 0.4);
  flex-wrap: wrap;
}
.btn-gift .chip { min-height: 28px; padding: 4px 10px; font-size: 13px; }

.btn-bundle {
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 12px 16px;
  text-align: left;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
}
.bb-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bb-main b { font-size: 16px; }
.bb-main span { font-size: 14px; font-weight: 600; color: var(--muted); }
.bb-price { font-size: 17px; white-space: nowrap; }

.btn-col { display: flex; flex-direction: column; gap: 10px; }

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.12s var(--ease);
}
.icon-btn:active { transform: scale(0.94); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
}
.link-btn .ic { width: 18px; height: 18px; }
.center-btn { align-self: center; }

/* ------------------------------------------------------------------ chips & badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font: 700 14px/1.2 var(--font);
  white-space: nowrap;
}
.chip .ic { width: 16px; height: 16px; }
.chip-action {
  position: relative;
  z-index: 2;
  min-height: 40px;
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.chip-action .ic { color: var(--accent-ink); }
.chip-action[aria-busy="true"] { opacity: 0.6; }
.chip-soft { background: rgba(var(--accent-rgb), 0.14); border-color: transparent; }
.chip-soft .ic { color: var(--accent-ink); }
.chip-brand, .chip-accent {
  min-height: 0;
  padding: 3px 8px;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}
.chip-brand { background: var(--grad); color: #FFFFFF; }
.chip-accent { background: var(--accent); color: var(--on-accent); }
.chip.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: 800 13px/1 var(--font);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge .ic { width: 14px; height: 14px; stroke-width: 3; }
.badge-free, .badge-ok { background: rgba(43, 214, 123, 0.16); color: var(--ok); }
.badge-hot { background: var(--grad); color: #FFFFFF; }

/* ------------------------------------------------------------------ cards & blocks */
.card {
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line);
}
.card > .h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card > .h3 .ic { color: var(--accent-ink); }
.card-soft { padding: 16px; border-radius: 16px; background: var(--surface-2); }

.note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.note p { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.note > .ic { color: var(--accent-ink); margin-top: 2px; }
.note-ok > .ic { color: var(--ok); }
.note-warn { background: rgba(255, 181, 71, 0.08); border-color: rgba(255, 181, 71, 0.3); }
.note-warn > .ic { color: var(--warn); }
.note-inline {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.note-inline .ic { width: 18px; height: 18px; margin-top: 1px; }

.block .h3 { margin-bottom: 8px; }
.block p { color: var(--text-2); line-height: 1.6; }
.block p + p { margin-top: 10px; }
.block-tip {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-card);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}
.block-tip > div { min-width: 0; }
.block-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-ink);
}

.row-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.12s var(--ease);
}
.row-card:active { transform: scale(0.985); }
.row-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-ink);
}
.row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.row-main b { font-weight: 800; font-size: 16px; }
.row-main span { font-size: 14px; color: var(--muted); }
.row-go { color: var(--muted); }

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transition: width 1s var(--ease);
}
.bar-accent > span { background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.6), var(--accent)); }

/* ------------------------------------------------------------------ loading & states */
.skel {
  width: 100%;
  border-radius: var(--r-card);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skel + .skel { margin-top: 12px; }
.skel-circle { border-radius: 50%; margin-left: auto; margin-right: auto; }

.spinner {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(var(--accent-rgb), 0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }

.dots { display: flex; gap: 8px; }
.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot 1s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }

.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 8px 16px;
  text-align: center;
}
.state-ic {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: var(--surface-2);
  color: var(--muted);
}
.state-ic .ic { width: 32px; height: 32px; }
.state-ic.is-bad { background: rgba(255, 92, 108, 0.12); color: var(--bad); }
.state-ic.is-warn { background: rgba(255, 181, 71, 0.12); color: var(--warn); }
.state-title { font: 800 22px/1.25 var(--font); }
.state-text { color: var(--muted); max-width: 340px; line-height: 1.5; }
.state-block .btn { max-width: 320px; margin-top: 8px; }
.boot-error { justify-content: center; }

/* ------------------------------------------------------------------ splash, fatal, dev back */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  transition: opacity 0.35s ease;
}
.splash.is-hidden { opacity: 0; pointer-events: none; }
.splash-in { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.splash-logo { filter: drop-shadow(0 16px 32px rgba(124, 92, 255, 0.5)); animation: float 2.4s ease-in-out infinite; }
.splash-name { margin-top: 12px; font: 800 28px/1 var(--font); letter-spacing: -0.02em; }
.splash-tag { color: var(--muted); font-weight: 600; }
.splash-bar {
  position: relative;
  width: 120px;
  height: 4px;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.splash-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--grad);
  animation: slide 1.1s ease-in-out infinite;
}
.splash-in.is-stalled .splash-bar { display: none; }
.splash-fail {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: calc(var(--safe-bottom) + 32px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
}
.splash-fail[hidden] { display: none; }

.fatal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px var(--gutter);
  background: var(--bg);
}
.fatal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 380px;
}
.fatal-card .logo-mark { filter: drop-shadow(0 16px 32px rgba(124, 92, 255, 0.45)); }

.dev-back {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 12px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dev-back[hidden] { display: none; }
.dev-back:not([hidden]) ~ .toast { top: calc(var(--safe-top) + 64px); }

/* ------------------------------------------------------------------ home */
.home-top { display: flex; align-items: center; gap: 12px; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad);
  color: #FFFFFF;
  font: 800 20px/1 var(--font);
  box-shadow: 0 8px 20px -8px rgba(255, 92, 168, 0.6);
}
.hello { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hello-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 800 18px/1.3 var(--font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hello-sub { font-size: 14px; color: var(--muted); }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 8px;
}
.hero .display { max-width: 15ch; }
.hero .lead { max-width: 30ch; }
.hero-deco {
  position: absolute;
  top: -4px;
  right: -28px;
  z-index: -1;
  width: 190px;
  height: 190px;
  background: url("../img/orbit.svg") center / contain no-repeat;
  opacity: 0.9;
  animation: float 6s ease-in-out infinite;
}
[data-theme="light"] .hero-deco { opacity: 0.7; }
.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.hero-stat b { color: var(--text); font-weight: 800; }
.hero-stat .ic { width: 18px; height: 18px; color: var(--brand-2); }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(255, 92, 168, 0.1));
  border: 1px solid rgba(124, 92, 255, 0.3);
}
.banner p { font-size: 15px; line-height: 1.5; white-space: pre-line; }
.banner .ic { color: var(--brand-2); margin-top: 1px; }

.bundle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  overflow: hidden;
  border-radius: var(--r-card);
  border: 1.5px solid transparent;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 92, 168, 0.16), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
  box-shadow: 0 16px 36px -20px rgba(124, 92, 255, 0.8);
  text-align: left;
  transition: transform 0.12s var(--ease);
}
.bundle:active { transform: scale(0.985); }
.bundle[aria-busy="true"] { opacity: 0.7; }
.bundle-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--grad);
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.bundle-ic .ic { width: 26px; height: 26px; }
.bundle-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.bundle-title { font: 800 17px/1.3 var(--font); }
.bundle-sub { font-size: 14px; line-height: 1.4; color: var(--muted); }
.bundle-price { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.bundle-price b { font: 800 19px/1 var(--font); }
.bundle-price s { font-size: 14px; color: var(--muted); }
.bundle-go {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
}

.refcard {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.12s var(--ease);
}
.refcard:active { transform: scale(0.985); }
.refcard-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(43, 214, 123, 0.12);
}
.refcard-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.refcard-main > b { font-weight: 800; font-size: 16px; }
.refcard-text { font-size: 14px; line-height: 1.4; color: var(--muted); }
.refcard-prog { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.refcard-prog .bar { flex: 1; height: 6px; }
.refcard-prog .bar > span { background: linear-gradient(90deg, #22C17A, var(--ok)); }
.refcard-step { font: 800 13px/1 var(--font); color: var(--ok); white-space: nowrap; }
.refcard-go { color: var(--muted); }

.section { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-head .muted { font-size: 14px; font-weight: 700; }

.tlist { display: grid; gap: 12px; list-style: none; }
.tcard {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-card);
  background:
    radial-gradient(130% 120% at 100% 0%, rgba(var(--accent-rgb), 0.2), transparent 55%),
    var(--surface);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.14s var(--ease), border-color 0.2s;
}
.tcard:has(.tcard-hit:active) { transform: scale(0.985); }
.tcard-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.tcard-emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.38), rgba(var(--accent-rgb), 0.12));
  box-shadow: 0 10px 24px -10px rgba(var(--accent-rgb), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.tcard-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.tcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tcard-title { font: 800 17px/1.3 var(--font); }
.tcard-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}
.tcard-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tcard-meta span, .tcard-people { display: inline-flex; align-items: center; gap: 6px; }
.tcard-meta .ic, .tcard-people .ic { width: 16px; height: 16px; color: var(--accent-ink); }
.tcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tcard-people { font-size: 14px; color: var(--muted); }

.home-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.home-foot p { display: flex; align-items: center; gap: 8px; }
.home-foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--brand); font-weight: 700; }
.home-foot a .ic { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ intro */
.intro-hero,
.res-hero,
.pay-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  text-align: center;
}
.intro-hero::before,
.res-hero::before,
.pay-hero::before,
.calc::before {
  content: "";
  position: absolute;
  top: -96px;
  left: 50%;
  z-index: -1;
  width: 460px;
  height: 340px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.32), transparent);
  pointer-events: none;
}
.intro-hero .lead { max-width: 34ch; }
.intro-orb,
.pay-orb {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin-bottom: 8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.2), transparent 45%),
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.5), rgba(var(--accent-rgb), 0.12));
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 24px 60px -18px rgba(var(--accent-rgb), 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: float 4s ease-in-out infinite;
}

.info-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ichip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.ichip b { color: var(--text); font-weight: 800; }
.ichip .ic { width: 16px; height: 16px; color: var(--accent-ink); }
.ichip-warn .ic { color: var(--warn); }

.about {
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line);
}
.about > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 16px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.about > summary::-webkit-details-marker { display: none; }
.about > summary > span { flex: 1; }
.about > summary > .ic:first-child { color: var(--accent-ink); }
.about-chev { color: var(--muted); transition: transform 0.2s var(--ease); }
details[open] > summary .about-chev { transform: rotate(180deg); }
.about-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}
.about-k { color: var(--text); font-weight: 700; }
.about-cite { font-style: italic; overflow-wrap: anywhere; }
.about-body .link-btn { align-self: flex-start; }
.disclaimer {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.disclaimer .ic { color: var(--ok); width: 18px; height: 18px; margin-top: 2px; }

.cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: auto calc(-1 * var(--gutter)) calc(-1 * (var(--safe-bottom) + 24px));
  padding: 24px var(--gutter) calc(var(--safe-bottom) + 16px);
  background: linear-gradient(to bottom, transparent, var(--bg) 36%);
}
.cta-hint { font-size: 14px; color: var(--muted); text-align: center; }

/* ------------------------------------------------------------------ question flow */
.flow { gap: 0; padding-top: 0; }
.flow-top {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 calc(-1 * var(--gutter));
  padding: calc(var(--safe-top) + 12px) var(--gutter) 12px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.flow-row { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.flow-test {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}
.flow-test > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-count { font: 800 17px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-count span { color: var(--muted); }
.flow-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font: 800 15px/1 var(--font);
  font-variant-numeric: tabular-nums;
}
.flow-timer .ic { width: 16px; height: 16px; color: var(--accent-ink); }
.flow-timer.is-warn { background: rgba(255, 181, 71, 0.18); color: var(--warn); animation: pulse 1s ease-in-out infinite; }
.flow-timer.is-warn .ic { color: var(--warn); }
.flow-bar {
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.flow-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.7), var(--accent));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
  transition: width 0.35s var(--ease);
}

.q-stage { flex: 1; padding-top: 16px; }
.q { display: flex; flex-direction: column; gap: 16px; }
.q-next { animation: qInNext 0.28s var(--ease) both; }
.q-prev { animation: qInPrev 0.28s var(--ease) both; }
@keyframes qInNext { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes qInPrev { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
.q-num {
  font: 800 14px/1 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.q-text { font: 700 21px/1.4 var(--font); letter-spacing: -0.01em; outline: none; }
.q-img {
  position: relative;
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: var(--r-card);
  background: var(--img-bg);
  box-shadow: var(--shadow);
}
.q-img img { width: 100%; max-height: min(40vh, 340px); margin: 0 auto; object-fit: contain; }
.q-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(11, 11, 20, 0.7);
  color: #FFFFFF;
}
.q-zoom .ic { width: 18px; height: 18px; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border-radius: var(--r-btn);
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  font: 600 16px/1.35 var(--font);
  text-align: left;
  transition: transform 0.12s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.opt:active { transform: scale(0.98); }
.opt.is-sel {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}
.opt-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  font: 800 14px/1 var(--font);
  color: var(--muted);
}
.opt-mark.is-key { border-radius: 10px; }
.opt-check {
  position: absolute;
  inset: -2px;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: var(--accent);
  color: var(--on-accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s, transform 0.22s var(--ease);
}
.opt-check .ic { width: 16px; height: 16px; stroke-width: 3; }
.opt.is-sel .opt-mark { border-color: var(--accent); }
.opt.is-sel .opt-check { opacity: 1; transform: scale(1); }
.opt-label { flex: 1; min-width: 0; }
.opt-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  padding: 4px;
  border-radius: 10px;
  background: var(--img-bg);
  object-fit: contain;
}

.opts-grid { display: grid; gap: 10px; }
.opts-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt-img {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: var(--img-bg);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--line-2);
}
.opt-img img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.opt-img.is-sel { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35); background: var(--img-bg); }
.opt-key {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(11, 11, 20, 0.72);
  color: #FFFFFF;
  font: 800 13px/1 var(--font);
}
.opt-img.is-sel .opt-key { background: var(--accent); color: var(--on-accent); }

.flow-nav {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px calc(-1 * var(--gutter)) calc(-1 * (var(--safe-bottom) + 24px));
  padding: 16px var(--gutter) calc(var(--safe-bottom) + 12px);
  background: linear-gradient(to bottom, transparent, var(--bg) 40%);
}
.flow-nav .btn { flex: 0 1 auto; }

/* ------------------------------------------------------------------ calculating */
.calc {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.calc::before { top: 10%; }
.calc-orb { position: relative; display: grid; place-items: center; width: 176px; height: 176px; margin-bottom: 8px; }
.calc-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 1.3s linear infinite; }
.calc-track { fill: none; stroke: rgba(var(--accent-rgb), 0.16); stroke-width: 6; }
.calc-arc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 90 237; }
.calc-emoji {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.14);
  animation: breathe 1.6s ease-in-out infinite;
}
.calc-step { min-height: 24px; }

/* ------------------------------------------------------------------ result */
.res-hero { gap: 12px; }
.eyebrow-sm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.eyebrow-sm > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-metric {
  font: 800 13px/1.3 var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.gauge-wrap { position: relative; width: min(236px, 72vw); aspect-ratio: 1 / 1; }
.gauge { width: 100%; height: 100%; overflow: visible; }
.g-track { fill: none; stroke: var(--surface-2); stroke-width: 16; stroke-linecap: round; }
.g-arc {
  fill: none;
  stroke-width: 16;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.55));
  transition: stroke-dasharray 1.2s var(--ease);
}
.g-arc-ghost { stroke: rgba(var(--accent-rgb), 0.55); filter: blur(3px); }
.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 6px;
}
.g-label { font: 800 15px/1 var(--font); letter-spacing: 0.16em; color: var(--accent-ink); margin-bottom: 4px; }
.g-num { display: flex; align-items: baseline; font: 800 58px/1 var(--font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.g-unit { margin-left: 2px; font-size: 28px; color: var(--muted); }
.g-sub { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.res-level { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.res-level-emoji { margin-top: -8px; }
.res-title { font: 800 26px/1.2 var(--font); letter-spacing: -0.02em; }
.res-level .lead { max-width: 36ch; }

.lock-visual { position: relative; width: min(204px, 60vw); aspect-ratio: 1 / 1; }
.lock-blur {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 56px/1 var(--font);
  color: var(--text);
  filter: blur(9px);
  opacity: 0.6;
  -webkit-user-select: none;
  user-select: none;
}
.lock-blur small { font-size: 28px; }
.lock-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 22px;
  background: var(--grad);
  color: #FFFFFF;
  box-shadow: 0 14px 32px -10px rgba(255, 92, 168, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: float 3s ease-in-out infinite;
}
.lock-badge .ic { width: 30px; height: 30px; }
.res-locked .display-sm { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

.checklist { display: grid; gap: 12px; list-style: none; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; }
.checklist .ic { color: var(--ok); margin-top: 2px; }
.trust {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.trust .ic { width: 18px; height: 18px; color: var(--ok); margin-top: 1px; }
.res-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; }

.legend-track { position: relative; padding-top: 34px; }
.legend-bar { display: flex; gap: 3px; height: 12px; border-radius: 999px; overflow: hidden; }
.seg { height: 100%; background: rgba(var(--accent-rgb), var(--o, 0.4)); }
.seg.is-cur { background: var(--accent); }
.legend-pin {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}
.legend-pin span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 800 12px/1.2 var(--font);
}
.legend-pin::after {
  content: "";
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-top-color: var(--accent);
}
.legend-list { display: grid; gap: 4px; margin-top: 16px; list-style: none; }
.legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--muted);
}
.legend-list li.is-cur { background: rgba(var(--accent-rgb), 0.14); color: var(--text); font-weight: 800; }
.ll-emoji { display: grid; place-items: center; width: 24px; flex: none; }
.ll-title { flex: 1; min-width: 0; }
.ll-range { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.rank-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rank-pos b { display: block; font: 800 42px/1 var(--font); letter-spacing: -0.03em; }
.rank-pos small { font-size: 20px; color: var(--muted); letter-spacing: 0; }
.rank-pos span { display: block; margin-top: 6px; font-weight: 600; color: var(--muted); }
.rank-phrase { margin: 14px 0 10px; font-size: 17px; line-height: 1.45; }
.rank-phrase b { color: var(--accent-ink); font-weight: 800; }
.rank .btn { margin-top: 16px; }

.sub-list { display: grid; gap: 18px; list-style: none; }
.sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sub-title { flex: 1; min-width: 0; font-weight: 800; }
.sub-val { font: 800 16px/1 var(--font); font-variant-numeric: tabular-nums; }
.sub-desc { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.sub-list li.is-top .sub-title { color: var(--accent-ink); }

.advice-list { display: grid; gap: 14px; list-style: none; }
.advice-list li { display: flex; gap: 12px; }
.adv-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-ink);
  font: 800 14px/1 var(--font);
}
.advice-list p { line-height: 1.55; color: var(--text-2); }

.review > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
}
.review > summary::-webkit-details-marker { display: none; }
.review > summary .h3 { flex: 1 1 auto; }
.rv-sum { font-size: 14px; font-weight: 700; color: var(--muted); }
.rv-sum .ok { color: var(--ok); }
.rv-sum .bad { color: var(--bad); }
.rv-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rv-filter .chip { min-height: 40px; }
.rv-list { display: grid; gap: 12px; margin-top: 16px; list-style: none; }
.rv-list.only-wrong .is-ok { display: none; }
.rv-item {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  border-left: 4px solid var(--ok);
}
.rv-item.is-bad { border-left-color: var(--bad); }
.rv-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.rv-ic {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ok);
  color: #0B0B14;
}
.is-bad .rv-ic { background: var(--bad); color: #FFFFFF; }
.rv-ic .ic { width: 14px; height: 14px; stroke-width: 3; }
.rv-q { margin: 8px 0 10px; font-weight: 700; line-height: 1.45; }
.rv-img {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  background: var(--img-bg);
}
.rv-img img { max-height: 200px; margin: 0 auto; object-fit: contain; }
.rv-ans { display: grid; gap: 8px; }
.rv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
.rv-k { font-size: 14px; color: var(--muted); }
.rv-k::after { content: ":"; }
.rv-opt { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.rv-row.is-ok .rv-opt { color: var(--ok); }
.rv-row.is-bad .rv-opt { color: var(--bad); }
.rv-key {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid currentColor;
  font: 800 12px/1 var(--font);
}
.rv-opt img { width: 48px; height: 48px; padding: 3px; border-radius: 8px; background: var(--img-bg); object-fit: contain; }
.rv-exp { display: flex; gap: 8px; margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.rv-exp .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--warn); }

.share > .muted { font-size: 15px; line-height: 1.5; }
.share-row { display: flex; gap: 10px; margin-top: 16px; }
.share-row .btn { flex: 1; }
.retake { display: flex; flex-direction: column; gap: 8px; }

.mini-list { display: grid; gap: 10px; list-style: none; }
.mini {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.12s var(--ease);
}
.mini:active { transform: scale(0.985); }
.mini-emoji,
.hist-emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.36), rgba(var(--accent-rgb), 0.1));
}
.mini-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mini-main b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-main span { font-size: 14px; color: var(--muted); }
.section > .link-btn { align-self: center; }

/* ------------------------------------------------------------------ payment */
.pay-orb { position: relative; }
.pay-orb::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.4);
  animation: ripple 2s ease-out infinite;
}
.pay-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-sum .muted { font-weight: 600; min-width: 0; }
.pay-amount { font: 800 22px/1.2 var(--font); white-space: nowrap; }
.steps { display: grid; list-style: none; padding: 4px 4px 0; }
.step { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 36px;
  bottom: 2px;
  left: 15px;
  width: 2px;
  background: var(--line-2);
}
.step-dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font: 800 14px/1 var(--font);
}
.step-dot .ic { width: 18px; height: 18px; stroke-width: 3; }
.step.is-done .step-dot { background: var(--ok); color: #0B0B14; }
.step.is-active .step-dot { background: rgba(var(--accent-rgb), 0.18); }
.step b { display: block; font-weight: 800; }
.step span { font-size: 15px; color: var(--muted); }
.step:not(.is-done):not(.is-active) b { color: var(--muted); }
.pay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 22px;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}
.pay-done {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.success-burst { position: relative; display: grid; place-items: center; width: 132px; height: 132px; }
.success-burst::before,
.success-burst::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--ok);
  animation: burst 1s var(--ease) both;
}
.success-burst::after { animation-delay: 0.18s; }
.success-burst > span {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--ok);
  color: #0B0B14;
  box-shadow: 0 18px 40px -12px rgba(43, 214, 123, 0.8);
  animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.success-burst .ic { width: 52px; height: 52px; stroke-width: 3; }

/* ------------------------------------------------------------------ history */
.page-head { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.hist-list { display: grid; gap: 10px; list-style: none; }
.hist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.12s var(--ease);
}
.hist-row:active { transform: scale(0.985); }
.hist-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hist-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-date { font-size: 14px; color: var(--muted); }
.hist-score { display: flex; flex-direction: column; align-items: flex-end; max-width: 42%; text-align: right; }
.hist-score b { font: 800 20px/1.1 var(--font); color: var(--accent-ink); }
.hist-score span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.hist-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.hist-lock .ic { width: 16px; height: 16px; }
.state-emoji { display: grid; place-items: center; }

/* ------------------------------------------------------------------ bottom sheet */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 12, 0.62);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(var(--tg-viewport-height, 100vh) * 0.9);
  padding-bottom: var(--safe-bottom);
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.45);
  transform: translateY(100%);
  transition: transform 0.28s var(--ease);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.closing .sheet-backdrop { opacity: 0; }
.sheet-wrap.closing .sheet { transform: translateY(100%); }
.sheet-tall .sheet { height: calc(var(--tg-viewport-height, 100vh) * 0.82); }
.sheet-grab { width: 40px; height: 5px; margin: 10px auto 0; border-radius: 999px; background: var(--line-2); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 4px 20px; }
.sheet-title { flex: 1; min-width: 0; font: 800 19px/1.3 var(--font); }
.sheet-head .icon-btn { background: var(--surface-2); }
.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 20px;
}
.sheet-text { margin-bottom: 20px; line-height: 1.5; color: var(--text-2); }

.ref { display: flex; flex-direction: column; gap: 16px; }
.ref-hero { display: grid; place-items: center; }
.ref-lead { text-align: center; line-height: 1.55; color: var(--text-2); }
.ref-lead b { color: var(--text); }
.row-between { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 10px; }
.ref-step b { font: 800 22px/1 var(--font); }
.ref-progress .bar > span { background: linear-gradient(90deg, #22C17A, var(--ok)); }
.ref-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 16px;
  background: var(--surface-2);
  text-align: center;
}
.stat b { font: 800 24px/1.1 var(--font); }
.stat span { font-size: 14px; color: var(--muted); }
.ref-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px dashed var(--line-2);
}
.ref-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 15px; }

.lb-sub { margin-bottom: 12px; font-weight: 700; color: var(--muted); }
.lb-list { display: grid; gap: 6px; list-style: none; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}
.lb-row.is-me { background: rgba(var(--accent-rgb), 0.16); box-shadow: inset 0 0 0 1.5px var(--accent); }
.lb-badge { display: grid; place-items: center; flex: none; width: 32px; }
.lb-pos { font: 800 16px/1 var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lb-val { font: 800 16px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-gap { padding: 6px 0; text-align: center; letter-spacing: 0.3em; color: var(--muted); }
.lb .muted.small { margin-top: 12px; }

/* ------------------------------------------------------------------ toast, zoom, confetti */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--toast-bg);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: var(--brand); }
.toast-ok .ic { color: var(--ok); }
.toast-warn .ic { color: var(--warn); }
.toast-error .ic { color: var(--bad); }

.zoom-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 64px) 12px calc(var(--safe-bottom) + 24px);
  background: rgba(5, 5, 12, 0.92);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.zoom-wrap.open { opacity: 1; }
.zoom-frame { max-width: 100%; padding: 12px; border-radius: var(--r-card); background: var(--img-bg); }
.zoom-frame img { max-width: 100%; max-height: calc(var(--tg-viewport-height, 100vh) - 140px); object-fit: contain; }
.zoom-x {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  right: 12px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.confetti { position: fixed; inset: 0; z-index: 85; width: 100%; height: 100%; pointer-events: none; }

/* ------------------------------------------------------------------ keyframes */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes slide { from { left: -40%; } to { left: 100%; } }
@keyframes ripple { from { transform: scale(0.92); opacity: 0.9; } to { transform: scale(1.25); opacity: 0; } }
@keyframes burst { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ small phones */
@media (max-width: 359px) {
  .display { font-size: 31px; }
  .display-sm { font-size: 25px; }
  .hero-deco { width: 150px; height: 150px; right: -36px; }
  .q-text { font-size: 19px; }
  .g-num { font-size: 50px; }
  .tcard { gap: 12px; padding: 14px; }
  .tcard-emoji { width: 52px; height: 52px; border-radius: 16px; }
  .flow-nav .btn-sm { padding: 0 12px; }
}
