/* Glassing Data. Tokens and parts are the design contract in docs/design.md; a value
   changes there and here in the same commit. Dark only. */

:root {
  --ground: #141710;
  --header: #181b14;
  --surface: #1c2017;
  --raised: #242920;
  --glass: rgba(39, 43, 33, 0.62);
  --bone: #f0ece2;
  --body: rgba(240, 236, 226, 0.78);
  --muted: rgba(240, 236, 226, 0.6);
  --rule: rgba(240, 236, 226, 0.1);
  --rule-surface: rgba(240, 236, 226, 0.13);
  --rule-strong: rgba(240, 236, 226, 0.22);
  --ember: #ff5e00;
  --ember-text: #ff8a4c;
  --local: #ff5cc8;
  --closure: #ff5b55;
  --fire: #ff8c6e;
  --allowed: #9cc4a4;
  --caution: #e8b04a;
  --tint-closure: #ffb3ad;
  --tint-allowed: #c6e0cb;
  --tint-ember: #ffb08a;
  --tint-caution: #f3d08e;

  --display: "Newsreader", Georgia, serif;
  --label: "Varela Round", -apple-system, system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  color-scheme: dark;
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: rgba(255, 94, 0, 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ember-text);
  text-decoration-color: var(--ember-text);
}

:focus-visible {
  outline: 2px solid var(--ember-text);
  outline-offset: 2px;
}

p {
  margin: 0;
}

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

.data {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Header */

.site-header {
  position: relative;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--header);
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-wordmark {
  margin-top: 1px;
}

.brand-pill {
  padding: 1px 8px;
  border: 1px solid var(--ember);
  border-radius: 999px;
  color: var(--ember-text);
  font: 11px/16px var(--label);
}

.site-search {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.site-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.site-search input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 34px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--raised);
  color: var(--bone);
  font: 14px var(--sans);
}

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

.site-search input:focus {
  border-color: var(--ember);
  outline: none;
}

.site-search-key {
  position: absolute;
  top: 50%;
  right: 10px;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  color: var(--muted);
  font: 11px/16px var(--mono);
  text-align: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.site-search input:focus ~ .site-search-key {
  display: none;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font: 13px var(--label);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--bone);
}

.site-nav a[aria-current="page"] {
  background: var(--raised);
  color: var(--bone);
}

/* Place search suggestions (header and trip search) */

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 1200;
  padding: 4px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.search-result {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--raised);
  outline: none;
}

.search-result strong {
  display: block;
  color: var(--bone);
  font-size: 14px;
  font-weight: 500;
}

.search-result span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

/* Three columns: sidebar, main, rail; the footer sits under main */

.layout {
  display: grid;
  grid-template-areas:
    "side main rail"
    "side foot rail";
  grid-template-columns: 260px minmax(0, 880px) 250px;
  grid-template-rows: auto 1fr;
  gap: 40px;
  justify-content: center;
  max-width: 1520px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

.main {
  grid-area: main;
  min-width: 0;
}

.sidebar,
.rail {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Sidebar */

.sidebar {
  grid-area: side;
  padding-bottom: 24px;
}

.sidebar-label,
.rail-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--muted);
  font: 12px var(--label);
}

.sidebar ul,
.rail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar ul {
  margin-bottom: 12px;
}

/* One collapsible group a state; only the current area's state starts open. */
.sidebar-group summary {
  min-height: 32px;
  margin: 0;
  padding: 0 8px;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}

.sidebar-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-group summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.sidebar-group[open] summary::after {
  transform: rotate(45deg);
}

.sidebar-group summary:hover {
  background: var(--surface);
  color: var(--bone);
}

.sidebar-count {
  color: var(--muted);
  font-size: 11px;
}

.sidebar a {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--body);
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
}

.sidebar a:hover {
  background: var(--surface);
  color: var(--bone);
}

.sidebar a[aria-current="page"] {
  background: rgba(255, 94, 0, 0.12);
  color: var(--bone);
}

.sidebar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-status {
  color: var(--muted);
  font: 11px var(--label);
  white-space: nowrap;
}

/* Rail */

.rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 24px;
  font-size: 13px;
}

.rail-toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  text-decoration: none;
}

.rail-toc a:hover {
  color: var(--bone);
}

.rail-toc a.is-current {
  border-left-color: var(--ember);
  color: var(--bone);
}

.rail-changes li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.rail-changes li:first-child {
  padding-top: 0;
}

.rail-change-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rail-change-head a {
  text-decoration: none;
}

.rail-change-head .data,
.rail-change-move {
  color: var(--muted);
}

.rail-changes > p {
  margin-top: 10px;
}

.rail-app {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-app img {
  width: 16px;
  height: 12px;
}

.rail-app p:not(.rail-label) {
  color: var(--body);
}

.rail-app-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  color: var(--ember-text);
  font: 13px var(--label);
  text-decoration: none;
}

.rail-app-link:hover {
  color: var(--tint-ember);
  text-decoration: underline;
}

/* Page head */

.crumb {
  color: var(--muted);
  font: 12px var(--label);
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--bone);
}

h1 {
  margin: 6px 0 10px;
  color: var(--bone);
  font: 500 clamp(34px, 4vw, 46px)/1.08 var(--display);
  letter-spacing: -0.01em;
}

.lede {
  max-width: 640px;
  color: var(--body);
  font-size: 15px;
}

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

/* Status shapes */

.mark {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mark-allowed {
  border: 2px solid var(--allowed);
}

.mark-restricted {
  background: var(--ember);
}

.mark-caution {
  width: 8px;
  height: 8px;
  margin: 1px;
  border-radius: 1px;
  background: var(--caution);
  transform: rotate(45deg);
}

.mark-unknown {
  border: 1.5px dashed var(--muted);
}

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font: 12px/18px var(--label);
  white-space: nowrap;
}

.pill-restricted {
  background: rgba(255, 94, 0, 0.15);
  color: var(--tint-ember);
}

.pill-allowed {
  background: rgba(156, 196, 164, 0.14);
  color: var(--tint-allowed);
}

.pill-caution {
  background: rgba(232, 176, 74, 0.15);
  color: var(--tint-caution);
}

.pill-unknown {
  background: var(--raised);
  color: var(--muted);
}

/* Status block */

.status-block {
  margin: 28px 0 0;
  padding: 20px 24px;
  border: 1px solid var(--rule-surface);
  border-radius: 12px;
  background: var(--surface);
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.status-answer {
  color: var(--bone);
  font: 500 30px/1.15 var(--display);
}

.status-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px 24px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule-surface);
}

.facts dt {
  color: var(--muted);
  font: 11px var(--label);
}

.facts dd {
  margin: 2px 0 0;
  color: var(--bone);
  font-size: 13px;
}

.facts .facts-wide {
  grid-column: span 2;
}

.facts .facts-full {
  grid-column: 1 / -1;
}

/* Sections */

.section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 16px;
}

.section h2 {
  margin: 0 0 12px;
  color: var(--bone);
  font: 500 22px/1.25 var(--display);
}

.hash {
  margin-right: 8px;
  color: var(--muted);
  font: 16px var(--mono);
}

.count {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
}

.section-meta,
.caption,
.map-status {
  color: var(--muted);
  font-size: 12px;
}

.section-lede {
  margin-bottom: 14px;
  color: var(--bone);
  font-size: 15px;
}

.caption {
  margin-top: 10px;
}

.map-status:empty {
  display: none;
}

.map-status {
  margin-top: 8px;
}

.empty,
.more {
  color: var(--muted);
  font-size: 14px;
}

.more {
  margin-top: 14px;
}

.about p {
  max-width: 640px;
}

.credits {
  margin-top: 24px;
  padding-top: 12px;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

thead th {
  padding-top: 0;
  border-bottom-color: var(--surface);
  color: var(--muted);
  font: 400 12px var(--label);
  white-space: nowrap;
}

tbody th {
  min-width: 200px;
  font-weight: 400;
}

.num {
  text-align: right;
}

thead th.num {
  text-align: right;
}

.row-title {
  display: block;
  color: var(--bone);
  font-size: 14px;
  font-weight: 500;
}

a.row-title {
  text-decoration: none;
}

a.row-title:hover {
  color: var(--ember-text);
}

.row-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.row-meta span + span::before,
.row-meta a + span::before {
  content: " · ";
}

.row-note {
  display: block;
  margin-top: 4px;
  color: var(--body);
  font-size: 13px;
}

.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bone);
  white-space: nowrap;
}

/* Fire-use chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font: 12px/16px var(--label);
  white-space: nowrap;
}

.chip-prohibited {
  background: rgba(255, 91, 85, 0.15);
  color: var(--tint-closure);
}

.chip-allowed {
  background: rgba(156, 196, 164, 0.14);
  color: var(--tint-allowed);
}

.chip-limited {
  background: rgba(232, 176, 74, 0.15);
  color: var(--tint-caution);
}

/* Typical lows */

.lows {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--bone);
  white-space: nowrap;
}

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

/* On a status block the lows read as words, in body type (Kyle, 2026-10-08): one line
   with dots between readings on a wide screen, one reading a line on a phone. */

.lows-line {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  color: var(--body);
  font-size: 14px;
  line-height: 1.6;
}

.lows-temp {
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 641px) {
  .lows-line {
    display: flex;
    flex-wrap: wrap;
  }

  .lows-line li + li::before {
    margin: 0 10px;
    color: var(--muted);
    content: "·";
    content: "·" / "";
  }
}

/* Wildfire */

.wildfire h2 .hash {
  color: var(--fire);
}

.wildfire .section-lede {
  color: var(--bone);
}

.wildfire-minor h2 .hash {
  color: var(--muted);
}

/* Recent changes */

.changes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.change {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.change:first-child {
  padding-top: 0;
}

.change-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.change-direction {
  font: 12px var(--label);
}

.change-transition {
  margin-top: 4px;
  color: var(--bone);
  font-size: 13px;
}

.change-from,
.change-arrow {
  color: var(--muted);
}

.change-to-tightened {
  color: var(--tint-closure);
}

.change-to-eased {
  color: var(--tint-allowed);
}

.change-to-first,
.change-to-updated {
  color: var(--muted);
}

.change-summary {
  max-width: 640px;
  margin: 6px 0 4px;
  font-size: 14px;
}

/* Before you go */

.before-you-go {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  padding: 16px 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  scroll-margin-top: 16px;
}

.before-you-go svg {
  flex: none;
  margin-top: 2px;
  color: var(--muted);
}

.before-you-go h2 {
  margin: 0 0 4px;
  color: var(--bone);
  font: 400 13px var(--label);
}

.before-you-go p {
  font-size: 14px;
}

/* Trip search */

.search-large {
  position: relative;
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin-top: 24px;
}

.search-large input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--raised);
  color: var(--bone);
  font: 16px var(--sans);
}

.search-large input:focus {
  border-color: var(--ember);
  outline: none;
}

.search-large button {
  min-width: 96px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--ember);
  color: var(--ground);
  font: 15px var(--label);
  cursor: pointer;
}

.search-large button:hover {
  background: var(--ember-text);
}

.search-large .search-results {
  right: 104px;
}

/* Footer */

.site-footer {
  grid-area: foot;
  margin-top: 16px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 8px;
}

.site-footer-links a {
  color: var(--body);
}

/* Map */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font: 12px var(--label);
  list-style: none;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.swatch-forestwide {
  border: 2px solid var(--closure);
  background: rgba(255, 91, 85, 0.3);
}

.swatch-local {
  border: 2px solid var(--local);
  background: rgba(255, 92, 200, 0.45);
}

/* A fire with no perimeter yet: the map's incident dot. Perimeters are the live
   layer's, whose swatches the map script writes from glassing.app's contract. */
.swatch-fire {
  border: 2px solid var(--ground);
  border-radius: 50%;
  background: var(--fire);
}

.legend .legend-note {
  flex-basis: 100%;
  font-size: 11px;
}

.swatch-place {
  border: 3px solid var(--bone);
  border-radius: 50%;
  background: var(--ground);
}

.map {
  height: clamp(340px, 38vw, 460px);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--ground);
  overflow: hidden;
}

/* MapLibre's chrome in the page's glass. Its own stylesheet comes with the map
   (web/app/embed/data-map.ts); scoped to the shell, these win whatever the order. */
.map-shell .maplibregl-map {
  font: 13px/1.4 var(--sans);
}

.map-shell .maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: none;
}

.map-shell .maplibregl-ctrl-group button {
  width: 34px;
  height: 34px;
  background-color: transparent;
}

.map-shell .maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--rule);
}

.map-shell .maplibregl-ctrl-group button:not(:disabled):hover {
  background-color: rgba(240, 236, 226, 0.1);
}

/* The zoom icons are MapLibre's dark glyphs, turned bone. */
.map-shell .maplibregl-ctrl-icon {
  filter: invert(0.93);
}

/* Credits stay tucked behind the info toggle. */
.map-credits {
  display: none;
  position: absolute;
  right: 56px;
  bottom: 10px;
  z-index: 900;
  max-width: min(70vw, 560px);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--muted);
  font-size: 11px;
}

.map-shell.map-credits-visible .map-credits {
  display: block;
}

.map-credits a {
  color: var(--body);
}

.map-control-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bone);
  cursor: pointer;
}

.map-control-button:hover {
  background: rgba(240, 236, 226, 0.1);
}

.map-control-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The full map (#fullscreen): the map fills the window and the page's glass floats over
   it, a title card and the selected shape's panel on the left, the close button on
   the right. On a phone the panel is a bottom sheet. */

.map-shell {
  position: relative;
}

.map-overlay,
.map-close {
  display: none;
}

.map-watermark {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0.45;
  pointer-events: none;
}

.map-watermark img {
  display: block;
}

html.map-full-open,
html.map-full-open body {
  overflow: hidden;
}

.map-shell.map-full {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--ground);
}

.map-shell.map-full .map {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.map-shell.map-full .map-expand-control {
  display: none;
}

.map-shell.map-full .map-watermark {
  bottom: 16px;
  left: 16px;
}

.map-shell.map-full .map-overlay {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100% - 92px));
  pointer-events: none;
}

.map-card,
.map-panel,
.map-close {
  border: 1px solid var(--rule-surface);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.map-card {
  flex: none;
  padding: 16px 18px;
  border-radius: 14px;
}

.map-card-eyebrow {
  color: var(--muted);
  font: 12px/1.4 var(--label);
}

.map-card-title {
  margin: 4px 0 0;
  color: var(--bone);
  font: 500 30px/1.08 var(--display);
  letter-spacing: -0.01em;
}

.map-card-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-strong);
}

.map-card-answer {
  color: var(--bone);
  font: 500 21px/1.15 var(--display);
}

.map-card-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.map-card-legend {
  margin-top: 12px;
}

.map-panel {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  padding: 16px 18px 18px;
  overflow-y: auto;
  border-radius: 14px;
  overscroll-behavior: contain;
}

.map-panel-close,
.map-close {
  place-items: center;
  padding: 0;
  color: var(--bone);
  cursor: pointer;
}

.map-panel-close {
  display: grid;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(240, 236, 226, 0.08);
}

.map-shell.map-full .map-close {
  display: grid;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.map-panel-close:hover,
.map-close:hover {
  background: rgba(240, 236, 226, 0.16);
}

.map-panel-close svg,
.map-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.map-panel .map-popup strong {
  margin-right: 36px;
  font-size: 24px;
  line-height: 1.12;
}

.map-panel .map-popup-rule {
  margin-top: 6px;
  font-size: 13px;
}

.map-panel .map-popup .chips {
  margin-top: 12px;
}

.map-panel .map-popup-text {
  margin-top: 12px;
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

.map-panel .map-popup dl {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-strong);
  font-size: 13px;
}

.map-panel .map-popup-source {
  margin-top: 12px;
  font-size: 13px;
}

.map-popup-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--muted);
  font: 12px/1.3 var(--label);
}

.map-popup .chips {
  margin-top: 8px;
}

.map-popup-text {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .map-shell.map-full .map-overlay {
    top: 12px;
    right: 68px;
    bottom: auto;
    left: 12px;
    width: auto;
  }

  .map-shell.map-full .map-close {
    top: 12px;
    right: 12px;
  }

  .map-card {
    padding: 12px 14px;
  }

  .map-card-title {
    font-size: 23px;
  }

  .map-card-status {
    margin-top: 8px;
    padding-top: 8px;
  }

  .map-card-answer {
    font-size: 18px;
  }

  .map-card-legend {
    display: none;
  }

  .map-shell.map-full .map-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 58vh;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
  }
}

.map-shell .maplibregl-popup-content {
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--body);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.map-shell .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.map-shell .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.map-shell .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: var(--surface);
}

.map-shell .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.map-shell .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.map-shell .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: var(--surface);
}

.map-shell .maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--surface);
}

.map-shell .maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--surface);
}

.map-shell .maplibregl-popup-close-button {
  top: 4px;
  right: 6px;
  color: var(--muted);
  font-size: 18px;
}

.map-shell .maplibregl-popup-close-button:hover {
  background: transparent;
  color: var(--bone);
}

.map-popup strong {
  display: block;
  margin-right: 12px;
  color: var(--bone);
  font: 500 16px/1.25 var(--display);
}

.map-popup p {
  margin: 4px 0 0;
}

/* A closed stretch more than one order owns: each order after the lead, ruled off. */
.map-popup-live strong:not(:first-of-type) {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-strong);
}

.map-panel .map-popup-live strong:not(:first-of-type) {
  font-size: 17px;
}

.map-popup-rule,
.map-popup-meta {
  color: var(--muted);
  font-size: 12px;
}

.map-popup dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 10px 0 0;
}

.map-popup dt {
  color: var(--muted);
  font: 11px/18px var(--label);
}

.map-popup dd {
  margin: 0;
  color: var(--bone);
}

.map-popup-source {
  font-size: 12px;
}

/* Two columns at 1260 px and below, where three would squeeze main under ~620 px:
   the rail folds under main at its width, without "On this page". */

@media (max-width: 1260px) {
  .layout {
    grid-template-areas:
      "side main"
      "side rail"
      "side foot";
    grid-template-columns: 260px minmax(0, 880px);
    grid-template-rows: auto auto 1fr;
  }

  .rail {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 24px 0 0;
    border-top: 1px solid var(--rule);
  }

  .rail-toc {
    display: none;
  }
}

/* One column at 900 px and below: main, rail, sidebar, footer. */

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 16px;
  }

  .site-search {
    flex-basis: 100%;
    order: 3;
    max-width: none;
  }

  .site-search input {
    height: 44px;
    font-size: 16px;
  }

  .site-search-key {
    display: none;
  }

  .site-nav {
    margin-right: -8px;
    overflow-x: auto;
  }

  .site-nav a {
    min-height: 44px;
    padding: 0 8px;
  }

  .layout {
    grid-template-areas:
      "main"
      "rail"
      "side"
      "foot";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 40px;
    padding: 24px 16px 0;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }

  .site-footer {
    padding-bottom: 16px;
  }

  .sidebar a,
  .sidebar-group summary {
    min-height: 44px;
  }

  .status-block {
    padding: 18px 16px;
  }

  .status-answer {
    font-size: 26px;
  }

  .facts .facts-wide {
    grid-column: 1 / -1;
  }

  .map {
    height: 340px;
  }

  .search-large button {
    min-width: 0;
  }

  .search-large .search-results {
    right: 0;
  }
}

@media (max-width: 560px) {
  .site-nav {
    flex-basis: 100%;
    order: 4;
    margin: 0 0 -6px -8px;
  }
}
