:root {
  --mar: #0b4f63;
  --mar-2: #0e7490;
  --mar-claro: #7dd3fc;
  --madera: #c2853a;
  --ok: #15803d;
  --alerta: #b45309;
  --bg: #eef5f6;
  --surface: #ffffff;
  --surface-2: #f4f8f9;
  --text: #0f2a33;
  --muted: #557079;
  --border: #d6e3e6;
  --shadow: 0 6px 20px rgba(11, 79, 99, .12);
  --radius: 18px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-title: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071d24; --surface: #0d2a33; --surface-2: #11343f; --text: #e6f2f4;
    --muted: #93b1b9; --border: #1d4552; --shadow: 0 6px 20px rgba(0,0,0,.35);
    --mar-2: #22a3c4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #071d24; --surface: #0d2a33; --surface-2: #11343f; --text: #e6f2f4;
  --muted: #93b1b9; --border: #1d4552; --shadow: 0 6px 20px rgba(0,0,0,.35);
  --mar-2: #22a3c4; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
}
a { color: var(--mar-2); }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-title); letter-spacing: .02em; line-height: 1.1; margin: 0; }
h2 { font-size: 1.6rem; text-transform: uppercase; }
h3 { font-size: 1.25rem; }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 500; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(180deg, var(--mar), #0a4556); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: 1; min-width: 0; }
.brand span:last-child { font-family: var(--font-title); font-size: 1.35rem; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, #0e7490, #083344); border: 2px solid var(--mar-claro);
  font-family: var(--font-title); font-weight: 700; font-size: 1.2rem;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14);
  color: #fff; font-size: 1.15rem; display: grid; place-items: center; flex: none; text-decoration: none;
}
#btn-back .ico { width: 24px; height: 24px; }
.lang-btn { flex: none; height: 36px; min-width: 40px; padding: 0 10px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.55);
  background: transparent; color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .05em; }
/* Íconos de línea (SVG) para barras superior e inferior */
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---------- Contenedor ---------- */
main { max-width: 960px; margin: 0 auto; padding: 16px; outline: none; }
.section { margin: 28px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; justify-content: space-between; background: #0b4f63; color: #fff; overflow: hidden; }
.splash-art { position: absolute; inset: 0; background-size: cover; background-position: 72% center; }
.splash-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,51,68,.92) 0%, rgba(8,51,68,.15) 38%, rgba(8,51,68,0) 60%, rgba(8,51,68,.75) 100%); }
.splash-top { position: relative; text-align: center; padding: calc(48px + env(safe-area-inset-top,0px)) 16px 0; }
.splash h1 { font-size: clamp(4rem, 22vw, 7rem); text-shadow: 0 4px 18px rgba(0,0,0,.4); }
.splash-sub { margin: 0; font-family: var(--font-title); font-size: 1.9rem; font-weight: 700; }
.splash-sub2 { margin: 0; font-family: var(--font-title); font-size: 1.2rem; text-transform: uppercase; opacity: .95; }
.splash-actions { position: relative; display: grid; gap: 12px; padding: 0 32px calc(40px + env(safe-area-inset-bottom,0px)); max-width: 380px; width: 100%; margin: 0 auto; }

/* ---------- Botones ---------- */
.btn { border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
.btn-light { background: #fff; color: var(--mar); }
.btn-outline-light { background: rgba(0,0,0,.25); color: #fff; border: 2px solid #fff; }
.btn-primary { background: var(--mar-2); color: #fff; }
.btn-soft { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); text-transform: none; font-weight: 700; letter-spacing: 0; }
.btn-block { width: 100%; }

/* ---------- Buscador ---------- */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 16px; box-shadow: var(--shadow); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; padding: 10px 0; outline: none; }

/* ---------- Hero ---------- */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 210px; display: flex; align-items: flex-end; box-shadow: var(--shadow); margin-top: 16px; background: var(--mar) center 55% / cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,51,68,.9), rgba(8,51,68,0) 65%); }
.hero-text { position: relative; z-index: 1; padding: 18px; color: #fff; }
.hero-text h2 { font-size: 2.3rem; }
.hero-text p { margin: 4px 0 0; font-weight: 600; }
.weather { position: absolute; top: 12px; right: 12px; z-index: 1; background: rgba(255,255,255,.92); color: #0f2a33; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: .9rem; }

/* ---------- Grupos ---------- */
.groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.group { border-radius: 16px; padding: 14px 6px 10px; color: #fff; text-decoration: none; text-align: center; box-shadow: var(--shadow); }
.group span { display: block; font-size: 2rem; line-height: 1.2; }
.group b { font-family: var(--font-title); text-transform: uppercase; font-size: 1rem; letter-spacing: .03em; }

/* ---------- Categorías (círculos) ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px 10px; }
.cat { text-align: center; text-decoration: none; color: var(--text); }
.cat-circle { width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; box-shadow: var(--shadow), inset 0 -6px 0 rgba(0,0,0,.12); border: 3px solid var(--surface); }
.cat b { display: block; font-family: var(--font-title); text-transform: uppercase; font-size: .98rem; line-height: 1.1; }
.cat small { color: var(--muted); font-weight: 700; }

/* ---------- Carrusel / tarjetas ---------- */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 46%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: thin; }
.carousel > * { scroll-snap-align: start; }
@media (min-width: 700px) { .carousel { grid-auto-columns: minmax(220px, 30%); } }

.tile { position: relative; display: flex; align-items: flex-end; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; color: #fff; text-decoration: none; box-shadow: var(--shadow); background-size: cover; background-position: center; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.7), rgba(0,0,0,0) 60%); }
.tile-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.4rem; padding-bottom: 28px; }
.tile b { position: relative; z-index: 1; padding: 12px; font-family: var(--font-title); text-transform: uppercase; font-size: 1.2rem; line-height: 1.05; }

.list { display: grid; gap: 12px; }
@media (min-width: 700px) { .list { grid-template-columns: 1fr 1fr; } }
.card { display: flex; gap: 12px; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.card-thumb { width: 96px; flex: none; display: grid; place-items: center; font-size: 2.4rem; background-size: cover; background-position: center; }
.card-body { padding: 10px 12px 10px 0; min-width: 0; flex: 1; }
.card-body h3 { font-size: 1.2rem; text-transform: uppercase; }
.card-body p { margin: 2px 0 0; font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge { font-size: .75rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.badge.open { background: #dcfce7; color: #14532d; border-color: #86efac; }
.badge.closed { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }

/* ---------- Chips de filtro ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .9rem; }
.chip.active { background: var(--mar-2); color: #fff; border-color: var(--mar-2); }

/* ---------- Ficha de lugar ---------- */
.detail-hero { position: relative; margin: -16px -16px 0; height: 300px; background-size: cover; background-position: center; display: grid; place-items: center; font-size: 6rem; border-radius: 0 0 50% 50% / 0 0 40px 40px; overflow: hidden; }
@media (min-width: 700px) { .detail-hero { margin: 0; border-radius: var(--radius); height: 360px; } }
.detail-head { text-align: center; margin-top: 16px; }
.detail-head h2 { font-size: 2.1rem; }
.detail-head .badges { justify-content: center; }
.actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 18px 0; }
.action { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .72rem; font-weight: 700; text-decoration: none; text-align: center; line-height: 1.15; }
.action span { font-size: 1.4rem; }
.action.on { background: #ffe4e6; border-color: #fda4af; color: #881337; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-top: 12px; box-shadow: var(--shadow); }
.panel h3 { margin-bottom: 8px; text-transform: uppercase; }
.row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.row:first-of-type { border-top: 0; }
.row > span:first-child { flex: none; width: 26px; text-align: center; }
.notice { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; border-radius: 12px; padding: 10px 12px; font-size: .9rem; margin-top: 12px; }
.mini-map { height: 220px; border-radius: 14px; overflow: hidden; margin-top: 10px; z-index: 0; }
.cta-bar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); margin-top: 16px; z-index: 10; }
.cta-bar .btn { width: 100%; box-shadow: var(--shadow); }

/* ---------- Mapa ---------- */
.map-full { height: calc(100vh - 230px); height: calc(100dvh - 230px); min-height: 320px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); z-index: 0; }
.pin { width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin i { transform: rotate(45deg); font-style: normal; font-size: 17px; }
.me-pin { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37,99,235,.25); }
.leaflet-popup-content { font-family: var(--font); }
.leaflet-popup-content b { font-family: var(--font-title); font-size: 1.1rem; text-transform: uppercase; }

/* ---------- Contenido informativo ---------- */
.info-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.info-card h3 { display: flex; gap: 8px; align-items: center; text-transform: uppercase; margin-bottom: 6px; }
.info-card p { margin: 0; color: var(--muted); }
.info-ico svg { width: 30px; height: 30px; display: block; }
.sos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sos a { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.sos b { font-size: 1.3rem; color: #b91c1c; display: block; line-height: 1; }
.sos small { color: var(--muted); font-weight: 700; }
.steps { list-style: none; padding: 0; margin: 10px 0 0; border-left: 3px solid var(--mar-claro); }
.steps li { position: relative; padding: 4px 0 10px 16px; }
.steps li::before { content: ""; position: absolute; left: -8px; top: 10px; width: 13px; height: 13px; border-radius: 50%; background: var(--mar-2); border: 2px solid var(--surface); }
.steps time { font-weight: 800; color: var(--mar-2); margin-right: 6px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-weight: 700; font-size: .92rem; }
.form input, .form select, .form textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; width: 100%; }
.form textarea { min-height: 110px; resize: vertical; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: .85rem; }
.seg input:checked + span { background: var(--mar-2); color: #fff; border-color: var(--mar-2); }

.empty { text-align: center; padding: 32px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: 16px; }
.empty div { font-size: 3rem; }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 600; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: linear-gradient(180deg, #0a4556, var(--mar)); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 18px rgba(0,0,0,.18);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(255,255,255,.72); text-decoration: none; font-size: .72rem; font-weight: 700; }
.tabbar a span { display: grid; place-items: center; width: 44px; height: 28px; margin-bottom: 3px; border-radius: 999px; transition: background .2s, transform .2s; }
.tabbar a span .ico { stroke-width: 1.8; }
.tabbar a.active { color: #fff; }
.tabbar a.active span { background: rgba(255,255,255,.16); }
.tabbar a.active span .ico { stroke-width: 2.2; }
.tabbar a.active .ico-heart { fill: currentColor; }
.tabbar a.tab-cta span { width: 50px; height: 50px; margin-top: -26px; border-radius: 50%; color: #fff;
  background: linear-gradient(160deg, #f97361, #e0533f); border: 4px solid var(--bg); box-shadow: 0 4px 12px rgba(224,83,63,.45); }
.tabbar a.tab-cta span .ico { width: 24px; height: 24px; stroke-width: 2; }
.tabbar a.tab-cta.active span { background: linear-gradient(160deg, #f97361, #e0533f); }
@media (min-width: 960px) { .tabbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); bottom: 12px; border-radius: 22px; height: var(--tabbar-h); padding: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); background: #0f2a33; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; z-index: 2000; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Inicio: portada "Esencia local" ---------- */
.hero-big { position: relative; margin: -16px -16px 0; min-height: 300px; background: var(--mar) center 55% / cover; display: flex; align-items: flex-end; }
.hero-big::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,51,68,.85) 8%, rgba(8,51,68,0) 60%); }
.hero-big .hero-text { padding: 20px 20px 56px; }
.hero-big h2 { font-size: clamp(2.3rem, 10vw, 3.2rem); line-height: .95; }
@media (min-width: 700px) { .hero-big { margin: 0; border-radius: var(--radius); overflow: hidden; } }
.search-card { position: relative; z-index: 2; margin: -36px 4px 0; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.search-card h3 { text-transform: uppercase; font-size: 1.05rem; margin-bottom: 8px; }
.search-card .search { box-shadow: none; background: var(--surface-2); }

/* Accesos rápidos */
.shortcuts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 18px; }
.shortcuts a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--text); font-size: .75rem; font-weight: 800; }
.shortcuts span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }

/* Banners con foto "Guía visual" */
/* "Explora": fila compacta de fotos que se desliza hacia el lado */
.banners-mini { display: grid; grid-auto-flow: column; grid-auto-columns: 40%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
@media (min-width: 700px) { .banners-mini { grid-auto-columns: calc((100% - 40px) / 5); margin: 0; padding: 0 0 6px; } }
.banner-mini { position: relative; height: 96px; border-radius: 14px; overflow: hidden; display: flex; align-items: flex-end; scroll-snap-align: start;
  background-size: cover; background-position: center; color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.banner-mini::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.7), rgba(0,0,0,.05) 70%); }
.banner-mini b { position: relative; z-index: 1; padding: 8px 10px; font-family: var(--font-title); text-transform: uppercase; font-size: 1rem; line-height: 1.05; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.banner-mini span { position: absolute; top: 6px; right: 6px; z-index: 1; font-size: 1rem; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; background: rgba(255,255,255,.25); backdrop-filter: blur(4px); }
.banners { display: grid; gap: 10px; }
@media (min-width: 700px) { .banners { grid-template-columns: 1fr 1fr; } .banners a:first-child { grid-column: 1 / -1; } }
.banner { position: relative; height: 96px; border-radius: 16px; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px 14px; color: #fff; text-decoration: none; background: var(--mar) center / cover; box-shadow: var(--shadow); }
.banner:first-child { height: 140px; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,.05) 70%), linear-gradient(0deg, rgba(0,0,0,.45), transparent 60%); }
.banner b, .banner span { position: relative; z-index: 1; }
.banner b { font-family: var(--font-title); text-transform: uppercase; font-size: 1.45rem; letter-spacing: .02em; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.banner span { font-size: 1.4rem; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5); border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; backdrop-filter: blur(4px); }

/* Cuadrícula "Portal de categorías" */
.sq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 700px) { .sq-grid { grid-template-columns: repeat(5, 1fr); } }
.sq { aspect-ratio: 1; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px;
  text-decoration: none; color: var(--text); text-align: center; border: 1px solid; box-shadow: 0 3px 10px rgba(11,79,99,.08); }
.sq i { font-style: normal; font-size: 2.1rem; line-height: 1; }
.sq b { font-family: var(--font-title); text-transform: uppercase; font-size: .92rem; line-height: 1.05; }
.sq small { font-size: .7rem; color: var(--muted); font-weight: 700; margin-top: -4px; }

/* Reportar / contacto */
.report { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); font-family: var(--font-title); text-transform: uppercase; font-size: 1.2rem; font-weight: 700; }
.report span { font-size: 1.5rem; }
.btn-green { background: linear-gradient(180deg, #4f8a4f, #3b6f3e); color: #fff; }

/* Informar: estado de ubicación y confirmación */
.loc-ok { color: var(--ok); font-weight: 800; font-size: .9rem; }
.success { text-align: center; padding: 8px 0 4px; }
.success > div:first-child { font-size: 3.5rem; }
.stack { display: grid; gap: 10px; margin-top: 16px; }
.code { white-space: pre-wrap; word-break: break-word; font-family: Consolas, monospace; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; max-height: 220px; overflow: auto; }
.admin-item { border-top: 1px solid var(--border); padding: 12px 0; }
.admin-item:first-of-type { border-top: 0; }
.admin-item .chips { padding-bottom: 0; flex-wrap: wrap; }

/* Portada con fotos que cambian */
.slides { position: absolute; inset: 0; overflow: hidden; }
.slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transform: scale(1.08);
  transition: opacity 1.4s ease, transform 1.4s ease; }
.slide.on { opacity: 1; transform: scale(1); transition: opacity 1.4s ease, transform 8s ease-out; }
.dots { position: absolute; top: 16px; left: 16px; z-index: 2; display: flex; gap: 6px; }
.dots button { width: 9px; height: 9px; padding: 0; border-radius: 999px; border: 0; background: rgba(255,255,255,.55); box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: width .3s; }
.dots button.on { width: 24px; background: #fff; }
.hero-credit { position: absolute; right: 14px; top: 52px; max-width: 70%; text-align: right; z-index: 1; font-size: .62rem; color: rgba(255,255,255,.85); text-decoration: none; text-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* ---------- Eventos ---------- */
.evento { display: flex; gap: 12px; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.evento-fecha { width: 74px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.evento-fecha b { font-family: var(--font-title); font-size: 2.1rem; line-height: 1; }
.evento-fecha span { text-transform: uppercase; font-weight: 800; font-size: .8rem; letter-spacing: .08em; }
.evento-info { padding: 10px 12px 10px 0; min-width: 0; }
.evento-info small { color: var(--muted); font-weight: 700; }
.evento-info h3 { font-size: 1.2rem; text-transform: uppercase; margin: 2px 0; }
.evento-info p { margin: 0; color: var(--muted); font-size: .9rem; }
h3.mes { text-transform: none; color: var(--muted); font-size: 1.05rem; margin-bottom: 8px; }
.badge.ejemplo { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; letter-spacing: .05em; }
.actions.actions-3 { grid-template-columns: repeat(3, 1fr); }
.seg.seg-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .seg.seg-4 { grid-template-columns: repeat(4, 1fr); } }
/* 5 opciones: en celular la última ocupa todo el ancho; en pantallas grandes, todas en una fila */
@media (max-width: 559px) { .seg.seg-5 label:last-child { grid-column: 1 / -1; } }
@media (min-width: 560px) { .seg.seg-5 { grid-template-columns: repeat(5, 1fr); } }

/* Acceso directo a la farmacia de turno (portada) */
.turno-home { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 16px; text-decoration: none;
  background: linear-gradient(135deg, #15803d, #16a34a); color: #fff; box-shadow: 0 4px 14px rgba(22,163,74,.3); }
.turno-home-ico { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; background: rgba(255,255,255,.2); }
.turno-home div { flex: 1; min-width: 0; }
.turno-home b { display: block; font-size: 1.02rem; }
.turno-home small { display: block; opacity: .92; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turno-home-ir { font-size: 1.8rem; line-height: 1; opacity: .85; }

/* ---------- Calificación de Google ---------- */
.badge.g { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.stars { font-size: 1.5rem; letter-spacing: 2px; line-height: 1; color: transparent;
  background: linear-gradient(90deg, #f59e0b var(--p), #cbd5e1 var(--p)); -webkit-background-clip: text; background-clip: text; }
.g-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.g-rating b { font-family: var(--font-title); font-size: 2.4rem; line-height: 1; }

/* ---------- Emergencias y salud ---------- */
.sos-btn { flex: none; height: 36px; padding: 0 12px; border-radius: 999px; display: grid; place-items: center; text-decoration: none;
  background: #dc2626; color: #fff; font-weight: 800; letter-spacing: .06em; font-size: .85rem; box-shadow: 0 0 0 3px rgba(220,38,38,.3); }
.sos-head { background: linear-gradient(135deg, #b91c1c, #dc2626); color: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.sos-head p { margin: 4px 0 0; opacity: .9; font-weight: 700; }
.sos-grande a { border-color: #fecaca; }
.sos small { display: block; }
.sos .sos-dir { font-weight: 600; font-size: .72rem; margin-top: 2px; }
.salud-info a.tel { color: var(--mar-2); font-weight: 800; }
.salud-lista { padding-top: 4px; padding-bottom: 4px; }
.salud-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.salud-item:first-child { border-top: 0; }
.salud-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.salud-info a { color: var(--text); text-decoration: none; }
.salud-info small { color: var(--muted); }
.salud-ops { display: flex; gap: 6px; flex: none; }
.op { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--border); }
.turno { border: 2px solid #86efac; background: #f0fdf4; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; color: #14532d; }
.turno h3 { text-transform: uppercase; margin: 6px 0 4px; }
.turno p { margin: 2px 0; }
.turno-head { display: flex; gap: 6px; flex-wrap: wrap; }
.fuente { font-size: .8rem; margin: 4px 0 0; }

/* ---------- Panel de administración ---------- */
.badge.star { background: #fef3c7; color: #78350f; border-color: #fcd34d; }
.badge.warn { background: #ffedd5; color: #7c2d12; border-color: #fdba74; }
a.badge { text-decoration: none; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.panel-head .muted { font-size: .85rem; }
button.link { border: 0; background: none; padding: 0; color: var(--mar-2); font-weight: 800; text-decoration: underline; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis div { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--ok); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.kpis .kpi-warn { border-left-color: #f59e0b; }
.kpis .kpi-bad { border-left-color: #dc2626; }
.kpis b { display: block; font-size: 1.5rem; font-family: var(--font-title); }
.kpis small { color: var(--muted); font-weight: 700; }
.volver { display: inline-block; margin-bottom: 8px; font-weight: 800; text-decoration: none; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .form-2 { grid-template-columns: 1fr; } }
.form .panel { display: grid; gap: 12px; }
.form .panel h3 { margin-bottom: 0; }
.form label.check { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.form label.check input { width: 22px; height: 22px; flex: none; }
.foto-prev { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }

/* ---------- Alrededores (localidades cercanas) ---------- */
.pueblos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pueblo { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; border-radius: 16px; text-decoration: none; color: #fff; text-align: center;
  background: linear-gradient(150deg, var(--c), color-mix(in srgb, var(--c) 65%, #000)); box-shadow: var(--shadow); }
.pueblo span { font-size: 1.9rem; line-height: 1.2; }
.pueblo b { font-family: var(--font-title); text-transform: uppercase; font-size: 1.05rem; letter-spacing: .02em; }
.pueblo small { font-size: .72rem; font-weight: 700; opacity: .9; }

.loc-atajos { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; margin-top: 14px; }
.loc-atajos button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 800; font-size: .78rem; box-shadow: var(--shadow); }
.loc-atajos span { font-size: 1.4rem; line-height: 1.1; }
.loc-atajos small { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--mar-2); color: #fff; font-size: .68rem; line-height: 18px; }
.section[id^="sec-"] { scroll-margin-top: 76px; }
.card-invita { border-style: dashed; border-width: 2px; box-shadow: none; background: transparent; }
.card-invita .card-thumb { background: var(--surface-2); font-size: 1.8rem; color: var(--mar-2); }

/* ---------- Cuenta de los locales ---------- */
.acceso { max-width: 520px; margin: 16px auto; }
.acceso .chips { margin: 4px 0 2px; }
fieldset.limpio { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
fieldset.limpio[disabled] { opacity: .6; }
.contador { text-align: right; font-weight: 700; }
.olvide { display: block; text-align: center; padding: 8px; font-weight: 800; }
.estado-cuenta { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid #64748b; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.estado-cuenta p { margin: 6px 0 0; }
.estado-cuenta.ok { border-left-color: var(--ok); }
.estado-cuenta.aviso { border-left-color: #f59e0b; }
.estado-cuenta.mal { border-left-color: #dc2626; }
.estado-cuenta > a { display: inline-block; margin-top: 8px; font-weight: 800; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.foto-item { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; background-size: cover; background-position: center; border: 1px solid var(--border); }
.foto-item .badge { position: absolute; left: 6px; bottom: 6px; }
.foto-btn { position: absolute; bottom: 6px; left: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(15,42,51,.75); color: #fff; font-size: .95rem; display: grid; place-items: center; }
.foto-btn.foto-quitar { left: auto; right: 6px; top: 6px; bottom: auto; }
label.btn { cursor: pointer; }

/* Galería de fotos en la ficha del local */
.galeria { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: none; }
.galeria button { flex: none; width: 72px; height: 54px; border-radius: 10px; border: 2px solid transparent; background-size: cover; background-position: center; opacity: .7; padding: 0; }
.galeria button.on { border-color: var(--mar-2); opacity: 1; }
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tabla th, .tabla td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tabla th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.plan-row:first-of-type { border-top: 0; }
.plan-row small { display: block; color: var(--muted); }
.plan-row .precio { display: flex; align-items: center; gap: 4px; font-weight: 800; flex: none; }
.plan-row input { width: 110px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.atenuado { opacity: .65; }

/* ---------- Sobre Ancud ---------- */
.about-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--mar), #0e7490); box-shadow: var(--shadow); }
.about-card h3 { font-size: 1.45rem; text-transform: uppercase; }
.about-card p { margin: 4px 0 0; opacity: .92; }
.about-card > span { font-weight: 800; color: var(--mar-claro); }
.aviso-card { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 12px 14px; border-radius: 14px; text-align: left;
  border: 1px dashed var(--mar-2); background: var(--surface); color: var(--text); font-size: 1.2rem; }
.aviso-card span { font-size: .92rem; }
.about-text p { margin: 0 0 12px; }
.about-text p:last-child { margin-bottom: 0; }
.datos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .datos { grid-template-columns: repeat(3, 1fr); } }
.datos div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.datos span { font-size: 1.4rem; }
.datos span svg { width: 36px; height: 36px; display: block; }
.datos small { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; margin-top: 2px; }
.datos b { display: block; line-height: 1.3; }

/* ---------- Mi ruta ---------- */
.ruta-nombre { width: 100%; font-family: var(--font-title); font-weight: 700; font-size: 1.7rem; text-transform: uppercase; color: var(--text);
  background: transparent; border: 0; border-bottom: 2px dashed var(--border); padding: 4px 0; outline: none; }
.ruta-nombre:focus { border-bottom-color: var(--mar-2); }
#ruta-map { margin-top: 12px; }
.paradas { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.paradas li { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; box-shadow: var(--shadow); }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--mar-2); color: #fff; display: grid; place-items: center; font-weight: 800; }
.parada-info { flex: 1; min-width: 0; }
.parada-info a { display: block; font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parada-info small { color: var(--muted); }
.ops { display: flex; gap: 4px; flex: none; }
.ops button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 800; }
.ops button:disabled { opacity: .35; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.btn-row .btn { padding: 10px 8px; font-size: .9rem; }
.btn:disabled { opacity: .5; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.pick:first-child { border-top: 0; }
.pick-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.pick > div { flex: 1; min-width: 0; }
.pick b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick small { color: var(--muted); }
.pick-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--mar-2); background: transparent; color: var(--mar-2); font-size: 1.3rem; font-weight: 800; flex: none; }
.pick-btn.on { background: var(--mar-2); color: #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
