/* LocalGo — sistema visual
   Blanco puro, negro para acciones, niebla para superficies y un solo acento cítrico
   (los naranjos de La Valldigna) reservado para rutas y estados en vivo. */

:root {
  --paper: #FFFFFF;
  --ink: #000000;
  --mist: #F3F3F1;
  --mist-strong: #E9E9E6;
  --line: #E4E4E0;
  --stone: #6E6E6A;
  --citrus: #FF5A1F;
  --citrus-soft: #FFEDE5;
  --ok: #0F8A4B;
  --ok-soft: #E3F4EA;
  --warn: #9A6500;
  --warn-soft: #FFF3D6;
  --danger: #C8261B;
  --danger-soft: #FDE8E6;
  --on-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, .78);
  --shadow-lift: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px -12px rgba(0,0,0,.14);

  --r-sheet: 28px;
  --r-card: 20px;
  --r-field: 14px;

  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000; --ink: #FFFFFF; --mist: #151515; --mist-strong: #202020; --line: #262626;
    --stone: #A1A1A0; --citrus: #FF7A45; --citrus-soft: #2A150C; --ok: #4ADE80; --ok-soft: #0D2417;
    --warn: #F5C451; --warn-soft: #2A2008; --danger: #FF6B5E; --danger-soft: #2B0F0C;
    --on-ink: #000000; --glass: rgba(0,0,0,.72);
    --shadow-lift: 0 0 0 1px #262626; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #000000; --ink: #FFFFFF; --mist: #151515; --mist-strong: #202020; --line: #262626;
  --stone: #A1A1A0; --citrus: #FF7A45; --citrus-soft: #2A150C; --ok: #4ADE80; --ok-soft: #0D2417;
  --warn: #F5C451; --warn-soft: #2A2008; --danger: #FF6B5E; --danger-soft: #2B0F0C;
  --on-ink: #000000; --glass: rgba(0,0,0,.72);
  --shadow-lift: 0 0 0 1px #262626; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
@media (min-width: 860px) { body { padding-bottom: 0; } }
img, svg { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--citrus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; }
.muted { color: var(--stone); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Tipografía ---------- */
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.display { font-size: clamp(2.8rem, 6.4vw, 5rem); letter-spacing: -.045em; line-height: .98; }
.title { font-size: clamp(2rem, 4.6vw, 3rem); }
.heading { font-size: 1.5rem; letter-spacing: -.02em; }
.subhead { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--stone); max-width: 34ch; margin: 18px 0 0; line-height: 1.45; }
p { margin: 0; }
.prose p + p { margin-top: 1em; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.35rem; margin: 2em 0 .5em; letter-spacing: -.02em; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .wrap { display: flex; align-items: center; height: 64px; gap: 12px; }
@media (min-width: 860px) { .topbar .wrap { gap: 28px; } }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 21px; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; }
.nav { display: none; gap: 4px; margin-right: auto; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--stone); transition: color .15s, background .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--mist); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 860px) { .nav { display: flex; } .top-actions { margin-left: 0; } }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 999px; border: 0; background: transparent; cursor: pointer; text-decoration: none;
  transition: background .15s;
}
.icon-btn:hover { background: var(--mist); }
.icon-btn svg { width: 22px; height: 22px; }
.dot-badge { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--citrus); box-shadow: 0 0 0 2px var(--paper); }
.hide-mobile { display: none !important; }
@media (min-width: 860px) { .hide-mobile { display: inline-flex !important; } .hide-desktop { display: none !important; } }

/* ---------- Pestañas inferiores (móvil) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
@media (min-width: 860px) { .tabbar { display: none; } }
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
  font-size: 11px; font-weight: 600; text-decoration: none; color: var(--stone);
}
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar .dot-badge { top: 4px; right: calc(50% - 16px); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--on-ink);
  transition: transform .15s var(--ease), opacity .15s, background .15s;
}
.btn:hover { opacity: .86; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .35; cursor: not-allowed; transform: none; }
.btn-soft { background: var(--mist); color: var(--ink); }
.btn-soft:hover { background: var(--mist-strong); opacity: 1; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--mist); opacity: 1; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link-plain { text-decoration: none; font-weight: 600; }
.link-plain:hover { text-decoration: underline; }

/* ---------- Formularios ---------- */
.field { display: block; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.input, .select, .textarea {
  width: 100%; min-height: 54px; padding: 14px 16px; border-radius: var(--r-field);
  border: 1.5px solid transparent; background: var(--mist); outline: none;
  transition: border-color .15s, background .15s; -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); background: var(--paper); }
.select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236E6E6A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
}
.hint { font-size: 14px; color: var(--stone); margin-top: 8px; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }

.check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; padding: 14px 0; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line);
  display: grid; place-items: center; transition: background .15s, border-color .15s; margin-top: 1px;
}
.check .box::after { content: ""; width: 11px; height: 6px; border: solid var(--on-ink); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .2s var(--ease); }
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .box::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:focus-visible + .box { outline: 3px solid var(--citrus); outline-offset: 2px; }
.check b { display: block; font-weight: 600; }

/* Interruptor tipo iOS */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { flex: none; width: 51px; height: 31px; border-radius: 999px; background: var(--mist-strong); position: relative; transition: background .25s var(--ease); }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.toggle input:checked + .track { background: var(--ok); }
.toggle input:checked + .track::after { transform: translateX(20px); }
.toggle input:focus-visible + .track { outline: 3px solid var(--citrus); outline-offset: 2px; }
.toggle b { display: block; font-weight: 600; }

/* Selector numérico */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--mist); border-radius: 999px; padding: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); cursor: pointer; font-size: 22px; line-height: 1; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 44px; text-align: center; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }

/* Segmentado */
.segmented { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 4px; gap: 2px; }
.segmented a, .segmented button { border: 0; background: none; cursor: pointer; padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--stone); text-decoration: none; }
.segmented [aria-current="true"], .segmented [aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- Buscador ---------- */
.search-sheet {
  background: var(--paper); border-radius: var(--r-sheet); padding: 10px;
  box-shadow: var(--shadow-lift); border: 1px solid var(--line);
}
.route-fields { position: relative; display: grid; gap: 6px; }
.route-field { position: relative; }
.route-field .select { padding-left: 50px; min-height: 60px; font-weight: 500; background-color: var(--mist); }
.route-field::before {
  content: ""; position: absolute; left: 22px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; border: 2.5px solid var(--ink); z-index: 1; pointer-events: none;
}
.route-field.to::before { border-radius: 2px; background: var(--ink); }
.route-fields::after {
  content: ""; position: absolute; left: 26.5px; top: 42px; bottom: 42px; width: 1.5px; background: var(--stone); opacity: .5;
}
.swap {
  position: absolute; right: 52px; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  display: grid; place-items: center; cursor: pointer; transition: transform .3s var(--ease);
}
.swap:hover { transform: translateY(-50%) rotate(180deg); }
.swap svg { width: 18px; height: 18px; }
.search-bottom { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 6px; }
.search-bottom .input { min-height: 60px; }
.search-bottom .btn { min-height: 60px; padding: 0 28px; }

/* ---------- Portada ---------- */
.hero { padding: clamp(28px, 6vw, 72px) 0 40px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; } }
.hero .search-sheet { margin-top: 32px; max-width: 520px; }

.coast { position: relative; border-radius: var(--r-sheet); background: var(--mist); overflow: hidden; aspect-ratio: 1 / 1.02; }
.coast svg { display: block; width: 100%; height: 100%; }
.coast .sea { fill: var(--mist-strong); }
.coast .land-line { fill: none; stroke: var(--stone); stroke-width: 1.2; opacity: .45; }
.coast .road { fill: none; stroke: var(--line); stroke-width: 5; stroke-linecap: round; }
.coast .rail { fill: none; stroke: var(--stone); stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .7; }
.coast .route { fill: none; stroke: var(--citrus); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s .5s var(--ease) forwards; }
.coast .town { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.coast .town-label { font: 600 13px var(--font); fill: var(--ink); }
.coast .town-label.dim { fill: var(--stone); font-weight: 500; }
.coast .sea-label { font: 500 12px var(--font); fill: var(--stone); letter-spacing: .02em; }
.coast .pin-end { opacity: 0; animation: pop .4s 2.7s var(--ease) forwards; transform-box: fill-box; transform-origin: center; }
.coast-card {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(12px); animation: rise .5s 2.8s var(--ease) forwards;
}
.coast-card .price { margin-left: auto; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }

.section { padding: clamp(48px, 8vw, 96px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }

.value-grid { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); }
@media (min-width: 760px) { .value-grid { grid-template-columns: repeat(3, 1fr); } }
.value { background: var(--paper); padding: 28px; }
.value .big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-bottom: 12px; }
.value p { color: var(--stone); }
.value b { color: var(--ink); font-weight: 600; }

.steps { counter-reset: s; display: grid; gap: 28px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { list-style: none; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 700; margin-bottom: 14px; }
.steps h3 { font-size: 1.15rem; letter-spacing: -.01em; margin-bottom: 6px; }
.steps p { color: var(--stone); }
.steps { padding: 0; margin: 0; }

.cta-band { background: var(--ink); color: var(--on-ink); border-radius: var(--r-sheet); padding: clamp(32px, 6vw, 64px); display: grid; gap: 24px; align-items: center; }
@media (min-width: 760px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band p { opacity: .7; margin-top: 10px; max-width: 46ch; }
.cta-band .btn { background: var(--paper); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: var(--mist); text-decoration: none; font-size: 15px; font-weight: 500; transition: background .15s; }
a.chip:hover { background: var(--mist-strong); }

/* ---------- Tarjeta de viaje ---------- */
.trip-list { display: grid; gap: 12px; }
@media (min-width: 900px) { .trip-list.cols { grid-template-columns: 1fr 1fr; } }
.trip-card {
  display: block; text-decoration: none; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 20px; transition: border-color .15s, transform .2s var(--ease);
}
.trip-card:hover { border-color: var(--ink); }
.trip-card:active { transform: scale(.99); }
.trip-card.full { opacity: .5; }
.trip-top { display: flex; gap: 16px; }
.timeline { display: grid; grid-template-columns: auto 16px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; flex: 1; min-width: 0; }
.timeline .t { grid-column: 1; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; }
.timeline .place { grid-column: 3; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline .r1 { grid-row: 1; } .timeline .r3 { grid-row: 3; }
.timeline .dur { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--stone); padding: 4px 0; }
.timeline .rail { grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; align-items: center; padding: 7px 0; }
.timeline .node { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--ink); flex: none; }
.timeline .node.end { border-radius: 3px; background: var(--ink); }
.timeline .bar { flex: 1; width: 2px; background: var(--ink); margin: 3px 0; }
.price-tag { text-align: right; flex: none; }
.price-tag .amount { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.price-tag .per { font-size: 13px; color: var(--stone); }
.trip-bottom { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.meta { font-size: 14px; color: var(--stone); }
.seats-left { margin-left: auto; font-size: 14px; font-weight: 600; white-space: nowrap; }
.seats-left.low { color: var(--citrus); }

.avatar { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--mist-strong); color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.avatar.lg { width: 88px; height: 88px; font-size: 32px; }
.avatar.md { width: 56px; height: 56px; font-size: 20px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.stars { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 14px; }
.stars svg { width: 14px; height: 14px; fill: currentColor; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--mist); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.live { background: var(--citrus-soft); color: var(--citrus); }
.pill svg { width: 14px; height: 14px; }

/* ---------- Resultados ---------- */
.results-head { padding: 24px 0 8px; }
.results-layout { display: grid; gap: 24px; padding-bottom: 48px; }
.results-layout > *, .detail-grid > *, .hero-grid > * { min-width: 0; }
@media (min-width: 960px) { .results-layout { grid-template-columns: 360px 1fr; align-items: start; } .results-layout aside { position: sticky; top: 88px; } }
.day-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-strip a { flex: none; text-decoration: none; padding: 10px 16px; border-radius: 14px; background: var(--mist); font-size: 14px; font-weight: 600; text-align: center; line-height: 1.2; }
.day-strip a span { display: block; font-size: 12px; font-weight: 500; color: var(--stone); }
.day-strip a[aria-current="true"] { background: var(--ink); color: var(--on-ink); }
.day-strip a[aria-current="true"] span { color: inherit; opacity: .7; }

.empty { text-align: center; padding: 56px 24px; border-radius: var(--r-card); background: var(--mist); }
.empty .icon { width: 56px; height: 56px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); }
.empty .icon svg { width: 26px; height: 26px; }
.empty h2 { font-size: 1.35rem; letter-spacing: -.02em; margin-bottom: 8px; }
.empty p { color: var(--stone); max-width: 40ch; margin: 0 auto 22px; }

/* ---------- Detalle ---------- */
.page { padding: 24px 0 64px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; color: var(--stone); margin-bottom: 20px; font-size: 15px; }
.back:hover { color: var(--ink); }
.back svg { width: 18px; height: 18px; }
.detail-grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: start; } .detail-grid .side { position: sticky; top: 88px; } }
.big-timeline { display: grid; grid-template-columns: auto 20px 1fr; column-gap: 16px; margin: 28px 0; }
.big-timeline .t { grid-column: 1; font-weight: 800; font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.big-timeline .place { grid-column: 3; font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.25; }
.big-timeline .r1 { grid-row: 1; } .big-timeline .r3 { grid-row: 3; }
.big-timeline .sub { color: var(--stone); font-size: 15px; margin-top: 2px; font-weight: 400; letter-spacing: 0; }
.big-timeline .dur { grid-column: 1; grid-row: 2; color: var(--stone); font-size: 14px; padding: 12px 0 28px; }
.big-timeline .rail { grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; align-items: center; padding: 8px 0 10px; }
.big-timeline .node { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ink); flex: none; }
.big-timeline .node.end { border-radius: 4px; background: var(--ink); }
.big-timeline .bar { flex: 1; width: 3px; background: var(--ink); margin: 4px 0; }

.panel { background: var(--mist); border-radius: var(--r-card); padding: 20px; }
.panel.white { background: var(--paper); border: 1px solid var(--line); }
.list-rows > * { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.list-rows > * + * { border-top: 1px solid var(--line); }
.list-rows svg { width: 22px; height: 22px; flex: none; color: var(--stone); }
.person { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.person:hover .name { text-decoration: underline; }
.person .name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }

.book-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sheet); padding: 24px; box-shadow: var(--shadow-lift); }
.book-card .total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0; margin: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.book-card .total b { font-size: 28px; letter-spacing: -.03em; }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--mist); font-size: 15px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.notice.ok { background: var(--ok-soft); }
.notice.ok svg { color: var(--ok); }
.notice.warn { background: var(--warn-soft); }
.notice.warn svg { color: var(--warn); }
.notice.live { background: var(--citrus-soft); }
.notice.live svg { color: var(--citrus); }

.request { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 0; }
.request + .request { border-top: 1px solid var(--line); }
.request .actions { display: flex; gap: 8px; margin-left: auto; }

.share-row { display: flex; gap: 8px; flex-wrap: wrap; }

.rate { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rate input { position: absolute; opacity: 0; }
.rate label { cursor: pointer; color: var(--mist-strong); transition: color .1s, transform .15s var(--ease); }
.rate label svg { width: 34px; height: 34px; fill: currentColor; }
.rate label:hover, .rate label:hover ~ label, .rate input:checked ~ label { color: var(--citrus); }
.rate input:focus-visible + label { outline: 3px solid var(--citrus); border-radius: 6px; }
.rate label:active { transform: scale(.9); }

details.fold summary { cursor: pointer; list-style: none; font-weight: 600; padding: 12px 0; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "+"; float: right; font-size: 20px; line-height: 1; color: var(--stone); }
details.fold[open] summary::after { content: "−"; }

/* ---------- Publicar (asistente) ---------- */
.wizard { max-width: 620px; margin: 0 auto; padding: 16px 0 48px; }
.progress { height: 4px; background: var(--mist); border-radius: 999px; overflow: hidden; margin: 8px 0 32px; }
.progress i { display: block; height: 100%; width: 25%; background: var(--ink); border-radius: inherit; transition: width .45s var(--ease); }
.step + .step { margin-top: 56px; }
.js .step { display: none; margin-top: 0; }
.js .step.active { display: block; animation: stepIn .4s var(--ease); }
.js .no-js-only { display: none; }
html:not(.js) [data-next], html:not(.js) [data-prev], html:not(.js) [data-price-dial],
html:not(.js) [data-price-range], html:not(.js) .progress, html:not(.js) .swap { display: none !important; }
html:not(.js) [data-submit] { display: inline-flex !important; }
.step h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin-bottom: 8px; }
.step > p.muted { margin-bottom: 28px; }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.wizard-nav { display: flex; gap: 10px; margin-top: 32px; }
.wizard-nav .btn:last-child { flex: 1; }
.price-dial { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 28px 0 8px; }
.price-dial button { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--mist); font-size: 28px; cursor: pointer; transition: background .15s, transform .1s; }
.price-dial button:active { transform: scale(.92); }
.price-dial button:disabled { opacity: .3; }
.price-dial output { font-size: clamp(3.4rem, 12vw, 4.6rem); font-weight: 800; letter-spacing: -.05em; min-width: 4ch; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.price-range { text-align: center; color: var(--stone); font-size: 15px; }
.route-summary { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.review-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; }
.review-list > div + div { border-top: 1px solid var(--line); }
.review-list dt { color: var(--stone); }
.review-list dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Chat ---------- */
.chat-page { display: flex; flex-direction: column; height: calc(100dvh - 64px - 76px - env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
@media (min-width: 860px) { .chat-page { height: calc(100dvh - 64px); } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
.bubble-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 10px 14px; border-radius: 20px; background: var(--mist); line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-row.mine .bubble { background: var(--ink); color: var(--on-ink); }
.bubble small { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.bubble .who { display: block; font-size: 12px; font-weight: 700; margin-bottom: 1px; }
.bubble-row.new { animation: rise .25s var(--ease) both; opacity: 0; transform: translateY(6px); }
.chat-form { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.chat-form .input { min-height: 48px; border-radius: 999px; padding: 12px 20px; }
.chat-form .btn { width: 48px; min-height: 48px; padding: 0; }

/* ---------- Mis viajes / perfil / avisos ---------- */
.tabs-panel[hidden] { display: none; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-card); overflow: hidden; margin: 24px 0; }
.stat-row > div { background: var(--mist); padding: 18px 16px; }
.stat-row b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.stat-row span { font-size: 13px; color: var(--stone); }
.profile-head { display: flex; gap: 20px; align-items: center; }
.review-item { padding: 18px 0; }
.review-item + .review-item { border-top: 1px solid var(--line); }
.notif { display: flex; gap: 14px; padding: 16px 0; text-decoration: none; align-items: flex-start; }
.notif + .notif { border-top: 1px solid var(--line); }
.notif .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--citrus); margin-top: 8px; flex: none; }
.notif .read-dot { width: 8px; flex: none; }

/* ---------- Auth ---------- */
.auth { min-height: calc(100dvh - 64px - 76px); display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: clamp(2.2rem, 6vw, 2.8rem); margin-bottom: 12px; }
.auth-card > p { line-height: 1.5; }
.auth-card form { margin-top: 28px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; top: 76px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast {
  /* Deja pasar el clic a lo que hay debajo: solo el botón de cerrar es pulsable */
  pointer-events: none; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border-radius: 16px; background: var(--ink); color: var(--on-ink); box-shadow: 0 12px 40px -8px rgba(0,0,0,.35);
  animation: toastIn .45s var(--ease) both; font-size: 15px; font-weight: 500;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast button { pointer-events: auto; margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 20px; line-height: 1; padding: 0 2px; }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------- Pie ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; margin-top: 40px; color: var(--stone); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Tablas admin ---------- */
.table-wrap { overflow-x: auto; }
table.clean { width: 100%; border-collapse: collapse; font-size: 15px; }
table.clean th { text-align: left; font-weight: 600; color: var(--stone); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.clean td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }

.error-page { text-align: center; padding: 96px 20px; }
.error-page .code { font-size: clamp(5rem, 20vw, 9rem); font-weight: 800; letter-spacing: -.06em; line-height: 1; color: var(--mist-strong); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .coast .route { stroke-dashoffset: 0; }
  .coast .car { display: none; }
}

/* Retoques finales */
@media (max-width: 520px) {
  .timeline .place { white-space: normal; line-height: 1.25; }
  .price-tag .amount { font-size: 21px; }
}
.brand-mark { border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }

/* Gráfico de barras del panel */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar-col i { display: block; width: 100%; max-width: 64px; background: var(--ink); border-radius: 8px 8px 4px 4px; }
.bar-col .bar-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Filtros de búsqueda */
.filters { margin: 0 0 14px; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.fchip { flex: none; cursor: pointer; }
.fchip input { position: absolute; opacity: 0; pointer-events: none; }
.fchip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 999px;
  background: var(--mist); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s, transform .1s var(--ease);
}
.fchip span svg { width: 15px; height: 15px; }
.fchip:hover span { background: var(--mist-strong); }
.fchip input:checked + span { background: var(--ink); color: var(--on-ink); }
.fchip input:focus-visible + span { outline: 3px solid var(--citrus); outline-offset: 2px; }
.fchip:active span { transform: scale(.96); }
.filter-sep { flex: none; width: 1px; background: var(--line); margin: 6px 4px; }

/* Entrada escalonada de resultados */
@media (prefers-reduced-motion: no-preference) {
  .trip-list > * { animation: cardIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Transiciones entre páginas (navegadores compatibles) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vtOut .18s var(--ease) both; }
  ::view-transition-new(root) { animation: vtIn .26s var(--ease) both; }
}
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Iconos con tamaños fijos */
.icon-xl svg { width: 40px; height: 40px; }
.icon-inline { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.icon-inline svg { width: 16px; height: 16px; }

/* En pantallas anchas, las tiras no se cortan: se reparten en varias líneas */
@media (min-width: 960px) {
  .day-strip, .filter-chips { flex-wrap: wrap; overflow: visible; }
}

/* Tablas dentro de textos legales: más anchas que la columna de lectura */
.prose table.clean { width: min(920px, calc(100vw - 40px)); font-size: 14px; }
.prose table.clean td, .prose table.clean th { padding: 10px; }
@media (max-width: 720px) {
  .prose table.clean { font-size: 13px; width: 100%; }
  .prose table.clean td, .prose table.clean th { padding: 8px 6px; }
}

/* Barra fija de reserva en móvil */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 35; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; background: var(--glass); border-top: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.sticky-cta { transition: transform .3s var(--ease), opacity .25s; }
.sticky-cta b { font-size: 20px; letter-spacing: -.02em; display: block; }
.sticky-cta .btn { min-height: 46px; }
@media (min-width: 860px) { .sticky-cta { display: none !important; } }
.sticky-cta ~ * { scroll-margin-bottom: 120px; }
#reservar { scroll-margin-top: 80px; }

/* Botones con texto largo que pueden ocupar dos líneas */
.btn-wrap { white-space: normal; text-align: center; line-height: 1.3; padding-top: 12px; padding-bottom: 12px; height: auto; }

/* Verificación en dos pasos */
.code-input { font-size: 24px; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; font-weight: 600; }
.setup-steps { counter-reset: s; list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 28px; }
.setup-steps li { counter-increment: s; position: relative; padding-left: 48px; display: grid; gap: 4px; }
.setup-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; width: max-content; margin: 10px 0 6px; }
.qr-box svg { display: block; width: 180px; height: 180px; }
.secret { font-size: 14px; background: var(--mist); padding: 2px 8px; border-radius: 6px; word-break: break-all; letter-spacing: .05em; }

/* Fotos de perfil */
img.avatar.photo { object-fit: cover; background: var(--mist-strong); }
.photo-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* Selector de idioma */
.lang-switch { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-decoration: none; color: var(--stone); transition: background .15s, color .15s; }
.lang-switch:hover { background: var(--mist); color: var(--ink); }
.lang-links a[aria-current="true"] { color: var(--ink); font-weight: 600; }

/* Buscador de lugares con autocompletado */
.place-box { position: relative; }
.route-field .place-input { padding-left: 50px; min-height: 60px; font-weight: 500; padding-right: 56px; }
.place-list {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px;
  list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lift); max-height: 340px; overflow-y: auto; animation: rise .18s var(--ease) both;
}
.place-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.place-list li[aria-selected="true"], .place-list li:hover { background: var(--mist); }
.place-list .ico { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--mist); display: grid; place-items: center; }
.place-list li[aria-selected="true"] .ico, .place-list li:hover .ico { background: var(--paper); }
.place-list .ico svg { width: 16px; height: 16px; }
.place-list b { font-weight: 600; display: block; line-height: 1.25; }
.place-list small { color: var(--stone); font-size: 13px; }
.place-list mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--citrus); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.place-list .empty-row { color: var(--stone); cursor: default; font-size: 14px; }
.place-list .empty-row:hover { background: none; }
.route-field:focus-within { z-index: 5; }

/* Programa de ahorro energético */
.cae-steps { display: grid; gap: 10px; }
.cae-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--mist); }
.cae-step .punto { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--stone); }
.cae-step.hecho .punto { background: var(--ok); border-color: var(--ok); }
.cae-step b { display: block; line-height: 1.2; }

/* Entrar con Google o Apple */
.social-login { display: grid; gap: 10px; margin: 24px 0 8px; }
.btn.social { justify-content: center; gap: 10px; font-weight: 600; border: 1px solid var(--line); background: var(--paper); }
.btn.social:hover { background: var(--mist); }
.separador { display: flex; align-items: center; gap: 12px; color: var(--stone); font-size: 14px; margin: 6px 0 2px; }
.separador::before, .separador::after { content: ""; flex: 1; height: 1px; background: var(--line); }
