:root{--phy-panel-width:390px;--phy-rail-height:56px}
#phy-tools,#phy-panel{font:500 14px/1.5 system-ui,-apple-system,"PingFang SC",sans-serif;color:#18354b;box-sizing:border-box}
#phy-tools{position:fixed;top:max(6px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));z-index:11000;display:flex;align-items:center;gap:5px;margin:0;padding:2px 3px;background:#fff;border:1px solid #cfdee9;border-radius:14px;box-shadow:0 2px 9px #1939500e}
#phy-tools a{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;height:44px;margin:0;border:0;text-decoration:none;font:650 14px/1.2 system-ui,sans-serif;color:#174766;background:transparent;border-radius:10px}
#phy-tools #phy-agent{width:44px;padding:7px}
#phy-tools #phy-space{padding:0 12px;white-space:nowrap}
#phy-tools img{display:block;width:28px;height:28px}
#phy-tools a:hover,#phy-tools a:focus-visible,#phy-tools [aria-expanded=true],#phy-tools [aria-current=page]{background:#e7f3f8}
.phy-tools-rail{height:var(--phy-rail-height);flex:none}
html:has(#phy-tools) .ps-header-inner,html:has(#phy-tools) header.top{padding-right:166px}
#phy-panel[hidden],.phy-docked>header.top,.phy-docked>.skip{display:none!important}
#phy-panel{position:fixed;z-index:10999;inset:var(--phy-rail-height) 0 0 auto;width:var(--phy-panel-width);display:flex;flex-direction:column;gap:0;background:#fff;border:1px solid #cbdbe6;box-shadow:-7px 4px 25px #15364910;text-align:left;margin:0;padding:0;max-width:100%;min-width:0}
#phy-panel *{box-sizing:border-box}
#phy-panel .phy-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid #e4ebef}
#phy-panel .phy-panel-head strong{color:#17394e;font:700 16px/1.45 system-ui,sans-serif}
#phy-panel button,#phy-panel .phy-link{background:white;border:1px solid #cbdde6;border-radius:8px;color:#174d69;cursor:pointer;padding:5px 9px;min-height:32px;font:600 13px/1.4 system-ui,sans-serif;text-decoration:none}
#phy-panel button:hover,#phy-panel .phy-link:hover{background:#eef7fa}
#phy-panel details{margin:0;padding:7px 14px;color:#31566c;background:#f1f7f9}
#phy-panel summary{cursor:pointer;font:600 13px/1.4 system-ui,sans-serif}
#phy-panel details p{white-space:pre-wrap;max-height:14vh;overflow:auto;margin:6px 0}
#phy-panel .phy-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center;padding:6px 12px}
#phy-panel .phy-receipt{margin:0;padding:0 12px;font:500 13px/1.6 system-ui,sans-serif;max-height:16vh;overflow:auto;color:#244b60;white-space:pre-line}
#phy-panel iframe{position:static;display:block;flex:1 1 0%;min-height:0;width:100%;margin:0;border:0;background:white}
#phy-panel [role=separator]{position:absolute;left:-6px;top:0;bottom:0;width:10px;cursor:col-resize;touch-action:none}
#phy-panel [role=separator]:focus-visible{outline:2px solid #3b779f}
.phy-docked .chat-bar{min-height:0;padding:4px 12px;border:0;justify-content:flex-end}
.phy-docked .chat-bar h1{display:none}
.phy-docked .chat-welcome{padding:12px}
.phy-docked .chat-welcome h2{font-size:20px}
.phy-docked .standalone{margin:0}
.phy-docked #chat-log{padding:12px}
.phy-docked .chat-context{color:#497082}
@media(min-width:960px){html.phy-open>body{width:calc(100% - var(--phy-panel-width))!important;max-width:calc(100% - var(--phy-panel-width))!important;margin-right:var(--phy-panel-width)!important;margin-left:0!important;box-sizing:border-box}
html.phy-open .ps-header-inner,html.phy-open header.top{padding-right:15px}
html.phy-open .ps-lab-workspace,html.phy-open .ps-lab-stage{max-width:100%}
}
@media(max-width:959px){#phy-panel{z-index:11002;inset:0 0 0 auto;width:min(100%,480px);height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);box-shadow:-20px 0 65px #19395038}#phy-panel [role=separator]{display:none}
html.phy-open{overflow:hidden}
html:has(#phy-tools) .ps-header-inner{padding-right:14px;display:flex;flex-wrap:wrap}
html:has(#phy-tools) .ps-header-inner>.ps-brand{max-width:calc(100% - 150px);min-height:42px}
html:has(#phy-tools) .ps-header-inner>.ps-nav{width:100%;order:3}
html:has(#phy-tools) header.top{flex-wrap:wrap;min-height:55px;padding-right:158px}
}
@media(max-width:420px){#phy-tools{right:5px}#phy-tools #phy-space{padding:0 7px}.ps-header-inner .ps-brand small{display:none}}

/* The toolbar uses its own height; the experiment takes the rest of the viewport. */
body.ps-lab-viewer {
  display: flex;
  flex-direction: column;
}
body.ps-lab-viewer > #lab-panel {
  flex: 1 1 0;
  min-height: 0;
}
