.finance{width:100%;max-width:2200px;min-width:0;box-sizing:border-box;margin:auto;overflow-wrap:anywhere}.finance .panel{padding:22px;margin-bottom:16px}.finance-overview strong{font-size:clamp(22px,4vw,36px)}.finance-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.finance-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:16px}.finance-form{max-width:640px;display:grid;gap:12px}.finance-form label{display:grid;gap:6px}.finance-form input,.finance-form select{width:100%;max-width:100%;min-width:0;padding:10px;font-size:16px}.finance-account,.finance-history{padding:12px 0;border-bottom:1px solid var(--border)}.finance-history small{display:block;color:var(--muted)}.finance-stage{font-size:13px;color:var(--muted)}.finance-form-error{color:var(--danger,#b74d4d)}.finance [hidden]{display:none!important}@media(max-width:520px){.finance .page-heading{display:block}.finance .panel{padding:16px}.finance-actions button{flex:1 1 140px}body:has(#content[data-active-view="FINANCE"]) .sidebar nav{grid-template-columns:repeat(6,minmax(0,1fr))!important}body:has(#content[data-active-view="FINANCE"]) .sidebar nav button{min-width:0;font-size:9px!important}.finance{max-width:100%}}

.finance-plans{display:grid;gap:18px;margin-top:18px}.finance-plan-editor dl{display:grid;grid-template-columns:minmax(100px,1fr) 2fr;gap:8px}.finance-plan-editor dd{overflow-wrap:anywhere;margin:0}.finance-notification-dialog{width:min(540px,calc(100vw - 24px));max-height:85vh;overflow:auto;background:var(--panel,#151923);color:var(--text,#eee);border:1px solid #555;border-radius:16px;padding:24px}.finance-notification-dialog label{display:block;margin:12px 0}.finance-notification-dialog textarea{width:100%;box-sizing:border-box}.finance-user-menu{display:none}.finance-user-menu-items{position:absolute;right:0;top:100%;padding:12px;background:var(--panel,#151923);border:1px solid var(--border,#555);border-radius:12px;z-index:45}.finance-user-menu summary{cursor:pointer;padding:8px}.finance-user-menu-items button{white-space:nowrap}@media(max-width:760px){.finance-user-menu{display:block;position:relative;font-size:12px}.finance-plan-editor dl{grid-template-columns:1fr}.finance-plan-editor dd{margin-bottom:10px}}
@media(max-width:760px){.finance-user-menu-items{left:0;right:auto;min-width:170px}.topbar-right:has(.finance-user-menu){gap:5px}.topbar-right:has(.finance-user-menu)>.planning-open{display:none}.finance-user-menu-items button{font-size:13px!important;width:100%;min-width:145px}}
/* Finance: contextual navigation, exact data and responsive reading order. */
.finance-dashboard{max-width:2200px;margin:auto;--finance-soft:rgba(115,150,170,.08)}
.finance-heading,.finance-section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:10px 0 24px}.finance-heading h1{font-size:32px;margin:4px 0 8px;letter-spacing:-.7px}.finance-heading p{color:var(--muted);margin:0}.finance-nav{display:flex;gap:5px;border-bottom:1px solid var(--border);margin:0 0 26px;overflow:auto}.finance-nav button{border:0;border-radius:8px 8px 0 0;white-space:nowrap;background:transparent;padding:13px 15px;color:var(--muted)}.finance-nav button[aria-current=page]{color:var(--accent);background:var(--finance-soft);box-shadow:inset 0 -2px var(--accent)}.finance-mobile-nav{display:none}.finance-content>.panel,.finance-content>.finance-grid,.finance-content>.finance-actions{margin-bottom:20px}.finance-dashboard .panel{padding:24px;border-radius:16px}.finance-dashboard .panel h2{font-size:16px;font-weight:600;margin:0 0 17px;letter-spacing:0}.finance-dashboard .panel h3{text-transform:none;font-size:15px;letter-spacing:0;margin:16px 0 8px}.finance-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.finance-stat strong,.finance-value{display:block;font-size:27px;font-weight:650;letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.finance-stat p,.finance-dashboard small,.finance-dashboard .panel>p{font-size:13px;color:var(--muted);line-height:1.6}.finance-stat h2{color:var(--muted)}.finance-content .finance-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.finance-list-row{width:100%;display:flex;justify-content:space-between;gap:16px;text-align:left;padding:18px 0;border:0;border-radius:0;border-bottom:1px solid var(--border);background:transparent}.finance-list-row span:last-child{text-align:right;white-space:nowrap}.finance-list-row small{display:block;margin-top:5px;white-space:normal}.finance-facts{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px 20px;font-size:13px}.finance-facts dt{color:var(--muted)}.finance-facts dd{margin:0;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.finance-periods{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.finance-periods button{padding:7px 13px;background:transparent;border-color:transparent}.finance-periods button[aria-pressed=true]{background:var(--finance-soft);color:var(--accent);border-color:var(--border)}.finance-chart svg{width:100%;max-height:300px;display:block;color:var(--muted);overflow:visible}.finance-chart svg text{fill:var(--muted);font-size:12px}.finance-chart-legend{display:flex;gap:25px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin:10px 0 20px}.finance-chart-legend span:first-child{color:#37c4ad}.finance-chart-legend span+span{color:#b59adc}.finance-chart>p{font-size:12px;line-height:1.6;color:var(--muted)}.finance-allocation{display:grid;grid-template-columns:190px minmax(0,1fr);align-items:center;gap:20px}.finance-allocation svg{width:190px}.finance-allocation text{fill:var(--text);font-size:12px}.finance-allocation ul{list-style:none;margin:0;padding:0}.finance-allocation li{display:grid;grid-template-columns:9px 1fr auto;gap:8px;align-items:center;padding:10px 0;font-size:13px}.finance-allocation li small{grid-column:2/4}.finance-swatch{width:8px;height:8px;border-radius:50%;background:var(--swatch)}.finance-donut-empty{height:170px;width:170px;border:18px solid var(--border);border-radius:50%;display:grid;place-content:center;font-size:12px;color:var(--muted)}.finance-warning{padding:12px;border-left:3px solid #e2b769;background:rgba(226,183,105,.06);color:var(--text)!important}.finance-table-wrap{overflow:auto;max-width:100%}.finance-dashboard table{width:100%;border-collapse:collapse;font-size:13px}.finance-dashboard th,.finance-dashboard td{text-align:left;padding:13px 10px;border-bottom:1px solid var(--border);white-space:nowrap}.finance-dashboard th{color:var(--muted);font-weight:500}.finance-strategy+.finance-strategy{border-top:1px solid var(--border);margin-top:24px;padding-top:16px}.finance-goal progress{width:100%;height:8px;accent-color:var(--accent)}.finance-goal small{display:block;margin-top:8px}.finance-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:end}.finance-dashboard label{display:grid;gap:7px;font-size:13px;color:var(--muted)}.finance-dashboard input,.finance-dashboard select{width:100%;min-width:0;box-sizing:border-box;font-size:16px;min-height:42px}.finance-dashboard summary{cursor:pointer;padding:12px 0;min-height:24px}.finance-dashboard details button{margin:8px 8px 8px 0}.finance-dashboard .finance-history{padding:20px 0}.finance-dashboard .finance-history>div{display:flex;justify-content:space-between;gap:12px}.finance-dashboard .finance-history p{overflow-wrap:anywhere}.finance-dashboard .finance-plans{scroll-margin-top:20px}.finance-dashboard .finance-form{max-width:720px;margin-bottom:24px}.finance-dashboard .finance-actions{margin:16px 0}.finance-dashboard button:focus-visible,.finance-dashboard select:focus-visible,.finance-dashboard input:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.finance-dashboard .finance-stage{font-size:12px;line-height:1.6;margin-top:28px}
@media(max-width:1050px){.finance-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.finance-allocation{grid-template-columns:1fr}.finance-allocation svg,.finance-donut-empty{margin:auto}}
@media(max-width:650px){.finance-heading{align-items:flex-start;gap:8px}.finance-heading h1{font-size:26px}.finance-heading button{font-size:12px;white-space:nowrap}.finance-mobile-nav{display:grid;margin:0 0 22px}.finance-nav{display:none}.finance-content .finance-grid,.finance-filters{grid-template-columns:1fr}.finance-stat-grid{gap:10px}.finance-dashboard .panel{padding:17px;border-radius:13px;min-width:0}.finance-stat strong{font-size:21px}.finance-dashboard .finance-stat h2{font-size:12px}.finance-stat p{font-size:11px}.finance-section-heading{flex-direction:column;align-items:stretch}.finance-facts{grid-template-columns:1fr;gap:5px}.finance-facts dd{text-align:left;margin-bottom:9px}.finance-dashboard button{min-height:44px}.finance-periods{justify-content:flex-start;gap:0}.finance-periods button{flex:1;padding:6px;min-width:0}.finance-allocation{grid-template-columns:1fr}.finance-list-row{flex-wrap:wrap}.finance-list-row span:last-child{text-align:left}.finance-dashboard .finance-history>div{flex-direction:column}.finance-chart-legend{gap:10px}.finance-dashboard .finance-actions{gap:8px}.finance-dashboard .finance-actions button{flex:1 1 130px}.finance-chart svg{min-height:140px}.finance-dashboard .finance-filters input,.finance-dashboard .finance-filters select{min-height:44px}}
.finance-dashboard label.finance-mobile-nav{display:none}.finance-dashboard select,.finance-dashboard input{background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:9px;padding:10px}.finance-dashboard input[type=checkbox]{width:18px;min-height:18px;accent-color:var(--accent)}.finance-dashboard .finance-plans:has(.finance-plan-editor:empty){display:none}@media(max-width:650px){.finance-dashboard label.finance-mobile-nav{display:grid}}
@media(max-width:650px){.finance-chart svg text{font-size:25px}}
/* Keep the import preview table inside its scroll region on narrow screens. */
.finance-plans,.finance-plan-editor,.finance-plan-editor>.panel,.finance-plan-editor details{min-width:0;max-width:100%;box-sizing:border-box}
.finance-form fieldset{min-width:0;border:1px solid var(--border);border-radius:12px;padding:16px}
.finance-form legend{padding:0 6px}
.finance-form label:has(input[type=checkbox]){display:flex;align-items:flex-start;gap:10px;line-height:1.5}
.finance-form input[type=checkbox]{width:18px;min-width:18px;min-height:18px;height:18px;margin:2px 0;flex-shrink:0}

/* Only the Finance view may use the full desktop canvas. Other modules retain their layout. */
main:has(#content[data-active-view="FINANCE"]){max-width:none}
.finance-shell,.finance-content,.finance-grid>*{min-width:0}
.finance-content .finance-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr))}
.finance-filters{grid-template-columns:repeat(auto-fit,minmax(155px,210px));gap:10px 14px;justify-content:start}
.finance-filters input,.finance-filters select{font-size:14px;padding:8px;min-height:38px}
.finance-filters .finance-actions{margin:0;align-self:end}
.finance-dashboard .finance-form{width:min(100%,720px);box-sizing:border-box}
.finance-dashboard .finance-plan-editor>.panel:not(.finance-form){width:100%}
.finance-transactions td:nth-child(2){white-space:normal;min-width:180px}
.finance-transactions td:last-child{white-space:normal}
.finance-chart svg{height:clamp(200px,18vw,340px);max-height:340px}
.finance-bond-import .finance-table-wrap{max-height:560px}
@media(min-width:1800px){.finance-stat-grid{gap:24px}.finance-content .finance-grid{gap:24px}.finance-dashboard .panel{padding:28px}}
@media(min-width:2560px){.finance-dashboard{max-width:2200px}}
@media(max-width:900px){.finance-content .finance-grid{grid-template-columns:1fr}}
@media(max-width:650px){.finance-content .finance-grid{grid-template-columns:1fr}.finance-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.finance-filters .finance-actions{grid-column:1/-1}.finance-chart svg{height:180px}}

.finance-content .finance-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.finance-overview-grid>.panel{margin-bottom:0}
@media(max-width:900px){.finance-content .finance-overview-grid{grid-template-columns:1fr}}
