/* ── Camp map · trail-sign aesthetic: warm paper, forest ink, highlighter zones ── */
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #F5F0E1;
  --paper-2: #EBE4CF;
  --ink: #1A2B20;
  --ink-2: #4A5B4E;
  --forest: #1F4630;
  --moss: #5E7F4F;
  --sun: #F5C400;
  --line: rgba(26, 43, 32, .16);
  --blue: #1E6BFF;
  --display: "Bricolage", "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  --body: "Atkinson", "Verdana", "Segoe UI", sans-serif;
  --sticker: 0 2px 0 var(--ink);
  --float: 0 10px 30px -8px rgba(18, 38, 26, .45), 0 2px 6px rgba(18, 38, 26, .18);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sheet-w: 410px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; touch-action: pan-x pan-y; }
body { font: 400 16px/1.45 var(--body); color: var(--ink); background: var(--paper-2); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ── map ── */
#map { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #E9E5D0; z-index: 0; }
#map.sat { background: #26382b; }
.leaflet-container { font-family: var(--body); }
.leaflet-control-attribution { font-size: 10px; background: rgba(245, 240, 225, .82) !important; color: var(--ink-2); padding: 1px 6px; border-radius: 6px 0 0 0; }
.leaflet-control-attribution a { color: inherit; }
.leaflet-bottom.leaflet-right { margin-bottom: var(--sab); }

/* ── pins ── */
.pin { position: relative; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg);
  background: var(--c, #fff); color: var(--k, var(--ink)); border: 2.5px solid var(--ink); box-shadow: -2px 2px 0 rgba(26, 43, 32, .85);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.pin > b { transform: rotate(45deg); font: 800 14px/1 var(--display); letter-spacing: -.02em; }
.pin > svg { transform: rotate(45deg); width: 16px; height: 16px; stroke-width: 2.6; }
.pin-wrap { background: none; border: 0; }
.pin-wrap.is-selected { z-index: 1000 !important; }
.pin-wrap.is-selected .pin { transform: rotate(-45deg) scale(1.45); }
.pin-wrap.is-selected::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 3px solid var(--ink); animation: ring 1.4s ease-out infinite; pointer-events: none; }
@keyframes ring { from { transform: scale(.8); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }

.pin.star { width: 44px; height: 44px; border-width: 3px; }
.pin.star > svg { width: 22px; height: 22px; fill: var(--sun); stroke: var(--ink); stroke-width: 1.8; }

.pin-label { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); white-space: nowrap; pointer-events: none;
  font: 700 12px/1.1 var(--body); color: var(--ink); padding: 3px 7px; border-radius: 7px; background: rgba(245, 240, 225, .94); border: 1.5px solid var(--ink); }
.pin-label.big { font: 800 13px/1.1 var(--display); background: var(--ink); color: var(--paper); border-color: var(--ink); padding: 5px 9px; letter-spacing: .01em; }
.pin-label.big small { display: block; font: 700 10px/1.2 var(--body); color: var(--sun); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1px; }

/* numbered pins speak for themselves; their name shows only when selected */
.pin-wrap.unit:not(.lone):not(.is-selected) .pin-label { display: none; }
.pin-wrap.is-selected .pin-label { display: block !important; transform: translate(-50%, 12px); font-size: 13px; }

/* general (not ours) places: quiet */
.poi { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-2); color: var(--ink-2); }
.poi svg { width: 12px; height: 12px; stroke-width: 2.6; }
.poi.used { width: 28px; height: 28px; background: var(--forest); color: var(--paper); border-color: var(--ink); box-shadow: var(--sticker); }
.poi.used svg { width: 15px; height: 15px; }
.poi-label { font-weight: 700; font-size: 11px; color: var(--ink-2); background: rgba(245, 240, 225, .88); border: 0; padding: 2px 5px; }
#map.sat .poi-label { background: rgba(20, 30, 22, .78); color: #fff; }

/* zone banners shown when zoomed out */
.zone-tag { transform: translate(-50%, -50%); position: absolute; white-space: nowrap; display: flex; align-items: center; gap: 6px;
  font: 800 13px/1 var(--display); padding: 7px 11px 7px 8px; border-radius: 999px; background: var(--c); color: var(--k); border: 2.5px solid var(--ink); box-shadow: var(--sticker); }
.zone-tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--k); opacity: .85; }

/* zoomed out, the Gym label leans right so it doesn't cover the cafeteria next door */
#map.z-far .pin-wrap.gym .pin-label.big { transform: translate(-20%, 4px); }

/* activity pins: small but visible when zoomed out; named once the Actividades chip is chosen */
#map.z-far .pin-wrap.act .pin { width: 22px; height: 22px; border-width: 2px; box-shadow: -1px 1px 0 rgba(26, 43, 32, .85); }
#map.z-far .pin-wrap.act .pin > svg { width: 12px; height: 12px; }
#map.focus-act .pin-wrap.act .pin-label { display: block !important; }
#map.focus-act .zone-wrap { display: none; }

/* landmarks (cafeteria): always visible, always named */
.pin-wrap.landmark .pin-label { display: block !important; font-weight: 700; }

@media (max-width: 380px) { .zone-tag { font-size: 12px; padding: 5px 9px 5px 7px; gap: 5px; } .zone-tag i { width: 8px; height: 8px; } }

/* zoom-level choreography (class set on #map by JS) */
#map.z-far .pin-wrap.unit:not(.act), #map.z-far .poi-wrap, #map.z-far .pin-label:not(.big) { display: none; }
#map.z-mid .zone-wrap, #map.z-near .zone-wrap { display: none; }
#map.z-mid .pin-wrap.unit .pin { width: 18px; height: 18px; border-width: 2px; box-shadow: -1px 1px 0 rgba(26, 43, 32, .85); }
#map.z-mid .pin-wrap.unit .pin > b { font-size: 9.5px; }
#map.z-mid .pin-wrap.unit.lone .pin { width: 26px; height: 26px; }
#map.z-mid .pin-wrap.unit.lone .pin > b { font-size: 12px; }
#map.z-mid .pin-label:not(.big), #map.z-mid .poi-wrap:not(.used) { display: none; }
#map.z-mid .pin-wrap.is-selected .pin-label { display: block; }
#map.z-far .pin-wrap.is-selected { display: block; }

#map.routing .zone-wrap { display: none; }

/* you-are-here */
.me { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); border: 3.5px solid #fff; box-shadow: 0 0 0 1.5px rgba(10, 40, 120, .5), 0 3px 10px rgba(10, 40, 120, .5); position: relative; }
.me::after { content: ""; position: absolute; inset: -3.5px; border-radius: 50%; background: var(--blue); opacity: .35; animation: ring 2s ease-out infinite; z-index: -1; }

.route-glow { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)); }
.route-dash { stroke-dasharray: 2 11; animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -13; } }

/* ── top bar ── */
#topbar { position: fixed; z-index: 500; top: calc(var(--sat) + 10px); left: 10px; right: 10px; display: grid; gap: 8px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.search { display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 6px 0 14px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--float); }
.search > svg { width: 21px; height: 21px; flex: none; color: var(--forest); stroke-width: 2.6; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 700 16px var(--body); color: var(--ink); padding: 0 6px; appearance: none; }
.search input::placeholder { color: var(--ink-2); font-weight: 400; opacity: .9; }
.search input::-webkit-search-cancel-button { display: none; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { background: var(--paper-2); }
.lang { display: flex; flex: none; padding: 3px; border-radius: 11px; background: var(--paper-2); border: 1.5px solid var(--line); }
.lang b { font: 800 12px/1 var(--display); padding: 8px 8px; border-radius: 8px; color: var(--ink-2); letter-spacing: .04em; }
html[lang="es"] .lang b[data-l="es"], html[lang="en"] .lang b[data-l="en"] { background: var(--forest); color: var(--paper); }

#chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding: 2px 10px 6px; margin: 0 -10px; scroll-snap-type: x proximity; }
#chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 9px; border-radius: 999px; scroll-snap-align: start;
  background: var(--paper); border: 2px solid var(--ink); font: 700 13.5px/1 var(--body); box-shadow: 0 2px 0 rgba(26, 43, 32, .8); white-space: nowrap; }
.chip i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); flex: none; }
.chip.star i { border-radius: 4px; transform: rotate(45deg) scale(.85); }
.chip:active, .chip.on { background: var(--c); color: var(--k); transform: translateY(1px); box-shadow: 0 1px 0 rgba(26, 43, 32, .8); }
.chip.on i { background: var(--k); }

/* ── search results ── */
body.searching #chips { display: none; }
#results { position: fixed; z-index: 490; top: calc(var(--sat) + 70px); left: 10px; right: 10px; max-height: min(62vh, 520px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--float); padding: 6px; animation: drop .18s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.res-head { font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); padding: 10px 10px 6px; }
.res { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 11px; }
.res:active, .res:hover { background: var(--paper-2); }
.res .dot { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--c, var(--paper-2)); color: var(--k, var(--ink)); border: 2px solid var(--ink); font: 800 14px var(--display); }
.res .dot svg { width: 16px; height: 16px; }
.res .t { font-weight: 700; line-height: 1.2; }
.res .s { font-size: 13px; color: var(--ink-2); line-height: 1.25; margin-top: 1px; }
.res-empty { padding: 18px 12px; color: var(--ink-2); text-align: center; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; padding: 2px 10px 10px; }
.res-grid button { height: 40px; border-radius: 10px; background: var(--c); color: var(--k); border: 2px solid var(--ink); font: 800 15px var(--display); }
.res-grid button:active { transform: translateY(1px); }

/* ── floating buttons ── */
#fabs { position: fixed; z-index: 450; right: 10px; bottom: calc(var(--sab) + 26px); display: grid; gap: 10px; transition: transform .28s cubic-bezier(.2, .9, .3, 1); }
.fab { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--paper); border: 2.5px solid var(--ink); box-shadow: var(--float); }
.fab svg { width: 23px; height: 23px; }
.fab:active { transform: translateY(1px); }
.fab-primary { background: var(--forest); color: var(--paper); width: 56px; height: 56px; border-radius: 18px; margin-left: -6px; }
.fab-primary svg { width: 26px; height: 26px; }
.fab-primary .dot { fill: currentColor; stroke: none; }
.fab-primary.on { background: var(--blue); color: #fff; }
.fab-primary.wait svg { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#layers { position: fixed; z-index: 650; right: 70px; bottom: calc(var(--sab) + 150px); display: grid; gap: 4px; padding: 6px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--float); animation: drop .16s ease-out; }
#layers button { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 10px; font-weight: 700; font-size: 14.5px; }
#layers button i { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--ink); background-size: cover; background-position: center; }
#layers button[aria-checked="true"] { background: var(--forest); color: var(--paper); }
#layers .l-map i { background: linear-gradient(135deg, #CFDDB5 0 40%, #fff 40% 52%, #E9E5D0 52% 78%, #9CCBE0 78%); }
#layers .l-sat i { background: radial-gradient(circle at 30% 30%, #4f7a45, #26402b 60%, #1b2c20); }
#layers .l-art i { background: linear-gradient(135deg, #54b96a 0 45%, #d8c36a 45% 55%, #2f8f4a 55%); }

/* ── place sheet ── */
#sheet { position: fixed; z-index: 600; left: 0; right: 0; bottom: 0; max-height: min(78vh, 720px); display: flex; flex-direction: column;
  background: var(--paper); border-top: 3px solid var(--ink); border-radius: 22px 22px 0 0; box-shadow: 0 -14px 40px -10px rgba(18, 38, 26, .5);
  transform: translateY(0); transition: transform .32s cubic-bezier(.2, .9, .3, 1); padding-bottom: var(--sab); }
#sheet.enter { transform: translateY(105%); }
#sheet.peek { transform: translateY(calc(100% - var(--peek, 190px) - var(--sab))); }
.sheet-handle { flex: none; width: 100%; height: 22px; display: grid; place-items: center; }
.sheet-handle i { width: 44px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .28; }
.sheet-close { position: absolute; top: 12px; right: 10px; z-index: 2; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; width: 36px; height: 36px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 18px; -webkit-overflow-scrolling: touch; }

.card-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 44px; }
.badge { flex: none; min-width: 52px; height: 52px; padding: 0 8px; border-radius: 15px; display: grid; place-items: center; background: var(--c, var(--forest)); color: var(--k, var(--paper)); border: 2.5px solid var(--ink); box-shadow: var(--sticker); font: 800 24px/1 var(--display); }
.badge svg { width: 26px; height: 26px; }
.badge svg.starfill { fill: var(--sun); stroke: var(--ink); stroke-width: 1.6; }
.card-head h2 { margin: 1px 0 0; font: 800 23px/1.08 var(--display); letter-spacing: -.015em; }
.card-head .zone-line { margin-top: 5px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-head .zone-line i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--ink); display: inline-block; }
.unit-line { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: var(--paper); font: 700 15px/1.25 var(--body); display: flex; gap: 10px; align-items: center; }
.unit-line svg { width: 22px; height: 22px; flex: none; color: var(--sun); }
.unit-line b { font: 800 20px/1 var(--display); color: var(--sun); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 8px 12px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--paper); font: 700 14.5px/1.15 var(--body); text-align: left; text-decoration: none; color: var(--ink); box-shadow: var(--sticker); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--forest); color: var(--paper); }
.btn.on { background: var(--blue); color: #fff; }
.btn.wide { grid-column: 1 / -1; }
.btn.ghost { box-shadow: none; border-width: 2px; min-height: 44px; font-size: 13.5px; }

.route-info { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #E3ECFF; border: 2px solid var(--blue); color: #0B2E80; font-weight: 700; }
.route-info { flex-wrap: nowrap; white-space: nowrap; }
.route-info b { font: 800 19px/1 var(--display); }
.route-info span { font-size: 14px; }
.route-info button { margin-left: auto; font-size: 13px; text-decoration: underline; color: inherit; font-weight: 700; }

.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 14px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; height: 190px; width: auto; max-width: 86%; object-fit: cover; border-radius: 14px; border: 2.5px solid var(--ink); scroll-snap-align: center; background: var(--paper-2); }
.gallery img:only-child { width: 100%; max-width: 100%; }

.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.facts li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper-2); font-size: 13.5px; font-weight: 700; }
.facts li.warn { background: #FFE9B8; border-color: #C58A00; color: #5A3D00; }
.facts li.good { background: #DCEFD9; border-color: #4E9A55; color: #1E4D25; }
.facts svg { width: 15px; height: 15px; }
.desc { margin: 12px 0 0; color: #2c3d31; font-size: 15.5px; }
.note { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--sun); background: #FFF6D6; border-radius: 0 10px 10px 0; font-weight: 700; font-size: 14.5px; }
.muted { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.siblings { margin-top: 16px; }
.siblings h3 { font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); margin: 0 0 8px; }
.siblings .res-grid { padding: 0; }
.siblings .res-grid button.cur { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ── photo viewer, toast, splash ── */
#viewer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 900; background: rgba(10, 18, 13, .94); display: grid; place-items: center; animation: fade .2s; }
#viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
#viewer .icon-btn { position: absolute; top: calc(var(--sat) + 12px); right: 12px; background: var(--paper); border-radius: 50%; }
@keyframes fade { from { opacity: 0; } }

#toast { position: fixed; z-index: 950; left: 50%; bottom: calc(var(--sab) + 100px); transform: translateX(-50%); max-width: min(92vw, 440px); padding: 12px 16px; border-radius: 14px;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 14.5px; text-align: center; box-shadow: var(--float); animation: drop .2s ease-out; }

#splash { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000; display: grid; place-items: center; overflow-y: auto; padding: calc(var(--sat) + 64px) 0 calc(var(--sab) + 28px); background: var(--forest);
  background-image: radial-gradient(circle at 20% 15%, rgba(245, 196, 0, .16), transparent 45%), radial-gradient(circle at 85% 90%, rgba(154, 91, 232, .18), transparent 40%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 9px);
  transition: transform .7s cubic-bezier(.7, 0, .2, 1), opacity .5s .25s; }
#splash.gone { transform: translateY(-104%); opacity: 0; pointer-events: none; }
.splash-card { color: var(--paper); text-align: left; padding: 0 28px; max-width: 460px; width: 100%; }
.splash-stamp { display: inline-block; font: 800 13px/1 var(--display); letter-spacing: .16em; padding: 7px 11px; border: 2px solid var(--sun); color: var(--sun); border-radius: 8px; transform: rotate(-3deg); animation: rise .5s both; }
.splash-card h1 { margin: 18px 0 10px; font: 800 clamp(44px, 13vw, 66px)/.92 var(--display); letter-spacing: -.035em; }
.splash-card h1 span { display: block; animation: rise .55s both; }
.splash-card h1 span:nth-child(2) { animation-delay: .09s; color: var(--sun); }
.splash-card p { margin: 0; font-size: 16px; opacity: .85; animation: rise .55s .18s both; }
.splash-trail { display: flex; gap: 9px; margin-top: 22px; }
.splash-trail i { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--ink); animation: pop .4s both; }
.splash-trail i:nth-child(1) { background: #F5C400; animation-delay: .30s; }
.splash-trail i:nth-child(2) { background: #9A5BE8; animation-delay: .37s; }
.splash-trail i:nth-child(3) { background: #F28A1E; animation-delay: .44s; }
.splash-trail i:nth-child(4) { background: #E5484D; animation-delay: .51s; }
.splash-trail i:nth-child(5) { background: #14A9E3; animation-delay: .58s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { from { opacity: 0; transform: scale(0); } }

/* ── wide screens: the sheet becomes a side panel ── */
@media (min-width: 860px) {
  #topbar, #results { right: auto; width: var(--sheet-w); left: 14px; }
  #topbar { top: 14px; }
  #results { top: 76px; }
  #sheet { left: 14px; right: auto; width: var(--sheet-w); bottom: 14px; top: 132px; max-height: none; border: 3px solid var(--ink); border-radius: 20px; }
  #sheet.peek { transform: none; }
  #sheet.enter { transform: translateX(-110%); }
  .sheet-handle { visibility: hidden; height: 14px; }
  #fabs { right: 16px; bottom: 30px; }
  #layers { right: 80px; bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── agenda: "now / next" pill + full agenda panel ── */
:root { --ember: #E8501E; }
#nowpill { position: fixed; z-index: 440; left: 10px; bottom: calc(var(--sab) + 26px); max-width: calc(100vw - 92px); display: flex; align-items: center; gap: 11px; text-align: left;
  min-height: 66px; padding: 9px 12px 9px 13px; border-radius: 20px; background: var(--sun); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink), var(--float); }
#nowpill > svg { width: 30px; height: 30px; flex: none; stroke-width: 2.4; }
#nowpill:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.np-text { display: grid; gap: 3px; min-width: 0; }
.np-text b { font: 800 23px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.np-text small { font: 700 12.5px/1.15 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text small:empty { display: none; }
#nowpill > svg.np-go { width: 22px; height: 22px; stroke-width: 3.2; margin-left: 2px; }
#nowpill.live small::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 0 rgba(232, 80, 30, .7); animation: live 1.8s ease-out infinite; }
@keyframes live { to { box-shadow: 0 0 0 9px rgba(232, 80, 30, 0); } }
body.sheet-open #nowpill, body.searching #nowpill { display: none; }

#agenda { position: fixed; z-index: 800; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; background: var(--paper); animation: agenda-in .32s cubic-bezier(.2, .9, .3, 1); }
@keyframes agenda-in { from { transform: translateY(100%); } }
.ag-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: calc(var(--sat) + 26px) 14px 14px 18px; background: var(--forest); color: var(--paper);
  background-image: radial-gradient(circle at 85% 0%, rgba(232, 80, 30, .35), transparent 55%), repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 9px); }
.ag-brand { display: inline-block; font: 800 11px/1 var(--display); letter-spacing: .15em; color: var(--sun); border: 1.5px solid var(--sun); border-radius: 6px; padding: 5px 8px; transform: rotate(-2deg); }
.ag-head h2 { margin: 10px 0 0; font: 800 38px/.95 var(--display); letter-spacing: -.03em; }
.ag-head .icon-btn { background: var(--paper); color: var(--ink); border-radius: 50%; width: 42px; height: 42px; align-self: flex-start; }
.ag-days { flex: none; display: flex; gap: 8px; padding: 12px 14px; background: var(--paper); border-bottom: 2px solid var(--line); }
.ag-days button { flex: 1; display: grid; gap: 2px; justify-items: center; padding: 8px 4px; border-radius: 14px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 0 2px 0 rgba(26, 43, 32, .8); }
.ag-days button small { font: 700 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.ag-days button b { font: 800 22px/1 var(--display); }
.ag-days button[aria-selected="true"] { background: var(--forest); color: var(--paper); transform: translateY(1px); box-shadow: 0 1px 0 rgba(26, 43, 32, .8); }
.ag-days button[aria-selected="true"] small { color: var(--sun); }
.ag-days button.today b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--ember); vertical-align: 8px; }
.ag-remind { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: #FFF6D6; border-bottom: 2px solid var(--line); }
.ag-remind > svg { flex: none; width: 24px; height: 24px; color: var(--ember); stroke-width: 2.2; }
.ag-remind span { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ag-remind b { font: 800 15px/1.1 var(--display); }
.ag-remind small { font-size: 12px; line-height: 1.2; color: var(--ink-2); }
.ag-remind a { flex: none; padding: 9px 11px; border-radius: 12px; border: 2px solid var(--ink); background: var(--sun); color: var(--ink); font: 800 14px/1 var(--display); text-decoration: none; box-shadow: 0 2px 0 var(--ink); white-space: nowrap; }
.ag-remind a:active { transform: translateY(2px); box-shadow: none; }
.ag-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 14px calc(var(--sab) + 28px); }
.ag-list { list-style: none; margin: 0; padding: 0; position: relative; }
.ag-list::before { content: ""; position: absolute; left: 66px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
.ag-item { display: grid; grid-template-columns: 58px 1fr; gap: 18px; padding: 8px 0; position: relative; }
.ag-item::before { content: ""; position: absolute; left: 61px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink); z-index: 1; }
.ag-item.is-now::before { background: var(--ember); box-shadow: 0 0 0 5px rgba(232, 80, 30, .22); }
.ag-item.is-past { opacity: .58; }
.ag-time { text-align: right; padding-top: 14px; }
.ag-time b { display: block; font: 800 14.5px/1.1 var(--display); white-space: nowrap; }
.ag-time span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.ag-card { border: 2px solid var(--ink); border-radius: 16px; padding: 12px 13px; background: #FBF8EE; box-shadow: 0 2px 0 rgba(26, 43, 32, .8); min-width: 0; }
.ag-title { font: 800 17.5px/1.15 var(--display); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.now-badge { font: 800 10.5px/1 var(--display); letter-spacing: .1em; padding: 4px 7px; border-radius: 6px; background: var(--ember); color: #fff; font-style: normal; }
.now-badge.ended { background: var(--ink-2); }
.ag-opt.is-past { opacity: .55; }
.ag-detail { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.ag-people { list-style: none; margin: 9px 0 0; padding: 0; display: grid; gap: 6px; }
.ag-people li { font-size: 14.5px; line-height: 1.25; }
.ag-people li span { display: inline-block; min-width: 72px; font: 700 11px/1 var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--sun); }
.ag-people li small { display: block; margin-left: 72px; font-size: 12.5px; opacity: .75; }
.ag-place { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; min-height: 40px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--c, var(--paper-2)); color: var(--k, var(--ink)); font: 700 13.5px/1.1 var(--body); max-width: 100%; }
.ag-place svg { width: 17px; height: 17px; flex: none; }
.ag-place .go { opacity: .7; margin-left: 2px; }
.ag-place:active { transform: translateY(1px); }
.ag-tba { display: inline-block; margin-top: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 5px 10px; border: 1.5px dashed var(--ink-2); border-radius: 999px; }
.kind-service .ag-card { background: var(--ink); color: var(--paper); }
.kind-service .ag-detail { color: #C9D8C4; }
.kind-meal .ag-card, .kind-prayer .ag-card, .kind-quiet .ag-card, .kind-info .ag-card { padding: 10px 13px; }
.kind-meal .ag-title, .kind-prayer .ag-title, .kind-quiet .ag-title { font-size: 16px; }
.kind-quiet .ag-card { background: none; border-style: dashed; box-shadow: none; }
.kind-meal .ag-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.kind-meal .ag-place { margin-top: 0; }
.ag-options { display: grid; gap: 8px; margin-top: 11px; }
.ag-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 11px; background: var(--paper); }
.ag-opt.is-now { border-color: var(--ember); box-shadow: inset 3px 0 0 var(--ember); }
.ag-opt h4 { margin: 0; font: 800 15px/1.2 var(--display); }
.ag-opt .when { font: 700 12.5px/1 var(--body); color: var(--ink-2); margin-top: 4px; }
.ag-opt .topic { margin-top: 5px; font-size: 14.5px; font-style: italic; }
.ag-opt .speaker { margin-top: 3px; font-size: 13px; color: var(--ink-2); }
.ag-opt .ag-place { margin-top: 8px; }
.ag-foot { margin: 18px 4px 0; font-size: 12.5px; color: var(--ink-2); text-align: center; }

/* agenda items inside a place card */
.here { margin-top: 16px; }
.here h3 { font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); margin: 0 0 8px; }
.here ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.here li { display: flex; gap: 10px; align-items: baseline; padding: 8px 11px; border-radius: 11px; background: var(--paper-2); font-size: 14.5px; }
.here li b { font: 800 13.5px/1.2 var(--display); white-space: nowrap; min-width: 118px; }
.here li.is-now { background: #FFE3D6; box-shadow: inset 3px 0 0 var(--ember); }

@media (min-width: 860px) {
  #nowpill { left: auto; right: 84px; bottom: 30px; max-width: 360px; }
  #agenda { left: 14px; right: auto; top: 14px; bottom: 14px; width: calc(var(--sheet-w) + 40px); border: 3px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: var(--float); animation-name: agenda-in-wide; }
  @keyframes agenda-in-wide { from { transform: translateX(-110%); } }
  .ag-head { padding-top: 18px; }
}

/* ── home page: the opening card stays, with the three big choices under it ── */
#home-lang { position: absolute; top: calc(var(--sat) + 16px); right: 18px; background: rgba(245, 240, 225, .12); border-color: rgba(245, 240, 225, .35); }
#home-lang b { color: var(--paper); opacity: .75; }
html[lang="es"] #home-lang b[data-l="es"], html[lang="en"] #home-lang b[data-l="en"] { background: var(--sun); color: var(--ink); opacity: 1; }
.home-nav { display: grid; gap: 12px; margin-top: 30px; }
.home-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 78px; padding: 12px 14px 12px 14px; text-align: left; border-radius: 20px;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 5px 0 rgba(10, 20, 14, .9); animation: rise .5s both; }
.home-opt:nth-child(1) { animation-delay: .34s; } .home-opt:nth-child(2) { animation-delay: .42s; } .home-opt:nth-child(3) { animation-delay: .50s; }
.home-opt:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(10, 20, 14, .9); }
.home-opt .ico { flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--c, var(--forest)); color: var(--k, var(--paper)); border: 2.5px solid var(--ink); }
.home-opt .ico svg { width: 27px; height: 27px; stroke-width: 2.3; }
.home-opt .txt { display: grid; gap: 4px; min-width: 0; flex: 1; }
.home-opt .txt b { font: 800 25px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.home-opt .txt small { font: 700 13px/1.2 var(--body); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-opt.live .txt small::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--ember); animation: live 1.8s ease-out infinite; }
.home-opt > svg { flex: none; width: 24px; height: 24px; stroke-width: 3; }
.home-opt.primary { background: var(--sun); }
.home-opt.primary .txt small { color: var(--ink); }
/* "Inicio": the way back to the home page, on every screen */
.menu-btn { flex: none; display: flex; align-items: center; gap: 6px; height: 38px; margin-left: -7px; padding: 0 11px 0 9px; border-radius: 11px; background: var(--forest); color: var(--paper); font: 800 13px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.menu-btn svg { width: 19px; height: 19px; stroke-width: 2.5; flex: none; }
.menu-btn:active, .home-btn:active { transform: translateY(1px); }
.head-btns { display: flex; align-items: center; gap: 8px; align-self: flex-start; flex: none; }
.home-btn { display: flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px 0 11px; border-radius: 999px; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); font: 800 14px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.home-btn svg { width: 20px; height: 20px; stroke-width: 2.5; flex: none; }
/* the search field must give way on narrow phones: an <input> keeps a ~190px intrinsic width unless told otherwise */
#topbar { grid-template-columns: minmax(0, 1fr); }
#topbar > *, .search { min-width: 0; }
.search input { width: 0; }
@media (max-width: 345px) { .menu-btn span { display: none; } .menu-btn { padding: 0 9px; } }
.search > .menu-btn + svg { display: none; }   /* the home button takes the magnifier's place */
@media (max-height: 700px) { .home-opt { min-height: 66px; } .home-nav { margin-top: 20px; gap: 10px; } .splash-card h1 { font-size: clamp(38px, 11vw, 54px); } }

/* ── Hospedaje: name lookup (same sheet-of-paper look as the agenda) ── */
#people { position: fixed; z-index: 800; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; background: var(--paper); animation: agenda-in .32s cubic-bezier(.2, .9, .3, 1); }
.pp-bar { flex: none; padding: 12px 14px; background: var(--paper); border-bottom: 2px solid var(--line); }
.pp-bar .search { box-shadow: var(--sticker); height: 56px; }
.pp-bar .search input { font-size: 17px; }
#pp-body { display: grid; gap: 4px; padding-top: 8px; max-width: 560px; margin: 0 auto; }
#pp-body .res { padding: 11px 10px; border-bottom: 1.5px solid var(--line); border-radius: 0; }
#pp-body .res:last-of-type { border-bottom: 0; }
#pp-body .res .t { font-size: 17px; }
#pp-body .res .s { font-size: 13.5px; }
#pp-body .res.pp-mine { border: 2.5px solid var(--ink); border-radius: 16px; background: #FFF6D6; box-shadow: var(--sticker); margin-bottom: 6px; }
.pp-note { margin: 10px 2px; padding: 12px 14px; border-radius: 12px; font-size: 15.5px; }
.pp-note.hint { color: var(--ink-2); background: var(--paper-2); }
.pp-note.warn { border-left: 4px solid var(--sun); background: #FFF6D6; font-weight: 700; border-radius: 0 10px 10px 0; }
.pp-note.loading { display: flex; justify-content: center; gap: 7px; padding: 22px; }
.pp-note.loading i { width: 10px; height: 10px; border-radius: 50%; background: var(--forest); animation: pp-dot 1s ease-in-out infinite; }
.pp-note.loading i:nth-child(2) { animation-delay: .15s; } .pp-note.loading i:nth-child(3) { animation-delay: .3s; }
@keyframes pp-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.res-people .pp-note.loading { margin: 0; padding: 16px; }
.pp-browse { margin-top: 6px; }
.pp-back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; padding: 8px 12px 8px 6px; margin: 2px 0 6px; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); font: 700 14px/1 var(--body); }
.pp-back svg { width: 18px; height: 18px; stroke-width: 3; }
.pp-card { display: grid; gap: 10px; padding: 16px; border: 3px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.pp-name { margin: 0; font: 800 28px/1.05 var(--display); letter-spacing: -.02em; }
.pp-church { margin-top: -6px; font-weight: 700; color: var(--ink-2); }
.pp-where { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--ink); color: var(--paper); }
.pp-where .badge { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--c, var(--sun)); color: var(--k, var(--ink)); border: 2.5px solid var(--paper); font: 800 24px/1 var(--display); }
.pp-where .badge svg { width: 26px; height: 26px; }
.pp-where small { display: block; font: 700 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--sun); }
.pp-where b { display: block; margin-top: 4px; font: 800 23px/1.05 var(--display); }
.pp-where span:not(.badge) { display: block; margin-top: 3px; font-weight: 700; font-size: 15.5px; }
#pp-save svg { fill: none; } #pp-save.on { background: #FFF6D6; } #pp-save.on svg { fill: var(--sun); }
.pp-group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 20px 4px 8px; font: 800 19px/1.1 var(--display); }
.pp-group h3 small { font: 700 12.5px/1 var(--body); color: var(--ink-2); white-space: nowrap; }
.pp-mates { list-style: none; margin: 0; padding: 0; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; background: #fff; }
.pp-mates li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1.5px solid var(--line); }
.pp-mates li:last-child { border-bottom: 0; }
.pp-mates li b { min-width: 0; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.pp-mates li small { flex: 0 1 auto; max-width: 45%; font-size: 12.5px; color: var(--ink-2); text-align: right; }
.pp-mates li.pp-me { background: var(--sun); }
.pp-mates li.pp-me small { color: var(--ink); }
.pp-code { display: grid; gap: 10px; padding: 18px 16px; margin-top: 8px; border: 3px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.pp-code h3 { margin: 0; font: 800 24px/1 var(--display); }
.pp-code p { margin: 0; color: var(--ink-2); }
.pp-code.bad p { color: #A8201A; font-weight: 700; }
.pp-code input { height: 56px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); font: 800 22px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); outline: 0; }
@media (min-width: 860px) {
  #people { left: 14px; right: auto; top: 14px; bottom: 14px; width: calc(var(--sheet-w) + 40px); border: 3px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: var(--float); animation-name: agenda-in-wide; }
}

/* photo shows as soon as a place is tapped: it sits under the name, above the buttons */
.gallery.top { margin-top: 12px; }
.gallery.top img { height: clamp(118px, 21vh, 170px); }
