/* ESG Country Panel -- shared styles for report + dashboard */

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

  --series-1: #2a78d6; /* blue */
  --series-2: #eb6834; /* orange */
  --series-3: #1baf7a; /* aqua */
  --series-4: #eda100; /* yellow */
  --series-5: #e87ba4; /* magenta */
  --series-6: #008300; /* green */
  --series-7: #4a3aa7; /* violet */
  --series-8: #e34948; /* red */

  --seq-100: #cde2fb; --seq-250: #86b6ef; --seq-400: #3987e5; --seq-500: #256abf; --seq-650: #104281;

  --accent: var(--series-1);
  --radius: 10px;

  --font-body: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-chart: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "EB Garamond", Garamond, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --gridline: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255,255,255,0.10);
    --success-text: #0ca30c;

    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
  }
}

/* Manual dark override -- must work regardless of OS setting */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --gridline: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255,255,255,0.10);
  --success-text: #0ca30c;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

html { background: var(--page); }
body { line-height: 1.55; background: transparent; overflow-x: clip; /* full-bleed dividers use 100vw */ }
button, select, input { font-family: inherit; }

/* Site-wide backdrop: a fixed dot grid plus green and blue glows. js/effects.js
   sets --scroll (0 at the top of the page, 1 at the bottom) and the glow
   strengths, so the hues shift and drift as the reader scrolls. */
:root { --scroll: 0; --glow-green: 1; --glow-blue: 0.6; }
html::before, html::after, body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
html::before {
  background: radial-gradient(ellipse 55% 60% at 6% calc(4% + var(--scroll) * 70%),
    color-mix(in srgb, var(--series-3) 20%, transparent), transparent 70%);
  opacity: var(--glow-green);
}
html::after {
  background: radial-gradient(ellipse 55% 65% at 96% calc(12% + var(--scroll) * 55%),
    color-mix(in srgb, var(--series-1) 20%, transparent), transparent 70%);
  opacity: var(--glow-blue);
}
body::before {
  background-image: radial-gradient(color-mix(in srgb, var(--text-primary) 11%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

a { color: var(--accent); }

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

/* Nav */
nav.site-nav {
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 10;
}
nav.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
nav.site-nav .brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 20px;
}
nav.site-nav .links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-left: 20px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
nav.site-nav .links a:hover { color: var(--text-primary); }
nav.site-nav .links a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Header */
header.page-header {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
}
header.page-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 820px;
  margin: 0 0 10px;
}
header.page-header .byline {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 18px;
}
header.page-header .summary {
  font-size: 17.5px;
  color: var(--text-primary);
  max-width: 760px;
}

/* Stat tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 28px 0 8px;
}
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-tile {
  background: color-mix(in srgb, var(--surface-1) 85%, transparent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-tile .value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums proportional-nums;
}
.stat-tile .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Sections */
main { padding-bottom: 64px; }
section.finding {
  position: relative;
  padding: 44px 0;
}
/* Full-width dividers: one style everywhere, spanning the whole window.
   Sections draw theirs with ::after; the dashboard uses <hr class="rule">. */
section.finding::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  height: 1px;
  background: var(--border);
}
hr.rule {
  border: 0;
  height: 1px;
  background: var(--border);
  width: 100vw;
  margin: 36px 0 36px calc(50% - 50vw);
}
.charts-grid > hr.rule { margin-top: 14px; margin-bottom: 14px; }
section.finding h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
section.finding .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.tag-environmental { background: color-mix(in srgb, var(--series-3) 16%, transparent); color: var(--series-3); }
.tag-social { background: color-mix(in srgb, var(--series-5) 16%, transparent); color: var(--series-5); }
.tag-governance { background: color-mix(in srgb, var(--series-7) 18%, transparent); color: var(--series-7); }

section.finding p {
  color: var(--text-primary);
  max-width: 720px;
  font-size: 16px;
}
section.finding p.figure-note {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 10px;
}

.chart-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 10px;
  margin-top: 18px;
  max-width: 760px;
}
.chart-card .chart-holder { position: relative; height: 280px; }
.chart-holder canvas { display: block; max-width: 100%; }

/* Closing / methodology */
section.methodology {
  padding: 44px 0 64px;
}
section.methodology h2 { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin-bottom: 12px; }
section.methodology p, section.methodology li { color: var(--text-secondary); font-size: 15px; }
section.methodology ul { padding-left: 20px; }

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

/* Dashboard */
.dashboard-toolbar {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0;
}
.toolbar-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
button.btn {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  cursor: pointer;
}
button.btn:hover { border-color: var(--accent); color: var(--accent); }

.switch-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.switch-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.switch-group button {
  border: none;
  background: var(--surface-1);
  color: var(--text-secondary);
  padding: 5px 10px;
  font-size: 12.5px;
  cursor: pointer;
}
.switch-group button.active {
  background: var(--accent);
  color: #fff;
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
}
.charts-grid .chart-card {
  max-width: none;
  min-width: 0; /* let Chart.js canvases shrink instead of overflowing */
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 22px;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--gridline);
  font-variant-numeric: tabular-nums;
}
table.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0; /* relative to .table-wrap's scroll box, not the page */
  z-index: 1;
  background: var(--surface-1);
}
.table-wrap {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.result-count {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 8px 0 4px;
}
.loading-note {
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
  text-align: center;
}

.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}
.chart-card-head h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
button.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
}

/* Section contents (report page): findings grouped by pillar, in columns */
.section-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}
@media (max-width: 820px) { .section-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .section-nav { grid-template-columns: minmax(0, 1fr); } }
.nav-group {
  --pillar: var(--text-muted);
  background: color-mix(in srgb, var(--surface-1) 85%, transparent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-top: 3px solid var(--pillar);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
}
.nav-group.env { --pillar: var(--series-3); }
.nav-group.soc { --pillar: var(--series-5); }
.nav-group.gov { --pillar: var(--series-7); }
.nav-group.cmp { --pillar: var(--series-1); }
.nav-group h3 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pillar);
}
.nav-group a {
  display: block;
  padding: 5px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color .2s;
}
.nav-group a::before { content: "→ "; color: var(--pillar); }
.nav-group a:hover { background: color-mix(in srgb, var(--pillar) 12%, transparent); }

section.finding, section.methodology { scroll-margin-top: 72px; }
html { scroll-behavior: smooth; }

/* Reveal on scroll (classes added by js/effects.js) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 480px) {
  nav.site-nav .brand { font-size: 17px; white-space: nowrap; }
  nav.site-nav .links { white-space: nowrap; }
  nav.site-nav .links a { margin-left: 12px; }
  nav.site-nav #theme-toggle { margin-left: 12px !important; padding: 6px 9px; font-size: 12.5px; }
}
@media (max-width: 400px) {
  nav.site-nav .tt-label { display: none; }
}
@media (max-width: 350px) {
  nav.site-nav .brand { font-size: 15px; }
  nav.site-nav .links a { margin-left: 8px; font-size: 13px; }
  nav.site-nav #theme-toggle { margin-left: 8px !important; padding: 5px 7px; }
}

@media (max-width: 720px) {
  header.page-header h1 { font-size: 32px; }
  section.finding h2 { font-size: 24px; }
}

/* ---- Headline numbers (report header + dashboard summary) ------------------------------------------ */
.stat-tile { text-align: center; padding: 20px 14px 18px; }
.stat-tile .value {
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 700;
  white-space: nowrap;
  text-shadow:
    0 1px 0 color-mix(in srgb, var(--surface-1) 80%, transparent),
    0 3px 6px color-mix(in srgb, var(--series-1) 22%, transparent),
    0 8px 22px color-mix(in srgb, var(--series-3) 30%, transparent);
}
.stat-tile .label { margin-top: 6px; }

/* ---- Report: chart cards open as they scroll into view ----------------- */
section.finding { --pillar: var(--accent); }
section.finding:has(.tag-environmental) { --pillar: var(--series-3); }
section.finding:has(.tag-social)        { --pillar: var(--series-5); }
section.finding:has(.tag-governance)    { --pillar: var(--series-7); }
#s-composite                            { --pillar: var(--series-1); }

.chart-card.card-closed { opacity: 0; transform: translateY(26px) scale(0.96); }
.chart-card.card-open { animation: card-open 1.2s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes card-open {
  0%   { opacity: 0; transform: translateY(26px) scale(0.96); box-shadow: 0 0 0 0 transparent; }
  40%  { opacity: 1; transform: none; border-color: var(--pillar);
         box-shadow: 0 0 0 3px color-mix(in srgb, var(--pillar) 40%, transparent),
                     0 14px 44px color-mix(in srgb, var(--pillar) 30%, transparent); }
  100% { opacity: 1; transform: none; border-color: var(--border); box-shadow: 0 0 0 0 transparent; }
}

/* ---- Report: notes under the emissions chart, linked to its bars ------- */
ul.bar-notes {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  max-width: 760px;
  display: grid;
  gap: 4px;
}
ul.bar-notes li {
  font-size: 15px;
  color: var(--text-muted);
  padding: 7px 12px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  cursor: default;
  transition: color .2s, border-color .2s, background-color .2s;
}
ul.bar-notes li:nth-child(1) { --bar: var(--series-1); }
ul.bar-notes li:nth-child(2) { --bar: var(--series-2); }
ul.bar-notes li:nth-child(3) { --bar: var(--series-3); }
ul.bar-notes li:nth-child(4) { --bar: var(--series-4); }
ul.bar-notes li.is-active, ul.bar-notes li:focus-visible {
  color: var(--text-primary);
  border-left-color: var(--bar);
  background: color-mix(in srgb, var(--bar) 9%, transparent);
  outline: none;
}

/* ---- Report: top 10 / bottom 10 side by side -------------------------- */
.chart-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.chart-pair .chart-card { margin-top: 0; max-width: none; min-width: 0; }
.charts-grid > .chart-pair { margin-top: 0; }
@media (max-width: 760px) { .chart-pair { grid-template-columns: minmax(0, 1fr); } }
.pair-title.top    { color: var(--series-1); }
.pair-title.bottom { color: var(--series-8); }
.pair-title span { font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .chart-card.card-closed { opacity: 1; transform: none; }
  .chart-card.card-open { animation: none; }
}

/* ---- Dashboard filters (no dropdowns) ---------------------------------- */
.filter-block { margin-bottom: 16px; min-width: 0; }
.filter-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.filter-label small { font-size: 11.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.filter-label .readout { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.filter-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}
@media (max-width: 720px) { .filter-split { grid-template-columns: minmax(0, 1fr); gap: 0; } }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  --chip: var(--accent);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--chip); color: var(--text-primary); }
.chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chip) 14%, var(--surface-1));
  border-color: var(--chip);
  color: var(--text-primary);
  font-weight: 600;
}
.chip:focus-visible { outline: 2px solid var(--chip); outline-offset: 2px; }
.chip-removable::after { content: "×"; margin-left: 6px; font-weight: 400; color: var(--text-muted); }

/* Indicator: pillar tabs + chips */
.pillar-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; flex-wrap: wrap; }
.pillar-tab {
  --pillar: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 12px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}
.pillar-tab.env { --pillar: var(--series-3); }
.pillar-tab.soc { --pillar: var(--series-5); }
.pillar-tab.gov { --pillar: var(--series-7); }
.pillar-tab .count { font-weight: 400; font-size: 12px; color: var(--text-muted); margin-left: 2px; }
.pillar-tab:hover { color: var(--text-primary); }
.pillar-tab[aria-selected="true"] { color: var(--pillar); border-bottom-color: var(--pillar); }
.pillar-tab.has-selection::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pillar);
}
.indicator-chips.env .chip { --chip: var(--series-3); }
.indicator-chips.soc .chip { --chip: var(--series-5); }
.indicator-chips.gov .chip { --chip: var(--series-7); }

/* Year range: two range inputs stacked on one track */
.range-slider { position: relative; height: 28px; }
.range-track {
  position: absolute;
  left: 0; right: 0; top: 12px;
  height: 4px;
  border-radius: 2px;
  background: var(--gridline);
}
.range-fill { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.range-slider input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none; /* only the thumbs take input */
  -webkit-appearance: none;
          appearance: none;
}
.range-slider input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; }
.range-slider input[type="range"]::-moz-range-track { background: none; border: 0; }
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 20px; height: 20px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  cursor: grab;
}
.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  cursor: grab;
}
.range-slider input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Country type-ahead */
.typeahead {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--page);
}
.typeahead:focus-within { border-color: var(--accent); }
.typeahead #country-chips:empty { display: none; }
.typeahead input {
  flex: 1 1 160px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  padding: 5px 4px;
}
#country-suggest {
  position: absolute;
  left: -1px; right: -1px;
  top: calc(100% + 4px);
  z-index: 20;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
#country-suggest li { padding: 7px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; color: var(--text-primary); }
#country-suggest li[aria-selected="true"], #country-suggest li[data-iso]:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#country-suggest li.empty { color: var(--text-muted); cursor: default; }
.chip { text-align: left; }
@media (max-width: 480px) {
  .pillar-tabs { flex-wrap: nowrap; gap: 0; }
  .pillar-tab { font-size: 13.5px; padding: 7px 9px 8px; }
  .pillar-tab .count { display: none; }
}

/* Dashboard chart cards glow in the selected indicator's pillar color */
main[data-pillar="Environmental"] { --pillar: var(--series-3); }
main[data-pillar="Social"]        { --pillar: var(--series-5); }
main[data-pillar="Governance"]    { --pillar: var(--series-7); }

/* Light mode: the pale page washes the glows out, so push them harder */
:root[data-theme="light"]::before {
  background: radial-gradient(ellipse 60% 65% at 6% calc(4% + var(--scroll) * 70%),
    color-mix(in srgb, var(--series-3) 42%, transparent), transparent 72%);
}
:root[data-theme="light"]::after {
  background: radial-gradient(ellipse 55% 65% at 96% calc(12% + var(--scroll) * 55%),
    color-mix(in srgb, var(--series-1) 28%, transparent), transparent 70%);
}

/* Theme toggle icon (inline SVG replaces the old emoji) */
#theme-toggle { display: inline-flex; align-items: center; gap: 6px; }
#theme-toggle .tt-icon { flex: none; }

/* Load problems and no-JavaScript notes */
.load-error, .noscript-note {
  margin: 20px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--series-2);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 14px;
}
.load-error[hidden] { display: none; }

/* Dashboard while a newly picked indicator is downloading */
main.is-loading .charts-grid,
main.is-loading .stat-grid,
main.is-loading .table-wrap { opacity: 0.55; transition: opacity 0.15s; }
