/* Surface-aware colours: light cards must not inherit the dark shell palette. */
:is(.whitecard,.analytics-card,.insight,.budget-alert,.report-tile,.txlist,.account-card,.settings-list,.setting,.history-tools,.prefs-card,.backup-card,.privacy-section,.sync-section,.sync-summary,.diagnostic-box,.category-box,.onboarding-step,.import-mapping,.import-drop,.import-summary,.health-detail,.plan-card,.debt-card){--muted:#506963;--text:#173b37;--line:#d6e2de;color:var(--text)}
:is(.whitecard,.analytics-card,.insight,.budget-alert,.report-tile,.txlist,.account-card,.history-tools,.prefs-card,.backup-card,.privacy-section,.sync-section,.sync-summary,.category-box,.onboarding-step,.import-mapping,.health-detail,.plan-card,.debt-card) :is(small,.smallnote,.muted,.formlabel,.meta,.time,.plan-meta,.debt-meta,.sync-auth-state){color:var(--muted)!important;opacity:1}
:is(.whitecard,.txlist,.report-tile,.analytics-card) .green{color:#17763a}
:is(.whitecard,.txlist,.report-tile,.analytics-card) .red{color:#c02e29}
:is(.whitecard,.txlist,.report-tile,.analytics-card) .orange{color:#925500}
:is(.whitecard,.txlist,.report-tile,.analytics-card) .blue{color:#245cc1}
:is(.whitecard,.txlist) .progress{background:#deebe6}
.whitecard .chip{color:#24554d;background:#edf6f2;border:1px solid #bed3cb;min-width:44px;min-height:44px}
.whitecard .project-actions button{background:#edf6f2!important;color:#24554d!important;border:1px solid #bed3cb!important;min-height:44px}
.whitecard .project-actions .delete-project-btn{background:#fff1ef!important;color:#aa2e25!important;border-color:#e6bbb5!important}
.tx-actions button{color:#24554d;background:#edf6f2;min-height:36px}
.tx-actions .danger-mini{color:#aa2e25;background:#fff1ef}
.primary{background:linear-gradient(135deg,#227d43,#176638);color:#fff}
.status-banner button{background:#185d31;color:#fff;min-height:44px;flex-shrink:0}
.status-banner{position:relative;top:auto;left:auto;transform:none;margin:8px auto;width:min(420px,calc(100% - 24px))}
.topbar{position:static}
.history-search{margin:0;grid-template-columns:minmax(0,1fr) auto}
.history-search input{width:100%;height:46px;border-radius:10px;padding:10px 12px;font-size:16px;outline-offset:2px}
.history-search input::placeholder{color:#586e68;opacity:1}
.search-submit{display:grid;place-items:center;width:46px;height:46px;padding:10px;border:0;border-radius:10px;background:#176638;color:#fff}
.search-submit svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2}
.history-filter-panel{margin-top:12px;border-top:1px solid #d6e2de;padding-top:4px}
.history-filter-panel summary{cursor:pointer;min-height:44px;align-content:center;font-size:13px;font-weight:750;color:#24554d}
.history-filter-panel summary::marker{color:#176638}
.history-tools .history-advanced{grid-template-columns:repeat(2,minmax(0,1fr))}
.history-advanced input,.history-advanced select{width:100%;min-width:0;min-height:46px;border-radius:10px;padding:10px;font-size:16px;color-scheme:light}
.history-actions button{min-height:44px;color:#24554d;border-color:#bed3cb;background:#edf6f2;font-size:13px}
.history-reset{width:100%;margin-top:10px;min-height:44px;border:1px solid #bed3cb;border-radius:10px;background:#fff;color:#24554d;font-size:13px}
.history-results{font-size:12px;color:#c5d4d0;margin:8px 0}
.subpage{padding:8px 16px 96px;min-width:0;color:#f8fbfa}
.subpage>.modal-head{display:flex;flex-direction:row-reverse;justify-content:flex-end;gap:12px;padding:8px 0 18px;border:0;background:transparent}
.subpage>.modal-head h3{font-size:21px;margin:0;color:#fff;line-height:1.3}
.subpage>.modal-head .close{flex:none;background:#125158;color:#fff;border:1px solid #628c8c;border-radius:12px;font-size:28px;width:44px;height:44px}
.subpage>.modal-body{padding:0;max-height:none;overflow:visible}
.subpage .darkcard{padding:16px;color:#fff;--muted:#c5d4d0}
.subpage .field :is(input,select,textarea){min-width:0}
.subpage :is(.prefs-card,.category-box,.onboarding-step,.backup-card,.sync-section) :is(input,select,textarea){background:#fff;color:#173b37;border:1px solid #a9c2b9;border-radius:9px;padding:10px}
.sync-section .ghost{color:#24554d;border-color:#a9c2b9;background:#edf6f2}
.setting{position:relative;cursor:pointer;min-height:48px;padding-right:44px}
.setting>button{position:absolute;inset:0;width:100%;height:100%;text-align:right;padding-right:14px;color:#24554d;border-radius:14px}
.subpage-head .backbtn{background:#125158;color:#fff;border-color:#628c8c}
.profile-head small{color:#c5d4d0}
.formlabel{font-size:12px}
.hero .red,.darkcard .red{color:#ffaaa5}
.calendar-weekday,.subpage .sync-detail{color:#c5d4d0}
.prefs-card p,.backup-card p,.backup-note,.import-file-note{color:#506963}
.import-preview{color:#173b37;--muted:#506963}
.txicon{color:#176638}
.score-ring{flex:none}
.smallnote{font-size:12px;line-height:1.5}
.history-col small{font-size:11px}
#appScreen>.safe{padding-bottom:0}
#importDialog .ghost{background:#edf6f2;color:#24554d;border-color:#a9c2b9}
@media(max-width:360px){.history-tools .history-advanced{grid-template-columns:1fr}.subpage>.modal-head h3{font-size:19px}.budget-row,.fixed-edit{grid-template-columns:minmax(0,1fr) 90px 36px}.account-card{flex-wrap:wrap}.account-actions{margin-left:auto}}
