/* =========================================================
   FutuStore Mini-App · Dark Premium Theme
   ========================================================= */

:root {
  /* Background */
  --bg: #0a0d18;
  --bg-grad-top: #131a30;

  /* Surface */
  --surface: #161c2e;
  --surface-2: #1c2238;
  --surface-3: #232a44;
  --surface-hi: rgba(255, 255, 255, 0.04);

  /* Text */
  --ink: #ffffff;
  --ink-2: #c5c9d6;
  --muted: #8a8fa0;
  --subtle: #5d6273;

  /* Brand */
  --brand: #4ba0ec;
  --brand-2: #3b82f6;
  --brand-glow: rgba(75, 160, 236, 0.35);
  --brand-soft: rgba(75, 160, 236, 0.12);

  /* Accents */
  --gold: #fbbf24;
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --purple: #a855f7;
  --cyan: #06b6d4;
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.12);

  /* Border */
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 28px;

  /* Easing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(75, 160, 236, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 70% 40% at 80% 30%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    Inter, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Restore a visible focus ring for keyboard users (Telegram desktop, etc.).
   `outline: none` above suppresses the default ring; without :focus-visible
   replacing it, keyboard users get no indication of focus. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Respect users who prefer reduced motion — kill long-running spin/shimmer
   animations rather than burning battery and eyeballs. */
@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;
  }
}

/* Kill iOS Safari double-tap-to-zoom across the whole mini-app while
   keeping single-finger pan + two-finger pinch-zoom (a11y) working.
   `touch-action: manipulation` is the standard way to do this — covers
   non-button hot zones (cards, descriptions, prices) that the existing
   `button { ... }` rule below didn't reach. */
html { touch-action: manipulation; }

button { cursor: pointer; touch-action: manipulation; }

h1, h2, h3, h4, p { margin: 0; }

i, svg { width: 20px; height: 20px; stroke-width: 2; flex-shrink: 0; }

/* =========================================================
   Layout
   ========================================================= */

.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px 110px;
}

.view { display: none; }

.view.active {
  display: block;
  animation: viewIn 0.4s var(--ease-out);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Topbar
   ========================================================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 4px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #4ba0ec 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(75, 160, 236, 0.35);
}

.brand-mark i { width: 20px; height: 20px; color: #fff; stroke-width: 2.5; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-text span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 1px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  transition: 0.2s var(--ease);
}

.icon-btn i { width: 18px; height: 18px; }

.icon-btn:active { transform: scale(0.9); background: var(--surface-2); }

/* =========================================================
   Wallet Card (the centerpiece)
   ========================================================= */

.wallet-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 80% -20%, rgba(75, 160, 236, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.3) 0%, transparent 60%),
    linear-gradient(135deg, #1c2240 0%, #131a30 100%);
  border: 1px solid var(--line-2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.wallet-card__deco {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.wallet-card__deco::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.04);
}

.wallet-card__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.wallet-card__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.wallet-card__chain {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wallet-card__chain i { width: 14px; height: 14px; color: var(--green); }

.wallet-card__amount {
  display: block;
  position: relative;
  margin-bottom: 14px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #c5c9d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-card__actions {
  display: flex;
  gap: 8px;
  position: relative;
}

.wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  transition: 0.2s var(--ease);
}

.wallet-btn i { width: 16px; height: 16px; }

.wallet-btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--brand-glow);
}

.wallet-btn--primary:active { transform: scale(0.97); filter: brightness(0.9); }

.wallet-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.wallet-btn--ghost:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.1); }

/* =========================================================
   Hero Card (Telegram Premium feature)
   ========================================================= */

.hero-card {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 16px 18px 18px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(251, 191, 36, 0.22) 0%, transparent 50%),
    linear-gradient(135deg, #1e3a8a 0%, #312e81 50%, #4c1d95 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 10px 32px rgba(49, 46, 129, 0.4);
  transition: 0.25s var(--ease);
}

.hero-card:active { transform: scale(0.985); }

.hero-card__glow {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.35) 0%, transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-card__body {
  position: relative;
  z-index: 2;
  padding-right: 64px;
}

.hero-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.hero-card__pill i { width: 12px; height: 12px; color: var(--gold); }

.hero-card__title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 6px;
}

.hero-card__desc {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.hero-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #fff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: 0.2s var(--ease);
}

.hero-card__cta i { width: 14px; height: 14px; }

.hero-card:active .hero-card__cta { transform: scale(0.96); }

.hero-card__art {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  pointer-events: none;
  z-index: 1;
}

.hero-art-star {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 16px rgba(251, 191, 36, 0.55));
  animation: heroPulse 3s ease-in-out infinite;
}

.hero-art-star svg { width: 100%; height: 100%; }

@keyframes heroPulse {
  0%, 100% { transform: scale(1) rotate(-6deg); }
  50%      { transform: scale(1.06) rotate(-2deg); }
}

/* =========================================================
   Quick Action Tiles
   ========================================================= */

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.quick-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 76px;
  padding: 12px 6px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  transition: 0.2s var(--ease);
  overflow: hidden;
}

.quick-tile:active {
  transform: scale(0.96);
  background: var(--surface-2);
}

.quick-tile__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.quick-tile__icon i { width: 18px; height: 18px; color: #fff; stroke-width: 2.25; }

.quick-tile--purple .quick-tile__icon {
  background: linear-gradient(135deg, #a855f7, #6d28d9);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}

.quick-tile--cyan .quick-tile__icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.quick-tile--amber .quick-tile__icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.quick-tile span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   Section Heads
   ========================================================= */

.section-block { margin-top: 28px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h3 {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding: 0 6px 0 12px;
  border-radius: 20px;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  transition: 0.15s var(--ease);
}

.link-btn:active { background: var(--brand-soft); }

.link-btn i { width: 15px; height: 15px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 4px 0;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--brand);
  text-transform: uppercase;
}

.page-head h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.count-pill {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* =========================================================
   Product Cards (the redesigned ones)
   ========================================================= */

.services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skel-card {
  height: 96px;
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border: 1px solid var(--line);
}

/* Inline load-error panel — replaces skel-cards or empty list when a
   fetch fails. Tap-to-retry button right inline, no toast needed. */
.load-error {
  padding: 22px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px dashed var(--line-2);
  text-align: center;
  display: grid;
  gap: 12px;
}
.load-error__msg {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  word-break: break-word;
}
.load-error__retry {
  justify-self: center;
  min-height: 36px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}
.load-error__retry:hover {
  background: var(--brand);
  color: #fff;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.product-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  transition: 0.2s var(--ease);
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(75, 160, 236, 0.06) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.product-card:active {
  transform: scale(0.99);
  background: var(--surface-2);
}

.product-card:active::before { opacity: 1; }

.product-card.is-coming { opacity: 0.5; }

.product-card__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #fff;
  align-self: center;
}

.product-card__icon--tg {
  background: linear-gradient(135deg, #8b2d7c 0%, #6b2160 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 8px 20px rgba(123, 45, 111, 0.4);
}

.product-card__icon--tg svg {
  width: 78%;
  height: 78%;
}

.product-card__icon--esim {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 8px 20px rgba(16, 185, 129, 0.35);
}

.product-card__icon--stars {
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 8px 20px rgba(251, 191, 36, 0.4);
}

.product-card__icon--stars svg { color: #fff; filter: drop-shadow(0 1px 2px rgba(180, 83, 9, 0.3)); }

.product-card__icon--default {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.product-card__icon--tron {
  background: linear-gradient(135deg, #ff5c5c 0%, #ef0027 100%);
  box-shadow: 0 8px 20px rgba(239, 0, 39, 0.35);
}

.product-card__icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0a0d18;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
}

.product-card__icon-badge svg { width: 14px; height: 14px; }

.product-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.product-card__title-row {
  display: flex;
  align-items: center;
}

.product-card__title {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.product-card__desc {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.product-card__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.product-card__price {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.product-card.is-coming .product-card__price { color: var(--muted); }

.product-card__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.product-card__status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.product-card__status.is-active {
  background: var(--green-soft);
  color: #34d399;
}

.product-card__status.is-coming {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.product-card__arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  transition: 0.2s var(--ease);
}

.product-card__arrow i { width: 16px; height: 16px; }

.product-card:active .product-card__arrow {
  background: var(--brand-soft);
  color: var(--brand);
  transform: translateX(2px);
}

/* =========================================================
   Product Detail
   ========================================================= */

.product-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.back-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  flex: 0 0 auto;
  transition: 0.2s var(--ease);
}

.back-btn:active { transform: scale(0.92); background: var(--surface-2); }

.back-btn i { width: 22px; height: 22px; }

.product-head__info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.product-head__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex: 0 0 auto;
}

.product-head__icon--tg {
  background: linear-gradient(135deg, #8b2d7c, #6b2160);
  box-shadow: 0 4px 14px rgba(123, 45, 111, 0.4);
}

.product-head__icon--tg svg {
  width: 76%;
  height: 76%;
}

.product-head__icon--esim {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.product-head__icon--stars {
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.4);
}

.product-head__icon--stars svg { color: #fff; }

.product-head__icon--default {
  background: linear-gradient(135deg, #6366f1, #4338ca);
}

.product-head__text { min-width: 0; }

.product-head__text h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.product-head__status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--green-soft);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* =========================================================
   Panels (order-related sections)
   ========================================================= */

.panel {
  margin-bottom: 10px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.panel-tag {
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.last-panel { margin-bottom: 96px; }

/* =========================================================
   Plan Selection
   ========================================================= */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.plan-button {
  position: relative;
  min-height: 62px;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
  text-align: left;
  transition: 0.2s var(--ease);
}

.plan-button strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.plan-button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.plan-button.active {
  background: linear-gradient(135deg, rgba(75, 160, 236, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.plan-button.active strong { color: var(--brand); }
.plan-button.active span { color: rgba(75, 160, 236, 0.85); }

.plan-button:active { transform: scale(0.97); }

/* =========================================================
   Stars Quantity Picker
   ========================================================= */

.qty-picker { display: flex; flex-direction: column; gap: 8px; }

.qty-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.qty-chip {
  min-height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
  transition: 0.2s var(--ease);
}

.qty-chip.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.12) 100%);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

.qty-chip:active { transform: scale(0.96); }

.qty-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line);
  height: 42px;
  transition: 0.2s var(--ease);
}

.qty-input:focus-within {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.05);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}

.qty-input input {
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  -moz-appearance: textfield;
}

.qty-input input::-webkit-outer-spin-button,
.qty-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input__suffix {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.qty-breakdown {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.06) 0%, rgba(245, 158, 11, 0.04) 100%),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.qty-breakdown__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  color: var(--muted);
}

.qty-breakdown__row em {
  font-style: normal;
  color: var(--subtle);
  font-size: 11px;
  margin-left: 4px;
}

.qty-breakdown__fee { color: #fbbf24; font-weight: 700; }

.qty-breakdown__row--total {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.qty-breakdown__row--total strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--gold);
}

/* =========================================================
   Amount Buttons (recharge)
   ========================================================= */

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.amount-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
  transition: 0.2s var(--ease);
}

.amount-button strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.amount-button span {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.amount-button.active {
  background: linear-gradient(135deg, rgba(75, 160, 236, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.amount-button.active strong { color: var(--brand); }
.amount-button:active { transform: scale(0.97); }

/* =========================================================
   Form
   ========================================================= */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field-label__count {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.field span:not(.field-label) { color: var(--muted); font-size: 12px; font-weight: 600; }

.field input,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  /* >=16px 防止 iOS Safari 输入聚焦自动缩放页面 */
  font-size: 16px;
  font-weight: 500;
  transition: 0.2s var(--ease);
}

.field input { height: 42px; padding: 0 12px; }

.field textarea {
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.field textarea.textarea--single {
  min-height: 42px;
  resize: none;
  white-space: nowrap;
  overflow: hidden;
}

.field input::placeholder, .field textarea::placeholder {
  color: var(--subtle);
}

.field input:focus, .field textarea:focus {
  border-color: var(--brand);
  background: rgba(75, 160, 236, 0.04);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.field-hint i { width: 14px; height: 14px; color: var(--brand); }

/* =========================================================
   Summary Card
   ========================================================= */

.summary-card {
  display: flex;
  align-items: stretch;
  margin-bottom: 10px;
  padding: 14px;
  border-radius: var(--r-md);
  background:
    linear-gradient(135deg, rgba(75, 160, 236, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%),
    var(--surface);
  border: 1px solid var(--line-2);
}

.summary-item { flex: 1; }

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.summary-item strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.summary-divider {
  width: 1px;
  margin: 0 14px;
  background: var(--line);
}

/* =========================================================
   Assurance List
   ========================================================= */

.assurance-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assurance-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assurance-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  flex-shrink: 0;
}

.assurance-icon i { width: 18px; height: 18px; color: var(--brand); }

.assurance-text { display: flex; flex-direction: column; line-height: 1.4; }

.assurance-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.assurance-text span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* =========================================================
   Checkout Bar (sticky bottom)
   ========================================================= */

.checkout-bar {
  position: fixed;
  right: 0; bottom: 0; left: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px max(14px, env(safe-area-inset-bottom));
  background: rgba(10, 13, 24, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
}

.checkout-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.checkout-info strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 23px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 20px var(--brand-glow);
  transition: 0.2s var(--ease);
}

.cta-btn i { width: 16px; height: 16px; }

.cta-btn:active { transform: scale(0.96); filter: brightness(0.9); }

.cta-btn[disabled],
.cta-btn.is-loading {
  opacity: 0.85;
  cursor: not-allowed;
  filter: saturate(0.85);
}

.cta-btn.is-loading:active { transform: none; filter: saturate(0.85); }

.cta-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: ctaSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes ctaSpin {
  to { transform: rotate(360deg); }
}

.cta-wide { width: 100%; margin-top: 12px; padding: 0; min-height: 46px; border-radius: 23px; }

/* =========================================================
   Provider Tiles (Recharge channel selector)
   ========================================================= */

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.provider-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--line);
  text-align: left;
  transition: 0.2s var(--ease);
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
}

.provider-tile.active {
  background: linear-gradient(135deg, rgba(75, 160, 236, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.provider-tile:active { transform: scale(0.97); }

.provider-tile__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(75, 160, 236, 0.2);
  color: var(--brand);
  flex-shrink: 0;
}

.provider-tile.active .provider-tile__icon {
  background: var(--brand);
  color: #fff;
}

.provider-tile__icon i { width: 16px; height: 16px; }

.provider-tile__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.provider-tile__body strong {
  font-size: 14px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.provider-tile__body span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-tile.active .provider-tile__body strong { color: var(--brand); }

.provider-tile.disabled {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.06);
}

.provider-tile.disabled .provider-tile__icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--subtle);
  filter: saturate(0);
}

.provider-tile.disabled .provider-tile__body strong {
  color: var(--muted);
  font-weight: 600;
}

.provider-tile.disabled:active { transform: none; }

.provider-tile__pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   Pay Panel (Recharge waiting state)
   ========================================================= */

.pay-panel {
  margin-top: 12px;
  border: 1px solid var(--brand-soft);
  background:
    linear-gradient(135deg, rgba(75, 160, 236, 0.06) 0%, rgba(168, 85, 247, 0.04) 100%),
    var(--surface);
}

.pay-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pay-panel__head h3 {
  font-size: 15px;
  font-weight: 750;
  color: var(--ink);
}

.pay-panel__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--amber-soft, rgba(245, 158, 11, 0.12));
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
}

.pay-panel__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulse 1.4s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pay-panel__status.is-paid {
  background: var(--green-soft);
  color: #34d399;
}

.pay-panel__status.is-paid::before { animation: none; }

.pay-panel__hint {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.pay-panel__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-bottom: 10px;
  padding: 0 18px;
  border-radius: 23px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 6px 20px var(--brand-glow);
  transition: 0.2s var(--ease);
}

.pay-panel__cta:active { transform: scale(0.97); filter: brightness(0.92); }
.pay-panel__cta i { width: 16px; height: 16px; }

.pay-panel__url {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
}

.pay-panel__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  transition: 0.15s var(--ease);
}

.pay-panel__copy:active { background: var(--surface-3); }
.pay-panel__copy i { width: 13px; height: 13px; }

/* TokenPay deposit modal — bottom-sheet style same as LPA modal.
   Wider QR room, scrolls if content too tall on small screens. */
.tokenpay-modal__content {
  max-width: 520px;
}

/* Pre-submit order confirmation modal */
.confirm-modal { max-width: 480px; }
.confirm-modal__subtitle {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.confirm-modal__section { margin-bottom: 14px; }
.confirm-modal__section-label {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.confirm-modal__list {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  max-height: 200px;
  overflow-y: auto;
}
.confirm-modal__list li {
  padding: 4px 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--ink);
}
.confirm-modal__list li:not(:last-child) {
  border-bottom: 1px solid var(--line);
}
.confirm-modal__total {
  margin: 14px 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(95,142,255,0.18), rgba(95,142,255,0.08));
  border: 1px solid rgba(95,142,255,0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
}
.confirm-modal__total strong {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.confirm-modal__warn {
  font-size: 12px;
  color: rgb(255, 200, 80);
  background: rgba(255, 180, 50, 0.10);
  border: 1px solid rgba(255, 180, 50, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  line-height: 1.55;
}
.confirm-modal__actions {
  display: flex;
  gap: 10px;
}
.confirm-modal__cancel,
.confirm-modal__ok {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: 0.15s var(--ease);
}
.confirm-modal__cancel {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.confirm-modal__ok {
  background: linear-gradient(180deg, #5f8eff, #4a76f0);
  color: #fff;
}
.confirm-modal__cancel:active,
.confirm-modal__ok:active { transform: scale(0.98); filter: brightness(0.95); }

/* Highlight the decimal tail of an amount (e.g., the .0001 in 20.0001)
   so users can't miss a small fractional part — they MUST send it
   exactly or the on-chain match fails upstream. */
.amount-decimal-warn {
  color: #ff6b6b;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Payment-arrived celebration overlay (replaces deposit modal content
   when poll detects status=paid). Animated check + amount + OK btn. */
.tokenpay-paid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 20px 20px;
}
.tokenpay-paid__check {
  width: 96px;
  height: 96px;
}
.tokenpay-paid__check svg { width: 100%; height: 100%; }
.tp-paid-circle {
  stroke: #5fc587;
  stroke-width: 2.5;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: tpPaidCircleStroke 0.55s ease-out forwards;
}
.tp-paid-tick {
  stroke: #5fc587;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: tpPaidTickStroke 0.4s 0.5s ease-out forwards;
}
@keyframes tpPaidCircleStroke {
  to { stroke-dashoffset: 0; }
}
@keyframes tpPaidTickStroke {
  to { stroke-dashoffset: 0; }
}
.tokenpay-paid__title {
  font-size: 22px;
  font-weight: 750;
  color: var(--ink);
  margin: 0;
  animation: tpPaidPop 0.4s 0.7s both var(--spring);
}
.tokenpay-paid__amount {
  font-size: 34px;
  font-weight: 700;
  color: #5fc587;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.5px;
  margin: 0;
  animation: tpPaidPop 0.4s 0.85s both var(--spring);
}
.tokenpay-paid__amount small {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  margin-left: 6px;
}
.tokenpay-paid__hint {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  animation: tpPaidPop 0.4s 1s both var(--spring);
}
.tokenpay-paid__ok {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #5fc587, #4ab074);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  animation: tpPaidPop 0.4s 1.15s both var(--spring);
}
.tokenpay-paid__ok:active { transform: scale(0.98); filter: brightness(0.95); }
@keyframes tpPaidPop {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== TokenPay-style direct deposit panel ========== */

.pay-panel__amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(95, 142, 255, 0.18), rgba(95, 142, 255, 0.08));
  border: 1px solid rgba(95, 142, 255, 0.35);
}
.pay-panel__amount-label { color: var(--ink-2); font-size: 12px; }
.pay-panel__amount-value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.pay-panel__amount-value small {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  margin-left: 6px;
}

/* Decimal-tail confirmation gate */
.pay-panel__gate {
  margin: 10px 0 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 180, 50, 0.10);
  border: 1px solid rgba(255, 180, 50, 0.45);
}
.pay-panel__warn {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.pay-panel__warn strong { color: rgb(255, 200, 80); }
.pay-panel__gate-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.pay-panel__gate-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 16px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.pay-panel__gate-input:focus {
  outline: none;
  border-color: rgba(95, 142, 255, 0.7);
}
.pay-panel__gate-cta {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #5f8eff, #4a76f0);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  transition: 0.15s var(--ease);
}
.pay-panel__gate-cta:disabled {
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: not-allowed;
}
.pay-panel__gate-cta:not(:disabled):active { transform: scale(0.98); }

/* Deposit reveal panel */
.pay-panel__deposit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  padding-top: 4px;
}
.pay-panel__qr {
  align-self: center;
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.pay-panel__addr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.pay-panel__addr-label {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ink-2);
  width: 64px;
}
.pay-panel__addr {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--ink);
  word-break: break-all;
}
.pay-panel__copy-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pay-panel__copy-btn:active { background: var(--surface-3); }
.pay-panel__copy-btn i { width: 14px; height: 14px; }

/* =========================================================
   History (Orders / Recharges / Transactions)
   ========================================================= */

.history-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.history-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: 0.2s var(--ease);
}

.history-tab i { width: 15px; height: 15px; }

.history-tab.active {
  background: linear-gradient(135deg, rgba(75, 160, 236, 0.18), rgba(99, 102, 241, 0.12));
  color: var(--brand);
}

.history-tab:active { transform: scale(0.96); }

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.hist-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.2s var(--ease);
}

.hist-row:active { transform: scale(0.99); background: var(--surface-2); }

.hist-row__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.hist-row__icon i { width: 18px; height: 18px; }

.hist-row__icon--blue { background: var(--brand-soft); color: var(--brand); }
.hist-row__icon--green { background: var(--green-soft); color: #34d399; }
.hist-row__icon--rose { background: var(--rose-soft); color: var(--rose); }
.hist-row__icon--gray { background: rgba(255,255,255,0.06); color: var(--muted); }
.hist-row__icon--amber { background: var(--amber-soft); color: var(--amber); }

.hist-row__body { flex: 1; min-width: 0; }

.hist-row__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.hist-row__title strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-row__amt {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  flex-shrink: 0;
}

.hist-row__amt em {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-style: normal;
  margin-left: 2px;
}

.amt-pos { color: #34d399; }
.amt-neg { color: var(--ink-2); }

.hist-row__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.hist-row__time {
  margin-left: auto;
  font-size: 11px;
  color: var(--subtle);
}

.hist-row__cta {
  margin-left: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.hist-row__cta:active { transform: scale(0.96); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tag--blue { background: var(--brand-soft); color: var(--brand); }
.tag--green { background: var(--green-soft); color: #34d399; }
.tag--rose { background: var(--rose-soft); color: var(--rose); }
.tag--amber { background: var(--amber-soft); color: var(--amber); }
.tag--gray { background: rgba(255,255,255,0.05); color: var(--muted); }

/* ----- Info modal (reused for order/recharge details) ----- */

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.info-modal.open { display: flex; animation: fadeIn 0.2s var(--ease-out); }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.info-modal__content {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-bottom: none;
  animation: slideInUp 0.3s var(--spring);
}

@keyframes slideInUp {
  from { transform: translateY(40px); }
  to   { transform: translateY(0); }
}

.info-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.info-modal__head h3 {
  font-size: 17px;
  font-weight: 750;
  color: var(--ink);
}

.info-modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
}

.info-modal__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-modal__row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.info-modal__row:last-child { border-bottom: none; }

.info-modal__row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.info-modal__row dd {
  color: var(--ink);
  word-break: break-all;
}

.mono-sm {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--ink-2);
}

.modal-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
}

.modal-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

/* =========================================================
   Empty State
   ========================================================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 40px 24px;
  text-align: center;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: var(--brand-soft);
  border: 1px solid var(--line);
}

.empty-icon i { width: 32px; height: 32px; color: var(--brand); }

.empty-state strong {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 750;
  color: var(--ink);
}

.empty-state span {
  color: var(--muted);
  font-size: 14px;
}

/* =========================================================
   Bottom Nav (floating glass pill)
   ========================================================= */

.bottom-nav {
  position: fixed;
  right: 16px; bottom: max(12px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  max-width: 448px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 22px;
  background: rgba(22, 28, 46, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.bottom-nav[hidden] { display: none; }

body.keyboard-open .bottom-nav,
body.keyboard-open .checkout-bar {
  display: none !important;
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 3px;
  min-height: 50px;
  padding: 6px;
  border-radius: 16px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 600;
  transition: 0.25s var(--spring);
}

.bottom-nav button.active {
  background: linear-gradient(135deg, rgba(75, 160, 236, 0.18), rgba(99, 102, 241, 0.12));
  color: var(--brand);
}

.bottom-nav button:active { transform: scale(0.92); }

.bottom-nav i { width: 22px; height: 22px; stroke-width: 2; transition: stroke-width 0.2s; }

.bottom-nav button.active i { stroke-width: 2.5; }

/* =========================================================
   Toast
   ========================================================= */

.toast {
  position: fixed;
  right: 20px; left: 20px;
  /* Sit above the checkout-bar (~85-95px tall) when present, otherwise
     above the bottom-nav (~75px). The largest of the two keeps the toast
     clear of either layout. env(safe-area-inset-bottom) accounts for the
     iOS home indicator. */
  bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
  z-index: 30;
  max-width: 440px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(28, 34, 56, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: 0.3s var(--spring);
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0) scale(1); }

.toast .toast__title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 3px;
}

.toast .toast__hint {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.45;
}

.toast.toast--rose {
  background: rgba(73, 22, 36, 0.95);
  border-color: rgba(244, 114, 124, 0.35);
}
.toast.toast--rose .toast__title { color: #ffd5db; }
.toast.toast--rose .toast__hint  { color: rgba(255, 213, 219, 0.78); }

.toast.toast--amber {
  background: rgba(72, 50, 18, 0.95);
  border-color: rgba(251, 191, 36, 0.35);
}
.toast.toast--amber .toast__title { color: #fde68a; }
.toast.toast--amber .toast__hint  { color: rgba(253, 230, 138, 0.78); }

.toast.toast--green {
  background: rgba(20, 60, 44, 0.95);
  border-color: rgba(52, 211, 153, 0.35);
}
.toast.toast--green .toast__title { color: #a7f3d0; }
.toast.toast--green .toast__hint  { color: rgba(167, 243, 208, 0.78); }

/* =========================================================
   History row: NEW badge + processing spinner
   ========================================================= */

.hist-row { position: relative; }

.hist-row.is-new {
  animation: histRowNewPulse 3.4s var(--ease) 1;
  border-color: var(--brand);
}

@keyframes histRowNewPulse {
  0%   { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.55); border-color: var(--brand); }
  35%  { box-shadow: 0 0 0 8px rgba(96, 165, 250, 0.0);  border-color: var(--brand); }
  70%  { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.4);    border-color: var(--brand); }
  100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);      border-color: var(--line); }
}

.hist-row__new-badge {
  position: absolute;
  top: -8px;
  left: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 14px var(--brand-glow);
  animation: histRowNewBadgeIn 0.4s var(--spring) 1 backwards;
}

@keyframes histRowNewBadgeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.6); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Subtle background pulse on processing rows so they read as "live" */
.hist-row.is-processing {
  background: linear-gradient(90deg,
    var(--surface) 0%,
    rgba(251, 191, 36, 0.04) 50%,
    var(--surface) 100%);
  background-size: 200% 100%;
  animation: histRowLiveShimmer 2.4s linear infinite;
}

@keyframes histRowLiveShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Spinner inside the status tag */
.tag.tag--with-spinner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-left: 6px;
}

.tag-spinner {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  opacity: 0.85;
  animation: tagSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes tagSpin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   eSIM product page
   ========================================================= */

/* When productView is in eSIM mode, hide the username panel + standard
   checkout UI. The eSIM list itself becomes the primary scroll area. */
.product-view--esim #planRow { display: flex; flex-direction: column; gap: 10px; }
.product-view--esim .last-panel { display: none; }
.product-view--esim #usernameInput,
.product-view--esim .field-hint { display: none; }
.product-view--esim #selectedPlanText { display: none; }
/* eSIM has per-card "购买" buttons — the global "合计 / 确认开通" bar is
   redundant and looked broken (it always read "—"). Hide the whole footer
   while in eSIM mode; renderProductCheckout removes the class for other
   products so their footer comes back. */
.product-view--esim .checkout-bar { display: none; }

.esim-filters {
  display: flex; gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 10px;
  padding-bottom: 2px;
}
.esim-filters::-webkit-scrollbar { display: none; }
.esim-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: 0.15s;
}
.esim-chip.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent;
}
.esim-search {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.esim-search i { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.esim-search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  color: var(--ink); font-size: 13.5px;
}
.esim-search input::placeholder { color: var(--muted); }
.esim-note {
  display: flex; align-items: flex-start; gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
}
.esim-note i { width: 14px; height: 14px; color: var(--amber); flex: 0 0 auto; margin-top: 1px; }

.esim-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: 0.15s;
}
.esim-card.is-out { opacity: 0.45; }
.esim-card__name {
  grid-column: 1;
  font-size: 14.5px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.005em;
}
.esim-card__meta {
  grid-column: 1;
  font-size: 12px; color: var(--muted);
  display: flex; gap: 10px; flex-wrap: wrap;
}
.esim-card__meta span { white-space: nowrap; }
.esim-card__price {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  text-align: right;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.esim-card__price strong {
  font-size: 17px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.esim-card__price .esim-card__buy {
  padding: 6px 14px; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 12px; font-weight: 700;
  border: 0; cursor: pointer;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.esim-card__price .esim-card__buy:disabled {
  background: var(--surface-2); color: var(--muted);
  box-shadow: none; cursor: not-allowed;
}
.esim-card.is-out .esim-card__buy::before { content: "🚫 "; }

.esim-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--muted); font-size: 13px;
}

.esim-lookup-btn {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  color: var(--ink-2);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.esim-lookup-btn:active {
  transform: scale(0.99);
  background: var(--surface);
}
.esim-lookup-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ---- eSIM brand-list cards (one per card_name) ---- */
.esim-brand {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
  width: 100%;
  font: inherit;
  color: inherit;
}
.esim-brand:hover:not(:disabled) {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.esim-brand:active:not(:disabled) { transform: translateY(0); }
/* Brand-list card with all variants out of stock — dimmed but still
   tappable. Drill-in shows the per-package sold-out state honestly. */
.esim-brand.is-out { opacity: 0.65; }
.esim-brand__name {
  grid-column: 1;
  font-size: 15.5px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.01em;
}
.esim-brand__desc {
  grid-column: 1;
  font-size: 12px; color: var(--muted);
  /* Stop super-long upstream descriptions from blowing the card up. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.esim-brand__meta {
  grid-column: 1;
  font-size: 12px; color: var(--ink-2);
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 2px;
}
.esim-brand__meta span { white-space: nowrap; }
.esim-brand__price {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  text-align: right;
  display: flex; align-items: center; gap: 6px;
}
.esim-brand__price strong {
  font-size: 14.5px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.esim-brand__chev {
  font-size: 22px; line-height: 1;
  color: var(--muted);
  font-weight: 400;
}

/* ---- eSIM category landing (流量卡 / 注册卡) ---- */
.esim-cat-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.esim-cat {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 14px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left; width: 100%;
  font: inherit; color: inherit; cursor: pointer;
  transition: 0.15s;
}
.esim-cat:hover:not(:disabled) {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.esim-cat:active:not(:disabled) { transform: translateY(0); }
.esim-cat.is-out { opacity: 0.5; cursor: default; }
.esim-cat__icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
}
.esim-cat__icon i { width: 22px; height: 22px; }
.esim-cat__body { min-width: 0; }
.esim-cat__title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.esim-cat__desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.esim-cat__foot { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.esim-cat__count {
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  background: var(--surface-2); border-radius: 999px; padding: 2px 9px;
}
.esim-cat__from {
  font-size: 13px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.esim-cat__chev { font-size: 24px; color: var(--muted); font-weight: 400; }

/* ---- eSIM product cards (one per product within a category) ---- */
.esim-prod-list { display: flex; flex-direction: column; gap: 10px; }
.esim-prod {
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.esim-prod.is-out { opacity: 0.5; }
.esim-prod__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.esim-prod__region { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.esim-prod__price {
  font-size: 16px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em; white-space: nowrap;
}
.esim-prod__price small { font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.esim-prod__name { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.esim-prod__meta {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  font-size: 12px; color: var(--ink-2); margin-top: 7px;
}
.esim-prod__meta span { white-space: nowrap; }
.esim-prod__egress { color: var(--muted); }
.esim-prod__hero { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.esim-prod__cover { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.esim-prod__has { font-size: 12px; font-weight: 800; color: #22c55e; white-space: nowrap; }
.esim-prod__foot { display: flex; justify-content: flex-end; margin-top: 11px; }
.esim-prod__buy {
  padding: 8px 22px; border-radius: 10px; border: 0;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: 0.15s;
}
.esim-prod__buy:hover { filter: brightness(1.08); transform: translateY(-1px); }
.esim-prod__buy:active { transform: translateY(0); }
.esim-prod__soldout { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 8px 16px; }
.esim-prod__roam-toggle {
  display: inline-flex; align-items: center; gap: 3px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--brand);
}
.esim-prod__roam-toggle .chev { font-size: 10px; transition: transform 0.15s; }
.esim-prod.roam-open .esim-prod__roam-toggle .chev { transform: rotate(180deg); }
.esim-prod__roaming {
  display: none;
  flex-wrap: wrap; gap: 6px 10px;
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.esim-prod.roam-open .esim-prod__roaming { display: flex; }
.esim-prod__roaming span { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.esim-usage-phone {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 10px 0; padding: 10px 13px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
}
.esim-usage-phone .label { font-size: 12.5px; color: var(--ink-2); }
.esim-usage-phone strong {
  font-size: 15px; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: 0.03em;
  -webkit-user-select: all; user-select: all;
}

/* ---- eSIM brand-detail header (compact, two-row) ----
     row 1: [⌫]  熊猫卡            新加坡 · 4 套餐
     row 2: [description card]
   Total ~70px tall vs. the old 4-stripe layout (~150px).
*/
.esim-detail-header {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 14px;
}
.esim-detail-bar {
  display: flex; align-items: center; gap: 12px;
}
.esim-back-icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  transition: 0.15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.esim-back-icon i { width: 18px; height: 18px; }
.esim-back-icon:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.esim-back-icon:active { transform: scale(0.94); }

.esim-detail-name {
  flex: 1 1 auto;
  margin: 0;
  font-size: 18px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.015em;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.esim-detail-summary {
  flex: 0 0 auto;
  font-size: 12px; font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.esim-detail-desc {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px; line-height: 1.6;
  color: var(--ink-2);
  white-space: normal;
  word-break: break-word;
}

/* ---- eSIM package list (one panel, internal dividers) ----
   The old design had 4 separate bordered cards; this groups them in
   a single panel so the page reads as one coherent menu. Saves ~12px
   per row and removes 3 redundant border weights. */
.esim-pkg-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.esim-pkg {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  transition: background 0.15s;
}
.esim-pkg:first-child { border-top: 0; }
.esim-pkg:not(.is-out):hover { background: var(--surface-2); }
.esim-pkg.is-out { opacity: 0.4; }

/* Subtle gradient rail on the left edge — appears on hover. Adds a
   premium "this is interactive" cue without adding visual weight in
   the rest state. */
.esim-pkg::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  opacity: 0;
  transition: opacity 0.15s;
}
.esim-pkg:not(.is-out):hover::before { opacity: 1; }

.esim-pkg__spec {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.esim-pkg__data {
  font-size: 19px; font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.esim-pkg__sub {
  font-size: 12px; font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.003em;
}
.esim-pkg__stock {
  color: var(--green);
  font-weight: 600;
}

.esim-pkg__cta {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  text-align: right;
}
.esim-pkg__price {
  font-size: 16.5px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.esim-pkg__price small {
  font-size: 10px; font-weight: 600;
  margin-left: 3px;
  color: var(--amber);
  -webkit-text-fill-color: var(--amber);
  letter-spacing: 0.04em;
}
.esim-pkg__buy {
  padding: 6px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 12px; font-weight: 700;
  border: 0; cursor: pointer;
  box-shadow: 0 2px 8px var(--brand-glow);
  transition: 0.15s;
  letter-spacing: 0.02em;
}
.esim-pkg__buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brand-glow);
}
.esim-pkg__buy:active { transform: translateY(0); }
/* Sold-out: plain muted text, no pill background — the row's 0.4
   opacity already does the heavy lifting. */
.esim-pkg__soldout {
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* eSIM LPA modal */
.esim-tip { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 0 0 14px; }
.esim-qr {
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.esim-qr svg, .esim-qr img { width: 220px; height: 220px; display: block; }
.esim-qr-empty { color: #555; font-size: 12px; padding: 80px 16px; text-align: center; }

.esim-lpa-box {
  display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px;
}
.esim-lpa-box code {
  flex: 1; min-width: 0;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  font: 11px ui-monospace, monospace; color: var(--ink);
  overflow-x: auto; word-break: break-all;
}

.esim-actions { margin-bottom: 12px; }
.esim-disclaimer { font-size: 12px; color: var(--muted); margin: 0; }

/* eSIM usage display */
.esim-loading, .esim-error {
  padding: 24px 16px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.esim-error { color: var(--rose); }
.esim-usage-bar {
  height: 10px; border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 12px 0 6px;
}
.esim-usage-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--brand) 100%);
  transition: width 0.5s var(--ease);
}
.esim-usage-numbers {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--muted);
  margin-bottom: 14px;
}
.esim-usage-numbers strong {
  font-size: 14px; color: var(--ink); font-weight: 700;
}
.esim-usage-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 12px;
}
.esim-usage-cell {
  padding: 12px; border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.esim-usage-cell .label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.esim-usage-cell .value {
  font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 2px;
}

/* =========================================================
   Menu page (聚合页)
   ========================================================= */

.me-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.me-card__avatar {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}
.me-card__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-card__info strong {
  font-size: 15px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.me-card__uid {
  font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace;
}
.me-card__balance { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.me-card__balance > span {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.me-card__balance > strong {
  font-size: 16px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.me-group {
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  overflow: hidden;
}

.me-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s var(--ease);
  position: relative;
}
.me-row + .me-row, .me-row + .me-row--static, .me-row--static + .me-row {
  border-top: 1px solid var(--line);
}
.me-row:not(.me-row--static):active { background: var(--surface-2); }
.me-row--static { cursor: default; }
.me-row__icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.me-row__icon i { width: 16px; height: 16px; }
.me-row__icon--blue   { background: var(--brand-soft); color: var(--brand); }
.me-row__icon--purple { background: rgba(168, 85, 247, 0.14); color: var(--purple); }
.me-row__icon--cyan   { background: rgba(6, 182, 212, 0.14); color: var(--cyan); }
.me-row__icon--amber  { background: var(--amber-soft); color: var(--amber); }
.me-row__icon--green  { background: var(--green-soft); color: var(--green); }
.me-row__label { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink); }
.me-row__arrow { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }

.me-lang-switch {
  display: flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.me-lang-pill {
  padding: 6px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}
.me-lang-pill.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.me-foot {
  margin: 24px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--subtle);
  letter-spacing: 0.06em;
}

/* =========================================================
   Developer / API console
   ========================================================= */

.dev-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(75, 160, 236, 0.06) 0%, rgba(168, 85, 247, 0.06) 100%);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.2s var(--ease);
  text-align: left;
}
.dev-cta:active { transform: scale(0.99); background: var(--surface-2); }
.dev-cta__icon {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: rgba(75, 160, 236, 0.18);
  color: var(--brand);
  flex-shrink: 0;
}
.dev-cta__icon i { width: 18px; height: 18px; }
.dev-cta__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dev-cta__body strong { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.005em; }
.dev-cta__body span { font-size: 12px; color: var(--muted); }
.dev-cta > i { color: var(--muted); width: 18px; height: 18px; flex-shrink: 0; }

.api-intro p { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; margin: 0 0 10px; }
.dev-links { display: flex; gap: 14px; flex-wrap: wrap; }
.dev-links a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--brand); font-weight: 600; font-size: 13px;
  text-decoration: none;
}
.dev-links a:active { opacity: 0.7; }
.dev-links a i { width: 14px; height: 14px; }

.cta-sm { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.cta-sm i { width: 12px; height: 12px; }

.api-keys-list { display: flex; flex-direction: column; gap: 8px; }

.api-key-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.api-key-row.is-revoked { opacity: 0.55; }
.api-key-row__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--ink);
  flex-shrink: 0;
}
.api-key-row__meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.api-key-row__meta strong {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.api-key-row__meta span {
  font-size: 11px; color: var(--muted);
}
.api-key-row__revoke {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.12);
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
}
.api-key-row.is-revoked .api-key-row__revoke {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  pointer-events: none;
}

.api-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* API-order notification toggle */
.api-notify {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.api-notify__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.api-notify__text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.api-notify__text span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* iOS-style on/off switch */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 28px;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.switch__track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease);
}
.switch input:checked ~ .switch__track {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}
.switch input:checked ~ .switch__track .switch__thumb {
  transform: translateX(18px);
}
.switch input:disabled {
  cursor: default;
}
.switch input:disabled ~ .switch__track {
  opacity: 0.45;
}

.curl-snippet {
  background: #0f1320;
  padding: 12px 14px;
  border-radius: 10px;
  font: 12px ui-monospace, monospace;
  color: #d8e2ee;
  overflow-x: auto;
  border: 1px solid var(--line);
  white-space: pre;
  margin: 0;
}

/* One-time key reveal modal */
.api-key-warn {
  font-size: 13px; line-height: 1.55;
  color: #ffd5db;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0 0 14px;
}
.api-key-box {
  display: flex; gap: 8px; align-items: stretch;
  margin-bottom: 10px;
}
.api-key-box code {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font: 13px ui-monospace, monospace;
  color: var(--ink);
  overflow-x: auto;
  word-break: break-all;
}
.api-key-saved-hint { font-size: 12px; color: var(--muted); margin: 0 0 12px; }

/* =========================================================
   Hover (desktop)
   ========================================================= */

@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-2px);
    background: var(--surface-2);
    border-color: var(--line-2);
  }
  .product-card:hover::before { opacity: 1; }
  .product-card:hover .product-card__arrow {
    background: var(--brand-soft);
    color: var(--brand);
  }
  .quick-tile:hover {
    transform: translateY(-2px);
    background: var(--surface-2);
  }
  .plan-button:hover:not(.active) { background: rgba(255, 255, 255, 0.06); }
  .amount-button:hover:not(.active) { background: rgba(255, 255, 255, 0.06); }
  .icon-btn:hover { background: var(--surface-2); }
  .back-btn:hover { background: var(--surface-2); }
  .link-btn:hover { background: var(--brand-soft); }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 360px) {
  .quick-row { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .hero-card__art { width: 100px; }
  .wallet-card__amount { font-size: 30px; }
}
