.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid-primary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.summary-grid-primary .metric {
  border-radius: 14px;
  padding: 9px 10px;
}

.summary-grid-primary .metric .label {
  font-size: 11px;
  margin-bottom: 4px;
}

.summary-grid-primary .metric .value {
  font-size: 18px;
  line-height: 1.16;
}

.summary-grid-primary .metric .sub {
  font-size: 11px;
  margin-top: 3px;
}

.summary-grid-secondary {
  margin-top: 8px;
}

.history-summary-grid {
  margin-bottom: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 251, 255, 0.9) 100%);
  border: 1px solid #dde6ee;
  border-radius: 16px;
  padding: 11px 14px;
  box-shadow: 0 8px 18px rgba(16, 32, 51, 0.03);
  min-width: 0;
  opacity: 0.88;
}

.metric .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric .value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  overflow-wrap: anywhere;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.metric .value.ok {
  color: #0b6a43;
}

.metric .value.error {
  color: var(--danger);
}

.metric .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.metric-primary {
  border-color: #d4e1f2;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
  opacity: 0.96;
}

.summary-more {
  border: 1px solid #d7e2ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  overflow: hidden;
}

.summary-more summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #16324c;
}

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

.summary-more summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.summary-more:not([open]) summary::after {
  content: "▸";
}

.summary-more .summary-grid-secondary {
  padding: 0 12px 12px;
}

.history-metric {
  position: relative;
}

.history-metric.featured {
  border-color: #d5e0ea;
  border-radius: 16px;
  padding: 16px;
}

.history-metric.featured .label {
  font-size: 13px;
  font-weight: 700;
}

.history-metric.featured .value {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.history-metric.featured.tone-primary {
  background: linear-gradient(180deg, #f7fbff 0%, #eef5fc 100%);
  border-color: #cfe0f5;
}

.history-metric.featured.tone-positive {
  background: linear-gradient(180deg, #f4fbf7 0%, #ebf7f0 100%);
  border-color: #cae8d6;
}

.history-metric.featured.tone-amber {
  background: linear-gradient(180deg, #fffaf0 0%, #fff5df 100%);
  border-color: #f0ddaa;
}
