/* Shared web/Android layout. Keep all content readable without horizontal panning. */
html,body{width:100%;max-width:100%;margin:0;overflow-x:clip;overscroll-behavior-x:none}
body{touch-action:pan-y pinch-zoom}
#root{width:100%;min-width:0;max-width:100%}
*,*::before,*::after{box-sizing:border-box}
img,video,canvas{max-width:100%}
input,select,textarea,button{min-width:0;max-width:100%}
textarea{resize:vertical}
h1,h2,h3,p,label,small,b,strong,a,code,pre,button,td,th{overflow-wrap:anywhere}
svg{flex-shrink:0}
.landing,.landing-grid,.landing-intro,.auth-card,main,.content,.panel,.modal,.form-fields,.fields-grid,.stats,.charts,.packages-body{min-width:0;max-width:100%}
.landing-grid>*,.fields-grid>*,.stats>*,.charts>*,.modal-grid>*{min-width:0}
.primary,.exports button,.account-actions button{white-space:normal;text-align:center}
.heading,.toolbar,.period,.exports,.account-actions,.topbar,.sidebar,footer{flex-wrap:wrap}
.global-error{width:max-content;max-width:calc(100vw - 24px);overflow-wrap:anywhere}
.overlay{overflow-x:clip;overscroll-behavior:contain}
.modal{width:min(980px,100%);overflow-x:clip}
.modal-head>div{min-width:0;flex:1}
.modal-head>button{flex:none}
.photo-view{max-width:100%}
.business,.business>div,.legend,.profile>div{min-width:0}
.business b,.profile small{white-space:normal;text-overflow:clip;overflow-wrap:anywhere}
@media screen and (max-width:780px){
 .sidebar{gap:12px;padding:12px 16px}
 .sidebar nav{width:100%;display:flex;flex-wrap:wrap;gap:6px}
 .sidebar nav button{flex:1 1 auto;justify-content:center;white-space:normal}
 main{width:100%;margin-left:0}
 .topbar{height:auto;min-height:52px;gap:10px;padding:12px 16px}
 .topbar>span{min-width:0;flex-wrap:wrap}
 .content{padding:20px 16px}
 .heading{align-items:stretch}
 .heading .primary{align-self:flex-start}
 .toolbar{align-items:stretch}
 .period{width:100%;gap:8px}
 .period input{flex:1;max-width:100%;width:0;min-width:135px}
 .exports{width:100%;gap:8px}
 .exports button{flex:1 1 120px;justify-content:center;min-height:42px}
 .charts{grid-template-columns:minmax(0,1fr)}
 .stats{grid-template-columns:repeat(3,minmax(0,1fr))}
 .stats strong{font-size:clamp(18px,4vw,26px);overflow-wrap:anywhere}
 .filters{flex-wrap:wrap;gap:10px;padding:16px}
 .filters label{width:100%;max-width:none;flex:1 1 100%;min-width:0}
 .filters select{width:100%}
 .table-wrap{width:100%;max-width:100%;overflow:visible}
 .table-wrap table,.table-wrap tbody,.table-wrap tfoot{display:block;width:100%;min-width:0;white-space:normal}
 .table-wrap thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 .table-wrap tbody{padding:12px;display:grid;gap:12px}
 .table-wrap tr{display:block;min-width:0;border:1px solid #eae8ef;border-radius:10px;padding:8px;background:#fff}
 .table-wrap td{display:grid;grid-template-columns:minmax(0,0.9fr) minmax(0,1.5fr);gap:10px;align-items:start;padding:9px 6px;white-space:normal;font-size:12px;min-width:0}
 .table-wrap td::before{content:attr(data-label);color:#81798d;font-size:11px;font-weight:600;overflow-wrap:anywhere}
 .table-wrap td>*{min-width:0;max-width:100%}
 .table-wrap td[colspan]{display:block;text-align:center}
 .table-wrap td[colspan]::before{display:none}
 .table-wrap .business{align-items:flex-start}
 .table-wrap .business b{max-width:none;white-space:normal}
 .table-wrap .business>span{flex-shrink:0}
 .table-wrap .actions{display:flex;flex-wrap:wrap;gap:6px}
 .table-wrap .actions::before{flex:0 0 35%}
 .panel-title{flex-wrap:wrap;padding:18px 16px 0}
 .panel-title>div{min-width:0;flex:1}
 .donut-area{flex-wrap:wrap;justify-content:center}
 .legend{flex:1 1 135px;max-width:100%}
 .legend>div{min-width:0;flex-wrap:wrap}
 .overlay{padding:8px;align-items:flex-start}
 .modal{margin:auto 0;max-height:calc(100dvh - 16px)}
 .modal-head{padding:16px;gap:10px}
 .modal-head h2{font-size:21px;line-height:1.3}
 .modal-grid{grid-template-columns:minmax(0,1fr);padding:16px;gap:16px}
 .fields-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .form-fields input,.form-fields select,.form-fields textarea,.auth-card input,.auth-card select{font-size:16px}
 .modal-foot{padding:14px 16px;align-items:stretch}
 .modal-foot>*{min-width:0;max-width:100%}
 .membership-banner{align-items:flex-start}
 footer{gap:10px}
}
@media screen and (max-width:480px){
 .landing{padding:0 16px}
 .landing-header{gap:12px;padding:20px 0;flex-wrap:wrap}
 .landing-header .brand{font-size:21px}
 .landing-grid{grid-template-columns:minmax(0,1fr);gap:24px;padding:28px 0}
 .landing-intro h1{font-size:clamp(27px,8vw,36px);letter-spacing:-1px;line-height:1.2}
 .landing-features>div{align-items:flex-start}
 .auth-card{padding:20px 16px}
 .auth-card h2{font-size:22px;line-height:1.35}
 .auth-tabs button{padding:10px 8px}
 .landing-packages h2{font-size:24px}
 .stats{grid-template-columns:minmax(0,1fr);gap:10px}
 .stats article{padding:16px}
 .stat-label{font-size:12px}
 .stats strong{font-size:27px;margin:10px 0}
 .stats article>small{font-size:11px}
 .fields-grid{grid-template-columns:minmax(0,1fr)}
 .tax-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 30px;gap:6px}
 .tax-header{flex-wrap:wrap;gap:10px}
 .tax-header button{white-space:normal}
 .packages-body{padding:16px}
 .package-grid{grid-template-columns:minmax(0,1fr)}
 .donut-area{flex-direction:column;gap:20px}
 .donut b{max-width:100%;font-size:clamp(10px,2.8vw,13px);text-align:center;line-height:1.3}
 .legend{flex:auto;width:100%}
 .account-actions{width:100%}
 .account-actions button{flex:1}
}
@media print{
 html,body{overflow:visible;width:auto;max-width:none}
 .table-wrap td::before{display:none}
}
