/* Interest by lender: opens from the Loans overview card and morphs back into its button. */
:root { --sheet-line:#ea580c; --sheet-fill:#ea580c38; --sheet-up:#b91c1c; --sheet-up-soft:#fee2e2; --sheet-down:#0f766e; --sheet-down-soft:#ccfbf1; }
:root[data-theme=dark] { --sheet-line:#eea566; --sheet-fill:#eea56630; --sheet-up:#ee9898; --sheet-up-soft:#3a2222; --sheet-down:#74c69b; --sheet-down-soft:#183124; }
:root[data-theme=grey-glass] { --sheet-line:#fdba74; --sheet-fill:#fdba7433; --sheet-up:#fca5a5; --sheet-up-soft:#3f1d24; --sheet-down:#86efac; --sheet-down-soft:#143127; }

.private-overview-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:-6px; }
.private-sheet-open { flex:none; display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:6px 12px 6px 10px; border:1px solid var(--border); border-radius:var(--radius-pill); background:var(--surface); color:var(--text); font:inherit; font-size:var(--text-xs); font-weight:600; cursor:pointer; transition:transform var(--motion-fast) var(--motion-ease),border-color var(--motion-fast); }
.private-sheet-open .icon { width:16px; height:16px; color:var(--sheet-line); }
@media (hover:hover) and (pointer:fine){.private-sheet-open:hover{ border-color:var(--control-border); }}
.private-sheet-open:active { transform:scale(.96); }
.private-sheet-open:focus-visible { outline:2px solid var(--link); outline-offset:2px; }

.loan-sheet { display:grid; gap:16px; }
.loan-sheet-card { display:grid; gap:10px; padding:18px 18px 12px; border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); }
.loan-sheet>.private-detail-nav { margin-bottom:-6px; }
.loan-sheet-periods .chip:focus-visible,.loan-sheet-chart:focus-visible,.loan-sheet-table button:focus-visible { outline:2px solid var(--link); outline-offset:2px; }
.loan-sheet-total { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
.loan-sheet-total strong { font-family:var(--font-money); font-size:var(--display-md,var(--text-4xl)); font-weight:600; line-height:1.1; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.loan-sheet-chip { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:var(--radius-pill); background:var(--subtle); color:var(--muted); font-size:var(--text-xs); font-weight:600; }
.loan-sheet-chip .icon { width:14px; height:14px; stroke-width:2.25; }
.loan-sheet-chip.up { background:var(--sheet-up-soft); color:var(--sheet-up); }
.loan-sheet-chip.down { background:var(--sheet-down-soft); color:var(--sheet-down); }
.loan-sheet-sub { margin:0; }
.loan-sheet-periods { position:relative; display:flex; gap:2px; padding:3px; border:1px solid var(--border); border-radius:var(--radius-control); background:var(--subtle); }
.loan-sheet-periods .chip { flex:1; justify-content:center; min-height:34px; padding:6px 4px; border:0; border-radius:var(--radius-xs); background:none; color:var(--muted); font-size:var(--text-xs); font-weight:600; transition:background-color var(--motion-exit),color var(--motion-exit); }
.loan-sheet-periods .chip[aria-pressed=true] { background:var(--surface); color:var(--text); box-shadow:0 1px 2px #0f172a14; }

.loan-sheet-chart { position:relative; margin:18px 0 0; padding:0 0 22px; touch-action:pan-y; cursor:crosshair; border-radius:var(--radius-xs); }
.loan-sheet-chart svg { display:block; width:100%; height:150px; overflow:visible; }
.loan-sheet-fill-top { stop-color:var(--sheet-fill); }
.loan-sheet-fill-bottom { stop-color:var(--sheet-fill); stop-opacity:0; }
.loan-sheet-line { fill:none; stroke:var(--sheet-line); stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.loan-sheet-chart svg { animation:loan-sheet-draw var(--motion-value) var(--motion-ease) both; }
.loan-sheet-area { animation:loan-sheet-fade 250ms var(--motion-ease) both; }
.loan-sheet-base { stroke:var(--divider,var(--border)); stroke-width:1; stroke-dasharray:3 4; }
@keyframes loan-sheet-draw { from { clip-path:inset(-8px 100% -8px 0); } to { clip-path:inset(-8px 0 -8px 0); } }
@keyframes loan-sheet-fade { from { opacity:0; } }
.loan-sheet-dot { position:absolute; left:100%; top:0; width:12px; height:12px; margin:-6px 0 0 -6px; border:2.5px solid var(--surface); border-radius:50%; background:var(--sheet-line); box-shadow:0 0 0 1px var(--sheet-line); opacity:0; pointer-events:none; transition:opacity var(--motion-fast); }
.loan-sheet-tip { position:absolute; top:-26px; left:100%; transform:translateX(-50%); padding:4px 8px; border-radius:var(--radius-xs); background:var(--text); color:var(--surface); font-size:var(--text-xs); font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; opacity:0; pointer-events:none; transition:opacity var(--motion-fast); }
.loan-sheet-tip.flip { transform:translateX(-100%); }
.loan-sheet-tip.start { transform:none; }
.loan-sheet-chart[data-scrubbing] .loan-sheet-dot,.loan-sheet-chart[data-scrubbing] .loan-sheet-tip { opacity:1; }
.loan-sheet-axis { position:absolute; inset:auto 0 0; display:flex; justify-content:space-between; color:var(--muted); font-size:var(--text-2xs); }

.loan-sheet-alloc { display:grid; gap:8px; }
.loan-sheet-alloc h4 { margin:0; font-size:var(--text-sm); }
.loan-sheet-bar { display:block; width:100%; height:10px; border-radius:var(--radius-pill); overflow:hidden; background:var(--subtle); }
.loan-sheet-bar rect { fill:var(--badge); }
.loan-hue-0 { --badge:#2563eb; }.loan-hue-1 { --badge:#0891b2; }.loan-hue-2 { --badge:#7c3aed; }.loan-hue-3 { --badge:#16a34a; }
.loan-hue-4 { --badge:#db2777; }.loan-hue-5 { --badge:#ca8a04; }.loan-hue-6 { --badge:#e11d48; }.loan-hue-7 { --badge:#64748b; }
:root[data-theme=dark] .loan-hue-0,:root[data-theme=grey-glass] .loan-hue-0 { --badge:#7fa6e8; }
:root[data-theme=dark] .loan-hue-1,:root[data-theme=grey-glass] .loan-hue-1 { --badge:#5fc3d6; }
:root[data-theme=dark] .loan-hue-2,:root[data-theme=grey-glass] .loan-hue-2 { --badge:#b39ce8; }
:root[data-theme=dark] .loan-hue-3,:root[data-theme=grey-glass] .loan-hue-3 { --badge:#74c69b; }

.loan-sheet-table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius-section); background:var(--surface); }
.loan-sheet-table { width:100%; border-collapse:collapse; font-size:var(--text-sm); font-variant-numeric:tabular-nums; }
.loan-sheet-table th,.loan-sheet-table td { padding:10px 12px; border-bottom:1px solid var(--divider,var(--border)); text-align:right; vertical-align:middle; }
.loan-sheet-table thead th { padding-block:8px; color:var(--muted); font-size:var(--text-2xs); font-weight:600; white-space:nowrap; }
.loan-sheet-table thead th:first-child,.loan-sheet-table tbody th,.loan-sheet-table tfoot th { text-align:left; }
.loan-sheet-table thead button { padding:4px 0; border:0; background:none; color:inherit; font:inherit; cursor:pointer; }
.loan-sheet-table thead th[aria-sort=descending] { color:var(--text); }
.loan-sheet-table thead th[aria-sort=descending] button::after { content:" \2193"; }
.loan-sheet-table tbody tr:last-child>* { border-bottom:0; }
.loan-sheet-table tbody th { padding:0; font-weight:400; }
.loan-sheet-lender { display:flex; align-items:center; gap:10px; width:100%; min-height:52px; padding:8px 4px 8px 0; border:0; background:none; color:var(--text); font:inherit; text-align:left; cursor:pointer; }
@media (hover:hover) and (pointer:fine){.loan-sheet-lender:hover strong{ text-decoration:underline; text-underline-offset:2px; }}
.loan-sheet-lender>span:last-child { display:grid; min-width:0; }
.loan-sheet-lender strong { font-weight:600; overflow-wrap:anywhere; }
.loan-sheet-lender small { color:var(--muted); font-size:var(--text-2xs); }
.loan-sheet-mark { flex:none; width:4px; height:28px; margin-right:2px; border-radius:0 var(--radius-2xs) var(--radius-2xs) 0; background:var(--badge); }
.loan-sheet-lender .calendar-merchant { flex:none; display:inline-grid; width:30px; height:30px; border-radius:var(--radius-xs); font-size:var(--text-2xs); }
.loan-sheet-table td small { display:block; color:var(--muted); font-size:var(--text-2xs); }
.loan-sheet-interest { font-weight:600; }
.loan-sheet-table td small.loan-sheet-added { color:var(--sheet-up); font-weight:600; }
.loan-sheet-table tfoot>tr>* { border-top:1px solid var(--border); border-bottom:0; background:var(--subtle); font-weight:600; }
.loan-sheet-table tfoot th { padding-left:12px; }

.dialog-footer.loan-sheet-insight { display:flex; align-items:center; gap:12px; }
.loan-sheet-insight>.icon { flex:none; width:18px; height:18px; color:var(--sheet-line); }
.loan-sheet-insight p { flex:1; margin:0; font-size:var(--text-sm); }
.loan-sheet-insight .button { flex:none; }

/* Narrow sheets: the rate and share move under the lender's name. */
.loan-sheet-share-inline { display:none; }
/* Columns follow the sheet's own width: the Loans dialog stays narrow on wide screens too. */
.loan-sheet { container-type:inline-size; }
@container (max-width:560px) {
 .loan-sheet-rate,.loan-sheet-share { display:none; }
 .loan-sheet-share-inline { display:inline; }
}
@media (max-width:639px) {
 .loan-sheet-card { padding:16px 14px 10px; }
 .loan-sheet-table th,.loan-sheet-table td { padding:10px 10px; }
 .loan-sheet-chart svg { height:130px; }
}

::view-transition-group(loan-sheet) { animation-duration:var(--motion-move); animation-timing-function:var(--motion-ease); }
::view-transition-old(loan-sheet),::view-transition-new(loan-sheet) { height:100%; object-fit:cover; overflow:clip; }
@media (prefers-reduced-motion:reduce) { .loan-sheet-chart svg,.loan-sheet-area { animation:none; } .private-sheet-open { transition:none; } }

/* Yearly rate on every loan, coloured by how dear it is: above 18%, 12–18%, below 12%. */
.private-rate-band { font-weight:600; color:var(--text); }
.private-rate-band::before { content:""; display:inline-block; width:7px; height:7px; margin:0 5px 1px 0; border-radius:50%; background:var(--income); vertical-align:middle; }
.private-rate-band.is-mid::before { background:var(--warning); }
.private-rate-band.is-high::before { background:var(--error); }
.private-terms-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(96px,1fr)); gap:10px 14px; margin:0; padding:12px 0; border-block:1px solid var(--divider); }
.private-terms-strip dt { color:var(--muted); font-size:var(--text-xs); }
.private-terms-strip dd { margin:2px 0 0; font-size:var(--text-md); font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.private-terms-strip dd small { margin-left:1px; color:var(--muted); font-size:var(--text-xs); font-weight:500; }
.private-cost-so-far { margin:0; font-size:var(--text-sm); color:var(--muted); }
.private-cost-so-far strong { color:var(--text); font-variant-numeric:tabular-nums; }
.private-agreed-note { margin:0 0 4px; padding:10px 12px; border-radius:var(--radius-xs); background:var(--subtle); font-size:var(--text-sm); }

/* What if the rate was…: a scenario card, never saved. */
.rate-whatif { display:grid; gap:12px; padding:0 16px 16px; }
.rate-whatif-rates,.rate-whatif-mode { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.rate-whatif-now { flex-basis:100%; font-size:var(--text-sm); color:var(--muted); }
.rate-whatif-now strong { color:var(--text); font-variant-numeric:tabular-nums; }
.rate-whatif .chip { display:inline-flex; align-items:center; min-height:40px; padding:6px 12px; border-radius:var(--radius-pill); background:none; font:inherit; font-size:var(--text-sm); font-weight:600; cursor:pointer; }
.rate-whatif .chip[aria-pressed=true] { border-color:var(--brand); background:color-mix(in srgb,var(--brand) 12%,transparent); color:var(--text); }
.rate-whatif-custom input { width:76px; min-height:40px; padding:6px 10px; border:1px solid var(--border); border-radius:var(--radius-pill); background:var(--surface); color:var(--text); font:inherit; font-size:var(--text-sm); }
.rate-whatif-hint,.rate-whatif-units,.rate-whatif p { margin:0; }
.rate-whatif-headline { font-size:var(--text-md); line-height:1.4; }
.rate-whatif-headline strong { font-variant-numeric:tabular-nums; }
.rate-whatif-headline.is-saving strong { color:var(--income); }
.rate-whatif-headline.is-cost strong { color:var(--error); }
.rate-whatif-table { width:100%; border-collapse:collapse; font-size:var(--text-sm); font-variant-numeric:tabular-nums; }
.rate-whatif-table th,.rate-whatif-table td { padding:8px 4px; border-bottom:1px solid var(--divider); text-align:right; }
.rate-whatif-table th[scope=row] { text-align:left; font-weight:500; color:var(--muted); }
.rate-whatif-table thead th { font-size:var(--text-xs); color:var(--muted); font-weight:600; }
.rate-whatif-table td:last-child { font-weight:600; }
.rate-whatif-rank ol { display:grid; gap:4px; margin:4px 0 0; padding-left:20px; font-size:var(--text-sm); }
.rate-whatif-rank li span { display:block; }
.rate-whatif-apply { justify-self:start; }
.rate-whatif .chip:focus-visible,.rate-whatif-custom input:focus-visible { outline:2px solid var(--link); outline-offset:2px; }

/* EMI loans: the instalment, whether EMIs are on track, the schedule and a prepayment comparison. */
.private-emi-card { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:10px; padding:16px; border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); }
.private-emi-head { display:grid; gap:2px; }
.private-emi-head strong { font-size:var(--text-2xl); font-weight:600; font-variant-numeric:tabular-nums; }
.private-emi-head strong small { margin-left:2px; color:var(--muted); font-size:var(--text-sm); font-weight:500; }
.private-emi-card p { margin:0; }
.private-emi-status { font-size:var(--text-sm); font-weight:600; }
.private-emi-status.is-ok::before,.private-emi-status.is-ahead::before,.private-emi-status.is-behind::before { content:""; display:inline-block; width:7px; height:7px; margin:0 6px 1px 0; border-radius:50%; background:var(--income); vertical-align:middle; }
.private-emi-status.is-behind { color:var(--error); }
.private-emi-status.is-behind::before { background:var(--error); }
.private-emi-schedule>summary,.private-emi-prepay>summary { min-height:44px; display:flex; align-items:center; cursor:pointer; font-size:var(--text-sm); font-weight:600; }
.private-emi-schedule table { font-size:var(--text-xs); font-variant-numeric:tabular-nums; }
.private-emi-schedule th,.private-emi-schedule td { white-space:nowrap; padding:8px 4px; }
.private-emi-schedule tbody th { font-weight:500; }
.private-emi-schedule td { text-align:right; }
.private-emi-schedule .payoff-table-scroll { max-height:320px; max-width:100%; overflow:auto; }
.private-emi-prepay input { box-sizing:border-box; max-width:100%; }
.private-emi-prepay label { margin-bottom:10px; }
.private-emi-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; margin-bottom:8px; }
.private-emi-option { display:grid; gap:4px; padding:12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:var(--text-sm); }
.private-emi-option b { color:var(--income); font-variant-numeric:tabular-nums; }
.private-emi-fields .field-pair { gap:12px; }

/* Keep loan controls reachable without changing the two-tone theme. */
.private-sheet-open,.loan-sheet-periods .chip,.rate-whatif .chip,.rate-whatif-custom input { min-height:44px; }
@media (prefers-reduced-motion:reduce) { ::view-transition-group(loan-sheet),::view-transition-old(loan-sheet),::view-transition-new(loan-sheet) { animation:none; } }

/* Loans review: compact summaries and distinct progress/cost explanations. */
.private-large-amount { display:block; color:var(--muted); font-size:var(--text-xs); font-weight:400; line-height:1.5; }
.private-summary-history>summary,.private-balance-breakdown>summary,.private-history>summary,.private-calculation-details>summary,.rate-whatif-calculation>summary { display:flex; align-items:center; gap:8px; min-height:44px; cursor:pointer; font-size:var(--text-sm); font-weight:600; }
.private-balance-breakdown,.private-calculation-details { border-top:1px solid var(--divider); }
.private-balance-breakdown>.private-loan-metrics { margin-top:12px; }
.private-cost-split { margin-block:16px; }.private-cost-split h4 { margin:0 0 12px; font-size:var(--text-sm); }
.private-history { padding-top:0; }
.rate-whatif-outcomes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:0; padding:12px 0; border-block:1px solid var(--divider); }
.rate-whatif-outcomes dt { color:var(--muted); font-size:var(--text-xs); }.rate-whatif-outcomes dd { margin:4px 0 0; font-size:var(--text-md); font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.payoff-curve svg { height:auto; max-height:180px; touch-action:pan-y; }
.payoff-curve svg text { fill:var(--muted); font-size:.5625rem; }.payoff-curve-grid { stroke:var(--divider); stroke-dasharray:2 3; }
.payoff-curve svg circle { fill:var(--brand); stroke:var(--surface); stroke-width:1.5; }
.payoff-curve-scrubber { display:grid; gap:6px; margin-top:12px; font-size:var(--text-xs); }.payoff-curve-scrubber input { width:100%; min-height:44px; padding:0; accent-color:var(--brand); }
.payoff-curve output { display:block; margin-top:4px; font-size:var(--text-sm); font-variant-numeric:tabular-nums; }
::view-transition-group(loan-morph-name),::view-transition-group(loan-morph-amount),::view-transition-group(loan-sheet) { animation-duration:180ms; }
html:active-view-transition-type(loans)::view-transition-old(root),html:active-view-transition-type(loans)::view-transition-new(root) { animation:none; }
@media(max-width:639px) {
 .private-overview.private-overview-focused { padding:14px 16px; }.private-overview-focused>div { gap:3px; }
 .private-overview-figures { margin-top:4px; padding-top:8px; }.private-reminders { padding:10px 12px; gap:4px; }
 .private-detail-workspace .private-loan-top h3 { font-size:var(--text-xl); }.private-detail-workspace .private-loan-total { font-size:var(--text-4xl); }
 .private-detail-workspace .private-interest-math { font-size:var(--text-xs); line-height:1.5; }
 .rate-whatif-outcomes { grid-template-columns:repeat(2,minmax(0,1fr)); }.rate-whatif-outcomes>div:last-child { grid-column:1/-1; }
 .payoff-curve figcaption { flex-wrap:wrap; }.payoff-curve figcaption span:last-child { margin-left:auto; }
}
@media(prefers-reduced-motion:reduce) {
 ::view-transition-group(loan-morph-name),::view-transition-group(loan-morph-amount),::view-transition-group(loan-sheet) { animation:none; }
}

html:active-view-transition-type(loans)::view-transition-group(root) { animation-duration:0s; }

@media(max-width:639px) {
 .private-list-workspace { gap:16px; }
 .private-overview-focused .private-overview-split,.private-overview-focused .private-large-amount { display:none; }
 .private-overview-focused .private-overview-figures { margin-block:4px 0; padding-block:8px 0; }
 .private-summary-history { margin:0; }
}

/* Overdue and upcoming use both words and distinct theme-aware treatments. */
.private-loans .private-due-badge.overdue { color:var(--error); border-color:var(--error); background:color-mix(in srgb,var(--error) 8%,var(--surface)); }
.private-reminders.has-overdue { border-color:color-mix(in srgb,var(--error) 45%,var(--border)); background:color-mix(in srgb,var(--error) 4%,var(--surface)); }
.private-reminder.is-overdue small { color:var(--error); font-weight:600; }
@media(max-width:639px) { .private-overview-focused .private-large-amount { display:block; } }

/* Actions stay with the unlocked loan header; planning gets a contextual footer. */
.private-workspace>.dialog-heading { overflow:visible; }
.private-workspace .private-header-actions { position:static; flex:none; }
.private-header-actions>summary.icon-button { width:44px; height:44px; min-height:44px; padding:10px; justify-content:center; }
.private-header-actions>div { top:100%; left:auto; right:16px; width:min(280px,calc(100% - 32px)); z-index:8; }
.private-header-actions>div .button { justify-content:flex-start; }
.private-planning-footer [data-action=private-add] { flex:none; }
.private-planning-footer [data-action=private-strategy-focus] { flex:1; width:auto; }
.private-planning-footer [data-loan-footer-planning] { flex-basis:100%; }
.strategy-option-selected { display:none; font-weight:600; }
.strategy-option[aria-pressed=true] { border:2px solid var(--link); padding:9px 11px; background:color-mix(in srgb,var(--brand) 10%,var(--surface)); }
.strategy-option[aria-pressed=true] .strategy-option-selected { display:block; color:var(--text); }
@media(max-width:639px) {
 .private-workspace>.dialog-heading:has(.private-header-actions) { gap:6px; }
 .private-header-actions>div { right:16px; }
 .private-workspace .private-planning-footer { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; }
 .private-planning-footer [data-loan-footer-planning] { grid-column:1/-1; }
 .private-planning-footer [data-action=private-strategy-focus] { grid-column:1; width:100%; font-size:var(--text-sm); }
 .private-planning-footer [data-action=private-add] { grid-column:2; font-size:var(--text-sm); padding-inline:12px; }
}

/* Reserve one header row for back, title, actions, lock and close at phone width. */
.private-workspace>.dialog-heading:has(.private-header-actions) { display:grid; grid-template-columns:44px minmax(0,1fr) 44px auto 44px; gap:6px; align-items:center; }
.private-workspace>.dialog-heading:has(.private-header-actions)>.sheet-drag-handle { display:none; }
.private-workspace>.dialog-heading:has(.private-header-actions)>h2 { grid-column:2; grid-row:1; margin:0; }
.private-workspace>.dialog-heading:has(.private-header-actions)>.private-header-back { grid-column:1; grid-row:1; }
.private-workspace>.dialog-heading:has(.private-header-actions)>.private-header-actions { grid-column:3; grid-row:1; }
.private-workspace>.dialog-heading:has(.private-header-actions)>.private-header-lock { grid-column:4; grid-row:1; min-width:0; padding-inline:10px; }
.private-workspace>.dialog-heading:has(.private-header-actions)>[data-action=close] { grid-column:5; grid-row:1; }

/* Interest report: distinguish period activity, current balances and estimated cost. */
.loan-sheet-summary { display:grid; gap:4px; }.loan-sheet-summary p { margin:0; }
.loan-sheet-key-figures { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0; }
.loan-sheet-key-figures dt { color:var(--muted); font-size:var(--text-xs); }.loan-sheet-key-figures dd { margin:3px 0 0; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.loan-sheet-chart-heading { gap:8px; font-size:var(--text-xs); }.loan-sheet-chart-heading strong { font-weight:600; }
.loan-sheet-chart { padding-left:56px; margin-top:12px; }.loan-sheet-plot { position:relative; }
.loan-sheet-chart svg { height:90px; }.loan-sheet-y-axis { position:absolute; left:0; top:0; bottom:22px; display:flex; flex-direction:column; justify-content:space-between; width:50px; text-align:right; color:var(--muted); font-size:var(--text-2xs); }
.loan-sheet-axis { left:56px; }.loan-sheet-chart-heading .muted { font-size:var(--text-2xs); }
.loan-sheet-scrubber { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; font-size:var(--text-xs); }.loan-sheet-scrubber input { min-height:44px; width:100%; padding:0; accent-color:var(--sheet-line); }
.loan-sheet-card output { font-variant-numeric:tabular-nums; }.loan-sheet-explanation { font-size:var(--text-xs); }.loan-sheet-explanation summary { min-height:36px; display:flex; align-items:center; cursor:pointer; }.loan-sheet-explanation p { margin:8px 0; }
.loan-sheet-metrics { display:flex; flex-wrap:wrap; gap:6px; }.loan-sheet-metrics .chip { min-height:44px; }.loan-sheet-metrics [aria-pressed=true] { background:var(--subtle); border-color:var(--link); }
.loan-sheet-table thead th { white-space:normal; }.loan-sheet-table td small { font-size:var(--text-2xs); }
.loan-sheet-alloc { border:1px solid var(--border); border-radius:var(--radius-card); padding:0 12px; }
.loan-sheet-alloc>summary { display:flex; flex-wrap:wrap; gap:4px 12px; align-items:center; min-height:44px; font-size:var(--text-sm); cursor:pointer; }.loan-sheet-alloc>summary>span { margin-left:auto; color:var(--muted); font-size:var(--text-xs); }
.loan-sheet-balance-bars { display:grid; gap:12px; margin:8px 0; padding:0; list-style:none; }.loan-sheet-balance-bars li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; font-size:var(--text-sm); }.loan-sheet-balance-bars strong { font-weight:600; font-variant-numeric:tabular-nums; }.loan-sheet-balance-bars small { color:var(--muted); font-weight:400; }.loan-sheet-balance-bars svg { grid-column:1/-1; width:100%; height:6px; border-radius:3px; }.loan-sheet-balance-bars rect { fill:var(--badge); }.loan-sheet-balance-base { fill:var(--subtle)!important; }.loan-hue-other { --badge:var(--muted); }
.loan-sheet-header-period { display:block; color:var(--muted); font-size:var(--text-xs); font-weight:400; }
.private-workspace>.dialog-heading:has([data-action=private-sheet-close]) { display:grid; grid-template-columns:44px minmax(0,1fr) auto 44px; gap:6px; align-items:center; }
.private-workspace>.dialog-heading:has([data-action=private-sheet-close])>.sheet-drag-handle { display:none; }
.private-workspace>.dialog-heading:has([data-action=private-sheet-close])>[data-action=private-sheet-close] { grid-column:1; grid-row:1; }
.private-workspace>.dialog-heading:has([data-action=private-sheet-close])>h2 { grid-column:2; grid-row:1; margin:0; }
.private-workspace>.dialog-heading:has([data-action=private-sheet-close])>.private-header-lock { grid-column:3; grid-row:1; padding-inline:10px; }
.private-workspace>.dialog-heading:has([data-action=private-sheet-close])>[data-action=close] { grid-column:4; grid-row:1; }
.loan-sheet-insight p { min-width:0; overflow-wrap:anywhere; font-size:var(--text-xs); line-height:1.4; }.loan-sheet-insight .button { max-width:140px; white-space:normal; text-align:center; }
@media(max-width:639px) {
 .loan-sheet-card { padding:12px; gap:8px; }.loan-sheet-chart svg { height:80px; }.loan-sheet-chart-heading { flex-wrap:wrap; }
 .private-workspace .loan-sheet-insight { display:grid; grid-template-columns:18px minmax(0,1fr) auto; gap:8px; }.private-workspace .loan-sheet-insight>.primary { width:auto; }
 .loan-sheet-table th,.loan-sheet-table td { padding:8px 6px; }.loan-sheet-total strong { font-size:var(--text-3xl); }
 .loan-sheet-key-figures dt { font-size:var(--text-2xs); }.loan-sheet-key-figures dd { font-size:var(--text-sm); }.loan-sheet-total .loan-sheet-chip { font-size:var(--text-2xs); }
 .loan-sheet-alloc>summary>span { margin-left:0; }.loan-sheet-balance-bars strong small { display:block; text-align:right; }
}

.private-existing-emi { margin-top:12px; font-size:var(--text-sm); }.private-existing-emi>summary { min-height:44px; display:flex; align-items:center; font-weight:600; cursor:pointer; }.private-existing-emi p { margin:8px 0; }
.private-import-review .payoff-table-scroll { max-height:320px; overflow:auto; }.private-import-review table { width:100%; border-collapse:collapse; font-size:var(--text-xs); font-variant-numeric:tabular-nums; }.private-import-review th,.private-import-review td { padding:8px 6px; border-bottom:1px solid var(--divider); text-align:right; white-space:nowrap; }.private-import-review th:first-child { text-align:left; }.private-import-review .private-loan-metrics { margin-block:16px; }
.private-import-confirm { display:flex; align-items:flex-start; gap:10px; padding:12px; border-radius:var(--radius-sm); background:var(--subtle); font-size:var(--text-sm); line-height:1.5; }.private-import-confirm input { flex:none; width:20px; height:20px; min-height:20px; margin:0; padding:0; }

.loan-sheet-inspector { display:grid; grid-template-columns:minmax(0,1fr) minmax(90px,.7fr); gap:12px; align-items:center; }
.loan-sheet-inspector .loan-sheet-scrubber { display:block; }.loan-sheet-inspector output { font-size:var(--text-xs); line-height:1.4; }
@media(max-width:639px) {
 .loan-sheet-key-figures { grid-template-columns:1fr; gap:4px; }.loan-sheet-key-figures>div { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }.loan-sheet-key-figures dd { margin:0; }
 .loan-sheet-periods { padding:0; }.loan-sheet-chart-heading { font-size:var(--text-2xs); line-height:1.4; }
 .loan-sheet-chart { margin-top:4px; padding-bottom:16px; }.loan-sheet-chart svg { height:60px; }.loan-sheet-y-axis { bottom:16px; }.loan-sheet-axis { font-size:var(--text-2xs); line-height:1.4; }
 .loan-sheet-insight p { font-size:var(--text-2xs); }.loan-sheet-chip { max-width:100%; }.loan-sheet-chip .icon { flex:none; }
}

@media(max-width:639px) {
 .loan-sheet-card { gap:5px; }.loan-sheet-summary>p { display:none; }
 .loan-sheet-key-figures { line-height:1.4; }.loan-sheet-chart { margin-top:0; }.loan-sheet-chart svg { height:50px; }.loan-sheet-y-axis { font-size:var(--text-2xs); line-height:1; }
 .loan-sheet-inspector { display:block; }.loan-sheet-inspector .loan-sheet-scrubber { display:none; }
}

.loan-sheet-chart svg { animation-duration:180ms; }.loan-sheet-area { animation-duration:140ms; animation-delay:0ms; }.loan-sheet-y-axis:has(span:only-child) { justify-content:flex-end; }

/* Loans analytics, exports and reviewed calculation changes. */
.private-month-summary,.private-analytics,.private-scenario,.private-statement-checkpoint{border:1px solid var(--border);border-radius:var(--radius-md);padding:16px;margin:16px 0;min-width:0}.private-month-summary h3{margin:0 0 12px}.private-month-summary ul,.private-statement-checkpoint ul{list-style:none;padding:0}.private-month-summary small{display:block}.private-analytics summary,.private-scenario summary,.private-statement-checkpoint summary{min-height:44px;font-weight:600;cursor:pointer}.private-analytics label,.private-scenario label{display:block;margin:12px 0}.private-analytics .payoff-table-scroll,.private-scenario .payoff-table-scroll{max-width:100%;margin:16px 0}.private-analytics table,.private-scenario table{min-width:640px}.private-scenario form{padding:0}.private-scenario-curve{margin:16px 0}.private-scenario li{margin:12px 0;overflow-wrap:anywhere}.private-export-actions{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0}.private-export-actions .button{min-height:44px}.private-history-completeness{overflow-wrap:anywhere}.private-loans textarea[readonly]{width:100%;box-sizing:border-box;font-size:12px}.private-history-filters{display:flex;flex-wrap:wrap;gap:12px}.private-history-filters label{flex:1;min-width:120px}.private-analytics svg text{fill:var(--muted);font-size:12px}@media(max-width:639px){.private-month-summary,.private-analytics,.private-scenario,.private-statement-checkpoint{padding:12px}.private-export-actions{flex-direction:column}.private-scenario .field-pair{grid-template-columns:1fr}.private-scenario li .text-button{min-height:44px}}


/* Soft, opaque card surfaces only within unlocked Loans. No image or blur dependencies. */
dialog.private-workspace,dialog:has([data-private-loans].private-form){--loan-panel:var(--surface);--loan-panel-soft:var(--subtle);--loan-card-border:var(--border);--loan-avatar:var(--brand-soft);--whatif-blue:#3478ed;--whatif-yellow:#d3a82e;--loan-shadow:0 5px 18px #101c2b08;background-color:var(--bg);background-image:radial-gradient(ellipse at 4% 12%,#78a8ee16,transparent 48%),radial-gradient(ellipse at 96% 35%,#f4d77520,transparent 52%);}
:root[data-theme=light] dialog.private-workspace,:root[data-theme=light] dialog:has([data-private-loans].private-form){--bg:#f7f6f0;--surface:#fffefa;--subtle:#f1f2ed;--text:#18212b;--muted:#626b76;--border:#dde2e7;--divider:#e4e7e8;--loan-panel:#fffefa;--loan-panel-soft:#f5f5ef;--loan-card-border:#dce1e5;--loan-avatar:#e7efff;--whatif-blue:#3478ed;--whatif-yellow:#d4b23f;}
:root[data-theme=dark] dialog.private-workspace,:root[data-theme=dark] dialog:has([data-private-loans].private-form){--bg:#161b1e;--surface:#23292d;--subtle:#2b3237;--text:#f0f2f4;--muted:#b1bbc3;--border:#414a52;--divider:#394249;--brand:#9eb8ff;--brand-soft:#303d5b;--on-brand:#15213b;--link:#afc5ff;--warning:#e3bf66;--income:#88cfb7;--error:#ffaaa8;--loan-panel:#23292d;--loan-panel-soft:#272f34;--loan-card-border:#414a52;--loan-avatar:#303d5b;--whatif-blue:#8eacff;--whatif-yellow:#e3bf66;--loan-shadow:0 8px 24px #0000001c;background-image:radial-gradient(ellipse at 8% 10%,#6d99ca1a,transparent 48%),radial-gradient(ellipse at 96% 40%,#b58a4412,transparent 50%);}
.private-workspace .dialog-heading,dialog:has([data-private-loans].private-form) .dialog-heading{background:var(--loan-panel);border-bottom-color:var(--loan-card-border);}
.private-workspace>.dialog-footer,dialog:has([data-private-loans].private-form) .dialog-footer{background:var(--loan-panel);border-top-color:var(--loan-card-border);}
.private-loans .private-loan-list{display:grid;gap:12px;border:0;background:transparent;overflow:visible;}
.private-loans .private-loan-row{border:1px solid var(--loan-card-border);border-radius:var(--radius-lg);overflow:hidden;background:var(--loan-panel);box-shadow:var(--loan-shadow);}
.private-loans .private-loan-row+.private-loan-row{border-top:1px solid var(--loan-card-border);}
.private-loans .private-loan-open{background:transparent;padding:18px 16px;}
.private-loans .private-card-footer{background:var(--loan-panel-soft);border-top:1px solid var(--divider);}
.private-loans .private-row-name{position:relative;padding-left:42px;min-width:0;}
.private-loans .private-row-name>strong{font-weight:600;line-height:1.4;}
.private-lender-avatar{position:absolute;left:0;top:2px;display:grid;place-items:center;width:30px;height:30px;border-radius:var(--radius-sm);background:var(--loan-avatar);color:var(--text);font-size:14px;font-weight:650;line-height:1;}
.private-loans .private-row-since,.private-loans .private-row-name>.private-due-badge,.private-loans .private-row-name>.private-cost-tag{margin-left:-42px;}
.private-loans .private-overview,.private-loans .private-month-summary,.private-loans .private-analytics,.private-loans .private-scenario,.private-loans .private-statement-checkpoint,.private-loans .private-strategy-fold,.private-loans .private-emi-card{background:var(--loan-panel);border:1px solid var(--loan-card-border);border-radius:var(--radius-lg);box-shadow:var(--loan-shadow);}
.private-loans .private-detail-balance{background:var(--loan-panel);border-radius:var(--radius-lg);padding:20px;border:1px solid var(--loan-card-border);}
[data-private-loans].private-form fieldset{border-radius:var(--radius-md);border-color:var(--loan-card-border);}
/* Rate comparison: the chart is the primary surface; rate and custom input stay at its bottom. */
.private-loans .rate-whatif{gap:16px;padding:0 16px 18px;min-width:0;}
.rate-whatif-visual{padding:16px;background:var(--loan-panel-soft,var(--subtle));border:1px solid var(--divider);border-radius:var(--radius-lg);min-width:0;}
.whatif-chart-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.whatif-chart-heading>div{min-width:0;}.whatif-chart-heading .eyebrow{font-size:var(--text-xs);letter-spacing:0;text-transform:none;color:var(--muted);}
.whatif-chart-heading strong{display:block;font-family:var(--font-money);font-size:clamp(25px,4vw,36px);line-height:1.2;font-weight:650;letter-spacing:-.7px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;}
.whatif-month-badge{flex:none;padding:4px 8px;border-radius:var(--radius-pill);background:var(--loan-panel,var(--surface));border:1px solid var(--divider);font-size:var(--text-2xs);color:var(--muted);white-space:nowrap;}
.whatif-chart-legend{display:flex;gap:8px 14px;flex-wrap:wrap;margin:12px 0 2px;font-size:var(--text-2xs);line-height:1.5;color:var(--muted);}
.whatif-chart-legend>span{display:inline-flex;align-items:center;gap:5px;}.whatif-chart-legend i{display:inline-block;width:7px;height:7px;border-radius:50%;}.whatif-principal-key{background:var(--whatif-blue);}.whatif-interest-key{background:var(--whatif-yellow);}.whatif-chart-legend .whatif-current-key{width:15px;height:0;border-top:2px dashed var(--text);border-radius:0;}
.whatif-balance-chart{display:block;width:100%;height:auto;overflow:visible;margin-top:8px;touch-action:pan-y;}
.whatif-principal{fill:var(--whatif-blue);}.whatif-interest{fill:var(--whatif-yellow);}.whatif-current-line{fill:none;stroke:var(--text);stroke-width:2;stroke-dasharray:5 4;opacity:.7;}.whatif-baseline{stroke:var(--divider);stroke-width:1;}.whatif-selected-line{stroke:var(--muted);stroke-width:1;stroke-dasharray:2 4;}.whatif-selected-dot{fill:var(--text);stroke:var(--loan-panel,var(--surface));stroke-width:2;}.whatif-axis{font:12px var(--font-ui);fill:var(--muted);}
.whatif-month-slider{display:block;font-size:var(--text-xs);color:var(--muted);margin:8px 0;}.whatif-month-slider input{display:block;width:100%;min-height:44px;padding:0;accent-color:var(--whatif-blue);cursor:pointer;}
.whatif-chart-readout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;padding:10px 0;font-size:var(--text-xs);color:var(--muted);font-variant-numeric:tabular-nums;}.whatif-chart-readout span:last-child{grid-column:1/-1;}.whatif-chart-readout strong{display:block;color:var(--text);font-weight:600;}
.whatif-horizons{display:flex;gap:6px;flex-wrap:wrap;}.whatif-horizons .chip{flex:1;justify-content:center;}.whatif-chart-note{padding:10px 0;}.whatif-exact>summary{min-height:44px;display:flex;align-items:center;font-size:var(--text-xs);cursor:pointer;}.whatif-exact table{min-width:640px;font-size:var(--text-xs);font-variant-numeric:tabular-nums;}.whatif-exact th,.whatif-exact td{padding:8px;text-align:right;white-space:nowrap;}.whatif-exact th:first-child{text-align:left;}
.rate-whatif-bottom{display:grid;gap:12px;padding-top:16px;border-top:1px solid var(--divider);}.rate-whatif-preset-label{flex-basis:100%;font-size:var(--text-xs);color:var(--muted);}.rate-whatif-rates .chip{flex:1;justify-content:center;}.rate-whatif .chip{min-height:44px;}.rate-whatif .chip[aria-pressed=true]{background:var(--loan-avatar,var(--brand-soft));border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand);}
.rate-whatif .rate-whatif-custom{display:grid;grid-template-columns:minmax(0,1fr) minmax(90px,120px);align-items:center;gap:12px;margin:0;font-size:var(--text-sm);font-weight:500;}.rate-whatif-input-wrap{position:relative;}.rate-whatif .rate-whatif-custom input{width:100%;box-sizing:border-box;min-height:44px;padding:8px 28px 8px 12px;border-radius:var(--radius-sm);background:var(--loan-panel,var(--surface));}.rate-whatif-input-wrap>span{position:absolute;right:12px;top:50%;transform:translateY(-50%);font-size:var(--text-sm);color:var(--muted);pointer-events:none;}
.rate-whatif-mode .chip{flex:1;justify-content:center;}.rate-whatif-outcomes{gap:12px;}.rate-whatif-table{font-size:var(--text-xs);}.rate-whatif-table th,.rate-whatif-table td{overflow-wrap:anywhere;}.rate-whatif-apply{width:100%;white-space:normal;min-height:44px;}.rate-whatif input:focus-visible,.rate-whatif button:focus-visible{outline:2px solid var(--link);outline-offset:3px;}
@media(max-width:639px){.private-loans .private-loan-open{padding:16px 12px;}.private-loans .private-row-name{padding-left:36px;}.private-loans .private-row-since,.private-loans .private-row-name>.private-due-badge,.private-loans .private-row-name>.private-cost-tag{margin-left:-36px;}.private-lender-avatar{width:27px;height:27px;border-radius:var(--radius-xs);}.private-loans .private-detail-balance{padding:16px;}.private-loans .rate-whatif{padding:0 12px 14px;}.rate-whatif-visual{padding:12px;border-radius:var(--radius-md);}.whatif-chart-heading{gap:6px;}.whatif-month-badge{font-size:var(--text-2xs);padding:4px 6px;}.whatif-chart-heading .eyebrow{font-size:var(--text-2xs);}.whatif-chart-heading strong{font-size:28px;}.whatif-chart-legend{gap:6px 10px;font-size:var(--text-2xs);}.whatif-chart-readout{font-size:var(--text-2xs);}.rate-whatif .rate-whatif-custom{font-size:var(--text-xs);}.private-loans .private-row-amount{max-width:125px;}}
@media(prefers-reduced-motion:reduce){.rate-whatif-visual *{animation:none!important;transition:none!important;}.private-loans .private-loan-row{transition:none!important;}}

/* Keep the chart, controls and headline close together on phones. */
.whatif-chart-readout{display:flex;flex-wrap:wrap;gap:3px 12px;padding:4px 0 8px;line-height:1.5;}.whatif-chart-readout span:last-child{flex-basis:100%;}.whatif-chart-readout strong{display:inline;margin-left:4px;}.rate-whatif-bottom{gap:10px;padding-top:12px;}.whatif-saving-summary{font-size:var(--text-sm);padding:10px 0 0;line-height:1.5;}.whatif-saving-summary strong{font-variant-numeric:tabular-nums;}.rate-whatif-analysis{border-top:1px solid var(--divider);padding-top:4px;min-width:0;}.rate-whatif-analysis>summary{display:flex;align-items:center;min-height:44px;font-size:var(--text-sm);font-weight:600;cursor:pointer;}.rate-whatif-analysis [data-whatif-details]{display:grid;gap:12px;padding-top:12px;}.whatif-exact>summary{min-height:36px;font-size:var(--text-2xs);}.rate-whatif .rate-whatif-now{font-size:var(--text-xs);}.rate-whatif .rate-whatif-preset-label{font-size:var(--text-2xs);}


/* A lender card expands into its detail hero; secondary content settles after it. */
.private-loan-hero{min-width:0;display:grid;gap:16px;padding:18px;border:1px solid var(--loan-card-border,var(--border));border-radius:var(--radius-lg);background:var(--loan-panel,var(--surface));box-shadow:var(--loan-shadow);}
.private-loan-identity{position:relative;min-width:0;padding-left:54px;}.private-detail-avatar{position:absolute;left:0;top:2px;display:grid;place-items:center;width:40px;height:40px;border-radius:var(--radius-sm);background:var(--loan-avatar,var(--brand-soft));color:var(--text);font-weight:650;font-size:20px;line-height:1;}.private-loan-hero .private-detail-balance{background:transparent;border:0;border-top:1px solid var(--divider);border-radius:0;padding:16px 0 0;}.private-loan-detail-body{display:grid;gap:20px;min-width:0;}.private-loan-identity h3:focus{outline:none;}

.loan-row-flight{isolation:isolate;pointer-events:none;overflow:visible;}.loan-row-flight-part{pointer-events:none;will-change:transform;}
@media(max-width:639px){.private-loan-hero{padding:16px;gap:14px;}.private-loan-identity{padding-left:46px;}.private-detail-avatar{width:34px;height:34px;border-radius:var(--radius-sm);font-size:17px;}.private-loan-detail-body{gap:16px;}}

/* Loan planning: controls explain the payment, charts compare balances, schedules retain exact paise. */
.loan-options{display:grid;gap:16px;min-width:0}
.loan-options fieldset{min-width:0;margin:0;padding:14px;border:1px solid var(--divider);border-radius:var(--radius-md)}
.loan-options legend{padding-inline:5px;font-size:var(--text-sm);font-weight:600}
.loan-option-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.loan-option-fields label{font-size:var(--text-sm);min-width:0}
.loan-option-fields input,.loan-option-fields select{width:100%;min-height:44px;font-size:var(--text-md)}
.loan-options input[readonly]{color:var(--muted);background:var(--subtle)}
.loan-options input:disabled{opacity:.65}
.loan-option-fields+p{margin-top:12px}
.loan-option-statement{padding:16px;background:var(--loan-panel,var(--surface));border:1px solid var(--divider);border-radius:var(--radius-md)}
.loan-option-statement dl{display:grid;gap:12px;margin-block:14px}
.loan-option-statement dl>div{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2fr);gap:12px}
.loan-option-statement dt{font-size:var(--text-xs);color:var(--muted)}
.loan-option-statement dd{margin:0;font-size:var(--text-sm);overflow-wrap:anywhere}
.loan-option-equation{display:grid;gap:10px;padding:16px;background:var(--loan-panel,var(--surface));border-radius:var(--radius-md);border:1px solid var(--divider)}
.loan-option-equation strong{display:block;margin-top:5px;font-variant-numeric:tabular-nums;font-size:var(--text-lg)}
.loan-option-equation>span{font-size:var(--text-xs);color:var(--muted)}
.loan-option-equation strong{color:var(--text)}
.loan-option-outcomes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-block:18px}
.loan-option-outcomes dt{font-size:var(--text-xs);color:var(--muted)}
.loan-option-outcomes dd{margin:6px 0 0;font-size:var(--text-lg);font-weight:600;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.loan-option-chart-controls,.loan-option-legend{display:flex;gap:10px;flex-wrap:wrap;margin-block:16px}
.loan-option-chart-controls button{min-height:44px;white-space:normal;flex:1}
.loan-option-legend{font-size:var(--text-xs);color:var(--muted)}
.loan-option-legend>span{display:inline-flex;gap:7px;align-items:center}
.loan-key{display:inline-block;width:20px;height:3px;background:var(--reference-blue)}
.loan-key.current{height:0;background:none;border-top:2px dashed var(--muted)}
.loan-key.interest{background:var(--reference-yellow,var(--warning))}
.loan-options svg{display:block;width:100%;height:auto;overflow:visible}
.loan-option-axis{font:12px var(--font-ui);fill:var(--muted)}
.loan-option-grid{stroke:var(--divider);stroke-width:1;vector-effect:non-scaling-stroke}
.loan-option-line{fill:none;stroke-width:2.5;vector-effect:non-scaling-stroke}
.loan-option-line.current{stroke:var(--muted);stroke-dasharray:6 5}
.loan-option-line.planned{stroke:var(--reference-blue)}
.loan-option-principal{fill:var(--reference-blue)}
.loan-option-interest{fill:var(--reference-yellow,var(--warning))}
.loan-option-comparison>summary,.loan-option-amortization>summary{min-height:44px;padding-block:12px;cursor:pointer}
.loan-options table{width:100%;font-size:var(--text-xs);font-variant-numeric:tabular-nums;border-collapse:collapse}
.loan-options :is(th,td){padding:10px;text-align:right;border-bottom:1px solid var(--divider);white-space:nowrap}
.loan-options th:first-child{text-align:left}
.loan-options .payoff-table-scroll{position:relative;contain:inline-size layout;max-width:100%;overflow:auto}
.loan-option-amortization label{font-size:var(--text-xs);margin-block:10px}
.loan-option-amortization select{min-height:44px}
.rate-whatif-bottom{border-top:0;padding-top:0;margin-bottom:16px}
.whatif-new-line{fill:none;stroke:var(--whatif-blue,var(--reference-blue));stroke-width:2.5;vector-effect:non-scaling-stroke}
.whatif-current-line{vector-effect:non-scaling-stroke}
.whatif-balance-chart .whatif-axis{font-size:12px}
.rate-whatif .whatif-horizons .chip{min-height:44px;min-width:80px;white-space:normal}
@media(max-width:639px){
 .loan-option-fields{grid-template-columns:minmax(0,1fr)}
 .loan-option-outcomes{grid-template-columns:minmax(0,1fr);gap:12px}
 .loan-option-outcomes>div{display:flex;justify-content:space-between;align-items:baseline;gap:12px;border-bottom:1px solid var(--divider);padding-bottom:10px}
 .loan-option-outcomes dd{font-size:var(--text-md);text-align:right}
 .loan-option-statement dl>div{grid-template-columns:minmax(0,1fr)}
}

.loan-options{--loan-payment-interest:light-dark(#e8b855,#cbb36c)}
.loan-options .loan-key.interest{background:var(--loan-payment-interest)}
.loan-options .loan-option-interest{fill:var(--loan-payment-interest)}
.loan-option-footer-action[hidden]{display:none}

/* Unlocked Loans: one balance hero, a secondary EMI card, and quiet task cards. */
dialog.private-workspace{--loan-card-radius:20px;--loan-card-space:20px}
.private-workspace .private-loan-hero{margin:0;padding:24px;border:1px solid var(--border);border-radius:var(--radius-xl);background:var(--surface);box-shadow:none}
.private-workspace .private-loan-top{align-items:flex-start;gap:16px}
.private-workspace .private-loan-identity h3{font-size:var(--text-xl);font-weight:600;line-height:1.4}
.private-workspace .private-detail-avatar{background:color-mix(in srgb,var(--reference-blue) 24%,var(--surface));border-radius:var(--radius-sm);color:var(--text)}
.private-workspace .private-detail-balance{display:grid;gap:12px;padding-top:24px;margin:0}
.private-workspace .private-loan-total{display:block;font-size:clamp(28px,6.5vw,44px);line-height:1.15;font-weight:600;letter-spacing:-.03em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.private-workspace .private-loan-detail-body{display:grid;gap:16px;padding:20px 0 0}
.private-workspace .private-loan-detail-body>*{min-width:0;margin-block:0}
.private-workspace :is(.private-emi-card,.private-strategy-fold,.private-balance-breakdown,.private-history,.private-plan-disclosure,.private-calculation-details,.private-notes-panel,.payoff-planner,.rate-whatif,.private-consolidated,.loan-sheet-card){border:1px solid var(--border);border-radius:var(--loan-card-radius);background:var(--surface);box-shadow:none}
.private-workspace .private-emi-card{padding:20px;background:color-mix(in srgb,var(--decorative) 9%,var(--surface))}
.private-workspace .private-emi-head{gap:6px}
.private-workspace .private-emi-head>strong{font-size:var(--text-3xl);font-weight:600;font-variant-numeric:tabular-nums}
.private-workspace .private-emi-head>strong small{font-size:var(--text-sm);font-weight:400;color:var(--muted);margin-left:6px}
.private-workspace :is(.private-strategy-fold,.private-balance-breakdown,.private-history,.private-plan-disclosure,.private-calculation-details)>summary{min-height:64px;padding:18px 20px;font-size:var(--text-base);line-height:1.5}
.private-workspace :is(.private-balance-breakdown,.private-history,.private-plan-disclosure,.private-calculation-details)[open]{padding-bottom:20px}
.private-workspace :is(.private-balance-breakdown,.private-history,.private-plan-disclosure,.private-calculation-details)>:not(summary){margin-inline:20px}
.private-workspace .private-strategy-fold>section{border:0;border-radius:0 0 var(--radius-lg) var(--radius-lg);background:none;padding:0 20px 20px}
.private-workspace .private-loan-row{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);overflow:hidden;box-shadow:none}
.private-workspace .private-loan-list{display:grid;gap:12px}
.private-workspace .private-loan-open{min-height:88px;padding:18px;gap:14px}
.private-workspace :is(.button,.icon-button,input:not([type=checkbox]):not([type=range]),select,.chip){min-height:48px;border-radius:var(--radius-sm)}
.private-workspace .icon-button{min-width:48px}
.private-workspace .private-asof-note{font-size:var(--text-xs)}
.private-workspace .dialog-footer{gap:12px;padding:16px 20px}
.private-workspace .loan-options{display:grid;gap:18px}
.private-workspace .loan-options>p{margin:0;line-height:1.65}
.private-workspace .loan-options fieldset{margin:0;padding:18px;border:1px solid var(--divider);border-radius:var(--radius-md);min-width:0}
.private-workspace .loan-options legend{padding-inline:6px;color:var(--text);font-size:var(--text-sm);font-weight:600}
.private-workspace .loan-option-fields{gap:16px;align-items:start}
.private-workspace .loan-option-fields label{display:grid;gap:8px;line-height:1.5;font-size:var(--text-sm)}
.private-workspace .loan-option-fields input:read-only{background:var(--subtle);border-color:var(--divider);color:var(--muted)}
.private-workspace .loan-payment-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;margin:0 0 18px;background:var(--subtle);border-radius:var(--radius-md)}
.private-workspace .loan-payment-modes .chip{min-width:0;justify-content:center;padding:8px 4px;border:0;white-space:normal;line-height:1.3;font-size:var(--text-sm);background:none}
.private-workspace .loan-payment-modes [aria-pressed=true]{background:var(--decorative);color:var(--on-decorative);box-shadow:0 1px 3px color-mix(in srgb,var(--text) 8%,transparent)}
.private-workspace .loan-option-equation{display:grid;gap:12px;padding:18px;border-radius:var(--radius-md);background:var(--subtle)}
.private-workspace .loan-option-equation>span{display:grid;gap:6px;color:var(--muted);font-size:var(--text-sm)}
.private-workspace .loan-option-equation strong{color:var(--text);font-size:var(--text-lg);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.private-workspace .loan-option-outcomes{gap:12px;margin-block:20px}
.private-workspace .loan-option-outcomes>div{padding:16px;border:0;background:var(--subtle);border-radius:var(--radius-md);min-width:0}
.private-workspace .loan-option-outcomes dd{font-size:var(--text-xl);line-height:1.4;font-variant-numeric:tabular-nums}
.private-workspace .loan-option-chart-controls{display:grid;grid-template-columns:1fr 1fr;gap:4px;background:var(--subtle);padding:4px;border-radius:var(--radius-md)}
.private-workspace .loan-option-chart-controls .chip{border:0;white-space:normal;justify-content:center;line-height:1.4}
.private-workspace :is(.loan-option-amortization,.loan-option-comparison,.whatif-exact){margin-top:16px;border-top:1px solid var(--divider);padding-top:8px}
.private-workspace :is(.loan-option-amortization,.loan-option-comparison,.whatif-exact)>summary{min-height:48px;align-items:center;line-height:1.5}
.private-workspace .payoff-table-scroll{border-radius:var(--radius-sm);border:1px solid var(--divider)}
.private-workspace .payoff-table-scroll th{background:var(--subtle)}
.private-workspace .payoff-table-scroll :is(th,td){padding:12px;font-variant-numeric:tabular-nums}
.private-workspace .rate-whatif-bottom{padding:18px;border-radius:var(--radius-md);background:var(--subtle);border:0;gap:16px}
.private-workspace .rate-whatif-rates{gap:8px}
.private-workspace .rate-whatif-rates .chip{min-width:48px;justify-content:center}
.private-workspace .whatif-chart-heading strong{font-size:var(--text-3xl);line-height:1.3}
.private-workspace .whatif-chart-readout{gap:12px}
.private-workspace .whatif-horizons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.private-workspace .whatif-horizons .chip{min-width:0;padding:8px 4px;white-space:normal;line-height:1.3;font-size:var(--text-xs);justify-content:center}
.private-workspace :is(.whatif-balance-chart,.loan-sheet-chart svg,.loan-sheet-area){animation:none}
@media(max-width:639px){
 .private-workspace{--loan-card-space:16px}
 .private-workspace .private-loan-hero{padding:20px}
 .private-workspace .private-strategy-fold>section{padding-inline:16px}
 .private-workspace .loan-options fieldset{padding:14px}
 .private-workspace .loan-option-outcomes{grid-template-columns:1fr 1fr}
 .private-workspace .loan-option-outcomes>div:last-child{grid-column:1/-1}
 .private-workspace .loan-option-fields{grid-template-columns:1fr}
 .private-workspace .private-loan-open{padding:16px}
}

.private-workspace :is(.loan-start-details,.loan-option-costs)>summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-height:48px;font-size:var(--text-sm);line-height:1.5}
.private-workspace .loan-start-details>summary small{display:block;flex-basis:100%;color:var(--muted);font-size:var(--text-sm);font-weight:400}
.private-workspace .loan-option-costs{margin-top:12px;border-top:1px solid var(--divider)}
.private-workspace .loan-option-costs>label{display:grid;gap:8px;margin-block:12px;font-size:var(--text-sm)}
.private-workspace .loan-option-costs>p{line-height:1.65}

/* Keep savings readable as an amount, rather than splitting it beside a long label. */
.private-workspace .loan-option-outcomes>div{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;align-content:start}
.private-workspace .loan-option-outcomes dt{line-height:1.5}
.private-workspace .loan-option-outcomes dd{margin:0}
@media(max-width:639px){.private-workspace .loan-option-outcomes{grid-template-columns:1fr}}

/* Consistent lending chart semantics; scenario baselines stay neutral and dashed. */
dialog.private-workspace,dialog:has([data-private-loans].private-form){--loan-chart-principal:#3c70b7;--loan-chart-interest:var(--decorative)}
:root[data-theme=dark] dialog.private-workspace,:root[data-theme=dark] dialog:has([data-private-loans].private-form),:root[data-theme=grey-glass] dialog.private-workspace,:root[data-theme=grey-glass] dialog:has([data-private-loans].private-form){--loan-chart-principal:#8eacff}
:root[data-theme] dialog.private-workspace,:root[data-theme] dialog:has([data-private-loans].private-form){--whatif-blue:var(--loan-chart-principal);--whatif-yellow:var(--loan-chart-interest)}
.private-workspace .loan-sheet{--sheet-line:var(--loan-chart-interest);--sheet-fill:color-mix(in srgb,var(--loan-chart-interest) 20%,transparent)}
.private-workspace :is(.payoff-principal,.loan-option-principal),.private-workspace .private-split .bar-fill{fill:var(--loan-chart-principal)}
.private-workspace :is(.payoff-interest,.loan-option-interest),.private-workspace .private-split .bar-fill.tone-1{fill:var(--loan-chart-interest)}
.private-workspace :is(.payoff-principal-key,.loan-key.principal,.loan-key.planned){background:var(--loan-chart-principal)}
.private-workspace :is(.payoff-interest-key,.loan-key.interest){background:var(--loan-chart-interest)}
.private-workspace .loan-option-line.planned{stroke:var(--loan-chart-principal)}
/* Chart pass: a readable cumulative-interest chart. Solid hairline grid aligned with round scale labels; taller plot on phones. */
.loan-sheet-chart{padding-bottom:22px}
.loan-sheet-chart svg{height:150px}
.loan-sheet-base{stroke-dasharray:none;stroke-opacity:.7}
.loan-sheet-line{stroke-width:2}
.loan-sheet-fill-top{stop-opacity:.85}
.private-workspace .loan-sheet-plot{
 min-width:0;
 border-radius:8px 8px 0 0;
 background:var(--loan-plot-texture) 0 0/12px 12px,var(--loan-plot-surface);
}
.private-workspace .loan-sheet-chart svg{height:clamp(120px,15vw,168px)}
.private-workspace .loan-sheet-chart-heading{flex-wrap:wrap;gap:4px 12px}
.private-workspace .loan-sheet-line{stroke-width:2.5}
:root[data-theme=light] .private-workspace .loan-sheet{--sheet-line:#8a550b}
:root[data-theme=dark] .private-workspace .loan-sheet{--sheet-line:#f4bd72}
:root[data-theme=grey-glass] .private-workspace .loan-sheet{--sheet-line:#ffd18e}
@media(forced-colors:active){.private-workspace .loan-sheet-line{stroke:CanvasText}.private-workspace .loan-sheet-area{fill:none}}
.loan-sheet-y-axis{top:-6px;bottom:16px;line-height:12px;font-size:12px;font-variant-numeric:tabular-nums}
.loan-sheet-dot{width:10px;height:10px;margin:-5px 0 0 -5px;border-width:2px;box-shadow:none}
@media(max-width:639px){.loan-sheet-chart{margin-top:8px;padding-bottom:22px}.loan-sheet-chart svg{height:112px}.loan-sheet-y-axis{top:-6px;bottom:16px;font-size:12px;line-height:12px}.loan-sheet-axis{font-size:12px}}
