.country-explorer { --explorer-ink: #254b43; --explorer-muted: #647672; --explorer-height: clamp(540px, 65vh, 740px); }
.country-explorer [hidden] { display: none !important; }
.explorer-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.country-explorer svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.country-explorer button, .country-explorer input { font: inherit; }
.country-explorer button { cursor: pointer; }
.country-explorer :is(button, a, input, [tabindex]):focus-visible { outline: 3px solid #4a7c59; outline-offset: 4px; }
.explorer-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.4rem; }
.explorer-kicker { display: inline-flex; align-items: center; gap: 0.5rem; width: fit-content; margin-bottom: 0.8rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: #3f704b; font-weight: 800; }
.explorer-kicker-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2rem; height: 2rem; border: 1px solid rgba(79,132,88,0.14); border-radius: 8px; color: #3f704b; background: #eef3ea; }
.explorer-kicker-icon svg { width: 1rem; height: 1rem; }
.explorer-eyebrow { color: #507b68; font-size: 0.69rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; margin: 0 0 0.4rem; }
.explorer-heading h1 { font-family: 'DM Sans', sans-serif; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -0.055em; font-weight: 600; line-height: 1.15; margin: 0; }
.explorer-intro { margin-top: 0.65rem; color: var(--text-muted); font-size: 0.98rem; }
.explorer-list-link { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--explorer-ink); text-decoration: none; font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.explorer-list-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.explorer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.explorer-search { position: relative; width: min(100%, 440px); margin: 0; z-index: 10; }
/* Avoid Chromium's opaque-overlay culling clipping the transparent WebGL canvas. */
.explorer-search:has(.custom-select.open) { opacity: 0.999; }
.explorer-search .custom-select-display { display: flex; align-items: center; min-height: 48px; width: 100%; text-align: left; font-size: 0.94rem; }
.explorer-search .custom-select-search:focus-visible { outline: none; }
.explorer-search .custom-select-options { width: 100%; max-height: min(340px, 50svh); }
.explorer-search .custom-select-option { display: flex; align-items: center; min-height: 44px; }
.explorer-search .custom-select-option.keyboard-active { background: var(--cs-bg-hover, #f3f4f6); }
.explorer-search .custom-select.placeholder .custom-select-display, .explorer-search .is-uncovered { color: #78817e; }
.explorer-option-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; width: 100%; min-width: 0; }
.explorer-option-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.explorer-option-count { color: #69776f; white-space: nowrap; font-size: 0.7rem; }
.explorer-search .custom-select-display .explorer-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explorer-search .custom-select-display .explorer-option-count { display: none; }
.explorer-no-results { padding: 1rem; font-size: 0.875rem; color: var(--text-muted); }
.explorer-coverage { color: var(--explorer-muted); font-size: 0.82rem; }
.explorer-coverage strong { color: var(--explorer-ink); font-weight: 700; }
.explorer-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: stretch; gap: 1.25rem; }
.explorer-stage { position: relative; isolation: isolate; min-width: 0; height: var(--explorer-height); overflow: hidden; border-radius: 20px; border: 1px solid #d7e1da; background: radial-gradient(ellipse at 45% 45%, #fff 0%, #eef3ee 55%, #e4ece5 100%); }
.explorer-stage::after { content: ''; position: absolute; width: 45%; height: 24px; border-radius: 50%; background: #37645214; filter: blur(14px); left: 27.5%; bottom: 74px; pointer-events: none; }
#explorer-globe { position: absolute; z-index: 0; inset: 0; outline-offset: -4px; }
#explorer-globe canvas { display: block; }
.explorer-controls { position: absolute; z-index: 2; top: 1rem; right: 1rem; display: flex; flex-direction: column; padding: 0.25rem; border-radius: 12px; border: 1px solid #d5dfd6; background: #fff; box-shadow: 0 3px 10px #264c3b09; }
.explorer-controls button { width: 36px; height: 36px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 8px; color: #47665a; }
.explorer-controls button:hover { background: #eaf1e9; }
.explorer-controls button:disabled { opacity: 0.35; cursor: default; }
.explorer-controls button:last-child { border-top: 1px solid #e4e8e2; border-radius: 0 0 8px 8px; margin-top: 3px; padding-top: 3px; height: 40px; }
.explorer-stage-footer { position: absolute; z-index: 1; bottom: 1.15rem; left: 1.25rem; right: 1.25rem; pointer-events: none; }
.explorer-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.69rem; color: #587064; }
.explorer-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.explorer-legend i { display: block; width: 9px; height: 9px; border-radius: 3px; border: 1px solid #72877838; }
.explorer-legend .covered { background: #6f9f7d; }
.explorer-legend .uncovered { background: #c7ceca; }
#explorer-instructions { font-size: 0.67rem; color: #74867a; margin-top: 0.45rem; }
.explorer-touch-toggle { position: absolute; z-index: 2; left: 1rem; top: 1rem; background: #fff; border: 1px solid #ced9cf; color: #365e49; padding: 0.45rem 0.75rem; border-radius: 999px; font-size: 0.75rem !important; }
.explorer-panel { height: var(--explorer-height); border: 1px solid #dce2d9; border-radius: 20px; background: #fff; padding: 1.5rem; display: flex; flex-direction: column; min-width: 0; }
.explorer-panel h2 { font-family: 'DM Sans', sans-serif; font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.035em; color: #294b40; margin: 0 0 0.75rem; }
#explorer-welcome > p:not(.explorer-eyebrow) { color: #737d76; font-size: 0.875rem; line-height: 1.7; }
.explorer-start { margin-top: 1.9rem; }
.explorer-start h3, .explorer-category-heading { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: #7b867e; margin-bottom: 0.6rem; }
#explorer-suggestions { display: grid; gap: 0.5rem; }
.explorer-suggestion { display: flex; gap: 0.65rem; align-items: center; width: 100%; text-align: left; border: 1px solid #e1e7dd; border-radius: 10px; background: #fafbf8; padding: 0.7rem; color: #3a5547; font-size: 0.86rem !important; }
.explorer-suggestion:hover { background: #eff5ed; border-color: #bacfbb; }
.explorer-suggestion img { width: 24px; height: 17px; border-radius: 3px; object-fit: cover; }
.explorer-suggestion span:last-child { margin-left: auto; color: #75947b; }
#explorer-country { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.explorer-country-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #a9bead transparent; padding: 0.25rem 0.4rem 0.25rem 0; margin-right: -0.4rem; }
.country-explorer .explorer-country-content:focus-visible { outline-offset: 2px; border-radius: 4px; }
.explorer-country-summary { color: #56675c; font-size: 0.82rem; line-height: 1.65; }
.explorer-country-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
#explorer-flag { object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px #213c3a12; }
#explorer-clear { display: grid; place-items: center; background: transparent; color: #849185; border: 0; padding: 0.2rem; }
#explorer-country-name { overflow-wrap: anywhere; }
.explorer-territory-note { font-size: 0.75rem; color: #78847a; }
.explorer-pathway-total { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0 1.25rem; background: #f0f5ed; border-radius: 12px; padding: 0.85rem 1rem; color: #48734f; }
.explorer-pathway-total strong { font-size: 2.1rem; font-weight: 500; line-height: 1.1; letter-spacing: -0.05em; }
.explorer-pathway-total span { font-size: 0.8rem; line-height: 1.4; max-width: 100px; }
.explorer-themes { list-style: none; margin: 0; padding: 0; }
.explorer-themes li + li { border-top: 1px solid #e7ece5; }
.explorer-theme-link { display: block; padding: 0.8rem 0; text-decoration: none; color: #294b40; }
.explorer-theme-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 0.65rem; }
.explorer-theme-name { font-size: 0.83rem; line-height: 1.4; font-weight: 600; }
.explorer-theme-count { flex-shrink: 0; font-variant-numeric: tabular-nums; color: #657b68; font-size: 0.69rem; white-space: nowrap; }
.explorer-theme-description { display: block; margin-top: 0.3rem; font-size: 0.77rem; line-height: 1.55; color: #647268; }
.explorer-theme-link:hover .explorer-theme-name { text-decoration: underline; text-underline-offset: 3px; }
.country-explorer .explorer-theme-link:focus-visible { outline-offset: -2px; border-radius: 4px; }
.explorer-country-link { flex-shrink: 0; margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; color: #fff; background: #456e52; border-radius: 10px; padding: 0.85rem 1rem; font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.explorer-country-link:hover { background: #355b40; color: #fff; }
.explorer-country-link svg { width: 17px; height: 17px; }
.explorer-bottom { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 0.85rem; font-size: 0.67rem; color: #859082; }
.explorer-bottom a { color: inherit; text-decoration: none; }
.explorer-bottom a:hover { text-decoration: underline; }
.explorer-loading { position: absolute; z-index: 3; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1rem; flex-direction: column; color: #5e7c66; font-size: 0.875rem; text-align: center; padding: 3rem; background: #edf2ed; }
.explorer-loading-orbit { width: 44px; height: 44px; border: 1px solid #c3d4c3; border-top: 2px solid #668d6c; border-radius: 50%; animation: explorer-spin 1.3s linear infinite; }
.explorer-loading a { font-weight: 600; }
.explorer-noscript { padding: 1rem; margin-top: 1rem; background: #fff; border-radius: 10px; }
/* The country card supplies its own surface; remove the library's dark wrapper. */
.country-explorer .float-tooltip-kap { z-index: 1; padding: 0; background: transparent; }
/* Keep the renderer's depth-sorted markers together below country popovers. */
.country-explorer .scene-container > :has(> .explorer-island) { isolation: isolate; z-index: 0; }
.explorer-tooltip { padding: 0.65rem 0.8rem; border: 1px solid #e2e8dd; border-radius: 10px; background: #fff; box-shadow: 0 4px 18px #142c3020; color: #345344; font: 600 0.85rem 'DM Sans', sans-serif; }
.explorer-tooltip small { display: block; font-size: 0.7rem; font-weight: 400; color: #778575; margin-top: 3px; }
.explorer-island { width: 22px; height: 22px; display: grid; place-items: center; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.explorer-island::before { content: ''; width: 7px; height: 7px; border: 1.5px solid #fff; border-radius: 50%; background: #527b55; box-shadow: 0 0 0 3px #42694424; }
.explorer-island:hover::before, .explorer-island.is-selected::before { background: #ce9d44; box-shadow: 0 0 0 4px #ce9d4444; }
@keyframes explorer-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .explorer-loading-orbit { animation: none; } }
@media (max-width: 1000px) {
  .explorer-workspace { grid-template-columns: minmax(0, 1fr) 290px; gap: 1rem; }
  .explorer-panel { padding: 1.2rem; }
  .country-explorer { --explorer-height: 560px; }
}
@media (max-width: 760px) {
  .explorer-heading { align-items: flex-start; flex-direction: column; gap: 0.8rem; margin-bottom: 1.1rem; }
  .explorer-heading h1 { font-size: 2rem; }
  .explorer-eyebrow { font-size: 0.62rem; }
  .explorer-intro { font-size: 0.88rem; max-width: 28rem; }
  .explorer-list-link { font-size: 0.8rem; }
  .explorer-toolbar { align-items: flex-start; flex-direction: column; gap: 0.6rem; }
  .explorer-search { width: 100%; }
  .explorer-search input { font-size: 16px; }
  .explorer-coverage { font-size: 0.73rem; }
  .explorer-workspace { grid-template-columns: minmax(0, 1fr); }
  .explorer-stage { height: clamp(340px, 50svh, 470px); border-radius: 16px; }
  .explorer-panel { height: auto; border-radius: 16px; padding: 1.35rem; }
  #explorer-country { scroll-margin-top: calc(var(--app-shell-sticky-offset, 8.25rem) + 1rem); }
  .explorer-country-content { overflow: visible; padding: 0; margin: 0; }
  .explorer-start { margin-top: 1.2rem; }
  #explorer-suggestions { grid-template-columns: 1fr 1fr; }
  .explorer-stage-footer { left: 1rem; bottom: 1rem; right: 0.75rem; }
  .explorer-legend { gap: 0.7rem; font-size: 0.62rem; }
  #explorer-instructions { font-size: 0.61rem; }
  .explorer-bottom { font-size: 0.59rem; }
}
.explorer-map-message { position: absolute; z-index: 2; top: 1rem; left: 1rem; max-width: calc(100% - 100px); padding: 0.65rem 0.85rem; border: 1px solid #d5dfd6; border-radius: 10px; background: #fffffff2; color: #667367; font-size: 0.8rem; pointer-events: none; }
@media (max-width: 760px) { .explorer-map-message { top: 3.7rem; } }

@media (max-width: 760px), (pointer: coarse) {
  .explorer-controls button, .explorer-controls button:last-child { width: 44px; height: 44px; }
  .explorer-touch-toggle, #explorer-clear { min-width: 44px; min-height: 44px; }
}
