:root {
  --page: #f4f2ed;
  --surface: #ffffff;
  --surface-soft: #ebe8e1;
  --ink: #17191c;
  --muted: #666b73;
  --line: #d8d5ce;
  --header: #17191c;
  --header-ink: #f8f7f4;
  --primary: #2457d6;
  --primary-soft: #dfe7ff;
  --secondary: #0f8a83;
  --warning: #c87812;
  --danger: #bd4b4b;
  --grid: rgba(23, 25, 28, 0.10);
  --shadow: 0 12px 34px rgba(23, 25, 28, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111315;
    --surface: #1a1d21;
    --surface-soft: #24282e;
    --ink: #f2f1ed;
    --muted: #afb4bc;
    --line: #343941;
    --header: #08090a;
    --header-ink: #f8f7f4;
    --primary: #8aa8ff;
    --primary-soft: #22335f;
    --secondary: #5ac8be;
    --warning: #f0ad4e;
    --danger: #ef8a8a;
    --grid: rgba(242, 241, 237, 0.12);
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  background: var(--header);
  color: var(--header-ink);
}

.header-row {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(18px, 2.3vw, 24px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: rgba(248, 247, 244, 0.62);
  font-size: 13px;
}

.updated {
  margin: 0;
  color: rgba(248, 247, 244, 0.68);
  font-size: 13px;
  text-align: right;
}

.country-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(14px);
}

.country-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding-block: 10px;
}

.country-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.country-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.country-link[aria-current="page"] {
  background: var(--ink);
  color: var(--page);
}

.country-link[data-status="planned"]::after {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.32;
}

main.shell {
  padding-block: 38px 64px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5.8vw, 66px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.range-control {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.range-panel {
  flex: 0 0 auto;
}

.range-status {
  margin: 7px 4px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.range-button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.range-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.range-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--page);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 38px;
}

.kpi-card,
.chart-card,
.empty-state,
.methodology {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 162px;
  padding: 20px;
}

.kpi-label {
  min-height: 42px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  margin: 0;
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}

.kpi-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.delta {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 3.7vw, 36px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.section-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

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

.chart-card {
  min-width: 0;
  padding: 20px;
}

.chart-card--wide {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.chart-period {
  margin: -5px 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.chart-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
}

.chart-latest {
  flex: 0 0 auto;
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  text-align: right;
}

.chart-latest small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.chart-wrap {
  position: relative;
  height: 285px;
}

.chart-card--wide .chart-wrap {
  height: 340px;
}

.chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.source-link {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

summary {
  min-height: 32px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.table-wrap {
  max-height: 320px;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  font-weight: 500;
}

td:last-child,
th:last-child {
  text-align: right;
}

.methodology {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 28px;
  margin-top: 28px;
  padding: 22px;
}

.methodology h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.methodology ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.methodology li + li {
  margin-top: 8px;
}

.empty-state,
.loading-state,
.error-state {
  min-height: 430px;
  padding: clamp(28px, 6vw, 72px);
}

.empty-state {
  display: grid;
  place-content: center;
  text-align: center;
}

.empty-flag {
  display: block;
  margin-bottom: 18px;
  font-size: 52px;
}

.empty-state h1 {
  font-size: clamp(32px, 5vw, 54px);
}

.empty-state p {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--muted);
}

.error-state {
  color: var(--danger);
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-row {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}

.footer-row p {
  margin: 0;
}

@media (max-width: 860px) {
  .country-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    align-items: start;
    flex-direction: column;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-card--wide {
    grid-column: auto;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-heading p {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .header-row {
    min-height: 82px;
  }

  .updated {
    display: none;
  }

  main.shell {
    padding-block: 28px 48px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .range-control {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .range-panel {
    width: 100%;
  }

  .range-button {
    min-height: 44px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 0;
  }

  .chart-card {
    padding: 16px 12px;
  }

  .chart-header {
    padding-inline: 4px;
  }

  .chart-wrap,
  .chart-card--wide .chart-wrap {
    height: 270px;
  }

  .chart-footer {
    align-items: start;
    flex-direction: column;
  }

  .methodology {
    grid-template-columns: 1fr;
  }

  .footer-row {
    align-items: start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
