/* ===========================================================
   TU VI LA SO - Mobile-First Stylesheet
   Dark theme with gold accents — Optimized for 100% mobile users
   Screen-based layout with scroll navigation
   =========================================================== */

/* ========================
   CSS VARIABLES
   ======================== */
:root {
  --bg-body: #080c14;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --bg-card-alt: #0f1520;
  --bg-input: #0c1220;
  --bg-overlay: rgba(0, 0, 0, 0.75);
  --text-primary: #e8ecf1;
  --text-secondary: #94a3b8;
  --text-muted: #7a8ba3;
  --accent-gold: #f0b429;
  --accent-gold-light: #fcd34d;
  --accent-gold-dim: rgba(240, 180, 41, 0.12);
  --accent-gold-glow: rgba(240, 180, 41, 0.25);
  --accent-red: #f87171;
  --accent-red-dim: rgba(248, 113, 113, 0.12);
  --accent-green: #4ade80;
  --accent-green-dim: rgba(74, 222, 128, 0.12);
  --accent-blue: #60a5fa;
  --accent-blue-dim: rgba(96, 165, 250, 0.12);
  --accent-purple: #a78bfa;
  --accent-purple-dim: rgba(167, 139, 250, 0.12);
  --accent-teal: #2dd4bf;
  --accent-orange: #fb923c;
  --border-color: rgba(240, 180, 41, 0.10);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --glass-bg: rgba(17, 24, 39, 0.80);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(240, 180, 41, 0.2);
  --shadow-glow-lg: 0 4px 40px rgba(240, 180, 41, 0.15);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* Mobile spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.25rem;
  --space-xl: 1.5rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ========================
   SPLASH SCREEN
   ======================== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash-screen:not(.active) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Ambient background orbs */
.splash-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.splash-orbs::before,
.splash-orbs::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  animation: splashOrbIn 2s 0.3s ease-out forwards;
}
.splash-orbs::before {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.18) 0%, transparent 70%);
  top: 15%;
  left: -10%;
  animation: splashOrbIn 2s 0.3s ease-out forwards, splashOrbFloat 8s 2s ease-in-out infinite alternate;
}
.splash-orbs::after {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
  bottom: 10%;
  right: -10%;
  animation: splashOrbIn 2s 0.6s ease-out forwards, splashOrbFloat2 10s 2.5s ease-in-out infinite alternate;
}
@keyframes splashOrbIn {
  to { opacity: 1; }
}
@keyframes splashOrbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(20px, -30px) scale(1.1); }
}
@keyframes splashOrbFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-25px, 20px) scale(1.15); }
}

/* Star particles */
.splash-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 15%, rgba(240, 180, 41, 0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 60%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(167, 139, 250, 0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 45%, rgba(240, 180, 41, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 75%, rgba(255, 255, 255, 0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 85%, rgba(167, 139, 250, 0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 20%, rgba(240, 180, 41, 0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 90%, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  opacity: 0;
  animation: splashStarsIn 1.5s 0.8s ease-out forwards, splashStarsTwinkle 6s 2s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes splashStarsIn {
  to { opacity: 1; }
}
@keyframes splashStarsTwinkle {
  0% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; }
  100% { opacity: 0.7; transform: scale(1.02); }
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 0 2rem;
}

/* Logo container */
.splash-logo {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  animation: splashLogoIn 1s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.splash-logo-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: block;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(240, 180, 41, 0.3)) drop-shadow(0 0 60px rgba(240, 180, 41, 0.1));
  animation: splashLogoPulse 3s 1.5s ease-in-out infinite;
}
@keyframes splashLogoIn {
  to { opacity: 1; transform: scale(1); }
}
@keyframes splashLogoPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(240, 180, 41, 0.3)) drop-shadow(0 0 60px rgba(240, 180, 41, 0.1)); }
  50% { filter: drop-shadow(0 0 30px rgba(240, 180, 41, 0.5)) drop-shadow(0 0 80px rgba(240, 180, 41, 0.2)); }
}

/* Spinning rings around logo */
.splash-logo-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: rgba(240, 180, 41, 0.5);
  border-right-color: rgba(240, 180, 41, 0.15);
  animation: splashRingSpin 3s linear infinite;
  z-index: 1;
}
.splash-logo-ring--2 {
  inset: -14px;
  border-top-color: rgba(167, 139, 250, 0.35);
  border-right-color: rgba(167, 139, 250, 0.1);
  border-left-color: rgba(240, 180, 41, 0.08);
  animation: splashRingSpinReverse 5s linear infinite;
}
@keyframes splashRingSpin {
  to { transform: rotate(360deg); }
}
@keyframes splashRingSpinReverse {
  to { transform: rotate(-360deg); }
}

/* Logo glow backdrop */
.splash-logo::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.12) 0%, rgba(124, 58, 237, 0.06) 50%, transparent 70%);
  z-index: 0;
  animation: splashGlowPulse 4s 1s ease-in-out infinite;
}
@keyframes splashGlowPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.splash-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #fff 0%, #f0b429 50%, #fcd34d 75%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(15px);
  animation: splashTextIn 0.7s 0.8s ease-out forwards, splashTitleShimmer 4s 2s linear infinite;
}
@keyframes splashTitleShimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.splash-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  animation: splashTextIn 0.6s 1.1s ease-out forwards;
}
.splash-slogan {
  font-size: 0.68rem;
  color: rgba(240, 180, 41, 0.55);
  letter-spacing: 0.12em;
  font-weight: 500;
  font-style: italic;
  margin-top: 0.6rem;
  opacity: 0;
  transform: translateY(8px);
  animation: splashTextIn 0.6s 1.3s ease-out forwards;
}

@keyframes splashTextIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Loading section */
.splash-loader {
  margin-top: 2.5rem;
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: splashTextIn 0.5s 1.4s ease-out forwards;
}

.splash-progress-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}
.splash-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-purple), var(--accent-gold));
  background-size: 200% 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
  animation: splashProgressShimmer 2s linear infinite;
}
@keyframes splashProgressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* splash-status removed — clean splash without text */

/* ========================
   RESET & BASE
   ======================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 180, 41, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(99, 102, 241, 0.03), transparent);
}

::selection {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
}

/* ========================
   SCREEN SYSTEM
   ======================== */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Input screen */
.screen-input {
  background: var(--bg-body);
}

/* Results screen — subtle star tile texture */
.screen-results {
  background-image:
    linear-gradient(to bottom, rgba(8, 12, 20, 0.95), rgba(8, 12, 20, 0.92)),
    url('../images/stars-tile.webp');
  background-size: auto, 512px 512px;
  background-repeat: no-repeat, repeat;
}

/* Consultation result screen — consultation background */
.screen-consult-result {
  background-image:
    linear-gradient(to bottom, rgba(8, 12, 20, 0.5) 0%, rgba(8, 12, 20, 0.75) 40%, rgba(8, 12, 20, 0.92) 70%),
    url('../images/consult-bg.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.screen.active {
  display: block;
  animation: screenIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.exit {
  display: block;
  animation: screenOut 0.3s ease forwards;
}

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

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

/* ========================
   HERO SECTION — full-width image blended with bg
   ======================== */
.hero-section {
  position: relative;
  text-align: center;
  height: 80vw;
  max-height: 420px;
  overflow: hidden;
  margin-top: -1rem;
}

/* Hero image — full width, flush to top */
.hero-image-wrap {
  position: absolute;
  inset: 0;
}
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}
/* Smooth fade on all edges — blends seamlessly into dark bg */
.hero-image-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    /* Bottom fade — strongest, transitions to content */
    linear-gradient(to bottom,
      transparent 30%,
      rgba(8, 12, 20, 0.4) 55%,
      rgba(8, 12, 20, 0.88) 78%,
      var(--bg-body) 100%),
    /* Left edge */
    linear-gradient(to right,
      rgba(8, 12, 20, 0.4) 0%,
      transparent 18%),
    /* Right edge */
    linear-gradient(to left,
      rgba(8, 12, 20, 0.4) 0%,
      transparent 18%);
}

/* Title group — positioned at bottom of hero */
.hero-title-group {
  position: absolute;
  bottom: 0.25rem;
  left: 0;
  right: 0;
  z-index: 1;
  text-align: center;
}
.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 0%, #f0b429 40%, #fcd34d 60%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroTitleShimmer 6s linear infinite;
  filter: drop-shadow(0 2px 12px rgba(240, 180, 41, 0.2));
}
@keyframes heroTitleShimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.hero-slogan {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.1em;
  font-weight: 500;
  margin-top: 0.3rem;
}
.hero-tagline {
  font-size: 0.62rem;
  color: rgba(240, 180, 41, 0.45);
  letter-spacing: 0.1em;
  font-weight: 500;
  font-style: italic;
  margin-top: 0.25rem;
}

/* Trust badges */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-gold-light);
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(240, 180, 41, 0.15);
  border-radius: 100px;
  background: rgba(240, 180, 41, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.trust-badge-icon {
  font-size: 0.72rem;
}

/* ========================
   INPUT FORM
   ======================== */
.form-section {
  max-width: 520px;
  margin: 0 auto var(--space-lg);
  padding: 0 0.75rem;
  animation: formSlideUp 1s 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.birth-form {
  background: linear-gradient(170deg,
    rgba(240, 180, 41, 0.04) 0%,
    rgba(11, 15, 25, 0.7) 30%,
    rgba(11, 15, 25, 0.8) 70%,
    rgba(167, 139, 250, 0.03) 100%);
  border: 1px solid rgba(240, 180, 41, 0.18);
  border-radius: var(--radius-lg, 14px);
  padding: 1.1rem 1rem;
  box-shadow:
    0 0 24px rgba(240, 180, 41, 0.05),
    0 4px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(240, 180, 41, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.birth-form::before {
  display: none;
}

/* Form heading */
.form-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  margin-bottom: -0.15rem;
}

/* 2-column row */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.85rem 0.9rem;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(240, 180, 41, 0.22);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  min-height: 50px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.45;
  font-size: 0.85rem;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23f0b429' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Year number input: hide spinner */
.form-group input[type="number"] {
  -moz-appearance: textfield;
}
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(240, 180, 41, 0.5);
  background: rgba(11, 15, 25, 0.9);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.1), 0 0 24px rgba(240, 180, 41, 0.08), 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Submit button — Premium Gold */
.btn-submit {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #1a1e2e 0%, #1f2438 50%, #1a1e2e 100%);
  color: var(--accent-gold);
  border: 1.5px solid rgba(240, 180, 41, 0.35);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  min-height: 48px;
  margin-top: 0.85rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 15px rgba(240, 180, 41, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(240, 180, 41, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.btn-submit-glow { display: none; }

.btn-submit-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-submit-icon {
  font-size: 1.05rem;
  filter: drop-shadow(0 0 6px rgba(240, 180, 41, 0.4));
}

.btn-submit-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Subtle shimmer */
.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 41, 0.08), rgba(240, 180, 41, 0.15), rgba(240, 180, 41, 0.08), transparent);
  animation: submitShimmer 4s ease-in-out infinite;
  z-index: 0;
}

@keyframes submitShimmer {
  0% { left: -100%; }
  50% { left: 120%; }
  100% { left: 120%; }
}

/* Bottom accent line */
.btn-submit::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 41, 0.3), transparent);
  z-index: 1;
}

.btn-submit:active {
  transform: scale(0.97);
  border-color: rgba(240, 180, 41, 0.5);
  box-shadow: 0 0 20px rgba(240, 180, 41, 0.15), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.btn-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-submit:disabled::before {
  display: none;
}

/* Disclaimer under button */
/* ========================
   QUOTES MARQUEE
   ======================== */
/* Wisdom quote — single line, elegant */
.hero-quote {
  text-align: center;
  padding: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  min-height: 4.5rem;
}
.hero-quote-mark {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent-gold);
  opacity: 0.3;
  font-family: Georgia, serif;
  vertical-align: top;
  margin-right: 0.15rem;
}
.hero-quote-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.hero-quote-source {
  display: block;
  font-size: 0.65rem;
  color: rgba(240, 180, 41, 0.45);
  font-weight: 500;
  margin-top: 0.3rem;
  letter-spacing: 0.05em;
}
/* Fade transition when quote changes */
.hero-quote.fade-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hero-quote.fade-in {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.form-disclaimer {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.6;
  margin-top: 0.1rem;
  line-height: 1.4;
}

/* ========================
   HOME ABOUT SECTION (inline, scroll to see)
   ======================== */
.home-about-section {
  max-width: 520px;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
}
.home-about-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.home-about-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 41, 0.2), transparent);
}
.home-about-divider-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.home-about-card {
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.home-about-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}
.home-about-card p + p {
  margin-top: 0.5rem;
}
.home-about-card strong {
  color: var(--accent-gold-light);
  font-weight: 600;
}
.home-about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.home-about-feature {
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  text-align: center;
}
.home-about-feature-icon {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  color: var(--accent-gold);
  opacity: 0.7;
}
.home-about-feature strong {
  display: block;
  font-size: 0.75rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.home-about-feature p {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}
.home-about-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(240, 180, 41, 0.03);
  border: 1px solid rgba(240, 180, 41, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.home-about-note-icon {
  font-size: 0.9rem;
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.home-about-note p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.home-about-note strong {
  color: var(--accent-gold-light);
}
/* Credibility & Ancient Origins section */
.home-about-credibility {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}
.home-about-credibility-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.6rem;
  letter-spacing: 0.02em;
}
.home-about-credibility > p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 0.8rem;
}
.home-about-credibility > p strong {
  color: var(--accent-gold-light);
}
.home-about-credibility-points {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.credibility-point {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.credibility-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  margin-top: 0.1rem;
}
.credibility-point strong {
  display: block;
  font-size: 0.74rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.credibility-point p {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}
.credibility-point em {
  color: var(--accent-gold);
  font-style: normal;
}

.home-about-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.7rem;
  background: rgba(240, 180, 41, 0.05);
  border: 1px solid rgba(240, 180, 41, 0.12);
  border-radius: var(--radius-md);
  color: var(--accent-gold);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.home-about-more:hover {
  background: rgba(240, 180, 41, 0.08);
  border-color: rgba(240, 180, 41, 0.2);
}
.home-about-more span {
  font-size: 1.1rem;
  font-weight: 800;
}

/* ========================
   LOADING STATE
   ======================== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  justify-content: flex-end;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
}

/* Background image layer with zoom animation */
.loading-overlay::before {
  content: '';
  position: absolute;
  inset: -10%;
  background: url('../images/loading-chart.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: loadingBgZoom 8s ease-in-out infinite;
  z-index: -2;
}

/* Dark vignette overlay */
.loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 45%, rgba(8, 12, 20, 0.25) 0%, rgba(8, 12, 20, 0.75) 100%),
    linear-gradient(to bottom, rgba(8, 12, 20, 0.1) 0%, rgba(8, 12, 20, 0.7) 70%, rgba(8, 12, 20, 0.92) 100%);
  z-index: -1;
}

@keyframes loadingBgZoom {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.loading-overlay.active {
  display: flex;
}

/* Loading content — positioned at bottom */
.loading-content {
  width: 100%;
  padding: 0 2rem 20vh;
  text-align: center;
  z-index: 1;
  animation: loadContentIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.loading-text {
  color: var(--accent-gold-light);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 12px rgba(240, 180, 41, 0.3), 0 1px 3px rgba(0, 0, 0, 0.6);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.25rem;
}

/* Progress bar */
.loading-progress {
  width: 200px;
  max-width: 60%;
  height: 3px;
  background: rgba(240, 180, 41, 0.12);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
  border-radius: 4px;
  transition: width 0.35s ease;
  box-shadow: 0 0 8px rgba(240, 180, 41, 0.4);
}

@keyframes loadIconPulse {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

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

/* ========================
   RESULTS TOPBAR
   ======================== */
.results-topbar {
  position: sticky;
  top: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: rgba(8, 12, 20, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 52px;
}

.results-back-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s ease;
}

.results-back-btn:active {
  transform: scale(0.96);
  background: rgba(255,255,255,0.08);
}

.back-arrow {
  font-size: 1.125rem;
}

.results-person-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================
   SUMMARY SECTION
   ======================== */
.summary-section {
  display: none;
  max-width: 900px;
  margin: 0 auto var(--space-xl);
  padding: 0 var(--space-md);
}

.summary-section.active {
  display: block;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 41, 0.4), transparent);
}

/* Summary Header */
.summary-header {
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.08), rgba(240, 180, 41, 0.02));
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.summary-header h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-header h2::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: var(--accent-gold);
  border-radius: 2px;
  flex-shrink: 0;
}

.summary-header .summary-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.summary-info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.info-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.info-chip .chip-label {
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.info-chip .chip-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9375rem;
}

.info-chip.highlight {
  border-color: rgba(240, 180, 41, 0.25);
  background: rgba(240, 180, 41, 0.06);
}

.info-chip.highlight .chip-value {
  color: var(--accent-gold);
}

.summary-cuc-desc {
  margin-top: var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 0.875rem var(--space-md);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-gold-dim);
}

/* ======================== */
/* Overview Card V2         */
/* ======================== */
.overview-card-v2 {
  overflow: hidden;
}

/* --- Header: Birth Info --- */
.ov2-header {
  text-align: center;
  padding: 1.75rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ov2-header-icon {
  font-size: 2.25rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}
.ov2-header-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.35rem;
}
.ov2-header-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ov2-dot {
  opacity: 0.4;
}
.ov2-header-lunar {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-style: italic;
}

/* --- Attributes Grid --- */
.ov2-attrs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.ov2-attr {
  background: var(--bg-card);
  padding: 0.875rem 0.5rem;
  text-align: center;
}
.ov2-attr.highlight {
  background: rgba(240, 180, 41, 0.04);
}
.ov2-attr-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.ov2-attr-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.ov2-attr.highlight .ov2-attr-value {
  color: var(--accent-gold);
}
.ov2-attr-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* --- Interpretations --- */
.ov2-interp {
  padding: 1rem 1.25rem 1.25rem;
}
.ov2-interp-item {
  padding: 0.75rem 0;
}
.ov2-interp-item + .ov2-interp-item {
  border-top: 1px solid var(--border-subtle);
}
.ov2-interp-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.35rem;
}
.ov2-interp-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Summary body */
.summary-body {
  padding: var(--space-lg);
}

.summary-aspect {
  margin-bottom: var(--space-lg);
}

.summary-aspect:last-child {
  margin-bottom: 0;
}

.aspect-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.aspect-icon {
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.aspect-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.aspect-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.aspect-stars .mini-star {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.mini-star.good {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: rgba(74, 222, 128, 0.15);
}
.mini-star.bad {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: rgba(248, 113, 113, 0.15);
}
.mini-star.neutral {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-color: rgba(96, 165, 250, 0.15);
}
.mini-star.adj {
  font-size: 0.65rem;
  padding: 2px 6px;
  opacity: 0.7;
}

.aspect-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.aspect-divider {
  display: none;
}

/* Chart toggle button */
.chart-toggle {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.btn-toggle-chart {
  padding: 0.6875rem 1.75rem;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px;
  font-family: inherit;
}

.btn-toggle-chart.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

/* ========================
   CHART CONTAINER
   ======================== */
.chart-section {
  display: none;
  max-width: 1200px;
  margin: 0 auto var(--space-xl);
  padding: 0 var(--space-md);
}

.chart-section.active {
  display: block;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* ========================
   CHART GRID (4x4)
   ======================== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, minmax(140px, auto));
  gap: 1px;
  background: rgba(240, 180, 41, 0.08);
  border: 1px solid rgba(240, 180, 41, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.3);
  min-width: 600px;
}

/* ========================
   PALACE CELL
   ======================== */
.palace-cell {
  background: var(--bg-card);
  padding: 0.625rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.palace-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background var(--transition);
  pointer-events: none;
}

.palace-cell.active::after {
  background: rgba(240, 180, 41, 0.06);
  box-shadow: inset 0 0 0 2px var(--accent-gold);
}

.palace-cell.is-soul-palace {
  background: linear-gradient(160deg, rgba(240, 180, 41, 0.07), var(--bg-card));
}

.palace-cell.is-body-palace::before {
  content: 'Thân';
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.6875rem;
  background: var(--accent-purple);
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  z-index: 3;
}

.palace-cell.is-original-palace::before {
  content: 'Lai Nhân';
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.6875rem;
  background: var(--accent-teal);
  color: #0f1520;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  z-index: 3;
}

/* Palace header */
.palace-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.375rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-subtle);
}

.palace-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.02em;
}

.palace-branch {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Stars in palace */
.palace-major-stars {
  margin-bottom: 0.25rem;
}

.star-tag {
  display: inline-block;
  font-size: 0.8125rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin: 2px 2px 2px 0;
  font-weight: 600;
  line-height: 1.5;
}

.star-tag.major {
  font-size: 0.875rem;
  font-weight: 700;
}

.star-tag.category-good { color: var(--accent-green); }
.star-tag.category-bad { color: var(--accent-red); }
.star-tag.category-neutral { color: var(--accent-blue); }
.star-tag.category-unknown { color: var(--text-secondary); }

/* Brightness indicator */
.star-brightness {
  font-size: 0.625rem;
  vertical-align: super;
  opacity: 0.8;
  margin-left: 1px;
}

/* Mutagen indicator */
.star-mutagen {
  font-size: 0.6875rem;
  font-weight: 700;
  margin-left: 2px;
  padding: 0 3px;
  border-radius: 2px;
}

.mutagen-禄 { color: var(--accent-green); }
.mutagen-权 { color: var(--accent-gold); }
.mutagen-科 { color: var(--accent-blue); }
.mutagen-忌 { color: var(--accent-red); }

.palace-minor-stars {
  margin-top: auto;
}

.palace-minor-stars .star-tag {
  font-size: 0.6875rem;
  opacity: 0.75;
}

/* Adjective stars (Tạp diệu) */
.palace-adj-stars {
  margin-top: 2px;
}

.palace-adj-stars .star-tag {
  font-size: 0.6rem;
  opacity: 0.6;
  padding: 0 3px;
  border-radius: 2px;
}

/* Trường Sinh + Bác Sĩ on chart */
.palace-extra-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

.star-tag-extra {
  font-size: 0.575rem;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(167, 139, 250, 0.08);
  color: var(--accent-purple);
  opacity: 0.55;
  line-height: 1.4;
}

/* Stage */
.palace-stage {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  padding-top: 0.2rem;
  border-top: 1px dashed var(--border-subtle);
}

/* ========================
   CENTER INFO
   ======================== */
.center-info {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  background: linear-gradient(160deg, rgba(240, 180, 41, 0.04), var(--bg-card));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-md);
  cursor: default;
  text-align: center;
}

.center-info:hover::after {
  background: transparent !important;
}

.center-title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
  position: relative;
}

.center-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.center-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  width: 100%;
  max-width: 300px;
}

.center-info-grid .info-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.center-info-grid .info-value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
}

.center-info-grid .info-value.highlight {
  color: var(--accent-gold);
  font-weight: 700;
}

/* ========================
   DETAIL PANEL (Full-screen on mobile)
   ======================== */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 900;
  animation: fadeIn 0.2s ease;
}

.detail-overlay.active {
  display: block;
}

.detail-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-card);
  border-left: none;
  z-index: 910;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.detail-panel.active {
  right: 0;
}

.detail-close {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1;
  min-height: 56px;
}

.detail-close h2 {
  font-size: 1.125rem;
  color: var(--accent-gold);
  font-weight: 700;
}

.btn-close {
  background: none;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-close:active {
  background: rgba(248, 113, 113, 0.1);
  color: var(--accent-red);
  border-color: rgba(248, 113, 113, 0.3);
}

.detail-body {
  padding: var(--space-lg);
}

/* Palace description in detail */
.detail-palace-desc {
  margin-bottom: var(--space-xl);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.detail-palace-desc .palace-icon {
  font-size: 1.375rem;
  margin-bottom: 0.375rem;
  display: block;
}

/* Star detail card */
.star-detail-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: 0.75rem;
  transition: all var(--transition);
}

.star-detail-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.star-detail-name {
  font-weight: 700;
  font-size: 1.0625rem;
}

.star-detail-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-good { background: var(--accent-green-dim); color: var(--accent-green); }
.badge-bad { background: var(--accent-red-dim); color: var(--accent-red); }
.badge-neutral { background: var(--accent-blue-dim); color: var(--accent-blue); }

.star-detail-short {
  font-size: 0.9375rem;
  color: var(--accent-gold-light);
  margin-bottom: 0.5rem;
  font-style: italic;
  opacity: 0.9;
}

.star-detail-meaning {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.star-detail-brightness {
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border-medium);
  line-height: 1.7;
}

.star-detail-mutagen {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  line-height: 1.7;
}

/* Section headers in detail panel */
.detail-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: var(--space-xl) 0 0.875rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-section-title::before {
  content: '';
  width: 3px;
  height: 0.8em;
  background: var(--accent-gold);
  border-radius: 1px;
}

.detail-section-title:first-of-type {
  margin-top: 0;
}

/* Stage info in detail */
.detail-stage {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.875rem var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.detail-stage strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ========================
   CONSULTATION SECTION — Premium Redesign
   ======================== */
.consult-ai-section .step-card-body { padding: 0; }
.consult-pdf-section .step-card-body { padding: 0; }
.consult-inner {
  padding: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(124, 58, 237, 0.03) 50%, transparent 100%);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Compact consult layout */
.consult-compact {
  padding: 16px 14px 14px;
}
.consult-compact-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.consult-compact-icon {
  font-size: 1.4rem;
  color: var(--accent-purple);
  flex-shrink: 0;
}
.consult-compact-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.consult-compact-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.consult-topics-compact {
  margin-bottom: 12px;
}
.consult-topics-compact .consult-section-label {
  margin-bottom: 8px;
}
.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.topic-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.topic-chip.active {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.3);
  color: var(--text-primary);
}
.topic-chip:hover {
  border-color: rgba(124, 58, 237, 0.4);
}

/* Hero banner — taller, more immersive */
.consult-hero-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.consult-hero-banner img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  filter: brightness(0.8) saturate(1.1);
}
.consult-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(
    to bottom,
    rgba(8, 12, 20, 0.15) 0%,
    rgba(8, 12, 20, 0.45) 50%,
    rgba(15, 19, 32, 0.95) 100%
  );
}
.consult-hero-badge {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 3px 14px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.15), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(240, 180, 41, 0.25);
  color: rgba(240, 180, 41, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.consult-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 58, 237, 0.2);
  letter-spacing: 0.04em;
}
.consult-hero-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Body section with padding */
.consult-body {
  padding: 0.25rem 0 0;
}

/* Section labels */
.consult-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1rem 1.25rem 0.6rem;
}
.consult-topic-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: -0.3rem 1.25rem 0.6rem;
  font-style: italic;
  opacity: 0.8;
}
.consult-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
}

/* Topic Grid — 2 columns, themed premium cards */
.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0 1rem;
  margin-bottom: 0.25rem;
}

.topic-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  min-height: 50px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  overflow: hidden;
}

.topic-icon-symbol {
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.08);
  color: rgba(167, 139, 250, 0.7);
  flex-shrink: 0;
  transition: all 0.25s;
}

.topic-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.topic-card .topic-name {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topic-hint {
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  opacity: 0.65;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Per-topic theme colors */
.topic-love .topic-icon-symbol { background: rgba(232, 127, 160, 0.1); color: #e87fa0; }
.topic-career .topic-icon-symbol { background: rgba(74, 158, 255, 0.1); color: #4a9eff; }
.topic-finance .topic-icon-symbol { background: rgba(240, 180, 41, 0.1); color: #f0b429; }
.topic-health .topic-icon-symbol { background: rgba(239, 108, 94, 0.1); color: #ef6c5e; }
.topic-spiritual .topic-icon-symbol { background: rgba(167, 139, 250, 0.1); color: #a78bfa; }
.topic-fortune .topic-icon-symbol { background: rgba(251, 146, 60, 0.1); color: #fb923c; }
.topic-education .topic-icon-symbol { background: rgba(52, 211, 153, 0.1); color: #34d399; }
.topic-general .topic-icon-symbol { background: rgba(167, 139, 250, 0.12); color: #c4b5fd; }
.topic-children .topic-icon-symbol { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
.topic-family .topic-icon-symbol { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.topic-people .topic-icon-symbol { background: rgba(20, 184, 166, 0.1); color: #14b8a6; }
.topic-property .topic-icon-symbol { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

/* Active state — uses per-topic colors */
.topic-card.active {
  background: rgba(167, 139, 250, 0.05);
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.08);
}
.topic-love.active { background: rgba(232, 127, 160, 0.06); border-color: rgba(232, 127, 160, 0.3); box-shadow: 0 0 16px rgba(232, 127, 160, 0.08); }
.topic-career.active { background: rgba(74, 158, 255, 0.06); border-color: rgba(74, 158, 255, 0.3); box-shadow: 0 0 16px rgba(74, 158, 255, 0.08); }
.topic-finance.active { background: rgba(240, 180, 41, 0.06); border-color: rgba(240, 180, 41, 0.3); box-shadow: 0 0 16px rgba(240, 180, 41, 0.08); }
.topic-health.active { background: rgba(239, 108, 94, 0.06); border-color: rgba(239, 108, 94, 0.3); box-shadow: 0 0 16px rgba(239, 108, 94, 0.08); }
.topic-spiritual.active { background: rgba(167, 139, 250, 0.06); border-color: rgba(167, 139, 250, 0.3); box-shadow: 0 0 16px rgba(167, 139, 250, 0.08); }
.topic-fortune.active { background: rgba(251, 146, 60, 0.06); border-color: rgba(251, 146, 60, 0.3); box-shadow: 0 0 16px rgba(251, 146, 60, 0.08); }
.topic-education.active { background: rgba(52, 211, 153, 0.06); border-color: rgba(52, 211, 153, 0.3); box-shadow: 0 0 16px rgba(52, 211, 153, 0.08); }
.topic-general.active { background: rgba(167, 139, 250, 0.07); border-color: rgba(196, 181, 253, 0.35); box-shadow: 0 0 16px rgba(167, 139, 250, 0.1); }
.topic-children.active { background: rgba(251, 191, 36, 0.06); border-color: rgba(251, 191, 36, 0.3); box-shadow: 0 0 16px rgba(251, 191, 36, 0.08); }
.topic-family.active { background: rgba(139, 92, 246, 0.06); border-color: rgba(139, 92, 246, 0.3); box-shadow: 0 0 16px rgba(139, 92, 246, 0.08); }
.topic-people.active { background: rgba(20, 184, 166, 0.06); border-color: rgba(20, 184, 166, 0.3); box-shadow: 0 0 16px rgba(20, 184, 166, 0.08); }
.topic-property.active { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.3); box-shadow: 0 0 16px rgba(59, 130, 246, 0.08); }

.topic-card.active .topic-icon-symbol {
  transform: scale(1.08);
  box-shadow: 0 0 10px currentColor;
}
.topic-card.active .topic-name {
  color: #fff;
}
.topic-card.active .topic-hint {
  opacity: 0.85;
}
.topic-card.active::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.topic-card:active {
  transform: scale(0.97);
}

/* Question textarea */
.consult-question-group {
  padding: 0 1rem;
  margin-bottom: 1rem;
}
.consult-question-group textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
.consult-question-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
.consult-question-group textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.08);
}
.consult-question-group textarea {
  max-height: 80px;
}
.consult-question-counter {
  text-align: right;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 0.25rem;
  padding-right: 0.25rem;
}

/* ======================== */
/* Button Luận Giải V2      */
/* ======================== */
.btn-consult-v2 {
  width: calc(100% - 2rem);
  margin: 0.5rem 1rem 1.25rem;
  padding: 0.875rem 1.5rem;
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid rgba(167, 139, 250, 0.35);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  letter-spacing: 0.03em;
  -webkit-tap-highlight-color: transparent;
}
.btn-consult-v2:hover {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.06);
}
.btn-consult-v2:active {
  transform: scale(0.98);
}
.btn-cv2-text {
  font-weight: 600;
}
.btn-cv2-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}
.btn-consult-v2:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-consult-v2.loading {
  opacity: 0.6;
  pointer-events: none;
}
.btn-consult-v2.loading .btn-cv2-text::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(167, 139, 250, 0.3);
  border-top-color: rgba(167, 139, 250, 0.8);
  border-radius: 50%;
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======================== */
/* Premium PDF Compare      */
/* ======================== */
/* Comparison: side-by-side cards */
.premium-compare-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px;
}
.compare-card {
  border-radius: var(--radius-sm);
  padding: 12px 10px;
}
.compare-card--basic {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.compare-card--premium {
  background: rgba(212, 175, 55, 0.06);
  border: 1.5px solid rgba(212, 175, 55, 0.2);
}
.compare-card-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare-card--premium .compare-card-header {
  color: var(--accent-gold);
  border-bottom-color: rgba(212, 175, 55, 0.15);
}
.compare-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.compare-card-list li {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.35;
  padding-left: 14px;
  position: relative;
  opacity: 0.7;
}
.compare-card--basic .compare-card-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.compare-card--premium .compare-card-list li {
  opacity: 1;
}
.compare-card--premium .compare-card-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-gold);
  font-size: 0.6rem;
}
.compare-card--premium .compare-card-list li.new {
  color: var(--accent-gold);
  font-weight: 600;
}
.compare-card--premium .compare-card-list li.new::before {
  content: '★';
  font-size: 0.55rem;
}

/* Submit button — premium gradient with glow */
/* Consult button — Premium Purple (legacy) */
.btn-consult {
  width: calc(100% - 2rem);
  margin: 0 1rem 1.25rem;
  padding: 1rem 1.25rem;
  min-height: 56px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 30%, #6d28d9 70%, #5b21b6 100%);
  color: white;
  border: 2px solid rgba(167, 139, 250, 0.5);
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(139, 92, 246, 0.35),
    0 0 40px rgba(124, 58, 237, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: consultGlow 3s ease-in-out infinite;
  letter-spacing: 0.04em;
}

@keyframes consultGlow {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(139, 92, 246, 0.35),
      0 0 40px rgba(124, 58, 237, 0.15),
      0 4px 16px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
  50% {
    box-shadow:
      0 0 30px rgba(139, 92, 246, 0.5),
      0 0 60px rgba(124, 58, 237, 0.25),
      0 6px 24px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

.btn-consult-glow {
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: conic-gradient(from 0deg, transparent, rgba(167, 139, 250, 0.5), transparent, rgba(139, 92, 246, 0.5), transparent);
  animation: consultBorderSpin 4s linear infinite;
  opacity: 0.5;
  z-index: 0;
}

@keyframes consultBorderSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-consult-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-consult-icon {
  font-size: 1.2rem;
  animation: consultIconPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.8));
}

@keyframes consultIconPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* Shimmer sweep */
.btn-consult::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.2), transparent);
  animation: consultShimmer 3.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes consultShimmer {
  0% { left: -100%; }
  50% { left: 120%; }
  100% { left: 120%; }
}

/* Top edge highlight */
.btn-consult::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  z-index: 1;
}

.btn-consult-text {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 700;
}

.btn-consult-arrow {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: transform 0.3s, opacity 0.3s;
  animation: consultArrowBounce 2s ease-in-out infinite;
}

@keyframes consultArrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.btn-consult:hover .btn-consult-arrow { transform: translateX(5px); opacity: 1; }
.btn-consult:active { transform: scale(0.97); }
.btn-consult:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}
.btn-consult.loading {
  opacity: 0.7;
  animation: consultPulseLoading 1.5s ease-in-out infinite;
}
@keyframes consultPulseLoading {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}
.btn-consult:disabled .btn-consult-glow,
.btn-consult:disabled::before {
  display: none;
  animation: none;
}

/* ========================
   CONSULTATION LOADING STATE
   ======================== */
/* ========================
   CONSULTATION LOADING — FULL-PAGE OVERLAY
   ======================== */
.consult-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background:
    radial-gradient(ellipse at center, rgba(8, 12, 20, 0.5) 0%, rgba(8, 12, 20, 0.78) 100%),
    url('../images/loading-ai.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}
.consult-loading-overlay.active { display: flex; }

/* Ambient glow */
.consult-loading-overlay::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, transparent 70%);
  animation: consultAmbient 4s ease-in-out infinite alternate;
}
.consult-loading-overlay::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.06) 0%, transparent 70%);
  animation: consultAmbient 5s ease-in-out 1s infinite alternate-reverse;
}
@keyframes consultAmbient {
  from { transform: scale(1) translate(0, 0); opacity: 0.5; }
  to { transform: scale(1.4) translate(20px, -20px); opacity: 1; }
}

/* Spinning ring */
.consult-loading-visual {
  position: relative;
  width: 88px;
  height: 88px;
  margin-bottom: 1.75rem;
  z-index: 1;
}
.consult-loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(167, 139, 250, 0.12);
  border-top-color: var(--accent-purple);
  border-right-color: rgba(167, 139, 250, 0.4);
  animation: consultSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.consult-loading-ring-inner {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.06);
  border-bottom-color: rgba(167, 139, 250, 0.35);
  animation: consultSpin 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}
.consult-loading-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  animation: consultPulse 2s ease-in-out infinite;
}

@keyframes consultSpin { to { transform: rotate(360deg); } }
@keyframes consultPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* Loading text */
.consult-loading-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 0.4rem;
  min-height: 1.4em;
  transition: opacity 0.3s;
  z-index: 1;
}
.consult-loading-text.fade { opacity: 0; }

.consult-loading-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 1.2em;
  transition: opacity 0.3s;
  z-index: 1;
}
.consult-loading-sub.fade { opacity: 0; }

/* Progress bar */
.consult-loading-progress {
  width: 100%;
  max-width: 260px;
  height: 3px;
  background: rgba(167, 139, 250, 0.1);
  border-radius: 100px;
  margin-top: 1.75rem;
  overflow: hidden;
  z-index: 1;
}
.consult-loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-purple), #818cf8, var(--accent-purple));
  background-size: 200% 100%;
  border-radius: 100px;
  transition: width 0.6s ease;
  animation: barShimmer 2s linear infinite;
}
@keyframes barShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ========================
   CONSULTATION RESULT — DEDICATED FULL-PAGE SCREEN
   ======================== */
.screen-consult-result {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg-body);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ambient background glow */
.screen-consult-result::before {
  content: '';
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Top bar */
.consult-result-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.08);
}

.consult-result-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--accent-purple);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.consult-result-back:active {
  background: var(--accent-purple-dim);
}

/* Page layout */
.consult-result-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 5rem;
  position: relative;
  z-index: 1;
}

/* Hero header — compact inline */
.consult-result-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.1rem 0 0.9rem;
  position: relative;
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
  margin-bottom: 0;
}

.consult-result-hero::after {
  display: none;
}

.consult-result-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 50%;
  animation: consultPulse 3s ease-in-out infinite;
}

.consult-result-title {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.consult-result-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Content body */
.consult-result-body {
  padding: 1rem 0 0.5rem;
  animation: resultContentReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

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

/* Streaming cursor animation */
.ai-streaming-cursor {
  display: inline-block;
  color: var(--accent-gold);
  font-weight: bold;
  animation: cursorBlink 0.7s ease-in-out infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* Typing indicator bar — shown during streaming */
.ai-typing-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  margin: 0 16px 12px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: var(--radius-sm);
  animation: typingFadeIn 0.4s ease;
}
.ai-typing-indicator.active { display: flex; }

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

.ai-typing-icon {
  font-size: 1.1rem;
  animation: typingIconPulse 2s ease-in-out infinite;
}
@keyframes typingIconPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.ai-typing-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-purple);
}

.ai-typing-dots {
  display: flex;
  gap: 2px;
}
.ai-typing-dots span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-purple);
  animation: typingDot 1.4s ease-in-out infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Footer actions */
/* ===== PREMIUM UPSELL CTA SECTION ===== */
.premium-upsell {
  position: relative;
  margin: 2.5rem 0 1.5rem;
  padding: 1.75rem 1.25rem 1.5rem;
  background: linear-gradient(165deg, rgba(212, 175, 55, 0.06) 0%, rgba(167, 139, 250, 0.04) 40%, rgba(212, 175, 55, 0.03) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.2);
  border-radius: 16px;
  overflow: hidden;
  animation: premiumReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes premiumReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.premium-upsell-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.06) 0%, transparent 60%);
  pointer-events: none;
  animation: premiumGlowPulse 4s ease-in-out infinite;
}
@keyframes premiumGlowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Header */
.premium-upsell-header {
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}
.premium-upsell-badge {
  display: inline-block;
  padding: 3px 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 100px;
  color: var(--accent-gold);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}
.premium-upsell-title {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), #fcd34d, var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}
.premium-upsell-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

/* Benefits list */
.premium-upsell-benefits {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(212, 175, 55, 0.08);
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}
.premium-benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.premium-benefit-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.12);
  border-radius: 50%;
  font-size: 0.55rem;
  color: var(--accent-gold);
  margin-top: 1px;
}

/* Price section */
.premium-upsell-price {
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}
.premium-price-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.premium-price-original {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.7;
}
.premium-price-discount {
  display: inline-block;
  padding: 1px 6px;
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.premium-price-current {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
}
.premium-price-amount {
  font-size: 1.65rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-gold), #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.premium-price-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.premium-price-compare {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-style: italic;
  opacity: 0.8;
}

/* Email input section */
.premium-email-section {
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.premium-email-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.premium-email-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.premium-email-input {
  width: 100%;
  padding: 0.7rem 0.85rem 0.7rem 2.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(212, 175, 55, 0.15);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.premium-email-input:focus {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}
.premium-email-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
.premium-email-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}
.premium-email-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  opacity: 0.7;
}
.premium-email-hint.error {
  color: #f87171;
  opacity: 1;
}

/* Preview Sample Button — Featured */
.btn-premium-preview-featured {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(212,175,55,0.12) 0%, rgba(212,175,55,0.06) 100%);
  color: #d4af37;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 12px;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.btn-premium-preview-featured::before {
  content: '';
  position: absolute;
  top: -1px; right: -1px; bottom: -1px; left: -1px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212,175,55,0.3), transparent 50%, rgba(212,175,55,0.2));
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.btn-premium-preview-featured:hover::before { opacity: 1; }
.btn-premium-preview-featured:hover {
  border-color: rgba(212, 175, 55, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}
.btn-premium-preview-featured:active { transform: scale(0.98); }
.preview-featured-icon {
  font-size: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(212,175,55,0.4));
}
.preview-featured-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.preview-featured-text strong {
  font-size: 0.95rem;
  color: #e8c84a;
}
.preview-featured-text small {
  font-size: 0.78rem;
  color: rgba(212,175,55,0.7);
  font-weight: 400;
}
.preview-featured-arrow {
  font-size: 22px;
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.btn-premium-preview-featured:hover .preview-featured-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* PDF Preview Dialog */
.pdf-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: fadeIn 0.2s ease;
}
.pdf-preview-modal {
  width: 100%;
  max-width: 800px;
  height: 90vh;
  max-height: 90vh;
  background: #1a1a2e;
  border-radius: 14px;
  border: 1px solid rgba(212,175,55,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.pdf-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #2a1f0a 0%, #1a1530 100%);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  flex-shrink: 0;
}
.pdf-preview-title {
  color: #e8c84a;
  font-size: 0.95rem;
  font-weight: 600;
}
.pdf-preview-close {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.pdf-preview-close:hover { color: #fff; }
.pdf-preview-body {
  flex: 1;
  position: relative;
  overflow: auto;
  background: #2a2a2a;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}
.pdf-preview-body canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.pdf-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #aaa;
  font-size: 0.9rem;
  z-index: 2;
  background: #2a2a2a;
}
.pdf-preview-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.pdf-preview-limit {
  text-align: center;
  padding: 12px 16px;
  font-size: 0.75rem;
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.08);
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.pdf-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #141425;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  gap: 12px;
}
.pdf-preview-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pdf-nav-btn {
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.4);
  color: #d4af37;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.pdf-nav-btn:hover { background: rgba(212,175,55,0.3); }
.pdf-nav-btn:disabled { opacity: 0.3; cursor: default; }
.pdf-page-info {
  color: #ccc;
  font-size: 0.85rem;
  min-width: 50px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pdf-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdf-preview-download {
  color: #d4af37;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 8px;
  transition: all 0.2s;
}
.pdf-preview-download:hover {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.7);
}
.pdf-preview-close-btn {
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.pdf-preview-close-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Back Warning Dialog */
.back-warning-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.back-warning-modal {
  background: #1a1a2e;
  border: 1px solid rgba(255,180,0,0.3);
  border-radius: 16px;
  padding: 28px 24px 22px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}
.back-warning-icon {
  font-size: 40px;
  margin-bottom: 10px;
}
.back-warning-title {
  color: #fbbf24;
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.back-warning-text {
  color: #a0a0b0;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 20px;
}
.back-warning-actions {
  display: flex;
  gap: 10px;
}
.back-warning-btn {
  flex: 1;
  padding: 11px 10px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.back-warning-btn.stay {
  background: linear-gradient(135deg, #d4af37, #f0b429);
  color: #1a1a00;
}
.back-warning-btn.stay:hover {
  box-shadow: 0 4px 15px rgba(212,175,55,0.4);
  transform: translateY(-1px);
}
.back-warning-btn.leave {
  background: rgba(255,255,255,0.08);
  color: #999;
  border: 1px solid rgba(255,255,255,0.12);
}
.back-warning-btn.leave:hover {
  background: rgba(255,255,255,0.15);
  color: #ccc;
}

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

/* CTA Button */
.btn-premium-cta {
  width: 100%;
  padding: 0.95rem 1.25rem;
  min-height: 52px;
  background: linear-gradient(135deg, #d4af37 0%, #f0b429 30%, #d4af37 60%, #c49b2a 100%);
  color: #0a0e1a;
  border: 2px solid rgba(252, 211, 77, 0.5);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(212, 175, 55, 0.3),
    0 0 40px rgba(212, 175, 55, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.3);
  animation: premiumBtnGlow 3s ease-in-out infinite;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  z-index: 1;
}
@keyframes premiumBtnGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3), 0 0 40px rgba(212, 175, 55, 0.1), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5), 0 0 60px rgba(212, 175, 55, 0.2), 0 6px 24px rgba(0, 0, 0, 0.3);
  }
}
.btn-premium-glow {
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: conic-gradient(from 0deg, transparent, rgba(252, 211, 77, 0.4), transparent, rgba(212, 175, 55, 0.4), transparent);
  animation: consultBorderSpin 4s linear infinite;
  opacity: 0.4;
  z-index: 0;
}
.btn-premium-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-premium-icon {
  font-size: 1.15rem;
  animation: consultIconPulse 2s ease-in-out infinite;
}
.btn-premium-text {
  font-size: 1rem;
  font-weight: 800;
}
.btn-premium-arrow {
  font-size: 1.2rem;
  opacity: 0.7;
  animation: consultArrowBounce 2s ease-in-out infinite;
}
.btn-premium-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), rgba(255,255,255,0.4), rgba(255,255,255,0.25), transparent);
  animation: consultShimmer 3.5s ease-in-out infinite;
  z-index: 1;
}
.btn-premium-cta:active {
  transform: scale(0.97);
}
.btn-premium-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}
.btn-premium-cta:disabled .btn-premium-glow,
.btn-premium-cta:disabled::before {
  display: none;
}
.btn-premium-cta.loading .btn-premium-text::after {
  content: '...';
  animation: typingDot 1.4s ease-in-out infinite;
}

/* Trust signals */
.premium-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  position: relative;
  z-index: 1;
}
.premium-trust-item {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
  white-space: nowrap;
}
.premium-trust-sep {
  color: var(--text-muted);
  opacity: 0.3;
  font-size: 0.5rem;
}

.consult-result-actions {
  padding: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: resultContentReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}

.btn-consult-again {
  width: 100%;
  padding: 0.95rem;
  min-height: 50px;
  background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.2);
  letter-spacing: 0.01em;
}
.btn-consult-again:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-consult-back-secondary {
  width: 100%;
  padding: 0.8rem;
  min-height: 46px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-consult-back-secondary:active {
  background: rgba(255,255,255,0.05);
  border-color: var(--accent-purple-dim);
}

/* Topbar action buttons group */
.consult-result-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Save image button */
.btn-save-image {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  font-weight: 500;
  min-height: 34px;
  -webkit-tap-highlight-color: transparent;
}

.btn-save-image:active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(240, 180, 41, 0.08);
}

/* Copy button in topbar */
.btn-copy-result {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  font-weight: 500;
  min-height: 34px;
  -webkit-tap-highlight-color: transparent;
}

.btn-copy-result:active {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: var(--accent-purple-dim);
}

/* --- AI Result Content Typography --- */
.ai-result-content {
  font-size: 1.02rem;
  line-height: 1.95;
  color: var(--text-primary);
}

.ai-result-content h1,
.ai-result-content h2 {
  color: var(--accent-gold);
  margin: 2.2rem 0 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.6rem 0.85rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.06), rgba(167, 139, 250, 0.04));
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  letter-spacing: -0.01em;
}

.ai-result-content h3 {
  color: var(--accent-purple);
  margin: 1.75rem 0 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  padding-left: 0.75rem;
  position: relative;
}

.ai-result-content h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 3px;
  height: 0.9em;
  background: var(--accent-purple);
  border-radius: 2px;
}

.ai-result-content h1:first-child,
.ai-result-content h2:first-child {
  margin-top: 0;
}

.ai-result-content strong {
  color: var(--accent-gold-light);
  font-weight: 600;
}

.ai-result-content em {
  color: var(--text-secondary);
  font-style: italic;
}

.ai-result-content ul, .ai-result-content ol {
  padding-left: 1.4rem;
  margin: 0.75rem 0;
}

.ai-result-content li {
  margin-bottom: 0.5rem;
  line-height: 1.85;
  padding-left: 0.2rem;
}

.ai-result-content li::marker {
  color: var(--accent-gold);
}

.ai-result-content p {
  margin-bottom: 0.75rem;
}

.ai-result-content blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent-purple);
  background: rgba(167, 139, 250, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.8;
}

.ai-result-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: 2rem 0;
}

/* ========================
   VAN HAN (FORTUNE CYCLE)
   ======================== */
.vanhan-section {
  display: none;
  max-width: 900px;
  margin: 0 auto var(--space-xl);
  padding: 0 var(--space-md);
}

.vanhan-section.active {
  display: block;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.vanhan-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.vanhan-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251, 146, 60, 0.4), transparent);
}

.vanhan-header {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.08), rgba(251, 146, 60, 0.02));
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.vanhan-header h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--accent-orange);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vanhan-header h2::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: var(--accent-orange);
  border-radius: 2px;
  flex-shrink: 0;
}

.vanhan-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
  line-height: 1.65;
}

/* Year Picker */
.vanhan-year-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
}

.btn-year-nav {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.btn-year-nav:active {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: rgba(251, 146, 60, 0.06);
}

.year-input {
  width: 100px;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--accent-orange) !important;
  background: transparent !important;
  border: none !important;
  font-family: inherit;
  -moz-appearance: textfield;
  box-shadow: none !important;
}

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

.year-input:focus {
  outline: none;
}

/* Van Han Content — no extra padding, blocks bleed full-width */
.vanhan-content {
  padding: 0.5rem 0 0;
}

/* ========================
   VAN HAN BLOCKS (Redesigned Mobile-First — Full Width)
   ======================== */
.vanhan-block {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}
.vanhan-block:last-child { border-bottom: none; }

/* Color accent left bar */
.vanhan-block::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
}
.vanhan-block.vanhan-daihan::before {
  background: linear-gradient(180deg, var(--accent-orange), #f59e0b);
}
.vanhan-block.vanhan-luunien::before {
  background: linear-gradient(180deg, var(--accent-blue), #818cf8);
}
.vanhan-block.vanhan-tieuhan::before {
  background: linear-gradient(180deg, var(--accent-teal), #34d399);
}

.vanhan-block-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.5rem 1.25rem;
}

.vanhan-block-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.vanhan-daihan .vanhan-block-icon {
  background: rgba(251, 146, 60, 0.12);
}
.vanhan-luunien .vanhan-block-icon {
  background: rgba(96, 165, 250, 0.12);
}
.vanhan-tieuhan .vanhan-block-icon {
  background: rgba(45, 212, 191, 0.12);
}

.vanhan-block-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.vanhan-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

/* Block body — generous padding */
.vanhan-block-body {
  padding: 0.5rem 1rem 1.25rem 1.25rem;
}

.vanhan-palace-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.65rem;
  padding: 0.3rem 0.75rem;
  background: var(--accent-gold-dim);
  border-radius: 100px;
}

/* Stars in Van Han */
.vanhan-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.vanhan-star {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.3;
}

.vanhan-star.good {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: rgba(74, 222, 128, 0.15);
}
.vanhan-star.bad {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: rgba(248, 113, 113, 0.15);
}
.vanhan-star.neutral {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-color: rgba(96, 165, 250, 0.15);
}
.vanhan-star.flow {
  background: rgba(251, 146, 60, 0.10);
  color: var(--accent-orange);
  border-color: rgba(251, 146, 60, 0.2);
  font-style: italic;
}

/* Tứ Hóa */
.vanhan-tuhoa {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.vanhan-tuhoa-label {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.vanhan-tuhoa-item {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Interpretation */
.vanhan-interp {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-xs);
  border-left: 3px solid var(--accent-gold-dim);
}

/* ========================
   MONTHLY OVERVIEW (Redesigned)
   ======================== */
.vanhan-monthly-section {
  margin-top: 1.25rem;
}

.vanhan-monthly-header {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  padding: 0 1rem 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vanhan-monthly-header::before {
  content: '';
  width: 3px;
  height: 1em;
  background: var(--accent-purple);
  border-radius: 1px;
}

.monthly-overview-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  padding: 0 1rem 0 1.25rem;
}

/* Compact legend */
.monthly-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0 1rem 0 1.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-item.theme-career .legend-dot { background: #4a9eff; }
.legend-item.theme-wealth .legend-dot { background: #f0b942; }
.legend-item.theme-relationship .legend-dot { background: #e87fa0; }
.legend-item.theme-health .legend-dot { background: #ef6c5e; }
.legend-item.theme-self .legend-dot { background: #a78bfa; }
.legend-item.theme-travel .legend-dot { background: #34d399; }

/* Monthly Grid — single column on mobile for full readability */
.vanhan-monthly-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.monthly-cell {
  position: relative;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition-fast);
  cursor: default;
  border-left: 4px solid var(--border-subtle);
}

.monthly-cell:last-child {
  border-bottom: none;
}

/* Theme left-border colors */
.monthly-cell.theme-career { border-left-color: #4a9eff; }
.monthly-cell.theme-wealth { border-left-color: #f0b942; }
.monthly-cell.theme-relationship { border-left-color: #e87fa0; }
.monthly-cell.theme-health { border-left-color: #ef6c5e; }
.monthly-cell.theme-self { border-left-color: #a78bfa; }
.monthly-cell.theme-travel { border-left-color: #34d399; }

.monthly-cell.current-month {
  background: rgba(167, 139, 250, 0.06);
  border-left-color: var(--accent-purple);
  border-left-width: 4px;
}

.monthly-current-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.15);
  padding: 2px 8px;
  border-radius: 100px;
}

.monthly-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 28px;
  flex-shrink: 0;
  text-align: center;
}

.monthly-cell.current-month .monthly-num {
  color: var(--accent-purple);
}

.monthly-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.monthly-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.monthly-palace {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.monthly-keyword {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.monthly-stem {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Dai Han / Luu Nien indicators on chart */
.palace-cell .palace-indicator {
  position: absolute;
  bottom: 4px;
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 100px;
  font-weight: 700;
  z-index: 3;
  letter-spacing: 0.02em;
}

.palace-indicator.indicator-daihan {
  right: 4px;
  background: var(--accent-orange);
  color: #0f1520;
}

.palace-indicator.indicator-luunien {
  left: 4px;
  background: var(--accent-blue);
  color: white;
}

/* Tam Phuong Tu Chinh in Detail Panel */
.tam-phuong-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 0.5rem;
}

.tam-phuong-cell {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.875rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tam-phuong-cell:active {
  border-color: var(--accent-gold-dim);
  background: var(--bg-card-hover);
}

.tam-phuong-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.tam-phuong-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.15rem;
}

.tam-phuong-stars {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ========================
   ERROR MESSAGE
   ======================== */
.error-message {
  display: none;
  max-width: 700px;
  margin: 0.75rem var(--space-md);
  padding: 0.875rem var(--space-lg);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-left: 3px solid var(--accent-red);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.error-message.active {
  display: block;
  animation: slideUp 0.3s ease;
}

/* ========================
   SOCIAL PROOF — Stats + Reviews
   ======================== */
.social-proof {
  padding: 0 var(--space-md);
  margin-top: 1.5rem;
}

/* Stats bar */
.sp-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.9rem 0.5rem;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.06), rgba(167, 139, 250, 0.04));
  border: 1px solid rgba(240, 180, 41, 0.1);
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
}
.sp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.sp-stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold-light);
  letter-spacing: -0.02em;
  line-height: 1;
}
.sp-stat-star {
  font-size: 0.75rem;
  margin-left: 1px;
}
.sp-stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.sp-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

/* Section header */
.sp-header {
  text-align: center;
  margin-bottom: 0.8rem;
}
.sp-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}
.sp-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 0;
}
.sp-subtitle strong {
  color: var(--accent-gold);
}

/* Reviews list */
.sp-reviews {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sp-review {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sp-review-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.sp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sp-reviewer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sp-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.sp-meta {
  font-size: 0.58rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.sp-stars {
  font-size: 0.7rem;
  color: var(--accent-gold);
  letter-spacing: 1px;
  flex-shrink: 0;
}
.sp-star-dim {
  opacity: 0.25;
}
.sp-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.sp-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.sp-text em {
  color: var(--accent-gold);
  font-style: italic;
}

/* Load more hint */
.sp-more {
  text-align: center;
  padding: 0.8rem 0 0.4rem;
}
.sp-more-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.6;
  font-style: italic;
}

/* ========================
   AUTHOR'S NOTE CARD
   ======================== */
.author-note-card {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid rgba(240, 180, 41, 0.28);
  background: linear-gradient(160deg,
    rgba(240, 180, 41, 0.08) 0%,
    rgba(17, 24, 39, 0.85) 35%,
    rgba(13, 18, 30, 0.95) 70%,
    rgba(167, 139, 250, 0.04) 100%);
  margin-bottom: 1.5rem;
  box-shadow:
    0 0 20px rgba(240, 180, 41, 0.06),
    0 4px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(240, 180, 41, 0.1);
  position: relative;
}
.author-note-card::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 3.5rem;
  line-height: 1;
  color: rgba(240, 180, 41, 0.07);
  font-family: Georgia, serif;
  pointer-events: none;
}
.author-note-accent {
  width: 4px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--accent-gold), rgba(240, 180, 41, 0.6) 60%, rgba(167, 139, 250, 0.3), transparent);
}
.author-note-body {
  padding: 1.1rem 1.1rem 1rem;
  flex: 1;
}
.author-note-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.author-note-icon {
  font-size: 1rem;
  filter: grayscale(0.2);
}
.author-note-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-gold-light);
  margin: 0;
  letter-spacing: 0.03em;
  text-shadow: 0 0 12px rgba(240, 180, 41, 0.2);
}
.author-note-content p {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.75;
  margin: 0 0 0.6rem;
}
.author-note-content p:first-child {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
}
.author-note-content p:last-child {
  margin-bottom: 0;
}
.author-note-content strong {
  color: var(--accent-gold-light);
  font-weight: 600;
}
.author-note-footer {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(240, 180, 41, 0.12);
}
.author-note-sign {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}
.author-note-team {
  font-size: 0.76rem;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px rgba(240, 180, 41, 0.15);
}

/* ========================
   FOOTER
   ======================== */
.app-footer {
  text-align: center;
  padding: 2rem var(--space-md);
  color: var(--text-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
  position: relative;
  padding-bottom: calc(2rem + var(--safe-bottom));
}

.app-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold-dim), transparent);
}

.app-footer a {
  color: var(--accent-gold);
  text-decoration: none;
}

.app-footer p {
  line-height: 1.6;
  font-size: 0.72rem;
  opacity: 0.6;
  margin-top: 0.25rem;
}

/* About banner — above form, VERY prominent */
/* ========================
   ABOUT TỬ VI SCREEN
   ======================== */
.screen-about {
  background: var(--bg-body);
}

.about-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.75rem 1rem;
  padding-top: calc(0.75rem + var(--safe-top));
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.about-back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 0.25rem 0;
  -webkit-tap-highlight-color: transparent;
}
.about-back-btn:active { opacity: 0.7; }

.about-content {
  max-width: 600px;
  margin: 0 auto;
}

/* Hero */
.about-hero {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}
.about-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.7) saturate(1.1);
}
.about-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(
    to bottom,
    rgba(8, 12, 20, 0.2) 0%,
    rgba(8, 12, 20, 0.6) 60%,
    rgba(8, 12, 20, 0.95) 100%
  );
}
.about-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.03em;
}
.about-hero-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* Sections */
.about-section {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.about-section:last-of-type {
  border-bottom: none;
}

.about-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}

.about-section > p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.6rem;
}
.about-section > p strong {
  color: var(--accent-gold);
  font-weight: 700;
}

/* Highlight box */
.about-highlight {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  margin-top: 0.75rem;
  background: rgba(240, 180, 41, 0.04);
  border: 1px solid rgba(240, 180, 41, 0.12);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-gold);
}
.about-highlight-icon {
  font-size: 1.2rem;
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 2px;
}
.about-highlight p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.about-highlight strong {
  color: var(--accent-gold);
  font-weight: 700;
}

/* List */
.about-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.about-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: 1rem;
  position: relative;
}
.about-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-gold);
  opacity: 0.6;
}
.about-list li strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Use items */
.about-uses {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.about-use-item {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.about-use-icon {
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(240, 180, 41, 0.08);
  color: var(--accent-gold);
  flex-shrink: 0;
}
.about-use-item strong {
  font-size: 0.82rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.15rem;
}
.about-use-item p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Tips */
.about-tips {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}
.about-tip {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.about-tip-num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(167, 139, 250, 0.1));
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: var(--accent-purple);
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 2px;
}
.about-tip strong {
  font-size: 0.82rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.15rem;
}
.about-tip p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* CTA */
.about-cta {
  text-align: center;
  padding: 2rem 1.25rem;
}
.about-cta p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}
.btn-about-cta {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: linear-gradient(135deg, var(--accent-gold), #d4910a);
  color: #080c14;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 24px rgba(240, 180, 41, 0.3);
  transition: all 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.btn-about-cta:active {
  transform: scale(0.97);
}

/* About footer */
.about-footer {
  text-align: center;
  padding: 1.5rem 1.25rem;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  opacity: 0.6;
}
.about-footer-author {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}
.about-footer-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  opacity: 1;
}
.about-footer-email {
  font-size: 0.75rem;
  margin-top: 0.2rem;
}
.about-footer-email a {
  color: var(--accent-gold);
  text-decoration: none;
}
.about-footer a {
  color: var(--accent-gold);
  text-decoration: none;
}
.about-footer p + p {
  margin-top: 0.25rem;
}

/* ========================
   PALACE CARD — CLEAN LAYOUT
   ======================== */
.palace-card-clean {
  padding: 0;
  overflow: hidden;
}

.palace-clean-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(240, 180, 41, 0.1);
}

.palace-clean-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.palace-clean-title-block {
  min-width: 0;
}

.palace-clean-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
}

.palace-clean-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.palace-clean-section {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.palace-clean-section:last-of-type {
  border-bottom: none;
}

.palace-clean-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}

/* Major star cards — grid layout */
.palace-clean-stars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.625rem;
}

.palace-star-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  transition: all var(--transition);
}

.palace-star-card.good {
  border-color: rgba(76, 175, 80, 0.2);
  background: rgba(76, 175, 80, 0.05);
}

.palace-star-card.bad {
  border-color: rgba(244, 67, 54, 0.2);
  background: rgba(244, 67, 54, 0.05);
}

.palace-star-card.neutral {
  border-color: rgba(240, 180, 41, 0.15);
  background: rgba(240, 180, 41, 0.04);
}

.palace-star-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.palace-star-brightness {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.palace-star-mutagen {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.palace-star-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Minor/Adj star chips */
.palace-clean-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* CTA at bottom */
.palace-clean-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.06), rgba(240, 180, 41, 0.02));
  border-top: 1px solid rgba(240, 180, 41, 0.1);
}

.palace-clean-cta-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.btn-palace-cta {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.2), rgba(240, 180, 41, 0.1));
  border: 1px solid rgba(240, 180, 41, 0.35);
  border-radius: var(--radius-md);
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-palace-cta:hover {
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.3), rgba(240, 180, 41, 0.2));
}

/* ========================
   CHART COMPACT VIEW (Mini preview)
   ======================== */
.chart-compact-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.chart-compact-inner {
  max-height: 280px;
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
}

.chart-compact-inner .chart-grid {
  min-width: 600px;
  transform: scale(0.85);
  transform-origin: top left;
}

.chart-compact-inner .palace-cell {
  padding: 0.35rem;
}

.chart-compact-inner .palace-major-stars,
.chart-compact-inner .palace-minor-stars,
.chart-compact-inner .palace-adj-stars,
.chart-compact-inner .palace-extra-stars {
  gap: 1px;
}

.chart-compact-inner .star-tag {
  font-size: 0.55rem;
  padding: 0.05rem 0.2rem;
}

.chart-compact-inner .palace-header .palace-name {
  font-size: 0.65rem;
}

.chart-compact-inner .palace-header .palace-branch {
  font-size: 0.55rem;
}

.chart-compact-inner .palace-stage {
  font-size: 0.5rem;
}

.chart-compact-inner .center-info {
  pointer-events: none;
}

.chart-compact-inner .center-title {
  font-size: 0.75rem;
}

.chart-compact-inner .center-info-grid {
  font-size: 0.55rem;
  gap: 0.1rem 0.3rem;
}

.chart-compact-fade {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--bg-primary) 90%);
  pointer-events: none;
}

.btn-chart-expand {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.15), rgba(240, 180, 41, 0.08));
  border: 1px solid rgba(240, 180, 41, 0.3);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  color: var(--gold);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-chart-expand:hover {
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.25), rgba(240, 180, 41, 0.15));
}

.btn-chart-collapse {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.625rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-chart-collapse:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.chart-full-wrapper .chart-scroll-wrapper {
  margin-bottom: 0;
}

.chart-compact-wrapper.hidden,
.chart-full-wrapper.hidden {
  display: none;
}

/* ========================
   CHART SCROLL WRAPPER (Mobile)
   ======================== */
.chart-scroll-wrapper {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}

.chart-scroll-wrapper::-webkit-scrollbar { height: 4px; }
.chart-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(240, 180, 41, 0.3);
  border-radius: 100px;
}

.chart-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.375rem 0;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  animation: pulseHint 2s ease-in-out infinite;
}

.chart-scroll-hint span::before {
  content: '\2190';
  margin-right: 0.3rem;
}

.chart-scroll-hint span::after {
  content: '\2192';
  margin-left: 0.3rem;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ========================
   SCROLLBAR STYLING
   ======================== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

/* ========================
   STEP WIZARD / RESULTS
   ======================== */
.results-section {
  display: none;
  max-width: 900px;
  margin: 0 auto var(--space-xl);
  padding: 0 var(--space-sm);
}

.results-section.active {
  display: block;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Step Navigation Bar - sticky below results topbar */
.step-nav {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  position: sticky;
  top: 52px;
  z-index: 100;
  background: rgba(8, 12, 20, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.625rem 0;
  margin-bottom: 0.625rem;
}

.step-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.step-nav-arrow {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.0625rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-nav-arrow:active:not(:disabled) {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.step-nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.step-tabs-scroll {
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.step-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.step-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.step-tab {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 40px;
}

.step-tab.active {
  background: var(--accent-gold-dim);
  border-color: rgba(240, 180, 41, 0.2);
  color: var(--accent-gold);
  font-weight: 600;
}

/* On mobile, only show icon; show label only for active tab */
.step-tab-label {
  display: none;
}

.step-tab.active .step-tab-label {
  display: inline;
}

.step-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Results Tip Banner */
.results-tip-banner {
  position: relative;
  margin: 0 0.75rem 0.75rem;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  animation: tipSlideIn 0.4s ease-out;
}
.results-tip-banner.hidden { display: none; }
@keyframes tipSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.results-tip-close {
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
  z-index: 1;
}
.results-tip-close:hover { color: #aaa; }
.results-tip-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  padding-right: 18px;
}
.results-tip-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.results-tip-text {
  font-size: 0.78rem;
  color: #b0b8d0;
  line-height: 1.5;
}
.results-tip-text strong {
  color: #a78bfa;
  font-weight: 600;
}
.results-tip-actions {
  display: flex;
  gap: 8px;
}
.results-tip-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tip-btn-ai {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
}
.tip-btn-ai:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.25));
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.2);
}
.tip-btn-pdf {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
}
.tip-btn-pdf:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.15));
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(212, 175, 55, 0.2);
}

/* Step Panels - scroll layout, all visible */
.step-panels {
  padding: 0 0.5rem;
  padding-bottom: 4rem;
}

.step-panel {
  /* All panels visible in scroll layout */
  margin-bottom: 1.5rem;
  scroll-margin-top: 64px; /* Height of topbar (52px) + padding */
}

/* Section label above each panel */
.step-panel::before {
  content: attr(data-section-label);
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 0.25rem 0.4rem;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 0;
}

.step-panel:first-child::before {
  border-top: none;
  padding-top: 0.25rem;
}

/* Step Footer - hidden for scroll layout */
.step-footer {
  display: none !important;
}

.step-footer.active {
  display: none !important;
}

.step-footer-btn {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 42%;
}

.step-footer-btn.step-footer-next {
  background: var(--accent-gold-dim);
  border-color: rgba(240, 180, 41, 0.25);
  color: var(--accent-gold);
}

.step-footer-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.step-footer-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.step-footer-counter {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

/* Step Card with reveal animation */
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: cardReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 41, 0.4), transparent);
}

/* When card has banner, suppress the top line (banner covers it) */
.step-card.has-banner::before {
  display: none;
}

/* === Step Card Banner === */
.step-card-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 180;
  overflow: hidden;
}

.step-card-banner picture,
.step-card-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.step-card-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(17, 24, 39, 0) 0%,
    rgba(17, 24, 39, 0.15) 40%,
    rgba(17, 24, 39, 0.65) 75%,
    rgba(17, 24, 39, 0.92) 100%
  );
  pointer-events: none;
}

.step-card-banner-overlay.vanhan-overlay {
  background: linear-gradient(
    to bottom,
    rgba(17, 24, 39, 0) 0%,
    rgba(17, 24, 39, 0.15) 40%,
    rgba(17, 24, 39, 0.60) 75%,
    rgba(17, 24, 39, 0.90) 100%
  );
}

.step-card-banner-title {
  position: absolute;
  bottom: 0.625rem;
  left: var(--space-lg);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-gold-light);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(240, 180, 41, 0.25);
  letter-spacing: 0.02em;
  z-index: 1;
}

.step-card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.06), transparent);
}

/* When header follows a banner, reduce top padding and remove top background */
.has-banner .step-card-header {
  padding-top: var(--space-sm);
  background: none;
}

.step-card-header h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.step-card-header h2::before {
  content: '';
  width: 4px;
  height: 1.2em;
  background: var(--accent-gold);
  border-radius: 2px;
  flex-shrink: 0;
}

.step-card-header .step-card-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.step-card-body {
  padding: var(--space-lg);
}

/* Stars in step-card-header */
.step-card-header .aspect-stars {
  margin-top: 0.5rem;
}

/* Vanhan step card — minimal padding for full-width blocks */
.step-card.vanhan-theme::before {
  background: linear-gradient(90deg, transparent, rgba(251, 146, 60, 0.4), transparent);
}
.step-card.vanhan-theme .step-card-header {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.08), transparent);
}
.step-card.vanhan-theme.has-banner .step-card-header {
  background: none;
}
.step-card.vanhan-theme .step-card-body {
  padding: 0;
}
.step-card.vanhan-theme .step-card-header h2 {
  color: var(--accent-orange);
}
.step-card.vanhan-theme .step-card-header h2::before {
  background: var(--accent-orange);
}
.step-card.vanhan-theme .step-card-banner-title {
  color: var(--accent-orange);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(251, 146, 60, 0.3);
}

/* Consultation step card */
.step-card.consult-theme::before {
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.4), transparent);
}
.step-card.consult-theme .step-card-header {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), transparent);
}
.step-card.consult-theme .step-card-header h2 {
  color: var(--accent-purple);
}
.step-card.consult-theme .step-card-header h2::before {
  background: var(--accent-purple);
}

/* Overview quick-link grid */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: var(--space-lg);
}

.overview-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.overview-item:active {
  border-color: var(--accent-gold-dim);
  background: rgba(240, 180, 41, 0.03);
}

.overview-item-thumb {
  width: 100%;
  aspect-ratio: 800 / 180;
  overflow: hidden;
}

.overview-item-thumb picture,
.overview-item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overview-item-info {
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.overview-item-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.overview-item-stars {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ========================
   OVERVIEW SECTION LABEL
   ======================== */
.overview-section-label {
  margin-top: 1.5rem;
}

.overview-section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.overview-section-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.625rem;
}

/* ========================
   CONSULT CTA BLOCK - PREMIUM
   ======================== */
.ai-cta-block {
  position: relative;
  margin-top: 2rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 220px;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Background image */
.ai-cta-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.ai-cta-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.7) saturate(1.2);
}

/* Dark overlay for readability */
.ai-cta-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    135deg,
    rgba(8, 12, 20, 0.75) 0%,
    rgba(15, 19, 32, 0.55) 40%,
    rgba(124, 58, 237, 0.15) 100%
  );
}

/* Animated gradient border top */
.ai-cta-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue), var(--accent-gold), var(--accent-purple));
  background-size: 300% 100%;
  animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Content on top of image */
.ai-cta-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1.5rem 1.5rem 1.75rem;
}

.ai-cta-badge {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 3px 12px;
  border-radius: 100px;
  background: rgba(240, 180, 41, 0.15);
  border: 1px solid rgba(240, 180, 41, 0.3);
  color: rgba(240, 180, 41, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ai-cta-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.ai-cta-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.55;
  max-width: 300px;
}

.btn-ai-cta {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0.9rem 1.5rem;
  margin-top: 0.35rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 40%, #6d28d9 100%);
  color: white;
  border: 2px solid rgba(167, 139, 250, 0.4);
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 50px;
  transition: all 0.3s ease;
  font-family: inherit;
  letter-spacing: 0.04em;
  overflow: hidden;
  box-shadow:
    0 0 16px rgba(139, 92, 246, 0.3),
    0 0 32px rgba(124, 58, 237, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.25);
  -webkit-tap-highlight-color: transparent;
  animation: consultGlow 3s ease-in-out infinite;
}

.btn-ai-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2), transparent);
  animation: consultShimmer 3.5s ease-in-out infinite;
  z-index: 1;
}

.btn-ai-cta:active {
  transform: scale(0.97);
}

/* ========================
   CONSULT CTA INLINE (in palace steps)
   ======================== */
.ai-cta-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.ai-cta-inline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue), var(--accent-purple));
  background-size: 200% 100%;
  animation: gradientShift 3s linear infinite;
}

.ai-cta-inline-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ai-cta-inline-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.btn-ai-cta-sm {
  flex-shrink: 0;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-ai-cta-sm:active {
  transform: scale(0.96);
}

/* ========================
   FLOATING CONSULT BUTTON
   ======================== */
.floating-consult-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1rem;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
  animation: floatPulse 2s ease-in-out infinite;
  transition: transform 0.2s;
  font-family: inherit;
}

.floating-consult-btn.visible {
  display: flex;
}

.floating-consult-btn:active {
  transform: scale(0.9);
}

@keyframes floatPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5); }
  50% { box-shadow: 0 4px 30px rgba(124, 58, 237, 0.7), 0 0 40px rgba(124, 58, 237, 0.2); }
}

/* ========================
   DESKTOP ENHANCEMENTS
   ======================== */
@media (min-width: 768px) {
  .hero-section {
    height: 380px;
  }

  .birth-form {
    padding: 0;
  }

  .detail-panel {
    width: 480px;
    max-width: 92vw;
    right: -500px;
    border-left: 1px solid var(--border-color);
  }

  .detail-panel.active {
    right: 0;
  }

  .summary-header {
    padding: 1.75rem 2rem;
  }

  .summary-header h2 {
    font-size: 1.375rem;
  }

  .summary-body {
    padding: 1.75rem 2rem;
  }

  .info-chip {
    flex-direction: row;
    align-items: center;
    gap: 0.375rem;
    border-radius: 100px;
  }

  .topic-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Desktop: center the purchase modal */
  .purchase-overlay {
    align-items: center;
  }
  .purchase-modal {
    border-radius: var(--radius-lg);
    border-bottom: 1px solid rgba(240, 180, 41, 0.12);
    max-height: 85vh;
  }

  .tam-phuong-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .monthly-cell {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem 0.6rem;
    border-left: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    border-top: 3px solid var(--border-subtle);
    border-radius: var(--radius-xs);
  }
  .monthly-cell:last-child { border-bottom: 1px solid var(--border-subtle); }
  .monthly-cell.theme-career { border-top-color: #4a9eff; border-left-color: var(--border-subtle); }
  .monthly-cell.theme-wealth { border-top-color: #f0b942; border-left-color: var(--border-subtle); }
  .monthly-cell.theme-relationship { border-top-color: #e87fa0; border-left-color: var(--border-subtle); }
  .monthly-cell.theme-health { border-top-color: #ef6c5e; border-left-color: var(--border-subtle); }
  .monthly-cell.theme-self { border-top-color: #a78bfa; border-left-color: var(--border-subtle); }
  .monthly-cell.theme-travel { border-top-color: #34d399; border-left-color: var(--border-subtle); }
  .monthly-info { align-items: center; }

  .vanhan-header {
    padding: 1.75rem 2rem;
  }

  .vanhan-content {
    padding: 1rem 0.5rem;
  }

  .step-card.vanhan-theme .step-card-body {
    padding: 0 0.5rem;
  }

  .vanhan-block {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  .vanhan-block::before { width: 4px; }
  .vanhan-block:last-child { margin-bottom: 0; }

  .overview-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem;
  }

  .step-tab-label {
    display: inline;
  }

  .step-card-header {
    padding: 1.5rem 1.75rem;
  }

  .step-card-body {
    padding: 1.5rem 1.75rem;
  }

  .results-section {
    padding: 0 1.25rem;
  }

  .results-topbar {
    padding: 0.625rem 1.5rem;
  }

  .step-panels {
    padding: 0 0.75rem;
  }

  /* Hover effects only on desktop */
  .btn-submit:hover {
    transform: translateY(-1px);
    border-color: rgba(240, 180, 41, 0.5);
    box-shadow:
      0 0 20px rgba(240, 180, 41, 0.15),
      0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .btn-consult:hover {
    transform: translateY(-2px);
    box-shadow:
      0 0 35px rgba(139, 92, 246, 0.5),
      0 0 70px rgba(124, 58, 237, 0.2),
      0 8px 24px rgba(0, 0, 0, 0.3);
  }

  .topic-card:hover {
    border-color: var(--accent-purple-dim);
    background: rgba(167, 139, 250, 0.04);
  }

  .btn-consult-again:hover {
    opacity: 0.9;
    transform: translateY(-1px);
  }
  .btn-consult-back-secondary:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
  }

  .palace-cell:hover {
    z-index: 1;
  }

  .palace-cell:hover::after {
    background: rgba(240, 180, 41, 0.03);
  }

  .summary-aspect:hover {
    border-color: var(--border-medium);
  }

  .star-detail-card:hover {
    border-color: var(--border-medium);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .btn-close:hover {
    background: rgba(248, 113, 113, 0.1);
    color: var(--accent-red);
    border-color: rgba(248, 113, 113, 0.3);
  }

  .overview-item:hover {
    border-color: var(--accent-gold-dim);
    background: rgba(240, 180, 41, 0.03);
  }

  .step-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
  }

  .step-footer-btn:hover:not(:disabled) {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
  }

  .step-nav-arrow:hover:not(:disabled) {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
  }

  .btn-year-nav:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(251, 146, 60, 0.06);
  }

  .info-chip:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-medium);
  }

  .monthly-cell:hover {
    background: var(--bg-card-hover);
  }

  .tam-phuong-cell:hover {
    border-color: var(--accent-gold-dim);
    background: var(--bg-card-hover);
  }

  .vanhan-block:hover {
    border-color: var(--border-medium);
  }

  .summary-aspect:hover .aspect-icon {
    border-color: var(--accent-gold-dim);
    background: rgba(240, 180, 41, 0.04);
  }

  .btn-save-image:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(240, 180, 41, 0.08);
  }

  .btn-copy-result:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: var(--accent-purple-dim);
  }

  .btn-toggle-chart:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 16px rgba(240, 180, 41, 0.08);
  }

  .form-group input:hover,
  .form-group select:hover {
    border-color: rgba(255, 255, 255, 0.15);
  }

  .consult-question-group textarea:hover {
    border-color: rgba(255, 255, 255, 0.15);
  }

  .chart-scroll-hint {
    display: none;
  }

  .btn-ai-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
  }

  .btn-ai-cta-sm:hover {
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
  }

  .step-footer-btn:hover:not(:disabled) {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
  }

  .step-footer-btn.step-footer-next:hover:not(:disabled) {
    background: rgba(240, 180, 41, 0.18);
    box-shadow: 0 0 12px rgba(240, 180, 41, 0.15);
  }

  .results-back-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--text-secondary);
    color: var(--text-primary);
  }

  .floating-consult-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.6), 0 0 40px rgba(124, 58, 237, 0.25);
  }
}

/* ========================
   DESKTOP PHONE FRAME
   Show mobile app inside a professional phone mockup on desktop
   ======================== */

/* App shell — transparent wrapper on mobile */
.app-shell {
  position: relative;
}

@media (min-width: 768px) {
  /* Desktop background */
  html {
    height: 100%;
    overflow: hidden;
  }

  body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    padding: 0;
    background: #070a12;
    background-image:
      radial-gradient(ellipse 60% 50% at 30% 20%, rgba(240, 180, 41, 0.04), transparent),
      radial-gradient(ellipse 50% 60% at 70% 80%, rgba(124, 58, 237, 0.03), transparent),
      radial-gradient(ellipse 80% 80% at 50% 50%, rgba(17, 24, 50, 1), rgba(8, 10, 18, 1));
  }

  /* Phone viewport */
  .app-shell {
    width: 430px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0); /* contain fixed-position elements */
    flex-shrink: 0;
    background: var(--bg-body);
    background-image:
      radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 180, 41, 0.06), transparent),
      radial-gradient(ellipse 60% 40% at 80% 60%, rgba(99, 102, 241, 0.03), transparent);
    /* Hide scrollbar — keep scroll functional */
    scrollbar-width: none; /* Firefox */
    box-shadow:
      0 0 80px rgba(0, 0, 0, 0.6),
      0 0 160px rgba(0, 0, 0, 0.3);
    position: relative;
  }

  .app-shell::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
  }

  /* Revert desktop layout overrides — content stays at mobile width */
  .app-shell .hero-section {
    height: 340px;
  }

  .app-shell .detail-panel {
    width: 100%;
    max-width: 100%;
    right: -100%;
    border-left: none;
  }

  .app-shell .detail-panel.active {
    right: 0;
  }

  .app-shell .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /*
   * Desktop overlay fix: inside app-shell, transform:translateZ(0) breaks position:fixed.
   * Overlays use position:absolute + JS sets top/height to match visible viewport.
   * The class .desktop-overlay-positioned is added by JS.
   */
  .app-shell .desktop-overlay-positioned {
    position: absolute !important;
    bottom: auto !important;
  }

  .app-shell .purchase-overlay {
    align-items: center;
  }

  .app-shell .purchase-modal {
    border-radius: var(--radius-lg);
    border-bottom: 1px solid rgba(240, 180, 41, 0.12);
    max-height: 85vh;
    animation: overlayPopCenter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .app-shell .qr-sheet-overlay {
    align-items: center;
  }

  .app-shell .qr-sheet {
    border-radius: var(--radius-lg);
    border-bottom: 1px solid rgba(240, 180, 41, 0.12);
    animation: overlayPopCenter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes overlayPopCenter {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  .app-shell .tam-phuong-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-shell .vanhan-monthly-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
  }

  .app-shell .monthly-cell {
    flex-direction: row;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-left: none;
    border-bottom: none;
    border-top: none;
    border-radius: 0;
  }

  .app-shell .monthly-info {
    align-items: flex-start;
  }

  .app-shell .overview-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .app-shell .step-tab-label {
    display: none;
  }

  .app-shell .step-tab.active .step-tab-label {
    display: inline;
  }

  .app-shell .step-card-header {
    padding: var(--space-md) var(--space-lg);
  }

  .app-shell .step-card-body {
    padding: var(--space-md) var(--space-lg);
  }

  .app-shell .results-section {
    padding: 0 var(--space-sm);
  }

  .app-shell .results-topbar {
    padding: 0.625rem 1rem;
  }

  .app-shell .step-panels {
    padding: 0 0.5rem;
  }

  .app-shell .info-chip {
    flex-direction: column;
    align-items: flex-start;
    border-radius: var(--radius-sm);
  }

  .app-shell .summary-header {
    padding: var(--space-md) var(--space-lg);
  }

  .app-shell .summary-body {
    padding: var(--space-md) var(--space-lg);
  }

  .app-shell .vanhan-header {
    padding: var(--space-md) var(--space-lg);
  }

  .app-shell .vanhan-content {
    padding: 0.5rem;
  }

  .app-shell .chart-scroll-hint {
    display: flex;
  }

  /* Screens inside phone shell don't need body bg */
  .app-shell .screen-input {
    background-size: 115%;
    background-position: center -10px;
  }
}

/* Tall screens: show phone frame with border & rounded corners */
@media (min-width: 768px) and (min-height: 680px) {
  body {
    padding: 1.25rem 0;
  }

  .app-shell {
    height: calc(100vh - 2.5rem);
    max-height: 932px;
    border-radius: 48px;
    border: 4px solid #1c1f2e;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 0 0 2px rgba(0, 0, 0, 0.3),
      0 25px 80px rgba(0, 0, 0, 0.7),
      0 0 120px rgba(240, 180, 41, 0.04),
      inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  }

  /* Dynamic Island notch */
  .app-shell::before {
    content: '';
    position: sticky;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 126px;
    height: 36px;
    background: #000;
    border-radius: 20px;
    z-index: 10000;
    margin: 0 auto;
    pointer-events: none;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      inset 0 0 4px rgba(0, 0, 0, 0.8);
  }

  /* Camera dot inside Dynamic Island */
  .app-shell::after {
    content: '';
    position: sticky;
    top: 22px;
    left: calc(50% + 36px);
    display: block;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 40% 40%, #1a1a3a, #0a0a1a);
    border-radius: 50%;
    z-index: 10001;
    margin-top: -28px;
    pointer-events: none;
    box-shadow:
      0 0 0 1.5px rgba(30, 40, 80, 0.8),
      0 0 4px rgba(80, 100, 200, 0.15);
  }

  /* Adjust screen padding to account for notch */
  .app-shell .auth-bar {
    padding-top: calc(0.5rem + 32px);
  }

  .app-shell .splash-content {
    margin-top: 0;
  }

  /* Home bar indicator at bottom */
  .app-shell .screen-input::after,
  .app-shell .screen-results::after,
  .app-shell .screen-about::after {
    content: '';
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    z-index: 9999;
    pointer-events: none;
  }
}

/* Extra wide screens: decorative side labels */
@media (min-width: 1200px) and (min-height: 680px) {
  body::before {
    content: 'Tử Vi Đẩu Số';
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(240, 180, 41, 0.15);
    pointer-events: none;
  }

  body::after {
    content: 'Luận giải vận mệnh';
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.06);
    pointer-events: none;
  }
}

/* --- Small phones (max 360px) --- */
@media (max-width: 360px) {
  .hero-section { height: 65vw; }
  .trust-badges { gap: 0.35rem; padding: 0 0.75rem 0.5rem; }
  .trust-badge { font-size: 0.62rem; padding: 0.2rem 0.5rem; }
  .birth-form { padding: 0; }
  .form-row-2col {
    gap: 0.45rem;
  }
  .birth-form {
    gap: 0.6rem;
  }
  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }
  .vanhan-block-header { padding: 0.875rem 0.75rem 0.4rem 1rem; }
  .vanhan-block-body { padding: 0.4rem 0.75rem 1rem 1rem; }
  .vanhan-monthly-header { padding: 0 0.75rem 0.5rem 1rem; }
  .monthly-overview-desc,
  .monthly-legend { padding: 0 0.75rem 0 1rem; }
  .monthly-cell { padding: 0.65rem 0.75rem; }
  .chart-grid {
    min-width: 540px;
  }
  .step-card-header,
  .step-card-body {
    padding: var(--space-md);
  }
}

/* ========================
   PRINT STYLES
   ======================== */
@media print {
  body {
    background: white;
    color: black;
  }
  .form-section, .app-footer, .detail-overlay, .detail-panel, .loading-overlay, .consult-loading-overlay, .screen-consult-result, .step-nav, .step-footer, .results-topbar, .floating-consult-btn {
    display: none !important;
  }
  .chart-section { display: block !important; }
  .chart-grid { box-shadow: none; border: 2px solid #333; }
  .palace-cell { border: 1px solid #ccc; }
  .summary-section { display: block !important; }
  .summary-card { box-shadow: none; border: 1px solid #ccc; }
  .auth-bar, .credits-inline, .credits-badge, .purchase-overlay, .toast-container { display: none !important; }
}

/* ========================
   AUTH BAR
   ======================== */
.auth-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.45rem 0.6rem;
  gap: 0;
  position: relative;
  z-index: 10;
  background: linear-gradient(to bottom,
    rgba(8, 12, 20, 0.65) 0%,
    rgba(8, 12, 20, 0.3) 70%,
    transparent 100%);
}

/* Unified bar inline elements */
.auth-bar-divider {
  display: none;
}
.auth-bar-credits {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-bar-credit {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.auth-bar-credit strong {
  color: var(--accent-gold-light);
  font-weight: 800;
  font-size: 0.85rem;
  text-shadow: 0 0 8px rgba(240, 180, 41, 0.25);
}
.auth-bar-credit-sep {
  color: rgba(255,255,255,0.15);
  font-size: 0.6rem;
}
.auth-bar-buy {
  padding: 5px 14px;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.2), rgba(252, 211, 77, 0.1));
  color: var(--accent-gold-light);
  border: 1px solid rgba(240, 180, 41, 0.3);
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  margin-left: auto;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(240, 180, 41, 0.08);
}
.auth-bar-buy:hover {
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.3), rgba(252, 211, 77, 0.18));
  border-color: rgba(240, 180, 41, 0.45);
  box-shadow: 0 0 14px rgba(240, 180, 41, 0.15);
}
.auth-bar-buy:active { transform: scale(0.97); }
.btn-google-login {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-google-login:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.btn-google-login:disabled { opacity: 0.5; cursor: not-allowed; }
.google-icon { flex-shrink: 0; }

/* Profile chip — unified row */
.auth-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 10px 8px 8px;
  border-radius: 24px;
  transition: var(--transition);
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
}
.auth-profile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Avatar container */
.auth-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
/* Subtle pulse ring to hint tappable */
.auth-avatar-wrap::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 180, 41, 0.25);
  animation: avatarRingPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes avatarRingPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0; transform: scale(1.15); }
}
.auth-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 180, 41, 0.5);
  object-fit: cover;
}
.auth-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.15), rgba(167, 139, 250, 0.1));
  border: 1.5px solid rgba(240, 180, 41, 0.4);
  color: var(--accent-gold);
  font-size: 0.68rem;
  font-weight: 700;
}
.auth-status-dot {
  position: absolute;
  bottom: 0px; right: 0px;
  width: 7px; height: 7px;
  background: var(--accent-green);
  border: 1.5px solid rgba(8, 12, 20, 0.6);
  border-radius: 50%;
  z-index: 1;
}

/* Profile text */
.auth-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.auth-name {
  font-size: 0.72rem; font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.2;
}
.auth-email {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 80px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.2;
}
.auth-arrow {
  color: rgba(255, 255, 255, 0.45);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: -2px;
  animation: arrowHint 2.5s ease-in-out infinite;
}
@keyframes arrowHint {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(2px); }
  60% { transform: translateY(0); }
}
.auth-profile:hover .auth-arrow { color: var(--accent-gold); }

/* ========================
   AUTH MENU PANEL (Profile)
   ======================== */
.auth-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 100;
  overflow: hidden;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.auth-menu-dropdown.active {
  display: block;
  animation: menuReveal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes menuReveal {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Menu header — user info */
.auth-menu-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(139, 105, 20, 0.04) 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}
.auth-menu-avatar-wrap {
  width: 48px; height: 48px;
  flex-shrink: 0;
}
.auth-menu-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--accent-gold);
  object-fit: cover;
  box-shadow: 0 0 20px rgba(240, 180, 41, 0.25);
}
.auth-menu-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(139, 105, 20, 0.15));
  border: 2.5px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(240, 180, 41, 0.2);
}
.auth-menu-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.auth-menu-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-menu-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Menu credits section */
.auth-menu-credits {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-menu-credit-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(212, 175, 55, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.1);
}
.auth-menu-credit-icon-wrap {
  font-size: 1.2rem;
  color: var(--accent-gold);
  opacity: 0.8;
  flex-shrink: 0;
}
.auth-menu-credit-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.auth-menu-credit-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
}
.auth-menu-credit-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Menu action items */
.auth-menu-actions {
  padding: 6px 0;
}
.auth-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 18px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
}
.auth-menu-item svg { color: var(--text-muted); flex-shrink: 0; transition: var(--transition-fast); }
.auth-menu-item span { flex: 1; }
.auth-menu-item-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  opacity: 0.4;
  flex: 0 !important;
  transition: var(--transition-fast);
}
.auth-menu-item:hover {
  background: rgba(240, 180, 41, 0.06);
}
.auth-menu-item:hover svg { color: var(--accent-gold); }
.auth-menu-item:hover .auth-menu-item-arrow {
  opacity: 0.8;
  color: var(--accent-gold);
  transform: translateX(2px);
}
.auth-menu-premium {
  position: relative;
}
.auth-menu-item-badge {
  flex: 0 !important;
  font-size: 0.6rem;
  font-weight: 700;
  color: #1a1a00;
  background: linear-gradient(135deg, #d4af37, #f0b429);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Sign out */
.auth-menu-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 4px 0;
}
.auth-menu-signout { color: var(--accent-red) !important; }
.auth-menu-signout svg { color: var(--accent-red) !important; }
.auth-menu-signout:hover { background: rgba(248, 113, 113, 0.06) !important; }
.auth-menu-login-google { color: #4285F4 !important; font-weight: 500; }
.auth-menu-login-google:hover { background: rgba(66, 133, 244, 0.06) !important; }
.auth-menu-login-google .google-icon { flex-shrink: 0; }

/* ========================
   CREDITS INLINE
   ======================== */
.credits-inline {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; padding: 0.5rem 1rem; margin: 0 1rem 0.5rem;
  background: rgba(240, 180, 41, 0.05);
  border: 1px solid var(--accent-gold-dim);
  border-radius: var(--radius-sm);
}
.credits-inline-item {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; color: var(--text-secondary);
}
.credits-inline-icon { font-size: 0.85rem; color: var(--accent-gold); }
.credits-inline-item strong { color: var(--accent-gold); font-weight: 700; }
.btn-buy-credits {
  padding: 0.3rem 0.7rem;
  background: rgba(240, 180, 41, 0.12);
  border: 1px solid rgba(240, 180, 41, 0.25);
  border-radius: var(--radius-xs);
  color: var(--accent-gold); font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: var(--transition-fast); font-family: inherit;
}
.btn-buy-credits:hover { background: rgba(240, 180, 41, 0.2); }

/* ========================
   CREDITS BADGE (Results)
   ======================== */
.credits-badge {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: rgba(240, 180, 41, 0.08);
  border: 1px solid rgba(240, 180, 41, 0.15);
  border-radius: var(--radius-xs);
  font-size: 0.72rem; color: var(--text-secondary);
  margin-left: auto; flex-shrink: 0;
  cursor: pointer; transition: all 0.2s;
}
.credits-badge:active { transform: scale(0.95); }
.credits-badge:hover { background: rgba(240, 180, 41, 0.15); border-color: rgba(240, 180, 41, 0.3); }
.credits-badge-item { display: flex; align-items: center; gap: 0.2rem; }
.credits-badge-item .credit-views-count,
.credits-badge-item .credit-ai-count { font-weight: 700; color: var(--accent-gold); }
.credits-badge-divider { color: var(--border-medium); font-size: 0.65rem; }
.credits-badge-plus {
  font-size: 0.85rem; font-weight: 700; color: var(--accent-gold);
  margin-left: 0.1rem; line-height: 1;
}

/* ========================
   PURCHASE MODAL — Premium Paywall
   ======================== */
.purchase-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.purchase-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.purchase-modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0f1320 0%, #0b0f19 100%);
  border: 1px solid rgba(240, 180, 41, 0.12);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(240, 180, 41, 0.05);
  animation: purchaseSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes purchaseSlideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero header with background image */
.purchase-hero {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
}
.purchase-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.purchase-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 12, 20, 0.15) 0%,
    rgba(8, 12, 20, 0.5) 50%,
    rgba(15, 19, 32, 0.95) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
}
.purchase-hero .purchase-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}
.purchase-hero .purchase-modal-close:hover {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}
.purchase-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}
.purchase-hero-icon {
  font-size: 1.5rem;
  color: var(--accent-gold);
  filter: drop-shadow(0 0 8px rgba(240, 180, 41, 0.4));
  margin-bottom: 0.15rem;
}
.purchase-hero-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.purchase-sale-tag {
  display: inline-block;
  padding: 3px 10px;
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  border-radius: 4px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
  animation: pulse-sale 2s ease-in-out infinite;
}
@keyframes pulse-sale {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.03); }
}
.purchase-users-online {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.58rem;
  font-weight: 600;
  white-space: nowrap;
}
.purchase-users-online .pkg-buyers-icon,
.purchase-users-online > span:first-child {
  color: #48bb78;
  font-size: 0.5rem;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.purchase-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  line-height: 1.2;
}
.purchase-hero-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Free notice — replaces purchase tabs/packages */
.purchase-free-notice {
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.purchase-free-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}
.purchase-free-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-gold);
}
.purchase-free-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}
.purchase-free-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.purchase-free-btn {
  margin-top: 0.75rem;
  padding: 0.7rem 2rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.purchase-free-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.1);
}

/* Auth menu free notice */
.auth-menu-free-notice {
  color: var(--accent-gold) !important;
  opacity: 0.7;
  cursor: default !important;
  font-size: 0.8rem;
}

/* Tabs */
.purchase-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}
.purchase-tab-btn {
  flex: 1;
  padding: 0.7rem 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.purchase-tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}
.purchase-tab-btn:hover { color: var(--text-primary); }

/* Tab panels */
.purchase-tab-panel { display: none; padding: 1rem 1rem 1.5rem; }
.purchase-tab-panel.active { display: block; }

/* Package cards */
.purchase-packages { display: flex; flex-direction: column; gap: 1rem; }
.purchase-package-card {
  position: relative;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.purchase-package-card:hover {
  border-color: rgba(240, 180, 41, 0.25);
  background: rgba(240, 180, 41, 0.03);
}
.purchase-package-card.selected {
  border-color: var(--accent-gold);
  background: rgba(240, 180, 41, 0.06);
  box-shadow: 0 0 20px rgba(240, 180, 41, 0.1), inset 0 0 20px rgba(240, 180, 41, 0.02);
}
.purchase-package-card.popular {
  border-color: rgba(240, 180, 41, 0.3);
  background: rgba(240, 180, 41, 0.04);
}
.purchase-package-card.popular::before {
  content: 'BAN CHAY';
  position: absolute;
  top: -1px;
  right: 12px;
  padding: 2px 10px 4px;
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

/* Package top row: icon+name+badge | price */
.pkg-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.pkg-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.package-icon-badge {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.15);
  font-size: 0.85rem;
  color: var(--accent-gold);
  flex-shrink: 0;
  transition: all 0.25s;
}
.purchase-package-card.selected .package-icon-badge {
  background: rgba(240, 180, 41, 0.2);
  box-shadow: 0 0 10px rgba(240, 180, 41, 0.15);
}
.package-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.package-popular-badge {
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: #000;
  font-size: 0.58rem;
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Bottom row: credits + social proof */
.pkg-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Credits row */
.pkg-credits-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.55rem;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.pkg-credit-item {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.pkg-credit-num {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-gold);
}
.pkg-credit-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}
.pkg-credit-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* Price block in top row */
.pkg-price-main {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.package-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
  white-space: nowrap;
}
.package-original-price {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.5;
  line-height: 1;
}
.package-discount-badge {
  display: inline-block;
  padding: 1px 5px;
  background: #e53e3e;
  color: #fff;
  font-size: 0.52rem;
  font-weight: 700;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* Social proof */
.pkg-social-proof {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 500;
}
.pkg-buyers-icon {
  font-size: 0.4rem;
  color: #48bb78;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Trust bar */
.pkg-trust-bar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding: 0.7rem 0.5rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}
.pkg-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  text-align: center;
}
.pkg-trust-icon {
  font-size: 1rem;
  line-height: 1;
  filter: grayscale(0.2);
}
.pkg-trust-item span:last-child {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  line-height: 1.3;
}

/* QR Payment Bottom Sheet */
.qr-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 950;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.qr-sheet-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}
.qr-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 75vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #131929 0%, #0d1120 100%);
  border: 1px solid rgba(240, 180, 41, 0.12);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(240, 180, 41, 0.05);
  animation: qrSheetUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes qrSheetUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
.qr-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 10px auto 0;
}
.qr-sheet-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}
.qr-sheet-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.qr-sheet-body {
  padding: 0.75rem 1.25rem 1.5rem;
}
.sepay-qr-content {
  text-align: center;
  padding: 0;
}
.sepay-qr-header {
  margin-bottom: 0.75rem;
}
.sepay-pkg-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
}
.sepay-pkg-credits {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.sepay-qr-image {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: inline-block;
  margin-bottom: 0.75rem;
}
.sepay-qr-image img {
  display: block;
  border-radius: 4px;
}
.sepay-transfer-info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: left;
  margin-bottom: 0.75rem;
}
.sepay-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.8rem;
}
.sepay-info-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sepay-info-label {
  color: var(--text-muted);
  min-width: 75px;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.sepay-info-value {
  color: var(--text-primary);
  font-weight: 600;
  flex: 1;
  word-break: break-all;
}
.sepay-amount {
  color: var(--accent-gold);
  font-size: 1rem;
  font-weight: 800;
}
.sepay-order-code {
  font-family: monospace;
  letter-spacing: 0.1em;
  font-size: 1.1rem;
  color: var(--accent-gold);
}
.sepay-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}
.sepay-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-gold);
}
.sepay-notice {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: rgba(240, 180, 41, 0.04);
  border: 1px solid rgba(240, 180, 41, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}
.sepay-notice-icon {
  color: var(--accent-gold);
}
.sepay-premium-note {
  font-size: 0.75rem;
  color: var(--accent-purple);
  padding: 0.6rem 0.75rem;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.4;
}
.sepay-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sepay-save-btn, .sepay-copy-btn-lg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sepay-save-btn:hover, .sepay-copy-btn-lg:hover {
  background: rgba(240, 180, 41, 0.08);
  border-color: rgba(240, 180, 41, 0.2);
  color: var(--accent-gold);
}
.sepay-save-btn:active, .sepay-copy-btn-lg:active {
  transform: scale(0.97);
}
.sepay-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.sepay-waiting.completed {
  color: #4ade80;
}
.sepay-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.sepay-waiting.completed .sepay-spinner { display: none; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.sepay-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.sepay-success-icon {
  font-size: 1.2rem;
  color: #4ade80;
}
.sepay-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.no-credits-buy-btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: #000;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  margin-top: 0.5rem;
}
.no-credits-buy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(240, 180, 41, 0.3);
}

/* Payment Success Dialog */
.payment-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}
.payment-success-modal {
  width: 92%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #131929 0%, #0d1120 100%);
  border: 1px solid rgba(72, 187, 120, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(72, 187, 120, 0.08);
  animation: successPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes successPopIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.payment-success-icon-wrap {
  margin: 0 auto 1rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(72, 187, 120, 0.15), rgba(72, 187, 120, 0.05));
  border: 2px solid rgba(72, 187, 120, 0.3);
  animation: successRing 0.6s 0.3s ease both;
}
@keyframes successRing {
  from { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4); }
  to { box-shadow: 0 0 0 12px rgba(72, 187, 120, 0); }
}
.payment-success-icon {
  font-size: 1.8rem;
  color: #48bb78;
  animation: successCheck 0.4s 0.2s ease both;
}
@keyframes successCheck {
  from { opacity: 0; transform: scale(0); }
  60% { transform: scale(1.2); }
  to { opacity: 1; transform: scale(1); }
}
.payment-success-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #48bb78;
  margin-bottom: 0.35rem;
}
.payment-success-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
}
.payment-success-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.success-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.75rem;
}
.success-detail-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.success-detail-label {
  color: rgba(255, 255, 255, 0.5);
}
.success-detail-value {
  font-weight: 700;
  color: var(--text-primary);
}
.success-detail-value.highlight {
  color: #48bb78;
}
.payment-success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.payment-success-btn {
  display: block;
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.payment-success-btn.primary {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.25);
}
.payment-success-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3);
}
.payment-success-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}
.payment-success-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Premium success dialog variant */
.payment-success-icon-wrap.premium {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
  border-color: rgba(212, 175, 55, 0.3);
}
.payment-success-icon-wrap.premium .payment-success-icon {
  color: var(--accent-gold);
}
.premium-success .payment-success-title {
  color: var(--accent-gold);
  font-size: 1.25rem;
}
.premium-success {
  border-color: rgba(212, 175, 55, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(212, 175, 55, 0.08);
}
.premium-success .payment-success-btn.primary {
  background: linear-gradient(135deg, var(--accent-gold), #d4af37);
  color: #0a0e1a;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}
.premium-success-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  background: rgba(167, 139, 250, 0.05);
  border: 1px solid rgba(167, 139, 250, 0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  line-height: 1.45;
}
.premium-success-instructions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  text-align: left;
}
.premium-instruction-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.premium-instruction-item:hover {
  background: rgba(212, 175, 55, 0.08);
}
.premium-instruction-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.premium-instruction-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.premium-instruction-text strong {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
}
.premium-instruction-text span {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
}
.premium-instruction-text span strong {
  color: rgba(255, 255, 255, 0.8);
  font-size: inherit;
}

/* History */
.purchase-history { min-height: 100px; }
.history-empty, .history-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2rem 0;
}
.history-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.history-item:last-child { border-bottom: none; }
.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.history-package-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.history-amount { font-weight: 700; color: var(--accent-gold); font-size: 0.9rem; }
.history-item-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.history-date { font-size: 0.72rem; }

/* History sections */
.history-section { margin-bottom: 1rem; }
.history-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(240, 180, 41, 0.15);
  margin-bottom: 0.5rem;
}
.history-section-title svg { opacity: 0.7; stroke: var(--accent-gold); }

/* Premium report items */
.report-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(240, 180, 41, 0.04);
  border: 1px solid rgba(240, 180, 41, 0.1);
  margin-bottom: 0.5rem;
  transition: background 0.2s;
}
.report-item:active { background: rgba(240, 180, 41, 0.08); }
.report-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.15), rgba(240, 180, 41, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.report-item-info { flex: 1; min-width: 0; }
.report-item-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.report-item-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.report-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.report-btn-view {
  background: rgba(240, 180, 41, 0.12);
  color: var(--accent-gold);
}
.report-btn-view:active { background: rgba(240, 180, 41, 0.25); }
.report-btn-download {
  background: rgba(76, 175, 80, 0.12);
  color: #4CAF50;
}
.report-btn-download:active { background: rgba(76, 175, 80, 0.25); }

/* Report status badges */
.report-status {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
}
.report-status-processing {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  animation: statusPulse 2s ease-in-out infinite;
}
.report-status-done {
  background: rgba(72, 187, 120, 0.12);
  color: #48bb78;
}
.report-status-failed {
  background: rgba(245, 101, 101, 0.12);
  color: #f56565;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.report-item-processing {
  border-color: rgba(251, 191, 36, 0.15);
}
.report-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(251, 191, 36, 0.2);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.report-processing-text {
  font-size: 0.7rem;
  color: #fbbf24;
  opacity: 0.8;
}

/* History premium badge */
.history-premium-badge {
  color: var(--accent-gold);
  margin-right: 0.25rem;
}
.history-item-premium {
  border-left: 2px solid rgba(212, 175, 55, 0.3);
}

/* ========================
   NO CREDITS PROMPT
   ======================== */
.no-credits-prompt {
  text-align: center;
  padding: 2rem 1.5rem;
  margin: 1rem;
  background: rgba(240, 180, 41, 0.03);
  border: 1px solid rgba(240, 180, 41, 0.1);
  border-radius: var(--radius-md);
}
.no-credits-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.no-credits-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.35rem; }
.no-credits-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }
.btn-buy-credits-lg {
  display: inline-block; padding: 0.65rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: #000; font-size: 0.9rem; font-weight: 700;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-buy-credits-lg:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(240, 180, 41, 0.3); }

/* ========================
   NEW YEAR WELCOME PROMO MODAL
   ======================== */
.promo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.promo-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.promo-modal {
  width: 100%;
  max-width: 360px;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #0c0f1a 0%, #111827 100%);
  border: 1px solid rgba(240, 180, 41, 0.15);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(240, 180, 41, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  animation: promoPopIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes promoPopIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Close button */
.promo-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 5;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.promo-close:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

/* Image section */
.promo-image {
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
}
.promo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.promo-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(12, 15, 26, 0.4) 60%,
    rgba(12, 15, 26, 1) 100%
  );
  pointer-events: none;
}

/* Content section */
.promo-content {
  padding: 0 1.5rem 1.5rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.promo-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 3px 14px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(240, 180, 41, 0.2));
  border: 1px solid rgba(240, 180, 41, 0.25);
  color: var(--accent-gold);
  margin-bottom: 0.6rem;
}

.promo-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.25;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.promo-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.promo-desc strong {
  color: var(--accent-gold);
  font-weight: 700;
}

/* Gift display */
.promo-gifts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  background: rgba(240, 180, 41, 0.04);
  border: 1px solid rgba(240, 180, 41, 0.1);
  border-radius: 12px;
}
.promo-gift-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.promo-gift-icon {
  font-size: 1.2rem;
  color: var(--accent-gold);
  filter: drop-shadow(0 0 4px rgba(240, 180, 41, 0.3));
}
.promo-gift-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.promo-gift-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
}
.promo-gift-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}
.promo-gift-divider {
  width: 1px;
  height: 32px;
  background: rgba(240, 180, 41, 0.15);
}

.promo-wish {
  font-size: 0.75rem;
  color: rgba(240, 180, 41, 0.6);
  font-style: italic;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* CTA button */
.promo-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  min-height: 48px;
  background: linear-gradient(135deg, #f0b429, #d4910a);
  color: #0b0f19;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  box-shadow: 0 4px 24px rgba(240, 180, 41, 0.3);
  -webkit-tap-highlight-color: transparent;
}
.promo-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ========================
   TOAST NOTIFICATIONS
   ======================== */
.toast-container {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 0.5rem;
  width: 90%; max-width: 380px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  font-size: 0.82rem; color: var(--text-primary);
  pointer-events: auto; opacity: 0; transform: translateY(-12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon {
  flex-shrink: 0; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.72rem; font-weight: 700;
}
.toast-success .toast-icon { background: var(--accent-green-dim); color: var(--accent-green); }
.toast-error .toast-icon { background: var(--accent-red-dim); color: var(--accent-red); }
.toast-info .toast-icon { background: var(--accent-blue-dim); color: var(--accent-blue); }
.toast-warning .toast-icon { background: rgba(251, 146, 60, 0.12); color: var(--accent-orange); }
.toast-message { flex: 1; line-height: 1.4; }

/* ========================
   BUTTON CREDIT BADGES
   ======================== */
.btn-credit-badge {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.5;
  margin-left: 0.15rem;
}
.btn-consult-badge {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.7;
  margin-left: 0.1rem;
}

/* ========================
   DISCLAIMER MODAL
   ======================== */
.disclaimer-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.disclaimer-overlay.active {
  opacity: 1; pointer-events: auto;
}
.disclaimer-modal {
  background: linear-gradient(165deg, var(--bg-card) 0%, rgba(15, 20, 35, 0.98) 100%);
  border: 1px solid rgba(240, 180, 41, 0.15);
  border-radius: 20px;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(240, 180, 41, 0.04);
  transform: translateY(24px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.disclaimer-overlay.active .disclaimer-modal {
  transform: translateY(0) scale(1);
}
.disclaimer-hero {
  text-align: center;
  padding: 1.75rem 1.5rem 1rem;
}
.disclaimer-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 0 12px rgba(240, 180, 41, 0.3));
}
.disclaimer-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}
.disclaimer-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}
.disclaimer-body {
  padding: 0 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.disclaimer-card {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.disclaimer-card-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.disclaimer-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.disclaimer-card strong {
  color: var(--text-primary);
}
.disclaimer-quote {
  position: relative;
  padding: 0.7rem 1rem;
  margin: 0.15rem 0;
  background: rgba(240, 180, 41, 0.05);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--gold);
}
.disclaimer-quote-mark {
  font-size: 1.4rem;
  font-style: normal;
  line-height: 1;
  opacity: 0.35;
  margin-right: 0.15rem;
  vertical-align: -0.12em;
}
.disclaimer-footer {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 1.25rem 1.25rem 1.5rem;
  margin-top: 0.5rem;
}
.disclaimer-btn {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #f0b429 0%, #d4960a 60%, #b8800a 100%);
  color: #0a0e18;
  border: none;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(240, 180, 41, 0.25);
}
.disclaimer-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}
.disclaimer-link {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.disclaimer-link:active {
  color: var(--gold);
}

/* ========================
   CONSULT FEATURES GRID (legacy)
   ======================== */
.consult-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 6px;
}
.consult-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(240, 180, 41, 0.06);
  border: 1px solid rgba(240, 180, 41, 0.12);
  border-radius: var(--radius-sm);
}
.consult-feature-icon {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--accent-gold);
  line-height: 1.3;
}
.consult-feature-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
@media (max-width: 380px) {
  .consult-features {
    grid-template-columns: 1fr;
  }
}

/* ========================
   CONSULT VALUE BLOCK (new)
   ======================== */
.consult-value-block {
  padding: 1.125rem 1.25rem;
}

.consult-value-headline {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.consult-value-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.consult-value-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.consult-value-item:hover {
  background: rgba(240, 180, 41, 0.05);
  border-color: rgba(240, 180, 41, 0.15);
}

.consult-value-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 180, 41, 0.1);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--gold);
}

.consult-value-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.consult-value-content strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.consult-value-content span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* PDF section card — blue/gold accent instead of purple */
.step-card.consult-pdf-section::before {
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
}

/* ========================
   CONSULT SECTION DIVIDER
   ======================== */
.consult-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.5rem 0;
  padding: 0 8px;
}
.consult-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 140, 160, 0.25), transparent);
}
.consult-divider-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ========================
   PREMIUM PDF PROMOTED SECTION
   ======================== */
.consult-pdf-section {
  margin-top: 0;
}
.premium-pdf-inner {
  width: 100%;
  padding: 0;
}

/* Hero banner */
.premium-pdf-hero {
  position: relative;
  width: 100%;
  min-height: 140px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  overflow: hidden;
}
.premium-pdf-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.15) 0%, transparent 60%),
              radial-gradient(circle at 80% 30%, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
  pointer-events: none;
}
.premium-pdf-hero::after {
  content: '📄';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 60px;
  opacity: 0.15;
  pointer-events: none;
}
.premium-pdf-hero-overlay {
  position: relative;
  z-index: 2;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.premium-pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #d4af37, #b8962e);
  color: #1a1a2e;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.premium-pdf-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.premium-pdf-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.45;
  max-width: 85%;
}

/* Features grid */
.premium-pdf-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 6px;
}
.premium-pdf-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(15, 52, 96, 0.08);
  border: 1px solid rgba(15, 52, 96, 0.12);
  border-radius: var(--radius-sm);
}
.premium-pdf-feature-icon {
  flex-shrink: 0;
  font-size: 1rem;
  color: #d4af37;
  line-height: 1.3;
}
.premium-pdf-feature-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
@media (max-width: 380px) {
  .premium-pdf-features {
    grid-template-columns: 1fr;
  }
}

/* Purchase body */
.premium-pdf-body {
  padding: 0 16px 16px;
}
