/* Sandbox uses the same outer MillFlow header and an isolated full-height
   operations viewport. No extra landing dashboard, nested scroll page, or
   secondary demo header. The iframe is same-origin and RLS-protected. */
body:has(.mf-unified-sandbox) .layout{display:block}
body:has(.mf-unified-sandbox) .layout>.sidebar,
body:has(.mf-unified-sandbox) .mobile-nav{display:none!important}
body:has(.mf-unified-sandbox) .layout>.main{width:100%;max-width:none;margin:0;padding-bottom:0}
body:has(.mf-unified-sandbox) .layout>.main>.content{padding:0;max-width:none}
body:has(.mf-unified-sandbox) .mf-safety-note{display:none}
body:has(.mf-unified-sandbox) .topbar{min-height:58px;padding:8px 17px;background:#0c2032;border-bottom:1px solid #2b445b;position:relative;z-index:15}
body:has(.mf-unified-sandbox) .topbar .eyebrow,body:has(.mf-unified-sandbox) .topbar .who{display:none}
body:has(.mf-unified-sandbox) .topbar h1{font-size:18px;letter-spacing:-.035em;margin:0}
body:has(.mf-unified-sandbox) .topbar .right{gap:8px}
.mf-unified-sandbox{width:100%;max-width:none;background:#091929}
.mf-unified-testmill{display:block;border:0;border-radius:0;background:#091929}
.mf-unified-testmill iframe{display:block;width:100%;height:calc(100dvh - 66px)!important;min-height:360px!important;border:0;background:#091929}
.mf-research-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 20px;border-bottom:1px solid #2d4960;background:#0d253b}
.mf-research-toolbar strong{font-size:17px}
@media(max-width:740px){
 html:has(.mf-unified-testmill),body:has(.mf-unified-testmill){overflow:hidden}
 body:has(.mf-unified-sandbox) .topbar{position:sticky;top:0;min-height:56px;padding:8px 12px;gap:7px}
 body:has(.mf-unified-sandbox) .topbar h1{font-size:17px}
 body:has(.mf-unified-sandbox) .topbar .right{margin-left:auto}
 body:has(.mf-unified-sandbox) .topbar .btn{padding:6px 8px;min-height:34px;font-size:11px}
 .mf-unified-testmill iframe{height:calc(100dvh - 60px)!important;min-height:350px!important}
}

/* iOS Safari: size the frame from the actual parent, not a second viewport calculation. */
@media(max-width:740px){
 html:has(.mf-unified-testmill),body:has(.mf-unified-testmill){height:100%;min-height:0;overflow:hidden}
 body:has(.mf-unified-testmill) .layout{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 body:has(.mf-unified-testmill) .layout>.main{height:100%;min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden}
 body:has(.mf-unified-testmill) .layout>.main>.topbar{flex:0 0 auto}
 body:has(.mf-unified-testmill) .layout>.main>.content{height:100%;min-height:0;flex:1;display:flex;flex-direction:column}
 body:has(.mf-unified-testmill) .mf-unified-sandbox{height:100%;min-height:0;flex:1;display:flex;flex-direction:column}
 body:has(.mf-unified-testmill) .mf-unified-testmill{height:100%;min-height:0;flex:1;display:flex;flex-direction:column}
 body:has(.mf-unified-testmill) .mf-unified-testmill iframe{height:100%!important;min-height:0!important;flex:1}
}
