:root {
  color-scheme: light;
  --paper: #f7faf6;
  --panel: #ffffff;
  --ink: #102a25;
  --muted: #44625a;
  --subtle: #5c7870;
  --rule: #d3e2d9;
  --washed: #eff6ef;
  --mint: #d7f0db;
  --pine: #105544;
  --dark: #103c32;
  --accent: #0c6b50;
  --warn-bg: #fdf3eb;
  --warn-border: #e5c3a6;
  --warn-ink: #7c3810;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --display: "Aptos Display", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --sans: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding-bottom: 76px;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}

a { color: var(--pine); text-underline-offset: .21em; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #197e60;
  outline-offset: 3px;
}

h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); line-height: 1.15; letter-spacing: -.038em; }
h3 { font-size: 1.08rem; line-height: 1.3; letter-spacing: -.015em; }
img { max-width: 100%; height: auto; display: block; }

.frame { width: min(calc(100% - 56px), 1180px); margin-inline: auto; }
.skip { position: absolute; z-index: 40; left: 16px; top: 12px; transform: translateY(-200%); background: #fff; padding: 8px 16px; border: 1px solid var(--dark); border-radius: 6px; }
.skip:focus { transform: none; }
.is-hidden { display: none !important; }

/* Header */
.masthead { position: sticky; top: 0; z-index: 25; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.masthead-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(10px, 2vw, 24px); min-height: 68px; }
.brand { display: inline-flex; gap: 9px; align-items: center; color: var(--ink); text-decoration: none; font-size: 1.08rem; font-weight: 780; letter-spacing: -.042em; white-space: nowrap; }
.brand-tail { color: #47665d; font-weight: 530; }
.brand-logo { width: 30px; height: 30px; border-radius: 7px; flex: 0 0 30px; }

.site-nav { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; column-gap: clamp(8px, 1.25vw, 16px); }
.site-nav a { position: relative; display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); font-size: .84rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--dark); }
.site-nav a[aria-current]::after { content: ""; height: 2px; position: absolute; inset: auto 0 4px; background: #2d8760; }

/* Buttons & Micro-triggers */
.cta-stack { display: flex; flex-direction: column; gap: 8px; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: fit-content;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--dark);
  border-radius: 9px;
  background: var(--dark);
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.action span { color: #cff5af; line-height: 1; }
.action:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.action--outline { background: #fff; color: var(--dark); border-color: #aac9b8; }
.action--outline span { color: var(--pine); }
.action--outline:hover { background: var(--mint); color: var(--dark); border-color: #77af92; }
.masthead .action { min-height: 38px; padding: 7px 13px; font-size: .82rem; white-space: nowrap; }
.text-action { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: .9rem; font-weight: 650; }
.cta-micro { font-size: .78rem; color: var(--subtle); line-height: 1.35; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cta-micro strong { color: var(--pine); font-weight: 650; }

/* Hero */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(0, .76fr);
  gap: clamp(24px, 4.5vw, 64px);
  align-items: center;
  padding: clamp(28px, 4.5vw, 56px) 0 clamp(22px, 3vw, 40px);
}
.edition {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 11px;
  color: var(--pine);
  font: 700 .72rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.edition span { background: var(--mint); padding: 4px 8px; border-radius: 5px; }
.edition time { color: var(--muted); }

.feature h1, .missing h1 {
  margin: 12px 0 14px;
  font-size: clamp(2.25rem, 4.9vw, 4.15rem);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.feature h1 em { color: var(--pine); font-style: normal; }
.answer {
  max-width: 38rem;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: clamp(.98rem, 1.45vw, 1.12rem);
  line-height: 1.5;
}

/* Quick Fact Pills */
.quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.quick-pills li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #c5ddd0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.2;
}
.quick-pills li.pill-live {
  background: #e5f5e7;
  border-color: #9ed0ae;
  color: #134e38;
}
.quick-pills li.pill-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #1d9a5c;
}
.quick-pills li.pill-alert {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

/* Snapshot Aside */
.snapshot {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(18px, 2.8vw, 30px);
  border: 1px solid #c5dccf;
  border-radius: 16px;
  background: linear-gradient(140deg, #fff 20%, #edf7ed);
  box-shadow: 0 14px 36px -28px #24745975;
}
.snapshot-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font: 600 .71rem/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.signal { display: inline-flex; gap: 6px; align-items: center; background: #e3f4e3; color: #1d573a; padding: 4px 8px; border: 1px solid #c8e5cd; border-radius: 999px; font: 650 .69rem/1.25 var(--sans); letter-spacing: 0; text-transform: none; }
.signal::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: #208c54; }
.signal--warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.signal--warn::before { background: #c55b1e; }
.snapshot h2 { margin: 14px 0 4px; font-size: clamp(1.25rem, 2.1vw, 1.7rem); }
.snapshot-value { margin: 12px 0 4px; font: 760 clamp(1.75rem, 3.6vw, 2.9rem)/1.05 var(--display); letter-spacing: -.05em; color: var(--dark); }
.snapshot-note { font-size: .88rem; color: var(--muted); line-height: 1.45; }

.share-bars { display: grid; gap: 8px; list-style: none; padding: 0; margin: 14px 0 6px; }
.share-line { display: grid; grid-template-columns: 2.5ch 1fr 4ch; align-items: center; gap: 10px; font: 650 .79rem/1.4 var(--mono); }
.share-line b { text-align: right; color: var(--dark); }
.share-track { height: 8px; background: #dfeee1; border-radius: 10px; overflow: hidden; }
.share-track i { display: block; height: 100%; background: #3e8762; border-radius: 10px; }
.share-line--1 i { width: 100%; background: #135943; }
.share-line--2 i { width: 20%; }
.share-line--3 i { width: 10%; }

/* Fact Band */
.fact-band { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0 0 32px; overflow: hidden; border: 1px solid var(--rule); border-radius: 13px; background: var(--washed); }
.fact-band > div { padding: 12px clamp(10px, 1.8vw, 22px); }
.fact-band > div + div { border-left: 1px solid var(--rule); }
.fact-band dt { color: var(--muted); font: 650 .66rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.fact-band dd { margin-top: 3px; font-size: clamp(.86rem, 1.35vw, 1.02rem); font-weight: 720; line-height: 1.25; color: var(--ink); }

/* Content Flow */
.guide-flow { display: grid; gap: 36px; margin-block: 32px; }
.guide-block { min-width: 0; }
.guide-block h2 { margin-bottom: 12px; }
.guide-block p:not(.reference-line):not(.cta-micro) { max-width: 82ch; margin-block: 8px 12px; color: var(--muted); }
.guide-block > .cta-stack, .guide-block > .action-row { margin-top: 16px; }

.reference-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: .78rem; color: var(--subtle); }
.reference-line a { display: inline-flex; gap: 4px; align-items: baseline; min-height: 24px; font-weight: 600; color: var(--subtle); text-decoration-thickness: 1px; }
.reference-line a:hover { color: var(--dark); }

/* Related / Hub Cards */
.reading-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.reading-tile {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 138px;
  padding: 16px 32px 15px 16px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 11px;
  color: var(--ink);
  text-decoration: none;
  transition: background .14s ease, border-color .14s ease;
}
.reading-tile:hover { background: #eff8ee; border-color: #8eb49f; }
.tile-tag { color: var(--pine); font: 700 .66rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.tile-title { margin: 5px 0 4px; font: 720 1.08rem/1.25 var(--display); letter-spacing: -.018em; }
.tile-copy { color: var(--muted); font-size: .84rem; line-height: 1.42; }
.tile-arrow { position: absolute; top: 14px; right: 14px; color: var(--pine); font-weight: 700; }

/* Tables */
.matrix-scroll { max-width: 100%; overflow-x: auto; margin: 14px 0 12px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; line-height: 1.45; }
caption { padding: 10px 14px; background: #e7f2e7; color: var(--pine); text-align: left; font: 650 .71rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .055em; }
th, td { padding: 10px 14px; border-top: 1px solid var(--rule); vertical-align: top; }
thead th { background: #f3f8f2; font-weight: 700; color: var(--ink); }
tbody th { font-weight: 650; color: var(--ink); }
tbody td { color: var(--muted); }
tbody tr:nth-child(even) { background: #fafcf9; }

/* Steps */
.steps { display: grid; gap: 10px; counter-reset: stepnum; list-style: none; margin-block: 14px; padding: 0; }
.steps li { counter-increment: stepnum; display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 11px; background: #fff; }
.steps li::before { content: counter(stepnum); flex: 0 0 28px; align-self: flex-start; padding: 4px 0; border-radius: 6px; background: var(--mint); color: var(--pine); text-align: center; font: 700 .8rem/1.4 var(--mono); }
.steps li p:not(.reference-line) { margin: 4px 0 0; }
.plain-steps { padding-left: 22px; color: var(--muted); margin: 10px 0 14px; }
.plain-steps li + li { margin-top: 6px; }

/* Interactive Calculator Cards */
.calc-card {
  margin: 14px 0;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid #bfd7ca;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px -24px rgba(16, 60, 50, .35);
}
.calc-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.calc-badge { font: 700 .68rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; background: var(--mint); color: var(--pine); padding: 3px 8px; border-radius: 5px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.calc-field { display: flex; flex-direction: column; gap: 5px; }
.calc-field label { font-size: .78rem; font-weight: 650; color: var(--ink); }
.calc-field input, .calc-field select {
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #b9d2c4;
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  font: 600 .92rem/1.3 var(--sans);
}
.calc-check { display: flex; align-items: center; gap: 8px; min-height: 42px; font-size: .85rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.calc-check input { width: 17px; height: 17px; accent-color: var(--dark); min-height: auto; }
.calc-out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 13px;
  border-radius: 10px;
  background: var(--washed);
  border: 1px solid var(--rule);
  margin-bottom: 14px;
}
.calc-kpi span { display: block; font: 600 .67rem/1.35 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.calc-kpi strong { display: block; margin-top: 3px; font: 760 1.2rem/1.2 var(--display); color: var(--dark); }
.calc-kpi strong.is-good { color: #0e6b46; }
.calc-kpi strong.is-warn { color: var(--warn-ink); }
.calc-note { font-size: .82rem; color: var(--muted); margin: 0 0 14px; }

/* Geo / Country Live Checker */
.geo-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.geo-search-input {
  flex: 1 1 260px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #aac9b8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: 500 .94rem/1.3 var(--sans);
}
.geo-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.geo-tab {
  min-height: 38px;
  padding: 6px 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: 650 .8rem/1.2 var(--sans);
  cursor: pointer;
}
.geo-tab.is-active { background: var(--dark); border-color: var(--dark); color: #fff; }
.geo-banner {
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  margin-bottom: 14px;
}
.geo-banner--open { border-color: #a9d5b8; background: #e8f6ea; }
.geo-banner h3 { margin-bottom: 5px; color: var(--ink); }
.geo-banner p { margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.geo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 9px; }
.geo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: #fff;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.geo-item:hover { border-color: #88b19c; background: #f4faf4; }
.geo-status { font: 700 .67rem/1.2 var(--mono); text-transform: uppercase; padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.geo-status--blocked { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); }
.geo-status--open { background: #e3f4e3; color: #165537; border: 1px solid #bedfc6; }

/* Branded SVG Infographics */
.infographic-card {
  margin: 14px 0 8px;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
}
.infographic-card img { width: 100%; height: auto; border-radius: 8px; }
.infographic-card figcaption { margin-top: 9px; font-size: .8rem; color: var(--subtle); }

/* FAQ Accordion */
.faq-list { display: grid; gap: 9px; margin-top: 12px; }
.faq-item { border: 1px solid var(--rule); border-radius: 11px; background: #fff; padding: 0 16px; }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 26px 14px 0;
  font-weight: 700;
  font-size: .96rem;
  color: var(--ink);
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 2px; top: 12px; font: 700 1.15rem/1 var(--mono); color: var(--pine); }
.faq-item[open] summary::after { content: "-"; }
.faq-item p { padding: 0 0 14px; margin: 0; font-size: .92rem; color: var(--muted); max-width: 78ch; }

/* Closing CTA */
.closing { margin: 36px 0 28px; padding: clamp(20px, 3.8vw, 34px); border-radius: 15px; background: var(--dark); color: #fff; }
.closing p { margin: 8px 0 16px; color: #d2e9db; }
.closing .cta-micro { color: #b7d7c5; }
.closing .cta-micro strong { color: #d9f4c4; }
.closing .action { border-color: #d9f4c4; background: #d9f4c4; color: var(--dark); }
.closing .action:hover { background: #fff; border-color: #fff; color: var(--dark); }
.closing .action span { color: var(--pine); }
.closing .action--outline { border-color: #a4cbb8; background: var(--dark); color: #fff; }
.closing .action--outline span { color: #cfeacb; }
.closing .action--outline:hover { background: #0c5844; }
.closing a:focus-visible { outline-color: #fff; }

/* Footer */
.endmatter { padding: 24px 0 20px; border-top: 1px solid var(--rule); background: #eff6ef; }
.endmatter-grid { display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; align-items: center; }
.endmatter nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.endmatter nav a { min-height: 24px; font-size: .82rem; font-weight: 600; text-decoration: none; }
.endmatter nav a:hover { text-decoration: underline; }
.endmatter-date { color: var(--muted); font-size: .79rem; white-space: nowrap; }
.endmatter-legal {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #d7e5dc;
  font-size: 11.5px;
  line-height: 1.4;
  color: #5b776e;
}

/* Sticky Bottom CTA Bar */
.sticky-bar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16, 60, 50, .97);
  border-top: 1px solid #2b6e59;
  color: #fff;
  transform: translateY(110%);
  transition: transform .22s ease;
  box-shadow: 0 -8px 24px rgba(10, 35, 28, .22);
}
.sticky-bar.is-visible { transform: translateY(0); }
.sticky-inner {
  width: min(calc(100% - 32px), 1180px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 10px 0;
}
.sticky-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sticky-title { font: 700 .9rem/1.25 var(--display); color: #fff; }
.sticky-sub { font-size: .75rem; color: #c4e3d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-bar .action {
  min-height: 40px;
  padding: 8px 16px;
  border-color: #d9f4c4;
  background: #d9f4c4;
  color: var(--dark);
  font-size: .85rem;
  white-space: nowrap;
}
.sticky-bar .action span { color: var(--pine); }
.sticky-bar .action:hover { background: #fff; border-color: #fff; color: var(--dark); }

.missing { padding-block: 60px; }
.missing p:not(.edition) { margin-bottom: 16px; }

@media (max-width: 980px) {
  .frame { width: min(calc(100% - 40px), 1180px); }
  .masthead-row { grid-template-columns: 1fr auto; gap: 4px 14px; padding-block: 8px; }
  .masthead-row > .action { grid-column: 2; grid-row: 1; }
  .site-nav { grid-column: 1 / -1; justify-content: flex-start; column-gap: 14px; }
  .endmatter-grid { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 680px) {
  .frame { width: calc(100% - 28px); }
  .site-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 6px; }
  .site-nav a { min-height: 32px; font-size: .76rem; }
  .feature { grid-template-columns: 1fr; gap: 16px; padding-top: 22px; padding-bottom: 16px; }
  .feature h1 { font-size: clamp(1.95rem, 8.2vw, 2.55rem); }
  .fact-band { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
  .fact-band > div { padding-block: 9px; }
  .fact-band > div:nth-child(odd) { border-left: 0; }
  .fact-band > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .matrix-scroll > table { min-width: 440px; }
  th, td { padding: 9px 10px; font-size: .86rem; }
  .sticky-sub { display: none; }
  .sticky-inner { gap: 10px; }
  .sticky-title { font-size: .83rem; }
  .sticky-bar .action { padding: 8px 12px; font-size: .8rem; }
}

/* Data citation & table embed copy button */
.cite-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid #bcd4c7;
  border-radius: 6px;
  background: #fff;
  color: var(--pine);
  font: 650 .74rem/1.4 var(--sans);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.cite-btn:hover { background: var(--mint); border-color: #7fb297; color: var(--dark); }
.cite-btn.is-copied { background: var(--dark); border-color: var(--dark); color: #d9f4c4; }
