/* ============================================================
   interactive.css — insight popup + "Ask the data" search page
   ============================================================ */

/* ---------- INSIGHT POPUP ---------- */
.insight-veil {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(var(--scrim-rgb), 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.insight-veil.open { opacity: 1; pointer-events: auto; }

.insight-pop {
  position: relative;
  width: min(480px, 92vw);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 32px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 var(--glass-hi);
  transform: translateY(14px) scale(.97);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
:root[data-theme="light"] .insight-pop { background: var(--card); box-shadow: 0 30px 80px rgba(58,58,58,0.25); }
.insight-veil.open .insight-pop { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .insight-veil.open .insight-pop {
    animation: ipFloat 13s ease-in-out 0.4s infinite;
  }
}
@keyframes ipFloat {
  0%   { transform: translate(0px, 0px) rotate(0deg); }
  20%  { transform: translate(9px, -7px) rotate(0.5deg); }
  40%  { transform: translate(4px, -13px) rotate(-0.3deg); }
  60%  { transform: translate(-7px, -9px) rotate(-0.6deg); }
  80%  { transform: translate(-5px, 4px) rotate(0.3deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

@property --ip-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.ip-accent {
  position: absolute; inset: 0;
  border-radius: 22px;
  padding: 1.6px;                 /* = border thickness of the travelling line */
  pointer-events: none;
  background: conic-gradient(from var(--ip-angle),
      transparent 0deg,
      transparent 286deg,
      var(--accent) 318deg,
      var(--psmfc-orange) 344deg,
      transparent 360deg);
  /* show only the border ring */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: ipBorderSpin 7s linear infinite;
}
@keyframes ipBorderSpin { to { --ip-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .ip-accent { animation: none; } }
.ip-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-hi); border: 1px solid var(--stroke);
  color: var(--tx2); cursor: pointer;
  transition: all .2s ease;
}
.ip-close:hover { color: var(--accent); border-color: var(--accent); }
.ip-close svg { width: 15px; height: 15px; }

.ip-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
}
.ip-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(18px, 2vw, 23px); letter-spacing: -0.015em;
  color: var(--tx1); margin-top: 8px; line-height: 1.15;
  padding-right: 30px;
}
.ip-value {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(34px, 4.4vw, 50px); letter-spacing: -0.03em;
  color: var(--accent); margin-top: 10px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ip-lines { margin-top: 14px; display: grid; gap: 9px; }
.ip-lines p { margin: 0; color: var(--tx2); font-size: clamp(13px, 1.15vw, 15px); line-height: 1.55; text-wrap: pretty; }
.ip-foot {
  margin-top: 18px; padding-top: 13px;
  border-top: 1px solid var(--stroke);
  color: var(--tx3); font-size: 11px;
}

/* a clickable chart shape advertises itself */
.bar-rect, .leg-row, .hbar-row, .zm-province { cursor: pointer; }

/* ---------- SEARCH BUTTON (top chrome) ---------- */
.search-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 11px; border-radius: 999px;
  background: var(--card-hi); border: 1px solid var(--stroke);
  color: var(--tx1); cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: clamp(12px,1.1vw,14px);
  backdrop-filter: blur(12px);
  transition: all .25s ease;
}
.search-toggle:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.search-toggle:active { transform: scale(.96); }
.search-toggle svg { width: 16px; height: 16px; }

/* ---------- SEARCH PAGE ---------- */
.search-page {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(var(--scrim-rgb), 0.62);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  overflow-y: auto;
  animation: spIn .3s ease both;
}
@keyframes spIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .search-page { animation: none; } }

.sp-chrome {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px,2.6vh,22px) clamp(20px,3vw,40px);
}
.sp-logo { height: clamp(34px,4.6vh,52px); width: auto; }

.sp-body {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: clamp(8px,2vh,24px) clamp(22px,4vw,40px) 80px;
  display: flex; flex-direction: column; gap: clamp(18px,2.6vh,26px);
}
.sp-head .slide-title { margin-top: 10px; }

.sp-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 18px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-brd);
  backdrop-filter: blur(var(--glass-blur));
  transition: border-color .25s ease, box-shadow .25s ease;
}
.sp-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}
.sp-bar .sp-ico { width: 19px; height: 19px; color: var(--tx3); flex: 0 0 auto; }
.sp-bar input {
  flex: 1 1 auto; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--tx1);
  font-family: var(--font-body); font-weight: 500;
  font-size: clamp(14px, 1.4vw, 17px);
  padding: 10px 0;
}
.sp-bar input::placeholder { color: var(--tx3); }
.sp-go {
  border: none; cursor: pointer;
  padding: 11px 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  transition: filter .2s ease, transform .2s ease;
}
.sp-go:hover { filter: brightness(1.1); }
.sp-go:active { transform: scale(.97); }
.sp-go:disabled { opacity: .4; cursor: default; }

.sp-faqs { display: grid; gap: 10px; }
.sp-faq-label {
  font-size: 11px; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--tx3);
}
.sp-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chip { cursor: pointer; transition: all .2s ease; font-weight: 500; }
.sp-chip:hover { transform: translateY(-1px); background: color-mix(in oklab, var(--accent) 26%, transparent); }
.sp-chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.sp-answer { display: grid; gap: clamp(12px,1.8vh,16px); }
.sp-answer.primary { margin-top: clamp(6px,1.4vh,14px); }
.sp-also {
  font-size: 11px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--psmfc-orange);
  margin-top: 8px;
}
.sp-ans-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -0.02em;
  line-height: 1.12; color: var(--tx1); margin: 0;
  text-wrap: balance;
}
.sp-ans-sub {
  margin: 0; color: var(--tx2);
  font-size: clamp(13px, 1.25vw, 16px); line-height: 1.55;
  max-width: 64ch; text-wrap: pretty;
}
.sp-kpis {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.sp-kpi { padding: 16px 18px; display: grid; gap: 5px; border-radius: 16px; }
.sp-chart { padding: clamp(16px,2vw,24px); }
.sp-divider { height: 1px; background: var(--stroke); margin-top: clamp(14px,2.4vh,24px); }
.sp-empty { padding: 22px; }

@media (max-width: 720px) {
  .sp-kpis { grid-template-columns: repeat(2, 1fr); }
  .sp-go { padding: 10px 16px; }
}

/* ============================================================
   3D EXTRUDED ZAMBIA MAP
   ============================================================ */
/* ============================================================
   PRODUCT & FACT CARDS (Products / About slides)
   ============================================================ */
.prod-ic {
  flex: 0 0 auto; display: grid; place-items: center;
  width: clamp(38px, 3.2vw, 50px); height: clamp(38px, 3.2vw, 50px);
  border-radius: 12px;
  background: color-mix(in oklab, var(--c) 16%, transparent);
  border: 1px solid color-mix(in oklab, var(--c) 32%, transparent);
  color: var(--c);
}
.prod-ic svg { width: clamp(18px, 1.7vw, 24px); height: clamp(18px, 1.7vw, 24px); }
.prod-card { position: relative; }
.prod-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(13px, 1.05vw, 16px); color: var(--tx1);
  line-height: 1.18; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prod-ben { font-size: clamp(10px, 0.85vw, 12px); color: var(--tx3); margin-top: 3px; }
.prod-amt {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(15px, 1.45vw, 22px); letter-spacing: -0.02em;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.prod-expand {
  flex: 0 0 auto; width: 16px; height: 16px; margin-left: 2px;
  color: var(--tx3); opacity: 0; transform: translateX(-4px);
  transition: opacity .18s ease, transform .18s ease, color .18s ease;
}
.prod-card:hover .prod-expand { opacity: .9; transform: translateX(0); color: var(--accent); }

/* ---- morph-to-detail overlay ---- */
.prod-modal-root { position: fixed; inset: 0; z-index: 200; }
.prod-backdrop {
  position: absolute; inset: 0;
  background: rgba(24,22,20,0.46); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .4s ease;
}
.prod-modal-root.open .prod-backdrop { opacity: 1; }
.prod-morph {
  position: absolute; overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45), inset 0 1px 0 var(--glass-hi);
  transition: box-shadow .42s ease;
  will-change: transform;
}
:root[data-theme="light"] .prod-morph { background: var(--card); box-shadow: 0 30px 70px rgba(58,58,58,0.26); }
.prod-modal-root.open .prod-morph { box-shadow: 0 40px 90px rgba(0,0,0,0.5), inset 0 1px 0 var(--glass-hi); }
@media (prefers-reduced-motion: reduce) { .prod-morph { transition: none; } }

.prod-morph-body {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: clamp(18px, 2vw, 30px);
  opacity: 0; transition: opacity .26s ease;
}
.prod-modal-root.open .prod-morph-body { opacity: 1; transition: opacity .3s ease .16s; }

.prod-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--stroke, var(--border)); border-radius: 999px;
  background: transparent; color: var(--tx2); cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.prod-close:hover { background: color-mix(in oklab, var(--c) 12%, transparent); color: var(--c); border-color: var(--c); }
.prod-close svg { width: 18px; height: 18px; }

.prod-morph-head { display: flex; align-items: center; gap: clamp(12px, 1.4vw, 18px); padding-right: 40px; }
.prod-morph-head .prod-ic { width: clamp(44px, 3.6vw, 56px); height: clamp(44px, 3.6vw, 56px); border-radius: 14px; }
.prod-morph-head .prod-ic svg { width: clamp(22px, 2vw, 28px); height: clamp(22px, 2vw, 28px); }
.prod-morph-eyebrow {
  font-size: clamp(10px, 0.85vw, 12px); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--tx3);
}
.prod-morph-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(18px, 1.9vw, 28px); letter-spacing: -0.02em; color: var(--tx1);
  line-height: 1.12; margin-top: 2px; text-wrap: balance;
}
.prod-morph-total { margin-left: auto; text-align: right; flex: 0 0 auto; }
.prod-morph-total-num {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(22px, 2.4vw, 36px); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.prod-morph-total-lab { font-size: clamp(10px, 0.85vw, 12px); color: var(--tx3); margin-top: 4px; }

.prod-morph-chart { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: clamp(12px, 1.6vh, 20px); }
.prod-chart-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: clamp(8px, 1.2vh, 12px);
}
.prod-chart-head .chart-toggle { flex: 0 0 auto; }
.prod-chart-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.prod-chart-body .chart-wrap { flex: 1; min-height: 0; display: flex; align-items: stretch; }
.prod-chart-body .chart-svg { height: 100% !important; width: 100% !important; }

/* gender view — isotype pictogram (fills the chart body) */
.pg-view { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: clamp(14px, 2.4vw, 34px); --pg-ghost: color-mix(in oklab, var(--tx3) 42%, transparent); }
.pg-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; gap: clamp(8px, 1.4vh, 14px); }
.pg-divider { width: 1px; align-self: stretch; background: var(--stroke); flex: 0 0 auto; }
.pg-col-head {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(12px, 1.2vw, 15px); color: var(--tx2); letter-spacing: .01em;
}
.pg-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.pg-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: clamp(3px, .5vw, 7px); width: 100%; max-width: clamp(180px, 18vw, 260px);
}
.pg-fig {
  display: block; aspect-ratio: 1 / 1; line-height: 0;
  opacity: 0; transform: translateY(6px) scale(.8);
  transition: opacity .4s ease, transform .45s cubic-bezier(.16,1,.3,1), color .3s ease;
}
.pg-fig.in { opacity: 1; transform: none; }
.pg-fig svg { width: 100%; height: 100%; display: block; }
@media (prefers-reduced-motion: reduce) { .pg-fig { opacity: 1; transform: none; transition: none; } }
.pg-num {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(22px, 2.6vw, 38px); letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.pg-sub { font-size: clamp(10.5px, 0.95vw, 13px); color: var(--tx3); text-wrap: pretty; max-width: 30ch; }

.prod-morph-foot {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.2vw, 18px);
  margin-top: clamp(12px, 1.6vh, 18px); padding-top: clamp(12px, 1.5vh, 16px);
  border-top: 1px solid var(--stroke, var(--border));
}
.prod-foot-stat { display: flex; flex-direction: column; gap: 3px; }
.pf-num {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(16px, 1.6vw, 24px); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.pf-lab { font-size: clamp(10px, 0.85vw, 12px); color: var(--tx3); }

.zm3d-wrap {
  position: relative;
  width: 100%;
  perspective: 1500px;
  padding: clamp(8px, 2vh, 22px) 0;
}
/* soft neutral bloom behind the glass map so the frosted panes read as lit */
.zm3d-wrap::before {
  content: ""; position: absolute; inset: -12% -8% 0;
  background: radial-gradient(58% 52% at 50% 42%, rgba(255,255,255,0.12), transparent 72%);
  filter: blur(24px); opacity: .6; pointer-events: none; z-index: 0;
}
/* faint blueprint grid backdrop (matches the 3D-map reference) */
.zm3d-grid {
  position: absolute; inset: -6% -4%;
  background-image:
    linear-gradient(color-mix(in oklab, var(--accent) 16%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 16%, transparent) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 46%, #000 18%, transparent 76%);
  mask-image: radial-gradient(120% 90% at 50% 46%, #000 18%, transparent 76%);
  opacity: .5; pointer-events: none;
}
/* tilt the whole map into a 3/4 perspective; shadow grounds it */
.zm3d-svg {
  display: block;
  transform: rotateX(30deg) rotateZ(-3deg) scale(1.02);
  transform-origin: 50% 56%;
  filter: drop-shadow(0 30px 28px rgba(0,0,0,.55));
}
:root[data-theme="light"] .zm3d-svg { filter: drop-shadow(0 30px 26px rgba(58,58,58,.32)); }
@media (prefers-reduced-motion: reduce) {
  .zm3d-svg { transform: rotateX(24deg) scale(1.0); }
}

.zm3d-labels { position: absolute; inset: 0; pointer-events: none; }
/* bare text sitting directly on the glass province — hidden until its province is hovered, then animates in */
.zm3d-pin {
  position: absolute; transform: translate(-50%, -38%) scale(.9);
  pointer-events: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0; border: none; background: none; box-shadow: none;
  font-family: var(--font-body);
  white-space: nowrap; text-align: center;
  color: #fff;
  text-shadow: none;
  opacity: 0;
  transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .25s ease;
  z-index: 4;
}
:root[data-theme="light"] .zm3d-pin {
  text-shadow: none;
}
.zm3d-pin.show {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -62%) scale(1.06);
  z-index: 5;
}
@media (prefers-reduced-motion: reduce) {
  .zm3d-pin { transition: opacity .2s ease; transform: translate(-50%, -55%); }
  .zm3d-pin.show { transform: translate(-50%, -55%); }
}

/* green shock-wave ripple emitted on province click */
.zm3d-ripples { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.zm3d-ripple {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--accent);
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 38%, transparent), transparent 70%);
  animation: zmRipple .72s cubic-bezier(.22,.61,.36,1) forwards;
}
@keyframes zmRipple {
  0%   { opacity: .85; transform: translate(-50%,-50%) scale(.35); }
  70%  { opacity: .45; }
  100% { opacity: 0;   transform: translate(-50%,-50%) scale(7.5); }
}
@media (prefers-reduced-motion: reduce) { .zm3d-ripple { animation-duration: .35s; } }
.zm3d-pin-name { color: var(--psmfc-orange); font-weight: 700; font-size: clamp(9px, 0.95vw, 12px); letter-spacing: -0.01em; line-height: 1; text-transform: uppercase; opacity: 1; }
.zm3d-pin-val  { color: #fff; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: clamp(12px, 1.25vw, 16px); line-height: 1.05; font-variant-numeric: tabular-nums; }

.zm3d-hint { display: flex; justify-content: center; margin-top: clamp(6px, 1.4vh, 14px); }

/* ============================================================
   PROVINCE HOVER CARD (zm-card) — floating glass read-out
   anchored to the hovered province's top-face centroid.
   ============================================================ */
.zm-card {
  position: absolute;
  z-index: 7;
  width: clamp(232px, 22vw, 290px);
  --zmx: -50%;
  --zmy: calc(-100% - 18px);
  transform: translate(var(--zmx), var(--zmy));
  padding: clamp(13px, 1.1vw, 16px);
  border-radius: 16px;
  background: var(--glass-bg), rgba(18,20,26,0.58);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: 0 20px 48px rgba(0,0,0,0.42), inset 0 1px 0 var(--glass-hi);
  pointer-events: none;
  /* hold hidden for a beat, then glide in smoothly */
  animation: zmCardIn .5s cubic-bezier(.16,1,.3,1) .28s both;
}
:root[data-theme="light"] .zm-card { box-shadow: 0 20px 48px rgba(58,58,58,0.22), inset 0 1px 0 var(--glass-hi); }
.zm-card.below { --zmy: 18px; }
.zm-card.left  { --zmx: calc(-100% + 28px); }
.zm-card.right { --zmx: -28px; }
.zm-card.mid   { --zmx: -50%; }
@keyframes zmCardIn {
  from { opacity: 0; transform: translate(var(--zmx), calc(var(--zmy) + 14px)) scale(.96); }
  to   { opacity: 1; transform: translate(var(--zmx), var(--zmy)) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .zm-card { animation: none; } }

.zm-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.zm-card-eyebrow {
  font-family: var(--font-body); font-weight: 600;
  font-size: clamp(10px, 0.85vw, 12px); letter-spacing: .02em;
  text-transform: uppercase; color: #fff; line-height: 1.2;
}
.zm-card-num {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(20px, 2vw, 26px); letter-spacing: -0.02em;
  color: #fff; line-height: 1.05; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.zm-card-pill {
  flex: 0 0 auto;
  padding: 4px 9px; border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 28%, transparent);
  color: #fff; font-weight: 600;
  font-size: clamp(9.5px, 0.8vw, 11px); white-space: nowrap; line-height: 1.4;
}
.zm-card-sub {
  margin-top: 9px; color: rgba(255,255,255,0.82);
  font-size: clamp(11px, 0.95vw, 13px); line-height: 1.45; text-wrap: pretty;
}
.zm-card-chart {
  margin-top: 12px;
  display: flex; align-items: flex-end; gap: 5px;
  height: clamp(44px, 5vh, 58px);
}
.zm-bar-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.zm-bar {
  width: 100%; border-radius: 4px 4px 2px 2px;
  background: color-mix(in oklab, var(--tx2) 42%, transparent);
  min-height: 4px;
}
.zm-bar.hot { background: var(--accent); }
.zm-bar-lab {
  font-size: 9px; color: rgba(255,255,255,0.7); font-weight: 500;
  letter-spacing: .01em; white-space: nowrap;
}
.zm-card-foot {
  margin-top: 11px; padding-top: 9px;
  border-top: 1px solid rgba(255,255,255,0.18);
  font-size: clamp(10px, 0.85vw, 12px); color: rgba(255,255,255,0.72); line-height: 1.4;
}

/* ============================================================
   PROVINCE DRILL-DOWN POPUP
   ============================================================ */
.drill-pop {
  position: relative;
  width: min(1340px, 96vw);
  max-height: 94vh; overflow-y: auto; overflow-x: hidden;
  border-radius: 22px;
  padding: clamp(20px, 2.6vw, 30px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 var(--glass-hi);
  transform: translateY(14px) scale(.98);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
:root[data-theme="light"] .drill-pop { background: var(--card); box-shadow: 0 30px 80px rgba(58,58,58,0.22); }
.drill-veil.open .drill-pop { transform: none; }

.drill-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding-bottom: clamp(14px, 2vh, 20px); margin-bottom: clamp(14px, 2vh, 20px);
  border-bottom: 1px solid var(--stroke);
}
.drill-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -0.02em;
  color: var(--tx1); margin-top: 3px;
}
.drill-head-stats { display: flex; gap: clamp(16px, 2.4vw, 34px); }
.drill-hstat-num {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(18px, 2vw, 26px); letter-spacing: -0.02em;
  color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1;
}
.drill-hstat-lab { font-size: clamp(10px, 0.95vw, 12px); color: var(--tx3); margin-top: 4px; }

.drill-grid {
  display: grid; grid-template-columns: 1.15fr 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
}
.drill-col { display: flex; flex-direction: column; gap: 12px; min-width: 0;
  background: color-mix(in oklab, var(--tx1) 5%, transparent);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: clamp(14px, 1.4vw, 20px);
}
:root[data-theme="light"] .drill-col { background: color-mix(in oklab, var(--tx1) 3%, #fff); }
.drill-col.is-filter { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent); }
.drill-col-head { display: flex; flex-direction: column; gap: 2px; }
.drill-col-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(13px, 1.2vw, 15.5px); color: var(--tx1); letter-spacing: -0.01em;
}
.drill-col-sub { font-size: 11px; color: var(--tx3); letter-spacing: .02em; }

/* inside the popup columns the donut stacks its legend BELOW the chart so a
   narrow column never overflows sideways (kills the horizontal scrollbar) */
.drill-col .pie-wrap { flex-direction: column; align-items: center; gap: 14px; flex-wrap: nowrap; }
.drill-col .pie-figure { width: 100%; }
.drill-col .pie-legend { width: 100%; flex: 0 0 auto; }
.drill-col .chart-svg { width: min(100%, 196px) !important; }

/* clicked-segment readout — full-width banner under the three columns */
.drill-desc {
  grid-column: 1 / -1;
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: 2px; padding: 13px 18px; border-radius: 14px;
  background: color-mix(in oklab, var(--tx1) 4%, transparent);
  border: 1px solid var(--stroke);
  font-size: clamp(13px, 1.15vw, 15px); line-height: 1.5; color: var(--tx3);
  text-wrap: pretty; transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.drill-desc.is-on {
  background: color-mix(in oklab, var(--accent) 11%, transparent);
  border-color: color-mix(in oklab, var(--accent) 28%, transparent);
  color: var(--tx1);
}
.drill-desc .dd-dot { width: 12px; height: 12px; border-radius: 4px; margin-top: 3px; flex: 0 0 auto; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent); }

/* view toggle row in the popup header */
.drill-viewbar { display: flex; align-items: center; gap: 10px; }
.drill-viewbar .drill-view-lab { font-size: 11px; color: var(--tx3); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }

.drill-bars { display: flex; flex-direction: column; gap: 9px; }
.drill-row {
  display: flex; flex-direction: column; gap: 6px;
  border: none; background: transparent; text-align: left;
  font: inherit; color: inherit; padding: 6px 8px; border-radius: 10px;
  transition: background .2s ease;
}
.drill-row.pick { cursor: pointer; }
.drill-row.pick:hover { background: color-mix(in oklab, var(--accent) 12%, transparent); }
.drill-row.on { background: color-mix(in oklab, var(--accent) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 45%, transparent); }
.drill-row[disabled] { cursor: default; }
.drill-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.drill-row-name { font-size: clamp(12px, 1.1vw, 14px); font-weight: 500; color: var(--tx2); }
.drill-row.on .drill-row-name { color: var(--tx1); font-weight: 600; }
.drill-row-val { font-family: var(--font-display); font-weight: 800; font-size: clamp(12px, 1.1vw, 14px); color: var(--tx1); font-variant-numeric: tabular-nums; }
.drill-track { position: relative; height: 8px; border-radius: 999px; background: color-mix(in oklab, var(--tx3) 22%, transparent); overflow: hidden; }
.drill-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transition: width .5s cubic-bezier(.16,1,.3,1); }

/* gender column */
.drill-gender { display: flex; flex-direction: column; gap: 14px; }
.drill-split { display: flex; height: 16px; border-radius: 999px; overflow: hidden; border: 1px solid var(--stroke); }
.drill-split-seg { height: 100%; transition: width .5s cubic-bezier(.16,1,.3,1); }
.drill-split-seg.f { background: var(--psmfc-green); }
.drill-split-seg.m { background: var(--psmfc-orange); }
.drill-grow {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--stroke);
}
.drill-gdot { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.drill-gdot.f { background: var(--psmfc-green); }
.drill-gdot.m { background: var(--psmfc-orange); }
.drill-gname { font-size: clamp(12px, 1.1vw, 14px); font-weight: 600; color: var(--tx1); }
.drill-gval { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: clamp(15px, 1.5vw, 19px); color: var(--tx1); grid-column: 3; font-variant-numeric: tabular-nums; }
.drill-gben { grid-column: 2 / 4; font-size: 11px; color: var(--tx3); }
.drill-gnote { font-size: clamp(11px, 1vw, 13px); color: var(--tx2); line-height: 1.5; text-wrap: pretty; }

@media (max-width: 860px) {
  .drill-grid { grid-template-columns: 1fr; }
  .drill-head-stats { gap: 18px; }
}
