/* =====================================================================
   RADAR GALICIA · estilos
   Móbil primeiro: o mapa enche a pantalla; os controis flotan enriba.
   ===================================================================== */
:root {
  --ink: #14171c; --ink-2: #3a404a; --muted: #5b626c;
  --surface: #ffffff; --surface-2: #f4f6f3; --line: #dde0da; --line-2: #cdd1ca;
  --md: #2447c7; --md-soft: #e9edfb;
  --reg: #16784a; --reg-soft: #e2f2e9;
  --stale: #858b93;
  --ok: #1b7a4b; --warn: #b07a00; --danger: #c0392b;
  --shadow: 0 1px 2px rgba(20, 23, 28, .08), 0 10px 30px -12px rgba(20, 23, 28, .35);
  --r: 16px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --inv-bg: #14171c; --inv-fg: #ffffff; --atr-fg: #a3470f; --atr-bg: #fdebe1; --soft: #fbfcfa; --mapbg: #e9ece6;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
.mono { font-family: var(--mono); }
body { font: 400 15px/1.45 Geist, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--mapbg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--md); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--md-soft); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#mapa { position: fixed; inset: 0; z-index: 0; background: var(--mapbg); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10.5px; background: rgba(255,255,255,.82) !important; }
.leaflet-bottom.leaflet-right { margin-bottom: calc(var(--safe-b)); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 42px !important; height: 42px !important; line-height: 42px !important; font-size: 20px !important; color: var(--ink) !important; }

/* ---------- Barra superior ---------- */
.barra {
  position: fixed; z-index: 500; top: calc(10px + var(--safe-t)); left: 10px; right: 10px;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid rgba(20,23,28,.06); border-radius: var(--r); box-shadow: var(--shadow);
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: var(--md); color: #fff; display: grid; place-items: center; flex: none; }
.logo svg { width: 22px; height: 22px; }
.marca-t { min-width: 0; }
.marca-t h1 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; }
.marca-t p { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.estado { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); }
.estado .punto { width: 10px; height: 10px; border-radius: 99px; background: var(--stale); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--stale) 22%, transparent); }
.estado.ok .punto { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); animation: latexo 2.4s ease-in-out infinite; }
.estado.vello .punto { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.estado.erro .punto { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
@keyframes latexo { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 8%, transparent); } }
.estado-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.estado-t b { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.estado-t small { font: 500 11.5px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.estado-t .curto { display: none; }
.barra-acts { display: flex; align-items: center; gap: 6px; }
.idioma { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface-2); }
.idioma button { border: 0; background: transparent; height: 28px; min-width: 32px; padding: 0 8px; border-radius: 99px; font: 600 12px/1 var(--mono); color: var(--muted); }
.idioma button[aria-pressed="true"] { background: var(--inv-bg); color: var(--inv-fg); }
.ibtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.ibtn svg { width: 20px; height: 20px; }

/* ---------- Filtros ---------- */
.filtros { position: fixed; z-index: 650; left: 10px; bottom: calc(18px + var(--safe-b)); display: flex; gap: 8px; flex-wrap: wrap; max-width: calc(100% - 80px); }
.filtro { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; cursor: pointer; user-select: none; position: relative; }
.filtro input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filtro .caixa { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); display: grid; place-items: center; transition: background-color .15s, border-color .15s; }
.filtro input:checked + .caixa { background: var(--c); border-color: var(--c); }
.filtro input:checked + .caixa::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: translateY(-1px) rotate(-45deg); }
.filtro input:focus-visible + .caixa { outline: 2px solid var(--c); outline-offset: 2px; }
.filtro .ico { width: 10px; height: 10px; border-radius: 99px; background: var(--c); }
.filtro em { font: 600 12px/1 var(--mono); font-style: normal; color: var(--muted); padding: 3px 6px; border-radius: 99px; background: var(--surface-2); }
.filtro.md { --c: var(--md); }
.filtro.regional { --c: var(--reg); }
.filtro:has(input:not(:checked)) { color: var(--muted); }

/* ---------- Marcadores dos trens ---------- */
.tren-ico { background: transparent !important; border: 0 !important; }
.tren { position: relative; width: 38px; height: 38px; }
.tren .corpo { position: absolute; inset: 4px; border-radius: 99px; background: var(--c); color: #fff; display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .2s ease, background-color .3s; }
.tren .corpo svg { width: 16px; height: 16px; }
.tren .rumbo { position: absolute; inset: 0; transition: transform .6s ease; }
.tren .rumbo::before { content: ""; position: absolute; left: 50%; top: -3px; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--c); filter: drop-shadow(0 -1px 0 #fff) drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.tren.sen-rumbo .rumbo { display: none; }
.tren.md { --c: var(--md); }
.tren.regional { --c: var(--reg); }
.tren.sen-datos { --c: var(--stale); }
.tren.sen-datos .corpo { opacity: .85; }
.tren.escollido .corpo { transform: scale(1.18); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent), 0 3px 10px rgba(0,0,0,.35); }
.tren-num { background: var(--surface) !important; border: 0 !important; border-radius: 8px !important; box-shadow: var(--shadow) !important; font: 600 11.5px/1.2 var(--mono) !important; color: var(--ink) !important; padding: 3px 7px !important; }
.tren-num::before { display: none !important; }
.estacion-tt { font: 500 12px/1.2 Geist, sans-serif !important; padding: 3px 7px !important; border-radius: 7px !important; }

/* ---------- Aviso ---------- */
.aviso { position: fixed; z-index: 450; left: 50%; top: calc(84px + var(--safe-t)); transform: translateX(-50%); width: min(420px, calc(100% - 20px)); padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; color: var(--ink-2); text-align: center; }

/* ---------- Tarxeta do tren ---------- */
.tarxeta {
  position: fixed; z-index: 600; left: 0; right: 0; bottom: 0; max-height: 72dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px -10px rgba(20,23,28,.4);
  padding: 8px 18px calc(18px + var(--safe-b)); animation: sube .28s cubic-bezier(.23,1,.32,1);
}
@keyframes sube { from { transform: translateY(30px); opacity: 0; } }
.asa { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 2px auto 10px; }
.tarxeta .pechar { position: absolute; top: 12px; right: 12px; }
.t-cat { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 99px; font-weight: 650; font-size: 13.5px; background: var(--cs); color: var(--c); }
.t-cat.md { --c: var(--md); --cs: var(--md-soft); }
.t-cat.regional { --c: var(--reg); --cs: var(--reg-soft); }
.t-cat .ico { width: 16px; height: 16px; }
.t-cat small { font: 500 11px/1 var(--mono); opacity: .8; }
.t-tit { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 10px 44px 2px 0; }
.t-sub { color: var(--muted); font-size: 13.5px; }
.t-estado { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.t-estado .p { width: 10px; height: 10px; border-radius: 99px; margin-top: 6px; flex: none; background: var(--ok); }
.t-estado.sen .p { background: var(--stale); }
.t-estado b { display: block; font-weight: 650; }
.t-estado span { font-size: 13.5px; color: var(--ink-2); }
.t-atraso { font-weight: 650; }
.t-atraso.si { color: var(--danger); }
.t-atraso.non { color: var(--ok); }
.t-grella { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 14px; }
.t-dato { min-width: 0; }
.t-dato .k { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.t-dato .v { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.t-dato .v.mono { font: 600 13.5px/1.35 var(--mono); }
.t-dato.ancho { grid-column: 1 / -1; }
.t-nota { margin-top: 12px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.t-nota .anim { display: inline-block; width: 9px; height: 9px; border-radius: 99px; background: var(--md); margin-top: 4px; flex: none; }
.t-nota .anim.quieto { background: var(--ink); }
details.t-paradas { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.t-paradas summary { cursor: pointer; font-weight: 650; font-size: 14px; padding: 4px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.t-paradas summary::-webkit-details-marker { display: none; }
details.t-paradas summary::after { content: "+"; font: 600 18px/1 var(--mono); color: var(--muted); }
details.t-paradas[open] summary::after { content: "−"; }
.t-lista { list-style: none; margin: 8px 0 0; padding: 0; }
.t-lista li { display: grid; grid-template-columns: 52px 14px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 0; font-size: 14px; }
.t-lista .h { font: 500 12.5px/1 var(--mono); color: var(--muted); }
.t-lista .d { width: 10px; height: 10px; border-radius: 99px; border: 2px solid var(--line-2); background: var(--surface); justify-self: center; }
.t-lista li.gal .d { border-color: var(--c, var(--md)); }
.t-lista li.aqui { font-weight: 700; }
.t-lista li.aqui .d { background: var(--c, var(--md)); border-color: var(--c, var(--md)); }
.t-fonte { margin-top: 14px; font-size: 11.5px; color: var(--muted); }

/* ---------- Diálogo de información ---------- */
dialog { border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: 86dvh; box-shadow: var(--shadow); color: var(--ink); }
dialog::backdrop { background: rgba(10,12,16,.4); }
dialog[open] { display: flex; flex-direction: column; }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.dlg-h h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.dlg-b { padding: 14px 18px 20px; overflow-y: auto; font-size: 14.5px; color: var(--ink-2); }
.dlg-b h3 { font-size: 14.5px; color: var(--ink); margin: 16px 0 6px; }
.dlg-b h3:first-child { margin-top: 0; }
.dlg-b p, .dlg-b ul { margin: 0 0 8px; }
.dlg-b ul { padding-left: 18px; }
.dlg-b li { margin-bottom: 4px; }
.dlg-b a { color: var(--md); }
.dlg-b code { font: 500 12.5px var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- Pantallas grandes ---------- */
@media (min-width: 760px) {
  .barra { left: 16px; right: auto; top: calc(16px + var(--safe-t)); padding-right: 10px; gap: 14px; }
  .filtros { left: 16px; bottom: 24px; }
  body.con-tarxeta .leaflet-bottom.leaflet-right { right: 404px; }
  .tarxeta { left: auto; right: 16px; top: calc(16px + var(--safe-t)); bottom: 16px; width: 380px; max-height: none; border-radius: 20px; box-shadow: var(--shadow); padding-top: 16px; animation-name: entra; }
  @keyframes entra { from { transform: translateX(20px); opacity: 0; } }
  .asa { display: none; }
  .aviso { top: calc(92px + var(--safe-t)); }
}
@media (max-width: 420px) {
  .marca-t h1 { font-size: 15px; }
  .barra .idioma { display: none; }   /* só o da barra; o de «Sobre os datos» sempre visible */
  .estado { padding: 6px 9px; }
  .estado-t .longo { display: none; }
  .estado-t .curto { display: inline; }
}
@media (max-width: 340px) { .logo { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.t-cat small { color: inherit; opacity: 1; }
.leaflet-control-attribution a { text-decoration: underline; }
.dlg-b a { text-decoration: underline; }

/* ---------- Botón lista ---------- */
.btn-lista { border: 0; color: var(--ink); gap: 7px; padding: 0 14px 0 12px; }
.btn-lista svg { width: 19px; height: 19px; }
.btn-lista[aria-expanded="true"] { background: var(--inv-bg); color: var(--inv-fg); }
.btn-lista[aria-expanded="true"] em { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Informe na tarxeta ---------- */
.t-informe { margin-top: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--soft); }
.t-informe h3 { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.t-informe p { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.t-informe p.lead { font-size: 15px; color: var(--ink); font-weight: 550; line-height: 1.45; margin-top: 0; }
.t-accions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bt { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.bt:hover { background: var(--surface-2); }

/* ---------- Avisos ---------- */
.avisos { position: fixed; z-index: 700; left: 50%; transform: translateX(-50%); top: calc(84px + var(--safe-t)); width: min(440px, calc(100% - 20px)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.notif { pointer-events: auto; padding: 10px 14px 10px 12px; border-radius: 12px; background: var(--inv-bg); color: var(--inv-fg); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); border-left: 4px solid var(--ok); animation: notifEntra .25s ease-out; transition: opacity .3s, transform .3s; }
.notif.md { border-left-color: #7d95f0; } .notif.regional { border-left-color: #4cc38a; } .notif.sen { border-left-color: var(--stale); }
.notif.vai { opacity: 0; transform: translateY(-6px); }
@keyframes notifEntra { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Panel lista ---------- */
.panel-lista { position: fixed; z-index: 600; left: 0; right: 0; bottom: 0; top: calc(78px + var(--safe-t)); background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 14px 12px calc(84px + var(--safe-b)); }
.l-cab { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.l-cab h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.l-resumo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.r-tile { background: var(--surface-2); border-radius: 12px; padding: 8px 6px; text-align: center; min-width: 0; }
.r-tile b { display: block; font: 700 20px/1.1 var(--mono); }
.r-tile span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-tile.md b { color: var(--md); } .r-tile.regional b { color: var(--reg); } .r-tile.atr b { color: var(--atr-fg); } .r-tile.sen b { color: var(--muted); }
.l-ferr { display: flex; gap: 8px; margin: 10px 0 8px; }
.l-ferr input, .l-ferr select { height: 42px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 14.5px; background: var(--surface); color: var(--ink); min-width: 0; }
.l-ferr input { flex: 1; }
.l-ferr select { flex: none; max-width: 44%; }
.l-trens { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.l-trens li + li { margin-top: 6px; }
.l-fila { width: 100%; display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); border-left: 5px solid var(--c); background: var(--surface); border-radius: 12px; padding: 10px 12px 10px 10px; --c: var(--md); }
.l-fila.regional { --c: var(--reg); }
.l-fila.sen { --c: var(--stale); background: var(--soft); }
.l-fila:hover { background: var(--surface-2); }
.l-fila.activa { outline: 2px solid var(--c); outline-offset: -1px; }
.l-num b { display: block; font: 700 16px/1.1 var(--mono); }
.l-num small { display: inline-block; margin-top: 3px; font: 650 10.5px/1 var(--mono); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 3px 5px; border-radius: 5px; }
.l-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.l-ruta { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-ruta i { font-style: normal; color: var(--muted); }
.l-lugar { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.l-est { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pt { width: 8px; height: 8px; border-radius: 99px; flex: none; background: var(--ok); }
.pt.parado { background: var(--warn); } .pt.sen { background: var(--stale); }
.l-der { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.l-atr { font: 650 12px/1 var(--mono); padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.l-atr.si { background: var(--atr-bg); color: var(--atr-fg); } .l-atr.non { background: var(--reg-soft); color: var(--reg); }
.l-hora { font-size: 13px; font-weight: 600; }
.l-hace { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.l-baleiro { padding: 24px 8px; text-align: center; color: var(--muted); }
@media (min-width: 760px) {
  .panel-lista { left: 16px; right: auto; width: 420px; top: calc(108px + var(--safe-t)); bottom: 84px; border-radius: 20px; padding-bottom: 12px; }
  .avisos { top: calc(24px + var(--safe-t)); }
}
@media (max-width: 420px) {
  .filtro { padding: 0 11px 0 9px; font-size: 13.5px; gap: 6px; }
  .filtro .ico { display: none; }
  .r-tile b { font-size: 17px; } .r-tile span { font-size: 10px; }
  .l-fila { grid-template-columns: 54px 1fr auto; gap: 8px; }
}

.filtro .curto { display: none; }
@media (max-width: 480px) {
  .filtro .longo { display: none; } .filtro .curto { display: inline; }
  .filtros { flex-wrap: nowrap; gap: 6px; }
}
@media (max-width: 759px) {
  body.con-tarxeta .filtros { display: none; }
}
@media (min-width: 760px) {
  .avisos { top: auto; bottom: 90px; }
}

/* ---------- Horario do tren ---------- */
.t-horario { margin-top: 14px; display: grid; grid-template-columns: 1fr 44px 1fr; align-items: start; gap: 6px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c, var(--md)) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--md)) 22%, transparent); }
.th-p { display: flex; flex-direction: column; min-width: 0; }
.th-p.der { text-align: right; align-items: flex-end; }
.th-k { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.th-p b { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.th-e { font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.th-prev { margin-top: 3px; font: 650 12px/1.2 var(--mono); color: var(--atr-fg); background: var(--atr-bg); padding: 3px 6px; border-radius: 6px; }
.th-l { height: 100%; display: flex; align-items: center; padding-top: 18px; }
.th-l span { display: block; width: 100%; height: 2px; background: var(--line-2); position: relative; }
.th-l span::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--line-2); border-right: 0; }
.th-gal { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); border-top: 1px dashed var(--line-2); padding-top: 8px; margin-top: 4px; }
.tarxeta .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.l-horario { font-size: 12.5px; color: var(--ink-2); }
.l-horario b { font-size: 13px; color: var(--ink); }
.l-prev { color: var(--atr-fg); font-weight: 600; }
.l-gal { font-size: 12px; color: var(--muted); }
.l-od { margin-top: 0; }
.l-od label { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.l-od label span { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-left: 2px; }
.l-od select { width: 100%; max-width: none; }
.t-horario.md { --c: var(--md); } .t-horario.regional { --c: var(--reg); }

/* ---------- Mapa profesional ---------- */
.leaflet-tile-pane { filter: saturate(.85); }
.capa-vias { mix-blend-mode: multiply; }
.ruta-tt { background: var(--surface); border: 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(20,23,28,.18); padding: 3px 8px; font: 500 12px/1.3 Geist, system-ui, sans-serif; color: var(--ink); }
.ruta-tt b { font-weight: 700; }
.ruta-tt.prox { background: var(--inv-bg); color: var(--inv-fg); }
.ruta-tt::before { display: none; }
.filtro.vias { --c: #5b626c; }

/* ---------- Seguir o tren ---------- */
.t-seguir { display: flex; gap: 8px; margin-top: 12px; }
.t-seguir .bt { flex: 1; justify-content: center; gap: 8px; height: 44px; }
.bt.seg { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.bt.seg.on { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.cs-radar { width: 12px; height: 12px; border-radius: 99px; background: #4cc38a; box-shadow: 0 0 0 0 rgba(76,195,138,.6); animation: radar 1.8s ease-out infinite; flex: none; }
.bt.seg.on .cs-radar { background: var(--ok); }
@keyframes radar { 70% { box-shadow: 0 0 0 9px rgba(76,195,138,0); } 100% { box-shadow: 0 0 0 0 rgba(76,195,138,0); } }
.chip-seguir { position: fixed; z-index: 640; left: 50%; transform: translateX(-50%); top: calc(84px + var(--safe-t)); display: flex; align-items: stretch; background: var(--inv-bg); color: var(--inv-fg); border-radius: 99px; box-shadow: var(--shadow); max-width: calc(100% - 20px); }
.chip-seguir button { border: 0; background: transparent; color: inherit; }
.cs-ver { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; min-width: 0; text-align: left; }
.cs-t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cs-t b { font-size: 13.5px; }
.cs-t small { font-size: 12px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-parar { width: 44px; border-left: 1px solid rgba(255,255,255,.18) !important; font-size: 15px; border-radius: 0 99px 99px 0; }
.chip-seguir.md { box-shadow: 0 0 0 2px #7d95f0, var(--shadow); } .chip-seguir.regional { box-shadow: 0 0 0 2px #4cc38a, var(--shadow); }
body.seguindo .avisos { top: calc(140px + var(--safe-t)); }
@media (min-width: 760px) {
  .chip-seguir { top: calc(24px + var(--safe-t)); left: calc(50% + 120px); }
  body.seguindo .avisos { top: auto; }
}

/* ---------- Formulario de suxestións ---------- */
.sux-intro { color: var(--ink-2); margin-bottom: 12px; }
.campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.campo > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.campo input, .campo select, .campo textarea { font: inherit; font-size: 15px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: var(--surface); color: var(--ink); width: 100%; }
.campo textarea { resize: vertical; min-height: 96px; }
.campo [aria-invalid="true"] { border-color: var(--danger); }
.campos2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .campos2 { grid-template-columns: 1fr; gap: 0; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); margin: 4px 0 8px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--md); }
.check a { color: var(--md); }
.c-erro { display: block; font-style: normal; font-size: 12.5px; color: var(--danger); min-height: 0; }
.c-erro:empty { display: none; }
.sux-web { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bt.primario { width: 100%; justify-content: center; height: 46px; margin-top: 8px; background: var(--md); border-color: var(--md); color: #fff; font-size: 15px; }
.bt.primario:hover { background: #1c3aa8; }
.bt[disabled] { opacity: .6; }
.sux-alt { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.sux-ok { text-align: center; padding: 20px 0; }
.sux-ok p { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.dlg-b h3#licenza { margin-top: 18px; }
@media (max-width: 420px) { .filtro.vias { display: none; } }

@media (max-width: 759px) {
  /* Mentres se segue un tren, a tarxeta baixa a metade de pantalla para ver o mapa */
  body.seguindo .tarxeta { max-height: 46dvh; }
  .chip-seguir { top: calc(80px + var(--safe-t)); }
  .cs-ver { padding: 6px 6px 6px 12px; gap: 8px; }
  .cs-t { flex-direction: row; gap: 6px; align-items: baseline; }
  .cs-t b { white-space: nowrap; }
  .cs-parar { width: 40px; }
}
.t-seguir .bt { white-space: nowrap; font-size: 14px; }

/* ---------- Tema escuro ---------- */
:root[data-tema="escuro"] {
  color-scheme: dark;
  --ink: #e8ebef; --ink-2: #c3c8d0; --muted: #98a0ab;
  --surface: #171b21; --surface-2: #222831; --line: #2e353f; --line-2: #3b4350;
  --md: #7d95f0; --md-soft: #1f2a4d; --reg: #4cc38a; --reg-soft: #173527;
  --stale: #7a828d; --ok: #4cc38a; --warn: #e0a52e; --danger: #ff7b6b;
  --inv-bg: #e8ebef; --inv-fg: #14171c; --atr-fg: #ffb088; --atr-bg: #3d2417; --soft: #1c2129; --mapbg: #11151a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -12px rgba(0,0,0,.8);
}
:root[data-tema="escuro"] .leaflet-control-attribution { background: rgba(23,27,33,.85) !important; color: var(--muted); }
:root[data-tema="escuro"] .leaflet-control-attribution a { color: var(--md); }
:root[data-tema="escuro"] .leaflet-control-zoom a, :root[data-tema="escuro"] .leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
:root[data-tema="escuro"] .capa-vias { mix-blend-mode: screen; }
:root[data-tema="escuro"] .leaflet-tile-pane { filter: none; }
:root[data-tema="escuro"] .tren .corpo { color: #0d1117; }
:root[data-tema="escuro"] .estacion-tt, :root[data-tema="escuro"] .ruta-tt { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
:root[data-tema="escuro"] .ruta-tt.prox { background: var(--inv-bg); color: var(--inv-fg); }
:root[data-tema="escuro"] .bt.primario { color: #0d1117; }
:root[data-tema="escuro"] .logo { color: #0d1117; }
:root[data-tema="escuro"] dialog::backdrop { background: rgba(0,0,0,.6); }

/* Máscara: fóra de Galicia o mapa esvaece */
.mascara-galicia { pointer-events: none; }

/* Botón de tema (control do mapa, á beira do zoom) */
.ctl-tema { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; margin-bottom: 8px !important; }
.ctl-tema svg { width: 20px; height: 20px; }
.ctl-tema .sol { display: none; }
:root[data-tema="escuro"] .ctl-tema .sol { display: block; } :root[data-tema="escuro"] .ctl-tema .lua { display: none; }

/* ---------- Marca: icona radar ---------- */
.logo-img { width: 40px; height: 40px; border-radius: 11px; flex: none; display: block; }
.info-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.info-ico { border-radius: 14px; flex: none; }
.info-nome { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.info-lema { color: var(--muted); font-size: 14px; }
.info-apoio { display: flex; gap: 12px; margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.ia-ico { width: 40px; height: 40px; border-radius: 12px; background: #ff5e5b; display: grid; place-items: center; font-size: 20px; flex: none; }
.info-apoio p { font-size: 13.5px; color: var(--ink-2); margin: 3px 0 10px; }
.bt.kofi { background: #ff5e5b; border-color: #ff5e5b; color: #fff; }
.bt.kofi:hover { background: #e84f4c; }
.info-pe { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.info-pe .xd { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-size: 15px; }
.info-pe .xd svg { width: 26px; height: 26px; color: var(--md); }
.priv-data { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
#privB h3 { margin-top: 16px; }
#privB ul { padding-left: 18px; }
@media (max-width: 420px) { .marca-t h1 { font-size: 14px; } .logo-img { width: 34px; height: 34px; } }
@media (max-width: 420px) {
  #btnSux { display: none; }                 /* no móbil, as suxestións están en «Sobre os datos» */
  .estado-t .curto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* só o punto de cor e a hora (o texto queda para lectores de pantalla) */
  .estado { padding: 6px 8px; gap: 6px; }
  .marca-t h1 { font-size: 14.5px; }
}
@media (max-width: 759px) {
  .leaflet-control-attribution { font-size: 9px !important; line-height: 1.3; max-width: 100vw; padding: 2px 6px !important; }
  .filtros { bottom: calc(40px + var(--safe-b)); }
  .leaflet-bottom.leaflet-right .leaflet-control-zoom, .leaflet-bottom.leaflet-right .ctl-tema { margin-right: 10px !important; }
  .leaflet-bottom.leaflet-right { bottom: 92px; }
  .leaflet-bottom.leaflet-left { width: 100%; }
  .leaflet-bottom.leaflet-left .leaflet-control-attribution { margin: 0 !important; width: 100%; }
}
a.bt { text-decoration: none; }
.info-pe .xd b { margin-right: 1px; }
.info-pe .xd { gap: 6px; }

/* ---------- Botón Apoiar (Ko-fi) na cabeceira ---------- */
.btn-apoiar { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 11px; border-radius: 12px; background: #ff5e5b; color: #fff; font-weight: 650; font-size: 14px; text-decoration: none; flex: none; box-shadow: 0 4px 12px -4px rgba(255,94,91,.6); transition: transform .15s, background-color .15s; }
.btn-apoiar:hover { background: #ec4d4a; }
.btn-apoiar:active { transform: scale(.97); }
.btn-apoiar svg { width: 19px; height: 19px; }
:root[data-tema="escuro"] .btn-apoiar { color: #1b0b0b; }
.h1-gal { font: inherit; }
@media (max-width: 520px) {
  .btn-apoiar { width: 40px; padding: 0; justify-content: center; }
  .btn-apoiar span { display: none; }
}
@media (max-width: 420px) {
  /* no móbil: «Radar Trens» e debaixo «Galicia»; o número de trens xa se ve no botón Lista */
  .marca-t h1 { font-size: 15px; line-height: 1.1; }
  .h1-gal { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
  #conta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .barra { gap: 8px; }
  .barra-acts { gap: 6px; }
}
@media (max-width: 759px) {
  .barra .idioma { display: none; }          /* o idioma cámbiase en «Sobre os datos» */
}
@media (max-width: 680px) {
  .estado-t .longo { display: none; }
  .estado-t .curto { display: inline; }
}
@media (max-width: 370px) {
  .logo-img { width: 30px; height: 30px; }
  .barra { gap: 6px; padding-left: 8px; }
  .marca { gap: 7px; }
  .marca-t h1 { font-size: 14px; }
  .btn-apoiar, .ibtn { width: 38px; height: 38px; }
}

/* ---------- Botóns Seguir / Ver percorrido (con explicación) ---------- */
.t-seguir { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.bt2 { display: flex; align-items: flex-start; gap: 9px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); min-height: 58px; }
.bt2:hover { background: var(--surface-2); }
.b2-ico { width: 22px; height: 22px; display: grid; place-items: center; flex: none; margin-top: 1px; font-size: 17px; line-height: 1; }
.b2-ico svg { width: 20px; height: 20px; }
.b2-t { display: flex; flex-direction: column; min-width: 0; }
.b2-t b { font-size: 14px; font-weight: 700; line-height: 1.25; }
.b2-t small { font-size: 12px; line-height: 1.3; color: var(--muted); margin-top: 2px; }
.bt2.seg { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.bt2.seg small { color: color-mix(in srgb, var(--inv-fg) 72%, transparent); }
.bt2.seg.on { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ink); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.bt2.seg.on small { color: var(--muted); }
.bt2.seg.alt { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.bt2.seg.alt small { color: var(--muted); }
.bt2.ruta { color: var(--ink); }
.bt2.ruta .b2-ico { color: var(--md); }
.bt2.ruta.on { background: var(--md-soft); border-color: color-mix(in srgb, var(--md) 45%, transparent); }
.t-axuda { margin: 8px 2px 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
@media (max-width: 380px) { .t-seguir { grid-template-columns: 1fr; } }
@media (min-width: 760px) {
  /* a etiqueta «Seguindo» vai debaixo da cabeceira, sen tapala */
  .chip-seguir { top: calc(104px + var(--safe-t)); left: 16px; transform: none; }
}

/* ---------- Seguir: un só botón con LED (vermello = sen seguir, verde = seguindo) ---------- */
.t-seguir.un { grid-template-columns: 1fr; }
.bt2.seg.off { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.bt2.seg.off small { color: color-mix(in srgb, var(--inv-fg) 72%, transparent); }
.led { width: 12px; height: 12px; border-radius: 99px; background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.25), 0 0 8px rgba(229,72,77,.6); display: block; }
.led.si { background: #30c47c; box-shadow: 0 0 0 0 rgba(48,196,124,.6); animation: radar 1.8s ease-out infinite; }
.t-axuda { display: none; }

/* ---------- Botón «Ver percorrido» na barra de abaixo ---------- */
.btn-ruta { border: 0; color: var(--ink); gap: 7px; padding: 0 14px 0 12px; }
.btn-ruta svg { width: 19px; height: 19px; color: var(--md); }
.btn-ruta[aria-pressed="true"] { background: var(--md); color: #fff; }
.btn-ruta[aria-pressed="true"] svg { color: #fff; }
:root[data-tema="escuro"] .btn-ruta[aria-pressed="true"] { color: #0d1117; }
:root[data-tema="escuro"] .btn-ruta[aria-pressed="true"] svg { color: #0d1117; }
@media (max-width: 759px) {
  /* coa tarxeta aberta no móbil vense só «Ver percorrido» e «Lista», enriba da tarxeta */
  body.con-tarxeta .filtros { display: flex; bottom: calc(var(--tarxeta-alto, 50dvh) + 10px); left: auto; right: 10px; max-width: none; }
  body.con-tarxeta .filtros .filtro:not(.btn-ruta):not(.btn-lista) { display: none; }
  body.con-tarxeta .leaflet-bottom.leaflet-right { display: none; }
}
@media (max-width: 420px) {
  .btn-ruta span { display: none; }
  .btn-ruta { width: 44px; padding: 0; justify-content: center; }
  body.con-tarxeta .btn-ruta span { display: inline; }
  body.con-tarxeta .btn-ruta { width: auto; padding: 0 14px 0 12px; }
}
@media (max-width: 759px) { .filtros { max-width: calc(100% - 20px); } }
@media (max-width: 759px) {
  /* a tarxeta ocupa como moito a metade da pantalla: así o percorrido e o tren vense enriba */
  .tarxeta { max-height: 52dvh; }
  body.seguindo .tarxeta { max-height: 46dvh; }
}

/* ---------- Titorial ---------- */
.dlg-tut { width: min(420px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 24px; }
.dlg-tut .dlg-b { padding: 22px 22px 18px; text-align: center; }
.dlg-tut h2 { font-size: 21px; letter-spacing: -.02em; color: var(--ink); margin: 2px 0 8px; }
.tut-ilus { min-height: 132px; display: grid; place-items: center; gap: 10px; margin-bottom: 12px; padding: 14px; border-radius: 18px; background: linear-gradient(160deg, var(--md-soft), var(--surface-2)); }
.tut-icona { border-radius: 20px; box-shadow: 0 10px 24px -10px rgba(12,29,92,.5); }
.tut-fila { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tut-tren { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.tut-tren svg { width: 16px; height: 16px; }
.tut-tren.md { background: var(--md); } .tut-tren.regional { background: var(--reg); }
.tut-ficha { background: var(--surface); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); min-width: 210px; text-align: left; }
.tf-h { display: flex; align-items: center; justify-content: space-between; font: 700 24px/1 var(--mono); color: var(--ink); }
.tf-h i { font-style: normal; color: var(--muted); font-size: 18px; }
.tf-l { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.tf-e { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font: 650 12.5px/1 var(--mono); color: var(--atr-fg); background: var(--atr-bg); padding: 4px 8px; border-radius: 6px; }
.tf-e .pt { background: var(--ok); }
.tut-leds { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tut-bt { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--inv-bg); color: var(--inv-fg); font-weight: 700; font-size: 13.5px; }
.tut-bt.on { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); }
.tut-frecha { color: var(--muted); font-size: 18px; }
.tut-chip { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font-weight: 650; color: var(--ink); }
.tut-chip svg { width: 18px; height: 18px; }
.tut-chip.azul { background: var(--md); color: #fff; }
:root[data-tema="escuro"] .tut-chip.azul { color: #0d1117; }
.tut-estados span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); padding: 7px 11px; border-radius: 10px; box-shadow: var(--shadow); }
.tut-estados .d { width: 10px; height: 10px; border-radius: 99px; display: block; }
.tut-estados .d.ok { background: var(--ok); } .tut-estados .d.vello { background: var(--warn); } .tut-estados .d.erro { background: var(--danger); }
.tut-paso { font: 600 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.tut-txt { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0 auto; max-width: 340px; }
.tut-puntos { display: flex; justify-content: center; gap: 6px; margin: 16px 0 14px; }
.tut-puntos i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-2); transition: width .2s, background-color .2s; }
.tut-puntos i.on { width: 20px; background: var(--md); }
.tut-accions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.tut-accions .bt { justify-content: center; height: 46px; margin: 0; }
.tut-accions .bt.primario { width: auto; }
.tut-saltar { color: var(--muted); }
.dlg-tut .dlg-b { min-height: min(500px, 80dvh); display: flex; flex-direction: column; } .tut-txt { flex: 1; } .dlg-tut :focus-visible { outline-offset: 3px; }
/* Botóns de «Sobre os datos»: os tres na mesma liña, mesmo tamaño en galego e castelán */
.info-botons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ib { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 72px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 13.5px; line-height: 1.2; text-align: center; }
.ib:hover { background: var(--surface-2); }
.ib-ico { font-size: 20px; line-height: 1; }
/* X para saír do titorial */
.dlg-tut .dlg-b { position: relative; }
.tut-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; z-index: 1; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.tut-x svg { width: 18px; height: 18px; }
.info-botons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ib span:last-child { max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 420px) { .ib { font-size: 12.5px; padding: 10px 4px; } }
.tut-par { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ib span:last-child { overflow-wrap: normal; white-space: nowrap; }
@media (max-width: 420px) { .info-botons { gap: 6px; } .ib { font-size: 12px; padding: 10px 2px; letter-spacing: -.01em; } }

/* ---------- Volver a «Sobre os datos» ---------- */
.dlg-h { flex-wrap: wrap; }
.volver { flex-basis: 100%; order: -1; align-self: flex-start; border: 0; background: none; color: var(--md); font-weight: 650; font-size: 14px; padding: 2px 0 6px; text-align: left; }
.volver:hover { text-decoration: underline; }
.tut-volver { position: absolute; top: 16px; left: 18px; padding: 4px 0; z-index: 1; }
.dlg-tut .dlg-b:has(.tut-volver:not([hidden])) .tut-ilus { margin-top: 30px; }

/* ---------- Titorial: instalar no móbil ---------- */
.tut-instalar { display: flex; align-items: center; gap: 16px; }
.tut-instalar > img { border-radius: 14px; box-shadow: 0 8px 18px -8px rgba(12,29,92,.5); }
.ti-frecha { font-size: 22px; color: var(--muted); }
.ti-mobil { width: 74px; height: 112px; border-radius: 14px; border: 3px solid var(--ink); background: var(--surface); display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 12px 9px; align-content: start; }
.ti-mobil i { width: 100%; aspect-ratio: 1; border-radius: 6px; background: var(--line-2); }
.ti-mobil img { width: 100%; height: auto; border-radius: 6px; outline: 2px solid var(--md); outline-offset: 1px; }
.tut-inst { margin: 10px auto 0; max-width: 340px; text-align: left; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.tut-inst p { margin: 0; }
.ti-nav { font-weight: 700; color: var(--ink); margin-bottom: 3px !important; font-size: 13px; }
.ti-ic { font-weight: 700; }
.ti-bt { margin-top: 10px !important; height: 40px !important; }

/* ---------- Crédito ---------- */
.credito { position: fixed; z-index: 640; left: 16px; bottom: 4px; margin: 0; font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--surface) 82%, transparent); padding: 1px 7px; border-radius: 6px; }
.credito a { color: var(--ink-2); font-weight: 650; text-decoration: none; }
.credito a:hover { text-decoration: underline; }
@media (max-width: 759px) { .credito { display: none; } }

/* Nota legal baixo o botón de Ko-fi */
.info-apoio p.ia-nota { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.info-apoio .ia-nota a { color: var(--md); }

/* ---------- Tren que estás a seguir: inconfundible aínda que haxa varios xuntos ---------- */
.tren .seg-halo, .tren .seg-eti { display: none; }
.tren.seguido .corpo { transform: scale(1.22); border-color: #ffb400; border-width: 3px; box-shadow: 0 0 0 3px #fff, 0 3px 12px rgba(0,0,0,.45); animation: segCorpo 1.2s ease-in-out infinite; }
.tren.seguido .seg-halo { display: block; position: absolute; inset: 2px; border-radius: 50%; border: 3px solid #ffb400; opacity: 0; animation: segHalo 1.8s ease-out infinite; pointer-events: none; }
.tren.seguido .seg-halo.h2 { animation-delay: .9s; }
.tren.seguido .seg-eti { display: block; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; background: #ffb400; color: #1a1300; font: 700 11px/1 var(--mono); padding: 5px 8px; border-radius: 99px; box-shadow: 0 2px 8px rgba(0,0,0,.35); pointer-events: none; }
.tren.seguido .seg-eti::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #ffb400; }
.tren.seguido .rumbo::before { border-bottom-color: #ffb400; }
@keyframes segHalo { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(2.3); opacity: 0; } }
@keyframes segCorpo { 50% { border-color: #fff; box-shadow: 0 0 0 3px #ffb400, 0 3px 12px rgba(0,0,0,.45); } }
@media (prefers-reduced-motion: reduce) {
  .tren.seguido .seg-halo { opacity: 1; transform: scale(1.5); }
  .tren.seguido .seg-halo.h2 { display: none; }
}

/* ---------- Viaxe rematada (chegou ao destino ou, segundo o horario, xa debería) ---------- */
.t-estado.fin .p { background: var(--md); }
.pt.fin { background: var(--md); }
.tren.fin .corpo { opacity: .8; }
.tren.fin::after { content: "✓"; position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; border-radius: 50%; background: #fff; color: var(--ink); font: 700 10px/15px var(--mono); text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
