/* ==========================================================================
   SDG Country Profiles
   A data-first stylesheet: neutral surfaces, one accent, and the 17 official
   SDG colours used only where they carry meaning.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e0e4ea;
  --border-strong: #c9d0da;

  --text: #16202e;
  --text-muted: #5b6878;
  --text-faint: #8a95a3;

  --accent: #0a97d9;
  --accent-dark: #00689d;
  --accent-soft: #e6f4fb;

  --up: #2f7d4e;
  --down: #b3261e;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px -12px rgba(16, 24, 40, 0.18);

  --wrap: 1180px;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1319;
    --surface: #161d26;
    --surface-2: #1d2632;
    --border: #27313d;
    --border-strong: #384555;

    --text: #e8edf3;
    --text-muted: #a3b0bf;
    --text-faint: #78859a;

    --accent: #3fb3ec;
    --accent-dark: #7cc9f2;
    --accent-soft: #16303f;

    --up: #58c98a;
    --down: #f2837c;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 20;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.up { color: var(--up); }
.down { color: var(--down); }

.dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  flex: none;
}

/* --------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  margin-right: auto;
}

.brand:hover {
  text-decoration: none;
}

.brand strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand small {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(
    #e5243b 0 5.88%, #dda63a 0 11.76%, #4c9f38 0 17.64%, #c5192d 0 23.52%,
    #ff3a21 0 29.4%, #26bde2 0 35.28%, #fcc30b 0 41.16%, #a21942 0 47.04%,
    #fd6925 0 52.92%, #dd1367 0 58.8%, #fd9d24 0 64.68%, #bf8b2e 0 70.56%,
    #3f7e44 0 76.44%, #0a97d9 0 82.32%, #56c02b 0 88.2%, #00689d 0 94.08%,
    #19486a 0 100%
  );
  box-shadow: inset 0 0 0 6px var(--surface);
}

.site-nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--text-muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.country-search,
.hero-search {
  display: flex;
  gap: 0.4rem;
}

input[type="text"],
input[type="search"] {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-width: 0;
}

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: background 0.15s ease;
}

button:hover {
  background: var(--accent-dark);
}

/* ----------------------------------------------------------------- hero */

.hero {
  background:
    radial-gradient(80rem 30rem at 15% -12%, var(--accent-soft), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  margin-bottom: 0.9rem;
}

.lede {
  font-size: 1.06rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 46ch;
}

.hero-search input {
  flex: 1;
  max-width: 24rem;
}

.hero-shortcuts {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.hero-stat-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stat-value {
  margin: 0.15rem 0 0;
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-stat-value span {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-faint);
}

.hero-stat-change {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 2.5vw, 1.8rem);
  margin-block: 1.5rem;
}

.panel-head {
  margin-bottom: 1.2rem;
}

.panel-head h2 {
  font-size: 1.25rem;
}

.panel-head .muted {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  max-width: 72ch;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  align-items: start;
}

.two-col > .panel {
  margin-block: 0;
}

.two-col:not(:first-child) {
  margin-block: 1.5rem;
}

.callout {
  margin: 1.2rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.94rem;
}

/* ------------------------------------------------------------ world goals */

.world-goals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0.6rem;
}

.world-goal {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.world-goal:hover {
  border-color: var(--goal);
  transform: translateY(-1px);
  text-decoration: none;
}

.world-goal img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  flex: none;
}

.world-goal-body {
  flex: 1;
  min-width: 0;
}

.world-goal-title {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-goal-score {
  text-align: right;
  flex: none;
  min-width: 3.2rem;
}

.world-goal-score b {
  display: block;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.world-goal-score small {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- meters */

.meter {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: visible;
}

.meter-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--goal, var(--accent));
  max-width: 100%;
}

.meter-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  transform: translateX(-1px);
}

.meter-mark.region {
  background: var(--text-muted);
}

.meter-mark.world {
  background: var(--text-faint);
  opacity: 0.75;
  height: 10px;
  top: -1px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  align-items: center;
  margin: 1.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.key {
  display: inline-block;
  width: 14px;
  height: 8px;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.key-fill { background: var(--accent); }
.key-region { background: var(--text-muted); width: 3px; height: 13px; }
.key-world { background: var(--text-faint); width: 3px; height: 13px; }

/* --------------------------------------------------------- country header */

.country-head {
  padding-top: 2.2rem;
}

.crumbs {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.crumbs span {
  margin: 0 0.4rem;
  color: var(--text-faint);
}

.country-headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.country-headline h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.country-meta {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 99px;
  padding: 0.15rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.score-block {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.score-value {
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.score-caption {
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 12rem;
}

.score-caption small {
  color: var(--text-faint);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.plain-row .stat {
  box-shadow: var(--shadow);
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ------------------------------------------------------------- highlights */

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.highlight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}

.highlight h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.highlight .muted {
  margin: 0.3rem 0 0.8rem;
  font-size: 0.82rem;
}

.ranked {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.ranked li {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.92rem;
}

.ranked a {
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranked b {
  font-variant-numeric: tabular-nums;
  margin-left: 0.5rem;
}

/* -------------------------------------------------------------- goal grid */

.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.goal-card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--goal);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.goal-card.is-missing {
  border-top-color: var(--border-strong);
  background: var(--surface-2);
}

.goal-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.goal-card-head img {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  flex: none;
}

.goal-card-head > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.goal-number {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--goal);
}

.goal-card-head h3 {
  font-size: 1rem;
  margin-top: 0.1rem;
}

.goal-card-head h3 a {
  color: var(--text);
}

.goal-score {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.goal-score .na {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-faint);
}

.goal-desc {
  margin: 0.7rem 0 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.goal-facts {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.goal-facts li {
  background: var(--surface-2);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
}

.goal-facts b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.goal-facts .up { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.goal-facts .down { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }

.band {
  font-weight: 600;
}

/* Quartile position is ordinal, so it gets a single-hue ramp rather than a
   red-to-green scale -- the site must not imply the report's own dashboard
   rating, which is computed from indicators these files do not contain. */
.band-top { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--accent-dark); }
.band-upper { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-dark); }
.band-lower { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text-muted); }
.band-bottom { background: var(--surface-2); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--border-strong); }

.not-assessed {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sparkline {
  margin: 0.9rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
}

.spark-svg {
  display: block;
  width: 100%;
  height: 34px;
  overflow: visible;
}

.sparkline figcaption {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ goal */

.goal-hero {
  background: linear-gradient(140deg, color-mix(in srgb, var(--goal) 22%, var(--bg)), var(--bg) 62%);
  border-bottom: 1px solid var(--border);
  padding-top: 2.5rem;
}

.goal-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.goal-hero-inner img {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  flex: none;
  box-shadow: var(--shadow);
}

.goal-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  margin-bottom: 0.5rem;
}

.goal-hero .eyebrow {
  color: var(--text-muted);
}

.goal-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 1.6rem 0 1.2rem;
}

.goal-switch a {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--goal);
  opacity: 0.45;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.goal-switch a:hover {
  opacity: 0.85;
  text-decoration: none;
}

.goal-switch a.is-current {
  opacity: 1;
  transform: scale(1.12);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--goal);
}

/* ---------------------------------------------------------------- tables */

.filter-input {
  width: min(100%, 22rem);
  margin-bottom: 0.9rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.table-scroll.tall {
  max-height: 30rem;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  z-index: 1;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.data-table td:first-child,
.data-table td:last-child {
  font-variant-numeric: tabular-nums;
}

.cell-bar {
  display: inline-block;
  width: 5rem;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  margin-right: 0.5rem;
  vertical-align: middle;
  overflow: hidden;
}

.cell-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.data-table tbody tr:hover .cell-bar {
  background: var(--border-strong);
}

/* --------------------------------------------------------------- leagues */

.league {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.league li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.league li:last-child {
  border-bottom: 0;
}

.league-rank {
  width: 1.9rem;
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.league a {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-region {
  flex: 1;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-bar {
  width: 4.5rem;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  flex: none;
  overflow: hidden;
}

.league-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.league b {
  width: 3.2rem;
  text-align: right;
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ bar charts */

.bar-chart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.bar-chart li {
  display: grid;
  grid-template-columns: minmax(6rem, 11rem) 1fr 2.6rem;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.87rem;
}

.bar-label {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 10px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
}

.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------------------------------------------------------------- charts */

.chart {
  margin: 0;
  position: relative;
}

.chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.chart-svg .grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-svg .tick {
  fill: var(--text-faint);
  font-size: 11px;
  font-family: var(--sans);
}

.chart-svg .guide {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-legend i {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.5;
  box-shadow: var(--shadow);
  min-width: 9rem;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.chart-tooltip span b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}

.chart-empty {
  color: var(--text-faint);
  font-size: 0.82rem;
  margin: 0;
}

/* ------------------------------------------------------------------ misc */

.commentary {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 72ch;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  text-decoration: none;
}

.news-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: var(--surface-2);
}

.news-card > div {
  padding: 0.85rem;
}

.news-card h3 {
  font-size: 0.94rem;
  margin-bottom: 0.35rem;
}

.news-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.news-meta {
  margin-top: 0.6rem !important;
  font-size: 0.75rem !important;
  color: var(--text-faint) !important;
}

.note-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 80ch;
}

.note-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.disclosure {
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.88rem;
}

.disclosure summary {
  cursor: pointer;
  font-weight: 600;
}

.disclosure p {
  color: var(--text-muted);
  max-width: 80ch;
}

/* ---------------------------------------------------------------- prose */

.prose {
  max-width: 72ch;
  padding: 2.5rem 0 1rem;
}

.prose h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 0.8rem;
}

.prose h2 {
  font-size: 1.2rem;
  margin-top: 2.2rem;
  margin-bottom: 0.5rem;
}

.prose p,
.prose li {
  color: var(--text-muted);
}

.prose dt {
  font-weight: 600;
  color: var(--text);
  margin-top: 1rem;
}

.prose dd {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

.suggestions {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.suggestions a {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------- footer */

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2rem;
}

.footer-grid h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.footer-grid p,
.footer-grid li {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.goal-links {
  columns: 2;
  column-gap: 1rem;
}

.goal-links li {
  break-inside: avoid;
}

.goal-links a {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-note {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.footer-note p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-faint);
  max-width: 80ch;
}

/* --------------------------------------------------------- narrow screens */

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .header-inner {
    row-gap: 0.6rem;
  }

  .brand {
    margin-right: 0;
    width: 100%;
  }

  .country-search {
    width: 100%;
  }

  .country-search input {
    flex: 1;
  }

  .league-region {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ------------------------------------------------------- score histogram */

.subhead {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 1.6rem 0 0.8rem;
}

.histogram {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.25rem;
  align-items: end;
  height: 8rem;
}

.histogram li {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: 0.2rem;
}

.histogram-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
}

.histogram-count {
  order: -1;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.histogram-label {
  font-size: 0.66rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
