:root {
  color-scheme: light;
  --paper: #f9f7f0;
  --paper-raised: #fffdf7;
  --ink: #143220;
  --soft: #516052;
  --rule: #c2c7b8;
  --green: #234c34;
  --pale: #deead8;
  --mint: #76dda1;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid #15836d; outline-offset: 3px; }
h1, h2, h3, p, dl { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg { width: 19px; height: 19px; display: block; flex-shrink: 0; }
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 64px; padding: 8px 23px; gap: 14px; border-bottom: 1px solid var(--rule); }
.brand, .date, .controls { display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 38px; border-radius: 7px; background: var(--mint); }
.brand-icon svg { width: 24px; height: 24px; }
h1 { font-size: clamp(23px, 2.4vw, 36px); line-height: 1; letter-spacing: -.04em; }
.edition { border-left: 1px solid var(--rule); padding-left: 14px; font-style: italic; color: var(--soft); }
#day { font: 650 12px var(--sans); letter-spacing: .09em; text-transform: uppercase; }
#time { border-left: 1px solid var(--rule); padding-left: 15px; font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 85px; }
.controls { justify-self: end; gap: 11px; }
.segments { display: flex; border: 1px solid #80917e; border-radius: 6px; overflow: hidden; }
.segments button { border: 0; background: transparent; padding: 7px 14px; min-width: 46px; }
.segments button + button { border-left: 1px solid #a7b19f; }
.segments button:hover, .icon-button:hover { background: #e9eee1; }
.segments button[aria-pressed="true"] { background: var(--green); color: white; }
.segments button:focus-visible { outline-offset: -3px; }
.icon-button,.play { height: 34px; min-width: 36px; display: grid; place-items: center; border: 1px solid #84917f; border-radius: 6px; background: transparent; }
.play { min-width: 40px; background: var(--green); color: white; border-color: var(--green); }
.play:hover, .primary:hover { background: #356744; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); min-height: 65px; align-items: center; border-bottom: 1px solid #a9b3a3; box-shadow: inset 0 -3px 0 #f1eee2; }
.metric { display: flex; justify-content: center; align-items: center; gap: 11px; padding: 5px 8px; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--rule); }
.metric span { font-size: clamp(13px, 1.45vw, 22px); white-space: nowrap; }
.metric strong { font-size: clamp(21px, 2.05vw, 32px); font-variant-numeric: tabular-nums; }
.metric svg { width: 25px; height: 25px; }
main { display: grid; grid-template-columns: minmax(0, 1fr) clamp(296px, 25vw, 390px); min-height: 520px; height: calc(100dvh - 129px); }
.map { min-width: 0; min-height: 0; position: relative; isolation: isolate; background: #164e58; overflow: hidden; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
canvas.dragging { cursor: grabbing; }
.map-head { display: flex; gap: 7px; position: absolute; top: 16px; left: 16px; }
.live, .route-toggle, .map-key, .zoom, .map-note { border: 1px solid #f9f7f0; box-shadow: 0 2px 7px #062a2b45; border-radius: 6px; }
.live { display: flex; align-items: center; gap: 7px; padding: 6px 10px; background: #234936; color: #fffdf3; font-weight: 700; }
.live span { border-radius: 50%; width: 8px; height: 8px; background: #83e4a6; }
.live.paused span { background: #e9b978; }
.route-toggle { padding: 5px 10px; background: var(--paper); font-size: 14px; }
.route-toggle[aria-pressed="true"] { background: var(--pale); border-color: #85b691; }
.map-key { position: absolute; bottom: 18px; left: 16px; background: var(--paper); padding: 9px 12px 10px; font-size: 12px; line-height: 1.6; pointer-events: none; color: #202c21; }
.map-key h2 { padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid #b6bcab; text-transform: uppercase; font: 700 10px var(--sans); letter-spacing: .12em; }
.map-key div { display: flex; align-items: center; gap: 7px; }
.map-key i { display: inline-block; width: 12px; height: 9px; border-radius: 2px; border: 1px solid #263e2c55; }
.map-key .housing { background: #97b9bd; } .map-key .commerce { background: #cd8267; }
.map-key .employer { background: #d8bb84; } .map-key .park { background: #8eae64; }
.map-key .resident-dot { background: #ee6150; width: 8px; height: 8px; margin: 0 2px; border-radius: 50%; }
.map-key .bus-dot { background: #69d49c; } .map-key .vacant { background: #a3a091; }
.map-note { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #f2f6e9; background: #193e40e8; border-color: #f9f7f062; font: 11px var(--sans); padding: 5px 9px; white-space: nowrap; pointer-events: none; }
.zoom { position: absolute; display: grid; right: 16px; bottom: 18px; background: var(--paper); overflow: hidden; }
.zoom button { display: grid; place-items: center; border: 0; background: none; width: 33px; height: 33px; font: 21px var(--sans); }
.zoom button + button { border-top: 1px solid var(--rule); }
.zoom button:hover { background: var(--pale); }
.zoom svg { width: 16px; height: 16px; }
.side { border-left: 4px double #b1b9a5; padding: 13px 13px 22px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tabs { flex-shrink: 0; }
.tabs button { flex: 1; padding: 8px 7px; font-size: clamp(13px, 1.15vw, 17px); }
#panel { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 3px 5px; margin-right: -3px; }
#panel h2 { font-size: 29px; line-height: 1.12; letter-spacing: -.025em; }
.panel-head { margin: 16px 0 8px; }
.panel-head p { margin-top: 5px; font-size: 14px; color: var(--soft); line-height: 1.35; }
.section-label { font: 650 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--soft); margin: 17px 0 8px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 4px; border-block: 1px solid var(--rule); padding: 9px 0; }
.quick div { text-align: center; }
.quick div + div { border-left: 1px solid var(--rule); }
.quick strong { display: block; font-size: 21px; }
.quick span { font-size: 11px; color: var(--soft); font-family: var(--sans); }
.trip-list { display: grid; gap: 5px; padding: 5px 0 13px; border-bottom: 1px solid var(--rule); }
.trip-row { display: grid; grid-template-columns: 39px minmax(0, 1fr) 33px; gap: 8px; align-items: center; font: 11px var(--sans); }
.trip-row b { text-align: right; }
.bar { height: 5px; background: #ebece2; border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: #4c805b; }
.timeline { margin: 7px 0 14px 5px; border-left: 1px solid #b3c2ae; list-style: none; padding: 0; }
.timeline li { position: relative; margin: 0; }
.timeline li::before { content: ''; z-index: 1; position: absolute; width: 7px; height: 7px; background: var(--paper); border: 1.5px solid #49835b; border-radius: 50%; top: 14px; left: -5px; pointer-events: none; }
.event { border: 0; background: none; text-align: left; display: flex; gap: 9px; padding: 8px 5px 9px 12px; width: 100%; }
button.event:hover { background: #eaf0e4; }
.event-icon, .list-mark { display: grid; flex: 0 0 auto; place-items: center; background: var(--pale); color: #27543a; border-radius: 7px; width: 30px; height: 29px; }
.event-icon svg { width: 16px; height: 16px; }
.event-icon.closure { background: #f3e2d6; color: #924932; }
.event time { display: block; color: var(--soft); font: 10px var(--sans); margin-bottom: 2px; }
.event strong { display: block; font-size: 16px; line-height: 1.15; }
.event small { display: block; font-size: 13px; margin-top: 3px; line-height: 1.32; color: #3b473d; }
#search-box { margin-top: 12px; }
input { width: 100%; border: 1px solid #a7b39f; border-radius: 5px; background: var(--paper-raised); color: var(--ink); padding: 7px 9px; font-family: var(--sans); font-size: 13px; }
.directory { display: grid; }
.row { border: 0; border-top: 1px solid #dedfd3; background: none; text-align: left; padding: 8px 2px; display: flex; align-items: center; gap: 9px; min-width: 0; width: 100%; }
.row:hover { background: #e9eee1; }
.row .label { flex: 1; min-width: 0; }
.row strong, .row small { display: block; }
.row small { color: var(--soft); margin-top: 3px; font: 11px var(--sans); }
.row > svg { color: var(--soft); width: 14px; height: 14px; }
.row.opening { min-height: 38px; }
.back { background: none; border: 0; padding: 5px 0; font: 12px var(--sans); display: flex; align-items: center; gap: 5px; margin-top: 10px; color: #31533a; }
.back svg { width: 14px; height: 14px; }
.entity-head { margin: 6px 0 11px; }
.entity-head p { margin-top: 5px; font-size: 14px; color: var(--soft); }
.action-row { display: flex; gap: 6px; margin: 10px 0; }
.action-row button, .cash-form button, dialog button { display: flex; gap: 6px; align-items: center; justify-content: center; border: 1px solid #9bad95; border-radius: 5px; padding: 6px 9px; background: var(--paper-raised); font: 12px var(--sans); }
.action-row button:hover, dialog button:hover { background: var(--pale); }
.action-row button[aria-pressed="true"], .cash-form button, dialog .primary { background: var(--green); color: white; }
.action-row svg { width: 14px; height: 14px; }
.facts { padding: 4px 0; border-block: 1px solid var(--rule); }
.facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; }
.facts div + div { border-top: 1px solid #e1e2d7; }
.facts dt { flex-shrink: 0; font: 12px var(--sans); color: var(--soft); }
.facts dd { margin: 0; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
.facts dd button { text-align: right; border: 0; border-bottom: 1px dotted #728d72; background: none; padding: 0; }
.cash-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.cash-form p { grid-column: 1 / -1; line-height: 1.45; font: 11px var(--sans); color: var(--soft); }
.cash-form .feedback { color: #155638; font-weight: 600; }
.cash-form .feedback.error { color: #8e3425; }
.empty { font-style: italic; color: var(--soft); padding: 7px 0; font-size: 14px; }
.closed { color: #8e3425; }
dialog { width: min(400px, calc(100% - 28px)); padding: 22px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 9px; box-shadow: 0 12px 50px #13332155; }
dialog::backdrop { background: #152c23aa; }
dialog p { margin: 8px 0 16px; }
dialog form { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 970px) {
  .edition { display: none; }
  .metric { gap: 6px; }
  .metric svg { display: none; }
  .top { padding-inline: 12px; }
}
@media (max-width: 860px) {
  .top { grid-template-columns: 1fr auto; gap: 7px; padding: 9px 10px; }
  .brand { gap: 7px; }
  .brand-icon { width: 26px; height: 28px; }
  .brand-icon svg { width: 18px; height: 18px; }
  h1 { font-size: 26px; }
  .date { grid-column: 1 / 2; grid-row: 2; gap: 8px; }
  #day { font-size: 9px; }
  #time { padding-left: 8px; min-width: 0; font-size: 18px; }
  .controls { grid-column: 2; grid-row: 1 / span 2; gap: 5px; }
  #speeds button { min-width: 30px; padding: 6px; font-size: 13px; }
  .icon-button, .play { min-width: 27px; height: 29px; }
  .icon-button svg, .play svg { width: 15px; height: 15px; }
  .metrics { grid-template-columns: repeat(4,minmax(0,1fr)); min-height: 60px; padding: 4px 0; }
  .metric { gap: 2px; padding: 2px 1px; display: flex; flex-direction: column; }
  .metric span { font-size: clamp(9px, 2.6vw, 15px); }
  .metric strong { font-size: clamp(16px, 4.6vw, 25px); }
  .metric svg { display: none; }
  main { grid-template-columns: minmax(0,1fr); height: auto; min-height: 0; }
  .map { height: clamp(265px, 70vw, 545px); }
  .side { border-left: 0; border-top: 4px double #b1b9a5; padding-inline: 12px; }
  #panel { overflow: visible; }
  .map-key { font-size: 9px; padding: 5px 7px; bottom: 8px; left: 8px; }
  .map-key h2 { font-size: 8px; }
  .map-note { display: none; }
  .map-head { top: 9px; left: 8px; }
  .zoom { right: 8px; bottom: 8px; }
}
.pagination { justify-content: space-between; align-items: center; }
.pagination small { font: 11px var(--sans); color: var(--soft); }
