@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: optional;
  src: url("fonts/space-grotesk/space-grotesk-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: optional;
  src: url("fonts/space-grotesk/space-grotesk-latin-ext.woff2") format("woff2");
}

:root {
  --bg: #f7f8f4;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #5c6670;
  --line: #d8ded6;
  --blue: #225ea8;
  --teal: #2c7a7b;
  --green: #16815c;
  --gold: #c87921;
  --coral: #c84f3d;
  --red: #b33d3d;
  --shadow: 0 14px 35px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: 58px;
  background:
    linear-gradient(180deg, rgba(34, 94, 168, 0.08), rgba(247, 248, 244, 0) 340px),
    var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Space Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 110;
  padding: 18px 28px;
  background: linear-gradient(115deg, #12233a, #173f50 68%, #315737);
  color: #fff;
  border-bottom: 4px solid #d6b45a;
  box-shadow: 0 10px 28px rgba(18, 35, 58, 0.18);
}

.topbar > div {
  flex: 1 1 460px;
  min-width: 260px;
}

.topbar h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #b7d7ff;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.topbar nav {
  display: flex;
  flex: 0 1 auto;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar a {
  color: #e7f1ff;
  text-decoration: none;
  font-weight: 800;
}

.eatf-badge {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 172px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(214, 180, 90, 0.28);
}

.eatf-badge span {
  color: #f1cf72;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.eatf-badge strong,
.eatf-badge small {
  color: #fff;
}

.eatf-badge small {
  color: #dbe9ee;
}

.eatf-info {
  position: relative;
  color: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.eatf-info::after {
  content: attr(data-info);
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(280px, 75vw);
  padding: 10px 12px;
  border: 1px solid #d6b45a;
  border-radius: 8px;
  background: #12233a;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 120;
}

.eatf-info:hover::after,
.eatf-info:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.eatf-badge.eatf-info {
  text-decoration: none;
}

.eatf-badge.eatf-info::after {
  left: auto;
  right: 0;
  top: calc(100% + 10px);
  bottom: auto;
}

main {
  padding: 18px;
}

section[id] {
  scroll-margin-top: 150px;
}

.page-main {
  max-width: 1180px;
  margin: 0 auto;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.overview-strip div {
  background: #fff;
  padding: 14px 16px;
  min-height: 82px;
}

.overview-strip span,
.layer-card span,
.scale-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-strip strong {
  display: block;
  margin-top: 6px;
  color: #183149;
  font-size: 19px;
}

.notice {
  padding: 12px 16px;
  border: 1px solid #ead39d;
  background: #fff7de;
  border-radius: 8px;
  margin-bottom: 18px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(360px, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: start;
}

.controls,
.map-panel,
.drawer,
.compare-panel,
.table-section,
.method-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls,
.drawer {
  padding: 16px;
}

.controls label {
  display: block;
  margin-bottom: 14px;
  font-weight: 700;
}

.layer-card,
.scale-card {
  margin: -2px 0 16px;
  padding: 12px;
  border: 1px solid #b8d5d3;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f1fbfa;
}

.layer-card strong,
.scale-card strong {
  display: block;
  margin-top: 5px;
}

.layer-card p,
.scale-card p {
  margin: 7px 0 0;
  color: #34434c;
}

.scale-card {
  border-color: #ead39d;
  border-left-color: var(--gold);
  background: #fffaf0;
}

select,
input,
button {
  width: 100%;
  margin-top: 6px;
  min-height: 40px;
  border: 1px solid #bec8c1;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

button {
  cursor: pointer;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 800;
}

.map-panel {
  overflow: hidden;
  min-height: 590px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}

.map-toolbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.map-updated {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #173f50;
  font-weight: 800;
}

.map-updated span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #b8d5d3;
  border-radius: 999px;
  background: #f1fbfa;
}

.zoom-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.icon-button {
  width: 38px;
  min-height: 34px;
  margin-top: 0;
  padding: 0;
  border-radius: 6px;
  background: #173f50;
  border-color: #173f50;
  font-size: 17px;
  line-height: 1;
}

#world-map {
  display: block;
  width: 100%;
  height: 520px;
  background: #eef3f0;
}

.country {
  stroke: #ffffff;
  stroke-width: 0.5;
  cursor: pointer;
}

.country:hover {
  stroke: #111;
  stroke-width: 1.2;
}

.country.selected {
  stroke: #0b1720;
  stroke-width: 2.8;
  paint-order: stroke;
}

.fallback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 6px;
  padding: 12px;
}

.tile {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 8px;
  min-height: 64px;
  cursor: pointer;
}

.tile strong {
  display: block;
}

.tile.selected {
  outline: 3px solid #0b1720;
  outline-offset: 2px;
}

.legend,
.metrics {
  margin-top: 16px;
  color: var(--muted);
}

.metrics {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.metrics p {
  margin: 8px 0;
}

.legend-swatch {
  display: inline-block;
  width: 16px;
  height: 12px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

.drawer h2,
.compare-panel h2,
.table-section h2,
.method-section h2 {
  margin-top: 0;
}

.drawer .score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.country-signal-card {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #b8d5d3;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: linear-gradient(135deg, #f1fbfa, #ffffff 68%);
}

.country-signal-card p {
  margin: 0 0 10px;
  color: #34434c;
}

.country-signal-card .scale-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #fbfcf8;
}

.stat strong {
  display: block;
  font-size: 20px;
}

.stat-score {
  border-top: 3px solid var(--blue);
}

.stat-review {
  border-top: 3px solid var(--gold);
}

.stat-source {
  border-top: 3px solid var(--teal);
}

.indicator-list {
  display: grid;
  gap: 8px;
}

.indicator-row {
  border: 1px solid var(--line);
  border-left: 4px solid #b8d5d3;
  border-radius: 7px;
  padding: 10px;
  background: linear-gradient(135deg, #ffffff, #fbfcf8);
}

.indicator-row.needs-review {
  border-left-color: var(--gold);
}

.indicator-heading {
  display: grid;
  gap: 8px;
}

.indicator-id {
  color: var(--blue);
  font-weight: 900;
}

.signal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.signal-secondary {
  margin-top: 8px;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #25313b;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.score-pill {
  border-color: #9bbde2;
  background: #e8f1fb;
  color: #183149;
}

.score-0 {
  border-color: #cdd7d1;
  background: #f3f6f2;
  color: #3f4a54;
}

.score-1 {
  border-color: #e1c173;
  background: #fff3cf;
  color: #6f4606;
}

.score-2 {
  border-color: #8ccac8;
  background: #e5f5f4;
  color: #155f61;
}

.score-3 {
  border-color: #88b7df;
  background: #dbeafe;
  color: #173f78;
}

.confidence-pill {
  border-color: #cdd7d1;
  background: #f5f7f4;
}

.confidence-h {
  border-color: #88c5a8;
  background: #e2f3eb;
  color: #0f6844;
}

.confidence-m,
.confidence-mean {
  border-color: #d6b45a;
  background: #fff7de;
  color: #7a4c00;
}

.confidence-l {
  border-color: #e2a096;
  background: #f8deda;
  color: #872c2c;
}

.delta-positive {
  border-color: #88c5a8;
  background: #e2f3eb;
  color: #0f6844;
}

.delta-negative {
  border-color: #e2a096;
  background: #f8deda;
  color: #872c2c;
}

.delta-neutral {
  border-color: #cdd7d1;
  background: #f5f7f4;
  color: #3f4a54;
}

.review-active {
  border-color: #d6b45a;
  background: #fff7de;
  color: #7a4c00;
}

.review-clear {
  border-color: #b8d5d3;
  background: #f1fbfa;
  color: #155f61;
}

.confidence-move {
  border-color: #c7d1ce;
  background: #ffffff;
  color: #4d5964;
}

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

.warning {
  border-left: 4px solid var(--gold);
  background: #fff7e8;
  padding: 9px 10px;
  border-radius: 6px;
}

.compare-panel,
.table-section,
.method-section,
.attestation-section,
.directions-section {
  margin-top: 18px;
  padding: 18px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

.method-section,
.attestation-section,
.directions-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-heading p {
  max-width: 900px;
  color: var(--muted);
}

.method-grid,
.directions-grid,
.attestation-grid,
.definition-grid {
  display: grid;
  gap: 12px;
}

.method-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  margin-top: 14px;
}

.method-card,
.directions-grid article,
.attestation-grid article,
.definition-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.method-card {
  border-top: 4px solid var(--blue);
}

.method-card:nth-child(2),
.method-card:nth-child(5) {
  border-top-color: var(--teal);
}

.method-card:nth-child(3),
.method-card:nth-child(6) {
  border-top-color: var(--gold);
}

.method-card span {
  color: var(--coral);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.method-card h3,
.directions-grid h3,
.definition-grid h4 {
  margin: 6px 0;
}

.method-card p,
.directions-grid p,
.attestation-grid p,
.definition-grid p {
  margin: 0;
  color: #3f4a54;
}

.attestation-section {
  border-top: 4px solid #d6b45a;
}

.attestation-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.attestation-grid article {
  background: #fbfcf8;
}

.attestation-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attestation-grid strong {
  display: block;
  margin: 7px 0;
  color: #183149;
  font-size: 21px;
  overflow-wrap: anywhere;
}

.definition-section {
  margin-top: 22px;
}

.definition-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.definition-grid article {
  background: #fbfcf8;
}

.directions-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.agent-hero,
.transparency-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.agent-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  padding: 18px;
}

.transparency-hero {
  padding: 28px;
  border-top: 4px solid var(--teal);
}

.transparency-hero h2 {
  max-width: 860px;
  margin: 6px 0 10px;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.03;
}

.transparency-hero p {
  max-width: 880px;
  color: #34434c;
  font-size: 18px;
}

.agent-card {
  border: 1px solid #b8d5d3;
  border-radius: 8px;
  background: linear-gradient(145deg, #f7fbfb, #ffffff);
  padding: 18px;
}

.agent-card-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.agent-mark {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: #173f50;
  color: #f1cf72;
  font-size: 42px;
  font-weight: 900;
  box-shadow: inset 0 0 0 3px rgba(214, 180, 90, 0.32);
}

.agent-card h2 {
  margin: 0;
  font-size: 42px;
}

.agent-card p,
.agent-summary p {
  color: #3f4a54;
}

.agent-facts {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.agent-facts div {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.agent-facts div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.agent-facts dt {
  color: var(--muted);
  font-weight: 800;
}

.agent-facts dd {
  margin: 0;
}

.agent-summary {
  align-self: center;
  padding: 12px;
}

.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.agent-actions a {
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
}

.agent-actions a:nth-child(2) {
  background: var(--teal);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.timeline article {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 14px 14px 58px;
}

.timeline span {
  position: absolute;
  left: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #173f50;
  color: #fff;
  font-weight: 900;
}

.timeline h3 {
  margin: 2px 0 6px;
}

.timeline p {
  margin: 0;
  color: #3f4a54;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  background: #f3f5f1;
  z-index: 1;
}

tbody tr {
  cursor: pointer;
}

tbody tr.selected {
  background: #fff7de;
  box-shadow: inset 4px 0 0 #c87921;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: fixed;
  right: 18px;
  bottom: 10px;
  left: 18px;
  z-index: 80;
  margin: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(216, 222, 214, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 32, 42, 0.06);
  opacity: 0.92;
  backdrop-filter: blur(12px);
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-footer.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 18px));
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.site-footer-brand div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-footer-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  opacity: 0.62;
}

.site-footer strong {
  color: #173f50;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.site-footer span {
  color: var(--muted);
}

.site-footer-brand span:not(.site-footer-copy) {
  display: none;
}

.site-footer .site-footer-copy {
  color: #6d747a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.site-footer a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1050px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .overview-strip,
  .method-grid,
  .directions-grid,
  .attestation-grid,
  .definition-grid,
  .agent-hero,
  .timeline {
    grid-template-columns: 1fr;
  }

  .agent-facts div {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .topbar > div {
    flex: 0 1 auto;
    min-width: 0;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-footer {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .site-footer-brand {
    align-items: center;
  }
}

@media (max-width: 620px) {
  body {
    padding-bottom: 54px;
  }

  main {
    padding: 14px;
  }

  section[id] {
    scroll-margin-top: 172px;
  }

  .topbar {
    gap: 10px;
    padding: 10px 12px;
    border-bottom-width: 2px;
  }

  .topbar h1 {
    font-size: 18px;
    line-height: 1.12;
  }

  .topbar nav {
    gap: 9px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar nav a {
    flex: 0 0 auto;
    font-size: 13px;
    white-space: nowrap;
  }

  .eatf-badge {
    min-width: 0;
    padding: 7px 9px;
  }

  .eatf-badge strong {
    font-size: 13px;
  }

  .site-footer {
    right: 10px;
    bottom: 8px;
    left: 10px;
    min-height: 36px;
    padding: 7px 9px;
  }

  .site-footer-logo {
    display: none;
  }

  .site-footer-brand {
    gap: 0;
  }

  .site-footer .site-footer-copy {
    display: none;
  }
}
