/* Shared status-area geometry for iPhone browser and installed web-app views. */
:root{--site-safe-top:env(safe-area-inset-top,0px);--site-safe-left:env(safe-area-inset-left,0px);--site-safe-right:env(safe-area-inset-right,0px);--site-safe-bottom:env(safe-area-inset-bottom,0px)}
body{--site-status-background:var(--surface-page,#f5f3ef)}
body:not([data-screen=workspace]):not([data-screen=landing]){padding-top:var(--site-safe-top);padding-left:var(--site-safe-left);padding-right:var(--site-safe-right)}
body:not([data-screen=workspace]):not([data-screen=landing]):not(.public-profile-page):not(.proposal-public-page):not(.component-gallery){--site-status-background:#f8f6f0}
body[data-screen=landing]{--site-status-background:#f8f6f0}
body.public-profile-page{--site-status-background:#f5f3ef}
body.policy-page{--site-status-background:#f8f6f0}
html[data-theme=dark] body.public-profile-page{--site-status-background:#1b2531}
body[data-screen=landing] #account-landing.sales-page{padding-top:var(--site-safe-top);padding-left:var(--site-safe-left);padding-right:var(--site-safe-right)}
body:not([data-screen=workspace])::before{content:"";position:fixed;inset:0 0 auto;height:var(--site-safe-top);background:var(--site-status-background);z-index:100;pointer-events:none}
@media(min-width:681px){
 body[data-screen=workspace]>aside{padding-top:calc(36px + var(--site-safe-top));padding-left:calc(24px + var(--site-safe-left));width:calc(236px + var(--site-safe-left))}
 body[data-screen=workspace]>main{margin-left:calc(236px + var(--site-safe-left))}
}
@media(max-width:680px){
 /* Keep iPhone pull-down chrome continuous with the stationary app header.
    Allow native pull-down while the exposed canvas stays navy in both themes. */
 html:has(body[data-screen=workspace]){background:#17212d!important;overscroll-behavior-y:auto}
 body[data-screen=workspace]{--site-status-background:#17212d;background:#17212d!important;overscroll-behavior-y:auto}
 html body[data-screen=workspace]>main{background:var(--surface-page);min-height:100dvh;padding-top:calc(var(--workspace-header-height,64px) + 10px)}
 body[data-screen=workspace][data-view=profile] .profile-editor-toolbar{bottom:calc(76px + var(--site-safe-bottom))}
 body[data-screen=workspace]::before{height:var(--site-safe-top);background:#17212d}
 body[data-screen=workspace]>aside{position:fixed;top:0;left:0;right:0;width:100%;z-index:35;padding-top:calc(var(--site-safe-top) + 10px);padding-left:max(9px,var(--site-safe-left));padding-right:max(9px,var(--site-safe-right))}
 body[data-screen=workspace]>aside{justify-content:space-between;gap:8px}
 body[data-screen=workspace]>aside>.brand{flex:0 1 132px;width:132px;max-width:38vw}
 body[data-screen=workspace]>aside .app-brand-logo{width:132px;max-width:100%}
 body[data-screen=workspace] #mobile-account-menu[open]{top:calc(var(--site-safe-top) + 10px);max-height:calc(100dvh - var(--site-safe-top) - var(--site-safe-bottom) - 100px);overflow-y:auto}
 body[data-screen=workspace] #nav{grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:5px max(6px,var(--site-safe-right)) calc(5px + var(--site-safe-bottom)) max(6px,var(--site-safe-left))}
 body[data-screen=workspace] #nav>button,body[data-screen=workspace] #nav>.secondary-navigation>.more-toggle{height:44px;min-height:44px;padding:6px 2px;border-radius:8px;background:transparent;gap:0;font-size:13px;line-height:1.2}
 body[data-screen=workspace] #nav>button .nav-label{margin:0;font-size:13px;line-height:1.2}
 body[data-screen=workspace] #nav>.secondary-navigation>.more-toggle::before{display:none}
 body[data-screen=workspace] #nav>.secondary-navigation[data-open=true]>.more-toggle{background:#283747;color:#fff!important}
 #account-landing .sales-hero-screen>a{display:block}
 #account-landing .sales-hero-screen figcaption{display:block}
}
/* Short landscape phones need the same bounded fields as portrait phones.
   Keep navigation breakpoints separate from form geometry. */
@media(max-width:680px), (max-width:1024px) and (max-height:600px) and (orientation:landscape){
 dialog{max-height:calc(100dvh - var(--site-safe-top) - var(--site-safe-bottom) - 32px);margin-top:calc(var(--site-safe-top) + 16px);margin-bottom:calc(var(--site-safe-bottom) + 16px)}
 #modal{background:var(--surface-card);color:var(--text-primary)}
 #modal:has(.ux-form-dialog){height:auto;max-height:calc(100dvh - var(--site-safe-top) - var(--site-safe-bottom) - 24px)}
 #modal.mobile-form-viewport:has(.ux-form-dialog){top:calc(var(--form-visible-top) + var(--site-safe-top) + 12px);height:auto;max-height:calc(var(--form-visible-height) - var(--site-safe-top) - var(--site-safe-bottom) - 24px)}
 #modal .ux-form-dialog{height:auto;max-height:inherit}
 #modal .ux-dialog-form,#modal .ux-form-scroll{flex:0 1 auto}
 #modal .field,#modal .form-grid>*{min-width:0}
 #modal .field :is(input,select,textarea){min-width:0;max-width:100%;width:100%;box-sizing:border-box}
 #modal .ux-form-dialog,#modal .ux-dialog-form,#modal .ux-form-scroll{min-width:0;width:100%;max-width:100%;box-sizing:border-box}
 #modal .ux-form-scroll{overflow-x:hidden;overscroll-behavior-x:none}
 #modal .form-grid{grid-template-columns:minmax(0,1fr);width:100%;min-width:0;max-width:100%}
 #modal .field{width:100%;max-width:100%;box-sizing:border-box}
 #modal .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){height:48px;min-height:48px;padding:10px 12px;font-size:16px;line-height:1.5}
 #modal .field :is(input[type=date],input[type=time]){appearance:none;-webkit-appearance:none;min-inline-size:0;inline-size:100%}
 #modal .field :is(input[type=date],input[type=time])::-webkit-date-and-time-value{text-align:left;min-height:24px}
 #modal{position:fixed;top:calc(var(--site-safe-top) + 12px);left:calc(var(--site-safe-left) + 12px);right:calc(var(--site-safe-right) + 12px);margin:0 auto;width:min(720px,calc(100vw - var(--site-safe-left) - var(--site-safe-right) - 24px));max-width:calc(100vw - var(--site-safe-left) - var(--site-safe-right) - 24px);scroll-padding-top:80px}
 #modal:not(:has(.ux-form-dialog)){padding:16px;overflow-y:auto}
 #modal:not(:has(.ux-form-dialog)) .modalhead{position:sticky;top:-16px;z-index:4;background:var(--surface-card);margin:-16px -16px 16px;padding:16px}
 #modal .modalhead{min-width:0;align-items:flex-start}
 #modal .modalhead h2{min-width:0;overflow-wrap:anywhere}
 #modal button{min-width:0;max-width:100%;white-space:normal;word-break:normal;overflow-wrap:normal;line-height:1.35}
 #modal .close{flex:0 0 44px;min-width:44px;min-height:44px}
 #modal .form-actions{display:flex;flex-wrap:wrap;gap:8px}
 #modal .form-actions>button{flex:1 1 130px;padding:10px 12px}
 #modal .venue-detail-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #modal .venue-detail-actions>button{width:100%;min-height:44px;padding:10px 8px;font-size:14px}
 #modal .ux-form-dialog{padding:12px 14px 0}
 #modal .ux-dialog-form>.form-actions{margin:0 -14px;padding:10px 14px}
 #modal.mobile-form-viewport .ux-form-scroll{overscroll-behavior-y:contain}
 #modal.mobile-form-viewport[data-mobile-compact=true] .ux-form-dialog>.modalhead{margin-bottom:6px}
 #modal.mobile-form-viewport[data-mobile-compact=true] .ux-form-dialog>p{flex:none;margin:0 0 6px;font-size:13px;line-height:1.35}
 #modal.mobile-form-viewport[data-mobile-compact=true] .ux-form-dialog>:is(.privacy,.booking-form-intro){display:none}
 #modal.mobile-form-viewport[data-mobile-compact=true] .ux-dialog-form>.form-actions{padding-block:8px}
 #modal fieldset{min-inline-size:0;max-width:100%;box-sizing:border-box}
 body[data-view=profile] :is(.public-editor-layout,.public-editor-panel,.profile-field,.field,.form-grid){min-width:0;max-width:100%;box-sizing:border-box}
 body[data-view=profile] .public-editor-layout{display:block}
 body[data-view=profile] .public-editor-panel .form-grid{grid-template-columns:minmax(0,1fr)}
 #public-profile-form .field :is(input,select,textarea){width:100%;min-width:0;max-width:100%;box-sizing:border-box;font-size:16px}
 #public-profile-form .field :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){height:48px;min-height:48px;padding:10px 12px;line-height:1.5}
 #public-profile-form button{max-width:100%;white-space:normal;word-break:normal;overflow-wrap:normal}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar{top:auto;bottom:calc(100% - var(--profile-visible-bottom) + 8px);padding:8px 12px;gap:0;z-index:36}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar>p:not([data-error=true]){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar>div{width:100%;flex-basis:100%}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar button{width:100%;min-height:44px}
}
@media(min-width:681px) and (max-width:1024px) and (max-height:600px) and (orientation:landscape){
 body[data-screen=workspace]>main{padding-right:calc(20px + var(--site-safe-right))}
 body[data-screen=workspace][data-view=profile] #content{padding-bottom:130px}
 body[data-screen=workspace][data-view=profile] .profile-editor-toolbar{left:calc(248px + var(--site-safe-left));right:calc(12px + var(--site-safe-right));bottom:calc(12px + var(--site-safe-bottom));padding:10px 12px;gap:8px}
 body[data-screen=workspace][data-view=profile] .profile-editor-toolbar>p{font-size:12px}
 body[data-screen=workspace][data-view=profile] .profile-editor-toolbar button{padding:10px 12px;white-space:normal}
 body[data-screen=workspace][data-view=profile].profile-keyboard-open .profile-editor-toolbar{bottom:calc(100% - var(--profile-visible-bottom) + 8px)}
}

/* Give every shared dialog and copied venue-pane close control a clear target. */
html :is(#modal,.venue-detail-pane) .modalhead>.close{
 display:inline-grid;place-items:center;flex:0 0 48px;
 width:48px;height:48px;min-width:48px;min-height:48px;max-width:48px;
 padding:0;box-sizing:border-box;border:1px solid var(--input-border);border-radius:12px;
 background:var(--surface-subtle);color:var(--text-primary);
 font:600 32px/1 system-ui,sans-serif;opacity:1;
}
html :is(#modal,.venue-detail-pane) .modalhead>.close:hover{background:var(--surface-card);border-color:var(--text-primary);color:var(--text-primary)}
html :is(#modal,.venue-detail-pane) .modalhead>.close:focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
