@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700&family=Poppins:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --night: #101d35;
  --panel: #ffffff;
  --panel-raised: #f5f8fb;
  --line: #e1e7ed;
  --line-soft: #e8edf2;
  --blue: #00a6ff;
  --blue-light: #68c8ff;
  --ink: #373737;
  --muted: #687783;
  --faint: #87939d;
  --green: #327b62;
  --red: #b4565c;
  --neutral: #7f8993;
  --font-ui: "Poppins", sans-serif;
  --font-display: "Plus Jakarta Sans", sans-serif;
  font-family: var(--font-ui);
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: #fff; }
body { margin: 0; min-height: 100dvh; background: #fff; color: var(--ink); }
button, select, input { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.page-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(18px, 3vw, 44px); border-bottom: 1px solid var(--line); background: #fff; position: relative; z-index: 3; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #242a30; }
.brand img { display: block; width: 34px; height: 34px; }
.brand-name { font: 700 18px/1 var(--font-display); letter-spacing: -.045em; }
.topbar-right { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); }
.nav-toggle { display: none; border: 1px solid var(--line); border-radius: 5px; padding: 8px 12px; background: #fff; color: #25354b; font: inherit; font-size: 13px; cursor: pointer; }
.home-link { color: #424b52; text-decoration: none; font-size: 13px; transition: color .18s ease; }
.home-link:hover { color: #008edc; }
.home-link[aria-current="page"] { color: #008edc; font-weight: 600; text-decoration: underline; text-underline-offset: 9px; }
.home-link:focus-visible, .nav-toggle:focus-visible { outline: 3px solid #80b9e5; outline-offset: 3px; }
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .topbar-right { display: none; position: absolute; top: 100%; left: 16px; right: 16px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 18px #10203814; }
  .topbar-right.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .topbar-right .home-link { padding: 12px; font-size: 14px; }
}
.workspace { width: 100%; max-width: 1800px; margin: 0 auto; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 390px); height: calc(100dvh - 68px); min-height: 0; }
.globe-column { min-width: 0; min-height: 0; padding: 22px clamp(18px, 2.7vw, 40px) 20px; display: flex; flex-direction: column; }
.stage-heading { flex-shrink: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 16px; }
h1 { font: 700 clamp(25px, 2.4vw, 34px)/1.16 var(--font-display); margin: 0; letter-spacing: -.045em; color: #292f34; }
.stage-copy { color: #66737d; margin: 7px 0 0; max-width: 590px; font-size: 14px; line-height: 1.55; }
.country-count { color: #687783; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; padding-bottom: 3px; }
.country-count strong { color: #424b52; font-weight: 600; }
.globe-frame { position: relative; display: flex; flex-direction: column; min-height: 280px; flex: 1; overflow: hidden; border-radius: 5px; background: #101d35; }
#globe { position: relative; flex: 1; min-height: 0; touch-action: none; }
#globe canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#globe canvas:active { cursor: grabbing; }
.stage-topline { position: absolute; top: 17px; left: 19px; z-index: 1; }
.stage-label { color: #bac7d9; font-size: 11px; }
.loading-pill { position: absolute; z-index: 2; top: 14px; right: 16px; border: 1px solid rgba(255,255,255,.2); background: rgba(16,29,53,.9); color: #e5f4ff; padding: 7px 10px; border-radius: 4px; font-size: 11px; }
.globe-actions { position: relative; z-index: 1; flex-shrink: 0; margin: 0 14px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.globe-actions > * { pointer-events: auto; }
.button-cluster, .mode-switch { display: flex; align-items: center; border: 1px solid rgba(216,229,243,.24); border-radius: 5px; overflow: hidden; background: rgba(17,31,54,.94); }
.icon-button, .mode-button, .rotation-button { border: 0; background: transparent; min-width: 40px; height: 40px; color: #e1e8f1; display: inline-flex; align-items: center; justify-content: center; transition: background .18s ease, color .18s ease; }
.icon-button { font-size: 18px; }
.icon-button:hover, .mode-button:hover, .rotation-button:hover { background: rgba(0,166,255,.18); color: #fff; }
.zoom-readout { padding: 0 9px; min-width: 56px; text-align: center; color: #c5d1df; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.mode-button { padding: 0 12px; font-size: 11px; }
.mode-button[aria-pressed="true"] { color: #fff; background: rgba(0,166,255,.27); box-shadow: inset 0 -2px var(--blue); }
.rotation-button { padding: 0 12px; gap: 7px; font-size: 11px; white-space: nowrap; border: 1px solid rgba(216,229,243,.24); border-radius: 5px; background: rgba(17,31,54,.94); }
.rotation-glyph { color: #a7dcff; font-size: 14px; }
.globe-caption { flex-shrink: 0; color: #65737e; font-size: 12px; margin: 10px 1px 0; display: flex; justify-content: space-between; gap: 12px; }
.sidebar { overflow-y: auto; border-left: 1px solid var(--line); background: #f7f9fb; padding: 26px clamp(19px, 2vw, 29px) 22px; min-width: 0; display: flex; flex-direction: column; gap: 21px; }
.sidebar-intro { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.sidebar:has(.selected-summary:not([hidden])) .sidebar-intro { display: none; }
.sidebar-intro h2 { font: 700 19px/1.25 var(--font-display); margin: 0; letter-spacing: -.025em; }
.sidebar-intro p { color: #687783; font-size: 13px; line-height: 1.6; margin: 6px 0 0; }
.selected-summary { display: grid; gap: 3px; padding: 12px 0 15px; border-bottom: 1px solid var(--line); }
.selected-country { color: #343d43; font: 600 17px/1.35 var(--font-display); }
.selected-summary strong { color: #087fbd; font: 700 22px/1.25 var(--font-display); font-variant-numeric: tabular-nums; }
.selected-summary > span:last-child { color: #687783; font-size: 12px; line-height: 1.45; }
.control-section { min-width: 0; }
.control-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.control-heading label, .control-title { font-size: 13px; font-weight: 600; color: #41494f; }
.control-index { display: none; }
.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 13px; top: 50%; transform: translateY(-56%); color: #6c7881; pointer-events: none; font-size: 16px; }
select { appearance: none; width: 100%; height: 44px; border: 1px solid #d5dde4; border-radius: 4px; background: #fff; color: #353d43; padding: 0 36px 0 12px; font-size: 13px; }
select:hover { border-color: #aebdca; }
option, optgroup { background: #fff; color: var(--ink); }
.definition { color: #5f6c75; font-size: 14px; line-height: 1.6; margin: 9px 0 0; }
.source-line { display: block; color: #687783; font-size: 11px; margin-top: 4px; }
.legend-box { flex-shrink: 0; border: 0; border-top: 1px solid #e0e6eb; border-radius: 0; background: transparent; padding: 12px 0 0; margin-top: 12px; }
.legend-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: #697680; font-size: 11px; }
.legend-head strong { color: #41494f; font-size: 12px; font-weight: 600; }
#legend-gradient { height: 8px; border-radius: 2px; background: linear-gradient(90deg, #244d7a, #1686c6, #a8ddf5); }
.legend-labels { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: #596670; }
.legend-note { color: #62707a; font-size: 12px; margin-top: 7px; line-height: 1.5; display: flex; align-items: center; gap: 7px; }
.no-data-swatch { width: 10px; height: 10px; border-radius: 2px; background: #87919b; display: inline-block; flex: 0 0 auto; }
.year-controls { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; }
.year-readout { color: #087fbd; font: 700 19px var(--font-display); min-width: 45px; text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--blue); height: 20px; cursor: pointer; }
.year-meta { display: flex; justify-content: space-between; color: #74808a; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 2px; }
.year-play { width: 40px; height: 40px; border-radius: 4px; border: 1px solid #cbd6df; background: #fff; color: #34424b; }
.year-play:hover { border-color: var(--blue); color: #087fbd; }
.hint { color: #687783; font-size: 12px; line-height: 1.5; margin: 7px 0 0; }
.status-line { color: #65727c; font-size: 12px; line-height: 1.5; min-height: 15px; }
.status-line:empty { display: none; }
.status-line[data-state="error"] { color: #a94349; }
.retry-button { color: #087fbd; background: transparent; border: 0; text-decoration: underline; padding: 0 0 0 5px; font-size: inherit; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #697680; font-size: 11px; }
.sidebar-footer a { color: #087fbd; text-decoration: none; }
.sidebar-footer a:hover { text-decoration: underline; }
.tooltip { position: fixed; z-index: 20; pointer-events: none; min-width: 160px; max-width: 260px; padding: 10px 12px; background: #fff; border: 1px solid #d9e1e8; border-radius: 4px; box-shadow: 0 8px 24px rgba(10,28,45,.18); font-size: 12px; color: var(--ink); }
.tooltip[hidden] { display: none; }
.tooltip-name { font-weight: 600; margin-bottom: 4px; }
.tooltip-value { color: #53616b; font-variant-numeric: tabular-nums; line-height: 1.5; }
dialog { color: var(--ink); padding: 0; border: 1px solid #d7dfe6; border-radius: 8px; background: var(--panel); box-shadow: 0 24px 70px rgba(17,35,54,.25); max-height: min(88dvh, 900px); }
dialog::backdrop { background: rgba(20,34,48,.48); }
#profile-dialog, #comparison-dialog { width: min(1030px, calc(100vw - 40px)); }
.dialog-shell { min-height: 0; display: flex; flex-direction: column; max-height: min(88dvh, 900px); }
.dialog-header { flex-shrink: 0; }
.profile-focus { margin-top: 12px; display: grid; gap: 5px; }
.profile-focus strong { color: #087fbd; font: 700 26px/1.2 var(--font-display); }
.profile-focus span { color: #596670; font-size: 13px; line-height: 1.5; }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 24px 16px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); }
.dialog-header > div:first-child { min-width: 0; }
.dialog-kicker { color: #087fbd; font-size: 12px; font-weight: 600; }
.dialog-header h2 { font: 700 clamp(22px, 3vw, 31px)/1.12 var(--font-display); margin: 6px 0 5px; overflow-wrap: anywhere; color: #2e363c; }
.dialog-meta { color: #5d6972; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.dialog-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.close-button { width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid #d2dbe2; border-radius: 4px; background: #f7f9fb; color: #41494f; font-size: 22px; line-height: 1; }
.close-button:hover { color: #087fbd; border-color: var(--blue); }
.action-button { min-height: 44px; border: 1px solid #cbd6df; border-radius: 4px; background: #fff; color: #3d474e; padding: 8px 12px; font-size: 14px; white-space: nowrap; }
.action-button:hover { border-color: var(--blue); color: #087fbd; }
.dialog-body { flex: 1; min-height: 0; padding: 18px 24px 26px; overflow: auto; }
.profile-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; color: #596670; font-size: 14px; line-height: 1.45; margin-bottom: 18px; }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-dot.favourable { background: var(--green); }.legend-dot.unfavourable { background: var(--red); }.legend-dot.neutral { background: var(--neutral); }
.profile-section { border: 1px solid var(--line); border-radius: 5px; background: #fff; margin: 12px 0; overflow: hidden; }
.section-title { margin: 0; padding: 15px 17px; color: #343d43; font: 600 20px/1.4 var(--font-display); border-bottom: 1px solid var(--line-soft); }
.metric-row { border-bottom: 1px solid var(--line-soft); }
.metric-row:last-child { border-bottom: 0; }
.metric-summary { list-style: none; display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(140px, .7fr) minmax(190px, 1fr); align-items: center; gap: 16px; padding: 15px 17px; cursor: pointer; }
.metric-summary::-webkit-details-marker { display: none; }
.metric-summary:hover { background: #f7fafc; }
.metric-label { color: #3d474e; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.metric-label .info-mark { color: #7a8790; margin-left: 5px; font-size: 14px; }
.metric-values { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.metric-value { font-size: 18px; line-height: 1.35; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: #353e44; }
.metric-context { color: #65727b; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.metric-row .favourable { color: var(--green); }.metric-row .unfavourable { color: var(--red); }.metric-row .neutral { color: #4b555d; }
.metric-detail { padding: 0 17px 17px; color: #53616a; font-size: 15px; line-height: 1.65; }
.metric-detail p { margin: 0 0 12px; max-width: 760px; overflow-wrap: anywhere; }
.chart-container { min-height: 130px; border: 1px solid #e2e8ed; border-radius: 4px; padding: 8px; background: #fff; }
.section-chart { margin: 12px 15px 15px; }
.section-chart .chart-container { min-height: 165px; }
.chart-legend { display: flex; gap: 13px; flex-wrap: wrap; color: #5d6972; font-size: 14px; line-height: 1.5; margin: 9px 0 0; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-swatch { width: 14px; height: 2px; background: var(--blue); display: inline-block; }.chart-swatch.region { background: #327b62; }.chart-swatch.world { background: #87919b; }
.chart-tooltip { position: absolute; pointer-events: none; padding: 7px 9px; background: #fff; border: 1px solid #d7dfe6; border-radius: 4px; color: var(--ink); font-size: 13px; }
#profile-dialog .data-note, #comparison-dialog .data-note { color: #5d6972; font-size: 14px; line-height: 1.55; margin: 12px 0 0; overflow-wrap: anywhere; }
#profile-dialog .definition, #comparison-dialog .definition { color: #53616a; font-size: 14px; line-height: 1.6; }
#profile-dialog .error-note, #comparison-dialog .error-note { color: #a94349; font-size: 14px; line-height: 1.5; padding: 14px; border: 1px solid #e4b9bc; border-radius: 4px; overflow-wrap: anywhere; }
.retry-indicator { min-height: 40px; display: inline-flex; align-items: center; border: 1px solid #9dcee7; background: #f1faff; color: #087fbd; padding: 7px 12px; border-radius: 4px; font-size: 14px; }
.comparison-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.compare-picker { border: 1px solid var(--line); border-radius: 4px; padding: 13px; margin: 13px 0; background: #f8fafb; }
.compare-picker label { color: #414b52; font-size: 14px; display: block; margin-bottom: 9px; }
.compare-select-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.comparison-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.comparison-table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 14px; }
.comparison-table th, .comparison-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.comparison-table th:first-child, .comparison-table td:first-child { text-align: left; }
.comparison-table th { position: sticky; top: 0; background: #f2f6f9; color: #343d43; font-size: 15px; }
.comparison-table td { color: #526069; font-size: 14px; }
.comparison-table tr:last-child td { border-bottom: 0; }
.comparison-chart { min-height: 220px; margin-top: 14px; }
.dialog-status { color: #5d6972; font-size: 14px; line-height: 1.5; margin: 10px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.score-methodology { border: 0; border-top: 1px solid #e0e6eb; border-radius: 0; background: transparent; color: #596670; font-size: 12px; line-height: 1.65; margin-top: 10px; }
.score-methodology > summary { cursor: pointer; padding: 10px 0 2px; color: #3e4850; font-weight: 600; }
.score-methodology > summary::marker { color: #087fbd; }
.score-methodology[open] > summary { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.score-methodology > :not(summary) { margin: 9px 0; }
.indicator-methodology { border: 0; border-top: 1px solid #e0e6eb; margin-top: 10px; color: #596670; font-size: 12px; line-height: 1.65; }
.indicator-methodology > summary { cursor: pointer; padding: 10px 0 2px; color: #3e4850; font-weight: 600; }
.indicator-methodology > summary::marker { color: #087fbd; }
.indicator-methodology > p { margin: 8px 0 0; }
.legend-directions { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #64717a; font-size: 12px; }
.ranking-summary { border-left: 3px solid var(--blue); background: #edf8fe; color: #315c73; padding: 9px 11px; font-size: 12px; line-height: 1.5; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(300px, 35%); }
  .globe-column { padding: 19px; }
  .sidebar { padding: 22px 18px; }
  .metric-summary { grid-template-columns: minmax(180px, 1.2fr) minmax(120px, .7fr) minmax(160px, 1fr); gap: 12px; }
}
@media (min-width: 701px) and (max-height: 820px) {
  .sidebar { padding-top: 15px; padding-bottom: 14px; gap: 12px; }
  .sidebar-intro { padding-bottom: 10px; }
  .sidebar-intro p { margin-top: 4px; line-height: 1.45; }
  .control-heading { margin-bottom: 6px; }
  .definition { font-size: 14px; line-height: 1.5; margin-top: 6px; }
  .legend-box { margin-top: 7px; padding-top: 8px; }
  .legend-note { font-size: 12px; line-height: 1.4; margin-top: 5px; }
  .score-methodology, .indicator-methodology { margin-top: 6px; }
  .score-methodology > summary, .indicator-methodology > summary { padding-top: 6px; }
  .hint { margin-top: 5px; }
  .sidebar-footer { padding-top: 9px; }
}
@media (max-width: 700px) {
  .topbar { min-height: 62px; padding: 0 16px; }
  .brand-name { font-size: 16px; }
  .topbar-right { gap: 14px; }
  .home-link { font-size: 12px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; height: auto; }
  .globe-column { padding: 20px 14px 18px; }
  .stage-heading { align-items: flex-start; }
  .stage-heading .country-count { padding-top: 5px; font-size: 10px; }
  .stage-copy { font-size: 13px; max-width: 440px; }
  .globe-frame { height: min(105vw, 520px); min-height: 370px; flex: none; }
  .globe-actions { margin: 0 9px 9px; flex-wrap: wrap; gap: 7px; }
  .button-cluster, .mode-switch { max-width: 100%; }
  .icon-button, .mode-button, .rotation-button { min-height: 44px; height: 44px; }
  .rotation-button { padding: 0 9px; }
  .globe-caption { flex-direction: column; gap: 4px; font-size: 12px; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); padding: 21px 17px 25px; gap: 20px; }
  #profile-dialog, #comparison-dialog { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; border-left: 0; border-right: 0; }
  .dialog-header { padding: 14px; gap: 10px; flex-wrap: wrap; }
  .dialog-header > div:first-child { flex: 1 1 100%; }
  .dialog-actions { width: 100%; justify-content: flex-start; gap: 7px; }
  .dialog-shell { max-height: 100dvh; }
  .dialog-body { padding: 14px 13px 24px; }
  .dialog-header h2 { font-size: 23px; }
  .action-button { min-height: 44px; padding: 8px 11px; font-size: 14px; }
  .metric-summary { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 7px 12px; padding: 13px 12px; }
  .metric-label { grid-column: 1; }
  .metric-values { grid-column: 2; grid-row: 1; }
  .metric-context { grid-column: 1 / -1; grid-row: 2; text-align: left; max-width: none; }
  .section-chart { margin: 11px 10px 13px; }
  .profile-legend { gap: 9px 13px; }
  .comparison-table { min-width: 680px; }
  .compare-select-row { grid-template-columns: 1fr; }
  .comparison-heading { align-items: flex-start; }
}
@media (max-width: 420px) {
  .topbar-right { gap: 10px; }
  .home-link { font-size: 11px; }
  .brand { gap: 6px; }
  .brand img { width: 30px; height: 30px; }
  h1 { font-size: 25px; }
  .stage-heading { display: block; }
  .stage-heading .country-count { padding-top: 7px; }
  .metric-summary { gap: 7px 8px; }
  .metric-value { font-size: 17px; }
  .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 44px; }
  .dialog-actions .close-button { justify-self: end; }
  .dialog-actions .action-button { width: 100%; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
