:root {
  --bg: #071935;
  --card: rgba(14, 44, 82, 0.88);
  --line: rgba(124, 168, 220, 0.15);
  --text: #f5f7fb;
  --muted: rgba(245, 247, 251, 0.65);
  --accent: #ff6a11;
  --accent-2: #ff3b06;
  --accent-glow: rgba(255, 90, 10, 0.35);
}

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

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  background: radial-gradient(ellipse at top center, #0c2f59 0%, var(--bg) 50%, #05142b 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid rgba(114, 178, 255, 0.6);
  outline-offset: 2px;
}

/* APP LAYOUT */
.app {
  max-width: 430px;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 14px) 16px calc(32px + env(safe-area-inset-bottom, 0px));
}

.topbar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 12px; height: 56px; margin-bottom: 8px;
}

.brand {
  text-align: center; font-size: clamp(24px, 6vw, 28px); font-weight: 800; letter-spacing: -0.02em;
}

.hero {
  text-align: center; margin: 0 0 18px; font-size: 18px; color: var(--text);
}

/* CARDS */
.card {
  background: linear-gradient(180deg, rgba(17, 53, 95, 0.88), rgba(9, 31, 59, 0.92));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.25);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 18px; margin-bottom: 16px;
}

.section-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.helper { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-anchor: middle; }
.text-left { text-anchor: start; }
.text-right { text-anchor: end; }

/* FORMS */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { width: 100%; }
.field span { font-size: 13px; font-weight: 500; color: var(--muted); padding-left: 4px; }
.field-help { margin-top: 8px; color: var(--muted); font-size: 12px; text-align: left; }
.parsed-preview { margin-top: 8px; color: #b9e7ff; font-size: 12px; text-align: left; }
.hidden { display: none !important; }
input {
  width: 100%; height: 52px; border: 2px solid transparent; border-radius: 16px;
  padding: 0 16px; background: rgba(255,255,255,0.96); color: #273245; font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 3px 10px rgba(0,0,0,0.16);
  transition: border-color 0.2s;
}
input:focus { outline: none; border-color: rgba(114, 178, 255, 0.5); }
.inline-error { min-height: 20px; text-align: center; color: #ffb4a8; font-size: 13px; margin-top: 8px; }

/* BUTTONS */
button { font-family: inherit; }
.pill {
  height: 38px; border-radius: 99px; border: 1px solid var(--line);
  background: rgba(11, 38, 71, 0.75); color: var(--text); font-weight: 600; font-size: 14px;
  padding: 0 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.primary-btn {
  width: 100%; height: 60px; border-radius: 99px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 18px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px var(--accent-glow); margin-top: 12px; transition: 0.2s;
}
.primary-btn:active:not(:disabled) { transform: scale(0.97); }
.primary-btn:disabled, .gauge-btn:disabled { opacity: 0.5; filter: grayscale(0.5); cursor: not-allowed; }

/* LANGUAGE SHEET ENHANCEMENTS */
.sheet-card--language {
  background: linear-gradient(180deg, #0f2a44, #0a1f33);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 12px;
}

.sheet-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.sheet-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: #94a3b8;
}

.sheet-close {
  background: transparent;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sheet-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sheet-body { 
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); 
  overflow-y: auto; 
  display: flex; 
  flex-direction: column; 
  min-height: 0; 
  max-height: 70vh;
} 

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

.lang-item { 
  width: 100%; 
  display: grid; 
  grid-template-columns: 40px 1fr 24px; 
  align-items: center; 
  gap: 14px; 
  padding: 16px; 
  border-radius: 18px; 
  border: 1px solid transparent; 
  background: rgba(11, 43, 83, 0.38); 
  color: #f4f7fb; 
  text-align: left; 
  cursor: pointer; 
  transition: all 0.18s ease; 
} 

.lang-item:hover:not(:disabled) { 
  background: rgba(17, 55, 102, 0.62); 
  border-color: rgba(78, 140, 244, 0.18); 
} 

.lang-item:active:not(:disabled) { 
  transform: scale(0.995); 
} 

.lang-item.active { 
  background: linear-gradient(180deg, rgba(18, 67, 125, 0.92), rgba(12, 50, 97, 0.92)); 
  border-color: rgba(0, 153, 255, 0.9); 
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.14), 0 0 22px rgba(0, 132, 255, 0.18); 
} 

.lang-item__flag {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-item__content {
  display: flex;
  flex-direction: column;
}

.lang-item__label {
  font-weight: 600;
  font-size: 15px;
}

.lang-item__native {
  font-size: 13px;
  color: #94a3b8;
}

.lang-item__status { 
  justify-self: end; 
  width: 24px; 
  height: 24px; 
  display: grid; 
  place-items: center; 
  color: #18a0ff; 
} 

.lang-item__check { 
  opacity: 0; 
  transform: scale(0.8); 
  transition: all 0.2s ease; 
} 

.lang-item.active .lang-item__check { 
  opacity: 1; 
  transform: scale(1); 
} 

.lang-item__spinner { 
  animation: spin 1s linear infinite; 
} 

.lang-item.is-loading { 
  pointer-events: none; 
  opacity: 0.8; 
} 

.lang-item.is-loading .lang-item__check { 
  display: none; 
} 

.lang-item.is-loading .lang-item__spinner { 
  display: block; 
} 

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

/* --- DEEP NAVY THEME VARIABLES --- */
.theme-navy {
  --bg-backdrop: rgba(2, 6, 15, 0.85); /* Darker, slightly blue backdrop */
  --bg-modal: linear-gradient(145deg, #0B172D, #060D1A);
  --bg-card: #111E3A;
  --bg-input: #040A15;
  
  --border-subtle: #1C2D54;
  --border-active: #FF4500; /* Vibrant Orange-Red */
  
  --text-primary: #FFFFFF;
  --text-secondary: #8CA2C4; /* Soft slate blue */
  
  --brand-orange-grad: linear-gradient(135deg, #FF6B00, #E62000);
  --brand-glow: 0 4px 20px rgba(230, 32, 0, 0.45);
}

/* Modal Container */
.theme-navy .modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  color: var(--text-primary);
  max-width: 440px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Typography & Text */
.theme-navy .modal-title { color: var(--text-primary); }
.theme-navy .option-meta, .theme-navy .field-label, .theme-navy .text-muted {
  color: var(--text-secondary);
}

/* Plan Cards */
.theme-navy .plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.theme-navy .plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.theme-navy .plan-card:hover {
  border-color: #364B82;
  background: #152547;
}
.theme-navy .plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.theme-navy .plan-name { font-weight: 600; color: var(--text-secondary); font-size: 14px;}
.theme-navy .plan-price { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 4px 0; }
.theme-navy .plan-desc { font-size: 12px; color: var(--text-secondary); }

/* Plan Card Active State (Orange Border) */
.theme-navy .plan-card.active {
  border-color: var(--border-active);
  background: linear-gradient(180deg, rgba(255, 69, 0, 0.05), transparent);
}
.theme-navy .plan-card.active .plan-name { color: var(--border-active); }
.theme-navy .plan-check {
  width: 18px; height: 18px;
  color: transparent;
  transition: color 0.2s;
}
.theme-navy .plan-card.active .plan-check {
  color: var(--border-active); /* Orange checkmark */
}

/* Input Fields */
.theme-navy .modal-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  margin-top: 6px;
  transition: all 0.2s;
}
.theme-navy .modal-input:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.15);
}

/* Glowing Primary Button (Mirrors the "GO" button) */
.theme-navy .btn-glow {
  background: var(--brand-orange-grad);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  padding: 14px;
  margin-top: 24px;
  cursor: pointer;
  box-shadow: var(--brand-glow);
  transition: transform 0.1s, box-shadow 0.2s;
}
.theme-navy .btn-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(230, 32, 0, 0.6);
}
.theme-navy .btn-glow:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(230, 32, 0, 0.4);
}

/* Secondary Links & Trust Signals */
.theme-navy .trust-signals {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.theme-navy .secondary-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.theme-navy .text-btn.text-accent {
  background: none; border: none;
  color: var(--border-active);
  font-weight: 600; cursor: pointer;
  font-size: 14px;
}
.theme-navy .text-btn.text-accent:hover { text-decoration: underline; }

.cf-turnstile-container { margin-top: 12px; }

/* UTILITIES */
.utility-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.utility-btn, .footer-btn, .modal-secondary {
  height: 50px; border-radius: 99px; border: 1px solid var(--line);
  background: rgba(14, 44, 82, 0.85); color: var(--text); font-weight: 600; cursor: pointer;
}
.utility-btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; }
.utility-btn.active {
  background: linear-gradient(135deg, #2ebf70, #1b9a57);
  border: none;
  color: #f4fff8;
  cursor: default;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.footer-btn { width: 100%; font-size: 13px; color: var(--muted); }

/* SVG GAUGES */
.gauge-wrap { position: relative; max-width: 320px; margin: 0 auto; padding-bottom: 20px; }
.gauge-wrap.smaller { max-width: 280px; }
.gauge-svg { width: 100%; height: auto; display: block; overflow: visible; }
.gauge-track { fill: none; stroke: #0d284a; stroke-width: 26; stroke-linecap: round; }
.gauge-ticks { fill: none; stroke: rgba(255,255,255,0.7); stroke-width: 2.5; stroke-dasharray: 2 45.125; stroke-linecap: round; }
.gauge-band { fill: none; stroke-width: 22; stroke-linecap: round; }
#demandBand { stroke: #49d17d; }
.needle { pointer-events: none; }
.needle-poly { fill: #a1a9b4; stroke: #8e959f; stroke-width: 1; stroke-linejoin: round; }
.needle-counterweight { fill: #1c2633; stroke: #151d26; stroke-width: 1; stroke-linejoin: round; }
.needle-stripe { fill: #ff4d00; }
.needle-hub-inner { fill: #1c2633; }
.gauge-label { font-size: 16px; font-weight: 600; letter-spacing: 0.5px; }

.gauge-btn {
  position: absolute; left: 50%; bottom: -5%; transform: translateX(-50%);
  width: 96px; height: 96px; border-radius: 50%; border: none;
  background: radial-gradient(circle at top, #ff5722, #d82b00);
  color: white; font-size: 26px; font-weight: 800; cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 60, 0, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.gauge-btn:hover:not(:disabled) { transform: translateX(-50%) scale(1.05); box-shadow: 0 0 32px rgba(255, 60, 0, 1), inset 0 2px 6px rgba(255, 255, 255, 0.6); }
.gauge-btn:active:not(:disabled) { transform: translateX(-50%) scale(0.95); }
.gauge-btn.small { width: 84px; height: 84px; font-size: 22px; bottom: -2%; }
.gauge-btn.unlock-styled { background: radial-gradient(circle at top, #7d80f8, #4338ca); box-shadow: 0 0 24px rgba(99, 102, 241, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.5); text-shadow: 0 2px 4px rgba(0,0,0,0.4); }
.gauge-btn.unlock-styled:hover:not(:disabled) { box-shadow: 0 0 32px rgba(99, 102, 241, 1), inset 0 2px 6px rgba(255, 255, 255, 0.6); }

.message-board {
  margin-top: 24px; min-height: 52px; border-radius: 8px;
  background: rgba(8, 26, 51, 0.95); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 15px; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* TURNSTILE */
.turnstile-slot { margin-top: 14px; padding: 14px; border-radius: 18px; background: rgba(11,38,71,0.8); border: 1px solid var(--line); }
.turnstile-label { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }

/* MODALS */
.modal-layer {
  position: fixed; inset: 0; background: rgba(2, 10, 24, 0.85); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 100; opacity: 0; visibility: hidden; transition: 0.25s ease;
}
.modal-layer.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 400px; border-radius: 28px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #11355f, #091f3b); box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-layer.open .modal { transform: translateY(0); }

.modal-head { position: relative; padding: 20px; text-align: center; }
.modal-title { font-size: 24px; font-weight: 800; }
.modal-close {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(11, 38, 71, 0.8); color: white; cursor: pointer;
}
.modal-body { padding: 0 20px 24px; }
.modal-step { display: none; }
.modal-step.active { display: block; animation: fadeIn 0.3s ease; }

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

.chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.chip {
  padding: 14px 10px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(14, 44, 82, 0.8); color: var(--text); font-weight: 600; cursor: pointer; transition: 0.2s;
}
.chip span { font-size: 18px; color: var(--accent); font-weight: 800; display: block; margin-top: 4px; }
.chip.active { border-color: rgba(114, 178, 255, 0.5); background: rgba(28, 70, 119, 0.9); box-shadow: 0 0 0 1px rgba(114, 178, 255, 0.3); }

.spinner {
  width: 48px; height: 48px; border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; margin: 0 auto; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-icon {
  width: 64px; height: 64px; border-radius: 50%; background: #5ee500; color: white;
  font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.hidden { display: none !important; }

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

/* MODAL ENHANCEMENTS */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: -1;
}

.modal-card {
  background: linear-gradient(180deg, #0f2a44, #0a1f33);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  color: white;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  border: 1px solid var(--line);
  position: relative;
  z-index: 1001;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover,
.btn-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  outline: none;
}

.tier-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.tier-badge.tier-free {
  background: rgba(255,255,255,0.1);
  color: #cbd5e1;
}

.tier-badge.tier-pro,
.tier-badge.tier-paid {
  background: rgba(255, 122, 0, 0.2);
  color: #ff9b44;
}

.status-block {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.05);
}

.status-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.status-row:last-child { margin-bottom: 0; }

.available { color: #a8ffb0; }
.locked { color: #ff6b6b; font-weight: 500; }

.info-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
  font-size: 14px;
}

.info-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #e2e8f0;
}

.modal-card ul {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
}

.modal-card ul li { margin-bottom: 6px; }

.cta-unlock {
  width: 100%;
  padding: 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, #ff7a00, #ff3d00);
  color: white;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 61, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-unlock:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 61, 0, 0.6);
}

.cta-unlock:active {
  transform: translateY(1px);
}

.cta-subtext {
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 12px;
}

/* ===== ABOUT / INFO SHEET ===== */

.info-sheet-layer::backdrop {
  background: rgba(3, 13, 28, 0.58);
  backdrop-filter: blur(6px);
}

.info-sheet {
  width: min(100%, 720px);
  max-height: 88vh;
  margin: auto; /* Centers on desktop */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(17, 57, 104, 0.98) 0%, rgba(8, 35, 73, 0.98) 100%);
  border: 1px solid rgba(69, 138, 255, 0.24);
  border-radius: 28px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255,255,255,0.05);
  color: #f4f7fb;
}

/* Hide mobile handle on desktop */
.mobile-only {
  display: none;
}

.info-sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(84, 131, 198, 0.12);
}

.info-sheet__title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.info-sheet__badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, #ff6b00 0%, #ff4d00 100%);
  box-shadow: 0 8px 22px rgba(255, 89, 0, 0.26), 0 0 24px rgba(255, 96, 0, 0.16);
}

.info-sheet__title {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px); /* Slightly refined clamp */
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f7fbff;
}

.info-sheet__subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: rgba(226, 236, 249, 0.72);
}

/* Body & Scrollbar */
#aboutModalLayer .modal-body {
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(97, 145, 214, 0.55) transparent;
}

#aboutModalLayer .modal-body::-webkit-scrollbar { width: 8px; }
#aboutModalLayer .modal-body::-webkit-scrollbar-track { background: transparent; }
#aboutModalLayer .modal-body::-webkit-scrollbar-thumb {
  background: rgba(97, 145, 214, 0.45);
  border-radius: 999px;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card Common Elements */
.about-hero-card, .about-panel {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(70, 135, 231, 0.18);
}
.about-hero-card h3, .about-panel h3, .about-hero-card p, .about-panel p {
  margin: 0;
}

/* Hero card */
.about-hero-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  background: linear-gradient(180deg, rgba(16, 55, 102, 0.92), rgba(11, 42, 84, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.about-hero-card__icon, .about-panel__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.06);
  color: #6191d6; /* Subtle accent color for SVGs */
}

.about-panel__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.warning-icon { color: #ff9100; } /* Accent for warning SVG */

.about-hero-card__title, .about-panel__title {
  font-size: 18px;
  font-weight: 700;
  color: #f7fbff;
}

.about-hero-card__title { margin-bottom: 6px; }

.about-hero-card__text, .about-panel__text {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(232, 240, 250, 0.88);
}

/* Generic panels */
.about-panel {
  background: rgba(10, 41, 80, 0.48);
}

.about-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* Warning panel */
.about-panel--warning {
  background: linear-gradient(180deg, rgba(63, 44, 18, 0.92), rgba(49, 35, 14, 0.92));
  border: 1px solid rgba(255, 166, 0, 0.34);
  box-shadow: 0 0 18px rgba(255, 145, 0, 0.08);
}

/* Steps */
.about-steps {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(238, 244, 252, 0.9);
}

.about-steps li {
  line-height: 1.45;
  font-size: 15px;
}

/* Links */
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-link-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* Apple HIG standard */
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  color: #eef5ff;
  background: rgba(19, 61, 112, 0.9);
  border: 1px solid rgba(84, 131, 198, 0.22);
  transition: all 0.18s ease;
}

.about-link-chip:hover {
  transform: translateY(-1px);
  background: rgba(24, 73, 132, 0.95);
  border-color: rgba(84, 131, 198, 0.38);
}

.about-link-chip--stack {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 16px;
  line-height: 1.3;
}

.chip-email {
  font-size: 13px;
  opacity: 0.74;
}

/* Footer */
.about-footer {
  padding: 12px 0 4px;
  text-align: center;
  color: rgba(224, 235, 247, 0.58);
}

.about-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* Mobile Adjustments (Bottom Sheet behavior) */
@media (max-width: 640px) {
  .info-sheet {
    margin: auto auto 0; /* Attach to bottom */
    width: 100%;
    border-radius: 28px 28px 0 0;
    max-height: 90vh;
  }

  .mobile-only {
    display: block;
  }

  .sheet-handle {
    width: 60px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.3);
    margin: 12px auto 0; /* Spacing for the drag handle */
  }

  .info-sheet__head {
    padding: 12px 16px 12px;
  }

  #aboutModalLayer .modal-body {
    padding: 16px 16px 24px;
  }

  .about-hero-card, .about-panel {
    padding: 16px;
  }

  .about-hero-card {
    grid-template-columns: 42px 1fr;
    gap: 12px;
  }

  .about-hero-card__icon {
    width: 42px;
    height: 42px;
  }

  .about-link-chip {
    width: 100%; /* Full width touch targets on mobile */
  }
}

/* ==========================================
   MODAL ENHANCEMENTS
   ========================================== */

/* Native dialog polyfill improvements */
.modal-layer {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}

.modal-layer::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-layer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bottom Sheet Style (Mobile-optimized) */
.modal-layer.bottom-sheet {
  align-items: flex-end;
  justify-content: center;
}

.modal-layer.bottom-sheet .modal {
  width: 100%;
  max-width: 600px;
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  animation: slideUp 0.3s ease-out;
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color, #ddd);
  border-radius: 2px;
  margin: 12px auto;
  cursor: grab;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge[data-tier="free"] {
  background: #fee;
  color: #c33;
}

.status-badge[data-tier="paid"] {
  background: #efe;
  color: #3c3;
}

/* Plan Cards (Visual selection) */
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.plan-card {
  padding: 16px;
  border: 2px solid var(--border-color, #e0e0e0);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.plan-card.active {
  border-color: var(--primary-color, #007bff);
  background: var(--primary-light, rgba(0,123,255,0.05));
}

.plan-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.plan-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color, #007bff);
}

.plan-desc {
  font-size: 12px;
  color: var(--text-muted, #666);
  margin-top: 4px;
}

/* Language List Items */
.lang-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.lang-item:hover {
  background: var(--hover-bg, rgba(0,0,0,0.05));
}

.lang-item.active {
  border-color: var(--primary-color, #007bff);
  background: var(--primary-light, rgba(0,123,255,0.05));
}

.lang-flag {
  font-size: 20px;
}

.lang-name {
  flex: 1;
  font-weight: 500;
}

.lang-native {
  color: var(--text-muted, #666);
  font-size: 14px;
}

.lang-item .checkmark {
  opacity: 0;
  color: var(--primary-color, #007bff);
  font-weight: 700;
}

.lang-item.active .checkmark {
  opacity: 1;
}

/* Success Animation */
.success-animation {
  text-align: center;
  padding: 20px;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: var(--success-color, #28a745);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  animation: scaleIn 0.3s ease-out;
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Utility Classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.sr-only { /* Screen reader only */ }

/* Button States */
.btn-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Copy Field with Button */
.copy-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-field .readbox {
  flex: 1;
}

.icon-btn {
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--hover-bg);
}

/* Secondary Actions */
.secondary-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.text-btn {
  background: none;
  border: none;
  color: var(--primary-color, #007bff);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

.text-btn:hover {
  opacity: 0.8;
}

.privacy-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #666);
  margin-top: 16px;
}

/* About Modal Specifics */
.about-content {
  gap: 20px;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.steps-list {
  padding-left: 20px;
  margin: 0;
}

.steps-list li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.warning-section {
  padding: 16px;
  background: #fffbeb;
  border-radius: 12px;
  border: 1px solid #f59e0b;
}

/* ===== SHARE SHEET ===== */
.share-sheet-layer::backdrop {
  background: rgba(4, 15, 33, 0.7);
  backdrop-filter: blur(4px);
}

.share-sheet {
  width: min(100%, 480px);
  background: #0f2240;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-family: inherit;
}

.share-sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 16px;
}

.share-sheet__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.share-sheet__subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.share-sheet__close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.share-sheet__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.share-sheet__body {
  padding: 24px;
}

.share-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.share-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-card__label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  padding-left: 4px;
}

.share-textarea,
.share-input-group {
  width: 100%;
  background: #f4f7fb;
  border: none;
  border-radius: 16px;
  color: #0f2240;
}

.share-textarea {
  min-height: 80px;
  padding: 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
}

.share-textarea:focus {
  outline: 2px solid #ff6b00;
  outline-offset: 2px;
}

.share-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.share-card__hint {
  color: rgba(255, 255, 255, 0.58);
}

.share-input-group {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 16px;
}

.share-input-group:focus-within {
  outline: 2px solid #ff6b00;
  outline-offset: 2px;
}

.share-url-box {
  flex: 1;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.share-icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #e2e8f0;
  color: #0f2240;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.share-icon-btn:hover {
  background: #cbd5e1;
}

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

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.share-sheet .btn-primary,
.share-sheet .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: none;
}

.share-sheet .btn-primary {
  background: linear-gradient(90deg, #ff6b00 0%, #ff4d00 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 89, 0, 0.4);
}

.share-sheet .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 89, 0, 0.5);
}

.share-sheet .btn-secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.share-sheet .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.share-sheet .btn-icon {
  flex: 0 0 auto;
}

.share-feedback {
  text-align: center;
  font-size: 14px;
  color: #ff6b00;
  min-height: 20px;
}

@media (max-width: 480px) {
  .share-sheet {
    width: 100%;
    border-radius: 24px 24px 0 0;
    margin-top: auto;
    border: none;
  }

  .share-sheet__head {
    padding: 20px 16px 14px;
  }

  .share-sheet__body {
    padding: 16px;
  }

  .share-content {
    gap: 16px;
  }

  .share-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

.about-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.copyright {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.version {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Processing State */
.processing-state {
  text-align: center;
  padding: 40px 20px;
}

.spinner-large {
  font-size: 48px;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
  display: inline-block;
}

/* Limitation/Tips Lists */
.limitation-list,
.tips-list {
  margin: 0;
  padding-left: 20px;
}

.limitation-list li,
.tips-list li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

/* Animations */
.modal-layer {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-layer.open,
.modal-layer[open] {
  opacity: 1;
  visibility: visible;
}

.modal {
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease-out;
}

.modal-layer.open .modal,
.modal-layer[open] .modal {
  transform: scale(1) translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
  .modal {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }
  
  .modal-layer.bottom-sheet .modal {
    border-radius: 20px 20px 0 0;
    min-height: auto;
  }
  
  .plan-cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gauge-band,
  .needle {
    transition: none !important;
  }
  .gauge-wrap {
    animation: none !important;
  }
}

/* --- DIALOG & SHEET BASE --- */
.report-sheet-layer {
  border: none;
  background: rgba(0, 0, 0, 0.6); /* Backdrop dimming */
  backdrop-filter: blur(4px);
}

.report-sheet {
  width: min(100%, 460px);
  margin: auto;
  background: linear-gradient(180deg, #112a46, #091a2e); /* Matches main UI navy */
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  box-shadow: 0 24px 48px rgba(0,0,0,0.4);

  /* NEW: Prevent modal from overflowing screen height */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* --- HEADER --- */
.report-sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 16px;
}

.report-sheet__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.report-sheet__subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.report-sheet__close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.report-sheet__close:hover { background: rgba(255, 255, 255, 0.15); }

/* --- BODY & CARDS --- */
.report-sheet__body {
  padding: 0 24px 24px;

  /* NEW: Allow scrolling inside the modal on small phones */
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* NEW: Custom scrollbar for webkit browsers to match the dark theme */
.report-sheet__body::-webkit-scrollbar {
  width: 6px;
}
.report-sheet__body::-webkit-scrollbar-track {
  background: transparent;
}
.report-sheet__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
.report-content { display: flex; flex-direction: column; gap: 16px; }

.report-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.report-card__label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-card__value { font-size: 15px; font-weight: 500; }
.optional { opacity: 0.5; font-weight: 400; text-transform: none; }

/* --- PILLS (Report Type) --- */
.report-type-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.report-pill {
  flex: 1 1 calc(50% - 8px);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255,255,255, 0.8);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.report-pill:hover { background: rgba(255, 255, 255, 0.06); }

.report-pill.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ff5e00; /* Subtle orange tie-in */
  color: #fff;
  box-shadow: inset 0 0 0 1px #ff5e00;
}

/* --- TEXTAREA --- */
.report-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  border-radius: 12px;
  background: #f4f7fb;
  color: #1a1a1a;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 15px;
  resize: none;
  transition: border-color 0.2s;
}
.report-textarea:focus { outline: none; border-color: #ff5e00; }
.report-meta { text-align: right; font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 6px; }

/* --- CUSTOM TOGGLE SWITCH --- */
.report-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0;
}
.report-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-ui {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}
.toggle-ui::after {
  content: "";
  width: 18px;
  height: 18px;
  background: white;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.report-toggle input:checked + .toggle-ui { background: #ff5e00; } /* Main orange */
.report-toggle input:checked + .toggle-ui::after { transform: translateX(20px); }
.toggle-label { font-size: 15px; font-weight: 500; }

/* --- BUTTONS --- */
.report-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.report-submit {
  background: linear-gradient(90deg, #ff6b00, #ff4d00);
  padding: 16px;
  border-radius: 999px; /* Pill shape matching main UI */
  color: white;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 94, 0, 0.3); /* The orange glow */
  transition: transform 0.1s, box-shadow 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}
.report-submit:active { transform: scale(0.98); box-shadow: 0 2px 10px rgba(255, 94, 0, 0.3); }

.report-cancel {
  background: transparent;
  padding: 14px;
  border: none;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}
.report-cancel:hover { color: #fff; }

.report-error { color: #ff6b6b; font-size: 14px; text-align: center; }

/* --- SUCCESS STATE --- */
.report-success { text-align: center; padding: 40px 20px; }
.success-icon {
  width: 64px;
  height: 64px;
  background: #ff5e00;
  color: white;
  font-size: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.success-title { font-size: 24px; margin: 0 0 8px; font-weight: 700; }
.success-msg { color: rgba(255,255,255,0.7); font-size: 15px; line-height: 1.5; margin: 0; }
.hidden { display: none !important; }
