/* Map page: full-height map, time panel, ad rail on wide screens */
/* The map fills the first screen; crawlable text follows below it */
.screen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.below-map { max-width: 900px; margin: 0 auto; padding: 24px 16px 40px; }
.below-map h1 { font-size: 26px; margin: 0 0 10px; }
.below-map h2 { font-size: 19px; margin: 22px 0 8px; }
.city-links { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-left: 18px; }

.cities { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.cities button {
  background: transparent;
  color: var(--bar-fg);
  border: 1px solid var(--bar-line);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
}
.cities button:hover, .cities button:focus-visible { border-color: var(--accent); color: var(--accent); }

.map-wrap { flex: 1; min-height: 0; display: flex; position: relative; }
#map { flex: 1; min-width: 0; }

.ad-rail { display: none; }
@media (min-width: 1100px) {
  .ad-rail {
    display: flex;
    justify-content: center;
    padding: 12px 10px;
    width: 180px;
    flex: none;
    background: var(--soft-bg);
    border-left: 1px solid var(--line);
  }
}

/* ---- time panel ---- */
.panel {
  position: absolute;
  left: 12px;
  bottom: 28px;
  width: 300px;
  max-height: calc(100% - 40px);
  overflow: auto;
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px 8px;
}
.tabs { display: flex; gap: 2px; margin-bottom: 10px; background: var(--soft-bg); border-radius: 6px; padding: 2px; }
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 5px 4px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.15); }

.tab-body { margin-bottom: 8px; }
.when { display: block; font-weight: 700; font-size: 15px; margin: 2px 0 6px; min-height: 1.5em; }
.row { display: flex; gap: 6px; margin-bottom: 6px; }
.row > * { flex: 1; min-width: 0; }
.row select, .row input[type="date"] {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.step {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.step:hover { border-color: var(--accent-strong); }
.player { display: flex; align-items: center; gap: 8px; }
.play {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--accent-strong);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
.play:hover { background: #267f30; }
input[type="range"] { width: 100%; accent-color: var(--accent-strong); }
.scale-hint { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -2px; }
.colorby { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; }
.colorby label { cursor: pointer; }

.legend { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .swatch { width: 22px; height: 5px; border-radius: 2px; flex: none; }
.legend .short { display: none; }
.legend .dot, .maplibregl-popup .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); flex: none;
}
.legend .dot { margin: 0 6px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 0 0 6px; cursor: pointer; }
.toggle[hidden] { display: none; }
.notice { margin: 0 0 8px; padding: 6px 8px; background: #fff7e0; border: 1px solid #f0d58c; border-radius: 5px; font-size: 13px; }
.notice[hidden] { display: none; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-strong); text-decoration: underline; cursor: pointer; font: inherit; }
.status { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.status.warn { color: #b00020; font-weight: 600; }

/* ---- popup ---- */
.maplibregl-popup-content { padding: 8px 10px; font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
.pop-road { font-weight: 700; }
.pop-speed { font-size: 18px; font-weight: 700; }
.pop-note { color: var(--muted); }
.pop-road .dot { margin-right: 6px; vertical-align: -1px; }
.pop-cause { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.pop-cause .dot { margin-right: 5px; vertical-align: -1px; }
.pop-log { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); font-size: 12px; }
.pop-log li { margin-bottom: 3px; }
.pop-log span { color: var(--muted); }

@media (max-width: 700px) {
  .cities { margin-left: 0; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .cities button { flex: none; }
  .cities button { padding: 2px 7px; font-size: 13px; }
  .panel { left: 6px; right: 6px; bottom: 22px; width: auto; max-height: 55%; padding: 8px 10px 6px; }
  .legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; }
  .legend .long { display: none; }
  .legend .short { display: inline; }
  .legend .swatch { width: 16px; }
  .legend .dot { margin: 0 2px; }
  .maplibregl-ctrl-scale { display: none; }
}
.below-map .tomorrow { padding-left: 20px; }
.below-map .tomorrow li { margin-bottom: 8px; }
.est-cta { font-weight: 700; }
