/* S08 and S21: keep SVG dimensions and content panels inside their measured stage. */
.timebudget { align-content: safe center; overflow: auto; min-height: 0; }
.timebudget__bar, .timebudget__grid, .timebudget__other { min-width: 0; }
.timebudget__grid .chart-note, .timebudget__other ul { margin-bottom: 0; }
.timebudget--split {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 16px 36px;
  align-items: start;
}
.timebudget--split > .chart-banner { grid-column: 1 / -1; grid-row: 1; margin: 0; }
.timebudget--split .timebudget__bar { grid-column: 1; grid-row: 2; }
.timebudget--split .timebudget__grid { grid-column: 2; grid-row: 2 / 4; align-self: center; }
.timebudget--split .timebudget__other { grid-column: 1; grid-row: 3; }
.timebudget--split .tb-grid { width: 100%; }
.timebudget .tb-corner,
.timebudget .tb-grid thead th:first-child { font-size: var(--fs-small); }
.timebudget .tb-corner { max-width: 8em; }
.timebudget .chart-svg { flex: none; }
.bridge { min-width: 0; min-height: 0; gap: 12px; }
.bridge > .chart-svg { flex: none; max-width: 100%; }
.bridge > .chart-note { max-width: 1160px; margin: 0; }

/* Paired evidence uses separate scales and shares the same sector order. */
.sector-comparison { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.sector-comparison--wide { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; }
.sector-comparison__panel { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.sector-comparison__panel h4 { font-size: var(--fs-body); margin: 0 0 4px; color: var(--text-primary); }
.sector-comparison__plot { flex: 1; min-height: 0; }
/* Keep each heading attached to its three bars when the screen is tall. */
.sector-comparison--wide .sector-comparison__panel { height: min(100%, 380px); align-self: center; }
.series-interval { opacity: .13; stroke: none; }
.scenario-variant { opacity: .55; stroke-width: 1.2; }
.legend__swatch--dash { background: repeating-linear-gradient(90deg, var(--sw) 0 6px, transparent 6px 10px); }
.tooltip:has(.lines-tip--scenario) { max-width: min(750px, calc(100vw - 16px)); }
.db-gain-value { fill: var(--text-primary) !important; font-size: var(--fs-lead) !important; font-weight: 500; }
.db-start-value { fill: var(--text-muted) !important; }
.db-end-value { fill: var(--text-primary) !important; }
.dumbbell__formula { margin-bottom: 8px; max-width: 60em; }
.tooltip:has(.dumbbell-tip--members) { max-width: min(640px, calc(100vw - 16px)); }
.dumbbell-tip--members .tip-row:last-child { display: block; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border-hairline); }
.dumbbell-tip--members .tip-row:last-child span { display: block; text-align: left; }

/* Interactive arithmetic keeps observed service volumes and editable assumptions apart. */
.timebudget--interactive { grid-template-rows: auto auto minmax(0, 1fr); gap: 12px 28px; align-content: stretch; }
.timebudget--interactive > .chart-banner { grid-column: 1 / -1; grid-row: 1; }
.time-controls { grid-column: 1 / -1; grid-row: 2; border: 0; margin: 0; padding: 0; display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.time-controls legend { font-size: var(--fs-small); color: var(--text-muted); margin-bottom: 4px; }
.time-control { flex: 1 1 125px; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-small); }
.time-control input { width: 100%; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-2); color: var(--text-primary); padding: 6px 10px; font: inherit; font-size: var(--fs-body); }
.timebudget__primary { grid-column: 1; grid-row: 3; min-width: 0; align-self: center; }
.timebudget__secondary { grid-column: 2; grid-row: 3; min-width: 0; align-self: center; display: flex; flex-direction: column; gap: 18px; }
.timebudget--interactive .timebudget__grid { align-self: stretch; }
.timebudget--interactive .timebudget__bar { margin-top: 8px; }
.time-result strong { display: block; font-size: clamp(1.65rem, 2.25vw, 2.5rem); font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.time-result p { margin: 6px 0 10px; font-size: var(--fs-small); }
.time-formula { margin: 0 0 4px; color: var(--text-primary); font-size: var(--fs-small); }
.time-formula-note { margin: 0; color: var(--text-muted); font-size: var(--fs-small); line-height: 1.4; }
@media (max-width: 820px) {
  .timebudget--interactive { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; }
  .timebudget__primary { grid-column: 1; grid-row: 3; }
  .timebudget__secondary { grid-column: 1; grid-row: 4; }
}
.time-controls > .time-control { flex: 1 1 220px; max-width: 430px; }
.time-control > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.time-control__value { font-size: var(--fs-lead); font-weight: 500; color: var(--text-primary); }
.time-control input[type="range"] { accent-color: var(--accent); min-height: 28px; padding: 0; cursor: pointer; }
.time-controls__more { position: relative; }
.time-controls__additional { position: absolute; top: calc(100% + 8px); right: 0; z-index: 6; display: grid; width: 290px; gap: 10px; padding: 16px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 8px 24px #0006; }
.time-result strong { font-size: clamp(3.5rem, 6.4vw, 6rem); line-height: 1.15; }
.time-result__label { display: block; color: var(--text-primary); font-size: var(--fs-lead); }
.timebudget--interactive .time-formula { margin-top: 18px; line-height: 1.8; }
.timebudget--interactive .timebudget__secondary { gap: 30px; }
