/*
 * ELU 0.7 Globe System
 *
 * This stylesheet ports the designer handoff's HUD language around the
 * production globe.gl renderer. Renderer, country geometry, and data remain
 * owned by js/globe.js; this file owns the instrument surface only.
 */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.globe-mode {
  --hud-bg: rgba(7, 13, 22, .92);
  --hud-bg-strong: rgba(6, 11, 18, .97);
  --hud-cell: rgba(255, 255, 255, .035);
  --hud-cell-hover: rgba(78, 205, 196, .09);
  --hud-border: rgba(123, 232, 208, .2);
  --hud-border-strong: rgba(123, 232, 208, .42);
  --hud-divider: rgba(255, 255, 255, .08);
  --hud-divider-soft: rgba(255, 255, 255, .045);
  --hud-muted: rgba(210, 224, 224, .62);
  --hud-faint: rgba(210, 224, 224, .62);
  --hud-shadow: 0 16px 42px rgba(0, 0, 0, .28);
  --hud-shadow-strong: 0 18px 54px rgba(0, 0, 0, .42), 0 0 0 1px rgba(123, 232, 208, .025);
  --hud-nav-bg: rgba(6, 11, 18, .9);
  --hud-trajectory-bg: rgba(78, 205, 196, .035);
  --hud-grid: rgba(255, 255, 255, .1);
  --hud-today: rgba(255, 255, 255, .28);
  --globe-dock-inset: 24px;
  --globe-dock-gap: 12px;
  --globe-dock-height: 54px;
  --globe-back-height: 54px;
  --globe-back-lift: 0px;
  --globe-back-width: clamp(260px, 31vw, 470px);
}

/* The globe remains an instrument, but the shared theme control must still
   have a real effect when the homepage is in its old-money light mode. */
html[data-theme="light"] body.globe-mode,
body.globe-mode[data-theme="light"] {
  --glow: rgba(31, 94, 70, .22);
  --glass-bg: rgba(255, 255, 255, .50);
  --glass-bg-hi: rgba(255, 255, 255, .72);
  --glass-border: rgba(31, 94, 70, .18);
  --glass-hi: rgba(255, 255, 255, .60);
  --bg: #f3efe6;
  --bg2: #faf7f0;
  --bg3: #ede7d9;
  --teal: #1f5e46;
  --mint: #26694f;
  --ocean: #3a6d5c;
  --deep: #c9bfa6;
  --leaf: #3f7d54;
  --amber: #9a7b3f;
  --warn: #9a3b2c;
  --text: #20302a;
  --text2: #5a6158;
  --text3: #9a9584;
  --border: rgba(31, 94, 70, .20);
  --border-hi: rgba(31, 94, 70, .42);
  --hud-bg: rgba(246, 250, 247, .91);
  --hud-bg-strong: rgba(252, 254, 252, .96);
  --hud-cell: rgba(220, 231, 224, .56);
  --hud-cell-hover: rgba(31, 94, 70, .10);
  --hud-border: rgba(31, 94, 70, .26);
  --hud-border-strong: rgba(31, 94, 70, .46);
  --hud-divider: rgba(31, 94, 70, .14);
  --hud-divider-soft: rgba(31, 94, 70, .08);
  --hud-muted: rgba(32, 48, 42, .78);
  --hud-faint: rgba(32, 48, 42, .78);
  --hud-shadow: 0 16px 38px rgba(27, 62, 50, .13);
  --hud-shadow-strong: 0 18px 48px rgba(27, 62, 50, .16), 0 0 0 1px rgba(31, 94, 70, .05);
  --hud-nav-bg: rgba(252, 254, 252, .95);
  --hud-trajectory-bg: rgba(31, 94, 70, .04);
  --hud-grid: rgba(31, 94, 70, .15);
  --hud-today: rgba(32, 48, 42, .34);
  color-scheme: only light;
}

html[data-theme="light"] body.globe-mode #globeViz {
  background:
    radial-gradient(circle at 50% 48%, rgba(98, 203, 177, .28), transparent 42%),
    radial-gradient(circle at 50% 42%, #f8f5eb, #dfe9e3 58%, #c4d7d0);
}

html[data-theme="light"] body.globe-mode #topbar {
  opacity: 1;
  box-sizing: border-box;
  height: 64px;
  padding-top: 9px;
  padding-bottom: 9px;
  transition: none;
  background: linear-gradient(180deg, rgba(252, 254, 251, .95), rgba(242, 248, 244, .89));
  border-bottom: 1px solid rgba(31, 94, 70, .22);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .7), 0 10px 28px rgba(27, 62, 50, .09);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

html[data-theme="light"] body.globe-mode .hex-legend {
  border-color: rgba(31, 94, 70, .3);
  background: rgba(246, 250, 247, .88);
  color: var(--text2);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

/* Keep the fair header to one deliberate instrument band. Its formerly
   flexible statistic labels could wrap to three lines, making the opaque
   surface cover both the lens switcher and the rail heading. */
html[data-theme="light"] body.globe-mode #topbar .logo {
  flex: 1 1 auto;
}

html[data-theme="light"] body.globe-mode #topbar .brand-wordmark {
  flex: 0 0 auto;
}

html[data-theme="light"] body.globe-mode #topbar .brand-subtitle {
  flex: 1 1 auto;
}

html[data-theme="light"] body.globe-mode #topbar .topbar-actions,
html[data-theme="light"] body.globe-mode #topbar .stats,
html[data-theme="light"] body.globe-mode #topbar .stat-block,
html[data-theme="light"] body.globe-mode #topbar .cc-topbar {
  flex: 0 0 auto;
}

html[data-theme="light"] body.globe-mode #topbar .stat-label,
html[data-theme="light"] body.globe-mode #topbar .stat-value {
  white-space: nowrap;
}

html[data-theme="light"] body.globe-mode #elu-country-rank-rail,
html[data-theme="light"] body.globe-mode .climate-lens-controls {
  border-color: rgba(31, 94, 70, .3);
}

html[data-theme="light"] body.globe-mode #elu-country-rank-rail {
  background: rgba(246, 250, 247, .9);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

html[data-theme="light"] body.globe-mode .climate-lens-controls {
  background: rgba(252, 254, 252, .94);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

html[data-theme="light"] body.globe-mode .elu-rank-search input {
  background: rgba(255, 255, 255, .64);
}

html[data-theme="light"] body.globe-mode[data-climate-lens="power"] .elu-rank-gap,
html[data-theme="light"] body.globe-mode[data-climate-lens="physical"] .elu-rank-gap {
  white-space: nowrap;
}

html[data-theme="light"] body.globe-mode[data-climate-lens="power"] .elu-rank-gap small,
html[data-theme="light"] body.globe-mode[data-climate-lens="physical"] .elu-rank-gap small {
  display: inline;
  margin: 0 0 0 2px;
}

@media (min-width: 901px) and (max-width: 1100px) {
  html[data-theme="light"] body.globe-mode #topbar {
    gap: 12px;
    padding-right: 18px;
    padding-left: 18px;
  }

  html[data-theme="light"] body.globe-mode #topbar .brand-subtitle,
  html[data-theme="light"] body.globe-mode #topbar .brand-sep {
    display: none;
  }

  html[data-theme="light"] body.globe-mode #topbar .topbar-actions {
    gap: 10px;
  }
}

@media (max-width: 800px) {
  html[data-theme="light"] body.globe-mode #topbar {
    height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  html[data-theme="light"] body.globe-mode .climate-lens-controls,
  html[data-theme="light"] body.globe-mode #elu-country-rank-rail {
    top: 64px;
  }
}

@media (max-width: 720px) {
  html[data-theme="light"] body.globe-mode #elu-country-card-wrap {
    top: 118px;
  }
}

body.globe-mode #topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

#globe-evidence-browse {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

#globe-evidence-browse .browse-label-short { display: none; }

@media (max-width: 480px) {
  body.globe-mode #topbar {
    gap: 6px;
    padding-left: 8px;
    padding-right: 8px;
  }

  body.globe-mode #topbar .logo {
    flex: 0 0 24px;
    width: 24px;
    gap: 0;
  }

  body.globe-mode #topbar .logo .brand-wordmark,
  body.globe-mode #topbar .logo .brand-subtitle,
  body.globe-mode #topbar .logo .brand-sep {
    display: none;
  }

  body.globe-mode #topbar .topbar-actions { gap: 6px; }

  #globe-evidence-browse {
    min-height: 44px;
    padding: 6px 10px;
    letter-spacing: 1.2px;
  }

  #globe-evidence-browse .browse-label-full { display: none; }
  #globe-evidence-browse .browse-label-short { display: inline; }

  body.globe-mode #globe-theme-toggle {
    width: 44px;
    height: 44px;
  }
}

body.globe-fallback-active #globe-evidence-browse {
  display: none;
}

@keyframes elu-hud-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes elu-card-in {
  from { opacity: 0; transform: translateX(26px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes elu-lens-in {
  from { opacity: 0; transform: translate(-50%, 14px); filter: blur(5px); }
  to { opacity: 1; transform: translate(-50%, 0); filter: none; }
}

body.globe-mode #topbar { animation: elu-hud-in .7s cubic-bezier(.22,.61,.36,1) .15s both; }
body.globe-mode #elu-country-rank-rail { animation: elu-hud-in .7s cubic-bezier(.22,.61,.36,1) .3s both; }
body.globe-mode .hex-legend { animation: elu-hud-in .7s cubic-bezier(.22,.61,.36,1) .35s both; }
body.globe-mode .climate-lens-controls { animation: elu-lens-in .7s cubic-bezier(.22,.61,.36,1) .22s both; }

.climate-lens-controls { display: none; }

body.globe-mode .climate-lens-controls {
  position: fixed;
  top: 68px;
  left: 50%;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 4px;
  border: 1px solid var(--hud-border);
  border-radius: 999px;
  background: var(--hud-bg-strong);
  box-shadow: var(--hud-shadow);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

@media (min-width: 1001px) {
  body.globe-mode.country-card-open:not(.globe-fallback-active) .climate-lens-controls {
    left: calc(50% - 190px);
  }
}

.climate-lens-label {
  padding: 0 6px 0 9px;
  color: var(--hud-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.climate-lens-controls button {
  min-width: 72px;
  min-height: 44px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--hud-muted);
  font: 500 10px/1 var(--body);
  cursor: pointer;
}

.climate-lens-controls button:hover,
.climate-lens-controls button:focus-visible,
.climate-lens-controls button.is-active {
  border-color: var(--hud-border-strong);
  background: var(--hud-cell-hover);
  color: var(--mint);
  outline: none;
}

.climate-lens-controls button.is-active::before {
  content: '●';
  margin-right: 6px;
  font-size: 7px;
}

#globe-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--hud-border);
  border-radius: 50%;
  background: var(--hud-cell);
  color: var(--hud-muted);
  cursor: pointer;
  padding: 0;
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}

#globe-theme-toggle:hover,
#globe-theme-toggle:focus-visible {
  border-color: var(--mint);
  background: var(--hud-cell-hover);
  color: var(--mint);
  outline: none;
  transform: translateY(-1px);
}

#globe-theme-toggle .ic-moon { display: none; }
[data-theme="light"] #globe-theme-toggle .ic-sun { display: none; }
[data-theme="light"] #globe-theme-toggle .ic-moon { display: block; }

/* The two signals stay independent: pledge status colours the card's hero
   and actual trajectory, while CAT colours only its rating badge. */
[data-status="over"] {
  --st: var(--warn);
  --st-bg: rgba(255, 84, 58, .08);
  --st-bd: rgba(255, 84, 58, .30);
}
[data-status="on"] {
  --st: var(--leaf);
  --st-bg: rgba(46, 204, 113, .08);
  --st-bd: rgba(46, 204, 113, .28);
}
[data-status="notarget"] {
  --st: var(--amber);
  --st-bg: rgba(212, 165, 116, .08);
  --st-bd: rgba(212, 165, 116, .30);
}
[data-status="nodata"] {
  --st: var(--text2);
  --st-bg: var(--hud-cell);
  --st-bd: var(--hud-border);
}

.cat-crit, .cat-high { --cat: var(--warn); }
.cat-insuf { --cat: var(--amber); }
.cat-almost { --cat: var(--leaf); }
.cat-compat { --cat: var(--teal); }
.cat-unknown { --cat: var(--text2); }

body:not(.globe-mode) #hex-country-tooltip,
body:not(.globe-mode) #elu-country-rank-rail,
body:not(.globe-mode) #elu-country-card-wrap,
body:not(.globe-mode) #globe-loading,
body:not(.globe-mode) #globe-fallback {
  display: none !important;
}

/* Loading state: visible while the vendored renderer and country layer arrive. */
#globe-loading {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}

#globe-loading.is-visible {
  opacity: 1;
  visibility: visible;
}

.elu-loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 196px;
  padding: 12px 15px;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: var(--hud-bg-strong);
  box-shadow: var(--hud-shadow);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.25px;
  line-height: 1.4;
  text-transform: uppercase;
}

.elu-loading-mark {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(123, 232, 208, .3);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: elu-globe-spin .9s linear infinite;
}

@keyframes elu-globe-spin { to { transform: rotate(360deg); } }

/* Non-WebGL evidence route. This region is a direct child of body so it is
   never trapped beneath #globeViz or the opaque Foundation sections. */
#globe-fallback[hidden] { display: none !important; }

body.globe-fallback-active #globeViz {
  pointer-events: none !important;
}

body.globe-fallback-active #globe-loading,
body.globe-fallback-active #elu-country-rank-rail,
body.globe-fallback-active #elu-country-card-wrap,
body.globe-fallback-active #hex-country-tooltip,
body.globe-fallback-active .hex-legend,
body.globe-fallback-active #globe-back-btn {
  display: none !important;
}

#globe-fallback {
  position: fixed;
  inset: 112px 0 0;
  z-index: 60;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 26px clamp(12px, 3vw, 38px) 96px;
  background: var(--bg);
  color: var(--text);
  pointer-events: auto;
}

.elu-fallback-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.elu-fallback-header,
.elu-fallback-evidence {
  border: 1px solid var(--hud-border);
  border-radius: 4px;
  background: var(--hud-bg-strong);
  box-shadow: var(--hud-shadow);
}

.elu-fallback-header {
  padding: clamp(20px, 4vw, 34px);
}

.elu-fallback-eyebrow {
  margin: 0 0 8px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.elu-fallback-header h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 400;
  line-height: 1.05;
}

.elu-fallback-reason {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.elu-fallback-boundary {
  max-width: 880px;
  margin: 10px 0 0;
  color: var(--hud-muted);
  font-size: 12px;
  line-height: 1.65;
}

.elu-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.elu-fallback-actions .glass-btn {
  min-height: 44px;
  white-space: normal;
}

.elu-fallback-evidence {
  margin-top: 14px;
  padding: clamp(16px, 3vw, 24px);
}

.elu-fallback-evidence-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.elu-fallback-evidence h3,
.elu-fallback-evidence h4 {
  color: var(--mint);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .8px;
}

.elu-fallback-evidence h3 {
  margin: 0;
  font-size: 13px;
}

#globe-fallback-summary {
  margin: 7px 0 0;
  color: var(--hud-muted);
  font-size: 11px;
  line-height: 1.5;
}

.elu-fallback-search {
  display: grid;
  flex: 0 1 340px;
  gap: 6px;
  color: var(--hud-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.elu-fallback-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--hud-border);
  border-radius: 3px;
  background: var(--hud-cell);
  color: var(--text);
  font: 14px/1.35 var(--body);
}

.elu-fallback-search input:focus-visible {
  border-color: var(--mint);
  outline: none;
  box-shadow: none;
}

#globe-fallback button:focus-visible,
#globe-fallback a:focus-visible,
#globe-fallback [tabindex="-1"]:focus-visible {
  border-color: var(--mint);
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.elu-fallback-results {
  min-height: 18px;
  margin: 10px 0 6px;
  color: var(--hud-muted);
  font-size: 10px;
}

.elu-fallback-grid {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr);
  gap: 12px;
  min-height: 430px;
}

.elu-fallback-list-panel,
.elu-fallback-detail {
  min-width: 0;
  border: 1px solid var(--hud-divider);
  border-radius: 3px;
  background: var(--hud-cell);
}

.elu-fallback-list-panel {
  max-height: 560px;
  overflow: auto;
  scrollbar-width: thin;
}

#globe-fallback-country-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.elu-fallback-country-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid var(--hud-divider-soft);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.elu-fallback-country-row:hover,
.elu-fallback-country-row:focus-visible,
.elu-fallback-country-row[aria-current="true"] {
  background: var(--hud-cell-hover);
}

.elu-fallback-country-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.elu-fallback-country-name small,
.elu-fallback-country-state {
  display: block;
  margin-top: 3px;
  color: var(--hud-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .35px;
}

.elu-fallback-country-state {
  align-self: center;
  margin: 0;
  text-align: right;
}

.elu-fallback-country-state.is-gap { color: var(--hud-muted); }

.elu-fallback-detail {
  padding: clamp(16px, 3vw, 24px);
  overflow: auto;
}

.elu-fallback-detail h3 {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(25px, 4vw, 36px);
  letter-spacing: .2px;
}

.elu-fallback-detail h4 {
  margin: 20px 0 8px;
  font-size: 10px;
  text-transform: uppercase;
}

.elu-fallback-detail p,
.elu-fallback-detail li {
  color: var(--hud-muted);
  font-size: 12px;
  line-height: 1.6;
}

.elu-fallback-detail ul {
  margin: 0;
  padding-left: 20px;
}

.elu-fallback-detail-value {
  margin: 12px 0 0;
  color: var(--text) !important;
}

.elu-fallback-detail-value strong {
  color: #f2b36f;
  font-family: var(--mono);
  font-size: clamp(20px, 4vw, 29px);
  font-weight: 500;
}

.elu-fallback-detail-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 9px;
  padding: 5px 8px;
  border: 1px solid var(--hud-border);
  border-radius: 999px;
  color: var(--hud-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.elu-fallback-table-wrap {
  max-width: 100%;
  margin-top: 12px;
  overflow-x: auto;
}

.elu-fallback-detail table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 10px;
}

.elu-fallback-detail caption {
  padding: 0 0 7px;
  color: var(--hud-muted);
  text-align: left;
}

.elu-fallback-detail th,
.elu-fallback-detail td {
  padding: 7px 8px;
  border-top: 1px solid var(--hud-divider);
  color: var(--text);
  text-align: left;
  white-space: nowrap;
}

.elu-fallback-source a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--teal);
}

.elu-fallback-back-to-list {
  min-height: 44px;
  margin-top: 18px;
  padding: 9px 12px;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: transparent;
  color: var(--teal);
  font: 11px/1.3 var(--body);
  cursor: pointer;
}

html[data-theme="light"] body.globe-mode .elu-fallback-detail-value strong {
  color: #6b3d00;
}

@media (max-width: 760px) {
  #globe-fallback { padding: 16px 10px 90px; }
  .elu-fallback-evidence-head { display: grid; }
  .elu-fallback-search { width: 100%; }
  .elu-fallback-grid { grid-template-columns: 1fr; }
  .elu-fallback-list-panel { max-height: 270px; }
}

@media (prefers-reduced-motion: reduce) {
  #globe-fallback,
  #globe-fallback * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Exact-metric order with explicit gaps, outside #globeViz by design. */
#elu-country-rank-rail {
  position: fixed;
  top: 72px;
  bottom: calc(var(--globe-dock-inset) + var(--globe-dock-height) + 12px);
  left: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 218px;
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: var(--hud-bg);
  box-shadow: var(--hud-shadow);
  backdrop-filter: blur(12px);
  color: var(--text);
}

.elu-rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px 8px;
  border-bottom: 1px solid var(--hud-divider);
}

.elu-rank-title {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.elu-rank-relief-note {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 5px;
  border: 1px solid rgba(96, 225, 203, .34);
  border-radius: 2px;
  background: rgba(96, 225, 203, .08);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.2;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.elu-rank-subtitle {
  margin-top: 3px;
  color: var(--hud-faint);
  font-size: 9px;
}

.elu-rank-boundary-compact { display: none; }

.elu-rank-toggle {
  width: 23px;
  height: 23px;
  border: 1px solid var(--hud-border);
  border-radius: 2px;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-size: 11px;
}

.elu-rank-toggle:hover,
.elu-rank-toggle:focus-visible {
  border-color: var(--mint);
  outline: none;
}

.elu-rank-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  scrollbar-width: thin;
}

.elu-rank-search {
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--hud-divider-soft);
  color: var(--hud-muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .55px;
  text-transform: uppercase;
}

.elu-rank-search input {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 2px solid var(--hud-border);
  border-radius: 2px;
  background: var(--hud-cell);
  color: var(--text);
  font: 11px/1.3 var(--body);
}

#elu-country-rank-rail .elu-rank-search input:focus-visible {
  border-color: var(--mint);
  outline: none;
  box-shadow: none;
}

.elu-rank-filter-results {
  min-height: 14px;
  margin: 0;
  padding: 0 10px 6px;
  color: var(--hud-faint);
  font-size: 8px;
}

#elu-country-rank-rail.is-collapsed { bottom: auto; }

#elu-country-rank-rail.is-collapsed .elu-rank-list,
#elu-country-rank-rail.is-collapsed .elu-rank-subtitle {
  display: none;
}

.elu-rank-row {
  display: grid;
  grid-template-columns: 21px 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 5px 10px;
  border: 0;
  border-bottom: 1px solid var(--hud-divider-soft);
  background: transparent;
  color: var(--hud-muted);
  font-family: var(--body);
  text-align: left;
  cursor: pointer;
}

.elu-rank-row:hover,
.elu-rank-row:focus-visible,
.elu-rank-row.is-active {
  background: var(--hud-cell-hover);
  color: var(--text);
  outline: none;
}

.elu-rank-number,
.elu-rank-gap {
  color: var(--hud-faint);
  font-family: var(--mono);
  font-size: 8px;
}

.elu-rank-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.elu-rank-name small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--hud-faint);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elu-rank-code { display: none; }

.elu-rank-gap { color: var(--hud-muted); text-align: right; }
.elu-rank-gap small { display: block; margin-top: 2px; font-size: 6px; }
.elu-rank-row.is-unmapped { border-left: 2px dotted var(--hud-border-strong); }
.elu-rank-row[hidden] { display: none; }
.elu-rank-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hud-faint); }
.elu-rank-dot.is-red { background: #ff786d; box-shadow: 0 0 7px rgba(255, 120, 109, .35); }
.elu-rank-dot.is-green { background: #63dc8b; box-shadow: 0 0 7px rgba(99, 220, 139, .3); }
.elu-rank-dot.is-amber { background: var(--amber); }
.elu-rank-dot.is-magnitude { background: linear-gradient(135deg,#5b4a97,#f6913a); box-shadow:0 0 7px rgba(246,145,58,.28); }
.elu-rank-dot.is-gap { background:repeating-linear-gradient(135deg,#91a0ac 0 2px,transparent 2px 4px); border:1px solid #aeb9c1; }
.elu-rank-gap-heading { margin:0; padding:9px 10px; border-top:1px solid var(--hud-divider); border-bottom:1px solid var(--hud-divider-soft); color:var(--hud-muted); font-family:var(--mono); font-size:8px; font-weight:500; letter-spacing:1px; text-transform:uppercase; }
.elu-rank-disclosure,.elu-rank-unmapped { padding:7px 10px; color:var(--hud-muted); font-size:9px; line-height:1.4; }
.elu-rank-disclosure-full { display:block; }
.elu-rank-disclosure-compact { display:none; }
.elu-rank-unmapped { border-bottom:1px solid var(--hud-divider-soft); }

/* Selected dashboard: the v0.7 461px docked card. */
#hex-country-tooltip {
  z-index: 1000;
  border-radius: 3px;
  background: var(--hud-bg);
  border-color: var(--hud-border);
  box-shadow: var(--hud-shadow-strong);
}

#hex-country-tooltip.selected {
  width: min(461px, calc(100vw - 124px)) !important;
  max-height: min(78vh, 700px);
  padding: 14px 15px 13px;
  border-color: var(--hud-border-strong);
  background: var(--hud-bg-strong);
  box-shadow: var(--hud-shadow-strong);
  animation: elu-card-in .5s cubic-bezier(.22,.61,.36,1);
}

#hex-country-tooltip.selected .tt-topline {
  position: sticky;
  top: -14px;
  z-index: 3;
  align-items: center;
  min-height: 27px;
  margin: -14px -15px 5px;
  padding: 14px 15px 8px;
  border-bottom: 1px solid var(--hud-divider);
  background: var(--hud-bg-strong);
}

#hex-country-tooltip.selected .tt-country {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .15px;
}

#hex-country-tooltip.selected .tt-detail {
  color: var(--hud-muted);
  font-size: 10px;
}

#hex-country-tooltip[data-status] .tt-pill {
  color: var(--st);
  border-color: var(--st-bd);
  background: var(--st-bg);
}

#hex-country-tooltip[data-status] .tt-gap {
  border-color: var(--st-bd);
  background: var(--st-bg);
}

#hex-country-tooltip[data-status] .tt-gap-line {
  color: var(--st);
}

#hex-country-tooltip .tt-cat {
  border-color: var(--cat) !important;
  background: var(--hud-cell) !important;
  background: color-mix(in srgb, var(--cat) 9%, transparent) !important;
}

#hex-country-tooltip .tt-cat-dot {
  background: var(--cat) !important;
}

/* Selected card is mounted between two sibling arrows, matching the handoff
   and keeping the controls out of the card's scrollable content. */
#elu-country-card-wrap {
  position: fixed;
  top: 64px;
  right: 24px;
  bottom: calc(var(--globe-dock-inset) + var(--globe-dock-height) + var(--globe-dock-gap));
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

#elu-country-card-wrap #hex-country-tooltip {
  position: relative !important;
  inset: auto !important;
  z-index: auto;
  width: min(461px, calc(100vw - 124px)) !important;
  max-width: calc(100vw - 124px);
  max-height: 100% !important;
  overflow-y: auto;
  scroll-padding-block-start: 76px;
  transform: none;
  pointer-events: auto;
}

@keyframes elu-country-card-swipe-cue {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
  24% { transform: translate3d(-7px, 0, 0) rotate(-.35deg); }
  50% { transform: translate3d(6px, 0, 0) rotate(.3deg); }
  72% { transform: translate3d(-2px, 0, 0) rotate(-.1deg); }
}

#elu-country-card-wrap .tt-nav {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 auto;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border: 1px solid var(--cell-bd);
  border-radius: 50% !important;
  background: var(--glass-bg);
  color: var(--text2);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  opacity: .7;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none;
  transition: opacity .2s, color .15s, border-color .15s, transform .15s;
}

#elu-country-card-wrap .tt-nav:hover,
#elu-country-card-wrap .tt-nav:focus-visible {
  border-color: var(--teal);
  color: var(--teal);
  opacity: 1;
  outline: none;
  transform: scale(1.08);
}

#hex-country-tooltip .tt-pill {
  border-radius: 2px;
  letter-spacing: .9px;
}

#hex-country-tooltip .tt-status-magnitude { color:#f2b36f; border-color:rgba(242,179,111,.38); background:rgba(117,76,151,.16); }
#hex-country-tooltip .tt-candidate { margin-top:8px; padding:7px 8px; border:1px solid rgba(242,179,111,.34); background:rgba(117,76,151,.14); color:#f7c58d; font-family:var(--mono); font-size:8px; letter-spacing:.55px; line-height:1.4; text-transform:uppercase; }
#hex-country-tooltip .tt-close { min-width:44px; min-height:44px; }
#hex-country-tooltip .tt-factual h3 { margin:12px 0 5px; color:var(--mint); font-family:var(--mono); font-size:9px; letter-spacing:1px; text-transform:uppercase; }
#hex-country-tooltip .tt-factual-value { color:var(--text2); font-size:11px; }
#hex-country-tooltip .tt-factual-value strong { color:#f2b36f; font-family:var(--mono); font-size:20px; }
#hex-country-tooltip .tt-factual-value span { color:var(--hud-faint); }
#hex-country-tooltip .elu-trajectory-current.is-magnitude { stroke:#f2a553; stroke-width:2; fill:none; }
#hex-country-tooltip .elu-trajectory-point { fill:#fff1dc; stroke:#704f9d; stroke-width:1.2; }
#hex-country-tooltip .elu-trajectory-current.is-observed { stroke:var(--mint); stroke-width:1.5; fill:none; }
#hex-country-tooltip .elu-trajectory-point.is-observed { fill:var(--mint); stroke:var(--hud-bg-strong); stroke-width:1; }
#hex-country-tooltip .elu-chart-axis { fill:var(--text2); font-family:var(--mono); font-size:7px; }
#hex-country-tooltip .tt-chart-data { margin-top:8px; color:var(--text2); font-size:10px; }
#hex-country-tooltip .tt-chart-data summary { min-height:44px; display:flex; align-items:center; color:var(--teal); cursor:pointer; }
#hex-country-tooltip .tt-chart-data table { width:100%; border-collapse:collapse; font-family:var(--mono); font-size:9px; }
#hex-country-tooltip .tt-chart-data caption { padding:5px; color:var(--hud-muted); text-align:left; }
#hex-country-tooltip .tt-chart-data th,#hex-country-tooltip .tt-chart-data td { padding:4px 5px; border-top:1px solid var(--hud-divider-soft); text-align:left; }
#hex-country-tooltip .tt-source,#hex-country-tooltip .tt-limit { margin-top:8px; color:var(--text2); font-size:10px; line-height:1.45; }
#hex-country-tooltip .tt-source a { display:inline-flex; align-items:center; min-height:44px; color:var(--teal); }
#hex-country-tooltip :focus-visible,#elu-country-rank-rail :focus-visible { outline:2px solid var(--mint); outline-offset:2px; }

.tt-glance,
.tt-lens-panel,
.tt-observed-series { margin-top: 12px; }

.tt-glance > h3,
.tt-lens-panel > h3,
.tt-observed-series > h3 {
  margin: 0 0 6px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tt-lens-panel > p {
  margin: 0 0 8px;
  color: var(--hud-muted);
  font-size: 10px;
  line-height: 1.45;
}

.tt-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.tt-glance .tt-fact:first-child { grid-column: 1 / -1; }

.tt-fact {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--hud-divider);
  border-radius: 3px;
  background: var(--hud-cell);
}

.tt-fact.is-gap { border-style: dashed; }

.tt-fact h4 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
}

.tt-fact-value {
  color: var(--hud-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.tt-fact-value strong {
  color: #f2b36f;
  font-size: 15px;
  font-weight: 500;
}

.tt-fact p {
  margin: 5px 0 0;
  color: var(--hud-muted);
  font-size: 9px;
  line-height: 1.45;
}

.tt-fact .tt-fact-meta {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .25px;
}

.tt-fact .tt-fact-uncertainty,
.tt-fact .tt-fact-note { color: var(--hud-faint); }

.tt-fact .tt-fact-warning {
  padding-left: 7px;
  border-left: 2px solid var(--amber);
  color: var(--text2);
}

.elu-power-field {
  --power-nuclear: #5cff8d;
  --power-hydro: #2e91b7;
  --power-wind: #56d8cf;
  --power-solar: #f2c75c;
  --power-bioenergy: #64a965;
  --power-other-renewables: #b97acb;
  --power-coal: #262c31;
  --power-coal-ridge: #46505a;
  --power-gas: #df8856;
  --power-other-fossil: #c7653f;
  --power-other-fossil-mark: rgba(24, 29, 32, .72);
  margin: 0 0 8px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background:
    linear-gradient(105deg, rgba(48, 196, 151, .08), transparent 52%),
    var(--hud-trajectory-bg);
}

.elu-power-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1.05px;
  text-transform: uppercase;
}

.elu-power-field-head span:last-child {
  color: var(--hud-faint);
  font-family: var(--body);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
}

.elu-power-field-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 1px 0 7px;
  color: var(--hud-faint);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: .3px;
}

.elu-power-field-scale span { text-align: center; }
.elu-power-field-scale span:first-child { text-align: left; }
.elu-power-field-scale span:last-child { text-align: right; }

.elu-power-lanes {
  display: grid;
  gap: 10px;
}

.elu-power-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  color: var(--text2);
  font-size: 9px;
  line-height: 1.2;
}

.elu-power-lane-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.elu-power-lane-head strong {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
}

.elu-power-lane-track {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--hud-divider);
  border-radius: 2px;
  background: var(--hud-cell);
}

.elu-power-lane-track::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--hud-divider-soft) 1px, transparent 1px);
  background-size: 25% 100%;
  pointer-events: none;
}

.elu-power-segment {
  position: relative;
  z-index: 0;
  display: block;
  min-width: 0;
  height: 100%;
  flex: 0 0 auto;
  box-shadow: inset -1px 0 rgba(6, 11, 18, .38);
}

/* Fuel-specific color and restrained static textures work with fixed ordering
   and the text legend as a non-color reading route. No fill is animated. */
.elu-power-segment.is-nuclear,
.elu-power-segment-key.is-nuclear {
  background: var(--power-nuclear);
}

.elu-power-segment.is-nuclear {
  z-index: 1;
  box-shadow:
    inset -1px 0 rgba(6, 11, 18, .42),
    0 0 6px rgba(92, 255, 141, .34);
}

.elu-power-segment-key.is-nuclear {
  box-shadow: 0 0 4px rgba(92, 255, 141, .28);
}

.elu-power-segment.is-hydro,
.elu-power-segment-key.is-hydro {
  background: repeating-linear-gradient(135deg, var(--power-hydro) 0 5px, #236b8e 5px 8px);
}

.elu-power-segment.is-wind,
.elu-power-segment-key.is-wind {
  background: repeating-linear-gradient(90deg, var(--power-wind) 0 3px, #248a87 3px 5px);
}

.elu-power-segment.is-solar,
.elu-power-segment-key.is-solar {
  background:
    repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, .48) 5px 6px, transparent 6px 11px),
    var(--power-solar);
}

.elu-power-segment.is-bioenergy,
.elu-power-segment-key.is-bioenergy {
  background: repeating-linear-gradient(45deg, var(--power-bioenergy) 0 4px, #347447 4px 6px);
}

.elu-power-segment.is-other-renewables,
.elu-power-segment-key.is-other-renewables {
  background: var(--power-other-renewables);
}

.elu-power-segment.is-coal,
.elu-power-segment-key.is-coal {
  background: repeating-linear-gradient(135deg, var(--power-coal) 0 4px, var(--power-coal-ridge) 4px 6px);
}

.elu-power-segment.is-gas,
.elu-power-segment-key.is-gas {
  background: repeating-linear-gradient(90deg, var(--power-gas) 0 5px, #9c573d 5px 7px);
}

.elu-power-segment.is-other-fossil,
.elu-power-segment-key.is-other-fossil {
  background:
    linear-gradient(45deg, transparent 42%, var(--power-other-fossil-mark) 44% 56%, transparent 58%) 0 0 / 10px 10px,
    linear-gradient(-45deg, transparent 42%, var(--power-other-fossil-mark) 44% 56%, transparent 58%) 0 0 / 10px 10px,
    var(--power-other-fossil);
}

.elu-power-mix-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 10px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid var(--hud-divider-soft);
  list-style: none;
}

.elu-power-mix-legend li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--hud-muted);
  font-size: 9px;
  line-height: 1.25;
}

.elu-power-mix-legend li span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.elu-power-mix-legend li strong {
  color: var(--text2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
}

.elu-power-mix-legend li.is-zero { opacity: .68; }

.elu-power-mix-legend li.is-gap .elu-power-segment-key {
  background: repeating-linear-gradient(135deg, transparent 0 3px, var(--hud-divider) 3px 5px);
  box-shadow: none;
}

.elu-power-mix-legend li.is-gap strong {
  color: var(--hud-faint);
  font-size: 8px;
  text-transform: uppercase;
}

.elu-power-segment-key {
  display: block;
  width: 20px;
  height: 8px;
  border: 1px solid var(--hud-divider);
  border-radius: 1px;
}

.elu-power-reconciliation,
.elu-power-taxonomy-note,
.elu-power-mix-gap {
  margin: 7px 0 0;
  color: var(--hud-muted);
  font-size: 7px;
  line-height: 1.45;
}

.elu-power-reconciliation strong { color: var(--text2); }

.elu-power-reconciliation.has-rounding {
  padding-left: 7px;
  border-left: 2px solid var(--amber);
}

.elu-power-taxonomy-note { color: var(--hud-faint); }

.elu-power-mix-gap {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 9px;
  border: 1px dashed var(--hud-divider);
  background: var(--hud-cell);
}

.elu-power-field figcaption {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--hud-divider-soft);
  color: var(--hud-muted);
  font-size: 8px;
  line-height: 1.45;
}

.elu-power-field figcaption strong { color: var(--text2); }

html[data-theme="light"] body.globe-mode .elu-power-field {
  --power-nuclear: #28df70;
  --power-hydro: #2f718f;
  --power-wind: #2d8981;
  --power-solar: #d89a24;
  --power-bioenergy: #4d8050;
  --power-other-renewables: #80558a;
  --power-coal: #30363a;
  --power-coal-ridge: #59636a;
  --power-gas: #ac603c;
  --power-other-fossil: #b75830;
  --power-other-fossil-mark: rgba(37, 39, 40, .66);
}

html[data-theme="light"] body.globe-mode .elu-power-segment.is-nuclear {
  box-shadow:
    inset -1px 0 rgba(32, 48, 42, .28),
    0 0 4px rgba(40, 223, 112, .24);
}
.tt-power-support-grid { margin-top: 7px; }
.tt-glance .tt-power-support-grid .tt-fact:first-child { grid-column: auto; }

.tt-breakdown,
.tt-methods,
.tt-method-fact {
  margin-top: 8px;
  border-top: 1px solid var(--hud-divider-soft);
}

.tt-breakdown summary,
.tt-methods > summary,
.tt-method-fact > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .5px;
  cursor: pointer;
}

.tt-breakdown h5,
.tt-methods h4,
.tt-methods h5 {
  margin: 9px 0 5px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .5px;
}

.tt-breakdown ul,
.tt-methods ul { margin: 0; padding-left: 18px; }

.tt-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tt-methods {
  margin-top: 12px;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: var(--hud-trajectory-bg);
}

.tt-methods > summary { padding: 0 10px; }

.tt-methods-body {
  padding: 0 10px 10px;
  overflow-wrap: anywhere;
}

.tt-methods-body p,
.tt-methods-body li {
  margin-top: 6px;
  color: var(--hud-muted);
  font-size: 9px;
  line-height: 1.5;
}

.tt-methods a { display: inline-flex; min-height: 44px; align-items: center; color: var(--teal); }
.tt-methods code { color: var(--text2); font: 7px/1.5 var(--mono); overflow-wrap: anywhere; }

#hex-country-tooltip.selected .tt-gap {
  border-radius: 3px;
  background: var(--hud-cell);
}

#hex-country-tooltip.selected .tt-grid4 {
  gap: 6px;
  margin-top: 9px;
}

#hex-country-tooltip.selected .tt-grid4 > div {
  border-radius: 3px;
  background: var(--hud-cell);
}

#hex-country-tooltip.selected .tt-nav {
  width: 26px;
  height: 86px;
  border-radius: 2px;
  background: var(--hud-nav-bg);
}

#hex-country-tooltip.selected .tt-hint {
  padding-top: 6px;
  border-top: 1px solid var(--hud-divider-soft);
  color: var(--hud-muted);
  opacity: 1;
}

/* v0.7 trajectory panel inserted by GlobeModule._renderCountryMetrics. */
.elu-trajectory {
  margin-top: 10px;
  padding: 9px 10px 8px;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: var(--hud-trajectory-bg);
}

.tt-physical-story { margin-top: 12px; }

.tt-climate-variable {
  padding: 10px;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: var(--hud-cell);
}

.tt-climate-variable + .tt-climate-variable { margin-top: 10px; }

.tt-climate-variable > h3 {
  margin: 0 0 9px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.15px;
  text-transform: uppercase;
}

.tt-climate-evidence + .tt-climate-evidence,
.tt-climate-evidence + .tt-projected-fact,
.tt-projected-fact + .tt-climate-evidence { margin-top: 10px; }

.tt-climate-evidence > h4 {
  margin: 0 0 6px;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .85px;
  text-transform: uppercase;
}

.tt-climate-evidence .elu-trajectory,
.tt-projected-fact .tt-fact { margin-top: 0; }

.elu-projection-range {
  padding: 9px 10px 8px;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: var(--hud-trajectory-bg);
}

.elu-projection-range svg {
  display: block;
  width: 100%;
  height: 72px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.elu-projection-range-band {
  fill: rgba(77, 139, 216, .18);
  stroke: rgba(77, 139, 216, .46);
  stroke-width: .8;
}

.elu-projection-range-line {
  stroke: var(--hud-muted);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.elu-projection-marker {
  stroke: var(--hud-bg-strong);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.elu-projection-marker.is-p10 { fill: #4d8bd8; }
.elu-projection-marker.is-median { fill: var(--mint); }
.elu-projection-marker.is-p90 { fill: #e85b45; }

.elu-projection-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px 12px;
  margin-top: -3px;
  color: var(--hud-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .3px;
  line-height: 1.35;
}

.elu-projection-values span { display: inline-flex; align-items: center; gap: 4px; }
.elu-projection-values strong { color: var(--text2); font-weight: 700; }
.elu-projection-values i { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; }
.elu-projection-values i.is-p10 { background: #4d8bd8; }
.elu-projection-values i.is-median { background: var(--mint); transform: rotate(45deg); }
.elu-projection-values i.is-p90 { border-radius: 50%; background: #e85b45; }

.elu-projection-disclosure {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--hud-divider-soft);
  color: var(--hud-muted);
  font-size: 9px;
  line-height: 1.45;
}

.elu-projection-disclosure strong { color: var(--text2); }

.elu-trajectory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.elu-trajectory-title {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.elu-trajectory-note {
  color: var(--hud-faint);
  font-size: 9px;
}

.elu-trajectory svg {
  display: block;
  width: 100%;
  height: 54px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.elu-trajectory-grid { stroke: var(--hud-grid); stroke-width: .7; }
.elu-trajectory-trend { stroke: var(--teal); stroke-width: 1.6; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.elu-trajectory-target { fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-dasharray: 3 3; opacity: .65; }
.elu-trajectory-current { fill: none; stroke: var(--st); stroke-width: 1.6; }
.elu-trajectory-current.is-red { stroke: var(--warn); }
.elu-trajectory-current.is-green { stroke: var(--leaf); }
.elu-trajectory-current.is-amber { stroke: var(--amber); }
.elu-trajectory-marker { fill: var(--st); stroke: var(--hud-bg-strong); stroke-width: 1; }
.elu-trajectory-marker.is-red { fill: var(--warn); }
.elu-trajectory-marker.is-green { fill: var(--leaf); }
.elu-trajectory-today { stroke: var(--hud-today); stroke-width: .8; stroke-dasharray: 1.5 2; vector-effect: non-scaling-stroke; }
.elu-trajectory-years { display: flex; justify-content: space-between; margin-top: -1px; color: var(--hud-muted); font-family: var(--mono); font-size: 8px; letter-spacing: .55px; line-height: 1; }
.elu-trajectory-empty { color: var(--hud-faint); font-size: 10px; line-height: 1.4; }
.elu-trajectory-legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--hud-faint); font-size: 8px; }
.elu-trajectory-legend span { display: inline-flex; align-items: center; gap: 5px; }
.elu-trajectory-legend span::before { content: ''; width: 14px; border-top: 2px solid var(--hud-faint); }
.elu-trajectory-legend span:first-child::before { border-color: var(--warn); }
.elu-trajectory-legend span:first-child.is-green::before { border-color: var(--leaf); }
.elu-trajectory-legend span:last-child::before { border-top-style: dashed; border-color: var(--teal); }
.elu-observed-legend { margin-top: 6px; }
.elu-trajectory-legend.elu-observed-legend span.elu-observed-series-key::before { border-color: var(--mint); }
.elu-trajectory-legend.elu-observed-legend span.elu-observed-trend-key::before { border-top-style: dashed; border-color: var(--teal); }
.elu-trajectory-today-key::before { border-top-style: dotted !important; border-color: var(--hud-today) !important; }
.elu-trajectory-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.elu-trajectory-chip { padding: 4px 7px; border: 1px solid var(--cell-bd); border-radius: 20px; color: var(--hud-muted); font-family: var(--mono); font-size: 8px; line-height: 1; }
.elu-trajectory-chip.is-red { border-color: var(--st-bd); background: var(--st-bg); color: var(--warn); }
.elu-trajectory-chip.is-green { border-color: rgba(46, 204, 113, .28); background: rgba(46, 204, 113, .08); color: var(--leaf); }

/* Bottom utility dock: evidence context sits beside the exit action instead
   of consuming a second layer of the globe or colliding with the rank rail. */
body.globe-mode .hex-legend {
  left: calc(var(--globe-dock-inset) + var(--globe-back-width) + var(--globe-dock-gap));
  right: var(--globe-dock-inset);
  bottom: var(--globe-dock-inset);
  z-index: 60;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  gap: 14px;
  min-height: var(--globe-dock-height);
  padding: 10px 14px;
  border-color: var(--hud-border);
  border-radius: 3px;
  background: var(--hud-bg);
  box-shadow: var(--hud-shadow);
}

body.globe-mode .hex-legend-row {
  min-width: 0;
  color: var(--text2);
  line-height: 1.25;
}

body.globe-mode .hex-legend-title { grid-column: 1 / -1; }

body.globe-mode .hex-legend-note {
  grid-column: 1 / -1;
  max-width: none;
  margin: 0;
  padding-top: 6px;
  border-top-color: var(--hud-divider);
  color: var(--text2);
  line-height: 1.3;
}

/* The expanded evidence card and the bottom legend occupy the same desktop
   quadrant. Keep the selected record unobscured; the lens controls, card
   summary, and rail retain the active metric while the card is open. */
body.globe-mode.country-card-open:not(.globe-fallback-active) .hex-legend {
  display: none !important;
}

body.globe-mode #globe-back-btn {
  left: var(--globe-dock-inset);
  z-index: 200;
  bottom: calc(var(--globe-dock-inset) + var(--globe-back-lift));
  width: var(--globe-back-width);
  min-height: var(--globe-back-height);
  padding: 10px 14px;
  border-color: var(--border-hi);
  background: var(--bg2);
  color: var(--teal);
  overflow: hidden;
  font-size: 10px;
  letter-spacing: 1.7px;
  white-space: nowrap;
  transform: none;
  animation: elu-hud-in .7s cubic-bezier(.22,.61,.36,1) .55s both;
}

html[data-theme="light"] body.globe-mode #hex-country-tooltip .tt-close {
  border-color: var(--hud-border);
  background: var(--hud-cell);
}

html[data-theme="light"] body.globe-mode #hex-country-tooltip .tt-grid4 > div {
  border-color: var(--hud-divider);
}

html[data-theme="light"] body.globe-mode #hex-country-tooltip .tt-status-magnitude,
html[data-theme="light"] body.globe-mode #hex-country-tooltip .tt-candidate,
html[data-theme="light"] body.globe-mode #hex-country-tooltip .tt-factual-value strong,
html[data-theme="light"] body.globe-mode .tt-fact-value strong {
  color: #6b3d00;
}
html[data-theme="light"] body.globe-mode #hex-country-tooltip .tt-candidate {
  border-color: #81521d;
  background: #f4e7d4;
}
html[data-theme="light"] body.globe-mode #hex-country-tooltip .elu-trajectory-current.is-magnitude { stroke: #7a4300; }

@media (max-width: 900px) {
  body.globe-mode {
    --globe-dock-inset: 12px;
    --globe-dock-gap: 10px;
    --globe-back-width: clamp(230px, 32vw, 300px);
  }

  #elu-country-rank-rail { left: 12px; }
  #elu-country-card-wrap {
    bottom: calc(var(--globe-dock-inset) + var(--globe-dock-height) + 10px);
  }
  body.globe-mode.country-card-open:not(.globe-fallback-active) .hex-legend {
    display: none !important;
  }
  #hex-country-tooltip.selected {
    width: min(461px, calc(100vw - 54px)) !important;
  }
}

@media (max-width: 800px) {
  #elu-country-rank-rail {
    display: block !important;
    top: 60px;
    bottom: calc(var(--globe-dock-inset) + var(--globe-dock-height) + 10px);
    left: 8px;
    width: 72px;
    max-height: none;
    backdrop-filter: blur(10px);
  }

  .elu-rank-head {
    justify-content: center;
    padding: 8px 5px 7px;
    text-align: center;
  }

  .elu-rank-head > div { min-width: 0; }
  .elu-rank-title { font-size: 7px; letter-spacing: .8px; }
  .elu-rank-relief-note {
    display: block;
    margin-top: 4px;
    padding: 2px 3px;
    font-size: 6px;
    letter-spacing: .35px;
  }
  .elu-rank-subtitle,
  .elu-rank-toggle { display: none; }

  .elu-rank-boundary-compact {
    display: block;
    margin-top: 3px;
    color: var(--hud-faint);
    font-family: var(--mono);
    font-size: 6px;
    line-height: 1.15;
    letter-spacing: .35px;
    text-transform: uppercase;
  }

  .elu-rank-disclosure {
    padding: 7px 3px;
    font-family: var(--mono);
    text-align: center;
  }

  .elu-rank-disclosure-full { display: none; }
  .elu-rank-disclosure-compact {
    display: grid;
    justify-items: center;
    gap: 2px;
    line-height: 1.15;
    text-transform: uppercase;
  }

  .elu-rank-disclosure-compact strong {
    color: var(--mint);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: .35px;
  }

  .elu-rank-disclosure-compact span {
    color: var(--hud-faint);
    font-size: 6px;
    letter-spacing: .45px;
  }

  .elu-rank-list {
    height: calc(100% - 50px);
    max-height: none;
  }

  .elu-rank-search,
  .elu-rank-filter-results { display: none; }

  #elu-country-rank-rail.is-collapsed .elu-rank-list { display: block; }

  .elu-rank-row {
    grid-template-columns: 15px 6px minmax(0, 1fr);
    gap: 4px;
    min-height: 44px;
    padding: 5px;
  }

  .elu-rank-name,
  .elu-rank-gap { display: none; }

  .elu-rank-code {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--hud-muted);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: .4px;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  body.globe-mode {
    --globe-dock-inset: 14px;
    --globe-dock-height: 46px;
    --globe-back-height: 46px;
    --globe-back-lift: 0px;
    --globe-back-width: calc(100vw - 28px);
  }

  #elu-country-card-wrap .tt-nav,
  body.globe-mode .hex-legend {
    display: none !important;
  }

  body.globe-mode .climate-lens-controls {
    top: 60px;
    min-height: 48px;
  }

  .climate-lens-label { display: none; }

  .climate-lens-controls button {
    min-width: 68px;
    min-height: 44px;
    padding: 8px 9px;
  }

  body.globe-mode #globe-back-btn {
    transform: none;
    padding: 9px 13px;
    font-size: 10px;
    letter-spacing: 1.35px;
  }

  #hex-country-tooltip.selected {
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    height: auto;
    padding: 12px 12px 10px;
    transform: none;
  }

  #hex-country-tooltip.selected .tt-topline {
    top: -12px;
    margin: -12px -12px 5px;
    padding: 12px 12px 8px;
  }

  /* Mobile deck motion: a one-time affordance on entry, then short travel and
     a soft settle when the user commits or cancels a horizontal swipe. */
  #elu-country-card-wrap #hex-country-tooltip.tt-swipe-cue {
    animation: elu-country-card-swipe-cue .72s cubic-bezier(.22,.61,.36,1) .38s 1 both;
  }

  #elu-country-card-wrap #hex-country-tooltip.tt-motion-ready {
    animation: none !important;
  }

  #elu-country-card-wrap #hex-country-tooltip.tt-dragging,
  #elu-country-card-wrap #hex-country-tooltip.tt-snap,
  #elu-country-card-wrap #hex-country-tooltip.tt-fly-left,
  #elu-country-card-wrap #hex-country-tooltip.tt-fly-right,
  #elu-country-card-wrap #hex-country-tooltip.tt-enter-left,
  #elu-country-card-wrap #hex-country-tooltip.tt-enter-right {
    will-change: transform, opacity;
  }

  #elu-country-card-wrap #hex-country-tooltip.tt-snap {
    transition: transform .28s cubic-bezier(.22,.61,.36,1), opacity .22s ease;
  }

  #elu-country-card-wrap #hex-country-tooltip.tt-fly-left {
    transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .18s ease;
    transform: translate3d(-135px, 3px, 0) rotate(-2deg) !important;
  }

  #elu-country-card-wrap #hex-country-tooltip.tt-fly-right {
    transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .18s ease;
    transform: translate3d(135px, 3px, 0) rotate(2deg) !important;
  }

  #elu-country-card-wrap #hex-country-tooltip.tt-enter-left {
    transform: translate3d(-22px, 2px, 0) rotate(-.6deg) !important;
  }

  #elu-country-card-wrap #hex-country-tooltip.tt-enter-right {
    transform: translate3d(22px, 2px, 0) rotate(.6deg) !important;
  }

  #hex-country-tooltip.selected .tt-country { font-size: 16px; }
  #hex-country-tooltip.selected .tt-grid4 { grid-template-columns: repeat(2, 1fr); }
  #hex-country-tooltip.selected .tt-nav { display: none; }
  #hex-country-tooltip.selected .tt-hint { padding-bottom: 1px; }

  /* Preserve the card's usable scroll area inside the HUD bands while keeping
     a visible gutter below the 60px lens control. */
  #hex-country-tooltip.selected > * { max-width: 100%; }
  #elu-country-card-wrap {
    left: 90px;
    right: 10px;
    top: 142px !important;
    bottom: 78px;
    align-items: flex-end;
  }

  #elu-country-card-wrap #hex-country-tooltip {
    width: 100% !important;
    max-width: none;
  }
}

@media (max-width: 480px) {
  #elu-country-rank-rail {
    left: 6px;
    width: 50px;
  }

  .elu-rank-title { font-size: 0; }
  .elu-rank-title::after {
    content: 'Lens';
    font-size: 7px;
    letter-spacing: .8px;
  }

  body[data-climate-lens="carbon"] .elu-rank-title::after { content: 'CO₂'; }
  body[data-climate-lens="power"] .elu-rank-title::after { content: 'Clean'; }
  body[data-climate-lens="physical"] .elu-rank-title::after { content: 'Warm'; }

  .elu-rank-relief-note { font-size: 0; }
  .elu-rank-relief-note::after {
    content: 'Demo';
    font-size: 6px;
    letter-spacing: .35px;
  }

  .climate-lens-controls button {
    min-width: 60px;
    padding: 8px 7px;
    font-size: 9px;
  }

  .climate-lens-controls button.is-active::before { margin-right: 4px; }

  .tt-fact-grid { grid-template-columns: 1fr; }
  .tt-glance .tt-fact:first-child { grid-column: auto; }
  .elu-power-field-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .elu-power-mix-legend { grid-template-columns: 1fr; }

  .elu-rank-row {
    grid-template-columns: 6px minmax(0, 1fr);
    gap: 5px;
    padding: 5px 4px;
  }

  .elu-rank-number { display: none; }
  .elu-rank-code { font-size: 8px; letter-spacing: .2px; }

  #elu-country-card-wrap {
    left: 64px;
    right: 8px;
  }

  /* Keep the essential country name and Close control on their own row.
     The review-status badge moves below them so its intrinsic text width
     cannot collapse the heading at the 320/375px production breakpoints. */
  #hex-country-tooltip.selected .tt-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: 6px 8px;
  }

  #elu-country-card-wrap #hex-country-tooltip {
    scroll-padding-block-start: 116px;
  }

  #hex-country-tooltip.selected .tt-country {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #hex-country-tooltip.selected .tt-pill {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #hex-country-tooltip.selected .tt-close {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 44px;
    height: 44px;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .elu-loading-mark { animation: none; }
  body.globe-mode #topbar,
  body.globe-mode #elu-country-rank-rail,
  body.globe-mode .climate-lens-controls,
  body.globe-mode .hex-legend,
  body.globe-mode #globe-back-btn,
  #hex-country-tooltip.selected { animation: none; }
  #globe-loading,
  #hex-country-tooltip { transition: none !important; }
  #elu-country-card-wrap #hex-country-tooltip.tt-swipe-cue { animation: none !important; }
  #elu-country-card-wrap #hex-country-tooltip.tt-fly-left,
  #elu-country-card-wrap #hex-country-tooltip.tt-fly-right,
  #elu-country-card-wrap #hex-country-tooltip.tt-enter-left,
  #elu-country-card-wrap #hex-country-tooltip.tt-enter-right {
    transform: none !important;
    opacity: 1 !important;
  }
}
