/* Controle Financeiro — shared visual language; no financial state. */
:root{--ui-font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;--ui-bg:#f4f7fa;--ui-ink:#172b36;--ui-muted:#667987;--ui-line:#e3eaf0;--ui-accent:#125766;--ui-soft:#eaf4f5;--ui-radius:20px;--ui-sidebar:260px;--ui-shadow:0 3px 16px rgba(26,48,63,.035)}
body[data-ui-page]{--cf-background:var(--ui-bg);--cf-surface:#fff;--cf-surface-low:#f3f6f9;--cf-outline-soft:var(--ui-line);--cf-primary:#103f4b;--cf-primary-container:var(--ui-accent);--cf-primary-soft:var(--ui-soft);--cf-text:var(--ui-ink);--cf-muted:var(--ui-muted);--cf-shadow:var(--ui-shadow);background:var(--ui-bg)!important;color:var(--ui-ink)!important;font-family:var(--ui-font)!important;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;line-height:1.5;overflow-x:clip}
body[data-ui-page] *,body[data-ui-page] *::before,body[data-ui-page] *::after{box-sizing:border-box}
body[data-ui-page] :is(button,input,select,textarea){font-family:var(--ui-font)}
body[data-ui-page] :is(button,a,input,select,textarea):focus-visible{outline:3px solid #70b8bd;outline-offset:3px}
body[data-ui-page] :is(button,a){-webkit-tap-highlight-color:transparent;touch-action:manipulation}
body[data-ui-page] :is(button,a,input,select,textarea){scroll-margin-top:88px}
body[data-ui-page] button:disabled{cursor:not-allowed;opacity:.45}
body[data-ui-page] :is(img,canvas,svg){max-width:100%}
body[data-ui-page] :is(h1,h2,h3,.panel-title,.hero-title,.period-title){font-family:var(--ui-font)!important;text-wrap:balance}
body[data-ui-page] [style*='font-family:Manrope']{font-family:var(--ui-font)!important}
body[data-ui-page] :is(h1,.hero-title){font-weight:750!important;letter-spacing:-.045em;line-height:1.18}
body[data-ui-page] :is(.content-wrap,.page-shell) h1{font-size:clamp(26px,2.2vw,34px)!important}
body[data-ui-page] :is(.card h2,.panel-title){font-size:17px!important;letter-spacing:-.025em;font-weight:700!important}
body[data-ui-page] :is(.content-wrap,.page-shell){max-width:1760px!important;padding:30px clamp(20px,2.2vw,40px) 48px!important}
body[data-ui-page] .main-wrap{min-width:0;min-height:100dvh;margin-left:var(--ui-sidebar)!important;padding-top:72px;background:var(--ui-bg)!important}
body[data-ui-page] :is(.main-grid,.analytics-grid,.layout,.subgrid-2,.subgrid-3,.subgrid-4,.entry-grid)>*{min-width:0}
body[data-ui-page] .entry-grid>section{min-width:0;grid-template-columns:minmax(0,1fr)}
body[data-ui-page] .entry-grid>section>*{min-width:0;max-width:100%}
body[data-ui-page] .sidebar{width:var(--ui-sidebar)!important;background:#fff!important;border-right:1px solid var(--ui-line)!important;box-shadow:none!important}
body[data-ui-page] .sidebar>div:first-child{min-height:64px;padding:12px 20px!important;border-bottom:1px solid var(--ui-line)!important}
body[data-ui-page] .ui-brand{display:flex;align-items:center;gap:11px;color:var(--ui-ink);text-decoration:none;min-width:0}
body[data-ui-page] .ui-brand img{width:39px;height:39px;flex:none;border-radius:12px;padding:3px;border:1px solid var(--ui-line);background:#fff}
body[data-ui-page] .ui-brand strong{display:block;font-size:14px;font-weight:750;letter-spacing:-.03em}
body[data-ui-page] .ui-brand small{display:block;margin-top:3px;font-size:10px;font-weight:500;color:var(--ui-muted);letter-spacing:.02em;text-transform:none!important}
body[data-ui-page] .sidebar>div:nth-child(2),body[data-ui-page] .sidebar .nav-scroll{padding-top:7px!important}
body[data-ui-page] .nav-section{display:none!important}
body[data-ui-page] .nav-section{padding:22px 22px 8px!important;color:#82929c!important;font-size:10px!important;letter-spacing:.12em!important;font-weight:600!important}
body[data-ui-page] .nav-item{position:relative;margin:3px 12px!important;min-height:43px;padding:10px 13px!important;border:0!important;border-radius:11px!important;color:#526774!important;font-size:13px!important;font-weight:550!important;box-shadow:none!important;transform:none!important;transition:background-color .16s,color .16s}
body[data-ui-page] .nav-item .ms{color:#708590!important;font-size:20px}
body[data-ui-page] .nav-item:hover{background:#f3f7f9!important;color:var(--ui-accent)!important}
body[data-ui-page] :is(.nav-item.active,.nav-item.parent-active){background:var(--ui-soft)!important;color:#124d5a!important;font-weight:700!important}
body[data-ui-page] :is(.nav-item.active,.nav-item.parent-active) .ms{color:var(--ui-accent)!important}
body[data-ui-page] .nav-item::before{content:none!important}
body[data-ui-page] .nav-sub{min-height:35px;margin-left:34px!important;padding:7px 12px!important;font-size:12px!important;color:#70838f!important}
body[data-ui-page] .brand-icon{border-radius:7px!important;border-color:var(--ui-line)!important}
body[data-ui-page] .topbar{left:var(--ui-sidebar)!important;height:72px!important;padding:0 clamp(20px,2.2vw,40px)!important;background:rgba(244,247,250,.94)!important;border-bottom:1px solid var(--ui-line)!important;box-shadow:none!important;backdrop-filter:blur(12px)}
body[data-ui-page] .topbar h1{font-size:15px!important;font-weight:650!important;letter-spacing:-.02em;color:#46616e!important}
body[data-ui-page] .topbar-user-name{font-size:12px;max-width:190px;overflow:hidden;text-overflow:ellipsis}
body[data-ui-page] .topbar-user-label{font-size:10px;font-weight:500}
body[data-ui-page] :is(.card,.panel,.hero-main,.hero-side){background:#fff!important;border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important;box-shadow:var(--ui-shadow)!important}
body[data-ui-page] :is(.panel-head,.modal-head){border-bottom-color:var(--ui-line)!important}
body[data-ui-page] :is(.hero-main,.hero-side){padding:26px!important}
body[data-ui-page] .hero-copy{color:var(--ui-muted)!important;max-width:780px}
body[data-ui-page] :is(.panel-sub,.soft-note,.metric-sub){color:var(--ui-muted)!important}
body[data-ui-page] :is(.item-card,.preview-card,.metric-card,.category-group-card,.field-card,.breakdown-tile,.period-group,.stat-tile){border-color:var(--ui-line)!important;border-radius:14px!important;background:#fff!important;box-shadow:none!important}
body[data-ui-page] .metrics-grid{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;gap:14px!important;align-items:stretch}
body[data-ui-page] .metric{position:relative;height:auto!important;min-height:126px!important;padding:20px!important;gap:12px!important;border:1px solid var(--ui-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--ui-shadow)!important;align-content:start;overflow:hidden}
body[data-ui-page] .metric::before,body[data-ui-page] .metric::after{content:none!important}
body[data-ui-page] :is(.metric>span,.metric-label){color:var(--ui-muted)!important;font-size:10px!important;font-weight:650!important;letter-spacing:.075em;line-height:1.5}
body[data-ui-page] :is(.metric strong,.metric-value){font-family:var(--ui-font)!important;font-size:clamp(21px,1.8vw,29px)!important;font-weight:700!important;letter-spacing:-.045em;line-height:1.25;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
body[data-ui-page] .metric :is(#m-top,#m-largest,#m-top-merchant,#m-top-tag){font-size:14px!important;line-height:1.45;letter-spacing:-.015em;font-weight:600!important}
body[data-ui-page] #metric-net-card{background:linear-gradient(115deg,#eff8f7,#f9fcfc)!important;border-color:#d7e9e7!important}
body[data-ui-page] :is(.btn,.tab,.tab-chip,.anchor-chip,.account-chip,.seg){font-weight:600!important;border-radius:10px!important;transition:background-color .15s,color .15s,border-color .15s,box-shadow .15s}
body[data-ui-page] .btn{min-height:38px;padding:9px 14px;gap:7px;line-height:1.25}
body[data-ui-page] .btn-p{background:#103f4b!important;color:#fff!important;box-shadow:0 3px 8px rgba(16,63,75,.12)!important}
body[data-ui-page] .btn-p:hover{background:#1b5c69!important;box-shadow:0 5px 12px rgba(16,63,75,.16)!important}
body[data-ui-page] .btn-g{background:#fff!important;border:1px solid #dce5ec!important;color:#526774!important;box-shadow:none!important}
body[data-ui-page] .btn-g:hover{background:#f3f7f9!important;border-color:#c6d6df!important}
body[data-ui-page] :is(.seg,.tab-chip,.anchor-chip,.tab,.account-chip){border:1px solid var(--ui-line)!important;background:#fff!important;color:#607580!important;box-shadow:none!important}
body[data-ui-page] :is(.seg.active,.tab.active,.tab-chip.active,.account-chip.active){background:var(--ui-accent)!important;color:#fff!important;border-color:var(--ui-accent)!important}
body[data-ui-page] :is(input:not([type='checkbox']):not([type='radio']):not([type='color']),select,textarea,.brand-select-button,.entry-account-button){border:1px solid #dce5eb!important;border-radius:10px!important;background-color:#fff;color:#2f4754;font-weight:500;min-width:0;transition:border-color .16s,box-shadow .16s}
body[data-ui-page] :is(input:not([type='checkbox']):not([type='radio']):not([type='color']),select,textarea){min-height:40px;padding:10px 12px}
body[data-ui-page='gateway'] .auth-input-wrap .auth-input:not(.auth-otp-input){padding-left:44px!important}
body[data-ui-page='gateway'] .auth-field input.auth-input[aria-invalid='true']{border-color:#c94545!important}
body[data-ui-page] :is(input,textarea)::placeholder{color:#96a5af;opacity:1}
body[data-ui-page] :is(input,select,textarea):focus{border-color:#69a6ae!important;box-shadow:0 0 0 3px rgba(50,132,144,.11)!important}
body[data-ui-page] :is(input[type='checkbox'],input[type='radio']){accent-color:var(--ui-accent)}
body[data-ui-page] label{font-weight:600!important}
body[data-ui-page] .period-shell{grid-template-columns:minmax(330px,1.15fr) minmax(300px,1.1fr) minmax(210px,.85fr);padding:10px;gap:10px;margin-bottom:20px!important}
body[data-ui-page] .period-group{min-height:105px;padding:14px!important;background:#fafcfd!important;border:0!important}
body[data-ui-page] .period-group-title{color:#81939e!important;font-size:10px!important;letter-spacing:.09em}
body[data-ui-page] .period-title{font-size:17px!important;letter-spacing:-.025em;font-weight:700!important}
body[data-ui-page] .period-subtitle{font-size:11px;font-weight:450;color:#7f929e}
body[data-ui-page] .period-selector{gap:5px}
body[data-ui-page] .seg{font-size:11px;padding:8px 9px;min-height:36px}
body[data-ui-page] .brand-select-button{height:43px;font-weight:600}
body[data-ui-page] :is(.brand-menu,.entry-account-menu,.suggest-box){border:1px solid var(--ui-line)!important;border-radius:14px!important;box-shadow:0 14px 40px rgba(25,50,68,.13)!important}
body[data-ui-page] :is(.brand-option,.entry-account-option,.suggest-item){font-weight:550;min-height:43px}
body[data-ui-page] :is(.brand-option:hover,.brand-option.active,.entry-account-option:hover,.suggest-item:hover){background:#edf6f7!important;color:var(--ui-accent)!important}
body[data-ui-page] :is(.bar,.diff-line){height:7px;border-radius:999px;background:#edf2f5!important}
body[data-ui-page] :is(.bar span,.bar-fill){border-radius:999px}
body[data-ui-page] :is(#category-bars,#merchant-bars,#month-bars){max-height:405px;overflow:auto;overscroll-behavior:contain;padding-right:5px;scrollbar-width:thin;scrollbar-color:#cbd8e0 transparent}
body[data-ui-page] :is(#category-bars,#merchant-bars,#month-bars)>div{min-width:0;max-width:100%}
body[data-ui-page] :is(#category-bars,#merchant-bars,#month-bars)>div>div:first-child>strong{min-width:0;overflow-wrap:anywhere}
body[data-ui-page] :is(#category-bars,#merchant-bars,#month-bars).insight-bar-list{max-height:none;overflow:visible;padding-right:0;gap:10px!important;align-content:start}
body[data-ui-page] #analytics-grid>section:has(>.insight-bar-list){align-self:start}
body[data-ui-page] .insight-bar-heading{display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:baseline;gap:10px;margin-bottom:4px;line-height:18px}
body[data-ui-page] .insight-bar-heading>strong{font-size:13px!important;font-weight:600;color:#172b36}
body[data-ui-page] .insight-bar-value,body[data-ui-page] .insight-bar-value span{font-size:12px!important;font-weight:750;white-space:nowrap;line-height:18px}
body[data-ui-page] .insight-bar-row>.bar{height:4px}
body[data-ui-page] .insight-bar-meta{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-top:3px;min-height:14px;line-height:14px;color:#728793}
body[data-ui-page] .insight-bar-meta span{font-size:10.5px!important;line-height:14px}
body[data-ui-page] .insight-bar-trend{text-align:right;font-weight:650}
body[data-ui-page] .pie-layout{grid-template-columns:180px minmax(0,1fr);gap:24px;align-items:center}
body[data-ui-page] .legend-row{font-size:12px;gap:16px}
body[data-ui-page] .legend-row>:first-child{min-width:0;overflow-wrap:anywhere}
body[data-ui-page] :is(#spend-pie-legend,#tag-pie-legend,.js-donut-legend>span){min-width:0}
body[data-ui-page] .flow-chart-wrap{height:330px;padding:0;margin-top:12px}
body[data-ui-page] #flow-card{padding:24px!important;margin-top:18px!important}
body[data-ui-page] .flow-tooltip{border-radius:13px;border:1px solid rgba(255,255,255,.1);background:#183640;box-shadow:0 10px 32px rgba(16,45,57,.18);padding:13px 15px;font-weight:500}
body[data-ui-page] .flow-total-summary{border-top-color:var(--ui-line);padding-top:16px;font-weight:500}
body[data-ui-page] #recent-card{overflow:visible!important}
body[data-ui-page] .recent-card-heading{padding:22px 24px 18px!important;display:block!important;border-bottom-color:var(--ui-line)!important}
body[data-ui-page] .recent-card-heading h2{margin-bottom:16px}
body[data-ui-page] .recent-toolbar{display:flex;gap:12px!important;align-items:flex-end!important}
body[data-ui-page] :is(.recent-toolbar>label,.flow-filter-wrap){flex-direction:column;align-items:stretch!important;gap:6px!important;font-size:11px!important;color:#728793!important;font-weight:550!important}
body[data-ui-page] #flow-filters{gap:12px!important}
body[data-ui-page] .flow-multi-trigger{width:220px;min-width:0;max-width:100%;height:40px;padding:0 12px;border-radius:10px;border-color:#dce5eb;font-weight:550;font-size:12px}
body[data-ui-page] .recent-toolbar :is(input,select){min-height:40px;font-size:12px!important}
body[data-ui-page] .recent-month-nav{height:40px;padding:3px;border-color:#e1e8ee;background:#f7f9fb;border-radius:10px}
body[data-ui-page] .recent-month-nav .btn{min-height:30px;width:30px;height:30px;padding:0;border-radius:7px!important}
body[data-ui-page] .recent-month-nav strong{min-width:100px;font-size:11px;font-weight:650}
body[data-ui-page] #recent-show-all{min-height:40px}
body[data-ui-page] #recent-count{align-self:center;white-space:nowrap;font-size:11px!important;color:#81949f!important}
body[data-ui-page] .flow-multi-menu{width:390px;max-width:calc(100vw - 32px);max-height:min(580px,70dvh);padding:10px;border:1px solid #dde7ee;border-radius:15px;box-shadow:0 16px 44px rgba(21,53,69,.17);overscroll-behavior:contain;scrollbar-width:thin}
body[data-ui-page] .flow-multi-search{position:static;height:40px;font-size:13px;background:#f6f9fb}
body[data-ui-page] .flow-multi-actions{position:static;padding:6px 0;background:#fff}
body[data-ui-page] .flow-multi-option{min-height:38px;padding:7px 9px;column-gap:10px;grid-template-columns:20px minmax(0,1fr);font-size:12px;font-weight:500}
body[data-ui-page] .flow-multi-option input{width:20px!important;height:20px!important}
body[data-ui-page] .flow-multi-option:has(input:checked){background:#ecf6f6;color:#164f5b}
body[data-ui-page] .flow-multi-action{min-height:32px;padding:7px 10px;font-weight:650;border-radius:8px}
body[data-ui-page] .ui-table-scroll{width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;border-radius:0 0 var(--ui-radius) var(--ui-radius)}
body[data-ui-page] table{border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums}
body[data-ui-page] :is(th,.sort-head){font-size:10px!important;font-weight:650!important;letter-spacing:.055em;color:#7d909b!important}
body[data-ui-page] th{padding:13px 16px!important;background:#f7f9fb!important;border-bottom:1px solid var(--ui-line)!important}
body[data-ui-page] td{padding:14px 16px;color:#4b626f;font-size:12px;line-height:1.5;border-bottom:1px solid #edf2f5!important}
body[data-ui-page] tr:last-child td{border-bottom:0!important}
body[data-ui-page] tr:hover td{background:#f9fbfc!important}
body[data-ui-page] #recent-table td:nth-child(3) strong{font-weight:600}
body[data-ui-page] #recent-table td:nth-child(6){font-weight:650!important;white-space:nowrap}
body[data-ui-page] #recent-table .btn{min-height:32px;border-radius:8px!important}
body[data-ui-page] .pager{padding:16px 22px;border-top-color:var(--ui-line);gap:8px}
body[data-ui-page] .modal-bg{background:rgba(16,36,48,.42);backdrop-filter:blur(5px)}
body[data-ui-page] .modal{border:1px solid var(--ui-line)!important;border-radius:22px!important;box-shadow:0 24px 90px rgba(16,36,48,.23)!important;max-height:calc(100dvh - 48px)}
body[data-ui-page] .modal-head{padding:22px 24px 18px;background:#fff}
body[data-ui-page] .modal-head h2{font-size:23px!important;font-weight:700!important;letter-spacing:-.035em}
body[data-ui-page] .modal-body{padding:20px 24px 24px;gap:12px}
body[data-ui-page] #entry-modal .field-card{border-radius:13px!important;padding:14px!important}
body[data-ui-page] #entry-modal :is(input:not([type='checkbox']),select,textarea,.entry-account-button){min-height:40px!important;font-weight:500!important}
body[data-ui-page] #entry-modal .entry-amount-input{font-size:31px!important;min-height:52px!important}
body[data-ui-page] #entry-modal .entry-save-btn{min-height:48px!important;border-radius:12px!important;font-weight:650!important}
body[data-ui-page] #toast{border-radius:12px;max-width:calc(100vw - 32px);line-height:1.5;font-weight:550}
body[data-ui-page] .overdue-warning{border-radius:17px;box-shadow:0 14px 48px rgba(30,50,66,.14)}
body[data-ui-page] .ui-nav-close{display:none}
body[data-ui-page] .ui-skip-link{position:fixed;left:16px;top:-80px;z-index:1000;padding:10px 16px;border-radius:10px;color:#fff;background:#103f4b;text-decoration:none}
body[data-ui-page] .ui-skip-link:focus{top:12px}
body[data-ui-page='gateway'] :is(.auth-card,.modal-card){border-radius:24px;border-color:var(--ui-line);box-shadow:0 20px 60px rgba(17,49,65,.12)}
body[data-ui-page] :is(.hero,.hero-main,.hero-side,.section-nav){min-width:0;max-width:100%}
body[data-ui-page] .hero{grid-template-columns:minmax(0,1fr)}
body[data-ui-page] :is(.hero-copy,.hero-copy code,.stat-tile){overflow-wrap:anywhere}
body[data-ui-page] .stat-tile{min-width:0}
body[data-ui-page] #recent-card{padding:0!important}
body[data-ui-page] #m-net{font-size:27px!important}
body[data-ui-page] .overdue-warning{background:#fff!important}
body[data-ui-page] .overdue-warning-items{display:none}
body[data-ui-page] .overdue-warning.ui-expanded .overdue-warning-items{display:grid}
body[data-ui-page] .ui-overdue-details{margin-left:8px;border:1px solid #f2d1d3;background:#fff;color:#a73f46;border-radius:8px;padding:7px 10px;min-height:32px;font:600 11px var(--ui-font);cursor:pointer}
body[data-ui-page='ledger']:has(#entry-modal:not(.hidden)) .overdue-warning{display:none!important}
@media(min-width:1380px){
  body[data-ui-page='ledger'] .metrics-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important}
  body[data-ui-page] .metric{padding:18px!important}
  body[data-ui-page] .metric strong{font-size:clamp(20px,1.5vw,25px)!important}
  body[data-ui-page] #m-net{font-size:clamp(20px,1.5vw,25px)!important}
}
@media(min-width:1025px) and (max-width:1260px){
  :root{--ui-sidebar:236px}
  body[data-ui-page] .period-shell{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  body[data-ui-page] .period-group:first-child{grid-column:1/-1;min-height:76px}
  body[data-ui-page] .period-selector{flex-wrap:nowrap}
}
@media(max-width:1024px){
  body[data-ui-page] .sidebar{width:min(86vw,306px)!important;transform:translateX(-105%);z-index:220;box-shadow:14px 0 70px rgba(20,45,60,.12)!important;transition:transform .22s ease}
  body[data-ui-page] .sidebar.open{transform:translateX(0)}
  body[data-ui-page] .sidebar>div:first-child{padding:12px 54px 12px 18px!important;position:relative}
  body[data-ui-page] .ui-nav-close{display:grid;place-items:center;position:absolute;right:12px;top:14px;width:36px;height:36px;border:1px solid var(--ui-line);border-radius:10px;background:#fff;color:#607784;cursor:pointer}
  body[data-ui-page] .main-wrap{margin-left:0!important;padding-top:64px!important}
  body[data-ui-page] .topbar{left:0!important;height:64px!important;padding:0 16px 0 64px!important;z-index:100}
  body[data-ui-page] .topbar h1{margin-left:0!important;max-width:45vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body[data-ui-page] .mobile-toggle{display:flex!important;position:fixed;align-items:center;justify-content:center;left:12px;top:11px;width:42px;height:42px;padding:0;z-index:101;border:1px solid #dce5eb;border-radius:12px;color:#365c6a;background:#fff}
  body[data-ui-page] .mobile-overlay{position:fixed;inset:0;z-index:210;background:rgba(17,41,54,.35);backdrop-filter:blur(3px)}
  body[data-ui-page] .mobile-overlay.show{display:block!important}
  body[data-ui-page].ui-nav-open{overflow:hidden}
  body[data-ui-page] :is(.content-wrap,.page-shell){padding:24px!important}
  body[data-ui-page] .period-shell{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  body[data-ui-page] .period-group:first-child{grid-column:1/-1;min-height:auto}
  body[data-ui-page] .period-selector{flex-wrap:nowrap}
  body[data-ui-page] .period-selector .seg{flex:1}
  body[data-ui-page] :is(.main-grid,.analytics-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-ui-page] .mobile-secondary-grid{grid-template-columns:1fr!important}
  body[data-ui-page] .pie-layout{grid-template-columns:1fr}
  body[data-ui-page] .pie-canvas{margin:0 auto}
  body[data-ui-page] .subgrid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  body[data-ui-page] .layout>:is(.span-7,.span-8,.span-5,.span-4){grid-column:span 12}
}
@media(max-width:700px){
  body[data-ui-page] :is(.content-wrap,.page-shell){padding:18px 14px calc(86px + env(safe-area-inset-bottom))!important}
  body[data-ui-page] .topbar-user-meta{display:none}
  body[data-ui-page] .topbar .btn{min-height:40px}
  body[data-ui-page] .topbar .btn{width:42px;min-width:42px;padding:10px!important;font-size:0!important;gap:0}
  body[data-ui-page] .topbar .btn .ms{font-size:18px!important}
  body[data-ui-page] .topbar>div:last-child{flex-wrap:nowrap!important}
  body[data-ui-page] :is(.main-grid,.analytics-grid,.entry-grid,.subgrid-2,.subgrid-3){grid-template-columns:minmax(0,1fr)!important}
  body[data-ui-page] .main-grid>.card{grid-column:1/-1!important}
  body[data-ui-page] .card div:has(>:is(#spend-pie-legend,#tag-pie-legend)){flex-direction:column!important;align-items:stretch!important}
  body[data-ui-page] .card div:has(>:is(#spend-pie-legend,#tag-pie-legend))>canvas{align-self:center}
  body[data-ui-page] :is(.js-spend-bar>div:first-child,#top-tx>div,#merchant-list>div){flex-wrap:wrap;gap:7px}
  body[data-ui-page] .js-spend-bar>div:first-child>div:first-child{min-width:0;max-width:100%}
  body[data-ui-page] .js-spend-bar>div:first-child>div:first-child>span:last-child{min-width:0;overflow-wrap:anywhere}
  body[data-ui-page] .analytics-grid{gap:14px!important}
  body[data-ui-page] .analytics-grid>section{display:block;padding:20px!important}
  body[data-ui-page] .analytics-grid section:first-child,body[data-ui-page] .analytics-grid section:nth-child(3),body[data-ui-page] .analytics-grid section:nth-child(4){display:block}
  body[data-ui-page] :is(.card,.panel,.hero-main,.hero-side){border-radius:17px!important}
  body[data-ui-page] .metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  body[data-ui-page] .metric{min-width:0!important;height:auto!important;min-height:112px!important;padding:12px!important;border-radius:15px!important;gap:10px!important;box-sizing:border-box}
  body[data-ui-page] .metric strong{min-width:0;max-width:100%;font-size:clamp(13px,4vw,17px)!important;white-space:normal!important;overflow-wrap:anywhere;overflow:visible!important}
  body[data-ui-page] .metric>span{font-size:9px!important}
  body[data-ui-page] #metric-net-card{grid-column:1/-1;min-height:118px!important}
  body[data-ui-page] #metric-net-card strong{font-size:clamp(24px,7vw,32px)!important}
  body[data-ui-page] .metric :is(#m-top,#m-largest,#m-top-merchant,#m-top-tag){font-size:13px!important}
  body[data-ui-page] .period-shell{grid-template-columns:100px minmax(0,1fr);gap:8px!important;padding:8px!important;margin-bottom:14px!important}
  body[data-ui-page] .period-group{padding:10px!important;min-height:0!important;gap:7px!important}
  body[data-ui-page] .period-group:first-child{order:2;grid-column:auto}
  body[data-ui-page] .period-group:nth-child(2){order:1;grid-column:1/-1}
  body[data-ui-page] .period-group:nth-child(3){order:3}
  body[data-ui-page] .period-selector{display:none}
  body[data-ui-page] .mobile-period-select{display:block;width:100%;min-height:42px;padding:8px;font-size:14px}
  body[data-ui-page] .period-center{grid-template-columns:38px minmax(0,1fr) 38px;gap:8px}
  body[data-ui-page] .period-nav{width:38px;height:38px}
  body[data-ui-page] .period-title{font-size:15px!important;line-height:1.4}
  body[data-ui-page] .period-group-title{font-size:9px!important}
  body[data-ui-page] .brand-select-button{min-height:42px;padding:6px 9px}
  body[data-ui-page] .period-subtitle{display:block;font-size:10px;line-height:1.5}
  body[data-ui-page] #period-range{white-space:normal;font-size:10px!important}
  body[data-ui-page] .period-group:nth-child(3)>div:last-child{display:none}
  body[data-ui-page] .pie-layout{grid-template-columns:150px minmax(0,1fr);gap:16px}
  body[data-ui-page] .pie-canvas{width:150px;height:150px}
  body[data-ui-page] .legend-row{font-size:11px;gap:8px}
  body[data-ui-page] :is(#category-bars,#merchant-bars,#month-bars){max-height:330px}
  body[data-ui-page] #flow-card{padding:20px 14px!important}
  body[data-ui-page] .flow-chart-wrap{height:285px;margin-top:8px}
  body[data-ui-page] .flow-legend{gap:12px;font-size:11px}
  body[data-ui-page] .flow-total-summary{gap:10px;align-items:baseline;flex-wrap:wrap;font-size:11px}
  body[data-ui-page] .recent-card-heading{padding:20px 16px 16px!important}
  body[data-ui-page] .recent-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px!important}
  body[data-ui-page] .recent-toolbar>*{min-width:0}
  body[data-ui-page] .recent-toolbar>label{width:100%}
  body[data-ui-page] #flow-filters{grid-column:1/-1;width:100%;flex-wrap:nowrap!important}
  body[data-ui-page] .flow-filter-wrap{min-width:0;flex:1;width:calc(50% - 6px)}
  body[data-ui-page] .flow-multi-filter{width:100%}
  body[data-ui-page] .flow-multi-trigger{width:100%;height:44px;font-size:12px}
  body[data-ui-page] .recent-toolbar>label:has(#recent-search){grid-column:1/-1}
  body[data-ui-page] .recent-toolbar :is(input,select){width:100%!important;min-height:44px;font-size:16px!important}
  body[data-ui-page] :is(input:not([type='checkbox']):not([type='radio']):not([type='color']),select,textarea){font-size:16px!important;min-height:44px}
  body[data-ui-page='statement'] .card div:has(>#search-box){min-width:0;max-width:100%;width:100%}
  body[data-ui-page='statement'] :is(#search-box,#filter-type){flex:1;min-width:100px;width:auto!important}
  body[data-ui-page='statement'] .entry-grid h2+span{min-width:0;overflow-wrap:anywhere;text-align:right}
  body[data-ui-page] .recent-month-nav{height:44px;width:100%;justify-content:space-between}
  body[data-ui-page] .recent-month-nav strong{min-width:0;font-size:11px}
  body[data-ui-page] #recent-show-all{min-height:44px;align-self:end}
  body[data-ui-page] #recent-count{grid-column:1/-1;justify-self:end}
  body[data-ui-page] .flow-multi-menu{position:fixed;inset:auto 12px calc(12px + env(safe-area-inset-bottom));width:auto;max-width:none;max-height:min(65dvh,580px);border-radius:19px;padding:12px;z-index:320}
  body[data-ui-page] .flow-multi-option{min-height:43px}
  body[data-ui-page] .flow-multi-option span{white-space:normal;overflow:visible}
  body[data-ui-page] .flow-multi-search{font-size:16px;min-height:44px}
  body[data-ui-page] .flow-multi-action{min-height:38px}
  body[data-ui-page] .pager{flex-wrap:wrap;justify-content:center;padding:16px 12px;gap:7px}
  body[data-ui-page] .pager .btn{min-height:40px;min-width:40px}
  body[data-ui-page] .ui-table-scroll table:not(.excel-table){min-width:640px}
  body[data-ui-page] .ui-table-scroll :is(table,thead,tbody){display:table;width:100%}
  body[data-ui-page] .ui-table-scroll thead{display:table-header-group}
  body[data-ui-page] .ui-table-scroll tbody{display:table-row-group}
  body[data-ui-page] .ui-table-scroll tr{display:table-row;padding:0;width:auto}
  body[data-ui-page] .ui-table-scroll :is(td,th){display:table-cell;width:auto;padding:12px!important;border-radius:0;background:transparent}
  body[data-ui-page] #recent-card .ui-table-scroll{overflow:visible}
  body[data-ui-page] #recent-card table{min-width:0!important;display:block}
  body[data-ui-page] #recent-card thead{display:none}
  body[data-ui-page] #recent-table{display:block;width:100%}
  body[data-ui-page] #recent-table tr{display:grid;width:100%;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'date amount' 'account account' 'description description' 'category actions' 'subcategory actions';gap:6px 12px;padding:17px 16px;border:0;border-top:1px solid #edf2f5;background:#fff}
  body[data-ui-page] #recent-table tr:first-child{border-top:0}
  body[data-ui-page] #recent-table td{display:block;width:auto;min-width:0;padding:0!important;margin:0;background:none!important;border:0!important;border-radius:0;text-align:left!important;font-size:11px!important;overflow-wrap:anywhere}
  body[data-ui-page] #recent-table td:nth-child(1){grid-area:date;align-self:center;color:#8697a1!important}
  body[data-ui-page] #recent-table td:nth-child(2){grid-area:account;color:#7a8f9b}
  body[data-ui-page] #recent-table td:nth-child(3){grid-area:description;padding:3px 0 5px!important}
  body[data-ui-page] #recent-table td:nth-child(3) strong{font-size:14px;font-weight:650;line-height:1.5}
  body[data-ui-page] #recent-table td:nth-child(4){grid-area:category;color:#718591;font-weight:500}
  body[data-ui-page] #recent-table td:nth-child(5){grid-area:subcategory;color:#526c79;font-size:11px!important}
  body[data-ui-page] #recent-table td:nth-child(6){grid-area:amount;text-align:right!important;align-self:center;font-size:16px!important;letter-spacing:-.03em}
  body[data-ui-page] #recent-table td:nth-child(7){grid-area:actions;align-self:end;text-align:right!important}
  body[data-ui-page] #recent-table td:nth-child(7) .btn{min-height:36px;min-width:36px}
  body[data-ui-page] #recent-table td[colspan]{grid-column:1/-1;grid-area:auto;padding:20px 0!important;text-align:center!important}
  body[data-ui-page] #recent-table .payment-badge{max-width:100%;white-space:normal}
  body[data-ui-page] .panel-head{padding:20px;flex-wrap:wrap}
  body[data-ui-page] .panel-body{padding:20px}
  body[data-ui-page] :is(.hero-main,.hero-side){padding:22px!important}
  body[data-ui-page] .hero-title{font-size:28px!important}
  body[data-ui-page] .section-nav{flex-wrap:nowrap;overflow-x:auto;padding:4px 0 10px;scrollbar-width:none}
  body[data-ui-page] .section-nav>*{flex-shrink:0}
  body[data-ui-page] .layout>*{grid-column:1/-1}
  body[data-ui-page] :is(.budget-row,.preview-grid){grid-template-columns:minmax(0,1fr)}
  body[data-ui-page] .stat-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-ui-page] #m-net{font-size:32px!important}
  body[data-ui-page='debit'] .card div:has(>#f-search){flex-wrap:wrap!important;max-width:100%}
  body[data-ui-page='debit'] .card div:has(>#f-search)>:is(input,button.picker-trigger){flex:1;min-width:100px}
  body[data-ui-page='debit'] #bin-toggle+span{display:none}
  body[data-ui-page='debit'] :is(#f-search,.picker-trigger){max-width:100%}
  body[data-ui-page] .modal-bg{align-items:flex-end;padding:0}
  body[data-ui-page] .modal{width:100%;max-width:100%!important;max-height:calc(100dvh - 16px)!important;border-radius:22px 22px 0 0!important;overflow-y:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom)}
  body[data-ui-page] .modal-head{position:sticky;top:0;z-index:4;padding:19px 18px 15px}
  body[data-ui-page] .modal-body{padding:16px}
  body[data-ui-page] :is(.form-grid,#entry-modal .entry-layout){grid-template-columns:minmax(0,1fr)!important}
  body[data-ui-page] #entry-modal .field-card{padding:12px!important}
  body[data-ui-page] #entry-modal :is(input:not([type='checkbox']),select,textarea,.entry-account-button){font-size:16px!important;min-height:44px!important}
  body[data-ui-page] #entry-modal .entry-amount-input{font-size:30px!important}
  body[data-ui-page] #entry-modal .entry-save-btn{position:sticky;bottom:0;min-height:50px!important;margin:6px 0 0!important}
  body[data-ui-page] .mobile-fab{width:54px;height:54px;right:18px;bottom:calc(18px + env(safe-area-inset-bottom));z-index:90;background:#125766!important;box-shadow:0 8px 25px rgba(18,87,102,.25)!important}
  body[data-ui-page] .overdue-warning{right:12px;bottom:calc(82px + env(safe-area-inset-bottom));width:min(365px,calc(100vw - 24px))}
}
@media(max-width:380px){
  body[data-ui-page] .pie-layout{grid-template-columns:1fr}
  body[data-ui-page] .metric{padding:13px!important}
  body[data-ui-page] .metric strong{font-size:clamp(12px,3.8vw,14px)!important}
  body[data-ui-page] .recent-month-nav strong{font-size:10px}
}
@media(max-width:700px){
  body[data-ui-page='ledger'] #entry-modal .entry-money-row,
  body[data-ui-page='ledger'] #entry-modal .entry-description-row{display:contents!important}
  body[data-ui-page='ledger'] #entry-modal .entry-field-row:first-child{order:0}
  body[data-ui-page='ledger'] #entry-modal .entry-meta-row{order:1}
  body[data-ui-page='ledger'] #entry-modal .entry-amount-card{order:2}
  body[data-ui-page='ledger'] #entry-modal .entry-description-card{order:3}
  body[data-ui-page='ledger'] #entry-modal .entry-category-card{order:4}
  body[data-ui-page='ledger'] #entry-modal .entry-merchant-card{order:5}
  body[data-ui-page='ledger'] #entry-modal #entry-currency-row{order:6}
  body[data-ui-page='ledger'] #entry-modal .entry-tags-card{order:7}
  body[data-ui-page='ledger'] #entry-modal #entry-payment-card{order:8}
  body[data-ui-page='ledger'] #entry-modal #entry-notes-subscription-row{order:9}
  body[data-ui-page='ledger'] #entry-modal #entry-save-actions{order:10;position:sticky;bottom:0;z-index:5;margin-top:2px!important;padding:6px 0 calc(6px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #e5edf2;box-shadow:0 -6px 16px rgba(15,23,42,.06)}
  body[data-ui-page='ledger'] #entry-modal .entry-save-btn{position:static!important;margin:0!important;min-height:50px!important;height:50px!important;font-size:12px!important}
}
@media(prefers-reduced-motion:reduce){
  body[data-ui-page] *,body[data-ui-page] *::before,body[data-ui-page] *::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
@media print{
  body[data-ui-page] :is(.sidebar,.topbar,.mobile-toggle,.mobile-fab,.mobile-overlay,.ui-skip-link){display:none!important}
  body[data-ui-page] .main-wrap{margin:0!important;padding:0!important}
  body[data-ui-page] :is(.card,.metric,.panel){box-shadow:none!important;break-inside:avoid}
}
