/* Shared three-region form-modal contract. The root stays fixed; only its body scrolls. */
:root{
 --tz-modal-safe-top:max(0px,env(safe-area-inset-top));
 --tz-modal-safe-bottom:max(0px,env(safe-area-inset-bottom));
 --tz-modal-visible-top:var(--tz-modal-safe-top);
 --tz-modal-visible-height:100dvh;
}
[data-tz-modal-layout]{
 box-sizing:border-box!important;
 position:fixed!important;
 inset:auto 0!important;
 top:var(--tz-modal-visible-top)!important;
 width:100%!important;
 height:var(--tz-modal-visible-height)!important;
 max-height:var(--tz-modal-visible-height)!important;
 align-items:center!important;
 justify-content:center!important;
 overflow:hidden!important;
 padding:8px!important;
 overscroll-behavior:none!important;
}
[data-tz-modal-layout].tz-modal-long{
 align-items:flex-start!important;
}
[data-tz-modal-panel]{
 box-sizing:border-box!important;
 max-height:calc(var(--tz-modal-visible-height) - 16px)!important;
 min-height:0!important;
 overflow:hidden!important;
 display:flex!important;
 flex-direction:column!important;
}
[data-tz-modal-panel][data-tz-modal-legacy-scroll]{
 overflow-y:auto!important;
 overflow-x:hidden!important;
 -webkit-overflow-scrolling:touch!important;
 overscroll-behavior-y:contain!important;
}
[data-tz-modal-panel][data-tz-modal-legacy-scroll] > [data-tz-modal-header]{
 position:sticky!important;
 top:0!important;
 z-index:3!important;
}
[data-tz-modal-panel][data-tz-modal-legacy-scroll] > [data-tz-modal-footer]{
 position:sticky!important;
 bottom:0!important;
 z-index:3!important;
}
[data-tz-modal-header],
[data-tz-modal-footer]{flex:0 0 auto!important}
[data-tz-modal-body]{
 min-height:0!important;
 flex:1 1 auto!important;
 overflow-y:auto!important;
 overflow-x:hidden!important;
 -webkit-overflow-scrolling:touch!important;
 overscroll-behavior-y:contain!important;
 overflow-anchor:none!important;
 touch-action:pan-y!important;
}
/* A vertical drag belongs to the modal body regardless of which ordinary
   content element starts it. Editable controls keep native iOS gesture and
   caret handling; no JavaScript synthesizes scrolling. */
[data-tz-modal-body] :where(div,section,article,p,span,label,strong,small,button){
 touch-action:pan-y!important;
}
[data-tz-modal-body] :where(div,section,article,p,span,label,strong,small,button){
 -webkit-user-select:none;
 user-select:none;
}
[data-tz-modal-body] :where(input,textarea,[contenteditable="true"]){
 -webkit-user-select:text;
 user-select:text;
 touch-action:auto!important;
}
[data-tz-modal-body] [data-tz-modal-footer],
[data-tz-modal-body] > .tz80-rm-actions{
 position:sticky;
 z-index:2;
 bottom:0;
 background:#fff;
 padding-top:8px;
 padding-bottom:max(2px,var(--tz-modal-safe-bottom));
}
html.tz-mobile-keyboard-open [data-tz-modal-layout] [data-tz-modal-panel]{
 height:calc(var(--tz-modal-visible-height) - 16px)!important;
 max-height:calc(var(--tz-modal-visible-height) - 16px)!important;
}
