:root { --layer-wizard-actions:35; }
#app,.auth-screen,.form-dialog:not(.document-viewer-dialog):not(.invoice-scanner-dialog) {touch-action:pan-x pan-y;}
:is(button,a,input,select,textarea,label,summary,[role=button]) {touch-action:manipulation;}
.wizard-layout,.invoice-builder-panel>.wizard-layout {display:flex;flex-direction:column;height:var(--wizard-height,calc(100vh - 200px));height:var(--wizard-height,calc(100dvh - 200px));min-height:0;min-width:0;max-width:100%;padding:0!important;overflow:visible;}
.wizard-layout[hidden] {display:none;}
.wizard-layout>.invoice-stepper,.wizard-layout>.avr-steps {flex:none;margin:0;padding:12px 16px;border-bottom:1px solid var(--line);}
.wizard-scroll {flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior-y:contain;scroll-padding-block:16px;padding:16px 20px calc(var(--wizard-action-height,72px) + env(safe-area-inset-bottom,0px) + 16px);}
.wizard-scroll>* {min-width:0;max-width:100%;}
.wizard-scroll .invoice-step {padding:0;}
[data-wizard-action-bar] {flex:none;position:relative;z-index:var(--layer-wizard-actions);}
.wizard-action-bar {display:grid;grid-template-columns:minmax(88px,.8fr) minmax(0,1.2fr);gap:10px;align-items:stretch;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);background:var(--surface,#fff);box-shadow:0 -5px 16px rgb(34 72 125 / 5%);}
.wizard-action-bar:has(>.button:not([hidden]):only-child),.wizard-action-bar:has(>.button[hidden]):not(:has(>.button:not([hidden])~.button:not([hidden]))) {grid-template-columns:minmax(0,1fr);}
.wizard-action-bar>.button {width:100%;min-width:0;min-height:48px;margin:0;padding:10px;font-size:14px;line-height:1.3;display:flex;align-items:center;justify-content:center;white-space:nowrap;}
.wizard-action-bar>.button[hidden] {display:none;}
.wizard-action-bar>.button[aria-busy=true]::before {content:'';flex:none;width:14px;height:14px;margin-right:6px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:wizard-busy 800ms linear infinite;}
.wizard-action-bar>.button[aria-busy=true] {cursor:wait;}
.wizard-field-error {margin:6px 0 0;color:var(--danger);font-size:14px;line-height:1.4;}
body.wizard-active {overflow:hidden;}
body.wizard-active .topbar {display:none;}
body.wizard-active .page-content {padding-bottom:0;}
body.wizard-active .invoice-builder-panel {padding:0;}
body.wizard-active .invoice-page-heading {display:flex;}
body.wizard-active .invoice-page-heading>div {display:block;}
body.wizard-active .invoice-page-heading,body.wizard-active [data-screen=create-avr]>.section-heading {margin-bottom:12px;}
body.wizard-active .section-heading p {display:none;}
body.wizard-active .toast-region {top:calc(8px + env(safe-area-inset-top,0px));bottom:auto;pointer-events:none;}
body.wizard-active .toast-region .toast {pointer-events:auto;}
@keyframes wizard-busy {to{transform:rotate(360deg);}}
@media(prefers-reduced-motion:no-preference) {
 .wizard-action-bar>.button {transition:opacity 160ms var(--motion-ease),background-color 160ms var(--motion-ease);}
}
@media(prefers-reduced-motion:reduce) {.wizard-action-bar>.button[aria-busy=true]::before{animation:none;}}
@media(max-width:700px) {
 body.wizard-active .page-content {padding:10px 12px 0;}
 body.wizard-active .section-heading {margin-bottom:8px;}
 .wizard-scroll {padding:12px 12px calc(var(--wizard-action-height,72px) + env(safe-area-inset-bottom,0px) + 12px);}
 .wizard-layout>.invoice-stepper,.wizard-layout>.avr-steps {padding:8px 10px;}
 .wizard-layout>.avr-steps {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));}
 .wizard-layout>.avr-steps>span {font-size:11px;padding:7px 3px;}
 .wizard-action-bar {gap:8px;padding-inline:12px;}
 body.wizard-keyboard-open .mobile-brand,body.wizard-keyboard-open .workspace-toolbar,body.wizard-keyboard-open .app-shell>.sidebar {display:none!important;}
 .wizard-scroll :is(.invoice-builder-grid,.invoice-quick-add) {padding:12px 0;}
}
@media(max-width:1024px),(pointer:coarse) {
 :is(input:not([type=checkbox]):not([type=radio]),select,textarea,.ui-select-trigger) {font-size:max(16px,1rem)!important;min-width:0;max-width:100%;}
}
