/* =============================================================
   Huellas a Casa · estilos
   Pensado primero para el celular, se acomoda en la compu.
   ============================================================= */
:root {
  --bg: #F7F6F0;
  --paper: #FFFFFF;
  --paper-2: #FAFAF6;
  --line: #E5E7DD;
  --sage-50: #F1F6EC;
  --sage-100: #E4EFD9;
  --sage-200: #D2E4C0;
  --sage-300: #BFD7A6;
  --sage-500: #6F9A5A;
  --forest: #1C5153;
  --forest-2: #153E40;
  --ink: #1F2B2C;
  --ink-soft: #3A4A4B;
  --muted: #6B7670;
  --sun: #F39B4A;
  --sun-soft: #FDE8D3;
  --coral: #E9784A;
  --coral-soft: #FDE6DD;
  --red: #D94B3F;
  --red-soft: #FBE3DF;
  --sky-soft: #E1EEF2;
  --wa: #25B35E;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(28, 43, 36, .05), 0 2px 10px rgba(28, 43, 36, .04);
  --shadow: 0 2px 6px rgba(28, 43, 36, .05), 0 14px 34px -12px rgba(28, 43, 36, .18);
  --shadow-lg: 0 30px 60px -24px rgba(28, 43, 36, .35);

  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --script: 'Caveat', 'Segoe Print', 'Comic Sans MS', cursive;
  --side-w: 256px;
  --tab-h: 70px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--forest); }
h1, h2, h3, h4 { font-weight: 900; line-height: 1.15; margin: 0 0 .45em; letter-spacing: -.015em; color: var(--forest-2); }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { background: var(--sage-100); padding: .1em .4em; border-radius: 6px; font-size: .88em; }
svg { width: 1em; height: 1em; flex-shrink: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.script { font-family: var(--script); font-weight: 700; line-height: 1.05; letter-spacing: 0; }
.doodle { width: 1.1em; height: 1.1em; vertical-align: -.15em; color: currentColor; }
.doodle-line { width: 160px; height: 14px; display: block; }
.eyebrow { display: inline-flex; align-items: center; gap: .45em; font-weight: 900; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-500); margin-bottom: .6rem; }
.eyebrow svg { width: 1.2em; height: 1.2em; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Estructura: menú lateral + contenido ---------- */
.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px 16px 32px; }
.page--narrow { max-width: 820px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 60;
  background: var(--paper-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 18px 0; overflow-y: auto; overflow-x: hidden;
  transform: translateX(-105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 22px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--forest-2); width: 100%; }
.brand-logo { display: block; width: 172px; height: auto; }
.brand-barrio { font-size: .62rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-500); }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: .98rem; transition: background .15s, transform .15s; }
.side-nav a svg { width: 22px; height: 22px; color: var(--forest); }
.side-nav a:hover { background: var(--sage-50); transform: translateX(3px); }
.side-nav a[aria-current="page"] { background: var(--sage-100); color: var(--forest-2); font-weight: 800; }
.side-note { font-size: 1.7rem; color: var(--forest-2); transform: rotate(-7deg); margin: 34px 6px 0; }
.side-note .doodle { color: var(--coral); }
.side-foot { position: relative; margin-top: auto; padding: 90px 0 20px 52px; font-size: .74rem; color: var(--muted); }
.side-foot strong { color: var(--forest-2); font-size: .8rem; }
.side-foot p { position: relative; margin: 0; }
.leaf { position: absolute; background: var(--sage-200); border-radius: 0 100% 0 100%; }
.leaf--1 { width: 120px; height: 120px; left: -40px; bottom: -30px; transform: rotate(-20deg); }
.leaf--2 { width: 70px; height: 70px; left: 40px; bottom: 60px; background: var(--sage-300); transform: rotate(30deg); opacity: .7; }

.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: rgba(246, 245, 239, .9); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--paper); color: var(--forest-2); box-shadow: var(--shadow-sm); cursor: pointer; text-decoration: none; flex-shrink: 0; }
.icon-btn svg { width: 22px; height: 22px; }
.sidebar-close { display: grid; }
.topbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--forest-2); margin-right: auto; min-width: 0; }
.topbar-brand img { width: 62px; height: auto; }
.topbar-brand span { display: flex; flex-direction: column; font-family: var(--script); font-weight: 700; line-height: .9; white-space: nowrap; }
.topbar-brand strong { font-size: 1.7rem; }
.topbar-brand small { font-size: 1rem; }
.top-search { display: none; position: relative; flex: 1; max-width: 600px; }
.top-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.top-search input { width: 100%; padding: 12px 16px 12px 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font: inherit; color: var(--ink); box-shadow: var(--shadow-sm); }
.top-search input:focus { outline: none; border-color: var(--sage-500); }
.bell-dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--bg); animation: pop 2s ease-in-out infinite; }
.user-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--forest-2); font-weight: 800; flex-shrink: 0; }
.user-chip .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 900; }
.user-chip .avatar svg { width: 20px; height: 20px; }
.user-chip .user-name, .user-chip > svg { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(21, 62, 64, .35); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }
.menu-open .scrim { opacity: 1; pointer-events: auto; }
.demo-bar { background: var(--sun-soft); color: #6B5310; font-size: .82rem; padding: 7px 16px; border-bottom: 1px solid #F3E2A2; }

/* Barra inferior (celular) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); padding: 0 6px env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -16px rgba(28, 43, 36, .25);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 800; -webkit-tap-highlight-color: transparent; }
.tab-ico { display: grid; place-items: center; width: 44px; height: 30px; border-radius: 999px; transition: background .2s; }
.tab-ico svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--forest-2); }
.tabbar a[aria-current="page"] .tab-ico { background: var(--sage-100); }
.tabbar .tab-big .tab-ico { width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; background: var(--coral); color: #fff; box-shadow: 0 10px 20px -8px var(--coral), 0 0 0 5px var(--bg); animation: breathe 3s ease-in-out infinite; }
.tabbar .tab-big .tab-ico svg { width: 28px; height: 28px; }
.tabbar .tab-big { color: var(--coral); }
body.has-sidebar { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 700px) {
  .page { padding: 24px 24px 40px; }
  .top-search { display: block; }
}
@media (min-width: 1024px) {
  body.has-sidebar { padding-left: var(--side-w); padding-bottom: 0; }
  .sidebar { transform: none; }
  .sidebar-close, .menu-btn, .topbar-brand, .tabbar, .scrim { display: none !important; }
  .topbar { padding: 14px 28px; gap: 16px; }
  .top-search { margin-right: auto; }
  .user-chip .user-name, .user-chip > svg { display: inline; }
  .user-chip > svg { width: 16px; height: 16px; color: var(--muted); }
  .page { padding: 24px 28px 48px; }
  .demo-bar { padding: 7px 28px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.35em; border-radius: 14px; border: 2px solid transparent;
  font: inherit; font-weight: 800; font-size: .98rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 1.2em; height: 1.2em; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn--forest { background: var(--forest); color: #fff; box-shadow: 0 10px 22px -12px var(--forest); }
.btn--forest:hover { background: var(--forest-2); }
.btn--sun { background: var(--sun); color: var(--forest-2); box-shadow: 0 10px 22px -12px #C9671F; }
.btn--coral { background: var(--coral); color: #fff; box-shadow: 0 10px 22px -12px var(--coral); }
.btn--wa { background: var(--wa); color: #fff; box-shadow: 0 10px 22px -12px var(--wa); }
.btn--light { background: var(--paper); color: var(--forest-2); border-color: var(--line); }
.btn--light:hover { border-color: var(--sage-300); }
.btn--ghost { background: transparent; color: var(--forest-2); border-color: var(--line); }
.btn--glass { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn--danger { background: transparent; color: var(--red); border-color: var(--red-soft); }
.btn--danger:hover { background: var(--red-soft); }
.btn--sm { padding: .5em .9em; font-size: .86rem; border-radius: 11px; }
.btn--lg { padding: 1em 1.4em; font-size: 1.05rem; border-radius: 16px; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: .82rem; color: var(--forest); text-decoration: none; white-space: nowrap; }
.link-arrow svg { width: 15px; height: 15px; transition: transform .15s; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Paneles ---------- */
.panel { background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
@media (min-width: 700px) { .panel { padding: 24px; } }

/* ---------- Portada ---------- */
.hero-banner {
  position: relative; overflow: hidden; border-radius: 26px; color: #fff; isolation: isolate;
  background: var(--forest-2);
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 18px 20px 24px;
  box-shadow: var(--shadow);
}
.hero-banner::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 92% 8%, rgba(191, 215, 166, .28) 0 110px, transparent 111px), radial-gradient(circle at 4% 100%, rgba(191, 215, 166, .16) 0 140px, transparent 141px); }
.hero-duo { display: block; width: min(330px, 92%); height: auto; margin: 0 auto -4px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .22)); transform-origin: bottom center; animation: saludo 4.5s ease-in-out infinite; }
.hero-text { max-width: 560px; }
.hero-eyebrow { font-size: .68rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; opacity: .9; margin-bottom: 8px; color: var(--sage-300); }
.hero-title { font-size: clamp(3rem, 12vw, 5.4rem); color: #fff; margin: 0 0 4px; transform: rotate(-3deg); transform-origin: left; }
.hero-title small { display: block; font-size: .5em; margin-bottom: -.1em; color: var(--sage-300); }
.hero-tagline { font-family: var(--script); font-weight: 700; font-size: clamp(1.4rem, 6vw, 1.8rem); color: var(--sun); margin: 0 0 10px; line-height: 1; }
.hero-lead { font-size: 1rem; font-weight: 700; max-width: 440px; margin-bottom: 18px; opacity: .95; }
.hero-heart { position: absolute; color: var(--sun); opacity: .9; animation: float 5s ease-in-out infinite; }
.hero-heart svg { width: 100%; height: 100%; }
.hero-heart--1 { width: 30px; height: 30px; top: 22px; right: 22px; }
.hero-heart--2 { display: none; width: 26px; height: 26px; animation-delay: -2s; }
@media (min-width: 900px) {
  .hero-banner { flex-direction: row-reverse; align-items: center; justify-content: space-between; min-height: 300px; padding: 30px 40px; gap: 24px; }
  .hero-duo { width: 400px; max-width: 44%; margin: 0 -6px -30px 0; align-self: flex-end; }
  .hero-heart--2 { display: block; top: 30px; left: 50%; }
  .hero-heart--1 { right: 32px; }
}

/* ---------- Tablero de inicio ---------- */
.dash { display: grid; gap: 18px; margin-top: 18px; }
.dash-main, .dash-aside { display: grid; gap: 18px; align-content: start; min-width: 0; }
@media (min-width: 1280px) { .dash { grid-template-columns: minmax(0, 1fr) 320px; } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--paper); border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform .2s; }
.stat:hover { transform: translateY(-3px); }
.stat-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; }
.stat > div > span { display: block; color: var(--ink-soft); font-weight: 700; font-size: .8rem; line-height: 1.3; }
.stat strong { display: block; font-size: 1.85rem; font-weight: 900; color: var(--forest-2); line-height: 1.1; margin-top: 2px; }
@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .stat { flex-direction: row; align-items: center; padding: 18px; gap: 14px; }
  .stat-icon { width: 54px; height: 54px; }
}

.promo { position: relative; overflow: hidden; border-radius: 20px; min-height: 150px; background: var(--forest-2) url('../img/gato.jpg') right center / auto 100% no-repeat; color: #fff; padding: 20px; display: flex; align-items: center; box-shadow: var(--shadow-sm); text-decoration: none; }
.promo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--forest-2) 40%, rgba(21, 62, 64, 0) 75%); }
.promo p { position: relative; font-size: 2.1rem; margin: 0; transform: rotate(-8deg); max-width: 60%; }
.promo .doodle { color: var(--sun); }

/* ---------- Tarjetas de animales ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.filters .search { grid-column: 1 / -1; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input, .select { width: 100%; padding: 12px 14px 12px 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: .92rem; color: var(--ink); }
.select { padding-left: 14px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%236B7670' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; cursor: pointer; }
.search input:focus, .select:focus { outline: none; border-color: var(--sage-500); }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } .filters .search { grid-column: auto; } }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; } }
.card { position: relative; display: flex; flex-direction: column; background: var(--paper); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.2, .8, .2, 1.4), box-shadow .2s; animation: rise .5s both; }
.card:hover { transform: translateY(-5px) rotate(-.6deg); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 1.42; background: var(--sage-100); overflow: hidden; }
.card-media img, .card-media .ph { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 10px 12px 14px; }
.card-body h3 { margin: 0; font-size: 1.05rem; }
.card-meta { margin: 0; color: var(--muted); font-size: .8rem; font-weight: 600; }
.card-code { display: flex; align-items: center; gap: 5px; margin: 4px 0 10px; color: var(--muted); font-size: .74rem; font-weight: 700; }
.card-code svg { width: 15px; height: 15px; }
.card--perdido { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft), var(--shadow-sm); }
@media (min-width: 700px) { .card-body { padding: 12px 14px 16px; } .card-body h3 { font-size: 1.15rem; } }

.fav { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(21, 62, 64, .28); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .2s; }
.fav svg { width: 20px; height: 20px; }
.fav:hover { transform: scale(1.12); }
.fav[aria-pressed="true"] { background: #fff; color: var(--coral); animation: pop .4s ease; }
.fav[aria-pressed="true"] svg path { fill: currentColor; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.pill--casa { background: var(--sage-100); color: var(--forest); }
.pill--perdido { background: var(--red); color: #fff; }
.pill--sun { background: var(--sun-soft); color: #7A5A0C; }
.pill--xs { padding: 1px 8px; font-size: .66rem; vertical-align: middle; }

.ph { width: 100%; height: 100%; background: var(--ph-bg, var(--sage-100)); color: var(--forest); display: grid; place-items: center; }
.ph svg { width: 56%; height: 56%; opacity: .8; }
.ph:has(img.pj) { place-items: end center; overflow: hidden; }
.ph img.pj { width: auto; height: 86%; max-width: 88%; object-fit: contain; object-position: bottom; }

.cta-band { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; padding: 16px 18px; border-radius: 18px; background: var(--sage-50); border: 1px solid var(--sage-100); }
.cta-band .ico { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--forest); flex-shrink: 0; }
.cta-band .ico svg { width: 24px; height: 24px; }
.cta-band div { flex: 1 1 200px; }
.cta-band strong { display: block; color: var(--forest-2); }
.cta-band p { margin: 0; font-size: .88rem; color: var(--muted); }

.empty { text-align: center; padding: 40px 20px; background: var(--paper-2); border-radius: 18px; border: 2px dashed var(--line); color: var(--muted); }
.empty .big { display: block; width: 90px; margin: 0 auto 10px; color: var(--sage-500); }
.empty .big svg, .empty .big img { display: block; width: 100%; height: auto; }

/* ---------- Escaneos ---------- */
.scans { list-style: none; margin: 0; padding: 0; display: grid; }
.scan { display: grid; grid-template-columns: 54px 1fr 20px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.scan:last-child { border-bottom: 0; padding-bottom: 0; }
.scan-thumb { width: 54px; height: 54px; border-radius: 14px; overflow: hidden; background: var(--sage-100); }
.scan-thumb img, .scan-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.scan-body { display: grid; gap: 1px; min-width: 0; font-size: .78rem; color: var(--muted); }
.scan-name { font-weight: 900; color: var(--forest-2); font-size: .95rem; text-decoration: none; }
.scan-place a, .scan-place span { display: inline-flex; align-items: center; gap: 4px; color: var(--forest); font-weight: 700; text-decoration: none; }
.scan-place svg { width: 14px; height: 14px; }
.scan-go { color: var(--muted); }
.scan-go svg { width: 18px; height: 18px; }

/* ---------- Mapa ---------- */
.map { position: relative; height: 230px; border-radius: 16px; overflow: hidden; background: var(--sage-50); border: 1px solid var(--line); z-index: 0; }
.map--big { height: min(68vh, 620px); }
.map .leaflet-tile-pane { filter: saturate(.55) sepia(.12) hue-rotate(35deg) brightness(1.04); }
.map-pin { width: 34px; height: 42px; color: var(--forest); filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.map-pin svg { width: 100%; height: 100%; }
.map-pin--perdido { color: var(--red); animation: bounce-pin 1.6s ease-in-out infinite; }
.map-pin--reporte { color: var(--coral); }
.map-label { background: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 900; font-size: .78rem; color: var(--forest-2); box-shadow: var(--shadow-sm); white-space: nowrap; border: 0; }
.leaflet-popup-content-wrapper { border-radius: 16px !important; font-family: var(--font); }
.leaflet-popup-content { margin: 12px 14px !important; }
.pop { display: flex; gap: 10px; align-items: center; min-width: 190px; }
.pop .pop-thumb { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.pop .pop-thumb img, .pop .pop-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.pop strong { display: block; color: var(--forest-2); font-size: .95rem; }
.pop span { color: var(--muted); font-size: .78rem; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.found-card { position: relative; overflow: hidden; background: var(--sage-50); border-color: var(--sage-100); }
.found-card .found-dog { position: absolute; right: 4px; bottom: 0; width: 96px; color: var(--forest-2); }
.found-card .found-dog svg, .found-card .found-dog img { display: block; width: 100%; height: auto; }
.found-card p { font-size: .86rem; color: var(--ink-soft); max-width: 72%; margin: 0 0 12px; }
.found-card h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.found-card h3 svg { width: 22px; height: 22px; color: var(--forest); }

/* ---------- Encabezado de secciones internas ---------- */
.page-banner { position: relative; overflow: hidden; border-radius: 24px; color: #fff; padding: 22px 20px; margin-bottom: 18px; background: var(--forest-2); box-shadow: var(--shadow-sm); isolation: isolate; min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
.page-banner-img { position: absolute; inset: 0 0 0 auto; width: 52%; height: 100%; object-fit: cover; z-index: -1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%); mask-image: linear-gradient(90deg, transparent, #000 55%); }
.page-banner h1 { color: #fff; font-family: var(--script); font-weight: 700; font-size: clamp(2.4rem, 8vw, 3.6rem); margin: 0; transform: rotate(-2deg); transform-origin: left; max-width: 68%; line-height: 1; }
.page-banner p { margin: 8px 0 0; max-width: 58%; opacity: .92; font-weight: 600; font-size: .92rem; }
.page-banner .eyebrow { color: var(--sun); }
@media (min-width: 700px) { .page-banner { padding: 30px 34px; min-height: 180px; } .page-banner p { max-width: 50%; font-size: 1rem; } }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.fieldset { background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); padding: 18px; box-shadow: var(--shadow-sm); }
.fieldset-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.fieldset-head .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.fieldset-head .ico svg { width: 23px; height: 23px; }
.fieldset-head h2 { font-size: 1.2rem; margin: 0; }
.fieldset-head p { margin: 1px 0 0; color: var(--muted); font-size: .86rem; }
.fields { display: grid; grid-template-columns: 1fr; gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } .fieldset { padding: 26px; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 800; font-size: .88rem; color: var(--ink-soft); }
.field > span small { font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; transition: border-color .15s, background .15s, box-shadow .15s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sage-500); background: #fff; box-shadow: 0 0 0 4px var(--sage-50); }
.field .hint { font-size: .8rem; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: .6em 1.1em; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper-2); font-weight: 800; cursor: pointer; font-size: .92rem; transition: all .15s; }
.seg span svg { width: 18px; height: 18px; }
.seg input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; transform: scale(1.03); }
.seg input:focus-visible + span { outline: 3px solid var(--sage-200); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; font-size: .92rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--forest); }
.switch input:checked::after { transform: translateX(20px); }

.photo-drop { display: grid; grid-template-columns: 1fr; gap: 16px; justify-items: center; text-align: center; }
.photo-preview { width: 150px; height: 150px; border-radius: 28px; overflow: hidden; background: var(--sage-100); box-shadow: var(--shadow-sm); border: 4px solid #fff; transform: rotate(-3deg); }
.photo-preview img, .photo-preview .ph { width: 100%; height: 100%; object-fit: cover; }
.photo-drop input[type=file] { display: none; }
@media (min-width: 560px) { .photo-drop { grid-template-columns: 150px 1fr; justify-items: start; text-align: left; align-items: center; } }

.choice-cards { display: grid; gap: 10px; }
.choice-cards label { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--paper-2); cursor: pointer; transition: all .15s; }
.choice-cards input { margin-top: 4px; accent-color: var(--forest); width: 18px; height: 18px; flex-shrink: 0; }
.choice-cards strong { display: block; color: var(--forest-2); }
.choice-cards small { color: var(--muted); font-size: .84rem; }
.choice-cards label:has(input:checked) { border-color: var(--forest); background: var(--sage-50); }
@media (min-width: 900px) { .choice-cards { grid-template-columns: repeat(3, 1fr); } }

.chapita-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.form-actions { position: sticky; bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: flex; gap: 10px; justify-content: flex-end; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 10px; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.form-actions .btn { flex: 1; }
@media (min-width: 1024px) { .form-actions { bottom: 14px; } .form-actions .btn { flex: 0 0 auto; } }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--sky-soft); color: #234A60; font-size: .9rem; align-items: flex-start; }
.notice svg { width: 22px; height: 22px; margin-top: 1px; }
.notice--sun { background: var(--sun-soft); color: #6B5310; }
.notice--sage { background: var(--sage-50); color: var(--forest-2); border: 1px solid var(--sage-100); }

/* ---------- Login ---------- */
.login { max-width: 460px; margin: 0 auto; text-align: center; }
.login-icon { display: block; width: 190px; margin: 0 auto 10px; }
.login-icon img { display: block; width: 100%; height: auto; }
.login-form { display: grid; gap: 14px; text-align: left; margin-top: 16px; }
.login-ok { margin-top: 16px; padding: 16px; background: var(--sage-100); color: var(--forest-2); border-radius: 14px; }

/* ---------- Ficha del animal ---------- */
.lost-banner { background: var(--red); color: #fff; border-radius: 20px; padding: 14px 18px; display: flex; gap: 12px; align-items: center; margin-bottom: 16px; box-shadow: 0 16px 30px -16px var(--red); animation: attention 2.4s ease-in-out infinite; }
.lost-banner svg { width: 30px; height: 30px; flex-shrink: 0; }
.lost-banner strong { font-family: var(--script); font-size: 1.9rem; display: block; line-height: 1; }
.lost-banner span { opacity: .95; font-size: .9rem; font-weight: 600; }
.ficha-top { display: grid; gap: 18px; }
.ficha-photo { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 1; background: var(--sage-100); transform: rotate(-2deg); border: 6px solid #fff; box-shadow: var(--shadow-lg); max-width: 380px; width: 100%; margin: 6px auto 0; }
.ficha-photo img, .ficha-photo .ph { width: 100%; height: 100%; object-fit: cover; }
.ficha-photo .stamp { position: absolute; left: 12px; bottom: 12px; }
.ficha-info { text-align: center; }
.ficha-info h1 { font-family: var(--script); font-weight: 700; font-size: clamp(3.2rem, 12vw, 4.6rem); margin: 0; line-height: .95; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 16px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: var(--sage-50); font-weight: 800; font-size: .82rem; color: var(--ink-soft); border: 1px solid var(--sage-100); }
.badge svg { width: 15px; height: 15px; }
.badge--green { background: var(--sage-100); color: var(--forest); }
.badge--sun { background: var(--sun-soft); color: #7A5A0C; border-color: #F6E4A6; }
.badge--coral { background: var(--coral-soft); color: #B1482A; border-color: #F8D2C4; }
.badge--red { background: var(--red-soft); color: var(--red); border-color: #F5C9C3; }
.owner-msg { position: relative; text-align: left; background: var(--sun-soft); border-radius: 18px; padding: 14px 18px 14px 52px; margin: 0 0 16px; font-size: 1rem; font-weight: 600; }
.owner-msg::before { content: '“'; position: absolute; left: 14px; top: -4px; font-family: var(--script); font-size: 4rem; color: var(--sun); line-height: 1; }
.owner-msg cite { display: block; margin-top: 4px; font-style: normal; font-weight: 800; color: #7A5A0C; font-size: .86rem; }
.contact-actions { display: grid; gap: 10px; }
.contact-actions .btn { padding: 1em 1.2em; font-size: 1.05rem; justify-content: flex-start; border-radius: 16px; }
.contact-actions .btn small { margin-left: auto; font-weight: 700; opacity: .85; font-size: .8rem; }
.ficha-grid { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 900px) {
  .ficha-top { grid-template-columns: minmax(0, 400px) 1fr; gap: 40px; align-items: start; }
  .ficha-info { text-align: left; padding-top: 10px; }
  .badges { justify-content: flex-start; }
  .ficha-grid { grid-template-columns: repeat(3, 1fr); }
}
.info-card h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.info-card h2 .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.info-card h2 .ico svg { width: 19px; height: 19px; }
.kv { display: grid; margin: 0; }
.kv div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; }
.kv .warn dd { color: var(--red); }
.owner-tools { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--sage-50); border: 2px dashed var(--sage-200); }
.owner-tools strong { margin-right: auto; color: var(--forest-2); }
.consent { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-align: left; }
.consent .ico { width: 42px; height: 42px; border-radius: 50%; background: var(--sage-100); color: var(--forest); display: grid; place-items: center; flex-shrink: 0; }
.consent .ico svg { width: 22px; height: 22px; }
.consent div { flex: 1 1 200px; font-size: .88rem; }
.consent strong { display: block; color: var(--forest-2); font-size: .95rem; }

.state-card { text-align: center; max-width: 560px; margin: 24px auto; }
.state-card .tag-mini { width: 110px; height: 110px; margin: 0 auto 16px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); transform: rotate(-8deg); animation: wiggle 3s ease-in-out infinite; }
.state-card .tag-mini svg { width: 54px; height: 54px; }
.state-card .tag-mini.is-new { background: var(--sun); color: var(--forest-2); }
.code-pill { display: inline-block; font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: var(--sage-100); color: var(--forest-2); padding: 3px 11px; border-radius: 8px; letter-spacing: .12em; font-weight: 700; }

/* ---------- Encontré un animal ---------- */
.code-entry { display: flex; gap: 10px; flex-wrap: wrap; }
.code-entry input { flex: 1 1 140px; min-width: 0; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 1.4rem; letter-spacing: .2em; text-transform: uppercase; text-align: center; padding: 12px; border-radius: 14px; border: 2px solid var(--sage-200); background: #fff; color: var(--forest-2); font-weight: 800; }
.code-entry input:focus { outline: none; border-color: var(--forest); }
.ways { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 760px) { .ways { grid-template-columns: repeat(3, 1fr); } }
.way { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; }
.way .ico { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 4px; }
.way .ico svg { width: 26px; height: 26px; }
.way strong { color: var(--forest-2); font-size: 1.05rem; }
.way span { color: var(--muted); font-size: .88rem; }
.reportes { display: grid; gap: 12px; }
@media (min-width: 760px) { .reportes { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
.reporte { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.reporte-thumb { width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: var(--sage-100); }
.reporte-thumb img, .reporte-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.reporte p { margin: 0 0 4px; font-size: .88rem; }
.reporte .muted { font-size: .78rem; }
.reporte .btn-row { margin-top: 8px; gap: 6px; }

/* ---------- Información del barrio ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 0 16px; background: var(--paper); border-radius: 16px; border: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; padding: 10px 16px; border-radius: 12px; border: 0; background: transparent; font: inherit; font-weight: 800; font-size: .9rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--forest); color: #fff; }
.news { display: grid; gap: 12px; }
.news-item { padding: 16px 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-left: 6px solid var(--sage-300); }
.news-item--aviso { border-left-color: var(--sun); }
.news-item h3 { margin: 4px 0 6px; }
.news-item p { margin: 0; color: var(--ink-soft); white-space: pre-line; }
.tips { display: grid; gap: 12px; }
@media (min-width: 760px) { .tips { grid-template-columns: repeat(2, 1fr); } }
.tip { display: flex; gap: 14px; padding: 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.tip .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.tip .ico svg { width: 24px; height: 24px; }
.tip h3 { margin: 0 0 4px; font-size: 1rem; }
.tip p { margin: 0; color: var(--muted); font-size: .9rem; }
.story { position: relative; overflow: hidden; }
.story .script { font-size: 2.2rem; color: var(--forest-2); margin: 0 0 8px; transform: rotate(-2deg); }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--paper); border-radius: 16px; border: 1px solid var(--line); padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--forest-2); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.5rem; font-weight: 400; color: var(--sage-500); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); }

/* ---------- Mi cuenta y administración ---------- */
.rows { display: grid; gap: 10px; }
.row-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; background: var(--paper); border-radius: 18px; padding: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.row-thumb { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--sage-100); }
.row-thumb img, .row-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.row-item h3 { margin: 0; font-size: 1.02rem; }
.row-item p { margin: 0; font-size: .82rem; color: var(--muted); }
.row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 760px) { .row-item { grid-template-columns: 64px 1fr auto; } .row-actions { grid-column: auto; justify-content: flex-end; } }
.account-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
.tags-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tag-item { background: var(--paper); border-radius: 18px; border: 1px solid var(--line); padding: 16px; text-align: center; box-shadow: var(--shadow-sm); }
.tag-item .qr { width: 150px; height: 150px; margin: 0 auto 10px; padding: 8px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.tag-item .qr svg { width: 100%; height: 100%; }
.tag-item .url { font-size: .72rem; color: var(--muted); word-break: break-all; margin: 6px 0 12px; }
.tag-item .btn-row { justify-content: center; gap: 6px; }
.tools-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.tools-row .field { flex: 1 1 160px; }
.how { counter-reset: how; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .92rem; }
.how li { counter-increment: how; position: relative; padding-left: 40px; }
.how li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--sage-100); color: var(--forest); font-weight: 900; display: grid; place-items: center; font-size: .85rem; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; color: var(--muted); font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- Pie ---------- */
.site-footer { position: relative; margin-top: 40px; color: var(--forest-2); }
.site-footer .wave { display: block; width: 100%; height: 70px; color: var(--sage-200); }
.footer-inner { position: relative; overflow: hidden; background: var(--sage-200); padding: 22px 20px 30px; display: grid; gap: 14px; }
.footer-script { font-size: 1.9rem; margin: 0 0 10px; transform: rotate(-3deg); transform-origin: left; max-width: 520px; }
.footer-script .doodle { color: var(--coral); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; position: relative; z-index: 1; }
.site-footer nav a { color: var(--forest-2); text-decoration: none; font-weight: 800; font-size: .88rem; }
.site-footer nav a:hover { text-decoration: underline; }
.footer-contact { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; position: relative; z-index: 1; }
.footer-contact a { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--forest-2); text-decoration: none; }
.footer-contact svg { width: 18px; height: 18px; }
.footer-duo { display: flex; justify-content: flex-end; align-items: flex-end; gap: 0; margin: -6px -20px -30px auto; }
.footer-duo img { width: 120px; height: auto; display: block; transform-origin: bottom center; animation: saludo 5s ease-in-out infinite; }
.footer-duo img + img { animation-delay: -2.5s; }
.footer-duo img + img { width: 112px; margin-left: -18px; }
@media (min-width: 900px) {
  .footer-inner { padding: 24px 40px 36px; min-height: 190px; }
  .footer-script, .site-footer nav, .footer-contact { max-width: calc(100% - 340px); }
  .footer-duo { position: absolute; right: 30px; bottom: 0; margin: 0; }
  .footer-duo img { width: 170px; } .footer-duo img + img { width: 158px; }
}

/* ---------- Personajes (globos, festejos, saludo, guía) ---------- */
.pj-globo {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: flex-end; gap: 4px; pointer-events: none;
  opacity: 0; transform: translateY(16px); transition: opacity .3s, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.pj-globo.is-on { opacity: 1; transform: none; }
.pj-globo > img { width: 92px; height: auto; flex-shrink: 0; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); animation: saludo 3s ease-in-out infinite; transform-origin: bottom center; }
.pj-burbuja {
  position: relative; pointer-events: auto; margin: 0 0 40px; padding: 12px 38px 12px 16px; max-width: 300px;
  background: #fff; color: var(--forest-2); border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow); font-weight: 800; font-size: .95rem; line-height: 1.35;
}
.pj-burbuja p { margin: 0; }
.pj-burbuja .pj-cerrar { position: absolute; top: 8px; right: 8px; }
.pj-cerrar { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--sage-100); color: var(--forest-2); font-size: 1rem; line-height: 1; cursor: pointer; }
@media (min-width: 900px) { .pj-globo { left: calc(var(--side-w) + 24px); right: auto; bottom: 24px; } }

.pj-festejo { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(21, 62, 64, .55); opacity: 0; transition: opacity .25s; }
.pj-festejo.is-on { opacity: 1; }
.pj-festejo-card { position: relative; overflow: hidden; width: min(420px, 100%); background: var(--bg); border-radius: 28px; padding: 26px 24px 24px; text-align: center; box-shadow: var(--shadow-lg); transform: scale(.92); transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); }
.pj-festejo.is-on .pj-festejo-card { transform: none; }
.pj-festejo-card h2 { font-family: var(--script); font-size: 2.3rem; line-height: 1; color: var(--forest-2); margin: 6px 0 8px; }
.pj-festejo-card p { color: var(--ink-soft); font-weight: 700; margin: 0 0 18px; }
.pj-abrazo { width: 210px; margin: 0 auto; animation: saludo 2.6s ease-in-out infinite; transform-origin: bottom center; }
.pj-duo { display: flex; justify-content: center; align-items: flex-end; }
.pj-duo img { width: 140px; height: auto; animation: saludo 2.4s ease-in-out infinite; transform-origin: bottom center; }
.pj-duo img + img { width: 128px; margin-left: -22px; animation-delay: -1.2s; }
.pj-corazones span { position: absolute; top: -30px; width: 18px; height: 18px; background: var(--coral); opacity: .9;
  clip-path: path('M9 16C4 12 0 9 0 5a4.5 4.5 0 0 1 9-1 4.5 4.5 0 0 1 9 1c0 4-4 7-9 11z'); animation: caer 2.6s ease-in forwards; }
.pj-corazones span:nth-child(3n) { background: var(--sun); } .pj-corazones span:nth-child(3n+1) { background: var(--sage-300); }
@keyframes caer { to { transform: translateY(520px) rotate(var(--giro, 20deg)); opacity: 0; } }

.hero-pj { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero-saludo {
  position: relative; z-index: 1; margin: 0 0 -6px; padding: 8px 14px; background: #fff; color: var(--forest-2); border-radius: 16px;
  font-weight: 800; font-size: .9rem; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .4); max-width: 280px; text-align: center;
}
.hero-saludo::after { content: ''; position: absolute; left: 34%; bottom: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.hero-saludo:empty { display: none; }
@media (min-width: 900px) { .hero-pj { width: 400px; max-width: 44%; align-self: flex-end; margin-bottom: -30px; } .hero-pj .hero-duo { width: 100%; max-width: none; margin: 0; } }

.guia { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 4px; }
.guia img { width: 84px; height: auto; flex-shrink: 0; transform-origin: bottom center; }
.guia img.salta { animation: saltito .5s ease; }
.guia p { margin: 0 0 18px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; font-weight: 800; color: var(--forest-2); box-shadow: var(--shadow-sm); }
@keyframes saltito { 40% { transform: translateY(-10px) rotate(-3deg); } }

.news-item.con-pj { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; }
.news-item .news-pj { width: 58px; height: 58px; border-radius: 50%; background: var(--sage-100); overflow: hidden; display: grid; place-items: end center; }
.news-item .news-pj img { width: 112%; height: auto; margin-bottom: -4px; }
.news-item .news-body { min-width: 0; }

.logro { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.logro img { width: 78px; height: auto; }
.logro h3 { font-family: var(--script); font-size: 1.7rem; line-height: 1; margin: 0 0 4px; color: var(--forest-2); }
.logro p { margin: 0; font-size: .86rem; color: var(--ink-soft); font-weight: 700; }
.meta { margin-top: 12px; }
.meta-bar { height: 10px; border-radius: 99px; background: var(--sage-100); overflow: hidden; }
.meta-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage-300), var(--sun)); border-radius: inherit; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.meta small { display: block; margin-top: 6px; font-size: .76rem; font-weight: 800; color: var(--muted); }

.votos-pj { display: grid; gap: 14px; }
.voto { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; }
.voto > img { width: 64px; height: auto; }
.voto h4 { margin: 0 0 6px; font-size: .92rem; color: var(--forest-2); }
.voto-ops { display: flex; flex-wrap: wrap; gap: 6px; }
.voto-ops button { position: relative; overflow: hidden; border: 1px solid var(--sage-200); background: #fff; color: var(--forest-2); border-radius: 99px; padding: 7px 12px; font: inherit; font-weight: 800; font-size: .85rem; cursor: pointer; }
.voto-ops button:hover:not(:disabled) { border-color: var(--sage-500); }
.voto-ops button .fill { position: absolute; inset: 0 auto 0 0; background: var(--sage-100); z-index: 0; transition: width .8s; }
.voto-ops button span { position: relative; z-index: 1; }
.voto-ops button.mio { border-color: var(--sun); background: var(--sun-soft); }
.voto-ops button:disabled { cursor: default; }

.tarjeta { display: none; }
.comercios { display: grid; gap: 12px; }
.comercios .empty { grid-column: 1 / -1; }
@media (min-width: 700px) { .comercios:not(.comercios--mini) { grid-template-columns: 1fr 1fr; } }
.comercio { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.comercios--mini .comercio { border: 0; padding: 0; background: none; }
.comercio-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--sun-soft); color: #C2621F; display: grid; place-items: center; font-weight: 900; font-size: 1.4rem; overflow: hidden; }
.comercio-logo img { width: 100%; height: 100%; object-fit: cover; }
.comercio small { font-size: .66rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-500); }
.comercio h3 { margin: 0 0 4px; font-size: 1rem; }
.comercio p { margin: 0 0 4px; font-size: .84rem; display: flex; gap: 6px; align-items: flex-start; }
.comercio p svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.comercio-ben { font-weight: 800; color: var(--forest-2); } .comercio-ben svg { color: var(--coral); }
.como-ayudar { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.donar-box { margin: 10px 0 12px; display: grid; gap: 10px; }
.donar-box:empty { display: none; }
.alias { display: grid; text-align: left; gap: 1px; width: 100%; padding: 12px 14px; border: 2px dashed var(--sun); border-radius: 16px; background: var(--sun-soft); color: var(--forest-2); font: inherit; cursor: pointer; }
.alias small { font-size: .66rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #C2621F; }
.alias strong { font-size: 1.15rem; }
.alias span { font-size: .75rem; font-weight: 700; color: var(--muted); }
.aviso-pj { flex-shrink: 0; width: 46px; } .aviso-pj img { display: block; width: 100%; height: auto; margin: -8px 0 -6px; }
.pj-escena { display: block; width: 100%; height: auto; }
.empty .big--escena { width: min(280px, 80%); }
.escena-marco { display: block; width: 100%; height: auto; border-radius: 18px; margin: 0 0 14px; }
.buscando-card { display: grid; gap: 4px; justify-items: center; text-align: center; margin: 4px 0 14px; }
.buscando-card .pj-escena { width: min(420px, 100%); }
.buscando-card p { position: relative; margin: 0; padding: 10px 16px; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; font-weight: 800; color: var(--forest-2); box-shadow: var(--shadow-sm); }
.buscando-card p::before { content: ''; position: absolute; left: 50%; top: -8px; width: 14px; height: 14px; background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
@media (min-width: 900px) { .buscando-card { grid-template-columns: 340px 1fr; text-align: left; justify-items: start; align-items: center; gap: 18px; } .buscando-card p::before { left: -8px; top: 50%; transform: translateY(-50%) rotate(-45deg); } }

/* ---------- Cuenta regresiva y accesos rápidos ---------- */
.cuenta { position: relative; overflow: hidden; margin-top: 16px; border-radius: 26px; background: var(--sun); color: var(--forest-2); display: grid; grid-template-columns: 1fr; padding: 18px 20px; box-shadow: var(--shadow); }
.cuenta::before { content: ''; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.cuenta > * { position: relative; }
.cuenta-pj { position: absolute; right: 6px; bottom: -6px; width: 110px; opacity: .95; animation: saltito 2.4s ease-in-out infinite; transform-origin: bottom center; }
.cuenta-eti { display: inline-block; background: var(--forest-2); color: #fff; font-weight: 900; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; padding: 5px 12px; border-radius: 99px; }
.cuenta h2 { font-family: var(--script); font-size: 2rem; line-height: 1; margin: 8px 0 10px; max-width: 70%; }
.reloj { display: flex; gap: 8px; margin-bottom: 12px; }
.reloj > div { background: #fff; border-radius: 14px; min-width: 58px; padding: 8px 6px 6px; text-align: center; box-shadow: 0 6px 14px -10px rgba(21, 62, 64, .5); }
.reloj b { display: block; font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.reloj b.late { animation: late .4s ease; }
.reloj span { font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #9A5A1E; }
.cuenta-info { margin: 0 0 12px; font-weight: 800; font-size: .9rem; line-height: 1.5; max-width: 75%; }
.reloj-hoy { margin: 0; font-weight: 900; font-size: 1.05rem; }
@keyframes late { 0% { transform: translateY(-4px); opacity: .4; } 100% { transform: none; opacity: 1; } }
.cuenta .btn--sun { background: var(--forest-2); color: #fff; box-shadow: none; }
.cuenta .btn svg { width: 18px; height: 18px; }
@media (min-width: 700px) { .cuenta { padding: 22px 28px; } .cuenta-pj { width: 150px; right: 20px; } .cuenta h2 { font-size: 2.4rem; } .reloj > div { min-width: 74px; } .reloj b { font-size: 2rem; } }

.ayuda-rapida { margin-top: 16px; }
.rapidos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .rapidos { grid-template-columns: repeat(3, 1fr); } }
.rapido { display: grid; gap: 2px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--forest-2); transition: transform .15s, box-shadow .15s; }
.rapido:hover, .rapido:active { transform: translateY(-2px); box-shadow: var(--shadow); }
.rapido .r-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 6px; }
.rapido b { font-size: .95rem; line-height: 1.2; }
.rapido small { font-size: .78rem; font-weight: 700; color: var(--muted); }

.comercio-cta { margin-top: 14px; display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center; background: var(--sun-soft); border-radius: 18px; padding: 14px 16px; }
.comercio-cta img { width: 70px; }
.comercio-cta h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--forest-2); }
.comercio-cta p { margin: 0 0 8px; font-size: .88rem; color: var(--ink-soft); }
.comercio-cta .btn svg { width: 18px; height: 18px; }
.filtro-barrio { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-weight: 800; color: var(--forest-2); }
.filtro-barrio select { flex: 1; max-width: 320px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font: inherit; color: var(--ink); }

/* iPhone hace zoom si un campo tiene letra menor a 16px */
@media (max-width: 899px) { input, select, textarea { font-size: 16px !important; } }

/* ---------- Toast y carga ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 220%); background: var(--forest-2); color: #fff; padding: 13px 22px; border-radius: 16px; font-weight: 800; box-shadow: var(--shadow-lg); z-index: 100; transition: transform .35s cubic-bezier(.2, .8, .2, 1.3); max-width: calc(100% - 32px); text-align: center; }
.toast.is-visible { transform: translate(-50%, 0); }
.toast--error { background: var(--red); }
@media (min-width: 1024px) { .toast { bottom: 24px; left: calc(50% + var(--side-w) / 2); } }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--sage-500); grid-column: 1 / -1; }
.loading svg { width: 46px; height: 46px; animation: bounce 1s ease-in-out infinite; }

/* ---------- Animaciones ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
@keyframes saludo { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-1.5deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(6deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) rotate(-10deg); } 50% { transform: translateY(-14px) rotate(10deg); } }
@keyframes bounce-pin { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes attention { 0%, 100% { box-shadow: 0 16px 30px -16px var(--red); } 50% { box-shadow: 0 16px 40px -8px var(--red); } }
.reveal { animation: rise .6s both; }
.grid > .card:nth-child(2) { animation-delay: .05s; } .grid > .card:nth-child(3) { animation-delay: .1s; } .grid > .card:nth-child(4) { animation-delay: .15s; }
.grid > .card:nth-child(5) { animation-delay: .2s; } .grid > .card:nth-child(6) { animation-delay: .25s; } .grid > .card:nth-child(7) { animation-delay: .3s; } .grid > .card:nth-child(8) { animation-delay: .35s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Impresión de chapitas ---------- */
@media print {
  .sidebar, .topbar, .tabbar, .site-footer, .demo-bar, .no-print, .toast, .pj-globo { display: none !important; }
  body:has(#admin) .page-banner, #admin > .tabs { display: none !important; }
  body.has-sidebar { padding: 0; background: #fff; }
  .tags-grid { grid-template-columns: repeat(4, 1fr); gap: 6mm; }
  .tag-item { box-shadow: none; border: 1px dashed #bbb; break-inside: avoid; padding: 4mm; }
  .tag-item .qr { width: 30mm; height: 30mm; border: 0; padding: 0; }
  .tag-item .btn-row, .tag-item .url { display: none; }
  body.print-tarjetas .tag-item { display: none; }
  body.print-tarjetas .tags-grid { grid-template-columns: repeat(2, 85mm); gap: 4mm; }
  body.print-tarjetas .tarjeta { display: grid; }
}
.tarjeta {
  width: 85mm; height: 55mm; box-sizing: border-box; border: 1px dashed #bbb; border-radius: 3mm; background: #F7F6F0; color: #153E40;
  grid-template-columns: 1fr 26mm; gap: 3mm; padding: 4mm; break-inside: avoid; overflow: hidden; position: relative; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.tarjeta .t-logo { width: 20mm; height: auto; }
.tarjeta h5 { font-family: var(--script); font-size: 15pt; line-height: 1; margin: 1mm 0; }
.tarjeta p { font-size: 6.6pt; font-weight: 700; line-height: 1.3; margin: 0; }
.tarjeta .t-qr { width: 26mm; height: 26mm; background: #fff; padding: 1mm; border-radius: 2mm; }
.tarjeta .t-qr svg { width: 100%; height: 100%; }
.tarjeta .t-code { display: block; text-align: center; font-weight: 900; font-size: 9pt; letter-spacing: .08em; margin-top: 1mm; }

