/* value: outcome, timing and cost visuals (public/pages/value.js). Tokens only. */
.value-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.value-period { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-variant-numeric: tabular-nums; }
.value-period > .icon { color: var(--text-3); }
.value-period .ui-pill { max-width: 100%; height: auto; padding-block: var(--s-1); white-space: normal; }

/* Glance band: outcomes beside time to decision; each chart sits in a panel. */
.value-glance { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gutter); align-items: start; }
.value-glance .viz-range-sub { display: none; }

.value-kpis { gap: var(--gutter); }
.value-cost-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin-bottom: var(--gutter); }
.value-cost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--gutter); align-items: start; }

/* Ranked rows: name and figure on one line, the proportional outcome bar under them. */
.value-rank-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); align-items: start; }
.value-rank-wrap { display: grid; gap: var(--s-3); }
.value-rank { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.value-rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-3); align-items: center; }
.value-rank-name { display: flex; align-items: center; gap: var(--s-2); min-width: 0; color: var(--text); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 500; }
.value-rank-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value-rank-name > :first-child:not(span) { flex: none; }
.value-rank-figure { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.value-rank-bar { grid-column: 1 / -1; display: flex; gap: 1px; height: 8px; border-radius: 2px; background: var(--neutral-soft); overflow: hidden; }
.value-seg { flex: none; width: var(--w); min-width: 2px; height: 100%; }
/* Same tones as OUTCOMES in value.js (statusTone for statuses, neutral ink otherwise). */
.value-seg.is-approved { background: var(--ok); }
.value-seg.is-unattended { background: var(--info); }
.value-seg.is-rejected { background: var(--chart-1); }
.value-seg.is-failed, .value-seg.is-needsAttention { background: var(--danger); }
.value-seg.is-cancelled { background: var(--text-3); }
.value-seg.is-open { background: var(--warn); }
.value-rank-all { justify-self: start; }

/* Full tables: the name column keeps room to read; headers wrap instead of widening the table. */
#value-all .ui-table th { white-space: normal; }
#value-all .ui-table :is(td, th):first-child { min-width: 22ch; }
.value-table-key { margin: var(--s-3) 0 0; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); max-width: 90ch; }

/* Earned autonomy cards. */
.value-autonomy { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--gutter); align-items: start; }
.value-autonomy-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.value-autonomy-text { margin: var(--s-3) 0 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
/* The bullet's summary repeats the card's own text; keep it for assistive technology only. */
.value-autonomy .viz-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.value-key { color: var(--text-3); font-family: var(--font-mono); font-size: var(--fs-xs); line-height: var(--lh-xs); overflow-wrap: anywhere; }
.value-cap { display: inline-flex; align-items: flex-start; gap: var(--s-2); }
.value-cap > span { display: grid; }

.value-notes { display: grid; gap: var(--s-2); margin: 0; padding-left: var(--s-5); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); max-width: 90ch; }
/* Executive risk controls: aligned reference / title / gaps / link columns, stacked on narrow screens. */
.exec-controls li { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 14rem) minmax(0, 1fr) minmax(0, 12rem); align-items: start; gap: var(--s-1) var(--s-3); }
.exec-controls li > * { margin: 0; }

@media (max-width: 1023px) {
  .value-glance { grid-template-columns: minmax(0, 1fr); }
  .exec-controls li { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .value-rank-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639px) {
  .value-cost-tiles { grid-template-columns: minmax(0, 1fr); }
}

/* Delivery evidence uses the existing Workflow, Value and Executive layouts. */
.delivery { display: grid; gap: var(--s-4); min-width: 0; }
.delivery :is(p, dd, code) { overflow-wrap: anywhere; }
.delivery .ui-pill { max-width: 100%; height: auto; white-space: normal; }
.delivery-actions { display: grid; gap: var(--s-5); min-width: 0; margin: 0; padding: 0; border: 0; }
.delivery-actions:disabled { opacity: .7; }
.delivery-form { display: grid; gap: var(--s-3); min-width: 0; padding: var(--s-4); border: 1px solid var(--line-subtle); border-radius: var(--r-md); background: var(--surface); }
.delivery-form > :is(h3, p) { margin: 0; }
.delivery-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.delivery-field { display: grid; gap: var(--s-2); min-width: 0; }
.delivery-wide { grid-column: 1 / -1; }
.delivery :is(input, select, textarea) { min-width: 0; width: 100%; max-width: 100%; }
.delivery textarea { resize: vertical; }
.delivery .ui-table th { white-space: normal; }
.delivery .button-row { flex-wrap: wrap; }
.delivery button { white-space: normal; min-height: 44px; }
@media (max-width: 639px) {
  .delivery-fields { grid-template-columns: minmax(0, 1fr); }
  .delivery .button-row > button { flex: 1 1 100%; }
}
