:root {
  color-scheme: light;
  --paper: #f5f2e7;
  --paper-2: #f8f6f2;
  --ink: #000000;
  --ink-2: #474240;
  --ink-3: #736e6a;
  --line: rgba(0, 0, 0, 0.26);
  --coral: #f8684d;
  --pink: #ca6780;
  --blue: #3981f1;
  --navy: #003b73;
  --water: #2e2927;
  --land: #57524d;
  --no-data: #958b85;
  --push: var(--coral);
  --developer: var(--blue);
  --negative: var(--blue);
  --well: rgba(255, 255, 255, 0.66);
  --well-border: rgba(0, 0, 0, 0.42);
  --masthead-height: 58px;
  /* The overlay system scales continuously with the available map surface.
     Width and height both participate so a short laptop window stays compact. */
  --edge: clamp(10px, min(1vw, 1.8vh), 16px);
  --radius: 3px;
  --panel-pad-x: clamp(14px, min(1.1vw, 1.7vh), 18px);
  --panel-pad-y: clamp(13px, min(1vw, 1.6vh), 17px);
  --story-width: clamp(278px, 20vw, 330px);
  --lens-width: clamp(252px, 18vw, 304px);
  --legend-width: clamp(300px, 20vw, 320px);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Baskervville, Georgia, "Times New Roman", serif;
  --numbers: Baskervville, Baskerville, Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
.experience,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--ink);
  border-radius: 999px;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.experience {
  position: relative;
  min-height: 560px;
}

#map {
  position: absolute;
  inset: var(--masthead-height) 0 0;
  height: calc(100% - var(--masthead-height));
}

.maplibregl-canvas {
  cursor: grab;
}

.maplibregl-canvas:active {
  cursor: grabbing;
}

.vignette {
  position: absolute;
  inset: var(--masthead-height) 0 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(130% 100% at 50% 45%, transparent 62%, rgba(0, 0, 0, 0.22) 100%);
}

/* The masthead and paper panels carry the publication identity; the map remains
   a dark evidence field rather than becoming a beige brand wash. */
.masthead {
  position: absolute;
  inset: 0 0 auto;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  height: var(--masthead-height);
  padding: 0 clamp(18px, 3vw, 46px);
  color: var(--ink);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  text-transform: uppercase;
}

.masthead a {
  color: inherit;
  text-decoration: none;
}

.brand-lockup {
  justify-self: start;
  display: inline-flex;
  align-items: center;
}

.brand-wordmark {
  display: block;
  width: auto;
  height: 12px;
}

.section-mark {
  justify-self: center;
  font-size: 11px;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.section-mark span {
  color: var(--coral);
  font-size: 15px;
}

.journal-link {
  justify-self: end;
  padding: 8px 15px 7px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.journal-link:hover,
.journal-link:focus-visible {
  color: var(--paper);
  background: var(--ink);
}

.paper-panel {
  position: absolute;
  z-index: 3;
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(245, 242, 231, 0.985);
  border: 1px solid var(--ink);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.1);
  isolation: isolate;
  transition: background-color 180ms ease;
}

.is-moving .paper-panel {
  background: rgba(245, 242, 231, 0.99);
}

/* Story and controls */
.story {
  top: calc(var(--masthead-height) + var(--edge));
  left: var(--edge);
  width: var(--story-width);
  padding: var(--panel-pad-y) var(--panel-pad-x);
}

.kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.story h1 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(20px, min(1.42vw, 3.15vh), 25px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-wrap: balance;
}

.dek {
  margin: 7px 0 clamp(11px, 0.8vw, 13px);
  font-family: var(--serif);
  font-size: clamp(13px, 0.82vw, 14.5px);
  line-height: 1.3;
  color: var(--ink-2);
}

.story-link {
  display: inline-block;
  margin: 0 0 12px;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  text-decoration: none;
}

.story-link:hover,
.story-link:focus-visible {
  color: var(--coral);
}

.search {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  height: clamp(34px, min(2.4vw, 4.8vh), 38px);
  padding: 0 9px 0 11px;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--well-border);
}

.search .icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.search input {
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--mono);
  font-size: clamp(11.5px, 0.78vw, 13px);
}

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

.search input::-webkit-search-cancel-button {
  display: none;
}

.search button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
}

.search button[hidden] {
  display: none;
}

.search button svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--coral);
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(7px, 0.6vw, 9px);
  margin-top: clamp(7px, 0.6vw, 9px);
}

.metric-field {
  margin-top: clamp(7px, 0.6vw, 9px);
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field > span:first-child {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.select {
  position: relative;
  display: block;
}

.select select {
  width: 100%;
  height: clamp(32px, min(2.3vw, 4.5vh), 36px);
  padding: 0 26px 0 9px;
  border: 1px solid var(--well-border);
  border-radius: 999px;
  background: var(--well);
  font-family: var(--mono);
  font-size: clamp(11.5px, 0.76vw, 13px);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.select select:focus-visible {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--coral);
}

.select svg {
  position: absolute;
  right: 9px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.segmented {
  display: grid;
  grid-template-columns: minmax(40px, 0.72fr) minmax(0, 1.28fr);
  height: clamp(32px, min(2.3vw, 4.5vh), 36px);
  padding: 2px;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--well-border);
  container: scale-control / inline-size;
}

.segmented button {
  min-width: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: clamp(10.5px, 0.72vw, 12px);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 160ms ease, color 160ms ease;
}

.scale-label-short {
  display: none;
}

@container scale-control (max-width: 132px) {
  .scale-label-full {
    display: none;
  }

  .scale-label-short {
    display: inline;
  }
}

.segmented button[aria-checked="true"] {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}

/* Crosshair and lens */
.crosshair {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--masthead-height) / 2);
  z-index: 4;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.72));
}

.crosshair svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.25;
}

.crosshair .dot {
  fill: var(--paper);
  stroke: none;
}

.crosshair .leader {
  position: absolute;
  left: 36px;
  top: 17.5px;
  width: 26px;
  height: 1px;
  background: var(--paper);
}

.lens {
  left: calc(50% + clamp(32px, 3vw, 42px));
  top: calc(50% + var(--masthead-height) / 2);
  width: var(--lens-width);
  padding: var(--panel-pad-y) var(--panel-pad-x);
  transform: translateY(-50%);
  container-type: inline-size;
}

.lens-head h2 {
  margin: 0;
  font-family: var(--numbers);
  font-weight: 400;
  font-size: clamp(25px, min(1.8vw, 3.7vh), 31px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.lens-head p {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: clamp(12.5px, 0.76vw, 14px);
  line-height: 1.3;
  color: var(--ink-2);
}

.bars {
  display: grid;
  gap: clamp(7px, 0.7vw, 10px);
  margin-top: clamp(8px, 0.7vw, 11px);
}

.bar-row {
  display: grid;
  gap: 4px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.bar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(11.5px, 0.72vw, 13px);
}

.bar-value {
  flex: 0 0 auto;
  font-family: var(--numbers);
  font-size: clamp(14px, 0.9vw, 16px);
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.015em;
}

.bar-value.muted {
  color: var(--ink-3);
  font-weight: 400;
  font-size: 12px;
}

.track {
  position: relative;
  height: clamp(5px, 0.38vw, 6px);
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 1px;
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fill.push {
  background: var(--push);
}

.fill.developer {
  background: var(--developer);
}

.fill.negative {
  background: var(--negative);
}

.stats {
  display: grid;
  /* The lens stays narrow on wide screens, so viewport-based four-column
     layouts make long rates collide. Keep the values in two card-sized columns. */
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: clamp(8px, 0.65vw, 10px);
  margin-top: clamp(8px, 0.7vw, 11px);
  padding-top: clamp(8px, 0.65vw, 10px);
  border-top: 1px solid var(--line);
}

.stats > div {
  min-width: 0;
}

.stats strong {
  display: block;
  font-family: var(--numbers);
  font-weight: 400;
  font-size: clamp(19px, 1.18vw, 22px);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.stats span {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.25;
  color: var(--ink-3);
}

.caveat {
  margin: clamp(7px, 0.6vw, 9px) 0 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.3;
  color: var(--ink-3);
}

.caveat:empty,
.lens.is-empty .bars,
.lens.is-empty .stats,
.lens.is-empty .caveat {
  display: none;
}

.lens.is-empty {
  width: clamp(200px, 14vw, 250px);
}

.lens.is-empty .lens-head h2 {
  color: var(--ink-2);
}

/* Legend */
.legend {
  left: var(--edge);
  bottom: var(--edge);
  width: var(--legend-width);
  padding: 8px 10px 7px;
}

.legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.legend-title {
  display: block;
  font-family: var(--mono);
  font-size: clamp(10.5px, 0.7vw, 12px);
  color: var(--ink-2);
  white-space: nowrap;
}

.legend-title b {
  color: var(--ink);
  font-family: var(--numbers);
  font-size: 1.12em;
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
}

.play-change {
  flex: 0 0 auto;
  min-width: 46px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
}

.play-change:hover,
.play-change:focus-visible {
  color: var(--paper);
  background: var(--ink);
}

.play-change[aria-pressed="true"] {
  background: var(--coral);
  color: var(--ink);
}

.ramp {
  position: relative;
  height: 7px;
  margin: 3px 0 4px;
  border-radius: 1px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: linear-gradient(90deg, #003b73 0%, #3981f1 16%, #f5f2e7 25.5%, #fcebc5 41.5%, #edc89b 57.5%, #f19254 70.5%, #f8684d 84.8%, #ca6780 100%);
}

.ramp::after {
  content: "";
  position: absolute;
  left: 25.5%;
  top: -3px;
  width: 1px;
  height: 11px;
  background: var(--ink);
}

.ramp-zones {
  display: grid;
  grid-template-columns: 25.5% 24% 1fr;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
}

.ramp-zones span:nth-child(2) {
  text-align: center;
}

.ramp-zones span:nth-child(3) {
  text-align: right;
}

.ramp-labels {
  position: relative;
  height: 13px;
  font-family: var(--numbers);
  font-size: 11px;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink-3);
}

.ramp-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.ramp-labels span:nth-child(1) { left: 0; transform: none; }
.ramp-labels span:nth-child(2) { left: 25.5%; }
.ramp-labels span:nth-child(3) { left: 57.5%; }
.ramp-labels span:nth-child(4) { left: 100%; transform: translateX(-100%); }

.legend-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.no-data-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
}

.no-data-key i {
  width: 18px;
  height: 9px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  background-color: var(--no-data);
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(245, 242, 231, 0.72) 3px 4px);
}

/* Zoom */
.zoom {
  right: var(--edge);
  bottom: var(--edge);
  display: grid;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
}

.zoom button {
  display: grid;
  place-items: center;
  width: clamp(30px, 2vw, 33px);
  height: clamp(30px, 2vw, 33px);
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.zoom button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.zoom svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Data notes: one round button top right, one compact reference panel */
.info-button {
  top: calc(var(--masthead-height) + var(--edge));
  right: var(--edge);
  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(34px, 2.2vw, 37px);
  height: clamp(34px, 2.2vw, 37px);
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}

.info-button:hover,
.info-button[aria-expanded="true"] {
  color: var(--paper);
  background: var(--ink);
}

.info-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.info-button .dot {
  fill: currentColor;
  stroke: none;
}

.info-panel {
  top: calc(var(--masthead-height) + var(--edge) + 43px);
  right: var(--edge);
  z-index: 5;
  width: clamp(342px, 25vw, 410px);
  max-height: calc(100% - var(--masthead-height) - var(--edge) * 2 - 43px);
  padding: var(--panel-pad-y) var(--panel-pad-x);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
}

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

.info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.info-kicker {
  margin: 0 0 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--coral);
}

.info-panel h3 {
  margin: 0;
  font-family: var(--numbers);
  font-weight: 400;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.025em;
}

.info-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -3px -5px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.info-close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.info-close svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.info-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  overflow: hidden;
}

.info-tabs button {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.info-tabs button:last-child {
  border-right: 0;
}

.info-tabs button[aria-selected="true"] {
  color: var(--paper);
  background: var(--ink);
}

.info-section[hidden] {
  display: none;
}

.source-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.source-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.source-list a {
  overflow: hidden;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-list span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
  white-space: nowrap;
}

.info-panel a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-underline-offset: 2px;
}

.info-panel a:hover {
  color: var(--coral);
  text-decoration-color: currentColor;
}

.info-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.info-actions a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  text-decoration: none;
}

.info-actions a:hover {
  color: var(--paper);
  background: var(--ink);
}

.variable-list {
  display: grid;
  gap: 15px;
}

.variable-group h4 {
  margin: 0 0 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--coral);
}

.variable-item {
  border-top: 1px solid var(--line);
}

.variable-item:last-child {
  border-bottom: 1px solid var(--line);
}

.variable-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 8px 18px 8px 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.variable-item summary::-webkit-details-marker {
  display: none;
}

.variable-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
}

.variable-item summary {
  position: relative;
}

.variable-item[open] summary::after {
  content: "−";
}

.variable-item summary span:last-child {
  font-family: var(--numbers);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-3);
  white-space: nowrap;
}

.variable-item p {
  margin: -1px 18px 9px 0;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.34;
  color: var(--ink-2);
}

.method-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.method-list > div {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.method-list > div:last-child {
  border-bottom: 1px solid var(--line);
}

.method-list dt {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
}

.method-list dd {
  margin: 3px 0 0;
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.34;
  color: var(--ink-2);
}

.method-formula {
  display: block;
  width: 100%;
  margin: 5px 0 7px;
  padding: 5px 6px 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.17);
  border-bottom: 1px solid rgba(0, 0, 0, 0.17);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  color: var(--ink);
  background: rgba(248, 104, 77, 0.04);
}

.method-explanation {
  display: block;
}

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

@container (max-width: 270px) {
  .stats strong {
    font-size: 18px;
  }
}

@media (min-width: 581px) and (max-width: 900px) {
  .masthead {
    grid-template-columns: 1fr auto;
    padding-inline: 18px;
  }

  .section-mark {
    display: none;
  }

  .scale-label-full {
    display: none;
  }

  .scale-label-short {
    display: inline;
  }
}

/* Compact desktop / split-window mode. It keeps the floating composition but
   removes secondary copy and dense tick labels before they begin to crowd the map. */
@media (min-width: 581px) and (max-width: 760px) {
  .story {
    padding: 12px;
  }

  .story h1 {
    font-size: 21px;
  }

  .dek {
    display: none;
  }

  .search {
    margin-top: 8px;
  }

  .select select {
    padding-right: 22px;
    padding-left: 8px;
    font-size: 10.5px;
  }

  .select svg {
    right: 8px;
  }

  .segmented button {
    font-size: 10px;
  }

  .lens {
    padding: 12px;
  }

  .legend {
    padding: 8px 10px 7px;
  }

  .legend-title {
    font-size: 9.5px;
  }

  .legend .ramp {
    height: 6px;
    margin-bottom: 0;
  }

  .legend .ramp-labels {
    display: block;
    height: 13px;
    font-size: 10.5px;
  }

  .legend-foot {
    margin-top: 4px;
    padding-top: 4px;
  }
}

/* Only phones become a stacked interface. Narrow desktop and split-screen
   windows retain floating, fluid panels so the map remains visible. */
@media (max-width: 580px) {
  :root {
    --edge: clamp(8px, 2.6vw, 12px);
    --masthead-height: 50px;
    --radius: 3px;
  }

  .masthead {
    grid-template-columns: 1fr;
    padding: 0 12px;
  }

  .section-mark,
  .journal-link {
    display: none;
  }

  .story {
    top: calc(var(--masthead-height) + var(--edge));
    left: var(--edge);
    right: var(--edge);
    width: auto;
    padding: 10px 52px 10px 12px;
  }

  .info-button {
    top: calc(var(--masthead-height) + var(--edge) + 6px);
    right: calc(var(--edge) + 6px);
    width: 36px;
    height: 36px;
  }

  .info-panel {
    top: calc(var(--masthead-height) + var(--edge) + 48px);
    left: var(--edge);
    right: var(--edge);
    width: auto;
  }

  .story h1 {
    font-size: clamp(19px, 5.4vw, 22px);
  }

  .dek {
    display: none;
  }

  .search {
    height: 36px;
    margin-top: 6px;
  }

  .metric-field,
  .controls {
    margin-top: 7px;
  }

  .field {
    gap: 5px;
  }

  .select select,
  .segmented {
    height: 36px;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zoom {
    display: none;
  }

  .legend {
    top: calc(var(--masthead-height) + var(--edge) + 220px);
    left: var(--edge);
    right: var(--edge);
    bottom: auto;
    width: auto;
    padding: 7px 8px 6px 10px;
  }

  .legend-title {
    font-size: 11px;
  }

  .legend .ramp {
    height: 6px;
    margin: 7px 0 0;
  }

  .legend .ramp-labels {
    display: block;
    height: 13px;
    font-size: 10.5px;
  }

  .legend-foot {
    font-size: 9.5px;
  }

  .legend .play-change {
    min-width: 64px;
    height: 44px;
  }

  .crosshair .leader {
    display: none;
  }

  .lens,
  .lens.is-empty {
    left: var(--edge);
    right: var(--edge);
    top: auto;
    bottom: var(--edge);
    width: auto;
    padding: 12px;
    transform: none;
  }

  .lens-head h2 {
    font-size: clamp(19px, 5.4vw, 22px);
  }

  .stats strong {
    font-size: clamp(15.5px, 4.5vw, 17px);
  }

  .bars {
    gap: 7px;
    margin-top: 8px;
  }

  .bar-row {
    gap: 4px;
  }

  .stats {
    gap: 8px 10px;
    margin-top: 8px;
    padding-top: 8px;
  }

  .caveat {
    margin-top: 7px;
  }
}

@media (min-width: 1024px) {
  .brand-wordmark {
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .paper-panel,
  .fill,
  .segmented button {
    transition: none;
  }
}

/* Smaller overlays only inside an article embed; the full-screen dashboard
   retains its original panel sizes and labels. */
html.is-embedded {
  --masthead-height: 0px;
}

html.is-embedded .masthead {
  display: none;
}

html.is-article-embed {
  --story-width: 244px;
  --legend-width: 252px;
  --panel-pad-x: 10px;
  --panel-pad-y: 10px;
}

.legend-baseline-compact {
  display: none;
}

html.is-article-embed .legend-baseline-full {
  display: none;
}

html.is-article-embed .legend-baseline-compact {
  display: inline;
}

html.is-article-embed .dek {
  margin-bottom: 8px;
}

html.is-article-embed .story-link {
  margin-bottom: 8px;
}

html.is-article-embed .legend {
  padding: 7px 9px 6px;
}

html.is-article-embed .legend-foot {
  gap: 12px;
}

html.is-article-embed .controls {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 6px;
}

html.is-article-embed .segmented {
  grid-template-columns: 36px minmax(0, 1fr);
}

html.is-article-embed .segmented button {
  font-size: 10px;
}

html.is-article-embed .scale-label-full {
  display: inline;
}

html.is-article-embed .scale-label-short {
  display: none;
}
