:root {
  /* Paleta Wufly */
  --purple:#7C4DCC;
  --purple-dark:#5C2FA8;
  --purple-mid:#9B6BE0;
  --purple-light:#F0EAFB;
  --purple-pale:#F8F5FF;

  --mint:#5DD6A8;
  --mint-dark:#3DAF87;
  --mint-light:#E6F9F3;
  --mint-pale:#F0FBF8;

  --peach:#F9B95C;
  --peach-light:#FEF3E8;

  --red:#C0392B;
  --red-light:#FDECEA;

  /* Neutros */
  --text:#2D1B6B;
  --text-muted:#6B5C8A;
  --text-hint:#A99BC0;
  --bg:#F8F7FF;
  --surface:#FFFFFF;
  --border:rgba(0,0,0,0.07);
  --border-md:rgba(0,0,0,0.12);

  /* Aliases semánticos usados en componentes */
  --green:var(--purple);
  --green-dark:var(--purple-dark);
  --green-mid:var(--purple-mid);
  --green-light:var(--purple-light);
  --green-pale:var(--purple-pale);
  --gold:var(--mint);
  --gold-light:var(--mint-light);
  --gold-pale:var(--mint-pale);
  --gold-dark:var(--mint-dark);
  --cream:var(--purple-pale);
  --cream-dark:var(--purple-light);
  --violet:var(--purple);
  --violet-light:var(--purple-light);
  --amber:var(--peach);
  --amber-light:var(--peach-light);

  /* Radios */
  --r:20px;
  --r-sm:14px;
  --r-xs:10px;
  --r-pill:100px;

  /* Sombras */
  --shadow-sm:0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:0 8px 32px rgba(0,0,0,0.12);
  --shadow-green:0 4px 20px rgba(124,77,204,0.25);
  --shadow-gold:0 4px 20px rgba(93,214,168,0.3);
}

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

/* Evitar zoom automático en iOS al enfocar inputs (requiere font-size >= 16px) */
input, textarea, select {
  font-size: max(16px, 1em) !important;
}

/* Pantalla de bloqueo en horizontal — solo móviles táctiles */
@media screen and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  body::before {
    content: '📱\A\AWufly es una app vertical.\AGira tu teléfono para continuar.';
    white-space: pre;
    position: fixed; inset: 0; z-index: 99999;
    background: #000;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px; font-weight: 600; line-height: 1.6;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 32px;
  }
  body > * { visibility: hidden; }
}

body {
  font-family:'Plus Jakarta Sans', sans-serif;
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  max-width:480px;
  margin:0 auto;
  padding-bottom:90px;
  opacity:0;
  transition:opacity 0.3s ease;
}
body.app-ready { opacity:1; }

/* app-topbar: visible y sticky en mobile */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
}
/* desktop-layout es transparente en mobile */
.desktop-layout { display: contents; }
.app-column { display: contents; }
/*.app-pages { display: contents; }*/
.info-column { display: none; }


.topbar {
  position:sticky;
  top:0;
  z-index:100;
  background: linear-gradient(160deg, #5C2FA8 0%, #7C4DCC 60%, #9B6BE0 100%);
  border-radius:0;
  overflow:hidden;
  box-shadow:0 4px 20px rgba(124,77,204,0.35);
}

/* Sutil patrón de puntos sobre el gradiente */
.topbar::before {
  content:'';
  position:absolute;
  inset:0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events:none;
}

.topbar-head {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px 20px 10px;
}

.logo img {
  height:80px;
  width:auto;
  filter:drop-shadow(0 2px 10px rgba(0,0,0,0.3));
}

/* Logo texto para Wufly (cuando no hay imagen) */
.logo-text {
  font-family:'Funnel Display', sans-serif;
  font-size:32px;
  font-weight:800;
  color:white;
  letter-spacing:-1px;
  display:flex;
  align-items:center;
  gap:6px;
}
.logo-text .logo-accent { color:#5DD6A8; }
.logo-text .logo-paw { font-size:24px; }

/* Wrapper tabs */
.tabs-wrap { position:relative; }

/* ── TABS ── */
.tabs {
  display:flex;
  background:transparent;
  border-top:1px solid rgba(255,255,255,0.15);
}

.tab {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:10px 2px 14px;
  cursor:pointer;
  border-bottom:2.5px solid transparent;
  transition:all 0.2s;
  color:rgba(255,255,255,0.55);
  font-size:8px;
  font-weight:700;
  letter-spacing:0.05em;
  position:relative;
}

.tab svg {
  width:20px; height:20px;
  stroke:currentColor; fill:none;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.tab.active {
  color:#5DD6A8;
  border-bottom-color:#5DD6A8;
}

.tab:hover:not(.active) {
  color:rgba(255,255,255,0.9);
}

/* ── PAGES ── */
.page { display:none; padding:130px 20px 20px; }
#page-home.page { padding:0px; }
#page-alergias.page { padding:0; }
.page.active {
  display:block;
  animation: pageIn 0.28s ease forwards;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-title {
  font-family:'Funnel Display', sans-serif;
  font-weight:700;
  font-size:28px;
  line-height:1.1;
  letter-spacing:-0.5px;
  margin-bottom:6px;
  color:var(--text);
}
.page-sub {
  font-size:14px;
  color:var(--text-muted);
  font-weight:300;
  margin-bottom:20px;
  line-height:1.5;
}

/* ── HERO BANNER ── */
.hero-banner {
  background:linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border-radius:var(--r);
  padding:22px;
  margin-bottom:20px;
  color:white;
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow-green);
}
.hero-banner::before {
  content:'';
  position:absolute;
  top:-30px; right:-30px;
  width:140px; height:140px;
  background:rgba(255,255,255,0.06);
  border-radius:50%;
}
.hero-banner::after {
  content:'';
  position:absolute;
  bottom:-20px; left:20px;
  width:80px; height:80px;
  background:rgba(232,168,32,0.1);
  border-radius:50%;
}
.hero-banner h2 {
  font-family:'Funnel Display', sans-serif;
  font-weight:900;
  font-size:22px;
  line-height:1.2;
  margin-bottom:6px;
  color:var(--cream);
}
.hero-banner p { font-size:13px; opacity:0.8; font-weight:300; line-height:1.5; }
.stat-row { display:flex; gap:10px; margin-top:16px; }
.stat {
  background:rgba(255,255,255,0.12);
  border-radius:var(--r-xs);
  padding:10px 14px;
  flex:1;
  border:1px solid rgba(255,255,255,0.15);
}
.stat-num {
  font-family:'Funnel Display', sans-serif;
  font-weight:900;
  font-size:22px;
  color:var(--gold);
}
.stat-label { font-size:10px; opacity:0.75; margin-top:1px; font-weight:500; color:var(--cream); }

/* ── UPLOAD ZONE ── */
.upload-zone {
  background:var(--surface);
  border:2px dashed rgba(78,107,74,0.25);
  border-radius:var(--r);
  padding:28px 20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition:all 0.2s;
  position:relative;
  overflow:hidden;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
}
.upload-zone:hover { border-color:var(--green); background:var(--green-pale); }
.upload-zone input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.cam-icon {
  width:56px; height:56px;
  background:var(--green-light);
  border-radius:16px;
  display:flex; align-items:center; justify-content:center;
}
.cam-icon svg { width:24px; height:24px; stroke:var(--green); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.upload-zone h3 { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:15px; }
.upload-zone p { font-size:12px; color:var(--text-muted); text-align:center; }

/* ── CHIPS ── */
.chips { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:14px; }
.chip {
  background:var(--surface);
  border:1.5px solid var(--border-md);
  border-radius:var(--r-pill);
  padding:6px 14px;
  font-size:12px;
  color:var(--text-muted);
  cursor:pointer;
  transition:all 0.15s;
  font-family:'Plus Jakarta Sans', sans-serif;
  font-weight:500;
  box-shadow:var(--shadow-sm);
}
.chip:hover { border-color:var(--green); color:var(--green); background:var(--green-pale); }

/* ── ALLERGY BANNER ── */
.allergy-active-banner {
  background:var(--gold-light);
  border:1.5px solid rgba(232,168,32,0.3);
  border-radius:var(--r-sm);
  padding:12px 14px;
  margin-bottom:14px;
  display:none;
}
.allergy-active-banner.show { display:flex; align-items:center; gap:10px; }
.allergy-active-banner svg { width:16px; height:16px; stroke:var(--gold-dark); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.allergy-active-banner p { font-size:12px; color:var(--gold-dark); font-weight:500; flex:1; line-height:1.4; }
.allergy-active-banner button { background:none; border:none; font-size:11px; color:var(--gold-dark); font-weight:700; cursor:pointer; text-decoration:underline; font-family:'Plus Jakarta Sans', sans-serif; }

/* ── BUTTONS ── */
.btn-primary {
  width:100%;
  background:var(--green);
  color:white;
  border:none;
  border-radius:var(--r-sm);
  padding:16px;
  font-family:'Funnel Display', sans-serif;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
  transition:all 0.2s;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  letter-spacing:-0.2px;
  box-shadow:var(--shadow-green);
}
.btn-primary:hover { background:var(--green-dark); transform:translateY(-1px); }
.btn-primary:active { transform:translateY(0); }
.btn-primary:disabled { background:#9AB59A; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-primary svg { width:18px; height:18px; stroke:white; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

.btn-ghost {
  width:100%;
  background:transparent;
  border:1.5px solid var(--border-md);
  border-radius:var(--r-sm);
  padding:12px;
  font-family:'Plus Jakarta Sans', sans-serif;
  font-size:13px;
  font-weight:500;
  color:var(--text-muted);
  cursor:pointer;
  transition:all 0.15s;
}
.btn-ghost:hover { border-color:var(--green); color:var(--green); }


/* ── SEARCH & FILTER ── */
.search-bar {
  display:flex; align-items:center; gap:10px;
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:var(--r-sm);
  padding:11px 14px;
  margin-bottom:16px;
  box-shadow:var(--shadow-sm);
}
.search-bar svg { width:16px; height:16px; stroke:var(--text-hint); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.search-bar input { border:none; outline:none; font-family:'Plus Jakarta Sans', sans-serif; font-size:14px; color:var(--text); background:transparent; flex:1; }
.search-bar input::placeholder { color:var(--text-hint); }

.filter-row { display:flex; gap:7px; flex-wrap:wrap; margin-bottom:18px; }
.filter-btn {
  background:var(--surface);
  border:1.5px solid var(--border-md);
  border-radius:var(--r-pill);
  padding:6px 16px;
  font-size:12px;
  font-weight:600;
  color:var(--text-muted);
  cursor:pointer;
  transition:all 0.15s;
  box-shadow:var(--shadow-sm);
}
.filter-btn.active, .filter-btn:hover { background:var(--green); color:white; border-color:var(--green); box-shadow:var(--shadow-green); }

/* ── CAROUSEL ── */
#clinicas-carousel::-webkit-scrollbar { display: none; }
#clinicas-carousel { scrollbar-width: none; }

/* ── PLACE CARDS ── */

/* TIER 1 — Resultado orgánico (OpenStreetMap) — solo informativo, no clickeable */
.place-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  cursor: default;
  opacity: 0.82;
}

/* TIER 2 — Conectado (pagado regular) — clickeable, color ámbar/verde */
.place-card-conectado {
  background: linear-gradient(150deg, #F6FFF9 0%, #EDFAF3 100%);
  border-radius: var(--r);
  border: 1.5px solid rgba(16,185,129,0.22);
  border-left: 4px solid #10B981;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(16,185,129,0.10);
}
.place-card-conectado:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16,185,129,0.18);
  border-color: rgba(16,185,129,0.4);
}

/* TIER 3 — Vitrina (pagado premium) — reservado para futuro */
.place-card-vitrina {
  background: linear-gradient(150deg, #FFFBF0 0%, #FFF3D0 100%);
  border-radius: var(--r);
  border: 1.5px solid rgba(245,158,11,0.28);
  border-left: 4px solid #F59E0B;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(245,158,11,0.12);
}
.place-card-vitrina:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245,158,11,0.22);
  border-color: rgba(245,158,11,0.5);
}

/* Mantener clase antigua como alias para no romper código existente */
.place-card-verificado {
  background: linear-gradient(150deg, #F6FFF9 0%, #EDFAF3 100%);
  border-radius: var(--r);
  border: 1.5px solid rgba(16,185,129,0.22);
  border-left: 4px solid #10B981;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(16,185,129,0.10);
}
.place-card-verificado:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16,185,129,0.18);
}

/* Badge tier 2 — Conectado */
.badge-conectado {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #059669, #10B981);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* Badge tier 3 — Vitrina */
.badge-vitrina {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* Badge viejo como alias */
.badge-wufly {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #059669, #10B981);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.place-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.place-icon { width:44px; height:44px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.place-name { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:15px; line-height:1.2; margin-bottom:3px; }
.place-type { font-size:11px; color:var(--text-hint); font-weight:600; letter-spacing:0.04em; }
.stars { color:var(--gold); font-size:12px; }
.rating-num { font-size:12px; font-weight:600; color:var(--text-muted); margin-left:3px; }
.place-desc { font-size:13px; color:var(--text-muted); line-height:1.5; margin-bottom:10px; }
.place-tags { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:10px; }
.ptag { font-size:11px; font-weight:600; padding:3px 10px; border-radius:var(--r-pill); background:var(--green-light); color:var(--green-dark); }
.ptag.gray { background:var(--bg); color:var(--text-muted); }
.place-foot { display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--border); padding-top:10px; font-size:12px; color:var(--text-muted); }
.place-foot a { color:var(--green); font-weight:600; text-decoration:none; font-size:12px; }
.badge-cert { display:inline-flex; align-items:center; gap:4px; background:var(--gold); color:white; font-size:10px; font-weight:700; padding:3px 8px; border-radius:var(--r-pill); letter-spacing:0.03em; }
.empty-state { text-align:center; padding:40px 20px; color:var(--text-hint); }
.empty-state p { font-size:14px; margin-top:8px; }

/* ── ALLERGY PROFILE ── */
.profile-card {
  background:var(--surface);
  border-radius:var(--r);
  border:1.5px solid var(--border);
  padding:18px;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
}
.profile-card h3 { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:17px; margin-bottom:4px; }
.profile-card p { font-size:13px; color:var(--text-muted); line-height:1.5; margin-bottom:16px; }

.allergy-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:16px; }
.allergy-toggle {
  background:var(--bg);
  border:1.5px solid var(--border);
  border-radius:var(--r-sm);
  padding:12px;
  cursor:pointer;
  transition:all 0.2s;
  display:flex;
  align-items:center;
  gap:10px;
}
.allergy-toggle:hover { border-color:rgba(78,107,74,0.4); }
.allergy-toggle.selected { background:var(--green-light); border-color:var(--green); }
.allergy-toggle.selected .at-check { background:var(--green); border-color:var(--green); color:white; }
.at-emoji { font-size:20px; flex-shrink:0; }
.at-info { flex:1; min-width:0; }
.at-name { font-size:13px; font-weight:600; color:var(--text); line-height:1.2; }
.at-sub { font-size:10px; color:var(--text-muted); margin-top:1px; }
.at-check { width:18px; height:18px; border-radius:5px; border:1.5px solid var(--border-md); display:flex; align-items:center; justify-content:center; font-size:11px; flex-shrink:0; transition:all 0.15s; }

.custom-allergy-wrap { margin-top:4px; }
.custom-allergy-wrap label { font-size:11px; font-weight:700; color:var(--text-hint); letter-spacing:0.06em; display:block; margin-bottom:8px; }
.custom-input-row { display:flex; gap:8px; }
.custom-input-row input { flex:1; border:1.5px solid var(--border); border-radius:var(--r-xs); padding:10px 12px; font-family:'Plus Jakarta Sans', sans-serif; font-size:13px; color:var(--text); outline:none; background:var(--bg); }
.custom-input-row input:focus { border-color:var(--green); }
.btn-add { background:var(--green); color:white; border:none; border-radius:var(--r-xs); padding:10px 16px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; font-family:'Plus Jakarta Sans', sans-serif; }
.custom-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.custom-tag { display:inline-flex; align-items:center; gap:5px; background:var(--gold-light); color:var(--gold-dark); font-size:12px; font-weight:600; padding:4px 10px; border-radius:var(--r-pill); }
.custom-tag button { background:none; border:none; color:var(--gold-dark); cursor:pointer; font-size:14px; line-height:1; padding:0; }

/* ── AI CHAT ── */
.ai-chat-card {
  background:var(--surface);
  border-radius:var(--r);
  border:1.5px solid var(--border);
  overflow:hidden;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
}
.ai-chat-header {
  background:linear-gradient(135deg, var(--green), var(--green-dark));
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid rgba(255,255,255,0.1);
}
.ai-chat-header svg { width:20px; height:20px; stroke:var(--cream); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.ai-chat-header h4 { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:15px; color:var(--cream); }
.ai-chat-header p { font-size:11px; color:var(--cream); opacity:0.7; margin-top:1px; }
.chat-messages { padding:14px; display:flex; flex-direction:column; gap:10px; min-height:80px; max-height:300px; overflow-y:auto; }
.msg { max-width:85%; padding:10px 13px; border-radius:14px; font-size:13px; line-height:1.55; }
.msg.bot { background:var(--green-light); color:var(--green-dark); align-self:flex-start; border-bottom-left-radius:4px; }
.msg.user { background:var(--green); color:white; align-self:flex-end; border-bottom-right-radius:4px; }
.msg.loading-msg { background:var(--bg); color:var(--text-hint); align-self:flex-start; }
.chat-input-row { display:flex; gap:8px; padding:12px 14px; border-top:1px solid var(--border); }
.chat-input-row input { flex:1; border:1.5px solid var(--border); border-radius:var(--r-xs); padding:10px 12px; font-family:'Plus Jakarta Sans', sans-serif; font-size:13px; color:var(--text); outline:none; }
.chat-input-row input:focus { border-color:var(--green); }
.btn-send { background:var(--green); color:white; border:none; border-radius:var(--r-xs); padding:10px 16px; font-size:13px; font-weight:600; cursor:pointer; font-family:'Plus Jakarta Sans', sans-serif; white-space:nowrap; }
.btn-send:disabled { background:#9AB59A; cursor:not-allowed; }
.btn-mic { background:var(--purple-light); color:var(--purple); border:none; border-radius:var(--r-xs); padding:10px 12px; cursor:pointer; flex-shrink:0; display:flex; align-items:center; justify-content:center; transition:background 0.2s, color 0.2s; }
.btn-mic.recording { background:#FEE2E2; color:#DC2626; animation:mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100% { transform:scale(1); box-shadow:0 0 0 0 rgba(220,38,38,0.3); } 50% { transform:scale(1.08); box-shadow:0 0 0 6px rgba(220,38,38,0); } }

/* ── DRA. WUFLY AVATAR ── */
.drw-wrap {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 0;
  background: #e8e0f5;
  height: 260px;
  box-shadow: var(--shadow-md);
}
.drw-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.drw-bubble {
  position: relative;
  margin: 0 0 14px 0;
  padding: 14px 18px;
  border-radius: 18px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  transform: scale(0.5);
  transform-origin: top left;
}
.drw-bubble--user {
  transform-origin: top right;
}
.drw-bubble.visible {
  animation: drwBubblePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes drwBubblePop {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.drw-bubble--doc {
  background: var(--purple);
  color: white;
  border-top-left-radius: 5px;
}
.drw-bubble--doc::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 22px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 9px solid var(--purple);
}
.drw-bubble--user {
  background: #f0eef6;
  color: #1a1a1a;
  border-top-right-radius: 5px;
  text-align: right;
}
.drw-bubble--user::before {
  content: '';
  position: absolute;
  top: -9px;
  right: 22px;
  left: auto;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid #f0eef6;
}
.drw-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  margin: 0 3px;
  animation: drwDotPulse 1.3s infinite ease-in-out;
}
.drw-dot:nth-child(2) { animation-delay: 0.2s; }
.drw-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes drwDotPulse {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.45; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position:fixed; bottom:0;
  left:50%; transform:translateX(-50%);
  width:100%; max-width:480px;
  background:var(--green);
  border-top:1px solid rgba(255,255,255,0.1);
  display:flex;
  padding:8px 0 20px;
  z-index:200;
  box-shadow:0 -4px 20px rgba(0,0,0,0.15);
}
.nav-btn {
  flex:1;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  cursor:pointer; padding:6px 2px;
  transition:all 0.15s;
  color:rgba(255,255,255,0.45);
  font-size:8px; font-weight:700; letter-spacing:0.03em;
  border:none; background:transparent; position:relative;
}
.nav-btn svg { width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.nav-btn.active { color:var(--gold); }
.nav-btn.active svg { stroke-width:2.2; }
.nav-dot { position:absolute; top:4px; right:calc(50% - 16px); width:7px; height:7px; background:var(--gold); border-radius:50%; border:2px solid var(--green); display:none; }
.nav-dot.show { display:block; }

/* ── DESTACADO DEL MES ── */
.featured-card {
  background:var(--surface);
  border-radius:var(--r);
  border:1.5px solid rgba(78,107,74,0.2);
  overflow:hidden;
  margin-bottom:16px;
  box-shadow:var(--shadow-md);
  width:100%;
}
.featured-badge {
  background:linear-gradient(135deg, var(--green), var(--green-dark));
  color:var(--gold);
  font-size:11px;
  font-weight:700;
  padding:8px 16px;
  letter-spacing:0.05em;
  display:block;
  width:100%;
}
.featured-body {
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  width:100%;
  box-sizing:border-box;
}
.featured-info { display:flex; gap:12px; align-items:flex-start; width:100%; }
.featured-icon {
  width:44px; height:44px; min-width:44px;
  background:var(--green-light);
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; flex-shrink:0;
}
.featured-info > div:last-child { flex:1; min-width:0; overflow:hidden; }
.featured-name { font-family:'Funnel Display', sans-serif; font-weight:700; font-size:16px; color:var(--text); margin-bottom:2px; }
.featured-type { font-size:10px; font-weight:700; color:var(--text-hint); letter-spacing:0.04em; margin-bottom:5px; }
.featured-desc { font-size:12px; color:var(--text-muted); line-height:1.5; margin-bottom:7px; word-break:break-word; }
.featured-tags { display:flex; flex-wrap:wrap; gap:5px; }
.featured-tag { font-size:11px; font-weight:600; padding:3px 9px; border-radius:var(--r-pill); background:var(--green-light); color:var(--green-dark); white-space:nowrap; }
.featured-tag.gold { background:var(--gold); color:white; }

.featured-map-wrap { border-radius:var(--r-sm); overflow:hidden; border:1px solid var(--border); width:100%; position:relative; }
.featured-map { width:100%; height:160px; border:none; display:block; }
.featured-map-link {
  display:block; text-align:center; padding:9px;
  font-size:12px; font-weight:600;
  color:var(--green); text-decoration:none;
  background:var(--green-pale);
  border-top:1px solid var(--border);
  transition:background 0.15s;
}
.featured-map-link:hover { background:var(--green-light); }
.featured-foot {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; border-top:1px solid var(--border);
  padding-top:11px; font-size:12px; color:var(--text-muted); flex-wrap:wrap;
}
.featured-foot span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.featured-foot a { color:var(--green); font-weight:600; text-decoration:none; white-space:nowrap; flex-shrink:0; }

/* ── PROFILE SUMMARY ── */
#profileSummaryCard {
  background:linear-gradient(135deg, var(--green-light), var(--gold-pale));
  border:1.5px solid rgba(78,107,74,0.2);
  border-radius:var(--r);
  padding:18px;
  margin-bottom:14px;
  display:none;
}
.ps-inner { display:flex; flex-direction:column; gap:10px; }
.ps-name { font-size:15px; color:var(--text); }
.ps-name strong { font-family:'Funnel Display', sans-serif; font-size:18px; }
.ps-tags { display:flex; flex-wrap:wrap; gap:6px; }
.ps-tag { font-size:11px; font-weight:600; padding:4px 11px; border-radius:var(--r-pill); }
.ps-tag.coral { background:var(--green-light); color:var(--green-dark); }
.ps-tag.amber { background:var(--gold-light); color:var(--gold-dark); }
.ps-tag.mint  { background:var(--green-light); color:var(--green-dark); }
.ps-tag.violet { background:var(--gold-light); color:var(--gold-dark); }
.ps-edit-btn {
  background:none; border:1.5px solid var(--border-md);
  border-radius:var(--r-xs); padding:8px 14px;
  font-size:12px; font-weight:600; color:var(--text-muted);
  cursor:pointer; font-family:'Plus Jakarta Sans', sans-serif;
  align-self:flex-start; transition:all 0.15s;
}
.ps-edit-btn:hover { border-color:var(--green); color:var(--green); }

/* ══════════════════════════════════════
   DESKTOP LAYOUT — min-width: 900px
   ══════════════════════════════════════ */
@media (min-width: 900px) {

  /* Fondo de hojas en toda la pantalla */
  html, body {
    height: 100%;
    overflow: hidden;
  }

  html {
    background: linear-gradient(135deg, #3B1A8C 0%, #5C2FA8 40%, #7C4DCC 70%, #96C7B3 100%);
    background-attachment: fixed;
  }

  body {
    max-width: 100%;
    background: transparent;
    padding-bottom: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }

  /* Ocultar bottom nav en desktop */
  .bottom-nav { display: none !important; }

  /* El topbar global se oculta — se usa el que está dentro de app-column */
  .topbar { display: none; }

  /* Layout principal: dos columnas a 100vh */
  .desktop-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
  }

  /* ── COLUMNA IZQUIERDA: app completa con su propio topbar ── */
  .app-column {
    width: 460px;
    min-width: 460px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    /* 3. Sombra que separa ambas secciones */
    box-shadow: 6px 0 40px rgba(0,0,0,1);
    position: relative;
    z-index: 10;
    overflow: hidden;
    /* 4. Pequeño margen izquierdo */
    margin-left: 140px;
    border-radius: 0 0 0 0;
    border-left: 1px solid #888c67;
    border-right: 1px solid #888c67;
  }

  /* Topbar propio dentro de la columna izquierda — siempre visible */
  .app-column .app-topbar {
    display: block !important;
    flex-shrink: 0;
  }

  /* El topbar dentro del app-column debe funcionar normal (no sticky) */
  .app-column .app-topbar .topbar {
    display: block !important;
    position: relative;
    max-width: 100%;
    border-radius: 0;
  }

  /* 2. Área scrollable de las páginas — overflow-y: auto para habilitar scroll */
  .app-column .app-pages {
    flex: 1;
    overflow-y: auto;
    overflow-x: clip;
    scrollbar-width: thin;
    scrollbar-color: rgba(78,107,74,0.3) transparent;
    min-height: 0;
    position: relative;
  }
  .app-column .app-pages::-webkit-scrollbar { width: 4px; }
  .app-column .app-pages::-webkit-scrollbar-thumb { background: rgba(78,107,74,0.3); border-radius: 4px; }

  .app-column .page { padding: 0px; }

  /* ── COLUMNA DERECHA: info sin scroll ── */
  .info-column {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 170px;
    padding-top: 40px;
    padding-bottom: 40px;
    gap: 0;
    overflow: hidden;
  }

  /* Cards que se distribuyen en el espacio disponible */
  .info-card {
    flex: 1;
    background: rgb(255 255 255 / 10%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    padding: 24px 28px;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  /* Espacio entre cards */
  .info-column > .info-card + .info-card { margin-top: 16px; }

  .info-card-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
  }

  .info-card h2 {
    font-family: 'Funnel Display', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 10px;
  }

  .info-card p {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255,255,255,0.72);
  }

  .info-card-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 12px 0;
  }

  .info-tip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }

  .info-tip + .info-tip { margin-top: 10px; }

  .info-tip-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(232,168,32,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
  }

  .info-tip-text { font-size: 12px; color: rgba(255,255,255,0.78); line-height: 1.55; }
  .info-tip-text strong { color: #fff; display: block; margin-bottom: 1px; font-size: 12px; }

  .info-stat-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }

  .info-stat {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
  }

  .info-stat-num {
    font-family: 'Funnel Display', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
  }

  .info-stat-label {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    margin-top: 3px;
  }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .app-column { width: 400px; min-width: 400px; }
  .info-column { padding: 28px 32px; }
  .info-card h2 { font-size: 18px; }
  .info-card { padding: 18px 22px; }
}

/* ── Lightbox ── */
#photoLightbox {
  opacity: 0;
  transition: opacity 0.38s ease;
}
#photoLightbox.lb-active {
  opacity: 1;
}
#photoLightboxImg {
  transform: scale(0.86);
  opacity: 0;
  transition: transform 0.48s cubic-bezier(0.34, 1.46, 0.64, 1), opacity 0.32s ease;
}
#photoLightbox.lb-active #photoLightboxImg {
  transform: scale(1);
  opacity: 1;
}
#photoLightbox button {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.28s ease 0.22s, transform 0.28s ease 0.22s;
}
#photoLightbox.lb-active button {
  opacity: 1;
  transform: scale(1);
}

/* Feedback táctil en fotos del feed */
#adoptFeed img[onclick],
#perdidoFeed img[onclick],
#rescateFeed img[onclick] {
  transition: transform 0.15s ease, filter 0.15s ease;
}
#adoptFeed img[onclick]:active,
#perdidoFeed img[onclick]:active,
#rescateFeed img[onclick]:active {
  transform: scale(0.97);
  filter: brightness(0.88);
}
