.metric-main {
  padding: 26px clamp(18px, 4vw, 56px) 60px;
  max-width: 1500px;
  margin: 0 auto;
}

.metric-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 26px;
  align-items: stretch;
}

.metric-card,
.metric-side,
.metric-chart-card,
.related-card {
  border: var(--border);
  box-shadow: var(--shadow-lg);
}

.metric-card {
  background: var(--yellow);
  padding: clamp(20px, 3vw, 34px);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 190px;
  height: 190px;
  background: var(--pink);
  border: 4px solid var(--ink);
  transform: rotate(-14deg);
  z-index: 0;
}

.metric-card > * {
  position: relative;
  z-index: 1;
}

.metric-card h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin: 16px 0 4px;
  max-width: 12ch;
}

.metric-id {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.metric-value {
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 10vw, 8rem);
  line-height: 0.82;
  letter-spacing: -0.07em;
  margin: 20px 0 16px;
  word-break: break-word;
}

.metric-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-top: 3px solid var(--ink);
  padding-top: 12px;
}

.metric-meta span,
.metric-side span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 3px;
}

.metric-meta strong {
  font-size: clamp(12px, 1.4vw, 16px);
  text-transform: uppercase;
}

.metric-desc {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.6;
  max-width: 60ch;
}

.metric-side {
  background: var(--cyan);
  padding: clamp(20px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metric-read {
  font-size: 13px;
  line-height: 1.65;
  border-top: 3px solid var(--ink);
  padding-top: 12px;
}

.metric-read p {
  margin: 0 0 10px;
}

.metric-read .read-rule {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.metric-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.metric-chart-card,
.related-card {
  margin-top: 26px;
  background: var(--white);
  padding: clamp(16px, 3vw, 28px);
}

.metric-chart-card .section-head,
.related-card .section-head {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 10px;
}

.metric-chart-card .section-head h2,
.related-card .section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
}

#metric-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 14px;
  overflow: visible;
  touch-action: pan-y;
  cursor: crosshair;
  user-select: none;
}

.metric-grid { stroke: rgba(10, 10, 10, 0.16); stroke-width: 1; }
.metric-label { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
.metric-line { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.metric-area { fill: url(#metric-fill); }
.metric-dot { fill: var(--pink); stroke: var(--ink); stroke-width: 3; }
.metric-hover-line { stroke: var(--pink); stroke-width: 2; stroke-dasharray: 4 4; }
.metric-hover-dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; }
.metric-hover-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--white);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.metric-brush { fill: rgba(255, 79, 216, 0.22); stroke: var(--pink); stroke-width: 2; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.related-item {
  border: 3px solid var(--ink);
  background: var(--paper);
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.related-item:hover,
.related-item:focus-visible {
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
  outline: none;
}

.related-item strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.related-item span {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .metric-hero { grid-template-columns: 1fr; }
  .metric-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .metric-meta { grid-template-columns: 1fr; }
  .metric-card h2 { font-size: 2.2rem; }
}
