/* KiezReach. Minimal monochrome style after ethlabs.org: Outfit, near-black ink on white, hairline rules,
   wide-tracked uppercase labels, square corners, one red accent. Layout descended from "À portée de tram" (MIT). */

/* Outfit (SIL Open Font License, fonts/OFL.txt), self-hosted: one variable file per subset, weights 300–700. */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #111111;
  --ink-soft: #3d3d3b;
  --muted: #8f8f8c;
  --line: #e4e4e1;
  --surface-alt: #f5f5f3;
  --panel: rgba(255, 255, 255, 0.96);
  --map-bg: #ffffff;
  --accent: #e5392b;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1.25rem, 5.4vw, 4.75rem);
}

/* Dark mode: set on <html data-theme="dark"> (system preference, or the toggle in the top bar). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0e;
  --ink: #ededed;
  --ink-soft: #bdbdba;
  --muted: #858582;
  --line: #262626;
  --surface-alt: #171717;
  --panel: rgba(14, 14, 14, 0.94);
  --map-bg: #0e0e0e;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

button,
input {
  font: inherit;
  color: inherit;
}

strong {
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

/* Shared label style: uppercase, light, widely tracked. */
.control-label,
.trip-eyebrow,
.eyebrow,
.tagline,
.bar-right a,
.bar-button,
.button,
.link-button,
.segmented,
.lines-table th,
.lines-block summary,
.steps strong {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Top bar ------------------------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.6rem var(--gutter) 1.2rem;
  line-height: 1.6;
}

.bar-brand {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.bar-right a,
.bar-button {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.88rem;
  font-weight: 300;
  text-decoration: none;
  cursor: pointer;
}

.bar-right a:hover,
.bar-button:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* --- Hero: wordmark, and a tagline on a hairline that turns up at its end ---------------------------------- */

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(1.5rem, 5vh, 3.5rem);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ink);
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 1px;
  height: calc(100% + 1.5rem);
  background: var(--ink);
}

.wordmark {
  margin: 0;
  font-size: clamp(3.4rem, 10vw, 7.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.92;
}

/* "Kiez" (Berlin for neighbourhood) takes the accent colour wherever the name is written. */
.kiez {
  color: var(--accent);
}

.tagline {
  margin: 1rem 0 0;
  font-size: 0.8rem;
}

/* "For Berlin by Parithosh": bottom right of the hero, in the uppercase label style, just inside the turned-up rule. */
.byline,
.footer-byline {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.byline {
  flex: none;
  margin: 0 1.2rem 0 0;
}

.byline a,
.footer-byline a {
  color: var(--ink);
  text-decoration: none;
}

.byline a:hover,
.footer-byline a:hover {
  text-decoration: underline;
}

.footer-byline {
  margin-left: 0.8rem;
  font-size: 0.72rem;
}

@media (max-width: 720px) {
  .hero {
    flex-wrap: wrap;
  }

  .byline {
    margin-top: -0.4rem;
  }
}

/* Theme toggle: a hairline moon in light mode (switch to dark), a sun in dark mode. */
.theme-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon.sun,
:root[data-theme="dark"] .theme-icon.moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon.sun {
  display: block;
}

.bar-button.theme-toggle {
  display: flex;
  align-items: center;
  padding: 2px;
}

.bar-button.theme-toggle:hover {
  opacity: 0.6;
  text-decoration: none;
}

.intro {
  max-width: 38rem;
  padding-top: 2.6rem;
}

.lede {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.6;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.8rem;
  border-bottom: 1px solid var(--ink);
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0;
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 300;
  outline: none;
}

.search input::placeholder {
  color: var(--muted);
}

.search .button {
  border: 0;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 15;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--ink);
  background: var(--bg);
}

.search-results button {
  display: block;
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 0;
  background: none;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.search-results li + li button {
  border-top: 1px solid var(--line);
}

.search-results button:hover,
.search-results button:focus-visible {
  background: var(--surface-alt);
}

.search-results small {
  display: block;
  color: var(--muted);
  font-weight: 300;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.4rem;
  margin: 3.2rem 0 1.6rem;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.steps li {
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.steps span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.steps strong {
  display: block;
  margin: 0.15rem 0 0.25rem;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 400;
}

/* --- Buttons --------------------------------------------------------------- */

.button {
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.button:hover {
  background: var(--ink);
  color: var(--bg);
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.button.primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--bg);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.icon-button[hidden] {
  display: none;
}

.icon-button:hover {
  background: var(--ink);
  color: var(--bg);
}

/* --- Map ------------------------------------------------------------------- */

.map-card {
  border: 1px solid var(--ink);
  scroll-margin-top: 1rem;
}

.map-stage {
  position: relative;
  height: min(74vh, 760px);
  min-height: 440px;
  background: var(--map-bg);
}

.map-stage:fullscreen {
  height: 100vh;
}

#mapCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

#mapCanvas.panning {
  cursor: grabbing;
}

#mapCanvas.over-marker {
  cursor: grab;
}

#mapCanvas.over-stop {
  cursor: pointer;
}

.noscript {
  margin: 0;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--ink);
}

.trip-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 300px;
  max-height: calc(100% - 28px);
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  background: var(--panel);
}

.trip-panel p {
  margin: 0;
}

.trip-eyebrow {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 400;
}

.trip-from,
.trip-to {
  margin-top: 2px !important;
  font-weight: 500;
  line-height: 1.4;
}

.trip-result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.trip-duration {
  margin-top: 6px !important;
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.trip-steps {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.trip-steps li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
}

.badge {
  flex: none;
  min-width: 26px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}

.badge.walk {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 400;
}

.trip-steps .minutes {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.66rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover {
  color: var(--ink);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
}

.segmented span {
  margin-right: 4px;
}

.segmented button {
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.trip-hint {
  margin-top: 10px !important;
  color: var(--muted);
  font-size: 0.85rem;
}

.map-buttons {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
}

.map-buttons .icon-button + .icon-button {
  margin-top: -1px;
}

/* Bottom right: the route and people panels can run down the whole left side. */
.legend {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 220px;
  padding: 10px 12px 6px;
  border: 1px solid var(--ink);
  background: var(--panel);
}

.legend-bar {
  height: 8px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

/* Hovered station: name, lines, travel time. Positioned by app.js (transform), never catches the mouse. */
.map-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  background: var(--panel);
  font-size: 0.85rem;
  line-height: 1.35;
  pointer-events: none;
}

.map-tooltip[hidden] {
  display: none;
}

.map-tooltip strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
}

.tooltip-lines {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
}

.tooltip-lines .badge {
  min-width: 24px;
  padding: 1px 5px;
  font-size: 0.7rem;
}

.tooltip-more {
  color: var(--muted);
  font-size: 0.76rem;
}

.tooltip-time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Controls ---------------------------------------------------------------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding: 16px 18px;
  border-top: 1px solid var(--ink);
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.control-group.actions {
  margin-left: auto;
}

.control-label {
  margin-right: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}

.pill-toggle:has(input:checked) {
  border-color: var(--ink);
  color: var(--ink);
}

/* A small square: outlined when off, filled when on. */
.pill-toggle input {
  appearance: none;
  width: 9px;
  height: 9px;
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 0;
  cursor: pointer;
}

.pill-toggle input:checked {
  background: var(--ink);
  border-color: var(--ink);
}

.pill-toggle input:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.mode-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Mode toggles: the coloured dot is the indicator (faded when off), no square. */
#modeToggles .pill-toggle {
  position: relative;
}

#modeToggles .pill-toggle input {
  position: absolute;
  opacity: 0;
}

#modeToggles .pill-toggle:not(:has(input:checked)) .mode-dot {
  opacity: 0.25;
}

#modeToggles .pill-toggle:has(input:focus-visible) {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

input[type="range"] {
  width: 140px;
  accent-color: var(--ink);
}

output {
  min-width: 52px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.reach {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* --- Sections ------------------------------------------------------------------ */

.section {
  max-width: 980px;
  margin-top: clamp(4rem, 10vh, 7rem);
  scroll-margin-top: 1rem;
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0 0 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.72rem;
}

.section h2 {
  margin: 0 0 1.8rem;
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

.section-lede {
  margin: -0.8rem 0 1.8rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  padding: 0.2rem 1.4rem 0.4rem 0;
}

.stat + .stat {
  padding-left: 1.4rem;
  border-left: 1px solid var(--line);
}

.stat strong {
  display: block;
  color: var(--ink);
  font-size: 2.7rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.stat-grid + p {
  margin: 2.4rem 0 0.4rem;
  font-size: 0.85rem;
}

.lines-block {
  border-bottom: 1px solid var(--line);
}

.lines-block summary {
  padding: 0.9rem 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 400;
  list-style: none;
  cursor: pointer;
}

.lines-block summary::-webkit-details-marker,
.faq summary::-webkit-details-marker {
  display: none;
}

.lines-block summary::after,
.faq summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 300;
}

.lines-block[open] summary::after,
.faq[open] summary::after {
  content: "−";
}

.lines-table {
  width: 100%;
  margin: 0 0 1.2rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.lines-table th,
.lines-table td {
  padding: 0.45rem 0.8rem 0.45rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.lines-table th {
  border-bottom-color: var(--ink);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 400;
}

.line-badge {
  display: inline-block;
  min-width: 30px;
  padding: 1px 6px;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
}

.ranking-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.4rem;
}

.ranking-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.ranking-card-question {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.ranking-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Hanging indent: a wrapped row lines up after its rank number. */
.ranking-card li {
  margin: 0.55rem 0;
  padding-left: 1.9rem;
  text-indent: -1.9rem;
}

.ranking-card li > * {
  text-indent: 0;
}

.ranking-card strong {
  color: var(--ink);
  font-weight: 500;
}

.ranking-card .line-badge {
  margin-right: 2px;
}

.ranking-card .muted {
  font-size: 0.8rem;
  line-height: 1.5;
}

.rank {
  display: inline-block;
  width: 1.9rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.faq {
  max-width: 46rem;
  border-bottom: 1px solid var(--line);
}

.faq summary {
  padding: 1rem 0;
  color: var(--ink);
  font-weight: 400;
  list-style: none;
  cursor: pointer;
}

.faq p {
  margin: 0 0 1.3rem;
  line-height: 1.7;
}

/* --- Footer ------------------------------------------------------------------- */

.site-footer {
  margin-top: clamp(5rem, 12vh, 8rem);
  border-top: 1px solid var(--ink);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.65;
}

.footer-inner p {
  max-width: 52rem;
  margin: 0 0 0.8rem;
}

.footer-brand {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer-credits {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 400;
}

/* --- Time of day, travel, cross links ------------------------------------------- */

/* Joined square buttons (Day | Rush hour | Night, Walk | Bike): the pressed one is filled. */
.segmented-control button {
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.segmented-control button + button {
  margin-left: -7px; /* collapse the 6px group gap and the shared border */
}

.segmented-control button[aria-pressed="true"] {
  position: relative;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.segmented-control[aria-busy="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.legend-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cross-link {
  margin: 1.2rem 0 0;
  font-size: 0.9rem;
}

.cross-link a {
  text-decoration-color: var(--muted);
}

/* --- Meeting planner ---------------------------------------------------------- */

.hero-small {
  padding-bottom: 1.1rem;
}

.hero-small .tagline {
  margin: 0 0 0.6rem;
}

.page-title {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.meet-panel {
  width: 320px;
}

.people-list,
.spot-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.people-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.person-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-dot {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 600;
}

.spots-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.spot {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
}

.spot:hover {
  border-color: var(--line);
}

.spot[aria-pressed="true"] {
  border-color: var(--ink);
}

.spot-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.88rem;
}

.spot-head strong {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.spot-figure {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spot .rank {
  width: auto;
}

.time-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.time-chip .person-dot {
  width: 15px;
  height: 15px;
  font-size: 0.58rem;
}

.map-tooltip .time-chips {
  margin-top: 6px;
}

/* --- Small screens ------------------------------------------------------------- */

@media (max-width: 860px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: 1.6rem;
  }

  .stat:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .bar {
    padding: 1.5rem var(--gutter) 1rem;
  }

  .bar-right {
    gap: 1rem;
  }

  .bar-right a,
  .bar-button {
    font-size: 0.76rem;
  }

  /* The how-to gives way to the map, which moves up into the first screen. */
  .steps {
    display: none;
  }

  .intro {
    padding-top: 1.8rem;
  }

  .map-card {
    margin-top: 2rem;
  }

  .map-stage {
    height: auto;
    min-height: 0;
  }

  .map-stage:fullscreen #mapCanvas {
    height: 100vh;
  }

  #mapCanvas {
    height: 60vh;
  }

  /* The route goes below the map instead of covering it. */
  .trip-panel {
    position: static;
    width: auto;
    max-height: none;
    border: 0;
    border-top: 1px solid var(--ink);
    background: var(--bg);
  }

  .map-stage:fullscreen .trip-panel {
    display: none;
  }

  .trip-duration {
    font-size: 1.9rem;
  }

  .legend {
    top: 10px;
    bottom: auto;
    right: auto;
    left: 10px;
    width: 160px;
  }

  .map-buttons {
    top: 10px;
    right: 10px;
  }

  .control-group.actions {
    margin-left: 0;
  }
}

@media (max-width: 460px) {
  .bar-right a[href$="#numbers"],
  .bar-right a[href$="#about"] {
    display: none;
  }
}
