/* Shared semantic tokens and card slots, adapted from shadcn/ui. */
@font-face {
  font-family: Geist;
  src: url("/assets/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --background: #f8f9fa;
  --foreground: #171b20;
  --card: #fff;
  --card-foreground: #171b20;
  --primary: #182021;
  --primary-foreground: #fff;
  --muted: #f1f3f4;
  --muted-foreground: #56616c;
  --border: #dce1e4;
  --input: #cbd2d5;
  --ring: #277968;
  --radius: .8rem;
  --shadow: 0 1px 2px rgb(19 32 39 / 5%);
  --ink: var(--foreground);
  --dim: var(--muted-foreground);
  --paper: var(--background);
  --line: var(--border);
  --pale: var(--muted);
  --gutter: clamp(1rem, 4.6vw, 3.5rem);
  background: var(--background);
  color: var(--foreground);
  font: 400 100%/1.5 Geist, Inter, system-ui, sans-serif;
}
* { box-sizing: border-box }
body { margin: 0; border: 0; min-height: 100vh; background: var(--background); color: var(--foreground) }
p, h1, h2, h3 { margin: 0 }
a { color: inherit; text-underline-offset: .19em }
a:hover { text-decoration-color: var(--ring) }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px }
[hidden] { display: none !important }
.ui-icon { flex: none; width: 1.1rem; height: 1.1rem; vertical-align: middle }
.skip-link { position: absolute; top: .4rem; left: .4rem; z-index: 10; transform: translateY(-150%); padding: .5rem .9rem; border-radius: .4rem; background: white }
.skip-link:focus { transform: none }
.site-bar { background: var(--card); border-bottom: 1px solid var(--border) }
.site-bar-inner, main#content { width: min(100%, 76rem); max-width: none; margin: 0 auto; padding-inline: var(--gutter) }
.site-bar-inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem }
.site-brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1rem; font-weight: 660; letter-spacing: -.045em; text-decoration: none; white-space: nowrap }
.site-brand > span { display: grid; place-items: center; height: 1.9rem; width: 1.9rem; border-radius: .52rem; color: #c7f2da; background: #183531 }
.site-brand .ui-icon { width: 1.28rem; height: 1.28rem }
.site-nav { display: flex; align-items: center; gap: .25rem; padding: 0; border: 0 }
.site-nav a { display: inline-flex; min-height: 2.5rem; align-items: center; border-radius: .45rem; padding: .35rem .82rem; font: 520 .875rem/1 Geist,system-ui,sans-serif; color: var(--muted-foreground); text-decoration: none }
.site-nav a:is(:hover,[aria-current],.section-active) { color: var(--foreground); background: var(--muted) }
main#content { padding-top: 0; padding-bottom: 3rem }
.page-heading { margin: 0; padding: clamp(1.75rem,4vw,3.25rem) 0 clamp(1.35rem,3vw,2rem); border: 0 }
.page-heading .location, .card-place { display: flex; align-items: center; gap: .4rem; color: var(--muted-foreground); font-size: .78rem; line-height: 1.45; font-weight: 550 }
.location .ui-icon { height: .95rem; width: .95rem; color: #47665d }
.page-heading h1 { font: 640 clamp(2.05rem,4.6vw,3.7rem)/1.06 Geist,system-ui,sans-serif; letter-spacing: -.06em; margin: .45rem 0 .6rem; color: var(--foreground); text-wrap: balance }
.page-heading .intro { max-width: 72ch; color: var(--muted-foreground); font-size: clamp(.97rem,1.4vw,1.08rem); line-height: 1.5 }
.home-page .page-heading h1 { font-size: clamp(2.65rem,5vw,4rem) }
.home-page .intro { max-width: 64ch }
h2.section-title, .network-section h2, #reliability h2, .data-footer h2, .rank-page footer h2 {
  font: 620 clamp(1.1rem,2vw,1.4rem)/1.25 Geist,system-ui,sans-serif;
  letter-spacing: -.038em;
}
.section-title { display: flex; gap: .58rem; align-items: center; margin: 0 0 .9rem }
.section-title .ui-icon { color: #52665f; width: 1.18rem; height: 1.18rem }
.home-page main > section + section { margin-top: 2.15rem }
[data-slot=card] { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow) }
.featured-map { display: grid; grid-template-columns: .95fr 1.12fr; overflow: hidden; color: #f7fbf9; background: #172e2b; border-color: #223936 }
.feature-copy { padding: clamp(1.4rem,3.4vw,2.65rem); align-self: center }
.feature-copy .card-place { color: #b6cec2; font-size: .8rem }
.feature-copy h3 { margin: .45rem 0 .52rem; font-size: clamp(1.9rem,3.3vw,2.75rem); font-weight: 590; letter-spacing: -.055em; line-height: 1.08 }
.feature-copy > p:not(.card-place) { max-width: 43ch; color: #d8e4df; font-size: .96rem }
.feature-art { display: block; width: 100%; height: 100%; min-height: 13rem; object-fit: cover; object-position: center; border-left: 1px solid #3c514a }
.line-links { display: flex; flex-wrap: wrap; gap: .42rem; margin: .85rem 0 1.2rem }
.line-links a { display: inline-flex; align-items: center; gap: .4rem; min-height: 1.72rem; padding: .18rem .53rem; border: 1px solid #52665e; border-radius: 2rem; font-size: .73rem; font-weight: 520; color: #fff; text-decoration: none }
.line-links a::before { content: ""; display:block; width:.47rem; height:.47rem; border-radius:50%; background:#82dda3 }
.line-links a:nth-child(2)::before { background: #7ac8ff }
.line-links a:nth-child(3)::before { background: #ffb765 }
.line-links a:hover { background: #304840 }
.feature-open { display: inline-flex; align-items: center; justify-content: center; gap: .7rem; padding: .55rem .9rem; min-height: 2.6rem; border-radius: .48rem; font-size: .86rem; font-weight: 610; color: #142e28; background: #f0f8f2; text-decoration: none }
.feature-open:hover { background: #d8ecdc }
.feature-open .ui-icon { width: 1rem; height: 1rem }
.featured-map :focus-visible { outline-color: #bde9ce }
.project-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem }
.featured-map + .project-grid { margin-top: .75rem }
.project-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .85rem; align-items: start; padding: 1.15rem 1.25rem; text-decoration: none }
.project-card:hover { border-color: #a4b7b0; background: #fcfdfc }
.card-symbol { display: grid; place-items: center; width: 2.45rem; height: 2.45rem; border: 1px solid #e0e6e3; color: #345a4c; border-radius: .55rem; background: #f2f6f3 }
.card-symbol .ui-icon { width: 1.2rem; height: 1.2rem }
.project-card > .ui-icon { width: .98rem; height: .98rem; margin: .32rem 0 0; color: #68777a }
.project-card h3 { font-size: 1.08rem; font-weight: 620; letter-spacing: -.03em; margin: .12rem 0 .32rem }
.project-card [data-slot=card-description] { color: var(--muted-foreground); font-size: .88rem }
.home-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 2.4rem; font-size: .86rem; color: var(--muted-foreground) }
.map-card, .river-card, #reliability, .rank-page .filters, .notice-card { padding: clamp(.85rem,2vw,1.45rem) }
.viewbar { margin: 0 0 .85rem; gap: .8rem }
.switch { padding: .21rem; gap: .12rem; border-radius: .55rem; background: var(--muted) }
.switch button, .switch button:hover:enabled { color: var(--muted-foreground); background: transparent; box-shadow: none; border: 0; min-height: 2.15rem; padding: .38rem .92rem; font: 560 .88rem/1.2 Geist,system-ui,sans-serif }
.switch button[aria-pressed=true] { color: var(--foreground); background: #fff; box-shadow: 0 1px 4px #13202725 }
label, .filters label { color: var(--foreground); font-size: .82rem; font-weight: 550 }
.route-filter { margin-right: auto }
#fleet { font-size: .86rem; font-weight: 580; font-variant-numeric: tabular-nums; color: #34433f }
button, #picker input, #picker select, .bus-row select, #speed, .filters select, #reliability-period, .route-filter select, .river-page :is(input,select) {
  min-height: 2.5rem; padding: .39rem .67rem; border: 1px solid var(--input); border-radius: .47rem;
  color: var(--foreground); background-color: white; font: 460 .92rem/1.35 Geist,system-ui,sans-serif; box-shadow: var(--shadow)
}
.bus-row select, #speed, #picker select, .river-page select { padding-right: 1.85rem }
button:enabled:hover { background-color: var(--muted) }
#go, .strip #play, .caption #play { color: var(--primary-foreground); background: var(--primary); border-color: var(--primary); font-weight: 550 }
#go:hover, .strip #play:hover, .caption #play:hover { background: #35403f }
.ct-map { border-color: var(--border); border-radius: .56rem }
.ct-map .map-buttons { border-color: var(--input); border-radius: .48rem; box-shadow: 0 2px 8px #172a2520 }
.ct-map .map-buttons button { background: white; color: var(--foreground) }
.ct-map .map-popup { border-color: var(--input); border-radius: .68rem; color: var(--foreground); background: var(--card); box-shadow: 0 5px 20px #172a2526 }
.strip { padding: .88rem 0 }
#moment { font-size: .95rem }
#status, #detail { color: var(--muted-foreground); font-size: .86rem }
.bus-row { padding: .82rem 0 0 }
#reliability { margin: 1rem 0; border: 1px solid var(--border) }
.otp-heading { align-items: center }
.otp-rank-link { margin: .4rem 0 0; font-size: .87rem }
.otp-rank-link a, .data-footer a, .rank-page footer a, .home-footer a, .notice-card a { color: #27594c }
#reliability-scope { color: var(--muted-foreground); font-size: .88rem; margin-top: 1.15rem }
#reliability-rate { font-size: clamp(1.85rem,4vw,2.45rem); letter-spacing: -.05em; line-height: 1.2; margin: .18rem 0 .28rem }
#reliability-sample, .otp-counts { font-size: .9rem }
#reliability details, #missing { max-width: none; padding-top: .78rem; margin-top: .85rem; border-top: 1px solid var(--border) }
details summary { color: var(--foreground); cursor: pointer; font-weight: 540 }
#reliability details p, .data-footer p, .rank-page footer p { max-width: 90ch }
.data-footer, .rank-page footer { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--border); line-height: 1.55; font-size: .86rem; color: var(--muted-foreground) }
.data-footer h2, .rank-page footer h2 { margin-bottom: .55rem; color: var(--foreground); font-size: 1.08rem }
.filters { column-gap: 1.2rem; align-items: end }
.filters select { min-width: 8rem }
.network-section { padding: 0; margin: 1.7rem 0; border: 0 }
#network-totals { grid-template-columns: repeat(auto-fit,minmax(min(100%,10rem),1fr)); gap: .55rem }
#network-totals > div { padding: .85rem; border: 1px solid var(--border); border-radius: .67rem; background: var(--card); box-shadow: var(--shadow) }
#network-totals a { font-size: .85rem; font-weight: 550; text-decoration-color: #a4b3ac }
#network-totals strong { margin: .38rem 0 .16rem; letter-spacing: -.05em; font-size: 1.8rem }
#coverage-note { font-size: .88rem }
.rank-table { border-radius: .64rem; overflow-x: auto; background: var(--card); box-shadow:var(--shadow) }
#rankings { border: 1px solid var(--border) }
#rankings th, #rankings td { padding: .68rem .86rem }
#rankings thead th { background: #eff2f2; color: #46505a; font-weight: 550 }
#rankings tbody tr:hover { background: #f5f8f6 }
.river-card .observation { margin: 0 0 .8rem }
.river-card h2 { font: 600 clamp(1.12rem,2.4vw,1.5rem)/1.3 Geist,system-ui,sans-serif; letter-spacing: -.03em }
#mode { font-size: .82rem }
.river-page .tank { border-radius: .56rem }
.river-page .controls { margin-bottom: 0 }
.river-page .text-button { margin-top: .85rem; padding-inline: .7rem; color: #27594c; text-decoration: none }
.notice-card { max-width: 76ch; line-height: 1.65; font-size: 1rem }
.notice-card p + p { margin-top: 1rem }
@media(max-width:45rem) {
  .featured-map { grid-template-columns: 1fr 1fr }
  .feature-copy { padding: 1.25rem }
  #network-totals { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .project-card { padding: .85rem; gap: .65rem }
}
@media(max-width:38rem) {
  .site-bar-inner { min-height: 3.6rem; gap: .45rem }
  .site-brand { font-size: .92rem; gap: .45rem }
  .site-brand > span { width: 1.65rem; height: 1.65rem }
  .site-nav { gap: 0 }
  .site-nav a { padding: .35rem .48rem; font-size: .79rem }
  .featured-map { grid-template-columns: 1fr }
  .feature-art { width: 100%; height: auto; min-height: 0; border-left: 0; border-top: 1px solid #3c514a }
  .project-grid { grid-template-columns: 1fr }
  .viewbar { justify-content: space-between; gap: .55rem }
  .route-filter { order: 1; flex: 1 1 100%; margin: 0; display:grid; grid-template-columns: auto minmax(0,1fr) }
  .route-filter select { width: 100% }
  .map-card .bus-row label { min-width: 0 }
  .map-card .bus-row { grid-template-columns: minmax(0,1fr) }
  #fleet { font-size: .79rem }
  #network-totals strong { font-size: 1.5rem }
  #rankings th, #rankings td { padding: .52rem .28rem; font-size: .78rem }
  #rankings thead th { font-size: .73rem }
  .rank-page .filters { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem }
  .rank-page .filters select { width: 100%; min-width: 0 }
  .filters .minimum { align-self: end; line-height: 1.3 }
  .minimum input { flex: none }
  .otp-heading label { font-size: .78rem }
  .river-page select, .river-page input, #picker input { font-size: 1rem }
}
@media(max-width:22rem) {
  .site-brand > span { display: none }
  .site-nav a { padding-inline: .4rem }
  .site-bar-inner, main#content { padding-inline: .7rem }
}
