/* ============================================================
   MIR 2025 Slot Simulator — "Midnight Amber" Redesign
   Dark-mode-first · Glassmorphism · Spring Physics
   ============================================================ */

/* ── 1. Design Tokens ── */
:root {
  /* Core backgrounds */
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-elevated: #1A1F33;
  --bg-glass: rgba(26, 31, 51, 0.72);

  /* Accent — Warm Amber */
  --accent-primary: #F59E0B;
  --accent-secondary: #FBBF24;
  --accent-glow: rgba(245, 158, 11, 0.15);

  /* Signal Colors */
  --signal-success: #10B981;
  --signal-warning: #F59E0B;
  --signal-danger: #EF4444;
  --signal-info: #3B82F6;

  /* Text hierarchy */
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;

  /* Glass morphism */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.04);

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0A0E1A 0%, #1E1B4B 50%, #0A0E1A 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);

  /* Legacy compat aliases */
  --primary: #F59E0B;
  --primary-dark: #D97706;
  --primary-light: rgba(245, 158, 11, 0.15);
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --accent: #F59E0B;
  --accent-light: rgba(245, 158, 11, 0.1);
  --gray-50: #1A1F33;
  --gray-100: #1F2544;
  --gray-200: rgba(255,255,255,0.08);
  --gray-300: rgba(255,255,255,0.12);
  --gray-400: #6B7280;
  --gray-500: #9CA3AF;
  --gray-600: #D1D5DB;
  --gray-700: #E5E7EB;
  --gray-800: #F3F4F6;
  --gray-900: #F9FAFB;

  /* Layout */
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 240px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);

  /* Spring physics curves */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-snappy: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --spring-tight: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-loose: cubic-bezier(0.22, 1.2, 0.36, 1);
  --spring-bouncy: cubic-bezier(0.175, 0.885, 0.32, 1.4);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ── Light Mode ── */
html.light {
  --bg-primary: #FAFAF9;
  --bg-secondary: #FFFFFF;
  --bg-elevated: #F5F4F2;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #9CA3AF;
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-highlight: rgba(0, 0, 0, 0.02);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
  --gray-50: #FAFAF9;
  --gray-100: #F5F4F2;
  --gray-200: #E5E4E2;
  --gray-300: #D1D0CE;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --primary-light: rgba(245, 158, 11, 0.12);
}

html.light .sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--glass-border);
}

html.light .card {
  background: var(--bg-secondary);
  border-color: var(--glass-border);
}

html.light body::before {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
    var(--bg-primary);
}

html.light .loading-screen {
  background: var(--bg-primary);
}

html.light input[type="text"],
html.light input[type="email"],
html.light input[type="password"],
html.light input[type="number"],
html.light select,
html.light textarea {
  background: var(--bg-elevated);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

html.light .mobile-bar {
  background: rgba(255, 255, 255, 0.88);
  border-top-color: rgba(0, 0, 0, 0.06);
}

html.light .step-nav {
  background: rgba(255, 255, 255, 0.88);
  border-top-color: rgba(0, 0, 0, 0.06);
}

html.light .toast {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ── 2. Reset & Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

button, a, .step, .funnel-spec-card, .funnel-chip, .funnel-hosp-card,
.wizard-option, .wizard-spec-card, .wizard-prov-card, .pref-group-controls .chip,
.tab, .pref-rank-input, .step-nav-btn, .btn-google, .btn-whatsapp, .sheet-close,
.step-nav-center, .sidebar-nav-item, .mobile-bar-item {
  user-select: none;
  -webkit-user-select: none;
}

button, a, input, select, textarea, [onclick], [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button, [role="button"] {
  min-height: 44px;
  min-width: 44px;
}

.btn-sm, .btn-move, .btn-remove, .wizard-skip,
.wizard-rank-btn, .sheet-close, .funnel-back-btn {
  min-height: 36px;
  min-width: 36px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 0.9rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

/* ── Ambient Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
    var(--bg-primary);
  animation: ambientShift 20s ease-in-out infinite alternate;
}

@keyframes ambientShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(15deg); }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
}

/* ── 3. Loading Screen: "The Arrival" ── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.loading-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.2) 0%, transparent 70%);
  animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.loading-logo {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
  z-index: 1;
  margin-bottom: 0.5rem;
}

.loading-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  z-index: 1;
  margin-bottom: 1.5rem;
  animation: loadingTitleIn 0.8s ease-out 0.2s both;
}

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

.loading-bar {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  z-index: 1;
  margin-bottom: 1rem;
}

.loading-bar-fill {
  height: 100%;
  width: 30%;
  background: var(--gradient-accent);
  border-radius: 2px;
  animation: loadingBarShimmer 1.5s ease-in-out infinite;
}

@keyframes loadingBarShimmer {
  0% { transform: translateX(-100%); width: 30%; }
  50% { width: 60%; }
  100% { transform: translateX(400%); width: 30%; }
}

.loading-tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  z-index: 1;
  animation: loadingTitleIn 0.8s ease-out 0.6s both;
}

.loading-screen h1.old-loading-title,
.loading-screen .loading-spinner {
  display: none;
}

/* ── 4. Sidebar Navigation (Desktop) ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 1.25rem 0.75rem;
  transition: transform 0.3s var(--spring-soft);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 1.25rem;
}

.sidebar-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0A0E1A;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
  width: 100%;
}

.sidebar-nav-item:hover:not(.locked) {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-primary);
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-nav-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar-nav-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-nav-item.active svg {
  opacity: 1;
  stroke: var(--accent-primary);
}

/* Sidebar user card */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 0.5rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #0A0E1A;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-order {
  font-size: 0.7rem;
  font-family: 'Inter', monospace;
  color: var(--accent-primary);
  font-weight: 600;
}

.sidebar-user-prefs {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

/* Sidebar version label */
.sidebar-version {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  position: fixed;
  left: 4px;
  bottom: 8px;
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.4;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 10;
}

/* Sidebar footer */
.sidebar-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

html.dark .theme-icon-light { display: none; }
html.light .theme-icon-dark { display: none; }
html.dark .theme-icon-dark { display: block; }
html.light .theme-icon-light { display: block; }

.sidebar-community {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.community-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal-success);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

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

/* ── 5. Mobile Bottom Bar ── */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  padding: 0.4rem 0;
  padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}

.mobile-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 1rem;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.mobile-bar-item.active {
  color: var(--accent-primary);
}

.mobile-bar-item.active svg {
  stroke: var(--accent-primary);
}

.mobile-bar-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s;
}

.mobile-bar-item.active .mobile-bar-dot {
  background: var(--accent-primary);
}

.mobile-bar-item.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── 6. Main Content Area ── */
main {
  margin-left: var(--sidebar-width);
  max-width: 960px;
  padding: 2rem 2rem 4rem;
}

section { display: none; }
section.active {
  display: block;
  animation: sectionIn 0.4s var(--ease-out-expo);
}

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

/* ── 7. Typography ── */
h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

h4 {
  color: var(--text-primary);
}

/* ── 8. Cards — Glassmorphism ── */
.card {
  background: var(--gradient-card);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow:
    0 0 0 1px var(--glass-highlight) inset,
    0 8px 32px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
  transition: transform 0.4s var(--spring-soft), box-shadow 0.4s ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px var(--glass-highlight) inset,
    0 12px 48px rgba(0, 0, 0, 0.35);
}

/* ── 9. Forms ── */
label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: border-color 0.25s var(--spring-soft), box-shadow 0.25s var(--spring-soft);
}

input::placeholder, textarea::placeholder {
  color: var(--text-tertiary);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group { flex: 1; }

/* ── 10. Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn:not(:active):not(:disabled) {
  transition: transform 0.3s var(--spring-tight), background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #0A0E1A;
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-success { background: var(--signal-success); color: white; }
.btn-success:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3); }

.btn-danger { background: var(--signal-danger); color: white; }
.btn-danger:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3); }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Launch button (simulation) */
.btn-launch {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 2rem;
  animation: btnBreathe 3s ease-in-out infinite;
}

@keyframes btnBreathe {
  0%, 100% { box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 4px 24px rgba(245, 158, 11, 0.4); }
}

.btn-launch:hover:not(:disabled) {
  animation: none;
  box-shadow: 0 4px 24px rgba(245, 158, 11, 0.4);
}

/* ── 11. Auth Card ── */
.auth-benefits {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.auth-benefit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-benefit svg {
  color: var(--accent-primary);
  stroke: var(--accent-primary);
  flex-shrink: 0;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--gradient-accent);
  color: #0A0E1A;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
  margin-bottom: 0.75rem;
}

.btn-google:active { transform: scale(0.97); }
.btn-google:hover { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35); }

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.auth-divider span {
  padding: 0 0.75rem;
}

.auth-buttons {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
}

.auth-links {
  text-align: center;
  margin-top: 0.5rem;
}

.auth-links a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.82rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-error {
  color: var(--signal-danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.auth-loading {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ── 12. Profile Section ── */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}



/* Community Banner */
.community-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.community-banner strong {
  color: var(--accent-primary);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border: none;
  border-radius: 2rem;
  background: #25D366;
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
  white-space: nowrap;
}

.btn-whatsapp:active { transform: scale(0.95); }

/* Info Box */
.info-box {
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Profile Guide */
.profile-guide {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.profile-guide-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.guide-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Specialty Landscape Heat Map */

/* Order stat */
.order-stat {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
}

/* Terms */
.terms-section {
  margin: 1rem 0;
}

.terms-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.terms-checkbox-label input[type="checkbox"] {
  margin-top: 0.15rem;
  accent-color: var(--accent-primary);
}

.terms-details {
  margin-top: 0.5rem;
}

.terms-details summary {
  cursor: pointer;
  color: var(--accent-primary);
  font-size: 0.82rem;
  font-weight: 500;
}

.terms-content {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.terms-content p { margin-bottom: 0.5rem; }

.terms-content a {
  color: var(--accent-primary);
}

/* Field errors */
.field-error {
  color: var(--signal-danger);
  font-size: 0.78rem;
  margin-top: 0.25rem;
  min-height: 0;
}

input.has-error {
  border-color: var(--signal-danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ── 13. Preferences Section ── */

.preferences-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* Slot browser */
.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  width: auto;
  flex: 1;
  min-width: 150px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.filtered-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.slot-list {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.slot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
  transition: background 0.15s ease;
}

.slot-item:last-child { border-bottom: none; }
.slot-item:hover { background: rgba(255,255,255,0.03); }

.slot-item .slot-info { flex: 1; min-width: 0; }

.slot-item .slot-specialty {
  font-weight: 600;
  color: var(--text-primary);
}

.slot-item .slot-hospital {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.slot-item .slot-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.slot-item .slot-count {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  color: var(--text-tertiary);
}

.slot-item .btn-add {
  background: var(--accent-primary);
  color: #0A0E1A;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--spring), background 0.15s ease;
}

.slot-item .btn-add:hover { background: var(--accent-secondary); }
.slot-item .btn-add:active:not(:disabled) { transform: scale(0.85); }
.slot-item .btn-add:disabled { opacity: 0.3; cursor: not-allowed; }
.slot-item.added { background: var(--accent-glow); }

.slot-item .btn-add.confirmed {
  background: var(--signal-success);
  pointer-events: none;
  animation: btnConfirmPop 0.35s ease-out;
}

@keyframes btnConfirmPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.slot-item.flash-green {
  animation: slotFlashGreen 0.6s ease-out;
}

@keyframes slotFlashGreen {
  0% { background: rgba(16, 185, 129, 0.3); }
  100% { background: var(--accent-glow); }
}

.slot-item .rank-badge {
  display: none;
  background: var(--accent-primary);
  color: #0A0E1A;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 1rem;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.slot-item .rank-badge.visible {
  display: inline-flex;
  animation: badgeSlideIn 0.3s ease-out;
}

@keyframes badgeSlideIn {
  0% { opacity: 0; transform: translateX(-8px) scale(0.6); }
  60% { opacity: 1; transform: translateX(2px) scale(1.05); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

.slot-item.added .rank-badge {
  display: inline-flex;
}

.slot-item.added .btn-add {
  display: none;
}

/* Preference list header */
.pref-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.pref-list-header h3 {
  margin-bottom: 0;
}

/* Preference ring */
.pref-ring {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.pref-ring-svg {
  display: block;
}

.pref-ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 3;
}

.pref-ring-fill {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--spring-soft);
}

.pref-ring-text {
  font-size: 10px;
  font-weight: 700;
  fill: var(--accent-primary);
  text-anchor: middle;
  dominant-baseline: central;
}

/* Preference list */
.pref-list {
  min-height: 100px;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.pref-list.has-items {
  border-style: solid;
  border-color: var(--glass-border);
}

.pref-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--text-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: grab;
  transition: transform 0.3s var(--spring-soft), box-shadow 0.25s ease, border-color 0.15s ease;
}

.pref-item.chance-high { border-left-color: var(--signal-success); }
.pref-item.chance-medium { border-left-color: var(--signal-warning); }
.pref-item.chance-low { border-left-color: var(--signal-danger); }
.pref-item.chance-none { border-left-color: var(--text-tertiary); }

.pref-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pref-item.dragging { opacity: 0.5; transform: scale(1.03) rotate(1deg); box-shadow: var(--shadow-lg); }
.pref-item.drag-over { border-top: 2px solid var(--accent-primary); }

.pref-rank-input {
  width: 46px !important;
  min-width: 46px;
  padding: 0.2rem 0.25rem !important;
  font-weight: 700;
  color: var(--accent-primary);
  text-align: center;
  background: var(--accent-glow) !important;
  border: 1px solid transparent !important;
  border-radius: 50% !important;
  font-size: 1rem;
  -moz-appearance: textfield;
  flex-shrink: 0;
}

.pref-drag-handle {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  letter-spacing: 1px;
}

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

.pref-rank-input:hover {
  border-color: var(--glass-border) !important;
}

.pref-rank-input:focus {
  border-color: var(--accent-primary) !important;
  background: var(--bg-elevated) !important;
  box-shadow: 0 0 0 2px var(--accent-glow) !important;
}

.pref-item .pref-info { flex: 1; min-width: 0; }

.pref-item .pref-specialty {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.pref-item .pref-hospital {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pref-item .pref-actions {
  display: flex;
  gap: 0.25rem;
}

.pref-item .btn-move,
.pref-item .btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.35rem;
  border-radius: 6px;
  color: var(--text-tertiary);
  transition: color 0.15s, background 0.15s;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pref-item .btn-move:hover { color: var(--accent-primary); background: var(--accent-glow); }
.pref-item .btn-remove:hover { color: var(--signal-danger); background: rgba(239, 68, 68, 0.1); }

/* Pref meta tags */
.pref-meta { display: none; }
.pref-meta-tag { display: none; }

/* Pref reorder hint */
.pref-reorder-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
  display: none;
}

/* Group controls */
.pref-group-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: rgba(255,255,255,0.04);
}

.chip.active {
  background: var(--accent-glow);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Selection toolbar */
.selection-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.selection-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.batch-move-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.batch-move-input {
  width: 60px !important;
  padding: 0.25rem 0.4rem !important;
  font-size: 0.8rem !important;
}

/* Pref empty state */
.pref-empty {
  padding: 2.5rem 1rem;
  text-align: center;
}

.pref-empty-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.pref-empty-illustration svg {
  color: var(--text-tertiary);
  opacity: 0.5;
}

.pref-empty-illustration p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.pref-empty-sub {
  font-size: 0.82rem !important;
  color: var(--text-tertiary) !important;
  font-weight: 400 !important;
}

.pref-empty-text-mobile { display: none; }

/* Pref checkbox */
.pref-checkbox {
  width: 16px;
  min-width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  flex-shrink: 0;
}

/* Pref selected */
.pref-item.selected {
  background: var(--accent-glow);
  border-color: rgba(245, 158, 11, 0.2);
}


/* Funnel navigation */
.funnel-spec-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.2s var(--spring-soft);
  background: rgba(255,255,255,0.02);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.funnel-spec-card:hover {
  background: rgba(255,255,255,0.05);
}

.funnel-spec-card:active {
  transform: scale(0.98);
}

.funnel-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  margin: 0 0.25rem 0.35rem 0;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s ease;
}

.funnel-chip:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.funnel-chip.active-chip {
  background: var(--accent-glow);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.funnel-hosp-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.funnel-hosp-card:hover {
  background: rgba(255,255,255,0.04);
}

.funnel-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: background 0.15s;
}

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

.funnel-search {
  margin-bottom: 0.75rem;
}

.funnel-spec-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.funnel-spec-name {
  font-weight: 600;
}

/* Pref group headers */
.pref-group-header {
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
}

/* ── 14. Simulation Section ── */
.sim-launch-card {
  text-align: center;
}

.sim-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.sim-summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sim-summary-icon {
  color: var(--accent-primary);
  flex-shrink: 0;
  display: flex;
}

.sim-summary-icon svg {
  stroke: var(--accent-primary);
}

.sim-config {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.sim-prereqs {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  justify-content: center;
}

.prereq-item { white-space: nowrap; }

/* Simulation progress */
.sim-progress {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.sim-progress-ring-container {
  position: relative;
}

.sim-ring-track {
  stroke: rgba(255,255,255,0.06);
}

.sim-ring-fill {
  stroke: var(--accent-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}

.sim-ring-text {
  font-size: 1.8rem;
  font-weight: 800;
  fill: var(--accent-primary);
  font-family: 'Inter', sans-serif;
}

.sim-ring-label {
  font-size: 0.65rem;
  fill: var(--text-tertiary);
  font-family: 'Inter', sans-serif;
}


.progress-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}


/* Hero Result */
.sim-hero-result {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--gradient-hero) !important;
  border: 1px solid rgba(245, 158, 11, 0.15);
  animation: heroReveal 0.8s var(--spring-bouncy) both;
}

@keyframes heroReveal {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.sim-hero-number {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.sim-hero-text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1rem;
}

.sim-hero-slot {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 600;
}



/* Probability tables */
.prob-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.prob-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--glass-border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prob-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prob-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.prob-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  min-width: 80px;
}

.prob-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--spring-soft);
}

.prob-bar-fill.high { background: var(--signal-success); }
.prob-bar-fill.medium { background: var(--signal-warning); }
.prob-bar-fill.low { background: var(--signal-danger); }
.prob-bar-fill.none { background: var(--text-tertiary); }

/* Interpretation */
.interpretation-callout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.interpretation-callout svg {
  stroke: var(--signal-info);
  flex-shrink: 0;
}

.sim-interpretation summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.interpretation-content {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}

.interpretation-content h4 {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.interpretation-content ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.interpretation-content li {
  margin-bottom: 0.35rem;
}

.interpretation-content p {
  margin-bottom: 0.5rem;
}

/* Simulation result tiers (existing) */
.sim-tier-card {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--text-tertiary);
}

.sim-tier-card.tier-high { border-left-color: var(--signal-success); background: rgba(16, 185, 129, 0.06); }
.sim-tier-card.tier-medium { border-left-color: var(--signal-warning); background: rgba(245, 158, 11, 0.06); }
.sim-tier-card.tier-low { border-left-color: var(--signal-danger); background: rgba(239, 68, 68, 0.06); }

/* ── 15. Sticky Pref Bar ── */
.sticky-pref-bar {
  position: fixed;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sticky-pref-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 0 0 2rem 2rem;
  transition: width 0.3s ease;
}

.sticky-pref-count {
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.sticky-pref-eye-btn {
  min-width: auto !important;
  min-height: auto !important;
  padding: 0.3rem !important;
  border-radius: 50%;
  background: var(--accent-glow) !important;
  color: var(--accent-primary) !important;
  border: none !important;
}

/* ── 16. Bottom Sheet ── */
.slot-browser-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  background: var(--bg-secondary);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s var(--spring-loose);
}

.slot-browser-sheet.open {
  display: flex;
  transform: translateY(0);
}

.sheet-drag-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  margin: 0.5rem auto;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.sheet-close {
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
}

.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

/* ── 17. Step Nav Footer ── */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1rem;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  z-index: 100;
  box-shadow: 0 -1px 0 var(--glass-highlight) inset;
}

.step-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.15s ease;
}

.step-nav-btn:active:not(:disabled) {
  transform: scale(0.9);
  background: rgba(255,255,255,0.12);
}

.step-nav-btn.step-nav-next {
  background: var(--gradient-accent);
  color: #0A0E1A;
}

.step-nav-btn.step-nav-next:active {
  background: var(--accent-primary);
}

.step-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.step-nav-btn[hidden] {
  visibility: hidden;
}

.step-nav-center {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 2rem;
  background: var(--gradient-accent);
  color: #0A0E1A;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  transition: transform 0.2s var(--spring);
  animation: stepNavCenterIn 0.3s var(--spring) both;
}

.step-nav-center:hover { transform: scale(1.04); }
.step-nav-center:active { transform: scale(0.97); }
.step-nav-center svg { flex-shrink: 0; }

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

main > section {
  padding-bottom: 4.5rem;
}

/* ── 18. Toasts ── */
.toast-container {
  position: fixed;
  bottom: 4.5rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 300;
  max-width: 380px;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-left: 3px solid var(--accent-primary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s var(--spring-loose);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.success { border-left-color: var(--signal-success); }
.toast.error { border-left-color: var(--signal-danger); }
.toast.warning { border-left-color: var(--signal-warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.slide-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%); }
}

.toast-undo {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  color: var(--accent-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}

/* ── 19. Wizard ── */
.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wizard-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.wizard-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.wizard-skip {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  cursor: pointer;
}

.wizard-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.wizard-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.wizard-option,
.wizard-spec-card,
.wizard-prov-card {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.wizard-option:hover,
.wizard-spec-card:hover,
.wizard-prov-card:hover {
  background: rgba(255,255,255,0.04);
}

.wizard-option.selected,
.wizard-spec-card.selected {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.wizard-rank-btn {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
}

/* ── 20. Shake Animation ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.shake {
  animation: shake 0.3s ease;
}

/* Hidden stepper (replaced by sidebar/mobile-bar) */
header { display: none !important; }
.stepper { display: none !important; }

/* ── 21. Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── 22. Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .sidebar-version {
    display: none;
  }

  .mobile-bar {
    display: flex;
  }

  main {
    margin-left: 0;
    padding: 1rem 1rem 6rem;
    max-width: none;
  }

  .preferences-layout {
    grid-template-columns: 1fr;
  }

  /* Hide slot browser card on mobile (use sheet instead) */
  .slot-browser-card {
    display: none;
  }

  .pref-empty-text-desktop { display: none; }
  .pref-empty-text-mobile { display: inline; }


  .pref-reorder-hint {
    display: block;
  }



  .auth-benefits {
    flex-direction: column;
    gap: 0.5rem;
  }


  h2 { font-size: 1.3rem; }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 5.5rem;
    max-width: none;
  }

  .toast {
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .step-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  /* Mobile preference items */
  .pref-item {
    position: relative;
    display: grid !important;
    grid-template-columns: 44px 1fr 40px;
    align-items: start;
    gap: 0;
    padding: 14px 12px 14px 14px;
    margin-bottom: 8px;
    border: none !important;
    border-left: 4px solid rgba(255,255,255,0.08) !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,0.03);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 4px 16px -4px rgba(0,0,0,0.15);
    cursor: default;
    animation: m-prefCardReveal 0.5s var(--spring-soft) both;
    overflow: hidden;
  }

  .pref-item:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  }

  @keyframes m-prefCardReveal {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .pref-item.chance-high {
    border-left-color: var(--signal-success) !important;
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 60%, rgba(16, 185, 129, 0.08) 100%);
  }
  .pref-item.chance-medium {
    border-left-color: var(--signal-warning) !important;
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 60%, rgba(245, 158, 11, 0.08) 100%);
  }
  .pref-item.chance-low {
    border-left-color: var(--signal-danger) !important;
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 60%, rgba(239, 68, 68, 0.08) 100%);
  }

  .pref-item .pref-checkbox {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 16px !important;
    height: 16px;
    margin: 0;
    opacity: 0;
    z-index: 5;
    transition: opacity 0.2s ease;
  }

  .pref-list.has-items .pref-item.selected .pref-checkbox,
  .pref-item .pref-checkbox:checked {
    opacity: 1;
  }

  .pref-item .pref-drag-handle {
    display: none !important;
  }

  .pref-item .pref-rank-input {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: start;
    width: 44px !important;
    min-width: 44px;
    height: 44px;
    padding: 0 !important;
    border-radius: 13px !important;
    font-size: 1rem;
    font-weight: 800;
    background: rgba(255,255,255,0.06) !important;
    border: 1.5px solid var(--glass-border) !important;
    color: var(--text-primary);
  }

  .pref-item .pref-info {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 0 10px;
    min-width: 0;
  }

  .pref-item .pref-specialty {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pref-item .pref-hospital {
    font-size: 0.546rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pref-meta {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
  }

  .pref-meta-tag {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(255,255,255,0.04);
    color: var(--text-tertiary);
  }

  .pref-item .pref-actions {
    grid-column: 3;
    grid-row: 1 / -1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding-top: 2px;
  }

  .pref-item .btn-move,
  .pref-item .btn-remove {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
  }

  .pref-list {
    border: none !important;
    padding: 0 !important;
    background: transparent;
    min-height: 60px;
  }

  /* Probability tables mobile */
  .card {
    padding: 1rem;
    overflow-x: auto;
  }

  .prob-table {
    font-size: 0.75rem;
  }

  .prob-table th,
  .prob-table td {
    padding: 0.4rem 0.35rem;
  }

  .prob-table th:first-child,
  .prob-table td:first-child {
    width: 24px;
    padding-right: 0;
  }

  .prob-table td:nth-child(2) {
    word-break: break-word;
  }

  .prob-table .badge-info {
    display: none;
  }

  .prob-pct-cell {
    width: 36px;
    font-size: 0.72rem;
  }

  /* Edge flash feedback */
  .edge-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .edge-flash.amber {
    box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.3);
    opacity: 1;
  }

  .edge-flash.red {
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.3);
    opacity: 1;
  }
}

/* Desktop: hide mobile-only elements */
@media (min-width: 769px) {
  .mobile-bar { display: none; }
  .pref-empty-text-mobile { display: none; }
  .pref-reorder-hint { display: none; }

  /* Hide step-nav on desktop (sidebar replaces it) */
  .step-nav { display: none; }
}

/* ── 23. Number Count-Up Animation Class ── */
.count-up {
  display: inline-block;
}

/* ── 24. Haptic Edge Flash ── */
.edge-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.edge-flash.active {
  opacity: 1;
}

.edge-flash.amber {
  box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.3);
}

.edge-flash.red {
  box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.3);
}


/* Tier summary */
.tier-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tier-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tier-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 140px;
}

.tier-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.tier-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s var(--spring-soft);
}

.tier-bar.high { background: var(--signal-success); }
.tier-bar.medium { background: var(--signal-warning); }
.tier-bar.low { background: var(--signal-danger); }

.tier-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Probability bar in tables */
.prob-bar-container {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.prob-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--spring-soft);
}

.prob-bar.high { background: var(--signal-success); }
.prob-bar.medium { background: var(--signal-warning); }
.prob-bar.low { background: var(--signal-danger); }

.prob-bar-cell {
  width: 200px;
}

.prob-pct-cell {
  width: 50px;
  text-align: right;
  font-weight: 700;
}

/* Badge */
.badge {
  display: inline-flex;
  padding: 0.1rem 0.4rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

.badge-info {
  background: var(--accent-glow);
  color: var(--accent-primary);
}

.badge-prob {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  color: #fff;
}
.badge-prob-high { background: var(--signal-success); }
.badge-prob-medium { background: var(--signal-warning); }
.badge-prob-low { background: var(--signal-danger); }

/* ── 27. Funnel Navigation Extras ── */
.funnel-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.bc-link {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
  text-decoration: none;
}

.bc-link:hover { text-decoration: underline; }

.bc-sep {
  color: var(--text-tertiary);
}

.bc-current {
  color: var(--text-primary);
  font-weight: 600;
}

.funnel-list {
  max-height: 400px;
  overflow-y: auto;
}

.funnel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.chip-count {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-left: 0.25rem;
}

.funnel-bulk-add {
  margin-bottom: 0.75rem;
}

.funnel-spec-card.dimmed {
  opacity: 0.4;
}

/* Spec card parts */
.spec-card-info { flex: 1; min-width: 0; }
.spec-card-name { font-weight: 600; }
.spec-card-meta { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }
.spec-card-hint {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  white-space: nowrap;
  margin: 0 0.35rem;
}

.spec-card-hint.hint-good { background: rgba(16, 185, 129, 0.15); color: var(--signal-success); }
.spec-card-hint.hint-possible { background: rgba(245, 158, 11, 0.15); color: var(--signal-warning); }
.spec-card-hint.hint-hard { background: rgba(239, 68, 68, 0.15); color: var(--signal-danger); }
.spec-card-hint.hint-out { background: rgba(107, 114, 128, 0.15); color: var(--text-tertiary); }

.spec-card-arrow {
  color: var(--text-tertiary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Hospital card parts */
.hosp-card-info { flex: 1; min-width: 0; }
.hosp-card-name { font-weight: 600; font-size: 0.85rem; }
.hosp-card-city { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.hosp-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-add-hosp {
  background: var(--accent-primary);
  color: #0A0E1A;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--spring);
}

.btn-add-hosp:active:not(:disabled) { transform: scale(0.85); }
.btn-add-hosp:disabled { opacity: 0.3; cursor: not-allowed; }

.hosp-rank-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-glow);
  padding: 0.1rem 0.4rem;
  border-radius: 1rem;
}

.funnel-hosp-card.added {
  background: var(--accent-glow);
}

/* Tier badges */
.tier-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: white;
}

.tier-badge.tier-s { background: #9333ea; }
.tier-badge.tier-a { background: var(--signal-success); }
.tier-badge.tier-b { background: var(--signal-info); }
.tier-badge.tier-c { background: var(--text-tertiary); }

/* ── 28. Wizard Extras ── */
.wizard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
  font-size: 0.78rem;
}

.wizard-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
}

.wizard-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-easy { background: var(--signal-success); }
.dot-medium { background: var(--signal-warning); }
.dot-hard { background: var(--signal-danger); }
.dot-out { background: var(--text-tertiary); }

.wizard-spec-grid,
.wizard-prov-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 50vh;
  overflow-y: auto;
}

.wizard-spec-card,
.wizard-prov-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wsc-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.wizard-spec-card.selected .wsc-check {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.wizard-spec-card.selected .wsc-check::after {
  content: '✓';
  color: #0A0E1A;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.wsc-info { flex: 1; min-width: 0; }
.wsc-name { font-weight: 600; font-size: 0.88rem; }
.wsc-meta { font-size: 0.72rem; color: var(--text-tertiary); }

.wsc-difficulty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.wsc-diff-bar {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.wsc-diff-fill {
  height: 100%;
  border-radius: 2px;
}

.diff-good .wsc-diff-fill { background: var(--signal-success); }
.diff-possible .wsc-diff-fill { background: var(--signal-warning); }
.diff-hard .wsc-diff-fill { background: var(--signal-danger); }
.diff-out .wsc-diff-fill { background: var(--text-tertiary); }

.wsc-diff-label {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.wsc-diff-label.hint-good { color: var(--signal-success); }
.wsc-diff-label.hint-possible { color: var(--signal-warning); }
.wsc-diff-label.hint-hard { color: var(--signal-danger); }
.wsc-diff-label.hint-out { color: var(--text-tertiary); }

/* Province wizard cards */
.wpc-name { font-weight: 600; font-size: 0.88rem; }
.wpc-meta { font-size: 0.72rem; color: var(--text-tertiary); }

.wpc-difficulty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.wpc-diff-bar {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.wpc-diff-fill {
  height: 100%;
  border-radius: 2px;
}

.prov-easy .wpc-diff-fill { background: var(--signal-success); }
.prov-medium .wpc-diff-fill { background: var(--signal-warning); }
.prov-hard .wpc-diff-fill { background: var(--signal-danger); }

.wpc-diff-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.wizard-prov-card.selected {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

/* Wizard ranking */
.wizard-rank-section {
  margin-bottom: 1rem;
}

.wizard-rank-section h4 {
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

.wizard-rank-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.wizard-rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.wizard-rank-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.wizard-rank-buttons {
  display: flex;
  gap: 0.2rem;
}

/* Wizard confirm */
.wizard-confirm-count {
  text-align: center;
  padding: 1.5rem 0;
}

.wc-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
}

.wc-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ── 29. Selection Toolbar Mobile ── */
@media (max-width: 768px) {
  .selection-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-color: var(--glass-border);
  }
}

/* ── 30. Sim Progress Fade ── */
.sim-progress.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ============================================================
   31. Share Panel & Gate
   ============================================================ */

.sim-share-panel {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.sim-share-msg {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.sim-share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--spring), box-shadow 0.2s ease, opacity 0.2s ease;
  color: white;
}

.share-btn:active {
  transform: scale(0.96);
}

.share-btn-whatsapp {
  background: #25d366;
}

.share-btn-whatsapp:hover {
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
}

.share-btn-twitter {
  background: #1d1d1f;
}

.share-btn-twitter:hover {
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

.share-btn-copy {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.share-btn-copy:hover {
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

/* Results gate overlay */
#simResults {
  position: relative;
}

.sim-results-locked > .card,
.sim-results-locked > .sim-hero-result {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.sim-share-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  transition: opacity 0.4s ease;
}

.sim-share-gate.fade-out {
  opacity: 0;
  pointer-events: none;
}

.sim-share-gate-content {
  text-align: center;
  max-width: 420px;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.sim-share-gate-content h3 {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.sim-share-gate-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.sim-share-gate-content .sim-share-buttons {
  justify-content: center;
}

@media (max-width: 768px) {
  .sim-share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
  }
}

/* ── Coffee / Donation Card ── */
.coffee-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(245, 158, 11, 0.12);
  margin-top: 0.5rem;
}

.coffee-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.coffee-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.coffee-text {
  flex: 1;
  min-width: 0;
}

.coffee-headline {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.coffee-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.btn-coffee {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.25rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: #0A0E1A;
  background: var(--gradient-accent);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-coffee:hover {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .coffee-inner {
    flex-direction: column;
    text-align: center;
  }

  .btn-coffee {
    width: 100%;
    justify-content: center;
  }
}

/* ── Share Hero as Image Button ── */
.btn-share-instagram {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: linear-gradient(135deg, #833ab4, #e1306c, #f77737);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(225, 48, 108, 0.2);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-share-instagram:hover {
  box-shadow: 0 4px 20px rgba(225, 48, 108, 0.35);
  transform: translateY(-1px);
}

/* ── Instagram Card ── */
.instagram-card {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.06) 0%, rgba(131, 58, 180, 0.04) 100%);
  border: 1px solid rgba(225, 48, 108, 0.12);
  margin-top: 0.5rem;
}

.instagram-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.instagram-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.instagram-text {
  flex: 1;
  min-width: 0;
}

.instagram-headline {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.instagram-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.btn-instagram {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #833ab4, #e1306c, #f77737);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(225, 48, 108, 0.2);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-instagram:hover {
  box-shadow: 0 4px 20px rgba(225, 48, 108, 0.35);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .instagram-inner {
    flex-direction: column;
    text-align: center;
  }

  .btn-instagram {
    width: 100%;
    justify-content: center;
  }
}
