/* Shared layout rules: keep wide data inside its own scrollable region. */
html{scroll-padding-top:90px;-webkit-text-size-adjust:100%}
body{min-width:0}
img,svg,video,canvas{max-width:100%}
button,input,select,textarea{min-width:0;max-width:100%}
button,a,input,select,textarea{touch-action:manipulation}
input,select,textarea{scroll-margin-block:100px}
input[type=checkbox],input[type=radio]{flex-shrink:0}
:where(h1,h2,h3,p,.brand,.user-menu,.summary-card strong){overflow-wrap:anywhere}
:where(.workspace,.content-card,.summary-card,.form-stack,.form-row,.form-stack label,.filters label,.hero-copy,.hero-art,.plan-card,.feature-card,.report-chart-card,.register-totals>div){min-width:0}
.workspace{width:calc(100% - 238px)}
.sidebar{overflow-y:auto;overscroll-behavior:contain}
.sidebar .brand{flex-shrink:0}
.mobile-menu-toggle{display:none}
.workspace-header,.card-heading,.branch-filter,.hero-actions,.report-category-row>div:first-child{gap:14px;flex-wrap:wrap}
.workspace-header>div:first-child{flex:1 1 220px;min-width:0}
.header-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;max-width:100%}
.workspace-header h1{font-size:clamp(20px,2.2vw,30px)}
.summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.summary-card>strong{font-size:clamp(18px,1.8vw,25px)}
.two-column{grid-template-columns:minmax(0,.8fr) minmax(0,1.5fr)}
.form-row{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-stack label{white-space:normal}
.form-stack input,.form-stack select,.form-stack textarea{min-width:0;max-width:100%}
.form-stack textarea{width:100%;resize:vertical}
.form-stack input[type=file],.inline-upload input{width:100%;max-width:100%;height:auto;min-height:42px;padding:8px}
.branch-checks{min-width:0;max-width:100%}
.branch-checks label{min-height:36px;overflow-wrap:anywhere}
.branch-checks input[type=checkbox]{width:18px;height:18px}
.filters{align-items:end}
.filters label{flex:1 1 150px;max-width:100%}
.filters input,.filters select{width:100%;max-width:100%}
.table-wrap{max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.table-wrap:focus-visible{outline:2px solid var(--purple);outline-offset:3px}
.table-wrap .form-stack{min-width:220px;max-width:360px}
.table-wrap td small{white-space:normal;overflow-wrap:anywhere}
.table-wrap td .form-stack,.audit-details{white-space:normal}
.table-wrap .row-actions{flex-wrap:wrap}
.inline-upload{min-width:0;max-width:260px}
.report-chart-grid{grid-template-columns:minmax(0,1.25fr) minmax(0,.9fr)}
.report-category-row>div:first-child>span{min-width:0;overflow-wrap:anywhere}
.register-modal{max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
.register-totals b{overflow-wrap:anywhere}
.auth-layout{min-height:calc(100vh - 82px);min-height:calc(100dvh - 82px);padding:48px 18px 64px}
.auth-brand{position:static;align-self:center;margin-bottom:24px}
.auth-card{margin-top:0;flex-shrink:0}
.auth-side-note{position:static;margin-top:28px;text-align:center}
.site-header{gap:16px;height:auto;min-height:82px;flex-wrap:wrap;padding-block:16px}
.site-header nav{gap:clamp(10px,2vw,32px);flex-wrap:wrap}
.hero{grid-template-columns:repeat(2,minmax(0,1fr));max-width:1180px}
.hero h1{font-size:clamp(30px,4.2vw,53px)}
.feature-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.plans-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.plan-card>p{height:auto;min-height:32px}
.trust-strip{padding:20px;flex-wrap:wrap;gap:24px}
.trust-strip>div{flex-wrap:wrap;justify-content:center}
footer{height:auto;min-height:82px;gap:16px;flex-wrap:wrap;padding-block:20px}
.floating-theme{right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom))}
@media(min-width:1800px){.workspace{padding-inline:56px}.content-card{padding:24px}.card-heading h2{font-size:16px}td,th{font-size:12px}}
@media(max-width:1200px){.quick-entry-layout,.two-column,.report-chart-grid{grid-template-columns:minmax(0,1fr)}.cash-shortcuts{flex-direction:column;align-items:stretch}.cash-shortcut-actions{grid-template-columns:repeat(3,minmax(0,1fr))}.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hero{gap:24px}.feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:901px) and (max-height:750px){.sidebar{padding-top:16px}.sidebar .brand{margin-bottom:20px}.side-link+.side-label{margin-top:14px}.help-card{display:none}}
@media(max-width:900px){
 .workspace{margin:0;width:100%;max-width:none;padding:24px clamp(12px,3vw,26px) 80px}
 .sidebar{position:sticky;inset:auto;top:0;z-index:10;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;width:100%;height:auto;max-height:100vh;max-height:100dvh;padding:12px 16px;overflow-y:auto;border-right:0;border-bottom:1px solid var(--line);background:var(--paper)}
 .sidebar>.brand{margin:0;font-size:17px;justify-self:start}
 .sidebar>.side-link,.sidebar>.side-label,.sidebar>.side-info,.sidebar>.sidebar-bottom{grid-column:1/-1}
 .sidebar>.side-link{height:auto;min-height:44px;padding:10px 12px;font-size:14px;white-space:normal;margin:0}
 .sidebar>.side-label,.sidebar>.side-info{display:none}
 .sidebar>.sidebar-bottom{display:block;margin-top:8px}
 .sidebar .help-card{display:none}
 .sidebar .user-menu{padding:12px;font-size:13px}
 .sidebar.mobile-menu-ready:not(.menu-open)>.side-link,.sidebar.mobile-menu-ready:not(.menu-open)>.sidebar-bottom{display:none}
 .mobile-menu-ready>.mobile-menu-toggle{display:inline-flex;grid-column:2;grid-row:1;min-height:44px;align-items:center;justify-content:center;gap:8px;padding:8px 14px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font-weight:600;cursor:pointer}
 .mobile-menu-toggle:focus-visible{outline:3px solid var(--purple);outline-offset:2px}
 .hero{grid-template-columns:minmax(0,1fr);padding:48px 22px;min-height:0}
 .hero-copy{max-width:650px}.hero-art{width:100%;max-width:500px;margin-inline:auto}.floating-note{right:0}
 .workspace-header p{max-width:none}.header-actions{display:flex}
 .auth-layout{min-height:calc(100dvh - 82px)}
}
@media(max-width:650px){
 .site-header{min-height:68px;padding:14px 18px}.site-header>.brand{font-size:17px}.site-header nav{gap:8px}.site-header nav .btn{font-size:12px;min-height:40px;white-space:normal}
 .auth-layout{min-height:calc(100vh - 68px);min-height:calc(100dvh - 68px);padding:28px 14px 80px}.auth-card{padding:28px 22px;margin:0}.auth-card h1{font-size:26px}
 .auth-side-note{display:none}.auth-brand{margin-bottom:20px}
 .form-row{grid-template-columns:minmax(0,1fr)}
 .form-stack label,.filters label{font-size:13px}.form-stack input,.form-stack select,.form-stack textarea,.filters input,.filters select,.branch-filter select{font-size:16px;min-height:44px}
 .form-stack input[type=checkbox],.form-stack input[type=radio]{min-height:18px}
 .btn{min-height:44px;white-space:normal;line-height:1.4;padding-block:10px}
 .mini-action{min-height:40px;padding:8px 10px;font-size:12px;display:inline-flex;align-items:center;justify-content:center}
 .workspace-header{align-items:stretch;margin-bottom:20px}.workspace-header>div:first-child{flex-basis:100%}.workspace-header p{font-size:13px}.workspace-header h1{font-size:24px}.header-actions .btn{font-size:13px;min-height:44px}
 .content-card{padding:16px}.card-heading{align-items:flex-start}.card-heading h2{font-size:16px;line-height:1.4}.card-heading p{font-size:12px;line-height:1.5}.card-heading .text-link{font-size:13px}
 .summary-grid{gap:12px}.summary-card{padding:16px}.summary-card>div{font-size:12px}.summary-card>small{font-size:11px;line-height:1.5}.summary-card>strong{font-size:21px}
 .filters{gap:12px}.filters label{flex-basis:calc(50% - 12px)}.filters .btn{min-height:44px;font-size:13px}
 .branch-filter{align-items:stretch}.branch-filter>div,.branch-filter>form{width:100%}.branch-filter select{width:100%;min-width:0;max-width:100%}
 .table-wrap table{min-width:600px}.table-wrap th,.table-wrap td{font-size:12px;padding:12px}.table-wrap .form-stack{min-width:230px}
 .cash-shortcut-actions{grid-template-columns:minmax(0,1fr)}.cash-shortcuts{padding:18px;gap:16px}.cash-shortcut{min-width:0}.cash-shortcut small{font-size:13px}.cash-shortcut b{font-size:15px}
 .register-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.register-totals>div:last-child{grid-column:1/-1}.register-modal{padding:22px 18px}.register-modal h2{font-size:24px}
 .report-category-row>div:first-child{align-items:flex-start}.report-category-row b{font-size:12px;white-space:normal}.report-category-row span{font-size:13px}
 .plans-grid,.feature-grid{grid-template-columns:minmax(0,1fr)}.hero-actions{align-items:flex-start;gap:16px}.hero-copy>p{font-size:15px}.hero h1{font-size:clamp(30px,8vw,42px);letter-spacing:-1px}.hero .eyebrow{line-height:1.6}
 .closing{gap:22px}.section{padding:48px 20px}.section-heading h2{font-size:30px}.trust-strip>div{gap:16px}
 footer{display:flex;flex-direction:column;align-items:flex-start;gap:16px}footer>span{overflow-wrap:anywhere;max-width:100%}
 .report-chart-legend{flex-wrap:wrap}.floating-theme{min-height:44px}
}
@media(max-width:380px){.summary-grid,.register-totals{grid-template-columns:minmax(0,1fr)}.register-totals>div:last-child{grid-column:auto}.filters label{flex-basis:100%}.site-header nav{width:100%}.site-header nav .btn{flex:1}.auth-card{padding:24px 18px}.preview-value{font-size:22px}.preview-value small{display:block;width:max-content;margin-top:6px}.floating-note{position:static;justify-self:end;margin-top:-12px}.hero-art{height:auto;min-height:380px}.orb{max-width:90%}.workspace{padding-inline:12px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important;animation:none!important}}
@media(pointer:coarse){
 .form-stack input,.form-stack select,.form-stack textarea,.filters input,.filters select,.branch-filter select{font-size:16px;min-height:44px}
 .form-stack input[type=checkbox],.form-stack input[type=radio]{min-height:18px}
 .btn,.theme-toggle,.mini-action{min-height:44px}
 .branch-checks label{min-height:44px}
}
/* Place the theme control in normal flow so it never covers form fields. */
.floating-theme{position:static;display:flex;width:max-content;max-width:calc(100% - 36px);margin:16px 18px 20px auto;box-shadow:none}
.sidebar .floating-theme{width:100%;max-width:100%;margin:12px 0}
