
  *{ box-sizing:border-box; }
  body{ margin:0; background:var(--ground); color:var(--ink); font-family:var(--ui); padding:16px; }
  .wrap{ max-width:980px; margin:0 auto; }
  body.view-qualify .wrap{ max-width:1380px; }
  body.notes-open .wrap{ max-width:1780px; }
  body.view-agent .wrap{ max-width:1780px; }
  body.view-client .wrap{ max-width:1780px; }
  .notes-tb-btn{ background:var(--paper); border:1px solid var(--line); border-radius:6px; font-size:12px; font-weight:600; padding:4px 9px; cursor:pointer; color:var(--ink); font-family:var(--ui); }
  .notes-tb-btn:hover{ border-color:var(--primary); }
  #qualNotesEditor:empty:before{ content:'Type notes here…'; color:var(--placeholder); }
  #qualNotesEditor mark{ background:var(--hl-total); }
  .sym{ font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,Arial,sans-serif; }
  .card{ background:var(--paper); border:1px solid var(--line); border-radius:14px; padding:18px; }
  .eyebrow{ font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
  .label{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
  #lo-scenario-host input{ font-family:var(--ui); }
  #lo-scenario-host input::placeholder{ color:var(--placeholder); }
  #lo-scenario-host input[type=number]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }

  /* ── header ── */
  .head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; gap:16px; flex-wrap:wrap; }
  body.view-qualify .head, body.view-agent .head{ margin-bottom:0; }
  #lo-scenario-host h1{ font-family:var(--display); font-size:27px; font-weight:700; line-height:1.05; margin:0; }
  .sub{ font-size:13px; color:var(--muted); margin-top:3px; }
  .toggle{ display:flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
  .toggle button{ font-family:var(--ui); font-size:13px; font-weight:600; padding:8px 12px; border:none; cursor:pointer; background:var(--paper); color:var(--muted); }
  .toggle button.active{ background:var(--primary); color:var(--paper); }
  .toggle button.icon-toggle-btn.active{ background:var(--accent-soft); }

  /* Shared Borrower One/Two + Save/Autosave bar — only relevant on Qualify and Scenario View */
  #borrowerNameBar{ display:none; }
  body.view-qualify #borrowerNameBar, body.view-agent #borrowerNameBar{ display:flex; }

  /* ── LO setup card ── */
  .lo-grid{ display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); margin-top:12px; }
  .lo-field{ display:flex; flex-direction:column; gap:4px; }
  .lo-field input{ border:1px solid var(--line); border-radius:8px; padding:7px 10px; font-size:13px; color:var(--ink); background:var(--paper); outline:none; }
  .lo-field input:focus{ border-color:var(--primary); }
  .save-lo-btn{ margin-top:12px; border:none; cursor:pointer; border-radius:8px; padding:8px 18px; font-size:13px; font-weight:600; background:var(--primary); color:var(--paper); font-family:var(--ui); }
  .lo-saved-note{ font-size:12px; color:var(--primary); margin-top:8px; min-height:16px; }

  /* ── global inputs ── */
  .global-inputs{ display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); }
  .field{ display:flex; flex-direction:column; gap:4px; }
  .field .box{ display:flex; align-items:center; border:1px solid var(--line); background:var(--paper); border-radius:8px; padding:0 10px; }
  .field .box span{ color:var(--muted); font-size:14px; white-space:nowrap; }
  .field input{ width:100%; background:transparent; border:none; outline:none; padding:8px 0; font-size:16px; font-weight:500; color:var(--ink); font-variant-numeric:tabular-nums; }
  .seg{ display:flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
  .seg button{ flex:1; padding:8px 0; border:none; cursor:pointer; background:var(--paper); color:var(--muted); font-size:14px; font-weight:600; }
  .seg button + button{ border-left:1px solid var(--line); }
  .seg button.active{ background:var(--slate); color:var(--paper); }

  /* ── save / load bar ── */
  .borrower-bar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .borrower-bar .bb-label{ font-size:13px; font-weight:600; color:var(--muted); white-space:nowrap; }
  .bb-name{ border:1px solid var(--line); border-radius:8px; padding:7px 12px; font-size:13px; color:var(--ink); font-family:var(--ui); outline:none; flex:1; min-width:160px; }
  .bb-name:focus{ border-color:var(--primary); }
  .bb-btn{ display:flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--paper); color:var(--ink); border-radius:8px; padding:7px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:var(--ui); white-space:nowrap; transition:background .12s; }
  .bb-btn:hover{ background:var(--accent-soft); }
  .bb-btn.primary{ background:var(--primary); color:var(--paper); border-color:var(--primary); }
  .bb-btn.primary:hover{ background:var(--primary-dk); }
  #fileInput{ display:none; }

  /* ── client summary ── */
  .summary{ display:flex; flex-wrap:wrap; gap:8px 32px; font-size:14px; font-weight:500; }
  .summary .k{ color:var(--muted); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-right:6px; }

  /* ── scenario cards ── */
  .scenarios-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
  .scenarios-header .sec-title{ font-family:var(--display); font-size:15px; font-weight:600; color:var(--muted); }
  .add-btn{ display:flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--paper); color:var(--ink); border-radius:8px; padding:7px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:var(--ui); transition:background .12s; }
  .add-btn:hover{ background:var(--accent-soft); }
  .scenarios-grid{ display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(224px,1fr)); align-items:stretch; justify-content:center; }
  .scen-card{ background:var(--paper); border:1px solid var(--line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; }
  .scen-head{ background:var(--slate); padding:10px 14px; display:flex; flex-direction:column; gap:6px; flex-shrink:0; }
  .scen-head-top{ display:flex; align-items:center; gap:8px; min-height:28px; }
  .scen-name{ background:transparent; border:none; outline:none; font-family:var(--display); font-size:15px; font-weight:600; color:var(--paper); width:100%; cursor:text; }
  .scen-name::placeholder{ color:rgba(255,255,255,.4); }
  .scen-remove{ background:none; border:none; cursor:pointer; color:rgba(255,255,255,.5); font-size:20px; line-height:1; padding:0; font-family:var(--ui); }
  .scen-remove:hover{ color:var(--paper); }
  .scen-body{ padding:14px; display:flex; flex-direction:column; gap:10px; flex:1; }
  .scen-spacer{ flex:1; min-height:0; } /* pushes result strip to bottom */
  .scen-field{ display:flex; flex-direction:column; gap:3px; }
  .scen-field .label{ font-size:10px; }
  .scen-field .box{ display:flex; align-items:center; border:1px solid var(--line); background:var(--ground); border-radius:8px; padding:0 10px; }
  /* Qualify page sits on a white card — match the income section's white input boxes */
  #qualifyPage .scen-field .box{ background:var(--paper); }
  #qualifyPage .down-box{ background:var(--paper); }
  .scen-field .box.computed{ opacity:.85; }
  .scen-field .box span{ color:var(--muted); font-size:13px; }
  .scen-field input{ width:100%; background:transparent; border:none; outline:none; padding:6px 0; font-size:14px; font-weight:500; color:var(--ink); font-variant-numeric:tabular-nums; }
  .scen-field .computed-val{ padding:6px 0; font-size:14px; font-weight:500; color:var(--muted); font-variant-numeric:tabular-nums; }
  .field-row{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }

  /* ── loan type pills ── */
  .loan-type-row{ display:flex; align-items:center; gap:4px; flex-wrap:nowrap; padding-top:6px; border-top:1px solid rgba(255,255,255,.1); overflow-x:auto; scrollbar-width:none; }
  .loan-type-row::-webkit-scrollbar{ display:none; }
  /* Compact mode kicks in at 4+ scenarios to keep everything fitting */
  .scen-card.compact .lt-btn{ padding:2px 6px; font-size:9px; }
  .scen-card.compact .loan-type-row{ gap:3px; }
  .scen-card.three-up .lt-btn{ padding:2.58px 7.72px; font-size:8.57px; }
  .scen-card.three-up .loan-type-row{ gap:3.43px; }
  .lt-btn{ background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18); border-radius:20px; color:rgba(255,255,255,.6); font-family:var(--ui); font-size:10px; font-weight:600; padding:3px 9px; cursor:pointer; transition:all .12s; white-space:nowrap; }
  .lt-btn:hover{ background:rgba(255,255,255,.16); color:var(--paper); }
  .lt-btn.active{ background:var(--primary); border-color:var(--primary); color:var(--paper); }
  .lt-divider{ width:1px; height:14px; background:rgba(255,255,255,.2); margin:0 4px; flex-shrink:0; }

  /* ── drag handle ── */
  #lo-scenario-host .drag-handle{ cursor:grab; color:rgba(255,255,255,.4); font-size:14px; padding:0 6px 0 0; line-height:1; user-select:none; flex-shrink:0; }
  #lo-scenario-host .drag-handle:active{ cursor:grabbing; }
  .scen-card.drag-over{ outline:2px dashed rgba(255,255,255,.5); outline-offset:-2px; opacity:.7; }
  .scen-card.dragging{ opacity:.35; }

  /* ── copy-from button: the .copy-* rules moved to styles/shell.css (Slice 3a) so the tool "Copy from
     scenario" control — which lives OUTSIDE #lo-scenario-host — can reuse them without a containment
     leak (scenario.css may not style anything outside the host). Zero visual change; sub-unit-1 pattern. ── */

  /* ── down payment smart field ── */
  .down-box{ display:flex; align-items:center; border:1px solid var(--line); background:var(--ground); border-radius:8px; padding:0 10px; }
  .down-prefix{ color:var(--muted); font-size:13px; min-width:8px; }
  .down-hint{ font-size:10px; color:var(--primary); font-weight:600; margin-top:2px; min-height:14px; }

  /* ── LTV pill — neutral only, no color warnings ── */
  .ltv-pill{ display:inline-block; background:var(--accent-soft); color:var(--primary); font-size:10px; font-weight:700; letter-spacing:.04em; padding:2px 8px; border-radius:20px; }

  /* ── PMI row ── */
  .pmi-row{ display:none; }
  .pmi-row.visible{ display:grid; }
  /* pmi-banner removed per request */

  /* ── result strip ── */
  .scen-result{ background:var(--slate); padding:14px; flex-shrink:0; min-height:90px; display:flex; flex-direction:column; justify-content:center; }
  .scen-result .rl{ font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:rgba(255,255,255,.55); margin-bottom:4px; }
  .scen-result .total{ font-family:var(--display); font-size:22px; font-weight:700; color:var(--paper); line-height:1; }
  .scen-result .breakdown{ font-size:11px; color:rgba(255,255,255,.5); margin-top:6px; line-height:1.7; min-height:19px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  /* comparison table */
  .comp-table{ width:auto; border-collapse:collapse; table-layout:fixed; }
  .comp-table .cell-hl{ background:var(--hl-total) !important; }
  .comp-table .cell-hl-source-ctc,
  .comp-table .cell-hl-source-pmt{ background:var(--hl-source) !important; }
  .comp-table th{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); text-align:left; padding:10px 12px; border-bottom:2px solid var(--line); background:var(--paper); word-break:break-word; }
  .comp-table th:first-child{ width:145px; }
  .comp-table td{ padding:10px 12px; font-size:14px; border-bottom:1px solid var(--line); font-variant-numeric:tabular-nums; vertical-align:top; background:var(--paper); word-break:break-word; }
  .comp-table tr:last-child td{ border-bottom:none; }
  .comp-table .rowlabel{ color:var(--muted); font-size:13px; }
  .comp-table .big-num{ font-size:16px; font-weight:700; }
  .comp-table .highlight{ color:var(--primary); }
  /* odd scenario columns (A, C, E…) — light green */
  .comp-table td.col-odd, .comp-table th.col-odd{ background:var(--accent-soft); }
  /* even scenario columns (B, D, F…) */
  .comp-table td.col-even, .comp-table th.col-even{ background:var(--table-even); }
  .comp-table .section-hdr td, .comp-table .section-hdr th{
    background:var(--table-section); font-size:11px; font-weight:700; text-transform:uppercase;
    letter-spacing:.06em; color:var(--primary); padding:8px 12px; border-bottom:1px solid var(--line);
  }

  /* ── teach ── */
  .teach{ font-size:14px; line-height:1.55; margin:0; }

  /* ── LO strip (agent view) ── */
  .lo-strip{ background:var(--slate); border-radius:14px; padding:16px; color:var(--paper); }
  .lo-strip .t{ font-family:var(--display); font-size:17px; font-weight:600; }
  .lo-strip .c{ font-size:13px; opacity:.85; }

  /* ── agent contact block (client/print) ── */
  .agentblk{ display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:20px; }
  .agentblk .ag-name{ font-family:var(--display); font-size:20px; font-weight:600; margin-top:3px; }
  .agentblk .ag-contact{ font-size:14px; color:var(--muted); margin-top:3px; }
  .agentblk .ph{ color:var(--placeholder); }
  .printbtn{ border:none; cursor:pointer; border-radius:8px; padding:8px 16px; font-size:13px; font-weight:600; background:var(--primary); color:var(--paper); font-family:var(--ui); }

  .disc{ font-size:11px; line-height:1.5; color:var(--muted); margin-top:16px; }
  .gap-md{ margin-bottom:16px; }
  .gap-sm{ margin-bottom:10px; }

  /* ── closing costs modal ── */
  .modal-overlay{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:1000; align-items:center; justify-content:center; padding:16px; }
  .modal-overlay.open{ display:flex; }
  .modal{ background:var(--paper); border-radius:16px; width:100%; max-width:680px; max-height:90vh; display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(0,0,0,.2); position:relative; }
  .modal-head{ padding:20px 24px 14px; border-bottom:1px solid var(--line); flex-shrink:0; }
  .modal-head h2{ font-family:var(--display); font-size:20px; font-weight:700; margin:0 0 2px; color:var(--ink); }
  .modal-head .modal-sub{ font-size:13px; color:var(--muted); }
  .modal-close{ position:absolute; top:16px; right:18px; background:none; border:none; font-size:22px; cursor:pointer; color:var(--muted); line-height:1; padding:4px; }
  .modal-close:hover{ color:var(--ink); }
  .modal-body{ overflow-y:auto; padding:20px 24px; flex:1; }
  .modal-foot{ padding:14px 24px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:12px; flex-wrap:wrap; }
  .modal-total-wrap{ display:flex; flex-direction:column; }
  .modal-total-label{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
  .modal-total-val{ font-family:var(--display); font-size:22px; font-weight:700; color:var(--ink); }
  .modal-save-btn{ background:var(--primary); color:var(--paper); border:none; border-radius:8px; padding:9px 20px; font-size:13px; font-weight:600; cursor:pointer; font-family:var(--ui); }
  .modal-save-btn:hover{ background:var(--primary-dk); }
  .cc-print-btn{ background:var(--paper); border:1px solid var(--line); border-radius:8px; padding:7px 14px; font-size:12px; font-weight:600; cursor:pointer; font-family:var(--ui); color:var(--ink); transition:all .12s; }
  .cc-print-btn:hover{ background:var(--accent-soft); border-color:var(--primary); color:var(--primary); }

  /* ── CC worksheet overlay (View Worksheet) ── */
  #cc-print-sheet{
    display:none; position:fixed; inset:0; z-index:2000;
    background:var(--paper); overflow-y:auto; padding:32px;
    font-family:"Helvetica Neue",Arial,sans-serif; font-size:11pt; color:var(--ws-ink);
  }
  #cc-print-sheet.open{ display:block; }
  #cc-ws-close{
    position:fixed; top:16px; right:20px; z-index:2001;
    background:var(--ws-deep); color:var(--paper); border:none; border-radius:8px;
    padding:8px 18px; font-size:13px; font-weight:600; cursor:pointer;
    font-family:"Helvetica Neue",Arial,sans-serif;
  }
  #cc-ws-close:hover{ background:var(--ws-deep-hover); }
  #cc-ws-print{
    position:fixed; top:16px; right:130px; z-index:2001;
    background:none; color:var(--ws-deep); border:1px solid var(--ws-deep); border-radius:8px;
    padding:8px 18px; font-size:13px; font-weight:600; cursor:pointer;
    font-family:"Helvetica Neue",Arial,sans-serif;
  }
  #cc-ws-print:hover{ background:var(--ws-btn-hover); }
  .ws-header{ display:flex; justify-content:space-between; align-items:flex-start; border-bottom:2pt solid var(--primary); padding-bottom:10pt; margin-bottom:12pt; }
  .ws-info{ display:flex; gap:14pt; background:var(--ground); padding:6pt 10pt; border-radius:5pt; margin-bottom:10pt; font-size:9.5pt; flex-wrap:wrap; }
  .ws-cols{ display:flex; gap:16pt; }
  .ws-col{ flex:1; }
  .ws-col h2{ font-size:9pt; margin:8pt 0 3pt; font-weight:700; color:var(--primary); text-transform:uppercase; letter-spacing:.04em; border-bottom:1pt solid var(--ws-rule); padding-bottom:2pt; }
  .ws-table{ width:100%; border-collapse:collapse; font-size:9.5pt; }
  .ws-table td{ padding:2.5pt 0; vertical-align:top; }
  .ws-table td:last-child{ text-align:right; white-space:nowrap; padding-left:12pt; }
  .ws-section-hdr td{ font-size:8pt; font-weight:700; color:var(--primary); text-transform:uppercase; letter-spacing:.04em; padding-top:7pt; border-top:1pt solid var(--ws-rule-soft); }
  .ws-total-row td{ font-weight:700; border-top:1.5pt solid var(--ws-ink); padding-top:3pt; }
  .ws-monthly{ background:var(--ground); border-radius:5pt; padding:8pt 12pt; margin-top:10pt; }
  .ws-monthly h2{ font-size:9pt; margin:0 0 5pt; font-weight:700; color:var(--ws-ink); text-transform:uppercase; letter-spacing:.04em; border:none; }
  .ws-monthly-row{ display:flex; gap:18pt; flex-wrap:wrap; font-size:9.5pt; }
  .ws-summary{ background:var(--ws-deep); color:var(--paper); border-radius:6pt; padding:10pt 14pt; margin-top:10pt; display:flex; gap:22pt; flex-wrap:wrap; }
  .ws-sum-item{ display:flex; flex-direction:column; }
  .ws-sum-label{ font-size:7.5pt; text-transform:uppercase; letter-spacing:.05em; opacity:.7; margin-bottom:2pt; }
  .ws-sum-val{ font-size:15pt; font-weight:700; }
  .ws-disc{ font-size:7.5pt; color:var(--ws-muted); margin-top:10pt; border-top:1pt solid var(--ws-rule-soft); padding-top:6pt; line-height:1.6; max-width:800px; }
  .ws-lo{ font-size:9pt; color:var(--ws-muted-strong); text-align:right; }
  @media print{
    #cc-ws-close, #cc-ws-print{ display:none !important; }
    #cc-print-sheet{ position:static; padding:0; }
  }
  .cc-main-section{ background:var(--ground); border-radius:10px; padding:12px 14px; margin-bottom:14px; }
  .cc-main-title{ font-family:var(--display); font-size:13px; font-weight:700; color:var(--ink); margin:0 0 10px; }
  .cc-sub-title{ font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin:12px 0 6px; }
  .cc-row{ display:flex; align-items:center; gap:10px; padding:5px 0; border-bottom:1px solid rgba(0,0,0,.05); }
  .cc-row:last-child{ border-bottom:none; }
  .cc-row-label{ flex:1; }
  .cc-row-name{ font-size:13px; color:var(--ink); }
  .cc-row-note{ font-size:11px; color:var(--muted); }
  .cc-row-input{ display:flex; align-items:center; background:var(--paper); border:1px solid var(--line); border-radius:7px; padding:0 8px; width:110px; flex-shrink:0; }
  .cc-row-input span{ color:var(--muted); font-size:13px; }
  .cc-row-input input{ background:transparent; border:none; outline:none; width:100%; padding:5px 3px; font-size:13px; font-weight:500; color:var(--ink); font-family:var(--ui); font-variant-numeric:tabular-nums; text-align:right; }
  .cc-row-input input::placeholder{ color:var(--cc-placeholder); }
  .cc-name-input{ background:transparent; border:none; outline:none; width:100%; font-size:13px; color:var(--ink); font-family:var(--ui); padding:2px 0; border-bottom:1px dashed transparent; transition:border-color .15s; }
  .cc-name-input:hover{ border-bottom-color:var(--line); }
  .cc-name-input:focus{ border-bottom-color:var(--primary); }
  .cc-drag-handle{ cursor:grab; color:var(--cc-placeholder); font-size:13px; padding:0 8px 0 0; user-select:none; flex-shrink:0; line-height:1; }
  .cc-drag-handle:active{ cursor:grabbing; }
  .cc-drag-handle.apr-active{ color:var(--primary); }
  .cc-apr-toggle{ display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; }
  .cc-apr-switch{ position:relative; width:34px; height:20px; border-radius:20px; background:var(--line); cursor:pointer; flex-shrink:0; transition:background .15s; }
  .cc-apr-switch.on{ background:var(--primary); }
  .cc-apr-switch .knob{ position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:var(--paper); transition:left .15s; }
  .cc-apr-switch.on .knob{ left:16px; }
  .cc-row.cc-dragging{ opacity:.3; }
  .cc-row.cc-drag-over{ border-top:2px solid var(--primary); }
  .cc-section-divider{ height:1px; background:var(--line); margin:6px 0 14px; }
  .cc-appraisal-chip{ background:var(--ground); border:1px solid var(--line); border-radius:20px; padding:2px 10px; font-size:11px; font-weight:600; color:var(--muted); cursor:pointer; font-family:var(--ui); transition:all .12s; white-space:nowrap; }
  .cc-appraisal-chip:hover{ border-color:var(--primary); color:var(--primary); }
  .cc-appraisal-chip.active{ background:var(--primary); border-color:var(--primary); color:var(--paper); }
  .fee-opts-btn{ display:inline-flex; align-items:center; justify-content:center; width:14px; height:14px; border-radius:50%; border:1px solid var(--line); background:var(--paper); color:var(--muted); font-size:9px; font-weight:700; cursor:pointer; padding:0; margin-left:5px; line-height:1; vertical-align:middle; }
  .fee-opts-btn:hover{ border-color:var(--primary); color:var(--primary); }
  .fee-opts-btn.active{ background:var(--primary); border-color:var(--primary); color:var(--paper); }
  .fee-options-menu{ position:absolute; z-index:1100; background:var(--paper); border:1px solid var(--line); border-radius:10px; box-shadow:0 6px 20px rgba(0,0,0,.15); padding:8px; display:none; flex-direction:column; gap:6px; min-width:130px; }
  .fee-options-menu .fee-options-title{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); padding:0 2px 2px; }
  .cc-inline-num{ display:inline-block; width:38px; background:var(--paper); border:1px solid var(--line); border-radius:5px; padding:1px 4px; font-size:12px; font-weight:600; color:var(--ink); font-family:var(--ui); text-align:center; vertical-align:middle; outline:none; }
  .cc-inline-num:focus{ border-color:var(--primary); }
  .cc-inline-rate{ display:inline-block; color:var(--primary); font-weight:600; font-size:12px; vertical-align:middle; }
  .occ-btn{ background:var(--paper); border:none; cursor:pointer; font-family:var(--ui); font-size:11px; font-weight:600; padding:4px 10px; color:var(--muted); transition:all .12s; }
  .occ-btn.active{ background:var(--primary); color:var(--paper); }
  .occ-btn:hover:not(.active){ background:var(--accent-soft); color:var(--primary); }
  /* delete button — hidden until row is hovered */
  .cc-delete-btn{ background:none; border:none; cursor:pointer; color:transparent; font-size:14px; line-height:1; padding:0; width:22px; flex-shrink:0; transition:color .12s; font-family:var(--ui); text-align:center; }
  .cc-row:hover .cc-delete-btn{ color:var(--cc-placeholder); }
  .cc-delete-btn:hover{ color:var(--danger) !important; }
  /* spacer to reserve same width as delete btn on rows that don't have one */
  .cc-row-spacer{ width:22px; flex-shrink:0; }
  /* section header row with + button */
  .cc-sub-header{ display:flex; align-items:center; justify-content:space-between; margin:12px 0 6px; }
  .cc-sub-header .cc-sub-title{ margin:0; }
  .cc-add-row-btn{ background:none; border:1px solid var(--line); border-radius:5px; cursor:pointer; color:var(--primary); font-size:13px; font-weight:700; line-height:1; padding:2px 7px; font-family:var(--ui); transition:background .12s; }
  .cc-add-row-btn:hover{ background:var(--accent-soft); }
  /* section total displayed inline in the sub-header */
  .cc-section-total{ font-size:13px; font-weight:700; color:var(--ink); margin-left:auto; padding-right:4px; font-variant-numeric:tabular-nums; min-width:90px; text-align:right; }
  /* summary row for D and I totals */
  .cc-summary-row{ display:flex; align-items:center; justify-content:space-between; padding:8px 0 4px; }
  .cc-summary-label{ font-size:11px; font-weight:700; color:var(--primary); text-transform:uppercase; letter-spacing:.05em; }
  .cc-summary-val{ font-size:14px; font-weight:700; color:var(--ink); font-variant-numeric:tabular-nums; }

  /* closing date picker */
  .cc-date-bar{ display:flex; align-items:center; gap:14px; padding:12px 14px; background:var(--paper); border:1px solid var(--line); border-radius:10px; margin-bottom:14px; flex-wrap:wrap; }
  .cc-date-label{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); white-space:nowrap; }
  .cc-date-input{ border:1px solid var(--line); border-radius:8px; padding:7px 11px; font-size:13px; font-family:var(--ui); color:var(--ink); outline:none; background:var(--ground); cursor:pointer; }
  .cc-date-input:focus{ border-color:var(--primary); background:var(--paper); }
  .cc-date-hint{ font-size:12px; color:var(--primary); font-weight:600; }
  .cc-history-btns{ display:flex; gap:4px; margin-left:auto; }
  .cc-history-btn{ background:none; border:1px solid var(--line); border-radius:7px; padding:5px 10px; cursor:pointer; font-size:14px; color:var(--muted); font-family:var(--ui); transition:all .12s; }
  .cc-history-btn:hover:not(:disabled){ background:var(--accent-soft); color:var(--primary); border-color:var(--primary); }
  .cc-history-btn:disabled{ opacity:.35; cursor:default; }

  /* ── LO image uploads ── */
  .lo-img-row{ display:flex; gap:16px; margin-top:14px; flex-wrap:wrap; }
  .lo-img-slot{ display:flex; flex-direction:column; gap:6px; width:104px; }
  .lo-img-slot .label{ font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
  .lo-img-preview{ width:104px; height:104px; border-radius:8px; border:1px solid var(--line); object-fit:cover; background:var(--ground); display:flex; align-items:center; justify-content:center; overflow:hidden; }
  .lo-img-preview img{ width:100%; height:100%; object-fit:cover; border-radius:7px; }
  .lo-img-preview .lo-img-placeholder{ color:var(--line); display:flex; }
  .lo-img-logo-preview{ width:104px; height:104px; border-radius:8px; border:1px solid var(--line); background:var(--ground); display:flex; align-items:center; justify-content:center; overflow:hidden; }
  .lo-img-logo-preview img{ max-width:100%; max-height:100%; object-fit:contain; }
  .lo-img-logo-preview .lo-img-placeholder{ color:var(--line); display:flex; }
  .lo-upload-btn{ width:100%; box-sizing:border-box; font-size:11px; font-weight:600; color:var(--primary); background:none; border:1px solid var(--line); border-radius:6px; padding:4px 10px; cursor:pointer; font-family:var(--ui); transition:background .12s; white-space:nowrap; text-align:center; }
  .lo-upload-btn:hover{ background:var(--accent-soft); }
  .lo-upload-err{ font-size:11px; color:var(--danger); margin-top:3px; min-height:14px; }
  /* show images in agent contact block */
  .agentblk .ag-photo{ width:56px; height:56px; border-radius:50%; object-fit:cover; flex-shrink:0; }
  .agentblk .ag-logo{ max-height:36px; max-width:120px; object-fit:contain; }
/* ── view: lo-info page ── */
  #homePage{ display:none; }
  body.view-home #homePage{ display:block; }
  body.view-home #clientSummary, body.view-home #agentBlock,
  body.view-home #loInfoPage, body.view-home #qualifyPage,
  body.view-home #scenInputs, body.view-home #loStrip,
  body.view-home #scenariosGrid, body.view-home #compTable,
  body.view-home #interestOverTimeCard, body.view-home #apCard,
  body.view-home .teach-block, body.view-home #loSetup{ display:none; }

  body.view-info #clientSummary, body.view-info #agentBlock,
  body.view-info #scenInputs, body.view-info #loStrip,
  body.view-info #scenariosGrid, body.view-info #compTable,
  body.view-info #interestOverTimeCard, body.view-info #apCard,
  body.view-info .teach-block, body.view-info #loSetup,
  body.view-info #qualifyPage, body.view-info #refiDetailsPage{ display:none; }
  body.view-info #loInfoPage{ display:block; }

  body.view-qualify #clientSummary, body.view-qualify #agentBlock,
  body.view-qualify #scenInputs, body.view-qualify #loStrip,
  body.view-qualify #scenariosGrid, body.view-qualify #compTable,
  body.view-qualify #interestOverTimeCard, body.view-qualify #apCard,
  body.view-qualify .teach-block, body.view-qualify #loSetup,
  body.view-qualify #loInfoPage, body.view-qualify #refiDetailsPage{ display:none; }
  body.view-qualify #qualifyPage{ display:block; }

  body.view-agent #clientSummary, body.view-agent #agentBlock,
  body.view-agent #loInfoPage, body.view-agent #qualifyPage, body.view-agent #refiDetailsPage{ display:none; }

  body.view-refi #clientSummary, body.view-refi #agentBlock,
  body.view-refi #scenInputs, body.view-refi #loStrip,
  body.view-refi #scenariosGrid, body.view-refi #compTable,
  body.view-refi #interestOverTimeCard, body.view-refi #apCard,
  body.view-refi .teach-block, body.view-refi #loSetup,
  body.view-refi #loInfoPage, body.view-refi #qualifyPage{ display:none; }
  body.view-refi #refiDetailsPage{ display:block; }

  body.view-client #loSetup, body.view-client #scenInputs,
  body.view-client #loStrip, body.view-client #loInfoPage,
  body.view-client #qualifyPage, body.view-client #refiDetailsPage{ display:none; }
  body.view-client .scen-remove{ display:none; }
  body.view-client .add-btn{ display:none; }
  body.view-client .scen-name{ pointer-events:none; }
  body.view-client .down-hint{ display:none; }
  body.view-client .compare-toggle-hint{ display:none; }
  body.view-client .dpa-boost-btn{ display:none; }
  body.view-client .loan-type-row{ display:none; }
  body.view-client .scen-dti{ display:none !important; }
  body.view-client .scen-client-summary{ display:block !important; }
  body.view-client #clientPrintBar{ display:block; }
  body.view-client .client-print-hidden{ display:none !important; }

  #loInfoPage{ display:none; }
  #qualifyPage{ display:none; }
  #refiDetailsPage{ display:none; }

  /* ── qualify page ── */
  .qual-grid{ display:grid; grid-template-columns:minmax(0,520px) minmax(0,400px) minmax(0,400px); gap:16px; }
  @media (max-width:1100px){ .qual-grid{ grid-template-columns:repeat(2, minmax(0, 400px)); } }
  @media (max-width:700px){ .qual-grid{ grid-template-columns:1fr; } }
  .qual-borrower{ background:var(--paper); border:1px solid var(--line); border-radius:14px; padding:20px; margin-bottom:14px; position:relative; }
  .qual-borrower-hdr{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
  .qual-borrower-hdr input{ font-family:var(--display); font-size:16px; font-weight:700; border:none; background:transparent; outline:none; color:var(--ink); flex:1; }
  .qual-remove-btn{ background:none; border:none; color:var(--muted); font-size:16px; cursor:pointer; padding:2px 6px; }
  .qual-remove-btn:hover{ color:var(--danger); }
  .qual-subhdr{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:14px 0 8px; }
  .qual-subhdr:first-child{ margin-top:0; }
  .qual-income-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
  .qual-field{ display:flex; flex-direction:column; gap:3px; }
  .qual-field .label{ font-size:10px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
  .qual-field input, .qual-field select{ border:1px solid var(--line); border-radius:7px; padding:6px 9px; font-size:13px; color:var(--ink); background:var(--paper); outline:none; font-family:var(--ui); }
  .qual-field input:focus, .qual-field select:focus{ border-color:var(--primary); }
  .qual-box{ display:flex; align-items:center; border:1px solid var(--line); background:var(--paper); border-radius:7px; padding:0 9px; }
  .qual-occ-box{ display:flex; border:1px solid var(--line); background:var(--paper); border-radius:7px; overflow:hidden; height:33px; box-sizing:border-box; }
  .qual-occ-box.occ-compact{ height:15px !important; border-radius:3px !important; }
  .qual-occ-box.occ-compact .qual-occ-seg{ font-size:8px !important; }
  .qual-occ-seg{ flex:1; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:12px; font-weight:600; color:var(--muted); border-right:1px solid var(--line); transition:all .12s; background:var(--paper); }
  .qual-occ-seg:last-child{ border-right:none; }
  .qual-occ-seg.active{ background:var(--primary); color:var(--paper); }
  .qual-occ-seg:hover:not(.active){ background:var(--accent-soft); color:var(--primary); }
  .qual-box span{ color:var(--muted); font-size:13px; flex-shrink:0; }
  .qual-box input{ border:none; background:transparent; outline:none; padding:6px 4px; font-size:13px; color:var(--ink); font-family:var(--ui); width:100%; min-width:0; }
  .qual-box input:focus{ outline:none; }
  .qual-housing-toggle{ display:flex; border:1px solid var(--line); border-radius:7px; overflow:hidden; width:fit-content; margin-bottom:10px; }
  .qual-housing-toggle button{ font-family:var(--ui); font-size:11px; font-weight:600; padding:6px 9px; border:none; cursor:pointer; background:var(--paper); color:var(--muted); white-space:nowrap; }
  .qual-housing-toggle button.active{ background:var(--primary); color:var(--paper); }
  .qual-paytype-btn{ background:var(--paper); border:1px solid var(--line); border-radius:3px; font-size:8px; font-weight:600; padding:0 4px; height:15px; line-height:13px; cursor:pointer; color:var(--muted); font-family:var(--ui); box-sizing:border-box; }
  .qual-paytype-btn.active{ background:var(--primary); border-color:var(--primary); color:var(--paper); }
  .qual-owned-prop{ background:var(--ground); border-radius:8px; padding:10px 34px 10px 10px; margin-top:8px; display:grid; grid-template-columns:repeat(4,1fr); gap:8px; align-items:end; position:relative; }
  .qual-owned-prop .qual-remove-btn{ position:absolute; top:8px; right:8px; }
  .qual-add-btn{ background:none; border:1px dashed var(--line); border-radius:8px; color:var(--primary); font-size:12px; font-weight:600; padding:6px 12px; cursor:pointer; width:100%; margin-top:8px; }
  .qual-add-btn:hover{ background:var(--accent-soft); }
  .qual-debt-row{ display:grid; grid-template-columns:minmax(0,150px) 104px 80px 90px 84px; gap:6px; align-items:center; margin-bottom:6px; }
  .qual-debt-actions{ display:flex; align-items:center; gap:4px; }
  .qual-status-btns{ display:flex; gap:2px; height:31px; flex:1; min-width:0; }
  .qual-status-btn{ background:var(--paper); border:1px solid var(--line); border-radius:5px; font-size:8px; font-weight:700; padding:0; cursor:pointer; color:var(--muted); font-family:var(--ui); flex:1; display:flex; align-items:center; justify-content:center; text-align:center; line-height:1; height:100%; }
  .qual-status-btn.active{ background:var(--ground); border-color:var(--ink); color:var(--ink); }
  .qual-status-btn.active-omit{ background:var(--danger); border-color:var(--danger); color:var(--paper); }
  .qual-status-btn.active-pac{ background:var(--primary); border-color:var(--primary); color:var(--paper); }
  .qual-debt-row.is-excluded input[type=text]:first-child,
  .qual-debt-row.is-excluded .qual-box input,
  .qual-debt-row.is-excluded select{ text-decoration:line-through; color:var(--muted); }
  .qual-debt-row select{ border:1px solid var(--line); border-radius:7px; padding:6px 9px; font-size:12px; color:var(--ink); background:var(--paper); outline:none; font-family:var(--ui); }
  .qual-debt-row select:focus{ border-color:var(--primary); }
  .qual-debt-row > input[type=text]{ border:1px solid var(--line); border-radius:7px; padding:6px 9px; font-size:12px; min-width:0; }
  .qual-debt-row > input[type=text]:focus{ outline:none; border-color:var(--primary); }
  .qual-summary-card{ background:var(--slate); color:var(--paper); border-radius:14px; padding:18px 22px; margin-bottom:16px; }
  .qual-ab-btn{ width:30px; height:26px; border-radius:6px; border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.08); color:rgba(255,255,255,.65); font-family:var(--ui); font-size:12px; font-weight:700; cursor:pointer; transition:all .12s; }
  .qual-ab-btn:hover:not(.active){ background:rgba(255,255,255,.16); color:var(--paper); }
  .qual-ab-btn.active{ background:var(--primary); border-color:var(--primary); color:var(--paper); }
  .qual-dti-row{ display:flex; gap:24px; margin-bottom:16px; }
  .qual-dti-item{ flex:1; }
  .qual-dti-label{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; opacity:.65; margin-bottom:4px; }
  .qual-dti-val{ font-size:32px; font-weight:700; }
  .qual-dti-val.warn{ color:var(--dti-warn); }
  .qual-dti-val.danger{ color:var(--dti-danger); }
  .qual-pmt-breakdown{ font-size:12px; opacity:.85; line-height:1.9; border-top:1px solid rgba(255,255,255,.15); padding-top:12px; margin-top:12px; }
  .qual-pmt-breakdown .row{ display:flex; justify-content:space-between; }
  .qual-pmt-breakdown .row.total{ font-weight:700; opacity:1; font-size:14px; border-top:1px solid rgba(255,255,255,.2); padding-top:8px; margin-top:6px; }

  /* ── info page sections ── */
  .info-section{ background:var(--paper); border:1px solid var(--line); border-radius:14px; padding:20px; margin-bottom:16px; }
  .info-section-title{ font-family:var(--display); font-size:16px; font-weight:700; color:var(--ink); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--line); }
  .info-grid{ display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }
  .info-field{ display:flex; flex-direction:column; gap:4px; }
  .info-field input{ border:1px solid var(--line); border-radius:8px; padding:7px 10px; font-size:13px; color:var(--ink); background:var(--paper); outline:none; font-family:var(--ui); }
  .info-field input:focus{ border-color:var(--primary); }
  .info-save-btn{ margin-top:14px; border:none; cursor:pointer; border-radius:8px; padding:8px 18px; font-size:13px; font-weight:600; background:var(--primary); color:var(--paper); font-family:var(--ui); }
  .info-saved-note{ font-size:12px; color:var(--primary); margin-top:8px; min-height:16px; }

  /* ── client print contact block ── */
  .contact-block{ display:flex; align-items:center; gap:14px; padding:14px; background:var(--paper); border:1px solid var(--line); border-radius:12px; flex:1; min-width:260px; }
  .contact-block .cb-photo{ width:56px; height:56px; border-radius:50%; object-fit:cover; flex-shrink:0; display:none; }
  .contact-block .cb-photo.visible{ display:block; }
  .contact-block .cb-middle{ flex:1; }
  .contact-block .cb-name{ font-family:var(--display); font-size:16px; font-weight:700; color:var(--ink); }
  .contact-block .cb-title{ font-size:12px; color:var(--muted); }
  .contact-block .cb-details{ font-size:12px; color:var(--muted); margin-top:4px; line-height:1.6; }
  .contact-block .cb-logo{ max-height:38px; max-width:110px; object-fit:contain; flex-shrink:0; display:none; }
  .contact-block .cb-logo.visible{ display:block; }
  .contacts-row{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }

  /* ── cobrand toggle ── */
  .cobrand-bar{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
  .cobrand-label{ font-size:13px; font-weight:600; color:var(--muted); }
  .cobrand-toggle{ display:flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
  .cobrand-toggle button{ font-family:var(--ui); font-size:12px; font-weight:600; padding:6px 14px; border:none; cursor:pointer; background:var(--paper); color:var(--muted); }
  .cobrand-toggle button.active{ background:var(--primary); color:var(--paper); }

  /* ── print scaling ── */
  @media print{
    .scenarios-grid{ display:flex !important; flex-wrap:nowrap !important; gap:6px !important; }
    .scen-card{ flex:1 1 0 !important; min-width:0 !important; font-size:11px !important; }
    .scen-result .total{ font-size:18px !important; }
    .contacts-row{ flex-wrap:nowrap !important; }
  }

  @media (max-width:600px){
    .scenarios-grid{ grid-template-columns:1fr !important; }
    .field-row{ grid-template-columns:1fr; }
    .borrower-bar{ gap:8px; }
  }
  @page{ margin:0; }
  @media print{
    .no-print{ display:none !important; }
    html,body{ background:var(--paper) !important; }
    body{ padding:10mm; -webkit-print-color-adjust:exact; print-color-adjust:exact; color-adjust:exact; }
    .wrap{ max-width:none; }
    .scen-result,.scen-head,.lo-strip,
    .comp-table td.col-odd,.comp-table th.col-odd,
    .comp-table td.col-even,.comp-table th.col-even,
    .ltv-pill{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
    #lo-scenario-host h1{ font-size:21px; }
    .scen-result .total{ font-size:22px; }
    .card,.scen-card{ break-inside:avoid; }
  }
