:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #123047;
  background: #d9e9ef;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
#app { min-height: 100dvh; display: grid; grid-template-columns: minmax(300px, 390px) 1fr; }
.panel { z-index: 2; padding: 32px 28px; background: #fffdf8; box-shadow: 5px 0 24px #19374b25; overflow: auto; }
.eyebrow { margin: 0 0 4px; color: #007c91; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; line-height: 1; color: #0b3b5c; }
.intro { margin: 12px 0 26px; color: #526876; line-height: 1.45; }
.route-form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: #315064; font-size: .86rem; font-weight: 700; }
select, input, button { min-height: 44px; border-radius: 9px; font: inherit; }
select, input { width: 100%; border: 1px solid #b5c8d0; padding: 0 12px; color: #183d52; background: #fff; }
button { border: 0; padding: 0 16px; color: #fff; background: #007c91; font-weight: 800; cursor: pointer; }
button:hover { background: #006476; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #f0b44d; outline-offset: 2px; }
.message { min-height: 2.8em; margin: 20px 0 12px; color: #526876; line-height: 1.4; }
.message.error { color: #ad3128; }
.matches { display: grid; gap: 8px; margin-bottom: 14px; }
.match { display: flex; justify-content: space-between; gap: 10px; padding: 10px; text-align: left; color: #18475e; background: #e5f3f5; }
.route-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.route-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 12px; border: 1px solid #d5e0e3; border-radius: 9px; background: #fff; }
.route-name { display: block; font-weight: 800; }
.route-description { display: block; margin-top: 2px; color: #5e717d; font-size: .78rem; }
.remove { min-height: 32px; padding: 0 9px; color: #7b3933; background: transparent; border: 1px solid #d6a59e; font-size: .8rem; }
.refresh-note { margin: 20px 0 0; color: #71818a; font-size: .78rem; line-height: 1.4; }
.map-shell { position: relative; min-height: 55dvh; }
#map { position: absolute; inset: 0; background: #d9e9ef; }
.map-status { position: absolute; z-index: 500; right: 18px; bottom: 18px; max-width: min(300px, calc(100% - 36px)); padding: 10px 12px; border-radius: 8px; color: #183d52; background: #fffdf8eB; box-shadow: 0 2px 12px #183d5230; font-size: .82rem; }
.bus-marker { height: 34px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 17px; background: #007c91; color: #fff; box-shadow: 0 2px 8px #002b3c70; }
.bus-marker span { padding: 0 4px; font-size: .78rem; font-weight: 850; line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.bus-marker.stale { background: #85939a; opacity: .72; }
.popup-route { margin: 0 0 5px; font-weight: 800; }
.popup-details { margin: 3px 0; color: #4b6674; font-size: .82rem; }
.leaflet-tooltip.bus-tooltip { padding: 7px 9px; border: 0; border-radius: 7px; color: #fff; background: #123f54; box-shadow: 0 2px 9px #001b2d55; font-size: .78rem; }
.leaflet-tooltip-top.bus-tooltip::before { border-top-color: #123f54; }

@media (max-width: 720px) {
  #app { display: flex; flex-direction: column; }
  .panel { padding: 20px; box-shadow: none; }
  h1 { font-size: 1.8rem; }
  .intro { margin-bottom: 18px; }
  .route-form { grid-template-columns: 1fr 1fr; align-items: end; }
  .route-form button { grid-column: 1 / -1; }
  .map-shell { flex: 1; min-height: 56dvh; }
}
