/* ==========================================================================
   Waarning V4 — Atlas map surface (frontend/assets/map.js)

   Loaded after site.css. Rules are scoped to `.atlas-*` and the Leaflet popup
   class used by the map, so the homepage HUD, the cockpit rails and the feed
   keep their own styles. Tokens come from site.css; the fallbacks keep the map
   legible if it is ever loaded on a page without them.
   ========================================================================== */

.atlas-canvas {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.atlas-heat {
  opacity: 0.92;
}

/* Only unclustered P0 points get an animated ring. A handful of isolated
 * div-icon layers is far cheaper than animating a full-viewport surface. */
.atlas-pulse-marker {
  background: transparent;
  border: 0;
}

.atlas-pulse-ring {
  display: block;
  width: 12px;
  height: 12px;
  margin: 11px;
  border: 1.8px solid var(--p0, #b23a2b);
  border-radius: 50%;
  opacity: 0;
  transform-origin: center;
  pointer-events: none;
}

.atlas-pulse-ring.is-beating {
  animation: atlas-ping 0.95s cubic-bezier(0.2, 0.6, 0.35, 1) 1 forwards;
  will-change: transform, opacity;
}

@keyframes atlas-ping {
  0% {
    transform: scale(0.55);
    opacity: 0.62;
  }
  70% {
    transform: scale(1.95);
    opacity: 0;
  }
  100% {
    transform: scale(1.95);
    opacity: 0;
  }
}

/* ---------- Atlas control panel (pages without their own map chrome) ------ */

.atlas-hud {
  position: absolute;
  z-index: 12;
  left: 18px;
  top: 92px;
  width: 268px;
  max-width: calc(100vw - 24px);
  max-height: calc(100svh - 116px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  scrollbar-width: thin;
  color: var(--ink, #17231d);
  font-family: var(--sans, system-ui, sans-serif);
  -webkit-overflow-scrolling: touch;
}

.atlas-hud *,
.atlas-hud *::before,
.atlas-hud *::after {
  box-sizing: border-box;
}

.atlas-hud :focus-visible {
  outline: 2px solid var(--rust, #b7472a);
  outline-offset: 2px;
  border-radius: 4px;
}

.atlas-hud-bar {
  padding: 11px 12px 12px;
  border: 1px solid var(--line-strong, rgba(23, 35, 29, 0.38));
  border-radius: 14px;
  background: rgba(248, 242, 227, 0.985);
  box-shadow: 0 18px 44px rgba(49, 38, 20, 0.2), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.atlas-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 3px;
  font: 700 8px/1.2 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust, #b7472a);
}

.atlas-kicker small {
  margin-left: auto;
  font: 600 7px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.08em;
  color: var(--muted, #657064);
}

.atlas-live-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--rust, #b7472a);
  box-shadow: 0 0 0 3px rgba(183, 71, 42, 0.14);
}

.atlas-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: var(--ink, #17231d);
}

.atlas-count b {
  font: 600 27px/0.92 var(--display, "Bricolage Grotesque", sans-serif);
  letter-spacing: -0.055em;
}

.atlas-count span {
  font: 700 7px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #657064);
}

.atlas-sub {
  margin: 3px 0 0;
  font: 600 7.5px/1.45 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #657064);
}

.atlas-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 9px;
}

.atlas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 7px 5px;
  border: 1px solid var(--line-strong, rgba(23, 35, 29, 0.38));
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink, #17231d);
  font: 700 7.5px/1.1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.atlas-btn:hover {
  background: var(--ink, #17231d);
  border-color: var(--ink, #17231d);
  color: var(--paper-2, #f8f2e3);
}

.atlas-btn[aria-expanded="true"] {
  background: var(--ink, #17231d);
  border-color: var(--ink, #17231d);
  color: var(--paper-2, #f8f2e3);
}

.atlas-btn:disabled,
.atlas-btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: progress;
}

.atlas-btn--wide {
  width: 100%;
}

.atlas-status {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--line, rgba(23, 35, 29, 0.18));
  border-left: 3px solid var(--rust, #b7472a);
  border-radius: 8px;
  background: rgba(248, 242, 227, 0.92);
  font: 600 7.5px/1.45 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
  color: var(--ink-2, #2b3a31);
}

/* ---------- drawers ------------------------------------------------------- */

.atlas-panel {
  padding: 10px 11px 11px;
  border: 1px solid var(--line-strong, rgba(23, 35, 29, 0.38));
  border-radius: 12px;
  background: rgba(248, 242, 227, 0.98);
  box-shadow: 0 16px 38px rgba(49, 38, 20, 0.18);
  color: var(--ink, #17231d);
}

.atlas-panel[hidden] {
  display: none;
}

.atlas-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.atlas-panel-title {
  font: 700 8px/1.2 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.atlas-close {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted, #657064);
  font: 700 15px/1 var(--mono, ui-monospace, monospace);
  cursor: pointer;
}

.atlas-close:hover {
  background: rgba(23, 35, 29, 0.08);
  color: var(--ink, #17231d);
}

.atlas-panel-body {
  min-width: 0;
}

.atlas-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line, rgba(23, 35, 29, 0.18));
  cursor: pointer;
}

.atlas-check:last-of-type {
  border-bottom: 0;
}

.atlas-check input {
  width: 13px;
  height: 13px;
  flex: none;
  margin: 0;
  accent-color: var(--rust, #b7472a);
}

.atlas-check-label {
  min-width: 0;
  font: 600 8px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2, #2b3a31);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-check em {
  margin-left: auto;
  flex: none;
  font: 600 7.5px/1 var(--mono, ui-monospace, monospace);
  font-style: normal;
  letter-spacing: 0.03em;
  color: var(--muted, #657064);
}

.atlas-sym {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: none;
  background: var(--p4, #6e7163);
}

.atlas-sym.p0 {
  border-radius: 50%;
  background: var(--p0, #b23a2b);
  box-shadow: 0 0 0 2px rgba(178, 58, 43, 0.26);
}

.atlas-sym.p1 {
  background: var(--p1, #c27a1e);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.atlas-sym.p2 {
  width: 9px;
  height: 9px;
  margin: 0 1.5px;
  background: var(--p2, #2f6f68);
  transform: rotate(45deg);
}

.atlas-sym.p3 {
  background: var(--p3, #3d5d8a);
  border-radius: 1px;
}

.atlas-sym.p4 {
  width: 7px;
  height: 7px;
  margin: 0 2.5px;
  border-radius: 50%;
  background: var(--p4, #6e7163);
}

.atlas-sym.heat {
  width: 16px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--amber, #c27a1e), var(--rust, #b7472a));
  filter: blur(0.3px);
}

.atlas-sym.cluster {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink, #17231d);
  box-shadow: inset 0 0 0 2px rgba(248, 242, 227, 0.5);
}

.atlas-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--line, rgba(23, 35, 29, 0.18));
}

.atlas-panel-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 9px;
}

.atlas-note {
  margin: 7px 0 0;
  font: 500 7.5px/1.5 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
  color: var(--muted, #657064);
}

/* ---------- unplaced warnings (only when the mapped-only view is off) ----- */

.atlas-unplaced {
  margin: 6px 0 2px;
  padding: 7px 8px 8px;
  border: 1px dashed var(--line-strong, rgba(23, 35, 29, 0.38));
  border-radius: 8px;
  background: rgba(230, 218, 196, 0.45);
}

.atlas-unplaced[hidden] {
  display: none;
}

.atlas-unplaced b {
  display: block;
  font: 700 7.5px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink, #17231d);
}

.atlas-unplaced p {
  margin: 2px 0 5px;
  font: 500 9px/1.45 var(--sans, system-ui, sans-serif);
  color: var(--muted, #657064);
}

.atlas-unplaced-list {
  display: grid;
  gap: 1px;
}

.atlas-unplaced-list a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 8px/1.5 var(--mono, ui-monospace, monospace);
  color: var(--ink-2, #2b3a31);
  text-decoration: none;
}

.atlas-unplaced-list a:hover {
  color: var(--rust, #b7472a);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.atlas-unplaced-more {
  display: inline-block;
  margin-top: 5px;
  font: 700 7px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rust, #b7472a);
  text-decoration: none;
}

.atlas-unplaced-more:hover {
  color: var(--rust-dark, #8e321d);
}

/* ---------- legend -------------------------------------------------------- */

.atlas-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 9px;
  margin: 3px 0 8px;
}

.atlas-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 7.5px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-2, #2b3a31);
}

.atlas-legend-link {
  display: inline-block;
  margin-top: 7px;
  font: 700 7.5px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rust, #b7472a);
  text-decoration: none;
}

.atlas-legend-link:hover {
  color: var(--ink, #17231d);
}

.atlas-credit {
  margin: 6px 0 0;
  font: 500 6.5px/1.4 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
  color: var(--soft, #8b9182);
}

/* ---------- rich popup ---------------------------------------------------- */

.atlas-popup .leaflet-popup-content-wrapper {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong, rgba(23, 35, 29, 0.38));
  border-radius: 13px;
  background: var(--paper-2, #f8f2e3);
  color: var(--ink, #17231d);
  box-shadow: 0 20px 48px rgba(49, 38, 20, 0.28);
}

.atlas-popup .leaflet-popup-content {
  max-width: min(340px, calc(100vw - 56px));
  margin: 0;
  line-height: 1.45;
}

.atlas-popup .leaflet-popup-tip {
  background: var(--paper-2, #f8f2e3);
  box-shadow: none;
}

.atlas-popup a.leaflet-popup-close-button {
  width: 24px;
  height: 24px;
  padding: 6px 7px 0 0;
  color: var(--muted, #657064) !important;
  font: 400 18px/18px var(--sans, system-ui, sans-serif);
  text-align: center;
}

.atlas-popup a.leaflet-popup-close-button:hover {
  color: var(--ink, #17231d) !important;
}

.atlas-popup a {
  text-decoration: none;
}

.atlas-pop {
  --cat: #8a6f4d;
  min-width: 208px;
  padding: 11px 13px 12px;
  box-shadow: inset 0 3px 0 var(--cat);
  color: var(--ink, #17231d);
  font: 12px/1.45 var(--sans, system-ui, sans-serif);
}

.atlas-pop-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 5px;
  padding-right: 16px;
}

.atlas-pri {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 17px;
  flex: none;
  padding: 0 5px;
  border-radius: 3px;
  color: #fff;
  font: 800 8px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
}

.atlas-pri.P0 { background: var(--p0, #b23a2b); }
.atlas-pri.P1 { background: var(--p1, #c27a1e); }
.atlas-pri.P2 { background: var(--p2, #2f6f68); }
.atlas-pri.P3 { background: var(--p3, #3d5d8a); }
.atlas-pri.P4 { background: var(--p4, #6e7163); }

.atlas-pop-cat {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cat);
  font: 700 7px/1.2 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.atlas-pop-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin-bottom: 4px;
  padding-right: 8px;
  color: var(--ink, #17231d);
  font: 600 14px/1.18 var(--display, "Bricolage Grotesque", sans-serif);
  letter-spacing: -0.01em;
}

.atlas-pop-title:hover {
  color: var(--rust, #b7472a);
}

.atlas-pop-sum {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 7px;
  color: var(--ink-2, #2b3a31);
  font: 11px/1.4 var(--sans, system-ui, sans-serif);
}

.atlas-pop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 7px;
  min-width: 0;
  color: var(--muted, #657064);
  font: 600 7px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.atlas-pop-meta b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink, #17231d);
  font-weight: 700;
}

.atlas-pop-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(183, 71, 42, 0.35);
  color: var(--rust, #b7472a);
  font: 700 7.5px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.atlas-pop-cta:hover {
  color: var(--rust-dark, #8e321d);
}

.atlas-pop--cluster .atlas-pop-kicker {
  margin: 0 0 2px;
  color: var(--cat);
  font: 700 8px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.atlas-pop-hint {
  margin: 0 0 6px;
  color: var(--muted, #657064);
  font: 500 9.5px/1.4 var(--sans, system-ui, sans-serif);
}

.atlas-pop-rows {
  display: grid;
  border-top: 1px solid var(--line, rgba(23, 35, 29, 0.18));
}

.atlas-pop-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line, rgba(23, 35, 29, 0.18));
  color: inherit;
}

.atlas-pop-row:last-child {
  border-bottom: 0;
}

.atlas-pop-row .atlas-pri {
  margin-top: 1px;
}

.atlas-pop-row-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.atlas-pop-row-body strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--ink, #17231d);
  font: 600 11.5px/1.25 var(--display, "Bricolage Grotesque", sans-serif);
}

.atlas-pop-row:hover .atlas-pop-row-body strong {
  color: var(--rust, #b7472a);
}

.atlas-pop-row-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #657064);
  font: 600 6.5px/1.35 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.atlas-pop-more {
  display: inline-block;
  margin-top: 7px;
  color: var(--rust, #b7472a);
  font: 700 7px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* The cockpit darkens its map stage; keep the popup legible there too. */
body.app .atlas-popup .leaflet-popup-content-wrapper {
  border-color: rgba(239, 230, 212, 0.3);
  background: #131d18;
  color: #f3ecdd;
}

body.app .atlas-popup .leaflet-popup-tip {
  background: #131d18;
}

body.app .atlas-popup a.leaflet-popup-close-button {
  color: #9aa799 !important;
}

body.app .atlas-popup a.leaflet-popup-close-button:hover {
  color: #f3ecdd !important;
}

body.app .atlas-pop,
body.app .atlas-pop-title,
body.app .atlas-pop-row-body strong,
body.app .atlas-pop-meta b {
  color: #f3ecdd;
}

body.app .atlas-pop-sum {
  color: #c8d0c2;
}

body.app .atlas-pop-meta,
body.app .atlas-pop-hint {
  color: #9aa799;
}

body.app .atlas-pop-cat {
  color: var(--cat);
  color: color-mix(in srgb, var(--cat) 55%, #f3ecdd);
}

body.app .atlas-pop-rows,
body.app .atlas-pop-row {
  border-color: rgba(239, 230, 212, 0.18);
}

body.app .atlas-pop-row-body small {
  color: #9aa799;
}

body.app .atlas-pop-cta,
body.app .atlas-pop-more {
  color: #e6a83f;
  border-color: rgba(230, 168, 63, 0.4);
}

/* ---------- mobile: compact sheet ---------------------------------------- */

@media (max-width: 760px) {
  .atlas-hud {
    position: fixed;
    z-index: 60;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    top: auto;
    width: auto;
    max-width: none;
    max-height: calc(100svh - 96px);
    gap: 4px;
  }

  .atlas-hud-bar {
    padding: 9px 10px 9px;
    border-radius: 13px;
  }

  .atlas-kicker {
    margin-bottom: 1px;
  }

  .atlas-count {
    display: inline-flex;
    margin: 0;
  }

  .atlas-count b {
    font-size: 22px;
  }

  .atlas-sub {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .atlas-actions {
    gap: 5px;
    margin-top: 7px;
  }

  .atlas-btn {
    min-height: 42px;
    padding: 8px 4px;
    font-size: 7.5px;
    touch-action: manipulation;
  }

  .atlas-status {
    padding: 6px 8px;
    font-size: 7px;
  }

  .atlas-panel {
    max-height: min(50svh, 430px);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .atlas-panel-actions {
    grid-template-columns: 1fr 1fr;
  }

  .atlas-panel-actions .atlas-btn {
    min-height: 38px;
  }

  .atlas-legend-grid {
    gap: 7px 8px;
  }

  .atlas-check {
    padding: 8px 0;
  }

  .atlas-popup .leaflet-popup-content-wrapper {
    max-width: calc(100vw - 44px);
  }

  .atlas-popup .leaflet-popup-content {
    max-width: calc(100vw - 46px);
  }

  .atlas-pop {
    max-width: calc(100vw - 74px);
    padding: 10px 11px 11px;
  }

  .atlas-pop-title {
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .atlas-hud {
    left: 6px;
    right: 6px;
  }

  .atlas-btn {
    font-size: 7px;
    letter-spacing: 0.03em;
  }

  .atlas-count b {
    font-size: 20px;
  }

  .atlas-legend-item {
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-pulse-ring {
    animation: none;
    opacity: 0.35;
  }

  .atlas-btn {
    transition: none;
  }
}

/* ==========================================================================
   V4 MapLibre Atlas
   The Liberty vector style supplies roads, relief, labels and 3D buildings.
   These rules keep the chrome quiet and editorial: parchment controls, paper
   popups and typographic annotations rather than geometric marker bubbles.
   ========================================================================== */

.maplibregl-map {
  background: #e9e1cf;
  font-family: var(--sans, "Manrope", system-ui, sans-serif);
}
.maplibregl-canvas {
  outline: none;
  filter: sepia(.04) saturate(.92) contrast(.99);
}
.maplibregl-ctrl-top-right {
  top: 84px;
  right: 10px;
}
.maplibregl-ctrl-group {
  border: 1px solid var(--line-strong, rgba(23,35,29,.38)) !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(49,38,20,.16) !important;
  background: var(--paper-2, #f8f2e3) !important;
}
.maplibregl-ctrl-group button {
  width: 33px;
  height: 33px;
  background: var(--paper-2, #f8f2e3) !important;
  color: var(--ink, #17231d) !important;
  border-bottom: 1px solid var(--line, rgba(23,35,29,.18)) !important;
}
.maplibregl-ctrl-group button:last-child { border-bottom: 0 !important; }
.maplibregl-ctrl-group button:hover { background: #fffaf0 !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: none; }
.maplibregl-ctrl-attrib {
  background: rgba(248,242,227,.88) !important;
  border-radius: 6px 0 0 0;
  font: 8px var(--mono, ui-monospace, monospace) !important;
  color: var(--muted, #657064) !important;
  padding: 3px 6px !important;
}
.maplibregl-ctrl-attrib a { color: var(--teal, #2f6f68) !important; }
.maplibregl-ctrl-scale {
  background: rgba(248,242,227,.82) !important;
  border-color: rgba(23,35,29,.35) !important;
  color: var(--muted, #657064) !important;
  font: 8px var(--mono, ui-monospace, monospace) !important;
}

/* Popup: a paper note, not a tooltip bubble. */
.atlas-maplibre-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: 12px;
  background: var(--paper-2, #f8f2e3);
  border: 1px solid var(--line-strong, rgba(23,35,29,.38));
  box-shadow: 0 18px 48px rgba(49,38,20,.26);
  overflow: hidden;
}
.atlas-maplibre-popup .maplibregl-popup-tip {
  border-top-color: var(--paper-2, #f8f2e3);
  border-bottom-color: var(--paper-2, #f8f2e3);
}
.atlas-maplibre-popup .maplibregl-popup-close-button {
  width: 26px;
  height: 26px;
  top: 4px;
  right: 4px;
  border-radius: 50%;
  color: var(--muted, #657064);
  font-size: 17px;
  line-height: 22px;
  background: transparent;
}
.atlas-maplibre-popup .maplibregl-popup-close-button:hover {
  background: rgba(23,35,29,.06);
  color: var(--ink, #17231d);
}

.atlas-note {
  padding: 13px 14px 12px;
  color: var(--ink, #17231d);
  border-left: 3px solid var(--atlas-color, #3d5d8a);
}
.atlas-note-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 5px;
  font: 700 7.5px/1.2 var(--mono, ui-monospace, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #657064);
}
.atlas-note-kicker b {
  color: #fff;
  background: var(--atlas-color, #3d5d8a);
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 7.5px;
}
.atlas-note-kicker time { margin-left: auto; white-space: nowrap; }
.atlas-note h3 {
  margin: 0 0 5px;
  font: 500 16px/1.18 var(--display, "Bricolage Grotesque", sans-serif);
  letter-spacing: -.02em;
}
.atlas-note p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ink-2, #2b3a31);
}
.atlas-note footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line, rgba(23,35,29,.18));
  margin-top: 9px;
  padding-top: 7px;
  font: 600 7px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted, #657064);
}
.atlas-note footer a {
  color: var(--rust, #b7472a);
  font-weight: 700;
  white-space: nowrap;
}

body.app .maplibregl-ctrl-group {
  background: #1b231f !important;
  border-color: rgba(248,242,227,.25) !important;
}
body.app .maplibregl-ctrl-group button {
  background: #1b231f !important;
  color: #efe6d4 !important;
  border-bottom-color: rgba(248,242,227,.14) !important;
}
body.app .maplibregl-ctrl-group button:hover { background: #27342d !important; }
body.app .maplibregl-ctrl-attrib {
  background: rgba(12,18,15,.82) !important;
  color: rgba(248,242,227,.62) !important;
}
body.app .maplibregl-ctrl-scale { display: none; }
body.app .atlas-maplibre-popup .maplibregl-popup-content {
  background: #151d19;
  border-color: rgba(248,242,227,.25);
}
body.app .atlas-maplibre-popup .maplibregl-popup-tip {
  border-top-color: #151d19;
  border-bottom-color: #151d19;
}
body.app .atlas-note { color: #f8f2e3; border-left-color: var(--atlas-color, #3d5d8a); }
body.app .atlas-note h3 { color: #f8f2e3; }
body.app .atlas-note p { color: rgba(248,242,227,.72); }
body.app .atlas-note footer { border-top-color: rgba(248,242,227,.14); color: rgba(248,242,227,.55); }
body.app .atlas-note-kicker { color: rgba(248,242,227,.62); }

@media (max-width: 620px) {
  .maplibregl-ctrl-top-right { top: 70px; right: 6px; }
  .maplibregl-ctrl-group button { width: 30px; height: 30px; }
  .atlas-note { padding: 11px 12px 10px; }
  .atlas-note h3 { font-size: 15px; }
}

/* Situation support in the map note. */
.atlas-note-support{margin:5px 0 0!important;font:700 7.5px/1.3 var(--mono,ui-monospace,monospace)!important;letter-spacing:.04em;text-transform:uppercase;color:var(--rust,#b7472a)!important}
body.app .atlas-note-support{color:#e6a83f!important}

/* ==========================================================================
   Atlas personalisation
   The map owns two controls (recentre + layers). Everything they remember
   lives in localStorage under `waarning.you.map.*`; nothing leaves the tab.
   ========================================================================== */

.atlas-ctl[hidden] {
  display: none;
}

.atlas-ctl-btn {
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.atlas-ctl-btn svg {
  pointer-events: none;
}

.atlas-ctl-btn:focus-visible {
  outline: 2px solid var(--rust, #b7472a);
  outline-offset: -3px;
}

body.app .atlas-ctl-btn:focus-visible {
  outline-color: var(--ck-watch, #e6a83f);
}

/* ---------- layers sheet -------------------------------------------------- */

.atlas-sheet {
  position: absolute;
  z-index: 620;
  top: 196px;
  right: 10px;
  width: min(236px, calc(100vw - 20px));
  max-height: calc(100% - 206px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 11px 12px 12px;
  border: 1px solid var(--line-strong, rgba(23, 35, 29, 0.38));
  border-radius: 12px;
  background: rgba(248, 242, 227, 0.985);
  box-shadow: 0 16px 38px rgba(49, 38, 20, 0.22);
  color: var(--ink, #17231d);
  font-family: var(--sans, system-ui, sans-serif);
  -webkit-overflow-scrolling: touch;
}

.atlas-sheet[hidden] {
  display: none;
}

.atlas-sheet *,
.atlas-sheet *::before,
.atlas-sheet *::after {
  box-sizing: border-box;
}

.atlas-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.atlas-sheet-head b {
  font: 700 8px/1.2 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.atlas-sheet-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted, #657064);
  font: 700 16px/1 var(--mono, ui-monospace, monospace);
  cursor: pointer;
}

.atlas-sheet-close:hover {
  background: rgba(23, 35, 29, 0.08);
  color: var(--ink, #17231d);
}

/* Five priority chips, typographic only: the letter is the marker. */
.atlas-sheet-chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 4px;
}

.atlas-chip {
  --chip: var(--p4, #6e7163);
  position: relative;
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 42px;
  padding: 5px 1px 4px;
  border: 1px solid var(--line, rgba(23, 35, 29, 0.18));
  border-radius: 8px;
  background: #fffaf0;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.atlas-chip--P0 { --chip: var(--p0, #b23a2b); }
.atlas-chip--P1 { --chip: var(--p1, #c27a1e); }
.atlas-chip--P2 { --chip: var(--p2, #2f6f68); }
.atlas-chip--P3 { --chip: var(--p3, #3d5d8a); }
.atlas-chip--P4 { --chip: var(--p4, #6e7163); }

.atlas-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  pointer-events: none;
}

.atlas-chip span {
  font: 700 9.5px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
  color: var(--muted, #657064);
}

.atlas-chip em {
  font: 600 7px/1 var(--mono, ui-monospace, monospace);
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--soft, #8b9182);
}

.atlas-chip:hover {
  border-color: var(--line-strong, rgba(23, 35, 29, 0.38));
}

.atlas-chip:has(input:checked) {
  border-color: var(--line-strong, rgba(23, 35, 29, 0.42));
  background: #fffdf7;
  box-shadow: inset 0 -2px 0 var(--chip);
}

.atlas-chip input:checked ~ span {
  color: var(--chip);
}

.atlas-chip input:checked ~ em {
  color: var(--ink-2, #2b3a31);
}

.atlas-chip:has(input:focus-visible) {
  outline: 2px solid var(--rust, #b7472a);
  outline-offset: 1px;
}

.atlas-chip input:focus-visible ~ span {
  outline: 2px solid var(--rust, #b7472a);
  outline-offset: 2px;
}

.atlas-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 0;
  border-top: 1px dotted var(--line, rgba(23, 35, 29, 0.18));
  font: 600 8px/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2, #2b3a31);
  cursor: pointer;
}

.atlas-row input {
  width: 14px;
  height: 14px;
  flex: none;
  margin: 0;
  accent-color: var(--rust, #b7472a);
}

.atlas-row-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-row em {
  margin-left: auto;
  flex: none;
  font: 600 7px/1 var(--mono, ui-monospace, monospace);
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--muted, #657064);
}

.atlas-sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--line, rgba(23, 35, 29, 0.18));
  font: 500 7px/1.35 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
  color: var(--muted, #657064);
}

.atlas-sheet-reset {
  flex: none;
  min-height: 30px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--rust, #b7472a);
  font: 700 7px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.atlas-sheet-reset:hover {
  color: var(--rust-dark, #8e321d);
}

/* ---------- saved place note ---------------------------------------------- */

.atlas-note--home {
  border-left-color: #b7472a;
}

.atlas-note--home h3 {
  font-size: 17px;
}

.atlas-note-btn {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid rgba(183, 71, 42, 0.4);
  background: transparent;
  color: var(--rust, #b7472a);
  font: 700 7.5px/1.2 var(--mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.atlas-note-btn:hover {
  color: var(--rust-dark, #8e321d);
}

body.app .atlas-note--home {
  color: #f8f2e3;
}

body.app .atlas-note-btn {
  color: #e6a83f;
  border-bottom-color: rgba(230, 168, 63, 0.45);
}

/* ---------- cockpit dark stage -------------------------------------------- */

body.app .atlas-sheet {
  border-color: rgba(239, 230, 212, 0.28);
  background: rgba(19, 29, 24, 0.97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  color: #f3ecdd;
}

body.app .atlas-sheet-head b {
  color: #f3ecdd;
}

body.app .atlas-sheet-close {
  color: #9aa799;
}

body.app .atlas-sheet-close:hover {
  background: rgba(239, 230, 212, 0.1);
  color: #f3ecdd;
}

body.app .atlas-chip {
  border-color: rgba(239, 230, 212, 0.16);
  background: rgba(26, 38, 31, 0.9);
}

body.app .atlas-chip span {
  color: #9aa799;
}

body.app .atlas-chip em {
  color: #7b8a7b;
}

body.app .atlas-chip:has(input:checked) {
  border-color: rgba(239, 230, 212, 0.34);
  background: rgba(38, 52, 44, 0.96);
}

body.app .atlas-chip input:checked ~ span {
  color: var(--chip);
  color: color-mix(in srgb, var(--chip) 62%, #f3ecdd);
}

body.app .atlas-chip input:checked ~ em {
  color: #c8d0c2;
}

body.app .atlas-chip:has(input:focus-visible) {
  outline-color: var(--ck-watch, #e6a83f);
}

body.app .atlas-row {
  border-top-color: rgba(239, 230, 212, 0.14);
  color: #c8d0c2;
}

body.app .atlas-row em {
  color: #7b8a7b;
}

body.app .atlas-sheet-foot {
  border-top-color: rgba(239, 230, 212, 0.14);
  color: #7b8a7b;
}

body.app .atlas-sheet-reset {
  color: #e6a83f;
}

/* The wide cockpit keeps its rails over the map; a floating sheet there would
 * sit under the right rail, so the layer control is offered on the compact
 * layouts where the map is its own card. */
@media (min-width: 1280px) {
  body.app .atlas-ctl--layers {
    display: none;
  }
}

/* ---------- phones: the sheet docks to the bottom of the map --------------- */

@media (max-width: 760px) {
  .atlas-sheet {
    top: auto;
    left: 6px;
    right: 6px;
    bottom: 6px;
    width: auto;
    max-height: calc(100% - 54px);
    padding: 10px 11px 9px;
    border-radius: 13px;
  }

  .atlas-chip {
    min-height: 46px;
    padding: 6px 1px 5px;
  }

  .atlas-chip span {
    font-size: 10px;
  }

  .atlas-row {
    min-height: 44px;
    padding: 7px 0;
    font-size: 8.5px;
  }

  .atlas-row input {
    width: 17px;
    height: 17px;
  }

  .atlas-sheet-close {
    width: 40px;
    height: 40px;
    margin: -6px -4px -6px 0;
    font-size: 19px;
  }

  .atlas-sheet-reset {
    min-height: 40px;
    padding: 6px 2px;
  }

  .atlas-sheet-foot {
    font-size: 7px;
  }

  .atlas-ctl-btn {
    min-width: 38px;
    min-height: 38px;
  }
}

@media (max-width: 380px) {
  .atlas-chip span {
    font-size: 9px;
  }

  .atlas-chip em {
    font-size: 6.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-chip {
    transition: none;
  }
}
