:root { color-scheme: dark; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #09121b; color: #eaf0f5; font-synthesis: none }
* { box-sizing: border-box }
html { scroll-behavior: smooth }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse 55% 22% at 72% 0%, #123149 0%, transparent 100%), #09121b }
button, a { -webkit-tap-highlight-color: transparent }
button { font: inherit; cursor: pointer }
button:focus-visible, a:focus-visible { outline: 3px solid #f3be50; outline-offset: 3px }
a { color: inherit }
.topbar { min-height: 100px; padding: 22px clamp(18px,5vw,68px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #22303a }
.site-brand { display: flex; gap: 16px; align-items: center }
.brand-mark { width: 54px; height: 54px; border: 1px solid #d0a347; color: #edbc54; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: #d6ad4b0e }
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: .06em; display: block }
.brand-title strong { color: #f5c865 }
.brand-subtitle { display: block; margin-top: 4px; font-size: 11px; color: #8096a5; text-transform: uppercase; letter-spacing: .16em }
.header-right { display: flex; align-items: center; gap: clamp(15px,3vw,42px) }
.live-indicator { display: flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: .12em; font-weight: 800; color: #d7ba77 }
.live-dot { width: 8px; height: 8px; background: #d7ba77; border-radius: 50% }
.live-indicator[data-state="ok"] { color: #7ce6b1 }
.live-indicator[data-state="ok"] .live-dot { background: #7ce6b1; box-shadow: 0 0 13px #7ce6b177 }
.live-indicator[data-state="error"] { color: #f58d8d }
.live-indicator[data-state="error"] .live-dot { background: #f58d8d }
.clock-wrap { display: flex; flex-direction: column; text-align: right; gap: 2px }
.clock { font-size: 25px; font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: .06em }
.clock-zone { font-size: 10px; letter-spacing: .16em; color: #8197a7 }
.layout { width: min(1520px,100%); margin: auto; padding: 0 clamp(18px,5vw,68px) }
.hero { padding: clamp(48px,6vw,100px) 0 52px; max-width: 930px }
.eyebrow, .panel-kicker { color: #e6b85b; font-size: 10px; font-weight: 800; letter-spacing: .2em }
.eyebrow { display: flex; align-items: center; gap: 13px }
.eyebrow-line { width: 28px; height: 2px; background: #e6b85b }
.hero h1 { font-size: clamp(43px,6.25vw,90px); line-height: 1.08; font-weight: 820; letter-spacing: -.055em; margin: 23px 0 22px }
.hero h1 em { font-style: normal; color: #efbd5a }
.hero p { margin: 0; color: #a7b7c5; font-size: clamp(14px,1.45vw,18px); line-height: 1.65; max-width: 690px }
.hero-meta { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 32px; color: #97aab8; font-size: 12px }
.hero-meta strong { color: #e7edf3 }
.meta-icon { color: #e4bc69; font-size: 18px; vertical-align: -2px; margin-right: 7px }
.content-grid { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(280px,.86fr); gap: 20px; align-items: start }
.panel { background: #111d28; border: 1px solid #283944; border-radius: 15px; overflow: hidden; box-shadow: 0 12px 34px #00000018 }
.panel-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 27px 27px 22px }
.panel-header h2, .rail-head h2 { font-size: clamp(22px,2.5vw,30px); margin: 9px 0 0; letter-spacing: -.025em }
.heading-arrow { color: #e4b956; font-weight: 400; font-size: 20px }
.update-meta { display: grid; gap: 6px; text-align: right; white-space: nowrap }
.update-meta span { font-size: 9px; color: #8196a6; letter-spacing: .12em; font-weight: 800 }
.update-meta strong { font-size: 15px; font-variant-numeric: tabular-nums; color: #dae3ea }
.status-strip { font-size: 12px; color: #a7b7c5; background: #182934; border-block: 1px solid #253946; padding: 12px 27px; min-height: 41px }
.status-strip[data-state="error"] { color: #ffbdab; background: #382525 }
.status-strip[data-state="ok"] { color: #a3e7c8; background: #13352d }
.tablist { display: flex; gap: 8px; padding: 19px 27px; flex-wrap: wrap }
.tab { border: 1px solid #30414c; background: transparent; color: #a7b6c2; border-radius: 7px; padding: 11px 13px; font-size: 12px; font-weight: 750 }
.tab:hover { color: #fff; border-color: #637784 }
.tab.active { color: #111a22; background: #f4c464; border-color: #f4c464 }
.table-scroll { max-width: 100%; overflow-x: auto; scrollbar-color: #4b5d67 #111d28 }
.board { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums }
.board th { color: #718b9b; padding: 12px 13px; font-size: 9px; letter-spacing: .12em; border-block: 1px solid #283944; font-weight: 800 }
.board th:first-child, .board td:first-child { padding-left: 27px }
.board th:last-child, .board td:last-child { padding-right: 24px }
.board td { padding: 17px 13px; font-size: 13px; border-bottom: 1px solid #24323e }
.board tbody tr:not(.message-row):hover { background: #192d3c }
.board tbody tr:last-child td { border-bottom: 0 }
.time-cell { color: #f4c665; font-size: 18px !important; font-weight: 800; letter-spacing: .02em }
.line-badge { display: inline-block; min-width: 41px; text-align: center; padding: 6px; background: #254c68; color: #bcdef5; border: 1px solid #397095; border-radius: 5px; font-size: 12px; font-weight: 800 }
.destination-cell { color: #e8f0f5; font-weight: 700; max-width: 200px; overflow: hidden; text-overflow: ellipsis }
.predicted { color: #d4e3ec; font-weight: 750 }
.delay { font-size: 12px; font-weight: 800 }
.delay.late { color: #ff8b8b }
.delay.early { color: #78dfb9 }
.delay.unknown { color: #81919e }
.platform { color: #c5d6e2 }
.detail-button { border-radius: 7px; border: 1px solid #3a5364; background: #203544; padding: 7px 10px; color: #e5eff6; font-weight: 800; font-size: 11px }
.detail-button:hover { background: #33516a }
.message-row td { padding-block: 28px; color: #9fb1bf; white-space: normal }
.panel-footer { display: flex; gap: 12px; justify-content: space-between; padding: 16px 27px; border-top: 1px solid #283944; font-weight: 700; font-size: 10px; color: #8ca0ae; letter-spacing: .09em }
.footer-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #78ddac; margin-right: 5px }
.side-stack { display: grid; gap: 20px }
.rail-panel, .info-panel { padding: 27px }
.rail-head { display: flex; align-items: end; gap: 7px; flex-wrap: wrap; justify-content: space-between }
.rail-head h2 { font-size: 20px; white-space: nowrap }
.rail-head h2 span { color: #e8b85c }
.preview-badge { color: #a6bbc8; background: #283b49; border-radius: 5px; padding: 5px 7px; font-size: 9px; font-weight: 750; letter-spacing: .06em }
.rail-caption { color: #9cb0bf; font-size: 12px; line-height: 1.65; margin: 17px 0 18px }
.rail-stations { padding: 8px 0 8px 6px; list-style: none; margin: 0; position: relative }
.rail-stations:before { content: ""; position: absolute; width: 3px; top: 30px; bottom: 30px; left: 15px; background: repeating-linear-gradient(to bottom,#4a687c 0 6px,transparent 6px 12px) }
.rail-stations li { display: flex; gap: 19px; align-items: center; position: relative; height: 52px; font-size: 13px; color: #c2d2dc }
.rail-stations li.highlight { color: #f7cf76; font-size: 15px }
.rail-circle { display: block; margin-left: 1px; width: 17px; height: 17px; border-radius: 50%; flex: 0 0 17px; border: 4px solid #608096; background: #101e2c; z-index: 1 }
.highlight .rail-circle { width: 19px; height: 19px; flex-basis: 19px; border-color: #f3c35f; background: #f3c35f; box-shadow: 0 0 0 5px #f3c35f24 }
.rail-kind, .station-here { margin-left: auto; font-size: 9px; letter-spacing: .06em; font-weight: 800; color: #728c9e; white-space: nowrap }
.station-here { color: #f4c665 }
.rail-warning { background: #21313c; border: 1px solid #354953; border-radius: 9px; padding: 13px; display: flex; align-items: start; gap: 10px; color: #e8c885; margin-top: 20px }
.rail-warning p { margin: 0; color: #acbfcb; font-size: 11px; line-height: 1.6 }
.info-panel h2 { font-size: 21px; margin: 13px 0 }
.info-panel p { font-size: 12px; color: #9fb0bf; line-height: 1.75; margin: 0 0 16px }
.source-link { display: inline-flex; gap: 12px; font-size: 12px; font-weight: 800; text-decoration: none; color: #f2c56b }
.source-link:hover { text-decoration: underline }
.page-footer { color: #6f8796; font-size: 10px; font-weight: 700; letter-spacing: .09em; padding: 48px 0 36px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap }
dialog { border: 1px solid #41596a; border-radius: 18px; width: min(540px,calc(100% - 32px)); background: #132331; color: #e7eff4; padding: 26px; box-shadow: 0 30px 90px #0009 }
dialog::backdrop { background: #02080dbd; backdrop-filter: blur(5px) }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px }
.dialog-heading h2 { font-size: 28px; margin: 12px 0 0; color: #f7c867 }
.close-button { border: 1px solid #405363; color: #d6e1eb; background: #213a4b; border-radius: 8px; font-size: 22px; height: 39px; width: 39px }
.dialog-destination { font-size: 18px; color: #c6d8e5; margin: 13px 0 22px }
.details-grid { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 15px }
.details-grid > div { border-top: 1px solid #354957; padding-top: 11px }
.details-grid dt { color: #88a1b2; font-size: 10px; letter-spacing: .08em; font-weight: 800; text-transform: uppercase }
.details-grid dd { margin: 7px 0 0; color: #f3f6f9; font-size: 15px; font-weight: 750; overflow-wrap: anywhere }
.dialog-note { margin: 24px 0 16px; color: #a9bcc7; font-size: 12px; line-height: 1.65 }
.dialog-close { border: 0; width: 100%; background: #f4c464; color: #121b24; border-radius: 8px; font-weight: 850; font-size: 12px; padding: 15px }
.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 }
@media (max-width: 1120px) { .content-grid { grid-template-columns: minmax(0,1fr) } .side-stack { grid-template-columns: 1fr 1fr } }
@media (max-width: 700px) { .topbar { min-height: 78px; padding-block: 16px } .brand-mark { width: 43px; height: 43px } .brand-title { font-size: 13px } .brand-subtitle { font-size: 9px } .header-right { flex-direction: column-reverse; gap: 6px; align-items: end } .clock { font-size: 19px } .clock-zone { display: none } .live-indicator { font-size: 9px } .hero { padding-top: 51px } .hero h1 { font-size: clamp(43px,10vw,60px) } .side-stack { grid-template-columns: 1fr } .panel-header { padding: 21px 19px } .tablist { padding-inline: 19px } .board th:first-child,.board td:first-child { padding-left: 19px } .board th:last-child,.board td:last-child { padding-right: 16px } .board { min-width: 650px } .status-strip { padding-inline: 19px } .panel-footer { padding-inline: 19px } .hero-meta { gap: 12px 22px } .page-footer { padding-top: 30px } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto } }

/* GPS train overlays on latitude-based schematic — no inferred track position */
.track-visual{position:relative;min-height:276px}
.track-visual .rail-stations{position:relative;z-index:1;padding-right:0}
.track-visual .rail-stations li{max-width:61%;font-size:12px}
.track-visual .rail-stations li strong{white-space:nowrap}
.track-visual .rail-kind,.track-visual .station-here{display:none}
.train-overlay{position:absolute;inset:0;z-index:2;pointer-events:none}
.moving-train{position:absolute;pointer-events:auto;transform:translateY(-50%);height:30px;min-width:74px;max-width:85px;display:flex;align-items:center;justify-content:center;gap:5px;padding:3px 7px;border:1px solid #4f86a5;background:#1c4158;color:#edfaff;border-radius:6px;box-shadow:0 3px 10px #0008;font-weight:900;font-size:11px;white-space:nowrap;cursor:pointer;transition:top 1.15s ease-out,filter .2s ease-out}
.moving-train:hover,.moving-train:focus-visible{filter:brightness(1.3);z-index:3}
.moving-train.r49{background:#493464;border-color:#9e78ca;color:#f1deff}
.moving-train .train-symbol{font-size:17px;line-height:1}
.train-legend{display:flex;align-items:center;gap:18px;font-size:11px;color:#acc0cd;flex-wrap:wrap;margin-top:4px}
.train-legend span{display:inline-flex;align-items:center;gap:7px}
.legend-dot{height:10px;width:10px;border-radius:3px;background:#377fa0;display:inline-block}
.legend-dot.r49{background:#9673c2}
.position-status{font-size:11px;color:#adbdc9;line-height:1.55;min-height:33px;margin:12px 0 0}
.preview-badge[data-state="ok"]{background:#174132;color:#a6f5cc}
.preview-badge[data-state="error"]{background:#49302f;color:#f0a9a2}
.preview-badge[data-state="idle"]{background:#2b3946;color:#b2c5d3}
@media(max-width:520px){.track-visual .rail-stations li{max-width:64%;font-size:12px}.moving-train{min-width:67px;max-width:75px;font-size:10px}.moving-train .train-symbol{font-size:15px}}
@media(prefers-reduced-motion:reduce){.moving-train{transition:none}}

/* Official PID GTFS track shape, projected on a geographical scale. */
.rail-geography{margin:12px 0 0;max-width:100%;border:1px solid #304756;border-radius:11px;
 background:radial-gradient(ellipse at 48% 58%,#163342,#0a1723 75%);overflow:hidden}
.rail-geography[hidden],.track-visual[hidden]{display:none!important}
.rail-geography svg{display:block;width:100%;height:auto;min-height:430px;max-height:600px;overflow:visible}
.rail-geography figcaption{font-size:10px;line-height:1.6;text-align:center;padding:10px 6px 12px;color:#9cb0bd;background:#12232d;border-top:1px solid #2b4352}
.rail-geography figcaption a{color:#eac675}
.rail-geo-underlay{fill:none;stroke:#4e6775;stroke-width:12;stroke-linejoin:round;stroke-linecap:round;opacity:.75}
.rail-geo-line{fill:none;stroke:#e4be73;stroke-width:3.4;stroke-linejoin:round;stroke-linecap:round}
.geo-station-outer{fill:#091a26;stroke:#b9d4e3;stroke-width:2.5}
.geo-station-inner{fill:#cfebfa}
.geo-station.major .geo-station-outer{stroke:#f4c464;fill:#f4c464}
.geo-station.major .geo-station-inner{fill:#0d202d}
.geo-station-label{fill:#b9cfdf;font-size:12px;font-weight:650;paint-order:stroke;stroke:#0d1d29;stroke-width:3.3px;stroke-linejoin:round}
.geo-station.major .geo-station-label{fill:#ffdd93;font-size:13px;font-weight:850}
.geo-train{cursor:pointer;outline:none}
.geo-train-connector{stroke:#7fbad6;stroke-width:1.4;opacity:.8}
.geo-train-dot{fill:#b9f0ff;stroke:#163e54;stroke-width:3}
.geo-train-pill{fill:#25556d;stroke:#79b4d1;stroke-width:1.3}
.geo-train.r49 .geo-train-pill{fill:#594276;stroke:#c4a0e4}
.geo-train.r49 .geo-train-dot{fill:#dcc3ff;stroke:#523375}
.geo-train-name{fill:#fff;font-size:11.5px;font-weight:900}
.geo-train-symbol{font-size:15px}
.geo-train:hover .geo-train-pill,.geo-train:focus-visible .geo-train-pill{stroke:#f9d77c;stroke-width:2.8}
.geo-train:focus-visible .geo-train-dot{stroke:#f9d77c;stroke-width:4}
@media(max-width:520px){.rail-geography svg{min-height:360px}}

/* Direction-first train callouts. Labels occupy fixed outer gutters;
   thin leaders always show the actual snapped point on the GTFS rail axis. */
.geo-station.major .geo-station-label{fill:#ffe3a0;font-size:14.5px;font-weight:900;stroke:#0a1620;stroke-width:4}
.geo-station.minor .geo-station-label{fill:#a8c3d2;font-size:10.7px;font-weight:600;stroke:#0a1620;stroke-width:3.4}
.geo-station.minor .geo-station-outer{stroke:#88a5b7;stroke-width:1.8;fill:#0c2230}
.geo-station.minor .geo-station-inner{fill:#b1cddd}
.geo-train-connector{fill:none;stroke-width:1.15;stroke-linejoin:round;stroke-linecap:round;opacity:.85;pointer-events:none}
.geo-train-connector.praha{stroke:#70d8a4}
.geo-train-connector.benesov{stroke:#d5a46b}
.geo-train-connector.unknown{stroke:#92a8b7;stroke-dasharray:3 3}
.geo-train.dir-praha .geo-train-pill{fill:#214e3c;stroke:#82dab2;stroke-width:1.25}
.geo-train.dir-benesov .geo-train-pill{fill:#66452b;stroke:#ddb17c;stroke-width:1.25}
.geo-train.dir-unknown .geo-train-pill{fill:#304656;stroke:#8fa5b3;stroke-width:1.25}
.geo-train.dir-praha .geo-train-dot{fill:#86e5b3;stroke:#20543c;stroke-width:2.6}
.geo-train.dir-benesov .geo-train-dot{fill:#efc18b;stroke:#79502e;stroke-width:2.6}
.geo-train.dir-unknown .geo-train-dot{fill:#b5c9d5;stroke:#304454;stroke-width:2.6}
.geo-train-name{font-size:12px;font-weight:900;fill:#f6fbfc}
.geo-train-direction{fill:#fff9ea;font-size:10.8px;font-weight:800;letter-spacing:.12px}
.geo-train-symbol{font-size:15px}
.geo-train:focus-visible .geo-train-pill,.geo-train:hover .geo-train-pill{stroke:#ffe9a7;stroke-width:2.8}
.train-legend .legend-dot.praha{background:#4bb487}
.train-legend .legend-dot.benesov{background:#bc8953}
.train-legend .legend-dot.unknown{background:#8498a8}

/* Live train cross-highlighting and direction priority */
.board tbody tr.board-praha>td:first-child{box-shadow:inset 4px 0 #53c897}
.board tbody tr.board-praha .destination-cell{color:#a9f2cb;font-weight:850}
.board tbody tr.board-praha{background:linear-gradient(90deg,#1a3a3326 0%,transparent 48%)}
.board tbody tr.board-benesov>td:first-child{box-shadow:inset 2px 0 #927154}
.board tbody tr.board-benesov .destination-cell{color:#b6b8ba;font-weight:650}
.board tbody tr.linked-train,.board tbody tr.linked-train:hover{background:#264c49!important;outline:2px solid #89dcb5;outline-offset:-2px}
.board tbody tr:not(.message-row){transition:background .17s ease,outline-color .17s ease;cursor:pointer}
.board tbody tr:not(.message-row):hover{background:#1e3340}
.geo-train.is-linked .geo-train-pill{stroke:#ffdf8c;stroke-width:3.2;filter:drop-shadow(0 0 7px #e9bf678c)}
.geo-train.is-linked .geo-train-dot{stroke:#ffde95;stroke-width:4}
.geo-train.is-linked{filter:brightness(1.28)}
.geo-train.is-dimmed{opacity:.51}
.geo-train-connector.is-linked{stroke:#ffde95;stroke-width:2.6;opacity:1}
.geo-train-connector.is-dimmed{opacity:.27}
.geo-train-arrow{fill:#fff7d2;font-size:13px;font-weight:950}
.train-hover-card[hidden]{display:none!important}
.train-hover-card{position:fixed;z-index:60;width:264px;pointer-events:none;background:#102330;border:1px solid #618294;border-radius:13px;overflow:hidden;box-shadow:0 16px 44px #000b;color:#f5f8fb}
.train-hover-card img{display:block;width:100%;height:119px;object-fit:cover;background:#123140}
.train-hover-content{padding:11px 13px 13px}
.train-hover-main{display:flex;gap:10px;align-items:baseline;justify-content:space-between;font-size:12px}
.train-hover-main strong{color:#f4c76d;font-weight:900;font-size:15px}
.train-hover-main span{color:#c4d8df;max-width:180px;text-align:right}
.train-hover-card p{margin:7px 0;color:#d9f1e3;font-weight:850;font-size:12px}
.train-hover-card small{color:#92b3c1;font-size:10px;line-height:1.45;display:block}
@media(prefers-reduced-motion:reduce){.board tbody tr:not(.message-row){transition:none}.geo-train{filter:none!important}}
