:root, [data-theme="dark"] {
  --bg: #0e0d0c;
  --panel: #1f1d1b;
  --panel-2: #2a2724;
  --text: #f5f3ef;
  --muted: #a8a29e;
  --border: #33302c;
  --accent: #22c55e;
  --accent-ink: #052e16;
  --accent-soft: #1f4a3a;
}
[data-theme="light"] {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-2: #eef1ec;
  --text: #1a1c19;
  --muted: #5d6359;
  --border: #dde2d9;
  --accent: #15803d;
  --accent-ink: #ffffff;
  --accent-soft: #dcf2e3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem; border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-weight: 600; font-size: 1.2rem; text-decoration: none; }
.topnav { display: flex; align-items: center; gap: 1.25rem; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.topnav a:hover { color: var(--text); }
.icon-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: .35rem .6rem; cursor: pointer; font-size: 1rem;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 2rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 1.5rem; line-height: 1.15; }
.back-link { color: var(--accent); display: inline-block; margin-bottom: 2rem; text-decoration: none; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.1rem; margin: -1rem 0 2.5rem; }
.members-view .about { border: 1px solid var(--accent); border-radius: 10px; padding: 1.5rem 2rem; margin-bottom: 2rem; }
.members-view .about p, .members-view .about ul { color: var(--text); max-width: none; }
.fellows-view .about { border-color: #a86fc5; background: #130d16; }
.fellows-view .about summary { color: #ead7f4; }
.fellows-view .about p, .fellows-view .about li { color: #ded5e2; }
.fellows-view .about a { color: #c084fc; }
.gds-intro { background: var(--panel); border-radius: 10px; padding: 2rem; margin-bottom: 2rem; }
.gds-intro h2 { display: flex; align-items: center; gap: .75rem; }
.gds-icon { color: var(--accent); font-size: 1.5rem; }
.gds-intro > p { color: var(--muted); }
.gds-categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.5rem; }
.gds-category { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.gds-category h3 { margin: 0 0 .35rem; font-size: 1rem; }
.gds-category p { color: var(--muted); font-size: .9rem; margin: 0; }
.gds-category.environmental { border-color: #1f6b3b; background: #101e15; }
.gds-category.environmental h3 { color: #4ade80; }
.gds-category.social { border-color: #324b99; background: #111728; }
.gds-category.social h3 { color: #60a5fa; }
.gds-category.supplier { border-color: #8b4d26; background: #24170f; }
.gds-category.supplier h3 { color: #fbbf24; }
.gds-category.destination { border-color: #6f2b82; background: #201024; }
.gds-category.destination h3 { color: #c084fc; }
.gds-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.gds-stats article { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
.gds-stats span { color: var(--muted); }
.gds-stats strong { display: block; font-size: 2rem; margin-top: .4rem; }
.gds-trend { margin-bottom: 1.5rem; }
.progress-view { margin-top: 2.5rem; }
.progress-view > h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.progress-list { display: grid; gap: 1rem; }
.progress-item { background: var(--panel); border-radius: 10px; padding: 1.5rem 2rem; }
.progress-item summary { cursor: pointer; font-size: 1.2rem; font-weight: 600; list-style: none; }
.progress-item summary::-webkit-details-marker { display: none; }
.progress-item summary::after { content: "+"; float: right; color: var(--muted); font-size: 1.5rem; font-weight: 400; line-height: 1; }
.progress-item[open] summary::after { content: "−"; }
.progress-item p { color: var(--muted); margin: 1rem 0 0; max-width: 70ch; }
.progress-item.environmental { border-left: 4px solid #4ade80; }
.progress-item.social { border-left: 4px solid #60a5fa; }
.progress-item.supplier { border-left: 4px solid #fbbf24; }
.progress-item.destination { border-left: 4px solid #c084fc; }
.member-controls { display: grid; grid-template-columns: 1fr 270px; gap: 1rem; margin-bottom: 1.5rem; }
.search-field input, .select-field select { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit; padding: .85rem 1rem; }
.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.member-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; min-height: 150px; padding: 1.25rem; }
.member-card h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.member-card p { color: var(--muted); margin: 0 0 1rem; }
.member-card a { color: var(--accent); text-decoration: none; font-weight: 600; }
.muted-text { color: var(--muted); }
.events-panel { margin-bottom: 1.5rem; }
.events-list { display: grid; gap: .65rem; list-style: none; margin: 0; padding: 0; }
.events-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--border); }
.events-list li:first-child { border-top: 0; padding-top: 0; }
.events-list strong { color: var(--muted); font-weight: 500; white-space: nowrap; }
.data-table { margin-top: 1rem; }
.data-table summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.data-table table { border-collapse: collapse; margin-top: 1rem; width: 100%; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: .65rem; text-align: left; }
.data-table th { font-weight: 600; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }
h2 { font-size: 1.35rem; margin: 0 0 1rem; font-weight: 600; }

.about { border-bottom: 1px solid var(--border); padding: 1rem 0; margin-bottom: 2rem; }
.about summary { cursor: pointer; font-size: 1.2rem; font-weight: 500; }
.about p { color: var(--muted); max-width: 70ch; }
.about p span { display: block; margin-bottom: 1rem; }
.about p span:last-child { margin-bottom: 0; }
.about p a { color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem;
}
.stat-primary { background: var(--accent-soft); }
.stat-link { color: inherit; cursor: pointer; text-decoration: none; }
.stat-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-label { font-weight: 500; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-value small { font-size: 1rem; font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem; }
.panel-link { color: inherit; cursor: pointer; text-decoration: none; }
.panel-link:hover { border-color: var(--accent); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.view-all { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.view-all:hover { text-decoration: underline; }
.chart-box { position: relative; height: 260px; }

.targets { display: flex; flex-direction: column; gap: 1.1rem; }
.target-row { display: flex; justify-content: space-between; font-size: .95rem; margin-bottom: .35rem; }
.target-row span:last-child { color: var(--muted); }
.bar { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 99px; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: .45rem .9rem; font: inherit; font-weight: 500; cursor: pointer;
}
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.carousel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; min-height: 150px; }
.nav {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 1.4rem; cursor: pointer;
}
.nav:disabled { opacity: .35; cursor: default; }
.slide { text-align: center; }
.slide .name { font-size: 1.25rem; font-weight: 600; }
.slide .meta { color: var(--muted); }
.slide .count { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.slide a { color: var(--accent); }
.empty { color: var(--muted); }

button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .stat-link:hover { transform: none; }
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: repeat(2, 1fr); }
  .gds-categories, .gds-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .stats { grid-template-columns: 1fr; }
  .wrap { padding: 1.25rem; }
  .topbar { padding: 1rem 1.25rem; }
  .topnav { gap: .75rem; }
  .topnav a { font-size: .9rem; }
  .member-controls, .member-grid { grid-template-columns: 1fr; }
  .gds-categories, .gds-stats { grid-template-columns: 1fr; }
}