:root {
  --bg: #f6f1ea;
  --surface: #fffdf9;
  --ink: #1d2a29;
  --muted: #5f6b69;
  --line: #e4dbcf;
  --teal: #1f5b57;      /* agua termal */
  --teal-soft: #dcebe8;
  --clay: #b5532f;      /* tierra salteña */
  --clay-soft: #f6e2d8;
  --gold: #c99a3b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(29, 42, 41, .12);
  --tabs-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121817; --surface: #1b2322; --ink: #eef2f1; --muted: #a3b0ae; --line: #2b3735;
    --teal: #6cc2b9; --teal-soft: #1e3532; --clay: #e48a64; --clay-soft: #3a2620;
    --shadow: 0 6px 24px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, sans-serif; }
body { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; margin: 0; }

.top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 14px;
  background: var(--teal); color: #fff;
  background-image: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.14), transparent 60%);
}
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.top h1 { font-size: 26px; line-height: 1.1; margin-top: 2px; }
.tagline { margin: 4px 0 0; font-size: 13px; opacity: .85; }
#lang { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px; padding: 6px 8px; font: 600 13px Inter, sans-serif; }
#lang option { color: #000; }

.view { display: none; }
.view.active { display: block; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 13px; font: 500 14px Inter, sans-serif; cursor: pointer; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.toolbar { display: flex; gap: 10px; align-items: center; padding: 8px 16px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 140px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

#map { height: 42vh; min-height: 240px; margin: 4px 16px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); z-index: 0; }

.list { list-style: none; margin: 0; padding: 0 16px 16px; display: grid; gap: 10px; }
.card { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; cursor: pointer; }
.card:active { transform: scale(.99); }
.badge { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.card h3 { font-family: Inter, sans-serif; font-size: 15px; font-weight: 600; }
.card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card .dist { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.star { color: var(--gold); font-size: 12px; margin-left: 4px; }

.section-title { font-size: 22px; padding: 18px 16px 10px; }
.agenda { list-style: none; margin: 0; padding: 0 16px 16px; display: grid; gap: 10px; }
.ev { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.ev .date { flex: none; width: 56px; text-align: center; background: var(--clay-soft); color: var(--clay);
  border-radius: 12px; padding: 6px 0; }
.ev .date b { display: block; font: 700 22px Fraunces, serif; line-height: 1; }
.ev .date span { font-size: 12px; text-transform: uppercase; font-weight: 600; }
.ev h3 { font-family: Inter, sans-serif; font-size: 15px; font-weight: 600; }
.ev p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ev .soon { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--teal); font-weight: 600; }
.empty { padding: 0 16px; color: var(--muted); }

.tabs { position: fixed; inset: auto 0 0 0; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--surface);
  border-top: 1px solid var(--line); z-index: 20; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); font: 500 12px Inter, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.tabs .ico { font-size: 18px; }
.tabs button.active { color: var(--teal); }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; z-index: 31;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.sheet .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--clay); font-weight: 600; }
.sheet h2 { font-size: 24px; margin: 4px 0 8px; }
.sheet .desc { color: var(--ink); margin: 0 0 12px; }
.meta { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px Inter, sans-serif;
  text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.fav-on { color: var(--clay); }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.close { position: absolute; right: 14px; top: 12px; border: 0; background: var(--bg); color: var(--ink);
  width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top));
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  z-index: 40; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

.leaflet-popup-content { font: 13px Inter, sans-serif; }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin span { transform: rotate(45deg); font-size: 14px; }

@media (min-width: 900px) {
  #view-explore.active { display: grid; grid-template-columns: 1fr 420px; grid-template-rows: auto auto 1fr; }
  #chips, .toolbar { grid-column: 1 / -1; }
  #map { height: calc(100vh - 260px); grid-column: 1; }
  #view-explore .list { grid-column: 2; max-height: calc(100vh - 260px); overflow-y: auto; padding-top: 4px; }
  .sheet { left: auto; right: 24px; bottom: 24px; width: 420px; border-radius: 20px; }
}

/* ===== Tema "Poncho salteño": rojo y negro del poncho de Güemes ===== */
:root, :root:is(*) {
  --bg: #f4efe7; --surface: #fff; --ink: #1a1a1a; --muted: #5a5552; --line: #e3d9cc;
  --teal: #9e1b1f; --teal-soft: #f6dcdc; --clay: #9e1b1f; --clay-soft: #f6dcdc; --gold: #d19a2a;
  --radius: 6px;
}
html, body { background: var(--bg); color: var(--ink); }
.top { background: #9e1b1f; background-image: none; border-bottom: 10px solid #111;
  box-shadow: inset 0 -4px 0 #9e1b1f, inset 0 -6px 0 #111; padding-bottom: 20px; }
.top h1 { font-family: Inter, system-ui, sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; font-size: 24px; }
.eyebrow { color: #f1c9a0; opacity: 1; }
.chip { border-radius: 6px; font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.chip.active { background: #9e1b1f; border-color: #9e1b1f; color: #fff; }
.card { border-left: 5px solid #9e1b1f; border-radius: 6px; }
.badge { border-radius: 6px; }
.sheet h2, .section-title { font-family: Inter, system-ui, sans-serif; font-weight: 900; text-transform: uppercase; }
.sheet { border-top: 6px solid #9e1b1f; }
.btn { border-radius: 6px; text-transform: uppercase; font-size: 13px; letter-spacing: .03em; }
.btn.primary { background: #111; border-color: #111; color: #fff; }
.tabs { background: #111; border-top: 0; }
.tabs button { color: #bbb; }
.tabs button.active { color: #fff; box-shadow: inset 0 3px 0 #9e1b1f; }
.ev .date { background: #9e1b1f; color: #fff; border-radius: 6px; }
.ev .soon { color: #9e1b1f; }
.toggle input { accent-color: #9e1b1f; }

/* ===== GPS propio (navegación giro por giro) ===== */
.btn.nav-go { background: #9e1b1f; border-color: #9e1b1f; color: #fff; }
body.navigating { padding-bottom: 0; overflow: hidden; }
body.navigating .top, body.navigating .chips, body.navigating .toolbar, body.navigating .list,
body.navigating .tabs, body.navigating #view-agenda, body.navigating #view-favs { display: none !important; }
body.navigating #view-explore { display: block !important; }
body.navigating #map { position: fixed !important; inset: 0; width: 100% !important; height: 100% !important; margin: 0; border: 0; border-radius: 0; z-index: 25; }
#nav { position: fixed; inset: 0; z-index: 26; pointer-events: none; }
#nav > * { pointer-events: auto; }
.nav-top { position: absolute; left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top));
  display: flex; gap: 12px; align-items: center; background: #111; color: #fff; border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.35); border-bottom: 5px solid #9e1b1f; }
.nav-arrow { flex: none; width: 58px; height: 58px; display: grid; place-items: center; font-size: 34px;
  background: #9e1b1f; border-radius: 8px; line-height: 1; }
.nav-instr { display: flex; flex-direction: column; min-width: 0; }
.nav-instr b { font: 900 26px Inter, sans-serif; line-height: 1.1; }
.nav-instr span { font: 600 16px Inter, sans-serif; line-height: 1.25; }
.nav-instr small { color: #f1c9a0; font-size: 13px; margin-top: 2px; }
.nav-instr small:empty { display: none; }
.nav-status { position: absolute; left: 50%; transform: translateX(-50%); top: calc(110px + env(safe-area-inset-top));
  background: #fff; color: #111; border: 2px solid #111; border-radius: 8px; padding: 8px 12px;
  font: 600 14px Inter, sans-serif; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.nav-center { position: absolute; right: 12px; bottom: calc(190px + env(safe-area-inset-bottom)); background: #fff; color: #111;
  border: 2px solid #111; border-radius: 8px; padding: 9px 12px; font: 700 13px Inter, sans-serif; text-transform: uppercase; cursor: pointer; }
.nav-bottom { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; color: #111;
  border-top: 6px solid #9e1b1f; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(0,0,0,.2); }
.nav-eta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nav-eta b { font: 900 28px Inter, sans-serif; color: #9e1b1f; }
.nav-eta span { color: #5a5552; font-size: 14px; }
.nav-dest { font: 700 14px Inter, sans-serif; text-transform: uppercase; letter-spacing: .03em; margin: 2px 0 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-dest::before { content: '🏁 '; }
.nav-row { display: flex; gap: 8px; align-items: stretch; }
.nav-modes { display: flex; flex: 1; border: 2px solid #111; border-radius: 8px; overflow: hidden; }
.nav-modes button { flex: 1; border: 0; background: #fff; color: #111; padding: 10px 6px; font: 700 13px Inter, sans-serif;
  text-transform: uppercase; cursor: pointer; }
.nav-modes button.on { background: #111; color: #fff; }
.nav-icon { width: 48px; border: 2px solid #111; background: #fff; border-radius: 8px; font-size: 18px; cursor: pointer; }
.nav-end { border: 0; background: #9e1b1f; color: #fff; border-radius: 8px; padding: 0 16px; font: 800 13px Inter, sans-serif;
  text-transform: uppercase; cursor: pointer; }
.nav-extra { display: flex; gap: 8px; margin-top: 10px; }
.nav-extra[hidden] { display: none; }
.nav-sim, .nav-gmaps { flex: 1; text-align: center; border: 2px dashed #9e1b1f; background: #fff; color: #9e1b1f;
  border-radius: 8px; padding: 10px; font: 700 13px Inter, sans-serif; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.nav-gmaps { border-style: solid; border-color: #e3d9cc; color: #111; }
.me-wrap { width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.me-arrow { width: 36px; height: 36px; transition: transform .4s ease; }
.dest-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: #111;
  border: 3px solid #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.dest-pin::after { content: ''; }
@media (min-width: 900px) {
  .nav-top { left: 24px; right: auto; width: 420px; }
  .nav-bottom { left: 24px; right: auto; bottom: 24px; width: 420px; border-radius: 10px; }
  .nav-center { right: 24px; bottom: 24px; }
}

/* ===== Ayuda, audioguía y encuesta ===== */
.tabs .tab-help .ico { color: #e05a5e; }
.tabs .tab-help.active .ico { color: #fff; }
#view-help { padding-bottom: 16px; }
.help-block { padding: 0 16px 14px; }
.help-h { font: 800 13px Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 10px; }
.sos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sos-btn { display: flex; flex-direction: column; gap: 2px; text-decoration: none; background: #9e1b1f; color: #fff;
  border-radius: 8px; padding: 12px 14px; border-bottom: 4px solid #111; min-height: 76px; }
.sos-btn b { font: 900 30px Inter, sans-serif; line-height: 1; }
.sos-btn span { font: 600 13px Inter, sans-serif; line-height: 1.25; opacity: .95; }
.sos-btn:first-child { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
.sos-btn:first-child b { font-size: 40px; }
.tour { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid #9e1b1f; border-radius: 6px; padding: 12px; }
.tour .meta { margin: 10px 0 0; }
.tour .meta:empty { display: none; }
.tour .meta a { color: inherit; }
.btn.big { width: 100%; padding: 14px; font-size: 14px; }
.useful { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card.u { cursor: default; flex-wrap: wrap; }
.card.u > div:first-child { flex: 1; min-width: 160px; }
.u-act { display: flex; gap: 6px; }
.u-act .btn { padding: 9px 12px; font-size: 12px; }

.listen { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 14px 8px 10px;
  border: 2px solid #111; background: #fff; color: #111; border-radius: 6px; font: 800 13px Inter, sans-serif;
  text-transform: uppercase; letter-spacing: .03em; cursor: pointer; }
.listen.on { background: #111; color: #fff; }
.listen .eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.listen.on .eq { display: inline-flex; }
.listen .eq i { width: 3px; background: #e05a5e; border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.listen .eq i:nth-child(2) { animation-delay: .2s; } .listen .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

.survey { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabs-h) + 10px + env(safe-area-inset-bottom)); z-index: 35;
  background: var(--surface); color: var(--ink); border-radius: 8px; border-top: 6px solid #9e1b1f;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 14px 14px 12px; max-height: 70vh; overflow-y: auto; animation: up .25s ease-out; }
.survey h2 { font: 900 17px Inter, sans-serif; text-transform: uppercase; margin: 0; }
.sv-sub { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.survey fieldset { border: 0; padding: 0; margin: 8px 0 0; }
.survey legend { font: 700 13px Inter, sans-serif; margin-bottom: 6px; padding: 0; }
.survey .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.survey .opts button { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; padding: 7px 10px;
  font: 600 13px Inter, sans-serif; cursor: pointer; }
.survey .opts button.on { background: #9e1b1f; border-color: #9e1b1f; color: #fff; }
.sv-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 12px; }
.sv-actions .btn:disabled { opacity: .45; cursor: default; }
@media (min-width: 900px) { .survey { left: auto; right: 24px; bottom: 84px; width: 420px; } }
