.nv { --nv-accent:#e9b83a; --nv-r:6px; overflow-x:hidden; }
.bus-sheet { position:fixed; left:16px; top:122px; bottom:24px; width:380px; max-width:calc(100vw - 32px); z-index:1001; background:#fff; border:1px solid var(--nv-line); border-radius:var(--nv-r); overflow:auto; padding:14px; color:var(--nv-ink); box-sizing:border-box; }
.bus-sheet *, .bus-arrivals-popup * { box-sizing:border-box; }
.bus-sheet h2,.bus-arrivals-popup h2 { font-size:1rem; line-height:1.3; margin:0 0 4px; overflow-wrap:anywhere; }
.bus-sheet h3 { font-size:.9rem; margin:12px 0 4px; }
.bus-sheet button,.bus-arrivals-popup button { min-height:44px; color:inherit; font:inherit; cursor:pointer; background:#fff; border:1px solid var(--nv-line); border-radius:var(--nv-r); }
.bus-sheet svg,.bus-ph { width:18px; height:18px; vertical-align:middle; flex-shrink:0; }
.bus-stop-row { display:flex; align-items:center; gap:6px; border-bottom:1px solid var(--nv-line); }
.bus-stop-row a { flex:1; min-width:0; min-height:44px; display:flex; flex-direction:column; justify-content:center; text-decoration:none; color:inherit; padding:5px 0; overflow-wrap:anywhere; }
.bus-star { width:44px; flex:none; }
.bus-sheet .bus-star[aria-pressed=true],.bus-arrivals-popup .bus-star[aria-pressed=true] { background:var(--nv-accent); }
.bus-sheet small,.bus-arrivals-popup small,.bus-age { color:var(--nv-muted); font-size:.75rem; line-height:1.4; }
.bus-sheet-head { display:grid; grid-template-columns:minmax(0,1fr) repeat(4,44px); align-items:center; gap:4px; }
.bus-sheet-head>div { min-width:0; overflow-wrap:anywhere; }
.bus-sheet-head button { width:44px; padding:0; }
/* Header buttons are icon-only: show their accessible name as a tooltip on hover/keyboard focus. */
.bus-sheet .bus-sheet-head button { position:relative; }
@media (hover:hover) {
  .bus-sheet .bus-sheet-head button:hover::after,.bus-sheet .bus-sheet-head button:focus-visible::after { content:attr(aria-label); position:absolute; top:calc(100% + 6px); right:0; z-index:20; padding:5px 8px; border-radius:var(--nv-r); background:var(--nv-ink); color:#fff; font:600 .75rem/1.3 var(--nv-font); white-space:nowrap; pointer-events:none; box-shadow:0 4px 12px -4px rgba(28,36,56,.45); }
}
.bus-age { margin:6px 0 10px; }
.bus-age[data-stale=true] { color:var(--nv-ink); }
.bus-sheet-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.bus-sheet-actions a { min-height:44px; display:flex; justify-content:center; align-items:center; gap:6px; padding:6px; text-decoration:none; color:var(--nv-ink)!important; border:1px solid var(--nv-line); border-radius:var(--nv-r); font-size:.8125rem; background:#fff; }
.bus-sheet-actions a:nth-child(2) { background:var(--nv-accent); }
.bus-sheet-actions .bus-connect-open { grid-column:1/-1; min-height:44px; display:flex; justify-content:center; align-items:center; gap:6px; padding:6px; border:1px solid var(--nv-line); border-radius:var(--nv-r); font:inherit; font-size:.8125rem; font-weight:600; color:var(--nv-ink); background:#fff; cursor:pointer; }
.bus-sheet-actions .bus-connect-open svg { width:18px; height:18px; }
.bus-list-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.bus-list-head h2 { margin:0; }
.bus-sheet .bus-connect-start { flex:none; min-height:36px; display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border:1px solid var(--nv-line); border-radius:var(--nv-r); font:inherit; font-size:.8125rem; font-weight:600; color:var(--nv-ink); background:#fff; cursor:pointer; }
.bus-sheet .bus-connect-start svg { width:16px; height:16px; }
.bus-saved-services { display:flex; flex-wrap:wrap; gap:6px; }
.bus-saved-chip { min-width:48px; min-height:36px; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; padding:0 12px; border-radius:var(--nv-r); background:var(--nv-accent); color:var(--nv-ink); font-weight:700; font-size:.875rem; text-decoration:none; }
.bus-service-switcher { position:sticky; top:0; z-index:2; display:flex; align-items:flex-start; gap:8px; background:#fff; padding:6px 0; border-bottom:1px solid var(--nv-line); }
.bus-all-services { flex:none; padding:8px; font-size:.75rem!important; white-space:nowrap; }
.bus-all-services[aria-pressed=true] { background:var(--nv-accent); border-color:var(--nv-accent); }
.bus-service-chips { position:relative; min-width:0; display:flex; flex:1; gap:6px; overflow-x:auto; overscroll-behavior-inline:contain; padding:0 0 4px; scrollbar-width:thin; --fade-start:0px; --fade-end:0px; -webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--fade-start),#000 calc(100% - var(--fade-end)),transparent 100%); mask-image:linear-gradient(to right,transparent 0,#000 var(--fade-start),#000 calc(100% - var(--fade-end)),transparent 100%); }
.bus-service-chips[data-start=true] { --fade-start:28px; }
.bus-service-chips[data-end=true] { --fade-end:28px; }
.bus-service-chips button { flex:none; display:flex; align-items:center; gap:6px; padding:8px 10px; white-space:nowrap; }
.bus-service-chips button[aria-pressed=true] { background:var(--nv-accent); border-color:var(--nv-accent); }
.bus-service-chips svg { width:14px; height:14px; }
.bus-service { margin-top:4px; }
.bus-service-title { display:flex; gap:6px; align-items:center; }
.bus-service-title button:first-child { display:flex; flex:1; min-width:0; gap:8px; align-items:center; text-align:left; padding:6px 8px; }
.bus-service-title strong { font-size:1.125rem; flex:none; }
.bus-service-title button>span { color:var(--nv-muted); font-size:.75rem; line-height:1.4; overflow-wrap:anywhere; }
.bus-arrival { display:grid; grid-template-columns:70px minmax(0,1fr); align-items:center; gap:8px; min-height:66px; padding:10px 0; border-bottom:1px solid var(--nv-line); text-align:left; }
.bus-arrival-time { font-weight:750; font-size:1.2rem; line-height:1.2; color:var(--nv-ink); font-variant-numeric:tabular-nums; }
.bus-arrival-info { min-width:0; display:grid; gap:6px; }
.bus-arrival-meta { font-size:.6875rem; display:flex; justify-content:flex-end; flex-wrap:wrap; align-items:center; gap:6px; line-height:1.4; color:var(--nv-muted); }
.bus-detail-main { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.bus-deck { font-size:.75rem; color:var(--nv-muted); text-align:right; }
.bus-later-meta { display:flex; align-items:center; gap:3px; color:var(--nv-muted); font-size:9px; min-height:14px; }
.bus-later-meta .bus-crowd { font-size:0; gap:0; }
.bus-later-meta .bus-crowd-bars { gap:1px; }
.bus-later-meta .bus-crowd-bars i { width:3px; height:6px; }
.bus-later-meta .bus-crowd-bars i:nth-child(2) { height:9px; }
.bus-later-meta .bus-crowd-bars i:nth-child(3) { height:12px; }
.bus-crowd { display:inline-flex; align-items:center; gap:6px; font-size:.75rem; line-height:1.4; white-space:normal; }
.bus-crowd-bars { display:inline-flex; align-items:flex-end; gap:2px; flex:none; }
.bus-crowd-bars i { width:4px; height:9px; background:var(--nv-line); }
.bus-crowd-bars i:nth-child(2) { height:12px; }.bus-crowd-bars i:nth-child(3) { height:15px; }
.bus-crowd-bars i.on { background:var(--nv-ink); }
.bus-scheduled { display:inline-block; padding:2px 4px; border:1px solid var(--nv-line); border-radius:var(--nv-r); white-space:nowrap; }
.bus-service-summary { display:flex; align-items:center; gap:4px; min-height:64px; border-bottom:1px solid var(--nv-line); }
.bus-sheet .bus-summary-arrival,.bus-arrivals-popup .bus-summary-arrival { display:grid; grid-template-columns:56px minmax(0,1.4fr) repeat(2,minmax(0,1fr)); flex:1; min-width:0; min-height:64px; align-items:center; gap:4px; border:0; background:#fff; padding:4px 0; text-align:left; }
.bus-summary-service { display:grid; place-items:center; min-height:36px; padding:4px 2px; background:var(--nv-accent); color:var(--nv-ink); border-radius:var(--nv-r); font-size:.875rem; white-space:nowrap; letter-spacing:-.01em; }
.bus-summary-service[data-len="5"] { font-size:.75rem; letter-spacing:-.03em; }
.bus-summary-service[data-len="6"] { font-size:.6875rem; letter-spacing:-.04em; }
.bus-routes-toggle[aria-pressed=true] { background:var(--nv-accent); border-color:var(--nv-accent); }
.route-num { background:none; border:0; pointer-events:none; }
.route-num span { position:absolute; left:0; top:0; width:max-content; transform:translate(-50%,-50%); padding:2px 6px; border-radius:999px; background:var(--c); color:#fff; border:2px solid #fff; font:700 11px/1.2 var(--nv-font); white-space:nowrap; box-shadow:0 1px 3px rgba(28,36,56,.35); }
.leaflet-popup.bus-route-popup-wrap .leaflet-popup-content-wrapper,.leaflet-popup.bus-route-popup-wrap .leaflet-popup-content { width:max-content!important; min-width:0!important; max-width:min(260px,calc(100vw - 48px))!important; }
.leaflet-popup.bus-route-popup-wrap .leaflet-popup-content { margin:10px 12px 12px; }
.bus-route-popup { user-select:none; -webkit-user-select:none; }
.bus-route-popup-title { display:block; margin-bottom:8px; font-size:.6875rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; line-height:1.2; color:var(--nv-muted); white-space:nowrap; }
.bus-route-popup-chips { display:flex; flex-wrap:wrap; gap:6px; }
.bus-route-popup-chips button { display:inline-flex; align-items:center; justify-content:center; height:32px; min-height:32px; min-width:44px; margin:0; padding:0 12px; border:0; border-radius:999px; background:var(--c); color:#fff; font:700 .8125rem/1 var(--nv-font); box-shadow:none; cursor:pointer; }
.bus-route-popup-chips button:hover { filter:brightness(1.12); }
.bus-route-popup-title { max-width:220px; overflow:hidden; text-overflow:ellipsis; }
.bus-route-popup .bus-route-popup-view { display:inline-flex; align-items:center; justify-content:center; height:36px; min-height:36px; margin:0; padding:0 14px; border:1px solid var(--nv-ink); border-radius:var(--nv-r); background:var(--nv-accent); color:var(--nv-ink); font:700 .8125rem/1 var(--nv-font); box-shadow:none; cursor:pointer; }
.bus-route-popup .bus-route-popup-view:hover { filter:brightness(1.05); }
.bus-hours { margin:10px 0 0; }
.bus-card-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px; }
.bus-service .bus-schedule-toggle { display:inline-flex; align-items:center; gap:4px; min-height:36px; padding:0; border:0; background:none; color:var(--nv-ink); font-size:.8125rem; font-weight:600; box-shadow:none; }
.bus-service .bus-schedule-toggle .bus-ph { width:14px; height:14px; transition:transform .15s var(--nv-ease); }
.bus-service .bus-schedule-toggle[aria-expanded=true] .bus-ph { transform:rotate(180deg); }
.bus-route-link { color:var(--nv-ink); font-size:.8125rem; font-weight:600; text-underline-offset:3px; }
.bus-hours-empty { margin:10px 0 0; color:var(--nv-muted); font-size:.875rem; }
.bus-hours-dir + .bus-hours-dir { margin-top:18px; }
.bus-freq { margin:0; display:grid; gap:0; }
.bus-freq div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid var(--nv-line); }
.bus-freq dt { display:flex; flex-direction:column; font-size:.8125rem; font-weight:600; }
.bus-freq dt small { font-weight:400; }
.bus-freq dd { margin:0; font-size:.8125rem; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.bus-hours-dir .bus-hours-title:not(:first-child) { margin-top:16px; }
.bus-sheet .bus-hours-title { margin:0 0 12px; font-size:.6875rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--nv-muted); }
.bus-hours-dest { margin:0 0 6px; font-size:.8125rem; font-weight:700; }
.bus-hours-status { margin:0 0 12px; font-size:.8125rem; font-weight:600; line-height:1.35; }
.bus-days { display:grid; gap:14px; margin:0; padding:0; list-style:none; }
.bus-day-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; font-size:.875rem; color:var(--nv-muted); }
.bus-day-head time { font-variant-numeric:tabular-nums; }
.bus-day-head sup { margin-left:2px; font-size:.625rem; }
.bus-span { position:relative; display:block; height:6px; margin-top:8px; border-radius:3px; background:var(--nv-line); }
.bus-span i { position:absolute; top:0; bottom:0; border-radius:3px; background:var(--nv-muted); opacity:.5; }
.bus-span b { position:absolute; top:-3px; bottom:-3px; width:2px; margin-left:-1px; border-radius:1px; background:var(--nv-ink); }
.bus-day.is-today .bus-day-head { color:var(--nv-ink); font-weight:700; }
.bus-day.is-today .bus-span i { background:var(--nv-accent); opacity:1; }
.bus-axis { display:flex; justify-content:space-between; margin-top:10px; font-size:.625rem; color:var(--nv-muted); font-variant-numeric:tabular-nums; }
.bus-summary-column { display:flex; flex-direction:column; justify-content:center; min-width:0; gap:5px; }
.bus-summary-time { display:flex; align-items:baseline; gap:2px; white-space:nowrap; font-variant-numeric:tabular-nums; line-height:1.1; }
.bus-summary-next .bus-summary-time { font-size:24px; font-weight:750; color:var(--nv-ink); }
.bus-summary-later .bus-summary-time { font-size:15px; font-weight:500; color:var(--nv-muted); }
.bus-summary-time small { font-size:10px; font-weight:400; }
.bus-compact-markers { display:flex; align-items:center; gap:3px; height:14px; color:var(--nv-muted); }
.bus-compact-markers>span { display:inline-flex; align-items:center; flex:none; }
.bus-compact-markers .bus-ph { width:12px; height:12px; }
.bus-compact-markers .bus-crowd-bars { gap:1px; }
.bus-compact-markers .bus-crowd-bars i { width:3px; height:6px; }
.bus-compact-markers .bus-crowd-bars i:nth-child(2) { height:9px; }
.bus-compact-markers .bus-crowd-bars i:nth-child(3) { height:12px; }
.bus-skeleton { height:60px; margin:8px 0; border-radius:var(--nv-r); background:#eee; }
.bus-info-popup.bus-arrivals-popup { width:100%; padding:8px; background:#fff; max-height:55dvh; overflow-y:auto; }
.bus-arrivals-popup .bus-popup-head { grid-template-columns:minmax(0,1fr) repeat(2,44px); padding-right:40px; }
.leaflet-container:has(.bus-arrivals-popup) a.leaflet-popup-close-button { width:44px!important; height:44px!important; top:4px!important; right:4px!important; padding:0!important; }
.bus-arrivals-popup .bus-popup-service { border-top:1px solid var(--nv-line); padding:10px 0; }
.bus-arrivals-popup .bus-popup-later { display:none; }
.bus-arrivals-popup .bus-popup-service.open .bus-popup-later { display:block; }
.bus-arrivals-popup .bus-popup-more { display:block; width:100%; min-height:44px; margin-top:4px; font-size:.75rem; }
.bus-arrivals-popup .bus-timeline { margin:0 0 8px; }
.bus-arrivals-popup .bus-arrival { margin:0; }
.top-search-container { max-width:min(420px,calc(100vw - 144px))!important; }
.bus-map-controls { position:fixed; right:12px; bottom:calc(24px + env(safe-area-inset-bottom)); z-index:1300; display:flex; flex-direction:column; align-items:stretch; gap:10px; width:44px; }
body.nv .bus-map-controls :is(.refresh-button,#weather-circle) { display:flex!important; align-items:center; justify-content:center; flex:0 0 44px; box-sizing:border-box!important; visibility:visible!important; position:static!important; inset:auto!important; width:44px!important; min-width:44px!important; max-width:44px!important; height:44px!important; min-height:44px!important; max-height:44px!important; margin:0!important; padding:0!important; opacity:1!important; pointer-events:auto!important; background:#fff!important; color:var(--nv-ink)!important; border:1px solid var(--nv-line)!important; border-radius:var(--nv-r)!important; cursor:pointer; transform:none!important; }
.bus-map-controls svg { display:block; width:22px!important; height:22px!important; }
.bus-map-controls #weather-emoji { display:flex; align-items:center; justify-content:center; line-height:1; font-size:22px; }
.bus-map-controls #weather-circle::after { display:none; }
.nv-more { display:none!important; }
@media(max-width:767px) {
 .bus-sheet { top:auto; bottom:0; left:0; width:100%; max-width:100%; max-height:48dvh; padding:12px 16px calc(16px + env(safe-area-inset-bottom)); border-radius:var(--nv-r) var(--nv-r) 0 0; }
 .bus-map-controls { bottom:calc(var(--bus-sheet-height,48dvh) + 12px); }
  .telegram-bot-button { display:none; }
 .bus-drawer-collapsed .bus-sheet { overflow:hidden; }
 .bus-drawer-collapsed .bus-sheet > :not(:first-child) { display:none; }
 .top-search-container { width:calc(100% - 32px)!important; max-width:calc(100% - 32px)!important; left:16px!important; right:16px!important; transform:none!important; box-sizing:border-box; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
.bus-info-popup.bus-arrivals-popup .timeline-bus-number { background:var(--nv-accent)!important; color:var(--nv-ink)!important; }
.bus-nearby-arrivals { display:flex; flex-wrap:wrap; gap:4px 6px; font-size:.6875rem; margin-top:6px; color:var(--nv-muted); max-height:56px; overflow:hidden; }
.bus-eta-pill { display:inline-flex; align-items:center; gap:5px; padding:3px 5px 3px 0; border:1px solid var(--nv-line); border-radius:var(--nv-r); background:var(--nv-surface); white-space:nowrap; }
.bus-eta-pill b { color:var(--nv-ink); background:var(--nv-accent); padding:3px 5px; border-radius:var(--nv-r); }
.bus-eta-pill strong { color:var(--nv-ink); font-weight:700; }
.bus-eta-pill[data-urgency=soon] { border-color:var(--nv-ok); }
.bus-eta-pill[data-urgency=soon] strong { color:var(--nv-ok); }
.bus-eta-pill[data-urgency=near] { background:color-mix(in srgb,var(--nv-accent) 18%,white); border-color:var(--nv-accent); }
.bus-eta-pill[data-urgency=unknown] strong { color:var(--nv-muted); font-weight:400; }
.bus-map-hint { position:fixed; left:50%; transform:translateX(-50%); z-index:1201; width:max-content; max-width:calc(100vw - 32px); display:flex; align-items:center; gap:8px; background:#fff; color:var(--nv-ink); border:1px solid var(--nv-line); border-radius:var(--nv-r); padding:10px 12px; box-sizing:border-box; font-size:.75rem; pointer-events:none; }
.bus-map-hint[hidden] { display:none; }
@keyframes bus-locate-pulse { 50% { opacity:.45; } }
.bus-map-controls .refresh-button[aria-busy=true] svg { animation:bus-locate-pulse .8s ease-in-out infinite; }
@media(prefers-reduced-motion:reduce) { .bus-map-controls .refresh-button[aria-busy=true] svg { animation:none; opacity:.6; } }

/* My-location marker and its tooltip, in the site theme */
.bus-user-icon { background: none; border: 0; }
.bus-user-dot { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%; background: var(--nv-accent); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--nv-ink), 0 2px 8px rgba(28,36,56,.35); }
.bus-user-dot::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; border: 2px solid var(--nv-accent); opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .bus-user-dot::after { animation: bus-user-ping 2.4s ease-out infinite; } }
@keyframes bus-user-ping { from { transform: scale(.55); opacity: .7; } to { transform: scale(1.1); opacity: 0; } }
.leaflet-popup.bus-user-popup-wrap .leaflet-popup-content-wrapper, .leaflet-popup.bus-user-popup-wrap .leaflet-popup-content { width: auto !important; min-width: 0; }
.leaflet-popup.bus-user-popup-wrap .leaflet-popup-content-wrapper { background: var(--nv-ink); color: #fff; border-color: var(--nv-ink); box-shadow: 0 6px 16px -8px rgba(28,36,56,.5); }
.leaflet-popup.bus-user-popup-wrap .leaflet-popup-content { margin: 8px 12px; }
.bus-user-popup { font-size: .8rem; font-weight: 700; line-height: 1.2; white-space: nowrap; color: #fff; }
.bus-compact-markers .bus-deck-code { font-size:11px; font-weight:700; letter-spacing:.02em; color:var(--nv-ink); }
.bus-later-meta>span { display:inline-flex; align-items:center; }
.bus-later-meta .bus-ph { width:12px; height:12px; }
.bus-section-nearby { margin-top:18px; padding-top:16px; border-top:1px solid var(--nv-line); }

/* Single-service arrival cards: big time left, crowd on top, deck/accessibility/status chips below */
.bus-arrival { grid-template-columns:minmax(88px,34%) minmax(0,1fr); gap:12px; min-height:76px; padding:14px 0; align-items:center; }
.bus-arrival-time { font-size:1.65rem; font-weight:800; letter-spacing:-.01em; white-space:nowrap; }
.bus-arrival-info { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.bus-arrival-info .bus-detail-main { display:contents; }
.bus-arrival-info .bus-crowd { flex:0 0 100%; font-size:.9rem; font-weight:650; color:var(--nv-ink); gap:8px; }
.bus-arrival-info .bus-crowd-bars i { width:5px; height:10px; }
.bus-arrival-info .bus-crowd-bars i:nth-child(2) { height:14px; }
.bus-arrival-info .bus-crowd-bars i:nth-child(3) { height:18px; }
.bus-arrival-info .bus-deck, .bus-arrival-info .bus-scheduled { display:inline-flex; align-items:center; min-height:26px; padding:0 10px; border:1px solid var(--nv-line); border-radius:var(--nv-r); font-size:.78rem; font-weight:600; color:var(--nv-ink); background:var(--nv-surface); text-align:left; }
.bus-arrival-info .bus-arrival-meta { display:contents; }
.bus-arrival-info .bus-arrival-meta>span[aria-label="Wheelchair accessible"] { display:inline-flex; align-items:center; min-height:26px; color:var(--nv-ink); }
.bus-arrival-info .bus-arrival-meta .bus-ph { width:20px; height:20px; }
.bus-arrival-info .bus-scheduled { color:var(--nv-muted); font-weight:500; }
.bus-arrival-info .bus-crowd { align-items:center; line-height:1; min-height:20px; }
.bus-arrival-info .bus-crowd-bars { align-self:center; height:18px; }
.bus-arrival-info .bus-crowd>span:not(.bus-crowd-bars) { display:inline-flex; align-items:center; height:18px; line-height:1; }
.bus-arrival-info { flex-wrap:nowrap; gap:8px; }
.bus-arrival-info .bus-crowd { flex:0 1 auto; }
.bus-arrival-info .bus-crowd>span:not(.bus-crowd-bars), .bus-arrival-info .bus-deck, .bus-arrival-info .bus-scheduled { white-space:nowrap; }
.bus-arrival-info .bus-crowd>span:not(.bus-crowd-bars) { font-size:.82rem; }
.bus-arrival-info .bus-deck, .bus-arrival-info .bus-scheduled { padding:0 7px; font-size:.72rem; }
.bus-arrival-info .bus-arrival-meta .bus-ph { width:18px; height:18px; }
@media (max-width:420px) { .bus-arrival { grid-template-columns:78px minmax(0,1fr); gap:8px; } .bus-arrival-time { font-size:1.4rem; } .bus-arrival-info { flex-wrap:wrap; row-gap:6px; } }

/* Compact rows: everything on one line */
.bus-arrival { min-height:56px; padding:8px 0; }
.bus-arrival-time { font-size:1.45rem; }
.bus-arrival-info { flex-wrap:nowrap; row-gap:0; gap:6px; }
.bus-arrival-info .bus-crowd { gap:6px; min-height:0; }
.bus-arrival-info .bus-crowd-bars, .bus-arrival-info .bus-crowd>span:not(.bus-crowd-bars) { height:16px; }
.bus-arrival-info .bus-crowd-bars i { width:4px; height:8px; }
.bus-arrival-info .bus-crowd-bars i:nth-child(2) { height:12px; }
.bus-arrival-info .bus-crowd-bars i:nth-child(3) { height:16px; }
.bus-arrival-info .bus-deck, .bus-arrival-info .bus-scheduled { min-height:22px; padding:0 6px; font-size:.7rem; }
.bus-arrival-info .bus-arrival-meta .bus-ph { width:16px; height:16px; }
@media (max-width:420px) { .bus-arrival { grid-template-columns:70px minmax(0,1fr); gap:6px; } .bus-arrival-time { font-size:1.3rem; } .bus-arrival-info { flex-wrap:nowrap; } .bus-arrival-info .bus-crowd>span:not(.bus-crowd-bars) { font-size:.76rem; } }

/* Nearby list: calm neutral pills, one accent only on service numbers */
.bus-eta-list { display:flex; flex-wrap:wrap; gap:4px 6px; }
.bus-eta-pill { padding:0; border:0; background:none; gap:4px; font-size:.78rem; }
.bus-eta-pill b { background:none; padding:0; color:var(--nv-ink); font-weight:800; }
.bus-eta-pill strong { color:var(--nv-muted); font-weight:600; }
.bus-eta-pill+.bus-eta-pill::before { content:""; align-self:center; width:1px; height:10px; margin-right:2px; background:var(--nv-line); }
.bus-eta-count { display:block; margin-top:3px; font-size:.68rem; color:var(--nv-muted); }
.bus-nearby-arrivals { display:block; max-height:none; }

/* Favourites sit on a tinted panel; nearby stops stay on the page background */
.bus-fav-block { margin:0 -10px 14px; padding:4px 10px 6px; border-radius:var(--nv-r); background:color-mix(in srgb,var(--nv-accent) 12%,var(--nv-raised)); }
.bus-fav-block h3 { margin-top:8px; }
.bus-fav-block .bus-stop-row:last-child { border-bottom:0; }
.bus-section-nearby { margin-top:0; padding-top:0; border-top:0; }

/* Crowd colour coding, text always stays alongside */
.bus-crowd-bars[data-level="1"] i.on, [data-level="1"]>.bus-crowd-bars i.on { background:var(--nv-ok); }
.bus-crowd-bars[data-level="2"] i.on, [data-level="2"]>.bus-crowd-bars i.on { background:var(--nv-warn); }
.bus-crowd-bars[data-level="3"] i.on, [data-level="3"]>.bus-crowd-bars i.on { background:var(--nv-bad); }
.bus-arrival-info .bus-crowd[data-level="1"]>span:not(.bus-crowd-bars) { color:var(--nv-ok); }
.bus-arrival-info .bus-crowd[data-level="2"]>span:not(.bus-crowd-bars) { color:var(--nv-warn); }
.bus-arrival-info .bus-crowd[data-level="3"]>span:not(.bus-crowd-bars) { color:var(--nv-bad); }

/* Single-service row: deck, wheelchair and Est./Live right-aligned */
.bus-arrival-info .bus-crowd { flex:0 1 auto; }
.bus-arrival-info .bus-deck { margin-left:auto; }
.bus-arrival-info .bus-scheduled, .bus-arrival-info .bus-live { min-height:20px; padding:0 5px; font-size:.65rem; font-weight:700; letter-spacing:.02em; text-transform:uppercase; }
.bus-arrival-info .bus-live { display:inline-flex; align-items:center; gap:4px; color:var(--nv-ok); border:1px solid color-mix(in srgb,var(--nv-ok) 45%,white); border-radius:var(--nv-r); background:none; }
.bus-arrival-info .bus-live::before { content:""; width:5px; height:5px; border-radius:50%; background:var(--nv-ok); }
.bus-eta-star { display:inline-flex; width:10px; height:10px; margin-left:-1px; color:var(--nv-accent-ink,#8a6a12); }
.bus-eta-star svg { width:10px; height:10px; fill:currentColor; }

/* Tap a live row to see the bus on the map */
.bus-arrival-wrap { border-bottom:1px solid var(--nv-line); }
.bus-arrival-wrap .bus-arrival { border-bottom:0; }
button.bus-arrival.is-trackable { width:100%; border:0; background:none; font:inherit; color:inherit; cursor:pointer; min-height:56px; }
button.bus-arrival.is-trackable:active { background:var(--nv-surface); }
.bus-arrival-wrap.is-tracked { background:color-mix(in srgb,var(--nv-accent) 12%,var(--nv-raised)); margin:0 -8px; padding:0 8px; border-radius:var(--nv-r); }
.bus-track-note { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; margin:0; padding:0 0 10px; font-size:.78rem; font-weight:650; color:var(--nv-ink); }
.bus-track-note .bus-ph { width:16px; height:16px; }
.bus-track-note>span:first-of-type { display:inline-flex; }
.bus-track-age { margin-left:auto; font-weight:500; color:var(--nv-muted); }
.bus-track-age[data-fresh="false"] { color:var(--nv-warn); }
.bus-arrival-info .bus-live .bus-ph { width:11px; height:11px; }
.bus-arrival-info .bus-live:has(.bus-ph)::before { display:none; }
.bus-track-icon { background:none; border:0; }
.bus-track-pin { position:relative; width:44px; height:44px; display:grid; place-items:center; align-content:center; border-radius:50%; background:var(--bc,var(--nv-ok)); color:#fff; border:3px solid #fff; box-shadow:0 0 0 2px var(--bc,var(--nv-ok)), 0 4px 12px rgba(28,36,56,.4); }
.bus-track-pin::after { content:""; position:absolute; inset:-3px; border-radius:50%; border:2px solid var(--bc,var(--nv-ok)); opacity:0; animation:bus-live-pulse 2s ease-out infinite; pointer-events:none; }
@keyframes bus-live-pulse { 0% { transform:scale(1); opacity:.7; } 100% { transform:scale(1.9); opacity:0; } }
@media (prefers-reduced-motion: reduce) { .bus-track-pin::after { animation:none; } }
.bus-track-pin .bus-ph { width:18px; height:18px; }
.bus-track-pin b { font-size:.62rem; line-height:1; font-weight:800; }

/* The stop card lives in the side sheet; the map popup would only duplicate it (and clip on desktop). */
.leaflet-popup:has(.bus-info-popup) { display:none; }
/* You are here: blue, distinct from yellow stops and coloured buses. */
.bus-user-dot { background:#2f6fed; box-shadow:0 0 0 1.5px #1c4fb8, 0 2px 8px rgba(28,36,56,.35); }
.bus-user-dot::after { border-color:#2f6fed; }
/* Next three buses of the open service: small live pins with a time, crowd and deck tag; tap one to track it. */
.bus-live-icon { background:none; border:0; }
.bus-live-pin { position:relative; width:26px; height:26px; margin:2px; display:grid; place-items:center; border-radius:50%; background:var(--nv-ok); color:#fff; border:2px solid #fff; box-shadow:0 0 0 1px var(--nv-ok), 0 2px 5px rgba(28,36,56,.3); box-sizing:border-box; }
.bus-live-pin .bus-ph { width:13px; height:13px; }
.bus-live-pin b { position:absolute; right:-6px; top:-6px; min-width:14px; height:14px; padding:0 3px; box-sizing:border-box; display:grid; place-items:center; border-radius:7px; background:#fff; color:var(--nv-ok); border:1.5px solid var(--nv-ok); font-size:.6rem; font-weight:800; line-height:1; }
.bus-live-pin::after { content:""; position:absolute; inset:-2px; border-radius:50%; border:1.5px solid var(--nv-ok); opacity:0; animation:bus-live-pulse 2.6s ease-out infinite; pointer-events:none; }
.bus-live-tag { position:absolute; left:34px; top:50%; transform:translateY(-50%); display:flex; align-items:center; gap:5px; padding:2px 6px; border:1px solid var(--nv-line); border-radius:var(--nv-r); background:var(--nv-raised, #fff); color:var(--nv-ink); font-size:.6875rem; font-weight:700; line-height:16px; white-space:nowrap; box-shadow:0 1px 3px rgba(28,36,56,.2); pointer-events:none; font-variant-numeric:tabular-nums; }
.bus-live-tag .bus-crowd-bars { height:10px; gap:1px; }
.bus-live-tag .bus-crowd-bars i { width:3px; height:5px; }
.bus-live-tag .bus-crowd-bars i:nth-child(2) { height:7px; }
.bus-live-tag .bus-crowd-bars i:nth-child(3) { height:10px; }
.bus-live-tag em { font-style:normal; font-weight:600; color:var(--nv-muted); }
@media (prefers-reduced-motion: reduce) { .bus-live-pin::after { animation:none; } }
.bus-pill-meta { display:inline-flex; align-items:center; gap:3px; margin-left:1px; }
.bus-pill-meta .bus-crowd-bars { gap:1px; height:9px; }
.bus-pill-meta .bus-crowd-bars i { width:3px; height:4px; }
.bus-pill-meta .bus-crowd-bars i:nth-child(2) { height:6px; }
.bus-pill-meta .bus-crowd-bars i:nth-child(3) { height:9px; }
.bus-eta-list { gap:4px 12px; align-items:center; }
.bus-eta-pill+.bus-eta-pill::before { display:none; }
.bus-eta-list .bus-eta-count { display:inline; margin:0; }
.bus-eta-list [hidden] { display:none; }
/* Wide chips (Standing, Limited, LIVE) wrap to a second line instead of being clipped by the sheet edge. */
body .bus-arrival-info { flex-wrap:wrap; row-gap:6px; overflow:visible; }
body .bus-arrival-info { justify-content:flex-start; }
body .bus-arrival-info .bus-deck, body .bus-arrival-info .bus-scheduled:first-child { margin-left:auto; }
body .bus-sheet .bus-arrival { grid-template-columns:minmax(78px,max-content) minmax(0,1fr); gap:14px; }
/* The side sheet covers the left edge of the map on desktop; keep zoom in/out clear of it. */
@media (min-width:768px) { .bus-sheet ~ * .leaflet-top.leaflet-left, body.nv .leaflet-top.leaflet-left { left:408px; } }
/* Desktop: sheet, zoom and search share one top row. Search sits right of the zoom stack instead of centred, so the sheet can start at the top. */
@media (min-width:768px) {
  .bus-sheet { top:calc(var(--nv-bar-h) + 11px); }
  .top-search-container { left:468px!important; transform:none!important; width:min(420px,calc(100vw - 468px - 76px))!important; max-width:none!important; }
}

/* Drawer tab: sits on the top edge of the bottom sheet and follows its height. Phones only. */
.bus-drawer-toggle { display:none; }
@media(max-width:767px) {
 .bus-drawer-toggle { position:fixed; left:50%; bottom:calc(var(--bus-sheet-height,48dvh) - 1px); transform:translateX(-50%); z-index:1002; width:56px; height:24px; padding:0; display:grid; place-items:center; color:var(--nv-ink); background:#fff; border:1px solid var(--nv-line); border-bottom:0; border-radius:var(--nv-r) var(--nv-r) 0 0; cursor:pointer; }
 .bus-drawer-toggle[hidden] { display:none; }
 .bus-drawer-toggle::before { content:''; position:absolute; inset:-14px -8px 0; } /* a 44px-tall touch target around the small tab */
 .bus-drawer-toggle svg { transition:transform .15s var(--nv-ease,ease); }
 .bus-drawer-toggle[aria-expanded=false] svg { transform:rotate(180deg); }
}
@media (prefers-reduced-motion:reduce) { .bus-drawer-toggle svg { transition:none; } }
