/*
  ========================================================================
  Copyright (c) 2026 Francisco Estevan García. Todos los derechos reservados.
  Este software y su código fuente son propiedad exclusiva de Francisco Estevan García.
  Queda estrictamente prohibida la copia, reproducción, distribución,
  modificación o uso no autorizado de este archivo y sus componentes.
  ========================================================================
*/

:root {
  --bg: #030308;
  --surface: rgba(10, 10, 20, 0.4);
  --surface2: rgba(18, 18, 32, 0.65);
  --surface3: rgba(30, 30, 48, 0.8);
  --accent: #9B5DE5; /* Púrpura inmersivo moderno */
  --accent-glow: rgba(155, 93, 229, 0.25);
  --accent2: #FF3B30; /* Rojo vibrante */
  --green: #00D4AA; /* Verde esmeralda premium */
  --amber: #FF9F0A; /* Ámbar/Naranja cálido */
  --text: #FFFFFF;
  --text2: #C7C7CC;
  --text3: #8E8E93;
  --border: rgba(155, 93, 229, 0.12);
  --border-light: rgba(155, 93, 229, 0.25);
  --r: 20px;
  --rSm: 12px;
  --neon-glow: 0 0 20px rgba(155, 93, 229, 0.35);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(155, 93, 229, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 212, 170, 0.05) 0%, transparent 40%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.01em;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ─── LOGIN ─── */
#login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(108,99,255,0.2) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(0,212,170,0.1) 0%, transparent 50%),
              var(--bg);
}

.login-logo {
  font-size: 64px;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

.login-brand {
  width: min(360px, 86vw);
  height: auto;
  margin: 0 auto 10px;
  display: block;
  filter: drop-shadow(0 0 22px rgba(155, 93, 229, 0.28));
  animation: float 3s ease-in-out infinite;
}

.login-brand-icon {
  width: 116px;
  height: 116px;
  margin: 0 auto 12px;
  display: block;
  border-radius: 28px;
  filter: drop-shadow(0 0 24px rgba(155, 93, 229, 0.32));
  animation: float 3s ease-in-out infinite;
}

.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;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.login-sub {
  color: var(--text2);
  font-size: 14px;
  text-align: center;
  margin-bottom: 36px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  width: 100%;
  max-width: 380px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: block;
}

.field-input {
  width: 100%;
  background: rgba(30, 30, 48, 0.4);
  border: 1px solid rgba(155, 93, 229, 0.15);
  border-radius: var(--rSm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  padding: 13px 16px;
  margin-bottom: 16px;
  outline: none;
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.field-input:focus {
  border-color: rgba(0, 212, 170, 0.6);
  box-shadow: 0 0 15px rgba(0, 212, 170, 0.15);
  background: rgba(30, 30, 48, 0.6);
}
.field-input::placeholder { color: var(--text3); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #7B61FF 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--rSm);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(155, 93, 229, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(155, 93, 229, 0.5);
}
.btn-primary:active { transform: scale(0.97); }

.btn-danger {
  background: linear-gradient(135deg, var(--accent2), #FF6B6B);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 20px rgba(255, 59, 48, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(255, 59, 48, 0.5);
}
.btn-danger:active { background: #FF3B30; }

.btn-telegram {
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.3);
}
.btn-telegram:hover {
  box-shadow: 0 8px 25px rgba(42, 171, 238, 0.5);
}
.btn-telegram:active { background: #229ED9; }

.btn-premium {
  background: linear-gradient(135deg, var(--accent), #5A52D5);
  color: #FFFFFF;
  border: none;
}
.btn-premium:active { background: #5A52D5; }

.btn-ghost {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(155, 93, 229, 0.2);
  border-radius: var(--rSm);
  color: var(--text2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 12px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  border-color: rgba(0, 212, 170, 0.4);
  color: var(--text);
  background: rgba(0, 212, 170, 0.05);
}

/* ─── MAIN APP ─── */
#app { display: none; min-height: 100vh; padding-bottom: 76px; }

/* ─── HEADER ─── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,20,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-logo img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  filter: drop-shadow(0 0 10px rgba(155, 93, 229, 0.28));
}

.header-logo span {
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-level {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.header-streak {
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
}

/* ─── PAGES ─── */
.page { display: none; padding: 20px; max-width: 500px; margin: 0 auto; animation: pageFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.page.active { display: block; }

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

/* ── OVERLAY: LLAMADA IA RETELL ── */
.ai-calling-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at center, rgba(0,212,170,0.18), rgba(5,5,15,0.92));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ai-calling-overlay.show { display: flex; }
.ai-calling-pulse {
  font-size: 48px;
  width: 96px; height: 96px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,212,170,0.15);
  border: 2px solid var(--green);
  animation: aiCallPulse 1.4s ease-in-out infinite;
  margin-bottom: 18px;
}
@keyframes aiCallPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,170,0.45); transform: scale(1); }
  50% { box-shadow: 0 0 0 18px rgba(0,212,170,0); transform: scale(1.05); }
}
.ai-calling-title { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.ai-calling-sub { font-size: 13px; color: var(--text2); max-width: 280px; }
.ai-calling-progress {
  width: 220px; height: 4px; border-radius: 2px; margin-top: 18px;
  background: rgba(255,255,255,0.1); overflow: hidden;
}
.ai-calling-progress-bar {
  height: 100%; width: 0%; background: var(--green);
  animation: aiCallProgress 12s linear forwards;
}
@keyframes aiCallProgress { from { width: 0%; } to { width: 100%; } }

/* ── LANG SELECTOR ── */
.lang-selector {
  position: fixed;
  bottom: 92px;
  left: 14px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 15, 25, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(0, 212, 170, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  max-width: calc(100vw - 28px);
}
.lang-selector select {
  min-width: 116px;
}
.translate-status {
  position: fixed;
  left: 14px;
  bottom: 142px;
  z-index: 99998;
  max-width: min(320px, calc(100vw - 28px));
  display: none;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(10, 10, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text2);
  font-size: 11px;
  line-height: 1.35;
}

/* ── FREE COMMUNITY MISSION ── */
.community-mission-card {
  margin: 18px 20px 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 212, 170, 0.24);
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.12), rgba(155, 93, 229, 0.08));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}
.community-mission-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 212, 170, 0.12);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}
.community-mission-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.community-mission-card p {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}
.community-mission-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.community-primary-btn,
.community-secondary-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.community-primary-btn {
  background: linear-gradient(135deg, var(--green), #54F2D0);
  color: #02110E;
}
.community-secondary-btn {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.community-privacy-note,
.report-privacy-copy {
  margin-top: 10px;
  color: var(--text3);
  font-size: 11px;
  line-height: 1.4;
}
.map-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.map-trust-strip span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text2);
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.trust-contact-card {
  margin: 0 20px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(155, 93, 229, 0.22);
}
.trust-contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(155, 93, 229, 0.12);
  font-size: 22px;
}
.trust-contact-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 3px;
}
.trust-contact-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text2);
}
.trust-contact-btn {
  border: none;
  border-radius: 11px;
  padding: 10px 13px;
  background: linear-gradient(135deg, var(--accent), #7B61FF);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.trust-settings-card {
  border-color: rgba(155, 93, 229, 0.22);
}

.map-tile-status {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 650;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(10, 10, 20, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

/* ── CHAT FAB ── */
.chat-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.4);
  cursor: pointer;
  z-index: 99;
  transition: transform 0.2s, bottom 0.3s ease;
  touch-action: manipulation;
}

/* ── BOTTOM NAV (FLOATING PILL) ── */
/* ── COOKIE BANNER: nunca debe tapar el menú inferior flotante ── */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99990;
  background: rgba(10,10,20,0.97);
  border-top: 1px solid rgba(155,93,229,0.3);
  padding: 16px 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-height: 60vh;
  overflow-y: auto;
}
/* En móvil el menú flotante ocupa ~90px desde abajo: dejamos ese hueco libre */
@media (max-width: 767px) {
  .cookie-banner {
    bottom: 90px;
    border-radius: 16px;
    margin: 0 8px;
    left: 0;
    right: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  }
}
/* En escritorio el menú es una barra lateral fija en la izquierda:
   el banner de cookies no debe extenderse por debajo de ella. */
@media (min-width: 768px) {
  .cookie-banner {
    bottom: 0;
    left: 240px;
  }
}
@media (min-width: 1280px) {
  .cookie-banner {
    left: 260px;
  }
}

.bottom-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 420px;
  background: rgba(10, 10, 24, 0.7);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(155, 93, 229, 0.2);
  display: flex;
  justify-content: space-around;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  color: var(--text3);
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
  text-decoration: none;
}
.nav-item:active {
  transform: scale(0.9);
}
.nav-item i {
  font-size: 20px;
  font-style: normal;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item.active {
  color: var(--green);
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.15);
}
.nav-item.active i {
  transform: scale(1.15) translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.5));
}

/* ─── CARDS ─── */
.card {
  background: rgba(18, 18, 36, 0.4);
  border: 1px solid rgba(155, 93, 229, 0.15);
  border-radius: var(--r);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card::before {
  content: ''; position:absolute; top:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(155,93,229,0.3), transparent);
}
.card:hover {
  border-color: rgba(155, 93, 229, 0.3);
  box-shadow: 0 16px 36px rgba(155, 93, 229, 0.1);
}
.card:active { transform: scale(0.99); }

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ─── HOME PAGE ─── */
.welcome-banner {
  background: linear-gradient(135deg, var(--surface2) 0%, var(--surface3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
}

.welcome-greeting {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 4px;
}

.welcome-name {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

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

.streak-number {
  font-family: 'Outfit', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
}

.streak-label { font-size: 13px; color: var(--text2); }
.streak-label strong { display: block; font-size: 15px; color: var(--text); }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: rgba(18, 18, 31, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.stat-icon { font-size: 24px; margin-bottom: 6px; }
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.stat-label { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* ─── PANIC BUTTON ─── */
.panic-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 20px;
}

.panic-btn {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 35%, #FF8A80, var(--accent2));
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(255,107,107,0.4),
              0 20px 60px rgba(255,107,107,0.3);
  animation: panicPulse 2.5s ease-in-out infinite;
  transition: transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.panic-btn:active { transform: scale(0.94); }
.panic-btn .panic-emoji { font-size: 36px; }

@keyframes panicPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.4), 0 20px 60px rgba(255,107,107,0.3); }
  50% { box-shadow: 0 0 0 20px rgba(255,107,107,0), 0 20px 80px rgba(255,107,107,0.4); }
}

.panic-label {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

/* ─── QUOTE ─── */
.quote-card {
  background: linear-gradient(135deg, rgba(108,99,255,0.1) 0%, rgba(0,212,170,0.05) 100%);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.quote-text {
  font-size: 15px;
  color: var(--text);
  font-style: italic;
  line-height: 1.6;
}

.quote-attr { font-size: 12px; color: var(--text3); margin-top: 8px; }

/* ─── AGENT / CHAT ─── */
.chat-messages {
  height: 380px;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  animation: msgIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

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

.msg-agent {
  background: rgba(26,26,46,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--text);
}

.msg-user {
  background: linear-gradient(135deg, var(--accent) 0%, #857dfa 100%);
  border: none;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  color: white;
}

.msg-typing {
  background: rgba(26,26,46,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--text2);
  font-size: 20px;
  letter-spacing: 4px;
  animation: blink 1s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 44px;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.chat-input-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.chat-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 12px 18px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text3); }

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.chat-send:active { transform: scale(0.9); }

.quick-replies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.quick-reply {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-reply:hover { border-color: var(--accent); color: var(--accent); }

/* ─── MAP ─── */
#map {
  height: 320px;
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 14px;
  z-index: 1;
}

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

.map-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.map-refresh {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.risk-pill {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.3);
  border-radius: 20px;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
}

.place-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.place-item:last-child { border-bottom: none; }

.place-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.place-icon.bar { background: rgba(255,107,107,0.15); }
.place-icon.salon { background: rgba(255,181,71,0.15); }

.place-info { flex: 1; min-width: 0; }
.place-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-addr { font-size: 12px; color: var(--text2); margin-top: 2px; }
.place-dist { font-size: 11px; color: var(--accent); font-weight: 600; margin-top: 3px; }

.report-btn-map {
  width: 100%;
  background: var(--surface2);
  border: 1px dashed rgba(108,99,255,0.4);
  border-radius: var(--r);
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.report-btn-map:hover { background: rgba(108,99,255,0.1); }

/* ─── STATS PAGE ─── */
.progress-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
}

.big-number {
  font-family: 'Outfit', sans-serif;
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.big-label { font-size: 14px; color: var(--text2); margin-top: 6px; }
.progress-metrics-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.progress-metric-item {
  min-width: 92px;
  flex: 1 1 92px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}
.progress-metric-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.25;
}
.progress-metric-value {
  font-family: 'Syne', sans-serif;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 800;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.progress-metric-amber { color: var(--amber); }
.progress-metric-accent { color: var(--accent); }
.progress-metric-green { color: var(--green); }
.progress-metric-separator {
  width: 1px;
  background: var(--border);
}
.savings-compare-grid,
.projection-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.savings-compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.projection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.badges-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  min-width: 80px;
  opacity: 0.4;
  transition: all 0.2s;
}

.badge-item.unlocked {
  opacity: 1;
  border-color: rgba(255,181,71,0.4);
  background: rgba(255,181,71,0.05);
}

.badge-emoji { font-size: 28px; }
.badge-name { font-size: 11px; color: var(--text2); margin-top: 6px; }

/* ─── SETTINGS ─── */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 14px; }
.setting-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }

.toggle {
  width: 48px;
  height: 26px;
  background: var(--surface3);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.on { background: var(--accent); }

.toggle::after {
  content: '';
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
}

.toggle.on::after { left: 25px; }

.logout-btn {
  width: 100%;
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.3);
  border-radius: var(--rSm);
  color: var(--accent2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s;
}

.logout-btn:hover { background: rgba(255,107,107,0.2); }

/* ─── MODALS ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-overlay.open { display: flex; }

/* Modal centrado (directorio, bloqueo) — diferente al modal-sheet que sale por abajo */
.modal-content {
  background: linear-gradient(135deg, rgba(18,18,32,0.98) 0%, rgba(10,10,20,0.98) 100%);
  border: 1px solid rgba(155, 93, 229, 0.25);
  border-radius: 20px;
  padding: 24px;
  width: 92%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  margin: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(155,93,229,0.1);
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Para los modales centrados, el overlay alinea al centro */
#directory-modal,
#bloqueo-modal {
  align-items: center;
  justify-content: center;
}

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

.modal-sheet {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  padding: 24px 24px 40px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

/* ─── PREMIUM / STRIPE ─── */
.modal-premium {
  background: linear-gradient(135deg, rgba(34,34,56,0.95) 0%, rgba(18,18,31,0.95) 100%);
  border: 1px solid rgba(255,181,71,0.4);
  box-shadow: 0 -10px 40px rgba(255,181,71,0.15);
}

.modal-premium .modal-title {
  background: linear-gradient(135deg, var(--text) 0%, var(--amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.premium-list {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.premium-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text2);
}

.premium-list-item .p-icon { color: var(--amber); font-size: 18px; }

.btn-premium {
  width: 100%;
  background: linear-gradient(135deg, #FFB547 0%, #FF8A80 100%);
  color: #12121F;
  border: none;
  border-radius: var(--rSm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(255,181,71,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-premium:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(255,181,71,0.5); }
.btn-premium:active { transform: scale(0.96); }
.stripe-label { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; opacity: 0.8; }

body.pro-mode .header-logo {
  background: linear-gradient(135deg, var(--amber) 0%, #FF8A80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.pro-mode .header-logo::after { content: " PRO"; font-size: 12px; vertical-align: top; }
body.pro-mode .app-header { border-bottom: 1px solid rgba(255,181,71,0.2); }

/* ─── PANIC MODAL ─── */
.breathing-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,170,0.3) 0%, rgba(0,212,170,0.05) 70%);
  border: 2px solid var(--green);
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  animation: breatheAnim 8s ease-in-out infinite;
}

@keyframes breatheAnim {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,212,170,0.2); }
  50% { transform: scale(1.2); box-shadow: 0 0 40px 10px rgba(0,212,170,0.1); }
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26,26,46,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 30px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: normal;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(0,212,170,0.4); box-shadow: 0 10px 40px rgba(0,212,170,0.2); }
.toast.error { border-color: rgba(255,107,107,0.4); box-shadow: 0 10px 40px rgba(255,107,107,0.2); }

/* ─── ALERT BANNER ─── */
.alert-banner {
  position: fixed;
  top: 70px;
  left: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid rgba(255,107,107,0.4);
  border-radius: var(--r);
  padding: 14px 16px;
  z-index: 150;
  display: none;
  animation: slideDown 0.3s ease;
}

.alert-banner.show { display: flex; align-items: center; gap: 12px; }

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

.alert-icon { font-size: 24px; flex-shrink: 0; }
.alert-text { flex: 1; font-size: 13px; line-height: 1.4; }
.alert-text strong { color: var(--accent2); display: block; margin-bottom: 2px; }
.alert-close { color: var(--text3); font-size: 20px; cursor: pointer; padding: 4px; }

/* ─── REPORT MODAL FORM ─── */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.type-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--rSm);
  color: var(--text2);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.type-btn.active {
  border-color: var(--accent);
  background: rgba(108,99,255,0.1);
  color: var(--text);
}

.type-btn .t-icon { font-size: 22px; display: block; margin-bottom: 6px; }

/* ─── LEAFLET OVERRIDES ─── */
.leaflet-container { background: #0d0d1a; }
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { margin: 12px 16px !important; font-size: 13px; }

/* ─── LOADING ─── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--surface3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

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

.btn-primary.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary.loading::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
  font-size: 14px;
  background: rgba(26,26,46,0.3);
  border: 1px dashed var(--border);
  border-radius: var(--r);
  margin-top: 10px;
}

.empty-state .e-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}




/* ══════════════════════════════════════
   MOBILE: base ya es mobile-first
   No hay breakpoints menores a 768px
══════════════════════════════════════ */

/* ══════════════════════════════════════
   TABLET + DESKTOP (768px y superior)
══════════════════════════════════════ */
@media (min-width: 768px) {

  /* Reset padding-bottom del app (ya no hay nav flotante abajo) */
  #app {
    padding-bottom: 0 !important;
  }

  /* ── Sidebar ── */
  .bottom-nav {
    /* Cancelar el centrado flotante del móvil */
    bottom: auto !important;
    left: 0 !important;
    transform: none !important;
    max-width: none !important;
    width: 240px !important;
    border-radius: 0 !important;
    /* Diseño lateral */
    position: fixed;
    top: 0;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    padding: 24px 12px !important;
    border-right: 1px solid var(--border);
    border-bottom: none;
    background: var(--surface) !important;
    box-shadow: 4px 0 32px rgba(0,0,0,0.4) !important;
    z-index: 200;
  }

  /* Logo del sidebar */
  .bottom-nav::before {
    content: "🛡️ Guardian";
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0 12px 20px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }

  /* ── Botones del nav ── */
  .nav-item {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text2) !important;
    width: 100% !important;
    text-align: left !important;
    transition: all 0.2s ease !important;
  }

  .nav-item:hover {
    background: rgba(255,255,255,0.07) !important;
    color: var(--text) !important;
    transform: none !important;
  }

  .nav-item.active {
    background: linear-gradient(135deg, rgba(108,99,255,0.25), rgba(108,99,255,0.12)) !important;
    color: var(--accent) !important;
    border: 1px solid rgba(108,99,255,0.3) !important;
  }

  .nav-item.active .nav-item i {
    transform: none !important;
    filter: none !important;
  }

  .nav-item i {
    font-size: 20px !important;
    width: 28px !important;
    flex-shrink: 0 !important;
    text-align: center !important;
  }

  .nav-label {
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }

  /* ── Header principal ── */
  .app-header {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    box-sizing: border-box;
  }

  /* ── Páginas de contenido ── */
  .page {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    max-width: none !important;
    padding: 32px 48px !important;
    min-height: 100vh;
    box-sizing: border-box;
  }

  /* ── Grids de estadísticas ── */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 18px !important;
  }

  .stat-card { padding: 22px !important; }

  /* ── Chat ── */
  .chat-messages { height: 55vh !important; }

  /* ── Mapa ── */
  #map { height: 480px !important; }

  /* ── Modales: centrado vertical en desktop ── */
  .modal {
    max-width: 480px;
    margin: 0 auto;
    border-radius: 20px;
    height: auto;
    max-height: 88vh;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) scale(0.92);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    visibility: hidden;
  }
  .modal.open {
    transform: translateY(-50%) scale(1) !important;
    opacity: 1;
    visibility: visible;
  }

  /* ── Welcome banner más ancho ── */
  .welcome-banner {
    padding: 32px 36px;
  }

  /* ── Cards más anchas ── */
  .card { margin-bottom: 20px; }

  /* ── Login centrado ── */
  .login-card { max-width: 440px; }
}

/* ══════════════════════════════════════
   PANTALLAS GRANDES (1280px+)
══════════════════════════════════════ */
@media (min-width: 1280px) {
  .bottom-nav { width: 260px !important; }
  .app-header {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
  }
  .page {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
    padding: 40px 64px !important;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* ══ HOME HERO ══ */
.home-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 0 0 0;
  flex-wrap: wrap;
}

.hero-left { flex: 1; min-width: 0; }

.hero-tagline {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
  font-style: italic;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.hero-action-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.hero-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108,99,255,0.4);
}

.hero-action-btn--secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.hero-action-btn--secondary:hover {
  background: var(--surface3);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

/* ══ QUICK ACTION GRID en Home ══ */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.quick-action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.quick-action-card:hover {
  background: var(--surface2);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108,99,255,0.15);
}

.quick-action-icon {
  font-size: 28px;
}

.quick-action-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══ RESPONSIVE HERO en Desktop ══ */
@media (min-width: 768px) {
  .home-hero {
    padding: 0 0 8px 0;
    align-items: center;
  }

  .hero-actions {
    flex-direction: row;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .quick-action-card {
    padding: 20px 10px;
  }
}

/* ══ CTA BUTTONS MEJORADOS ══ */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #9B5DE5);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 15px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(108,99,255,0.3);
}

.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(108,99,255,0.5);
}

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

.btn-cta-danger {
  background: linear-gradient(135deg, var(--accent2), #FF4444);
  box-shadow: 0 4px 16px rgba(255,107,107,0.3);
}

.btn-cta-danger:hover {
  box-shadow: 0 10px 30px rgba(255,107,107,0.5);
}

.btn-cta-success {
  background: linear-gradient(135deg, var(--green), #00A886);
  box-shadow: 0 4px 16px rgba(0,212,170,0.3);
}

/* ══ EMPTY STATE MEJORADO ══ */
.empty-cta-box {
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  margin: 16px 0;
}

.empty-cta-box .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-cta-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-cta-box p { font-size: 13px; color: var(--text3); margin-bottom: 20px; line-height: 1.5; }

/* ══ PAGE TITLES ══ */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.page-header p {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
}

/* Fix for fragmented stats page space */
#stats-page {
  min-height: auto !important;
  padding-bottom: 0 !important;
}
#stats-page-2 {
  padding-top: 0 !important;
}
.progress-helper-copy {
  margin: 0 0 14px;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.45;
}
#stats-page.active + #map-page + #stats-page-2,
#stats-page-2.active {
  display: block;
}

/* ══ PANEL DE ESTADISTICAS ══ */
.stat-card {
  position: relative;
  overflow: hidden;
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover::before {
  opacity: 1;
}

/* ══════════════════════════════════════════
   SETTINGS PAGE — PREMIUM UX
══════════════════════════════════════════ */

/* ── Banner de Plan de Suscripción ── */
.premium-banner-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(255,181,71,0.4);
  background: linear-gradient(145deg, #1A1525, #0F0A1A);
}

.premium-banner-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(255,181,71,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(108,99,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.premium-banner-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.premium-plan-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.premium-plan-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.premium-plan-desc {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.premium-upgrade-btn {
  background: linear-gradient(135deg, var(--amber), #FF8C42);
  color: #0A0A14;
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(255,181,71,0.4);
  flex-shrink: 0;
}

.premium-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,181,71,0.6);
}

/* ── Features grid del plan ── */
.premium-features-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px 20px 20px 20px;
}

.pf-item {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
}

.pf-ok {
  color: var(--green);
  background: rgba(0,212,170,0.08);
}

.pf-lock {
  color: var(--text3);
  background: rgba(255,255,255,0.03);
}

/* ── Cabeceras de sección dentro de cards ── */
.settings-section-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-section-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.settings-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.settings-section-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

/* ── Grid de líneas de ayuda ── */
.help-lines-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-line-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface2);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.help-line-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.help-line-info { flex: 1; min-width: 0; }

.help-line-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.help-line-desc {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.help-line-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.help-line-btn--green {
  background: var(--green);
  color: #0A0A14;
}

.help-line-btn--purple {
  background: var(--accent);
  color: white;
}

.help-line-btn:hover {
  transform: scale(1.05);
}

/* ── Zona de peligro ── */
.danger-zone-card {
  border-color: rgba(255,107,107,0.3) !important;
  background: rgba(255,107,107,0.03) !important;
}

/* ── RESPONSIVE SETTINGS ── */
@media (min-width: 768px) {
  .premium-features-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .premium-banner-content {
    flex-wrap: nowrap;
  }

  .help-lines-grid {
    flex-direction: row;
  }

  .help-line-card {
    flex: 1;
  }
}

/* ══════════════════════════════════════════
   PRICING MODAL — 3 PLANES
══════════════════════════════════════════ */

.pricing-modal {
  max-height: 92vh;
  overflow-y: auto;
  padding: 0 !important;
}

/* ── Cabecera ── */
.pricing-header {
  text-align: center;
  padding: 24px 24px 16px;
  background: linear-gradient(180deg, rgba(108,99,255,0.12) 0%, transparent 100%);
}

.pricing-badge {
  display: inline-block;
  background: rgba(108,99,255,0.2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(108,99,255,0.3);
  margin-bottom: 10px;
}

.pricing-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.pricing-subtitle {
  font-size: 13px;
  color: var(--text3);
}

/* ── Toggle mensual/anual ── */
.pricing-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
}

.ptoggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.discount-badge {
  background: var(--green);
  color: #0A0A14;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
}

.ptoggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.ptoggle-switch input { opacity: 0; width: 0; height: 0; }

.ptoggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface3);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.ptoggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.ptoggle-switch input:checked + .ptoggle-slider { background: var(--accent); }
.ptoggle-switch input:checked + .ptoggle-slider::before { transform: translateX(20px); }

/* ── Grid de planes (scroll horizontal en móvil) ── */
.pricing-grid {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 16px;
  gap: 12px;
}

.pricing-grid::-webkit-scrollbar { height: 4px; }
.pricing-grid::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ── Card de plan ── */
.pricing-card {
  flex: 0 0 260px;
  scroll-snap-align: center;
  border-radius: 20px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  transition: transform 0.2s ease;
}

.pricing-card:hover { transform: translateY(-3px); }

/* Variante destacada */
.plan-featured {
  border-color: rgba(108,99,255,0.6);
  background: linear-gradient(160deg, #1A1830, #0F0D1E);
  box-shadow: 0 0 0 1px rgba(108,99,255,0.3), 0 16px 40px rgba(108,99,255,0.15);
}

/* Variante clínica */
.plan-clinica {
  border-color: rgba(0,212,170,0.4);
  background: linear-gradient(160deg, #0D1E1A, #0A0A14);
}

/* ── Badges ── */
.plan-popular-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #9B5DE5);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 0 0 10px 10px;
  white-space: nowrap;
}

/* ── Nombre y precio ── */
.plan-name {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-top: 12px;
}

.plan-free .plan-name { color: var(--text2); }

.plan-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-price {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.plan-featured .plan-price { color: var(--accent); }
.plan-clinica .plan-price { color: var(--green); }

.plan-period {
  font-size: 12px;
  color: var(--text3);
}

.plan-audience {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 5px 10px;
}

/* ── Lista de features ── */
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.plan-features li {
  font-size: 12px;
  line-height: 1.4;
  padding-left: 0;
}

.feat-ok { color: var(--text2); }
.feat-ok strong { color: var(--text); }
.feat-no { color: var(--text3); text-decoration: line-through; opacity: 0.6; }

/* ── Botones de plan ── */
.plan-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  width: 100%;
  transition: all 0.25s ease;
  margin-top: auto;
}

.plan-btn-sub {
  font-size: 10px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  opacity: 0.7;
}

.plan-btn--ghost {
  background: var(--surface3);
  color: var(--text3);
  border: 1px solid var(--border);
  font-size: 13px;
}

.plan-btn--pro {
  background: linear-gradient(135deg, var(--accent), #9B5DE5);
  color: white;
  box-shadow: 0 6px 20px rgba(108,99,255,0.4);
}

.plan-btn--pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(108,99,255,0.6);
}

.plan-btn--clinica {
  background: linear-gradient(135deg, var(--green), #00A886);
  color: #0A0A14;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(0,212,170,0.3);
}

.plan-btn--clinica:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,212,170,0.5);
}

/* ── Trust signals ── */
.pricing-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 24px 8px;
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  border-top: 1px solid var(--border);
}

/* ── Responsive Desktop: 3 columnas ── */
@media (min-width: 900px) {
  .pricing-modal {
    max-width: 900px;
    width: 90vw;
  }

  .pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr 1fr;
    overflow-x: visible;
    padding: 0 24px 24px;
  }

  .pricing-card {
    flex: none;
  }
}
/* -- BOTTOM NAVIGATION BAR (MOBILE RESPONSIVE) -- */
@media (max-width: 768px) {
  body { padding-bottom: 90px; }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 100;
    padding: 8px 0 env(safe-area-inset-bottom);
    border-radius: 0;
    transform: none;
    left: 0;
    right: 0;
  }

  .lang-selector {
    bottom: calc(75px + env(safe-area-inset-bottom));
    left: 10px;
    padding: 4px 8px;
    transform: scale(0.75);
    transform-origin: left bottom;
  }

  .chat-fab {
    bottom: calc(75px + env(safe-area-inset-bottom));
    right: 15px;
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  #sos-btn {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .nav-item {
    flex: 1;
    width: 100%;
    color: var(--text3);
    font-size: 10px;
    padding: 8px 4px;
  }
  .nav-item i {
    font-size: 22px;
  }
  .nav-item.active {
    color: var(--green);
  }
  .nav-item.active i {
    filter: drop-shadow(0 0 5px var(--green));
  }
}

/* Desktop version keeps the floating pill style */
@media (min-width: 769px) {
  body { padding-bottom: 75px; }
}


/* Added missing auth-card and btn-outline classes for Settings page */
.auth-card { background: var(--surface); border-radius: 16px; padding: 24px; margin-top: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); backdrop-filter: blur(10px); }
.btn-outline { width: 100%; padding: 14px; border-radius: 12px; background: transparent; border: 1px solid rgba(255,255,255,0.2); color: white; font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.3s; }
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.4); }


/* Mobile-specific page adjustments */
@media (max-width: 768px) {
  .page {
    padding: 16px;
    padding-bottom: 20px;
  }

  .app-header {
    padding: 12px 16px;
  }

  .card {
    padding: 16px;
    margin-bottom: 12px;
  }

  .welcome-banner {
    padding: 16px;
    margin-bottom: 12px;
  }

  .btn-primary,
  .btn-ghost,
  .btn-danger {
    padding: 14px 16px;
    font-size: 14px;
  }

  /* Ensure modals are fullscreen on mobile */
  .modal-overlay {
    padding: 0;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    max-height: 100vh;
  }

  .modal-sheet {
    border-radius: 16px 16px 0 0;
  }
}


/* ═══════════════════════ GUARDIAN MEJORAS v2.0 ═══════════════════════ */

/* @keyframes pulse — usado por onboarding y modal de hitos */
@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Fix iPhone 8 / Safari: inset shorthand → valores individuales en inline styles
   no aplica aquí, pero sí prevenimos el problema con el onboarding overlay */
#onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

#onboarding-overlay button {
  -webkit-appearance: none;
  touch-action: manipulation;
  cursor: pointer;
}

/* Fix tap delay en Safari iOS (300ms) */
#onboarding-overlay button,
#milestone-modal button,
#padrino-panel-modal button {
  touch-action: manipulation;
}

/* Modal del hito — compatible Safari */
#milestone-modal .modal {
  -webkit-overflow-scrolling: touch;
  max-height: 90vh;
  overflow-y: auto;
}

/* Padrino panel scroll en iPhone */
#padrino-panel-modal .modal {
  -webkit-overflow-scrolling: touch;
  max-height: 85vh;
  overflow-y: auto;
}

/* Accesibilidad: alto contraste y tamaño mínimo de fuente */
@media (prefers-contrast: high) {
  :root {
    --text: #ffffff;
    --text2: #e0e0e0;
    --text3: #bbbbbb;
    --surface: #111111;
    --surface2: #1a1a1a;
  }
}

/* Accesibilidad: respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  @keyframes pulse { from { transform: scale(1); } to { transform: scale(1); } }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 430px) {
  .progress-metrics-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .progress-metric-separator {
    display: none;
  }
  .savings-compare-grid,
  .projection-grid {
    grid-template-columns: 1fr;
  }
  .stat-value,
  #calc-saved-now,
  #total-ahorrado,
  #total-gastado {
    overflow-wrap: anywhere;
  }
  .trust-contact-card {
    grid-template-columns: auto 1fr;
  }
  .trust-contact-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* iPhone 8 específico: 375px viewport, sin notch */
@media screen and (max-width: 375px) {
  #onboarding-overlay {
    padding: 16px;
  }
  #onboarding-overlay h2 {
    font-size: 20px !important;
  }
  #onboarding-overlay p {
    font-size: 13px !important;
  }
}

/* ─── GOOGLE TRANSLATE BANNER HIDDEN ─── */
iframe.goog-te-banner-frame,
iframe.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe[id^=":1.container"],
iframe[id^=":2.container"],
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
}
body {
  top: 0 !important;
  position: static !important;
}


/* Guardian Reset logo/header + progress mobile hardening */
.header-logo { min-width: 0; max-width: 62vw; }
.header-logo img { flex: 0 0 34px; object-fit: contain; background: rgba(255,255,255,0.04); }
.header-logo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header { padding-top: max(14px, env(safe-area-inset-top)); }
.progress-games-priority,
.progress-telegram-priority { margin-bottom: 14px; }
.progress-games-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.progress-games-actions .btn-ghost { margin-top: 0; min-height: 44px; white-space: normal; }
@media (max-width: 480px) {
  .app-header { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .header-logo { gap: 6px; font-size: 15px; max-width: 58vw; }
  .header-logo img { width: 30px; height: 30px; flex-basis: 30px; }
  .header-right { gap: 6px; }
  .header-level { padding: 4px 8px; font-size: 11px; }
  .header-streak { font-size: 12px; }
  #stats-page-2 .progress-metrics-row { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  #stats-page-2 .progress-metric-separator { display: none !important; }
  #stats-page-2 .progress-metric-item { min-width: 0 !important; padding: 10px 6px !important; background: rgba(255,255,255,0.035); border-radius: 12px; }
  #stats-page-2 .progress-metric-label { font-size: 10px !important; line-height: 1.2 !important; color: var(--text2) !important; }
  #stats-page-2 .progress-metric-value { font-size: 16px !important; overflow-wrap: anywhere; }
  #stats-page-2 .savings-compare-grid,
  #stats-page-2 .projection-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; }
  #stats-page-2 .card { overflow: hidden; }
  .progress-games-actions { grid-template-columns: 1fr !important; }
}



/* Keep anti-craving game modals above the fixed language selector. */
#tetris-modal.open,
#life-tree-modal.open {
  z-index: 100100;
}

/* Free anti-craving games */
.tetris-controls { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:12px; }
.tetris-controls button { min-height:42px; border-radius:10px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-weight:900; }
@media (max-width:480px){
  #tetris-modal .modal-sheet, #life-tree-modal .modal-sheet { width: calc(100vw - 20px); }
  #tetris-canvas { width: 180px; height: 288px; }
}


/* Guardian Reset streak UX redesign */
.streak-summary-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(31,31,49,0.98), rgba(24,24,38,0.98));
  border-color: rgba(0,212,170,0.20);
}
.streak-summary-glow {
  position: absolute;
  top: -44px;
  right: -44px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,170,0.18), rgba(108,99,255,0.06) 48%, transparent 70%);
  pointer-events: none;
}
.streak-summary-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(180px, .85fr);
  gap: 14px;
  align-items: stretch;
}
.streak-kicker {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 4px;
}
.streak-current-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.streak-summary-card .big-number {
  font-size: clamp(42px, 10vw, 64px);
}
.streak-current-unit {
  font-family: 'Syne', sans-serif;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 800;
  color: var(--text1);
}
.streak-summary-card .big-label {
  margin-top: 4px;
  line-height: 1.35;
}
.streak-next-box {
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.045);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 94px;
}
.streak-next-value {
  font-family: 'Syne', sans-serif;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 900;
  color: var(--green);
  margin-top: 6px;
}
.streak-mini-bar {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.streak-mini-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--accent));
  transition: width .35s ease;
}
.streak-metrics-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.streak-metrics-grid .progress-metric-item {
  min-width: 0;
  padding: 12px 10px;
}
.streak-chart-card {
  overflow: hidden;
}
.streak-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.streak-chart-subtitle {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.streak-chart-chip {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  background: rgba(0,212,170,0.10);
  border: 1px solid rgba(0,212,170,0.22);
  border-radius: 999px;
  padding: 7px 10px;
}
.streak-chart-wrap {
  position: relative;
  width: 100%;
  height: clamp(220px, 28vh, 310px);
  padding: 8px 2px 0;
}
#streak-chart {
  width: 100% !important;
  height: 100% !important;
}
.streak-chart-empty {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
  margin-top: 10px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}
@media (max-width: 640px) {
  .streak-summary-main { grid-template-columns: 1fr; }
  .streak-metrics-grid { grid-template-columns: 1fr; }
  .streak-chart-head { flex-direction: column; }
  .streak-chart-chip { align-self: flex-start; }
  .streak-chart-wrap { height: 230px; }
}
