:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #16a34a;
  --accent-text: #ffffff;
  --red: #dc2626;
  --yellow: #eab308;
  --green: #22c55e;
  --warn-bg: #fef9c3;
  --warn-text: #713f12;
  --error-bg: #fee2e2;
  --error-text: #7f1d1d;
  --topbar: #0f172a;
  --topbar-text: #e2e8f0;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 4px 16px rgb(15 23 42 / 6%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #111a2e; --surface-2: #17223a; --text: #e2e8f0; --muted: #94a3b8;
    --border: #233150; --warn-bg: #3a2f0b; --warn-text: #fde68a; --error-bg: #3b1212; --error-text: #fecaca;
    --topbar: #060b16; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2e; --surface-2: #17223a; --text: #e2e8f0; --muted: #94a3b8;
  --border: #233150; --warn-bg: #3a2f0b; --warn-text: #fde68a; --error-bg: #3b1212; --error-text: #fecaca;
  --topbar: #060b16; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--topbar); color: var(--topbar-text);
  padding-top: max(10px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 400; white-space: nowrap; }
.data-status { font-size: 12.5px; text-align: right; color: #cbd5e1; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; }
.data-status b { color: #fff; font-weight: 600; }
.data-status .pill { background: #a16207; color: #fff; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.data-status .pill.bad { background: var(--red); }

.layout { flex: 1; display: grid; grid-template-columns: 390px 1fr; min-height: 0; }
.panel { overflow-y: auto; padding: 16px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.map { min-height: 300px; }

.field { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; position: relative; }
.field-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0; }
input[type="text"], select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; min-height: 42px;
}
input[type="text"]:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; min-width: 0; }

.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 8px; padding: 9px 12px; min-height: 42px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }

/* Line icons (icons.js), drawn in the text colour */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.22em; }
.with-icon, .chip-label { display: inline-flex; align-items: center; gap: .35em; }
.ico.warn { color: #d97706; margin: 0 .1em; }
.stops .num .ico, .pin .ico { width: 13px; height: 13px; vertical-align: 0; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.whatsapp { background: #25d366; color: #052e16; border-color: #25d366; }
.btn.block { width: 100%; }
.plan-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 13.5px; }

.results { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); max-height: 220px; overflow-y: auto; }
.results li button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.results li button:hover, .results li button:focus { background: var(--surface-2); }
.place-title { display: block; font-weight: 600; }
.place-area { display: block; font-size: 12.5px; color: var(--muted); }
.input-row { position: relative; }
.input-row > .results { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 1500; }
.chosen { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chosen::before { content: "✓"; color: var(--accent); font-weight: 700; }

.help { font-size: 13.5px; color: var(--muted); }
.help summary { cursor: pointer; color: var(--text); font-weight: 500; }
.help ol { padding-left: 20px; margin: 8px 0; }
.help p { margin: 6px 0 0; }
.hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); }

/* The planner in three cards, so searching the map, planning a trip and the
   route options don't run into each other. */
.card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.card-title { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .ico { color: var(--accent); }
.explore-card { background: var(--surface-2); box-shadow: none; }
.explore-card .card-title .ico { color: var(--muted); }
.search-row input { border-radius: 999px; padding-left: 16px; }
.trip-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.route-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: 50%; color: #fff; font: 700 11px/1 system-ui, sans-serif; font-style: normal; margin-right: 4px;
  vertical-align: 1px; }
.route-badge.a { background: #2563eb; }
.route-badge.b { background: #0f172a; box-shadow: inset 0 0 0 1.5px #fff; }
.options-card .field-label { color: var(--text); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.avoid .hint, .when .hint { margin-top: 6px; }

.night-toggle { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 14px; cursor: pointer; }
.night-toggle input { margin-top: 3px; accent-color: var(--accent); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented label { display: flex; }
.segmented label > span { flex: 1; text-align: center; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 500; min-height: 42px; }
.segmented input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.r, .sq.r { background: #ef4444; } .dot.y, .sq.y { background: #facc15; } .sq.g { background: #4ade80; }
.sq.m { background: #a3e635; }
/* FADE's colours from app.js, one quarter per level; red deepens to the worst */
.fade-key { flex-basis: 100%; display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 3px;
  font-size: 11.5px; color: var(--muted); }
.fade-bar { grid-column: 1 / -1; height: 12px; border-radius: 3px;
  background: linear-gradient(90deg, #86efac, #bef264 25%, #fde047 50%, #fb923c 75%, #ef4444 83%, #b91c1c 92%, #7f1d1d); }
.fade-key span { border-left: 1px solid var(--muted); padding-left: 3px; white-space: nowrap; }
.sq.out { background: #0f172a; opacity: 0.45; }
.stations-toggle { display: flex; align-items: center; gap: 6px; flex-basis: 100%; cursor: pointer; }
.station-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #0f172a; background: #fff; display: inline-block; }
.coverage { flex-basis: 100%; font-size: 12.5px; }
.coverage summary { cursor: pointer; color: var(--text); }
.coverage p { margin: 6px 0 0; color: var(--muted); }
.about { flex-basis: 100%; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; }
.about h2 { margin: 0 0 4px; font-size: 13px; }
.about p { margin: 0 0 6px; color: var(--muted); }
.about details { margin-top: 4px; }
.about summary { cursor: pointer; }
.about summary h3 { display: inline; margin: 0; font-size: 12.5px; font-weight: 600; }
.about details p { margin: 4px 0 6px; }
.contact { flex-basis: 100%; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; }
.contact h3 { margin: 0 0 2px; font-size: 13px; }
.contact p { margin: 0 0 2px; color: var(--muted); }
.contact a { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.station-popup { min-width: 220px; font-size: 13px; }
.station-popup p { margin: 6px 0; }
.station-popup table { border-collapse: collapse; width: 100%; }
.station-popup td { padding: 2px 0; border-top: 1px solid #e2e8f0; }
.station-popup td:last-child { text-align: right; font-weight: 600; padding-left: 10px; }

.banner { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); }
.banner.error { background: var(--error-bg); color: var(--error-text); }

.result { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.result h2 { font-size: 17px; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.result p { margin: 0; }
.warnings { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.warnings li { background: var(--warn-bg); color: var(--warn-text); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.parts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.part { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.part.unclear { border-color: var(--yellow); }
.part-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.part-num { font-weight: 700; }
.part-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.part-route { font-size: 14px; margin: 2px 0 8px; overflow-wrap: anywhere; }
.part-links { display: flex; gap: 6px; }
.part-links .btn { flex: 1; }
.stops-box h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stops li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.stops .num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.stops .name { flex: 1; min-width: 0; }
.btn.remove { min-height: 30px; padding: 3px 10px; font-size: 13px; color: var(--error-text); background: var(--error-bg); border-color: transparent; }
.red-passages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.red-passages button { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  padding: 6px 8px 6px 10px; border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: 8px;
  background: var(--surface); font-size: 13px; }
.red-passages button:hover { background: var(--surface-2); }
.red-passages .where { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.share { display: flex; flex-direction: column; gap: 6px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.legend { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.legend p { flex-basis: 100%; margin: 0; }
.sq { width: 12px; height: 12px; display: inline-block; border-radius: 3px; margin-right: 5px; vertical-align: -1px; opacity: .8; }

.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 35%); }
.pin span { transform: rotate(45deg); color: #fff; font: 700 12px/1 system-ui, sans-serif; }
.pin.start { background: #2563eb; } .pin.end { background: #0f172a; } .pin.stop { background: var(--accent); }
.pin.via { background: #7c3aed; }
.stops .num.via { background: #7c3aed; }
.vias { display: flex; flex-direction: column; gap: 12px; }
.vias:empty { display: none; }
.add-via { align-self: flex-start; margin-top: -4px; }
.via-field .field-label { color: #7c3aed; }
/* Zones blend into the map ("multiply") so labels stay readable, and fade in. */
.zones-heat, .zones-crisp { mix-blend-mode: multiply; transition: opacity 0.4s ease; }
.zones-heat { filter: blur(2px); }
.zones-crisp { image-rendering: auto; }
.style-toggle { display: inline-flex; margin-left: auto; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.style-toggle button { font: inherit; font-size: 12.5px; padding: 4px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.style-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.map-popup { display: flex; flex-direction: column; gap: 6px; }
.route-popup { gap: 3px; font-size: 13px; }
.route-popup .where { font-weight: 700; font-size: 14px; }
.route-popup .zone { display: flex; align-items: center; gap: 6px; }
.route-popup .zone i { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 1px solid rgb(0 0 0 / 15%); }
.route-popup .why { margin-top: 4px; padding: 4px 0 4px 8px; border-left: 4px solid #dc2626; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 2000; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

.sheet-handle { display: none; }
.place-note { display: block; font-size: 12px; color: var(--warn-text); margin-top: 2px; }
.results .searching { padding: 8px; font-size: 13px; color: var(--muted); }
.chosen { flex-wrap: wrap; }
.chosen .chosen-note { flex-basis: 100%; color: var(--warn-text); font-size: 12px; }
.locate-control a { font-size: 17px; line-height: 30px; text-align: center; text-decoration: none; }
.locate-control a.busy { opacity: .5; }
.leaflet-marker-draggable .pin { cursor: grab; }
/* Long tooltips wrap instead of running off a phone screen. A tooltip opens on
   the side of its pin facing the map's middle, so half the width always fits. */
.leaflet-tooltip { white-space: normal; width: max-content; max-width: min(260px, calc(50vw - 32px)); }

/* Phones: the map fills the screen and the planner is a sheet over it,
   dragged up and down by its handle (peek, half, full). */
@media (max-width: 820px) {
  html, body { overflow: hidden; overscroll-behavior: none; }
  .topbar { padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); gap: 8px; }
  .brand { font-size: 15px; }
  .brand img { width: 22px; height: 22px; }
  .data-status { font-size: 11px; gap: 0 8px; }
  .data-status .st-next { display: none; }
  .layout { display: block; position: relative; }
  .map { position: absolute; inset: 0; z-index: 0; min-height: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 50%; max-height: 100%;
    border-right: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 24px rgb(15 23 42 / 22%);
    padding: 0 16px calc(16px + env(safe-area-inset-bottom)); overscroll-behavior: contain;
    transition: height .25s ease;
  }
  .panel.dragging { transition: none; }
  .panel[data-sheet="peek"] { overflow: hidden; }
  .sheet-handle {
    display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none;
    position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 8px 16px 10px;
    background: var(--surface); border-radius: 16px 16px 0 0; cursor: grab; touch-action: none; user-select: none;
  }
  .sheet-handle i { width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
  .sheet-handle span { font-weight: 600; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .panel[data-sheet="full"] .sheet-handle { border-bottom: 1px solid var(--border); }
  /* 16px stops iOS zooming in on the box you tap */
  input[type="text"], select, .areas-list input, .via-name { font-size: 16px; }
  .field, .result, .banner { scroll-margin-top: 64px; }
  .results { max-height: 40vh; }
  .results li button { padding: 10px 8px; }
  /* Plan stays in reach at the bottom of the sheet */
  .plan-row { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); z-index: 4; background: var(--surface);
    margin: 0 -16px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
  .panel[data-sheet="peek"] .plan-row, .panel.has-trip .plan-row { position: static; margin: 0; padding: 0; border: 0; }
  .toast { bottom: calc(var(--sheet-h, 0px) + 12px); }
  .leaflet-touch .leaflet-bar a { width: 36px; height: 36px; line-height: 36px; }
  .leaflet-popup-content { margin: 12px 14px; }
  /* a popup is nearly as wide as the screen: the map buttons step aside */
  .map.popup-open .leaflet-top.leaflet-left { opacity: 0; pointer-events: none; transition: opacity .2s; }
}

/* areas to avoid (drawn on the map) */
.areas-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.areas-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.areas-list li { display: flex; align-items: center; gap: 6px; }
.areas-list input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 14px; }
.area-swatch { width: 14px; height: 14px; flex: none; border: 2px dashed #7c3aed; background: rgb(124 58 237 / 0.15); border-radius: 3px; }
.areas-status { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.areas-status.error { color: #f87171; }
.map.drawing, .map.drawing .leaflet-interactive { cursor: crosshair !important; touch-action: none !important; }
.draw-control a { font-size: 16px; line-height: 30px; text-align: center; text-decoration: none; }
.draw-control a, .locate-control a, .contribute-control a { display: flex; align-items: center; justify-content: center; color: #0f172a; }
.draw-control a.active { background: #ede9fe; }
.draw-banner { display: flex; align-items: center; gap: 8px; background: #fff; color: #0f172a; padding: 6px 8px 6px 12px;
  border-radius: 8px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); font-size: 13px; font-weight: 600; }
.via-name { width: 100%; margin-top: 6px; padding: 6px 8px; font-size: 14px; }
.btn.rename { padding: 4px 8px; }
.stops-box h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* A police area's figures (and people's ratings), in the map and station popups */
.area-box { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.area-box p { margin: 0; }
.area-head { font-size: 13px; }
.area-police { margin-top: 4px !important; }
.area-error { color: #b91c1c; }

/* People's ratings: tracing roads, painting areas, reports, safe stops */
.contribute-open { font-weight: 600; white-space: normal; text-align: center; }
.panel.contributing > :not(.contribute):not(.sheet-handle) { display: none !important; }
.contribute { display: flex; flex-direction: column; gap: 12px; }
.contrib-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contrib-head h2 { margin: 0; font-size: 17px; }
.contrib-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.contrib-tools button { font: inherit; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center;
  gap: 2px; min-height: 64px; padding: 8px 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  color: var(--text); cursor: pointer; text-align: center; line-height: 1.2; }
.contrib-tools button span { font-size: 20px; display: inline-flex; }
.contrib-tools button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.contrib-body { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.contrib-body p { margin: 0; }
.contrib-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.contrib-actions .btn { flex: 1 1 auto; }
.chip-row { display: flex; flex-direction: column; gap: 4px; }
.chip-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.chip { font: inherit; font-size: 12px; font-weight: 600; min-height: 44px; padding: 4px 2px; line-height: 1.15; border-radius: 8px;
  border: 1px solid var(--border); border-bottom: 4px solid var(--lvl); background: var(--surface); color: var(--text); cursor: pointer; }
.chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.chip-ico { width: 15px; height: 15px; opacity: .85; }
.chip[aria-pressed="true"] { background: var(--lvl); border-color: var(--lvl); color: #fff; }
.lvl-1 { --lvl: #16a34a; } .lvl-2 { --lvl: #65a30d; } .lvl-3 { --lvl: #ca8a04; } .lvl-4 { --lvl: #ea580c; } .lvl-5 { --lvl: #991b1b; }
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kind { font: inherit; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.kind-icon { font-size: 20px; display: inline-flex; color: var(--muted); }
.kind[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.kind[aria-pressed="true"] .kind-icon { color: var(--accent); }
.place-pin { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 2px solid #2563eb; color: #2563eb; box-shadow: 0 1px 4px rgb(0 0 0 / .35); font-size: 14px; }
.place-pin.risky { border-color: #b91c1c; color: #b91c1c; }
.chips.n4 { grid-template-columns: repeat(4, 1fr); }
.place-ways { display: flex; flex-direction: column; gap: 6px; }
.place-way { text-align: left; }
.place-way-text { display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.place-way-text b { font-weight: 600; }
.picked-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.picked-piece { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 10px;
  border: 1px solid var(--border); border-radius: 8px; }
.picked-piece > span { min-width: 0; overflow-wrap: anywhere; }
.fuel-pin { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2px solid var(--c); color: var(--c); box-shadow: 0 1px 4px rgb(0 0 0 / .35); font-size: 13px; }
.fuel-box summary { cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.fuel-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fuel-item { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.fuel-head { display: flex; align-items: center; gap: 8px; }
.fuel-dot { display: inline-flex; color: var(--c); font-size: 18px; }
.fuel-rate { display: flex; flex-direction: column; gap: 8px; }
.fuel-popup { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.mine-head { margin: 4px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mine-item { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.mine-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.contribute-control a { font-size: 16px; line-height: 30px; text-align: center; text-decoration: none; }
.contrib-banner { flex-wrap: wrap; max-width: min(360px, calc(100vw - 80px)); user-select: none; -webkit-user-select: none; }
.contrib-banner > span { flex: 1 1 100%; }
.banner-buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.banner-buttons .btn { min-height: 40px; min-width: 40px; background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }
.banner-buttons .btn[aria-pressed="true"] { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.map.contributing, .map.contributing .leaflet-interactive { cursor: crosshair !important; touch-action: none !important; }
.map.picking { cursor: crosshair; }
.crowd-pin { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .4); font-size: 15px; color: #b91c1c; }
.crowd-pin.stop { width: 26px; height: 26px; font-size: 13px; border: 2px solid #16a34a; color: #15803d; }
.crowd-pin.faint { opacity: .55; }
.area-people { font-weight: 600; }
.people-key { display: inline-flex; width: 50px; height: 10px; border-radius: 3px; overflow: hidden; flex: none; }
.people-key b { flex: 1; }
.people-key .l1 { background: #16a34a; } .people-key .l2 { background: #84cc16; } .people-key .l3 { background: #eab308; }
.people-key .l4 { background: #f97316; } .people-key .l5 { background: #991b1b; }
@media (max-width: 420px) {
  .contrib-tools { grid-template-columns: repeat(2, 1fr); }
  .chip { font-size: 11px; }
}

/* Warnings on the way (onroute.js) */
.onroute-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.onroute-list .hazard { padding: 6px 8px; border-left: 4px solid #f97316; background: var(--surface-2); border-radius: 6px; }
.onroute-list .hazard.red { border-left-color: #b91c1c; }
.onroute-list .hazard.incident { border-left-color: #7c3aed; }
.onroute-banner { position: absolute; z-index: 1000; left: 60px; right: 12px; top: 12px; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: #7c2d12; color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 16px rgb(0 0 0 / .35); }
.onroute-banner .ico { width: 22px; height: 22px; }
.onroute-banner.red { background: #991b1b; }
.onroute-banner.incident { background: #5b21b6; }
.onroute-banner.ok { background: #166534; }
.onroute-banner.off { background: #1e293b; }

/* Privacy and terms pages */
.text-page { overflow: auto; }
.text-page .brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.text-main { max-width: 760px; margin: 0 auto; padding: 16px; }
.text-card { gap: 6px; line-height: 1.55; }
.text-card h1 { margin: 0 0 4px; font-size: 24px; }
.text-card h2 { margin: 14px 0 0; font-size: 17px; }
.text-card p, .text-card ul { margin: 0; }
.text-card a { color: var(--accent); }

/* The tour (tour.js) */
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour { position: fixed; z-index: 3000; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(420px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 10px 40px rgb(0 0 0 / .35); }
.tour p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; }
.tour-head .ico { color: var(--accent); }
.tour-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tour-ring { outline: 3px solid var(--accent) !important; outline-offset: 3px; border-radius: 12px;
  box-shadow: 0 0 0 9999px rgb(15 23 42 / .35); position: relative; z-index: 2; transition: box-shadow .2s; }
#map.tour-ring { outline-offset: -3px; box-shadow: none; }
@media (min-width: 821px) { .tour { left: auto; right: 24px; transform: none; } }
@media (max-width: 820px) { .tour { top: 64px; bottom: auto; } .tour-ring { scroll-margin-top: 230px; } }

/* Must-accept disclaimer before planning a route */
.disclaimer { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: 0 10px 40px rgb(0 0 0 / .35); }
.disclaimer::backdrop { background: rgb(15 23 42 / .55); }
.disclaimer h2 { margin: 0 0 10px; font-size: 18px; }
.disclaimer h2 .ico { color: var(--accent); }
.disclaimer p, .disclaimer li { font-size: 14.5px; line-height: 1.45; }
.disclaimer p { margin: 0 0 8px; }
.disclaimer ul { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.disclaimer a { color: var(--accent); }
.disclaimer-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 420px) { .disclaimer-actions .btn { flex: 1 1 100%; } .disclaimer-actions .primary { order: -1; } }
