* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

body { display: flex; flex-direction: column; }

/* ── Header ── */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #0f1419; color: #fff; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .pin { font-size: 26px; }
.brand h1 { font-size: 18px; font-weight: 700; line-height: 1.1; }
.brand .sub { font-size: 12px; color: #9fb3c8; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.legend .chip { flex: 0 0 auto; }
.chip {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: #1c2733; color: #dbe7f3; white-space: nowrap;
}

/* ── Demo banner ── */
#demo-banner {
  background: #fff7e0; color: #7a5b00; font-size: 12.5px;
  padding: 6px 16px; border-bottom: 1px solid #f0e2ae;
}

/* ── Map ── */
#map { flex: 1; min-height: 0; }

/* ── Camera pins ── */
.cam {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: #fff; border: 3px solid #4f9cf9;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer;
}
.cam.flood { border-color: #e5484d; }

/* ── Report pins (crowdsourced posts — squared, ≠ round camera pins) ── */
.report-pin {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; background: #fff; border: 3px solid #f5a623;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer;
}
.report-pin.flood { border-color: #7c5cff; }

/* ── Timeline (filters the reports layer) ── */
#timeline {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 1000; background: rgba(15,20,25,.92); color: #dbe7f3;
  border-radius: 12px; padding: 8px 12px; min-width: 320px; max-width: 94vw;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.tl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-toggles { display: flex; gap: 10px; padding-right: 8px; border-right: 1px solid #33465c; }
.tl-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: #dbe7f3; cursor: pointer; white-space: nowrap;
}
.tl-toggle input { accent-color: #4f9cf9; cursor: pointer; }
.tl-windows { display: flex; gap: 4px; }
.tl-windows button {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid #33465c; background: transparent; color: #9fb3c8; cursor: pointer;
}
.tl-windows button.active { background: #4f9cf9; border-color: #4f9cf9; color: #fff; }
.tl-count { font-size: 12px; color: #9fb3c8; white-space: nowrap; }
.tl-history-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tl-history-row[hidden] { display: none; }
.tl-history-row input[type="range"] { flex: 1; accent-color: #4f9cf9; }
#tl-history-label { font-size: 12px; color: #dbe7f3; white-space: nowrap; }

/* ── Popup ── */
.feed-popup { width: 320px; }
.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.feed-head strong { font-size: 14px; }
.badges { display: flex; gap: 4px; }
.badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  white-space: nowrap;
}
.badge.traffic  { background: #e3efff; color: #1d5dbf; }
.badge.flood    { background: #ffe3e4; color: #b1272c; }
.badge.live     { background: #e5484d; color: #fff; }
.badge.user     { background: #fff1dc; color: #9a6200; }
.badge.curated  { background: #ece6ff; color: #5636c9; }
.badge.verified { background: #ddf5e4; color: #1c7c3c; }
.feed-meta { font-size: 12px; color: #667; margin: 4px 0 8px; }

/* ── Report popup ── */
.report-popup { width: 280px; }
.report-popup .feed-head strong { font-size: 13.5px; }
.report-badges { margin-top: 4px; flex-wrap: wrap; }
.report-photo {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 8px; margin-top: 8px; background: #000; display: block;
}
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.feed-note { font-size: 11px; color: #999; margin-top: 6px; }

/* Mobile */
@media (max-width: 560px) {
  #topbar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .feed-popup { width: 260px; }
}
