/* 3.4.1 — layout only. The available CSS viewport, not monitor inches, sets the density. */
@media screen {
:root{--dv-gap:clamp(12px,1.15vw,22px);--dv-pad:clamp(16px,1.55vw,28px);--dv-radius:20px;--sidebar:clamp(176px,13vw,224px);--header:72px}
body.via-auth main{padding:var(--dv-pad);padding-bottom:40px;min-width:0}
body.via-auth #app{min-width:0;max-width:1680px;margin-inline:auto}
#content{min-width:0;max-width:100%;container-type:inline-size}
#content>*,.panel,.metric,.f-title,.f-kpis>*,.dv3-home-grid>*,.dv3-home-overview>*,.dv34-metrics>*,.dv33-score-layout>*,.dp-hero>*,.liq-grid>*,.adapt-overview>*{min-width:0}
#content .scroll,dialog .scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
#content .panel>table:not(.ledger){max-width:100%}
#content :is(h1,h2,h3,h4,p),dialog :is(h1,h2,h3,p){overflow-wrap:break-word}
#content :is(input,select,textarea),dialog :is(input,select,textarea){max-width:100%;min-width:0}
#content :is(.f-actions,.via-heading,.f-title,.adapt-head-actions,.dv3-section-head,.adapt-period-head,.dv34-heading){flex-wrap:wrap;min-width:0}
#content :is(.f-actions,.via-heading,.f-title,.adapt-head-actions) button{white-space:normal;max-width:100%}
#content :is(.f-kpis,.cards,.dv34-metrics,.dv34-account-grid){gap:var(--dv-gap)}
#content :is(.f-kpis .metric strong,.metric strong,.dv34-metric strong,.dv34-account>strong){overflow-wrap:anywhere;line-height:1.2;font-variant-numeric:tabular-nums}
#content .f-kpis{grid-template-columns:repeat(auto-fit,minmax(min(100%,165px),1fr))}
#content .panel{max-width:100%}
#content .adapt-overview{gap:var(--dv-gap);margin-bottom:14px}
.budget-view #content .adapt-hero{padding:clamp(18px,1.8vw,28px);min-height:0;justify-content:center}
.budget-view #content .adapt-hero>strong{font-size:clamp(29px,3vw,47px);line-height:1.12;overflow-wrap:anywhere}
.budget-view #content .adapt-hero-flows{margin-top:10px;padding-top:12px;gap:12px}
.budget-view #content .adapt-hero-flows b{font-size:clamp(17px,1.8vw,25px)}
#content .dv201-distribution{padding:clamp(16px,1.5vw,23px);min-height:0}
#content .dv201-distribution .dv140-ring{max-height:clamp(142px,16vw,215px)}
#content .dv201-distribution .dv140-legend{min-width:0;gap:12px;padding-left:12px}
#content .dv140-legend-row>div{min-width:0}
#content .dv140-legend-row strong{font-size:clamp(17px,1.65vw,25px);white-space:normal;overflow-wrap:anywhere;line-height:1.15}
#content .dv140-status{gap:12px;padding:12px 16px}
#content .dv140-status strong{overflow-wrap:anywhere;line-height:1.2}
#content .adapt-columns{gap:var(--dv-gap)}
#content .adapt-period{padding:clamp(12px,1.1vw,19px)}
#content .adapt-period-head>div,#content .adapt-ledger-head>div{min-width:0}
#content .adapt-period-head h2{font-size:clamp(15px,1.3vw,19px)}
#content .adapt-period-head button{white-space:normal}
#content .adapt-ledger-head{flex-wrap:wrap;gap:6px}
#content .adapt-ledger-head strong{font-size:clamp(14px,1.25vw,18px);white-space:normal;overflow-wrap:anywhere}
#content .adapt-ledger .concept-name,#content .adapt-agenda .concept-name{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
#content :is(.adapt-ledger,.adapt-agenda) .ledger .num{font-size:clamp(12px,1vw,14px);font-variant-numeric:tabular-nums;white-space:normal;overflow-wrap:anywhere}
#content :is(.adapt-ledger,.adapt-agenda) .ledger .amountcol{width:32%}
#content .adapt-half-total{flex-wrap:wrap}
#content .adapt-half-total strong{overflow-wrap:anywhere}
#content .dv3-home{max-width:none}
#content .dv3-home-overview,#content .dv3-home-grid{gap:var(--dv-gap)}
#content .dv3-actions button{min-height:60px}
#content .dv3-actions button>div{min-width:0;overflow-wrap:anywhere}
#content .dv33-gauge{max-width:100%}
#content .dv33-score-layout{gap:16px}
#content .dv34-import-grid article{min-width:0}
#content .dv34-road{flex-wrap:wrap}
#content .via-tabs{flex-wrap:wrap;gap:6px}
header{padding-inline:var(--dv-pad)}
.header-actions{flex-shrink:0;gap:7px}
#nav{padding:10px 10px 12px;gap:2px;overscroll-behavior:contain;scrollbar-width:thin}
#nav>button{min-height:36px;padding:8px 10px;font-size:13px;line-height:1.2}
#nav>button.dv3-sub{min-height:33px;padding-left:22px;font-size:12px}
#nav>button>span{min-width:0;white-space:normal;overflow-wrap:break-word}
#nav .dv3-nav-label{padding:7px 10px 2px;line-height:1.1}
#nav .dv141-inspiration{margin-top:auto}
#nav .dv141-inspiration p{min-height:0}
#viaProfile .via-pop{max-width:min(310px,calc(100vw - 24px))}
dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
dialog :is(.f-fields,.dv31-fields,.liq-fields,.dv3-welcome-grid)>*{min-width:0}
/* The quincena view responds to usable content, including a collapsed sidebar. */
@container (max-width:1050px){
 #content .dv201-distribution .dv140-chart-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 #content .dv201-distribution .dv140-ring{max-height:155px}
 #content .dv201-distribution .dv140-legend{gap:10px;padding-left:8px}
 #content .adapt-head-actions button{padding:8px 10px;font-size:12px}
 #content .adapt-heading{gap:10px}
 #content .adapt-ledger .ledger .checkcol,#content .adapt-agenda .ledger .checkcol{width:32px}
 #content .adapt-ledger .ledger .menucol,#content .adapt-agenda .ledger .menucol{width:26px}
}
@container (max-width:820px){
 #content .adapt-heading{align-items:flex-start;flex-wrap:wrap}
 #content .dv201-distribution .dv140-chart-body{grid-template-columns:1fr}
 #content .dv201-distribution .dv140-legend{grid-template-columns:repeat(2,minmax(0,1fr));border-left:0;padding-left:0}
 #content .dv201-distribution .dv140-ring{max-height:140px}
 #content .f-debt-layout,#content .ar-detail-grid,#content .liq-layout{grid-template-columns:minmax(0,1fr)}
 #content .dp-hero{grid-template-columns:minmax(0,1fr);gap:12px}
 #content .dv3-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container (max-width:560px){
 #content .adapt-heading{flex-direction:column}
 .budget-view #content .adapt-overview{grid-template-columns:minmax(0,1fr);gap:10px}
 #content .dv201-distribution .dv140-chart-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #content .dv201-distribution .dv140-legend{grid-template-columns:minmax(0,1fr);border-left:1px solid var(--line);padding-left:8px}
 #content .dv201-distribution .dv140-ring{max-height:160px}
 #content .dv140-legend-row strong{font-size:17px}
 #content .dv140-status{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:12px}
 #content .dv140-status .adapt-progress{grid-column:1/-1;border-left:0;border-top:1px solid var(--line);padding:9px 0 0}
 #content .dv140-status>div+div:not(.adapt-progress){padding-left:9px}
 #content .dv140-status strong{font-size:18px}
 #content .dv33-score-layout{grid-template-columns:1fr}
 #content .f-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 #content .f-kpis .metric{padding:12px}
 #content .dv34-metrics{gap:8px}
 #content .adapt-head-actions{width:100%;gap:6px}
 #content .adapt-head-actions button{flex:1 1 auto}
 #content .adapt-head-actions svg{width:16px;height:16px}
 #content .adapt-period-head>span{width:33px;height:33px;flex-shrink:0}
 #content .adapt-period-head button{font-size:11px}
 #content .dv32-notice{grid-template-columns:8px minmax(0,1fr)}
 #content .dv32-notice-actions{grid-column:2/-1}
}
@container (max-width:340px){
 #content .dv201-distribution .dv140-chart-body{grid-template-columns:1fr}
 #content .dv201-distribution .dv140-legend{grid-template-columns:1fr 1fr;border:0;padding:0}
 #content .dv201-distribution .dv140-ring{max-height:138px}
 #content .adapt-ledger .concept-icon,#content .adapt-agenda .concept-icon{width:25px;height:25px;flex:0 0 25px}
 #content .adapt-ledger .ledger .amountcol,#content .adapt-agenda .ledger .amountcol{width:33%}
 #content .adapt-ledger .ledger .checkcol,#content .adapt-agenda .ledger .checkcol{width:28px}
 #content .adapt-ledger .ledger .menucol,#content .adapt-agenda .ledger .menucol{width:24px}
 #content .adapt-ledger .ledger .num,#content .adapt-agenda .ledger .num{font-size:12px}
 #content .adapt-period{padding:10px}
 #content .dv34-metric{padding:9px}
 #content .dv34-metric strong{font-size:16px}
}
}
/* Desktop with little vertical space: smaller chrome, not browser-wide zoom. */
@media screen and (min-width:851px) and (max-height:850px){
 :root{--header:64px;--dv-pad:clamp(14px,1.3vw,22px)}
 #nav>button{min-height:31px;padding-block:6px}
 #nav>button.dv3-sub{min-height:28px;padding-block:5px}
 #nav .dv3-nav-label{padding-top:5px}
 #content .adapt-heading{margin-bottom:12px}
 #content .adapt-overview{margin-bottom:12px}
 #content .dv201-distribution .dv140-ring{max-height:168px}
 #content .dv201-distribution{padding-block:15px}
 #content .adapt-hero{padding-block:17px}
 #content .dv140-status{padding-block:10px}
 .tools{margin-bottom:13px!important}
}
@media screen and (min-width:851px) and (max-width:1150px){
 :root{--sidebar:174px;--dv-pad:15px}
 #nav>button{font-size:12px}
 #nav>button.dv3-sub{padding-left:17px}
 #content .adapt-period{padding:11px}
 #content .adapt-columns{gap:10px}
 #content .adapt-period-head{gap:6px}
 #content .adapt-period-head button{padding:6px;font-size:11px}
 #content .adapt-ledger .concept-icon{width:26px;height:26px}
 #content .adapt-ledger-head button span{display:none}
}
/* On tablets and phones keep the native-style bottom navigation. */
@media screen and (max-width:850px){
 :root{--header:64px;--dv-pad:clamp(12px,2.4vw,20px)}
 body.via-auth main{padding:var(--dv-pad);padding-bottom:calc(94px + env(safe-area-inset-bottom,0px))!important}
 header{padding-inline:max(10px,env(safe-area-inset-left,0px))}
 .header-actions{gap:5px}
 .brand{font-size:23px;gap:6px;min-width:0}
 .brand img{width:34px;height:34px}
 #dv3Mobile{padding-left:max(6px,env(safe-area-inset-left,0px));padding-right:max(6px,env(safe-area-inset-right,0px))}
 #dv3Mobile button{min-height:52px}
 #content .dv3-half-switch button{min-height:44px}
 #content .adapt-ledger .ledger input[type=checkbox],#content .adapt-agenda .ledger input[type=checkbox]{width:20px;height:20px}
 #content .adapt-ledger .ledger .more,#content .adapt-agenda .ledger .more{min-height:35px;min-width:26px}
 #content :is(.f-actions,.via-heading,.adapt-head-actions) button{min-height:42px}
 dialog input:not([type=checkbox]):not([type=radio]),dialog textarea,dialog select,#content input:not([type=checkbox]):not([type=radio]),#content select{font-size:16px}
 dialog button{min-height:38px}
 dialog .f-actions button{min-height:44px}
 #content .dv3-home-heading h1{font-size:clamp(23px,4.5vw,32px)}
}
@media screen and (max-width:400px){
 header{padding-inline:9px}.brand{font-size:20px;letter-spacing:-1.1px}.brand img{width:30px;height:30px}.brand small{display:none}.header-actions{gap:3px}
 #content .adapt-hero-flows span{font-size:11px}#content .adapt-hero-flows b{font-size:18px}
 #content .adapt-heading h1{font-size:25px}
 #content .adapt-period-head h2{font-size:15px}
 #content .dv140-chart-head h2{font-size:17px}
 #content .dv140-legend-row strong{font-size:16px}
 #content .adapt-tabs button{font-size:12px}
}
@media screen and (max-width:350px){.brand{font-size:18px}.brand img{width:27px;height:27px}.header-actions{gap:2px}#dv31Sync{width:14px}#content .adapt-hero>strong{font-size:29px}#content .adapt-head-actions button{font-size:11px;padding-inline:6px}}
@media (prefers-reduced-motion:reduce){#dv3Mobile *,#content *{scroll-behavior:auto!important}}
/* Prioritize real movements when the viewport is short. */
#dv341Movements{display:none}
@media screen and (min-width:851px) and (max-height:850px){
 body.via-auth main{padding-top:9px}
 .budget-view .tools{margin-bottom:6px!important}
 .budget-view #content .adapt-heading{margin:2px 0 10px}
 .budget-view #content .adapt-heading .eyebrow{margin:0 0 4px}
 .budget-view #content .monthbar{margin-bottom:0}
 .budget-view #content .monthbar h1{font-size:clamp(26px,2.45vw,34px)}
 .budget-view #content .adapt-hero{padding:16px 20px}
 .budget-view #content .dv201-distribution{padding:14px 16px;gap:3px}
 .budget-view #content .dv201-distribution .dv140-chart-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 .budget-view #content .dv201-distribution .dv140-legend{grid-template-columns:minmax(0,1fr);border-left:1px solid var(--line);padding-left:10px;gap:8px}
 .budget-view #content .dv201-distribution .dv140-ring{max-height:135px}
 .budget-view #content .dv201-distribution .dv140-chart-head h2{font-size:17px}
 .budget-view #content .dv201-distribution .dv140-chart-note{padding-top:5px;font-size:11px}
 .budget-view #content .dv140-status{padding:8px 14px;gap:10px}
 .budget-view #content .dv140-status strong{font-size:20px}
 .budget-view #content .adapt-controls{margin-bottom:9px}
 .budget-view #content .adapt-tabs button{padding-block:7px}
 .budget-view #content .adapt-period-head{padding-bottom:8px;margin-bottom:3px}
}
@media screen and (min-width:851px) and (max-width:1000px){
 .budget-view #content .dv201-distribution .dv140-legend-row strong{font-size:16px}
 .budget-view #content .dv201-distribution .dv140-legend-row{gap:5px}
 .budget-view #content .dv201-distribution .dv140-chart-note{font-size:11px}
}
@media screen and (max-width:850px){
 .budget-view #dv341Movements{display:inline-flex;align-items:center;justify-content:center;min-height:38px;margin-left:auto;background:var(--accent);color:var(--brand);font-weight:650;white-space:normal}
 .budget-view .tools{margin-bottom:9px!important;gap:6px}
 .budget-view #content .adapt-heading{margin:2px 0 10px}
 .budget-view #content .adapt-heading .eyebrow{margin:0 0 5px}
 .budget-view #content .monthbar{margin-bottom:0}
 .budget-view #content .adapt-overview{margin-bottom:10px}
 .budget-view #content .adapt-hero{padding:16px;gap:5px}
 .budget-view #content .adapt-hero-flows{padding-top:9px;margin-top:6px}
 .budget-view #content .dv201-distribution{padding:13px 14px;gap:3px}
 .budget-view #content .dv201-distribution .dv140-ring{max-height:136px}
 .budget-view #content .dv201-distribution .dv140-chart-note{font-size:11px;padding-top:6px}
 .budget-view #content .adapt-controls{scroll-margin-top:calc(var(--header) + 10px)}
 .budget-view #content .dv140-status{padding:10px 12px}
 .budget-view #content .adapt-controls{gap:7px;margin-bottom:9px}
 .budget-view #content .dv3-half-switch{margin-bottom:9px}
}
