/* Batch U12-D (reports-whatif.js): the three-views strip on Reports, Reports › What-if, and the forecast's track record on
   Trends (reports-insights.js). reports.css tokens. */
.wi-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.shop-on .wi-three-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 9px 12px; text-align: left; white-space: normal;
  background: var(--surface); color: var(--ink); border-radius: var(--r-l); box-shadow: 0 0 0 .5px var(--hair); }
.shop-on .wi-three-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.wi-three-label { font-weight: 650; font-size: 14.5px; }
.wi-three-what { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.shop-on .wi-three-btn.wi-whatif .wi-three-label::after { content: " · scenario"; font-weight: 500; color: var(--ink-2); }

.wi-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; align-items: start; }
.wi-grid > .rp-card { margin-bottom: 0; }
/* a card with a band head is a grid elsewhere: keep its one column inside the card (the table scrolls in its own wrap) */
.wi-card { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.wi-card > * { min-width: 0; }
.wi-lede { margin-top: 4px; }
.rs-chip.wi-chip-obs { background: var(--fill); color: var(--ink); }
.rs-chip.wi-chip-whatif { background: var(--amber-soft, #fff4dc); color: var(--amber, #8a5a00); font-weight: 600; }
.rs-chip.wi-chip-exp { background: var(--amber-soft, #fff4dc); color: var(--amber, #8a5a00); font-weight: 600; }
.wi-steps { display: grid; gap: 2px; margin-top: 10px; }
.wi-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.wi-step:last-child { border-bottom: 0; }
.wi-step-label { font-weight: 550; min-width: 0; }
.wi-step-val { font: 700 20px/1.2 var(--font-display); font-variant-numeric: tabular-nums; text-align: right; }
.wi-step-sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.wi-def { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-3, var(--ink-2)); overflow-wrap: anywhere; }

.wi-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.wi-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wi-field-wide { grid-column: 1 / -1; }
.wi-field-label { font-size: 13px; font-weight: 600; }
.wi-in { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.wi-in input { min-height: 40px; width: 7.5em; min-width: 0; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.wi-in select { min-height: 40px; max-width: 100%; }
.wi-unit { font-size: 13px; color: var(--ink-2); }
.wi-obs { font-size: 12px; color: var(--ink-2); }
.wi-double { font-size: 12.5px; }
.wi-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.wi-msg:empty { display: none; }
.wi-res { margin-top: 10px; }
.wi-table td.wi-sc { font-weight: 700; }
.wi-assume { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.wi-assume li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 10px; background: var(--fill); border-radius: var(--r-s, 8px); }
.wi-a-label { font-weight: 550; }
.wi-a-src { font-size: 12.5px; color: var(--ink-2); }
.wi-assume .wi-def { display: inline; margin-left: auto; }
.wi-diff { margin-top: 10px; font-size: 13px; }
.wi-diff summary { cursor: pointer; color: var(--ink-2); }
.wi-limit { font-size: 12.5px; }
.wi-save { margin-top: 12px; }

/* U13-D: Ask states the part of the company each answer covers */
.rs-chip.ri-scope-chip { background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: normal; }
.ri-now { margin-top: 6px; font-size: 13px; }
/* a same-name hint must stay readable on a phone: the answer's rows wrap instead of scrolling the hint away */
@media (max-width: 600px) { .ri-ask-table th[scope="row"], .ri-ask-table td:last-child { white-space: normal; } .ri-ask-table th[scope="row"] { overflow-wrap: anywhere; } }

/* U14-D: other payers' receivables on a phone: job, payer and what is still owed (share, settled and age on wider screens) */
@media (max-width: 600px) { .ri-op-table th:nth-child(3), .ri-op-table td:nth-child(3), .ri-op-table th:nth-child(4), .ri-op-table td:nth-child(4), .ri-op-table th:nth-child(6), .ri-op-table td:nth-child(6) { display: none; } .ri-op-table td:nth-child(2) { white-space: normal; } }

/* Trends: the forecast's track record */
.wi-eval { margin-top: 10px; min-width: 0; }
.rp-card:has(> .wi-eval) { grid-template-columns: minmax(0, 1fr); }
.rp-card:has(> .wi-eval) > * { min-width: 0; }
.wi-eval-sum { margin: 4px 0 8px; font-size: 13.5px; }
.wi-eval .rp-table td, .wi-eval .rp-table th { font-size: 12.5px; }
.wi-eval-meta { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.wi-fc-save { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }

@media (max-width: 860px) {
  .wi-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .wi-three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .shop-on .wi-three-btn { min-height: 48px; padding: 7px 8px; }
  .wi-three-what { display: none; }
  .shop-on .wi-three-btn.wi-whatif .wi-three-label::after { content: ""; }
  .wi-form { grid-template-columns: minmax(0, 1fr); }
  .wi-in input { width: 100%; flex: 1 1 6em; }
  .wi-assume .wi-def { display: block; margin-left: 0; }
  .wi-table th, .wi-table td { white-space: normal; padding-left: 4px; padding-right: 4px; }
  .wi-table thead th:first-child { font-size: 11px; }
  .wi-eval-table th, .wi-eval-table td { white-space: normal; }
}

/* U16-D: how the saved forecasts did (reports-insights.js, Trends) */
.wi-tr + .wi-tr { margin-top: 16px; }
.wi-tr-h { margin: 6px 0 4px; font-size: 15px; }
.wi-tr-one { margin-top: 8px; min-width: 0; }
.wi-tr-one .rp-table td, .wi-tr-one .rp-table th { font-size: 12.5px; }
/* on a phone each row is a small block: the week or horizon on top, then each value under its label (data-label) */
@media (max-width: 600px) {
  .wi-tr .rp-table thead { display: none; }
  .wi-tr .rp-table, .wi-tr .rp-table tbody { display: block; width: 100%; }
  .wi-tr .rp-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 14px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
  .wi-tr .rp-table th[scope="row"] { grid-column: 1 / -1; text-align: left; padding: 0; border: 0; }
  .wi-tr .rp-table td { display: flex; justify-content: space-between; gap: 6px; padding: 0; border: 0; white-space: normal; text-align: right; min-width: 0; }
  .wi-tr .rp-table td::before { content: attr(data-label); color: var(--ink-2); text-align: left; }
}
