.detailed-budget .results-panel { position: static; }
.detailed-budget .tool-layout { padding-bottom: 28px; }
.detailed-budget [hidden] { display: none !important; }
.detailed-budget .model-note, .section-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.detailed-budget .target-field { padding-top: 20px; border-top: 1px solid var(--line); }
.detailed-budget .target-field .input-prefix { border-color: var(--blue); }
.assessment-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.assessment-actions button { min-height: 44px; border: 1px solid #5077a1; border-radius: 10px; padding: 10px 14px; background: var(--navy); color: white; font: 700 13px var(--font-body); cursor: pointer; }
.assessment-actions button + button { background: white; color: var(--navy); }
.assessment-actions button:disabled { cursor: default; opacity: .5; }
.assessment-actions button:focus-visible, .capacity-details summary:focus-visible, .table-scroll:focus-visible { outline: 3px solid #799fc5; outline-offset: 3px; }
.capacity-details { margin-top: 20px; border-top: 1px solid var(--line); }
.capacity-details summary { min-height: 48px; padding-top: 15px; color: var(--navy); font-weight: 800; cursor: pointer; }
.capacity-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.capacity-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.capacity-row > span { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.capacity-row.limiting { border-left: 4px solid var(--blue); padding-left: 12px; background: #f1f6fc; }
.detail-section { padding-bottom: 30px; scroll-margin-top: 24px; }
.detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 15px 0 22px; }
.detail-heading h2 { margin: 6px 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.15; }
.detail-heading p:last-child { max-width: 620px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.assessed-price { min-width: 220px; padding: 20px 24px; background: #eaf2fa; border: 1px solid var(--line); border-radius: 18px; }
.assessed-price span, .assessed-price strong { display: block; }
.assessed-price span { font-size: 12px; color: var(--navy); }
.assessed-price strong { margin-top: 6px; color: var(--navy); font-size: 29px; font-variant-numeric: tabular-nums; }
.assessment-status { padding: 18px 22px; border: 1px solid #bfd3e5; border-radius: 14px; background: #edf4fc; color: var(--navy); line-height: 1.65; font-size: 14px; }
.assessment-status[data-state="ok"] { border-color: #9fceba; background: #eff8f2; color: #23583e; }
.assessment-status[data-state="warning"], .input-error { background: #fff4ee; border-color: #e5b093; color: #8f3518; }
.assessment-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.detail-card { margin-top: 22px; padding: 28px; border: 1px solid var(--line); background: white; border-radius: 20px; }
.detail-card h3 { margin: 0 0 12px; color: var(--navy); font: 800 22px var(--font-body); letter-spacing: -.02em; line-height: 1.35; }
.detail-card h4 { margin: 0 0 14px; color: var(--navy); font-size: 16px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.money-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.money-table th, .money-table td { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: right; font-variant-numeric: tabular-nums; }
.money-table thead th { background: var(--ice); color: var(--muted); font-weight: 700; }
.money-table th:first-child, .money-table thead th:nth-child(2) { text-align: left; }
.money-table tbody th { color: var(--navy); font-weight: 750; min-width: 140px; }
.money-table td { white-space: nowrap; }
.money-table .calculation { text-align: left; white-space: normal; min-width: 180px; color: var(--muted); }
.money-table tfoot { background: #eaf2fa; color: var(--navy); font-weight: 800; }
.money-table tfoot th, .money-table tfoot td { border-bottom: 0; }
.money-table tbody tr:last-child td, .money-table tbody tr:last-child th { border-bottom: 0; }
.checks-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.check-block { padding: 20px; background: var(--ice); border-radius: 14px; }
.checks-grid dl { margin: 0; }
.checks-grid dl > div, .formula-ledger > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checks-grid dt, .formula-ledger dt { color: var(--muted); font-size: 13px; line-height: 1.5; }
.checks-grid dd, .formula-ledger dd { margin: 0; color: var(--navy); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.formula-ledger { margin: 0; }
.formula-ledger > div { padding: 15px 0; }
.formula-ledger dt { font-size: 14px; color: var(--navy); font-weight: 700; }
.formula-ledger dt small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.formula-ledger .ledger-total { padding: 16px 14px; background: #eaf2fa; border-bottom-color: #c0d2e5; }
.detailed-budget .negative { color: #ad351b !important; }
.inline-note, .timing-note { padding: 16px 18px; border-radius: 12px; background: #edf4fc; color: var(--navy); font-size: 13px; line-height: 1.65; }
.inline-note { margin: 18px 0 0; }
.bsd-funding { margin-top: 22px; }
.timing-note p { margin-bottom: 0; }
.detailed-budget .calculation-disclaimer { margin-top: 26px; }
.input-error { border: 1px solid #e5b093; padding: 14px; border-radius: 10px; line-height: 1.5; font-size: 13px; }
.detailed-budget input[aria-invalid="true"] { outline: 2px solid #ad351b; outline-offset: -2px; }
@media (max-width: 1000px) {
  .assessment-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-card { padding: 22px; }
  .checks-grid { gap: 18px; }
}
@media (max-width: 700px) {
  .detail-heading { flex-direction: column; align-items: stretch; gap: 8px; }
  .assessed-price { min-width: 0; }
  .detail-card { padding: 20px 16px; }
  .detail-card h3 { font-size: 20px; }
  .checks-grid { grid-template-columns: minmax(0, 1fr); }
  .assessment-summary { gap: 10px; }
  .assessment-summary .result-card { padding: 14px 12px; }
  .assessment-summary .result-card strong { font-size: 19px; overflow-wrap: anywhere; }
  .money-table, .money-table tbody, .money-table tfoot { display: block; }
  .money-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .money-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .money-table th, .money-table td { padding: 0; border: 0; min-width: 0 !important; white-space: normal; text-align: left; }
  .money-table tbody th, .money-table tfoot th { grid-column: 1 / -1; }
  .money-table .calculation { grid-column: 1 / -1; font-size: 12px; }
  .money-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-bottom: 3px; }
  .money-table td { font-weight: 750; overflow-wrap: anywhere; }
  .money-table tfoot { padding: 0 12px; }
  .money-table tfoot tr { border: 0; }
  .bsd-table tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .formula-ledger > div, .checks-grid dl > div { gap: 12px; }
  .formula-ledger dt { font-size: 13px; }
  .formula-ledger dd { font-size: 13px; white-space: nowrap; }
  .capacity-row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}
@media print {
  .detailed-budget .tool-layout { display: block; }
  .detailed-budget .results-panel { margin-top: 20px; }
  .assessment-actions, .disclaimer-contact { display: none; }
  .detail-card { break-inside: avoid; }
}
