/* What-If, ML and Canvas, plus custom output views. */

.canvas-whatif {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px;
  color: var(--ps-charcoal);
}
.canvas-whatif > header,
.canvas-whatif-head,
.canvas-whatif-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.canvas-whatif h2,
.canvas-whatif h3 {
  margin: 0;
}
.canvas-whatif p {
  margin: 5px 0;
  color: var(--ps-muted);
}
.canvas-whatif-actions {
  display: flex;
  gap: 8px;
}
.canvas-whatif-context,
.canvas-whatif-card,
.canvas-whatif-grid aside section,
.canvas-whatif-info {
  background: var(--ps-panel);
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  box-shadow: 0 2px 6px #1322380d;
}
.canvas-whatif-context {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.2fr;
  gap: 18px;
  padding: 15px;
  margin: 16px 0;
}
.canvas-whatif-context > * {
  display: grid;
  gap: 5px;
}
.canvas-whatif-context span {
  display: flex;
  gap: 8px;
  align-items: center;
}
.canvas-whatif-context small {
  color: var(--ps-muted);
}
.canvas-whatif-context input,
.canvas-whatif select,
.canvas-whatif input {
  min-height: 34px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--ps-input);
}
.canvas-whatif-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
}
.canvas-whatif-grid main {
  min-width: 0;
  display: grid;
  gap: 16px;
}
.canvas-whatif-card {
  padding: 16px;
}
.canvas-whatif-card h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
  margin-right: 6px;
}
.canvas-whatif table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 12px;
}
.canvas-whatif th,
.canvas-whatif td {
  padding: 10px 7px;
  border-bottom: 1px solid #edf1f4;
  text-align: left;
}
.canvas-whatif th {
  color: var(--ps-muted);
  font-weight: 600;
}
.canvas-whatif-empty,
.canvas-whatif-chart {
  padding: 28px;
  text-align: center;
  color: #7a8795;
  background: #f8fafb;
  border: 1px dashed var(--ps-line-strong);
  border-radius: 7px;
  margin-top: 12px;
}
.canvas-whatif-card footer {
  margin-top: 12px;
}
.canvas-whatif-metric-placeholders {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.canvas-whatif-metric-placeholders i {
  display: block;
  height: 74px;
  background: #f4f7f9;
  border-radius: 7px;
}
.canvas-whatif-chart {
  height: 155px;
  padding-top: 55px;
}
.canvas-whatif-grid aside {
  display: grid;
  align-content: start;
  gap: 14px;
}
.canvas-whatif-grid aside section {
  padding: 15px;
}
.canvas-whatif-grid aside h3 {
  font-size: 14px;
}
.canvas-whatif-grid aside li {
  font-size: 12px;
  margin: 9px 0;
}
.canvas-whatif-grid aside button {
  display: block;
  width: 100%;
  margin: 7px 0;
  text-align: left;
}
.canvas-whatif-safety {
  margin: 16px auto 0;
  padding: 11px;
  text-align: center;
  background: #eef8f7;
  color: #356b70;
  border-radius: 7px;
}
.canvas-whatif-info {
  padding: 12px;
}
.canvas-whatif-backdrop {
  position: fixed;
  inset: 0;
  background: #12203333;
  z-index: 50;
}
.canvas-whatif-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(390px, 92vw);
  z-index: 51;
  background: var(--ps-overlay);
  box-shadow: -8px 0 24px #10203324;
  overflow-y: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 12px;
}
.canvas-whatif-drawer header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.canvas-whatif-drawer label,
.canvas-whatif-drawer fieldset {
  display: grid;
  gap: 6px;
  font-size: 13px;
  border: 0;
  padding: 0;
  margin: 0;
}
.canvas-whatif-drawer fieldset label {
  display: block;
  margin: 8px 0;
}
.canvas-whatif-drawer footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
}
.canvas-whatif-base {
  padding: 10px;
  background: #f3f8f8;
  border-radius: 7px;
  display: grid;
  gap: 4px;
}
.canvas-whatif-base small {
  color: var(--ps-muted);
}
@media (max-width: 980px) {
  .canvas-whatif-grid {
    grid-template-columns: 1fr;
  }
  .canvas-whatif-grid aside {
    grid-template-columns: repeat(3, 1fr);
  }
  .canvas-whatif-context {
    grid-template-columns: 1fr;
  }
  .canvas-whatif > header {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 680px) {
  .canvas-whatif-grid aside {
    grid-template-columns: 1fr;
  }
  .canvas-whatif-metric-placeholders {
    grid-template-columns: repeat(2, 1fr);
  }
  .canvas-whatif-actions {
    flex-wrap: wrap;
  }
}

/* ML What-If scenario setup: compactly reuses the Canvas context-card treatment. */
.scenario-setup-context {
  grid-template-columns: minmax(170px, 1.15fr) repeat(2, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 14px;
}
.scenario-setup-context .filter-field {
  min-width: 0;
}
.scenario-setup-context .smart-select {
  width: 100%;
}
.scenario-baseline-summary {
  align-content: start;
}
.scenario-baseline-summary strong {
  font-size: 15px;
}
.scenario-context-actions {
  display: flex !important;
  align-items: end;
  gap: 8px;
}
.scenario-context-actions .btn {
  min-height: 34px;
  white-space: nowrap;
}
.scenario-period-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scenario-period-range .smart-select {
  min-width: 0;
  flex: 1;
}
.scenario-period-end {
  min-height: 34px;
  padding: 8px 0;
  white-space: nowrap;
  color: #465568;
  font-weight: 600;
}
.scenario-baseline-models {
  grid-column: 1/-1;
  grid-template-columns: auto 1fr auto !important;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #edf1f4;
}
.scenario-baseline-models > span {
  font-weight: 700;
  color: var(--ps-charcoal);
}
.scenario-baseline-models > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--ps-muted);
  font-size: 12px;
}
.scenario-baseline-models > div span {
  display: block;
}
.scenario-baseline-models b {
  color: var(--ps-charcoal);
  font-weight: 600;
}
.scenario-baseline-models .btn-link {
  padding: 0;
  min-height: auto;
  color: var(--ps-teal-text);
}
.scenario-context-feedback {
  grid-column: 1/-1;
  margin: 0;
}
@media (max-width: 980px) {
  .scenario-setup-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scenario-baseline-models {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }
  .scenario-context-actions {
    align-items: center;
  }
}
@media (max-width: 620px) {
  .scenario-setup-context {
    grid-template-columns: 1fr;
  }
  .scenario-baseline-models {
    grid-column: auto;
  }
  .scenario-context-actions {
    justify-content: flex-start;
  }
}

/* ML What-If assumptions reuse the Canvas table hierarchy without changing Canvas. */
.scenario-assumptions-head h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
}
.scenario-assumption-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  background: #f7fafb;
  border: 1px solid var(--ps-line);
  border-radius: 7px;
}
.scenario-assumption-picker label {
  font-size: 12px;
  font-weight: 600;
  color: #526273;
}
.scenario-assumption-picker select {
  min-width: 220px;
  min-height: 34px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--ps-input);
}
.scenario-assumption-table-wrap {
  overflow-x: auto;
}
.scenario-assumption-table {
  width: 100%;
  min-width: 910px;
  border-collapse: collapse;
  font-size: 12px;
}
.scenario-assumption-table th,
.scenario-assumption-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf1f4;
  text-align: left;
  vertical-align: middle;
}
.scenario-assumption-table th {
  color: var(--ps-muted);
  font-weight: 600;
  white-space: nowrap;
}
.scenario-assumption-table td:nth-child(2),
.scenario-assumption-table td:nth-child(5),
.scenario-assumption-table td:nth-child(6),
.scenario-assumption-table td:nth-child(7) {
  white-space: nowrap;
}
.scenario-assumption-table select,
.scenario-assumption-table input {
  width: 132px;
  min-height: 34px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--ps-input);
}
.scenario-assumption-table input {
  width: 86px;
}
.scenario-assumption-empty {
  padding: 28px !important;
  text-align: center !important;
  color: #7a8795;
  background: #f8fafb;
}
.scenario-run-row {
  justify-content: flex-end;
}
.scenario-run-row .btn:first-child {
  margin-right: auto;
}
@media (max-width: 620px) {
  .scenario-assumption-picker {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .scenario-assumption-picker select {
    flex: 1;
    min-width: 180px;
  }
}

/* ML What-If market-event cards retain the established event state and calculations. */
.scenario-events-head h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
}
.scenario-event-form {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: #f8fbfc;
}
.scenario-event-form-head,
.scenario-event-form-actions,
.scenario-event-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.scenario-event-form-head {
  margin-bottom: 12px;
  color: var(--ps-charcoal);
}
.scenario-event-form-actions {
  justify-content: flex-end;
  margin-top: 12px;
}
.scenario-events {
  gap: 10px;
  margin-top: 0;
}
.scenario-event-card {
  padding: 14px 16px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: var(--ps-panel);
  box-shadow: 0 1px 3px #13223808;
}
.scenario-event-card h4 {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 14px;
}
.scenario-event-card header span {
  display: block;
  margin-top: 3px;
  color: var(--ps-muted);
  font-size: 12px;
}
.scenario-event-card-actions {
  display: flex;
  gap: 6px;
}
.scenario-event-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #edf1f4;
}
.scenario-event-card dl div {
  display: grid;
  gap: 3px;
}
.scenario-event-card dt {
  color: var(--ps-muted);
  font-size: 11px;
}
.scenario-event-card dd {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 13px;
  font-weight: 600;
}
.scenario-events-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--ps-line-strong);
  border-radius: 7px;
  background: #f8fafb;
  color: var(--ps-muted);
}
.scenario-events-empty svg {
  color: var(--ps-teal-text);
}
.scenario-events-empty div {
  display: grid;
  gap: 2px;
}
.scenario-events-empty strong {
  color: #465568;
  font-size: 13px;
}
.scenario-events-empty span {
  font-size: 12px;
}
.scenario-events-secondary {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
@media (max-width: 620px) {
  .scenario-event-card header {
    align-items: flex-start;
    flex-direction: column;
  }
  .scenario-event-card dl {
    grid-template-columns: 1fr;
  }
  .scenario-event-card-actions {
    width: 100%;
  }
  .scenario-event-form-actions {
    justify-content: flex-start;
  }
}

/* ML What-If scenario impact summary uses the existing calculated revenue series. */
.scenario-impact-summary {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
  box-shadow: 0 2px 6px #1322380d;
}
.scenario-impact-head {
  margin-bottom: 12px;
}
.scenario-impact-head h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
}
.scenario-impact-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.scenario-impact-kpi {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 94px;
  padding: 13px 14px;
  border: 1px solid #e1e8ec;
  border-radius: 8px;
  background: var(--ps-raised);
}
.scenario-impact-kpi span {
  color: var(--ps-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scenario-impact-kpi strong {
  color: var(--ps-charcoal);
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.scenario-impact-kpi.positive {
  border-left: 3px solid var(--ps-green);
}
.scenario-impact-kpi.positive strong {
  color: var(--ps-green);
}
.scenario-impact-kpi.negative {
  border-left: 3px solid var(--ps-red);
}
.scenario-impact-kpi.negative strong {
  color: var(--ps-red);
}
@media (max-width: 900px) {
  .scenario-impact-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .scenario-impact-kpis {
    grid-template-columns: 1fr;
  }
}

/* ML What-If trend presentation follows the compact Canvas chart-card pattern. */
.scenario-trend-section {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
  box-shadow: 0 2px 6px #1322380d;
}
.scenario-trend-head {
  align-items: end;
  margin-bottom: 12px;
}
.scenario-trend-head h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
}
.scenario-trend-head .filter-field {
  min-width: 190px;
}
.scenario-trend-head .filter-field label {
  font-size: 11px;
}
.scenario-trend-chart-wrap {
  width: 100%;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: var(--ps-panel);
}
.scenario-trend-chart-wrap .chart {
  width: 100%;
  height: 360px;
  min-height: 360px;
}
@media (max-width: 620px) {
  .scenario-trend-head {
    align-items: stretch;
    flex-direction: column;
  }
  .scenario-trend-head .filter-field {
    width: 100%;
  }
  .scenario-trend-chart-wrap,
  .scenario-trend-chart-wrap .chart {
    min-height: 300px;
    height: 300px;
  }
}

/* ML What-If detailed comparison uses the Canvas horizontal table pattern. */
.scenario-comparison-section {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
  box-shadow: 0 2px 6px #1322380d;
}
.scenario-comparison-head {
  align-items: center;
  margin-bottom: 12px;
}
.scenario-comparison-head h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
}
.scenario-comparison-wrap {
  overflow: auto;
  border: 1px solid #e5eaee;
  border-radius: 8px;
}
.scenario-comparison-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.scenario-comparison-table th,
.scenario-comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f4;
  text-align: right;
  white-space: nowrap;
}
.scenario-comparison-table thead th {
  background: #f7fafb;
  color: #536372;
  font-weight: 700;
}
.scenario-comparison-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 120px;
  text-align: left;
  background: var(--ps-panel);
  color: var(--ps-charcoal);
}
.scenario-comparison-table thead th:first-child {
  background: #f7fafb;
}
.scenario-comparison-table tr:last-child th,
.scenario-comparison-table tr:last-child td {
  border-bottom: 0;
}
.scenario-comparison-difference th,
.scenario-comparison-difference td,
.scenario-comparison-percentage th,
.scenario-comparison-percentage td {
  color: #9d3b33;
}
.scenario-baseline-safety {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 16px 0 0;
  padding: 11px;
  border-radius: 7px;
  background: #eef8f7;
  color: #356b70;
  font-size: 12px;
}
@media (max-width: 620px) {
  .scenario-comparison-head {
    align-items: stretch;
    flex-direction: column;
  }
  .scenario-baseline-safety {
    text-align: center;
  }
}

/* ML What-If result controls mirror the Canvas KPI hierarchy while retaining ML result data. */
.scenario-impact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.scenario-kpi-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.scenario-kpi-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.scenario-kpi-controls select {
  min-width: 150px;
  min-height: 36px;
}
.scenario-kpi-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.scenario-kpi-card {
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 12px 14px 11px;
  border: 1px solid #f0d2c4;
  border-left: 3px solid var(--ps-orange);
  border-radius: 10px;
  background: linear-gradient(145deg, var(--ps-panel) 0%, var(--ps-accent-soft) 100%);
  box-shadow:
    0 7px 18px rgba(217, 101, 50, 0.13),
    0 1px 2px rgba(31, 41, 55, 0.06);
}
.scenario-kpi-card small {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  color: #536372;
}
.scenario-kpi-card strong {
  margin: 2px 0 1px;
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.15;
  color: var(--ps-charcoal);
}
.scenario-kpi-card span,
.scenario-kpi-card i {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ps-muted);
  font-style: normal;
}
.scenario-kpi-card em {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  font-style: normal;
  font-weight: 700;
  color: var(--ps-orange-dark);
}
.scenario-kpi-card b {
  font-size: 12px;
  color: #536372;
}
.scenario-kpi-card i {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px solid rgba(217, 101, 50, 0.15);
}
.scenario-kpi-card.positive {
  border-left-color: var(--ps-green);
}
.scenario-kpi-card.negative {
  border-left-color: var(--ps-red);
}
.scenario-comparison-wrap {
  scrollbar-width: thin;
  scrollbar-color: #c8d3da transparent;
}
.scenario-comparison-wrap::-webkit-scrollbar {
  height: 8px;
}
.scenario-comparison-wrap::-webkit-scrollbar-thumb {
  background: #c8d3da;
  border-radius: 999px;
}
.scenario-trend-section,
.scenario-comparison-section {
  padding: 18px;
  margin-top: 18px;
}
.scenario-trend-head,
.scenario-comparison-head {
  margin-bottom: 14px;
}
.scenario-trend-chart-wrap,
.scenario-trend-chart-wrap .chart {
  height: 380px;
  min-height: 380px;
}
@media (max-width: 900px) {
  .scenario-kpi-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .scenario-kpi-controls {
    justify-content: flex-start;
    width: 100%;
  }
  .scenario-kpi-controls label {
    width: 100%;
    justify-content: space-between;
  }
  .scenario-kpi-controls select {
    flex: 1;
  }
  .scenario-kpi-cards {
    grid-template-columns: 1fr;
  }
  .scenario-trend-chart-wrap,
  .scenario-trend-chart-wrap .chart {
    height: 300px;
    min-height: 300px;
  }
}

/* ML What-If final layout parity with Canvas; Canvas selectors remain untouched. */
.content:has(.scenario-workflow) {
  width: 100%;
  max-width: none;
  padding: 20px 24px 32px;
}
.scenario-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin: 0 0 18px;
}
.scenario-page-head h2 {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 23px;
  line-height: 1.2;
}
.scenario-page-head p {
  margin: 5px 0 0;
  color: var(--ps-muted);
  font-size: 14px;
}
.scenario-top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.scenario-top-actions .btn {
  min-height: 36px;
  font-size: 13px;
}
.scenario-workflow {
  width: 100%;
  max-width: none;
  gap: 18px;
}
.scenario-setup-context {
  grid-template-columns: minmax(250px, 30%) minmax(210px, 1fr) minmax(210px, 1fr);
  gap: 18px;
  padding: 18px;
  margin: 0;
}
.scenario-period-range > span[aria-hidden],
.scenario-period-range .scenario-period-end {
  display: none;
}
.scenario-period-end-field {
  align-content: end;
}
.scenario-baseline-models {
  margin-top: 0;
}
.scenario-events-section {
  order: 3;
}
.scenario-section.data-card {
  order: 2;
}
@media (max-width: 980px) {
  .scenario-page-head {
    flex-direction: column;
  }
  .scenario-top-actions {
    justify-content: flex-start;
  }
  .scenario-setup-context {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .content:has(.scenario-workflow) {
    padding: 14px;
  }
  .scenario-setup-context {
    grid-template-columns: 1fr;
  }
  .scenario-top-actions {
    width: 100%;
  }
}

/* Canvas What-If Phase 1 layout refinement */
.content.epi-content:has(.canvas-whatif) {
  width: 100%;
  max-width: none;
  padding: 20px 24px 32px;
}
.canvas-whatif {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.canvas-whatif > header {
  width: 100%;
  min-height: 60px;
  align-items: flex-start;
}
.canvas-whatif > header h2 {
  font-size: 23px;
  line-height: 1.2;
}
.canvas-whatif > header p {
  font-size: 14px;
}
.canvas-whatif-actions .btn {
  min-height: 36px;
  font-size: 13px;
}
.canvas-whatif-context {
  grid-template-columns: minmax(260px, 30%) minmax(290px, 35%) minmax(320px, 1fr);
  gap: 20px;
  padding: 18px;
  margin: 18px 0;
}
.canvas-whatif-context strong {
  font-size: 15px;
}
.canvas-whatif-context input,
.canvas-whatif select,
.canvas-whatif input {
  font-size: 13px;
  min-height: 38px;
}
.canvas-whatif-grid {
  grid-template-columns: minmax(760px, 1fr) 280px;
  gap: 18px;
  align-items: start;
}
.canvas-whatif-grid main {
  gap: 18px;
}
.canvas-whatif-card {
  padding: 18px;
}
.canvas-whatif-card h3 {
  font-size: 16px;
}
.canvas-whatif-card p {
  font-size: 13px;
}
.canvas-whatif table {
  font-size: 13px;
  min-width: 940px;
}
.canvas-whatif-card.assumptions {
  overflow: hidden;
}
.canvas-whatif-card.assumptions table {
  margin-bottom: 0;
}
.canvas-whatif-card.assumptions > div:nth-of-type(2) {
  overflow-x: auto;
}
.canvas-whatif th,
.canvas-whatif td {
  padding: 12px 10px;
  white-space: nowrap;
}
.canvas-whatif th:first-child,
.canvas-whatif td:first-child {
  min-width: 190px;
}
.canvas-whatif th:nth-child(3),
.canvas-whatif td:nth-child(3) {
  min-width: 140px;
}
.canvas-whatif-empty {
  min-height: 72px;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.canvas-whatif-metric-placeholders {
  gap: 12px;
}
.canvas-whatif-metric-placeholders i {
  height: 116px;
  background: linear-gradient(var(--ps-panel), var(--ps-raised));
  border: 1px solid #dce7eb;
  border-radius: 8px;
  position: relative;
}
.canvas-whatif-metric-placeholders i:before,
.canvas-whatif-metric-placeholders i:after {
  content: "";
  position: absolute;
  left: 14px;
  right: 38%;
  height: 9px;
  border-radius: 5px;
  background: #e8eef1;
}
.canvas-whatif-metric-placeholders i:before {
  top: 16px;
}
.canvas-whatif-metric-placeholders i:after {
  top: 48px;
  right: 18px;
  height: 18px;
  background: #eef3f5;
}
.canvas-whatif-chart {
  height: 280px;
  padding-top: 112px;
  font-size: 14px;
}
.canvas-whatif-grid aside {
  width: 280px;
  gap: 16px;
}
.canvas-whatif-grid aside section {
  padding: 18px;
}
.canvas-whatif-grid aside h3 {
  font-size: 15px;
}
.canvas-whatif-grid aside li {
  font-size: 13px;
}
.canvas-whatif-safety {
  width: 100%;
  margin: 18px 0 0;
  font-size: 13px;
}
.canvas-whatif-sidebar-card {
  margin: 14px 10px 0;
  padding: 13px;
  border: 1px solid #d7e7ee;
  background: #f0f7fb;
  border-radius: 8px;
  font-size: 11px;
  color: #537083;
}
.canvas-whatif-sidebar-card strong {
  display: block;
  color: #2c6170;
  margin-bottom: 6px;
}
.canvas-whatif-sidebar-card p {
  margin: 6px 0;
}
.sidebar-collapsed .canvas-whatif-sidebar-card {
  display: none;
}
@media (max-width: 1120px) {
  .canvas-whatif-grid {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .canvas-whatif-context {
    grid-template-columns: 1fr 1fr;
  }
  .canvas-whatif-context > :last-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 980px) {
  .canvas-whatif-grid {
    grid-template-columns: 1fr;
  }
  .canvas-whatif-grid aside {
    width: auto;
    grid-template-columns: repeat(3, 1fr);
  }
  .canvas-whatif-context {
    grid-template-columns: 1fr;
  }
  .canvas-whatif-context > :last-child {
    grid-column: auto;
  }
}
@media (max-width: 700px) {
  .content.epi-content:has(.canvas-whatif) {
    padding: 14px;
  }
  .canvas-whatif-grid aside {
    grid-template-columns: 1fr;
  }
  .canvas-whatif > header {
    flex-direction: column;
  }
  .canvas-whatif-actions {
    flex-wrap: wrap;
  }
}

/* Canvas What-If drawer must never intercept global Canvas navigation. */
.app-shell:not(.sidebar-collapsed) .canvas-whatif-backdrop {
  left: 250px;
}
.app-shell.sidebar-collapsed .canvas-whatif-backdrop {
  left: 76px;
}

/* Canvas What-If: preserve the empty table row as a real full-width table cell. */
.canvas-whatif-table-wrap td.canvas-whatif-empty {
  display: table-cell;
  width: auto;
  min-width: 0;
  white-space: normal;
  text-align: center;
}
/* Canvas What-If navigation and chart containment cleanup. */
.canvas-whatif-actions {
  flex-wrap: nowrap;
  align-items: center;
}
.canvas-whatif-chart-wrap {
  width: 100%;
  min-height: 320px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px dashed var(--ps-line-strong);
  border-radius: 7px;
  background: #f8fafb;
}
.canvas-whatif-chart-wrap .canvas-whatif-chart {
  width: 100%;
  height: 320px;
  min-height: 320px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.canvas-whatif-chart-wrap .plotly,
.canvas-whatif-chart-wrap .js-plotly-plot {
  width: 100% !important;
  max-width: 100% !important;
}
.cw-unsaved-note {
  display: block;
  margin-top: 4px;
  color: #9a5a1f;
}
.canvas-whatif-sidebar-card {
  display: none;
}
@media (max-width: 980px) {
  .canvas-whatif-actions {
    flex-wrap: wrap;
  }
  .canvas-whatif-chart-wrap,
  .canvas-whatif-chart-wrap .canvas-whatif-chart {
    min-height: 290px;
    height: 290px;
  }
}

/* Canvas What-If Phase 4B1 review */
.cw-review {
  position: fixed;
  z-index: 52;
  inset: 4vh 5vw;
  background: var(--ps-panel);
  border-radius: 12px;
  box-shadow: 0 12px 40px #10203342;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  outline: 0;
}
.cw-review > header,
.cw-review > footer {
  padding: 18px 22px;
  border-bottom: 1px solid var(--ps-line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.cw-review > header h2 {
  margin: 0;
}
.cw-review > header p {
  margin: 5px 0;
  color: var(--ps-muted);
}
.cw-review > header small {
  color: var(--ps-muted);
}
.cw-review-body {
  overflow: auto;
  padding: 18px 22px;
}
.cw-review-body h3 {
  margin: 20px 0 8px;
}
.cw-review-table {
  overflow: auto;
  border: 1px solid #e5eaee;
  border-radius: 7px;
}
.cw-review table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
  font-size: 13px;
}
.cw-review th,
.cw-review td {
  padding: 10px;
  border-bottom: 1px solid #edf1f4;
  text-align: left;
}
.cw-review th {
  background: #f7fafb;
  color: #536372;
}
.cw-review details {
  margin: 9px 0;
  border: 1px solid #e2e9ed;
  border-radius: 7px;
  padding: 10px;
}
.cw-review summary {
  cursor: pointer;
  font-weight: 600;
}
.cw-split-review,
.cw-impact-review {
  padding: 12px;
  background: #f4f8f9;
  border-radius: 7px;
  line-height: 1.7;
}
.cw-review > footer {
  border-top: 1px solid var(--ps-line);
  border-bottom: 0;
  align-items: center;
}
.cw-review > footer label {
  max-width: 620px;
  font-size: 13px;
}
.cw-review > footer div {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .cw-review {
    inset: 2vh 2vw;
  }
  .cw-review > footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Canvas What-If result presentation repair. */
.canvas-whatif .cw-mode {
  display: block;
  margin-top: 4px;
  color: var(--ps-muted);
  font-size: 12px;
  font-weight: 500;
}
.canvas-whatif .cw-results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.canvas-whatif .cw-result-card {
  display: grid;
  gap: 5px;
  align-content: start;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--ps-line);
  border-radius: 9px;
  background: var(--ps-panel);
}
.canvas-whatif .cw-result-card .cw-result-name {
  font-size: 12px;
  color: #536372;
  white-space: normal;
}
.canvas-whatif .cw-result-card strong {
  font-size: 20px;
  line-height: 1.2;
  color: var(--ps-charcoal);
}
.canvas-whatif .cw-result-card span,
.canvas-whatif .cw-result-card i {
  font-size: 12px;
  color: var(--ps-muted);
  font-style: normal;
}
.canvas-whatif .cw-result-card em {
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  color: var(--ps-charcoal);
}
.canvas-whatif .cw-result-card b {
  font-size: 12px;
  color: #536372;
}
.canvas-whatif .cw-result-card.unchanged {
  background: #f8fafb;
}
.canvas-whatif .cw-result-card.increase,
.canvas-whatif .cw-result-card.decrease {
  border-left: 3px solid #7b8794;
}
.canvas-whatif .cw-comparison-wrap {
  overflow: auto;
  margin-top: 12px;
  border: 1px solid #e5eaee;
  border-radius: 8px;
}
.canvas-whatif .cw-comparison {
  min-width: max-content;
}
.canvas-whatif .cw-comparison th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f7fafb;
}
.canvas-whatif .cw-comparison tbody th {
  background: var(--ps-panel);
}
.canvas-whatif .cw-comparison tbody tr:last-child th,
.canvas-whatif .cw-comparison tbody tr:last-child td {
  border-bottom: 0;
}
@media (max-width: 1100px) {
  .canvas-whatif .cw-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .canvas-whatif .cw-results-grid {
    grid-template-columns: 1fr;
  }
}

/* Canvas What-If result presentation: compact KPI hierarchy and readable trend axes. */
.canvas-whatif .cw-results-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}
.canvas-whatif .cw-result-card {
  gap: 3px;
  min-height: 0;
  padding: 12px 14px 11px;
  border: 1px solid #f0d2c4;
  border-left: 3px solid var(--ps-orange);
  border-radius: 10px;
  background: linear-gradient(145deg, var(--ps-panel) 0%, var(--ps-accent-soft) 100%);
  box-shadow:
    0 7px 18px rgba(217, 101, 50, 0.13),
    0 1px 2px rgba(31, 41, 55, 0.06);
}
.canvas-whatif .cw-result-card .cw-result-name {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  color: #536372;
}
.canvas-whatif .cw-result-card strong {
  margin: 2px 0 1px;
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.15;
}
.canvas-whatif .cw-result-card span,
.canvas-whatif .cw-result-card i {
  line-height: 1.35;
}
.canvas-whatif .cw-result-card em {
  margin-top: 2px;
  line-height: 1.3;
  color: var(--ps-orange-dark);
}
.canvas-whatif .cw-result-card b {
  line-height: 1.3;
}
.canvas-whatif .cw-result-card i {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px solid rgba(217, 101, 50, 0.15);
}
.canvas-whatif .cw-result-card.unchanged {
  background: linear-gradient(145deg, var(--ps-panel) 0%, #fff9f5 100%);
}
.canvas-whatif .cw-result-card.increase,
.canvas-whatif .cw-result-card.decrease {
  border-left-color: var(--ps-orange);
}
.canvas-whatif-chart-wrap,
.canvas-whatif-chart-wrap .canvas-whatif-chart {
  min-height: 360px;
  height: 360px;
}
.canvas-whatif-chart-wrap {
  border-style: solid;
  border-color: var(--ps-line);
  background: var(--ps-panel);
}
@media (max-width: 1100px) {
  .canvas-whatif .cw-results-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}
@media (max-width: 980px) {
  .canvas-whatif-chart-wrap,
  .canvas-whatif-chart-wrap .canvas-whatif-chart {
    min-height: 330px;
    height: 330px;
  }
}
@media (max-width: 560px) {
  .canvas-whatif .cw-results-grid {
    grid-template-columns: 1fr;
  }
}

/* ML Reports & Analysis: Custom Outputs Phase 2A — Canvas Outputs UI */
/* Custom Outputs uses the Canvas Outputs shell geometry: one bounded panel,
   with the dashboard grid itself as the only scroll container. */
.custom-output-shell.epi-output-shell {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.custom-output-toolbar {
  border-radius: 0;
}

.custom-output-header-actions,
.custom-output-widget-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-output-header-actions {
  flex-wrap: nowrap;
}

.custom-output-header-actions > .btn,
.custom-output-mode-switch button,
.custom-output-view-bar .epi-dashboard-view-tabs button,
.custom-output-view-bar .epi-dashboard-view-actions .btn {
  white-space: nowrap;
}

.custom-output-mode-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: var(--ps-surface-soft);
}

.custom-output-mode-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ps-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.custom-output-mode-switch button.active {
  background: var(--ps-panel);
  color: var(--ps-teal-dark);
  box-shadow: 0 1px 4px rgba(31, 41, 55, 0.12);
}

.custom-output-slicers {
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.custom-output-slicers .smart-select-trigger {
  min-height: 32px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--ps-line);
  border-radius: 7px;
  background: var(--ps-input);
  color: var(--ps-charcoal);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.custom-output-filter-country {
  width: 155px;
  min-width: 155px;
}
.custom-output-filter-ta {
  width: 190px;
  min-width: 190px;
}
.custom-output-filter-from {
  width: 165px;
  min-width: 165px;
}
.custom-output-filter-to {
  width: 155px;
  min-width: 155px;
}

/* ML uses Canvas control dimensions, with deliberately separate view/action
   and filter rows so neither group competes for horizontal space. */
.custom-output-view-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px 16px 9px;
  overflow: visible;
}

.custom-output-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.custom-output-view-bar .epi-dashboard-view-tabs,
.custom-output-view-bar .epi-dashboard-view-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.custom-output-view-bar .custom-output-slicers {
  justify-content: flex-start;
  min-width: 0;
}

.custom-output-dashboard-body {
  min-height: 0;
  overflow: hidden;
  background: var(--ps-raised);
}

.custom-output-empty {
  min-height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  margin: 16px;
  padding: 32px;
  border: 1px dashed var(--ps-line-strong);
  border-radius: 10px;
  background: var(--ps-panel);
  color: var(--ps-muted);
  text-align: center;
}

.custom-output-empty > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--ps-sidebar-active);
  color: var(--ps-teal-text);
}

.custom-output-empty h3,
.custom-output-empty p {
  margin: 0;
}

.custom-output-empty h3 {
  color: var(--ps-ink);
  font-size: 16px;
}

.custom-output-empty p {
  max-width: 430px;
  font-size: 13px;
}

.custom-output-empty .btn {
  margin-top: 7px;
}

.custom-output-grid.epi-dashboard-grid {
  /* Inherit Canvas Outputs grid columns, 88px rows, 14px gap, 16px padding,
     card boundaries, and grid-owned overflow without a second scroll layer. */
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.custom-output-grid .custom-output-widget {
  min-width: 0;
  min-height: 0;
}

.custom-output-grid .custom-output-widget.kind-kpi {
  min-height: 0;
}

.custom-output-grid .custom-output-widget.kind-table {
  min-height: 0;
}

.custom-output-grid.editing .custom-output-widget {
  border-style: solid;
}

.custom-output-widget-header {
  min-height: 0;
}

.custom-output-widget-actions {
  flex: 0 0 auto;
}

.custom-output-widget-actions .btn-icon {
  min-width: 28px;
  min-height: 28px;
  padding: 5px;
}

.custom-output-chart {
  width: 100%;
  min-width: 0;
  min-height: 330px;
  height: 330px;
  overflow: hidden;
}

.custom-output-chart .plotly,
.custom-output-chart .js-plotly-plot {
  width: 100% !important;
  max-width: 100% !important;
}

.custom-output-table {
  max-height: 430px;
  overflow: auto;
}

/* Keep a long calculated-metric header from claiming the table's spare width. */
.custom-output-table .epi-dashboard-table {
  table-layout: fixed;
}

.custom-output-table .epi-dashboard-table th:first-child,
.custom-output-table .epi-dashboard-table td:first-child {
  width: 17%;
  min-width: 0;
}

.custom-output-table .epi-dashboard-table th:not(:first-child),
.custom-output-table .epi-dashboard-table td:not(:first-child) {
  width: auto;
  min-width: 0;
}

.custom-output-table .epi-dashboard-table th {
  white-space: normal;
  overflow-wrap: anywhere;
}

.custom-output-kpi span {
  color: var(--ps-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.custom-output-kpi strong {
  color: var(--dash-value, var(--ps-charcoal));
}

.custom-output-widget-modal {
  z-index: 281;
}

.custom-output-widget-modal .epi-dashboard-widget-type-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.custom-output-widget-modal .epi-dashboard-widget-preview-body .custom-output-widget {
  grid-column: auto;
  grid-row: auto;
}

.custom-output-widget-modal .epi-dashboard-widget-preview.preview-scatter .epi-dashboard-widget {
  min-height: 365px;
}

.custom-output-widget-modal .epi-dashboard-widget-preview.preview-scatter .epi-dashboard-chart {
  min-height: 300px;
  height: 300px;
}

/* Shared Canvas / ML dashboard widget card contract.
   Both renderers use .epi-dashboard-widget; the ML aliases below only
   neutralize old module-specific overrides so matching cards remain identical. */
.epi-dashboard-widget {
  --dashboard-widget-accent-width: 3px;
  --widget-accent: var(--dash-accent, #177e89);
  --dashboard-widget-radius: var(--radius);
  --dashboard-widget-shadow: var(--shadow-tight);
  --dashboard-widget-header-height: 54px;
  --dashboard-widget-header-x: 12px;
  --dashboard-widget-header-top: 12px;
  --dashboard-widget-header-bottom: 9px;
  --dashboard-widget-body-x: 20px;
  --dashboard-widget-body-y: 20px;
  border: 1px solid var(--ps-line);
  border-top: var(--dashboard-widget-accent-width) solid var(--widget-accent);
  border-radius: var(--dashboard-widget-radius);
  box-shadow: var(--dashboard-widget-shadow);
}

.epi-dashboard-widget-head,
.custom-output-widget-header {
  min-height: var(--dashboard-widget-header-height);
  padding: var(--dashboard-widget-header-top) var(--dashboard-widget-header-x) var(--dashboard-widget-header-bottom);
}

.epi-dashboard-widget-head h4 {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.epi-dashboard-kpi,
.custom-output-kpi {
  padding: var(--dashboard-widget-body-y) var(--dashboard-widget-body-x);
  gap: 8px;
}

.epi-dashboard-kpi span,
.custom-output-kpi span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.epi-dashboard-kpi strong,
.custom-output-kpi strong {
  font-size: clamp(24px, 2.1vw, 36px);
  line-height: 1;
  font-weight: 900;
}

.epi-dashboard-kpi small,
.custom-output-kpi small {
  font-size: 11px;
  line-height: 1.35;
}

.epi-dashboard-chart,
.custom-output-chart {
  padding: 6px 6px 0;
}

.epi-dashboard-table-wrap,
.custom-output-table {
  max-height: 420px;
}

/* Shared table-widget viewport: the widget header stays fixed while the
   table body consumes only the stored grid-row height and scrolls internally. */
.epi-dashboard-widget.kind-table,
.custom-output-grid .custom-output-widget.kind-table {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.epi-dashboard-widget.kind-table .epi-dashboard-table-wrap,
.custom-output-grid .custom-output-widget.kind-table .custom-output-table {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: none;
  align-self: stretch;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.epi-dashboard-widget.kind-table .epi-dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.epi-dashboard-widget-actions,
.custom-output-widget-actions {
  gap: 2px;
}

.epi-dashboard-widget-actions .btn-icon,
.custom-output-widget-actions .btn-icon {
  min-width: 28px;
  min-height: 28px;
  padding: 5px;
}

.epi-dashboard-grid.editing .epi-dashboard-widget:hover,
.epi-dashboard-grid.editing .epi-dashboard-widget:focus-within {
  border-color: rgba(36, 124, 138, 0.42);
  box-shadow:
    0 0 0 2px rgba(23, 126, 137, 0.1),
    var(--dashboard-widget-shadow);
}

.epi-dashboard-widget.dragging {
  box-shadow:
    0 0 0 2px rgba(23, 126, 137, 0.22),
    0 12px 26px rgba(31, 42, 68, 0.18);
}

.custom-output-metric-section .epi-dashboard-validation {
  margin-left: auto;
}

@media (max-width: 1180px) {
  .custom-output-view-row {
    flex-wrap: wrap;
  }

  .custom-output-view-bar .custom-output-view-actions {
    margin-left: auto;
  }

  .custom-output-view-bar .custom-output-slicers {
    flex-wrap: wrap;
  }

  .custom-output-grid .custom-output-widget.kind-kpi {
    grid-column: span 6;
  }
}

@media (max-width: 800px) {
  .custom-output-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .custom-output-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .custom-output-slicers {
    width: 100%;
    flex-wrap: wrap;
  }
  .custom-output-slicers .smart-select {
    width: min(250px, calc(100vw - 116px));
  }

  .custom-output-grid .custom-output-widget,
  .custom-output-grid .custom-output-widget.kind-kpi {
    grid-column: 1 / -1;
  }

  .custom-output-widget-modal .epi-dashboard-widget-type-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .custom-output-mode-switch {
    width: 100%;
  }

  .custom-output-mode-switch button {
    flex: 1 1 auto;
    justify-content: center;
  }
}
/* Canvas What-If KPI customization. */
.canvas-whatif-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}
.canvas-whatif-grid aside {
  display: none !important;
}
.cw-run-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.cw-run-actions .btn {
  min-height: 38px;
}
.cw-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.cw-summary-head > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.cw-summary-head label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.cw-summary-head select {
  min-width: 150px;
}
.cw-summary-head .btn {
  white-space: nowrap;
}
.cw-kpi-drawer {
  width: min(440px, 94vw);
  grid-template-rows: auto auto auto minmax(0, 1fr) minmax(0, 1fr) auto;
  overflow: hidden;
}
.cw-kpi-drawer > header p {
  font-size: 13px;
}
.cw-kpi-drawer > input {
  min-height: 38px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  padding: 8px;
}
.cw-kpi-drawer > section {
  overflow: auto;
  border-top: 1px solid #edf1f4;
  padding-top: 10px;
}
.cw-kpi-drawer h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.cw-kpi-count {
  font-size: 12px;
  color: #536372;
  font-weight: 600;
}
.cw-kpi-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 2px;
  border-bottom: 1px solid #f0f3f5;
}
.cw-kpi-row span {
  font-size: 13px;
}
.cw-kpi-row span small {
  display: block;
  color: var(--ps-muted);
  font-size: 11px;
  margin-top: 2px;
}
.cw-kpi-order {
  display: flex;
  gap: 3px;
}
.cw-kpi-order .btn {
  min-height: 28px;
  padding: 4px;
}
.cw-kpi-drawer footer {
  position: sticky;
  bottom: 0;
  background: var(--ps-overlay);
  border-top: 1px solid var(--ps-line);
  padding: 13px 0 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
}
.cw-kpi-drawer:focus {
  outline: 0;
}
@media (max-width: 760px) {
  .cw-summary-head > div {
    justify-content: flex-start;
  }
  .cw-run-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .canvas-whatif-card footer {
    flex-wrap: wrap;
  }
}

/* Shared What-If KPI presentation: compact scenario-first cards. */
.scenario-kpi-cards,
.canvas-whatif .cw-results-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.scenario-kpi-card,
.canvas-whatif .cw-result-card {
  min-height: 138px;
  padding: 14px;
  border: 1px solid var(--ps-line);
  border-left: 1px solid var(--ps-line);
  border-radius: 9px;
  background: var(--ps-panel);
  box-shadow: 0 1px 3px rgba(19, 34, 56, 0.06);
}
.scenario-kpi-card small,
.canvas-whatif .cw-result-card .cw-result-name {
  color: var(--ps-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scenario-kpi-card strong,
.canvas-whatif .cw-result-card strong {
  font-size: clamp(21px, 1.8vw, 26px);
  color: var(--ps-charcoal);
}
.scenario-kpi-card span,
.canvas-whatif .cw-result-card span {
  color: var(--ps-muted);
  font-size: 12px;
}
.scenario-kpi-card em,
.canvas-whatif .cw-result-card em {
  margin-top: 3px;
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
  color: var(--ps-muted);
}
.scenario-kpi-card.positive em,
.canvas-whatif .cw-result-card.increase em {
  color: var(--ps-green);
}
.scenario-kpi-card.negative em,
.canvas-whatif .cw-result-card.decrease em {
  color: var(--ps-red);
}
.scenario-kpi-card i,
.canvas-whatif .cw-result-card i {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #eef1f3;
  color: var(--ps-muted);
  font-size: 11px;
  font-style: normal;
}
.scenario-kpi-card.positive,
.scenario-kpi-card.negative,
.canvas-whatif .cw-result-card.increase,
.canvas-whatif .cw-result-card.decrease {
  border-left-color: var(--ps-line);
  background: var(--ps-panel);
}
/* ML What-If setup-card polish: Canvas hierarchy with ML scope controls. */
.scenario-setup-context {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}
.scenario-baseline-summary {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 3px 0;
}
.scenario-baseline-summary span {
  display: block;
  color: var(--ps-muted);
  font-size: 12px;
  font-weight: 500;
}
.scenario-baseline-summary strong {
  color: var(--ps-charcoal);
  font-size: 15px;
  font-weight: 700;
}
.scenario-period-field,
.scenario-period-end-field {
  max-width: 260px;
}
.scenario-baseline-models {
  grid-column: 1/-1 !important;
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) max-content !important;
  gap: 14px !important;
  align-items: center !important;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid #edf1f4;
}
.scenario-baseline-models > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-charcoal);
  white-space: nowrap;
}
.scenario-model-tiles {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  min-width: 0;
}
.scenario-model-tile {
  display: grid;
  gap: 3px;
  min-width: 128px;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--ps-line);
  border-radius: 7px;
  background: var(--ps-raised);
  color: var(--ps-charcoal);
  text-align: left;
  cursor: pointer;
}
.scenario-model-tile:hover {
  border-color: #aec7cc;
  background: #f5faf9;
}
.scenario-model-tile small {
  overflow: hidden;
  color: var(--ps-muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scenario-model-tile strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scenario-baseline-models .btn-link {
  white-space: nowrap;
}
@media (max-width: 980px) {
  .scenario-setup-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scenario-baseline-models {
    grid-template-columns: 1fr max-content !important;
  }
  .scenario-baseline-models > span {
    grid-column: 1/-1;
  }
  .scenario-period-field,
  .scenario-period-end-field {
    max-width: none;
  }
}
@media (max-width: 620px) {
  .scenario-setup-context {
    grid-template-columns: 1fr;
  }
  .scenario-baseline-models {
    grid-template-columns: 1fr !important;
  }
  .scenario-baseline-models > span {
    grid-column: auto;
  }
  .scenario-baseline-models .btn-link {
    justify-self: start;
  }
}
/* ML What-If baseline-model tiles are the sole detail interaction. */
.scenario-baseline-models {
  grid-template-columns: max-content minmax(0, 1fr) !important;
}
.scenario-model-tile:focus-visible {
  outline: 2px solid var(--ps-teal);
  outline-offset: 2px;
}

/* ML What-If keeps last-run results visible while event changes await Run Scenario. */
.scenario-results-pending {
  margin-right: 8px;
  color: var(--ps-muted);
  font-size: 12px;
}
.scenario-results-pending[hidden] {
  display: none;
}
body.epi-outputs-export-open {
  overflow: hidden;
}

.epi-outputs-export-backdrop {
  position: fixed;
  inset: 0;
  z-index: 82;
  background: rgba(15, 23, 42, 0.38);
}

.epi-outputs-export-modal {
  position: fixed;
  z-index: 83;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(720px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--ps-line);
  border-radius: var(--radius-lg, 14px);
  background: var(--ps-overlay);
  box-shadow: 0 26px 70px rgba(31, 42, 68, 0.26);
  overflow: hidden;
}

.epi-outputs-export-modal > header,
.epi-outputs-export-modal > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ps-line);
}

.epi-outputs-export-modal > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--ps-line);
  border-bottom: 0;
}
.epi-outputs-export-modal h3 {
  margin: 0 0 4px;
  color: var(--ps-charcoal);
  font-size: 18px;
  font-weight: 900;
}
.epi-outputs-export-modal header p {
  margin: 0;
  color: var(--ps-muted);
  font-size: 12px;
}
.epi-outputs-export-body {
  min-height: 0;
  padding: 16px 18px 18px;
  overflow: auto;
}
.epi-outputs-export-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.epi-outputs-export-selection-head strong {
  color: var(--ps-charcoal);
  font-size: 12px;
}
.epi-outputs-export-selection-head > div {
  display: flex;
  gap: 8px;
}
.epi-outputs-export-selection-head button {
  border: 0;
  background: transparent;
  color: var(--ps-teal-dark);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.epi-outputs-export-selection-head button:disabled {
  color: #9aa7b7;
  cursor: default;
}
.epi-outputs-export-list {
  display: grid;
  max-height: 310px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  overflow: auto;
}
.epi-outputs-export-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--ps-line);
  cursor: pointer;
}
.epi-outputs-export-item:last-child {
  border-bottom: 0;
}
.epi-outputs-export-item:hover {
  background: var(--ps-surface-soft);
}
.epi-outputs-export-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--ps-orange);
}
.epi-outputs-export-item span {
  color: var(--ps-charcoal);
  font-size: 12px;
  font-weight: 750;
}
.epi-outputs-export-item small {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ps-muted);
  font-size: 9px;
  font-weight: 800;
}
.epi-outputs-export-empty {
  padding: 34px 16px;
  border: 1px dashed var(--ps-line);
  border-radius: 10px;
  color: var(--ps-muted);
  font-size: 12px;
  text-align: center;
}
.epi-outputs-export-hint {
  margin: 8px 0 0;
  color: var(--ps-muted);
  font-size: 11px;
}
.epi-outputs-export-summary-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 14px 0 0;
  padding: 12px 13px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-teal-soft);
}
.epi-outputs-export-summary-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--ps-orange);
}
.epi-outputs-export-summary-option span {
  display: grid;
  gap: 3px;
}
.epi-outputs-export-summary-option strong {
  color: var(--ps-charcoal);
  font-size: 12.5px;
}
.epi-outputs-export-summary-option small {
  color: var(--ps-muted);
  font-size: 10.5px;
  line-height: 1.35;
}
.epi-outputs-export-progress,
.epi-outputs-export-error {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
}
.epi-outputs-export-progress {
  background: var(--ps-teal-soft);
  color: var(--ps-teal-dark);
}
.epi-outputs-export-progress svg {
  animation: spin 0.9s linear infinite;
}
.epi-outputs-export-error {
  background: #fff1f2;
  color: var(--ps-red);
}
.epi-outputs-export-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.epi-outputs-export-options article {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
  box-shadow: 0 4px 14px rgba(31, 42, 68, 0.06);
}
.epi-outputs-export-options article > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ps-orange-text);
}
.epi-outputs-export-options span {
  display: grid;
  gap: 3px;
}
.epi-outputs-export-options strong {
  color: var(--ps-charcoal);
  font-size: 13px;
}
.epi-outputs-export-options small {
  color: var(--ps-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

/* Read-only PPT sample layout inside the export modals only. */
.ppt-layout-preview-toggle { justify-self: start; display: inline-flex; align-items: center; gap: 5px; margin: -6px 0 -2px; padding: 0; border: 0; background: transparent; color: var(--ps-teal-dark); font-size: 11px; font-weight: 800; cursor: pointer; }
.ppt-layout-preview-toggle:disabled, .ppt-layout-preview.busy { opacity: .45; pointer-events: none; }
.ppt-layout-preview-toggle .chev { transition: transform .15s ease; }
.ppt-layout-preview-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.ppt-layout-preview { margin: 14px 0 0; border: 1px solid var(--ps-line); border-radius: 10px; background: var(--ps-surface-soft); overflow: hidden; }
.ppt-layout-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; background: var(--ps-panel); }
.ppt-layout-preview.open .ppt-layout-preview-head { border-bottom: 1px solid var(--ps-line); }
.ppt-layout-preview-head > div { display: grid; gap: 2px; }
.ppt-layout-preview-head strong { color: var(--ps-charcoal); font-size: 12.5px; }
.ppt-layout-preview-head small, .ppt-layout-preview-note { color: var(--ps-muted); font-size: 10.5px; }
.ppt-layout-preview-count { flex: none; padding: 4px 9px; border-radius: 999px; background: var(--ps-teal-soft); color: var(--ps-teal-dark); font-size: 10px; font-weight: 800; white-space: nowrap; }
.ppt-layout-preview-strip { display: flex; align-items: flex-start; gap: 10px; padding: 13px; overflow-x: auto; }
.ppt-layout-preview-tile { flex: none; width: 152px; display: grid; gap: 6px; margin: 0; }
.ppt-layout-preview-shell { aspect-ratio: 16 / 9; border: 1px solid var(--ps-line-strong); border-radius: 6px; overflow: hidden; background: var(--ps-panel); box-shadow: 0 2px 8px rgba(31,42,68,.1); }
.ppt-layout-preview-slide { display: block; width: 100%; height: 100%; }
.ppt-layout-preview-tile figcaption { display: flex; align-items: center; gap: 5px; color: var(--ps-muted); font-size: 9.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppt-layout-preview-tile figcaption i { width: 6px; height: 6px; border-radius: 2px; flex: none; display: block; }
.ppt-layout-preview-more { flex: none; align-self: start; width: 76px; aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 0 6px; border: 1px dashed var(--ps-line-strong); border-radius: 6px; background: transparent; color: var(--ps-muted); font: 800 10px inherit; text-align: center; cursor: pointer; }
.ppt-layout-preview-more:hover:not(:disabled) { border-color: var(--ps-teal); color: var(--ps-teal-dark); }
.ppt-layout-preview-note { margin: 0; padding: 0 13px 13px; }

@media (max-width: 640px) {
  .epi-outputs-export-options {
    grid-template-columns: 1fr;
  }
  .epi-outputs-export-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

/* Canvas What-If only: match ML What-If header hierarchy. */
.canvas-whatif .canvas-whatif-card h3,
.canvas-whatif .cw-summary-head h3 {
  font-weight: 900;
}
.canvas-whatif .canvas-whatif-card th {
  color: #475467;
  font-weight: 700;
}
.canvas-whatif .cw-assumption-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}
.canvas-whatif .cw-assumption-footer-left span {
  color: var(--ps-muted);
  font-size: 13px;
}
@media (max-width: 760px) {
  .canvas-whatif .cw-assumption-footer-left {
    width: 100%;
    justify-content: space-between;
  }
}

/* Shared Canvas + ML scenario KPI cards. Reuses the Outputs dashboard-widget
   visual contract without changing the Outputs or Custom Outputs components. */
.scenario-kpi-cards,
.canvas-whatif .cw-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.scenario-kpi-card,
.canvas-whatif .cw-result-card {
  --widget-accent: var(--dash-accent, #177e89);
  display: grid;
  width: 100%;
  min-height: 142px;
  padding: 16px 16px 14px;
  border: 1px solid var(--ps-line);
  border-top: var(--dashboard-widget-accent-width, 3px) solid var(--widget-accent);
  border-radius: var(--dashboard-widget-radius, var(--radius));
  background: var(--ps-panel);
  box-shadow: var(--dashboard-widget-shadow, var(--shadow-tight));
  text-align: left;
  cursor: pointer;
  align-content: start;
}
.scenario-kpi-card:hover,
.canvas-whatif .cw-result-card:hover,
.scenario-kpi-card:focus-visible,
.canvas-whatif .cw-result-card:focus-visible {
  border-color: #b8cbd2;
  box-shadow: var(--dashboard-widget-shadow, var(--shadow-tight));
  outline: 0;
}
.scenario-kpi-card.active,
.canvas-whatif .cw-result-card.active {
  border-color: #9fc8ce;
  border-top-width: 4px;
  box-shadow: var(--dashboard-widget-shadow, var(--shadow-tight));
}
.scenario-kpi-card small,
.canvas-whatif .cw-result-card .cw-result-name {
  color: var(--ps-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}
.scenario-kpi-card strong,
.canvas-whatif .cw-result-card strong {
  margin: 8px 0 12px;
  color: var(--ps-charcoal);
  font-size: clamp(24px, 2.1vw, 36px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.scenario-kpi-change,
.cw-kpi-change {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef1f4;
  color: #667085;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}
.scenario-kpi-change b,
.cw-kpi-change b {
  font-weight: 750;
}
.scenario-kpi-card.positive .scenario-kpi-change,
.canvas-whatif .cw-result-card.increase .cw-kpi-change {
  background: #eaf7ef;
  color: #167342;
}
.scenario-kpi-card.negative .scenario-kpi-change,
.canvas-whatif .cw-result-card.decrease .cw-kpi-change {
  background: #fdeeee;
  color: #b42318;
}
.scenario-kpi-card i,
.canvas-whatif .cw-result-card i {
  margin-top: auto;
  padding-top: 10px;
  border: 0;
  color: var(--ps-muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}
.canvas-whatif .cw-result-card.unchanged,
.canvas-whatif .cw-result-card.increase,
.canvas-whatif .cw-result-card.decrease {
  background: var(--ps-panel);
  border-left: 1px solid var(--ps-line);
}

/* Canvas What-If responsive layout contract. The page is fluid; result cards
   use bounded tracks, and dense data remains contained by its own scroller. */
.canvas-whatif .canvas-whatif-grid,
.canvas-whatif .canvas-whatif-grid main,
.canvas-whatif .canvas-whatif-card {
  min-width: 0;
}
.canvas-whatif .cw-results-grid {
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  justify-content: stretch;
  align-items: stretch;
  gap: 14px;
  margin-top: 14px;
}
.canvas-whatif .cw-result-card {
  width: 100%;
  min-width: 0;
  min-height: 142px;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.canvas-whatif .cw-result-card .cw-kpi-change {
  max-width: 100%;
  white-space: normal;
  flex-wrap: wrap;
}
.canvas-whatif .canvas-whatif-card.assumptions {
  min-width: 0;
  overflow: hidden;
}
.canvas-whatif .canvas-whatif-card .canvas-whatif-head,
.canvas-whatif .canvas-whatif-card footer {
  width: 100%;
  max-width: none;
}
.canvas-whatif .canvas-whatif-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c8d3da transparent;
}
.canvas-whatif .canvas-whatif-table-wrap::-webkit-scrollbar {
  height: 8px;
}
.canvas-whatif .canvas-whatif-table-wrap::-webkit-scrollbar-thumb {
  background: #c8d3da;
  border-radius: 999px;
}
.canvas-whatif .canvas-whatif-table-wrap table {
  width: 100%;
  min-width: 940px;
  margin-bottom: 0;
}
.canvas-whatif .canvas-whatif-card.assumptions footer {
  align-items: center;
  flex-wrap: wrap;
}
.canvas-whatif .cw-assumption-footer-left {
  flex: 1 1 220px;
  min-width: 0;
}
.canvas-whatif .cw-run-actions {
  flex: 0 1 auto;
  flex-wrap: wrap;
  margin-left: auto;
}
.canvas-whatif .cw-summary-head {
  width: 100%;
  align-items: center;
}
.canvas-whatif .cw-summary-head > div {
  min-width: 0;
}
.canvas-whatif .canvas-whatif-chart-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.canvas-whatif .canvas-whatif-chart-wrap .canvas-whatif-chart {
  width: 100%;
  max-width: 100%;
}
@media (max-width: 760px) {
  .canvas-whatif .cw-summary-head > div {
    width: 100%;
    justify-content: flex-start;
  }
  .canvas-whatif .cw-run-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .canvas-whatif .canvas-whatif-card.assumptions footer {
    align-items: flex-start;
  }
}
@media (max-width: 560px) {
  .canvas-whatif .cw-results-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .canvas-whatif .cw-result-card {
    max-width: none;
  }
  .canvas-whatif .cw-summary-head label {
    width: 100%;
    justify-content: space-between;
  }
  .canvas-whatif .cw-summary-head select {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 1200px) {
  .canvas-whatif .canvas-whatif-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Scenario Impact Summary only: card-count sizing is deliberately isolated
   from every other dashboard and card grid. */
.whatif-scenario-impact-kpi-grid,
.whatif-scenario-impact-kpi-grid.cw-results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.whatif-scenario-impact-kpi-grid[data-kpi-count="1"],
.whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="1"] {
  grid-template-columns: minmax(0, min(320px, 100%));
}
.whatif-scenario-impact-kpi-grid[data-kpi-count="2"],
.whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 320px));
}
.whatif-scenario-impact-kpi-grid[data-kpi-count="3"],
.whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 300px));
}
.whatif-scenario-impact-kpi-grid .scenario-kpi-card strong,
.whatif-scenario-impact-kpi-grid .cw-result-card strong {
  overflow-wrap: normal;
  word-break: normal;
}
@media (max-width: 900px) {
  .whatif-scenario-impact-kpi-grid,
  .whatif-scenario-impact-kpi-grid.cw-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .whatif-scenario-impact-kpi-grid[data-kpi-count="1"],
  .whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="1"] {
    grid-template-columns: minmax(0, min(320px, 100%));
  }
  .whatif-scenario-impact-kpi-grid[data-kpi-count="2"],
  .whatif-scenario-impact-kpi-grid[data-kpi-count="3"],
  .whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="2"],
  .whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .whatif-scenario-impact-kpi-grid,
  .whatif-scenario-impact-kpi-grid.cw-results-grid,
  .whatif-scenario-impact-kpi-grid[data-kpi-count="2"],
  .whatif-scenario-impact-kpi-grid[data-kpi-count="3"],
  .whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="2"],
  .whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="3"] {
    grid-template-columns: minmax(0, 1fr);
  }
  .whatif-scenario-impact-kpi-grid[data-kpi-count="1"],
  .whatif-scenario-impact-kpi-grid.cw-results-grid[data-kpi-count="1"] {
    grid-template-columns: minmax(0, min(320px, 100%));
  }
}

/* Canvas What-If uses the exact Outputs KPI widget shell and typography.
   These scoped rules only preserve its scenario badge and baseline detail. */
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card {
  display: grid;
  min-height: 180px;
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card:hover,
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card:focus-visible {
  border-color: var(--ps-line);
  box-shadow: var(--dashboard-widget-shadow);
  outline: none;
}
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card.active {
  border-color: var(--ps-line);
  border-top-width: var(--dashboard-widget-accent-width);
  box-shadow: var(--dashboard-widget-shadow);
}
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card .epi-dashboard-kpi {
  align-content: start;
  min-height: 0;
}
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card .cw-kpi-change {
  margin-top: 4px;
}
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card .epi-dashboard-kpi small {
  margin-top: 2px;
}
.canvas-whatif .whatif-scenario-impact-kpi-grid .epi-dashboard-widget.cw-result-card .epi-dashboard-kpi strong {
  font-size: clamp(20px, 1.6vw, 30px);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Shared What-If trend chart surface. */
.canvas-whatif-chart-wrap,
.scenario-trend-chart-wrap {
  margin-top: 12px;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #e1e8ec;
  border-radius: 9px;
  background: var(--ps-panel);
}
.canvas-whatif-chart-wrap .canvas-whatif-chart,
.scenario-trend-chart-wrap .chart {
  width: 100%;
  height: 360px;
  min-height: 360px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.canvas-whatif .canvas-whatif-head,
.scenario-trend-head {
  align-items: center;
  margin-bottom: 14px;
}
.canvas-whatif .canvas-whatif-head label,
.scenario-trend-head .filter-field {
  min-width: 190px;
}
.canvas-whatif .canvas-whatif-chart-wrap .modebar,
.scenario-trend-chart-wrap .modebar {
  display: none !important;
}
@media (max-width: 620px) {
  .canvas-whatif-chart-wrap,
  .scenario-trend-chart-wrap,
  .canvas-whatif-chart-wrap .canvas-whatif-chart,
  .scenario-trend-chart-wrap .chart {
    min-height: 300px;
    height: 300px;
  }
  .canvas-whatif .canvas-whatif-head,
  .scenario-trend-head {
    align-items: stretch;
    flex-direction: column;
  }
  .canvas-whatif .canvas-whatif-head label,
  .scenario-trend-head .filter-field {
    width: 100%;
  }
}

/* Shared Canvas + ML Phase 1 Impact Decomposition shell. */
.whatif-impact-decomposition {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
  box-shadow: 0 2px 6px #1322380d;
}
.whatif-decomposition-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.whatif-decomposition-head h3 {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 16px;
}
.whatif-decomposition-head h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
}
.whatif-decomposition-head p {
  margin: 5px 0 0;
  color: var(--ps-muted);
  font-size: 13px;
}
.whatif-decomposition-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.whatif-decomposition-controls label {
  display: grid;
  gap: 5px;
  color: #526273;
  font-size: 11px;
  font-weight: 700;
}
.whatif-decomposition-controls select {
  min-width: 150px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  background: var(--ps-input);
  color: var(--ps-charcoal);
}
.whatif-decomposition-display {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 7px;
  background: #f7fafb;
}
.whatif-decomposition-display > span {
  padding: 0 5px;
  color: #526273;
  font-size: 11px;
  font-weight: 700;
}
.whatif-decomposition-display button {
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #526273;
  font:
    600 12px Inter,
    sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.whatif-decomposition-display button.active {
  background: var(--ps-panel);
  color: var(--ps-teal-text);
  box-shadow: 0 1px 2px #1322381a;
}
.whatif-decomposition-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(230px, 3fr);
  gap: 16px;
  align-items: stretch;
}
.whatif-decomposition-waterfall {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 24px;
  border: 1px dashed #b9ccd0;
  border-radius: 8px;
  background: #f8fbfb;
  text-align: center;
}
.whatif-decomposition-waterfall > div {
  max-width: 430px;
}
.whatif-decomposition-waterfall strong {
  color: #3e5960;
  font-size: 14px;
}
.whatif-decomposition-waterfall p,
.whatif-decomposition-deferred {
  margin: 7px 0 0;
  color: var(--ps-muted);
  font-size: 13px;
  line-height: 1.45;
}
.whatif-decomposition-summary {
  display: grid;
  align-content: start;
  gap: 12px;
}
.whatif-decomposition-summary > section,
.whatif-decomposition-summary > aside {
  padding: 13px;
  border: 1px solid #e1e8ec;
  border-radius: 8px;
  background: var(--ps-raised);
}
.whatif-decomposition-summary h4 {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 13px;
}
.whatif-decomposition-summary dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}
.whatif-decomposition-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.whatif-decomposition-summary dt {
  color: var(--ps-muted);
  font-size: 12px;
}
.whatif-decomposition-summary dd {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 13px;
  font-weight: 700;
}
.whatif-decomposition-driver-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: #465568;
  font-size: 12px;
}
.whatif-decomposition-summary aside {
  background: #eef8f7;
  border-color: #d1e8e5;
  color: #356b70;
}
.whatif-decomposition-summary aside strong {
  font-size: 12px;
}
.whatif-decomposition-summary aside p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
}
.whatif-decomposition-summary code {
  font:
    600 11px Inter,
    sans-serif;
  color: var(--ps-teal-text);
}
@media (max-width: 980px) {
  .whatif-decomposition-head {
    flex-direction: column;
  }
  .whatif-decomposition-controls {
    justify-content: flex-start;
  }
  .whatif-decomposition-layout {
    grid-template-columns: 1fr;
  }
  .whatif-decomposition-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .whatif-decomposition-summary > aside {
    grid-column: 1/-1;
  }
}
@media (max-width: 620px) {
  .whatif-impact-decomposition {
    padding: 16px;
  }
  .whatif-decomposition-controls {
    width: 100%;
    align-items: stretch;
  }
  .whatif-decomposition-controls label {
    flex: 1 1 170px;
  }
  .whatif-decomposition-controls select {
    width: 100%;
    min-width: 0;
  }
  .whatif-decomposition-display {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .whatif-decomposition-waterfall {
    min-height: 210px;
  }
  .whatif-decomposition-summary {
    grid-template-columns: 1fr;
  }
}
.whatif-decomposition-waterfall.has-chart {
  display: block;
  min-height: 0;
  padding: 8px;
  border-style: solid;
  background: var(--ps-panel);
}
.whatif-impact-waterfall-chart {
  width: 100%;
  height: 270px;
}
.whatif-decomposition-summary dd small {
  display: block;
  margin-top: 3px;
  color: var(--ps-muted);
  font-size: 11px;
  font-weight: 600;
}
@media (max-width: 620px) {
  .whatif-decomposition-waterfall.has-chart {
    min-height: 0;
  }
  .whatif-impact-waterfall-chart {
    height: 250px;
  }
}
.whatif-scenario-driver-placeholder {
  max-width: 430px;
}
.whatif-scenario-driver-placeholder p:last-child {
  margin-top: 14px;
  color: #356b70;
  font-weight: 600;
}
.whatif-decomposition-layout {
  grid-template-columns: 1fr;
  gap: 12px;
}
.whatif-decomposition-waterfall.has-chart {
  padding: 10px 12px;
}
.whatif-impact-waterfall-chart {
  height: 370px;
}
.whatif-decomposition-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.whatif-decomposition-summary > section {
  padding: 12px;
}
.whatif-decomposition-summary > section:first-child {
  grid-column: 1/-1;
}
.whatif-decomposition-summary dl {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 9px;
}
.whatif-decomposition-summary dl div {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f5f8f9;
}
.whatif-decomposition-summary dd {
  margin-top: 3px;
}
.whatif-decomposition-driver-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}
.whatif-decomposition-driver-list li {
  padding: 5px 9px;
  border: 1px solid #d7e5e8;
  border-radius: 999px;
  background: #f4fbfb;
  color: #356b70;
}
.whatif-decomposition-summary aside {
  grid-column: 1/-1;
  padding: 10px 12px;
}
.whatif-impact-breakdown {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}
.whatif-impact-breakdown dt {
  grid-column: 1/-1;
}
.whatif-impact-breakdown dd {
  padding: 6px 8px;
  border-radius: 5px;
  background: #f7fafb;
}
@media (max-width: 620px) {
  .whatif-impact-waterfall-chart {
    height: 340px;
  }
  .whatif-decomposition-summary {
    grid-template-columns: 1fr;
  }
  .whatif-decomposition-summary dl {
    grid-template-columns: 1fr;
  }
  .whatif-decomposition-summary > section:first-child,
  .whatif-decomposition-summary > aside {
    grid-column: auto;
  }
}
.whatif-decomposition-layout {
  grid-template-columns: minmax(0, 7fr) minmax(250px, 3fr);
  gap: 16px;
  align-items: start;
}
.whatif-decomposition-waterfall.has-chart,
.whatif-decomposition-waterfall:has(.whatif-impact-waterfall-chart) {
  display: block;
  min-height: 0;
  padding: 8px 10px;
}
.whatif-impact-waterfall-chart {
  height: 325px;
}
.whatif-decomposition-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.whatif-decomposition-summary > section,
.whatif-decomposition-summary > section:first-child,
.whatif-decomposition-summary aside {
  grid-column: auto;
  padding: 12px;
}
.whatif-decomposition-summary dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
}
.whatif-decomposition-summary dl div {
  display: flex;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.whatif-decomposition-summary dd {
  margin: 0;
  text-align: right;
}
.whatif-decomposition-driver-list {
  display: grid;
  gap: 6px;
  margin: 9px 0 0;
  padding-left: 18px;
  list-style: disc;
}
.whatif-decomposition-driver-list li {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #465568;
}
.whatif-impact-breakdown {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}
.whatif-impact-breakdown dt {
  grid-column: auto;
}
.whatif-impact-breakdown dd {
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.whatif-decomposition-summary aside {
  padding: 10px 12px;
}
@media (max-width: 980px) {
  .whatif-decomposition-layout {
    grid-template-columns: 1fr;
  }
  .whatif-decomposition-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .whatif-decomposition-summary aside {
    grid-column: 1/-1;
  }
}
@media (max-width: 620px) {
  .whatif-impact-waterfall-chart {
    height: 310px;
  }
  .whatif-decomposition-summary {
    grid-template-columns: 1fr;
  }
  .whatif-decomposition-summary aside {
    grid-column: auto;
  }
}
.whatif-decomposition-head .whatif-decomposition-display {
  display: none;
}
.whatif-decomposition-waterfall {
  position: relative;
  padding: 8px 10px;
}
.whatif-chart-display {
  display: flex !important;
  justify-content: flex-end;
  margin: 0 0 2px;
}
.whatif-impact-waterfall-chart {
  height: 320px;
}
.whatif-decomposition-summary aside {
  display: none;
}
.whatif-decomposition-waterfall > .whatif-impact-waterfall-chart {
  width: 100%;
  max-width: none;
}
.whatif-impact-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.whatif-impact-period {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #526273;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.whatif-impact-period select {
  min-width: 108px;
  min-height: 30px;
  padding: 4px 24px 4px 7px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  background: var(--ps-input);
  color: var(--ps-charcoal);
  font:
    600 12px Inter,
    sans-serif;
}
@media (max-width: 360px) {
  .whatif-impact-summary-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .whatif-impact-period select {
    min-width: 120px;
  }
}
.whatif-decomposition-controls > .whatif-impact-period {
  display: grid;
  gap: 5px;
}
.whatif-decomposition-controls > .whatif-impact-period select {
  min-width: 118px;
  min-height: 36px;
  padding: 6px 28px 6px 8px;
}
@media (max-width: 620px) {
  .whatif-decomposition-controls > .whatif-impact-period {
    flex: 1 1 130px;
  }
}
.whatif-impact-breakdown {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e1e8ec;
}
.whatif-impact-breakdown dt {
  color: #526273;
  font-size: 11px;
  font-weight: 700;
}
.whatif-impact-breakdown dd {
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: var(--ps-muted);
  font-size: 11px;
}
.whatif-impact-breakdown b {
  color: var(--ps-charcoal);
}
.whatif-price-sensitivity {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--ps-line);
  border-radius: 10px;
  background: var(--ps-panel);
  box-shadow: 0 2px 6px #1322380d;
}
.whatif-price-sensitivity h3 {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 16px;
}
.whatif-price-sensitivity h3 b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-teal);
  color: #fff;
  font-size: 12px;
}
.whatif-price-sensitivity > div > p {
  margin: 5px 0 14px;
  color: var(--ps-muted);
  font-size: 13px;
}
.whatif-sensitivity-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.whatif-sensitivity-controls label {
  display: grid;
  gap: 5px;
  color: #526273;
  font-size: 11px;
  font-weight: 700;
}
.whatif-sensitivity-controls select,
.whatif-sensitivity-controls input {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--ps-line-strong);
  border-radius: 6px;
  background: var(--ps-input);
}
.whatif-sensitivity-controls label span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.whatif-sensitivity-controls input {
  width: 68px;
}
.whatif-sensitivity-controls .btn {
  min-height: 36px;
}
.whatif-sensitivity-current,
.whatif-sensitivity-note,
.whatif-sensitivity-unavailable {
  margin: 12px 0 0;
  color: var(--ps-muted);
  font-size: 12px;
}
.whatif-sensitivity-current strong {
  margin-left: 6px;
  color: var(--ps-charcoal);
}
.whatif-sensitivity-chart {
  display: grid;
  place-items: center;
  min-height: 210px;
  margin-top: 14px;
  padding: 20px;
  border: 1px dashed #b9ccd0;
  border-radius: 8px;
  background: #f8fbfb;
  text-align: center;
}
.whatif-sensitivity-chart p {
  margin: 7px 0 0;
  color: var(--ps-muted);
  font-size: 13px;
}
.whatif-sensitivity-results {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  background: #fbfdfd;
}
.whatif-sensitivity-results header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.whatif-sensitivity-results h4 {
  margin: 0;
  color: var(--ps-charcoal);
  font-size: 14px;
}
.whatif-sensitivity-results header p {
  margin: 4px 0 0;
  color: var(--ps-muted);
  font-size: 12px;
}
.whatif-sensitivity-results header span {
  color: #52717a;
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}
.whatif-sensitivity-plot {
  width: 100%;
  min-height: 300px;
  margin: 6px 0 14px;
}
.whatif-sensitivity-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  border: 1px solid #e3eaee;
  border-radius: 7px;
}
.whatif-sensitivity-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 12px;
}
.whatif-sensitivity-table th,
.whatif-sensitivity-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e7edf0;
  text-align: right;
  white-space: nowrap;
}
.whatif-sensitivity-table th:first-child,
.whatif-sensitivity-table td:first-child {
  text-align: left;
}
.whatif-sensitivity-table th {
  background: #f5f8f9;
  color: #526273;
  font-size: 11px;
}
.whatif-sensitivity-table tr:last-child td {
  border-bottom: 0;
}
.whatif-sensitivity-table tr.baseline {
  background: #eaf6f5;
}
.whatif-sensitivity-table small {
  margin-left: 4px;
  color: var(--ps-teal-text);
  font-size: 10px;
  font-weight: 700;
}
.whatif-sensitivity-table .positive {
  color: #177e89;
}
.whatif-sensitivity-table .negative {
  color: #b42318;
}
.whatif-sensitivity-table .neutral {
  color: #526273;
}
@media (max-width: 620px) {
  .whatif-sensitivity-controls label {
    flex: 1 1 150px;
  }
  .whatif-sensitivity-controls .btn {
    width: 100%;
  }
  .whatif-sensitivity-results header {
    display: block;
  }
  .whatif-sensitivity-results header span {
    display: block;
    margin-top: 6px;
    text-align: left;
  }
}

/* Home forecast cards: use the available dashboard width without adding empty
   vertical space.  The grid is scoped to Home so no other card collection is
   affected. */
