/* Shared visual system. Scientific chart colours and data remain unchanged. */
:root {
  --ink: #142f40;
  --muted: #526773;
  --teal: #087c80;
  --line: #dce5e9;
  --wash: #f3f7f8;
  --bs-body-color: var(--ink);
  --bs-link-color: #086e76;
  --bs-link-hover-color: #114855;
}
body { font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.7; color: var(--ink); background: #fff; }
.base-container { min-height: 100vh; height: auto; }
.base-content { padding-bottom: 3rem; min-width: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 1.5rem; }
h4 { font-size: 1.4rem; margin-bottom: 1rem; }
p { margin-bottom: 1.3rem; }
a { text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid #b78524; outline-offset: 4px; }
.base-header { border-top: 5px solid var(--teal); border-bottom: 1px solid var(--line); box-shadow: none !important; }
.site-nav { padding: 1.25rem 0; background: #fff; }
.site-nav > .container-fluid { max-width: 1600px; padding-inline: 2rem; }
.site-nav .navbar-nav { width: 100%; align-items: center; gap: 1.75rem; }
.site-nav .nav-item:first-child { margin-right: auto; max-width: 480px; }
.site-nav .nav-link { color: var(--muted); font-size: .95rem; font-weight: 600; padding: .65rem 0; border-bottom: 2px solid transparent; }
.site-nav .nav-item:first-child .nav-link { color: var(--ink); font-size: 1.15rem; line-height: 1.35; letter-spacing: -.025em; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--teal); border-color: var(--teal); }
.navbar-toggler { border-color: var(--line); padding: .6rem; }
.register-heading { padding: clamp(2.5rem, 5vw, 5rem) max(1.5rem, calc((100vw - 1320px) / 2)); background: var(--ink); border-bottom: 5px solid #56b6b1; }
.register-heading h1 { max-width: 950px; margin: 0; color: #fff; font-size: clamp(2rem, 4vw, 3.65rem); font-weight: 600; }
.chart-panel { margin: 2.5rem 1.5rem 1rem; padding: 1.5rem 1rem; max-width: calc(100% - 3rem); overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 8px 28px #142f4007; }
.figure-caption { color: var(--muted); font-size: .875rem; line-height: 1.6; padding: .75rem 1.5rem; }
.base-content > hr { max-width: 1320px; margin: 3rem auto; border-color: var(--line); opacity: 1; }
.report-panel { margin: 3rem auto; max-width: 1320px; padding: 2rem 2.5rem; background: var(--wash); border-left: 4px solid var(--teal); }
.report-panel > .mt-5 { margin: 0 !important; }
.report-panel h4 { font-size: 1.75rem; }
.report-panel ol { margin: 1.5rem 0 0; padding-left: 1.3rem; }
.report-panel li { padding: .4rem 0 .4rem .5rem; }
.team-icon { color: #086e76; overflow-wrap: anywhere; }
.team-icon:hover { color: var(--ink); }
.register-table-section { margin: 2.5rem 1.5rem; }
.register-table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.register-table-scroll > div:first-child { z-index: 2; }
.register-table-scroll table { border-collapse: collapse; font-size: .85rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.table-header { background: var(--ink); color: #fff; }
.table1 th { padding: 1rem .75rem; font-weight: 600; }
.table1-meta-cell, .table1-number-cell { padding: .65rem .75rem; border-bottom-color: var(--line); }
.table-row-country-name { background: #e3edf0; color: var(--ink); }
.table-row-national-total { background: #e7f2ed; color: #205344; }
.table-row-total-other { background: #1b596b; }
.table-row-total-disclose { background: #175e52; }
.table-row-record-tr:nth-child(even) { background: #f7f9fa; }
.table-row-record-tr:hover { background: #edf5f5; }
.footnote { margin-top: 1.5rem; background: var(--wash); border: 1px solid var(--line); padding: 1.5rem; border-radius: 4px; font-size: .9rem; }
.base-content > .container { padding-top: 1rem; padding-bottom: 1rem; }
.base-content > .container:first-child { padding-top: 3rem; }
.base-content > .container-fluid { padding-block: 2rem; }
.list-item { padding: 1.75rem 1.25rem; border-radius: 4px; }
.list-item:hover { background: #eaf1f3; }
.team-avatar { border: 1px solid var(--line); margin-bottom: 1rem; }
hr { border-color: var(--line); }
#yearSelect { padding: .65rem .8rem; background: var(--wash); color: var(--ink); border-radius: 4px; font: inherit; font-weight: 600; }
.footer { background: var(--ink); border-top: 4px solid var(--teal); color: #dbe7eb; text-align: left; padding: 2.25rem max(1.5rem, calc((100vw - 1320px) / 2)); font-size: .85rem; }
@media (max-width: 991.98px) {
  .site-nav > .container-fluid { padding-inline: 1.5rem; }
  .site-nav .navbar-nav { align-items: stretch; gap: .35rem; padding-top: 1rem; }
  .site-nav .nav-item:first-child { max-width: none; margin: 0; }
  .report-panel { margin-inline: 1.5rem; padding: 1.5rem; }
}
@media (max-width: 575.98px) {
  body { font-size: 15px; }
  .chart-panel { margin-inline: .75rem; max-width: calc(100% - 1.5rem); padding: .75rem; }
  .register-table-section { margin-inline: .75rem; }
  .report-panel { margin-inline: .75rem; }
  .base-content > .container-fluid { padding-inline: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Country disclosures keep chart legends compact without filtering data. */
#legend, #figure_2_legend { width: 300px; padding-inline: .75rem; }
#legend .legend-grp, #figure_2_legend .figure_2_legend-grp {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: .35rem;
  overflow: hidden;
  background: #fff;
}
#legend .legend-country-toggle, #figure_2_legend .legend-country-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .6rem;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
#legend .legend-country-toggle::-webkit-details-marker,
#figure_2_legend .legend-country-toggle::-webkit-details-marker { display: none; }
.legend-country-swatch {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--country-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.legend-country-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.legend-country-count {
  flex: 0 0 auto;
  color: var(--muted, #6b7280);
  font-size: .68rem;
  font-weight: 500;
}
.legend-country-chevron {
  flex: 0 0 auto;
  width: .45em;
  height: .45em;
  margin-right: .1em;
  border-right: 2px solid var(--muted, #9ca3af);
  border-bottom: 2px solid var(--muted, #9ca3af);
  transform: rotate(45deg);
  transition: transform .15s ease;
}
#legend .legend-grp[open] .legend-country-chevron,
#figure_2_legend .figure_2_legend-grp[open] .legend-country-chevron { transform: rotate(225deg); }
#legend .legend-country-toggle:hover, #figure_2_legend .legend-country-toggle:hover,
#legend .legend-grp[open] > summary, #figure_2_legend .figure_2_legend-grp[open] > summary { background: var(--wash); }
#legend .legend-grp-content, #figure_2_legend .figure_2_legend-grp-content {
  padding: .4rem .5rem .6rem;
  border-top: 1px solid var(--line);
}
#legend .legend-grp-header, #figure_2_legend .figure_2_legend-grp-header {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  margin-bottom: .45rem;
  padding: .3rem .6rem;
  font: inherit;
  font-size: .68rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
  cursor: pointer;
  opacity: .92;
}
#legend .legend-grp-header:hover, #figure_2_legend .figure_2_legend-grp-header:hover { opacity: 1; }
#legend .legend-btn, #figure_2_legend .figure_2_legend-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .22rem .3rem;
  border-radius: 4px;
  font-size: .72rem;
  cursor: pointer;
}
#legend .legend-btn:hover, #figure_2_legend .figure_2_legend-btn:hover { background: var(--wash); }
#legend .legend-color, #figure_2_legend .figure_2_legend-color {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
#legend .legend-text, #figure_2_legend .figure_2_legend-text { min-width: 0; overflow-wrap: anywhere; }

/* A single fixed-layout table keeps pinned headings and body cells aligned. */
.register-table-scroll { --meta-width: clamp(100px, 20vw, 300px); max-height: 65vh; }
.register-table-scroll .register-data-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: calc(3 * var(--meta-width) + 2400px);
}
.register-meta-column { width: var(--meta-width); }
.register-year-column { width: 80px; }
.register-data-table .table1-meta-cell { min-width: 0; max-width: none; overflow-wrap: anywhere; }
.register-data-table tr { background: #fff; }
.register-data-table thead tr { background: var(--ink); }
.register-data-table .table-row-country-name { background: #e3edf0; }
.register-data-table .table-row-national-total { background: #e7f2ed; }
.register-data-table .table-row-total-disclose { background: #175e52; }
.register-data-table .table-row-total-other { background: #1b596b; }
.register-data-table [data-n="0"],
.register-data-table [data-n="1"],
.register-data-table [data-n="2"] { position: sticky; z-index: 1; background: inherit; }
.register-data-table [data-n="0"] { left: 0; }
.register-data-table [data-n="1"] { left: var(--meta-width); }
.register-data-table [data-n="2"] { left: calc(2 * var(--meta-width)); }
.register-data-table [data-n="2"],
.register-data-table [colspan="3"] { border-right: 2px solid var(--line); }
.register-data-table thead th { position: sticky; top: 0; z-index: 2; background: var(--ink); }
.register-data-table thead th[data-n="0"],
.register-data-table thead th[data-n="1"],
.register-data-table thead th[data-n="2"] { z-index: 3; }
#storage-type-filter { width: 100%; padding: .45rem .25rem; border: 1px solid #8ca5b3; border-radius: 4px; background: var(--ink); color: #fff; font: inherit; }

/* Collapsible Table 1 with a filter toolbar and pinned header row. */
.register-table-collapse {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 1rem;
}
.register-table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 1rem;
  cursor: pointer;
  list-style: none;
}
.register-table-summary::-webkit-details-marker { display: none; }
.register-table-summary:hover { background: var(--wash); }
.register-table-summary-title { font-weight: 600; color: var(--ink); font-size: .95rem; }
.register-table-summary-title::before { content: "\25B8\00A0"; color: var(--muted, #6b7280); }
.register-table-collapse[open] .register-table-summary-title::before { content: "\25BE\00A0"; }
.register-table-summary-hint { font-size: .72rem; color: var(--muted, #6b7280); white-space: nowrap; }
.register-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: .5rem 1rem .7rem;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  color: var(--ink);
}
.register-table-toolbar label { display: flex; align-items: center; gap: .4rem; font-weight: 600; margin: 0; }
.register-table-toolbar select {
  font: inherit;
  font-weight: 400;
  padding: .25rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.register-table-collapse .register-table-scroll { margin: 0 .5rem .5rem; }
/* Keep the header row visible while scrolling vertically inside the panel. */
.register-data-table thead th { position: sticky; top: 0; z-index: 2; background: var(--ink); }
.register-data-table thead th[data-n="0"],
.register-data-table thead th[data-n="1"],
.register-data-table thead th[data-n="2"] { z-index: 3; }

/* KPI band on the home page, driven by data/register.toml. */
.kpi-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  border: 0;
  margin: 1.7rem 0 .25rem;
}
.kpi-card {
  padding: 1.05rem 1.2rem .9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(20, 47, 64, .05);
}
.kpi-value {
  font-size: 2.05rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-unit { font-size: .95rem; font-weight: 600; margin-left: .3rem; color: var(--muted, #6b7280); }
.kpi-label {
  margin-top: .4rem;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
}
.kpi-note { margin-top: .05rem; font-size: .72rem; color: var(--muted, #6b7280); }
.kpi-release { text-align: right; font-size: .7rem; color: var(--muted, #6b7280); margin: .45rem 0 1.4rem; }


/* Data & Downloads page. */
.downloads-section { max-width: 980px; margin: 0 auto; }
.downloads-heading { font-size: 1.25rem; margin: 1.6rem 0 .6rem; color: var(--ink); }
.downloads-year { font-size: .95rem; margin: .9rem 0 .5rem; color: var(--muted, #6b7280); font-weight: 600; }
.downloads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.download-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow .15s ease, transform .15s ease;
}
.download-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .1); transform: translateY(-2px); color: var(--ink); }
.download-cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-bottom: 1px solid var(--line); background: #fff; }
.download-card-body { padding: .55rem .7rem .65rem; }
.download-title { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.download-hint { margin-top: .2rem; font-size: .68rem; color: var(--muted, #6b7280); }
.downloads-db, .downloads-cite { font-size: .85rem; }
.bibtex-box { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; background: var(--wash); }
.bibtex-box summary { cursor: pointer; font-size: .8rem; font-weight: 600; }
.bibtex-box pre { margin: .5rem 0; font-size: .72rem; white-space: pre-wrap; }
.bibtex-copy { border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .72rem; padding: .25rem .6rem; cursor: pointer; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.history-table th, .history-table td { border: 1px solid var(--line); padding: .35rem .6rem; text-align: left; vertical-align: top; }
.history-table th { background: var(--wash); }

/* Footer upgrade. */
.footer { text-align: center; font-size: .75rem; line-height: 1.7; padding: 1.1rem 1rem 1.3rem; }
.footer-title { font-weight: 600; }
.footer a { text-decoration: underline; }

/* Table toolbar extras. */
.register-table-toolbar input[type="search"] {
  font: inherit;
  font-weight: 400;
  padding: .25rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 170px;
}
.table-csv-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .7rem;
  cursor: pointer;
}
.table-csv-btn:hover { background: var(--wash); }

/* Responsive charts: scale the SVG and stack the legend on narrow screens. */
#project_1_figure_1 { max-width: 100%; height: auto; }
.chart-panel { overflow-x: auto; }
@media (max-width: 1100px) {
  .chart-panel > div { flex-direction: column !important; min-width: 0 !important; align-items: stretch !important; }
  .chart-panel > div > div { min-width: 0 !important; }
  #legend, #figure_2_legend { width: 100%; }
}

/* Table 1 as an always-visible panel with a header toolbar. */
.register-table-panel { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; margin-bottom: 1rem; }
.register-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1.3rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}
.register-table-title { font-weight: 650; font-size: .95rem; color: var(--ink); }
.register-table-unit { font-weight: 500; font-size: .72rem; color: var(--muted, #6b7280); margin-left: .45rem; }
.register-table-head .register-table-toolbar { padding: 0; border: 0; margin-left: auto; }
.register-table-panel .register-table-scroll { margin: 0; }
.register-table-toolbar #storage-type-filter {
  width: auto;
  padding: .25rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.register-data-table { font-variant-numeric: tabular-nums; }
.register-data-table tbody tr.table-row-record-tr:hover { background: #eaf2f6; }
.figure-caption { font-size: .78rem; color: var(--muted, #6b7280); }

/* Interactive chart shells (figures 3 and 4). */
.ichart-panel { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 1rem 1.1rem .6rem; margin: 1.5rem 0 .4rem; }
.ichart-title { font-weight: 650; font-size: .95rem; color: var(--ink); margin-bottom: .2rem; }
.ichart-sub { font-size: .74rem; color: var(--muted, #6b7280); margin-bottom: .5rem; }
.ichart-panel svg { width: 100%; height: auto; display: block; }
.ichart-tooltip {
  position: absolute;
  visibility: hidden;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  padding: .45rem .6rem;
  font-size: .74rem;
  color: var(--ink);
  pointer-events: none;
  z-index: 10;
  max-width: 280px;
}

/* Legend reset control (Figure 1). */
.legend-reset-btn {
  display: block;
  width: calc(100% - 1.5rem);
  margin: 0 .75rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .74rem;
  font-weight: 600;
  padding: .35rem .6rem;
  cursor: pointer;
}
.legend-reset-btn:hover { background: var(--wash); }

/* ---- Institutional layout system ---- */
body { font-family: "Inter", "Avenir Next", Avenir, "Segoe UI", sans-serif; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); background: #fff; }
.masthead-inner {
  max-width: 1600px;
  margin-inline: auto;
  padding: 1.3rem 2rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.masthead-brand { text-decoration: none; display: block; }
.masthead-title {
  display: block;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  line-height: 1.2;
}
.masthead-sub { display: block; margin-top: .3rem; font-size: .8rem; color: var(--muted); }
.masthead-logos { display: flex; align-items: center; gap: 1.4rem; flex-shrink: 0; }
.masthead-logos img { height: 44px; width: auto; display: block; }
@media (max-width: 760px) { .masthead-logos { display: none; } }

/* Slim nav under the masthead */
.site-nav { padding: 0; background: var(--wash); border-bottom: 1px solid var(--line); }
.site-nav > .container-fluid { max-width: 1600px; padding-inline: 2rem; }
.site-nav .navbar-nav { gap: 1.9rem; }
.site-nav .nav-item:first-child { margin-right: 0; max-width: none; }
.site-nav .nav-link { font-size: .86rem; padding: .7rem 0; border-bottom-width: 3px; }
.site-nav .nav-item:first-child .nav-link { color: var(--muted); font-size: .86rem; line-height: inherit; letter-spacing: 0; }
.site-nav .nav-item:first-child .nav-link.active, .site-nav .nav-link.active { color: var(--ink); border-color: var(--teal); }

/* Content grid */
.page-wrap { max-width: 1600px; margin-inline: auto; padding: 0 2rem; }
.page-head { padding: 2rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.page-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }

/* Hero */
.hero { padding: 2.6rem 0 .4rem; max-width: 880px; }
.hero-headline { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 1rem; }
.hero-lede { font-size: 1.05rem; color: var(--muted); max-width: 46rem; margin-bottom: 1.4rem; }
.hero-ctas { display: flex; gap: .8rem; flex-wrap: wrap; }
.cta {
  display: inline-block;
  padding: .55rem 1.15rem;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}
.cta-primary { background: var(--ink); color: #fff; }
.cta-primary:hover { background: #0c2231; color: #fff; }
.cta-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.cta-secondary:hover { background: var(--wash); color: var(--ink); }

/* Footer columns */
.base-footer { background: var(--wash); border-top: 1px solid var(--line); margin-top: 3rem; }
.footer { background: var(--wash); text-align: left; font-size: .8rem; padding: 0; }
.footer-grid {
  max-width: 1600px;
  margin-inline: auto;
  padding: 2rem 2rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.footer-head { font-weight: 700; font-size: .82rem; margin-bottom: .5rem; color: var(--ink); }
.footer-col p { margin-bottom: .7rem; color: var(--muted); line-height: 1.65; }
.footer-cite { font-size: .74rem; }
.footer-base {
  max-width: 1600px;
  margin-inline: auto;
  padding: .7rem 2rem 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .74rem;
}

/* All figures fit the viewport width — no horizontal scrolling. */
.chart-panel { overflow: visible; }
.fig1-flex { display: flex; align-items: flex-start; gap: 1.1rem; }
.fig1-chart { flex: 1 1 auto; min-width: 0; }
.fig-legend-col { flex: 0 0 280px; min-width: 0; }
#project_1_figure_1 { width: 100%; height: auto; display: block; }
#legend { width: 100%; padding-inline: 0; }
.legend-reset-btn { width: 100%; margin: 0 0 .5rem; }
#figure3-svg { max-width: 1000px; margin-inline: auto; }
#figure4-svg { max-width: 1100px; margin-inline: auto; }
@media (max-width: 900px) {
  .fig1-flex, .figure1-plot-container { flex-wrap: wrap; }
  .fig-legend-col { flex: 1 1 100%; }
}

/* Continent layer in the Figure 1 legend. */
.legend-region { border: 0; margin-bottom: .55rem; }
.legend-region-toggle {
  display: flex;
  align-items: center;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .25rem 2px .4rem;
  cursor: pointer;
  list-style: none;
}
.legend-region-toggle::-webkit-details-marker { display: none; }
.legend-region-toggle::after {
  content: "";
  width: .4em;
  height: .4em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform .15s ease;
}
.legend-region[open] > .legend-region-toggle::after { transform: rotate(225deg); }

/* Downloads: both editions on one row. */
.downloads-section { max-width: none; }
.downloads-group { min-width: 0; max-width: 100%; }
.downloads-row { display: flex; gap: 2.6rem; align-items: flex-start; flex-wrap: wrap; }
.downloads-group + .downloads-group { border-left: 1px solid var(--line); padding-left: 2.6rem; }
.downloads-year { margin-top: 0; }
.downloads-cards { display: flex; gap: 1rem; flex-wrap: wrap; }
.downloads-cards .download-card { width: 205px; }

/* Figure 1: legend beside the chart, stretched to exactly the chart's height. */
.fig1-flex { flex-direction: row; align-items: stretch; }
.fig-legend-col { flex: 0 0 560px; display: flex; flex-direction: column; min-width: 0; }
#legend { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: .35rem; scrollbar-width: thin; column-count: 2; column-gap: 1.5rem; }
#legend .legend-region { break-inside: avoid; }
.legend-reset-btn { width: 100%; margin: 0 0 .55rem; }
@media (max-width: 900px) {
  .fig1-flex { display: block !important; }
  .fig1-chart { width: 100%; }
  .fig-legend-col { display: block !important; width: 100%; margin-top: 1rem; flex: none !important; }
  #legend { display: block; width: 100%; overflow: visible; column-count: 1; max-height: none; }
  .legend-reset-btn { max-width: 100%; }
}

/* Tighter references list. */
.list-item { padding: 9px 14px; }
.list-item p, .list-item .mb-2, .list-item .mt-2 { margin-top: .15rem !important; margin-bottom: .25rem !important; }
.list-item { font-size: .92rem; line-height: 1.55; }
.list-item ~ hr { margin: .25rem 0; opacity: .12; }
.list-item:hover { background-color: var(--wash); }

/* News coverage list. */
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: .9rem; margin-top: 1.2rem; }
.news-item {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: .95rem 1.15rem .9rem;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow .15s ease, transform .15s ease;
}
.news-item:hover { box-shadow: 0 4px 14px rgba(20, 47, 64, .1); transform: translateY(-2px); color: var(--ink); }
.news-meta { display: flex; align-items: baseline; gap: .7rem; margin-bottom: .3rem; }
.news-outlet {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--teal);
}
.news-date { font-size: .72rem; color: var(--muted); }
.news-title { font-size: .95rem; font-weight: 600; line-height: 1.4; }
.news-ext { color: var(--muted); font-size: .85rem; }
.news-item { display: flex; gap: .9rem; align-items: flex-start; }
.news-item .news-logo, .news-logo {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px;
  max-height: 34px;
  flex: 0 0 auto;
  margin-top: .1rem;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
}
.news-body { min-width: 0; }

/* Mobile refinements (no effect at desktop widths). */
@media (max-width: 900px) {
  #project_1_figure_2 { width: 100% !important; height: auto !important; max-width: 100%; }
  .page-wrap, .masthead-inner, .site-nav > .container-fluid { padding-inline: 1rem; }
  .masthead-inner { padding-block: .9rem .7rem; }
  .hero { padding-top: 1.6rem; }
  #legend { column-count: 1; }
  .downloads-cards .download-card { width: 160px; max-width: 46%; }
  .downloads-group + .downloads-group { border-left: 0; padding-left: 0; }
  .register-table-head { padding: .7rem .8rem; }
  .register-table-toolbar { gap: .6rem; }
  .register-table-toolbar input[type="search"] { min-width: 120px; }
}
.downloads-placeholder {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: clamp(1rem, 4vw, 2.2rem);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  background: var(--wash);
  min-width: 0;
  text-align: center;
}

/* Embargo cards stay non-interactive until the published assets are verified. */
.release-edition { flex: 1 1 630px; max-width: 680px; }
.release-notice { margin-bottom: 1.25rem; }
.release-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.release-cards .download-card { width: 100%; max-width: none; margin: 0; }
.release-document .download-card-body { display: flex; flex-direction: column; flex: 1; }
.release-document .download-title { flex: 1; }
.release-document .download-cover { object-fit: contain; }
.release-download-state { align-self: flex-start; padding: .22rem .5rem; border-radius: 4px; background: #e4f2ee; color: #185d53; font-size: .7rem; font-weight: 700; margin-top: .6rem; }
.release-document.is-embargoed { cursor: default; }
.release-document.is-embargoed:hover { transform: none; box-shadow: none; }
.release-document.is-embargoed .release-download-state { background: #edf0f2; color: #526773; }
@media (max-width: 480px) {
  .release-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-document .download-title { font-size: .8rem; }
}

/* Release countdown; all timing uses the absolute date in the time element. */
.release-announcement { margin: 0; }
.release-countdown { margin: 1.5rem auto 0; max-width: 360px; }
.release-countdown-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.35rem, 1.2vw, .75rem); }
.release-flip-card { position: relative; height: clamp(3.2rem, 7vw, 4.8rem); perspective: 500px; font-size: clamp(1.55rem, 4.5vw, 2.5rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.release-flip-value, .release-flip-leaf { position: absolute; inset: 0; display: grid; place-items: center; border-radius: .45rem; background: linear-gradient(#1d4053 50%, #142f40 50%); color: #fff; box-shadow: 0 3px 0 #0d2635; }
.release-flip-card::after { content: ""; position: absolute; z-index: 3; top: 50%; left: 0; right: 0; border-top: 1px solid #0006; pointer-events: none; }
.release-flip-leaf { visibility: hidden; backface-visibility: hidden; transform-origin: center; }
.release-flip-previous { clip-path: inset(50% 0 0 0); z-index: 1; }
.release-flip-card.is-flipping .release-flip-previous { visibility: visible; }
.release-flip-top { clip-path: inset(0 0 50% 0); z-index: 2; }
.release-flip-bottom { clip-path: inset(50% 0 0 0); z-index: 2; }
.release-flip-card.is-flipping .release-flip-top { visibility: visible; animation: release-flip-top .28s ease-in both; }
.release-flip-card.is-flipping .release-flip-bottom { visibility: visible; animation: release-flip-bottom .28s .28s ease-out both; }
.release-countdown-label { display: block; margin-top: .7rem; font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.release-countdown-status { margin: 1rem 0 0; }
@keyframes release-flip-top { from { transform: rotateX(0); } to { transform: rotateX(-90deg); } }
@keyframes release-flip-bottom { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .release-flip-card.is-flipping .release-flip-leaf { animation: none; visibility: hidden; }
}

/* Statistics and map are rendered by Hugo, with no browser-side dependencies. */
.footer-stats { background: var(--ink); color: #edf5f7; }
.footer-stats-inner {
  max-width: 1600px;
  margin-inline: auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.footer-stats h2, .stat-map figcaption { color: #edf5f7; font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }
.stats-updated, .stats-note { color: #b6c9d3; font-size: .75rem; line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.stat-chip { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.stat-label { color: #b6c9d3; font-size: .72rem; font-weight: 600; line-height: 1.5; }
.stat-num { order: -1; color: #fff; font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; margin: 0; }
.stat-map { min-width: 0; margin: 0; }
#visitor-map { display: block; width: 100%; height: auto; max-width: 640px; margin-inline: auto; }
.visitor-map-canvas { position: relative; }
.visitor-map-tooltip { position: absolute; bottom: .25rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1rem); padding: .55rem .85rem; border: 1px solid #91b9c9; border-radius: .5rem; background: #edf5f7; color: #142f40; font-size: .85rem; font-weight: 600; line-height: 1.5; text-align: center; pointer-events: none; box-shadow: 0 2px 10px #0004; }
.visitor-map-hint { color: #b6c9d3; font-size: .75rem; line-height: 1.6; margin: .5rem 0 0; }
.visitor-country[role="button"] { cursor: pointer; }
.visitor-country[data-selected], .visitor-country:focus-visible { stroke: #fff; stroke-width: 1.8; outline: none; }
.visitor-country { stroke: #142f40; stroke-width: .6; vector-effect: non-scaling-stroke; }
.visits-none { fill: #365366; background: #365366; }
.visits-low { fill: #75b6b4; background: #75b6b4; }
.visits-medium { fill: #3fc4b7; background: #3fc4b7; }
.visits-high { fill: #abe6c2; background: #abe6c2; }
@media (max-width: 900px) {
  .footer-stats-inner { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem 1rem; }
  .stat-map { max-width: 640px; width: 100%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); padding-inline: 1rem; }
}
