/* Navigation occupies a reserved lane. Decorative borders cannot cross its controls. */
.zf-shell{--zf-header-height:76px;--zf-frame-top:86px;--zf-frame-bottom:30px}
.zf-shell::before{top:var(--zf-frame-top);bottom:var(--zf-frame-bottom)}
.zf-top{height:var(--zf-header-height);min-height:var(--zf-header-height);align-items:start;margin:0}
.zf-top .zf-back,.zf-top .salon-fullscreen{align-self:start;margin-top:4px}
.zf-top .salon-mark{height:96px;transform:none;align-self:start}
.zf-card{padding-top:22px}
.zf-portrait-stage{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;gap:34px;width:100%;min-width:0;flex:none}
.zf-portrait{height:clamp(120px,33dvh,340px);max-width:none;margin:40px 0 0}
.zf-constellation{display:block;position:absolute;z-index:0;left:58%;top:-8%;transform:translateX(-38%);width:100%;max-width:480px;height:110%;object-fit:contain;pointer-events:none;opacity:.46;filter:drop-shadow(0 0 4px #e8b45d25);animation:constellation-breathe 11s ease-in-out infinite}
.zf-portrait{z-index:1}
.zf-person:not(:has(.zf-constellation)) .zf-portrait{margin-inline:auto}
html[data-brand=clean] .zf-constellation{filter:sepia(.4) brightness(.64);opacity:.38}
@keyframes constellation-breathe{0%,30%,100%{opacity:.38}60%{opacity:.56}}
/* Maintain a 12px minimum gap even when focus rings surround a control. */
html.game-mode-open .app.game-mode{padding-top:calc(80px + env(safe-area-inset-top))!important}
html.game-mode-open #gameScreen{position:relative}
#gameScreen>.game-navigation{position:absolute;left:0;top:-62px;height:44px;z-index:5;display:flex;align-items:center}
html[data-brand] #gameScreen>.game-navigation #restartBtn{position:static!important;display:flex!important;align-items:center;gap:7px;width:auto!important;height:44px!important;min-height:44px!important;padding:4px 10px!important;border:0!important;border-radius:10px!important;background:#240c1499!important;color:#ffe7c0!important;font:500 20px 'Cormorant Garamond',Georgia,serif!important;box-shadow:none!important}
#gameScreen>.game-navigation #restartBtn>span:first-child{font-size:32px;line-height:1}
html[data-brand=clean] #gameScreen>.game-navigation #restartBtn{background:#fff4e5bf!important;color:#563426!important}
body.game-mode-open .scene-control-cluster{top:calc(8px + env(safe-area-inset-top))!important;max-height:52px;box-sizing:border-box}
html[data-brand] .app.results-mode:has(.atelier-results.active){padding-top:calc(76px + env(safe-area-inset-top))!important}
/* Room headers already belong to normal flow; leave enough space below a wrapped row. */
.atelier-room .room-heading{height:auto!important;flex:none;min-height:56px!important;padding-bottom:8px!important}
.atelier-room .room-play-grid{margin-top:8px!important}
.salon-dossier-top{padding-bottom:8px}
/* A modal has its own close/fullscreen controls; the background toolbar stays out of it. */
body:has(.modal.open) .scene-control-cluster{visibility:hidden!important;pointer-events:none!important}
@media(max-width:650px){
 .zf-shell{--zf-header-height:64px;--zf-frame-top:76px;--zf-frame-bottom:24px}
 .zf-top{height:var(--zf-header-height);min-height:var(--zf-header-height)}
 .zf-top .salon-mark{height:83px}
 .zf-top .zf-back{font-size:18px}
 .zf-card{padding-top:20px}
 .zf-portrait-stage{gap:30px}
 .zf-portrait{height:clamp(90px,16dvh,160px);margin-top:25px}
 .zf-constellation{width:100%;max-width:340px}
 .zf-name{margin-top:25px!important}
}
@media(max-width:650px) and (max-height:740px){.zf-portrait{height:12dvh;margin-top:22px}.zf-constellation{width:100%}.zf-name{margin-top:19px!important}}
@media(max-width:650px) and (max-height:700px){
 .zf-shell{--zf-header-height:44px;--zf-frame-top:56px;--zf-frame-bottom:7px}
 .zf-top .salon-mark{height:61px}.zf-top .zf-back{font-size:16px}
 .zf-top .zf-back,.zf-top .salon-fullscreen{margin-top:0}
 .zf-top .salon-fullscreen{height:36px!important;min-height:36px!important;width:36px!important;min-width:36px!important;padding:6px!important}
 .zf-card{padding-top:17px}
 .zf-portrait-stage{display:flex;grid-column:1;grid-row:1/3;width:90px;height:90px;justify-self:center}
 .zf-person:has(.zf-constellation){grid-template-columns:82px minmax(0,1fr);column-gap:18px}
 .zf-person .zf-portrait{height:66px;margin:16px 0 7px;grid-column:1;grid-row:1/3}
 .zf-person .zf-name{grid-column:2;grid-row:1;margin:0!important}
 .zf-person .zf-sign{grid-column:2;grid-row:2}
 .zf-person .zf-constellation{width:145px;max-width:none;height:100px;top:0;left:50%;transform:translateX(-50%)}
 .zf-verdict{gap:2px}
}
@media(min-width:651px) and (max-height:550px){
 .zf-shell{--zf-header-height:43px;--zf-frame-top:55px;--zf-frame-bottom:20px}
 .zf-top .salon-mark{height:63px}.zf-top .zf-back,.zf-top .salon-fullscreen{margin-top:0}
 .zf-top .salon-fullscreen{height:36px!important;min-height:36px!important;width:36px!important;min-width:36px!important;padding:6px!important}
 .zf-card{padding-top:16px}.zf-portrait{height:26dvh;margin-top:20px}.zf-portrait-stage{gap:22px}.zf-constellation{width:100%}
 .zf-verdict{gap:0}.zf-title-wrap{margin-block:0;padding-block:2px}.zf-footer{padding-block:4px}
}
@media(max-height:550px){
 html.game-mode-open .app.game-mode{padding-top:calc(64px + env(safe-area-inset-top))!important}
 #gameScreen>.game-navigation{top:-54px}
 body.game-mode-open .scene-control-cluster{max-height:44px;padding-block:0!important}
}
@media(prefers-reduced-motion:reduce){.zf-constellation{animation:none;opacity:.48}}
