@charset "UTF-8";
/* ============================================================================
   NGỌA LONG H5 · NẠP THẺ — "KIM KHỐ THẾ HỆ MỚI" (IMPECCABLE REDESIGN v3)
   Flat Editorial Commerce · OKLCH Light & Dark Themes · Mobile-First

   Key Impeccable Principles:
   - True Light Mode & Dark Mode ALWAYS honored via [data-theme], even during
     Black Friday event (bf-event NEVER forces dark over light).
   - Zero nested card-inside-card clutter: open editorial hierarchy with crisp
     hairlines, generous whitespace, and clear visual focus on Gold & Price.
   - Compact Black Friday horizontal showcase (never buries Step 1 & Step 2).
   - 2-column scannable mobile package grid (>= 360px) + 3-column desktop grid.
   - Tabular figures on all numbers; >= 44px touch targets; transform/opacity motion.
   ============================================================================ */

@font-face {
  font-family: "NL Philosopher";
  src: url("/assets/fonts/Philosopher-Regular.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================================================
   1. OKLCH COLOR SYSTEM — CRISP LIGHT MODE & DEEP INK DARK MODE
   ============================================================================ */
:root,
html[data-theme="light"] {
  color-scheme: light;

  --tp-font-display: "NL Philosopher", Georgia, serif;
  --tp-font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tp-font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Luminous Porcelain & Xuan-Paper Neutrals (never pure #fff / #000) */
  --tp-canvas: oklch(97.4% 0.006 86);
  --tp-surface: oklch(99.5% 0.002 86);
  --tp-surface-2: oklch(95.6% 0.01 85);
  --tp-surface-3: oklch(92.4% 0.014 84);

  /* Crisp Ink Hierarchy (AAA primary, AA+ secondary) */
  --tp-ink: oklch(18.5% 0.02 170);
  --tp-ink-2: oklch(36% 0.016 160);
  --tp-muted: oklch(50% 0.013 145);
  --tp-faint: oklch(65% 0.01 115);

  /* Precision Hairlines */
  --tp-line: oklch(88% 0.012 85);
  --tp-line-strong: oklch(79% 0.02 82);
  --tp-line-soft: oklch(93% 0.009 86);

  /* Brand Accents: Imperial Jade (primary action) + Burnished Gold (currency) */
  --tp-jade: oklch(43% 0.112 166);
  --tp-jade-hover: oklch(37% 0.108 166);
  --tp-jade-soft: oklch(94.5% 0.032 166);
  --tp-jade-line: oklch(74% 0.075 166);
  --tp-jade-ink: oklch(99% 0.004 86);

  --tp-gold: oklch(56% 0.125 76);
  --tp-gold-bright: oklch(75% 0.125 80);
  --tp-gold-deep: oklch(44% 0.1 72);
  --tp-gold-soft: oklch(95.5% 0.036 82);
  --tp-gold-line: oklch(82% 0.078 80);

  /* Semantic States */
  --tp-ok: oklch(46% 0.12 154);
  --tp-ok-soft: oklch(94.5% 0.035 154);
  --tp-ok-line: oklch(77% 0.08 154);

  --tp-danger: oklch(50% 0.175 24);
  --tp-danger-soft: oklch(95.5% 0.032 24);
  --tp-danger-line: oklch(80% 0.09 24);

  --tp-warn: oklch(52% 0.13 65);
  --tp-warn-soft: oklch(95.8% 0.038 75);
  --tp-warn-line: oklch(80% 0.088 72);

  /* Light Mode Wallet Card: Bright sculpted porcelain + emerald/gold accents */
  --tp-wallet-bg: linear-gradient(145deg, oklch(99.5% 0.004 86), oklch(95.8% 0.022 84));
  --tp-wallet-border: var(--tp-gold-line);
  --tp-wallet-ink: var(--tp-ink);
  --tp-wallet-muted: var(--tp-muted);
  --tp-wallet-balance: var(--tp-jade);

  /* Subtle Tier Accent Dots/Strips */
  --tp-tier-std: oklch(46% 0.1 166);
  --tp-tier-epic: oklch(49% 0.125 244);
  --tp-tier-mythic: oklch(57% 0.135 74);
  --tp-tier-royal: oklch(48% 0.14 308);
  --tp-tier-flash: oklch(53% 0.185 25);

  /* Shadows & Radii */
  --tp-shadow-xs: 0 1px 2px oklch(18% 0.02 80 / 0.05);
  --tp-shadow-sm: 0 2px 6px -1px oklch(18% 0.02 80 / 0.06), 0 8px 20px -8px oklch(18% 0.02 80 / 0.07);
  --tp-shadow-md: 0 4px 12px -2px oklch(18% 0.02 80 / 0.07), 0 18px 36px -14px oklch(18% 0.03 80 / 0.13);
  --tp-shadow-lg: 0 24px 52px -16px oklch(12% 0.02 80 / 0.25);

  --tp-r-xs: 8px;
  --tp-r-sm: 12px;
  --tp-r-md: 16px;
  --tp-r-lg: 20px;
  --tp-r-pill: 999px;
  --tp-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Inline JS compatibility tokens */
  --bg: var(--tp-canvas);
  --card: var(--tp-surface);
  --card-2: var(--tp-surface-2);
  --ink: var(--tp-ink);
  --body-c: var(--tp-ink-2);
  --muted: var(--tp-muted);
  --faint: var(--tp-faint);
  --line: var(--tp-line);
  --line-soft: var(--tp-line-soft);
  --line-strong: var(--tp-line-strong);
  --gold: var(--tp-gold);
  --gold-strong: var(--tp-gold-deep);
  --gold-soft: var(--tp-gold-soft);
  --green: var(--tp-ok);
  --green-soft: var(--tp-ok-soft);
  --red: var(--tp-danger);
  --red-soft: var(--tp-danger-soft);
  --amber-ink: var(--tp-warn);
  --amber-soft: var(--tp-warn-soft);
  --amber-line: var(--tp-warn-line);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --tp-canvas: oklch(13.5% 0.014 170);
  --tp-surface: oklch(18.2% 0.017 168);
  --tp-surface-2: oklch(22.5% 0.019 166);
  --tp-surface-3: oklch(27% 0.022 164);

  --tp-ink: oklch(95% 0.01 86);
  --tp-ink-2: oklch(80% 0.014 88);
  --tp-muted: oklch(65% 0.014 110);
  --tp-faint: oklch(48% 0.014 140);

  --tp-line: oklch(29% 0.018 164);
  --tp-line-strong: oklch(38% 0.024 156);
  --tp-line-soft: oklch(24.5% 0.016 166);

  --tp-jade: oklch(68% 0.125 166);
  --tp-jade-hover: oklch(74% 0.125 166);
  --tp-jade-soft: oklch(26.5% 0.046 166);
  --tp-jade-line: oklch(46% 0.082 166);
  --tp-jade-ink: oklch(13% 0.025 168);

  --tp-gold: oklch(80% 0.118 82);
  --tp-gold-bright: oklch(87% 0.11 85);
  --tp-gold-deep: oklch(83% 0.115 82);
  --tp-gold-soft: oklch(27% 0.045 80);
  --tp-gold-line: oklch(49% 0.082 80);

  --tp-ok: oklch(72% 0.13 154);
  --tp-ok-soft: oklch(25.5% 0.045 154);
  --tp-ok-line: oklch(45% 0.085 154);

  --tp-danger: oklch(71% 0.155 24);
  --tp-danger-soft: oklch(26% 0.05 24);
  --tp-danger-line: oklch(47% 0.095 24);

  --tp-warn: oklch(78% 0.125 72);
  --tp-warn-soft: oklch(27% 0.048 72);
  --tp-warn-line: oklch(49% 0.088 72);

  /* Dark Mode Wallet Card: Deep obsidian-jade plaque */
  --tp-wallet-bg: linear-gradient(150deg, oklch(24.5% 0.042 168), oklch(17% 0.028 170));
  --tp-wallet-border: oklch(78% 0.105 82 / 0.45);
  --tp-wallet-ink: oklch(96.5% 0.01 86);
  --tp-wallet-muted: oklch(77% 0.02 88);
  --tp-wallet-balance: var(--tp-gold-bright);

  --tp-tier-std: oklch(68% 0.12 166);
  --tp-tier-epic: oklch(70% 0.12 244);
  --tp-tier-mythic: oklch(80% 0.12 80);
  --tp-tier-royal: oklch(73% 0.13 308);
  --tp-tier-flash: oklch(70% 0.165 25);

  --tp-shadow-xs: 0 1px 2px oklch(4% 0.01 170 / 0.35);
  --tp-shadow-sm: 0 4px 14px -4px oklch(4% 0.01 170 / 0.5);
  --tp-shadow-md: 0 14px 36px -14px oklch(3% 0.01 170 / 0.72);
  --tp-shadow-lg: 0 26px 58px -16px oklch(2% 0.01 170 / 0.88);
}

/* ============================================================================
   2. SELF-CONTAINED BASE (Zero portal-min.css cascade conflicts)
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
.spin { display: inline-block; animation: tpSpin 0.8s linear infinite; }
@keyframes tpSpin { to { transform: rotate(360deg); } }

#toast {
  position: fixed;
  z-index: 10020;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 16px);
  max-width: min(460px, calc(100vw - 32px));
  padding: 11px 18px;
  border-radius: var(--tp-r-sm);
  background: var(--tp-ink);
  color: var(--tp-surface);
  border: 1px solid var(--tp-line-strong);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: var(--tp-shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--tp-ease), transform 0.22s var(--tp-ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

body.topup-minimal {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--tp-canvas);
  color: var(--tp-ink);
  font-family: var(--tp-font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.22s ease, color 0.22s ease;
}

body.topup-minimal::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 35% at 10% 0%, color-mix(in oklch, var(--tp-jade) 6%, transparent), transparent 70%),
    radial-gradient(45% 32% at 92% 4%, color-mix(in oklch, var(--tp-gold) 7%, transparent), transparent 68%);
}

.topup-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10050;
  padding: 10px 16px;
  border-radius: var(--tp-r-sm);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-weight: 700;
  text-decoration: none;
}
.topup-skip:focus { left: 16px; }

.topup-page-wrap {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2.2vw, 24px) clamp(12px, 2.2vw, 24px) clamp(88px, 6vw, 56px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.8vw, 20px);
  flex: 1 0 auto;
}

.topup-minimal :focus-visible {
  outline: 2px solid var(--tp-gold);
  outline-offset: 2px;
}

/* Tabular figures for crisp alignment on every number */
.np-wallet-balance,
.medal-num,
.reward-price,
.confirm-gold-val,
.chip-v,
.confirm-price-amount,
.confirm-price-was,
.pkg-dock-price,
.racc-total,
.char-hero-power,
.char-hero-gold,
.char-vip-bar-val,
.confirm-vip-progress-text,
.history-tbl td,
.silver-amount strong,
.silver-option b,
.silver-option-amount,
.wp-countdown {
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   3. COMPACT EDITORIAL COMMAND MASTHEAD + WALLET CARD
   ============================================================================ */
.nx-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: clamp(12px, 1.8vw, 18px);
  align-items: stretch;
}

.nx-hero-main {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--tp-r-lg);
  border: 1px solid var(--tp-line);
  background: var(--tp-surface);
  padding: clamp(18px, 2.2vw, 24px) clamp(18px, 2.6vw, 28px);
  box-shadow: var(--tp-shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nx-hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.nx-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 80% 45%;
  opacity: 0.1;
  filter: saturate(0.7);
  mask-image: linear-gradient(110deg, transparent 35%, rgba(0, 0, 0, 0.75) 85%, #000 100%);
  -webkit-mask-image: linear-gradient(110deg, transparent 35%, rgba(0, 0, 0, 0.75) 85%, #000 100%);
}
html[data-theme="dark"] .nx-hero-art img { opacity: 0.16; }

.nx-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nx-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tp-gold);
}
.nx-hero-eyebrow::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nx-hero-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.nx-hero-title {
  margin: 0;
  font-family: var(--tp-font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--tp-ink);
}

.nx-rate-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 11px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-jade-soft);
  border: 1px solid var(--tp-jade-line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tp-ink);
  white-space: nowrap;
}
.nx-rate-line i { font-size: 13px; color: var(--tp-jade); }
.nx-rate-line em {
  font-style: normal;
  padding: 2px 8px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-size: 11.5px;
  font-weight: 800;
}

.nx-hero-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tp-ink-2);
  max-width: 54ch;
}

.nx-hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 2px;
}
.nx-hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  color: var(--tp-ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.nx-hero-links a i { font-size: 15px; color: var(--tp-jade); }
.nx-hero-links a:hover {
  color: var(--tp-jade);
  border-bottom-color: var(--tp-jade-line);
}

/* Sculpted Wallet Card (bright ivory in Light Mode, obsidian-jade in Dark Mode) */
.np-wallet {
  position: relative;
  border-radius: var(--tp-r-lg);
  padding: clamp(16px, 2vw, 22px);
  background: var(--tp-wallet-bg);
  border: 1px solid var(--tp-wallet-border);
  border-left: 4px solid var(--tp-gold);
  box-shadow: var(--tp-shadow-sm);
  color: var(--tp-wallet-ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.np-wallet-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.np-wallet-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--tp-r-sm);
  display: grid;
  place-items: center;
  background: var(--tp-gold-soft);
  border: 1px solid var(--tp-gold-line);
  color: var(--tp-gold);
  font-size: 22px;
}

.np-wallet-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 130px;
}

.np-wallet-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tp-wallet-muted);
}

.np-wallet-balance {
  font-family: var(--tp-font-display);
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--tp-wallet-balance);
  white-space: nowrap;
}

.np-wallet-login a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: var(--tp-r-sm);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, transform 0.16s var(--tp-ease);
}
.np-wallet-login a:hover { background: var(--tp-jade-hover); transform: translateY(-1px); }

/* Wallet Promo inside Wallet Card */
.np-wallet-promo {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: var(--tp-r-sm);
  background: var(--tp-surface);
  border: 1px solid var(--tp-gold-line);
  overflow: hidden;
}
html[data-theme="dark"] .np-wallet-promo {
  background: oklch(100% 0 0 / 0.06);
}
.wallet-promo-details { width: 100%; }
.wallet-promo-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  font-size: 12px;
  color: var(--tp-ink);
  min-height: 40px;
}
.wallet-promo-details > summary::-webkit-details-marker { display: none; }
.wp-fire-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-gold-soft);
  color: var(--tp-gold-deep);
  font-weight: 800;
  font-size: 11px;
}
.wp-fire-short { display: none; }
.wp-countdown { font-size: 11.5px; font-weight: 800; color: var(--tp-gold); }
.wp-countdown:empty { display: none; }
.wp-mult { font-size: 12px; color: var(--tp-ink-2); }
.wp-mult b { color: var(--tp-ink); font-weight: 800; }
.wp-mult-arrow { font-style: normal; margin: 0 2px; color: var(--tp-gold); }
.wp-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--tp-jade);
}
.wp-toggle-less { display: none; }
.wallet-promo-details[open] .wp-toggle-more { display: none; }
.wallet-promo-details[open] .wp-toggle-less { display: inline; }
.wallet-promo-details[open] .wp-toggle i { transform: rotate(180deg); }
.wp-body {
  padding: 0 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--tp-line-soft);
}
.wp-lead { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--tp-ink-2); }
.wp-lead b { color: var(--tp-gold-deep); }
.wp-chips-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 6px; }
.wp-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: var(--tp-r-xs);
  background: var(--tp-surface-2);
  border: 1px solid var(--tp-line);
  font-size: 11.5px;
}
.wp-chip.is-top { border-color: var(--tp-gold-line); background: var(--tp-gold-soft); }
.wp-chip-mult {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--tp-gold);
  color: var(--tp-jade-ink);
  font-weight: 800;
  font-size: 11px;
}
.wp-chip-main { display: flex; flex-direction: column; line-height: 1.3; color: var(--tp-muted); }
.wp-amt { display: inline-flex; align-items: center; gap: 3px; }
.wp-amt b { color: var(--tp-ink); }
.wp-chip-recv { color: var(--tp-jade) !important; }
.wp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 11.5px; color: var(--tp-muted); }
.wp-until-tag { display: inline-flex; align-items: center; gap: 4px; }
.wp-once-tag { padding: 2px 7px; border-radius: var(--tp-r-pill); background: var(--tp-surface-2); font-weight: 700; }
.wp-more { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; color: var(--tp-jade); font-weight: 700; text-decoration: none; }
.wp-more:hover { text-decoration: underline; }

/* ============================================================================
   4. COMPACT HORIZONTAL STEPPER + TÍCH NẠP
   ============================================================================ */
.tp-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tp-stepper::-webkit-scrollbar { display: none; }

.tp-stepper-link {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 14px;
  border-radius: var(--tp-r-pill);
  color: var(--tp-ink-2);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.tp-stepper-link .tp-st-num {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tp-surface-2);
  border: 1px solid var(--tp-line-strong);
  font-size: 11px;
  font-weight: 800;
  color: var(--tp-ink-2);
}
.tp-stepper-link:hover { background: var(--tp-surface-2); color: var(--tp-ink); }
.tp-stepper-link.is-active { background: var(--tp-jade); color: var(--tp-jade-ink); }
.tp-stepper-link.is-active .tp-st-num {
  background: color-mix(in oklch, var(--tp-jade-ink) 22%, transparent);
  border-color: transparent;
  color: var(--tp-jade-ink);
}

/* Tích Nạp Card */
.racc-card {
  border-radius: var(--tp-r-md);
  border: 1px solid var(--tp-gold-line);
  background: var(--tp-surface);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--tp-shadow-xs);
}
.racc-head { display: flex; align-items: center; gap: 12px; }
.racc-icon-badge {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--tp-r-sm);
  display: grid;
  place-items: center;
  background: var(--tp-gold-soft);
  color: var(--tp-gold);
  font-size: 19px;
}
.racc-head-text { min-width: 0; flex: 1; }
.racc-name { font-family: var(--tp-font-display); font-size: 18px; font-weight: 700; color: var(--tp-ink); line-height: 1.2; }
.racc-sub { font-size: 12.5px; color: var(--tp-muted); margin-top: 2px; }
.racc-total { font-family: var(--tp-font-display); font-size: 19px; font-weight: 700; color: var(--tp-gold); white-space: nowrap; }
.racc-toggle {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--tp-r-xs);
  border: 1px solid var(--tp-line);
  background: var(--tp-surface-2);
  color: var(--tp-ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.racc-card.collapsed .racc-toggle i { transform: rotate(-90deg); }
.racc-card.collapsed .racc-bar,
.racc-card.collapsed .racc-foot { display: none; }
.racc-bar { height: 7px; border-radius: var(--tp-r-pill); background: var(--tp-surface-2); overflow: hidden; }
.racc-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--tp-r-pill);
  background: linear-gradient(90deg, var(--tp-jade), var(--tp-gold-bright));
  transition: width 0.35s var(--tp-ease);
}
.racc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.racc-pending { font-weight: 700; color: var(--tp-ink-2); }
.racc-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--tp-jade); text-decoration: none; }
.racc-link:hover { text-decoration: underline; }

/* ============================================================================
   5. COMPACT BLACK FRIDAY FEATURE RIBBON (Never hijacks Light Mode!)
   ============================================================================ */
@keyframes bfReveal {
  0% { transform: scale(1); }
  45% { transform: scale(0.96); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

.bf-campaign {
  --bf-gold: oklch(84% 0.118 82);
  --bf-ink: oklch(96.5% 0.012 84);
  --bf-muted: oklch(80% 0.02 78);
  --bf-line: oklch(38% 0.05 46);
  display: grid;
  grid-template-columns: 196px minmax(0, 1.08fr) minmax(0, 0.96fr);
  gap: 12px;
  padding: 12px;
  border-radius: var(--tp-r-lg);
  border: 1px solid var(--bf-line);
  background:
    radial-gradient(ellipse at 10% 30%, oklch(35% 0.115 26 / 0.55), transparent 62%),
    oklch(15% 0.018 38);
  box-shadow: var(--tp-shadow-md);
  color: var(--bf-ink);
  align-items: stretch;
}
.bf-campaign[hidden] { display: none !important; }

/* Compact cropped poster art on the left instead of giant 500px full-width wall */
.bf-hero {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--tp-r-sm);
  border: 1px solid var(--bf-line);
  background: oklch(11% 0.012 38);
  min-height: 190px;
}
.bf-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 18%;
}

.bf-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--tp-r-sm);
  border: 1px solid oklch(30% 0.036 44);
  background: oklch(19.5% 0.022 38 / 0.92);
}
.bf-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.bf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--bf-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bf-dates { font-size: 11.5px; font-weight: 600; color: var(--bf-muted); }
.bf-title { margin: 0; font-family: var(--tp-font-display); font-size: 21px; font-weight: 700; line-height: 1.2; color: var(--bf-ink); }
.bf-sub { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--bf-muted); }
.bf-tiers { display: flex; flex-wrap: wrap; gap: 5px; }
.bf-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: oklch(13.5% 0.015 38);
  border: 1px solid oklch(32% 0.036 44);
  color: var(--bf-muted);
}
.bf-tier-chip b { color: var(--bf-gold); font-weight: 800; }
.bf-refund-note { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--bf-muted); }
.bf-refund-note b { color: var(--bf-gold); }
.bf-luck-stage { margin-top: auto; }
.bf-luck-card {
  border-radius: var(--tp-r-xs);
  border: 1px solid oklch(54% 0.1 42);
  background: linear-gradient(135deg, oklch(32% 0.115 26), oklch(21% 0.06 28));
  color: var(--bf-ink);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.bf-luck-card.is-flipping { animation: bfReveal 0.42s var(--tp-ease); }
.bf-luck-card.is-rolled { background: linear-gradient(135deg, oklch(36% 0.095 72), oklch(22% 0.045 55)); }
.bf-luck-value { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 150px; }
.bf-luck-pct { font-family: var(--tp-font-display); font-size: 18px; font-weight: 700; line-height: 1.2; color: oklch(91% 0.1 84); }
.bf-luck-hint { font-size: 11.5px; line-height: 1.4; color: oklch(90% 0.02 82); overflow-wrap: anywhere; }
.bf-roll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--tp-r-xs);
  background: var(--bf-gold);
  color: oklch(16% 0.03 45);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s var(--tp-ease), opacity 0.16s ease;
}
.bf-roll-btn:hover:not(:disabled) { opacity: 0.92; transform: translateY(-1px); }
.bf-roll-btn:disabled { opacity: 0.48; cursor: not-allowed; }
.bf-list-block { display: flex; flex-direction: column; gap: 5px; }
.bf-list-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bf-muted); }
.bf-scroll-list { display: flex; flex-direction: column; gap: 4px; max-height: 92px; overflow-y: auto; }
.bf-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: oklch(14% 0.015 38);
  border: 1px solid oklch(27% 0.03 44);
  font-size: 11.5px;
  color: var(--bf-ink);
}
.bf-row-item > span { min-width: 0; overflow-wrap: anywhere; }
.bf-row-item strong { color: var(--bf-gold); white-space: nowrap; }
.bf-modal-spin-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--tp-line-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bf-modal-spin-res { font-size: 13px; font-weight: 700; color: var(--tp-ok); }

/* ============================================================================
   6. MAIN 2-COLUMN WORKSPACE (LEFT FLOW + STICKY RIGHT LEDGER)
   ============================================================================ */
.nx-flow.rt-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 376px;
  gap: clamp(16px, 2.2vw, 24px);
  align-items: start;
}

.rt-col-left {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 22px);
  min-width: 0;
}

.rt-col-right {
  position: sticky;
  top: 88px;
  min-width: 0;
}

/* ============================================================================
   7. STEP PANELS (FLAT EDITORIAL — ZERO HEAVY BOXES INSIDE BOXES)
   ============================================================================ */
.nx-panel {
  border-radius: var(--tp-r-lg);
  border: 1px solid var(--tp-line);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-xs);
  overflow: hidden;
  scroll-margin-top: 94px;
}

.nx-step-head {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  padding: 15px clamp(16px, 2.2vw, 22px);
  border-bottom: 1px solid var(--tp-line-soft);
}

.nx-step-num {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-size: 13.5px;
  font-weight: 800;
}

.nx-step-head h2 {
  margin: 0;
  font-family: var(--tp-font-display);
  font-size: clamp(20px, 2vw, 23px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--tp-ink);
}

.recipient-status,
.reward-count-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-surface-2);
  border: 1px solid var(--tp-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--tp-ink-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-step-body {
  padding: clamp(16px, 2.2vw, 22px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- STEP 1: EXPRESS RECIPIENT PICKER ---------- */
.nx-picker {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, 0.85fr);
  gap: 14px 18px;
  align-items: start;
}

.picker-col-server,
.picker-col-char {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.recipient-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tp-muted);
}

.server-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--tp-r-pill);
  border: 1.5px solid var(--tp-line);
  background: var(--tp-surface-2);
  color: var(--tp-ink);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s var(--tp-ease);
}
.server-choice:hover:not(:disabled) {
  border-color: var(--tp-jade-line);
  background: var(--tp-jade-soft);
  transform: translateY(-1px);
}
.server-choice:disabled { opacity: 0.45; cursor: not-allowed; }
.server-choice b {
  flex: none;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--tp-r-pill);
  display: grid;
  place-items: center;
  background: var(--tp-surface);
  border: 1px solid var(--tp-line-strong);
  font-size: 12px;
  font-weight: 800;
  color: var(--tp-ink);
}
.server-choice > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--tp-ink);
  white-space: nowrap;
}
/* Hide noisy repetitive "Chọn máy chủ này" subtitle unless disabled ("Bảo trì") */
.server-choice small { display: none; }
.server-choice:disabled small {
  display: inline;
  font-size: 11px;
  font-weight: 600;
  color: var(--tp-muted);
}
.server-choice i {
  display: none;
  font-size: 15px;
  color: var(--tp-jade);
}
.server-choice[aria-pressed="true"] {
  border-color: var(--tp-jade);
  background: var(--tp-jade-soft);
  box-shadow: 0 0 0 1px var(--tp-jade);
}
.server-choice[aria-pressed="true"] b {
  background: var(--tp-jade);
  border-color: var(--tp-jade);
  color: var(--tp-jade-ink);
}
.server-choice[aria-pressed="true"] > span { color: var(--tp-ink); }
.server-choice[aria-pressed="true"] i { display: inline-flex; }

.custom-select {
  width: 100%;
  min-height: 44px;
  padding: 8px 36px 8px 14px;
  border-radius: var(--tp-r-pill);
  border: 1.5px solid var(--tp-line);
  background-color: var(--tp-surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237a847c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  -webkit-appearance: none;
  color: var(--tp-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.custom-select:hover:not(:disabled) { border-color: var(--tp-jade-line); }
.custom-select:focus {
  border-color: var(--tp-jade);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--tp-jade) 18%, transparent);
}
.custom-select:disabled { opacity: 0.6; cursor: not-allowed; }

/* Slim Inline Character Profile Strip */
.char-profile-card {
  border-radius: var(--tp-r-md);
  border: 1px solid var(--tp-line-soft);
  background: var(--tp-surface-2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.char-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.nx-profile-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tp-muted);
}
.char-acc-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--tp-muted);
}
.char-acc-name b { color: var(--tp-ink); }

.char-profile-body,
.char-profile-body[style*="block"] {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 1.1fr);
  gap: 12px;
  align-items: center;
}
.char-profile-body[style*="none"] { display: none !important; }

.char-hero-box { display: flex; align-items: center; gap: 11px; min-width: 0; }
.char-hero-flag-wrap {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: var(--tp-r-xs);
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
  display: grid;
  place-items: center;
  padding: 3px;
}
.char-hero-flag-img { width: 100%; height: 100%; object-fit: contain; }
.char-hero-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.char-hero-name-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.char-hero-name { font-size: 15.5px; font-weight: 800; color: var(--tp-ink); }
.profile-pill.level {
  padding: 1px 7px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-jade-soft);
  color: var(--tp-jade);
  font-size: 11.5px;
  font-weight: 800;
}
.char-hero-sub-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 700; color: var(--tp-ink-2); }
.char-hero-power,
.char-hero-gold { display: inline-flex; align-items: center; gap: 4px; }
.power-sword-icon,
.game-gold-icon { width: 16px; height: 16px; object-fit: contain; }

.char-vip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--tp-r-sm);
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
}
.char-vip-icon-img { width: 38px; height: 38px; flex: none; object-fit: contain; transition: transform 0.22s var(--tp-ease); }
.char-vip-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.char-vip-text { font-size: 12px; line-height: 1.35; color: var(--tp-ink-2); }
.char-vip-text b { color: var(--tp-ink); }
.char-vip-bar-wrap { height: 6px; border-radius: var(--tp-r-pill); background: var(--tp-surface-3); overflow: hidden; }
.char-vip-bar-fill { height: 100%; border-radius: var(--tp-r-pill); background: linear-gradient(90deg, var(--tp-jade), var(--tp-gold-bright)); transition: width 0.35s var(--tp-ease); }
.char-vip-bar-val { font-size: 11px; font-weight: 700; color: var(--tp-muted); }

.char-profile-empty,
.char-profile-empty[style*="block"] {
  display: flex !important;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--tp-muted);
}
.char-profile-empty[style*="none"] { display: none !important; }
.char-empty-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--tp-r-xs);
  background: var(--tp-surface);
  border: 1px solid var(--tp-line);
  display: grid;
  place-items: center;
  color: var(--tp-gold);
  font-size: 15px;
}

/* ============================================================================
   8. STEP 2: FLAT EDITORIAL PACKAGE SHOWCASE (NO NESTED BOXES!)
   ============================================================================ */
.nx-segs.package-groups {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-surface-2);
  border: 1px solid var(--tp-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.nx-segs.package-groups::-webkit-scrollbar { display: none; }

.package-group {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--tp-r-pill);
  background: transparent;
  color: var(--tp-ink-2);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.package-group i { font-size: 16px; color: var(--tp-muted); }
.package-group:hover { color: var(--tp-ink); background: color-mix(in oklch, var(--tp-surface) 70%, transparent); }
.package-group.active { background: var(--tp-jade); color: var(--tp-jade-ink); box-shadow: var(--tp-shadow-xs); }
.package-group.active i { color: var(--tp-jade-ink); }

.package-group-note { margin: -8px 0 0; font-size: 13px; color: var(--tp-muted); }
.package-group-note:empty { display: none; }

/* Silver Converter */
.silver-converter {
  border-radius: var(--tp-r-md);
  border: 1px solid var(--tp-line);
  background: var(--tp-surface-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.silver-result { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--tp-r-sm); background: var(--tp-surface); border: 1px solid var(--tp-line); }
.silver-result > span { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tp-muted); }
.silver-amount { display: flex; align-items: center; gap: 9px; }
.currency-icon { width: 19px; height: 19px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.silver-hero-icon { width: 26px; height: 26px; }
.silver-amount strong { font-family: var(--tp-font-display); font-size: 27px; font-weight: 700; color: var(--tp-gold); }
.silver-result p { margin: 0; font-size: 13px; color: var(--tp-ink-2); }
.silver-denominations > p { margin: 0 0 8px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tp-muted); }
.silver-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.silver-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 62px;
  padding: 10px 12px;
  border-radius: var(--tp-r-sm);
  border: 1.5px solid var(--tp-line);
  background: var(--tp-surface);
  color: var(--tp-ink);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s var(--tp-ease);
}
.silver-option:hover { border-color: var(--tp-jade-line); transform: translateY(-1px); }
.silver-option.active { border-color: var(--tp-jade); background: var(--tp-jade-soft); box-shadow: 0 0 0 1px var(--tp-jade); }
.silver-option b { font-size: 15px; font-weight: 800; color: var(--tp-ink); }
.silver-option-amount { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--tp-gold); }
.silver-mail { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tp-ink-2); }
.silver-mail:empty, .silver-event-note:empty { display: none; }
.silver-event-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--tp-ink-2); }
.silver-event-note.spark-optional { color: var(--tp-muted); }

/* Package Cards: Open, Uncluttered, Fast-Scanning */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reward-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 15px 13px;
  border-radius: var(--tp-r-md);
  border: 1.5px solid var(--tp-line);
  background: var(--tp-surface);
  cursor: pointer;
  transition: border-color 0.18s var(--tp-ease), transform 0.18s var(--tp-ease), box-shadow 0.18s var(--tp-ease), background-color 0.18s ease;
}

.reward-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  width: 36px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--tp-tier-accent, var(--tp-tier-std));
  transition: width 0.2s var(--tp-ease);
}

.reward-card.tier-standard { --tp-tier-accent: var(--tp-tier-std); }
.reward-card.tier-epic { --tp-tier-accent: var(--tp-tier-epic); }
.reward-card.tier-mythic { --tp-tier-accent: var(--tp-tier-mythic); }
.reward-card.tier-royal { --tp-tier-accent: var(--tp-tier-royal); }
.reward-card.tier-flash { --tp-tier-accent: var(--tp-tier-flash); }

.reward-card:hover {
  border-color: var(--tp-jade-line);
  transform: translateY(-2px);
  box-shadow: var(--tp-shadow-sm);
}
.reward-card:hover::before { width: 56px; }

.reward-card.selected {
  border-color: var(--tp-jade);
  background: color-mix(in oklch, var(--tp-jade-soft) 58%, var(--tp-surface));
  box-shadow: 0 0 0 1px var(--tp-jade), var(--tp-shadow-md);
}
.reward-card.selected::before {
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--tp-jade);
}

.reward-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.reward-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--tp-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-selected-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

/* Open Gold Display (NO nested box!) */
.reward-medallion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

.reward-icon-halo {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tp-gold-soft);
  border: 1px solid var(--tp-gold-line);
}
.reward-icon-halo img { width: 22px; height: 22px; object-fit: contain; border-radius: 50%; }

.reward-amount-col { display: flex; flex-direction: column; min-width: 0; }
.reward-amount-col .medal-num {
  font-family: var(--tp-font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--tp-ink);
}
.reward-amount-col .medal-num.gold-xl { font-size: 23px; }
.reward-amount-col .medal-num.gold-xxl { font-size: 20px; }
.reward-amount-col span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tp-muted);
  margin-top: 2px;
}

.reward-exp {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--tp-ink-2);
  line-height: 1.35;
}

.reward-gifts-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  min-height: 32px;
  padding: 4px 9px;
  border-radius: var(--tp-r-pill);
  border: 1px solid var(--tp-gold-line);
  background: var(--tp-gold-soft);
  color: var(--tp-gold-deep);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s var(--tp-ease), border-color 0.14s ease;
}
.reward-gifts-link i:first-child { color: var(--tp-gold); font-size: 14px; }
.reward-gifts-link i:last-child { font-size: 13px; opacity: 0.7; }
.reward-gifts-link:hover { border-color: var(--tp-gold); transform: translateY(-1px); }

.reward-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--tp-line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reward-price-row { display: flex; flex-direction: column; line-height: 1.15; }
.price-was { font-size: 11.5px; font-weight: 600; color: var(--tp-muted); text-decoration: line-through; }
.reward-price b {
  font-family: var(--tp-font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--tp-jade);
  white-space: nowrap;
}

.reward-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 5px 11px;
  border-radius: var(--tp-r-pill);
  border: 1.5px solid var(--tp-line-strong);
  background: transparent;
  color: var(--tp-ink-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.reward-card:hover .reward-select { border-color: var(--tp-jade); color: var(--tp-jade); }
.reward-card.selected .reward-select,
.reward-select[aria-pressed="true"] {
  background: var(--tp-jade);
  border-color: var(--tp-jade);
  color: var(--tp-jade-ink);
}

/* ============================================================================
   9. STEP 3: EDITORIAL CHECKOUT LEDGER (CLEAN KEY-VALUE ROWS, ZERO CLUTTER)
   ============================================================================ */
#tp-step-3 { scroll-margin-top: 94px; }

.confirm-checkout-card {
  border-radius: var(--tp-r-lg);
  border: 1px solid var(--tp-line);
  border-top: 3px solid var(--tp-jade);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-md);
  overflow: hidden;
}

.confirm-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--tp-line-soft);
}

.confirm-header-left { display: flex; align-items: flex-start; gap: 11px; }
.nx-order-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.checkout-heading { font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tp-gold); }
.confirm-header-title { font-family: var(--tp-font-display); font-size: 21px; font-weight: 700; line-height: 1.2; color: var(--tp-ink); }
.confirm-header-sub { font-size: 12px; color: var(--tp-muted); }

.confirm-card-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Recipient Strip */
.checkout-recipient {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--tp-r-sm);
  border: 1px solid var(--tp-warn-line);
  background: var(--tp-warn-soft);
}
.checkout-recipient.ready { border-color: var(--tp-ok-line); background: var(--tp-ok-soft); }
.checkout-recipient > div { min-width: 0; flex: 1; }
#checkout-destination {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tp-ink);
}
#checkout-destination > span { display: flex; flex-direction: column; min-width: 0; }
#checkout-destination strong { font-size: 14px; color: var(--tp-ink); }
#checkout-destination small { font-size: 11.5px; font-weight: 600; color: var(--tp-muted); }
.server-stamp {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-size: 11.5px;
  font-weight: 800;
}
.recipient-edit {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: var(--tp-r-pill);
  border: 1px solid var(--tp-line-strong);
  background: var(--tp-surface);
  color: var(--tp-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.recipient-edit:hover { border-color: var(--tp-jade); color: var(--tp-jade); }

/* Clean Gold Breakdown Rows (No 3 tiny boxes!) */
.checkout-overview { display: flex; flex-direction: column; gap: 12px; }

.confirm-gold-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 15px;
  border-radius: var(--tp-r-md);
  background: var(--tp-surface-2);
}
.confirm-gold-label { font-size: 12px; font-weight: 700; color: var(--tp-muted); }
.confirm-gold-display { display: flex; align-items: center; gap: 9px; }
.confirm-gold-icon { width: 28px; height: 28px; object-fit: contain; }
.confirm-gold-val {
  font-family: var(--tp-font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--tp-gold);
}

.confirm-gold-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 8px;
  border-top: 1px solid var(--tp-line);
}
.confirm-breakdown-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--tp-line-soft);
}
.confirm-breakdown-chip:last-child { border-bottom: 0; padding-bottom: 0; }
.chip-k { font-size: 12.5px; font-weight: 600; color: var(--tp-muted); }
.chip-v { font-size: 13px; font-weight: 800; color: var(--tp-ink); text-align: right; }
.confirm-breakdown-chip.bonus .chip-v { color: var(--tp-ok); }
.confirm-breakdown-chip.vip .chip-v { color: var(--tp-gold); }

/* VIP Collapsible */
.confirm-vip-box {
  border-radius: var(--tp-r-sm);
  border: 1px solid var(--tp-line);
  padding: 0 13px;
}
.confirm-vip-box > summary {
  list-style: none;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--tp-ink);
}
.confirm-vip-box > summary::-webkit-details-marker { display: none; }
.confirm-vip-box > summary::after { content: "▾"; font-size: 13px; color: var(--tp-muted); transition: transform 0.2s ease; }
.confirm-vip-box[open] > summary::after { transform: rotate(180deg); }
.confirm-vip-box[open] { padding-bottom: 13px; }
.confirm-vip-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 9px; }
.confirm-vip-title { font-size: 11px; font-weight: 700; color: var(--tp-muted); display: inline-flex; align-items: center; gap: 4px; }
.confirm-vip-result { font-size: 12.5px; color: var(--tp-ink-2); }
.confirm-vip-result b { color: var(--tp-gold); }
.confirm-vip-flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.confirm-vip-badge {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--tp-r-xs);
  background: var(--tp-surface-2);
  border: 1px solid var(--tp-line);
}
.confirm-vip-badge.target { border-color: var(--tp-gold-line); }
.vip-flow-icon { width: 26px; height: 26px; object-fit: contain; }
.vip-flow-meta { display: flex; flex-direction: column; line-height: 1.2; }
.vip-flow-lbl { font-size: 10px; color: var(--tp-muted); }
.vip-flow-val { font-size: 12.5px; font-weight: 800; color: var(--tp-ink); }
.vip-flow-val.vip-max { color: var(--tp-gold); }
.confirm-vip-arrow { color: var(--tp-gold); font-size: 15px; }
.confirm-vip-progress-bar {
  position: relative;
  height: 18px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-surface-3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-vip-progress-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--tp-jade), var(--tp-gold-bright)); opacity: 0.35; transition: width 0.35s var(--tp-ease); }
.confirm-vip-progress-text { position: relative; z-index: 1; font-size: 10.5px; font-weight: 800; color: var(--tp-ink); }

/* View Gifts Button */
.view-gifts.sum-gifts-box {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--tp-r-sm);
  border: 1px solid var(--tp-gold-line);
  background: var(--tp-gold-soft);
  color: var(--tp-gold-deep);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s var(--tp-ease);
}
.view-gifts.sum-gifts-box i:first-child { color: var(--tp-gold); font-size: 16px; }
.view-gifts.sum-gifts-box:hover { border-color: var(--tp-gold); transform: translateY(-1px); }

/* Payment Footer & Commanding Primary CTA */
.checkout-payment {
  padding-top: 14px;
  border-top: 1px solid var(--tp-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkout-payment-head { display: flex; flex-direction: column; gap: 2px; }
.checkout-payment-title { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tp-muted); }
.checkout-wallet-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--tp-ink-2); }
.checkout-wallet-note.insufficient {
  padding: 8px 10px;
  border-radius: var(--tp-r-xs);
  background: var(--tp-danger-soft);
  border: 1px solid var(--tp-danger-line);
  color: var(--tp-danger);
  font-weight: 600;
}

.confirm-checkout-footer { display: flex; flex-direction: column; gap: 11px; }
.confirm-price-block { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.confirm-price-lbl { font-size: 13.5px; font-weight: 700; color: var(--tp-ink-2); }
.confirm-price-was { margin-left: auto; font-size: 13.5px; color: var(--tp-muted); }
.confirm-price-amount { font-family: var(--tp-font-display); font-size: 30px; font-weight: 700; line-height: 1.05; color: var(--tp-jade); }

#topup-msg { padding: 10px 12px; border-radius: var(--tp-r-sm); font-size: 13px; line-height: 1.45; font-weight: 600; }
.checkout-flash-note { margin: 0; padding: 8px 10px; border-radius: var(--tp-r-xs); background: var(--tp-danger-soft); border: 1px solid var(--tp-danger-line); color: var(--tp-danger); font-size: 12px; font-weight: 700; }

.confirm-buttons-row { display: flex; flex-direction: column; gap: 8px; }
.btn-checkout-cta {
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--tp-r-sm);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px color-mix(in oklch, var(--tp-jade) 65%, transparent);
  transition: background-color 0.16s ease, transform 0.16s var(--tp-ease);
}
.btn-checkout-cta i { font-size: 19px; }
.btn-checkout-cta:hover:not(:disabled) { background: var(--tp-jade-hover); transform: translateY(-1px); }
.btn-checkout-cta:active:not(:disabled) { transform: translateY(0); }
.btn-checkout-cta:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cta-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.btn-cta-sub { font-size: 11px; font-weight: 600; opacity: 0.85; }

/* ============================================================================
   10. GUIDE ACCORDION & HISTORY HUB
   ============================================================================ */
.nx-help.topup-guide-card {
  border-radius: var(--tp-r-md);
  border: 1px solid var(--tp-line);
  background: var(--tp-surface);
  overflow: hidden;
}
.topup-guide-header {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
  color: var(--tp-ink);
}
.topup-guide-header::-webkit-details-marker { display: none; }
.topup-guide-header i { color: var(--tp-gold); font-size: 19px; }
.topup-guide-header::after { content: "▾"; margin-left: auto; font-size: 14px; color: var(--tp-muted); transition: transform 0.2s ease; }
.nx-help[open] .topup-guide-header::after { transform: rotate(180deg); }
.topup-guide-body { padding: 0 18px 16px; border-top: 1px solid var(--tp-line-soft); }
.nx-help-list { margin: 12px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--tp-ink-2); }
.nx-help-list b { color: var(--tp-ink); }
.nx-help-list a { color: var(--tp-jade); font-weight: 700; }

/* History Hub */
.nx-history.history-hub {
  border-radius: var(--tp-r-lg);
  border: 1px solid var(--tp-line);
  background: var(--tp-surface);
  padding: clamp(16px, 2.2vw, 22px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--tp-shadow-xs);
  scroll-margin-top: 94px;
}
.history-hub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.history-hub-title { margin: 0; font-family: var(--tp-font-display); font-size: clamp(20px, 2vw, 23px); font-weight: 700; color: var(--tp-ink); }
.history-hub-tabs { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--tp-r-pill); background: var(--tp-surface-2); border: 1px solid var(--tp-line); }
.history-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 14px;
  border: 0;
  border-radius: var(--tp-r-pill);
  background: transparent;
  color: var(--tp-ink-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.history-tab-btn:hover { color: var(--tp-ink); }
.history-tab-btn.active { background: var(--tp-jade); color: var(--tp-jade-ink); }
.history-card { display: none; }
.history-card.is-active-htab { display: block; }
.nx-table-wrap { width: 100%; overflow-x: auto; border-radius: var(--tp-r-sm); border: 1px solid var(--tp-line); }
.history-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; }
.history-tbl thead th {
  padding: 11px 14px;
  background: var(--tp-surface-2);
  border-bottom: 1px solid var(--tp-line);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tp-muted);
  white-space: nowrap;
}
.history-tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--tp-line-soft); color: var(--tp-ink-2); vertical-align: middle; }
.history-tbl tbody tr:last-child td { border-bottom: 0; }
.history-tbl tbody tr:hover td { background: color-mix(in oklch, var(--tp-surface-2) 55%, transparent); }
.history-tbl td.nx-empty { text-align: center; padding: 26px 16px; color: var(--tp-muted); }

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--tp-r-pill);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-status.ok { background: var(--tp-ok-soft); border-color: var(--tp-ok-line); color: var(--tp-ok); }
.badge-status.wait { background: var(--tp-warn-soft); border-color: var(--tp-warn-line); color: var(--tp-warn); }
.badge-status.cancel { background: var(--tp-danger-soft); border-color: var(--tp-danger-line); color: var(--tp-danger); }
.vqr-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 11px;
  border-radius: var(--tp-r-pill);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

/* ============================================================================
   11. MOBILE STICKY CHECKOUT DOCK (#pkg-selected-dock)
   ============================================================================ */
.pkg-dock {
  display: none;
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 900;
  border-radius: var(--tp-r-md);
  background: color-mix(in oklch, var(--tp-surface) 95%, transparent);
  border: 1px solid var(--tp-jade-line);
  box-shadow: var(--tp-shadow-lg);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  padding: 8px 10px;
}
.pkg-dock-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pkg-dock-main { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.pkg-dock-thumb {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--tp-gold-soft);
  border: 1px solid var(--tp-gold-line);
  display: grid;
  place-items: center;
}
.pkg-dock-img { width: 20px; height: 20px; object-fit: contain; border-radius: 50%; }
.pkg-dock-info { display: flex; flex-direction: column; min-width: 0; }
.pkg-dock-title { font-size: 13px; font-weight: 800; color: var(--tp-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-dock-gold { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--tp-gold); white-space: nowrap; }
.pkg-dock-action { display: flex; align-items: center; gap: 8px; flex: none; }
.pkg-dock-price { font-family: var(--tp-font-display); font-size: 16.5px; font-weight: 700; color: var(--tp-jade); white-space: nowrap; }
.pkg-dock-price .price-was { display: block; font-family: var(--tp-font-sans); font-size: 10px; line-height: 1; }
.btn-change-pkg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--tp-r-sm);
  background: var(--tp-jade);
  color: var(--tp-jade-ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

/* ============================================================================
   12. ACCESSIBLE MODAL (#wmodal)
   ============================================================================ */
.wmodal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 16px;
  background: oklch(10% 0.015 168 / 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--tp-ease);
}
.wmodal-backdrop.open { opacity: 1; pointer-events: auto; }
.wmodal-box {
  width: min(490px, 100%);
  max-height: min(88dvh, 740px);
  display: flex;
  flex-direction: column;
  border-radius: var(--tp-r-lg);
  border: 1px solid var(--tp-line);
  border-top: 3px solid var(--tp-jade);
  background: var(--tp-surface);
  color: var(--tp-ink);
  box-shadow: var(--tp-shadow-lg);
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.24s var(--tp-ease);
}
.wmodal-backdrop.open .wmodal-box { transform: translateY(0) scale(1); }
.wmodal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tp-line-soft);
  background: var(--tp-surface-2);
}
.wmodal-title { display: inline-flex; align-items: center; gap: 7px; font-size: 15.5px; font-weight: 800; color: var(--tp-ink); }
.wmodal-title i { color: var(--tp-gold); font-size: 19px; }
.wmodal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--tp-r-xs);
  border: 1px solid var(--tp-line);
  background: var(--tp-surface);
  color: var(--tp-ink-2);
  font-size: 21px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.wmodal-close:hover { border-color: var(--tp-danger-line); color: var(--tp-danger); }
.wmodal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; }
.wmodal-dest { padding: 12px 14px; border-radius: var(--tp-r-sm); background: var(--tp-jade-soft); border: 1px solid var(--tp-jade-line); }
.wmodal-dest-lbl { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--tp-jade); }
.wmodal-dest-srv { margin-top: 5px; display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 700; color: var(--tp-ink); }
.wmodal-dest-char { margin-top: 3px; display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 800; color: var(--tp-ink); }
.wmodal-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--tp-line-soft); font-size: 13.5px; }
.wmodal-row .k { color: var(--tp-muted); font-weight: 600; }
.wmodal-row .v { font-weight: 800; color: var(--tp-ink); text-align: right; }
.wmodal-row .v.gold { color: var(--tp-gold); }
.wmodal-row .v.green { color: var(--tp-ok); }
.wmodal-gifts { border-radius: var(--tp-r-sm); border: 1px solid var(--tp-line); background: var(--tp-surface-2); padding: 0 12px; }
.wmodal-gifts > summary { cursor: pointer; min-height: 38px; display: flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--tp-ink); }
.wmodal-gifts h4 { margin: 8px 0 5px; font-size: 12.5px; color: var(--tp-gold); }
.wmodal-gifts ul, .pkg-gift-items { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.wmodal-gifts li, .pkg-gift-items li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--tp-r-xs); background: var(--tp-surface); border: 1px solid var(--tp-line-soft); font-size: 12.5px; color: var(--tp-ink-2); }
.pkg-gift-item-icon { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; flex: none; }
.gift-preview-name { margin: 0; font-family: var(--tp-font-display); font-size: 21px; font-weight: 700; color: var(--tp-ink); }
.gift-preview-summary { margin: -5px 0 4px; font-size: 13px; font-weight: 700; color: var(--tp-gold); }
.gift-preview-list { display: flex; flex-direction: column; gap: 10px; }
.pkg-gift-category { padding: 11px; border-radius: var(--tp-r-sm); background: var(--tp-surface-2); border: 1px solid var(--tp-line); }
.pkg-gift-cat-header { margin: 0 0 7px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--tp-ink); }
.pkg-gift-cat-header i { color: var(--tp-gold); }
.gift-preview-note { margin: 0; font-size: 12px; color: var(--tp-muted); line-height: 1.45; }
.wmodal-warn { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border-radius: var(--tp-r-sm); background: var(--tp-warn-soft); border: 1px solid var(--tp-warn-line); font-size: 12.5px; line-height: 1.45; color: var(--tp-ink); }
.wmodal-warn i { color: var(--tp-warn); font-size: 17px; flex: none; margin-top: 1px; }
.wmodal-ack { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: var(--tp-r-sm); border: 1.5px solid var(--tp-line-strong); background: var(--tp-surface-2); font-size: 13px; font-weight: 600; color: var(--tp-ink); cursor: pointer; }
.wmodal-ack input { width: 19px; height: 19px; flex: none; accent-color: var(--tp-jade); cursor: pointer; }
.wmodal-note { font-size: 12px; line-height: 1.45; color: var(--tp-muted); }
.wmodal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--tp-line-soft); background: var(--tp-surface-2); }
.wmodal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 15px;
  border-radius: var(--tp-r-sm);
  border: 1px solid var(--tp-line-strong);
  background: var(--tp-surface);
  color: var(--tp-ink);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.wmodal-btn:hover:not(:disabled) { border-color: var(--tp-jade); }
.wmodal-btn.primary { background: var(--tp-jade); border-color: var(--tp-jade); color: var(--tp-jade-ink); flex: 1; }
.wmodal-btn.primary:hover:not(:disabled) { background: var(--tp-jade-hover); }
.wmodal-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.wmodal-close-inline { display: none; }

/* ============================================================================
   13. RESPONSIVE BREAKPOINTS (DESKTOP -> TABLET -> MOBILE -> LANDSCAPE)
   ============================================================================ */
@media (max-width: 1180px) {
  .bf-campaign {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .bf-campaign > .bf-panel:last-child {
    grid-column: 1 / -1;
  }
  .reward-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .nx-hero { grid-template-columns: minmax(0, 1fr); }
  .nx-flow.rt-two-col { grid-template-columns: minmax(0, 1fr); }
  .rt-col-right { position: static; }
  .pkg-dock { display: block; }
  .topup-page-wrap { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .reward-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .nx-picker { grid-template-columns: minmax(0, 1fr); }
  .char-profile-body,
  .char-profile-body[style*="block"] { grid-template-columns: minmax(0, 1fr); }
  .bf-campaign { grid-template-columns: minmax(0, 1fr); }
  .bf-hero { min-height: 150px; }
  .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wp-fire-long { display: none; }
  .wp-fire-short { display: inline; }
}

/* Mobile Portrait (360px - 599px): Crisp 2-Column Package Grid + Stacked History Cards */
@media (max-width: 599px) {
  .nx-hero-main { padding: 15px 15px; }
  .np-wallet { padding: 14px 15px; }
  .nx-step-head { padding: 13px 14px; }
  .nx-step-body { padding: 14px; gap: 13px; }
  .recipient-status, .reward-count-badge { margin-left: 0; width: 100%; justify-content: flex-start; }

  .racc-card { padding: 13px 14px; }
  .racc-head { flex-wrap: wrap; }
  .racc-head-text { flex: 1 1 170px; }
  .racc-total { font-size: 16.5px; margin-left: auto; }

  /* Compact scannable 2-col cards on mobile phones (>= 360px)! */
  .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .reward-card { padding: 12px 11px 11px; gap: 7px; border-radius: var(--tp-r-sm); }
  .reward-card h3 { font-size: 13px; }
  .reward-selected-pill { display: none; }
  .reward-icon-halo { width: 28px; height: 28px; }
  .reward-icon-halo img { width: 18px; height: 18px; }
  .reward-amount-col .medal-num { font-size: 20px; }
  .reward-amount-col .medal-num.gold-xl { font-size: 17.5px; }
  .reward-amount-col .medal-num.gold-xxl { font-size: 15.5px; }
  .reward-amount-col span { font-size: 10.5px; }
  .reward-exp { font-size: 11px; }
  .reward-gifts-link { width: 100%; justify-content: space-between; min-height: 30px; padding: 3px 7px; font-size: 10.5px; white-space: nowrap; }
  .reward-gifts-link span { overflow: hidden; text-overflow: ellipsis; }
  .reward-card-foot { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 8px; }
  .reward-price b { font-size: 16.5px; }
  .reward-select { width: 100%; min-height: 34px; font-size: 12px; }

  .bf-campaign { padding: 10px; gap: 10px; }
  .bf-panel { padding: 11px; }
  .bf-hero { min-height: 132px; }
  .bf-luck-card .bf-roll-btn { width: 100%; }

  /* Responsive History Cards on Mobile */
  .nx-table-wrap { border: 0; overflow: visible; }
  .history-tbl, .history-tbl tbody, .history-tbl tr, .history-tbl td { display: block; width: 100%; }
  .history-tbl thead { display: none; }
  .history-tbl tbody { display: flex; flex-direction: column; gap: 9px; }
  .history-tbl tbody tr {
    border-radius: var(--tp-r-sm);
    border: 1px solid var(--tp-line);
    background: var(--tp-surface-2);
    padding: 9px 12px;
  }
  .history-tbl tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid var(--tp-line-soft);
    text-align: right;
    white-space: normal !important;
  }
  .history-tbl tbody td:last-child { border-bottom: 0; }
  .history-tbl tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: var(--tp-muted);
    text-align: left;
    flex: none;
  }
  .history-tbl tbody td.nx-empty { display: block; text-align: center; border: 0; }

  /* Modal bottom-sheet on portrait phones */
  .wmodal-backdrop { padding: 10px 8px max(10px, env(safe-area-inset-bottom)); align-items: flex-end; }
  .wmodal-box { max-height: 90dvh; }
  .wmodal-actions { flex-direction: column-reverse; }
  .wmodal-btn { width: 100%; }
}

@media (max-width: 349px) {
  .reward-grid { grid-template-columns: minmax(0, 1fr); }
  .pkg-dock-gold { display: none; }
}

/* Landscape mobile: compact 2-col modal */
@media (orientation: landscape) and (max-height: 520px) {
  .wmodal-backdrop { padding: 6px 12px; align-items: center; }
  .wmodal-box { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 12px); }
  .wmodal-head { padding: 8px 14px; }
  .wmodal-title { font-size: 14px; }
  .wmodal-close { width: 32px; height: 32px; font-size: 18px; }
  .wmodal-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 6px 14px;
    padding: 10px 14px;
    font-size: 12.5px;
  }
  .wmodal-dest { grid-column: 1; grid-row: 1; padding: 8px 10px; }
  .wmodal-body > .wmodal-row { grid-column: 1; padding: 4px 0; font-size: 12.5px; }
  .wmodal-body > .wmodal-gifts { grid-column: 2; grid-row: 1; align-self: start; }
  .wmodal-body > .wmodal-ack { grid-column: 2; grid-row: 2 / span 3; align-self: start; padding: 8px 10px; font-size: 12px; }
  .wmodal-warn, .wmodal-note { display: none; }
  .wmodal-actions { flex-direction: row; padding: 8px 14px; }
  .wmodal-btn { width: auto; min-height: 40px; padding: 6px 14px; font-size: 13px; }
  .wmodal-close-inline { display: inline-flex; }
}

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