/* Map-first layout: top bar, full map, bottom sheet with places. Steppe palette: coirón olive, basalt, lake teal. */
:root {
  --ink: #23291f;
  --paper: #f6f4ec;
  --panel: #ffffff;
  --line: #dcd8c8;
  --muted: #6b6f5f;
  --olive: #2f3a2b;
  --olive-2: #4a5a3c;
  --sand: #c9a45c;
  --you: #1f7ae0;

  --c-aloj: #8a4b2f;
  --c-serv: #4a5a3c;
  --c-dep: #7a6a1f;
  --c-nat: #2f6f5a;
  --c-agua: #1d6a8a;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ecebe2; --paper: #191c17; --panel: #22261f; --line: #3a4033; --muted: #a3a796;
    --olive: #151a12; --olive-2: #8fa676; --sand: #d6b471;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 var(--font); color: var(--ink); background: var(--paper);
  display: flex; flex-direction: column; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--olive); color: #f3efe0;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; letter-spacing: .01em; font-size: 16px; }
.brand-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--sand); }
.langs { display: flex; gap: 4px; }
.langs button {
  background: transparent; border: 1px solid rgba(255,255,255,.25); border-radius: 6px;
  padding: 4px 8px; font-size: 12px; font-weight: 600; color: #f3efe0;
}
.langs button[aria-pressed="true"] { background: var(--sand); border-color: var(--sand); color: #23291f; }

.banner {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center;
  background: #fbf3df; color: #3d331a; border-bottom: 1px solid #e8d6a8;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) { .banner { background: #2c2716; color: #efe3c0; border-color: #4a4024; } }
.banner-text { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.banner.done { grid-template-columns: 1fr; }
.btn-primary {
  background: var(--olive-2); color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 600; white-space: nowrap;
}
@media (prefers-color-scheme: dark) { .btn-primary { color: #151a12; } }
.btn-primary:disabled { opacity: .6; }
.progress { grid-column: 1 / -1; height: 6px; background: rgba(0,0,0,.1); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--olive-2); transition: width .2s; }

#map { flex: 1; min-height: 0; background: #b9b49c; }

.fabs {
  position: fixed; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(var(--sheet-peek, 140px) + 16px);
  display: flex; flex-direction: column; gap: 10px; z-index: 900; transition: bottom .25s;
}
.fab {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--panel); color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.3); display: grid; place-items: center;
}
.fab.active { color: var(--you); }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: var(--panel); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px rgba(0,0,0,.18);
  height: 70vh; transform: translateY(calc(70vh - var(--sheet-peek, 140px)));
  transition: transform .25s ease; display: flex; flex-direction: column;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
}
.sheet.open { transform: translateY(0); }
@media (min-width: 760px) {
  .sheet { left: 16px; right: auto; width: 380px; bottom: 16px; border-radius: 16px; height: calc(100% - 110px); transform: none; max-height: 640px; }
  .fabs { bottom: 24px; }
  .handle { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .fabs { transition: none; } }
.handle { background: none; border: 0; padding: 10px 0 6px; display: grid; place-items: center; flex: none; }
.handle span { width: 42px; height: 5px; border-radius: 3px; background: var(--line); }
#browse, #detail { overflow-y: auto; min-height: 0; flex: 1; padding-bottom: 16px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 10px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.row { width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; background: none; border: 0; text-align: left; padding: 10px 0; }
.row .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.row .name { font-weight: 600; min-width: 0; }
.row .cat { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.row .dist { font: 600 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

.note { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin: 12px 0 0; }

.d-back { background: none; border: 0; padding: 4px 0; color: var(--muted); font-size: 13px; }
.d-title { font-size: 21px; margin: 6px 0 2px; text-wrap: balance; }
.d-cat { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.d-nav { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 16px 0; padding: 14px; border-radius: 12px; background: var(--paper); }
.d-arrow { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.d-arrow svg { transition: transform .3s; }
.d-big { font: 700 24px var(--mono); font-variant-numeric: tabular-nums; }
.d-small { font-size: 13px; color: var(--muted); }
.d-coords { font: 13px var(--mono); color: var(--muted); }

/* markers */
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); display: grid; place-items: center; }
.pin svg { transform: rotate(45deg); }
.pin.sel { outline: 3px solid #ffd54a; }
.leaflet-tooltip.lbl { background: rgba(20,24,18,.78); color: #fff; border: 0; box-shadow: none; font-size: 11.5px; font-weight: 600; padding: 2px 6px; }
.leaflet-tooltip.lbl::before { display: none; }
.you-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--you); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(31,122,224,.25); }
