.answer,
.evidence,
.caveat,
.definition {
  margin: 1.75rem 0;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.answer {
  border-top: 4px solid var(--pine);
  box-shadow: var(--shadow);
}

.answer__label,
.evidence__label,
.caveat__label,
.definition__label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--pine);
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.answer > :last-child,
.evidence > :last-child,
.caveat > :last-child,
.definition > :last-child {
  margin-bottom: 0;
}

.evidence {
  border-left: 4px solid var(--pine);
}

.caveat {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.caveat .caveat__label {
  color: #75420a;
}

.definition {
  background: var(--mint-soft);
}

.key-number {
  display: grid;
  grid-template-columns: minmax(8rem, auto) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  margin: 1.75rem 0;
  padding: 1.4rem;
  background: var(--pine);
  color: var(--surface);
}

.key-number strong {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  font-weight: 620;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.key-number p {
  margin: 0;
  color: #dcebe4;
  font-size: 0.9rem;
  line-height: 1.45;
}

.figure {
  margin: 2rem 0;
}

.figure.wide,
.data-table.wide,
.control-panel.wide {
  width: calc(100% + var(--rail-width) + var(--rail-gap));
  max-width: none;
  margin-left: calc(-1 * (var(--rail-width) + var(--rail-gap)));
}

.figure__frame {
  min-height: 8rem;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.figure figcaption,
.table-caption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.figure figcaption strong,
.table-caption strong {
  color: var(--ink);
}

.data-table {
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

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

.data-table caption {
  padding: 0.9rem 1rem;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.78rem 0.9rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--mint-soft);
  color: var(--pine);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--mint) 22%, transparent);
}

.control-panel {
  margin: 1.75rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.control-group button,
.pill,
.route-button,
.timeline-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.control-group button,
.pill {
  padding: 0.55rem 0.78rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 720;
}

.control-group button:hover,
.pill:hover,
.route-button:hover,
.timeline-button:hover {
  border-color: var(--pine);
}

.control-group button[aria-pressed="true"],
.pill[aria-pressed="true"],
.pill.active,
.route-button[aria-pressed="true"],
.route-button.active,
.timeline-button[aria-pressed="true"],
.timeline-button.active {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--surface);
}

.source-list {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.83rem;
}

.source-list li {
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.metric-card {
  padding: 1rem;
  border-top: 3px solid var(--pine);
  background: var(--surface);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 730;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}

.bar-track {
  width: 100%;
  height: 0.42rem;
  overflow: hidden;
  background: #dce0db;
}

.bar-fill {
  width: var(--score, 0%);
  height: 100%;
  background: var(--pine);
}

.bar-fill.mid {
  background: #628a77;
}

.bar-fill.low,
.bar-fill.gap {
  background: var(--amber);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.45rem;
  background: var(--mint-soft);
  color: var(--pine);
  font-size: 0.64rem;
  font-weight: 790;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.badge.amber {
  background: var(--amber-soft);
  color: #75420a;
}

@media (max-width: 840px) {
  .key-number {
    grid-template-columns: 1fr;
  }

  .figure.wide,
  .data-table.wide,
  .control-panel.wide {
    width: 100%;
    margin-left: 0;
  }

  .figure__frame {
    padding: 0.75rem;
  }
}
