/* Viaje a Tailandia — hoja de estilos (autónoma, sin build)
 *
 * «Taxi de Bangkok». Los taxis rosas y los tuk-tuk lima de la ciudad, sobre
 * tinta azul noche y papel lavanda: paneles planos con contorno de tinta y
 * sombra dura, como la cartelería y las chapas esmaltadas. Sin degradados ni
 * sombras difusas. Vuelos = tarjeta de embarque, días = talón numerado,
 * itinerario = carretera con línea central, mapas = chapas numeradas.
 * Tipografía: Bricolage Grotesque (títulos y cifras) · Figtree (texto).
 */

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  color-scheme: light;

  --paper:   #f1eef7;   /* asfalto claro: fondo de página */
  --paper-2: #f8f6fc;   /* fondo de listas dentro de paneles */
  --card:    #ffffff;
  --ink:     #161a3c;   /* tinta azul noche fija: texto y relleno sobre los colores vivos */
  --text:    #161a3c;   /* texto sobre papel y tarjetas (cambia con el tema) */
  --ink-2:   #494e78;   /* texto secundario */
  --line:    #d8d3e8;   /* separadores suaves */
  --edge:    #161a3c;   /* contornos */
  --shadow-c:#161a3c;   /* sombras duras */
  --night:   #161a3c;   /* rellenos oscuros: barra superior, carretera, cabeceras */
  --map-bg:  #e4daf3;

  --pink:      #ff3d95; /* taxi rosa: acción principal */
  --pink-deep: #c20f63; /* rosa para texto sobre claro */
  --pink-soft: #ffdcec;
  --lime:      #ccf62f; /* tuk-tuk: énfasis, estrellas, «hoy» */
  --lime-soft: #f0fcbf;
  --lime-deep: #4f6d00;
  --blue:      #4c7dff; /* taxi azul: vuelos y transporte */
  --blue-soft: #dde6ff;
  --blue-deep: #2549bd;
  --orange:      #ff9f1c; /* taxi naranja: dinero y avisos */
  --orange-soft: #ffe8c4;
  --orange-deep: #9a5600;
  --danger:      #d91f3c;
  --danger-soft: #ffdde2;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --step--1: 0.8125rem;
  --step-0:  0.9rem;
  --step-1:  1rem;
  --step-2:  1.125rem;
  --step-3:  1.5rem;
  --step-4:  2.3rem;

  --space-4:  0.25rem;
  --space-6:  0.375rem;
  --space-8:  0.5rem;
  --space-10: 0.625rem;
  --space-12: 0.75rem;
  --space-16: 1rem;
  --space-20: 1.25rem;
  --space-24: 1.5rem;
  --space-32: 2rem;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-pill: 999px;

  --pop-s: 2px 2px 0 var(--shadow-c);
  --pop:   3px 3px 0 var(--shadow-c);
  --pop-l: 5px 5px 0 var(--shadow-c);
  --stroke: 2px solid var(--edge);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.3, 1.6, 0.5, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;

  --appbar-h: 60px;
  --tabbar-h: 64px;
  --maxw: 640px;
  --gutter: max(var(--space-16), env(safe-area-inset-left));
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-1);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 84%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--pink-deep); text-underline-offset: 3px; }
.mono { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); font-size: var(--step-1); }
::-webkit-scrollbar { width: 0; height: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--lime); color: var(--ink); }

/* ============================================================
   BARRA SUPERIOR
   ============================================================ */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-10);
  height: calc(env(safe-area-inset-top) + var(--appbar-h));
  padding: env(safe-area-inset-top) max(var(--space-16), env(safe-area-inset-right)) 0 var(--gutter);
  background: var(--night);
  color: #fff;
  border-bottom: 3px solid var(--pink);
}
.theme-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 2px solid #b9bce0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease-pop), background var(--dur-1) var(--ease-out);
}
.theme-btn:active { transform: scale(0.9) rotate(-20deg); background: rgba(255, 255, 255, 0.14); }
.theme-btn:focus-visible { outline-color: var(--lime); }
.appbar__logo { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; }
.appbar__text { flex: 1; min-width: 0; }
.appbar__title {
  font-size: var(--step-2);
  font-stretch: 90%;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar__sub {
  margin-top: 2px;
  font-size: var(--step--1);
  color: #b9bce0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Cuenta atrás: el piloto del techo del taxi */
.appbar__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px 6px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-0);
  white-space: nowrap;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--lime);
}
.appbar__count svg { flex-shrink: 0; }
.appbar__count[hidden] { display: none; }
.appbar__count.is-live { background: var(--pink); box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--pink); }
.appbar__count.is-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  animation: lamp 1.6s steps(2, jump-none) infinite;
}
@keyframes lamp { 50% { opacity: 0.2; } }

/* ============================================================
   ESTRUCTURA
   ============================================================ */
main {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: var(--space-24) max(var(--space-16), env(safe-area-inset-right)) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-32)) var(--gutter);
}
.screen[hidden] { display: none; }
.screen { animation: enter var(--dur-3) var(--ease-out); }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }

.screen-head { margin-bottom: var(--space-20); }
.screen-head h2 { font-size: var(--step-4); line-height: 0.95; }
.screen-head .muted { margin-top: var(--space-10); max-width: 44ch; }

/* ============================================================
   BARRA DE PESTAÑAS
   ============================================================ */
.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: var(--stroke);
}
.tab {
  appearance: none;
  border: 2px solid transparent;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: calc(var(--tabbar-h) - 12px);
  padding: 4px 2px;
  border-radius: var(--radius-m);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  font-stretch: 90%;
  white-space: nowrap;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] {
  color: var(--ink);
  background: var(--pink);
  border-color: var(--edge);
  box-shadow: var(--pop-s);
}
.tab:active { transform: translateY(1px); }
.tab:focus-visible { outline-offset: 0; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  --_bg: var(--card);
  --_fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: 48px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-stretch: 90%;
  white-space: nowrap;
  color: var(--_fg);
  background: var(--_bg);
  border: var(--stroke);
  border-radius: var(--radius-m);
  box-shadow: var(--pop);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.btn svg { flex-shrink: 0; }
.btn--accent { --_bg: var(--pink); --_fg: var(--ink); }
.btn--ghost  { --_bg: var(--card); }
.btn--danger { --_bg: var(--danger-soft); --_fg: var(--danger); }
.btn--block  { width: 100%; }
.btn--sm     { min-height: 38px; padding: 6px 14px; font-size: var(--step-0); border-radius: var(--radius-s); box-shadow: var(--pop-s); }
.btn:active  { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-c); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
@media (hover: hover) { .btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-c); } .btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-c); } }

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text);
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-s);
  box-shadow: var(--pop-s);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.icon-btn--danger { color: var(--danger); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-c); }

/* ============================================================
   DATOS
   ============================================================ */
.card {
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-m);
  padding: var(--space-16);
  margin-bottom: var(--space-12);
}
.card--pass { padding: 0; background: none; border: 0; }
.card--pass .item__main { min-width: 0; }

/* Cabecera del viaje: el panel rosa */
.trip-hero {
  margin-bottom: var(--space-20);
  padding: var(--space-20);
  color: var(--ink);
  background: var(--pink);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop-l);
}
.trip-hero__title { font-size: var(--step-4); line-height: 0.92; }
.trip-hero__dates { margin-top: var(--space-8); font-size: var(--step-2); font-weight: 600; }
.trip-hero__stats { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-16); }
.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 13px;
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
}
.stat b { font-family: var(--font-display); font-size: var(--step-2); font-weight: 800; }

/* Bloques plegables */
.group {
  --gc: var(--pink);
  margin-bottom: var(--space-16);
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop);
  overflow: hidden;
}
.group__head {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-10) var(--space-12);
  background: none;
  border: 0;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 84%;
  letter-spacing: -0.02em;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.group__head:focus-visible { outline-offset: -4px; }
.group__label { display: inline-flex; align-items: center; gap: var(--space-12); min-width: 0; }
.group__ico {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: 19px;
  line-height: 1;
  background: var(--gc);
  border: 2px solid var(--edge);
  border-radius: 12px;
}
.group__right { display: inline-flex; align-items: center; gap: var(--space-10); flex-shrink: 0; }
.count {
  color: var(--ink);
  min-width: 28px;
  padding: 1px 9px;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 800;
  text-align: center;
  color: var(--ink);
  background: var(--lime);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
}
.chev { display: grid; transition: transform var(--dur-2) var(--ease-out); }
.group__head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.group__body { padding: var(--space-12); background: var(--paper-2); border-top: var(--stroke); }
.group__body[hidden] { display: none; }
.group__body > .btn { margin-top: var(--space-4); }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: flex-start; gap: var(--space-12); }
.item__main { flex: 1; min-width: 0; }
.item__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-8);
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 90%;
  font-size: var(--step-2);
  line-height: 1.2;
}
.item__meta { margin-top: 3px; color: var(--ink-2); font-size: var(--step-0); line-height: 1.5; overflow-wrap: anywhere; }
.item__acts { display: flex; gap: var(--space-6); flex-shrink: 0; }

.empty { padding: var(--space-12) var(--space-4); color: var(--ink-2); }
.notice {
  position: relative;
  margin-bottom: var(--space-16);
  padding: var(--space-12) var(--space-16) var(--space-12) calc(var(--space-16) + 32px);
  background: var(--lime-soft);
  border: var(--stroke);
  border-radius: var(--radius-m);
  font-size: var(--step-0);
  line-height: 1.55;
}
.notice::before {
  content: "i";
  color: var(--ink);
  position: absolute;
  left: var(--space-12);
  top: var(--space-12);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  background: var(--lime);
  border: 2px solid var(--edge);
  border-radius: 50%;
}

.prio {
  padding: 1px 9px;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
  background: var(--card);
}
.prio--alta  { background: var(--danger-soft); color: var(--danger); }
.prio--media { background: var(--blue-soft); color: var(--blue-deep); }
.prio--baja  { color: var(--ink-2); }

/* Listas de comprobación */
.equipaje-cat {
  margin: var(--space-16) 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-stretch: 90%;
}
.equipaje-cat:first-child { margin-top: var(--space-4); }
.equipaje-list { display: flex; flex-direction: column; }
.equipaje-row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-height: 48px;
  padding: var(--space-4) 0;
  border-bottom: 1.5px dashed var(--line);
  cursor: pointer;
}
.equipaje-list .equipaje-row:last-child { border-bottom: 0; }
.equipaje-row input[type="checkbox"] {
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: var(--card);
  border: 2px solid var(--edge);
  border-radius: 8px;
  transition: background var(--dur-1) var(--ease-out);
}
.equipaje-row input[type="checkbox"]::after {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform var(--dur-2) var(--ease-pop);
}
.equipaje-row input[type="checkbox"]:checked { background: var(--lime); }
.equipaje-row input[type="checkbox"]:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.equipaje-row span { flex: 1; line-height: 1.4; }
.equipaje-row--done span { color: var(--ink-2); text-decoration: line-through; }
.equipaje-row__del { margin-left: auto; flex-shrink: 0; width: 36px; height: 36px; }
.equipaje-add { display: flex; gap: var(--space-8); margin-top: var(--space-16); }
.equipaje-add input { flex: 1; }
.ante-fecha { font-size: var(--step--1); color: var(--ink-2); }

/* Gastos */
.gasto-resumen { padding: 0 var(--space-4) var(--space-12); margin-bottom: var(--space-8); border-bottom: 1.5px dashed var(--edge); }
.gasto-resumen__tot { margin: 0 0 var(--space-8); font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; }
.gasto-cat { display: flex; justify-content: space-between; gap: var(--space-12); margin: 3px 0; font-size: var(--step-0); color: var(--ink-2); }
.fx-line { margin: var(--space-12) 0 0; font-size: var(--step--1); color: var(--ink-2); }
.fx-line__rate {
  width: 5.5em;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-s);
  padding: 2px 6px;
}
.gasto-amt { display: flex; gap: var(--space-8); align-items: baseline; flex-wrap: wrap; }
.chip--cat {
  display: inline-block;
  padding: 1px 9px;
  font-size: var(--step--1);
  font-weight: 600;
  background: var(--orange-soft);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
}

/* Tarjeta de embarque */
.pass {
  --notch: var(--paper-2);
  margin-bottom: var(--space-12);
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop);
  overflow: hidden;
}
.pass__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-16);
  color: var(--ink);
  background: var(--blue);
}
.pass__route { display: flex; align-items: center; gap: var(--space-10); font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1; letter-spacing: -0.02em; }
.pass__route svg { flex-shrink: 0; }
.pass__tipo {
  padding: 3px 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-0);
  color: var(--lime);
  background: var(--night);
  border-radius: var(--radius-pill);
}
.pass__tear { position: relative; height: 0; border-top: 2px dashed var(--edge); }
.pass__tear::before, .pass__tear::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 20px;
  height: 20px;
  background: var(--notch);
  border: 2px solid var(--edge);
  border-radius: 50%;
}
.pass__tear::before { left: -12px; }
.pass__tear::after  { right: -12px; }
.pass__body { padding: var(--space-16); }
.fly-summary { font-size: var(--step-1); color: var(--ink-2); }
.fly-summary b { color: var(--text); font-family: var(--font-display); font-size: var(--step-2); }
.fly-legs { display: flex; flex-direction: column; gap: var(--space-8); margin: var(--space-12) 0; }
.fly-leg { padding: var(--space-10) var(--space-12); background: var(--blue-soft); border: 1.5px solid var(--edge); border-radius: var(--radius-s); }
.fly-leg__head { margin-bottom: var(--space-4); font-size: var(--step--1); color: var(--ink-2); }
.fly-leg__head .mono { color: var(--blue-deep); }
.fly-leg__route { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px var(--space-8); font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; }
.fly-leg__route em { font-style: normal; font-size: var(--step--1); color: var(--blue-deep); }
.fly-leg__arrow { color: var(--ink-2); }
.fly-leg__dur { margin-top: 2px; font-size: var(--step--1); color: var(--ink-2); }
.fly-lay {
  align-self: center;
  padding: 3px 12px;
  font-size: var(--step--1);
  font-weight: 600;
  background: var(--card);
  border: 1.5px dashed var(--edge);
  border-radius: var(--radius-pill);
}
.fly-alert {
  margin: var(--space-8) 0;
  padding: var(--space-10) var(--space-12);
  color: var(--ink);
  background: var(--lime);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-s);
  line-height: 1.45;
}
.fly-bags { margin-top: var(--space-8); }
.fly-bags summary { cursor: pointer; font-weight: 700; list-style: none; }
.fly-bags summary::-webkit-details-marker { display: none; }
.fly-bags summary::after { content: " ▾"; color: var(--ink-2); }
.fly-bags p {
  margin: var(--space-8) 0 0;
  padding: var(--space-12);
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--ink-2);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Coche de alquiler */
.coche-whens { display: grid; gap: var(--space-8); margin: var(--space-12) 0; }
.coche-when { padding: var(--space-10) var(--space-12); background: var(--paper-2); border: 1.5px solid var(--edge); border-radius: var(--radius-s); }
.coche-when.is-in  { background: var(--lime-soft); }
.coche-when.is-out { background: var(--blue-soft); }
.coche-when__lbl { font-size: var(--step--1); font-weight: 700; color: var(--ink-2); }
.coche-when__val { margin-top: 1px; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); }
.coche-when__loc { margin-top: 2px; color: var(--ink-2); font-size: var(--step-0); }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.field { display: block; margin-bottom: var(--space-16); }
.field > span, .field > label, label.field > span { display: block; }
.field span, .field > label { margin-bottom: var(--space-6); font-size: var(--step-0); font-weight: 700; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-10); }

input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px; /* evita el zoom automático en iOS */
  color: var(--text);
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  appearance: none;
  -webkit-appearance: none;
}
input.mono { font-family: var(--font-display); }
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23161a3c' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
input::placeholder, textarea::placeholder { color: #8b8fb3; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  background: var(--lime-soft);
  box-shadow: var(--pop-s);
}
input[type="date"], input[type="time"], input[type="datetime-local"] { min-height: 48px; }

.loc { display: grid; gap: var(--space-8); }
.loc__row { display: flex; gap: var(--space-8); }
.loc__row .loc__text { flex: 1; min-width: 0; }
.loc__btn { flex-shrink: 0; }
.loc__status { font-size: var(--step--1); color: var(--ink-2); }
.loc__status.is-set { color: var(--lime-deep); font-weight: 700; }
.loc__adv { font-size: var(--step-0); }
.loc__adv summary { padding: var(--space-4) 0; color: var(--ink-2); cursor: pointer; list-style: none; }
.loc__adv summary::-webkit-details-marker { display: none; }
.loc__adv summary::before { content: "▸ "; }
.loc__adv[open] summary::before { content: "▾ "; }
.loc__adv input { margin-top: var(--space-6); }

.tramos { margin-bottom: var(--space-12); }
.tramo { margin-bottom: var(--space-12); padding: var(--space-12); background: var(--paper-2); border: 1.5px solid var(--edge); border-radius: var(--radius-m); }
.tramo .field:last-child { margin-bottom: 0; }
.tramo__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-12); font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); }

/* ============================================================
   FILTROS
   ============================================================ */
.chips {
  display: flex;
  gap: var(--space-8);
  margin: 0 calc(-1 * var(--gutter)) var(--space-16);
  padding: 3px var(--gutter) 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding-inline: var(--gutter);
}
.chip {
  appearance: none;
  flex-shrink: 0;
  padding: 7px 15px;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  font-stretch: 90%;
  white-space: nowrap;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--edge);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.chip[aria-pressed="true"] { color: var(--lime); background: var(--night); }
.chip:active { transform: translateY(1px); }
.chip:disabled { opacity: 0.4; cursor: default; }

/* ============================================================
   ITINERARIO
   ============================================================ */
.ruta { margin-bottom: var(--space-24); }
.ruta__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-4) var(--space-12); margin-bottom: var(--space-10); }
.ruta__head h3 { font-size: var(--step-3); }
.ruta__stats { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.ruta__stats .stat { padding: 3px 11px; }

.day { margin-bottom: var(--space-32); }

/* Cada día es un talón: número a la izquierda, fecha a la derecha */
.day__head { display: flex; align-items: stretch; margin-bottom: var(--space-16); filter: drop-shadow(var(--pop)); }
.day__badge {
  flex: 0 0 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-8) 0;
  font-family: var(--font-display);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 0.9;
  color: var(--ink);
  background: var(--lime);
  border: var(--stroke);
  border-right: 0;
  border-radius: var(--radius-l) 0 0 var(--radius-l);
}
.day__badge small { font-size: var(--step--1); font-weight: 700; line-height: 1; }
.day__titles {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-10) var(--space-16);
  background: var(--card);
  border: var(--stroke);
  border-left: 2px dashed var(--edge);
  border-radius: 0 var(--radius-l) var(--radius-l) 0;
}
.day__titles::before, .day__titles::after {
  content: "";
  position: absolute;
  left: -11px;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border: 2px solid var(--edge);
  border-radius: 50%;
}
.day__titles::before { top: -11px; clip-path: inset(50% 0 0 0); }
.day__titles::after  { bottom: -11px; clip-path: inset(0 0 50% 0); }
.day__date { font-size: var(--step-3); line-height: 1; }
.day__wd { margin-top: 3px; font-size: var(--step-0); font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.day__now {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step--1);
  color: var(--ink);
  background: var(--pink);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
}
.day--hoy > .day__head .day__badge { background: var(--pink); }
.day__actions { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-16); }
.day__actions .btn { flex: 1 1 auto; min-height: 42px; font-size: var(--step-0); }

.day-plan, .day-out, .day-rain { margin: 0 0 var(--space-6); font-size: var(--step-0); line-height: 1.5; color: var(--ink-2); }
.day-plan .mono { color: var(--text); }
.day-out--malo, .day-rain--aviso { color: var(--orange-deep); font-weight: 600; }
.day-rain--fuerte { color: var(--danger); font-weight: 700; }
.day-plan + .timeline, .day-out + .timeline, .day-rain + .timeline { margin-top: var(--space-16); }
.day-verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.day-verdict::before { content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: currentColor; border: 1.5px solid var(--edge); }
.day-verdict--verde { color: var(--lime-deep); }
.day-verdict--ambar { color: var(--orange-deep); }
.day-verdict--rojo  { color: var(--danger); }

.hoy-card {
  margin-bottom: var(--space-20);
  padding: var(--space-16);
  background: var(--pink-soft);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop);
}
.hoy-card__head { margin: 0 0 var(--space-8); font-family: var(--font-display); font-size: var(--step-3); font-weight: 800; font-stretch: 84%; line-height: 1.05; }
.hoy-card__plan, .hoy-card__rain, .hoy-card__out { margin: var(--space-4) 0 0; font-size: var(--step-0); line-height: 1.5; }
.hoy-card__rain--fuerte { color: var(--danger); font-weight: 700; }

.itin-outlook { margin-bottom: var(--space-16); padding: var(--space-12) var(--space-16); background: var(--blue-soft); border: 1.5px solid var(--edge); border-radius: var(--radius-m); font-size: var(--step-0); }
.itin-outlook[hidden] { display: none; }
.itin-outlook p { margin: 0; }
.itin-outlook p + p { margin-top: var(--space-6); color: var(--ink-2); }

.day-diario { margin-top: var(--space-16); }
.day-diario__label { margin: 0 0 var(--space-6); font-family: var(--font-display); font-size: var(--step-2); font-weight: 800; font-stretch: 90%; }

/* Línea de tiempo: una carretera con su línea central */
.timeline { display: flex; flex-direction: column; }
.slot {
  --slot-c: var(--pink);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: var(--space-10);
}
.slot--vuelo, .slot--coche { --slot-c: var(--blue); }
.slot--checkin, .slot--checkout { --slot-c: var(--pink); }
.slot--comida { --slot-c: var(--lime); }
.slot--lugar  { --slot-c: var(--orange); }
.slot--noche  { --slot-c: var(--card); }
.slot__time {
  padding-top: 2px;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.slot__body { position: relative; padding: 0 0 var(--space-24) 30px; }
.slot__body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  width: 10px;
  background:
    repeating-linear-gradient(to bottom, var(--lime) 0 6px, transparent 6px 13px) center / 2px 100% no-repeat,
    var(--night);
}
.slot:first-child .slot__body::before { border-radius: 5px 5px 0 0; top: 4px; }
.slot:last-child .slot__body::before { border-radius: 0 0 5px 5px; bottom: 12px; }
.slot:last-child .slot__body { padding-bottom: var(--space-4); }
.slot__body::after {
  content: "";
  position: absolute;
  left: -11px;
  top: 1px;
  width: 22px;
  height: 22px;
  background: var(--slot-c);
  border: 2.5px solid var(--edge);
  border-radius: 50%;
}
.slot--quiet .slot__title { color: var(--ink-2); font-weight: 700; }

.slot__tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 9px;
  font-size: var(--step--1);
  font-weight: 700;
  background: color-mix(in srgb, var(--slot-c) 45%, var(--card));
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
}
.slot__title { font-family: var(--font-display); font-weight: 800; font-stretch: 88%; font-size: var(--step-3); line-height: 1.1; }
.slot__sub { margin-top: 4px; color: var(--ink-2); line-height: 1.45; }
.slot__notes { margin-top: var(--space-8); font-size: var(--step-0); }
.slot__notes summary { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--pink-deep); cursor: pointer; list-style: none; }
.slot__notes summary::-webkit-details-marker { display: none; }
.slot__notes summary::before { content: "+"; display: grid; place-items: center; width: 18px; height: 18px; font-size: 14px; line-height: 1; color: var(--ink); background: var(--pink); border: 1.5px solid var(--edge); border-radius: 50%; }
.slot__notes[open] summary::before { content: "–"; }
.slot__notes p {
  margin: var(--space-8) 0 0;
  padding: var(--space-10) var(--space-12);
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-s);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.slot__nav { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-10); }
.slot__go, .reco-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 13px;
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
  box-shadow: var(--pop-s);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.slot__go:active, .reco-link:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-c); }

/* Fotos: marco de tinta con la explicación integrada */
.slot__foto-wrap, .slot__opcion-foto-wrap {
  margin: var(--space-12) 0 0;
  overflow: hidden;
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-m);
  box-shadow: var(--pop);
}
.slot__foto, .slot__opcion-foto {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--line);
  border-bottom: var(--stroke);
}
.slot__foto-caption, .slot__opcion-foto-caption { margin: 0; padding: var(--space-8) var(--space-12) var(--space-10); font-size: var(--step-0); line-height: 1.5; }

/* «Elige una opción» */
.slot__opciones {
  margin-top: var(--space-16);
  padding: var(--space-12);
  background: var(--lime-soft);
  border: 2px dashed var(--edge);
  border-radius: var(--radius-m);
}
.slot__opciones-label {
  display: inline-block;
  margin: 0 0 var(--space-12);
  padding: 3px 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-2);
  color: var(--ink);
  background: var(--pink);
  border: 2px solid var(--edge);
  border-radius: var(--radius-pill);
  box-shadow: var(--pop-s);
}
.slot__opcion { margin-bottom: var(--space-10); padding: var(--space-12); background: var(--card); border: 1.5px solid var(--edge); border-radius: var(--radius-s); }
.slot__opcion:last-child { margin-bottom: 0; }
.slot__opcion-nombre { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); }
.slot__opcion-notas { margin-top: 2px; color: var(--ink-2); font-size: var(--step-0); }
.slot__opcion .slot__opcion-foto-wrap { box-shadow: none; border-width: 1.5px; border-radius: var(--radius-s); }
.slot__opcion .slot__opcion-foto { border-bottom-width: 1.5px; }

.leg { display: flex; align-items: center; gap: var(--space-6); margin: -8px 0 var(--space-12) 84px; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }

/* ============================================================
   MAPAS (Comer, Muay Thai, ruta)
   ============================================================ */
.zmap {
  height: 224px;
  position: sticky;
  top: calc(env(safe-area-inset-top) + var(--appbar-h) + 10px);
  z-index: 5;
  isolation: isolate;
  background: var(--map-bg);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop-l);
  overflow: hidden;
}
.zmap--flat { position: relative; top: auto; height: 300px; }
@media (max-height: 700px) { .zmap { height: 170px; } .zmap--flat { height: 240px; } }

/* Los mapas se tiñen de lavanda: teselas en gris multiplicadas sobre el fondo */
.leaflet-container { font-family: var(--font-body); background: var(--map-bg); }
.leaflet-tile-pane { filter: grayscale(1) contrast(0.92) brightness(1.06); mix-blend-mode: multiply; }
.leaflet-bar { border: 2px solid var(--edge) !important; border-radius: 10px !important; box-shadow: var(--pop-s) !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { width: 32px; height: 32px; line-height: 30px; font-family: var(--font-display); font-weight: 800; color: var(--text); background: var(--card); border-bottom: 1.5px solid var(--edge); }
.leaflet-bar a:last-child { border-bottom: 0; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,0.75) !important; color: var(--ink-2) !important; }
.leaflet-control-attribution a { color: var(--text) !important; }
.leaflet-popup-content-wrapper { color: var(--text); background: var(--card); border: 2px solid var(--edge); border-radius: 12px; box-shadow: var(--pop); }
.leaflet-popup-tip { background: var(--edge); box-shadow: none; }
.leaflet-popup-content { margin: 10px 14px; font-size: var(--step-0); line-height: 1.4; }
.leaflet-popup-content b { font-family: var(--font-display); font-size: var(--step-2); }
.leaflet-popup-content small { display: block; color: var(--ink-2); }
.leaflet-container a.leaflet-popup-close-button { color: var(--text); }

/* Chapas numeradas */
.mpin {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
  background: var(--pink);
  border: 2.5px solid var(--edge);
  border-radius: 50%;
  box-shadow: var(--pop-s);
  animation: pinDrop 480ms var(--ease-pop) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: transform var(--dur-2) var(--ease-pop);
}
.mpin--star { background: var(--lime); }
.mpin--mt   { background: var(--orange); }
.mpin--stop { background: var(--lime); width: 36px; height: 36px; font-size: 17px; }
.mpin--home { background: var(--night); color: var(--lime); border-radius: 10px; }
.mpin.is-active { transform: scale(1.35); }
.leaflet-marker-icon:has(.is-active) { z-index: 900 !important; }
@keyframes pinDrop { from { transform: translateY(-26px) scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
.route-line { stroke: var(--pink-deep); animation: march 900ms linear infinite; }
.map-ring { stroke: var(--edge); fill: var(--pink); }
.map-ring--in { fill-opacity: 0.16; }
.map-ring--out { fill-opacity: 0.07; }
.map-road { stroke: var(--night); }
@keyframes march { to { stroke-dashoffset: -28; } }

.city-tip {
  padding: 2px 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  color: var(--lime);
  background: var(--night);
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: none;
}
.city-tip::before { border-color: transparent !important; }
.leaflet-tooltip-left.city-tip::before { border-left-color: var(--night) !important; }
.leaflet-tooltip-right.city-tip::before { border-right-color: var(--night) !important; }
.leaflet-tooltip-top.city-tip::before { border-top-color: var(--night) !important; }
.ring-key { display: flex; align-items: center; gap: 6px; padding: 3px 9px; font-size: 11px; font-weight: 700; color: var(--text); background: color-mix(in srgb, var(--card) 88%, transparent); border: 1.5px solid var(--edge); border-radius: var(--radius-pill); }
.ring-key::before { content: ""; width: 12px; height: 12px; background: rgba(255, 61, 149, 0.15); border: 1.5px dashed var(--edge); border-radius: 50%; }

/* ============================================================
   DÓNDE COMER · MUAY THAI
   ============================================================ */
.zona { margin-bottom: var(--space-32); }
.zona__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-12);
  padding: var(--space-16) var(--space-16) var(--space-20);
  margin-bottom: var(--space-12);
  color: #fff;
  background: var(--night);
  border: var(--stroke);
  border-radius: var(--radius-l);
}
.zona__nombre { font-size: 2.6rem; line-height: 0.9; font-stretch: 80%; }
.zona__fechas {
  padding: 3px 13px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--lime);
  border-radius: var(--radius-pill);
}
.zona__intro { margin: var(--space-16) 0 var(--space-4); color: var(--ink-2); line-height: 1.6; }

/* Ciudades plegables de Comer: la cabecera es el botón */
.zona--fold:not([open]) { margin-bottom: var(--space-16); }
.zona--fold > summary { position: relative; padding-right: 64px; list-style: none; cursor: pointer; }
.zona--fold > summary::-webkit-details-marker { display: none; }
.zona--fold:not([open]) > summary { margin-bottom: 0; }
.zona--fold > summary:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.zona__cuenta { flex-basis: 100%; font-size: var(--step--1); font-weight: 700; color: rgba(255, 255, 255, 0.72); }
.zona__chev {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  background: var(--lime);
  border: 2px solid var(--edge);
  border-radius: 50%;
  transition: transform var(--dur-2) var(--ease-out);
}
.zona--fold[open] .zona__chev { transform: rotate(180deg); }
.zona .zmap { margin-bottom: 0; }

/* ============================================================
   QUÉ VER · bloques plegables (Transporte y guías, Muay Thai)
   ============================================================ */
.qv {
  margin-bottom: var(--space-16);
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop);
}
.qv > summary { list-style: none; cursor: pointer; }
.qv > summary::-webkit-details-marker { display: none; }
.qv__head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 36px;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-l);
}
.qv__head:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.qv__ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 26px;
  background: var(--lime);
  border: var(--stroke);
  border-radius: var(--radius-m);
  box-shadow: var(--pop-s);
}
#qv-muaythai .qv__ico { background: var(--blue-soft); }
.qv__title { font-size: var(--step-3); }
.qv__sub { display: block; margin-top: var(--space-4); font-size: var(--step-0); line-height: 1.4; color: var(--ink-2); }
.qv__chev {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  background: var(--lime);
  border: 2px solid var(--edge);
  border-radius: 50%;
  transition: transform var(--dur-2) var(--ease-out);
}
.qv[open] .qv__chev { transform: rotate(180deg); }
.qv[open] > .qv__head { border-bottom: 2px dashed var(--edge); border-radius: var(--radius-l) var(--radius-l) 0 0; }
.qv__body { padding: var(--space-16); }
.qv[open] .qv__body { animation: enter var(--dur-3) var(--ease-out); }

/* ============================================================
   LA HORA TAZ · sección bloqueada
   ============================================================ */
/* La cara de Taz es más grande que los demás iconos y asoma por encima de
   la barra como una chapa, para que se distinga bien. */
.tab__taz {
  width: 38px;
  height: 38px;
  margin-top: -16px;
  background: var(--lime);
  border: 2.5px solid var(--edge);
  border-radius: 50%;
  box-shadow: var(--pop-s);
}
.tab--taz[aria-current="page"] .tab__taz { animation: tazSpin 0.7s var(--ease-out); }
@keyframes tazSpin { from { transform: rotate(-720deg) scale(0.6); } to { transform: none; } }

.taz__stage {
  overflow: hidden;
  background: var(--night);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop-l);
}
.taz__gif { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.taz__lock {
  position: relative;
  margin-top: var(--space-20);
  padding: var(--space-32) var(--space-16) var(--space-20);
  text-align: center;
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop);
  overflow: hidden;
}
/* Cinta de «prohibido el paso» */
.taz__lock::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 12px;
  background: repeating-linear-gradient(-45deg, var(--orange) 0 12px, var(--ink) 12px 24px);
  border-bottom: 2px solid var(--edge);
}
.taz__padlock {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  color: var(--ink);
  background: var(--orange);
  border: var(--stroke);
  border-radius: 50%;
  box-shadow: var(--pop-s);
}
.taz__lock-title { margin-top: var(--space-12); font-family: var(--font-display); font-size: var(--step-3); font-weight: 800; font-stretch: 84%; }
.taz__lock-sub { margin-top: var(--space-6); color: var(--ink-2); }
.taz__teaser { display: grid; gap: var(--space-12); margin-top: var(--space-20); }
.taz__ghost {
  position: relative;
  height: 74px;
  background:
    linear-gradient(var(--line), var(--line)) 16px 18px / 55% 14px no-repeat,
    linear-gradient(var(--line), var(--line)) 16px 44px / 35% 10px no-repeat,
    var(--card);
  border: 2px dashed var(--ink-2);
  border-radius: var(--radius-m);
  opacity: 0.6;
  filter: blur(1.5px);
}
.taz__ghost::after {
  content: "🔒";
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 22px;
}

.sub-label { display: flex; align-items: center; gap: var(--space-10); margin: var(--space-24) 0 var(--space-12); font-family: var(--font-display); font-size: var(--step-2); font-weight: 800; font-stretch: 88%; }
.sub-label::after { content: ""; flex: 1; height: 0; border-top: 2px dashed var(--edge); }
.sub-label--star::before { content: "★"; color: var(--ink); display: grid; place-items: center; width: 26px; height: 26px; font-size: 14px; background: var(--lime); border: 2px solid var(--edge); border-radius: 50%; }

.venue {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-12);
  padding: var(--space-12);
  scroll-margin-top: calc(env(safe-area-inset-top) + var(--appbar-h) + 260px);
  background: var(--card);
  border: var(--stroke);
  border-radius: var(--radius-m);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out);
}
.venue.is-active { background: var(--pink-soft); box-shadow: var(--pop); transform: translate(-2px, -2px); }
.venue__n {
  appearance: none;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-3);
  color: var(--ink);
  background: var(--pink);
  border: 2.5px solid var(--edge);
  border-radius: 50%;
  box-shadow: var(--pop-s);
  cursor: pointer;
}
.venue--star .venue__n { background: var(--lime); }
.venue--mt .venue__n { background: var(--orange); }
.venue__n:active { transform: translate(2px, 2px); box-shadow: none; }
.venue__nombre { font-family: var(--font-display); font-weight: 800; font-stretch: 88%; font-size: var(--step-3); line-height: 1.1; }
.venue__stars { color: var(--ink); display: inline-block; margin-right: 4px; padding: 0 8px; font-size: var(--step-1); letter-spacing: 1px; background: var(--lime); border: 1.5px solid var(--edge); border-radius: var(--radius-pill); vertical-align: 2px; }
.venue__dias { color: var(--ink); margin-top: var(--space-8); padding: 6px 12px; font-weight: 700; line-height: 1.35; background: var(--lime); border: 1.5px solid var(--edge); border-radius: var(--radius-s); }
.venue__meta { margin-top: 4px; color: var(--ink-2); font-size: var(--step-0); line-height: 1.5; }
.venue__facts { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-8); }
.fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  font-size: var(--step--1);
  font-weight: 700;
  background: var(--paper-2);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-pill);
}
.fact svg { flex-shrink: 0; }
.fact--price { background: var(--orange-soft); }
.fact--dist  { background: var(--blue-soft); }
.fact--day   { color: var(--ink); background: var(--lime); font-size: var(--step-0); }
.venue__go { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-12); }
.venue__go .reco-link--map { background: var(--pink); }
.venue .slot__foto-wrap { margin-top: var(--space-12); }
.venue__body { min-width: 0; }
.aloj-link { margin-top: var(--space-12); text-decoration: none; }

/* ============================================================
   TRANSPORTE Y GUÍAS
   ============================================================ */
.reco-cat { --rc: var(--pink); margin-bottom: var(--space-24); }
.reco-cat:nth-of-type(4n+2) { --rc: var(--blue); }
.reco-cat:nth-of-type(4n+3) { --rc: var(--lime); }
.reco-cat:nth-of-type(4n)   { --rc: var(--orange); }
.reco-cat[hidden] { display: none; }
/* Cada bloque abre con un cartel de color, como la rotulación de una parada */
.reco-cat__head {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
  padding: var(--space-8) var(--space-16) var(--space-8) var(--space-8);
  color: var(--ink);
  background: var(--rc);
  border: var(--stroke);
  border-radius: var(--radius-l);
  box-shadow: var(--pop);
}
.reco-cat__badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 22px;
  color: var(--ink);
  background: var(--card);
  border: var(--stroke);
  border-radius: 50%;
}
.reco-cat__head h3 { font-size: var(--step-3); }
.reco-cat__list { display: grid; gap: var(--space-8); }
.reco-card {
  position: relative;
  padding: var(--space-12) var(--space-16);
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-m);
  line-height: 1.55;
}
.reco-card::before { content: ""; position: absolute; left: -1.5px; top: 14px; bottom: 14px; width: 6px; background: var(--rc); border: 1.5px solid var(--edge); border-left: 0; border-radius: 0 6px 6px 0; }
.reco-cat--mine { margin-top: var(--space-8); padding-top: var(--space-24); border-top: 2px dashed var(--edge); }
.reco-empty { padding: var(--space-16); text-align: center; color: var(--ink-2); background: var(--paper-2); border: 2px dashed var(--edge); border-radius: var(--radius-m); }
.reco-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8) var(--space-12); margin-top: var(--space-8); }
.reco-chip { padding: 2px 11px; font-family: var(--font-display); font-weight: 700; font-size: var(--step--1); background: var(--pink-soft); border: 1.5px solid var(--edge); border-radius: var(--radius-pill); }

.emerg-lead { --rc: var(--danger); margin-top: var(--space-8); padding-top: var(--space-24); border-top: 2px dashed var(--edge); margin-bottom: var(--space-16); }
.emerg-lead .reco-cat__head { color: #fff; }
.emerg-intro { margin: var(--space-8) 0 0; color: var(--ink-2); }
.emerg-card { display: grid; gap: var(--space-6); }
.emerg-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); }
.emerg-label { font-weight: 700; }
.emerg-num {
  flex-shrink: 0;
  padding: 6px 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-2);
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  background: var(--lime);
  border: 2px solid var(--edge);
  border-radius: var(--radius-pill);
  box-shadow: var(--pop-s);
}
.emerg-num:active { transform: translate(2px, 2px); box-shadow: none; }
.emerg-note { margin: 0; color: var(--ink-2); font-size: var(--step-0); line-height: 1.5; }

/* ============================================================
   HOJA INFERIOR, CONFIRMACIÓN, AVISO
   ============================================================ */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(22, 26, 60, 0.6); opacity: 0; transition: opacity var(--dur-2) var(--ease-out); }
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet__panel {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: var(--stroke);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform var(--dur-3) var(--ease-out);
}
.sheet.is-open .sheet__panel { transform: none; }
.sheet__grip { width: 44px; height: 6px; margin: var(--space-10) auto 0; background: var(--edge); border-radius: var(--radius-pill); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); padding: var(--space-12) var(--space-20); border-bottom: 2px dashed var(--edge); }
.sheet__head h3 { font-size: var(--step-3); }
.sheet__form { flex: 1; overflow-y: auto; padding: var(--space-20); -webkit-overflow-scrolling: touch; }
.sheet__form .field:last-child { margin-bottom: 0; }
.sheet__foot { display: flex; gap: var(--space-12); padding: var(--space-12) var(--space-20) var(--space-16); border-top: var(--stroke); background: var(--card); }
.sheet__foot .btn { flex: 1; }

.confirm { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: var(--space-24); }
.confirm[hidden] { display: none; }
.confirm__backdrop { position: absolute; inset: 0; background: rgba(22, 26, 60, 0.65); }
.confirm__box { position: relative; width: 100%; max-width: 340px; padding: var(--space-20); background: var(--card); border: var(--stroke); border-radius: var(--radius-l); box-shadow: var(--pop-l); }
.confirm__box p { margin-bottom: var(--space-16); font-size: var(--step-2); font-weight: 600; line-height: 1.4; }
.confirm__row { display: flex; gap: var(--space-12); }
.confirm__row .btn { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-16));
  z-index: 80;
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 48px);
  padding: 10px 20px;
  font-weight: 700;
  color: var(--ink);
  background: var(--lime);
  border: var(--stroke);
  border-radius: var(--radius-pill);
  box-shadow: var(--pop);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.toast[hidden] { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   MODO OSCURO — mismos colores vivos sobre noche de Bangkok
   ============================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;

  --paper:   #0f1230;
  --paper-2: #14183f;
  --card:    #1b1f4b;
  --text:    #f3f1fc;
  --ink-2:   #b7bbe8;
  --line:    #323878;
  --edge:    #8a91e6;
  --shadow-c:#03041a;
  --night:   #070920;
  --map-bg:  #181b48;

  --pink-deep:   #ff7db9;
  --pink-soft:   #4a1a45;
  --lime-soft:   #2c3512;
  --lime-deep:   #d6f85d;
  --blue-soft:   #202c66;
  --blue-deep:   #9db8ff;
  --orange-soft: #473010;
  --orange-deep: #ffbb55;
  --danger:      #ff6d84;
  --danger-soft: #4b1823;
}
:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f3f1fc' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #7f85c4; }
:root[data-theme="dark"] input::-webkit-calendar-picker-indicator { filter: invert(1); }
:root[data-theme="dark"] .sheet__backdrop, :root[data-theme="dark"] .confirm__backdrop { background: rgba(2, 3, 14, 0.72); }
/* Mapa oscuro: se invierten las teselas claras y se suman al fondo */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) grayscale(1) brightness(0.95) contrast(0.9); mix-blend-mode: screen; }
:root[data-theme="dark"] .leaflet-control-attribution { background: rgba(7, 9, 32, 0.75) !important; }
:root[data-theme="dark"] .tab:not([aria-current="page"]) { color: var(--ink-2); }

/* ============================================================
   RESPONSIVE Y MOVIMIENTO
   ============================================================ */
@media (min-width: 480px) {
  .slot { grid-template-columns: 58px minmax(0, 1fr); }
  .leg { margin-left: 88px; }
}
@media (min-width: 720px) {
  :root { --maxw: 680px; }
  .screen-head h2, .trip-hero__title { font-size: 2.8rem; }
  .tabbar {
    inset: auto auto 0 50%;
    width: var(--maxw);
    transform: translateX(-50%);
    border: var(--stroke);
    border-bottom: 0;
    border-radius: var(--radius-l) var(--radius-l) 0 0;
  }
}
@media (max-width: 350px) {
  .field-2 { grid-template-columns: 1fr; }
  .pass__route { font-size: 2rem; }
  .tab { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
