/* 9.1 — Operator-independent transport categories; app-facing modal selector. */
.uv-transit .app-heading .network-switch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
.uv-transit .app-heading .network-switch button,
.uv-transit .network-switch.secondary button{min-width:0;white-space:nowrap;font-size:13px;padding-inline:9px}
.uv-transit .network-switch.secondary{grid-template-columns:repeat(3,minmax(0,1fr))}
.uv-transit .rail-live-status{font-size:12px;color:var(--muted)}
.uv-transit.uv-rail-mode #liveStatus,
.uv-transit.uv-rail-mode #waterLiveStatus{display:none!important}
.uv-transit:not(.uv-rail-mode) #railLiveStatus{display:none!important}
/* Hide the ACTV realtime and local land routes in rail mode; they still update in
   the background and reappear immediately when the user returns to Bus/Tram. */
.uv-transit.uv-rail-mode .smooth-vehicle,
.uv-transit.uv-rail-mode .smooth-water-vehicle,
.uv-transit.uv-rail-mode .uv-network-route,
.uv-transit.uv-rail-mode .uv-water-route,
.uv-transit.uv-rail-mode .stop-hit,
.uv-transit.uv-rail-mode .raw-fix{display:none!important}
.uv-transit .uv-rail-network-track{pointer-events:none!important}
.uv-transit .scheduled-fleet-marker.scheduled-rail{border-color:#2f728f;color:#174b63;background:#eaf6fa}
.uv-transit .scheduled-fleet-marker.scheduled-bus{border-color:#aa7c4f}
.uv-transit .scheduled-fleet-marker{will-change:transform}
@media(max-width:760px){
 .uv-app89 .app-heading .network-switch{grid-template-columns:repeat(3,minmax(0,1fr))}
 .uv-app89 .app-heading .network-switch button{min-height:43px;font-size:12px;padding:6px 3px}
 .uv-transit .network-switch.secondary button{font-size:12px;padding:7px 4px}
}


.uv-transit .scheduled-fleet-popup{font-size:13px;line-height:1.35}
.uv-transit .scheduled-fleet-popup .pop-title{font-size:15px}
.uv-transit .scheduled-fleet-popup details{margin-top:6px;font-size:11px}
.uv-transit .scheduled-fleet-marker.scheduled-rail{width:max-content;min-width:42px;max-width:180px;padding-inline:8px;border-radius:12px}
.uv-transit .scheduled-rail .scheduled-fleet-route{font-size:11px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vehicle-stop-calls{list-style:none;margin:12px 0;padding:0;max-height:35vh;overflow:auto;overscroll-behavior:contain}
.vehicle-stop-calls li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border,#ddd);font-size:13px}
.vehicle-stop-calls li>span:last-child{white-space:nowrap;font-variant-numeric:tabular-nums}
.vehicle-stop-calls s{opacity:.6}.vehicle-stop-calls .stop-call-cancelled{text-decoration:line-through;opacity:.6}


/* Gate C: legible railway front + heading; solid simulated vehicle outlines.
 * A shape-derived bearing is shown for all moving scheduled services, while
 * the ≈ estimate badge is suppressed only on fresh ViaggiaTreno observations. */
.uv-transit .scheduled-fleet-marker{
 border-style:solid;
 border-width:2px;
}
.uv-transit .scheduled-fleet-marker.scheduled-rail{
 display:flex;align-items:center;justify-content:center;gap:4px;
 width:max-content;min-width:64px;max-width:118px;height:42px;
 padding:0 9px;border-radius:13px;
 border:2px solid #2f728f;color:#174b63;background:#f7fbfd;
 box-shadow:0 3px 12px #0003;
 position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
}
.uv-transit .scheduled-rail .scheduled-fleet-route{
 max-width:73px;line-height:1;white-space:nowrap;overflow:hidden;
 text-overflow:ellipsis;font-variant-numeric:tabular-nums;font-size:12px;
}
.uv-transit .uv-rail-train-glyph{
 width:20px;height:20px;flex:0 0 20px;display:block;
}
.uv-transit .scheduled-fleet-direction{
 position:absolute;left:50%;top:-10px;width:0;height:0;
 border-left:5px solid transparent;border-right:5px solid transparent;
 border-bottom:9px solid #243b48;transform-origin:50% 32px;
 transform:translateX(-50%) rotate(0deg);
 filter:drop-shadow(0 1px 1px white);pointer-events:none;
}
.uv-transit .scheduled-fleet-marker.scheduled-near-live{
 border-color:#2f728f;background:#eaf6fa;
}
.uv-transit .scheduled-near-live .scheduled-fleet-estimate{display:none}
.uv-transit .uv-external-stop-wrap{
 display:flex;align-items:center;justify-content:center;
 background:transparent;border:none;
}
.uv-transit .uv-external-stop{
 display:block;flex-shrink:0;background:#fff;
 font-size:0;line-height:0;box-shadow:0 1px 4px #0003;
}
.uv-transit .uv-external-stop.uv-external-bus{
 width:12px;height:12px;border:2px solid #53645c;
 border-radius:50%;background:#fff;
}
.uv-transit .uv-external-stop.uv-external-rail{
 width:16px;height:16px;border:2px solid #2e627a;
 border-radius:3px;background:#fff;
}
.uv-transit .uv-external-stop.uv-external-water{
 width:13px;height:13px;border:2px solid #338191;
 border-radius:4px;background:#fff;
}


/* 9.1 UX3 – one restrained design language for rail punctuality and operators.
 * Status is from an associated ViaggiaTreno observation, never from schedule alone. */
.uv-transit{
 --uv-rail-late:#9e3437;--uv-rail-late-bg:#fff1f1;
 --uv-rail-early:#006c7c;--uv-rail-early-bg:#e9f7f8;
 --uv-rail-ontime:#21633f;--uv-rail-ontime-bg:#eaf5ed;
 --uv-actv-color:#315b50;--uv-atvo-color:#845b2d;
}
.uv-transit .uv-delay-tag{
 display:inline-flex;align-items:center;justify-content:center;gap:5px;
 padding:4px 8px;border-radius:999px;border:1px solid currentColor;
 font-size:11px;font-weight:750;white-space:nowrap;line-height:1.1;
 font-variant-numeric:tabular-nums;letter-spacing:0;
}
.uv-transit .uv-delay-dot{
 width:7px;height:7px;border-radius:50%;flex:0 0 7px;
 background:currentColor;
}
.uv-transit .uv-delay-late{color:var(--uv-rail-late);background:var(--uv-rail-late-bg)}
.uv-transit .uv-delay-early{color:var(--uv-rail-early);background:var(--uv-rail-early-bg)}
.uv-transit .uv-delay-ontime{color:var(--uv-rail-ontime);background:var(--uv-rail-ontime-bg)}
.uv-transit .uv-rail-status-inline{
 display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:9px 0 5px;
}
.uv-transit .uv-rail-observation{
 display:inline-flex;align-items:center;gap:5px;
 font-size:11px;font-weight:700;color:#285d71;background:#e9f3f7;
 border-radius:999px;padding:4px 8px;
}
.uv-transit .uv-rail-observation::before{
 content:'';width:6px;height:6px;background:#2d819c;border-radius:50%;
}
.uv-transit .uv-provider-tag{
 font-size:9px;line-height:1.15;letter-spacing:.035em;font-weight:800;
 display:inline-flex;align-items:center;justify-content:center;
 white-space:nowrap;padding:3px 5px;border:1px solid currentColor;
 border-radius:5px;background:white;
}
.uv-transit .uv-provider-actv{color:var(--uv-actv-color);background:#ecf3ee}
.uv-transit .uv-provider-atvo{color:var(--uv-atvo-color);background:#fff4e7}
.uv-transit .uv-provider-treni{color:#245e78;background:#e9f4fa}
.uv-transit .uv-provider-alilaguna{color:#236b7b;background:#e9f5f8}
.uv-transit .line-picker-row .uv-provider-tag{
 flex:0 0 auto;margin-left:5px;font-size:10px;padding:4px 6px;
}
.uv-transit .line-selected-chip .uv-provider-tag{
 flex:0 0 auto;font-size:9px;margin-right:2px;
}
.uv-transit .line-picker-row label{min-width:0}
.uv-transit .line-picker-row label>span:not(.line-picker-swatch):not(.uv-provider-tag){
 min-width:0;overflow-wrap:anywhere;
}
.uv-transit .scheduled-fleet-marker{overflow:visible}
.uv-transit .scheduled-fleet-marker>.uv-delay-tag{
 position:absolute;right:-9px;bottom:-12px;z-index:4;
 box-shadow:0 1px 5px #0002;border:1px solid currentColor;
 min-height:18px;padding:3px 5px;font-size:10px;
}
.uv-transit .scheduled-fleet-marker .uv-provider-tag{
 position:absolute;left:50%;bottom:-12px;transform:translateX(-50%);
 z-index:3;box-shadow:0 1px 5px #0001;
}
.uv-transit .scheduled-fleet-direction{
 top:-21px;left:50%;width:14px;height:13px;
 border:0;border-radius:2px;background:#243b48;
 clip-path:polygon(50% 0,100% 100%,50% 77%,0 100%);
 transform-origin:50% 50%;z-index:3;
 filter:drop-shadow(0 1px 1px #fff);
}
.uv-transit .scheduled-fleet-marker.scheduled-rail{isolation:isolate}
.uv-transit .vehicle-arrow{
 top:-17px;transform-origin:50% 50%;
}
.uv-transit .vehicle .uv-provider-tag{
 position:absolute;left:50%;bottom:-12px;
 transform:translateX(-50%);z-index:3;box-shadow:0 1px 5px #0002;
}
.uv-transit .scheduled-fleet-popup .uv-delay-tag{font-size:12px}
.uv-transit .station-departure-status .uv-delay-tag{margin-left:5px}


/* 9.1 direction UX4: attached, route-oriented arrow nose.
 * The orbit shares the marker centre; a JS-computed ray/edge intersection
 * handles both round buses and variable-width rail pills. */
.uv-transit .scheduled-fleet-direction-orbit{
 position:absolute;left:50%;top:50%;height:0;width:0;
 transform-origin:0 0;z-index:6;pointer-events:none;
}
.uv-transit .scheduled-fleet-direction-orbit>.scheduled-fleet-direction{
 position:absolute;left:-6px;top:calc(-1 * var(--uv-arrow-tip-radius, 29px));
 height:12px;width:12px;border:0;border-radius:1px;
 background:#243b48;clip-path:polygon(50% 0%,100% 100%,0% 100%);
 filter:drop-shadow(0 1px 1px #fff);
 transform:none!important;transform-origin:50% 50%;
}
/* Restore the legible ACTV orbit: the earlier centre-of-circle pivot kept the
 * arrow attached while letting the complete nose rotate with the vehicle. */
.uv-transit .vehicle-arrow{
 top:-10px;transform-origin:50% 32px;
}


/* Last-known observations retain useful delays without masquerading as live. */
.uv-transit .uv-delay-cached{
 color:#56636b;background:#f1f3f5;border-color:#c2cbd0;
}
.uv-transit .scheduled-fleet-marker .uv-delay-cached{
 box-shadow:0 1px 5px #0002;
}


/* 9.1 journey fallback: providers are external transport contacts, not legs. */
.uv-transit .journey-alternatives{
 margin:14px 0 8px;padding:14px;border:1px solid #d8e1e7;
 border-radius:16px;background:#f8fafc;
 display:grid;gap:11px;
}
.uv-transit .journey-alternatives h3{font-size:17px;margin:0}
.uv-transit .journey-alternatives>p{margin:0;font-size:12px}
.uv-transit .journey-alternative-card{
 padding:12px;background:#fff;border:1px solid #e2e7eb;
 border-radius:12px;display:grid;gap:6px;
}
.uv-transit .journey-alternative-card>strong{font-size:14px}
.uv-transit .journey-alternative-card>p{font-size:12px;margin:0}
.uv-transit .journey-alternative-actions{display:flex;gap:8px;flex-wrap:wrap}
.uv-transit .journey-service-call,
.uv-transit .journey-service-link,
.uv-transit .journey-tickets-link{
 display:inline-flex;align-items:center;justify-content:center;
 border-radius:9px;padding:9px 12px;min-height:36px;
 text-decoration:none;font-size:12px;font-weight:750;
 border:1px solid #bac9d1;color:#214c5f;background:#fff;
}
.uv-transit .journey-service-call{color:#fff;background:#1d6670;border-color:#1d6670}
.uv-transit .journey-tickets-link{
 margin:10px 0 3px;color:#fff;background:#b6174b;border-color:#b6174b;
}
.uv-transit .journey-service-call:focus-visible,
.uv-transit .journey-service-link:focus-visible,
.uv-transit .journey-tickets-link:focus-visible{outline:3px solid #22758b;outline-offset:2px}
