/* v461: full-area workspaces. Keep existing DOM, save/cancel handlers and native
   dialog focus management. data-compact-dialog opts out for authorization. */
@media screen {
  html:root body .modal-overlay:not([data-compact-dialog]) {
    padding:0!important;
    background:var(--paper,#fff)!important;
    align-items:stretch!important;
    justify-content:stretch!important;
    overflow:hidden;
  }
  html:root body .modal-overlay:not([data-compact-dialog]) > :first-child,
  html:root body dialog:not([data-compact-dialog]) {
    box-sizing:border-box!important;
    position:fixed!important;
    inset:0!important;
    margin:0!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:100vh!important;
    height:100dvh!important;
    max-height:none!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    padding:clamp(16px,2.5vw,36px)!important;
    padding-bottom:max(24px,env(safe-area-inset-bottom))!important;
    overflow:auto!important;
    overscroll-behavior:contain;
    background:var(--paper,#fff);
    color:var(--ink,#192744);
    scroll-padding-block:80px;
  }
  html:root body dialog:not([data-compact-dialog])::backdrop {background:var(--paper,#fff)}
  /* Existing sticky actions remain usable without negative modal padding offsets. */
  html:root body .modal-overlay:not([data-compact-dialog]) .modal-actions {
    bottom:0!important;
    padding:12px 0!important;
    flex-wrap:wrap;
    z-index:2;
    border-top:1px solid var(--line,#e5e1d7);
  }
  html:root body :is(.modal-overlay,dialog):not([data-compact-dialog]) :is(.quality-dialog-head,.fm-dialog-head,.call-modal-head) {
    position:sticky;top:0;z-index:3;background:var(--paper,#fff);padding-block:8px;
  }
  /* Billing already has a flex body with its own scrolling and persistent footer. */
  html:root body #tfBillingModal > :first-child {padding:0!important;overflow:hidden!important}
  #tfbBody {flex:1;min-height:0}
  :is(.modal-overlay,dialog):not([data-compact-dialog]) :is(input,select,textarea,fieldset) {box-sizing:border-box;max-width:100%;min-width:0}
  :is(.modal-overlay,dialog):not([data-compact-dialog]) :is(.table-wrap,.app-table-scroll,.fm-table,.vd-table-wrap) {max-width:100%;overflow-x:auto}
  @media(max-width:720px) {
    html:root body .modal-overlay:not([data-compact-dialog]) .field-row {grid-template-columns:minmax(0,1fr)}
    :is(.modal-overlay,dialog):not([data-compact-dialog]) .modal-actions .btn {flex:1 1 130px;min-height:44px;white-space:normal}
  }
}
/* v469: reserve the standard sidebar for every subpage. */
@media screen{
 html:root body .modal-overlay:not([data-compact-dialog]){left:var(--workspace-sidebar,280px)!important;right:0!important;width:auto!important;z-index:110!important}
 html:root body .modal-overlay:not([data-compact-dialog]) > :first-child,html:root body dialog:not([data-compact-dialog]){left:var(--workspace-sidebar,280px)!important;right:0!important;width:auto!important;z-index:110!important}
 body.workspace-form-open .sidebar{z-index:120!important}body.workspace-form-open .mobile-nav-toggle{z-index:150!important}
 .workspace-back{display:block!important;margin:0 0 18px;padding:10px 16px;border:1px solid #d5d0c5;border-radius:8px;background:white;color:#192744;font-weight:600;cursor:pointer;min-height:44px}
 @media(max-width:720px){html:root body .modal-overlay:not([data-compact-dialog]),html:root body .modal-overlay:not([data-compact-dialog]) > :first-child,html:root body dialog:not([data-compact-dialog]){left:0!important}html:root body .modal-overlay:not([data-compact-dialog]) > :first-child,html:root body dialog:not([data-compact-dialog]){padding-top:70px!important}body.workspace-form-open .sidebar-backdrop{z-index:119!important}}
}
