/* The server-rendered pages of /tib/ (acerca, lineas, a line, the airport: deploy/tib/api/lib/Pages.php) on the platform's theme
   (theme.css); the top navigation is nav.css. The colours of each line come from line-colors.css (class lc-<line> sets --line-color and
   --line-text); no inline styles: the CSP forbids them. network.svg (the island and every TIB route, faint) is the background of the
   small maps of the lines; the island itself (© OpenStreetMap contributors) is drawn in the pages too, in the theme's colours. */

:root { --land: #e9e3d7; --land-line: #c8bfae; }
:root[data-theme="dark"] { --land: #232a33; --land-line: #3b4450; }

.pages-body { max-width: 980px; }
.pages-body.narrow { max-width: 740px; }
.pages-body p, .pages-body li { line-height: 1.55; }
.pages-body h2 { margin-top: 1.7em; }
.pages-body h3 { font-size: 17px; font-weight: 800; margin-top: 1.3em; }
.pages-body .lead { font-size: 18px; color: var(--db-text); max-width: 64ch; }
.pages-body .note, .pages-body .credit { color: var(--db-muted); font-size: 14px; }
.pages-body .more { margin-top: 26px; }
.pages-body .db-btn { margin: 4px 8px 4px 0; }
.db-visually-hidden, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* the bottom of every page: the same two lines as the bottom of the map's panel (what the site is; the data credit, About, privacy, terms) */
.bus-footer { display: block; padding: 18px clamp(12px, 3vw, 24px) 24px; }
.bus-footer p { margin: 0; color: var(--db-muted); font-size: 13px; line-height: 1.55; }
.bus-footer .bus-footer-legal { margin-top: 3px; font-size: 12.5px; }
.bus-footer a { color: inherit; text-decoration: underline; text-decoration-color: var(--db-border-strong); text-underline-offset: 2px; }
.bus-footer a:hover { color: var(--db-text); }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; color: var(--db-muted); }
.crumbs li + li::before { content: '›'; margin-right: 4px; }
.crumbs a { color: var(--db-muted); }

.faq h3 { margin-bottom: .3em; }
.faq p { margin-top: 0; }
.sources { list-style: none; padding: 0; margin: 8px 0; }
.sources li { margin: 6px 0; }
.sources .url { color: var(--db-muted); font-size: 13px; }
.about-page h2[id] { scroll-margin-top: 80px; }

/* the number of a line, the labels */
.line-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 30px; padding: 0 8px; border-radius: 9px; box-sizing: border-box;
  background: var(--line-color, #5c6470); color: var(--line-text, #fff); font: 800 15px/1 var(--db-display); letter-spacing: -.01em;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); flex: none;
}
.line-badge.big { min-width: 76px; height: 54px; font-size: 27px; border-radius: 14px; padding: 0 12px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--db-surface-3); color: var(--db-muted); white-space: nowrap; }
.tag-express { background: var(--db-accent-soft); color: var(--db-accent-soft-text); }
.tag-off { background: var(--db-warning-soft); color: var(--db-warning); }
.line-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.line-head h1, .line-head h2 { margin: 0; }

/* the small map of a line: its route over the island and every route of TIB */
.thumb, .route-fallback {
  display: block; flex: none; aspect-ratio: 128 / 100; border-radius: 10px;
  background: var(--db-surface-2) url(network.svg?v=20261112a) center / 100% 100% no-repeat;
}
.thumb { width: 108px; }
.thumb svg, .route-fallback svg { display: block; width: 100%; height: 100%; }
.thumb path, .route-fallback path {
  fill: none; stroke: var(--line-color, var(--db-accent)); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 .6px rgba(255, 255, 255, .95));
}

/* the list of lines */
.lines-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 28px; align-items: center; }
.lines-top h1 { margin-bottom: .35em; }
.lines-top .lead { margin: 0; }
/* the whole network on the island, by area */
.net-map { display: block; width: 100%; height: auto; overflow: visible; cursor: pointer; }
.net-map path {
  fill: none; stroke-width: .8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; pointer-events: stroke;
  transition: opacity .2s, stroke-width .2s; animation: net-in .7s ease-out both;
}
.net-map path.land { fill: var(--land); stroke: var(--land-line); stroke-width: .35; opacity: 1; pointer-events: none; animation: none; transition: none; }
@keyframes net-in { from { opacity: 0; } }
.z-aeropuerto { stroke: #0e8fd6; }
.z-ponent { stroke: #d1495b; animation-delay: .08s !important; }
.z-tramuntana { stroke: #2f9e44; animation-delay: .16s !important; }
.z-nord { stroke: #7b5cd6; animation-delay: .24s !important; }
.z-llevant { stroke: #f08c00; animation-delay: .32s !important; }
.z-migjorn { stroke: #0ca5a5; animation-delay: .4s !important; }
/* the trains (T1-T3) in their blue and the metro (M1) in its yellow (line-colors.css) */
.z-tren-train { stroke: #005192; animation-delay: .48s !important; }
.z-tren-metro { stroke: #ffdd00; animation-delay: .48s !important; }
.net-map[data-zone] path:not(.land) { opacity: .13; }
.net-map[data-zone="aeropuerto"] .z-aeropuerto, .net-map[data-zone="ponent"] .z-ponent, .net-map[data-zone="tramuntana"] .z-tramuntana,
.net-map[data-zone="nord"] .z-nord, .net-map[data-zone="llevant"] .z-llevant, .net-map[data-zone="migjorn"] .z-migjorn,
.net-map[data-zone="tren"] .z-tren { opacity: 1 !important; stroke-width: 1.25; }
.zc-aeropuerto { --zone: #0e8fd6; } .zc-ponent { --zone: #d1495b; } .zc-tramuntana { --zone: #2f9e44; }
.zc-nord { --zone: #7b5cd6; } .zc-llevant { --zone: #f08c00; } .zc-migjorn { --zone: #0ca5a5; }
/* EMT Palma's groups (/emt/lineas/): the day, the night (the airport as above) */
.z-dia { stroke: #d1495b; animation-delay: .08s !important; }
.z-noche { stroke: #7b5cd6; animation-delay: .16s !important; }
.net-map[data-zone="dia"] .z-dia, .net-map[data-zone="noche"] .z-noche { opacity: 1 !important; stroke-width: 1.25; }
.zc-dia { --zone: #d1495b; } .zc-noche { --zone: #7b5cd6; }
.lines-tools { margin: 18px 0 6px; }
.line-search { display: block; position: relative; max-width: 560px; }
.line-search::before {
  content: ''; position: absolute; left: 14px; top: 50%; width: 15px; height: 15px; margin-top: -9px; border: 2.5px solid var(--db-muted);
  border-radius: 50%; pointer-events: none;
}
.line-search::after { content: ''; position: absolute; left: 28px; top: 50%; width: 7px; height: 2.5px; margin-top: 5px; background: var(--db-muted); transform: rotate(45deg); }
.line-search input {
  width: 100%; box-sizing: border-box; padding: 13px 14px 13px 42px; font: 16px/1.2 var(--db-font); color: var(--db-text);
  background: var(--db-surface); border: 1px solid var(--db-border-strong); border-radius: 12px;
}
.line-search input:focus { outline: 2px solid var(--db-accent); outline-offset: 1px; border-color: transparent; }
.zone-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; }
.zone-chips a {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--db-border-strong); background: var(--db-surface);
  color: var(--db-text) !important; text-decoration: none !important; font-weight: 700; font-size: 14px;
}
.zone-chips a::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--zone, var(--db-text)); }
.zone-chips a[data-cat=""]::before { display: none; }
.zone-chips a span { color: var(--db-muted); font-weight: 600; }
.zone-chips a:hover { border-color: var(--db-text); }
.zone-chips a[aria-current="true"] { background: var(--db-text); border-color: var(--db-text); color: var(--db-bg) !important; }
.zone-chips a[aria-current="true"] span { color: inherit; opacity: .75; }
.lines-none { margin: 24px 0; font-size: 16px; color: var(--db-muted); }
.zone { margin-top: 30px; scroll-margin-top: 76px; }
.zone-head h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 9px; }
.zone-head h2::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--zone, var(--db-accent)); flex: none; }
.zone-head p { margin: 0 0 4px; color: var(--db-muted); }
.zone-more { font-weight: 700; }
.zone-more::after { content: ' →'; }
.line-cards { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.line-card {
  display: flex; gap: 12px; align-items: center; padding: 10px; height: 100%; box-sizing: border-box; border: 1px solid var(--db-border);
  border-radius: 14px; background: var(--db-surface); color: var(--db-text) !important; text-decoration: none !important;
  transition: border-color .15s, box-shadow .15s;
}
.line-card:hover, .line-card:focus-visible { border-color: var(--line-color); box-shadow: 0 0 0 1px var(--line-color); }
.card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line-card .name { font-weight: 700; line-height: 1.25; }
.line-card .meta { color: var(--db-muted); font-size: 13px; }

/* the page of a line */
.line-hero { display: flex; align-items: center; gap: 18px; margin: 6px 0 16px; }
.line-hero h1 { margin: 0 0 4px; }
.line-hero .tags { margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
/* the destinations: tabs as one control in the line's colour */
.line-tabs { display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; box-sizing: border-box; padding: 4px; margin: 0 0 12px; border-radius: 16px; background: var(--db-surface-2); border: 1px solid var(--db-border); }
.line-tabs button {
  border: 0; background: none; padding: 8px 14px; border-radius: 12px; font: 700 14.5px/1.25 var(--db-font); color: var(--db-muted); cursor: pointer; text-align: left;
  transition: background-color .15s, color .15s;
}
.line-tabs button:hover { color: var(--db-text); background: var(--db-surface-3); }
.line-tabs button[aria-selected="true"] { background: var(--line-color); color: var(--line-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.line-tabs button:focus-visible { outline: 2px solid var(--db-accent); outline-offset: 2px; }
.line-tabs ~ .tab-panel .tab-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tab-panel { margin-top: 18px; }
.tab-panel .tab-title { margin: 22px 0 6px; }
.route-map-wrap { margin: 0 0 8px; }
.route-map {
  position: relative; height: clamp(300px, 55vh, 470px); border-radius: 16px; overflow: hidden; border: 1px solid var(--db-border);
  background: #ece8e1; isolation: isolate;
}
/* the route draws itself in (line-map.js): hidden until then, the dots that flow, the other ways and the end names after it */
.route-hidden { visibility: hidden; }
.route-later { opacity: 0; }
.route-flow, .route-alt { transition: opacity .45s ease-out; }
.route-flow { animation: route-flow 1.1s linear infinite; }
@keyframes route-flow { to { stroke-dashoffset: -18.1; } }
.stop-dot.stop-wait { opacity: 0; }
.stop-dot.stop-in { animation: stop-in .28s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes stop-in { from { opacity: 0; transform: scale(.2); } }
.route-map .route-fallback { width: 100%; height: 100%; border-radius: 0; background-size: contain; aspect-ratio: auto; }
.route-map .base-tiles { filter: saturate(.45) contrast(.92) brightness(1.04); }
/* the tiles: Leaflet 1.9.4 closes the gaps between them with mix-blend-mode plus-lighter, which drew a light seam on these maps at some
   sizes; the older way leaves none: normal blending, each tile half a pixel larger, so that it covers the edge of the next one */
.route-map.leaflet-container img.leaflet-tile { mix-blend-mode: normal; width: 256.5px !important; height: 256.5px !important; }
.route-map .leaflet-container, .route-map.leaflet-container { font: inherit; }
.map-hint {
  position: absolute; z-index: 1000; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 7px 13px; border-radius: 999px;
  background: rgba(20, 22, 26, .8); color: #fff; font-size: 13px; font-weight: 700; pointer-events: none; white-space: nowrap;
}
.route-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-top: 10px; }
.route-bar .db-btn { margin: 0; }
.route-live { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-height: 1.5em; color: var(--db-muted); font-size: 14px; }
.route-live.has-buses { color: var(--db-text); font-weight: 700; }
.route-live.has-buses::before {
  content: ''; width: 9px; height: 9px; margin-right: 2px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .5);
  animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.route-live .sep { color: var(--db-muted); font-weight: 400; }
.live-part {
  border: 0; background: none; padding: 2px 0; font: 700 14px/1.3 var(--db-font); color: var(--db-text); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--db-border-strong); text-underline-offset: 3px;
}
.live-part:hover { text-decoration-color: currentColor; }
.live-part.is-current { color: var(--db-text); text-decoration-color: var(--line-color); text-decoration-thickness: 2px; }
.live-part:focus-visible { outline: 2px solid var(--db-accent); outline-offset: 2px; border-radius: 4px; }
.terminal-label {
  background: var(--db-surface); color: var(--db-text); border: 1px solid var(--db-border-strong); border-radius: 7px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  font: 700 12.5px/1.2 var(--db-font); padding: 3px 7px; transition: opacity .35s ease-out;
}
.terminal-label.tip-wait { opacity: 0; }
.terminal-label::before { display: none; }
.stop-popup { font: 14px/1.4 var(--db-font); }
.stop-popup-name { display: block; font-weight: 700; margin-bottom: 2px; }
.stop-popup .mark { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--db-muted); }
.stop-popup a { font-weight: 700; }

/* the buses: the live map's markers (a disc in the line's colour, a ring for punctuality, an arrow where it goes) */
.bus-icon { background: none; border: 0; }
.bm {
  --size: 30px; --status: #8f918c;
  position: absolute; left: 50%; top: 50%; width: var(--size); height: var(--size); transform: translate(-50%, -50%); transition: transform .25s, opacity .25s;
}
.bm-early { --status: #2b7a99; } .bm-on_time { --status: #2e8b57; } .bm-late { --status: #d4920b; } .bm-very_late { --status: #c0392b; } .bm-no_data { --status: #8f918c; }
.bm-disc {
  position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--line-color); color: var(--line-text, #fff); border: 3px solid var(--status);
  box-shadow: inset 0 0 0 1.5px #fff, 0 0 0 1.5px #fff, 0 2px 5px rgba(15, 23, 42, .35);
  font: 700 11px/1 var(--db-font); letter-spacing: -.02em; white-space: nowrap;
}
.bm-long .bm-disc { font-size: 9.5px; letter-spacing: -.04em; }
/* a bus whose GPS is far from its route (a detour?): where the GPS says, with a mark (as on the map, assets/app.css) */
.bm-off-mark {
  position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; border-radius: 50%; pointer-events: none;
  background: #9a3412; color: #fff; font: 800 10px/14px var(--db-font); text-align: center; box-shadow: 0 0 0 1.5px #fff;
}
.bm-dir { position: absolute; inset: -8px; transform: rotate(var(--heading, 0deg)); pointer-events: none; transition: transform .6s ease-out; }
.bm-dir::before {
  content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--status); filter: drop-shadow(0 -1px 0 #fff);
}
.bm.no-dir .bm-dir { display: none; }
.bm-estimated .bm-disc { border-style: dashed; }
.bus-icon.is-other .bm { transform: translate(-50%, -50%) scale(.68); opacity: .5; }
.bus-tip { padding: 6px 9px; border-radius: 9px; }
.bus-card { font: 13px/1.35 var(--db-font); }
.bus-card-to { display: block; font-weight: 800; font-size: 14px; }
.bus-card-next { display: block; color: #4b5563; }
:root[data-theme="dark"] .bus-card-next { color: #c3c9d1; }

/* the timetable of the tab on show: a kind of day, a stop, its times by hour */
.tt { margin: 6px 0 4px; padding: 16px 18px 12px; border: 1px solid var(--db-border); border-radius: 16px; background: var(--db-surface); }
.tt-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.tt-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-kinds button {
  border: 1px solid var(--db-border-strong); background: var(--db-surface); color: var(--db-text); padding: 6px 12px; border-radius: 999px;
  font: 700 13.5px/1.2 var(--db-font); cursor: pointer;
}
.tt-kinds button:hover { border-color: var(--db-text); }
.tt-kinds button[aria-pressed="true"] { background: var(--db-text); border-color: var(--db-text); color: var(--db-bg); }
.tt-kinds button:focus-visible, .tt-stop select:focus-visible { outline: 2px solid var(--db-accent); outline-offset: 2px; }
.tt-stop { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; font-size: 14px; color: var(--db-muted); }
.tt-stop select { min-width: 0; max-width: 300px; padding: 7px 10px; font: 600 15px/1.2 var(--db-font); color: var(--db-text); }
.tt-kind-name { margin: 0 0 8px; font-weight: 800; }
.tt-caption { margin: 0 0 6px; font-weight: 800; font-size: 15px; }
/* full times, a row per hour; the rows run down the columns, as many as fit: a short timetable stays short on a wide screen */
.tt-times { list-style: none; margin: 0; padding: 0; column-width: 230px; column-gap: 36px; font-variant-numeric: tabular-nums; }
.tt-times li { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; padding: 5px 0; border-bottom: 1px solid var(--db-border); break-inside: avoid; }
.tt-m { display: inline-block; padding: 2px 6px; border-radius: 7px; font-size: 15.5px; font-weight: 600; text-align: center; white-space: nowrap; }
.tt-m sup { font-size: 10px; font-weight: 800; color: var(--db-accent); margin-left: 1px; }
.tt-m.is-past { color: var(--db-faint, var(--db-muted)); opacity: .6; }
.tt-m.is-next { background: var(--line-color); color: var(--line-text); font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.tt-m.is-next sup { color: inherit; }
.tt-next { font-size: 13px; font-weight: 800; color: var(--db-text); white-space: nowrap; }
.tt-none { margin: 4px 0; }
.tt-legend { margin: 10px 0 0; font-size: 13.5px; color: var(--db-muted); }
.tt-legend sup { font-weight: 800; color: var(--db-accent); }
.tt-valid { margin: 8px 0 0; font-size: 13.5px; color: var(--db-muted); }

/* the stops as a line, the way a station shows them; the buses of the tab on the road now sit on it */
.stops-wrap { position: relative; max-width: 560px; }
.stop-bus {
  position: absolute; left: -2px; top: 0; z-index: 2; min-width: 36px; height: 20px; padding: 0 4px; box-sizing: border-box; margin-top: -10px; display: flex;
  align-items: center; justify-content: center; border-radius: 6px; background: var(--line-color); color: var(--line-text); font: 800 11px/1 var(--db-display);
  box-shadow: 0 0 0 2px var(--db-bg), 0 1px 5px rgba(0, 0, 0, .35); transition: top 1s linear;
}
.stop-bus.is-estimated { opacity: .75; }
.stops-line { list-style: none; margin: 10px 0 0; padding: 0; }
.stops-line li { position: relative; padding: 6px 0 6px 38px; min-height: 22px; }
.stops-line li::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 6px; background: var(--line-color, var(--db-accent)); }
.stops-line li:first-child::before { top: 50%; border-radius: 3px 3px 0 0; }
.stops-line li:last-child::before { bottom: 50%; border-radius: 0 0 3px 3px; }
.stops-line li:only-child::before { display: none; }
.stops-line li::after {
  content: ''; position: absolute; left: 8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; box-sizing: border-box; border-radius: 50%;
  background: var(--db-bg); border: 3.5px solid var(--line-color, var(--db-accent));
}
.stops-line li.terminal::after { left: 5px; width: 22px; height: 22px; margin-top: -11px; border-width: 5px; }
.stops-line li.no-board::after { border-color: var(--db-border-strong); }
.stops-line li.some-trips::after { border-style: dotted; }
.stops-line li a { color: var(--db-text) !important; text-decoration: none !important; font-weight: 600; }
.stops-line li a:hover { text-decoration: underline !important; }
.stops-line li.terminal a { font-weight: 800; font-size: 16.5px; }
.stops-line .mark {
  display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--db-surface-2); border: 1px solid var(--db-border);
  color: var(--db-muted); font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; vertical-align: 1px;
}

/* more lines of the area: chips with their route in a card (pages.js), or in the chip itself on a touch screen */
.related ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.line-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--db-border); border-radius: 999px;
  background: var(--db-surface); color: var(--db-text) !important; text-decoration: none !important; font-size: 14px; transition: border-color .15s;
}
.line-chip:hover, .line-chip[aria-describedby] { border-color: var(--line-color); }
.line-chip:focus-visible { outline: 2px solid var(--db-accent); outline-offset: 2px; }
.related .line-badge { min-width: 40px; height: 26px; font-size: 13px; border-radius: 999px; }
.chip-mini { display: none; width: 58px; height: 45px; flex: none; margin: -6px 0; }
.chip-mini path, .pop-route { fill: none; stroke: var(--line-color); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.chip-land, .pop-land { fill: var(--land); stroke: var(--land-line); stroke-width: .5; }
.island-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
@media (hover: none) {
  .related .line-chip { padding-right: 6px; }
  .chip-mini { display: block; }
}
.line-pop {
  position: fixed; left: 0; top: 0; z-index: 3000; width: 236px; box-sizing: border-box; padding: 10px 10px 8px; border-radius: 16px;
  background: var(--db-surface); border: 1px solid var(--db-border); box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  opacity: 0; transform: scale(.95); transition: opacity .14s ease-out, transform .14s ease-out; pointer-events: none;
}
.line-pop.is-open { opacity: 1; transform: none; pointer-events: auto; }
.line-pop[hidden] { display: none; }
.pop-map { display: block; width: 100%; height: auto; overflow: visible; }
.pop-map .pop-route { stroke-width: 2.2; }
.pop-end circle { fill: var(--db-surface); stroke: var(--line-color); stroke-width: 1.3; }
.pop-end text { font: 700 6.4px/1 var(--db-font); fill: var(--db-text); paint-order: stroke; stroke: var(--db-surface); stroke-width: 1.8px; stroke-linejoin: round; }
.pop-name { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-weight: 700; font-size: 14px; line-height: 1.25; }
.pop-name .line-badge { min-width: 38px; height: 24px; font-size: 12.5px; border-radius: 999px; }

/* the airport */
.airport-line { display: grid; grid-template-columns: 132px 1fr; gap: 18px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--db-border); }
.airport-line .thumb { width: 132px; }
.airport-line h2 { font-size: 21px; }
.airport-line .note { margin: 6px 0 4px; }
.airport-line .links { margin: 4px 0 0; font-size: 14.5px; }
.table-wrap { overflow-x: auto; }
.times { border-collapse: collapse; min-width: 100%; margin: 6px 0 8px; font-size: 15px; }
.times th, .times td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--db-border); vertical-align: top; }
.times thead th { color: var(--db-muted); font-size: 13px; font-weight: 700; }
.times tbody th { font-weight: 700; }
.times time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 16px; }
.times .none { color: var(--db-muted); }

/* dark theme: the same tiles, inverted (as on the live map) */
:root[data-theme="dark"] .route-map { background: #101317; }
:root[data-theme="dark"] .route-map .base-tiles { filter: invert(1) hue-rotate(180deg) saturate(.35) brightness(.88) contrast(.9); }
:root[data-theme="dark"] .route-map .leaflet-bar a { background: var(--db-surface); color: var(--db-text); border-color: var(--db-border); }
:root[data-theme="dark"] .route-map .leaflet-control-attribution { background: rgba(22, 26, 32, .86); color: var(--db-muted); }
:root[data-theme="dark"] .route-map .leaflet-control-attribution a { color: var(--db-accent); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper, :root[data-theme="dark"] .leaflet-popup-tip,
:root[data-theme="dark"] .leaflet-tooltip { background: var(--db-surface); color: var(--db-text); border-color: var(--db-border-strong); }
:root[data-theme="dark"] .leaflet-tooltip-top::before { border-top-color: var(--db-surface); }

@media (max-width: 760px) {
  .pages-body .lead { font-size: 17px; }
  .line-hero { gap: 14px; align-items: flex-start; }
  .line-badge.big { min-width: 62px; height: 46px; font-size: 22px; }
  .lines-top { grid-template-columns: 1fr; gap: 14px; }
  .net-map { grid-row: 1; max-width: 300px; margin: 0 auto; }
  .line-tabs { width: 100%; }
  .line-tabs button { flex: 1 1 auto; padding: 8px 10px; text-align: center; }
  .route-map { height: 340px; border-radius: 14px; }
  .route-bar .db-btn { width: 100%; justify-content: center; text-align: center; }
  .tt { padding: 12px 12px 10px; border-radius: 14px; }
  .tt-tools { flex-direction: column; align-items: stretch; }
  .tt-stop select { flex: 1; max-width: none; }
  .tt-m { font-size: 15px; padding: 2px 4px; }
  .times { font-size: 14px; }
  .line-cards { grid-template-columns: 1fr; }
  .thumb { width: 96px; }
  .airport-line { grid-template-columns: 1fr; gap: 10px; }
  .airport-line .thumb { width: 100%; max-width: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .route-live.has-buses::before, .route-flow, .net-map path, .stop-dot.stop-in { animation: none; }
  .line-card, .stop-bus, .net-map path, .line-tabs button, .route-flow, .route-alt, .terminal-label, .bm, .bm-dir, .line-chip { transition: none; }
  .line-pop { transition: none; transform: none; }
}

/* SFM's boards on a station page (api/sfm.php, station.js): the platform, its change, the delay; the station's alerts */
.dep-via { font-weight: 700; padding: 1px 7px; white-space: nowrap; border-radius: 6px; background: var(--db-surface-3, rgba(0, 0, 0, .06)); }
.dep-via.changed { background: var(--db-accent-soft); color: var(--db-accent-soft-text); }
.dep-via-change { color: var(--db-accent); font-weight: 700; }
.dep-delay { color: var(--db-muted); }
.dep-delay.late { color: #b45309; font-weight: 700; }
:root[data-theme="dark"] .dep-delay.late { color: #f0b35a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dep-delay.late { color: #f0b35a; } }
.station-alerts p { margin: 4px 0 0; }
.station-alerts small { display: block; margin-top: 6px; opacity: .85; }
.station-alerts[hidden], .station-live-source[hidden] { display: none; }
