/* ChiTransit transit components (see transit.js): route icons, line bars, stop rows, arrival cards and
   map markers. Loaded by /api/ and /components.html after /site/chitransit.css. */
/* The selection ring around a selected map marker: a Paper gap, then Ink (the route toggle's ring). */
:root{--selection-ring:0 0 0 var(--size-selection-ring-gap) var(--paper),0 0 0 calc(var(--size-selection-ring-gap) + var(--size-focus-ring-width)) var(--ink)}
/* Line fills (train route icons, line-bar segments, station bars) draw a 1px inner keyline in
   --route-keyline, set with --route: the generated --<line>-line-keyline, transparent unless the
   fill is under 3:1 against Surface, Card or Card 2 in the current theme (WCAG 1.4.11). */
/* ---------- route icons: one family, three sizes ---------- */
/* Bus capsules (and the +N chip) are sized in rem through their scalesWithText tokens, so the route
   number grows with the browser's text size; train discs carry no text and keep their size. */
.route-icon{--route:var(--accent);display:inline-grid;place-items:center;flex:none;font-weight:700;line-height:1}
.route-icon.train{width:24px;height:24px;border-radius:50%;background:var(--route);box-shadow:inset 0 0 0 1px var(--route-keyline,transparent)}
.route-icon.bus{min-width:var(--size-route-icon-bus-width);height:var(--size-route-icon-bus-height);padding:0 7px;border-radius:var(--radius-route-icon-bus);background:var(--accent);color:var(--accent-ink);font-size:var(--size-route-icon-bus-text);white-space:nowrap}
.route-icon.mini.train{width:14px;height:14px}
.route-icon.mini.bus{min-width:var(--size-route-icon-bus-width-mini);height:var(--size-route-icon-bus-height-mini);padding:0 4px;border-radius:var(--radius-route-icon-bus-mini);font-size:var(--size-route-icon-bus-text-mini)}
.route-icon.md.train{width:32px;height:32px}
/* Show line letters: the line code on the disc in the line's glyph color (--<line>-line-glyph), 8 / 10px */
.route-icon.train.letters b{color:var(--route-on,var(--always-white));font-size:var(--size-line-letter-minimum);font-weight:var(--weight-bold);letter-spacing:.02em}
.route-icon.md.train.letters b{font-size:10px}
.route-icon.md.bus{min-width:var(--size-route-icon-bus-width-large);height:var(--size-route-icon-bus-height-large);padding:0 9px;border-radius:var(--radius-route-icon-bus-large);font-size:var(--size-route-icon-bus-text-large)}
.line-bar{display:inline-flex;gap:var(--size-line-bar-segment-spacing);height:var(--size-line-bar-height);flex:none}
.line-bar i{display:block;width:var(--size-line-bar-segment-width);height:var(--size-line-bar-height);flex:0 0 var(--size-line-bar-segment-width);border-radius:var(--radius-line-bar);background:var(--route);box-shadow:inset 0 0 0 1px var(--route-keyline,transparent)}
.route-more{display:inline-grid;place-items:center;height:var(--size-route-icon-bus-height);min-width:30px;padding:0 7px;border-radius:var(--radius-route-icon-bus);background:var(--card-2);color:var(--muted);font-size:var(--fs-cap);letter-spacing:var(--ls-cap);font-weight:700;flex:none}
.route-flow{display:flex;align-items:center;gap:var(--space-6);min-width:0;overflow:hidden}
/* fitCapsules() hides capsules with [hidden]; the display rules above would otherwise keep them drawn. */
.route-flow>[hidden]{display:none}

.list-row{width:100%;min-height:64px;border:0;border-bottom:1px solid var(--line);background:transparent;padding:var(--space-10) var(--space-8);margin:0 calc(var(--space-8) * -1);width:calc(100% + 2 * var(--space-8));border-radius:0;display:flex;align-items:center;gap:var(--space-14);text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color var(--motion-press-duration) ease-out}
.list-row:last-child{border-bottom:0}
@media (hover:hover){.list-row:hover{background:var(--card)}}
.list-row:active{background:var(--card-pressed)}
.list-row.active{background:var(--accent-tint);border-radius:var(--r-card);border-bottom-color:transparent}
.list-lead{width:var(--size-list-lead);display:grid;place-items:center;flex:none}
.list-copy{flex:1 1 0;min-width:120px}
.list-copy>b{display:block;font-size:var(--fs-body);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list-copy>span{display:block;font-size:var(--fs-sub);letter-spacing:var(--ls-sub);color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* The trail takes at most 40% of the row so the name keeps the rest; fitCapsules() folds what doesn't fit into +N. */
.list-trail{display:flex;align-items:center;gap:var(--space-6);flex:0 1 auto;min-width:0;max-width:40%;overflow:hidden}
.row-chev{width:16px;height:16px;color:var(--muted);transform:rotate(-90deg);flex:none}

.arrival-card{width:100%;border:0;border-radius:var(--r-card);background:var(--card);text-align:left;padding:var(--space-12) var(--space-arrival-horizontal-padding) var(--space-12) var(--space-10);cursor:pointer;display:block;-webkit-tap-highlight-color:transparent;transition:background-color var(--motion-control-duration) ease-out,transform var(--motion-press-duration) ease-out}
@media (hover:hover){.arrival-card:hover{background:var(--card-hover)}}
.arrival-card:active{transform:scale(var(--motion-press-scale))}
/* The destination wraps to two lines and keeps at least 7em; when the time no longer fits beside
   that, the time and chevron wrap below it, at the trailing edge. */
.arrival-top{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-10)}
.arrival-icon-slot{width:auto;min-width:40px;display:grid;place-items:center;flex:none}
.arrival-destination{flex:1 1 0;min-width:min(7em,100%);font-size:var(--fs-body);white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.arrival-destination small{display:block;font-size:var(--fs-cap);letter-spacing:var(--ls-cap);color:var(--muted);margin-top:var(--space-2)}
.source-glyph{position:relative;display:inline-block;width:.95em;height:.95em;flex:none;box-sizing:border-box;color:currentColor;fill:currentColor}
.source-glyph.scheduled{color:var(--muted)}
.source-glyph.fault{border:1.5px solid currentColor;border-radius:50%}
.source-glyph.fault:before{content:"!";position:absolute;inset:-1px;display:grid;place-items:center;font-size:.72em;font-weight:800;line-height:1}
.arrival-time{text-align:right;flex:none;margin-left:auto;font-variant-numeric:tabular-nums}
.arrival-time b{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-4);font-size:var(--fs-body);font-weight:500}
.arrival-time b .source-glyph{color:var(--muted)}
.arrival-time b .source-glyph.fault{color:var(--warn)}
.arrival-time small{display:block;font-size:var(--fs-cap);letter-spacing:var(--ls-cap);color:var(--muted);margin-top:var(--space-2)}
.arrival-time.due b{color:var(--good);font-weight:700}
.arrival-time.delayed b{color:var(--warn);font-weight:700}
.arrival-chevron{width:12px;height:12px;color:var(--muted);flex:none;transition:transform var(--motion-control-duration) ease}
.arrival-card.expanded .arrival-chevron{transform:rotate(180deg)}
.vehicle{font-size:var(--fs-cap);letter-spacing:var(--ls-cap);color:var(--muted);padding-left:50px;margin-top:var(--space-2)}

/* Leaflet sizes its overlay SVG (route polylines) to the whole map pane. The reset's
   :where(img,svg,video){max-width:100%} capped it at the container width and collapsed the
   polylines in the web app, so lift the cap inside a Leaflet map. */
.leaflet-container svg{max-width:none}
.map-marker{position:absolute;left:0;top:0;width:var(--m);height:var(--m);transform:translate(-50%,-50%);border:2px solid var(--always-white);box-shadow:none;cursor:pointer;display:grid;place-items:center;padding:0;overflow:visible;transition:transform var(--motion-control-duration) ease-out,box-shadow var(--motion-control-duration) ease-out,opacity var(--motion-press-duration) ease-out}
.map-marker:before{content:"";position:absolute;inset:calc((var(--size-minimum-tap-target) - var(--m)) / -2)}
.map-marker svg.glyph{width:55%;height:55%}
.map-marker.bus{--m:var(--size-map-bus-marker);width:var(--m);height:var(--m);border-radius:25%;background:var(--accent);color:var(--accent-ink)}
/* station marker: the station icon at (marker − 4) inside a 2pt white keyline, same form for 1–6 lines */
.map-marker.station{width:auto;border-radius:calc(var(--m) / 2);background:var(--card-2)}
.map-marker.station .station-icon{--size:calc(var(--m) - 4px)}

/* station icon: neutral capsule, leading glyph cell, one rounded bar per line; every length derives from --size */
.station-icon{--size:24px;display:inline-flex;align-items:center;flex:none;height:var(--size);padding-right:max(4px,calc(var(--size)*.22));border-radius:calc(var(--size)/2);background:var(--card-2);color:var(--ink)}
.station-icon .st-glyph{display:grid;place-items:center;flex:none;width:var(--size);height:var(--size)}
.station-icon .st-glyph svg{width:75%;height:75%}
.station-icon .st-bars{display:flex;align-items:center;gap:1.5px;margin-left:calc(var(--size)*-.08)}
.station-icon .st-bars i{display:block;flex:none;width:calc(var(--size)*.225);height:calc(var(--size)*.6);border-radius:calc(var(--size)*.09);background:var(--route);box-shadow:inset 0 0 0 1px var(--route-keyline,transparent)}
/* Show line letters: each bar is followed by its line code in Ink on the neutral capsule, 40% of the
   capsule height (never under --size-line-letter-minimum; transit.js drops the letters first) */
.station-icon.letters .st-bars{gap:calc(var(--size)*.16)}
.station-icon .st-line{display:inline-flex;align-items:center;gap:calc(var(--size)*.07)}
.station-icon .st-line b{font-size:max(var(--size-line-letter-minimum),calc(var(--size)*.4));font-weight:var(--weight-heavy);line-height:1;letter-spacing:.02em;color:var(--ink)}
.map-marker.selected{transform:translate(-50%,-50%) scale(1.12);box-shadow:var(--selection-ring);z-index:5}
/* station tick (below zoom 14): a white pill drawn across exactly the lanes that stop there */
.map-tick{position:absolute;left:0;top:0;padding:0;border-radius:var(--radius-pill);background:var(--always-white);border:2px solid var(--always-black);transform-origin:center;cursor:pointer;box-sizing:content-box}
.map-tick:before{content:"";position:absolute;inset:calc(var(--space-8) * -1)}
.map-tick.selected{box-shadow:var(--selection-ring)}
/* Markers dim while pressed (the tap highlight is off; see base/global.css). */
.map-marker:active,.map-tick:active,.map-station-dot:active,.veh:active{opacity:var(--motion-press-dim)}
/* the tuner's zoomed-out solid station dot; the 44px pseudo-element keeps it tappable */
.map-station-dot{position:absolute;left:0;top:0;width:var(--dot);height:var(--dot);margin:calc(var(--dot) / -2) 0 0 calc(var(--dot) / -2);padding:0;border-radius:50%;background:var(--always-white);border:var(--dot-border) solid var(--always-black);cursor:pointer}
.map-station-dot:before{content:"";position:absolute;left:50%;top:50%;width:var(--size-minimum-tap-target);height:var(--size-minimum-tap-target);transform:translate(-50%,-50%)}
.map-station-dot.selected{box-shadow:var(--selection-ring)}
/* vehicles (design system → Map → Vehicle marker, A3): an SVG body + detached chevron, upright glyph.
   Selected scales the body and chevron about the body center; no shadow or glow. Glyph size and
   color come from the generated block (tokens/vehicle.json) through --v-glyph and --v-glyph-color. */
/* <vehicle-style> generated by `go generate ./...` from tokens/vehicle.json; edit it, not this block. */
.veh{--veh:25px;--v-glyph:.6;--v-glyph-color:var(--paper)}
.veh.bus{--v-glyph-color:var(--accent-ink)}
.veh .v-hair{fill:none;stroke:var(--v-hair,transparent);stroke-width:1px}
@media (prefers-contrast:more){.veh .v-hair{stroke:var(--ink)}}
/* </vehicle-style> */
.veh{position:absolute;left:0;top:0;width:0;height:0;cursor:pointer}
.veh>*{position:absolute;left:0;top:0}
.veh:before{content:"";position:absolute;left:calc(var(--size-minimum-tap-target) / -2);top:calc(var(--size-minimum-tap-target) / -2);width:var(--size-minimum-tap-target);height:var(--size-minimum-tap-target)}
.v-svg{transform:translate(-50%,-50%);overflow:visible;transition:transform var(--motion-control-duration) ease}
.veh.selected .v-svg{transform:translate(-50%,-50%) scale(var(--size-map-vehicle-selected-scale))}
.v-glyph{width:calc(var(--veh)*var(--v-glyph));height:calc(var(--veh)*var(--v-glyph));margin:calc(var(--veh)*var(--v-glyph)/-2) 0 0 calc(var(--veh)*var(--v-glyph)/-2);color:var(--v-glyph-color);display:grid;place-items:center;pointer-events:none;transition:transform var(--motion-control-duration) ease}
.veh.selected .v-glyph{transform:scale(var(--size-map-vehicle-selected-scale))}
.v-glyph svg{width:100%;height:100%}
@media (prefers-reduced-motion:reduce){.v-svg,.v-glyph{transition:none}}
.veh>.v-count{left:calc(var(--veh)*.56);top:calc(var(--veh)*-1.04);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--ink);color:var(--paper);font-size:10.5px;font-weight:var(--weight-heavy);display:grid;place-items:center;box-sizing:border-box}
