.aai-index {
  --aai-navy: #0f3440;
  --aai-teal: #05abc4;
  --aai-teal-dark: #047f92;
  --aai-lime: #d8ee67;
  --aai-mint: #e8f4ef;
  --aai-border: #d8e2e1;
  --aai-muted: #5d7076;
  --aai-bg: #f6f8f9;
  color: var(--aai-navy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

.aai-index * {
  box-sizing: border-box;
}

.aai-index h1,
.aai-index h2,
.aai-index h3,
.aai-index h4 {
  color: var(--aai-navy);
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.aai-index h1 {
  font-size: 2.25rem;
}

.aai-index h2 {
  font-size: 1.5rem;
}

.aai-index a {
  color: var(--aai-teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.aai-index a:hover {
  text-decoration: underline;
}

.aai-kicker {
  color: var(--aai-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.aai-heading-row {
  align-items: flex-start;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.aai-heading-row p {
  color: var(--aai-muted);
  margin: 0;
}

.aai-button {
  align-items: center;
  background: var(--aai-teal);
  border: 1px solid var(--aai-teal);
  border-radius: 6px;
  color: var(--aai-navy) !important;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  text-decoration: none !important;
}

.aai-button-secondary {
  background: #fff;
  border-color: var(--aai-border);
  color: var(--aai-navy) !important;
}

.aai-index a:focus-visible,
.aai-index button:focus-visible,
.aai-index select:focus-visible,
.aai-index input:focus-visible,
.aai-map-country:focus,
.aai-map-marker:focus {
  outline: 3px solid var(--aai-teal);
  outline-offset: 3px;
}

.aai-map-grid {
  background: #fff;
  border: 1px solid var(--aai-border);
  border-radius: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  overflow: hidden;
}

.aai-map-panel {
  min-width: 0;
}

.aai-panel-toolbar,
.aai-filterbar {
  align-items: center;
  border-bottom: 1px solid var(--aai-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.aai-map-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.aai-control-label {
  color: var(--aai-muted);
  display: grid;
  font-size: 0.74rem;
  font-weight: 800;
  gap: 0.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aai-control-label select {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.aai-panel-toolbar select,
.aai-filterbar input,
.aai-filterbar select,
.aai-compare-card select,
#aai-profile-switcher {
  background: #fff;
  border: 1px solid var(--aai-border);
  border-radius: 6px;
  color: var(--aai-navy);
  min-height: 42px;
  padding: 0.55rem 0.75rem;
}

.aai-map-reset {
  background: #fff;
  border: 1px solid var(--aai-border);
  border-radius: 6px;
  color: var(--aai-navy);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
}

.aai-map-reset:hover,
.aai-map-reset:focus {
  border-color: var(--aai-teal);
}

.aai-map-canvas {
  background: linear-gradient(0deg, #edf5f4 0%, #f5faf9 100%);
  height: 600px;
  min-height: 0;
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.aai-map-canvas.is-mapbox {
  background: #edf5f4;
  padding: 0;
}

.aai-map-canvas .mapboxgl-map {
  font: inherit;
  height: 100%;
  width: 100%;
}

.aai-map-canvas svg {
  display: block;
  height: auto;
  max-height: 620px;
  width: 100%;
}

.aai-map-loading,
.aai-map-empty {
  align-items: center;
  color: var(--aai-muted);
  display: flex;
  height: 100%;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
}

.aai-map-country,
.aai-map-marker circle {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 1.2;
  transition: filter 0.15s ease, stroke-width 0.15s ease;
}

.aai-map-country:focus,
.aai-map-marker:focus {
  outline-offset: 4px;
}

.aai-map-country:focus,
.aai-map-country.is-selected,
.aai-map-marker:focus circle,
.aai-map-marker.is-selected circle {
  filter: none;
  stroke: var(--aai-teal);
  stroke-linejoin: round;
  stroke-width: 2;
}

.aai-map-marker text {
  fill: var(--aai-navy);
  font-size: 12px;
  font-weight: 800;
}

.aai-score-band-1 {
  fill: #e7fbfd;
}

.aai-score-band-2 {
  fill: #b6eef5;
}

.aai-score-band-3 {
  fill: #70ddeb;
}

.aai-score-band-4 {
  fill: #05abc4;
}

.aai-score-band-5 {
  fill: #025d6c;
}

.aai-score-band-missing {
  fill: #d6dcdd;
}

.aai-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem;
}

.aai-map-status {
  border-top: 1px solid var(--aai-border);
  color: var(--aai-muted);
  font-size: 0.92rem;
  margin: 0;
  padding: 0.8rem 1.25rem;
}

.aai-map-fallback {
  border-top: 1px solid var(--aai-border);
  padding: 1rem 1.25rem;
}

.aai-map-fallback p {
  color: var(--aai-muted);
  margin: 0 0 0.8rem;
}

.aai-band {
  border: 1px solid rgba(15, 52, 64, 0.15);
  display: inline-block;
  height: 14px;
  margin-right: 0.3rem;
  vertical-align: -2px;
  width: 18px;
}

.aai-band-1 { background: #e7fbfd; }
.aai-band-2 { background: #b6eef5; }
.aai-band-3 { background: #70ddeb; }
.aai-band-4 { background: #05abc4; }
.aai-band-5 { background: #025d6c; }
.aai-band-missing { background: #d6dcdd; }

.aai-score-card {
  border-left: 1px solid var(--aai-border);
  padding: 2rem;
}

.aai-big-score {
  color: var(--aai-navy);
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1;
  margin: 1.3rem 0 0.8rem;
}

.aai-big-score small {
  color: var(--aai-muted);
  font-size: 1rem;
  margin-left: 0.25rem;
}

.aai-bar,
.aai-mini-bar {
  background: #e8f0ef;
  border-radius: 999px;
  display: block;
  height: 9px;
  overflow: hidden;
}

.aai-bar i,
.aai-mini-bar i {
  background: var(--aai-teal);
  display: block;
  height: 100%;
}

.aai-bar-muted i {
  background: #9fc4b5;
}

.aai-source-note,
.aai-empty-inline {
  color: var(--aai-muted);
  font-size: 0.92rem;
}

.aai-empty {
  background: #fff;
  border: 1px solid var(--aai-border);
  border-radius: 6px;
  padding: 1.25rem;
}

.aai-top-three {
  border: 1px solid var(--aai-border);
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.6rem 0;
  overflow: hidden;
}

.aai-top-card {
  color: var(--aai-navy) !important;
  display: block;
  min-height: 150px;
  padding: 1.4rem;
  text-decoration: none !important;
}

.aai-top-card + .aai-top-card {
  border-left: 1px solid var(--aai-border);
}

.aai-top-card span {
  color: var(--aai-muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.aai-top-card strong,
.aai-top-card em {
  display: block;
  font-style: normal;
}

.aai-top-card strong {
  font-size: 1.35rem;
  margin-top: 0.8rem;
}

.aai-top-card em {
  font-size: 2.3rem;
  margin-top: 1rem;
}

.aai-top-card small {
  color: var(--aai-muted);
  font-size: 0.85rem;
}

.aai-top-card.is-leading {
  background: var(--aai-navy);
  color: #fff !important;
}

.aai-top-card.is-leading span,
.aai-top-card.is-leading small {
  color: #c7d6d8;
}

.aai-table-wrap {
  overflow-x: auto;
}

.aai-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.aai-table th,
.aai-table td {
  border-bottom: 1px solid #e6ecec;
  padding: 1rem;
  text-align: left;
  vertical-align: top;
}

.aai-table th {
  color: var(--aai-muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.aai-mini-bar {
  display: inline-block;
  margin-left: 1rem;
  width: 170px;
}

.aai-compare-grid,
.aai-card-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aai-compare-card,
.aai-info-card,
.aai-section-panel,
.aai-note-box {
  background: #fff;
  border: 1px solid var(--aai-border);
  border-radius: 6px;
  padding: 1.5rem;
}

.aai-compare-card {
  border-top: 5px solid var(--aai-teal);
}

.aai-note-box {
  background: var(--aai-mint);
  border-left: 4px solid var(--aai-teal);
  margin-top: 1.6rem;
}

.aai-back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.aai-metric-strip {
  background: var(--aai-navy);
  border-radius: 6px;
  color: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 2rem 0 1.5rem;
}

.aai-metric-strip div {
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1.5rem;
}

.aai-metric-strip div:last-child {
  border-right: 0;
}

.aai-metric-strip span,
.aai-metric-strip small {
  color: #c7d6d8;
  display: block;
}

.aai-metric-strip span {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.aai-metric-strip strong {
  display: inline-block;
  font-size: 2.1rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.aai-tabs {
  border-bottom: 1px solid var(--aai-border);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
}

.aai-tabs a {
  padding: 0 0 0.9rem;
}

.aai-tabs a:first-child {
  border-bottom: 4px solid var(--aai-teal);
}

.aai-section,
.aai-section-panel {
  margin: 1.6rem 0;
}

.aai-section-panel {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.aai-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aai-link-list li {
  align-items: center;
  border-bottom: 1px solid var(--aai-border);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 48px 1fr auto;
  padding: 0.8rem 0;
}

.aai-score-bars p {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 1rem 0 0.4rem;
}

.aai-info-card span {
  color: var(--aai-muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.aai-country-list {
  columns: 2;
  margin: 1rem;
  padding-left: 1.2rem;
}

.aai-country-list li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}

@media (max-width: 900px) {
  .aai-heading-row,
  .aai-map-grid,
  .aai-section-panel {
    display: block;
  }

  .aai-score-card {
    border-left: 0;
    border-top: 1px solid var(--aai-border);
  }

  .aai-top-three,
  .aai-compare-grid,
  .aai-card-grid,
  .aai-metric-strip {
    grid-template-columns: 1fr;
  }

  .aai-top-card + .aai-top-card {
    border-left: 0;
    border-top: 1px solid var(--aai-border);
  }

  .aai-metric-strip div {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    border-right: 0;
  }

  .aai-map-canvas {
    height: 420px;
  }

  .aai-map-controls {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: flex-start;
    width: 100%;
  }

  .aai-control-label,
  .aai-control-label select,
  .aai-map-reset {
    width: 100%;
  }

  .aai-country-list {
    columns: 1;
  }
}

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

/* Shared index typography and containment, without restyling other theme pages. */
.aai-index { min-width: 0; max-width: 100%; }
.aai-index [hidden] { display: none !important; }
.aai-index h3 { font-size: 1.25rem; }
.aai-index h4 { font-size: 1rem; }
.aai-index h1, .aai-index h2, .aai-index h3, .aai-index h4,
.aai-index button, .aai-index select, .aai-index input { font-family: inherit; }
.aai-index select, .aai-index input { min-width: 0; max-width: 100%; font-size: 1rem; }
.aai-index select { width: 100%; min-height: 44px; }
.aai-index .aai-heading-row { gap: 1rem; margin-bottom: 1.5rem; }
.aai-index .aai-heading-row > *, .aai-index .aai-map-grid > *,
.aai-index .aai-compare-grid > *, .aai-index .aai-section-panel > *,
.aai-index .aai-map-controls > * { min-width: 0; }
.aai-index .aai-big-score { font-size: 3.25rem; overflow-wrap: anywhere; line-height: 1.2; }
.aai-index .aai-score-card { padding: 1.5rem; }
.aai-index .aai-score-card h3 { font-size: 1.75rem; }
.aai-index .aai-table-wrap { min-width: 0; max-width: 100%; overscroll-behavior-x: contain; }
.aai-index .aai-map-canvas { background: #f4f7f8; }
.aai-index .aai-map-status { font-size: .8125rem; }
.aai-index .aai-note-box { background: #f4f7f8; }
.aai-index .aai-metric-strip strong { font-size: 1.5rem; overflow-wrap: anywhere; }
.aai-index-page .wp-block-post-title {
  font: 600 2.25rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  color: #0f3440;
  margin-block: 1.5rem;
  max-width: var(--wp--style--global--wide-size, 1200px);
}
.aai-route-page { padding: 2rem max(20px, var(--wp--style--root--padding-left, 24px)); }
@media (max-width: 700px) {
  .aai-index .aai-heading-row { flex-wrap: wrap; }
  .aai-index .aai-filterbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .aai-index .aai-rankings, .aai-index .aai-map-controls { min-width: 0; }
  .aai-index .aai-map-controls { width: 100%; flex-wrap: wrap; }
  .aai-index .aai-map-controls > * { flex: 1 1 100%; }
  .aai-rankings .aai-table { min-width: 0; width: 100%; table-layout: fixed; }
  .aai-rankings .aai-table th, .aai-rankings .aai-table td { padding: .75rem .375rem; overflow-wrap: anywhere; }
  .aai-rankings .aai-table th:first-child { width: 16%; }
  .aai-rankings .aai-table th:nth-child(4) { width: 26%; }
  .aai-rankings .aai-table th:nth-child(3), .aai-rankings .aai-table td:nth-child(3),
  .aai-rankings .aai-table th:nth-child(5), .aai-rankings .aai-table td:nth-child(5) { display: none; }
  .aai-rankings .aai-mini-bar { width: 100%; }
  .aai-index .aai-compare-card, .aai-index .aai-score-card { padding: 1rem; }
  .aai-index .aai-section-panel { padding: 1rem; }
}
