.global-search{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:13px;padding:0 10px;background:#fff;margin:0 0 12px;min-height:48px}.global-search svg{width:20px;height:20px;flex:none}.global-search input{width:100%;min-width:0;border:0;background:transparent;padding:12px 0;font-size:.85rem}.global-results{display:grid;gap:5px;max-height:55vh;overflow:auto;margin-bottom:16px}.global-results[hidden],.drawer-group[hidden]{display:none!important}.global-result{min-height:48px;display:flex;align-items:center;gap:10px;text-align:left;font-size:.88rem}.global-result svg{width:20px;height:20px;flex:none}.help-functions{margin-top:18px}.help-functions details{border-bottom:1px solid var(--line);padding:12px 0}.help-functions summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600}.help-functions p{max-width:65ch}.help-functions button{min-height:44px}#nav>.global-search{margin-bottom:0}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #578468;outline-offset:3px}button:disabled{cursor:default;opacity:.65}aside{overflow-y:auto}.asidefoot{display:none}.global-search:focus-within{outline:2px solid #578468}button.mini{min-height:44px;min-width:44px}.stats-grid .card{min-width:0}
html[data-theme=dark]{--bg:#101b18;--line:#35473f;--green:#9bd4b8;--muted:#b0c2b8;color-scheme:dark}
html[data-theme=dark] body{background:#101b18;color:#edf5ef}
html[data-theme=dark] :is(.card,aside,dialog,.mobile-brand,#mobileNavigation){background:#192821!important;color:#edf5ef!important;border-color:#35473f!important}
html[data-theme=dark] :is(.muted,small,.legend,footer,.chart-hint,.stats-context,.stats-axis,.stats-month-label,.drawer-group h3,.stats-category small){color:#b0c2b8!important;fill:#b0c2b8!important}
html[data-theme=dark] :is(input,select,textarea,.global-search){background:#12201a!important;color:#edf5ef!important;border-color:#456354!important}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#aebfb4;opacity:1}
html[data-theme=dark] :is(button,.month button,.tool-item,.drawer-heading button,.mobile-brand #openNavigation){background:#263f33!important;color:#dcf2e4!important;border-color:#456354!important}
html[data-theme=dark] :is(button.primary,nav button.active,.drawer-link.active){background:#b1ddbf!important;color:#10261a!important}
html[data-theme=dark] :is(button:hover,.drawer-link:hover,.stats-category:hover){background:#355843!important;color:#f4fff6!important}
html[data-theme=dark] .hero{background:#204435!important;color:#f0faf3!important}html[data-theme=dark] .hero small{color:#c9e3d2!important}
html[data-theme=dark] :is(.positive,.amount.positive){color:#a3e0ba!important}html[data-theme=dark] :is(.negative,.amount.negative,.destructive){color:#ffb6a8!important}
html[data-theme=dark] a{color:#afdbc5}html[data-theme=dark] :is(.notice,.warning){background:#473d25!important;color:#ffe6ad!important}
html[data-theme=dark] :is(.stats-comparison,.tip,.member,.pill,.linkbox,.tool-icon,.icon,.ring){background:#253a2d!important;color:#dbebdc!important;border-color:#456354!important}
html[data-theme=dark] :is(.page-guide,.install-state,.forecast-details){border-color:#456354!important;background:transparent!important;color:#edf5ef!important}
html[data-theme=dark] .track{background:#34483d}html[data-theme=dark] td,html[data-theme=dark] th{border-color:#35473f}html[data-theme=dark] :is(.stats-donut-center small,.stats-donut-total,.metric-line strong,.category-label){color:#edf5ef!important}
html[data-theme=dark] .toast{background:#b1ddbf;color:#10261a}html[data-theme=dark] .bar{background:#9fd3b4}html[data-theme=dark] .bar.out{background:#e6a98b}
html[data-theme=dark] :focus-visible{outline-color:#a3e0ba}html[data-theme=dark] .global-search:focus-within{outline-color:#a3e0ba}
html[data-theme=dark] .tool-item small{color:#b0c2b8!important}html[data-theme=dark] .stats-series.incoming{background:#a3e0ba}html[data-theme=dark] .stats-series.outgoing{background:#e6a98b}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
@media(prefers-contrast:more){:is(.card,button,input,select,dialog){border-width:2px!important}small,.muted{font-weight:500}}
@media(prefers-reduced-transparency:reduce){dialog::backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}}

html[data-theme=dark] .stats-trend [stroke="#39715b"]{stroke:#a3e0ba}html[data-theme=dark] .stats-trend [stroke="#af724b"]{stroke:#e6a98b}html[data-theme=dark] .stats-donut [stroke="#edf2ed"]{stroke:#35473f}html[data-theme=dark] .stats-trend [fill="#fff"]{fill:#192821}html[data-theme=dark] .entry .detail,html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3{color:#edf5ef}

.app-version{display:block;font-size:.72rem;line-height:1.5;color:var(--muted,#657a6b);margin:4px 0 14px}#drawerNav .app-version{padding:0 12px;margin:2px 0 0}html[data-theme=dark] .app-version{color:#b0c2b8}
header>div:has(.page-info-button){display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px}header>div:has(.page-info-button)>small{flex-basis:100%}header>div:has(.page-info-button)>h1{margin-bottom:0}.page-info-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;min-height:44px;padding:10px;border:0;border-radius:50%;background:transparent;color:#416653}.page-info-button svg{width:22px;height:22px}.page-info-button:hover{background:#e4efe5}.page-info-button:focus-visible{outline:2px solid #517d65;outline-offset:2px}.page-info-dialog{width:min(640px,calc(100vw - 32px));max-height:85dvh;overflow-y:auto;padding:24px;border:1px solid #dfe7e1;border-radius:22px;background:#fbfdfb;color:#20352d}.page-info-dialog::backdrop{background:#112c2566}.page-info-dialog p,.page-info-dialog small{font-size:.9rem;line-height:1.65}.page-info-section{margin-top:22px}.page-info-section h3{font-size:1rem}.page-info-close{min-width:44px;min-height:44px;flex-shrink:0}html[data-theme=dark] .page-info-button{color:#b0c2b8}html[data-theme=dark] .page-info-button:hover{background:#35473f}html[data-theme=dark] .page-info-dialog{background:#192821;color:#edf5ef;border-color:#456354}

/* Phone layouts: wrap content instead of widening the page. */
@media(max-width:767px){
#app,#app .card,#app .member,#app .table-scroll,#loanMarket{max-width:100%;min-width:0}
#app :is(h2,h3,p,small,a,button,.category-label){overflow-wrap:anywhere;white-space:normal}
#app .fields{grid-template-columns:minmax(0,1fr)}
#app .row,#app .metric-line{flex-wrap:wrap}#app .metric-line strong{max-width:100%}
.table-scroll:has(.responsive-table){overflow:visible;border:0;border-radius:0}
.table-scroll .responsive-table{display:block;width:100%;min-width:0;max-width:100%;table-layout:fixed}
.responsive-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.responsive-table tbody{display:grid;gap:12px;width:100%;min-width:0}
.table-scroll .responsive-table tbody tr{display:block;min-width:0;border:1px solid var(--line);border-radius:14px;padding:10px 12px;background:var(--surface,#fff)}
.table-scroll .responsive-table tbody td{display:block;width:100%;padding:9px 0;text-align:left!important;white-space:normal;overflow-wrap:anywhere;border-bottom:1px solid var(--line)}
.responsive-table td[data-label]::before{content:attr(data-label);display:block;font-size:.72rem;font-weight:600;color:var(--muted);margin-bottom:4px}
.responsive-table td:last-child{border-bottom:0}.responsive-table td a{display:inline-block;max-width:100%}
.forecast-columns{min-width:0;width:100%;display:flex;flex-wrap:wrap;justify-content:center;gap:12px}.forecast-column{flex:0 1 48px;min-width:0}
#app .chart .week{min-width:0}.chart-column .bars{gap:3px}.chart .bar{width:min(18px,3vw)}
dialog{min-width:0;max-width:calc(100vw - 24px)}dialog .fields{grid-template-columns:minmax(0,1fr)}
html[data-theme=dark] .responsive-table tbody tr{background:#192821}
}

/* Keep the search icon outside the editable field and use one focus ring. */
.global-search{min-width:0;gap:10px}
.global-search input{flex:1 1 0;width:0;min-width:0;max-width:100%;font-size:16px;border-radius:0;-webkit-appearance:none;appearance:none;box-shadow:none}
.global-search input:focus,.global-search input:focus-visible{outline:none;outline-offset:0;box-shadow:none}
.global-search:focus-within{outline:2px solid #578468;outline-offset:2px}

.account-version{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:8px 12px 12px}
#drawerNav .account-version .app-version,#nav .account-version .app-version{margin:0;padding:0}
.account-plan{display:inline-flex;align-items:center;gap:4px;font-size:11px;line-height:1.4;color:var(--muted);white-space:nowrap}
.account-plan svg{width:15px;height:15px;flex:none}
.account-plan-premium{color:#765c23}
html[data-theme=dark] .account-plan-premium{color:#e5c779}
