:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-subtle: #f1efe9;
  --border: #dfdbd2;
  --border-strong: #c8c3b8;
  --text: #191d22;
  --text-muted: #525965;
  --accent: #b83227;
  --accent-soft: #fdf2f0;
  --blue: #1f6fa8;
  --amber: #c2760a;
  --plum: #7a2048;
  --slate: #646c78;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(25, 29, 34, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #144e78;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
}

.site-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.6rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 72ch;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.meta-item dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.meta-item dd {
  margin: 0;
  color: var(--text);
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.75rem;
}

.section-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.38rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.section-card h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.section-card p {
  margin: 0 0 0.9rem;
}

.section-card p:last-child {
  margin-bottom: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 0.9rem;
  margin: 1.1rem 0 1.35rem;
}

.kpi-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.95rem 1.05rem;
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.kpi-card.kpi-blue .kpi-value {
  color: var(--blue);
}

.kpi-card.kpi-plum .kpi-value {
  color: var(--plum);
}

.kpi-label {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  line-height: 1.38;
  color: var(--text-muted);
}

.findings-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.findings-list li {
  margin-bottom: 0.55rem;
}

.findings-list li:last-child {
  margin-bottom: 0;
}

.prep-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--text);
}

.prep-list li {
  margin-bottom: 0.45rem;
}

.question-answer {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 0.9rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 0.9rem 0 1.25rem;
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.control-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.btn-toggle {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.38rem 0.78rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-toggle:hover {
  border-color: var(--text);
}

.btn-toggle[aria-pressed="true"] {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}

.chip-toggle input {
  margin: 0;
  accent-color: var(--text);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.chart-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1rem 0.75rem;
  background: var(--surface);
  margin-bottom: 1.25rem;
}

.chart-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
}

.chart-subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.chart-container {
  width: 100%;
  min-height: 280px;
  overflow-x: auto;
}

.chart-container svg {
  display: block;
  max-width: 100%;
  height: auto;
  font-family: var(--font-sans);
}

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

.chart-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.table-block {
  margin-top: 1.2rem;
}

.table-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.table-heading h3 {
  margin: 0;
}

.table-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
}

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

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table thead th {
  background: var(--surface-subtle);
  font-weight: 700;
  color: var(--text);
  position: sticky;
  top: 0;
}

.sort-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  width: 100%;
  justify-content: flex-end;
}

.data-table th:first-child .sort-btn {
  justify-content: flex-start;
}

.sort-btn:hover {
  color: var(--accent);
}

.sort-indicator {
  font-size: 0.72rem;
  opacity: 0.35;
  min-width: 0.85em;
  text-align: center;
}

th[aria-sort="ascending"] .sort-indicator,
th[aria-sort="descending"] .sort-indicator {
  opacity: 1;
  color: var(--accent);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #faf9f6;
}

.data-table tbody tr.row-highlight {
  background: #fbf5f4;
  font-weight: 600;
}

.data-table tbody tr.row-muted {
  color: var(--text-muted);
  font-style: italic;
}

.drawer-card {
  margin-bottom: 1.75rem;
}

.drawer-stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.drawer-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.drawer-details.drawer-standalone {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drawer-details summary {
  padding: 0.8rem 1.05rem;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-details.drawer-standalone summary {
  padding: 1.05rem 1.5rem;
  font-size: 1.05rem;
}

.drawer-details summary::-webkit-details-marker {
  display: none;
}

.drawer-summary-title {
  flex: 1 1 auto;
}

.drawer-summary-meta {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.drawer-details summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.drawer-details[open] summary::after {
  content: "−";
}

.drawer-body {
  padding: 1rem 1.15rem 1.15rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 8px 8px;
  font-size: 0.91rem;
}

.drawer-details.drawer-standalone .drawer-body {
  padding: 1.1rem 1.5rem 1.4rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.96rem;
}

.drawer-body .table-block:first-child {
  margin-top: 0;
}

.methodology-body h4 {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.methodology-body h4:first-child {
  margin-top: 0;
}

.methodology-body ul {
  margin: 0.3rem 0 0.6rem;
  padding-left: 1.2rem;
}

.methodology-body li {
  margin-bottom: 0.35rem;
}

.map-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1rem 0.8rem;
  background: var(--surface);
  margin-bottom: 1.25rem;
}

.map-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

.map-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.map-canvas {
  width: 100%;
  height: 500px;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #e9e6de;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(25, 29, 34, 0.25);
  display: inline-block;
}

.map-popup {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
  max-width: 270px;
}

.map-popup h4 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  line-height: 1.25;
}

.map-popup p {
  margin: 0 0 0.35rem;
}

.map-popup ul {
  margin: 0.25rem 0 0;
  padding-left: 1.05rem;
}

.map-popup li {
  margin-bottom: 0.2rem;
}

.map-popup-note {
  margin-top: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.site-footer {
  margin-top: 1rem;
  padding: 1.2rem 0.25rem 0;
  border-top: 1px solid var(--border-strong);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0 0 0.35rem;
}

  @media (max-width: 680px) {
  .page {
    padding: 1.1rem 0.75rem 2.5rem;
  }

  .site-header,
  .section-card {
    padding: 1.25rem 1.05rem;
  }

  .controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-canvas {
    height: 390px;
  }
}
