@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: Sora; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/sora-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2'); }

:root {
  --grafito: #23262B;
  --papel: #FAF9F7;
  --senal: #6B4E8E;
  --via: #E4DCEF;
  --anden: #9FC9C4;
  --muted: #61616B;
  --linea: #dedbe1;
  --mono: 'IBM Plex Mono', monospace;
  font-family: Inter, sans-serif;
  color: var(--grafito);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, .app-shell, #map { width: 100%; margin: 0; }
html, body { min-height: 100%; }
body { overflow-x: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--senal); outline-offset: 4px; }
.app-shell { position: relative; min-height: 100dvh; padding: 24px 0 30px; }
#map { position: fixed; inset: 0; height: 100dvh; }
.dashboard {
  position: relative; z-index: 2; margin-left: 24px;
  width: min(490px, calc(100vw - 48px)); padding: 0 25px 20px;
  background: var(--papel); border: 1px solid var(--linea); border-radius: 5px;
  box-shadow: 0 8px 32px #23262b14;
  transition: padding-bottom .3s ease, box-shadow .3s ease;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 -25px; padding: 14px 25px; background: #e4dcef55; border-bottom: 1px solid var(--linea); }
.brand-link { display: inline-flex; flex: none; border-radius: 2px; }
.brand-logo { display: block; width: 220px; height: 38px; object-fit: cover; object-position: center; }
.brand-actions { display: flex; align-items: center; gap: 13px; }
.brand-tagline { margin: 0 -25px; padding: 9px 25px; background: #352840; color: var(--papel); font: 500 11px/1.4 Inter, sans-serif; letter-spacing: .015em; text-align: center; }
.brand-tagline strong { font-size: 1.18em; font-style: italic; font-weight: 700; }
.feed-status-link { color: var(--senal); font: 400 10px/1.4 var(--mono); text-decoration: none; border-bottom: 1px solid currentColor; }
.feed-status-link:hover { color: var(--grafito); }
.heading-row { padding-top: 18px; }
.heading-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font: 500 20px/1.25 Sora, sans-serif; letter-spacing: -.035em; white-space: nowrap; }
.heading-title-row h1 { min-width: 0; }
.heading-short { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.live-pill { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--grafito); font: 400 9px/1.5 var(--mono); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--senal); box-shadow: 0 0 0 4px var(--via); }
.panel-toggle { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; color: var(--senal); background: transparent; border: 1px solid transparent; border-radius: 3px; cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .25s ease; }
.panel-toggle:hover { color: var(--grafito); background: var(--via); border-color: #6b4e8e24; }
.panel-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.dashboard > #dashboard-content { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .3s cubic-bezier(.2,.7,.2,1), opacity .2s ease .06s; }
.dashboard-content-inner { min-height: 0; overflow: hidden; }
.dashboard.is-collapsed { padding-bottom: 0; box-shadow: 0 5px 20px #23262b12; }
.dashboard.is-collapsed .heading-row { padding-bottom: 10px; }
.dashboard.is-collapsed > #dashboard-content { grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s cubic-bezier(.2,.7,.2,1), opacity .13s ease; }
.dashboard.is-collapsed .panel-toggle svg { transform: rotate(180deg); }
.dashboard.is-collapsed .brand-row { background: #e4dcef75; }
.update-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 10px 11px; border: 1px solid var(--linea); border-radius: 3px; background: #fffdfa; }
.updated { display: flex; flex-direction: column; justify-content: center; }
.updated span { font: 400 8px/1.5 var(--mono); color: var(--muted); }
.updated strong { margin-top: 3px; font: 400 14px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.refresh { cursor: pointer; font: 400 9px/1.4 var(--mono); transition: background .15s, color .15s, border-color .15s; }
.refresh { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 10px; border-radius: 3px; background: var(--via); border: 1px solid transparent; color: var(--senal); white-space: nowrap; }
.refresh:hover { background: #d9c9e9; border-color: #6b4e8e26; }
.refresh:disabled { opacity: .55; cursor: wait; }
.refresh svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.operators-panel { margin-top: 20px; }
.operators-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: var(--muted); font: 400 9px/1.4 var(--mono); letter-spacing: .04em; }
.operators-heading span:last-child { font: 400 9px/1.4 Inter, sans-serif; letter-spacing: 0; }
.operator-cards { display: grid; gap: 8px; }
.operator-card { --operator-accent: var(--senal); overflow: hidden; border: 1px solid var(--linea); border-radius: 3px; background: #fffdfa; transition: opacity .18s ease, border-color .18s ease; }
.operator-card[data-operator="EMT"] { --operator-accent: #0072BB; }
.operator-card[data-operator="EMT_VALENCIA"] { --operator-accent: #FE0000; }
.operator-card[data-operator="AUVASA"] { --operator-accent: #006D38; }
.operator-card[data-operator="BILBOBUS"] { --operator-accent: #B24642; }
.operator-card[data-operator="BIZKAIBUS"] { --operator-accent: #268447; }
.operator-card[data-operator="METRO_BILBAO"] { --operator-accent: #FF6505; }
.operator-card[data-operator="DBUS"] { --operator-accent: #176B9A; }
.operator-card[data-operator="TUVISA"] { --operator-accent: #207648; }
.operator-card[data-operator="CARRIS_METROPOLITANA"] { --operator-accent: #D8A715; }
.operator-card[data-operator="FGC"] { --operator-accent: #008C70; }
.operator-card[data-operator="TRAM"] { --operator-accent: #028077; }
.operator-card[data-operator="LIGNES_DAZUR"] { --operator-accent: #EF7D00; }
.operator-credit { display: block; padding: 0 11px 9px; color: var(--muted); font: 400 9px/1.4 var(--mono); text-decoration: none; }
.operator-credit:hover { color: var(--operator-accent); text-decoration: underline; }
.operator-card[data-operator="EMT_MALAGA"] { --operator-accent: #006DAA; }
.operator-card.is-hidden { opacity: .68; }
.operator-card-head { padding: 10px 11px 9px; }
.operator-overview { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.operator-identity { display: flex; align-items: center; min-width: 0; gap: 9px; }
.operator-mark { display: grid; place-items: center; width: 25px; height: 25px; flex: none; border-radius: 3px; background: color-mix(in srgb, var(--operator-accent) 12%, white); color: var(--operator-accent); font: 500 9px/1 var(--mono); }
.operator-logo { display: block; width: 31px; height: 31px; flex: none; object-fit: contain; border-radius: 2px; }
.operator-card[data-operator="RENFE"] .operator-logo { object-fit: cover; mix-blend-mode: multiply; }
.operator-logo--dbus { object-fit: cover; object-position: left center; }
.operator-logo--valencia { width: 45px; }
.operator-logo--wide { width: 48px; }
.operator-card[data-operator="LIGNES_DAZUR"] .operator-logo { width: 55px; object-fit: cover; }
.operator-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.operator-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px/1.2 Sora, sans-serif; }
.operator-title small { color: var(--muted); font: 400 9px/1.3 var(--mono); }
.operator-count { flex: none; text-align: right; font: 400 20px/1 var(--mono); font-variant-numeric: tabular-nums; }
.operator-count small { margin-left: 3px; color: var(--muted); font: 400 9px/1.3 Inter, sans-serif; }
.operator-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.operator-status { display: inline-flex; align-items: center; gap: 6px; min-width: 0; margin-right: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.operator-status .status-dot { width: 7px; height: 7px; }
.operator-action { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 27px; padding: 4px 7px; border: 1px solid var(--linea); border-radius: 3px; background: transparent; color: var(--grafito); font: 400 9px/1.2 var(--mono); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.operator-action:hover { border-color: var(--operator-accent); background: color-mix(in srgb, var(--operator-accent) 8%, white); }
.operator-action[aria-pressed="false"] { color: var(--muted); background: #f1eff1; }
.operator-action svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.operator-detail { padding: 0 11px 10px; }
.operator-lines-label { margin: 0 0 6px; color: var(--muted); font: 400 8px/1.4 var(--mono); }
.operator-line-list { display: flex; flex-wrap: wrap; gap: 5px; }
.operator-detail-empty { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.operator-message { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 8px 10px; border: 0; border-radius: 0 0 2px 2px; background: color-mix(in srgb, var(--operator-accent) 9%, white); font-size: 10px; line-height: 1.45; }
.operator-message-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; flex: none; margin-top: 1px; border-radius: 50%; background: #b84c51; color: #fff; font: 500 10px/1 Inter, sans-serif; }
.operator-message[hidden] { display: none; }
.nucleus-picker { display: flex; align-items: center; flex: none; min-width: 0; }
.area-pickers { display: flex; align-items: center; gap: 7px; min-width: 0; }
.nucleus-picker select { width: 132px; max-width: 32vw; min-width: 0; padding: 8px 28px 8px 10px; border: 1px solid var(--linea); border-radius: 3px; appearance: none; background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%236B4E8E' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center; color: var(--grafito); font: 500 12px/1.4 Inter, sans-serif; cursor: pointer; }
.country-picker select { width: 126px; }
.operator-line-search { width: 100%; min-height: 32px; margin-bottom: 8px; padding: 6px 9px; border: 1px solid var(--linea); border-radius: 3px; background: #fffdfa; color: var(--grafito); font: 400 11px/1.3 Inter, sans-serif; }
.operator-line-search:focus-visible { outline: 2px solid var(--senal); outline-offset: 2px; }
.operator-line-hint { align-self: center; color: var(--muted); font: 400 9px/1.4 var(--mono); }
.nucleus-picker select:focus-visible { outline: 2px solid var(--senal); outline-offset: 2px; }
.line-chip { min-width: 40px; min-height: 34px; padding: 6px 8px; border: 1px solid #23262b20; border-radius: 3px; background: var(--line-color); color: var(--line-ink); font: 500 12px/1.4 Inter, sans-serif; cursor: pointer; transition: opacity .15s; }
.line-chip.dimmed { opacity: .45; }
.line-chip:hover { opacity: 1; }
.line-chip[aria-pressed="true"] { outline: 2px solid var(--grafito); outline-offset: 2px; }
.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.status-dot.ok { background: #397b69; }
.status-dot.empty, .status-dot.not_configured, .status-dot.neutral { background: #8c8b93; }
.status-dot.pending_authorization { background: #ad752b; }
.status-dot.unavailable { background: #ad752b; }
.status-dot.error, .status-dot.authentication_error, .status-dot.timeout, .status-dot.rate_limit, .status-dot.invalid_response { background: #b84c51; }
.notice { margin: 10px 0 0; padding: 8px 10px; border-left: 2px solid var(--senal); background: var(--via); color: var(--grafito); font-size: 10px; line-height: 1.5; }
.map-caption { position: fixed; z-index: 1; left: 24px; bottom: 30px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--papel); border: 1px solid var(--linea); border-radius: 3px; font: 400 9px/1.4 var(--mono); color: var(--muted); }
.caption-line { width: 16px; height: 2px; background: var(--senal); }
.map-legend { position: fixed; z-index: 1; right: 65px; bottom: 45px; display: flex; gap: 16px; padding: 11px 14px; background: var(--papel); border: 1px solid var(--linea); border-radius: 3px; font: 400 11px/1.5 var(--mono); }
.map-legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; display: inline-block; border-radius: 50%; background: var(--legend-color); }
.legend-dot.train { background: var(--papel); border: 2px solid var(--grafito); }
.legend-dot.bus { background: var(--anden); border: 1px solid var(--grafito); }
.legend-station { width: 10px; height: 10px; display: inline-block; border-radius: 50%; background: var(--papel); border: 2px solid var(--senal); }
.maplibregl-popup { font-family: Inter, sans-serif; }
.maplibregl-popup-content { min-width: 205px; border-radius: 4px; padding: 17px; background: var(--papel); border-top: 3px solid var(--senal); box-shadow: 0 6px 24px #23262b20; }
.maplibregl-popup-close-button { font-size: 20px; right: 7px; top: 4px; color: var(--grafito); }
.popup-title { margin: 0 20px 6px 0; font: 500 20px/1.3 Sora, sans-serif; color: var(--senal); }
.popup-line-badge { display: inline-block; padding: 4px 10px; border-radius: 3px; font-size: 17px; }
.popup-subtitle { margin: 0 0 13px; font: 400 11px/1.4 var(--mono); color: var(--muted); }
.popup-row { display: flex; gap: 10px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--linea); font-size: 11px; line-height: 1.5; }
.popup-row span { color: var(--muted); }
.popup-row strong { text-align: right; max-width: 140px; font-weight: 500; }
.station-panel { position: fixed; z-index: 4; top: 24px; right: 24px; width: min(390px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 20px; background: var(--papel); border: 1px solid var(--linea); border-radius: 5px; box-shadow: 0 10px 38px #23262b27; }
.station-panel-head { display: flex; justify-content: space-between; gap: 12px; }
.station-panel-kicker { color: var(--senal); font: 400 9px/1.4 var(--mono); letter-spacing: .04em; }
.station-panel h2 { margin: 6px 0 5px; font: 500 20px/1.25 Sora, sans-serif; }
.station-panel-lines { margin: 0; color: var(--muted); font: 400 10px/1.4 var(--mono); }
.station-close { align-self: flex-start; width: 30px; height: 30px; flex: none; border: 1px solid var(--linea); border-radius: 3px; background: transparent; color: var(--grafito); font-size: 22px; line-height: 1; cursor: pointer; }
.station-close:hover, .station-panel-meta button:hover { background: var(--via); }
.station-panel-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); color: var(--muted); font: 400 10px/1.4 var(--mono); }
.station-panel-meta button { flex: none; padding: 5px 7px; border: 1px solid var(--linea); border-radius: 3px; background: transparent; color: var(--senal); font: inherit; cursor: pointer; }
.station-panel-meta button:disabled { opacity: .55; cursor: wait; }
.station-message { margin: 11px 0 0; padding: 9px 10px; border-radius: 3px; background: var(--via); color: var(--grafito); font-size: 11px; line-height: 1.5; }
.station-departures { display: grid; }
.station-departure { display: grid; grid-template-columns: 47px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--linea); }
.station-departure-line { justify-self: start; padding: 5px 6px; border-radius: 3px; background: var(--via); color: var(--senal); font: 400 10px/1 var(--mono); }
.station-departure-destination { min-width: 0; font-size: 12px; line-height: 1.25; }
.station-departure-destination strong { display: block; font-weight: 500; }
.station-departure-destination small { display: block; margin-top: 3px; color: var(--muted); font: 400 10px/1.3 var(--mono); }
.station-departure-time { text-align: right; font: 400 15px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.station-departure-time small { display: block; margin-top: 5px; font: 400 9px/1.2 var(--mono); white-space: nowrap; }
.station-departure-time .is-live { color: #28765c; }
.station-departure-time .is-scheduled { color: var(--muted); }
.station-footnote { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.maplibregl-ctrl-group { border-radius: 3px; background: var(--papel); }
.analytics-consent {
  position: fixed; z-index: 10; left: 24px; bottom: 24px;
  width: min(410px, calc(100vw - 48px)); padding: 16px;
  border: 1px solid var(--linea); border-radius: 4px;
  background: var(--papel); box-shadow: 0 8px 32px #23262b25;
}
.analytics-consent-copy strong { font: 500 14px/1.4 Sora, sans-serif; }
.analytics-consent-copy p { margin: 7px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.analytics-consent a, .privacy-content a { color: var(--senal); text-underline-offset: 2px; }
.analytics-consent-actions { display: flex; gap: 8px; }
.analytics-consent-actions button {
  flex: 1; min-height: 36px; padding: 7px 10px; cursor: pointer;
  border: 1px solid var(--senal); border-radius: 3px;
  background: var(--papel); color: var(--senal); font: 500 12px/1.4 Inter, sans-serif;
}
.analytics-consent-actions button:hover { background: var(--via); }
.analytics-preferences {
  position: fixed; z-index: 5; left: 24px; bottom: 82px;
  min-height: 28px; padding: 4px 8px; cursor: pointer;
  border: 1px solid var(--linea); border-radius: 3px;
  background: var(--papel); color: var(--muted); font: 400 10px/1.4 var(--mono);
}
.analytics-preferences:hover { color: var(--senal); border-color: var(--senal); }
.privacy-page { overflow: auto; }
.privacy-content { max-width: 680px; margin: 0 auto; padding: 48px 24px 70px; }
.privacy-back { display: inline-block; margin-bottom: 36px; font: 400 12px/1.5 var(--mono); }
.privacy-content h1 { margin-bottom: 28px; font-size: clamp(24px, 5vw, 36px); white-space: normal; }
.privacy-content h2 { margin: 30px 0 12px; font: 500 18px/1.4 Sora, sans-serif; }
.privacy-content p { margin: 0 0 16px; font-size: 14px; line-height: 1.7; }

@media (max-width: 580px) {
  .app-shell { padding-top: 12px; }
  .dashboard { margin-left: 12px; width: calc(100vw - 24px); padding: 0 17px 15px; }
  .brand-row { margin: 0 -17px; padding: 8px 17px; }
  .brand-row { gap: 8px; }
  .brand-logo { width: 158px; height: 31px; }
  .brand-actions { gap: 7px; }
  .brand-tagline { margin: 0 -17px; padding: 8px 17px; font-size: 10px; }
  .heading-row { padding-top: 12px; }
  .heading-title-row { gap: 8px; flex-wrap: nowrap; }
  .heading-long { display: none; }
  .heading-short { display: inline; }
  .area-pickers { flex: 1; min-width: 0; }
  .area-pickers .country-picker { flex: 0 0 116px; }
  .area-pickers .nucleus-picker:not(.country-picker) { flex: 1 1 0; }
  .area-pickers select, .country-picker select { width: 100%; max-width: none; }
  .heading-title-row h1 { font-size: clamp(13px, 3.6vw, 16px); }
  .nucleus-picker select { width: 116px; padding: 7px 24px 7px 8px; font-size: 11px; }
  .live-pill { font-size: 8px; }
  .feed-status-link { font-size: 8px; }
  .update-panel { margin-top: 12px; padding: 8px 9px; }
  .updated span { font-size: 7px; }
  .updated strong { font-size: 12px; }
  .operators-panel { margin-top: 15px; }
  .operator-cards { gap: 6px; }
  .operator-card-head { padding: 7px 8px; }
  .operator-card-actions { margin-top: 5px; gap: 4px; }
  .operator-count { font-size: 18px; }
  .operator-detail { padding: 0 9px 9px; }
  .operator-action { min-height: 28px; padding: 4px 5px; font-size: 8px; }
  .operator-logo { width: 27px; height: 27px; }
  .line-chip { min-width: 42px; }
  .refresh { font-size: 9px; padding: 0 8px; }
  .map-caption { display: none; }
  .map-legend { right: 54px; bottom: 60px; }
  .analytics-consent { left: 12px; bottom: 12px; width: calc(100vw - 24px); padding: 14px; }
  .analytics-preferences { left: 12px; bottom: 12px; }
  .privacy-content { padding: 32px 20px 60px; }
  .station-panel { top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; max-height: min(58dvh, 460px); padding: 15px; }
  .station-panel h2 { font-size: 17px; }
}
@media (max-width: 380px) {
  .brand-logo { width: 140px; height: 28px; }
}
@media (max-width: 360px) {
  .brand-logo { width: 135px; height: 27px; }
  .nucleus-picker select { width: 104px; font-size: 10px; }
  .operator-card-actions { flex-wrap: wrap; }
  .operator-status { flex: 1 0 100%; }
  .operator-action { flex: 1; }
  .operator-action { font-size: 8px; }
  .refresh { font-size: 8px; padding: 0 6px; }
}
@media (max-width: 300px) {
  .brand-row { gap: 5px; }
  .brand-logo { width: 123px; height: 25px; }
  .brand-actions { gap: 4px; }
  .feed-status-link { font-size: 7px; }
  .live-pill { font-size: 7px; }
  .panel-toggle { width: 28px; height: 28px; }
  .heading-title-row h1 { font-size: 12px; }
  .area-pickers { gap: 5px; }
  .area-pickers .country-picker { flex-basis: 106px; }
  .nucleus-picker select { width: 94px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard, .dashboard > #dashboard-content, .panel-toggle, .panel-toggle svg { transition: none; }
}
