/* Shared stop hierarchy. Canvas dots have an invisible pointer tolerance; DOM pins
   and hubs have 44px targets. Boxed name signs are budgeted by the stop layer. */
/* Leaflet places every marker with position:absolute plus a translate; never override that here, or pins stack in the flow and drift as others are added or removed while panning. */
.bus-stop-icon { display: flex; align-items: center; color: var(--nv-ink, #1c2438); background: none; border: 0; }
.bus-stop-label-container { position: relative; display: flex; align-items: center; gap: 3px; padding-inline-start: 9px; color: var(--nv-ink, #1c2438); }
.bus-stop-pin-fa { position: relative; color: var(--nv-ink, #1c2438); background: #fbe6a0; box-shadow: inset 0 0 0 2px var(--nv-ink, #1c2438), 0 1px 4px rgba(28, 36, 56, .3); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; line-height: 1; flex: none; transition: width .15s, height .15s; }
.bus-stop-pin-fa svg { width: 16px; height: 16px; }
.bus-stop-small:not(.bus-stop-selected) .bus-stop-pin-fa { width: 28px; height: 28px; }
.bus-stop-nearby .bus-stop-label-container { padding-inline-start: 2.5px; }
.bus-stop-nearby .bus-stop-pin-fa { width: 39px; height: 39px; }
.bus-stop-nearby.bus-stop-small .bus-stop-label-container { padding-inline-start: 5.5px; }
.bus-stop-nearby.bus-stop-small .bus-stop-pin-fa { width: 33px; height: 33px; }
/* Yellow is reserved for what you are looking at: the chosen stop (inverted below), stops on the drawn route, and the stops of a Where to? trip. Every other stop is a pale-yellow disc with a dark ring: visible on the grey basemap, but lighter than the selection and not mistaken for a taxi stand. */
.bus-stop-onroute:not(.bus-stop-selected):not(.bus-stop-ahead):not(.bus-stop-passed) .bus-stop-pin-fa, .bus-stop-journey:not(.bus-stop-selected) .bus-stop-pin-fa { background: var(--nv-accent, #e9b83a); }
/* A saved stop carries a small dark star, so it can be found without colour. */
.bus-stop-saved:not(.bus-stop-selected):not(.bus-stop-ahead) .bus-stop-pin-fa::before { content: ""; position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--nv-ink, #1c2438) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23fff'%3E%3Cpath d='M239.2 97.4A16.4 16.4 0 0 0 224.6 86l-59.4-4.1-22-55.5a16.3 16.3 0 0 0-30.4 0l-22 55.5L31.4 86a16.4 16.4 0 0 0-9.4 28.8l45.4 38.9-14.3 57.6a16.1 16.1 0 0 0 24.5 17.6L128 197.1l50.4 32.8a16.1 16.1 0 0 0 24.5-17.6l-14.3-57.6L234 114.8a16.4 16.4 0 0 0 5.2-17.4Z'/%3E%3C/svg%3E") center / 9px no-repeat; }
/* A name that would land on another name or pin is hidden until its pin is hovered or opened. */
.bus-stop-icon.bus-stop-sign-off:not(:hover):not(:focus-visible):not(.is-open):not(.bus-stop-hover) .sg-bus-sign { display: none; }
/* One drawn route: stops ahead are white discs numbered by distance from the selected stop, the last is filled; stops behind it are small and quiet. */
.bus-stop-ahead .bus-stop-pin-fa { background: #fff; color: var(--nv-ink, #1c2438); box-shadow: inset 0 0 0 2px var(--nv-ink, #1c2438); font: 700 11px/1 var(--nv-font, sans-serif); font-variant-numeric: tabular-nums; }
.bus-stop-ahead .bus-stop-pin-fa svg { display: none; }
.bus-stop-ahead .bus-stop-pin-fa::after { content: attr(data-n); }
.bus-stop-ahead.bus-stop-last .bus-stop-pin-fa { background: var(--nv-ink, #1c2438); color: #fff; }
.bus-stop-passed:not(.bus-stop-selected) .bus-stop-pin-fa { width: 26px; height: 26px; background: #fff; color: var(--nv-muted, #596174); box-shadow: inset 0 0 0 1.5px var(--nv-muted, #596174); }
.bus-stop-passed .bus-stop-pin-fa svg { width: 15px; height: 15px; }
.bus-stop-selected .bus-stop-label-container { padding-inline-start: 9px; gap: 9px; }
/* The chosen stop is the one solid yellow pin: a white gap and a yellow ring, with a dark name sign and its code. */
.bus-stop-selected .bus-stop-pin-fa { width: 34px; height: 34px; background: var(--nv-accent, #e9b83a); color: var(--nv-ink, #1c2438); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--nv-accent, #e9b83a), 0 2px 8px rgba(28, 36, 56, .45); }
.bus-stop-selected .bus-stop-pin-fa svg { width: 19px; height: 19px; }
.bus-stop-hover .bus-stop-pin-fa { outline: 2px solid var(--nv-accent, #e9b83a); outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
.sg-bus-sign { display: none; flex-direction: column; align-items: stretch; gap: 1px; min-width: 0; max-width: 130px; padding: 3px 6px; border: 1px solid var(--nv-line, #d8dce3); border-radius: var(--nv-r, 4px); background: var(--nv-raised, #fff); color: var(--nv-ink, #1c2438); font: 700 11px/1.25 var(--nv-font, sans-serif); white-space: nowrap; pointer-events: none; }
.bus-stop-want-sign .sg-bus-sign { display: inline-flex; }
.sg-bus-sign-code { display: none; color: var(--nv-muted, #596174); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sg-bus-sign-name { overflow: hidden; text-overflow: ellipsis; color: var(--nv-ink, #1c2438); font-weight: 700; }
.bus-stop-compact .sg-bus-sign { max-width: 100px; padding: 2px 5px; font-size: 10px; }
/* Placed after the compact rule so the chosen stop's sign is never shrunk. */
.bus-stop-selected .sg-bus-sign, .bus-stop-selected.bus-stop-compact .sg-bus-sign { max-width: 200px; padding: 5px 9px; border-color: var(--nv-ink, #1c2438); background: var(--nv-ink, #1c2438); color: #fff; font-size: 12px; box-shadow: 0 2px 8px rgba(28, 36, 56, .35); }
.bus-stop-selected .sg-bus-sign-name { color: #fff; }
.bus-stop-selected .sg-bus-sign-code { display: block; color: var(--nv-accent, #e9b83a); font-size: 11px; }
/* Codes belong to hover/tap detail, not the default close-up name sign. */
.bus-stop-icon:hover, .bus-stop-icon:focus-visible, .bus-stop-icon.is-open, .bus-stop-icon.bus-stop-hover { z-index: 9000 !important; }
.bus-stop-icon:hover .sg-bus-sign, .bus-stop-icon:focus-visible .sg-bus-sign, .bus-stop-icon.is-open .sg-bus-sign, .bus-stop-icon.bus-stop-hover .sg-bus-sign { display: inline-flex; max-width: min(220px, 55vw); }
.bus-stop-icon:hover .sg-bus-sign-code, .bus-stop-icon:focus-visible .sg-bus-sign-code, .bus-stop-icon.is-open .sg-bus-sign-code, .bus-stop-icon.bus-stop-hover .sg-bus-sign-code { display: block; }
.bus-stop-icon:focus-visible, .bus-hub-icon:focus-visible { outline: 2px solid var(--nv-ink, #1c2438); outline-offset: 2px; }
.bus-stop-eta { position: absolute; inset-inline-start: 22px; bottom: 100%; margin-bottom: 5px; padding: 4px 8px; border: 1px solid var(--nv-line, #d8dce3); border-radius: var(--nv-r, 4px); background: var(--nv-raised, #fff); color: var(--nv-ink, #1c2438); font: 700 12px/1.4 var(--nv-font, sans-serif); white-space: nowrap; pointer-events: none; }
.bus-stop-eta[hidden] { display: none; }
.bus-stop-eta.is-below { bottom: auto; top: 100%; margin: 5px 0 0; }
/* On a phone the open sheet already lists these buses (chips, or the collapsed strip's next buses), so the map tag shows only while the drawer is collapsed to give the map room. */
/* It stays whenever the stop sheet is not showing (the Where to? panel is open over it), so it is never the only place a person cannot see the buses. */
@media (max-width: 767px) { body:not(.bus-drawer-collapsed):has(> .bus-sheet:not(.bus-connect):not([hidden])) .bus-stop-eta, body:not(.bus-drawer-collapsed):has(> .bus-sheet:not(.bus-connect):not([hidden])) .leaflet-tooltip.bus-stop-eta-tip { display: none; } }
.bus-stop-eta, .leaflet-tooltip.bus-stop-eta-tip { display: flex; flex-direction: column; gap: 3px; }
.bus-eta-row { display: flex; align-items: center; gap: 8px; }
.bus-eta-row b { min-width: 28px; padding: 0 5px; border-radius: var(--nv-r, 4px); background: var(--nv-accent, #e9b83a); color: var(--nv-ink, #1c2438); text-align: center; font-variant-numeric: tabular-nums; }
.leaflet-tooltip.bus-stop-eta-tip { padding: 4px 8px; border: 1px solid var(--nv-line, #d8dce3); border-radius: var(--nv-r, 4px); background: var(--nv-raised, #fff); color: var(--nv-ink, #1c2438); box-shadow: none; font: 700 12px/1.4 var(--nv-font, sans-serif); }
.leaflet-tooltip-right.bus-stop-eta-tip::before { border-right-color: var(--nv-line, #d8dce3); }

/* Hubs keep their small icon in browse/stop/own-route context. All-route and
   off-route hubs are ordinary canvas dots, not another DOM marker. */
.bus-hub-icon { background: none; border: 0; }
.bus-hub { position: relative; display: grid; place-items: center; width: 44px; height: 44px; }
.bus-hub i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 3px; background: var(--nv-ink, #1c2438); border: 1.5px solid var(--nv-accent, #e9b83a); color: #fff; }
.bus-hub svg { width: 14px; height: 14px; }
.bus-hub b { display: none; position: absolute; inset-inline-start: 30px; top: 50%; transform: translateY(-50%); max-width: 150px; overflow: hidden; text-overflow: ellipsis; padding: 3px 6px; border: 1px solid var(--nv-line, #d8dce3); border-radius: var(--nv-r, 4px); background: var(--nv-raised, #fff); color: var(--nv-ink, #1c2438); font: 600 11px/1.3 var(--nv-font, sans-serif); white-space: nowrap; pointer-events: none; }
.bus-hub-labels .bus-hub b { display: block; }
.bus-hub-icon.bus-stop-hover .bus-hub i { outline: 2px solid var(--nv-accent, #e9b83a); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }

/* Shared transient code-and-name detail for dots and hubs. */
.leaflet-tooltip.bus-stop-tip { padding: 8px 10px; max-width: min(220px, calc(100vw - 32px)); box-sizing: border-box; border: 1px solid var(--nv-line, #d8dce3); border-radius: var(--nv-r, 4px); background: var(--nv-raised, #fff); color: var(--nv-ink, #1c2438); box-shadow: none; font: 700 12px/1.35 var(--nv-font, sans-serif); white-space: normal; overflow-wrap: break-word; width: max-content; pointer-events: none; }
.bus-stop-tip-name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bus-stop-tip-code { display: block; margin-top: 2px; color: var(--nv-muted, #596174); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.leaflet-tooltip-top.bus-stop-tip::before { border-top-color: var(--nv-line, #d8dce3); }
@media (prefers-reduced-motion: reduce) { .bus-stop-pin-fa { transition: none; } }

/* A stop on a Where to? trip: the sign names its job (Board, Change here, Get off) and is tappable along with the pin. */
.bus-stop-journey .sg-bus-sign { pointer-events: auto; cursor: pointer; }
.bus-stop-journey .sg-bus-sign-role { color: var(--nv-accent, #e9b83a); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.bus-stop-journey.bus-stop-selected .sg-bus-sign { max-width: 170px; }
.bus-stop-journey .sg-bus-sign { transform: translateY(var(--sign-dy, 0)); }
.bus-stop-journey.is-left .bus-stop-label-container { flex-direction: row-reverse; }
.bus-stop-journey.is-left .sg-bus-sign { text-align: right; }
.bus-pin-hidden { display: none !important; } /* the page's own pin for a stop that the trip draws itself */
/* Tiny x on the arrivals tag: 18px to look at, 44px to hit. */
.bus-stop-eta .bus-eta-close, .leaflet-tooltip.bus-stop-eta-tip .bus-eta-close { position: absolute; top: -9px; right: -9px; width: 18px; min-height: 0; height: 18px; display: grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--nv-ink, #1c2438); color: #fff; font: 700 13px/1 var(--nv-font, sans-serif); cursor: pointer; pointer-events: auto; }
.bus-eta-close::after { content: ""; position: absolute; inset: -13px; }
.bus-eta-close:focus-visible { outline: 2px solid var(--nv-accent, #e9b83a); outline-offset: 1px; }
/* Phone: a trip crosses the whole island at low zoom, so its signs are narrower to find a clear place beside their pins (spreadJourneyPins). */
@media (max-width: 767px) { .bus-stop-journey .sg-bus-sign, .bus-stop-journey.bus-stop-selected .sg-bus-sign { max-width: 118px; padding: 3px 6px; font-size: 11px; } .bus-stop-journey .sg-bus-sign-role { font-size: 9px; } }
.bus-sign-leaders { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 640; pointer-events: none; overflow: visible; }
.bus-sign-leaders line { stroke: var(--nv-ink, #1c2438); stroke-width: 1.5; stroke-linecap: round; opacity: .75; }
