:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1f2630;
  --line: #2d3540;
  --text: #f0f3f6;
  --muted: #9aa5b1;
  --accent: #1f6feb;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --route: #1f6feb;
  --route-text: #ffffff;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body.scroll { overflow: auto; }
button, input, select { font: inherit; color: inherit; }

.route-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.6em; padding: .1em .55em; border-radius: .35em;
  background: var(--route); color: var(--route-text); font-weight: 700; white-space: nowrap;
}
.muted { color: var(--muted); }
.live-dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--good); margin-right: .35em; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* Captions for every spoken announcement */
.caption {
  position: fixed; left: 50%; bottom: 3vh; transform: translateX(-50%) translateY(150%);
  max-width: 92vw; padding: 1.4vh 3vw; border-radius: 1.2vh;
  background: rgba(13, 17, 23, .94); border: .35vh solid var(--route);
  font-size: clamp(20px, 4.4vh, 64px); font-weight: 700; text-align: center;
  transition: transform .45s ease; z-index: 1000; pointer-events: none;
}
.caption.show { transform: translateX(-50%) translateY(0); }

.overlay {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(13, 17, 23, .88); z-index: 900; text-align: center; gap: 2vh; padding: 4vw;
}
.overlay.show { display: flex; }
.overlay h1 { font-size: clamp(28px, 7vh, 96px); margin: 0; }
.overlay p { font-size: clamp(16px, 3vh, 40px); margin: 0; color: var(--muted); }

.banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 950; display: none;
  background: var(--warn); color: #000; text-align: center; font-weight: 700; padding: .6vh; font-size: clamp(14px, 2.2vh, 30px);
}
.banner.show { display: block; }

.sound-unlock {
  position: fixed; right: 2vw; bottom: 2vh; z-index: 1100; display: none;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 1.2vh 2.4vw; font-size: clamp(14px, 2.4vh, 28px); cursor: pointer;
}
.sound-unlock.show { display: block; }

.bus-marker { transition: transform .9s linear; }
.leaflet-container { background: #1b2027; font: inherit; }
.leaflet-control-attribution { font-size: 10px; }

/* Service alerts (GTFS-Realtime Alerts) */
.alerts {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 940; display: none;
  background: #5a3a00; color: #fff; border-top: .4vh solid var(--warn);
  font-size: clamp(14px, 2.6vh, 36px); padding: 1vh 2vw; max-height: 22vh; overflow: hidden;
}
.alerts.show { display: block; }
.alerts .alert + .alert { margin-top: .6vh; }
.alerts .alert span { opacity: .9; }
/* Older kiosk Chromium builds lack :has(), so JS sets body.has-alerts */
body.has-alerts .caption { bottom: 14vh; }

/* Priority messages from admin: over everything except the sound button */
.priority-msgs {
  position: fixed; left: 0; right: 0; top: 0; z-index: 1050; display: none;
  background: #9b1c1c; color: #fff; border-bottom: .6vh solid #fca5a5;
  font-size: clamp(18px, 3.6vh, 48px); line-height: 1.3; padding: 1.4vh 2.4vw; box-shadow: 0 .6vh 2vh #000a;
}
.priority-msgs.show { display: block; }
.priority-msg + .priority-msg { margin-top: 1vh; padding-top: 1vh; border-top: 1px solid #fff4; }
.priority-msg strong { text-transform: uppercase; letter-spacing: .06em; margin-right: .6em; }
