/* Traffic desk. One road, one big still, 511 is the rule. */
.traffic-page { background: #0e0d0b; }
.rule-box {
  margin: 1.1rem 0 1rem;
  padding: 0.85rem 1rem;
  background: #1a1408;
  border: 2px solid var(--amber);
  border-radius: var(--radius);
}
.rule-box strong { color: var(--amber); }
.pass-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
/* Chip colors carry severity: red = restriction/crash/closure, amber =
   work and slowdowns, green = a feed that reported and posted nothing. */
.pass-status .cue.warn { border-color: var(--amber); color: var(--amber); }
.pass-status .cue.bad { border-color: #e35b2a; color: #ff9a76; background: #1d0f08; }
.pass-status .cue.ok { border-color: #3d6b45; color: #c8e6c9; }
.pass-status .cue.faint { color: var(--muted); font-weight: 400; }
/* Chip icons inherit the chip's severity color, so they never need their
   own palette. Fixed-size and non-shrinking so wrapped text stays aligned. */
.pass-status .cue .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 17px;
  line-height: 1;
  font-variation-settings: "wght" 500, "opsz" 20;
}
.pass-status[hidden] { display: none; }
.route-stage {
  position: relative;
  background: #080807;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.route-stage img { width: 100%; max-height: 62vh; object-fit: contain; display: block; background: #080807; }
/* A camera that sent nothing: words on a quiet hatch, never a broken-image icon. */
.route-stage .still-down { display: none; }
.route-stage.is-broken img { display: none; }
.route-stage.is-broken .still-down {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(40vh, 320px);
  margin: 0;
  padding: 1rem var(--gutter);
  text-align: center;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 10px, var(--surface) 10px, var(--surface) 20px);
}
.route-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
}
.route-nav button {
  min-height: var(--target);
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--paper);
  font: inherit;
  font-weight: 650;
  border-radius: var(--radius);
  cursor: pointer;
}
.route-nav button:hover { border-color: var(--amber); }
.route-nav .count { margin: 0; text-align: center; min-width: 0; }
@media (max-width: 720px) {
  /* Phone: caption on its own line, buttons split the row below it. */
  .route-nav { flex-wrap: wrap; }
  .route-nav .count { order: -1; flex: 1 1 100%; }
  .route-nav button { flex: 1 1 28%; padding: 0 0.5rem; }
  .rule-box { padding: 0.7rem 0.8rem; font-size: 0.95rem; }
}
.route-strip {
  display: flex;
  gap: 0.4rem;
  overflow: auto;
  padding: 0.6rem 0 0;
}
.route-strip button {
  flex: 0 0 7.5rem;
  padding: 0;
  border: 2px solid transparent;
  background: #161512;
  cursor: pointer;
}
.route-strip button[aria-current="true"] { border-color: var(--amber); }
.route-strip img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.route-strip button.no-still img { visibility: hidden; }
.route-strip button.no-still {
  background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 6px, var(--surface) 6px, var(--surface) 12px);
}

/* ---- the traffic map -------------------------------------------------
   Reports lead, cameras confirm. The list sits beside the map on a desk
   and above it on a phone, so the answer ("what is in the way") is read
   before the map is panned. */
.traffic-work {
  display: grid;
  grid-template-columns: minmax(17rem, 23rem) 1fr;
  gap: 0;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  /* A fixed row height, not min-height: the list is a flex column that
     would otherwise size to all 200-odd reports and drag the map to
     thousands of pixels tall. */
  height: clamp(26rem, 60vh, 40rem);
}
.traffic-work #traffic-map { height: 100%; min-height: 0; }
.incident-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.inc-head { padding: 0.75rem 0.85rem 0.5rem; border-bottom: 1px solid var(--line); }
.inc-head h2 { margin: 0; font-size: 1.1rem; }
.inc-head .count { margin: 0.2rem 0 0; color: var(--muted); font-family: var(--font-clock); font-size: 0.76rem; }
#inc-items { flex: 1; overflow: auto; min-height: 0; }
.inc-kicker {
  margin: 0;
  padding: 0.5rem 0.85rem 0.25rem;
  color: var(--faint);
  font-family: var(--font-clock);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  background: var(--bg-2);
}
.inc-item {
  display: flex;
  gap: 0.55rem;
  width: 100%;
  min-height: var(--target);
  text-align: left;
  padding: 0.6rem 0.85rem;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
.inc-item:hover { background: var(--surface); }
.inc-item[aria-current="true"] { background: var(--surface-2); border-left-color: var(--amber); }
.inc-item .material-symbols-outlined { flex: 0 0 auto; font-size: 20px; line-height: 1.2; }
.inc-copy { min-width: 0; }
.inc-line { display: block; }
.inc-item .who { display: block; margin-top: 0.15rem; color: var(--faint); font-family: var(--font-clock); font-size: 0.72rem; }
/* Severity by the icon's color, matching the chips above the fold. */
.inc-item.sev-bad .material-symbols-outlined { color: #ff9a76; }
.inc-item.sev-warn .material-symbols-outlined { color: var(--amber); }
.inc-item.sev-low .material-symbols-outlined { color: var(--muted); }
.inc-note {
  margin: 0;
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.75rem;
}
@media (max-width: 820px) {
  .traffic-work {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 15rem) minmax(0, 20rem);
    height: 35rem;
  }
  .incident-list { order: 1; border-right: 0; border-bottom: 1px solid var(--line); }
  .traffic-work #traffic-map { order: 2; }
  .inc-note { display: none; }
}
