html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--map-bg);
  color: var(--map-text);
}

/* ============================================================
   iOS-aligned design tokens
   ============================================================
   Surviving iOS-aligned tokens after the dead-token cleanup; the
   --map-* tokens below remain the primary source of truth.

   Type:    iOS Human Interface Guidelines type scale
   Color:   iOS semantic labels + tints (light mode for now)
   Radius:  small / medium / pill */
:root {
  /* Type — sizes match iOS pt at default Dynamic Type. */
  --type-title3-size: 20px;
  --type-body-size: 17px;
  --type-callout-size: 16px;
  --type-subheadline-size: 15px;
  --type-footnote-size: 13px;
  --type-caption1-size: 12px;
  --type-caption2-size: 11px;

  /* Color — iOS semantic labels (light mode). */
  --secondary-label: rgba(60, 60, 67, 0.6);
  --system-blue: #007aff;

  /* Radius. */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-pill: 9999px;
}

:root {
  color-scheme: light;
  --map-glass-alpha: 0.72;
  --map-bg: #f8fafc;
  --map-text: #0f172a;
  /* Link / interactive text colors (anchor default + hover/focus) */
  --map-link: #2563eb;
  --map-link-hover: #1d4ed8;
  --map-muted: #475569;
  --map-subtle: #64748b;
  --map-panel-bg: rgba(255, 255, 255, var(--map-glass-alpha));
  --map-panel-border: rgba(255, 255, 255, 0.45);
  --map-panel-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  --map-control-bg: rgba(255, 255, 255, var(--map-glass-alpha));
  --map-control-border: rgba(148, 163, 184, 0.5);
  --map-control-text: #0f172a;
  --map-control-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  --map-tooltip-bg: rgba(255, 255, 255, var(--map-glass-alpha));
  --map-tooltip-border: rgba(148, 163, 184, 0.7);
  --map-tooltip-text: #0f172a;
  --map-tooltip-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  --map-layer-line: #e0e0e0;
  --map-layer-title: #777;
  --map-layer-text: #999;
  --map-layer-text-hover: #666;
  --map-layer-active: #000;
  --map-world-ocean: #FFFFFF;
  --map-world-land: #F6F6F4;
  --map-no-data: #cbd5e1;
  --map-no-data-nonmetro: #dbe4ee;
  --map-area-border-color: rgba(255, 255, 255, 0.85);
  --map-area-border-width: 0.4;
  --map-selection-outline: #000;
  --map-occ-item-bg: rgba(255, 255, 255, var(--map-glass-alpha));
  --map-occ-item-border: rgba(203, 213, 225, 0.85);
  --map-occ-item-title: #0f172a;
  --map-occ-item-text: #475569;
}

#us-ai-map-root {
  /* dvh tracks the dynamic viewport so the full-screen map fills the
     *visible* area on iOS Safari (the URL bar makes 100vh taller than the
     screen, which pushes content / the fixed bottom sheet off the bottom).
     vh stays as the fallback for engines without dvh. */
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

#us-ai-map-svg {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 380ms ease;
  will-change: opacity;
}

#us-ai-map-svg.is-visible {
  opacity: 1;
}

.map-data-layers {
  opacity: 0;
  transition: opacity 420ms ease 80ms;
  will-change: opacity;
}

.map-data-layers.is-visible {
  opacity: 1;
}

.map-unavailable {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.map-unavailable.is-hidden {
  display: none;
}

.map-unavailable__card {
  max-width: 320px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  text-align: center;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.map-unavailable__message {
  margin: 0 0 14px;
  font-size: var(--type-footnote-size);
  color: var(--map-text);
}

.map-unavailable__retry {
  padding: 8px 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: var(--map-text);
  color: #fff;
  font-size: var(--type-footnote-size);
  font-weight: 600;
  cursor: pointer;
}

.map-ui-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}

.map-ui-ready {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#map-tooltip {
  will-change: transform, opacity;
  border: 1px solid var(--map-tooltip-border);
  background: var(--map-tooltip-bg);
  color: var(--map-tooltip-text);
  box-shadow: var(--map-tooltip-shadow);
}

.map-treemap-tooltip {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--map-tooltip-border);
  background: rgba(255, 255, 255, 0.97);
  color: var(--map-tooltip-text);
  box-shadow: var(--map-tooltip-shadow);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.35;
}

.map-treemap-tooltip--hidden {
  opacity: 0;
  visibility: hidden;
}

.map-treemap-tooltip:not(.map-treemap-tooltip--hidden) {
  opacity: 1;
  visibility: visible;
}

.map-treemap-tooltip__title {
  margin: 0 0 0.35rem;
  font-size: var(--type-footnote-size);
  font-weight: 600;
  line-height: 1.25;
  color: var(--map-text);
}

.map-treemap-tooltip__row {
  margin: 0.2rem 0 0;
  font-size: var(--type-caption1-size);
  color: var(--map-muted);
}

#map-hover-card {
  left: 0;
  top: 0;
  will-change: transform, opacity;
  z-index: 100;
  pointer-events: none;
  transition: opacity 150ms ease;
  opacity: 0;
}

.map-hover-card {
  min-width: 180px;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  color: var(--map-text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.map-hover-card__title {
  margin: 0 0 4px;
  font-size: var(--type-footnote-size);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.map-hover-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 0;
}

.map-hover-card__label {
  font-size: var(--type-caption1-size);
  color: #6b7280;
}

.map-hover-card__value {
  font-size: var(--type-footnote-size);
  font-weight: 600;
}

.map-feature.is-hovered {
  filter: brightness(0.85);
}
.map-side-panel {
  z-index: 30 !important;
  transition: opacity 180ms ease, transform 180ms ease, width 180ms ease, visibility 0s linear 0s;
  background: var(--map-panel-bg) !important;
  border-color: var(--map-panel-border) !important;
  box-shadow: var(--map-panel-shadow) !important;
  color: var(--map-text);
  width: var(--map-side-panel-width, 40vw) !important;
  min-width: var(--map-side-panel-min-width, 280px) !important;
  max-width: var(--map-side-panel-max-width, min(40vw, calc(100vw - 32px)));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-side-panel.is-expanded {
  --map-side-panel-width: min(75vw, calc(100vw - var(--map-layer-toggle-width, 352px) - 48px));
  --map-side-panel-min-width: min(75vw, calc(100vw - var(--map-layer-toggle-width, 352px) - 48px));
  --map-side-panel-max-width: none;
}

.map-side-panel.is-expanded .map-exposure-panels {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
}

.map-side-panel.is-expanded .map-top-occupations-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

.map-side-panel.is-expanded .map-top-occupations-treemap {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
}

.map-side-panel.is-expanded .map-top-occupations-tasks:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 240px;
  min-width: 0;
  overflow: auto;
}

.map-side-panel-content {
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: opacity 160ms ease;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-side-panel-content .map-top-occupations-card__meta-row,
.map-side-panel-content .map-top-occupations-treemap,
.map-side-panel-content .map-top-occupations-tasks {
  transition: opacity 160ms ease;
}

.map-side-panel-content.is-mode-transitioning .map-top-occupations-card__meta-row,
.map-side-panel-content.is-mode-transitioning
  .map-top-occupations-treemap:not(.map-top-occupations-treemap--task-viz) {
  opacity: 0;
}

.map-side-panel-head {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.map-side-panel-head__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.map-side-panel-head__titles {
  min-width: 0;
  flex: 1 1 auto;
}

.map-panel-main-title {
  margin: 0;
  color: var(--map-text);
  font-size: var(--type-title3-size);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.map-panel-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: hidden;
}

.map-panel-body .map-exposure-panels {
  flex-shrink: 0;
}

.map-panel-body .map-top-occupations-card {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0 !important;
}

.map-side-panel-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 16;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--map-control-border);
  background: var(--map-control-bg);
  color: var(--map-control-text);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  box-shadow: var(--map-control-shadow);
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.map-panel-header-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.map-panel-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--map-control-border);
  background: var(--map-control-bg);
  color: var(--map-control-text);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  cursor: pointer;
  box-shadow: var(--map-control-shadow);
  font-size: var(--type-caption1-size);
  font-weight: 600;
}

.map-panel-control--panel {
  min-height: 34px;
  padding: 0 10px;
}

.map-panel-control--icon-only {
  width: 34px;
  min-width: 34px;
  padding: 0;
  justify-content: center;
}

#map-home-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#map-home-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-panel-control:hover {
  filter: brightness(1.03);
  background: color-mix(in srgb, var(--map-control-text) 10%, var(--map-control-bg));
}

.map-panel-control:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--map-control-text) 30%, transparent);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--map-control-text) 10%, var(--map-control-bg));
}

.map-side-panel-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  transition: transform 160ms ease;
}

.map-side-panel-toggle.hidden {
  display: none !important;
}

.map-side-panel.is-collapsed {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 180ms ease, transform 180ms ease, width 180ms ease, visibility 0s linear 180ms;
  pointer-events: none;
  visibility: hidden;
}

.map-side-panel.is-collapsed .map-side-panel-content {
  opacity: 1;
}

.map-layer-toggle-container {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 15;
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.map-zoom-controls {
  position: absolute;
  right: 16px;
  bottom: 70px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

.map-zoom-controls__btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--map-panel-border);
  border-radius: var(--radius-md);
  background: var(--map-panel-bg);
  box-shadow: var(--map-panel-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: #1f2937;
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease, background-color 120ms ease;
}

.map-zoom-controls__btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

.map-zoom-controls__btn:active {
  transform: scale(0.96);
}

.map-zoom-controls__btn:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.4);
  outline-offset: 2px;
}

.map-zoom-controls__btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-locate-status {
  position: absolute;
  right: 64px;
  bottom: 70px;
  max-width: 260px;
  z-index: 15;
  padding: 8px 12px;
  border: 1px solid var(--map-panel-border);
  border-radius: var(--radius-md);
  background: var(--map-panel-bg);
  box-shadow: var(--map-panel-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: #1f2937;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.map-locate-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.map-layer-toggle {
  min-width: 148px;
  position: relative;
  border: 1px solid var(--map-panel-border);
  border-radius: var(--radius-md);
  background: var(--map-panel-bg);
  padding: 16px;
  box-shadow: var(--map-panel-shadow);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.map-layer-toggle--combined {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 320px;
}

.map-layer-toggle--combined-top-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: flex-start;
  gap: 16px;
}

.map-layer-toggle--combined-group {
  flex: 1 1 0;
}

.map-layer-toggle--legend-group {
  border-top: 0;
  padding-top: 10px;
}

.map-layer-toggle--combined .map-layer-toggle--combined-group > .map-layer-toggle {
  min-width: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.map-layer-toggle__title {
  margin: 0 0 12px;
  font-size: var(--type-caption1-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--map-layer-title);
}

.map-layer-toggle__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.map-layer-toggle__header .map-layer-toggle__title {
  margin: 0;
}


.map-info-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.map-info-modal__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(148, 163, 184, 0.18), transparent 30%),
    rgba(236, 241, 247, 0.34);
  backdrop-filter: blur(16px) saturate(110%);
  -webkit-backdrop-filter: blur(16px) saturate(110%);
}

.map-info-modal__dialog {
  position: relative;
  width: min(860px, 100%);
  max-height: min(84vh, 900px);
  overflow: auto;
  padding: 0 clamp(1.4rem, 2.5vw, 2rem) clamp(1.4rem, 2.5vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--map-panel-border) 92%, white 8%);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.78));
  box-shadow:
    0 28px 80px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  color: var(--map-text);
}

.map-info-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--map-control-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--map-control-bg) 92%, transparent);
  color: var(--map-control-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--map-control-shadow);
  transition: transform 0.16s ease, background-color 0.16s ease, filter 0.16s ease;
}

.map-info-modal__close:hover,
.map-info-modal__close:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.03);
  background: color-mix(in srgb, var(--map-control-text) 10%, var(--map-control-bg));
}

.map-info-modal__close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--map-control-text) 30%, transparent);
  outline-offset: 2px;
}

.map-info-modal__close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-info-modal__eyebrow {
  margin-bottom: 0.55rem;
  color: var(--map-subtle);
  font-size: var(--type-caption1-size);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.map-info-modal__title {
  margin: 0;
  max-width: 30rem;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  font-weight: 200;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.map-info-modal__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
  margin: 0.25rem 0 1.5rem;
  padding-right: 56px;
  border-bottom: 1px solid color-mix(in srgb, var(--map-occ-item-border) 80%, transparent);
}

.map-info-modal__tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.15rem;
  margin-bottom: -1px;
  font: inherit;
  font-size: var(--type-callout-size);
  font-weight: 300;
  letter-spacing: 0.005em;
  color: var(--map-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.map-info-modal__tab:hover {
  color: var(--map-text);
}

.map-info-modal__tab[aria-selected="true"] {
  color: var(--map-text);
  border-bottom-color: var(--map-text);
}

.map-info-modal__tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--map-control-text) 30%, transparent);
  outline-offset: 4px;
  border-radius: 4px;
}

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

.map-info-modal__contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 0.6rem;
}

@media (max-width: 720px) {
  .map-info-modal__contact-grid {
    grid-template-columns: 1fr;
  }
}

.map-info-modal__sticky {
  position: sticky;
  top: 0;
  z-index: 4;
  margin-left: calc(-1 * clamp(1.4rem, 2.5vw, 2rem));
  margin-right: calc(-1 * clamp(1.4rem, 2.5vw, 2rem));
  margin-bottom: 2.2rem;
  padding: clamp(1.15rem, 2vw, 1.5rem) clamp(1.4rem, 2.5vw, 2rem) 0.9rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid color-mix(in srgb, var(--map-occ-item-border) 80%, transparent);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
}

.map-info-modal__sticky .map-info-modal__eyebrow {
  margin-bottom: 0.55rem;
}

.map-info-modal__sticky .map-info-modal__tabs {
  margin: 0;
  padding-right: 56px;
  border-bottom: 0;
}

.map-info-modal__sticky .map-info-modal__close {
  top: 12px;
  right: 12px;
}

.map-press-release {
  max-width: 46rem;
  color: var(--map-text);
}

.map-press-release__head {
  margin-bottom: 1.4rem;
}

.map-press-release__headline {
  max-width: 100%;
  margin: 0 0 0.6rem;
}

.map-press-release__deck {
  margin: 0 0 0.75rem;
  color: var(--map-muted);
  font-size: var(--type-callout-size);
  font-weight: 300;
  font-style: italic;
  line-height: 1.55;
}

.map-press-release__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
}

.map-press-release__stat {
  padding: 0.95rem 1.05rem 1rem;
  border: 1px solid var(--map-occ-item-border);
  border-radius: 16px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--map-occ-item-bg) 92%, white 8%),
      color-mix(in srgb, var(--map-occ-item-bg) 86%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.map-press-release__stat-eyebrow {
  color: var(--map-subtle);
  font-size: var(--type-caption2-size, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.map-press-release__stat-figure {
  margin-top: 0.2rem;
  font-size: clamp(1.85rem, 3.4vw, 2.4rem);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--map-text);
}

.map-press-release__stat-figure span {
  margin-left: 0.15em;
  font-size: 0.42em;
  font-weight: 400;
  color: var(--map-muted);
  letter-spacing: 0.04em;
}

.map-press-release__stat-sub {
  margin-top: 0.45rem;
  color: var(--map-muted);
  font-size: var(--type-caption1-size);
  line-height: 1.45;
}

.map-press-release__body {
  font-size: var(--type-subheadline-size);
  line-height: 1.72;
}

.map-press-release__body p {
  margin: 0 0 0.95rem;
}

.map-press-release__lead {
  font-size: 1.05em;
  color: var(--map-text);
  margin-bottom: 1.6rem !important;
}

.map-press-release__dateline {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--map-text);
}

.map-press-release__section {
  position: relative;
  margin-top: 1.6rem;
  padding-top: 1.3rem;
  border-top: 1px solid color-mix(in srgb, var(--map-occ-item-border) 80%, transparent);
}

.map-press-release__heading {
  margin: 0 0 0.7rem;
  color: var(--map-subtle);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.map-press-release__note {
  font-size: 0.9em;
  color: var(--map-muted);
  font-style: italic;
}

.map-press-release__quote {
  position: relative;
  margin: 1.1rem 0 1.2rem;
  padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 2px solid color-mix(in srgb, var(--map-text) 35%, transparent);
  color: var(--map-text);
}

.map-press-release__quote p {
  margin: 0;
  font-size: 1.08em;
  font-weight: 300;
  font-style: italic;
  line-height: 1.65;
  color: color-mix(in srgb, var(--map-text) 92%, transparent);
}

.map-press-release__quote::before {
  content: "\201C";
  position: absolute;
  top: -0.45rem;
  left: 0.55rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
  line-height: 1;
  color: color-mix(in srgb, var(--map-text) 22%, transparent);
  pointer-events: none;
}

.map-press-release__quote cite {
  display: block;
  margin-top: 0.55rem;
  color: var(--map-subtle);
  font-size: var(--type-caption1-size);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-press-release__quote cite::before {
  content: "— ";
  opacity: 0.7;
}

.map-press-release__body a,
.map-press-release__about a {
  color: var(--map-link);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--map-link) 35%, transparent);
  transition: color 0.16s ease, border-color 0.16s ease;
}

.map-press-release__body a:hover,
.map-press-release__body a:focus-visible,
.map-press-release__about a:hover,
.map-press-release__about a:focus-visible {
  color: var(--map-link-hover);
  border-bottom-color: var(--map-link-hover);
}

.map-press-release__footer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.4rem;
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid color-mix(in srgb, var(--map-occ-item-border) 90%, transparent);
}

.map-press-release__about p {
  margin: 0;
  font-size: var(--type-subheadline-size);
  line-height: 1.65;
  color: var(--map-muted);
}

.map-press-release__contact {
  padding: 1rem 1.05rem;
  border: 1px solid var(--map-occ-item-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--map-occ-item-bg) 88%, transparent);
  font-size: var(--type-subheadline-size);
  line-height: 1.5;
}

.map-press-release__contact a {
  color: var(--map-link);
  text-decoration: none;
}

.map-press-release__contact a:hover,
.map-press-release__contact a:focus-visible {
  text-decoration: underline;
}

.map-press-release__contact-label {
  margin-bottom: 0.4rem;
  color: var(--map-subtle);
  font-size: var(--type-caption2-size, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.map-press-release__contact-name {
  font-weight: 600;
  color: var(--map-text);
}

.map-press-release__contact-role {
  margin-bottom: 0.5rem;
  color: var(--map-muted);
  font-size: var(--type-caption1-size);
}

.map-press-release__contact-line {
  font-size: var(--type-caption1-size);
}

@media (max-width: 720px) {
  .map-press-release__stats,
  .map-press-release__footer {
    grid-template-columns: 1fr;
  }
}

.map-info-modal__intro {
  margin: 0.9rem 0 1.5rem;
  max-width: 42rem;
  color: var(--map-muted);
  font-size: var(--type-callout-size);
  line-height: 1.7;
}

.map-info-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.map-info-modal__card {
  padding: 1rem 1rem 1.05rem;
  border: 1px solid var(--map-occ-item-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--map-occ-item-bg) 94%, transparent);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.map-info-modal__card--wide {
  grid-column: 1 / -1;
}

.map-info-modal__card-title {
  margin: 0 0 0.45rem;
  color: var(--map-occ-item-title);
  font-size: var(--type-body-size);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.map-info-modal__card-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin-top: 0.35rem;
}

.map-info-modal__card-subtitle {
  margin: 0 0 0.3rem;
  color: var(--map-muted);
  font-size: var(--type-caption1-size, 0.8125rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-info-modal__card-text {
  margin: 0;
  color: var(--map-occ-item-text);
  font-size: var(--type-subheadline-size);
  line-height: 1.7;
}

@media (max-width: 720px) {
  .map-info-modal__card-sections {
    grid-template-columns: 1fr;
  }
}

.map-info-modal__card-text a {
  color: var(--map-link);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.map-info-modal__card-text a:hover,
.map-info-modal__card-text a:focus-visible {
  color: var(--map-link-hover);
  background: rgba(37, 99, 235, 0.08);
}

.map-info-modal__card-text a:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

.map-layer-toggle__options {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 21px;
  padding-left: 0;
}

.map-layer-toggle__options::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--map-layer-line);
  z-index: 0;
}

.map-layer-toggle__option {
  position: relative;
  z-index: 1;
  /* flex (instead of default block) so the inline-flex label doesn't
     generate a line box whose strut pushes the dot below y=6 — keeping
     the dot's vertical center aligned with the connector line at top:6. */
  display: flex;
  align-items: center;
  line-height: 1;
}

.map-layer-toggle__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-layer-toggle__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: var(--map-layer-text);
  font-size: var(--type-caption2-size);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.45px;
  transition: color 0.2s ease;
}

.map-layer-toggle__marker {
  /* border-box so the 1px border doesn't push the dot's center 1px right
     of the connector line at left:5px width:2px (center x=6). */
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: var(--radius-pill);
  background: #d3d3d3;
  border: 1px solid #d3d3d3;
  margin-left: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.map-layer-toggle__label-text {
  display: inline-block;
}

.map-layer-toggle__option:hover .map-layer-toggle__label {
  color: var(--map-layer-text-hover);
}

.map-layer-toggle__option:hover .map-layer-toggle__label .map-layer-toggle__marker {
  background: #666;
  border-color: #666;
}

.map-layer-toggle__label.is-active {
  color: var(--map-layer-active);
  font-weight: 700;
}

.map-layer-toggle__label.is-active .map-layer-toggle__marker {
  border-color: var(--map-layer-active);
  background: var(--map-layer-active);
}

.map-layer-toggle__option:hover .map-layer-toggle__label.is-active {
  color: var(--map-layer-active);
}

.map-layer-toggle__option:hover .map-layer-toggle__label.is-active .map-layer-toggle__marker {
  border-color: var(--map-layer-active);
  background: var(--map-layer-active);
}

.map-gradient-legend {
  display: flex;
  flex-direction: column;
}

.map-gradient-legend__scale {
  width: 100%;
  height: 14px;
  border-radius: var(--radius-pill);
  border: 0;
  box-shadow: none;
}

.map-gradient-legend__labels {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.map-gradient-legend__label {
  color: var(--map-layer-text);
  font-size: var(--type-caption2-size);
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1;
}

.map-feature {
  vector-effect: non-scaling-stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 0.4;
  cursor: pointer;
}

.map-feature-nonmetro,
.map-metro-nonmetro-border {
  stroke: var(--map-area-border-color);
  stroke-width: var(--map-area-border-width);
  vector-effect: non-scaling-stroke;
}

/* Interior county-border mesh (single path), drawn under the dissolved
   metro/nonmetro exterior borders so clean exteriors stay on top. The mesh
   is interior-only, so it never restates state or MSA edges. */
.map-county-borders {
  fill: none;
  stroke: var(--map-area-border-color);
  stroke-width: var(--map-area-border-width);
  stroke-opacity: 0.55;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* State/province boundary mesh drawn over the Country fill so a single-color
   country still reads as a states map. Stroke-only, non-interactive (clicks
   fall through to the country polygon below). */
.map-feature-country-edge {
  fill: none;
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.world-layer {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #us-ai-map-svg,
  .map-data-layers {
    transition-duration: 1ms;
    transition-delay: 0ms;
  }
}

.map-world-sphere {
  fill: var(--map-world-ocean);
}

.map-world-land {
  fill: var(--map-world-land);
  stroke: none;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.map-world-country-borders {
  display: none;
}

.map-feature:focus {
  outline: none;
}

.map-selection-outline {
  fill: none;
  stroke: var(--map-selection-outline);
  stroke-width: 1.75;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.map-selection-label {
  color: var(--map-subtle);
  margin: 0.25rem 0 0;
  font-size: var(--type-caption2-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.map-exposure-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.map-exposure-panels--flat {
  gap: 1.15rem;
}

.map-side-panel .map-top-occupations-card {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.map-side-panel .map-top-occupations-card__detail {
  border: none;
  background: transparent;
  margin-top: 0;
  padding: 0;
}

.map-exposure-card {
  height: auto;
  border: 1px solid var(--map-occ-item-border);
  background: color-mix(in srgb, var(--map-occ-item-bg) 94%, transparent);
  border-radius: 18px;
  padding: 1rem;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.map-exposure-card__title {
  margin: 0 0 0.9rem;
  color: var(--map-occ-item-title);
  font-size: var(--type-subheadline-size);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.map-exposure-card__body {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.map-exposure-gauge {
  position: relative;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  max-width: 76px;
  max-height: 76px;
  margin: 0 auto;
}

.map-exposure-gauge__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.map-exposure-gauge__track,
.map-exposure-gauge__progress,
.map-exposure-gauge__svg circle {
  fill: none;
  stroke-width: 8;
}

.map-exposure-gauge__track {
  stroke: color-mix(in srgb, var(--map-subtle) 18%, transparent);
}

.map-exposure-gauge__progress {
  stroke: var(--map-gauge-accent, #2563eb);
  stroke-linecap: round;
  stroke-dasharray: 289;
  stroke-dashoffset: 289;
  transition: stroke-dashoffset 220ms ease, stroke 220ms ease;
}

.map-exposure-gauge__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--map-occ-item-title);
  font-size: var(--type-subheadline-size);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.map-exposure-gauge.is-empty .map-exposure-gauge__value {
  color: var(--map-subtle);
}

.map-exposure-card__details {
  display: grid;
  gap: 0.5rem;
  align-self: center;
  align-content: center;
}

.map-exposure-card__line {
  margin: 0;
  color: var(--map-occ-item-text);
  font-size: var(--type-subheadline-size);
  line-height: 1.45;
}

.map-exposure-card__line span {
  color: var(--map-occ-item-title);
  font-weight: 700;
}

.map-top-occupations-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.map-top-occupations-card__status {
  margin: 0;
  color: var(--map-occ-item-text);
  font-size: var(--type-caption1-size);
  line-height: 1.35;
  text-align: left;
  flex-shrink: 0;
}

.map-top-occupations-card__legend {
  margin: 0;
  color: var(--map-occ-item-text);
  font-size: var(--type-caption1-size);
  line-height: 1.35;
  text-align: left;
  flex-shrink: 0;
}

.map-side-panel.is-expanded .map-top-occupations-card__legend-prefix {
  display: none;
}

.map-top-occupations-card__detail {
  margin-top: 0.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--map-occ-item-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--map-occ-item-bg) 90%, transparent);
}

.map-top-occupations-card__detail-meta {
  margin: 0;
  color: var(--map-occ-item-text);
  font-size: var(--type-footnote-size);
  line-height: 1.45;
  font-weight: 700;
}

.map-treemap-nav {
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--map-occ-item-border) 70%, transparent);
  flex-shrink: 0;
}

.map-treemap-nav__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.map-treemap-nav__sep {
  color: var(--map-subtle);
  font-size: var(--type-subheadline-size);
  font-weight: 500;
  line-height: 1.25;
  user-select: none;
}

.map-treemap-nav__region {
  color: var(--map-occ-item-title);
  font-size: var(--type-subheadline-size);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  padding: 0.15rem 0.1rem;
}

.map-treemap-nav__region:empty,
.map-treemap-nav__region:empty + .map-treemap-nav__sep {
  display: none;
}

.map-treemap-nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0.15rem 0.1rem;
  border: none;
  background: transparent;
  color: var(--map-occ-item-title);
  font-size: var(--type-subheadline-size);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  cursor: pointer;
  border-radius: 6px;
}

.map-treemap-nav__trigger span:first-of-type {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.map-treemap-nav__trigger:hover,
.map-treemap-nav__trigger:focus-visible {
  color: var(--map-link);
  outline: none;
}

.map-treemap-nav__trigger:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--map-link) 35%, transparent);
}

.map-treemap-nav__trigger.is-open .map-treemap-nav__chevron:not(.hidden) {
  transform: rotate(180deg);
}

.map-treemap-nav__industry-row,
.map-treemap-nav__jobs-row {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  min-width: 0;
}

.map-treemap-nav__industry-row .map-treemap-nav__trigger {
  min-width: 0;
}

.map-treemap-nav__jobs-row .map-treemap-nav__trigger {
  min-width: 0;
}

.map-treemap-nav__inline-clear {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #3b82f6;
  line-height: 1;
  cursor: pointer;
}

.map-treemap-nav__inline-clear:hover,
.map-treemap-nav__inline-clear:focus-visible {
  color: var(--map-link);
  background: rgba(37, 99, 235, 0.08);
  outline: none;
}

.map-treemap-nav__chevron {
  flex-shrink: 0;
  display: inline-flex;
  color: #3b82f6;
  transition: transform 0.18s ease;
}

.map-treemap-nav__popover {
  position: fixed;
  z-index: 80;
  margin-top: 0;
  border-radius: 14px;
  border: 1px solid var(--map-occ-item-border);
  background: color-mix(in srgb, #ffffff 90%, var(--map-panel-bg));
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  max-height: min(340px, 52vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-treemap-nav__popover.hidden {
  display: none;
}

.map-treemap-nav__popover-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--map-occ-item-border) 80%, transparent);
  flex-shrink: 0;
}

.map-treemap-nav__search {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--map-occ-item-border) 90%, transparent);
  border-radius: var(--radius-sm);
  /* 16px minimum prevents iOS Safari from auto-zooming on focus. */
  font-size: var(--type-callout-size);
  background: rgba(255, 255, 255, 0.92);
  color: var(--map-text);
}

.map-treemap-nav__search::placeholder {
  color: var(--map-subtle);
}

.map-treemap-nav__search:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  outline-offset: 1px;
}

.map-treemap-nav__clear {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--map-subtle);
  font-size: var(--type-title3-size);
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.map-treemap-nav__clear:hover {
  color: var(--map-text);
  background: rgba(15, 23, 42, 0.06);
}

.map-treemap-nav__undo-btn {
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-treemap-nav__undo-btn svg {
  display: block;
  color: var(--map-subtle);
}

.map-treemap-nav__undo-btn:hover svg,
.map-treemap-nav__undo-btn:focus-visible svg {
  color: var(--map-text);
}

.map-treemap-nav__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.map-treemap-nav__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.12s ease;
}

.map-treemap-nav__item:hover,
.map-treemap-nav__item:focus-visible {
  background: rgba(15, 23, 42, 0.06);
  outline: none;
}

.map-treemap-nav__item-title {
  display: block;
  font-size: var(--type-callout-size);
  font-weight: 700;
  line-height: 1.25;
  color: var(--map-occ-item-title);
  letter-spacing: -0.02em;
}

.map-treemap-nav__item-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--type-footnote-size);
  font-weight: 400;
  color: var(--map-occ-item-text);
  line-height: 1.3;
}

.map-treemap-nav__empty {
  padding: 1rem 0.85rem;
  margin: 0;
  font-size: var(--type-footnote-size);
  color: var(--map-subtle);
}

.map-top-occupations-treemap {
  margin-top: 0.35rem;
  width: 100%;
  flex: 1 1 0;
  min-height: 180px;
  height: 0;
}

.map-top-occupations-treemap:not([hidden]) {
  display: block;
}

.map-top-occupations-treemap.is-expanded {
  min-height: 0;
}

.map-top-occupations-tasks {
  margin-top: 0.35rem;
  width: 100%;
  flex: 1 1 auto;
  min-height: 240px;
  min-width: 0;
  opacity: 1;
}

.map-top-occupations-treemap--task-viz:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 260px;
  min-width: 0;
  height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.map-side-panel.is-expanded .map-top-occupations-treemap--task-viz:not([hidden]) {
  flex: 1 1 0;
  min-height: 280px;
}

.map-top-occupations-treemap--task-viz .map-task-page {
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  overflow: visible;
}

.map-top-occupations-tasks[hidden] {
  display: none !important;
}

.map-top-occupations-treemap[hidden] {
  display: none !important;
}

.map-task-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  min-height: 0;
  height: auto;
}

.map-task-page__main {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
}

.map-task-page__chart-area {
  position: relative;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  overflow: visible;
}

.map-top-occupations-card__detail-meta.map-task-page-meta {
  font-weight: 400;
}

.map-task-page-meta__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Bars/Table toggle sits on the same row as the task meta pills. */
.map-task-page-meta__pills .map-task-view-toggle {
  margin-left: auto;
}

.map-task-page-meta__pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: var(--type-footnote-size);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* Pill text uses the same near-black (--map-text) as the city/industry/job
   title; the variant is conveyed by the background tint, not the text color. */
.map-task-page-meta__pill--neutral {
  background: rgba(15, 23, 42, 0.08);
  color: var(--map-text);
}

.map-task-page-meta__pill--low {
  background: rgba(37, 99, 235, 0.14);
  color: var(--map-text);
}

.map-task-page-meta__pill--high {
  background: rgba(234, 88, 12, 0.18);
  color: var(--map-text);
}

/* Table view fills the available vertical space: the page stretches to the
   host's height and every wrapper flexes down to the table's own scroller,
   so the list scrolls inside a maximally tall table instead of being capped
   to a fraction of the viewport. Mirrors the mobile fill chain below. */
.map-top-occupations-treemap--task-viz .map-task-page--table-view {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.map-task-page--table-view .map-task-page__main,
.map-task-page--table-view .map-task-page__chart-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.map-task-page--table-view .map-task-page__chart--table:not([hidden]) {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.map-task-page__chart--table:not([hidden]) {
  display: block;
  width: 100%;
  min-height: 260px;
  max-height: min(52vh, 520px);
  overflow: hidden;
}

/* Desktop table view: the inner .map-task-table__scroller owns scrolling (like
   the overview table). The task-viz host must NOT also scroll, otherwise its
   overflow-y:auto lets the flex child grow to full content height and the inner
   scroller never engages — so the whole page scrolls instead of the list. The
   class is toggled in TaskPage.paint() (desktop table view only; mobile has its
   own fill chain) and stripped when the overview re-claims the host. */
/* Combined selector so this wins the overflow over the base --task-viz rule
   (`...--task-viz:not([hidden])`, same specificity, defined earlier). */
.map-top-occupations-treemap--task-viz.map-top-occupations-treemap--task-table-scroll {
  overflow-y: hidden;
}

.map-task-table {
  /* Default the stat-column width here (not only on .map-task-page) so the
     overview table — which mounts outside .map-task-page — still resolves the
     two-column grid. The @container overrides below re-key on .map-task-table. */
  --map-task-stat-pill-width: 7rem;
  --map-task-action-col-width: 1.25rem;
  --map-task-scrollbar-w: 0px;
  /* The table is a query container so its layout responds to the (resizable)
     side-panel width rather than the viewport — see the @container rules below.
     This matters because the panel can be narrow on a wide desktop, which the
     viewport-based MOBILE_QUERY doesn't catch. */
  container-type: inline-size;
  container-name: map-task-table;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  max-height: inherit;
  box-sizing: border-box;
  /* The border/radius/background live on the table root (not the scroller) so
     the fixed header and the scrolling list sit inside one bordered box. */
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.map-task-table__scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Reserve the scrollbar gutter always, so rows don't shift sideways when the
     scrollbar appears and so the gutter matches the header's padding-right. */
  scrollbar-gutter: stable;
}

/* Fixed header — lives outside the scroll container so it never moves while
   the list scrolls. padding-right mirrors the scroller's reserved gutter to
   keep the stat columns aligned with row values (0 on overlay scrollbars). */
.map-task-table__cols {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.65rem;
  padding-right: calc(0.65rem + var(--map-task-scrollbar-w, 0px));
  background: #f6f8fb;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.map-task-table__cols-stats {
  display: grid;
  grid-template-columns:
    var(--map-task-stat-pill-width)
    var(--map-task-stat-pill-width)
    var(--map-task-action-col-width);
  gap: 0.35rem;
  width: calc(
    var(--map-task-stat-pill-width) * 2
    + var(--map-task-action-col-width)
    + 0.35rem * 2
  );
  flex-shrink: 0;
}

.map-task-table__col {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0.15rem 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--type-footnote-size);
  font-weight: 600;
  line-height: 1.2;
  color: var(--map-subtle);
  cursor: pointer;
  white-space: nowrap;
}

.map-task-table__col--name {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
}

.map-task-table__col--stat {
  justify-content: center;
  width: var(--map-task-stat-pill-width);
  min-width: var(--map-task-stat-pill-width);
  box-sizing: border-box;
}

.map-task-table__col--action {
  width: var(--map-task-action-col-width);
  min-width: var(--map-task-action-col-width);
  padding: 0;
  cursor: default;
  pointer-events: none;
}

.map-task-table__col:hover,
.map-task-table__col:focus-visible {
  color: var(--map-text);
  outline: none;
}

.map-task-table__col.is-active {
  color: var(--map-text);
}

.map-task-table__col-arrow {
  font-size: 0.6rem;
  line-height: 1;
  opacity: 0.45;
}

.map-task-table__col.is-active .map-task-table__col-arrow {
  opacity: 1;
}

.map-task-table__list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.map-task-table__row {
  margin: 0;
  padding: 0;
}

.map-task-table__row--divided {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.map-task-table__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: default;
}

.map-task-table__item.is-clickable {
  cursor: pointer;
}

.map-task-table__item.is-clickable:hover,
.map-task-table__item.is-clickable:focus-visible {
  background: rgba(15, 23, 42, 0.04);
  outline: none;
}

.map-task-table__item.is-selected {
  background: rgba(37, 99, 235, 0.08);
}

.map-task-table__item-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--type-footnote-size);
  font-weight: 500;
  line-height: 1.35;
  color: var(--map-text);
}

.map-task-table__item-stats {
  display: grid;
  grid-template-columns:
    var(--map-task-stat-pill-width)
    var(--map-task-stat-pill-width)
    var(--map-task-action-col-width);
  gap: 0.35rem;
  flex: 0 0 calc(
    var(--map-task-stat-pill-width) * 2
    + var(--map-task-action-col-width)
    + 0.35rem * 2
  );
  width: calc(
    var(--map-task-stat-pill-width) * 2
    + var(--map-task-action-col-width)
    + 0.35rem * 2
  );
  min-width: calc(
    var(--map-task-stat-pill-width) * 2
    + var(--map-task-action-col-width)
    + 0.35rem * 2
  );
  align-self: center;
}

.map-task-table__item-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--type-footnote-size);
  font-weight: 600;
  line-height: 1.2;
  color: var(--map-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.map-task-table__item-action {
  position: relative;
  justify-self: center;
  align-self: center;
  width: 1.25rem;
  height: 1.25rem;
  box-sizing: border-box;
  border: 1.5px solid var(--system-blue, #007aff);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.map-task-table__item-action::before,
.map-task-table__item-action::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--system-blue, #007aff);
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.map-task-table__item-action::before {
  width: 8px;
  height: 1.5px;
}

.map-task-table__item-action::after {
  width: 1.5px;
  height: 8px;
}

.map-task-table__item-action.is-visible {
  opacity: 1;
}

/* Narrow side panel (desktop layout, but a thin panel): the two fixed 7rem stat
   columns otherwise crush the task name. Shrink the stat columns and let the
   "Estimated time" header wrap to two lines so the name keeps usable width.
   Keyed on the table's own width (container query), not the viewport, because
   the panel is resizable independently of the viewport. */
@container map-task-table (max-width: 420px) {
  .map-task-table {
    --map-task-stat-pill-width: 5rem;
  }

  /* Allow the stat header titles to wrap onto two centered lines. */
  .map-task-table__col--stat {
    white-space: normal;
  }

  .map-task-table__col--stat .map-task-table__col-label {
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
}

@container map-task-table (max-width: 340px) {
  .map-task-table {
    --map-task-stat-pill-width: 4.25rem;
  }
}

.map-task-view-toggle {
  display: inline-flex;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.map-task-view-toggle__btn {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--type-footnote-size);
  color: var(--map-subtle);
  cursor: pointer;
}

.map-task-view-toggle__btn.is-active {
  background: rgba(15, 23, 42, 0.08);
  color: var(--map-text);
  font-weight: 600;
}

.map-task-view-toggle__btn:hover,
.map-task-view-toggle__btn:focus-visible {
  color: var(--map-text);
  outline: none;
}

.map-task-page__chart {
  width: 100%;
  min-height: 0;
}

.map-task-page__chart--bars:not([hidden]) {
  display: block;
  width: 100%;
  height: 100%;
}

.map-task-bar-chart__svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Only the grey "Others" group is interactive (expand / collapse). */
.map-task-bar-chart__bar.is-others {
  cursor: pointer;
}

.map-task-page.is-explanation-enabled .map-task-bar-chart__bar:not(.is-others) {
  cursor: pointer;
}

.map-task-bar-chart__bar-fill {
  transition: fill-opacity 0.12s ease;
}

.map-task-bar-chart__axis text {
  font-family: Inter, system-ui, sans-serif;
  font-size: var(--type-caption2-size);
  fill: var(--map-subtle);
}

/* Light horizontal gridlines for the % scale; no axis domain line. */
.map-task-bar-chart__grid line {
  stroke: rgba(15, 23, 42, 0.08);
  shape-rendering: crispEdges;
}

.map-task-bar-chart__bar.is-hovered .map-task-bar-chart__bar-fill,
.map-task-bar-chart__bar.is-selected .map-task-bar-chart__bar-fill {
  fill-opacity: 1;
  filter: brightness(1.03);
}


.map-task-bar-chart__axis-label {
  font-size: var(--type-caption2-size);
  fill: var(--map-subtle);
  font-weight: 500;
}

.map-top-occupations-treemap__svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-top-occupations-tile {
  cursor: pointer;
}

.map-top-occupations-tile__rect {
  transition: transform 140ms ease, filter 140ms ease, stroke-width 140ms ease;
}

.map-top-occupations-tile:hover .map-top-occupations-tile__rect,
.map-top-occupations-tile:focus-within .map-top-occupations-tile__rect {
  filter: brightness(1.12) saturate(1.15);
  stroke: #111;
  stroke-width: 2;
  stroke-opacity: 0.85;
}

/* Tile labels are native SVG <text> (see treemap/shared.js: appendTileLabel).
   They were previously HTML inside <foreignObject>, which iOS Safari
   miscomposited inside the transformed mobile sheet — text from several tiles
   painted on top of the top-left tile. font-family lives on the label classes
   themselves (not just the svg) so the off-screen measurement probe resolves
   the same font. Wrapping/truncation/line-height are computed in JS, so the
   old HTML layout props (-webkit-line-clamp, flex, word-break) are gone. */
.map-top-occupations-tile__title,
.map-top-occupations-tile__meta {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.map-top-occupations-treemap__svg text {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.map-top-occupations-tile__title {
  font-size: var(--type-caption1-size);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.map-top-occupations-tile__meta {
  font-size: var(--type-caption2-size);
  font-weight: 400;
  opacity: 0.92;
}

.map-top-occupations-tile__meta--strong {
  font-weight: 500;
}

@media (max-width: 1100px) {
  .map-side-panel.is-expanded .map-exposure-panels {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .map-exposure-panels,
  .map-side-panel.is-expanded .map-exposure-panels {
    grid-template-columns: 1fr;
  }
}

/* Task exposure explanation overlay (calibrated ensemble reasoning +
   evidence). Opened by clicking a task tile in the task treemap; the
   element is created lazily by panel/task-explanation.js and appended to
   <body>, so these styles must be self-contained. */
.map-task-explanation-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.map-task-explanation-card {
  /* Matches .map-info-modal__dialog (40-modal.css) so both overlays read as
     the same modal width. */
  width: min(860px, 100%);
  max-height: min(78vh, 640px);
  overflow-y: auto;
  background: #fff;
  color: #0f172a;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.35);
  padding: 20px 22px 22px;
  font-family: Inter, system-ui, sans-serif;
}

.map-task-explanation-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.map-task-explanation-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.map-task-explanation-card__subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #64748b;
}

.map-task-explanation-card__close {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.map-task-explanation-card__close:hover {
  background: #e2e8f0;
}

.map-task-explanation-card__status {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: #64748b;
}

.map-task-explanation-card__score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.map-task-explanation-card__score {
  flex: none;
  font-size: 26px;
  font-weight: 800;
  color: #1e294b;
}

.map-task-explanation-card__score-caption {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.map-task-explanation-card__score-takeaway {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: #334155;
}

.map-task-explanation-card__score-detail {
  display: block;
}

.map-task-explanation-card__section {
  margin-top: 14px;
}

.map-task-explanation-card__section-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.map-task-explanation-card__badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.map-task-explanation-card__badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e294b;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.map-task-explanation-card__badge-desc {
  font-size: 12px;
  color: #64748b;
}

.map-task-explanation-card__reasoning {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #1e293b;
  white-space: pre-wrap;
}

.map-task-explanation-card__attribution {
  margin: 8px 0 0;
  font-size: 11.5px;
  font-style: italic;
  color: #94a3b8;
}

.map-task-explanation-card__sources {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-task-explanation-card__source {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.map-task-explanation-card__source-kind {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.map-task-explanation-card__source-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-task-explanation-card__source-link:hover {
  color: #1e40af;
}

.map-task-explanation-card__source-text {
  color: #334155;
}

.map-task-explanation-card__overall-label {
  /* Headline verdict: first element under the header, so a touch larger than
     the body copy. */
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.map-task-explanation-subtasks {
  margin: 0 0 16px;
}

.map-task-explanation-subtasks__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.map-task-explanation-subtasks__toggle:hover {
  background: #f1f5f9;
}

.map-task-explanation-subtasks__chevron {
  transition: transform 0.18s ease;
  color: #64748b;
}

.map-task-explanation-subtasks.is-open .map-task-explanation-subtasks__chevron {
  transform: rotate(180deg);
}

.map-task-explanation-subtasks__panel {
  margin-top: 10px;
}

.map-task-explanation-subtasks__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.map-task-explanation-subtask {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 12px;
  align-items: stretch;
}

.map-task-explanation-subtask__bar {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: #cbd5e1;
}

.map-task-explanation-subtask__bar.is-safe {
  background: #16a34a;
}

.map-task-explanation-subtask__bar.is-direct {
  background: #dc2626;
}

.map-task-explanation-subtask__bar.is-integration {
  background: #ea580c;
}

.map-task-explanation-subtask__body {
  min-width: 0;
}

.map-task-explanation-subtask__title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  color: #1e293b;
}

.map-task-explanation-subtask__label {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.map-task-explanation-subtask__detail {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #64748b;
}

.map-task-explanation-subtasks__disclaimer {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #94a3b8;
  font-style: italic;
}

.map-task-explanation-card__source-evidence {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
}

.map-task-explanation-card__source-evidence-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.map-task-explanation-card__source-evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.map-task-explanation-card__source-evidence-item,
.map-task-explanation-card__source-evidence-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #475569;
}

.map-task-explanation-card__source-evidence-copy {
  color: #475569;
}

.map-task-explanation-card__bottleneck {
  margin: 0 0 14px;
  padding: 14px 14px 14px 16px;
  border-left: 3px solid #cbd5e1;
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0));
}

.map-task-explanation-card__bottleneck-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.map-task-explanation-card__bottleneck-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.map-task-explanation-card__bottleneck-text,
.map-task-explanation-card__tail-summary {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #475569;
}

/* Unlike __bottleneck-text (spaced by its shaded parent block), the tail
   summary is a bare <p> that renders directly above the bottleneck/subtasks
   blocks (both top-margin 0) in the card order, so it carries its own gap. */
.map-task-explanation-card__tail-summary {
  margin: 0 0 14px;
}

.map-task-explanation-card__bottleneck-emphasis {
  font-weight: 800;
  color: #0f172a;
}

.map-task-explanation-card__inline-source {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.map-task-explanation-card__inline-source:hover {
  text-decoration: underline;
}

.map-task-explanation-card__source-index {
  flex: none;
  min-width: 58px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.map-task-explanation-overlay[hidden] {
  display: none;
}

@media (max-width: 1079px), (pointer: coarse) {
  .map-exposure-panels,
  .map-side-panel.is-expanded .map-exposure-panels {
    grid-template-columns: 1fr;
  }

  .map-exposure-card__body {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .map-exposure-card__details {
    width: 100%;
  }

  .map-side-panel {
    --map-side-panel-width: min(40vw, calc(100vw - 32px));
    --map-side-panel-min-width: min(280px, calc(100vw - 32px));
    --map-side-panel-max-width: min(40vw, calc(100vw - 32px));
  }

  .map-side-panel.is-expanded {
    --map-side-panel-width: calc(100vw - 32px);
    --map-side-panel-min-width: calc(100vw - 32px);
    --map-side-panel-max-width: calc(100vw - 32px);
  }

  .map-info-modal {
    padding: 14px;
  }

  .map-info-modal__dialog {
    max-height: min(88vh, 900px);
    padding: 0 1.15rem 1.15rem;
    border-radius: 20px;
  }

  .map-info-modal__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .map-info-modal__title {
    max-width: calc(100% - 52px);
  }

  .map-info-modal__grid {
    grid-template-columns: 1fr;
  }

  .map-info-modal__sticky {
    margin: 0 -1.15rem 1.7rem;
    padding: 1rem 1.15rem 0.8rem;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
  }

  /* Task explanation modal — stack the score block and sources so copy uses
     full card width on narrow viewports (incl. devtools mobile emulation). */
  .map-task-explanation-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .map-task-explanation-card {
    width: min(100%, calc(100vw - 16px));
    max-height: min(92vh, 900px);
    padding: 10px 12px 12px;
    border-radius: 14px 14px 0 0;
  }

  .map-task-explanation-card__header {
    margin-bottom: 8px;
    gap: 8px;
  }

  .map-task-explanation-card__title {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
  }

  .map-task-explanation-card__subtitle {
    margin-top: 2px;
    font-size: 9.5px;
    line-height: 1.25;
  }

  .map-task-explanation-card__close {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .map-task-explanation-card__score-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
  }

  .map-task-explanation-card__score {
    font-size: 18px;
    line-height: 1;
  }

  .map-task-explanation-card__score-caption {
    width: 100%;
    font-size: 9.5px;
    line-height: 1.3;
  }

  .map-task-explanation-card__score-takeaway {
    font-size: 10px;
    line-height: 1.25;
    margin-bottom: 3px;
  }

  .map-task-explanation-card__score-detail {
    font-size: 9.5px;
    line-height: 1.25;
  }

  .map-task-explanation-card__status {
    font-size: 9.5px;
    line-height: 1.3;
  }

  .map-task-explanation-card__section {
    margin-top: 10px;
  }

  .map-task-explanation-card__section-title {
    font-size: 9px;
    margin-bottom: 4px;
  }

  .map-task-explanation-card__overall-label {
    font-size: 10.5px;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  .map-task-explanation-subtasks__toggle {
    font-size: 10.5px;
    padding: 6px 9px;
  }

  .map-task-explanation-subtask__title {
    font-size: 10.5px;
    line-height: 1.25;
  }

  .map-task-explanation-subtask__label {
    font-size: 9.5px;
  }

  .map-task-explanation-subtask__detail,
  .map-task-explanation-card__bottleneck-text,
  .map-task-explanation-card__tail-summary,
  .map-task-explanation-card__source-evidence-item,
  .map-task-explanation-card__source-evidence-text,
  .map-task-explanation-card__reasoning {
    font-size: 10px;
    line-height: 1.35;
  }

  .map-task-explanation-card__bottleneck {
    padding: 8px 8px 8px 10px;
    margin-bottom: 8px;
  }

  .map-task-explanation-card__bottleneck-kicker,
  .map-task-explanation-card__source-evidence-kicker {
    font-size: 8.5px;
    margin-bottom: 3px;
  }

  .map-task-explanation-card__attribution,
  .map-task-explanation-subtasks__disclaimer {
    font-size: 9px;
    line-height: 1.3;
  }

  .map-task-explanation-card__source {
    display: block;
    font-size: 10px;
    line-height: 1.3;
  }

  .map-task-explanation-card__source-index {
    display: inline;
    min-width: 0;
    font-size: 9px;
  }

  .map-task-explanation-card__source-kind {
    display: inline-block;
    margin-left: 6px;
    font-size: 8.5px;
    padding: 1px 5px;
    vertical-align: baseline;
  }

  .map-task-explanation-card__source-link,
  .map-task-explanation-card__source-text {
    display: block;
    width: 100%;
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.3;
  }
}

.wal-corner-logos {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  left: max(20px, env(safe-area-inset-left, 0px));
  right: max(20px, env(safe-area-inset-right, 0px));
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
  user-select: none;
}

.wal-corner-logo,
.ctl-corner-logo {
  height: 30px;
  width: auto;
  display: block;
}

@media (max-width: 1100px) {
  .wal-corner-logo,
  .ctl-corner-logo {
    height: 24px;
  }
}

@media (max-width: 1079px), (pointer: coarse) {
  /* Move logos to top-left on mobile and align with the menu FAB
     (.map-mobile-menu-toggle): same 52px height and same top inset so
     both share a horizontal centerline. */
  .wal-corner-logos {
    top: max(12px, env(safe-area-inset-top, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto;
    bottom: auto;
    gap: 10px;
    align-items: center;
  }

  .wal-corner-logo,
  .ctl-corner-logo {
    height: 52px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    object-position: left center;
  }
}

/* ============================================================
   Liquid Glass design tokens (Phase 0.5)
   Light frosted-glass surfaces used across mobile chrome.
   ============================================================ */
:root {
  --glass-fill: rgba(255, 255, 255, 0.55);
  --glass-fill-strong: rgba(255, 255, 255, 0.95);
  --glass-blur: 20px;
  --glass-saturation: 180%;
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-soft: rgba(0, 0, 0, 0.06);
  --glass-specular: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --glass-shadow-pressed: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  --glass-radius-pill: 9999px;
  --glass-radius-card: 1.25rem;
  --glass-text: #0f172a;
}

.glass-pill,
.glass-card,
.glass-fab,
.glass-icon-btn,
.glass-segmented {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid var(--glass-border-soft);
  box-shadow: var(--glass-shadow);
  color: var(--glass-text);
  isolation: isolate;
}

.glass-pill::before,
.glass-card::before,
.glass-fab::before,
.glass-icon-btn::before,
.glass-segmented::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--glass-specular), transparent);
  pointer-events: none;
  border-radius: inherit;
}

.glass-pill {
  border-radius: var(--glass-radius-pill);
  padding: 0.5rem 1rem;
}

.glass-card {
  border-radius: var(--glass-radius-card);
}

.glass-fab,
.glass-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--glass-radius-pill);
  cursor: pointer;
  font: inherit;
  color: var(--glass-text);
  transition: transform 120ms ease, background-color 120ms ease;
}

.glass-fab[hidden],
.glass-icon-btn[hidden],
.glass-pill[hidden],
.glass-card[hidden],
.glass-segmented[hidden] {
  display: none;
}

.glass-fab {
  width: 52px;
  height: 52px;
}

.glass-icon-btn {
  width: 44px;
  height: 44px;
}

.glass-fab:active,
.glass-icon-btn:active {
  transform: scale(0.96);
  background: var(--glass-fill-strong);
  box-shadow: var(--glass-shadow), var(--glass-shadow-pressed);
}

.glass-fab:focus-visible,
.glass-icon-btn:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.4);
  outline-offset: 2px;
}

.glass-fab > svg,
.glass-icon-btn > svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glass-segmented {
  display: inline-flex;
  border-radius: var(--glass-radius-pill);
  padding: 4px;
  gap: 2px;
}

.glass-segmented__option {
  position: relative;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: var(--glass-radius-pill);
  font-size: var(--type-subheadline-size);
  font-weight: 500;
  color: var(--glass-text);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background-color 180ms ease, transform 120ms ease;
}

.glass-segmented__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.glass-segmented__option:has(input:checked) {
  background: var(--glass-fill-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.glass-segmented__option:active {
  transform: scale(0.98);
}

/* Layer/metric segmented variant: full-width column, 44px touch target,
   used inside the mobile Settings overlay. */
.map-layer-toggle__segmented {
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.map-layer-toggle__segmented .glass-segmented__option {
  /* flex 1 1 0 + min-width 0 so two segments share the column equally
     regardless of label length (otherwise "Theoretical" forces overflow). */
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  font-size: var(--type-footnote-size);
}

.map-layer-toggle__segmented .glass-segmented__option-label {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

@supports not (backdrop-filter: blur(0)) {
  .glass-pill,
  .glass-card,
  .glass-fab,
  .glass-icon-btn,
  .glass-segmented {
    background: rgba(255, 255, 255, 0.92);
  }
}

@media (prefers-reduced-transparency) {
  .glass-pill,
  .glass-card,
  .glass-fab,
  .glass-icon-btn,
  .glass-segmented {
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .glass-pill::before,
  .glass-card::before,
  .glass-fab::before,
  .glass-icon-btn::before,
  .glass-segmented::before {
    display: none;
  }
}

@media (prefers-contrast: more) {
  .glass-pill,
  .glass-card,
  .glass-fab,
  .glass-icon-btn,
  .glass-segmented {
    border-color: rgba(0, 0, 0, 0.5);
  }
}

/* ============================================================
   Mobile shell (Phase 1+2): hamburger menu, full-screen overlays
   ============================================================ */
.map-mobile-menu-shell,
.map-mobile-menu-toggle,
.map-mobile-menu,
.map-overlay {
  display: none;
}

@media (max-width: 1079px), (pointer: coarse) {
  /* Shell: shared top-right anchor for the toggle FAB and the morphing
     pill so they overlap pixel-for-pixel and crossfade in place. */
  .map-mobile-menu-shell {
    display: block;
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    width: 52px;
    z-index: 31;
  }

  /* Hamburger toggle: collapsed state shows this; opens fade it out. */
  .map-mobile-menu-toggle {
    display: inline-flex;
    position: absolute;
    top: 0;
    right: 0;
    transition: opacity 160ms ease, transform 200ms cubic-bezier(0.34, 1.2, 0.5, 1);
    z-index: 2;
  }

  .map-mobile-menu-toggle[aria-expanded="true"] {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
  }

  /* Morphing pill: same width/anchor as the FAB, grows downward when
     opened. Closed state is clipped to the FAB's circle so the reveal
     reads as a soft pill expansion. */
  .map-mobile-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    min-width: 52px;
    height: auto;
    padding: 6px;
    box-sizing: border-box;
    border-radius: 26px;
    transform-origin: top center;
    transform: scale(0.96);
    opacity: 0;
    pointer-events: none;
    clip-path: inset(0 0 100% 0 round 26px);
    transition:
      clip-path 320ms cubic-bezier(0.34, 1.2, 0.5, 1),
      opacity 200ms ease,
      transform 320ms cubic-bezier(0.34, 1.2, 0.5, 1);
    z-index: 1;
  }

  .map-mobile-menu[data-open="true"] {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
    clip-path: inset(0 0 0 0 round 26px);
  }

  /* Icon-only buttons inside the pill. Width tracks the 52px pill (40px +
     6px padding each side); height is 44px to meet the touch-target
     guideline — the pill is a vertical column, so taller items just make it
     a little taller without affecting the FAB-morph width. */
  .map-mobile-menu__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 40px;
    height: 44px;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    border-radius: 20px;
    color: var(--glass-text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    opacity: 0;
    transition: background-color 120ms ease, opacity 160ms ease;
  }

  .map-mobile-menu[data-open="true"] .map-mobile-menu__item {
    opacity: 1;
  }

  .map-mobile-menu[data-open="true"] .map-mobile-menu__item:nth-child(1) { transition-delay: 80ms; }
  .map-mobile-menu[data-open="true"] .map-mobile-menu__item:nth-child(2) { transition-delay: 110ms; }
  .map-mobile-menu[data-open="true"] .map-mobile-menu__item:nth-child(3) { transition-delay: 140ms; }
  .map-mobile-menu[data-open="true"] .map-mobile-menu__item:nth-child(4) { transition-delay: 170ms; }

  .map-mobile-menu__item + .map-mobile-menu__item {
    margin-top: 4px;
  }

  .map-mobile-menu__item:active,
  .map-mobile-menu__item:focus-visible {
    background: var(--glass-fill-strong);
    outline: none;
  }

  .map-mobile-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .map-mobile-menu__icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* The pill is icon-only on mobile, but labels stay in the accessibility
     tree so screen readers announce each item ("Home", "Refresh", etc.).
     `display: none` would also remove them from the a11y tree, leaving SR
     users with unlabeled buttons (icons are aria-hidden, no aria-labels). */
  .map-mobile-menu__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  @media (prefers-reduced-motion: reduce) {
    .map-mobile-menu,
    .map-mobile-menu-toggle,
    .map-mobile-menu__item {
      transition: opacity 80ms ease;
      transform: none;
      transition-delay: 0ms !important;
    }
    .map-mobile-menu {
      clip-path: none;
    }
    .map-mobile-menu:not([data-open="true"]) {
      visibility: hidden;
    }
  }

  /* Hide desktop chrome on phones. #map-treemap-tooltip intentionally
     stays in the DOM — on touch it's repurposed as the tap-to-reveal
     popover for truncated treemap tiles (see exposure.js). Hiding it
     here broke the first-tap reveal on mobile. */
  #map-layer-toggle,
  #map-side-panel-toggle,
  #map-hover-card,
  #map-zoom-controls {
    display: none !important;
  }

  /* The layer toggle is moved into the Settings overlay on mobile (see
     setupMobileShell.applyLayoutForMode). The desktop styles position it
     absolutely top-right; inside the overlay we want normal flow so it
     doesn't sit on top of the overlay's close button. */
  #map-settings-overlay #map-layer-toggle {
    display: block !important;
    position: static;
    inset: auto;
    width: 100%;
  }

  /* Settings overlay: settings sit directly on the overlay's glass
     surface — no nested card. iOS Settings.app uses a single-glass
     pattern; nesting a second card on top of the overlay reads as
     two stacked sheets. */
  #map-settings-overlay .map-layer-toggle.map-layer-toggle--combined {
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 0;
  }

  /* iOS-standard segmented control on a grouped settings surface: tinted
     gray track contains the control, white selected pill stands clearly
     above it. Without this, the track inherits --glass-fill (white 0.55)
     and stacks invisibly on the overlay's own glass surface — both the
     track and the unselected option vanish into the background. Scoped to
     the overlay so the floating desktop chrome (which has the map behind
     it for contrast) keeps its translucent look. */
  #map-settings-overlay .glass-segmented {
    background: rgba(120, 120, 128, 0.16);
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  #map-settings-overlay .glass-segmented::before {
    display: none;
  }

  #map-settings-overlay .glass-segmented__option {
    color: var(--glass-text);
  }

  #map-settings-overlay .glass-segmented__option:has(input:checked) {
    background: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  }

  /* Column titles: iOS grouped-section-header style — quiet, uppercase,
     letter-spaced, secondary-label color. Recedes behind the controls. */
  #map-settings-overlay .map-layer-toggle__title {
    font-size: var(--type-footnote-size);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--secondary-label);
  }

  /* 8pt grid: snap inter-section gaps for an iOS-system rhythm. */
  #map-settings-overlay .map-layer-toggle--combined { gap: 24px; }
  #map-settings-overlay .map-layer-toggle__title { margin-bottom: 8px; }
  #map-settings-overlay .map-layer-toggle__header { margin-bottom: 8px; }

  /* Stack the two sections vertically on phones so each segmented control
     gets the full width — iOS Settings is single-column. */
  #map-settings-overlay .map-layer-toggle--combined-top-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Side panel + info modal become full-screen overlays on mobile */
  #map-side-panel.map-side-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: 0;
    background: var(--glass-fill);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    box-shadow: none;
    --map-side-panel-width: 100vw;
    --map-side-panel-min-width: 100vw;
    --map-side-panel-max-width: 100vw;
  }

  #map-side-panel.map-side-panel.is-expanded {
    --map-side-panel-width: 100vw;
    --map-side-panel-min-width: 100vw;
    --map-side-panel-max-width: 100vw;
  }

  #map-side-panel-content {
    height: 100%;
    overflow-y: auto;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  /* Inner cards inside the panel: glass-card look */
  .map-exposure-card,
  .map-top-occupations-card {
    background: var(--glass-fill-strong);
    border-radius: var(--glass-radius-card);
    border: 1px solid var(--glass-border-soft);
    box-shadow: var(--glass-shadow);
  }

  /* Full-screen settings/info overlay */
  .map-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--glass-fill);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    flex-direction: column;
    /* Scroll on the overlay (not on the body) so the head/body junction
       doesn't sit on a scroll-container boundary — that boundary inside
       a backdrop-filter context can light up as a 1px compositing seam
       on iOS. */
    overflow-y: auto;
  }

  .map-overlay[data-open="true"] {
    display: flex;
  }

  .map-overlay__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Match horizontal padding to body so the title's left edge and close
       button's right edge line up with the card edges below. */
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px 0;
    border: 0;
    box-shadow: none;
  }

  .map-overlay__head h2 {
    margin: 0;
    font-size: var(--type-body-size);
    font-weight: 600;
  }

  /* iOS sheet-dismissal convention: tinted "Done" text button at top-right. */
  .map-overlay__done {
    border: 0;
    background: transparent;
    color: var(--system-blue);
    font: inherit;
    font-size: var(--type-body-size);
    font-weight: 600;
    padding: 8px 4px;
    margin: 0;
    min-height: 44px;
    cursor: pointer;
  }

  .map-overlay__done:active {
    opacity: 0.5;
  }

  .map-overlay__done:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--system-blue) 40%, transparent);
    outline-offset: 2px;
    border-radius: 6px;
  }

  .map-overlay__body {
    flex: 1 1 auto;
    /* Scroll lives on .map-overlay now (see comment above) — body keeps
       overflow visible so head/body share the same compositing layer. */
    overflow: visible;
    /* Small top breathing room above the controls (8pt grid). */
    padding: 8px 16px max(16px, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 0;
    box-shadow: none;
  }

  /* Info modal goes full-screen on mobile */
  .map-info-modal {
    padding: 0 !important;
  }

  .map-info-modal__dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    padding: 0 16px max(16px, env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto;
  }

  .map-info-modal__close {
    width: 44px !important;
    height: 44px !important;
    top: max(12px, env(safe-area-inset-top, 0px)) !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
  }

  .map-info-modal__sticky {
    margin: 0 -16px 1.7rem !important;
    padding: max(56px, env(safe-area-inset-top, 0px)) 16px 0.8rem !important;
    border-radius: 0 !important;
  }

  /* Bump panel header buttons up to 44px hit zones */
  .map-panel-control--icon-only {
    min-width: 44px;
    min-height: 44px;
  }

  /* Hide bottom-right corner logo on mobile (relocated to top-right via earlier rule which we now invert: keep it top-right) */

  /* When any overlay or the side panel is open, hide the menu toggle + logo. */
  body.map-overlay-open .map-mobile-menu-shell {
    display: none;
  }

  body.map-overlay-open .wal-corner-logos {
    display: none;
  }

  /* Mobile draggable info sheet (Find My-style). Bottom-anchored sheet with
     a grabber handle, a peek summary, and an expanded inline-details state.
     States are driven by [data-state] set from JS; height is animated by
     translateY (--sheet-translate-y) so transitions stay GPU-cheap. */
  .map-mobile-sheet {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    /* Auto-size to current state's content (peek vs. expanded) so the
       card's actual bottom edge sits at viewport_bottom - inset and the
       gap below the card is always visible — instead of being clipped off
       by the viewport when the sheet was a fixed 85vh and pushed down by
       translateY. */
    height: auto;
    /* dvh tracks the *dynamic* viewport (iOS Safari URL bar show/hide) so the
       sheet isn't clipped or oversized when the toolbar animates; vh is the
       fallback for engines without dvh. JS mirrors this via visualViewport. */
    max-height: 85vh;
    max-height: 85dvh;
    padding: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    transform: translateY(var(--sheet-translate-y, 110%));
    transition:
      transform 240ms cubic-bezier(0.32, 0.72, 0, 1),
      max-height 240ms cubic-bezier(0.32, 0.72, 0, 1);
    /* touch-action lives on the drag surfaces (handle/peek) only — putting
       `none` on the root would intersect with descendants' values and
       prevent .map-mobile-sheet__expanded from opting back into pan-y, so
       the expanded section's tall content couldn't scroll with touch. */
    overscroll-behavior: contain;
    /* Clip child sections to the sheet's max-height — during drag the JS
       pins max-height to the dragged value while children render at full
       natural size; without this they'd overflow visibly below the card. */
    overflow: hidden;
  }

  .map-mobile-sheet[hidden] {
    display: none;
  }

  .map-mobile-sheet__handle {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 8px 0 4px;
    background: transparent;
    border: 0;
    cursor: grab;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }

  .map-mobile-sheet__handle:active {
    cursor: grabbing;
  }

  .map-mobile-sheet__grabber {
    display: block;
    width: 40px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.22);
  }

  .map-mobile-sheet__peek {
    flex: 0 0 auto;
    padding: 4px 12px 14px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    touch-action: none;
  }

  .map-mobile-sheet__peek-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .map-mobile-sheet__title {
    margin: 0;
    font-size: var(--type-body-size);
    font-weight: 600;
    color: var(--glass-text);
    line-height: 1.25;
    /* Pill-style collapsed peek: keep the title on a single line and
       truncate with ellipsis so long names don't reflow the layout. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .map-mobile-sheet__type {
    margin: 0;
    font-size: var(--type-caption1-size);
    font-weight: 600;
    color: var(--map-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .map-mobile-sheet__type:empty {
    display: none;
  }

  .map-mobile-sheet__peek-stat {
    margin: 6px 0 0;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 14px;
    border: 1px solid var(--mobile-peek-accent, var(--glass-border-soft));
    background: color-mix(in srgb, var(--mobile-peek-accent, transparent) 18%, transparent);
  }

  .map-mobile-sheet__peek-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }

  .map-mobile-sheet__peek-stat-label {
    font-size: var(--type-caption1-size);
    font-weight: 500;
    color: var(--map-muted);
    margin: 0;
  }

  .map-mobile-sheet__peek-stat-value {
    font-size: var(--type-caption1-size);
    font-weight: 600;
    color: var(--glass-text);
    font-variant-numeric: tabular-nums;
    margin: 0;
    white-space: nowrap;
  }

  .map-mobile-sheet__peek-stat-pct {
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 2px;
  }

  .map-mobile-sheet__expanded {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 18px 24px;
    border-top: 1px solid var(--glass-border-soft);
    transition: opacity 180ms ease, max-height 240ms cubic-bezier(0.32, 0.72, 0, 1);
  }

  .map-mobile-sheet[data-state="peek"] .map-mobile-sheet__expanded,
  .map-mobile-sheet[data-state="closed"] .map-mobile-sheet__expanded {
    /* Collapse to zero height (rather than only fading via opacity) so the
       sheet auto-sizes to the peek content — leaving the bottom inset
       visible as a gap between the card and the screen edge. */
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .map-mobile-sheet[data-state="expanded"] .map-mobile-sheet__expanded {
    max-height: 85vh;
    max-height: 85dvh;
    opacity: 1;
    pointer-events: auto;
    /* Sheet root sets `touch-action: none` to suppress native vertical
       scroll during drag. The expanded section is the one place where we
       *do* want native scroll (treemap can be tall), so opt back in here.
       Drag handlers live only on the handle/peek, so this doesn't conflict
       with sheet drag UX. */
    touch-action: pan-y;
  }

  /* Mobile treemap card — lives inside .map-mobile-sheet__mount which is
     the only child of __expanded. Acts as a flex column so the treemap
     gets a measured height context. */
  .map-mobile-treemap-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0 16px;
    min-height: 0;
  }

  .map-mobile-treemap-card__detail[hidden] {
    display: none;
  }

  .map-mobile-treemap-card__detail-meta {
    margin: 0;
    font-size: var(--type-caption1-size);
    color: var(--map-muted);
  }

  .map-mobile-treemap-card__detail-meta.map-task-page-meta {
    font-weight: 400;
    color: inherit;
  }

  .map-mobile-treemap-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .map-mobile-treemap-card__legend,
  .map-mobile-treemap-card__status {
    margin: 0;
    font-size: var(--type-caption2-size);
    color: var(--map-muted);
  }

  .map-mobile-treemap {
    /* Explicit height: the desktop trick (.map-top-occupations-treemap
       { flex: 1 1 0; height: 0 }) needs a bounded flex parent. Inside the
       sheet's overflow-y: auto container, a measurable height keeps the
       renderer's clientHeight read happy and stops the treemap from
       collapsing during scroll. Capped to leave headroom for the nav bar
       and meta row. */
    height: min(58vh, 460px);
    width: 100%;
    flex: 0 0 auto;
  }

  .map-mobile-treemap.map-top-occupations-treemap--task-viz:not([hidden]) {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .map-mobile-treemap[hidden] {
    display: none;
  }

  .map-mobile-treemap-tasks:not([hidden]) {
    display: flex;
    flex-direction: column;
    height: min(50vh, 400px);
    min-height: 0;
    width: 100%;
    flex: 0 0 auto;
    overflow: hidden;
  }

  .map-mobile-treemap.map-top-occupations-treemap--task-viz:not([hidden]) .map-task-page--mobile-table-view,
  .map-mobile-treemap-tasks:not([hidden]) .map-task-page--mobile-table-view {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .map-task-page--mobile-table-view .map-task-page__main,
  .map-task-page--mobile-table-view .map-task-page__chart-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .map-task-page--mobile-table-view .map-task-page__chart--table:not([hidden]) {
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  .map-task-page--mobile-table-view .map-task-table {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .map-task-page--mobile-table-view .map-task-table__scroller {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .map-task-page--mobile-table-view .map-task-table__item {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.45rem;
  }

  .map-task-page--mobile-table-view .map-task-table__item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.85rem;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    align-self: stretch;
  }

  .map-task-page--mobile-table-view .map-task-table__item-action {
    margin-left: auto;
    align-self: center;
    flex: none;
  }

  .map-task-page--mobile-table-view .map-task-table__item-name {
    font-size: var(--type-caption1-size);
    line-height: 1.3;
    width: 100%;
  }

  /* Rows stack name above stats on mobile, so the aligned column header is
     hidden and the stat values carry their own labels instead. */
  .map-task-page--mobile-table-view .map-task-table__cols {
    display: none;
  }

  .map-task-page--mobile-table-view .map-task-table__item-stat {
    justify-content: flex-start;
    font-size: var(--type-caption2-size);
  }

  /* Zero-pad the NBSP escape to a full 6 hex digits. A bare "\00a0" is greedy:
     when the next char is itself a hex digit (the "e" in "exposure") it gets
     swallowed into the escape (\00a0e), dropping the letter. "time" happens to
     be safe because "t" isn't hex. \0000a0 always terminates at the leading 0. */
  .map-task-page--mobile-table-view .map-task-table__item-stat--time::after {
    content: "\0000a0time";
  }

  .map-task-page--mobile-table-view .map-task-table__item-stat--exposure::after {
    content: "\0000a0exposure";
  }

  /* Nav inside the mobile card: tighter than the desktop default because
     the sheet's vertical budget is at a premium. Targets sized to the
     WCAG 2.5.8 24px floor; full-size touch targets live in the popovers
     these chips open. */
  #map-mobile-treemap-nav {
    margin-top: 0.2rem;
    padding-bottom: 0.575rem;
  }

  #map-mobile-treemap-nav .map-treemap-nav__trigger {
    min-height: 24px;
    padding: 0.05rem 0.1rem;
  }

  #map-mobile-treemap-nav .map-treemap-nav__inline-clear {
    min-width: 24px;
    min-height: 24px;
  }

  /* Placed AFTER the per-state rules above so source order resolves the
     specificity tie in favour of the dragging rules — during drag, sheet's
     max-height is pinned by JS and child sections must be fully revealed
     1:1 with the finger, regardless of which data-state was active when
     the drag began. */
  .map-mobile-sheet[data-dragging="true"] {
    transition: none;
  }
  .map-mobile-sheet[data-dragging="true"] .map-mobile-sheet__expanded {
    transition: none;
    max-height: 85vh;
    max-height: 85dvh;
    padding-top: 4px;
    padding-bottom: 18px;
    border-top-width: 1px;
    opacity: 1;
    pointer-events: auto;
    overflow: hidden;
    /* Once a body drag commits, stop native vertical pan so the sheet drag
       (driven in JS) owns the gesture instead of the treemap scrolling. */
    touch-action: none;
  }

  /* Reduced motion: don't fling/spring the sheet. JS already drops the
     inertial projection on release; this cuts the slide so the snap is
     effectively instant. */
  @media (prefers-reduced-motion: reduce) {
    .map-mobile-sheet,
    .map-mobile-sheet .map-mobile-sheet__expanded {
      transition-duration: 1ms;
    }
  }

  .map-mobile-sheet__mount {
    padding-top: 12px;
  }

  /* The desktop side panel still exists in the DOM on mobile but should
     never overlay the map while the sheet is fully expanded. */
  .map-mobile-sheet[data-state="expanded"] ~ #map-side-panel {
    display: none !important;
  }
}

@media (hover: none) {
  /* Persistent active state on touch — :hover never fires */
  .map-layer-toggle__label,
  .map-treemap-nav__trigger,
  .map-panel-control,
  .glass-segmented__option {
    transition: background-color 120ms ease;
  }

  .map-layer-toggle__label:active,
  .map-treemap-nav__trigger:active,
  .map-panel-control:active,
  .glass-segmented__option:active {
    background-color: rgba(255, 255, 255, 0.85);
  }

  /* Bigger hit boxes on touch for native form controls */
  .map-layer-toggle__label,
  .map-treemap-nav__trigger {
    min-height: 44px;
  }

  /* Anchor the connector to the dot edges (not centers) so the line
     lives strictly in the gap between dots — no segment is ever painted
     above the first dot or below the last. With the 44px touch-target
     row, the 12px dot occupies y=16..28; line endpoints sit at y=28 and
     wrap_height−28. */
  .map-layer-toggle__options::before {
    top: 28px;
    bottom: 28px;
  }
}

/* Keyboard "skip to map" link (WCAG 2.4.1). Off-screen until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: #1e294b;
  color: #fff;
  border-radius: 0 0 8px 0;
  font: 600 14px/1.2 Inter, system-ui, sans-serif;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* No-JS fallback: the map is JS-driven, so without it show a centered card
   pointing at the server-rendered research/data pages. */
.map-noscript {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
  background: var(--map-bg);
  color: var(--map-text);
}

.map-noscript h1 {
  margin: 0;
  font-size: 1.5rem;
}

.map-noscript p {
  margin: 0;
  max-width: 36rem;
  color: var(--map-muted);
}

.map-noscript a {
  color: #1e294b;
  font-weight: 600;
}
