/* ==========================================================================
   Calculation Displays — DS primitives for computed values
   ----------------------------------------------------------------------------
   Visual treatments for a single label + scalar value, or a single weighted
   breakdown. Used primarily by Elements::Calculation but reusable on any
   page that needs to display a computed metric.

   Three families:
     1. Scalar     — one label + one number (Sum Answers / Average / Sum Elements / NPS)
     2. NPS        — variants tuned for signed [-100,+100] integer + zone
     3. Weighted   — variants for one Weighted Average breakdown

   Card variants (.ds-scorecard / .ds-nps-gauge / .ds-scorecard--hero / etc.)
   sit alongside chrome-less variants (.ds-stat-document / .ds-stat-banner /
   .ds-stat-leader) intended for editorial / report tone.
   ========================================================================== */


/* ──────────────────────────────────────────────────────────────────────────
   SCALAR — Card variants extending .ds-scorecard
   ────────────────────────────────────────────────────────────────────────── */

/* Hero — XXL display number with brand-tinted gradient panel */
.ds-scorecard--hero {
  background: linear-gradient(135deg, var(--accent-subtle), var(--accent-muted));
  border-color: var(--accent-muted);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-6);
  position: relative;
  overflow: hidden;
}
.ds-scorecard--hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -8%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, var(--brand-300), transparent 70%);
  opacity: .35;
  pointer-events: none;
}
.ds-scorecard--hero .ds-scorecard__label {
  color: var(--accent-hover);
  letter-spacing: 0.08em;
  position: relative;
}
.ds-scorecard--hero .ds-scorecard__value {
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  font-weight: 800;
  color: var(--brand-900);
  letter-spacing: -0.03em;
  position: relative;
}

/* Tile — compact square, smaller label, smaller value, fits at width 4/12 */
.ds-scorecard--tile {
  padding: var(--space-3) var(--space-4);
  display: inline-block;
  min-width: 120px;
}
.ds-scorecard--tile .ds-scorecard__label {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.ds-scorecard--tile .ds-scorecard__value {
  font-size: var(--text-2xl);
  margin-top: var(--space-2);
}


/* ──────────────────────────────────────────────────────────────────────────
   SCALAR — Stat primitives (alternative shapes / chrome-less)
   ────────────────────────────────────────────────────────────────────────── */

/* Pill / Chip — smallest possible footprint */
.ds-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5, 6px);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-muted);
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
}
.ds-stat-pill__value {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--brand-900);
}

/* Document Block — Professional Report
   Small-caps label · hairline rule · serif numeral. No card chrome. */
.ds-stat-document {
  padding: var(--space-1) 0;
}
.ds-stat-document__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding-bottom: var(--space-1-5, 6px);
  border-bottom: 1px solid var(--text-secondary);
}
.ds-stat-document__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.ds-stat-document__value {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: 1.05;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 60;
}
.ds-stat-document__caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-variation-settings: 'opsz' 18;
}

/* Leader-Dot Line — printed-document classic; reusable for any "label · · · value" */
.ds-stat-leader {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-1-5, 6px) 0;
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  font-variation-settings: 'opsz' 18;
}
.ds-stat-leader__label {
  color: var(--text-primary);
  white-space: nowrap;
}
.ds-stat-leader__dots {
  flex: 1;
  border-bottom: 2px dotted var(--text-tertiary);
  transform: translateY(-4px);
  min-width: 30px;
}
.ds-stat-leader__value {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.ds-stat-leader__caption {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-left: var(--space-2);
}

/* Centered Banner — magazine cover style; thin top/bottom rules */
.ds-stat-banner {
  text-align: center;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--text-secondary);
  border-bottom: 1px solid var(--text-secondary);
}
.ds-stat-banner__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-stat-banner__value {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(3rem, 5vw, 4rem);
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-top: var(--space-2);
  font-variation-settings: 'opsz' 72;
}

/* Ledger Line — financial statement row; no card */
.ds-stat-ledger {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-2-5, 10px) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.ds-stat-ledger__label {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.ds-stat-ledger__value {
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Statement Total — accountant convention; bold uppercase label, double-underlined mono total */
.ds-stat-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--space-3) 0 var(--space-1-5, 6px);
  border-top: 1px solid var(--text-secondary);
}
.ds-stat-total__label {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.ds-stat-total__value {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  padding-bottom: var(--space-1);
  border-bottom: 3px double var(--text-primary);
}

/* Editorial Caption — magazine pull-quote; numeral first, italic serif caption below */
.ds-stat-caption {
  padding: var(--space-1) 0;
}
.ds-stat-caption__value {
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: clamp(3.5rem, 6vw, 5rem);
  line-height: 0.95;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}
.ds-stat-caption__label {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
  font-variation-settings: 'opsz' 18;
}


/* ──────────────────────────────────────────────────────────────────────────
   NPS — Variants beyond .ds-nps-gauge
   ────────────────────────────────────────────────────────────────────────── */

/* Signed Hero — zone-tinted gradient panel; tone classes set color */
.ds-nps-hero {
  border: 1px solid;
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-6);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.ds-nps-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -8%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  opacity: .35;
  pointer-events: none;
}
.ds-nps-hero__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}
.ds-nps-hero__value {
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: clamp(3rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: var(--space-1);
  position: relative;
}
.ds-nps-hero__zone {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: var(--space-2);
  position: relative;
}

.ds-nps-hero--positive {
  background: linear-gradient(135deg, var(--status-success-bg), #dcfce7);
  border-color: #bbf7d0;
}
.ds-nps-hero--positive::before { background: radial-gradient(circle, #86efac, transparent 70%); }
.ds-nps-hero--positive .ds-nps-hero__label,
.ds-nps-hero--positive .ds-nps-hero__zone { color: var(--status-success-text); }
.ds-nps-hero--positive .ds-nps-hero__value { color: #14532d; }

.ds-nps-hero--neutral {
  background: linear-gradient(135deg, var(--status-warning-bg), #fef3c7);
  border-color: #fde68a;
}
.ds-nps-hero--neutral::before { background: radial-gradient(circle, #fcd34d, transparent 70%); }
.ds-nps-hero--neutral .ds-nps-hero__label,
.ds-nps-hero--neutral .ds-nps-hero__zone { color: var(--status-warning-text); }
.ds-nps-hero--neutral .ds-nps-hero__value { color: #78350f; }

.ds-nps-hero--negative {
  background: linear-gradient(135deg, var(--status-error-bg), #fee2e2);
  border-color: #fecaca;
}
.ds-nps-hero--negative::before { background: radial-gradient(circle, #fca5a5, transparent 70%); }
.ds-nps-hero--negative .ds-nps-hero__label,
.ds-nps-hero--negative .ds-nps-hero__zone { color: var(--status-error-text); }
.ds-nps-hero--negative .ds-nps-hero__value { color: #7f1d1d; }

/* Score + Zone Pill — neutral card with detached colored zone pill */
.ds-nps-pill-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.ds-nps-pill-card__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-nps-pill-card__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-top: var(--space-1);
}
.ds-nps-pill-card__value {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-4xl);
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.ds-nps-pill-card__zone {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ds-nps-pill-card__zone--positive {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}
.ds-nps-pill-card__zone--neutral {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}
.ds-nps-pill-card__zone--negative {
  background: var(--status-error-bg);
  color: var(--status-error-text);
}

/* Dial / Arc Gauge — semi-circular gauge with needle; SVG provided by view */
.ds-nps-dial {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.ds-nps-dial__svg {
  flex: none;
  width: 140px;
  height: 80px;
}
.ds-nps-dial__col {
  flex: 1;
  min-width: 0;
}
.ds-nps-dial__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-nps-dial__value {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-3xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.ds-nps-dial__zone {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: var(--space-1);
}
.ds-nps-dial__zone--positive { color: var(--status-success-text); }
.ds-nps-dial__zone--neutral  { color: var(--status-warning-text); }
.ds-nps-dial__zone--negative { color: var(--status-error-text); }

/* Document Block (NPS) — same template as .ds-stat-document with optional zone caption */
/* Re-uses .ds-stat-document classes; no extra CSS needed. */

/* Leader-Dot Line (NPS) — re-uses .ds-stat-leader with .ds-stat-leader__caption for zone */
/* No extra CSS needed. */


/* ──────────────────────────────────────────────────────────────────────────
   WEIGHTED AVERAGE — Variants for one breakdown
   ────────────────────────────────────────────────────────────────────────── */

/* Stacked Contribution Bar — total above, single segmented bar, legend below */
.ds-weighted-stack {
  padding: var(--space-4) var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.ds-weighted-stack__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2-5, 10px);
}
.ds-weighted-stack__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-weighted-stack__total {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-3xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.ds-weighted-stack__bar {
  display: flex;
  height: 18px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--surface-sunken);
}
.ds-weighted-stack__seg { height: 100%; }
.ds-weighted-stack__seg--1 { background: var(--brand-700); }
.ds-weighted-stack__seg--2 { background: var(--brand-500); }
.ds-weighted-stack__seg--3 { background: var(--brand-400); }
.ds-weighted-stack__seg--4 { background: var(--brand-300); }
.ds-weighted-stack__seg--5 { background: var(--brand-200); }
.ds-weighted-stack__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2-5, 10px);
}
.ds-weighted-stack__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5, 6px);
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.ds-weighted-stack__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

/* Ranked Bar List — total in header, each row a name + bar + value, ranked desc */
.ds-weighted-ranked {
  padding: var(--space-4) var(--space-5);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.ds-weighted-ranked__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
}
.ds-weighted-ranked__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-weighted-ranked__total {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-3xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.ds-weighted-ranked__row {
  display: grid;
  grid-template-columns: 140px 1fr 70px;
  align-items: center;
  gap: var(--space-2-5, 10px);
  padding: var(--space-1-5, 6px) 0;
}
@media (max-width: 640px) {
  .ds-weighted-ranked__row { grid-template-columns: 1fr 60px; }
  .ds-weighted-ranked__row .ds-weighted-ranked__row-track { grid-column: 1 / -1; order: 3; }
}
.ds-weighted-ranked__row-label {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.ds-weighted-ranked__row-track {
  height: 8px;
  background: var(--surface-sunken);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.ds-weighted-ranked__row-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
}
.ds-weighted-ranked__row-val {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Total + Mini Breakdown — big total left, ranked mini-bar list right */
.ds-weighted-twoup {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 1.4fr;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
  .ds-weighted-twoup { grid-template-columns: 1fr; }
  .ds-weighted-twoup__big { padding-right: 0; border-right: 0; padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-subtle); }
}
.ds-weighted-twoup__big {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: var(--space-4);
  border-right: 1px solid var(--border-subtle);
}
.ds-weighted-twoup__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-weighted-twoup__total {
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-top: var(--space-1);
}
.ds-weighted-twoup__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5, 6px);
}
.ds-weighted-twoup__row {
  display: grid;
  grid-template-columns: 1fr 50px;
  align-items: center;
  gap: var(--space-2);
}
.ds-weighted-twoup__row-label {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  color: var(--text-primary);
}
.ds-weighted-twoup__row-val {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.ds-weighted-twoup__row-track {
  grid-column: 1 / -1;
  height: 5px;
  background: var(--surface-sunken);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 2px;
}
.ds-weighted-twoup__row-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
}

/* Total Only — just the rolled-up total as a scorecard, breakdown hidden */
.ds-weighted-total {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.ds-weighted-total__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-weighted-total__value {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-4xl);
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.ds-weighted-total__meta {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* Donut + Legend — circular donut split by contribution, total in center */
.ds-weighted-donut {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
  .ds-weighted-donut { flex-direction: column; gap: var(--space-3); align-items: stretch; }
}
.ds-weighted-donut__svg {
  flex: none;
  width: 130px;
  height: 130px;
  align-self: center;
}
.ds-weighted-donut__col {
  flex: 1;
  min-width: 0;
}
.ds-weighted-donut__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ds-weighted-donut__total {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-3xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: var(--space-2);
}
.ds-weighted-donut__legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.ds-weighted-donut__legend-row {
  display: grid;
  grid-template-columns: auto 1fr 60px;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.ds-weighted-donut__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.ds-weighted-donut__num {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Document Statement (Weighted) — chrome-less; serif row labels, mono numerals, double-underlined total */
.ds-weighted-document {
  padding: var(--space-1) 0;
}
.ds-weighted-document__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding-bottom: var(--space-1-5, 6px);
  border-bottom: 1px solid var(--text-secondary);
}
.ds-weighted-document__row {
  display: grid;
  grid-template-columns: 1fr 70px 100px;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-base);
  font-variation-settings: 'opsz' 18;
}
.ds-weighted-document__row-label {
  color: var(--text-primary);
}
.ds-weighted-document__row-weight {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.ds-weighted-document__row-val {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.ds-weighted-document__total {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: var(--space-3);
  padding: var(--space-3) 0 var(--space-1-5, 6px);
  border-top: 1px solid var(--text-secondary);
  margin-top: var(--space-1);
}
.ds-weighted-document__total-label {
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 18;
}
.ds-weighted-document__total-val {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  padding-bottom: var(--space-1);
  border-bottom: 3px double var(--text-primary);
}

/* Leader-Dot Statement (Weighted) — printed-statement style; rows on dotted leaders */
.ds-weighted-leader {
  padding: var(--space-1) 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-base);
  font-variation-settings: 'opsz' 18;
}
.ds-weighted-leader__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-1-5, 6px) 0;
}
.ds-weighted-leader__label {
  color: var(--text-primary);
}
.ds-weighted-leader__weight {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.ds-weighted-leader__dots {
  flex: 1;
  border-bottom: 2px dotted var(--text-tertiary);
  transform: translateY(-4px);
  min-width: 30px;
}
.ds-weighted-leader__val {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.ds-weighted-leader__total {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2-5, 10px) 0 var(--space-1-5, 6px);
  margin-top: var(--space-1-5, 6px);
  border-top: 1px solid var(--text-secondary);
}
.ds-weighted-leader__total-label {
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 18;
}
.ds-weighted-leader__total-dots {
  flex: 1;
  border-bottom: 2px dotted var(--text-tertiary);
  transform: translateY(-4px);
  min-width: 30px;
}
.ds-weighted-leader__total-val {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  padding-bottom: var(--space-1);
  border-bottom: 3px double var(--text-primary);
}
