/* =====================================================================
   fairmaps.ca : maps.css
   ---------------------------------------------------------------------
   BASE (map engine, fm-core.js): map container, MapLibre controls,
   riding labels, legend, tooltip, WebGL-unavailable message.
   Uses the --fm-* tokens from site.css (with fallbacks, so the engine
   also works on pages that do not load site.css).

   Party colours are data colours: they appear here only inside the
   legend swatches and label chips. No PIA red in map chrome.

   Type scale: the site's tokens (site.css), one size per job (R9):
     sub    var(--fm-text-sub)  18 to 20 px: titles inside the map section (riding, table, figures)
     body   var(--fm-text)      17 px phones, 18 px desktop: the tabs that choose a map
     small  var(--fm-text-sm)   15 px: controls, captions, notes, table cells, panel facts
     xs     var(--fm-text-xs)   13 px: labels in small caps, and type drawn inside the map frame
   Inside the map canvas only: riding labels 13 px (12 px for the smallest) and the map credits 12 px.

   Other engineers: append your styles ONLY inside your marked section
   at the end of this file (explorer, focus). Do not edit the base.
   ===================================================================== */

/* --- Map container ---------------------------------------------------- */
.fm-map {
  position: relative;
  min-height: 300px;
  background: var(--fm-paper, #FAF7F4);
  border-radius: inherit;
  overflow: hidden;
  font-family: var(--fm-font-body, "Public Sans", system-ui, sans-serif);
  color: var(--fm-ink, #141414);
  -webkit-tap-highlight-color: transparent;
}
.fm-map .maplibregl-canvas { outline: none; }
.fm-map .maplibregl-canvas:focus-visible {
  outline: 3px solid var(--fm-ink, #141414);
  outline-offset: -3px;
}
.fm-map.maplibregl-map { font: inherit; }

/* --- Controls (MapLibre, restyled light) ------------------------------ */
.fm-map .maplibregl-ctrl-group {
  background: var(--fm-white, #fff);
  border-radius: var(--fm-radius-sm, 8px);
  box-shadow: 0 0 0 1px var(--fm-line, #D8CFC8);
  overflow: hidden;
}
.fm-map .maplibregl-ctrl-group:not(:empty) { box-shadow: 0 0 0 1px var(--fm-line, #D8CFC8); }
.fm-map .maplibregl-ctrl-group button { width: 36px; height: 36px; }
.fm-map .maplibregl-ctrl-group button + button { border-top: 1px solid var(--fm-stone-2, #EFEAE5); }
/* zoom and full screen read as one box: the second group joins the first with a single hairline */
.fm-map .maplibregl-ctrl-top-right .maplibregl-ctrl-group:has(+ .maplibregl-ctrl-group) { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.fm-map .maplibregl-ctrl-top-right .maplibregl-ctrl-group + .maplibregl-ctrl-group { margin-top: 0; border-top: 1px solid var(--fm-stone-2, #EFEAE5); border-top-left-radius: 0; border-top-right-radius: 0; }
.fm-map .maplibregl-ctrl button:not(:disabled):hover { background-color: var(--fm-paper, #FAF7F4); }
.fm-map .maplibregl-ctrl button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--fm-ink, #141414);
}
.fm-map .maplibregl-ctrl-top-right,
.fm-map .maplibregl-ctrl-top-left { padding-top: 2px; }
.fm-map .maplibregl-ctrl-scale {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--fm-ink-2, #3D3935);
  color: var(--fm-ink-2, #3D3935);
  font-size: 12px;
  line-height: 1.4;
}
.fm-map .maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, 0.85);
  color: var(--fm-ink-2, #3D3935);
  font-size: 12px;
}
.fm-map .maplibregl-ctrl-attrib a { color: inherit; }
.fm-map .maplibregl-ctrl-attrib.maplibregl-compact { border-radius: var(--fm-radius-sm, 8px); }
/* phones: the compass shows only while the map is tilted or turned (fm-core toggles .is-tilted) */
@media (max-width: 719.98px) {
  .fm-map:not(.is-tilted) .maplibregl-ctrl-compass { display: none; }
}
/* 44px touch targets on phones and tablets */
@media (pointer: coarse) {
  .fm-map .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  /* the credit's (i) button keeps its small look but gets a 44px hit area */
  .fm-map .maplibregl-ctrl-attrib-button { width: 28px; height: 28px; }
  .fm-map .maplibregl-ctrl-attrib-button::after { content: ""; position: absolute; inset: -8px; }
  .fm-legend-toggle { min-height: 44px; }
}

/* --- Riding labels (HTML, never symbol layers) ------------------------ */
.fm-labels {
  position: absolute;
  inset: 0;
  z-index: 1;               /* above the canvas, below the controls (z 2) */
  pointer-events: none;      /* clicks fall through to the map */
  overflow: hidden;
}
.fm-rlabel {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 132px;
  font-family: var(--fm-font-head, "Outfit", system-ui, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--fm-ink, #141414);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 4px #fff, 0 0 6px rgba(255, 255, 255, 0.9);
  will-change: transform;
  transition: opacity 0.18s ease;
}
.fm-rlabel.is-hidden { visibility: hidden; opacity: 0; }
.fm-rlabel.is-dim { opacity: 0.45; }
.fm-rlabel.is-selected { font-weight: 800; }
.fm-rlabel-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 1px rgba(20, 20, 20, 0.12);
  font-family: var(--fm-font-body, "Public Sans", system-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: none;
  color: var(--fm-ink-2, #3D3935);
}
.fm-rlabel-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
@media (min-width: 900px) {
  .fm-rlabel { max-width: 150px; }
}

/* --- Legend (a MapLibre control, bottom-left) ------------------------- */
/* Wide maps: a small card. Narrow maps (.is-compact): a "Key" chip that opens the card. */
.fm-legend.maplibregl-ctrl {
  margin: 0 0 6px 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--fm-radius-sm, 8px);
  box-shadow: 0 0 0 1px var(--fm-line, #D8CFC8);
  font-size: var(--fm-text-xs, 0.8125rem);
  line-height: 1.3;
  color: var(--fm-ink-2, #3D3935);
  pointer-events: auto;
}
.fm-legend-body { padding: 8px 10px 8px; }
.fm-legend:not(.is-open) .fm-legend-body { display: none; }
.fm-legend-toggle {
  display: none; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 10px;
  border: 0; border-radius: var(--fm-radius-sm, 8px); background: transparent; color: var(--fm-ink, #141414);
  font: inherit; font-family: var(--fm-font-head, "Outfit", system-ui, sans-serif); font-weight: 700; font-size: var(--fm-text-sm, 0.9375rem); cursor: pointer;
}
.fm-legend-toggle:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--fm-ink, #141414); }
.fm-legend.is-compact .fm-legend-toggle { display: inline-flex; }
.fm-legend.is-compact.is-open .fm-legend-toggle { width: 100%; border-bottom: 1px solid var(--fm-stone-2, #EFEAE5); border-radius: var(--fm-radius-sm, 8px) var(--fm-radius-sm, 8px) 0 0; }
.fm-legend-mini { display: inline-flex; flex-direction: column; gap: 2px; }
.fm-legend-mini span { display: flex; }
.fm-legend-mini i { width: 9px; height: 6px; opacity: 0.72; }
.fm-legend.is-open .fm-legend-mini { display: none; }
.fm-legend-title {
  margin: 0 0 5px;
  font-family: var(--fm-font-head, "Outfit", system-ui, sans-serif);
  font-size: var(--fm-text-sm, 0.9375rem);
  font-weight: 700;
  color: var(--fm-ink, #141414);
}
.fm-legend-row {
  display: grid;
  grid-template-columns: 34px auto;
  align-items: center;
  gap: 4px;
  margin: 0 0 3px;
}
.fm-legend-party { font-weight: 600; color: var(--fm-ink, #141414); }
.fm-legend-ramp { display: flex; background: var(--fm-paper, #FAF7F4); border-radius: 3px; }
/* swatches at the same opacity as the fills on the map */
.fm-legend-ramp span { width: 24px; height: 12px; opacity: var(--fm-swatch-op, 0.72); }
.fm-legend-ramp span:first-child { border-radius: 3px 0 0 3px; }
.fm-legend-ramp span:last-child { border-radius: 0 3px 3px 0; }
.fm-legend-ticks { position: relative; height: 18px; margin-left: 38px; width: 120px; font-size: var(--fm-text-xs, 0.8125rem); color: var(--fm-muted, #5E5650); font-variant-numeric: tabular-nums; }
.fm-legend-ticks span { position: absolute; top: 0; transform: translateX(-50%); line-height: 18px; }
.fm-legend-ends {
  display: flex;
  justify-content: space-between;
  margin-left: 38px;
  width: 120px;
  font-size: var(--fm-text-xs, 0.8125rem);
  color: var(--fm-muted, #5E5650);
}
.fm-legend-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fm-legend-key {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--fm-stone-2, #EFEAE5);
  max-width: 180px;
}
.fm-legend-key svg { flex: none; }

/* --- Tooltip (hover, mouse only) -------------------------------------- */
.fm-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  min-width: 160px;
  max-width: 240px;
  padding: 8px 10px;
  background: var(--fm-white, #fff);
  border-radius: var(--fm-radius-sm, 8px);
  box-shadow: 0 2px 4px rgba(20, 20, 20, 0.06), 0 12px 28px -10px rgba(20, 20, 20, 0.3);
  font-size: var(--fm-text-xs, 0.8125rem);
  line-height: 1.35;
  color: var(--fm-ink, #141414);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.fm-tip.is-on { opacity: 1; }
.fm-tip-name {
  display: block;
  margin-bottom: 2px;
  font-family: var(--fm-font-head, "Outfit", system-ui, sans-serif);
  font-size: var(--fm-text-sm, 0.9375rem);
  font-weight: 700;
}
.fm-tip-line { display: block; color: var(--fm-ink-2, #3D3935); }
.fm-tip-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  margin-top: 6px;
}
.fm-tip-bar span { display: block; height: 100%; border-radius: 2px; }
.fm-tip-bar span[style*="width:0%"] { display: none; }

/* --- WebGL unavailable / data failed ---------------------------------- */
.fm-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--fm-paper, #FAF7F4);
  text-align: center;
}
.fm-map-fallback p {
  max-width: 34em;
  margin: 0;
  font-size: var(--fm-text-sm, 0.9375rem);
  line-height: 1.5;
  color: var(--fm-ink-2, #3D3935);
}
.fm-map-fallback strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--fm-font-head, "Outfit", system-ui, sans-serif);
  font-size: var(--fm-text, 1.0625rem);
  color: var(--fm-ink, #141414);
}

@media (prefers-reduced-motion: reduce) {
  .fm-rlabel, .fm-tip { transition: none; }
}

/* === explorer === */
/* Explorer (explorer.js). Mobile first; 720px = tablet, 1000px = riding panel beside the map.
   The map comes first. One slim bar of controls above it, set in type: selected = ink weight plus an
   underline that slides; focus = the site's focus ring; hover = ink. No tiles, pills, tinted boxes or
   shadows on controls. Party colours appear only as data (fills, result tints, seat bars). */
.fm-explorer { position: relative; }
.fmx { --fmx-gap: var(--fm-space-4, 1rem); display: flex; flex-direction: column; font-size: var(--fm-text, 1.0625rem); }
.fmx [hidden] { display: none !important; }
.fmx-ico { flex: none; }
.fmx-small { display: block; margin-top: 2px; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.4; color: var(--fm-muted); }
.fmx-input {
  width: 100%; min-height: 44px; padding: 0.5rem 0.8rem;
  border: 1px solid var(--fm-field, #8C8178); border-radius: var(--fm-radius-sm);
  background: var(--fm-white); color: var(--fm-ink);
  font: inherit; font-size: var(--fm-text, 1.0625rem); line-height: 1.3;
  transition: border-color 0.15s ease;
}
.fmx-input::placeholder { color: #7A706A; }
.fmx-input:hover { border-color: var(--fm-ink-2); }
.fmx-input:focus { outline: none; border-color: var(--fm-ink); box-shadow: var(--fm-focus); }
.fmx-select { position: relative; }
.fmx-select select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer; }
.fmx-select::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 1.5px solid var(--fm-ink); border-bottom: 1.5px solid var(--fm-ink); transform: rotate(45deg); pointer-events: none;
}
/* a plain text action: ink, underlined on hover */
.fmx-textbtn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--fm-ink); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; text-decoration-color: var(--fm-line);
}
.fmx-textbtn:hover { text-decoration-color: currentColor; }
/* an inline text action keeps its line height; on touch screens an invisible box makes it a 44px target */
@media (pointer: coarse) {
  .fmx-textbtn { position: relative; }
  .fmx-textbtn::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; margin-top: -22px; }
}
.fmx-textbtn:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 3px; }

/* the sliding underline shared by every choice in the explorer */
.fmx-ink {
  position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--fm-ink); pointer-events: none;
  transition: transform var(--fm-dur-move, 280ms) var(--fm-ease), width var(--fm-dur-move, 280ms) var(--fm-ease), opacity var(--fm-dur-fast, 150ms) ease-out;
}

/* --- the bar ---------------------------------------------------------- */
.fmx-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; }
.fmx-find { flex: 1 1 100%; min-width: 0; order: 1; }
.fmx-cmpbtn { order: 3; }
.fmx-choose { order: 4; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 22px; min-width: 0; }
.fmx-combo { position: relative; }
.fmx-combo > .fmx-ico { position: absolute; left: 12px; top: 12px; color: var(--fm-muted); pointer-events: none; }
.fmx-combo .fmx-input { padding-left: 2.5rem; padding-right: 3rem; }
.fmx-locate {
  position: absolute; right: 2px; top: 2px; display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--fm-radius-xs, 4px); background: none; color: var(--fm-ink-2); cursor: pointer;
  transition: color var(--fm-dur-fast, 150ms) ease-out;
}
@media (hover: hover) { .fmx-locate:hover { color: var(--fm-red-deep); } }
.fmx-locate:focus-visible { outline: none; box-shadow: var(--fm-focus); }
.fmx-locate[disabled] { opacity: 0.5; cursor: progress; }
.fmx-combo__list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none; max-height: min(360px, 60vh); overflow-y: auto;
  background: var(--fm-white); border: 1px solid var(--fm-line); border-radius: var(--fm-radius-sm);
  box-shadow: var(--fm-shadow-lg);
}
.fmx-opt { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 10px; border-radius: var(--fm-radius-xs, 4px); cursor: pointer; }
.fmx-opt:hover { background: var(--fm-paper); }
.fmx-opt.is-active { background: var(--fm-paper); }
.fmx-opt__main { font-weight: 600; line-height: 1.25; }
.fmx-opt__sub { font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); line-height: 1.3; }

.fmx-who { position: relative; display: flex; flex-wrap: wrap; column-gap: 20px; box-shadow: inset 0 -1px 0 var(--fm-line); }
/* who drew it is the first choice, set at body size; every other choice in the bar is small */
.fmx-who__btn { font-size: var(--fm-text, 1.0625rem); }
.fmx-who__btn, .fmx-which__btn, .fmx-mode__btn, .fmx-flip__btn, .fmx-tab {
  position: relative; min-height: 44px; padding: 10px 0 9px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font-family: var(--fm-font-head); font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.2; color: var(--fm-ink-2);
  -webkit-tap-highlight-color: transparent; transition: color 0.15s ease;
}
.fmx-who__btn:hover, .fmx-which__btn:hover:not([disabled]), .fmx-mode__btn:hover:not([disabled]), .fmx-flip__btn:hover, .fmx-tab:hover { color: var(--fm-ink); }
.fmx-who__btn[aria-checked="true"], .fmx-which__btn[aria-checked="true"], .fmx-mode__btn[aria-checked="true"], .fmx-flip__btn[aria-checked="true"], .fmx-tab[aria-selected="true"] { color: var(--fm-ink); font-weight: 800; }
.fmx-who__btn:focus-visible, .fmx-which__btn:focus-visible, .fmx-mode__btn:focus-visible, .fmx-flip__btn:focus-visible, .fmx-tab:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
.fmx-now { display: inline-block; width: 7px; height: 7px; margin: 0 0 0 5px; border-radius: 50%; background: var(--fm-red); vertical-align: 0.5em; }
.fmx-which { position: relative; display: flex; gap: 16px; }
.fmx-which.is-off { visibility: hidden; }
.fmx-cmpbtn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font-family: var(--fm-font-head); font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); white-space: nowrap;
}
.fmx-cmpbtn:hover { color: var(--fm-ink); }
.fmx-cmpbtn.is-on, .fmx-cmpbtn[aria-expanded="true"] { color: var(--fm-ink); font-weight: 800; }
.fmx-cmpbtn:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
.fmx-cmp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0 2px; }
.fmx-cmp__lab { font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-cmp .fmx-select { flex: 1 1 240px; max-width: 420px; }
.fmx-mode { position: relative; display: flex; gap: 16px; }
.fmx-mode.is-off { display: none; }
.fmx-mode__btn[disabled] { cursor: not-allowed; }

.fmx-caption { margin: 10px 0 0; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.45; color: var(--fm-ink-2); }
.fmx-caption b { font-family: var(--fm-font-head); font-weight: 700; color: var(--fm-ink); }
.fmx-msg { margin: 4px 0 0; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.45; color: var(--fm-ink); }

/* --- stage: map(s) and the riding panel ------------------------------ */
.fmx-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fmx-gap); margin-top: 12px; --fmx-peek: 0px; }
.fmx-mapcol { min-width: 0; display: flex; flex-direction: column; }
/* below 1000px the sheet belongs to the map, not to the lines under it: the map column
   dissolves into the stage grid and the sheet takes the map's own row as its box */
@media (max-width: 999.98px) {
  .fmx-stage { overflow: hidden; overflow: clip; row-gap: 0; }
  .fmx-mapcol { display: contents; }
  .fmx-flip { grid-row: 1; }
  .fmx-maps { grid-row: 2; }
  .fmx-changed { grid-row: 3; }
  .fmx-jumps { grid-row: 4; }
  .fmx-card { grid-row: 2 / 3; grid-column: 1 / 2; } /* both lines: an abspos item with an auto end runs to the stage edge */
}
.fmx-flip { position: relative; display: flex; gap: 18px; margin-bottom: 6px; box-shadow: inset 0 -1px 0 var(--fm-line); }
.fmx-flip__btn { overflow: hidden; text-overflow: ellipsis; }
.fmx-maps { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.fmx-mapbox {
  position: relative; min-width: 0; height: clamp(360px, 60svh, 540px);
  border-radius: var(--fm-radius); overflow: hidden; border: 1px solid var(--fm-line); background: var(--fm-paper);
}
.fmx-map { position: absolute; inset: 0; min-height: 0; }
/* view controls on the map: one small instrument, top left */
.fmx-mapctl {
  position: absolute; z-index: 5; left: 10px; top: 10px; display: flex; flex-wrap: wrap; align-items: stretch; max-width: calc(100% - 64px);
  background: rgba(255, 255, 255, 0.96); border: 1px solid var(--fm-line); border-radius: var(--fm-radius-sm);
}
.fmx-layer { display: flex; }
.fmx-mapctl__btn {
  min-height: 38px; padding: 0 11px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font-family: var(--fm-font-head); font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2);
  -webkit-tap-highlight-color: transparent;
}
.fmx-mapctl__btn:hover { color: var(--fm-ink); }
.fmx-mapctl__btn[aria-checked="true"], .fmx-mapctl__btn[aria-pressed="true"] { color: var(--fm-ink); font-weight: 800; box-shadow: inset 0 -2px 0 var(--fm-ink); }
.fmx-mapctl__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--fm-ink); border-radius: 6px; }
.fmx-3d { border-left: 1px solid var(--fm-line); }
.fmx-maptag {
  position: absolute; z-index: 4; left: 10px; top: 58px; max-width: calc(100% - 80px); margin: 0; padding: 3px 8px;
  border-radius: 4px; background: rgba(255, 255, 255, 0.94); font-family: var(--fm-font-head); font-weight: 700; font-size: var(--fm-text-xs, 0.8125rem);
  line-height: 1.25; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fmx-mapbox--b .fmx-maptag { top: 10px; }
.fmx:not(.is-side) .fmx-maptag, .fmx-maps.is-flip .fmx-maptag { display: none; }
.fmx-status {
  position: absolute; z-index: 7; left: 50%; top: 58px; transform: translateX(-50%); max-width: calc(100% - 24px); margin: 0; padding: 7px 12px;
  border-radius: var(--fm-radius-sm); background: var(--fm-ink); color: var(--fm-white); font-size: var(--fm-text-sm, 0.9375rem); font-weight: 600; line-height: 1.35;
  text-align: center; pointer-events: none;
}
.fmx-status:empty { visibility: hidden; }
/* Google's 3D view sits over the flat map; its own logo and credit stay uncovered */
.fmx-g3d { position: absolute; inset: 0; z-index: 3; background: #D9D3CC; }
.fmx-g3d > * { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fmx-stage.sheet-open .fmx-g3d { bottom: var(--fmx-peek); transition: bottom 0.25s var(--fm-ease); }
.fmx.is-g3d .fmx-mapbox--a .maplibregl-ctrl-top-right,
.fmx.is-g3d .fmx-mapbox--a .maplibregl-ctrl-bottom-right,
.fmx.is-g3d .fmx-mapbox--a .maplibregl-ctrl-scale,
.fmx.is-g3d .fmx-mapbox--a .fm-labels { visibility: hidden; }
.fmx.is-g3d .fmx-mapbox--a .maplibregl-ctrl-bottom-left { z-index: 4; top: 56px; bottom: auto; }
.fmx.is-g3d .fmx-mapbox--a .maplibregl-ctrl-bottom-left .fm-legend { margin: 0 0 0 10px; }
.fmx.is-g3d .fmx-layer { display: none; }
.fmx.is-g3d .fmx-3d { border-left: 0; }
.fmx-g3dctl { position: absolute; z-index: 5; right: 10px; top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fmx-g3dctl__btn {
  display: grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0 10px; border: 1px solid var(--fm-line);
  border-radius: var(--fm-radius-sm); background: rgba(255, 255, 255, 0.96); color: var(--fm-ink); cursor: pointer;
  font-family: var(--fm-font-head); font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); white-space: nowrap;
}
.fmx-g3dctl__btn:hover { background: var(--fm-white); }
.fmx-g3dctl__btn[aria-pressed="true"] { font-weight: 800; box-shadow: inset 0 -2px 0 var(--fm-ink); }
.fmx-g3dctl__btn:focus-visible { outline: none; box-shadow: var(--fm-focus); }
/* phone side by side: the two maps share one box, the switch above flips them */
.fmx-maps.is-flip { grid-template-columns: minmax(0, 1fr); }
.fmx-maps.is-flip .fmx-mapbox--b { position: absolute; inset: 0; visibility: hidden; }
.fmx-maps.is-flip.show-b .fmx-mapbox--b { visibility: visible; }
.fmx-maps.is-flip.show-b .fmx-mapbox--a { visibility: hidden; }
/* legend and credit stay above the open sheet; on a phone the scale bar steps aside so nothing stacks */
@media (max-width: 719.98px) {
  .fmx-stage.sheet-open .maplibregl-ctrl-scale { display: none; }
}
.fmx-stage.sheet-open .fmx-mapbox .maplibregl-ctrl-bottom-left,
.fmx-stage.sheet-open .fmx-mapbox .maplibregl-ctrl-bottom-right { transform: translateY(calc(-1 * var(--fmx-peek))); transition: transform 0.25s var(--fm-ease); }
.fmx.is-g3d .fmx-stage.sheet-open .fmx-mapbox--a .maplibregl-ctrl-bottom-left { transform: none; }
/* opened all the way, the sheet is the focus: the legend and the Explore button step out rather than peek from under it */
.fmx-stage.sheet-full .fmx-mapbox .maplibregl-ctrl-bottom-left,
.fmx-stage.sheet-full .fmx-touch { visibility: hidden; }

.fmx-changed { margin: 10px 0 0; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.5; color: var(--fm-ink-2); }
.fmx-jumps { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 16px; margin-top: 2px; }
.fmx-jumps__label { font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); }
.fmx-jumps__list { display: flex; flex-wrap: wrap; gap: 0 16px; }
.fmx-jump {
  min-height: 36px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: var(--fm-text-sm, 0.9375rem); font-weight: 600;
  color: var(--fm-ink-2); text-decoration: underline; text-decoration-color: var(--fm-line); text-underline-offset: 3px;
}
.fmx-jump:hover { color: var(--fm-ink); text-decoration-color: currentColor; }
.fmx-jump:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 3px; }

/* the riding panel: a bottom sheet over the map below 1000px, a column beside it above */
.fmx-card {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  max-height: min(82%, 640px); display: flex; flex-direction: column;
  background: var(--fm-white); border-radius: 16px 16px var(--fm-radius) var(--fm-radius);
  box-shadow: 0 -1px 0 var(--fm-line), 0 -12px 32px -18px rgba(20, 20, 20, 0.35);
  transform: translateY(calc(100% + 24px)); visibility: hidden;
  transition: transform 0.28s var(--fm-ease), visibility 0s linear 0.28s;
}
.fmx-card[data-sheet="peek"] { visibility: visible; transform: translateY(calc(100% - var(--fmx-peek) + var(--fmx-drag, 0px))); transition: transform 0.28s var(--fm-ease); }
.fmx-card[data-sheet="full"] { visibility: visible; transform: translateY(max(0px, var(--fmx-drag, 0px))); transition: transform 0.28s var(--fm-ease); }
/* below 1000px the part of the sheet pushed below the map is cut at the map's edge,
   so it never covers the lines under the map */
@media (max-width: 999.98px) {
  /* opened all the way, the sheet still leaves at least 40% of the map in view; its body scrolls inside */
  .fmx-card { max-height: 60%; }
  .fmx-card { clip-path: inset(-48px -48px calc(100% + 24px) -48px); transition: transform 0.28s var(--fm-ease), clip-path 0.28s var(--fm-ease), visibility 0s linear 0.28s; }
  .fmx-card[data-sheet="peek"] { clip-path: inset(-48px -48px calc(100% - var(--fmx-peek) + var(--fmx-drag, 0px)) -48px); transition: transform 0.28s var(--fm-ease), clip-path 0.28s var(--fm-ease); }
  .fmx-card[data-sheet="full"] { clip-path: inset(-48px -48px max(0px, var(--fmx-drag, 0px)) -48px); transition: transform 0.28s var(--fm-ease), clip-path 0.28s var(--fm-ease); }
}
.fmx-card.is-dragging { transition: none; }
.fmx-card__grab { position: relative; flex: none; height: 26px; touch-action: none; cursor: grab; }
.fmx-card__handle { position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--fm-line); }
.fmx-card__close {
  position: absolute; right: 4px; top: 2px; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--fm-radius-xs, 4px); background: transparent; color: var(--fm-ink-2); cursor: pointer;
  transition: color var(--fm-dur-fast, 150ms) ease-out;
}
@media (hover: hover) { .fmx-card__close:hover { color: var(--fm-red-deep); } }
.fmx-card__close:focus-visible { outline: none; box-shadow: var(--fm-focus); }
.fmx-card__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--fm-space-4) var(--fm-space-4); outline: none; }
.fmx-card[data-sheet="peek"] .fmx-card__body { overflow: hidden; }
.fmx-card[data-sheet="peek"] .fmx-card__peek { cursor: pointer; touch-action: none; }
.fmx-card__on { margin: 0; padding-right: 40px; font-size: var(--fm-text-sm, 0.9375rem); font-weight: 600; color: var(--fm-muted); }
.fmx-card__name { margin: 1px 0 1px; padding-right: 36px; font-size: var(--fm-text-sub, 1.25rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; }
h4.fmx-card__name { font-size: var(--fm-text, 1.0625rem); padding-right: 0; }
.fmx-card__meta { margin: 0 0 var(--fm-space-3); font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); }
.fmx-result { margin: 0 0 var(--fm-space-2); }
.fmx-result__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); }
.fmx-result__p { white-space: nowrap; }
.fmx-result__p b { margin-left: 3px; color: var(--fm-ink); }
.fmx-margin { padding: 3px 9px; border-radius: 4px; color: var(--fm-ink); font-family: var(--fm-font-head); font-weight: 800; font-size: var(--fm-text-sm, 0.9375rem); white-space: nowrap; }
.fmx-bar { display: flex; gap: 2px; height: 8px; margin: 7px 0 4px; }
.fmx-bar span { display: block; height: 100%; border-radius: 2px; }
.fmx-bar span[style*="width:0%"] { display: none; }
.fmx-bar__oth { opacity: 0.55; }
.fmx-result__note { margin: 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); }
.fmx-card__dl { margin: var(--fm-space-3) 0 0; display: grid; gap: var(--fm-space-3); }
.fmx-card__dl > div { padding-top: var(--fm-space-3); border-top: 1px solid var(--fm-stone-2); }
.fmx-card__dl dt { font-size: var(--fm-text-sm, 0.9375rem); font-weight: 600; color: var(--fm-muted); }
.fmx-card__dl dd { margin: 2px 0 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink); line-height: 1.45; }
.fmx-card__dl dd b { font-family: var(--fm-font-head); font-size: var(--fm-text-sub, 1.25rem); font-variant-numeric: tabular-nums; }
.fmx-scale { margin: 10px 0 2px; }
.fmx-scale__track { position: relative; height: 4px; border-radius: 2px; background: var(--fm-stone); }
.fmx-scale__avg { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--fm-ink-2); }
.fmx-scale__dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--fm-ink); box-shadow: 0 0 0 3px var(--fm-white); }
.fmx-scale__ends { display: flex; justify-content: space-between; gap: 6px; margin-top: 7px; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); }
.fmx-card__from ul { list-style: none; margin: 2px 0 0; padding: 0; }
.fmx-card__from li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-card__from li span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.fmx-changes { margin: var(--fm-space-4) 0 0; padding-top: var(--fm-space-3); border-top: 2px solid var(--fm-ink); }
.fmx-changes__title { margin: 0 0 4px; font-family: var(--fm-font-head); font-weight: 700; font-size: var(--fm-text, 1.0625rem); }
.fmx-changes__list { margin: 0; padding-left: 1.1rem; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.45; color: var(--fm-ink-2); }
.fmx-changes__list li + li { margin-top: 4px; }
.fmx-changes__list b { color: var(--fm-ink); }
.fmx-changes__none { margin: 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); }
.fmx-card__other { margin-top: var(--fm-space-4); padding-top: var(--fm-space-3); border-top: 1px solid var(--fm-line); }
.fmx-card__say { margin: var(--fm-space-4) 0 0; font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-card__empty { padding: var(--fm-space-2) 0; color: var(--fm-ink-2); font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-card__empty p { margin: 0 0 8px; }
.fmx-card__emptytitle { font-family: var(--fm-font-head); font-weight: 800; font-size: var(--fm-text-sub, 1.25rem); color: var(--fm-ink); }
/* a community split among ridings: its ridings as a short list of choices */
.fmx-place__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fm-stone-2); }
.fmx-place__list li { border-bottom: 1px solid var(--fm-stone-2); }
.fmx-place__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 6px 0;
  border: 0; background: none; cursor: pointer; text-align: left; color: var(--fm-ink);
  font-family: var(--fm-font-head); font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.25;
}
.fmx-place__btn .fmx-tint { flex: none; font-family: var(--fm-font-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.fmx-place__btn:hover .fmx-place__n { text-decoration: underline; text-underline-offset: 3px; }
.fmx-place__btn:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 3px; }

/* --- under the map: seats and share ---------------------------------- */
.fmx-under { display: grid; gap: var(--fm-space-5); margin-top: var(--fm-space-5); padding-top: var(--fm-space-4); border-top: 1px solid var(--fm-line); }
.fmx-summary__title { margin: 0 0 var(--fm-space-2); font: 700 var(--fm-text-sub, 1.125rem)/1.3 var(--fm-font-head); letter-spacing: -0.01em; }
.fmx-summary__bars { display: grid; gap: var(--fm-space-4); }
.fmx-summary__note { margin: 8px 0 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); }
.fmx-seats__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 0 0 6px; }
.fmx-seats__map { font-family: var(--fm-font-head); font-weight: 700; font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-seats__nums { display: flex; gap: 14px; font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-seats__p { white-space: nowrap; }
.fmx-seats__p i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; background: var(--c); }
.fmx-seats__p b { font-family: var(--fm-font-head); font-variant-numeric: tabular-nums; }
.fmx-seatbar { position: relative; display: flex; gap: 2px; height: 12px; }
.fmx-seatbar span { display: block; height: 100%; width: 0; border-radius: 2px; transition: width 0.5s var(--fm-ease); }
.fmx-seatbar span[style*="width: 0%"], .fmx-seatbar span[style*="width: 0.000%"] { display: none; }
.fmx-seatbar__maj { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--fm-ink); box-shadow: 0 0 0 1.5px var(--fm-white); transition: left 0.5s var(--fm-ease); }
.fmx-seats__maj { margin: 5px 0 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); }
.fmx-share { display: flex; flex-direction: column; gap: var(--fm-space-3); }
.fmx-share__btns { display: flex; flex-wrap: wrap; gap: var(--fm-space-2); }
.fmx-share__btns .fm-button { flex: 1 1 160px; white-space: nowrap; }
@media (max-width: 479.98px) {
  .fmx-share__btns { flex-direction: column; }
  .fmx-share__btns .fm-button { flex: none; width: 100%; }
}
.fmx-share__hint { margin: 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); }
.fmx-share__hint:empty { display: none; }
.fmx-share__line { margin: 0; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.5; color: var(--fm-ink); }

/* --- table: a heat table, shaded like the map ------------------------- */
.fmx-tablewrap { margin-top: var(--fm-space-6); border-top: 1px solid var(--fm-line); border-bottom: 1px solid var(--fm-line); interpolate-size: allow-keywords; }
.fmx-table__sum { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 8px 0; cursor: pointer; list-style: none; }
.fmx-table__sum::-webkit-details-marker { display: none; }
.fmx-table__sum:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
.fmx-table__title { margin: 0; font: 700 var(--fm-text-sub, 1.125rem)/1.3 var(--fm-font-head); letter-spacing: -0.01em; color: var(--fm-ink); }
.fmx-table__plus { display: none; }
/* the same plus-to-minus glyph as the site's folds */
.fmx-table__sum::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat,
              linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat;
  transition: transform var(--fm-dur-move, 280ms) var(--fm-ease);
}
.fmx-tablewrap[open] > .fmx-table__sum::after { transform: rotate(180deg); background-size: 14px 2px, 2px 0; }
@media (hover: hover) { .fmx-table__sum:hover, .fmx-table__sum:hover .fmx-table__title { color: var(--fm-red-deep); } }
.fmx-tablewrap::details-content { block-size: 0; overflow: clip; transition: block-size var(--fm-dur-move, 280ms) var(--fm-ease), content-visibility var(--fm-dur-move, 280ms) allow-discrete; }
.fmx-tablewrap[open]::details-content { block-size: auto; }
.fmx-tablewrap[open] { padding-bottom: var(--fm-space-4); }
.fmx-tsum { margin: 4px 0 var(--fm-space-3); font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.5; color: var(--fm-ink-2); }
.fmx-tsum b { color: var(--fm-ink); font-weight: 600; }
.fmx-tabs { position: relative; display: flex; gap: 22px; margin-bottom: var(--fm-space-3); box-shadow: inset 0 -1px 0 var(--fm-line); }
.fmx-tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--fm-ink); }
.fmx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.fmx-count { flex: 1 1 100%; margin: 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); }
.fmx-tools__q { flex: 1 1 150px; width: auto; min-width: 0; }
.fmx-tools__rg { flex: 1 1 140px; min-width: 0; }
.fmx-more, .fmx-csv { min-height: 44px; font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-key { margin: 10px 0 6px; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.45; color: var(--fm-ink-2); }
.fmx-key__sw { display: inline-flex; margin-right: 8px; vertical-align: -1px; }
.fmx-key__sw i { width: 14px; height: 12px; }
.fmx-key__sw i:first-child { border-radius: 2px 0 0 2px; }
.fmx-key__sw i:last-child { border-radius: 0 2px 2px 0; }
.fmx-scroll { position: relative; }
.fmx-tablewrap.is-more .fmx-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.fmx-scroll:focus-visible { outline: 3px solid var(--fm-ink); outline-offset: 2px; }
.fmx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.35; font-variant-numeric: tabular-nums; }
.fmx-table thead th {
  position: sticky; top: var(--fm-header-h); z-index: 2; padding: 0; text-align: left; vertical-align: bottom;
  background: var(--fm-paper); box-shadow: inset 0 -1px 0 var(--fm-ink); white-space: nowrap;
}
.fmx-tablewrap.is-more .fmx-table thead th { top: 0; }
.fmx-sort {
  display: inline-flex; align-items: center; gap: 4px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; background: transparent;
  font: inherit; font-size: var(--fm-text-xs, 0.8125rem); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fm-muted);
  text-align: inherit; cursor: pointer; white-space: nowrap;
}
.fmx-table th.num .fmx-sort { justify-content: flex-end; }
.fmx-sort:hover { color: var(--fm-ink); }
.fmx-sort:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--fm-ink); border-radius: 4px; }
.fmx-sort__ico { width: 0.8em; text-align: center; opacity: 0; transition: opacity 0.15s ease; }
.fmx-sort:hover .fmx-sort__ico, .fmx-sort:focus-visible .fmx-sort__ico { opacity: 0.6; }
th[aria-sort="ascending"] .fmx-sort, th[aria-sort="descending"] .fmx-sort { color: var(--fm-ink); }
th[aria-sort="ascending"] .fmx-sort__ico, th[aria-sort="descending"] .fmx-sort__ico { opacity: 1; }
.fmx-table tbody th, .fmx-table tbody td { padding: 6px 10px; border-bottom: 1px solid var(--fm-stone-2); text-align: left; font-weight: 400; vertical-align: middle; }
.fmx-table .num { text-align: right; white-space: nowrap; }
.fmx-table tbody th.col-n { padding: 4px 10px 4px 0; }
.fmx-rowbtn {
  display: block; width: 100%; min-height: 32px; padding: 4px 0; border: 0; background: transparent; cursor: pointer;
  font-family: var(--fm-font-head); font-size: var(--fm-text-sm, 0.9375rem); font-weight: 600; line-height: 1.25; color: var(--fm-ink); text-align: left;
}
.fmx-rowbtn:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 3px; }
.fmx-rowmeta { display: block; padding-bottom: 3px; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.3; color: var(--fm-muted); }
.fmx-table td.col-rg, .fmx-table td.col-t { color: var(--fm-muted); }
.fmx-sort__short { display: none; }
.fmx-tint { display: inline-block; min-width: 4.6em; padding: 4px 8px; border-radius: 4px; color: var(--fm-ink); text-align: right; }
.col-res .fmx-tint { font-weight: 600; }
.fmx-over { display: block; margin-top: 2px; font-size: var(--fm-text-sm, 0.9375rem); font-weight: 600; color: var(--fm-ink-2); }
.fmx-table tbody tr { cursor: pointer; }
.fmx-table tbody tr:hover > * { background: var(--fm-paper); }
.fmx-table tbody tr.is-selected .fmx-rowbtn { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.fmx-table tbody tr.is-selected > * { border-bottom-color: var(--fm-ink); }
.fmx-showall { width: 100%; margin-top: var(--fm-space-4); }
.fmx-empty { text-align: center !important; padding: var(--fm-space-5) !important; color: var(--fm-muted); white-space: normal !important; }
/* phones: riding, result and gap; region and type fold under the name; the rest behind "More columns" */
.fmx-table .is-extra { display: none; }
.fmx-tablewrap.is-more .fmx-table .is-extra { display: table-cell; }
.fmx-tablewrap.is-more .fmx-rowmeta { display: none; }

/* --- share dialog ----------------------------------------------------- */
.fmx-dialog {
  width: min(520px, calc(100vw - 24px)); max-width: none; padding: 0; border: 0; border-radius: var(--fm-radius);
  box-shadow: var(--fm-shadow-lg); color: var(--fm-ink); background: var(--fm-white);
}
.fmx-dialog::backdrop { background: rgba(20, 20, 20, 0.45); }
.fmx-dialog__inner { padding: var(--fm-space-5); }
.fmx-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.fmx-dialog__head h3 { margin: 0; font-size: var(--fm-text-sub, 1.25rem); }
.fmx-dialog__x { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: var(--fm-radius-xs, 4px); background: transparent; color: var(--fm-ink); cursor: pointer; transition: color var(--fm-dur-fast, 150ms) ease-out; }
@media (hover: hover) { .fmx-dialog__x:hover { color: var(--fm-red-deep); } }
.fmx-dialog__x:focus-visible { outline: none; box-shadow: var(--fm-focus); }
.fmx-dialog__lede { margin: 0 0 var(--fm-space-4); color: var(--fm-ink-2); font-size: var(--fm-text-sm, 0.9375rem); }
.fmx-dialog__url { display: flex; gap: var(--fm-space-2); flex-wrap: wrap; }
.fmx-dialog__url .fmx-input { flex: 1 1 220px; min-width: 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); }
.fmx-copied { min-height: 1.4em; margin: 6px 0 var(--fm-space-3); font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); }
.fmx-dialog__nets { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; padding: 0; list-style: none; }
.fmx-dialog__nets .fmx-native-li { flex: 1 1 100%; }
.fmx-net {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--fm-ink); font: inherit; font-size: var(--fm-text-sm, 0.9375rem); font-weight: 400; cursor: pointer;
  text-decoration: underline 1.5px var(--fm-red); text-underline-offset: 0.18em;
  transition: color var(--fm-dur-fast, 150ms) ease-out;
}
a.fmx-net::after { content: "\2197"; display: inline-block; text-decoration: none; color: var(--fm-muted); }
a.fmx-net[href^="mailto:"]::after { content: none; }
.fmx-net:hover { color: var(--fm-red-deep); }
.fmx-net:focus-visible { outline: 3px solid var(--fm-ink); outline-offset: 3px; border-radius: 2px; }
.fmx-dialog__tag { margin: var(--fm-space-4) 0 0; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.5; color: var(--fm-ink); }

@media (max-width: 719.98px) {
  /* three slim rows: search; who drew it; majority or minority with "Compare" (a word, not an icon) at the right */
  .fmx-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "find find" "who who" "which cmp"; gap: 4px 12px; align-items: end; }
  .fmx-find { grid-area: find; }
  .fmx-choose { display: contents; }
  .fmx-who { grid-area: who; gap: 18px; }
  .fmx-which { grid-area: which; }
  .fmx-cmpbtn { grid-area: cmp; justify-self: end; max-width: 100%; min-width: 0; }
  .fmx-cmpbtn__t { overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  .fmx-cmpbtn.is-on, .fmx-cmpbtn[aria-expanded="true"] { box-shadow: inset 0 -2px 0 var(--fm-ink); }
  /* the caption is one line; its full text stays in the page for screen readers */
  .fmx-caption { margin-top: 6px; text-wrap: balance; }
}
/* phones and tablets: riding, result and gap; region and type fold under the name; the rest behind "More columns" */
@media (max-width: 999.98px) {
  .fmx-tablewrap:not(.is-more) .fmx-sort__long { display: none; }
  .fmx-tablewrap:not(.is-more) .fmx-sort__short { display: inline; }
  .fmx-table tbody td.num { padding-left: 4px; padding-right: 0; }
  .fmx-table thead th.num .fmx-sort { padding-right: 0; }
  /* one width per column, so the tints line up as a heat column, not a row of stickers */
  .fmx-tint { padding: 4px 6px; }
  .col-res .fmx-tint { min-width: 5.6em; }
  .col-dev .fmx-tint { min-width: 4.4em; }
  /* compact rows: the region and type sit on one line under the name */
  .fmx-table tbody th.col-n { padding-top: 6px; padding-bottom: 6px; }
  /* the meta line may not widen the name column: the result and gap columns (about 192px) always fit */
  .fmx-rowmeta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 2 * var(--fm-gutter) - 192px); }
}
/* phone: the map's own "Explore this map" switch (the main map starts as part of the page, like the place maps) */
/* above the Key and scale row, so the button never overlaps the legend */
.fmx-touch { position: absolute; z-index: 5; left: 50%; bottom: 84px; transform: translateX(-50%); transition: bottom 0.25s var(--fm-ease); }
/* the button rides above the sheet's peek, like the legend and credit */
.fmx-stage.sheet-open .fmx-touch { bottom: calc(84px + var(--fmx-peek)); }
.fmx-touch .fm-fmap__done { position: static; transform: none; }
.fmx-mapbox.is-idle .maplibregl-canvas-container.maplibregl-interactive,
.fmx-mapbox.is-idle .maplibregl-canvas-container.maplibregl-interactive .maplibregl-canvas { touch-action: pan-y; }
@media (pointer: coarse) {
  .fmx-mapctl__btn { min-height: 44px; }
  .fmx-g3dctl__btn { min-width: 44px; min-height: 44px; }
  .fmx-jump { min-height: 44px; }
  .fmx-rowbtn { min-height: 44px; }
  .fmx-locate { width: 44px; height: 44px; top: 0; right: 0; }
  .fmx-more, .fmx-csv { min-height: 44px; }
  .fmx-sort { min-height: 44px; }
}

/* --- tablet ------------------------------------------------------------ */
@media (min-width: 720px) {
  .fmx-find { flex: 1 1 280px; max-width: 360px; order: 1; }
  .fmx-choose { order: 2; flex: 0 1 auto; }
  .fmx-cmpbtn { order: 3; margin-left: auto; }
  .fmx-controls { align-items: flex-end; gap: 8px 28px; }
  .fmx-which { padding-left: 18px; }
  .fmx-which::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--fm-line); }
  .fmx-which .fmx-ink { left: 0; }
  .fmx-mapbox { height: clamp(460px, 64svh, 620px); }
  .fmx-maps.is-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fmx-under { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: var(--fm-space-6); }
  .fmx-card { left: auto; right: 12px; bottom: 12px; width: min(400px, calc(100% - 24px)); border-radius: var(--fm-radius); }
  .fmx-card[data-sheet="peek"] { transform: translateY(calc(100% - var(--fmx-peek) + var(--fmx-drag, 0px) + 12px)); }
  .fmx-tools__q { flex: 0 1 220px; }
  .fmx-tools__rg { flex: 0 1 200px; }
  .fmx-table tbody th, .fmx-table tbody td { padding-top: 8px; padding-bottom: 8px; }
}

/* --- desktop: the panel beside the map --------------------------------- */
@media (min-width: 1000px) {
  .fmx-stage { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; column-gap: var(--fm-space-6); }
  .fmx-mapbox { height: clamp(520px, calc(100svh - 300px), 680px); }
  .fmx-card {
    position: sticky; top: calc(var(--fm-header-h) + 12px); left: auto; right: auto; bottom: auto; width: auto;
    max-height: calc(100vh - var(--fm-header-h) - 24px); min-height: 0;
    transform: none !important; visibility: visible !important; transition: none;
    border: 0; border-top: 2px solid var(--fm-ink); border-radius: 0; background: transparent; box-shadow: none;
  }
  .fmx-card__grab { height: 0; cursor: default; }
  .fmx-card__handle { display: none; }
  .fmx-card__close { top: 6px; right: -10px; }
  .fmx-card:not(.has-riding) .fmx-card__close { display: none; }
  .fmx-card__body { padding: var(--fm-space-4) 0 var(--fm-space-4); }
  .fmx-card[data-sheet] .fmx-card__body { overflow-y: auto; }
  .fmx-card .fmx-card__peek { cursor: auto; touch-action: auto; }
  /* every column fits from here; below it the extra columns sit behind "More columns" */
  .fmx-count { flex: 1 1 auto; }
  .fmx-more { display: none; }
  .fmx-table .is-extra { display: table-cell; }
  .fmx-rowmeta { display: none; }
  .fmx-table td.col-t, .fmx-table td.col-rg { white-space: nowrap; }
}
@media (min-width: 1000px) and (max-width: 1199.98px) {
  .fmx.is-side .fmx-stage { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .fmx-tablewrap::details-content, .fmx-table__sum::after,
  .fmx-ink, .fmx-seatbar span, .fmx-seatbar__maj, .fmx-card, .fmx-card[data-sheet], .fmx-g3d, .fmx-touch,
  .fmx-stage.sheet-open .fmx-mapbox .maplibregl-ctrl-bottom-left,
  .fmx-stage.sheet-open .fmx-mapbox .maplibregl-ctrl-bottom-right { transition: none; }
}

@media print {
  .fmx-tablewrap::details-content { block-size: auto; content-visibility: visible; }
  .fmx-controls, .fmx-cmp, .fmx-mapctl, .fmx-g3dctl, .fmx-jumps, .fmx-share, .fmx-tools .fmx-input, .fmx-tools .fmx-select, .fmx-csv, .fmx-more { display: none !important; }
  .fmx-table .is-extra { display: table-cell; }
  .fmx-table thead th { position: static; }
}
@media (forced-colors: active) {
  .fmx-tint { background: none !important; }
  .fmx-ink, .fm-ftabs__line { background: CanvasText; forced-color-adjust: none; }
  .fm-ftab[aria-pressed="true"], .fmx-who__btn[aria-checked="true"], .fmx-which__btn[aria-checked="true"],
  .fmx-mode__btn[aria-checked="true"], .fmx-mapctl__btn[aria-checked="true"], .fmx-mapctl__btn[aria-pressed="true"],
  .fm-fmap__tool[aria-pressed="true"], .fmx-g3dctl__btn[aria-pressed="true"] { text-decoration: underline 3px; text-underline-offset: 6px; }
  /* focus rings drawn with box-shadow vanish here: give every control a real outline */
  .fm-map :focus-visible, .fmx :focus-visible, .fm-focus :focus-visible, .fmx-input:focus { outline: 3px solid CanvasText !important; outline-offset: 2px !important; }
}

/* === focus === */
/* "Three places" (focus.js). Each place: heading, one claim, up to three figures, the map, two actions,
   then "The details" (a native <details>). Mobile first: the map is full-bleed with its tabs above it;
   from 1000px the map takes about 60% of the row, sticky, with the text beside it, alternating sides.
   No cards, no pills, no accent bars: type, hairline rules and one ink underline for "selected". */

.fm-focus { display: grid; gap: clamp(4rem, 10vw, 7rem); }

.fm-fcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "stage" "body";
  gap: var(--fm-space-5);
}
.fm-fcard__head { grid-area: head; min-width: 0; }
.fm-fcard__stage { grid-area: stage; min-width: 0; }
.fm-fcard__body { grid-area: body; min-width: 0; display: grid; gap: var(--fm-space-5); align-content: start; }

/* heading */
.fm-fcard__place {
  /* type comes from the site's one label style (site.css); only the layout is set here */
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin: 0 0 var(--fm-space-2);
}
.fm-fcard__num { color: var(--fm-red-deep); font-variant-numeric: tabular-nums; }
.fm-fcard__title {
  font-size: clamp(1.75rem, 4.6vw, 2.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0 0 var(--fm-space-2);
  text-wrap: balance;
}
/* the claim is body text: same size, weight and leading as every other paragraph (R9) */
.fm-fcard__claim { margin: 0; max-width: 62ch; }

/* figures: type only, divided by hairlines */
.fm-ffigs {
  list-style: none;
  margin: var(--fm-space-5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--fm-line);
}
.fm-ffig {
  display: grid;
  grid-template-columns: 9.75rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.6rem 0 0.65rem;
  border-bottom: 1px solid var(--fm-line);
}
.fm-ffig__value {
  font-family: var(--fm-font-head);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fm-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fm-ffig--long .fm-ffig__value { white-space: normal; }
.fm-ffig__label { font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.4; color: var(--fm-muted); }

/* --- the bar above the map: two tabs with a sliding underline, and "Play the change" --- */
.fm-fcard__stick { position: relative; }
.fm-fbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--fm-space-3);
  margin-bottom: var(--fm-space-3);
  border-bottom: 1px solid var(--fm-line);
}
.fm-ftabs { position: relative; display: flex; gap: clamp(0.9rem, 3vw, 1.6rem); min-width: 0; }
.fm-ftab {
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fm-muted);
  font-family: var(--fm-font-head);
  font-weight: 600;
  font-size: var(--fm-text, 1.0625rem);
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--fm-dur-fast, 150ms) ease-out;
}
.fm-ftab[aria-pressed="true"] { color: var(--fm-ink); font-weight: 800; }
.fm-ftab__long { display: none; }
@media (min-width: 640px) { .fm-ftab__long { display: inline; } .fm-ftab__short, .fm-ftab__srshort { display: none; } }
@media (hover: hover) { .fm-ftab:not([aria-pressed="true"]):hover { color: var(--fm-ink); } }
.fm-ftab:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
.fm-ftabs__line {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  background: var(--fm-ink);
  pointer-events: none;
  transition: transform var(--fm-dur-move, 280ms) var(--fm-ease), width var(--fm-dur-move, 280ms) var(--fm-ease);
}
.fm-fplay {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0 0.1rem;
  border: 0;
  background: none;
  color: var(--fm-ink);
  font-family: var(--fm-font-head);
  font-weight: 700;
  font-size: var(--fm-text-sm, 0.9375rem);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fm-fplay:hover span { text-decoration: underline; text-underline-offset: 3px; }
.fm-fplay:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
.fm-fplay.is-playing svg { opacity: 0.4; }
/* the narrowest phones: keep each tab on one line, and put a figure's label under its value */
@media (max-width: 399px) {
  .fm-ftabs { gap: 0.7rem; }
  .fm-ftab { font-size: var(--fm-text-sm, 0.9375rem); white-space: nowrap; }
  .fm-fplay { gap: 0.3rem; }
  .fm-ffig { grid-template-columns: minmax(0, 1fr); }
}

/* --- the map frame: same shape as its poster, so the hand-off lines up --- */
.fm-fmap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #F1ECE6;
  border: 1px solid var(--fm-line);
  border-radius: var(--fm-radius);
  overflow: hidden;
  isolation: isolate;
}
.fm-fmap__posters { position: absolute; inset: 0; }
.fm-fmap__poster { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s ease-out; }
.fm-fmap__poster.is-on { opacity: 1; }
.fm-fmap__poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fm-fmap > .fm-fmap__live {
  position: absolute;
  inset: 0;
  min-height: 0;
  z-index: 1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
.fm-fmap > .fm-fmap__live.is-ready { opacity: 1; }
.fm-fmap.is-live .fm-fmap__posters { visibility: hidden; }
/* our labels on the live map: ridings in the story, a few places, a line name */
.fm-flabels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.fm-flab {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: nowrap;
  color: var(--fm-ink);
  font-family: var(--fm-font-head);
  line-height: 1.1;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 5px #fff;
  transition: opacity 0.4s ease-out;
}
.fm-flab.is-on { visibility: visible; }
.fm-flab--riding { font-weight: 800; font-size: 14px; letter-spacing: -0.005em; }
.fm-flab--riding.is-small { font-size: 12px; }
.fm-flab--ctx { font-weight: 600; font-size: 13px; color: #5E5650; }
.fm-flab--place { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; color: var(--fm-ink-2); }
.fm-flab--place i { width: 6px; height: 6px; border-radius: 50%; background: var(--fm-ink); box-shadow: 0 0 0 1.5px #fff; flex: none; }
.fm-flab--place.is-flip { flex-direction: row-reverse; }
.fm-flab--line { font-family: var(--fm-font-body); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: #5E5650; }
.fm-fleaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transition: opacity 0.4s ease-out; }
.fm-fleaders line { stroke: var(--fm-ink); stroke-width: 1.2; }
.fm-fleaders circle { fill: var(--fm-ink); stroke: #fff; stroke-width: 1.5; }
/* the two sides' labels cross-fade with their lines */
.fm-flabels[data-side="after"] [data-side="before"],
.fm-flabels[data-side="before"] [data-side="after"],
.fm-flabels[data-side="after"] .fm-flab[data-hide-after],
.fm-flabels[data-side="before"] .fm-flab[data-hide-before] { opacity: 0; }

/* tools over the map, top left (the engine's zoom and full-screen buttons sit top right) */
.fm-fmap__tools {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 10px;
  display: flex;
  max-width: calc(100% - 70px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--fm-line);
  border-radius: var(--fm-radius-sm);
}
.fm-fmap__tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  background: none;
  color: var(--fm-ink-2);
  font-family: var(--fm-font-head);
  font-weight: 600;
  font-size: var(--fm-text-sm, 0.9375rem);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fm-fmap__tool + .fm-fmap__tool:not([hidden]) { border-left: 1px solid var(--fm-line); }
@media (hover: hover) { .fm-fmap__tool:hover { color: var(--fm-ink); } }
.fm-fmap__tool:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--fm-ink); border-radius: 6px; }
.fm-fmap__tool[aria-pressed="true"] { color: var(--fm-ink); font-weight: 800; box-shadow: inset 0 -2px 0 var(--fm-ink); }
.fm-fmap__tool[hidden] { display: none; }
@media (pointer: coarse) { .fm-fmap__tool { min-height: 44px; } }
/* before a phone visitor taps "Explore this map", the frame shows only that button and the view bar */
@media (hover: none) and (pointer: coarse) {
  .fm-fmap:not(.is-active):not(.is-g3d) .maplibregl-ctrl-top-right { display: none; }
}

/* Google's 3D view fills the frame; its own logo and credit stay uncovered */
.fm-fmap > .fm-g3d { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; display: block; }
.fm-fmap.is-g3d .fm-fmap__touch { display: none; }

/* phones: a clear button turns the map on, "Done" hands scrolling back to the page */
.fm-fmap__touch, .fm-fmap__done { display: none; }
@media (hover: none) and (pointer: coarse) {
  .fm-fmap__touch {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 4;
    display: flex;
    justify-content: center;
    padding: 0 16px 18px;
    pointer-events: none;
  }
  .fm-fmap__touch .fm-fmap__explore { pointer-events: auto; }
  .fm-fmap.is-active .fm-fmap__touch { display: none; }
  .fm-fmap.is-active .fm-fmap__done { display: inline-flex; }
  /* until "Explore", one-finger scrolling passes over the map */
  .fm-fmap:not(.is-active) .fm-fmap__live { pointer-events: none; }
}
.fm-fmap__explore, .fm-fmap__done {
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.2rem;
  border: 1px solid var(--fm-ink);
  border-radius: var(--fm-radius-sm);
  font-family: var(--fm-font-head);
  font-weight: 700;
  font-size: var(--fm-text-sm, 0.9375rem);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fm-fmap__explore { display: inline-flex; background: var(--fm-white); color: var(--fm-ink); }
.fm-fmap__done { position: absolute; z-index: 5; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--fm-ink); color: var(--fm-white); }
/* over Google's view, "Done" moves to the top so Google's logo and credit stay clear */
.fm-fmap.is-g3d .fm-fmap__done { top: 10px; right: 10px; bottom: auto; left: auto; transform: none; }
.fm-fmap__explore:focus-visible, .fm-fmap__done:focus-visible { outline: none; box-shadow: var(--fm-focus); }
.fm-fmap.is-active .maplibregl-ctrl-bottom-left,
.fm-fmap.is-active .maplibregl-ctrl-bottom-right { margin-bottom: 70px; }

/* caption line and key under the map */
.fm-fcard__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.25rem;
  margin-top: var(--fm-space-3);
  font-size: var(--fm-text-sm, 0.9375rem);
  line-height: 1.4;
  color: var(--fm-muted);
}
.fm-fcard__which { margin: 0; }
.fm-fcard__which b { font-family: var(--fm-font-head); font-weight: 700; color: var(--fm-ink); }
.fm-fkey { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.55rem; margin: 0; }
.fm-fkey__sw { width: 16px; height: 12px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--fm-ink); }
.fm-fkey__title { font-family: var(--fm-font-head); font-weight: 700; color: var(--fm-ink); }
.fm-fkey__ramp { display: inline-flex; align-items: center; gap: 0; }
.fm-fkey__ramp b { font-weight: 600; color: var(--fm-ink); margin-right: 4px; }
.fm-fkey__ramp span { width: 14px; height: 10px; }
/* the lines key: one ink line on the flat map; in Google's 3D view the lines are light with a dark edge */
.fm-fkey__case { display: none; }
.fm-fcard.is-g3d-on .fm-fkey__case { display: inline; stroke: #111111; }
.fm-fcard.is-g3d-on .fm-fkey__line { stroke: #FFFFFF; }
.fm-fcard__note { margin: 0; min-height: 0; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.4; color: var(--fm-ink-2); }
.fm-fcard__note.is-visible { margin-top: 0.4rem; }

/* actions */
.fm-factions { display: flex; flex-wrap: wrap; gap: var(--fm-space-3); }
.fm-factions .fm-button { flex: 1 1 100%; }
/* our second action is a plain link with an arrow, not a second big button */
.fm-flink {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px;
  font-weight: 600; color: var(--fm-ink);
  text-decoration: underline 1.5px var(--fm-red); text-underline-offset: 0.18em;
  transition: color var(--fm-dur-fast, 150ms) ease-out;
}
.fm-flink:hover { color: var(--fm-red-deep); }
.fm-flink__arrow { color: var(--fm-red); text-decoration: none; display: inline-block; }
@media (min-width: 640px) {
  .fm-factions { align-items: center; gap: var(--fm-space-3) var(--fm-space-5); }
  .fm-factions .fm-button { flex: 0 0 auto; }
}

/* --- The details (a .fm-fold) --- */
.fm-fdetails__body { display: grid; gap: var(--fm-space-5); padding-top: var(--fm-space-2); }
.fm-fpoints { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--fm-space-3); max-width: 64ch; }
.fm-fpoints li { position: relative; padding-left: 1.1rem; }
.fm-fpoints li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.45rem; height: 1.5px; background: var(--fm-ink-2); }
.fm-frows { display: grid; gap: var(--fm-space-5); }
.fm-frows__title { margin: 0 0 0.35rem; font-size: var(--fm-text, 1.0625rem); font-weight: 700; }
.fm-frows__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fm-line); }
.fm-frow { border-bottom: 1px solid var(--fm-line); }
.fm-frow__btn {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.2rem;
  border: 0;
  background: transparent;
  color: var(--fm-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fm-frow__btn:hover .fm-frow__name { text-decoration: underline; text-underline-offset: 3px; }
.fm-frow__btn:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
.fm-frow__top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.fm-frow__name { font-family: var(--fm-font-head); font-weight: 700; font-size: var(--fm-text, 1.0625rem); line-height: 1.2; }
.fm-frow__margin { flex: none; font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* the same ink-on-tint chip as the ridings table and the riding panel */
.fm-frow__margin.fmx-tint { min-width: 0; padding: 2px 8px; }
.fm-frow__bar { display: flex; gap: 2px; height: 6px; }
.fm-frow__bar span { display: block; height: 100%; border-radius: 2px; }
.fm-frow__bar span[style*="width:0%"] { display: none; }
.fm-frow__meta { display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); font-variant-numeric: tabular-nums; }
.fm-frows__note { margin: 0; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-muted); }
.fm-fquestion { margin: 0; max-width: 60ch; font-family: var(--fm-font-head); font-weight: 700; font-size: var(--fm-text-sub, 1.25rem); line-height: 1.3; color: var(--fm-ink); text-wrap: balance; }
.fm-fsources { margin: 0; max-width: 70ch; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.5; color: var(--fm-muted); }

/* --- larger screens --- */
@media (min-width: 640px) {
  .fm-fmap { aspect-ratio: 6 / 5; }
  .fm-ffigs { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; gap: 0 1.25rem; }
  .fm-ffig { grid-template-columns: minmax(0, 1fr); border-bottom: 0; border-top: 1px solid var(--fm-line); padding-top: 0.8rem; }
  .fm-frows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--fm-space-6); }
  .fm-frows__note { grid-column: 1 / -1; }
}
@media (min-width: 640px) and (max-width: 999px) {
  .fm-fcard__stage { max-width: 760px; }
}
@media (min-width: 1000px) {
  .fm-fcard {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "stage head" "stage body";
    column-gap: clamp(2rem, 4vw, 3.5rem);
    row-gap: var(--fm-space-5);
  }
  .fm-fcard--flip {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-areas: "head stage" "body stage";
  }
  .fm-fcard__stage { position: sticky; top: calc(var(--fm-header-h) + 16px); align-self: start; }
  .fm-ffigs { grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--fm-line); gap: 0; }
  /* value over label, so every row has the same shape and labels run the full column */
  .fm-ffig { grid-template-columns: minmax(0, 1fr); row-gap: 2px; padding-block: 0.8rem; border-top: 0; border-bottom: 1px solid var(--fm-line); }
  .fm-frows { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .fm-ftabs__line, .fm-ftab, .fm-fmap__poster, .fm-fmap > .fm-fmap__live, .fm-flab, .fm-fleaders { transition: none; }
}
@media print {
  .fm-fbar, .fm-fmap__tools, .fm-fmap__touch, .fm-fmap__done, .fm-factions { display: none; }
}

/* --- explorer: lines first (shading choice, "Show what changed", legend line) --- */
.fmx-view { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 32px; margin-top: 6px; }
@media (max-width: 719.98px) { .fmx-view { gap: 0 20px; margin-top: 2px; } }
.fmx-shade { position: relative; display: flex; gap: 18px; box-shadow: inset 0 -1px 0 var(--fm-line); }
.fmx-shade__btn {
  position: relative; min-height: 44px; padding: 10px 0 9px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font-family: var(--fm-font-head); font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); line-height: 1.2; color: var(--fm-ink-2);
  -webkit-tap-highlight-color: transparent; transition: color 0.15s ease;
}
.fmx-shade__btn:hover { color: var(--fm-ink); }
.fmx-shade__btn[aria-checked="true"] { color: var(--fm-ink); font-weight: 800; }
.fmx-shade__btn:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
/* a plain switch: a short track that fills with ink, the red dash of the change lines on its knob side */
.fmx-wc {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font-family: var(--fm-font-head); font-weight: 600; font-size: var(--fm-text-sm, 0.9375rem); color: var(--fm-ink-2); white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.fmx-wc[hidden] { display: none; }
.fmx-wc:hover, .fmx-wc[aria-checked="true"] { color: var(--fm-ink); }
.fmx-wc:focus-visible { outline: none; box-shadow: var(--fm-focus); border-radius: 4px; }
.fmx-wc__track {
  position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: var(--fm-white);
  box-shadow: inset 0 0 0 1.5px var(--fm-field); transition: background var(--fm-dur-fast, 150ms) ease-out, box-shadow var(--fm-dur-fast, 150ms) ease-out;
}
.fmx-wc__track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--fm-field);
  transition: transform var(--fm-dur-move, 280ms) var(--fm-ease), background var(--fm-dur-fast, 150ms) ease-out;
}
.fmx-wc[aria-checked="true"] .fmx-wc__track { background: var(--fm-ink); box-shadow: inset 0 0 0 1.5px var(--fm-ink); }
.fmx-wc[aria-checked="true"] .fmx-wc__track::after { transform: translateX(14px); background: var(--fm-white); }

/* the legend line under the map: what the black lines and the red dashes are */
.fmx-lgd { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 2px; color: var(--fm-ink); font-weight: 600; }
.fmx-lgd__i { display: inline-flex; align-items: center; gap: 8px; }
.fmx-lgd__i svg { flex: none; }
.fmx-lgd__solid { stroke: #161616; stroke-width: 2.4; }
.fmx-lgd__case { stroke: #FFFFFF; stroke-width: 5; }
.fmx-lgd__dash { stroke: #E12527; stroke-width: 2.6; stroke-dasharray: 5 3.5; }
.fmx-lgd__note { display: block; }
/* the map's own key: the comparison line is red there too; with lines only there is no result scale to explain */
.fmx .fm-legend-key line { stroke: #E12527; stroke-width: 2.4; }
.fmx.is-lines .fm-legend { display: none; }
@media (prefers-reduced-motion: reduce) {
  .fmx-wc__track, .fmx-wc__track::after { transition: none; }
}
@media (forced-colors: active) {
  .fmx-shade__btn[aria-checked="true"] { text-decoration: underline; }
  .fmx-wc__track { forced-color-adjust: none; background: Canvas; box-shadow: inset 0 0 0 1.5px CanvasText; }
  .fmx-wc__track::after { background: CanvasText; }
  .fmx-wc[aria-checked="true"] .fmx-wc__track { background: Highlight; }
  .fmx-lgd__solid { stroke: CanvasText; }
  .fmx-lgd__dash { stroke: Highlight; }
}

/* --- reserved height while the mounts are empty ------------------------ */
/* measured from the filled sections (ridings table closed), so the page does not
   jump when the maps arrive and links to sections further down land where they should */
@media (scripting: enabled) {
  #explorer:empty { min-height: 1430px; } /* +90: the lines-first row above the map (two lines on a phone) */
  #focus:empty { min-height: 3620px; }
  @media (min-width: 640px) {
    #explorer:empty { min-height: 1200px; }
    #focus:empty { min-height: 3600px; }
  }
  @media (min-width: 1000px) {
    #explorer:empty { min-height: 1070px; }
    #focus:empty { min-height: 2260px; }
  }
}
