/* ============================================================
   PlinkExchange — World Map · Layered overrides
   This file LAYERS ON TOP of vendor/dev-base.css and
   vendor/dev-extra.css, which provide all design tokens, the
   global header, footer, button, chip, container, and section-head
   patterns used across plink-exchange-dev.netlify.app.

   Only world-map-specific UI lives here:
     · the .subnav strip
     · the mode picker
     · the map canvas + tooltip
     · the country detail panel
     · the threshold viz grid
     · drill-through styling for US / CA
============================================================ */


/* ============================================================
   TYPOGRAPHY PRIMITIVES
============================================================ */

h1, h2, h3, h4, h5 {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  letter-spacing: -0.022em;
  margin: 0;
  color: var(--charcoal);
  line-height: 1.05;
}

.eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-deep);
  display: inline-block;
}

/* Section header pattern — eyebrow + title + lede.
   Used by every major section across the site. */
.section-head {
  margin-bottom: var(--s-9);
  max-width: 820px;
}
.section-head__eye    { display: block; margin-bottom: var(--s-3); }
.section-head__title  {
  font-size: var(--t-4xl);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0;
}
.section-head__lede {
  margin-top: var(--s-4);
  font-size: var(--t-lg);
  color: var(--charcoal-3);
  line-height: 1.55;
}
.section-head--center { margin-inline: auto; text-align: center; }
.section--ink .section-head__title { color: var(--paper); }
.section--ink .section-head__eye { color: var(--orange); }
.section--ink .section-head__lede { color: rgba(244,241,234,0.75); }

/* Page-level title (the big map H1) */
.page-title {
  font-size: var(--t-5xl);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--charcoal);
  margin: 0;
}

/* ============================================================
   PAGE HEAD — uses dev-base.css `header.page-head` rules and
   layers on top with the directory-style `.dx-page-*` classes
   so this page reads identically to plink-exchange-directory.
============================================================ */
.dx-page-head { padding: var(--s-9) 0 var(--s-7) !important; }
.dx-page-title {
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 900;
  letter-spacing: -0.034em;
  line-height: 1.02;
  margin: var(--s-4) 0 var(--s-3);
  max-width: 18ch;
}
.dx-page-lede {
  max-width: 64ch;
  margin-bottom: var(--s-6);
}
.dx-page-lede strong {
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.dx-page-meta {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  font-size: var(--t-sm);
  color: var(--charcoal-3);
}
.dx-page-meta li { display: flex; align-items: center; gap: 8px; }
.dx-page-meta .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}
.dx-page-meta strong {
  color: var(--charcoal);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* ============================================================
   SECTION SUB-NAV (matches plink-exchange-range-directory)
============================================================ */
.subnav {
  background: var(--paper-warm);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: var(--header-h);
  z-index: 25;
}
.subnav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--s-6);
  height: 44px;
}
.subnav-eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-deep);
  flex-shrink: 0;
}
.subnav-nav {
  display: flex;
  gap: var(--s-5);
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav-nav::-webkit-scrollbar { display: none; }
.subnav-nav a {
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--charcoal-3);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 0;
  position: relative;
  transition: color 0.14s;
}
.subnav-nav a:hover {
  color: var(--charcoal);
}
.subnav-nav a.active {
  color: var(--orange-deep);
  font-weight: 600;
}
@media (max-width: 720px) {
  .subnav-inner { gap: var(--s-4); height: 40px; }
  .subnav-eye { font-size: 9.5px; }
  .subnav-nav { gap: var(--s-4); }
  .subnav { top: var(--header-h); }
}

/* ============================================================
   PAGE HERO (the map title block)
============================================================ */
.hero {
  padding-block: var(--s-11) var(--s-7);
}
.hero__eye { margin-bottom: var(--s-4); }
.hero__title {
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.034em;
  color: var(--charcoal);
  margin: 0;
  max-width: 18ch;
}
.hero__title em {
  font-style: normal;
  color: var(--orange-deep);
  font-weight: 900;
}
.hero__lede {
  margin-top: var(--s-6);
  font-size: var(--t-lg);
  color: var(--charcoal-3);
  line-height: 1.55;
  max-width: 56ch;
  font-weight: 400;
}

/* ============================================================
   MODE PICKER (highlighting modes — Country Tier, Threshold, etc.)
============================================================ */
.modes {
  background: linear-gradient(to bottom, var(--paper) 0%, var(--paper-warm) 100%);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: var(--s-10) var(--gutter);
}
.modes-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-7) var(--s-9);
  align-items: flex-start;
  justify-content: space-between;
}
.modes-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
}
.modes-grouplabel {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange-deep);
}

.modes-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.mode-pill {
  --pill-color: var(--charcoal);
  appearance: none;
  border: 1.5px solid var(--rule-2);
  background: rgba(255,255,255,0.55);
  color: var(--charcoal);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--t-base);
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 10px 16px 10px 13px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.mode-pill:hover {
  border-color: var(--charcoal-3);
  background: white;
  transform: translateY(-1px);
}
.mode-pill .pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pill-color);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.mode-pill.is-active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--paper);
  font-weight: 700;
}
.mode-pill.is-active .pill-dot {
  background: var(--orange);
  box-shadow: 0 0 0 2px rgba(45,54,61,0.4);
}
.mode-pill .pill-icon {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: currentColor;
}
/* Mobile: single dropdown replaces pill rows */
.modes-select-wrap {
  display: none;
  position: relative;
  width: 100%;
}
.modes-select {
  display: block;
  appearance: none;
  width: 100%;
  background: white;
  border: 1.5px solid var(--rule-2);
  border-radius: var(--r-pill);
  padding: 14px 44px 14px 18px;
  font: 600 var(--t-md) 'DM Sans', sans-serif;
  color: var(--charcoal);
  outline: none;
  cursor: pointer;
  letter-spacing: -0.005em;
}
.modes-select:focus { border-color: var(--orange); box-shadow: var(--focus-ring); }
.modes-select-wrap::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 10px; height: 10px;
  border-right: 2px solid var(--charcoal-3);
  border-bottom: 2px solid var(--charcoal-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.modes-select-wrap__eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: var(--s-2);
}

/* ============================================================
   MAP
============================================================ */
.map-section {
  padding: var(--s-7) var(--gutter) var(--s-7);
}
.map-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  gap: var(--s-6);
  align-items: stretch;
}

.map-card {
  position: relative;
  background: linear-gradient(135deg, #FFFCF6 0%, var(--paper) 100%);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: 540px;
  aspect-ratio: 1.6 / 1;
}
.map-card #us-map { display: block; width: 100%; height: 100%; }
.map-loading {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-warm);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-xs);
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-corner-tl, .map-corner-tr {
  position: absolute;
  z-index: 5;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  padding: 7px 12px;
  border-radius: var(--r);
  font-size: var(--t-xs);
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: var(--shadow-sm);
}
.map-corner-tl { top: var(--s-4); left: var(--s-4); }
.map-corner-tr { top: var(--s-4); right: var(--s-4); align-items: flex-end; }
.map-eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.map-mode-name {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: var(--t-sm);
  color: var(--charcoal);
  letter-spacing: -0.01em;
}
#state-counter-num {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: var(--t-xl);
  color: var(--charcoal);
  line-height: 1;
}
.counter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.map-watermark {
  position: absolute;
  bottom: 14px;
  right: 16px;
  width: 130px;
  height: auto;
  opacity: 0.30;
  pointer-events: none;
  z-index: 4;
  user-select: none;
  filter: saturate(0.85);
}

/* states */
.state {
  stroke: rgba(255,255,255,0.92);
  stroke-width: 0.7;
  stroke-linejoin: round;
  cursor: pointer;
  transition: filter 0.18s ease, stroke-width 0.18s ease;
}
.state:hover {
  filter: brightness(1.08) saturate(1.1);
  stroke: var(--charcoal);
  stroke-width: 1.4;
}
.state.is-selected {
  stroke: var(--charcoal-2) !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 2px 6px rgba(45,54,61,0.35));
}
.state-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 9.5px;
  fill: rgba(255,255,255,0.95);
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(45,54,61,0.4);
  stroke-width: 1px;
}
.state-label.label-dark {
  fill: var(--charcoal-2);
  stroke: rgba(255,255,255,0.85);
  stroke-width: 1px;
}
.state-leader { stroke: var(--charcoal-3); stroke-width: 0.7; fill: none; pointer-events: none; }

/* tooltip */
.map-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 500;
  background: var(--charcoal-2);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  max-width: 280px;
  opacity: 0;
  transform: translate(-50%, -120%) translateY(8px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.map-tooltip[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, -120%) translateY(0);
}
.map-tooltip .tt-state {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: var(--t-sm);
  margin-bottom: 4px;
}
.map-tooltip .tt-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--t-xs); font-weight: 500; }
.map-tooltip .tt-dot { width: 8px; height: 8px; border-radius: 50%; }
.map-tooltip .tt-hint { margin-top: 4px; font-size: 11px; color: rgba(244,241,234,0.65); }

/* sidebar */
.map-sidebar { display: flex; flex-direction: column; gap: var(--s-3); }
.side-card {
  background: white;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-sm);
}
.side-eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-deep);
  display: block;
  margin-bottom: var(--s-2);
}
.side-title {
  font-family: 'Archivo', sans-serif;
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: -0.018em;
  margin: 0 0 4px;
  color: var(--charcoal);
}
.side-desc { font-size: var(--t-sm); color: var(--charcoal-3); line-height: 1.5; margin: 0; }

.legend-card { padding-bottom: 10px; }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.legend-item:hover { background: var(--paper-warm); }
.legend-swatch {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.5);
  box-shadow: inset 0 0 0 1px rgba(45,54,61,0.15);
  flex-shrink: 0;
}
.legend-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  color: var(--charcoal-3);
  background: var(--paper-warm);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.legend-label { font-size: var(--t-sm); font-weight: 500; color: var(--charcoal); line-height: 1.3; }
.legend-item.dim { opacity: 0.4; }

.howto { background: var(--charcoal); border-color: var(--charcoal); color: var(--paper); }
.howto .side-eye { color: var(--orange-soft); }
.howto-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.howto-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-size: var(--t-sm);
  color: rgba(244,241,234,0.92);
  line-height: 1.4;
}
.howto-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  color: var(--orange);
  background: rgba(242,92,31,0.16);
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
}

/* ============================================================
   FINDER
============================================================ */
.finder-section {
  padding: var(--s-5) var(--gutter) var(--s-9);
}
.finder {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(220px, 320px);
  gap: var(--s-4);
  align-items: center;
}
.finder-search {
  position: relative;
  background: white;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-pill);
  display: flex; align-items: center;
  padding: 0 16px 0 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.14s, box-shadow 0.14s;
}
.finder-search:focus-within {
  border-color: var(--orange);
  box-shadow: var(--focus-ring);
}
.finder-icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
#state-search {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  font: 500 var(--t-base) 'DM Sans', sans-serif;
  color: var(--charcoal);
  padding: 14px 12px;
  outline: none;
  letter-spacing: -0.005em;
  min-width: 0;
}
#state-search::placeholder { color: var(--muted); }
.finder-clear {
  appearance: none;
  border: none;
  background: var(--paper-warm);
  color: var(--charcoal-3);
  width: 24px; height: 24px;
  border-radius: var(--r-pill);
  font-size: 16px; line-height: 1;
  display: none;
}
.finder-clear:hover { background: var(--rule-2); color: var(--charcoal); }
.finder-search.has-text .finder-clear { display: inline-flex; align-items: center; justify-content: center; }

.finder-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: white;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 30;
  padding: 6px;
}
.search-result-item {
  padding: 10px 12px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.search-result-item:hover, .search-result-item.is-active { background: var(--paper-warm); }
.search-result-state { font-weight: 600; font-size: var(--t-sm); color: var(--charcoal); }
.search-result-meta { font-size: var(--t-xs); color: var(--muted); }

.finder-or {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.finder-select { position: relative; display: flex; align-items: center; }
#state-select {
  appearance: none;
  border: 1.5px solid var(--rule);
  background: white;
  border-radius: var(--r-pill);
  padding: 14px 38px 14px 18px;
  font: 500 var(--t-base) 'DM Sans', sans-serif;
  color: var(--charcoal);
  width: 100%;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.14s, box-shadow 0.14s;
}
#state-select:focus, #state-select:hover { border-color: var(--orange); }
.finder-chev {
  position: absolute;
  right: 16px;
  width: 14px; height: 14px;
  color: var(--charcoal-3);
  pointer-events: none;
}

/* ============================================================
   DETAIL SECTION (state-specific 3-column panel)
============================================================ */
.detail-section {
  padding: var(--section-y-tight) var(--gutter);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
  animation: fadeIn 0.3s ease;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.detail-inner { max-width: var(--content-max); margin: 0 auto; }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-5);
  margin-bottom: var(--s-7);
}
.detail-id {
  display: flex;
  gap: var(--s-5);
  align-items: center;
}
.detail-abbr {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 64px;
  line-height: 0.85;
  color: var(--orange);
  letter-spacing: -0.04em;
}
.detail-name {
  font-size: var(--t-4xl);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: var(--s-2);
}
.detail-tier-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.detail-tier-badge {
  display: inline-block;
  background: var(--charcoal);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: var(--r-pill);
}
.detail-tier-badge[data-tier="1"] { background: var(--tier-1); }
.detail-tier-badge[data-tier="2"] { background: var(--tier-2); }
.detail-tier-badge[data-tier="3"] { background: var(--tier-3); color: var(--charcoal); }
.detail-tier-badge[data-tier="4"] { background: var(--tier-4); }
.detail-tier-text { font-size: var(--t-sm); color: var(--charcoal-3); }
.detail-close {
  appearance: none;
  border: 1.5px solid var(--rule-2);
  background: transparent;
  color: var(--charcoal-3);
  font: 500 var(--t-sm) 'DM Sans', sans-serif;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.detail-close:hover { border-color: var(--charcoal); color: var(--charcoal); background: white; }

.detail-warnings {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-7);
}
.detail-warning {
  background: var(--orange-tint);
  border-left: 4px solid var(--orange-deep);
  padding: 12px 16px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: var(--t-sm);
  color: var(--charcoal-2);
  font-weight: 500;
}

.detail-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
.detail-col {
  background: white;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.col-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-3);
  border-bottom: 1px solid var(--rule);
}
.col-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.18em;
}
.col-title {
  font-family: 'Archivo', sans-serif;
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--charcoal);
}
.col-body { padding: var(--s-4) var(--s-5) var(--s-5); flex: 1; }

/* state-rules: rich visual cards */
#col-rules { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }

.rule-card {
  position: relative;
  background: var(--paper-warm);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  padding: 12px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.rule-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--rule-2);
}
.rule-card[data-rank="1"]::before { background: var(--tier-4); }
.rule-card[data-rank="2"]::before { background: var(--rank-2); }
.rule-card[data-rank="3"]::before { background: var(--tier-3); }
.rule-card[data-rank="4"]::before { background: var(--tier-1); }
.rule-card:hover { transform: translateX(2px); box-shadow: var(--shadow-md); }

.rule-head { display: flex; align-items: center; gap: 7px; }
.rule-icon {
  width: 22px; height: 22px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--charcoal);
}
.rule-icon svg { width: 14px; height: 14px; }
.rule-card[data-rank="1"] .rule-icon { color: #3A6225; background: #EDF3DE; border-color: #C6D8A5; }
.rule-card[data-rank="2"] .rule-icon { color: #6B7C24; background: #F2F4DC; border-color: #CDD79A; }
.rule-card[data-rank="3"] .rule-icon { color: #8C5E14; background: #FBF0D8; border-color: #E5C078; }
.rule-card[data-rank="4"] .rule-icon { color: #7A2812; background: #F8E1D9; border-color: #D9907B; }

.rule-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.rule-status {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: var(--t-md);
  letter-spacing: -0.018em;
  line-height: 1.2;
  color: var(--charcoal);
}
.rule-card[data-rank="1"] .rule-status { color: #3A6225; }
.rule-card[data-rank="2"] .rule-status { color: #5C6E1F; }
.rule-card[data-rank="3"] .rule-status { color: #8C5E14; }
.rule-card[data-rank="4"] .rule-status { color: #7A2812; }

.rule-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 2px 0 4px;
}
.meter-seg {
  height: 5px;
  border-radius: 2px;
  background: var(--rule);
}
.meter-seg.lit { background: var(--seg-color); }

.rule-text {
  font-size: var(--t-sm);
  color: var(--charcoal-2);
  line-height: 1.5;
}

/* hunting column */
.hunt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: var(--s-4);
}
.hunt-cell {
  position: relative;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  padding: 12px 12px 10px;
  background: var(--paper-warm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.hunt-cell.full { grid-column: 1 / -1; }
.hunt-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rule-2);
}
.hunt-cell.s-allowed::before    { background: var(--tier-4); }
.hunt-cell.s-qualified::before  { background: var(--tier-3); }
.hunt-cell.s-prohibited::before { background: var(--tier-1); }
.hunt-cell.s-unresolved::before { background: var(--rule-2); }
.hunt-species {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.hunt-icon { width: 14px; height: 14px; }
.hunt-status {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: var(--t-sm);
  color: var(--charcoal);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.hunt-detail {
  font-size: var(--t-xs);
  color: var(--charcoal-3);
  line-height: 1.4;
}

.hunt-meta-grid {
  border-top: 1px solid var(--rule);
  padding-top: var(--s-3);
  margin-top: 4px;
}
.hunt-meta-grid .field {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
}
.hunt-meta-grid .field:last-child { border-bottom: none; padding-bottom: 0; }
.hunt-meta-grid .field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.hunt-meta-grid .field-value {
  font-size: var(--t-sm);
  color: var(--charcoal-2);
  line-height: 1.5;
}

/* local carve-outs */
.local-list { display: flex; flex-direction: column; gap: 10px; }
.local-item {
  border-left: 3px solid var(--orange);
  background: #FAF6EC;
  padding: 11px 14px;
  border-radius: 0 var(--r) var(--r) 0;
}
.local-jurisdiction {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: var(--t-sm);
  color: var(--charcoal);
  margin-bottom: 4px;
}
.local-rule { font-size: var(--t-sm); color: var(--charcoal-2); line-height: 1.5; }
.local-empty {
  text-align: center;
  padding: var(--s-7) var(--s-4);
  color: var(--muted);
  font-size: var(--t-sm);
  font-style: italic;
}
.local-empty svg { display: block; margin: 0 auto 10px; opacity: 0.3; }

/* ============================================================
   SPECIES VIZ
============================================================ */
.viz-section {
  padding: var(--section-y) var(--gutter);
}
.viz-inner { max-width: var(--content-max); margin: 0 auto; }

.viz-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
.viz-species {
  background: white;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.viz-species-head { display: flex; align-items: center; gap: 9px; }
.viz-species-icon {
  width: 30px; height: 30px;
  background: var(--paper-warm);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.viz-species-icon svg { width: 18px; height: 18px; color: var(--charcoal); }
.viz-species-name {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: var(--t-sm);
  letter-spacing: -0.012em;
  color: var(--charcoal);
}

.viz-cells {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  width: 100%;
  aspect-ratio: 10 / 5;
}
.viz-cell {
  border-radius: 3px;
  background: var(--rule);
  position: relative;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.viz-cell:hover { transform: scale(1.45); z-index: 4; box-shadow: 0 4px 14px -4px rgba(45,54,61,0.4); }
.viz-cell.s-allowed    { background: var(--tier-4); }
.viz-cell.s-qualified  { background: var(--tier-3); }
.viz-cell.s-prohibited { background: var(--tier-1); }
.viz-cell.s-unresolved { background: var(--rule-2); }
.viz-cell.is-highlight { outline: 2px solid var(--charcoal); outline-offset: 1.5px; z-index: 3; }

.viz-bars { display: flex; flex-direction: column; gap: 5px; font-family: 'DM Sans', sans-serif; font-size: 11px; }
.viz-bar-row { display: flex; align-items: center; gap: 7px; }
.viz-bar-track {
  flex: 1;
  height: 6px;
  background: var(--paper-warm);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.viz-bar-fill { height: 100%; border-radius: var(--r-pill); }
.viz-bar-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 10.5px;
  color: var(--charcoal-3);
  width: 22px;
  text-align: right;
  flex-shrink: 0;
}
.viz-bar-row.r-allowed    .viz-bar-fill { background: var(--tier-4); }
.viz-bar-row.r-qualified  .viz-bar-fill { background: var(--tier-3); }
.viz-bar-row.r-prohibited .viz-bar-fill { background: var(--tier-1); }
.viz-bar-row.r-unresolved .viz-bar-fill { background: var(--rule-2); }

.viz-callout {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--charcoal);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  text-align: center;
  padding: 7px 8px;
  letter-spacing: 0.04em;
  display: none;
}
.viz-species.has-selected .viz-callout { display: block; }
.viz-callout strong { font-family: 'Archivo'; color: var(--orange-soft); font-weight: 800; }

.viz-summary {
  background: var(--paper-warm);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-7);
  font-size: var(--t-sm);
  color: var(--charcoal-2);
  line-height: 1.55;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-5);
  align-items: center;
}
.viz-summary-num {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 56px;
  color: var(--orange-deep);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.viz-summary-text strong { color: var(--charcoal); font-weight: 700; }

/* ============================================================
   FEDERAL FLOOR
============================================================ */
.federal-section {
  padding: var(--section-y) var(--gutter);
  background: linear-gradient(to bottom, var(--paper) 0%, var(--paper-warm) 100%);
  border-top: 1px solid var(--rule);
}
.federal-inner { max-width: var(--content-max); margin: 0 auto; }

.federal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-4);
}
.fed-card {
  position: relative;
  background: white;
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
  padding: var(--s-5);
  transition: transform 0.16s, box-shadow 0.16s;
}
.fed-card::before {
  content: '';
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 3px;
  background: var(--orange);
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transition: opacity 0.16s;
}
.fed-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fed-card:hover::before { opacity: 1; }
.fed-card h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-deep);
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.fed-card p { font-size: var(--t-sm); color: var(--charcoal-2); line-height: 1.55; margin: 0; }

/* ============================================================
   METHODOLOGY (dark)
============================================================ */
.methodology-section {
  padding: var(--section-y) var(--gutter);
  background: var(--charcoal);
  color: var(--paper);
  position: relative;
}
.methodology-section::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' seed='6'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  opacity: 0.5;
}
.methodology-inner { max-width: var(--content-max); margin: 0 auto; position: relative; }
.methodology-inner .section-head__title { color: var(--paper); }
.methodology-inner .section-head__eye { color: var(--orange); }

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-7);
}
.method-num {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--t-eye);
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.18em;
  margin-bottom: var(--s-2);
}
.method-h {
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: -0.018em;
  color: var(--paper);
  margin-bottom: var(--s-2);
}
.method-block p { font-size: var(--t-sm); color: rgba(244,241,234,0.78); line-height: 1.55; margin: 0; }

/* ============================================================
   DISCLAIMER
============================================================ */
.disclaimer-section {
  padding: var(--section-y-tight) var(--gutter);
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.disclaimer-inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.disclaimer-inner h2 {
  font-size: var(--t-4xl);
  font-weight: 900;
  letter-spacing: -0.025em;
  margin: var(--s-2) 0 var(--s-4);
}
.disclaimer-inner p {
  font-size: var(--t-base);
  color: var(--charcoal-3);
  line-height: 1.65;
  max-width: 720px;
  margin: 0 auto;
}

/* ============================================================
   FOOTER
============================================================ */
/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1180px) {
  .modes-inner { grid-template-columns: 1fr 1fr; }
  .modes-group:first-child { grid-column: 1 / -1; }
  .map-wrap { grid-template-columns: 1fr; }
  .map-card { aspect-ratio: 1.65 / 1; min-height: 420px; }
  .map-sidebar { flex-direction: row; flex-wrap: wrap; }
  .map-sidebar .side-card { flex: 1 1 240px; }
  .viz-grid { grid-template-columns: repeat(3, 1fr); }
  .viz-grid > :nth-child(n+4) { grid-column: span 1; }
  .detail-cols { grid-template-columns: 1fr 1fr; }
  .detail-col.col-local { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  /* Compact header — hide inline tagline, show mobile strip */
  .hdr-tagline--inline { display: none; }
  .hdr-tagline-bar { display: flex; }
  .hdr-nav { gap: var(--s-4); }
  .hdr-nav a { font-size: var(--t-xs); }
  .hdr-logo { height: 30px; }

  /* Hero */
  .hero { padding-block: var(--s-9) var(--s-5); }

  /* Mode picker → 3-col tile grid (touch-friendly).
     Using flex with a 33% basis means each row fills naturally:
     - 2 items (Regulatory) → ~50% each
     - 3 items per row (Hunting row 1) → ~33% each; row 2 (2 items) ~50% each
     - 1 item (Equipment) → full width */
  .modes { padding: var(--s-8) var(--gutter); }
  .modes-inner {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
  }
  .modes-group {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin: 0;
  }
  .modes-grouplabel {
    font-size: 11px;
    color: var(--orange-deep);
  }
  .modes-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .mode-pill {
    flex: 1 1 calc(33.33% - 6px);
    min-width: 0;
    padding: 14px 14px;
    min-height: 54px;
    border-radius: var(--r);
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    font-size: 13.5px;
    font-weight: 600;
    background: white;
    box-shadow: var(--shadow-sm);
    white-space: normal;
    line-height: 1.2;
  }
  .mode-pill .pill-icon { width: 14px; height: 14px; flex-shrink: 0; }
  .mode-pill .pill-dot { width: 7px; height: 7px; flex-shrink: 0; }
  /* Hide the legacy dropdown (kept in DOM for resize-survival but never shown) */
  .modes-select-wrap { display: none; }

  /* Map */
  .map-card { aspect-ratio: 1.3 / 1; min-height: 320px; border-radius: var(--r-lg); }
  .map-corner-tr { display: none; }
  .map-watermark { width: 90px; bottom: 10px; right: 10px; }

  /* Finder stacks */
  .finder { grid-template-columns: 1fr; gap: 8px; }
  .finder-or { display: none; }

  /* Detail */
  .detail-id { gap: 12px; }
  .detail-abbr { font-size: 48px; }
  .detail-cols { grid-template-columns: 1fr; }
  .detail-col.col-local { grid-column: auto; }

  /* Viz */
  .viz-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .viz-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .viz-summary { grid-template-columns: 1fr; gap: var(--s-3); padding: var(--s-5); }
  .viz-summary-num { font-size: 44px; }

  /* Hunt grid */
  .hunt-grid { grid-template-columns: 1fr; }

  /* Footer */
  .ftr-inner { gap: var(--s-5); }
  .ftr-logo { height: 38px; }
}

@media (max-width: 480px) {
  /* On the smallest screens, drop the lengthy tagline copy and just show the pill */
  .hdr-tagline-bar__text { display: none; }
  .hdr-tagline-bar { justify-content: center; padding: 6px var(--gutter); }
}

@media (max-width: 700px) { .state-label { display: none; } }

/* print */
@media print {
  body::before, .modes, .finder-section, .map-watermark, .ftr, .detail-close { display: none !important; }
  .hdr { position: static; }
  .map-card, .detail-section, .viz-section, .federal-section { break-inside: avoid; }
}


/* ============================================================
   WORLD-MAP ADDITIONS
   Only the bits that don't exist in the US/CA shared base.
   Everything else (rule-card, fed-card, hunt-cell, local-item,
   viz-summary) inherits the existing styles unchanged.
============================================================ */

/* Drill-through visual hint — US and CA on the world map */
.state.is-drill-through {
  stroke-dasharray: 3 2;
  stroke-width: 1.4;
  stroke: var(--charcoal);
}
.state.is-drill-through:hover {
  filter: brightness(1.12) saturate(1.12);
  cursor: pointer;
  stroke-width: 1.8;
}

/* Tooltip drill-through hint line */
.tt-hint {
  margin-top: 6px;
  font-size: 10.5px;
  color: rgba(244,241,234,0.65);
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ── Energy-threshold viz (REPLACES the species cartogram grid) ── */
/* Override the US/CA .viz-grid (which is a 5-col species grid) when
   running on the world map.  Add .viz-grid--world from JS. */
.viz-grid.viz-grid--world {
  display: block;
  grid-template-columns: none;
  margin-bottom: var(--s-7);
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 14px 18px;
  margin-bottom: var(--s-5);
  background: var(--paper-warm);
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
}
.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--charcoal);
  letter-spacing: 0.02em;
}
.viz-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.viz-region-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--s-5);
  margin-bottom: var(--s-5);
  align-items: start;
  padding: var(--s-4) 0;
  border-bottom: 1px dashed var(--rule);
}
.viz-region-row:last-child { border-bottom: none; }

.viz-region-heading {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: var(--t-eye);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-deep);
  padding-top: 6px;
}

.viz-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.viz-tile {
  border: none;
  border-radius: 3px;
  width: 38px;
  height: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.viz-tile:hover {
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 3px 10px -2px rgba(45,54,61,0.35);
  z-index: 2;
}
.viz-tile.is-selected {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
  transform: translateY(-1px);
}
.viz-tile-abbr { pointer-events: none; }

/* Mobile: stack region heading above the tiles */
@media (max-width: 720px) {
  .viz-region-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .viz-region-heading {
    padding-top: 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--rule);
  }
  .viz-tile {
    width: 34px;
    height: 26px;
    font-size: 10px;
  }
}

/* ============================================================
   SEARCH RESULTS — city + range types (in addition to country)
============================================================ */
.search-result--city .search-abbr,
.search-result--range .search-abbr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: var(--paper-warm);
  color: var(--charcoal-3);
  border: 1px solid var(--rule);
}
.search-result--range .search-abbr {
  background: var(--orange-tint);
  color: var(--orange-deep);
  border-color: var(--orange-soft);
}
.search-result--city .search-region,
.search-result--range .search-region {
  font-style: italic;
  color: var(--muted);
}
