:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11,11,11,0.10);
  --good: #006300;

  --no: #2a78d6;   /* Norway — fixed identity, blue */
  --us: #eb6834;   /* United States — fixed identity, orange */
  --aqua: #1baf7a;
  --violet: #4a3aa7;

  /* Headline banner: muted flag-color pairs, blended US -> selected country. */
  --flag-us-a: #b6444f;   /* US flag red, softened */
  --flag-us-b: #42447a;   /* US flag blue, softened */
  --flag-no-a: #b8505c;   /* Norway flag red, softened */
  --flag-no-b: #33456e;   /* Norway flag blue, softened */
  /* Default banner colors before JS applies the selected country. */
  --flag-a: var(--flag-no-a);
  --flag-b: var(--flag-no-b);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255,255,255,0.10);
    --good: #0ca30c;
    --no: #3987e5;
    --us: #d95926;
    --aqua: #199e70;
    --violet: #9085e9;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255,255,255,0.10);
  --good: #0ca30c;
  --no: #3987e5;
  --us: #d95926;
  --aqua: #199e70;
  --violet: #9085e9;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

header.site {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 0; background: var(--page); z-index: 10;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; position: relative; }
.brand { font-weight: 700; font-size: 17px; text-decoration: none; }
.brand span.no { color: var(--no); }
.brand span.us { color: var(--us); }

.flag-icon {
  display: inline-flex; vertical-align: -3px; width: 20px; height: 15px;
  border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px var(--border);
}
.stat-tile .flag-icon, .legend .flag-icon, table.data-table .flag-icon { vertical-align: -2px; width: 18px; height: 13px; margin-right: 2px; }

.header-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.country-select {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary);
  border-radius: 6px; padding: 6px 8px; font-size: 13px; cursor: pointer;
}
button.theme-toggle, button.burger, button.share-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
button.burger { font-size: 16px; line-height: 1; }
button.share-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
button.share-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.share-icon { vertical-align: middle; flex-shrink: 0; }

nav.site-nav {
  display: none; flex-direction: column; gap: 2px;
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; min-width: 230px; z-index: 20;
  box-shadow: 0 10px 30px rgba(0,0,0,0.14);
}
nav.site-nav.open { display: flex; }
nav.site-nav a {
  text-decoration: none; color: var(--text-secondary); font-size: 14px;
  padding: 8px 10px; border-radius: 6px;
}
nav.site-nav a:hover { background: var(--page); color: var(--text-primary); }
nav.site-nav a.active { color: var(--text-primary); font-weight: 600; background: var(--page); }

main { padding: 36px 0 64px; }

h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 44px 0 6px; }
.subtitle { color: var(--text-secondary); font-size: 16px; max-width: 720px; line-height: 1.55; margin: 0 0 8px; }
/* Text that sits directly under a section h2/h3 headline reads better centered as a block. */
.lede { color: var(--text-secondary); font-size: 15.5px; max-width: 720px; line-height: 1.6; text-align: center; margin: 0 auto; }
.section-note { color: var(--text-secondary); font-size: 15px; max-width: 720px; line-height: 1.6; margin: 10px auto 20px; text-align: center; }

.legend { display: flex; gap: 18px; align-items: center; margin: 6px 0 18px; flex-wrap: wrap; }
.legend .item { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-secondary); }
.legend .swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend .swatch.no { background: var(--no); }
.legend .swatch.us { background: var(--us); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0 8px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-tile .label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 6px; }
.stat-tile .value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-tile .value.no { color: var(--no); }
.stat-tile .value.us { color: var(--us); }
.stat-tile .sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px 18px; margin: 14px 0 26px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chart-card h3 { font-size: 15px; margin: 0 0 2px; }
.chart-card .chart-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; text-align: center; }

.chart-groups {
  display: flex; align-items: flex-end; justify-content: center; gap: 30px; flex-wrap: wrap;
  padding: 26px 4px 4px; border-bottom: 1px solid var(--grid);
}
.chart-group { display: flex; flex-direction: column; align-items: center; }
.chart-group .bars { display: flex; align-items: flex-end; gap: 7px; height: 150px; }
.chart-group .bar-col {
  width: 36px; border-radius: 5px 5px 2px 2px; position: relative;
  transition: filter .12s ease; cursor: default;
}
.chart-group .bar-col.no { background: var(--no); }
.chart-group .bar-col.us { background: var(--us); }
.chart-group .bar-col:hover { filter: brightness(1.08); }
.chart-group .bar-val {
  position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap;
}
.chart-group .group-label {
  margin-top: 12px; font-size: 12.5px; color: var(--text-secondary);
  text-align: center; max-width: 120px; line-height: 1.35;
}

.tooltip {
  position: fixed; pointer-events: none; background: var(--text-primary); color: var(--page);
  font-size: 12.5px; padding: 6px 9px; border-radius: 6px; opacity: 0; transition: opacity .08s;
  z-index: 50; max-width: 240px; line-height: 1.4;
}
.tooltip.show { opacity: 1; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 20px 0;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; text-decoration: none; color: var(--text-primary); display: block;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.card:hover { border-color: var(--no); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.card .stage { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.card h4 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0 4px; }
table.data-table th, table.data-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--grid); }
table.data-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
table.data-table caption { text-align: left; caption-side: top; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }

details.table-toggle { margin: 4px 0 20px; }
details.table-toggle summary {
  cursor: pointer; font-size: 13px; color: var(--text-secondary); user-select: none;
}

.sources {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); line-height: 1.7;
}
.sources h5 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin: 0 0 8px; }
.caveat {
  background: var(--surface); border: 1px dashed var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--text-secondary); margin: 10px 0 20px;
}

.callout {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--violet);
  border-radius: 8px; padding: 16px 20px; margin: 20px 0;
}
.callout h4 { margin: 0 0 8px; font-size: 14.5px; }
.callout .steps { margin: 10px 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; }
.callout .steps li { padding-left: 18px; position: relative; }
.callout .steps li::before { content: "→"; position: absolute; left: 0; color: var(--violet); }
.callout .result { font-size: 15px; margin-top: 10px; }
.callout .result strong { color: var(--violet); }

.headline-banner {
  background: linear-gradient(120deg, var(--flag-us-a) 0%, var(--flag-us-b) 38%, var(--flag-a) 68%, var(--flag-b) 100%);
  color: #fdfcfa;
  text-align: center; border-radius: 10px; padding: 14px 22px;
  font-size: 16.5px; font-weight: 600; line-height: 1.5; margin: 0 0 28px;
}
.headline-banner strong { font-weight: 800; }

.hero-stat { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-end; margin: 18px 0 6px; }
.hero-stat .big { font-size: 44px; font-weight: 700; line-height: 1; }
.hero-stat .big .unit { font-size: 20px; font-weight: 500; color: var(--text-muted); }
.hero-stat .cap { font-size: 13.5px; color: var(--text-secondary); max-width: 220px; line-height: 1.4; }

footer.site {
  border-top: 1px solid var(--border); padding: 22px 0; margin-top: 40px;
  font-size: 12.5px; color: var(--text-muted);
}
