/* © 2026 Michele Berardi. All rights reserved. Rushmap — not licensed for copying or reuse (see info.html). */
:root {
  --bg: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #111418;
  --muted: #5f6672;
  --line: rgba(0, 0, 0, 0.08);
  --chip: #f1f3f5;
  --accent: #1f5fd6;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
button, select { font: inherit; color: inherit; }
#map { position: fixed; inset: 0; }

.panel {
  position: fixed; top: 12px; left: 12px; width: 340px; max-width: calc(100vw - 24px);
  padding: 12px; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: grid; gap: 10px; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 7px; }
.brand .name { font-weight: 700; font-size: 15px; }
.brand .city { color: var(--muted); font-size: 12px; }
.round {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0;
  background: var(--chip); color: var(--text); cursor: pointer; text-decoration: none; flex: none;
}
.round svg { width: 16px; height: 16px; transition: transform 0.2s; }
.info { margin-left: auto; font: italic 700 15px Georgia, "Times New Roman", serif; }
.more { display: none; }
.details { display: grid; gap: 10px; }
.get-app { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.get-app[hidden] { display: none; }
.get-app p { margin: 0; font-size: 12px; color: var(--muted); }
.stores { display: flex; gap: 8px; flex-wrap: wrap; }
.store {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 11px; border-radius: 10px;
  background: #000; color: #fff; text-decoration: none; line-height: 1.05;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.store[hidden] { display: none; }
.store svg { width: 22px; height: 22px; flex: none; }
.store span { display: grid; font-size: 14.5px; font-weight: 600; letter-spacing: -0.2px; }
.store small { font-size: 9px; font-weight: 500; letter-spacing: 0.3px; text-transform: uppercase; opacity: 0.85; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 10px; background: var(--chip); }
.segmented button {
  border: 0; background: none; padding: 6px; border-radius: 8px; cursor: pointer; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted);
}
.segmented button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #e5484d; }
body[data-mode="live"] .live-dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.pulse { margin: 0; display: flex; gap: 8px; font-weight: 600; font-size: 13px; }
.pulse .dot { flex: none; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--muted); }
.pulse[data-level="normal"] .dot, .pulse[data-level="faster"] .dot { background: #30a46c; }
.pulse[data-level="slower"] .dot { background: #f5a524; }
.pulse[data-level="much_slower"] .dot { background: #e5484d; }
body[data-mode="replay"] .pulse { display: none; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--chip); cursor: pointer; font-size: 13px;
}
.filters button[aria-pressed="false"] { opacity: 0.45; background: none; }
.sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sw.subway { background: conic-gradient(#ee352e 0 25%, #0062cf 0 50%, #eb6800 0 75%, #00933c 0); }
.sw.cars { background: linear-gradient(90deg, #b42318, #eaaa08, #12b76a); border-radius: 2px; height: 7px; }
.sw.traffic { background: linear-gradient(90deg, #d92d20, #eaaa08, #12b76a); border-radius: 2px; height: 5px; }
.sw.bus { background: #1f5fd6; }
.sw.bikes { background: #0075db; }
.sw.rail { background: #8e44ad; border-radius: 2px; }
.sw.njbus { background: #e8710a; }
.sw.boats { background: #0d4573; }
.sw.air { background: #1c294a; clip-path: polygon(50% 0, 62% 40%, 100% 60%, 62% 62%, 60% 88%, 72% 100%, 28% 100%, 40% 88%, 38% 62%, 0 60%, 38% 40%); border-radius: 0; }

.counts { color: var(--muted); font-size: 13px; }
.counts b { color: var(--text); font-variant-numeric: tabular-nums; }
.counts .status { font-size: 12px; margin-top: 2px; }
.counts .warn { color: #e5484d; font-weight: 600; }

.replay-bar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: 560px; max-width: calc(100vw - 24px); padding: 14px 16px; border-radius: 24px;
  background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  z-index: 2; display: none; gap: 10px;
}
body[data-mode="replay"] .replay-bar { display: grid; }
.replay-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.replay-title { font-weight: 700; font-size: 19px; }
.replay-sub { color: var(--muted); font-size: 12px; }
.clock { font-weight: 700; font-size: 30px; font-variant-numeric: tabular-nums; font-family: ui-rounded, -apple-system, sans-serif; }
.replay-message { margin: 0; height: 84px; display: grid; place-items: center; color: var(--muted); }
.replay-message[hidden], .chart[hidden] { display: none; }

.chart { position: relative; height: 84px; margin-bottom: 16px; cursor: ew-resize; touch-action: none; outline-offset: 4px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .bus { fill: rgba(0, 122, 255, 0.55); }
.chart .subway { fill: rgba(255, 149, 0, 0.8); }
.chart .grid { stroke: rgba(60, 60, 67, 0.2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.playhead {
  position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px;
  background: #007aff; pointer-events: none;
}
.chart.scrubbing .playhead { width: 4px; margin-left: -2px; }
.chart-labels { position: absolute; left: 0; right: 0; top: 100%; height: 16px; }
.chart-labels span { position: absolute; top: 2px; padding-left: 3px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-labels span.end { transform: translateX(-100%); padding: 0 3px 0 0; }

.replay-controls { display: flex; align-items: center; gap: 10px; }
.play {
  flex: none; width: 48px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: #007aff; color: #fff; font-size: 15px; font-weight: 700;
}
.play:disabled { opacity: 0.4; cursor: default; }
.pill {
  height: 44px; border: 0; border-radius: 999px; padding: 0 12px; background: var(--chip);
  font-size: 12px; font-weight: 600; cursor: pointer; min-width: 0;
}
.replay-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }

.maplibregl-popup-content {
  background: var(--panel); color: var(--text); border-radius: 12px; padding: 10px 12px;
  box-shadow: var(--shadow); font-size: 13px; display: grid; gap: 3px;
}
.maplibregl-popup-tip { display: none; }
.pop-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.pop-note { color: var(--muted); font-size: 11px; }
.bullet {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  font-weight: 700; font-size: 12px;
}
.bullet.bus { background: #1f5fd6; color: #fff; border-radius: 6px; }
.bullet.bike { background: #0075db; color: #fff; border-radius: 6px; font-size: 10px; }
.bullet.tag { color: #fff; border-radius: 6px; font-size: 11px; white-space: nowrap; }


/* Statistics: the app's Analysis tab, as a sheet over the live map. */
.segmented { grid-template-columns: 1fr 1fr 1fr 1fr; }
.stats {
  position: fixed; top: 12px; right: 12px; bottom: 12px; width: 460px; max-width: calc(100vw - 24px); z-index: 3;
  display: flex; flex-direction: column; border-radius: 20px; background: rgba(242, 242, 247, 0.97);
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden;
}
.stats[hidden] { display: none; }
.stats-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; }
.stats-head h2 { margin: 0; font-size: 24px; line-height: 1.1; }
.stats-head small { color: var(--muted); }
.stats-head div { margin-right: auto; }
.stats-tabs { display: flex; gap: 8px; padding: 6px 16px 0; overflow-x: auto; scrollbar-width: none; }
.stats-tabs button, .chips button {
  flex: none; border: 0; border-radius: 999px; padding: 0 14px; min-height: 38px; cursor: pointer;
  font-weight: 600; font-size: 13px; background: rgba(118, 118, 128, 0.12);
}
.stats-tabs button[aria-pressed="true"], .chips button[aria-pressed="true"] { background: #007aff; color: #fff; }
.stats-about { margin: 8px 16px 4px; color: var(--muted); font-size: 13px; }
.stats-body { flex: 1; overflow-y: auto; padding: 4px 12px 16px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

.card { background: #fff; border-radius: 14px; padding: 12px 14px; margin-top: 12px; display: grid; gap: 8px; }
.card h3 { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.card p { margin: 0; }
.card .foot { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.card .small, .card small { font-size: 12px; color: var(--muted); }
.card .muted { color: var(--muted); }
.card .headline { font-weight: 700; font-size: 16px; }
.card .huge { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; font-family: ui-rounded, -apple-system, sans-serif; }
.card .green { color: #34c759; }
.card .up { color: #34c759; font-weight: 600; }
.card .down { color: #ff3b30; font-weight: 600; }
.card .empty { color: var(--muted); font-size: 13px; }
.card .sub { font-weight: 600; font-size: 13px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips button { min-height: 32px; padding: 0 12px; font-size: 12px; }
.controls { display: grid; gap: 8px; }
.controls .pill, .card > .pill { height: 36px; justify-self: start; }
.chart { position: relative; width: 100%; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.15); border-top-color: #007aff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.density-map { height: 270px; border-radius: 16px; overflow: hidden; }
.density-inner { width: 100%; height: 100%; }
.metrics { display: flex; justify-content: space-between; }
.metrics b, .big3 b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.metrics span, .big3 span { font-size: 12px; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend i { width: 100px; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #007aff, #32ade6, #ff9500, #ff3b30); }
.legend em { margin-left: auto; font-style: normal; }
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.big3 > div + div { border-left: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; font-size: 14px; }

.srow { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.srow > span:nth-child(2) { flex: 1; }
.srow b { font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }
.sicon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: #fff; font-size: 13px; flex: none; }
.lbullet { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; }
.service { display: flex; align-items: center; gap: 10px; }
.service .bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(118, 118, 128, 0.16); overflow: hidden; }
.service .bar i { display: block; height: 100%; border-radius: 3px; }
.service span:last-child { width: 52px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wait { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.wait > div { flex: 1; min-width: 0; }
.wait > div > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aqi { display: flex; align-items: center; gap: 16px; }
.aqi > b { font-size: 36px; font-family: ui-rounded, -apple-system, sans-serif; }
.aqi strong { display: block; font-size: 16px; }
.insights { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.insights li::before { content: "💡 "; }
.ranking { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; }
.ranking li span { display: inline-block; max-width: 75%; }
.ranking li b { float: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.headrow { display: flex; align-items: baseline; gap: 8px; }
.headrow > b { font-size: 32px; font-variant-numeric: tabular-nums; }
.headrow span { display: block; font-size: 13px; color: var(--muted); }

@media (max-width: 600px) {
  .panel {
    top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; max-width: none; padding: 10px; gap: 8px;
    max-height: calc(100dvh - 16px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain;
  }
  /* Phones: filters, counts and store links fold away so the map stays visible. */
  .more { display: grid; margin-left: auto; }
  .info { margin-left: 0; }
  .panel:not(.open) .details { display: none; }
  .panel.open .more svg { transform: rotate(180deg); }
  .details { gap: 8px; }
  .filters button { padding: 6px 10px; }
  .pulse { font-size: 12.5px; }
  .replay-bar { padding: 12px; border-radius: 20px; }
  .clock { font-size: 26px; }
  .replay-title { font-size: 17px; }
  body[data-mode="replay"] .panel.open { max-height: calc(100dvh - 300px); }
  .replay-bar { bottom: max(8px, env(safe-area-inset-bottom)); }
  .maplibregl-ctrl-zoom-in, .maplibregl-ctrl-zoom-out { display: none !important; }   /* pinch to zoom; the reset button stays */
  body[data-mode="replay"]:not([data-cinema="on"]) .maplibregl-ctrl-bottom-right { bottom: 240px; }
  .stats { inset: 0; width: auto; max-width: none; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

/* Cookie consent banner (js/consent.js). */
.consent {
  position: fixed; left: 12px; bottom: 12px; z-index: 10; width: 360px; max-width: calc(100vw - 24px);
  padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.97); color: #111418;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: grid; gap: 10px;
}
.consent p { margin: 0; }
.consent a { color: #007aff; }
.consent div { display: flex; gap: 8px; justify-content: flex-end; }
.consent button { border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; background: #e9e9ee; color: #111418; }
.consent button.primary { background: #007aff; color: #fff; }
@media (max-width: 600px) { .consent { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; } }

/* Text for search engines and screen readers, not drawn on the map. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { position: fixed; inset: auto 16px 16px; z-index: 5; padding: 12px 14px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }

/* Street speeds legend (js/traffic.js). */
.traffic-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.traffic-legend[hidden] { display: none; }
.traffic-legend span:first-child { width: 100%; }
.traffic-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* Cinema: the night view for a big screen (js/cinema.js). */
.cinema-bar { display: none; }
body[data-cinema="on"] .panel, body[data-cinema="on"] .replay-bar, body[data-cinema="on"] .stats { display: none; }
/* Night view: dark map controls and vehicle details. */
body[data-cinema="on"] .maplibregl-ctrl-group { background: rgba(20, 24, 33, 0.8); }
body[data-cinema="on"] .maplibregl-ctrl-group button + button { border-top-color: rgba(255, 255, 255, 0.12); }
body[data-cinema="on"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
body[data-cinema="on"] .reset-ctrl button { color: #e8ecf4; }
body[data-cinema="on"] .maplibregl-popup-content { background: rgba(20, 24, 33, 0.94); color: #e8ecf4; }
body[data-cinema="on"] .maplibregl-popup-content .pop-note { color: #9aa4b8; }
body[data-cinema="on"] { background: #0b0e14; }
body[data-cinema="on"] .cinema-bar {
  position: fixed; left: 16px; right: 16px; top: max(16px, env(safe-area-inset-top)); z-index: 4;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: #e8ecf4; pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
.cin-title b { font-size: 22px; letter-spacing: 0.02em; }
.cin-title span { margin-left: 8px; color: #8d97ab; }
.cin-clock { font: 600 20px/1 ui-rounded, -apple-system, sans-serif; font-variant-numeric: tabular-nums; color: #b8c2d6; }
.cin-buttons { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; }
.cin-buttons button {
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 7px 14px; cursor: pointer;
  background: rgba(20, 24, 33, 0.7); color: #c9d1e0; font-weight: 600; font-size: 13px; backdrop-filter: blur(8px);
}
.cin-buttons button[aria-pressed="true"] { background: rgba(90, 169, 255, 0.25); border-color: rgba(90, 169, 255, 0.6); color: #fff; }
body[data-cinema="on"] .maplibregl-ctrl-attrib { background: rgba(11, 14, 20, 0.6); }
body[data-cinema="on"] .maplibregl-ctrl-attrib a { color: #8d97ab; }
@media (max-width: 600px) {
  body[data-cinema="on"] .cinema-bar { gap: 8px; }
  .cin-buttons { margin-left: 0; width: 100%; }
  .cin-buttons button { padding: 6px 10px; font-size: 12px; }
}

@media (max-width: 600px) { #cinema-open { margin-left: 0; } }
.cin-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #9aa4b8; }
.cin-legend[hidden] { display: none; }
.cin-legend span:first-child { margin-right: 6px; }
.cin-legend span:last-child { margin-left: 4px; }
.cin-legend i { width: 18px; height: 8px; border-radius: 2px; }

/* Reset view button (frames all of New York). */
.reset-ctrl button { display: grid !important; place-items: center; color: #333; }
.reset-ctrl svg { width: 16px; height: 16px; }

/* 3D view by day: dark text on the light map. */
body[data-cinema="on"][data-daylight="day"] .cinema-bar { color: #111418; text-shadow: 0 1px 6px rgba(255, 255, 255, 0.9); }
body[data-cinema="on"][data-daylight="day"] .cin-title span, body[data-cinema="on"][data-daylight="day"] .cin-clock,
body[data-cinema="on"][data-daylight="day"] .cin-legend { color: #3a3f47; }
body[data-cinema="on"][data-daylight="day"] .cin-buttons button { background: rgba(255, 255, 255, 0.85); color: #111418; border-color: rgba(0, 0, 0, 0.12); }
body[data-cinema="on"][data-daylight="day"] .cin-buttons button[aria-pressed="true"] { background: #007aff; color: #fff; border-color: #007aff; }
body[data-cinema="on"][data-daylight="day"] .maplibregl-ctrl-group { background: rgba(255, 255, 255, 0.9); }
body[data-cinema="on"][data-daylight="day"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: none; }
body[data-cinema="on"][data-daylight="day"] .reset-ctrl button { color: #333; }
body[data-cinema="on"][data-daylight="day"] .maplibregl-ctrl-attrib { background: rgba(255, 255, 255, 0.7); }
body[data-cinema="on"][data-daylight="day"] .maplibregl-ctrl-attrib a { color: #5f6672; }

/* 3D view: replay downloading. */
.cin-loading { display: none; }
body[data-cinema="on"] .cin-loading:not([hidden]) {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 999px;
  background: rgba(20, 24, 33, 0.88); color: #e8ecf4; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px);
}
body[data-cinema="on"] .cin-loading .spinner { border-color: rgba(255, 255, 255, 0.25); border-top-color: #5aa9ff; }

/* 3D view counters (under the title). */
.cin-counts { display: none; }
body[data-cinema="on"] .cin-counts {
  display: flex; flex-wrap: wrap; gap: 4px 14px; width: 100%; order: 4; font-size: 14px; color: #c9d1e0;
}
body[data-cinema="on"] .cin-counts span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
body[data-cinema="on"] .cin-counts i { width: 9px; height: 9px; border-radius: 50%; }
body[data-cinema="on"] .cin-counts b { font: 700 18px/1 ui-rounded, -apple-system, sans-serif; font-variant-numeric: tabular-nums; color: #fff; min-width: 2ch; }
body[data-cinema="on"][data-daylight="day"] .cin-counts { color: #3a3f47; }
body[data-cinema="on"][data-daylight="day"] .cin-counts b { color: #111418; }
@media (max-width: 600px) {
  body[data-cinema="on"] .cin-counts { gap: 2px 10px; font-size: 12px; }
  body[data-cinema="on"] .cin-counts b { font-size: 15px; }
}
/* Top bar order: title, clock and buttons on the first line; counters, then the density legend, below. */
.cin-title { order: 1; }
.cin-clock { order: 2; }
.cin-buttons { order: 3; }
.cin-legend { order: 5; }

/* Insights (js/insights.js). */
.slow-list { display: grid; gap: 4px; }
.slow {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-align: left; font: inherit;
}
.slow:hover { background: rgba(118, 118, 128, 0.1); }
.slow .rank { width: 18px; color: var(--muted); font-weight: 700; font-size: 13px; text-align: center; }
.slow .mph { flex: none; min-width: 58px; padding: 3px 8px; border-radius: 8px; color: #fff; font-weight: 700; font-size: 13px; text-align: center; }
.slow .where { flex: 1; min-width: 0; display: grid; gap: 2px; }
.slow .routes { display: flex; gap: 4px; flex-wrap: wrap; }
.slow .route { padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.35); font-size: 11px; font-weight: 800; background: #fff; }
.slow .more { font-size: 11px; color: var(--muted); }
.slow small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slow .go { color: var(--muted); font-size: 18px; }
.zone-toggle { justify-self: start; height: 36px; }
table.boro { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.boro th, table.boro td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
table.boro th:first-child { text-align: left; }
table.boro thead th { font-size: 11px; color: var(--muted); font-weight: 600; vertical-align: bottom; }

/* Guided tour captions (js/tour.js). */
.tour-caption { display: none; }
body[data-cinema="on"] .tour-caption:not([hidden]) {
  position: fixed; left: 32px; right: 32px; bottom: max(40px, env(safe-area-inset-bottom)); z-index: 5;
  display: grid; gap: 6px; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85); pointer-events: none;
}
.tour-caption b { font: 800 clamp(30px, 5vw, 64px)/1.05 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: -0.01em; }
.tour-caption span { font: 500 clamp(17px, 2.2vw, 30px)/1.25 -apple-system, BlinkMacSystemFont, sans-serif; color: #dfe6f2; }
body[data-daylight="day"] .tour-caption:not([hidden]) { color: #111418; text-shadow: 0 2px 14px rgba(255, 255, 255, 0.95); }
body[data-daylight="day"] .tour-caption span { color: #2b3038; }
.tour-caption.end b { font-size: clamp(40px, 7vw, 96px); }
body[data-tour="on"] .cin-buttons button:not(#cin-tour):not(#cin-record) { display: none; }
body[data-cinema="on"] #cin-record[aria-pressed="true"] { background: #d92d20; border-color: #d92d20; color: #fff; }
