/* One dark theme. The calendar reads --bg, --fg, --muted and the --cal-* tokens through
   getComputedStyle (js/calendar/palette.js, PALETTE_TOKENS). They must stay #rrggbb hex: the
   calendar computes contrast from them. tests/e2e.test.js checks them against
   CALENDAR_PALETTE_DARK.
   Color means something here: orange is HOT, blue is NOT, and the calendar's ramps. Everything
   else is neutral. */
:root {
  color-scheme: dark;
  --page: #17191e;
  --bg: #17191e;
  --side: #111317;
  --raised: #1f2228;
  --fg: #ececec;
  --muted: #a6a8ad;
  --border: #2c3038;
  --control-border: #8a8d94;
  --link: #ececec;
  --focus: #ffffff;
  --accent: #ececec;
  --accent-fg: #17191e;
  --hover: rgb(255 255 255 / 0.06);
  --bar: #626874;
  --warning-bg: #2a180a;
  --warning-fg: #fed7aa;
  --warning-border: #9a3412;
  --error-bg: #2a0f12;
  --error-fg: #fecaca;
  --error-border: #991b1b;
  --skeleton: #262a31;
  /* The verdict words use the ends of the anomaly ramp (--cal-div-8 and --cal-div-0). */
  --hot: #fdb863;
  --not: #9ecae1;

  --cal-seq-0: #440154;
  --cal-seq-1: #482475;
  --cal-seq-2: #414487;
  --cal-seq-3: #355f8d;
  --cal-seq-4: #2a788e;
  --cal-seq-5: #21918c;
  --cal-seq-6: #22a884;
  --cal-seq-7: #44bf70;
  --cal-seq-8: #7ad151;
  --cal-seq-9: #bddf26;
  --cal-seq-10: #fde725;
  --cal-div-0: #9ecae1;
  --cal-div-1: #6baed6;
  --cal-div-2: #4292c6;
  --cal-div-3: #2c5f8a;
  --cal-div-4: #2b2d33;
  --cal-div-5: #7a4a12;
  --cal-div-6: #b35806;
  --cal-div-7: #e08214;
  --cal-div-8: #fdb863;
  --cal-zero: #3a3c40;
  --cal-outline: #8a8c91;
  --cal-season: #9a9ca1;
  --cal-mark-dark: #000000;
  --cal-mark-light: #ffffff;
}

body {
  background: var(--page);
  color: var(--fg);
  font-size: 0.9375rem;
  line-height: 1.5;
}

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

.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;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 50;
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.875rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

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

p {
  margin: 0 0 0.5rem;
}

/* App bar */

.appbar {
  border-bottom: 1px solid var(--border);
  background: var(--side);
}

.appbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.875rem 1.25rem;
}

.appbar__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.appbar__tagline {
  margin: 0;
  color: var(--muted);
}

.appbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-left: auto;
}

.notice {
  margin: 0;
  padding: 0.5rem 1.25rem;
  border-top: 1px solid var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-fg);
  font-size: 0.875rem;
}

/* Layout: a place sidebar, the verdict beside the map, the calendar under both. */

/* base.css gives <main> a reading-column width for the method page; the dashboard is full width. */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  max-width: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 48rem) {
  .page {
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    grid-template-areas:
      "picker picker"
      "verdict map"
      "calendar calendar";
  }

  .page:has(> .story:not([hidden])) {
    grid-template-areas:
      "picker picker"
      "story story"
      "verdict map"
      "calendar calendar";
  }

  .picker {
    grid-area: picker;
  }

  .story {
    grid-area: story;
  }

  .verdict {
    grid-area: verdict;
  }

  .map-section {
    grid-area: map;
  }

  .calendar-section {
    grid-area: calendar;
  }
}

@media (min-width: 76rem) {
  .page {
    grid-template-columns: 16.5rem minmax(20rem, 25rem) minmax(0, 1fr);
    grid-template-areas:
      "picker verdict map"
      "picker calendar calendar";
    grid-template-rows: auto 1fr;
    align-items: stretch;
  }

  .page:has(> .story:not([hidden])) {
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "picker story map"
      "picker verdict map"
      "picker calendar calendar";
  }
}

/* Controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.12s ease-out, border-color 0.12s ease-out;
}

.button:hover:not(:disabled) {
  border-color: var(--fg);
  background-color: var(--hover);
}

.button:disabled,
.link-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button[aria-pressed="true"],
.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
}

.button--primary:hover:not(:disabled) {
  border-color: #ffffff;
  background: #ffffff;
}

.button--small {
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-decoration-color: var(--control-border);
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.link-button:hover:not(:disabled) {
  text-decoration-color: currentColor;
}

a {
  text-decoration-color: var(--control-border);
}

a:hover {
  text-decoration-color: currentColor;
}

/* Place sidebar */

.picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--side);
}

@media (min-width: 76rem) {
  .picker {
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }
}

.side-heading {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.regions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.25rem 0.75rem;
  min-height: 2.75rem;
}

@media (min-width: 76rem) {
  .regions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Region rows read as radio choices: a ring, filled for the chosen place. */
.button.region {
  justify-content: flex-start;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
  border-color: transparent;
  font-size: 0.9375rem;
  font-weight: 400;
  text-align: left;
}

.button.region::before {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 1.5px solid var(--control-border);
  border-radius: 50%;
}

.button.region:hover:not(:disabled) {
  border-color: transparent;
  background: var(--hover);
}

.button.region[aria-pressed="true"] {
  border-color: transparent;
  background: var(--raised);
  color: var(--fg);
  font-weight: 600;
}

.button.region[aria-pressed="true"]::before {
  border-color: var(--fg);
  background: radial-gradient(circle, var(--fg) 0 45%, transparent 50%);
}

.picker__own {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}

.area-summary {
  min-height: 1.5em;
  margin: 0;
  font-size: 0.8125rem;
}

.examples {
  display: grid;
  gap: 0.375rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

.examples__links {
  display: grid;
  justify-items: start;
  gap: 0.375rem;
  font-size: 0.875rem;
}

.data-note {
  margin: auto 0 0;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.banner {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.banner--warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-fg);
}

.banner--error {
  border-color: var(--error-border);
  background: var(--error-bg);
  color: var(--error-fg);
}

.message p {
  margin: 0 0 0.375rem;
}

.message__title {
  font-weight: 600;
}

.message__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

/* Verdict */

.verdict {
  --tone: var(--fg);
  min-width: 0;
  padding: 1.5rem 1.5rem 1.75rem;
}

.verdict[data-verdict="hot"] {
  --tone: var(--hot);
}

.verdict[data-verdict="not"] {
  --tone: var(--not);
}

.verdict__heading {
  display: grid;
  gap: 0.25rem;
  margin: 0 0 1rem;
  font-weight: 400;
}

.verdict__question {
  color: var(--muted);
  font-size: 0.875rem;
}

.verdict__where {
  min-height: 1.4em;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Room for the word, the sentence and the year chart, so the column does not jump. */
.verdict__body {
  min-height: 18rem;
}

.verdict__word {
  margin: 0 0 0.75rem -0.03em;
  color: var(--tone);
  font-size: clamp(3.25rem, 7vw, 4.25rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.verdict__sentence {
  margin-bottom: 0.375rem;
  font-size: 1.125rem;
  line-height: 1.45;
}

/* The numbers behind the word: label, bar on a shared scale, value. */
.figures {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}

.figures dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.figures dd {
  display: contents;
}

.figures__track {
  height: 0.75rem;
  background: var(--side);
}

.figures__bar {
  display: block;
  height: 100%;
}

.figures__bar--now {
  background: var(--tone);
}

.figures__bar--usual {
  background: var(--bar);
}

.figures__value {
  font-size: 1.0625rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.figures__ratio {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.figures dd.figures__rank {
  display: block;
  grid-column: 2 / 4;
  font-size: 0.9375rem;
  font-weight: 600;
}

.verdict__note {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.years {
  margin: 1.5rem 0 0.5rem;
}

.years__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1rem;
  margin-bottom: 0.625rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.years__peak {
  font-variant-numeric: tabular-nums;
}

.years__plot {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 5.5rem;
  border-bottom: 1px solid var(--control-border);
}

/* Each year is a full-height button, so a short or empty bar is as easy to hit as a tall one. */
.years__col {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px 2px 0 0;
  background: none;
  cursor: pointer;
}

.years__col:disabled {
  cursor: default;
}

.years__col:hover:not(:disabled) {
  background: var(--hover);
}

.years__col:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* The year whose fires the map shows. */
.years__col[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--fg);
}

.years__bar {
  width: 100%;
  background: var(--bar);
}

.years__col:hover:not(:disabled) .years__bar {
  background: var(--muted);
}

.years__col:hover:not(:disabled) .years__bar--now {
  background: var(--tone);
}

.years__bar--now {
  background: var(--tone);
}

.years__usual {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px dashed var(--fg);
  pointer-events: none;
}

.years__usual > span {
  position: absolute;
  right: 0;
  bottom: 2px;
  padding: 0 0.25rem;
  background: var(--bg);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.years__hint {
  margin: 0.375rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.years__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.why {
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

.why > summary {
  color: var(--muted);
  cursor: pointer;
}

.why > summary:hover {
  color: var(--fg);
}

.why p {
  margin: 0.5rem 0 0;
  line-height: 1.55;
}

/* Story */

.story {
  min-width: 0;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--raised);
}

.story__step {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.story__title {
  margin: 0 0 0.625rem;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
}

.story__body,
.story__caption {
  max-width: 62ch;
  line-height: 1.6;
}

.story__body {
  margin-bottom: 0.875rem;
}

.story__caption {
  margin-bottom: 1rem;
  font-weight: 600;
}

.story__more {
  margin-bottom: 1rem;
}

.story__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.story__close {
  margin-left: auto;
}

/* Map */

.map-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.25rem 1.25rem 0;
}


/* Which days of fires the map draws: the verdict's month unless the visitor picks dates. */
.map-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  min-width: 0;
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
}

.map-range__legend {
  float: left;
  margin-right: 0.25rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.map-range input[type="date"] {
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.map-range input[type="date"]:disabled {
  opacity: 0.5;
}

.map {
  flex: 1 1 auto;
  min-height: clamp(28rem, 72vh, 46rem);
}

/* The page's region buttons and "Draw your own area" replace the map's own tools; its
   coordinates form shows only while open ("Type coordinates" opens it). */
.map .hon-map__group,
.map .hon-map__box:not([open]) {
  display: none;
}

/* Calendar */

.calendar-section {
  min-width: 0;
  padding: 1.25rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
}

/* The menus' panels hang from the bar's right edge, so they stay inside the section at any width. */
.calendar-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
}

.section-heading {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--side);
}

.segmented label {
  position: relative;
  display: flex;
  font-size: 0.875rem;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.875rem;
  border-radius: 6px;
  color: var(--muted);
}

.segmented label:hover span {
  color: var(--fg);
}

.segmented input:checked + span {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 500;
}

/* The ring sits inside the segment; the inset band of --bg keeps it visible on the chosen segment. */
.segmented input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 4px var(--bg);
}

.calendar-bar__menus {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.menu {
  position: relative;
}

.menu > summary {
  gap: 0.5rem;
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu > summary::after {
  content: "";
  width: 0.375em;
  height: 0.375em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-20%) rotate(45deg);
}

.menu[open] > summary::after {
  transform: translateY(20%) rotate(-135deg);
}

.menu__panel {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 25;
  display: grid;
  gap: 0.875rem;
  width: max-content;
  max-width: min(26rem, 90vw);
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--raised);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  font-size: 0.875rem;
}

.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.options legend {
  margin-bottom: 0.375rem;
  padding: 0;
  font-weight: 600;
}

.options__hint {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
}

.select,
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.select select {
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.875rem;
}

.checkbox input {
  flex: none;
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.exports__list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exports__list li {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
}

.exports__hint,
.exports__note {
  color: var(--muted);
  font-size: 0.8125rem;
}

.exports__note {
  margin: 0;
}

.exports__status:empty {
  display: none;
}

.calendar-guide {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* The frame keeps the calendar's height while it loads, so nothing below it moves. */
.calendar-frame {
  position: relative;
  min-height: 12rem;
}

.calendar {
  width: 100%;
}

.calendar-skeleton {
  position: absolute;
  inset: 0;
  display: none;
  background:
    linear-gradient(var(--skeleton) 0 0) 1rem 1rem / min(14rem, 60%) 1rem no-repeat,
    linear-gradient(var(--skeleton) 0 0) 1rem 2.5rem / min(22rem, 80%) 0.75rem no-repeat,
    repeating-linear-gradient(var(--skeleton) 0 15px, transparent 15px 17px) 5.5rem 6rem / calc(100% - 6.5rem) calc(100% - 7rem) no-repeat;
  animation: pulse 1.6s ease-in-out infinite;
}

.calendar-status {
  margin: 0;
}

.calendar-frame[data-state="initial"] .calendar {
  visibility: hidden;
}

.calendar-frame[data-state="initial"] .calendar-skeleton {
  display: block;
}

.calendar-frame[data-state="initial"] .calendar-status,
.calendar-frame[data-state="ready"] .calendar-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.calendar-frame[data-state="loading"] .calendar {
  opacity: 0.45;
}

.calendar-frame[data-state="loading"] .calendar-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  background: var(--raised);
  font-size: 0.8125rem;
}

.calendar-frame[data-state="empty"] .calendar {
  visibility: hidden;
}

.calendar-frame[data-state="empty"] .calendar-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.calendar-numbers {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.calendar-numbers > summary {
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
}

.calendar-numbers > summary:hover {
  color: var(--fg);
}

.table-scroll {
  max-height: 28rem;
  margin-top: 0.75rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

table.data caption {
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  text-align: left;
}

table.data th,
table.data td {
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

table.data thead th {
  position: sticky;
  top: 0;
  background: var(--raised);
  color: var(--muted);
  font-weight: 500;
}

table.data tbody tr:hover {
  background: var(--hover);
}

table.data th[scope="row"] {
  font-weight: 500;
}

table.data .num {
  text-align: right;
}

.skeleton {
  display: grid;
  gap: 0.625rem;
  padding: 0.25rem 0;
}

.skeleton__line {
  display: block;
  height: 0.875rem;
  border-radius: 4px;
  background: var(--skeleton);
  animation: pulse 1.6s ease-in-out infinite;
}

.verdict__body .skeleton__line:first-child {
  height: 3.75rem;
}

.skeleton__line--inline {
  grid-column: 1 / -1;
  width: 100%;
  height: 2.75rem;
}

@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton__line,
  .calendar-skeleton {
    animation: none;
  }

  .button {
    transition: none;
  }
}

/* Phones: a row of place chips, then the verdict, the map as a window into the page, the
   calendar, and the examples and data note last. The picker's parts become items of the page
   grid so they can be placed around the verdict. */
@media (max-width: 47.99rem) {
  .appbar__inner {
    align-items: center;
    padding: 0.75rem 1rem;
  }

  .appbar__actions {
    gap: 0.5rem 0.875rem;
  }

  .appbar__tagline {
    flex-basis: 100%;
    order: 3;
    font-size: 0.8125rem;
  }

  .picker {
    display: contents;
  }

  .picker > * {
    margin-inline: 1rem;
  }

  #picker-heading {
    order: 1;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
  }

  .regions {
    display: flex;
    order: 2;
    gap: 0.5rem;
    min-height: 0;
    margin-inline: 0;
    padding: 0.25rem 1rem 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .regions::-webkit-scrollbar {
    display: none;
  }

  .button.region {
    flex: none;
    border-color: var(--border);
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .button.region[aria-pressed="true"] {
    border-color: var(--fg);
  }

  .picker__own {
    order: 3;
  }

  .area-summary {
    order: 4;
    margin-top: 0.25rem;
  }

  .picker > .banner {
    order: 5;
  }

  .story {
    order: 0;
    padding: 1.25rem 1rem;
  }

  .verdict {
    order: 6;
    padding: 1.25rem 1rem 1.5rem;
  }

  .verdict__body {
    min-height: 14rem;
  }

  .map-section {
    order: 7;
    padding: 0 1rem 1.25rem;
  }

  .map {
    min-height: clamp(20rem, 55vh, 28rem);
  }

  .map-range label {
    flex: 1 1 9rem;
  }

  .map-range input[type="date"] {
    width: 100%;
  }

  .calendar-section {
    order: 8;
    padding: 1rem 1rem 1.5rem;
  }

  .segmented {
    flex: 1 1 100%;
  }

  .segmented label {
    flex: 1 1 0;
  }

  .segmented span {
    justify-content: center;
    width: 100%;
  }

  .calendar-bar__menus {
    margin-left: 0;
  }

  .examples {
    order: 9;
    margin-top: 0.5rem;
  }

  .examples__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
  }

  .data-note {
    order: 10;
    margin-top: 0.875rem;
    margin-bottom: 1.25rem;
  }
}

/* Touch screens: every control at least 44 px tall. */
@media (pointer: coarse) {
  .button,
  .link-button,
  .select select,
  .map-range input[type="date"],
  .segmented span {
    min-height: 2.75rem;
  }
}

.app-footer {
  padding: 1rem 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--side);
  color: var(--muted);
  font-size: 0.8125rem;
}

.app-footer__inner {
  display: grid;
  gap: 0.25rem;
}

.app-footer p {
  margin: 0;
}
