/* Bus service page: full-viewport map under the NAVIG bar, route sheet on top (reuses .bus-sheet from bus-arrivals.css). */
html, body { margin: 0; height: 100%; overflow: hidden; }
#map { position: fixed; top: var(--nv-bar-h); left: 0; width: 100vw; height: calc(100dvh - var(--nv-bar-h)); z-index: 0; }

.svc-sheet { scroll-padding-top: 8px; }
.svc-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.svc-badge { display: grid; place-items: center; min-width: 56px; min-height: 40px; padding: 4px 8px; border-radius: var(--nv-r); background: var(--nv-accent); color: var(--nv-ink); font-size: 1.125rem; line-height: 1; white-space: nowrap; }
.svc-badge[data-len="5"], .svc-badge[data-len="6"] { font-size: .9375rem; }
.svc-sheet h1 { margin: 0 0 2px; font-size: 1rem; line-height: 1.3; }
.svc-sheet h2 { margin: 16px 0 4px; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--nv-muted); }
.svc-label { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.35; }
.svc-meta { margin: 2px 0 0; color: var(--nv-muted); font-size: .8125rem; }

.svc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.svc-actions .svc-save[aria-pressed=true] { background: var(--nv-accent); border-color: var(--nv-accent); }
.svc-actions .svc-save[aria-pressed=true] svg { fill: currentColor; }
.svc-actions button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; font-size: .8125rem; font-weight: 600; }
.svc-actions button[aria-busy=true] { opacity: .6; cursor: progress; }
.svc-toast { position: fixed; z-index: 2500; top: calc(var(--nv-bar-h) + 12px); left: 50%; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: var(--nv-r); background: var(--nv-ink); color: #fff; font-size: .8125rem; font-weight: 600; transform: translate(-50%, -8px); opacity: 0; pointer-events: none; transition: opacity .2s var(--nv-ease), transform .2s var(--nv-ease); }
.svc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.svc-tabs { display: flex; gap: 6px; margin: 14px 0 0; padding: 2px; border: 1px solid var(--nv-line); border-radius: var(--nv-r); background: var(--nv-surface); }
.svc-tabs button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 10px; border: 0; border-radius: calc(var(--nv-r) - 2px); background: transparent; color: var(--nv-muted); font-size: .8125rem; font-weight: 600; line-height: 1.25; text-align: center; }
.svc-tabs button[aria-pressed=true] { background: var(--nv-accent); color: var(--nv-ink); }

.js .svc-dir[hidden] { display: none; }
.svc-times { margin: 8px 0 4px; color: var(--nv-muted); font-size: .8125rem; line-height: 1.4; }

.svc-stops { margin: 8px 0 0; padding: 0; list-style: none; }
.svc-stops li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--nv-line); }
.svc-stops li.is-active { background: var(--nv-surface); }
.svc-stops a { flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 6px 0; color: inherit; text-decoration: none; }
.svc-seq { flex: none; width: 28px; color: var(--nv-muted); font-size: .75rem; font-variant-numeric: tabular-nums; text-align: right; }
.svc-name { min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.svc-name strong { font-size: .9375rem; line-height: 1.3; }
.svc-stops a:hover strong, .svc-stops a:focus-visible strong { text-decoration: underline; text-underline-offset: 3px; }
.svc-sheet .svc-locate { flex: none; width: 44px; border: 0; background: transparent; color: var(--nv-muted); }
.svc-sheet .svc-locate:hover, .svc-sheet .svc-locate:focus-visible { color: var(--nv-ink); background: var(--nv-surface); }

.svc-about { margin: 18px 0 0; color: var(--nv-muted); font-size: .8125rem; line-height: 1.5; }
.svc-links { margin: 10px 0 0; font-size: .875rem; }
.svc-links a { color: var(--nv-ink); text-underline-offset: 3px; }
.svc-attribution { margin: 8px 0 0; }

/* The two ends of the route keep a labelled marker while stops are dots; from pin zoom the shared pins carry the names instead. */
.svc-stop-icon { background: none; border: 0; }
.svc-stop-icon .svc-dot { width: 16px; height: 16px; box-sizing: border-box; margin: -2px; border-radius: 50%; background: var(--nv-accent); border: 3px solid var(--nv-ink); }
.bus-pins .svc-stop-icon { display: none; }
.svc-stop-label { position: absolute; left: 20px; top: -4px; padding: 1px 6px; border: 1px solid var(--nv-line); border-radius: var(--nv-r); background: rgba(255,255,255,.96); color: var(--nv-ink); font: 700 11px/1.3 var(--nv-font); white-space: nowrap; pointer-events: none; }
.svc-popup { min-width: 160px; }
.svc-popup strong { display: block; font-size: .9375rem; line-height: 1.3; }
.svc-popup small { display: block; margin: 2px 0 6px; color: var(--nv-muted); }
.svc-popup-times { margin: 0 0 8px; font-size: .8125rem; font-weight: 600; }
.svc-popup a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--nv-r); background: var(--nv-accent); color: var(--nv-ink); font-weight: 700; font-size: .8125rem; text-decoration: none; }

@media (max-width: 767px) {
  .svc-sheet { max-height: 52dvh; }
  .leaflet-control-zoom { display: none; }
}
@media (min-width: 768px) {
  .bus-map-controls { bottom: calc(124px + env(safe-area-inset-bottom)); }
}
