﻿.model-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 46px; }
.model-heading h1 { font-size: clamp(30px, 3.5vw, 43px); }
.model-heading .badge { white-space: nowrap; }
.model-config { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.model-section-title { font-size: 21px; letter-spacing: -.5px; margin-bottom: 20px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.confirm-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.confirm-check input { width: 18px; min-height: 18px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--blue); }
.model-config .help-text { margin: 10px 0 18px; }
.income-list { padding: 0; margin: 16px 0 0; list-style: none; }
.income-list li { border-top: 1px solid var(--border); padding: 10px 0; display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 14px; }
.income-list small { display: block; color: var(--muted); }
.model-toolbar { margin-top: 42px; }
.model-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.model-stats .panel { padding: 20px; display: flex; flex-direction: column; }
.model-stats span { color: var(--muted); font-size: 13px; }
.model-stats strong { font-size: 27px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.model-stats small { color: var(--muted); font-size: 12px; }
#threshold-form { margin-top: 20px; }
.threshold-field { margin-bottom: 10px; }
.threshold-field .help-text { margin-bottom: 0; }
.negative, .field-errors { color: var(--error) !important; }
.trajectory { margin-bottom: 24px; }
.trajectory-heading { display: flex; justify-content: space-between; gap: 16px; }
.trajectory-heading span { color: var(--muted); font-size: 14px; }
#balance-chart { width: 100%; height: 150px; display: block; overflow: visible; margin-top: 12px; }
#baseline-path { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 5 4; }
#scenario-path { fill: none; stroke: var(--purple); stroke-width: 3; }
#zero-line { stroke: var(--border); stroke-dasharray: 3 3; }
#day-marker { stroke: var(--muted); stroke-width: 1; }
#day-dot { fill: var(--purple); stroke: var(--surface); stroke-width: 2; }
#day-slider { padding: 0; min-height: 28px; border: 0; accent-color: var(--purple); cursor: pointer; }
.slider-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.daily-detail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.daily-detail span { display: block; color: var(--muted); font-size: 12px; }
.daily-detail strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.month-nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; }
.month-nav button { flex-shrink: 0; }
.month-nav button[aria-pressed="true"] { color: var(--purple); border-color: var(--purple); background: var(--soft-purple); }
.grid-help { margin-bottom: 12px; font-size: 13px; }
.forecast-scroll { max-height: 640px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
#forecast-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
#forecast-table th, #forecast-table td { min-width: 118px; max-width: 160px; padding: 12px 14px; text-align: right; border-right: 1px solid var(--border); }
#forecast-table th:first-child { position: sticky; left: 0; z-index: 2; min-width: 200px; max-width: 200px; text-align: left; background: var(--surface); white-space: normal; overflow-wrap: anywhere; box-shadow: 2px 0 5px #00000008; }
#forecast-table thead { position: sticky; top: 0; z-index: 3; }
#forecast-table thead th { background: var(--subtle); }
#forecast-table thead th:first-child { background: var(--subtle); z-index: 4; }
#forecast-table .date-button { border: 0; background: none; color: var(--text); font: inherit; padding: 0; text-align: right; width: 100%; }
.date-button span, .deposit-name { display: block; font-size: 12px; color: var(--muted); }
#forecast-table .deposit-cell { background: var(--soft-blue); color: var(--blue); }
#forecast-table .deposit-name { color: var(--blue); white-space: normal; }
#forecast-table .trial-row > * { background: var(--soft-purple); color: var(--purple); }
#forecast-table .total-column { font-weight: 650; background: var(--subtle); }
#forecast-table tfoot { position: sticky; bottom: 0; z-index: 3; }
#forecast-table tfoot > tr > * { background: var(--subtle); border-top: 2px solid var(--border); font-weight: 650; }
#forecast-table tfoot .threshold-warning {
  color: var(--error);
  color: color-mix(in srgb, var(--text), var(--error) var(--threshold-warning));
  background: color-mix(in srgb, var(--subtle), var(--error) calc(var(--threshold-warning) * .22));
}
#forecast-table tfoot .threshold-reached { color: var(--error); text-decoration: underline; text-underline-offset: .2em; }
#forecast-table [data-selected="true"] { box-shadow: inset 0 0 0 2px var(--purple); }
#scenario-dialog { width: min(540px, calc(100% - 32px)); max-height: 90vh; padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); }
#scenario-dialog::backdrop { background: #10152299; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { font-size: 24px; margin-bottom: 12px; }
#scenario-dialog p { font-size: 14px; color: var(--muted); }
@media (max-width: 850px) { .model-heading { flex-direction: column; align-items: start; padding-bottom: 20px; gap: 0; } .model-config { grid-template-columns: 1fr; } .model-stats { grid-template-columns: 1fr; } .daily-detail { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .two-fields { grid-template-columns: 1fr; } .trajectory-heading { flex-direction: column; gap: 2px; } .daily-detail { grid-template-columns: 1fr 1fr; } .slider-ends > span:nth-child(2) { display: none; } #forecast-table th:first-child { min-width: 135px; max-width: 135px; } .model-heading h1 { font-size: 32px; } }
