/* ═════════════════════════════════════════════════════════════
   TramGO — Cal y persiana verde
   Cal blanca de fondo, verde persiana como estructura,
   verde tranvía solo para lo vivo, albero y almagra como estados.
   ═════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/fonts/atkinson-hyperlegible-next.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Marca */
  --cal: #F7F9F6;
  --cal-2: #EDF2EE;
  --blanco: #FFFFFF;
  --persiana-950: #062618;
  --persiana-900: #0A3B26;
  --persiana-800: #0C4A30;
  --persiana-700: #0F5E3B;
  --persiana-600: #14734A;
  --persiana-500: #1A8A57;
  --tranvia: #2DB868;
  --tranvia-soft: #DDF3E5;
  --hierro: #16201A;
  --hierro-2: #46544B;
  --hierro-3: #5F6E65;
  --albero: #E3A41E;
  --albero-ink: #8A5A00;
  --albero-soft: #FBF0D3;
  --almagra: #C2412A;
  --almagra-ink: #A8321D;
  --almagra-soft: #F8DED8;
  --gps: #2F7BF5;

  /* Semántica (tema claro) */
  --bg: var(--cal);
  --bg-2: var(--cal-2);
  --card: var(--blanco);
  --fg: var(--hierro);
  --fg-2: var(--hierro-2);
  --fg-3: var(--hierro-3);
  --accent: var(--persiana-700);
  --accent-ink: var(--persiana-600);
  --line: rgba(15, 94, 59, .13);
  --line-2: rgba(15, 94, 59, .24);
  --shell: var(--persiana-800);
  --frame: var(--persiana-900);
  --slat: var(--persiana-700);
  --on-shell: #FFFFFF;
  --on-shell-2: #C9DCCF;
  --on-shell-soon: #F5C04A;
  --on-shell-now: #FFAE9B;
  --map-bg: #E6ECE7;
  --tile-filter: saturate(.32) sepia(.14) hue-rotate(38deg) brightness(1.04) contrast(.94);
  --selection: rgba(45, 184, 104, .28);
  --focus: var(--persiana-600);
  --shade: 6, 38, 24;
  --fav: var(--persiana-700);

  --shadow-1: 0 1px 2px rgba(10, 59, 38, .07), 0 2px 8px -2px rgba(10, 59, 38, .08);
  --shadow-2: 0 10px 28px -10px rgba(10, 59, 38, .30), 0 2px 6px rgba(10, 59, 38, .08);
  --shadow-3: 0 24px 60px -20px rgba(6, 38, 24, .45), 0 4px 14px rgba(6, 38, 24, .12);
  --shadow-sheet: 0 -10px 36px -12px rgba(6, 38, 24, .30);

  --r-xs: 6px;
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 26px;

  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-ui: 'Atkinson Hyperlegible Next', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
  --top-h: calc(var(--safe-t) + 70px);
  --grip-h: 26px;
  --sheet-visible: 260px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08140E;
    --bg-2: #0E1E16;
    --card: #10231A;
    --fg: #E8F1EA;
    --fg-2: #B6C7BB;
    --fg-3: #8FA597;
    --accent: #3CCB7A;
    --accent-ink: #5AD58E;
    --line: rgba(160, 220, 185, .12);
    --line-2: rgba(160, 220, 185, .22);
    --shell: #0A3B26;
    --frame: #072D1D;
    --slat: #0F5034;
    --map-bg: #0B1711;
    --tile-filter: invert(1) hue-rotate(180deg) saturate(.28) sepia(.18) hue-rotate(60deg) brightness(.82) contrast(.92);
    --selection: rgba(60, 203, 122, .32);
    --focus: #5AD58E;
    --shade: 0, 0, 0;
    --fav: #E8F1EA;
    --albero-ink: #F2BE4E;
    --albero-soft: rgba(227, 164, 30, .16);
    --almagra-ink: #FF9C85;
    --almagra-soft: rgba(194, 65, 42, .2);
    --tranvia-soft: rgba(45, 184, 104, .16);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 28px -10px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .35);
    --shadow-sheet: 0 -10px 36px -12px rgba(0, 0, 0, .6);
    --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .7), 0 4px 14px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08140E;
  --bg-2: #0E1E16;
  --card: #10231A;
  --fg: #E8F1EA;
  --fg-2: #B6C7BB;
  --fg-3: #8FA597;
  --accent: #3CCB7A;
  --accent-ink: #5AD58E;
  --line: rgba(160, 220, 185, .12);
  --line-2: rgba(160, 220, 185, .22);
  --shell: #0A3B26;
  --frame: #072D1D;
  --slat: #0F5034;
  --map-bg: #0B1711;
  --tile-filter: invert(1) hue-rotate(180deg) saturate(.28) sepia(.18) hue-rotate(60deg) brightness(.82) contrast(.92);
  --selection: rgba(60, 203, 122, .32);
  --focus: #5AD58E;
  --shade: 0, 0, 0;
  --fav: #E8F1EA;
  --albero-ink: #F2BE4E;
  --albero-soft: rgba(227, 164, 30, .16);
  --almagra-ink: #FF9C85;
  --almagra-soft: rgba(194, 65, 42, .2);
  --tranvia-soft: rgba(45, 184, 104, .16);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 28px -10px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-sheet: 0 -10px 36px -12px rgba(0, 0, 0, .6);
  --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .7), 0 4px 14px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
img, svg { display: block; }
::selection { background: var(--selection); color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
/* Sobre verde persiana el anillo pasa a blanco para mantener el contraste */
.persiana, .placa-top, .btn--primary { --focus: #FFFFFF; }
input { caret-color: var(--accent); }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic--s { width: 18px; height: 18px; }
.ic--xs { width: 14px; height: 14px; stroke-width: 2.4; }
.ic--fill { fill: currentColor; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-display); font-weight: 650; font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--persiana-800); color: #fff; padding: 10px 14px; border-radius: var(--r-s);
  font-weight: 700; text-decoration: none; transition: top .2s var(--ease-out);
}
.skip-link:focus { top: calc(var(--safe-t) + 10px); }

/* ── Splash: la persiana se levanta ───────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  pointer-events: none;
  animation: splash-failsafe .3s linear 3s forwards;
}
.splash-slats { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(10, 1fr); }
.splash-slats i {
  background:
    linear-gradient(to bottom, rgba(255,255,255,.10) 0 3px, transparent 3px calc(100% - 5px), rgba(0,0,0,.28) calc(100% - 5px)),
    var(--persiana-700);
  transform-origin: 50% 0;
}
.splash-logo { position: relative; width: min(240px, 60vw); height: auto; }
.splash.is-up .splash-slats i { animation: slat-up .62s var(--ease-io) forwards; }
.splash.is-up .splash-slats i:nth-child(1)  { animation-delay: .27s; }
.splash.is-up .splash-slats i:nth-child(2)  { animation-delay: .24s; }
.splash.is-up .splash-slats i:nth-child(3)  { animation-delay: .21s; }
.splash.is-up .splash-slats i:nth-child(4)  { animation-delay: .18s; }
.splash.is-up .splash-slats i:nth-child(5)  { animation-delay: .15s; }
.splash.is-up .splash-slats i:nth-child(6)  { animation-delay: .12s; }
.splash.is-up .splash-slats i:nth-child(7)  { animation-delay: .09s; }
.splash.is-up .splash-slats i:nth-child(8)  { animation-delay: .06s; }
.splash.is-up .splash-slats i:nth-child(9)  { animation-delay: .03s; }
.splash.is-up .splash-slats i:nth-child(10) { animation-delay: 0s; }
.splash.is-up .splash-logo { animation: splash-logo .42s var(--ease-io) forwards; }
.splash.is-gone { display: none; }
@keyframes slat-up {
  0%   { transform: translateY(0) rotateX(0); }
  45%  { transform: translateY(0) rotateX(-70deg); filter: brightness(1.25); }
  100% { transform: translateY(-110vh) rotateX(-80deg); }
}
@keyframes splash-logo { to { opacity: 0; transform: translateY(-24px) scale(.96); } }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; } }

/* ── Estructura (móvil) ───────────────────────────────── */
.app { position: fixed; inset: 0; overflow: hidden; }
.map-area { position: absolute; inset: 0; isolation: isolate; z-index: 0; }
.map { position: absolute; inset: 0; z-index: 0; background: var(--map-bg); }

.topbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 12px 10px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  flex: none; width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center; box-shadow: var(--shadow-2);
  transition: transform .2s var(--ease-out);
}
.brand img { width: 48px; height: 48px; border-radius: 13px; }
.brand:active { transform: scale(.94); }

.search {
  position: relative; flex: 1; min-width: 0; height: 48px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 6px 0 14px;
  background: var(--card); border-radius: 999px;
  box-shadow: var(--shadow-2);
  transition: box-shadow .2s var(--ease-out);
}
.search:focus-within { box-shadow: var(--shadow-2), 0 0 0 3px var(--tranvia); }
.search-ic { color: var(--fg-3); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none;
  font-size: 16px; font-weight: 500;
}
.search input::placeholder { color: var(--fg-3); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-3); }
.search-clear:hover { background: var(--bg-2); color: var(--fg); }

.search-list {
  position: absolute; left: -56px; right: -56px; top: calc(100% + 8px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow-3);
  max-height: min(62vh, 460px); overflow-y: auto; overscroll-behavior: contain;
  transform-origin: 50% 0;
  animation: pop-in .22s var(--ease-out);
}
.search-opt {
  display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 10px; border-radius: var(--r-m); cursor: pointer;
}
.search-opt[aria-selected="true"], .search-opt:hover { background: var(--bg-2); }
.search-opt .dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tranvia-soft); color: var(--accent-ink);
}
.search-opt .dot i { width: 12px; height: 12px; border-radius: 50%; border: 3px solid currentColor; background: var(--card); }
.search-opt b { display: block; font: 650 16px/1.2 var(--font-display); letter-spacing: -.01em; }
.search-opt small { display: block; color: var(--fg-3); font: 500 13px/1.3 var(--font-display); margin-top: 2px; }
.search-opt em { font: 700 11.5px/1 var(--font-ui); font-style: normal; color: var(--accent-ink); background: var(--tranvia-soft); padding: 3px 7px; border-radius: 99px; margin-left: 8px; vertical-align: 2px; letter-spacing: .01em; }
.so-times { display: flex !important; flex-wrap: wrap; gap: 2px 12px; font-family: var(--font-ui) !important; font-size: 13.5px !important; color: var(--fg-2) !important; }
.so-times span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.so-times .ic { color: var(--fg-3); }
.so-times b { font: 750 14px/1 var(--font-display); color: var(--accent-ink); font-variant-numeric: tabular-nums; margin-left: 2px; }
.search-opt mark { background: none; color: var(--accent-ink); }
.search-empty { padding: 18px 14px; color: var(--fg-2); }

.round-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); color: var(--fg); box-shadow: var(--shadow-2);
  transition: transform .2s var(--ease-out), background .2s;
}
.round-btn:active { transform: scale(.92); }
.round-btn[aria-pressed="true"] { background: var(--persiana-800); color: #fff; }

/* Botones del mapa: píldoras con su nombre, para que no haya que adivinar */
.map-fabs {
  position: absolute; right: 12px; z-index: 15;
  top: calc(var(--top-h) + 4px);
  display: grid; gap: 8px; justify-items: end;
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.sheet-full .map-fabs { opacity: 0; pointer-events: none; transform: translateY(-12px); }
/* Solo en pantallas bajas, con la hoja a media altura, los botones se quedan en icono */
@media (max-height: 700px) {
  .sheet-half .fab { padding: 0; width: 44px; justify-content: center; }
  .sheet-half .fab span { display: none; }
}
.fab {
  min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); color: var(--fg); box-shadow: var(--shadow-2);
  font: 700 14px/1 var(--font-ui);
  transition: transform .18s var(--ease-out), color .2s, background .2s;
}
.fab .ic { width: 20px; height: 20px; color: var(--accent-ink); }
.fab:active { transform: scale(.94); }
.fab.is-busy .ic { animation: spin 1s linear infinite; color: var(--gps); }
.fab.is-on .ic { color: var(--gps); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hoja inferior ───────────────────────────────────── */
.sheet {
  position: fixed; left: 0; right: 0; z-index: 20;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  height: calc(100dvh - var(--top-h) - var(--tabbar-h) - var(--safe-b));
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-sheet);
  transform: translate3d(0, var(--sheet-y, 60%), 0);
  transition: transform .52s var(--ease-out);
  will-change: transform;
  contain: layout paint;
}
.sheet.is-dragging { transition: none; }
.sheet-grip {
  flex: none; height: var(--grip-h); display: grid; place-items: center;
  cursor: grab; touch-action: none;
}
.sheet-grip span { width: 42px; height: 5px; border-radius: 99px; background: var(--line-2); transition: width .2s var(--ease-out), background .2s; }
.sheet-grip:hover span { width: 52px; background: var(--fg-3); }
.sheet-body {
  flex: none; height: calc(var(--sheet-visible) - var(--grip-h));
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  --sheet-pad: 16px;
  padding: 0 var(--sheet-pad) 28px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  outline: none;
}
.sheet-body::-webkit-scrollbar { width: 8px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid var(--bg); }

.view { display: none; }
.view.is-active { display: block; animation: view-in .34s var(--ease-out); }
.view.is-back { animation-name: view-in-back; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes view-in-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Luz que entra por la persiana al abrir una parada */
.sheet::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 70%; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(168deg, rgba(var(--shade), .075) 0 11px, transparent 11px 30px);
  -webkit-mask-image: radial-gradient(120% 90% at 85% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(120% 90% at 85% 0%, #000 0%, transparent 70%);
  opacity: 0;
}
.sheet.sun::after { animation: sun-in 2.4s var(--ease-out) both; }
@keyframes sun-in {
  0% { opacity: 0; transform: translateX(-12%); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateX(6%); }
}
.sheet-grip, .sheet-body { position: relative; z-index: 1; }

/* ── Barra de pestañas (clara: el verde se queda en la respuesta) ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 8px var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  box-shadow: 0 -1px 0 var(--line), 0 -8px 20px -14px rgba(var(--shade), .25);
}
.tab {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--fg-3);
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  transition: color .2s var(--ease-out);
}
.tab .ic { transition: transform .28s var(--ease-out); }
.tab:hover { color: var(--fg); }
.tab.is-active { color: var(--accent-ink); }
.tab.is-active .ic { transform: translateY(-1px); }
.tab.is-active[data-tab="favorites"] .ic { fill: currentColor; }
.tab:active .ic { transform: scale(.88); }
.tab-indicator {
  position: absolute; z-index: 0; top: 7px; left: 8px;
  width: calc((100% - 16px) / 4); height: 34px;
  display: grid; place-items: center; pointer-events: none;
  transform: translateX(calc(var(--tab-i, 0) * 100%));
  transition: transform .42s var(--ease-out);
}
.tab-indicator::before { content: ''; width: 60px; height: 34px; border-radius: 17px; background: var(--tranvia-soft); }
.tabbar.no-active .tab-indicator { opacity: 0; }

/* ── Tipografía de panel ─────────────────────────────── */
.view-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 14px; }
.view-head h2 { flex: 1; font: 750 26px/1.08 var(--font-display); letter-spacing: -.025em; font-stretch: 92%; text-wrap: balance; }
.view-head p { color: var(--fg-2); }
.lede { color: var(--fg-2); font-size: 15px; margin: -6px 0 16px; text-wrap: pretty; }
.section-title { font: 700 17px/1.2 var(--font-display); letter-spacing: -.01em; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .count-badge { font: 700 12px/1 var(--font-ui); background: var(--bg-2); color: var(--fg-2); padding: 4px 7px; border-radius: 99px; }
.muted { color: var(--fg-3); }
.fine { font-size: 13px; color: var(--fg-3); line-height: 1.45; }

/* ── Botones ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  font-weight: 700; font-size: 15px;
  background: var(--card); color: var(--fg);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  transition: transform .15s var(--ease-out), background .2s, box-shadow .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn:active { transform: scale(.96); }
.btn--primary { background: var(--persiana-700); color: #fff; box-shadow: 0 6px 16px -8px rgba(var(--shade), .6); }
.btn--primary:hover { background: var(--persiana-600); box-shadow: 0 8px 20px -8px rgba(var(--shade), .7); }
.btn--ghost { box-shadow: none; background: transparent; }
.btn--ghost:hover { background: var(--bg-2); box-shadow: none; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: var(--fg-2);
  transition: background .2s, color .2s, transform .15s var(--ease-out);
}
.icon-btn:hover { background: var(--bg-2); color: var(--fg); }
.icon-btn:active { transform: scale(.9); }
.icon-btn--on-shell { color: rgba(255, 255, 255, .86); }
.icon-btn--on-shell:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.icon-btn.is-fav .ic { fill: var(--fav); stroke: var(--fav); }
.icon-btn--on-shell.is-fav .ic { fill: #fff; stroke: #fff; }
.icon-btn.is-fav.pop .ic, .btn.is-fav.pop .ic { animation: star-pop .5s var(--ease-out); }
.fav-name { display: block; font: 760 21px/1.08 var(--font-display); letter-spacing: -.02em; font-stretch: 90%; }
@keyframes star-pop { 0% { transform: scale(.6) rotate(-20deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: none; } }

/* Control segmentado */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  position: relative; padding: 4px; gap: 0;
  background: var(--bg-2); border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.seg button {
  position: relative; z-index: 1; min-height: 40px; padding: 0 12px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--fg-2);
  transition: color .2s var(--ease-out);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg button[aria-pressed="true"] { color: var(--fg); }
.seg-thumb {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / var(--n, 2));
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow-1);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .38s var(--ease-out);
}

/* Campo select */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--fg-2); }
.select {
  appearance: none; -webkit-appearance: none;
  width: 100%; min-height: 50px; padding: 0 42px 0 16px;
  border-radius: var(--r-m); border: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6E65' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 18px no-repeat,
    var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  font: 650 16px/1.2 var(--font-display); color: var(--fg);
}
.select:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }

/* ── La persiana (firma) ─────────────────────────────── */
.persiana {
  position: relative; isolation: isolate;
  background: var(--frame); color: var(--on-shell);
  border-radius: var(--r-l); padding: 6px 6px 6px;
  box-shadow: var(--shadow-2);
}
.persiana-head { display: flex; align-items: center; gap: 6px; padding: 8px 6px 10px 12px; }
.persiana-title { flex: 1; min-width: 0; }
.persiana-title h2, .persiana-title h3 {
  font: 760 23px/1.06 var(--font-display); letter-spacing: -.02em; font-stretch: 90%;
  text-wrap: balance;
}
.persiana-title p { color: var(--on-shell-2); font-size: 13.5px; margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.persiana-title button.linkish { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); text-underline-offset: 3px; font-weight: 700; padding: 6px 2px; margin: -6px 0; }

.slats {
  display: grid; gap: 0; perspective: 900px;
  border-radius: 13px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.slat {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 62px; padding: 11px 14px 12px;
  border-radius: 0;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.13) 0 2px, rgba(255,255,255,.035) 2px 42%, transparent 42% calc(100% - 6px), rgba(0,0,0,.16) calc(100% - 6px) calc(100% - 3px), rgba(0,0,0,.34) calc(100% - 3px)),
    var(--slat);
  transform-origin: 50% 0;
  backface-visibility: hidden;
  color: var(--on-shell);
  text-align: left; width: 100%;
}
button.slat { cursor: pointer; transition: filter .2s; }
button.slat:hover { filter: brightness(1.08); }
.slat-main { min-width: 0; display: grid; gap: 2px; }
.slat-dir { font: 700 16px/1.15 var(--font-display); letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.slat-dir .ic { width: 16px; height: 16px; opacity: .85; }
.slat-sub { color: var(--on-shell-2); font: 500 14px/1.3 var(--font-display); font-variant-numeric: tabular-nums; text-wrap: pretty; }
.slat-sub b { color: var(--on-shell); font-weight: 700; }
.slat-tag {
  justify-self: start; display: inline-block; margin-top: 3px;
  font: 700 12px/1.2 var(--font-ui); letter-spacing: .01em;
  padding: 3px 8px; border-radius: 99px;
  background: rgba(0, 0, 0, .22); color: var(--on-shell);
}
.slat--home { min-height: 86px; padding-top: 12px; padding-bottom: 13px; }
.slat--home .count { font-size: 62px; font-stretch: 84%; letter-spacing: -.045em; }
.slat--home .count small { font-size: 15px; }
.slat--home .count--word { font-size: 30px; font-stretch: 88%; }
.slat--home .slat-dir { font-size: 17px; }

.count {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 4px;
  font: 800 36px/.9 var(--font-display); letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.count small { font: 700 14px/1 var(--font-ui); letter-spacing: 0; opacity: .82; }
.count--word { font-size: 22px; letter-spacing: -.02em; }
.slat[data-state="soon"] .count { color: var(--on-shell-soon); }
.slat[data-state="now"] .count { color: var(--on-shell-now); }
.slat[data-state="now"] .count::before {
  content: ''; align-self: center; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px;
  background: var(--on-shell-now); animation: blink 1.1s var(--ease-io) 3;
}
.slat[data-state="tomorrow"] .count { color: var(--on-shell-2); }
.persiana-note { padding: 0 12px 10px; color: var(--on-shell-2); font-size: 14px; }
@keyframes blink { 50% { opacity: .25; transform: scale(.7); } }

/* Cifra que gira como una lama */
.flip { display: inline-block; position: relative; overflow: hidden; vertical-align: bottom; perspective: 300px; padding-bottom: .04em; }
.flip > span { display: inline-block; transform-origin: 50% 50%; backface-visibility: hidden; }

/* Apertura en cascada de las lamas */
.shutter-open .slat { animation: slat-open .62s var(--ease-out) both; animation-delay: calc(var(--k, 0) * 55ms + 40ms); }
@keyframes slat-open {
  from { transform: rotateX(-82deg); filter: brightness(.55); opacity: .4; }
  60% { filter: brightness(1.18); }
  to { transform: none; filter: none; opacity: 1; }
}
.slat-new { animation: slat-open .55s var(--ease-out) both; }

/* Barra de proximidad dentro de la persiana */
.approach {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 4px;
  font-size: 13px; color: var(--on-shell-2);
}
.approach-track { position: relative; flex: 1; height: 6px; border-radius: 6px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.approach-track i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--tranvia); border-radius: 6px; transition: width 1s linear; }
.approach b { color: #fff; font-weight: 700; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tranvia); flex: none; position: relative; }
.live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--tranvia); opacity: 0; animation: ping 2s var(--ease-out) infinite; }
.live-dot.is-off { background: var(--fg-3); }
.live-dot.is-off::after { display: none; }
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }

/* Persiana vacía (sin parada elegida) */
.persiana-empty { padding: 18px 16px 16px; display: grid; gap: 14px; }
.persiana-empty h2 { font: 760 24px/1.08 var(--font-display); letter-spacing: -.02em; font-stretch: 90%; }
.persiana-empty p { color: var(--on-shell-2); font-size: 15px; }
.persiana-empty .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.persiana-empty .row .btn { padding: 0 12px; }
.btn--on-shell { background: #fff; color: var(--persiana-800); box-shadow: none; }
.btn--on-shell:hover { background: #F0F7F2; box-shadow: none; }
.btn--on-shell-ghost { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28); }
.btn--on-shell-ghost:hover { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }

/* ── Inicio y filas claras ───────────────────────────── */
.block { margin-top: 22px; }
.block .section-title { margin: 0 0 4px; }
.rows { display: grid; }
.rows--loose { margin-top: 18px; }
.row-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 58px; padding: 9px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border-radius: var(--r-m); text-align: left; color: var(--fg); text-decoration: none;
  position: relative; transition: background .2s;
}
.row-item + .row-item::before { content: ''; position: absolute; left: 8px; right: 8px; top: 0; height: 1px; background: var(--line); }
button.row-item:hover, a.row-item:hover { background: var(--bg-2); }
button.row-item:active { background: var(--bg-2); transform: scale(.99); }
.row-item > .ic:first-child { color: var(--accent-ink); }
.ri-main { min-width: 0; }
.ri-main b { display: block; font: 700 16px/1.2 var(--font-display); letter-spacing: -.01em; }
.ri-main small { display: block; margin-top: 2px; color: var(--fg-2); font-size: 14px; line-height: 1.35; text-wrap: pretty; }
.ri-end { width: 18px; height: 18px; color: var(--fg-3); }
.row-item:has(> .ri-main:first-child) { grid-template-columns: minmax(0, 1fr) auto auto; }

/* Paradas guardadas: lo que falta en cada sentido, a la derecha y alineado */
.fav-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.fav-row .ri-main b { font-size: 17px; }
.fr-times { display: grid; gap: 4px; justify-items: end; }
.fr-times span { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-2); font-size: 13.5px; white-space: nowrap; }
.fr-times .ic { color: var(--fg-3); }
.fr-times b { min-width: 54px; text-align: right; font: 760 16px/1 var(--font-display); color: var(--accent-ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.near-row > .ic:first-child { color: var(--gps); }

.reminder > .ic:first-child { color: var(--albero-ink); }
.reminder { grid-template-columns: auto minmax(0, 1fr) auto; }

.plain-line { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 2px 0; border-top: 1px solid var(--line); color: var(--fg-2); font-size: 14.5px; text-wrap: pretty; }
.plain-line .ic { color: var(--accent-ink); margin-top: 1px; width: 20px; height: 20px; }
.plain-line b { color: var(--fg); }
.plain-line .linkbtn { color: var(--accent-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; padding: 0 2px; }

.status-line { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 2px 0; border-top: 1px solid var(--line); color: var(--fg-2); font-size: 14px; }
.status-line b { color: var(--fg); font-family: var(--font-display); }

/* ── Parada ──────────────────────────────────────────── */
.stn-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 4px; align-items: start; padding: 2px 0 6px; }
.stn-head > .icon-btn { margin-left: -10px; }
.stn-title { min-width: 0; padding-top: 3px; }
.stn-title h2 { font: 780 30px/1.02 var(--font-display); letter-spacing: -.03em; font-stretch: 88%; text-wrap: balance; }
.stn-meta { color: var(--fg-2); font-size: 14.5px; line-height: 1.35; margin-top: 4px; }
.stn-tools { display: flex; margin-right: -8px; }
.stn-tools .icon-btn { color: var(--fg); }
.stn-tools .icon-btn.is-fav .ic { fill: var(--fav); stroke: var(--fav); }

.dir-block { margin-top: 18px; }
.dir-block .section-title { margin: 0 0 8px; }
.dir-note { color: var(--fg-2); font-size: 14px; margin: -2px 0 8px; }

/* Una sola lama por sentido: el próximo tranvía. El resto, en filas claras. */
.persiana--one { padding: 5px; }
.slat--dep { grid-template-columns: 58px minmax(0, 1fr) auto 44px; gap: 8px; min-height: 84px; padding-right: 6px; }
.slat-time { font: 750 19px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.slat-dest { min-width: 0; color: var(--on-shell-2); font-size: 13.5px; line-height: 1.25; }
.slat-dest b { display: block; color: var(--on-shell); font: 700 16px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slat--dep .count { font-size: 50px; font-stretch: 86%; letter-spacing: -.045em; }
.slat--dep .count--word { font-size: 28px; }

.rows--deps { margin-top: 4px; }
.dep-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto 44px; align-items: center; gap: 8px;
  min-height: 56px; padding: 4px 6px 4px 11px; position: relative;
}
.dep-row + .dep-row::before { content: ''; position: absolute; left: 8px; right: 8px; top: 0; height: 1px; background: var(--line); }
.dr-time { font: 700 17px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--fg); }
.dr-dest { min-width: 0; }
.dr-dest b { display: block; font: 650 15px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-dest small { display: block; font-size: 13px; font-weight: 700; color: var(--fg-2); margin-top: 1px; }
.dep-row .count { font-size: 22px; letter-spacing: -.03em; color: var(--accent-ink); }
.dep-row .count small { font-size: 12.5px; color: var(--fg-2); opacity: 1; }
.dep-row .count--word { font-size: 17px; }
.dep-row[data-state="soon"] .count { color: var(--albero-ink); }
.dep-row[data-state="now"] .count { color: var(--almagra-ink); }

.bell {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--fg-3);
  transition: background .2s, color .2s, transform .15s var(--ease-out);
}
.bell .ic { width: 22px; height: 22px; }
.bell:hover { background: var(--bg-2); color: var(--fg); }
.bell:active { transform: scale(.88); }
.bell.is-on { color: var(--albero-ink); }
.bell.is-on .ic { fill: currentColor; animation: ring .7s var(--ease-out); }
.bell--shell { color: rgba(255, 255, 255, .8); }
.bell--shell:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.bell--shell.is-on { color: var(--on-shell-soon); }
.bell-gap { width: 44px; }
@keyframes ring { 20% { transform: rotate(16deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }

.hint { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 11px 14px; border-radius: var(--r-m); background: var(--bg-2); color: var(--fg-2); font-size: 14px; text-wrap: pretty; }
.hint .ic { width: 20px; height: 20px; color: var(--albero-ink); flex: none; margin-top: 1px; }
.dlg-lede { color: var(--fg-2); font-size: 15px; text-wrap: pretty; }
.rem-test { margin-top: 6px; }
.rem-test .linkbtn { color: var(--accent-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 8px 2px; }

/* ── Viaje ───────────────────────────────────────────── */
.trip-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.trip-form .stack { display: grid; gap: 10px; }
.trip-swap { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--accent-ink); margin-bottom: 2px; transition: transform .35s var(--ease-out); }
.trip-swap:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.trip-swap.spin { transform: rotate(180deg); }
.journeys { display: grid; gap: 8px; margin-top: 16px; }
.journey {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 14px 16px; border-radius: var(--r-m);
  background: var(--card); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.journey .times { font: 760 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.journey .times .ic { width: 18px; height: 18px; color: var(--fg-3); }
.journey .meta { grid-column: 1; color: var(--fg-2); font: 500 14px/1.3 var(--font-display); }
.journey .leave { grid-row: 1 / 3; grid-column: 2; text-align: right; }
.journey .leave b { display: block; font: 800 24px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--accent-ink); letter-spacing: -.03em; }
.journey .leave small { color: var(--fg-3); font-size: 12.5px; }
.journey[data-state="soon"] .leave b { color: var(--albero-ink); }
.journey[data-state="now"] .leave b { color: var(--almagra-ink); }
.journey:first-child { box-shadow: var(--shadow-2), inset 0 0 0 1.5px var(--accent); }

/* ── Línea ───────────────────────────────────────────── */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--fg-2); margin: -4px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 22px; height: 16px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; }
.legend .l-ida { background: var(--persiana-700); color: #fff; }
.legend i .ic { width: 12px; height: 12px; stroke-width: 2.8; }
.legend .l-ida .ic { transform: rotate(90deg); }
.legend .l-vta .ic { transform: rotate(-90deg); }
.legend .l-vta { background: var(--card); color: var(--accent-ink); box-shadow: inset 0 0 0 2px var(--accent-ink); }

.line-diagram { position: relative; --row: 58px; padding-left: 0; }
.line-cols { display: flex; justify-content: flex-end; gap: 10px; padding-right: 10px; margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--fg-2); }
.line-cols span { width: 68px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; }
.line-rail {
  position: absolute; left: 39px; width: 6px; border-radius: 6px;
  top: calc(var(--row) / 2); bottom: calc(var(--row) / 2);
  background: var(--persiana-700);
}
.line-row {
  position: relative; display: grid; grid-template-columns: 84px 1fr auto; align-items: center;
  height: var(--row); width: 100%; text-align: left;
  border-radius: var(--r-s);
  transition: background .2s;
}
.line-row:hover { background: var(--bg-2); }
.line-row .node { justify-self: center; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 4px solid var(--persiana-700); position: relative; z-index: 1; margin-left: 0; transform: translateX(-0px); }
.line-row.is-term .node { width: 24px; height: 24px; border-color: var(--fg); border-width: 5px; }
.line-row.is-mine .node { border-color: var(--fg); border-width: 5px; box-shadow: 0 0 0 4px var(--line-2); }
.line-row .nm { font: 650 16px/1.15 var(--font-display); letter-spacing: -.01em; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-wrap: balance; }
.line-row.is-term .nm { font-weight: 780; }
.line-row .nm .ic { display: inline-block; width: 14px; height: 14px; vertical-align: -1px; fill: var(--fav); stroke: var(--fav); margin-left: 4px; }
.line-row .nx { display: grid; grid-auto-flow: column; gap: 10px; font: 600 13.5px/1.2 var(--font-display); color: var(--fg-2); font-variant-numeric: tabular-nums; padding-right: 10px; text-align: right; }
.line-row .nx span { width: 68px; }
.line-row .nx b { color: var(--fg); font-weight: 700; }
.line-tram {
  position: absolute; z-index: 2; top: 0; left: 0;
  width: 30px; height: 22px; margin: -11px 0 0 0;
  display: grid; place-items: center; border-radius: 11px;
  font-size: 12px; font-weight: 900;
  transform: translate3d(var(--x), var(--y), 0);
  transition: transform 1s linear;
  box-shadow: 0 3px 8px -2px rgba(var(--shade), .45);
  pointer-events: none;
}
.line-tram .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.line-tram--ida { --x: 3px; background: var(--persiana-700); color: #fff; }
.line-tram--vuelta { --x: 51px; background: var(--card); color: var(--accent-ink); box-shadow: inset 0 0 0 2px var(--accent-ink), 0 3px 8px -2px rgba(var(--shade), .35); }
.line-trams { position: absolute; inset: 0; pointer-events: none; }

/* ── Horarios ────────────────────────────────────────── */
.sched-controls { display: grid; gap: 10px; margin-bottom: 16px; }
.tt { border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); overflow: hidden; }
.tt-row { display: grid; grid-template-columns: 56px 1fr; align-items: start; border-top: 1px solid var(--line); }
.tt-row:first-child { border-top: 0; }
.tt-h { padding: 12px 0 12px 16px; font: 800 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--accent-ink); letter-spacing: -.02em; }
.tt-m { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 10px 4px; }
.tt-m span {
  display: inline-flex; align-items: center; gap: 3px;
  min-width: 42px; justify-content: center; padding: 5px 8px; border-radius: 8px;
  font: 650 16px/1.1 var(--font-display); font-variant-numeric: tabular-nums;
}
.tt-m span.is-past { color: var(--fg-3); opacity: .55; }
.tt-m span.is-next { background: var(--persiana-700); color: #fff; box-shadow: 0 6px 14px -8px rgba(var(--shade), .8); }
.tt-m span { position: relative; }
.tt-m span.is-short, .tt-chip.is-short { outline: 1.5px dashed var(--accent-ink); outline-offset: -2.5px; }
.tt-m span.is-next.is-short { outline-color: rgba(255, 255, 255, .9); }
.tt-m span.is-school::after, .tt-chip.is-school::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); }
.tt-m span.is-next.is-school::after { background: #fff; }
.tt-chip {
  position: relative; display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; margin-right: 6px; border-radius: 7px;
  font: 650 13px/1 var(--font-display); font-style: normal; font-variant-numeric: tabular-nums; color: var(--fg);
  background: var(--card); vertical-align: middle;
}
.tt-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 7px; font-size: 12.5px; color: var(--fg-2); }
.tt-key > span { display: inline-flex; align-items: center; }
.tt-m span.is-off { color: var(--fg-3); text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .6; }
.tt-row.is-past-hour .tt-h { color: var(--fg-3); }
.tt-note { margin-top: 12px; display: grid; gap: 6px; }
.tt-note p { font-size: 13px; color: var(--fg-2); line-height: 1.5; }
.tt-note .tt-day { color: var(--fg-2); }
/* Cabecera fija del horario: siempre sabes qué parada, sentido y día estás leyendo */
.tt-sticky {
  position: sticky; top: 0; z-index: 3;
  margin: 0 calc(-1 * var(--sheet-pad)) 10px; padding: 9px var(--sheet-pad) 10px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.tt-sticky b { display: block; font: 760 17px/1.15 var(--font-display); letter-spacing: -.015em; font-stretch: 92%; }
.tt-sticky small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--fg-2); }
.approach .est { color: var(--on-shell-2); font-size: .92em; font-weight: 500; white-space: nowrap; }
.tt-row.is-next-row { scroll-margin-top: 96px; }

/* ── Favoritos ───────────────────────────────────────── */
.empty { text-align: center; padding: 28px 18px 18px; display: grid; justify-items: center; gap: 12px; }
.empty-art { width: 120px; height: 92px; border-radius: 14px; background: var(--frame); padding: 8px; display: grid; gap: 4px; box-shadow: var(--shadow-2); }
.empty-art i { display: block; border-radius: 4px; background: linear-gradient(to bottom, rgba(255,255,255,.12) 0 2px, transparent 2px calc(100% - 3px), rgba(0,0,0,.25) calc(100% - 3px)), var(--slat); }
.empty h3 { font: 740 20px/1.15 var(--font-display); letter-spacing: -.015em; }
.empty p { color: var(--fg-2); max-width: 32ch; text-wrap: pretty; }

/* ── Más ─────────────────────────────────────────────── */
.list { display: grid; border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); overflow: hidden; }
.list > a, .list > button, .list > .list-row {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 14px;
  min-height: 56px; padding: 10px 16px; width: 100%; text-align: left;
  border-top: 1px solid var(--line); color: var(--fg); text-decoration: none;
  transition: background .2s;
}
.list > :first-child { border-top: 0; }
.list > a:hover, .list > button:hover { background: var(--bg-2); }
.list .ic { color: var(--accent-ink); }
.list .end { color: var(--fg-3); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.list .end .ic { color: var(--fg-3); width: 18px; height: 18px; }
.list small { display: block; color: var(--fg-3); font-size: 13px; margin-top: 1px; }
.list-row--seg { grid-template-columns: 24px 1fr !important; }
.list-row--seg .seg { grid-column: 1 / -1; }
.prose { display: grid; gap: 10px; color: var(--fg-2); font-size: 15px; text-wrap: pretty; }
.prose b { color: var(--fg); }
.credit { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.credit img { width: 120px; height: auto; }

/* ── Leaflet ─────────────────────────────────────────── */
.leaflet-container { font: inherit; background: var(--map-bg); outline: none; }
.leaflet-tile-pane { filter: var(--tile-filter); }
.leaflet-control-attribution {
  font-size: 10.5px !important; background: color-mix(in srgb, var(--card) 82%, transparent) !important; color: var(--fg-2) !important;
  border-radius: 8px 0 0 0; padding: 2px 8px !important; backdrop-filter: blur(6px);
}
.leaflet-control-attribution a { color: var(--accent-ink) !important; }
.leaflet-bottom { bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--sheet-visible)); transition: bottom .52s var(--ease-out); }
.sheet-dragging .leaflet-bottom, .sheet-dragging .map-fabs { transition: none; }
.sheet-full .leaflet-bottom { opacity: 0; pointer-events: none; }
.leaflet-control-zoom { display: none; }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--fg) !important; background: var(--card) !important; border-color: var(--line) !important; }

.tg-route-casing { stroke: var(--card); }
.tg-route { stroke: var(--persiana-700); }
[data-theme="dark"] .tg-route { stroke: #1F8F5A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tg-route { stroke: #1F8F5A; } }
[data-theme="dark"] .stn-pin.is-active::after { border-color: #E8F1EA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stn-pin.is-active::after { border-color: #E8F1EA; } }

.stn-pin { width: 18px; height: 18px; margin: -9px 0 0 -9px; position: relative; }
.stn-pin i { position: absolute; inset: 2px; border-radius: 50%; background: #fff; border: 3.5px solid var(--persiana-700); transition: transform .25s var(--ease-out); }
.stn-pin.is-term { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.stn-pin.is-term i { border-width: 5px; border-color: var(--hierro); }
.stn-pin.is-fav i { background: var(--persiana-700); box-shadow: inset 0 0 0 2px #fff; }
.stn-pin.is-active i { transform: scale(1.35); border-color: var(--hierro); }
.stn-pin.is-active::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 3px solid var(--hierro); animation: halo 1.6s var(--ease-out) 3;
}
.stn-pin.is-near i { border-color: var(--gps); }
@keyframes halo { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.leaflet-marker-icon:hover .stn-pin i { transform: scale(1.25); }

.leaflet-tooltip.stn-label {
  background: none; border: 0; box-shadow: none; padding: 0 4px;
  font: 720 12.5px/1 var(--font-display); letter-spacing: -.005em; color: var(--hierro);
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 6px #fff, 0 0 8px rgba(255,255,255,.9);
  white-space: nowrap;
}
.leaflet-tooltip.stn-label::before { display: none; }
.leaflet-tooltip.stn-label.is-term { font-size: 14px; font-weight: 800; }
.leaflet-tooltip.stn-label.is-pill {
  padding: 4px 9px; border-radius: 99px; background: #fff; color: var(--hierro);
  text-shadow: none; box-shadow: 0 4px 12px -4px rgba(6, 38, 24, .4), 0 0 0 1px rgba(15, 94, 59, .14);
}
[data-theme="dark"] .leaflet-tooltip.stn-label { color: #E8F1EA; text-shadow: 0 0 3px #08140E, 0 0 6px #08140E, 0 0 9px #08140E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tooltip.stn-label { color: #E8F1EA; text-shadow: 0 0 3px #08140E, 0 0 6px #08140E, 0 0 9px #08140E; } }
[data-theme="dark"] .leaflet-tooltip.stn-label.is-pill { background: var(--persiana-900); color: #E8F1EA; text-shadow: none; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .6), 0 0 0 1px rgba(160, 220, 185, .24); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tooltip.stn-label.is-pill { background: var(--persiana-900); color: #E8F1EA; text-shadow: none; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .6), 0 0 0 1px rgba(160, 220, 185, .24); } }
.z-xlow .stn-label:not(.is-xmajor):not(.is-keep),
.z-low .stn-label:not(.is-major):not(.is-keep),
.z-mid .stn-label.is-minor:not(.is-keep) { opacity: 0 !important; visibility: hidden; }
.leaflet-tooltip.stn-label { transition: opacity .25s, visibility .25s; }
.leaflet-tooltip.stn-label.is-under-ui:not(.is-pill) { opacity: 0 !important; visibility: hidden; }

.tram-icon { transition: transform 1s linear; }
.no-glide .tram-icon { transition: none; }
.tram {
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  display: grid; place-items: center; cursor: pointer;
  transform: translate(var(--ox, 0px), var(--oy, 0px)); transition: transform 1s linear;
}
.tram .tram-svg { width: 46px; height: 15px; overflow: visible; transform: rotate(var(--rot, 0deg)); transition: transform 1s linear; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.tram:hover .tram-svg { filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)) brightness(1.08); }

.user-dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--gps); box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.3); position: relative; }
.user-dot::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; background: var(--gps); opacity: .25; animation: ping 2s var(--ease-out) infinite; }

.tg-route-draw { animation: draw 1.4s var(--ease-io) .2s both; }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

/* ── Diálogos ────────────────────────────────────────── */
.dlg {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--r-xl);
  background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow-3);
  overflow: auto; overscroll-behavior: contain;
}
.dlg::backdrop { background: rgba(6, 26, 17, .5); backdrop-filter: blur(3px); }
.dlg[open] { animation: dlg-in .42s var(--ease-out); }
.dlg[open]::backdrop { animation: fade-in .3s var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 4px 20px; }
.dlg-head h2 { flex: 1; font: 760 21px/1.15 var(--font-display); letter-spacing: -.02em; }
.dlg-body { padding: 8px 20px 20px; display: grid; gap: 14px; }

.placa {
  border-radius: var(--r-l); overflow: hidden; background: #fff; color: var(--hierro);
  box-shadow: var(--shadow-2), inset 0 0 0 1px rgba(15, 94, 59, .12);
}
.placa-top {
  padding: 14px 18px 16px;
  background: var(--persiana-700);
  color: #fff;
}
.placa-top img { width: 112px; height: auto; margin-bottom: 12px; }
.placa-top strong { display: block; font: 780 26px/1.02 var(--font-display); letter-spacing: -.025em; font-stretch: 88%; }
.placa-top span { display: block; font-size: 13.5px; color: #CFE3D6; margin-top: 4px; }
.placa-qr { padding: 18px 18px 8px; display: grid; justify-items: center; }
.placa-qr svg { width: min(230px, 62vw); height: auto; }
.placa-qr svg .qr-band { animation: qr-band .5s var(--ease-out) both; animation-delay: calc(var(--b) * 45ms + 120ms); transform-box: fill-box; transform-origin: 50% 0; }
@keyframes qr-band { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: none; } }
.placa-url { text-align: center; padding: 6px 16px 16px; font: 700 14px/1.3 var(--font-ui); color: var(--persiana-700); word-break: break-all; }
.placa-url small { display: block; font-weight: 400; color: #5F6E65; font-size: 12.5px; margin-top: 2px; }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.share-grid .btn { min-height: 48px; min-width: 0; padding: 0 10px; white-space: normal; text-align: center; line-height: 1.15; }
.share-grid .btn--primary { grid-column: 1 / -1; }

.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; font-size: 15px; color: var(--fg-2); }
.steps li::before { counter-increment: s; content: counter(s); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--persiana-700); color: #fff; font: 800 14px/1 var(--font-display); }
.steps b { color: var(--fg); }
.steps .ic { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; color: var(--gps); }

/* ── Aviso flotante ──────────────────────────────────── */
.toast {
  position: fixed; left: 50%; z-index: 120;
  top: calc(var(--top-h) + 6px);
  width: max-content; max-width: min(calc(100vw - 32px), 420px);
  padding: 12px 16px; border-radius: var(--r-m); line-height: 1.4;
  background: var(--hierro); color: #fff; font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow-3);
  display: flex; align-items: center; gap: 12px;
  transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  transition: transform .34s var(--ease-out), opacity .25s var(--ease-out);
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { color: var(--tranvia); font-weight: 800; padding: 4px 2px; }
[data-theme="dark"] .toast { background: #E8F1EA; color: #08140E; }
[data-theme="dark"] .toast button { color: var(--persiana-600); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .toast { background: #E8F1EA; color: #08140E; }
  :root:not([data-theme="light"]) .toast button { color: var(--persiana-600); }
}

.noscript { padding: 18px 4px; display: grid; gap: 10px; }

/* ── Cartel para imprimir ────────────────────────────── */
.print-poster { display: none; }
@media print {
  @page { size: A5 portrait; margin: 0; }
  html, body { height: auto; overflow: visible; background: #fff; }
  body > *:not(.print-poster) { display: none !important; }
  .print-poster { display: block !important; width: 148mm; height: 210mm; }
  .print-poster .pp {
    width: 148mm; height: 210mm; display: grid; grid-template-rows: auto 1fr auto; color: #16201A;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .pp-top { background: repeating-linear-gradient(to bottom, rgba(255,255,255,.08) 0 1.2mm, transparent 1.2mm 8mm, rgba(0,0,0,.2) 8mm 9.5mm), #0F5E3B; color: #fff; padding: 12mm 12mm 10mm; }
  .pp-top img { width: 46mm; height: auto; margin-bottom: 8mm; }
  .pp-top strong { display: block; font: 800 15mm/1 'Bricolage Grotesque', sans-serif; letter-spacing: -.03em; font-stretch: 88%; }
  .pp-top span { display: block; font: 400 4.6mm/1.3 'Atkinson Hyperlegible Next', sans-serif; margin-top: 3mm; color: #DCEBE1; }
  .pp-mid { display: grid; place-items: center; align-content: center; gap: 5mm; padding: 6mm 12mm; }
  .pp-mid svg { width: 78mm; height: 78mm; }
  .pp-mid p { font: 700 5.2mm/1.25 'Bricolage Grotesque', sans-serif; text-align: center; max-width: 100mm; }
  .pp-foot { padding: 0 12mm 9mm; font: 400 3.4mm/1.4 'Atkinson Hyperlegible Next', sans-serif; color: #46544B; display: flex; justify-content: space-between; gap: 6mm; }
  .pp-foot b { color: #0F5E3B; }
}

/* ── Escritorio ──────────────────────────────────────── */
@media (min-width: 900px) {
  :root { --sheet-visible: 100vh; }
  .app {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .topbar { position: relative; grid-column: 1; grid-row: 1; padding: 16px 16px 12px; background: var(--bg); z-index: 25; }
  .search-list { left: -4px; right: -60px; }
  .map-area { position: relative; grid-column: 2; grid-row: 1 / 4; }
  .sheet {
    position: relative; grid-column: 1; grid-row: 2; z-index: 20;
    left: auto; right: auto; bottom: auto; height: auto; min-height: 0;
    transform: none !important; transition: none;
    border-radius: 0; box-shadow: none;
  }
  .sheet-grip { display: none; }
  .sheet-body { height: 100%; flex: 1; --sheet-pad: 18px; padding: 4px var(--sheet-pad) 28px; }
  .tabbar { position: relative; grid-column: 1; grid-row: 3; height: 70px; padding: 0 10px; }
  .app::after { content: ''; position: absolute; top: 0; bottom: 0; left: 420px; width: 1px; background: var(--line-2); box-shadow: 4px 0 18px rgba(var(--shade), .12); z-index: 22; pointer-events: none; }
  .map-fabs { top: auto; bottom: 28px; right: 20px; }
  .leaflet-bottom { bottom: 0 !important; }
  .leaflet-control-zoom { display: block; margin: 0 20px 136px 0 !important; border: 0 !important; box-shadow: var(--shadow-2) !important; border-radius: 12px !important; overflow: hidden; }
  .leaflet-right .leaflet-control-zoom { margin-right: 20px !important; }
  .toast { top: 20px; left: calc(420px + (100vw - 420px) / 2); }
}

/* Pantallas bajas en horizontal */
@media (max-width: 899px) and (max-height: 520px) {
  :root { --tabbar-h: 54px; --top-h: calc(var(--safe-t) + 62px); }
  .tab span { display: none; }
}

/* Móviles estrechos */
@media (max-width: 360px) {
  .count { font-size: 30px; }
  .slat--dep .count { font-size: 40px; }
  .slat--dep, .dep-row { grid-template-columns: 52px minmax(0, 1fr) auto 44px; }
  .stn-title h2 { font-size: 26px; }
  .fab { padding: 0 12px 0 10px; font-size: 13.5px; }
}

/* ── Movimiento reducido ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .view.is-active { animation: fade-in .2s linear !important; animation-duration: .2s !important; }
  .sheet { transition-duration: .2s !important; }
  .tram-icon, .line-tram, .tram .tram-svg { transition: none !important; }
  .splash { display: none; }
}

/* Ver la parada dentro de la app (Street View / satélite) */
.dlg--view { width: min(720px, calc(100vw - 16px)); }
.view-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-m); background: var(--bg-2); }
.view-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: calc(var(--r-m) - 3px); background: transparent; color: var(--fg-2); font: inherit; font-weight: 650; cursor: pointer; }
.view-tabs button[aria-selected="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.12)); }
.view-frame { position: relative; aspect-ratio: 4 / 5; max-height: 62dvh; width: 100%; border-radius: var(--r-l); overflow: hidden; background: var(--bg-2); }
@media (min-width: 700px) { .view-frame { aspect-ratio: 16 / 10; } }
.view-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Foto de la parada (Street View) arriba de los horarios: al tocarla se abre en 360° */
.stn-photo { position: relative; display: block; width: 100%; aspect-ratio: 32 / 15; margin: 2px 0 14px; padding: 0; border: 0; border-radius: var(--r-l); overflow: hidden; background: var(--bg-2); cursor: pointer; }
.stn-photo[hidden] { display: none; }
.stn-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease-out); }
.stn-photo:hover img { transform: scale(1.03); }
.stn-photo:active img { transform: scale(.99); }
.stn-photo-tag { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(6, 26, 17, .72); color: #fff; font-size: 13.5px; font-weight: 650; backdrop-filter: blur(6px); }
@media (prefers-reduced-motion: reduce) { .stn-photo img { transition: none; } }

/* Incidencias avisadas por viajeros */
.inc-block { margin: 18px 0 6px; display: grid; gap: 10px; }
.inc-block .section-title { margin: 0; }
.inc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.inc-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--r-m); background: #FFF4E0; color: #4A2E00; box-shadow: inset 3px 0 0 #E08A00; }
.inc-item b { display: block; font-size: 15px; }
.inc-item small { display: block; font-size: 13px; opacity: .8; margin-top: 1px; }
.inc-item .ic { color: #B86E00; margin-top: 1px; }
.inc-block .btn .ic { margin-right: 6px; }
.inc-choices { display: grid; gap: 4px; }
.inc-choices .row-item { width: 100%; text-align: left; }
.inc-choices .row-item.is-busy { opacity: .6; }
.inc-home .ic { color: #E08A00; }
.stn-pin.has-inc::after {
  content: '!'; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  width: 26px; height: 23px; padding-top: 6px; box-sizing: border-box;
  font: 900 13px/1 system-ui, sans-serif; color: #2B1B00; text-align: center;
  background: #FFB020; clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); animation: inc-pulse 1.8s ease-in-out infinite; pointer-events: none;
}
@keyframes inc-pulse { 50% { transform: translateX(-50%) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .stn-pin.has-inc::after { animation: none; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .inc-item { background: #3A2A10; color: #FBE3B8; }
  :root:not([data-theme="light"]) .inc-item .ic { color: #F2A93B; }
}
:root[data-theme="dark"] .inc-item { background: #3A2A10; color: #FBE3B8; }
:root[data-theme="dark"] .inc-item .ic { color: #F2A93B; }

.inc-item q { display: block; font-size: 14px; font-style: italic; margin-top: 3px; quotes: '«' '»'; }
.dlg--inc .dlg-body { gap: 12px; }
.inc-current { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-l); background: var(--bg-2); }
.inc-q { margin: 0; font-size: 15.5px; }
.inc-yn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inc-yn .btn { min-height: 44px; justify-content: center; }
.inc-or { margin: 2px 0 0; font-weight: 650; color: var(--fg-2); }
.inc-text { display: grid; gap: 4px; position: relative; }
.inc-text span { font-size: 13.5px; color: var(--fg-2); font-weight: 600; }
.inc-text textarea { width: 100%; box-sizing: border-box; resize: none; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: var(--r-m); border: 1.5px solid var(--line-2, #ccd); background: var(--card); color: var(--fg); }
.inc-text textarea:focus { outline: none; border-color: var(--accent); }
.inc-count { justify-self: end; font-size: 12px; color: var(--fg-3); }
.inc-choices .row-item:disabled { opacity: .55; }

/* Vista 3D del tranvía */
.dlg--3d { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; background: #0b1d14; }
@media (min-width: 900px) { .dlg--3d { width: min(980px, 94vw); height: min(720px, 90dvh); margin: auto; border-radius: var(--r-xl); } }
.t3d { position: absolute; inset: 0; }
.dlg--3d { padding: 0; overflow: hidden; }
.t3d .t3d-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.t3d-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 8px; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 28px 16px; background: linear-gradient(rgba(6,26,17,.78), rgba(6,26,17,0)); color: #fff; pointer-events: none; }
.t3d-title { flex: 1; }
.t3d-title h2 { font: 760 20px/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; }
.t3d-title p { margin: 2px 0 0; font-size: 13px; opacity: .85; }
.t3d-close { pointer-events: auto; background: rgba(255,255,255,.92); color: #0C4A30; }
.t3d-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 650; }
.t3d-card { position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 460px; margin-inline: auto; padding: 12px 14px; border-radius: var(--r-l); background: var(--card); color: var(--fg); box-shadow: var(--shadow-3); display: grid; gap: 8px; }
.t3d-next { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 10px; }
.t3d-next small { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); }
.t3d-next b { font: 760 19px/1.2 var(--font-display); }
.t3d-next span { font-weight: 650; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.t3d-next em { grid-column: 1 / -1; font-style: normal; font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.t3d-next em:empty { display: none; }
.t3d-bar { height: 5px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.t3d-bar i { display: block; height: 100%; width: 0; background: #1FA463; }
.t3d-actions { display: flex; gap: 8px; }
.t3d-tram .tram-svg { width: 76px; height: 24px; filter: drop-shadow(0 4px 5px rgba(0,0,0,.45)); }
.t3d .maplibregl-ctrl-attrib { font-size: 10px; }

/* Tour de bienvenida */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour-hole { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(6, 26, 17, .68); transition: all .35s var(--ease-out); pointer-events: none; outline: 3px solid #2DB868; outline-offset: 2px; }
.tour.is-center .tour-hole { outline: none; }
.tour-card { position: fixed; background: var(--card); color: var(--fg); border-radius: var(--r-l); padding: 16px 16px 12px; box-shadow: var(--shadow-3); display: grid; gap: 6px; max-width: 360px; transition: top .35s var(--ease-out), left .35s var(--ease-out); }
.tour.is-center .tour-card { width: min(360px, calc(100vw - 24px)); }
.tour-step { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
.tour-card h2 { margin: 0; font: 760 20px/1.2 var(--font-display); letter-spacing: -.02em; }
.tour-text { margin: 0 0 6px; font-size: 15px; line-height: 1.45; color: var(--fg-2); }
.tour-actions { display: flex; align-items: center; gap: 6px; }
.tour-sp { flex: 1; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }

/* Mientras dura el tour, fuera lo que estorba */
.touring .consent, .touring .toast, .touring .ad-slot, .touring .leaflet-control-zoom, .touring .plain-line, .touring .search-list { display: none !important; }
.touring .map-fabs { opacity: 1; }

/* Conexiones de una parada */
.cx-block { margin: 18px 0 6px; display: grid; gap: 8px; }
.cx-block .section-title { margin: 0; }
.cx-list { display: grid; gap: 6px; }
.cx-chip { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: var(--r-m); background: var(--card); color: var(--fg); text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.cx-chip b { justify-self: start; padding: 5px 9px; border-radius: 8px; background: var(--persiana-700); color: #fff; font: 760 13.5px/1 var(--font-display); }
.cx-chip span { font-size: 14px; color: var(--fg-2); }
.cx-more { justify-self: start; font-weight: 700; }

/* Web oficial en la parada */
.stn-official { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin: 0 0 12px; padding: 0 14px; border-radius: 999px; background: var(--bg-2); color: var(--accent-ink); font-weight: 700; font-size: 14.5px; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.stn-official .ic { width: 16px; height: 16px; }

/* Paradas de bus y taxi en el mapa */
.poi span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.28), 0 0 0 2px #fff; }
.poi svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.poi--bus span { background: #2563C9; }
.poi--taxi span { background: #F2B705; }
.poi--taxi svg { stroke: #2B1B00; }
.poi-popup .leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--shadow-3); background: var(--card); color: var(--fg); }
.poi-popup .leaflet-popup-tip { background: var(--card); }
.poi-popup .leaflet-popup-content { margin: 14px 16px; font: 15px/1.35 var(--font-ui); }
.poi-pop { display: grid; gap: 6px; }
.poi-pop b { font: 760 18px/1.2 var(--font-display); }
.poi-kind { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
.poi-lines { display: flex; flex-wrap: wrap; gap: 6px; }
.poi-line { padding: 5px 9px; border-radius: 8px; background: var(--persiana-700); color: #fff !important; font: 760 13.5px/1 var(--font-display); text-decoration: none; }
.poi-line--plain { background: var(--bg-2); color: var(--fg) !important; }
.poi-hint, .poi-src { margin: 0; font-size: 13px; color: var(--fg-3); }
.poi-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.poi-btn { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 999px; background: var(--persiana-700); color: #fff !important; font-weight: 700; font-size: 14px; text-decoration: none; }
.poi-open .map-fabs { opacity: 0; pointer-events: none; }
.poi-btn--ghost { background: transparent; color: var(--accent-ink) !important; box-shadow: inset 0 0 0 1.5px var(--line-2); }
