/*
 * The metros as a map — home page §G and cities.html.
 *
 * The map is a signage plate: a very pale land on the page ground, a crisp
 * hairline coast, the US state lines a step fainter, and the only colour on
 * it is the stations — route-blue discs with an ink ring and a white core,
 * the way the hero draws them; a white tick in place of the core on the
 * thirteen in the free rotation; and this week's assignment as a larger
 * accent disc with a pulsing ring and a destination-board plate pointing at
 * it. Continent tabs change the plate, they do not redraw it. The ledger
 * beneath is every metro as a table. Every colour is a token; the markup is
 * in the HTML and js/metros.js only adds the tabs, the sort, the week and
 * the hover card.
 */

.metros { margin-top: 0.5rem; }

/* ── Controls ─────────────────────────────────────────────────────────── */

.metros__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.1rem;
}

/* The continent tabs are a strip map: four stations on one route-blue line,
   the selected one a filled interchange. */
.metros__tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.6rem;
  padding: 0;
  --strip: var(--line-blue-lit);
}
/* The line: each station carries the run to the next one, so it ends at the last station. */
.metros__tabs [role="tab"]:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline: 0.5rem -1.6rem;
  inset-block-start: 0.45rem;
  block-size: 4px;
  background: var(--strip);
}
.metros__tabs [role="tab"] {
  position: relative;
  padding: 1.35rem 0 0.35rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink-2);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 160ms var(--ease-land);
}
/* The station: a ring on the line, filled when it is the one you are at. */
.metros__tabs [role="tab"]::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 0.95rem;
  block-size: 0.95rem;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--strip);
  transition: transform 160ms var(--ease-land), background-color 160ms, border-color 160ms, box-shadow 160ms;
}
.metros__tabs [role="tab"]:hover { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .metros__tabs [role="tab"]:hover::before { transform: scale(1.18); }
}
.metros__tabs [role="tab"][aria-selected="true"] { color: var(--ink); }
.metros__tabs [role="tab"][aria-selected="true"]::before {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2.5px var(--surface);
  transform: scale(1.08);
}
.metros__tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The line runs to the last station and no further. */
.metros__tabs [role="tab"]:last-child { padding-inline-end: 0; }

/* Sort: a run of plates. The label is an ink plate; the two controls are
   paper plates on an ink hairline. */
.metros__sort { display: inline-flex; align-items: stretch; }
.metros__sort label {
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem 0 0.6rem;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  border-inline-start: 4px solid var(--plate-accent);
}
.metros__sort select,
.metros__sort button {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-inline-start: 0;
  border-radius: 0;
  padding: 0.45rem 0.7rem 0.4rem;
  min-block-size: 2rem;
  cursor: pointer;
}
.metros__sort select { padding-inline-end: 1.6rem; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 0.9rem) 55%, calc(100% - 0.6rem) 55%;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
}
.metros__sort select:hover, .metros__sort button:hover { background-color: var(--ground-3); }
.metros__sort select:focus-visible, .metros__sort button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.metros__sort button { font-family: var(--mono); font-weight: 500; font-size: 0.8125rem; letter-spacing: 0; text-transform: none; min-inline-size: 7.5rem; text-align: left; }
.metros__sort button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
/* A phone: the continent tabs and the sort controls are 44 px taps on both
   pages that carry the map (site.css covers only the home page's #cities). */
@media (pointer: coarse), (max-width: 767.98px) {
  .metros__tabs [role="tab"] { min-block-size: 2.75rem; min-inline-size: 2.75rem; padding-block-end: 0.5rem; }
  .metros__sort select, .metros__sort button { min-block-size: 2.75rem; }
  /* The ledger: column sort buttons and the metro links are 44 px rows. */
  .metros__table thead th button { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
  .metros__table td a { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
  .metros__table tbody th a { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
}

/* This week's assignment, as a line above the map. */
.metros__week {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.metros__week .plate { --tick: var(--plate-accent); font-size: 0.8125rem; min-height: 1.75rem; }
.metros__week b { color: var(--ink); font-weight: 600; }
.metros__week a { color: var(--ink); }
.metros__week .mono { font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── The plate the map sits in ────────────────────────────────────────── */

.metros__plate {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  background: var(--surface);
}
/* Four continents occupy the same cell. Switching is a plate change: the
   outgoing map rolls off, the incoming one is already painted underneath. */
.metros__panels {
  display: grid;
  isolation: isolate;
  position: relative;
}
.metros__panel {
  grid-area: 1 / 1;
  position: relative;
  min-inline-size: 0;
}
.metros__panel.is-off {
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}
.metros__panel.is-on {
  visibility: visible;
  z-index: 1;
}
.metros__panel.is-leaving {
  visibility: visible;
  pointer-events: none;
  z-index: 2;
}
.metromap {
  display: block;
  inline-size: 100%;
  block-size: auto;
  background: var(--surface);
}

/* The caption: a mono line that is also the key. */
.metros__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
  margin: 0;
  padding: 0.55rem 0.85rem 0.6rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.metros__caption strong { color: var(--ink); font-weight: 500; }
.metros__caption span { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.metros__caption .src { margin-inline-start: auto; color: var(--ink-3); white-space: normal; }
/* The three station glyphs in the key, drawn the way the map draws them. */
.mm-key {
  display: inline-block;
  inline-size: 0.8rem;
  block-size: 0.8rem;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--line-blue-lit);
  border: 1px solid var(--ink);
  position: relative;
  flex: none;
}
.mm-key::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  inline-size: 0.26rem;
  block-size: 0.26rem;
  border-radius: 50%;
  background: var(--surface);
  transform: translate(-50%, -50%);
}
.mm-key--free::after { inline-size: 0.14rem; block-size: 0.42rem; border-radius: 0; }
.mm-key--week { background: var(--accent); inline-size: 1rem; block-size: 1rem; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent); }

/* ── Land ─────────────────────────────────────────────────────────────── */

.mm-land path {
  fill: var(--ground-2);
  stroke: var(--rule-2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
/* On the panel ground the land has to step once more to stay a land. */
.section--panel .mm-land path { fill: var(--ground-3); }
.mm-states path {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.section--panel .mm-states path { stroke: var(--rule-2); }
.mm-inset__frame { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.mm-inset__tick { fill: var(--plate-accent); }
.mm-inset__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--ink-2);
}

/* ── Stations ─────────────────────────────────────────────────────────── */

.mm-dot { cursor: pointer; }
.mm-dot circle, .mm-dot rect {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 120ms cubic-bezier(0.4, 0, 0.2, 1), opacity 120ms;
}
.mm-dot__disc { fill: var(--line-blue-lit); stroke: var(--ink); stroke-width: 1; }
.mm-dot__core, .mm-dot__tick { fill: var(--surface); }
/* The hit area: a one-unit square at the station wearing a transparent
   stroke in screen pixels whatever the map's scale (a transparent stroke
   still counts for hit-testing: visiblePainted tests stroke ≠ none; a rect,
   because Chrome does not hit-test a circle's non-scaling stroke beyond its
   fill), so the drawing is unchanged but the link answers a pointer well
   outside the dot. 24 px on a desktop; 44 on a phone. build-cities clips
   each square to its station's own cell of the map, so in the crowded
   north-east a tap goes to the nearest station rather than to whichever
   square was painted last. */
.mm-dot__hit { fill: none; stroke: transparent; stroke-width: 24px; vector-effect: non-scaling-stroke; transition: none; }
@media (pointer: coarse), (max-width: 767.98px) {
  .mm-dot__hit { stroke-width: 44px; }
}
.mm-dot:hover circle, .mm-dot:hover rect,
.mm-dot:focus circle, .mm-dot:focus rect,
.mm-dot[data-on] circle, .mm-dot[data-on] rect { transform: scale(1.45); }
.mm-dot:focus { outline: none; }
.mm-dot:focus-visible .mm-dot__disc,
.mm-dot[data-on] .mm-dot__disc { stroke: var(--accent); stroke-width: 2.2; }
/* Pointing at one dims the rest rather than outlining the one. */
.mm-dots:has(.mm-dot:hover) .mm-dot:not(:hover):not([data-week]):not([data-on]) circle,
.mm-dots:has(.mm-dot:hover) .mm-dot:not(:hover):not([data-week]):not([data-on]) rect,
.mm-dots:has(.mm-dot:focus) .mm-dot:not(:focus):not([data-week]):not([data-on]) circle,
.mm-dots:has(.mm-dot:focus) .mm-dot:not(:focus):not([data-week]):not([data-on]) rect,
.mm-dots:has(.mm-dot[data-on]) .mm-dot:not([data-on]):not([data-week]) circle,
.mm-dots:has(.mm-dot[data-on]) .mm-dot:not([data-on]):not([data-week]) rect { opacity: 0.45; }

/* This week's free assignment: bigger, in the accent, with a pulsing ring
   and a destination-board plate. */
.mm-dot[data-week] .mm-dot__disc { fill: var(--accent); stroke-width: 1.2; }
.mm-dot[data-week] circle, .mm-dot[data-week] rect { transform: scale(1.7); }
.mm-dot[data-week]:hover circle, .mm-dot[data-week]:hover rect,
.mm-dot[data-week]:focus circle, .mm-dot[data-week]:focus rect,
.mm-dot[data-week][data-on] circle, .mm-dot[data-week][data-on] rect { transform: scale(2); }
.mm-week { pointer-events: none; }
.mm-week__ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  transform-box: fill-box;
  transform-origin: center;
  animation: mm-pulse 2.4s var(--ease-land) infinite;
}
@keyframes mm-pulse {
  0% { transform: scale(0.5); opacity: 0.95; }
  100% { transform: scale(1.9); opacity: 0; }
}
.mm-week__plate, .mm-week__point { fill: var(--ink); }
.mm-week__text {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--ground);
}
.mm-week__text tspan.k { fill: var(--plate-accent); }
.mm-week__tick { fill: var(--plate-accent); }

/* ── The card that follows the pointer from dot to dot ────────────────── */

.metros__card {
  position: absolute;
  z-index: 3;
  inline-size: 15.5rem;
  max-inline-size: calc(100% - 1rem);
  padding: 0.7rem 0.85rem 0.8rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-top: 4px solid var(--area-c, var(--accent));
  font-size: 0.8125rem;
  line-height: 1.45;
  pointer-events: none;
  --lead: 0.9rem;
  opacity: 0;
  visibility: hidden;
}
.metros__card.is-on {
  opacity: 1;
  visibility: visible;
}
.metros__card[data-area="Northeast"] { --area-c: var(--area-northeast); }
.metros__card[data-area="Mid-Atlantic & South"] { --area-c: var(--area-midatlantic); }
.metros__card[data-area="Midwest"] { --area-c: var(--area-midwest); }
.metros__card[data-area="Texas & Plains"] { --area-c: var(--area-texas); }
.metros__card[data-area="Mountain West"] { --area-c: var(--area-mountain); }
.metros__card[data-area="Pacific"] { --area-c: var(--area-pacific); }
.metros__card[data-area="Europe"] { --area-c: var(--line-blue-lit); }
.metros__card[data-area="Asia"] { --area-c: var(--line-red-lit); }
.metros__card[data-area="South America"] { --area-c: var(--line-green-lit); }
.metros__card[data-x="c"][data-y="below"] { transform: translate(-50%, var(--lead)); }
.metros__card[data-x="l"][data-y="below"] { transform: translate(-0.6rem, var(--lead)); }
.metros__card[data-x="r"][data-y="below"] { transform: translate(calc(-100% + 0.6rem), var(--lead)); }
.metros__card[data-x="c"][data-y="above"] { transform: translate(-50%, calc(-100% - var(--lead))); }
.metros__card[data-x="l"][data-y="above"] { transform: translate(-0.6rem, calc(-100% - var(--lead))); }
.metros__card[data-x="r"][data-y="above"] { transform: translate(calc(-100% + 0.6rem), calc(-100% - var(--lead))); }
/* The hairline leader from the plate to the station. */
.metros__card::before {
  content: "";
  position: absolute;
  inline-size: 1px;
  block-size: var(--lead);
  background: var(--ink);
  inset-inline-start: 50%;
}
.metros__card[data-x="l"]::before { inset-inline-start: 0.6rem; }
.metros__card[data-x="r"]::before { inset-inline-start: auto; inset-inline-end: 0.6rem; }
.metros__card[data-y="below"]::before { inset-block-start: calc(-1 * var(--lead) - 4px); }
.metros__card[data-y="above"]::before { inset-block-end: calc(-1 * var(--lead)); }
.metros__card-name { font-family: var(--display); font-weight: 600; color: var(--ink); text-wrap: balance; font-size: 1.25rem; line-height: 1.05; margin: 0 0 0.1rem; max-width: none; }
.metros__card-sub { margin: 0 0 0.5rem; color: var(--ink-3); font-size: 0.75rem; font-family: var(--mono); }
.metros__card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.45rem;
}
.metros__card dt { color: var(--ink-3); }
.metros__card dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.metros__card-edition {
  margin: 0.55rem 0 0;
  display: inline-block;
  padding: 0.25rem 0.5rem 0.2rem 0.45rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ground);
  background: var(--ink);
  border-inline-start: 3px solid var(--plate-accent);
}
.metros__card-edition[data-free] { background: var(--accent); color: var(--on-accent); border-inline-start-color: var(--ink); }
.metros__card-src {
  margin: 0.4rem 0 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Honest empty state on a continent that has no metros in the game. */
.metros__empty {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  max-inline-size: 36ch;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-inline-start: 6px solid var(--accent);
  font-size: 0.9375rem;
  color: var(--ink-2);
  z-index: 2;
}
.metros__empty b { color: var(--ink); font-weight: 600; }
.metros__empty p { margin: 0; }
.metros__empty p + p { margin-top: 0.4rem; }

/* ── Difficulty ticks: the game's own 1–3 scale ───────────────────────── */

.ticks { display: inline-flex; gap: 2px; vertical-align: -0.1em; margin-inline-end: 0.4rem; }
.ticks i { display: block; inline-size: 0.35rem; block-size: 0.85rem; background: var(--rule-2); }
.ticks[data-level="1"] i:nth-child(-n+1),
.ticks[data-level="2"] i:nth-child(-n+2),
.ticks[data-level="3"] i:nth-child(-n+3) { background: var(--ink); }

/* ── The ledger of all metros ─────────────────────────────────────────── */

.metros__list { margin-top: 1.5rem; border-top: 2px solid var(--ink); }
.metros__list summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}
.metros__list summary::-webkit-details-marker { display: none; }
.metros__list summary::before {
  content: "+";
  font-family: var(--mono);
  font-size: 1.1rem;
  inline-size: 1.5rem;
  block-size: 1.5rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ink);
  flex: none;
}
.metros__list[open] summary::before { content: "−"; }
.metros__list summary small { font-family: var(--mono); font-weight: 400; font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.metros__list .table-scroll { margin-top: 0; }

.metros__table { min-width: 46rem; }
.metros__table thead th button {
  all: unset;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.metros__table thead th button:hover { color: var(--accent); }
.metros__table thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.metros__table thead th[aria-sort="ascending"] button::after { content: "↑"; font-family: var(--mono); }
.metros__table thead th[aria-sort="descending"] button::after { content: "↓"; font-family: var(--mono); }
.metros__table tbody th a {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.metros__table tbody th a:hover { color: var(--accent); text-decoration: underline; }
.metros__table tbody th { white-space: nowrap; }
.metros__table tbody tr:hover,
.metros__table tbody tr[data-on] { background: var(--ground-2); }
.metros__table .num { text-align: right; }
.metros__table .rail-none { color: var(--ink-3); }
.metros__table .region small { display: block; color: var(--ink-3); font-size: 0.8125rem; }
.metros__table .page a { font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }
.metros__table tr[data-week] th a { color: var(--accent); }
.metros__table tr[data-week] th { box-shadow: inset 4px 0 0 var(--accent); padding-inline-start: 0.6rem; }
.metros__table tr[data-on]:not([data-week]) th { box-shadow: inset 4px 0 0 var(--ink); padding-inline-start: 0.6rem; }

/* The small plate the thirteen carry. */
.metros__free {
  display: inline-block;
  margin-inline-start: 0.5rem;
  vertical-align: 0.15em;
  padding: 0.22rem 0.4rem 0.18rem 0.35rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ground);
  background: var(--ink);
  border-inline-start: 3px solid var(--plate-accent);
}
tr[data-week] .metros__free { background: var(--accent); border-inline-start-color: var(--ink); color: var(--on-accent); }

/* ── Motion ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  /* is-swap is added only when the plate actually changes, so the first
     paint of North America (already in the HTML) does not fade in again. */
  .metros__panel.is-on.is-swap {
    animation: mm-plate-in 400ms var(--ease-land) both;
  }
  .metros__panel.is-leaving {
    animation: mm-plate-out 280ms cubic-bezier(0.4, 0, 1, 1) both;
  }
  .metros__panel.is-arriving .mm-land path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: mm-draw 720ms var(--ease-land) forwards;
  }
  .metros__panel.is-arriving .mm-dot {
    animation: mm-dot-in 380ms var(--ease-land) both;
    animation-delay: calc(160ms + var(--i, 0) * 16ms);
  }
  .metros__card {
    transition: opacity 140ms var(--ease-land), visibility 140ms;
  }
}
@keyframes mm-plate-in {
  from { opacity: 0; transform: translateY(0.55rem); }
  to { opacity: 1; transform: none; }
}
@keyframes mm-plate-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-0.45rem); }
}
@keyframes mm-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes mm-dot-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .mm-week__ring { animation: none; transform: scale(1.4); opacity: 0.85; }
  .mm-dot circle, .mm-dot rect, .metros__tabs [role="tab"]::before, .metros__tabs [role="tab"] { transition: none; }
  .metros__panel.is-on, .metros__panel.is-on.is-swap, .metros__panel.is-leaving, .metros__panel.is-arriving .mm-land path, .metros__panel.is-arriving .mm-dot {
    animation: none;
  }
  .metros__card { transition: none; }
}

/* Narrow screens: the plate's lettering would scale below legibility, so
   only the ring marks the week on the map; the line above the map names it. */
@media (max-width: 640px) {
  .mm-week__plate, .mm-week__point, .mm-week__tick, .mm-week__text { display: none; }
  .mm-inset__label { display: none; }
}
/* A phone: the state hairlines would be a grey mesh at this size; the coast
   and the stations carry the map. */
@media (max-width: 479.98px) {
  .mm-states { display: none; }
}

@media print {
  .metros__bar, .metros__card { display: none !important; }
}

/* A phone: the ledger scrolls inside its box (table-scroll), and the region
   column stops wrapping into three lines; the summary's figures drop under
   its title rather than squeezing beside it. */
@media (max-width: 640px) {
  .metros__list summary { flex-wrap: wrap; }
  .metros__list summary small { flex: 1 1 100%; padding-inline-start: 2.2rem; }
  .metros__table .region { white-space: nowrap; }
}

/* After the `all: unset` reset above: the ledger's sort buttons stay 44 px rows on phones. */
@media (pointer: coarse), (max-width: 767.98px) {
  .metros__table thead th button { min-block-size: 2.75rem; }
}
