body.portal-workspace-private{--ws-paper:var(--ssp-surface,#fff);--ws-ink:var(--ssp-ink,#29253b);--ws-muted:var(--ssp-ink-soft,#666174);--ws-line:var(--ssp-border,#d9d4e7);--ws-accent:var(--ssp-accent,#3e2e8c);--ws-soft:var(--ssp-accent-soft,#ebe5ff);--ws-rail-offset:0px}
body.portal-workspace-private [hidden]{display:none!important}
body.portal-workspace-private .portal-workspace-navhost{position:sticky;top:0;z-index:85;display:flex;align-items:center;min-height:48px;padding:4px 16px;background:var(--ws-paper);color:var(--ws-ink);border-bottom:1px solid var(--ws-line)}
body.portal-workspace-private #portalWorkspaceNav,.ws-host .ws-button,.ws-host summary{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:7px 12px;border:1px solid var(--ws-line);border-radius:7px;background:var(--ws-paper);color:var(--ws-ink);font:inherit;font-size:14px;line-height:1.4;text-decoration:none;cursor:pointer;white-space:normal}
body.portal-workspace-private #portalWorkspaceNav:focus-visible,.ws-host .ws-button:focus-visible,.ws-host summary:focus-visible,.ws-image-entry>summary:focus-visible{outline:3px solid #9681ed;outline-offset:2px}
body.portal-workspace-private #portalWorkspaceNav svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:2}
body.portal-workspace-private #portalWorkspaceNav .portal-menu-cross,body.portal-workspace-private #portalWorkspaceNav[aria-expanded=true] .portal-menu-lines{display:none}
body.portal-workspace-private #portalWorkspaceNav[aria-expanded=true] .portal-menu-cross{display:inline}
body.portal-workspace-private #portalWorkspaceNav[aria-expanded=true]{background:var(--ws-soft);color:var(--ws-accent);border-color:var(--ws-accent)}
body.portal-workspace-private .rail-nav{display:none;overflow:auto;max-width:calc(100vw - 32px)}
body.portal-workspace-private.ws-nav-open .rail-nav{display:flex;flex-direction:column;position:fixed;inset:48px auto calc(var(--ssp-tab-bar-h,64px) + 4px) 0;width:var(--ssp-rail-w,232px);z-index:80;background:var(--ws-paper);border-right:1px solid var(--ws-line);padding:16px;box-sizing:border-box}
@media(max-width:1023px){
body.portal-workspace-private .rail-nav > .brand{visibility:hidden}
body.portal-workspace-private .rail-nav .rail-list{display:flex;flex-direction:column;gap:4px}
body.portal-workspace-private .rail-nav .rail-link{display:flex;align-items:center;gap:12px;min-height:48px;padding:8px 12px;border-radius:var(--ssp-radius-md);text-decoration:none;color:var(--ssp-ink-soft);font-weight:700;font-size:14px;border-left:3px solid transparent}
body.portal-workspace-private .rail-nav .rail-link svg{width:22px;height:22px;flex:none}
body.portal-workspace-private .rail-nav .rail-link:hover{background:var(--ssp-accent-soft);color:var(--ssp-accent)}
body.portal-workspace-private .rail-nav .rail-link[aria-current="page"]{background:var(--ssp-accent-soft);color:var(--ssp-accent);border-left-color:var(--ssp-accent)}
body.portal-workspace-private .rail-nav .rail-spacer{flex:1 1 auto}
}
body.portal-workspace-private .main-col{margin-left:var(--ws-rail-offset);min-width:0}
body.portal-workspace-private .image-confirm{left:calc(var(--ws-rail-offset) + 12px);right:12px;max-width:min(560px,calc(100vw - var(--ws-rail-offset) - 24px));box-sizing:border-box}
body.portal-workspace-psd main#main.content{max-width:none;min-width:0;padding:12px 16px 24px}
body.portal-workspace-psd main#main.content>.page-title{font-size:1.1rem;margin:0 0 10px}
body.portal-workspace-psd .ws-shell{max-width:none;min-width:0;color:var(--ws-ink)}
body.portal-workspace-psd .ws-host{position:sticky;top:48px;z-index:75;display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px 0;background:var(--ws-paper)}
.ws-host .ws-tabs{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.ws-host [aria-selected=true],.ws-host [aria-pressed=true]{background:var(--ws-soft);border-color:var(--ws-accent);color:var(--ws-accent)}
.ws-host .ws-unread:after{content:'●';font-size:10px;color:var(--ws-accent)}
.ws-host .ws-menu{position:relative}
.ws-host summary{list-style:none}
.ws-host summary::-webkit-details-marker{display:none}
.ws-host summary:after{content:'▾';font-size:11px}
.ws-host .ws-menu-list{position:absolute;top:calc(100% + 4px);left:0;z-index:2;display:grid;gap:5px;min-width:190px;max-height:min(420px,calc(100dvh - 130px));overflow:auto;padding:8px;background:var(--ws-paper);border:1px solid var(--ws-line);border-radius:8px;box-shadow:0 8px 30px #29253b22}
.ws-host .ws-menu-list .ws-button{justify-content:flex-start}
.ws-host .ws-menu-list [aria-pressed=true]:before{content:'✓'}
body.portal-workspace-psd #psdEditor.ws-editor{max-width:none;min-width:0;margin:0}
body.portal-workspace-psd #psdEditor>.psd-toolbar{margin:4px 0}
body.portal-workspace-psd #psdStatus{padding:4px 0;margin:4px 0}
body.portal-workspace-psd #psdEditor .ws-body{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:start;min-width:0}
body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers{grid-template-columns:220px minmax(0,1fr)}
body.portal-workspace-psd #psdEditor .ws-body.ws-with-right{grid-template-columns:minmax(0,1fr) 300px}
body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers.ws-with-right{grid-template-columns:220px minmax(0,1fr) 300px}
body.portal-workspace-psd #psdEditor #psdWorkspace.psd-layout{display:block;min-width:0}
body.portal-workspace-psd #psdEditor .ws-dock{min-width:0;max-height:calc(100dvh - 205px);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 8px 12px;background:var(--ws-paper)}
body.portal-workspace-psd #psdEditor .ws-dock h2{margin:6px 0 12px}
body.portal-workspace-psd #psdEditor .ws-dock .psd-section{padding:6px 0;margin:0}
body.portal-workspace-psd #psdEditor .psd-layers,body.portal-workspace-psd #psdEditor .psd-properties{width:auto;min-width:0;grid-column:auto}
body.portal-workspace-psd #psdEditor .psd-properties>div{grid-template-columns:minmax(0,1fr)}
body.portal-workspace-psd #psdEditor .psd-properties>div>label,body.portal-workspace-psd #psdEditor .psd-properties>div>.psd-adjust,body.portal-workspace-psd #psdEditor .psd-properties>div>.psd-structure{grid-column:auto}
body.portal-workspace-psd #psdEditor .psd-tree{max-height:none;overflow:visible}
body.portal-workspace-psd #psdEditor .psd-preview-panel{max-height:calc(100dvh - 205px);overflow:auto;min-width:0;padding:2px 3px 12px;overscroll-behavior:contain}
body.portal-workspace-psd #psdEditor #psdViewport{height:clamp(200px,calc(100dvh - 310px),680px);min-width:0;max-width:100%}
body.portal-workspace-psd #psdEditor .psd-tools{grid-template-columns:repeat(6,minmax(0,56px));max-width:100%}
body.portal-workspace-psd #psdEditor .ws-panel>.psd-section .psd-variant-list{grid-template-columns:minmax(0,1fr)}
body.portal-workspace-psd #psdEditor #psdWarnings{position:relative;width:fit-content;max-width:100%;padding:6px 10px;margin:6px 0}
body.portal-workspace-psd #psdEditor #psdWarnings[open]{z-index:72}
body.portal-workspace-psd #psdEditor #psdWarnings[open]>.ws-warning-body{position:absolute;top:100%;left:0;width:min(560px,calc(100vw - 48px));box-sizing:border-box;max-height:min(40dvh,320px);overflow:auto;overscroll-behavior:contain;margin:0;padding:12px 18px;background:#fff5de;border:1px solid #e6ca89;border-radius:8px;box-shadow:0 8px 24px #29253b22}
body.portal-workspace-psd #psdEditor .ws-warning-body>ul{margin:0;padding-left:20px}
body.portal-workspace-psd #psdEditor .ws-warning-body>p{margin:10px 0 0;font-size:.85rem}
body.portal-workspace-images #portalMediaRoot .ws-image-entries{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 14px}
body.portal-workspace-images #portalMediaRoot .ws-image-entries>.upload-row{display:contents}
body.portal-workspace-images #portalMediaRoot .ws-image-entry-section{padding:0;margin:0;border:0;background:none;box-shadow:none;min-width:0}
body.portal-workspace-images #portalMediaRoot .ws-image-entries>.ws-image-entry-section{flex:0 0 100%}
body.portal-workspace-images #portalMediaRoot .ws-image-entry>summary{min-height:44px;box-sizing:border-box;padding:10px 8px;cursor:pointer;font-weight:700;color:var(--ws-accent)}
body.portal-workspace-images #portalMediaRoot .ws-image-entry-body{padding:8px;min-width:0}
body.portal-workspace-images #portalMediaRoot .ws-image-entry-body>h2{display:none}
body.portal-workspace-images #portalMediaRoot .ws-image-entry-body .upload-row{flex-wrap:wrap}
body.portal-workspace-images #portalMediaRoot .ws-image-entry-body input{max-width:100%;box-sizing:border-box}
body.portal-workspace-images #portalImageSelectMode[aria-pressed=true]{background:var(--ws-accent);border-color:var(--ws-accent);color:#fff}
body.portal-workspace-images #portalImageSelectMode[aria-pressed=true]:before{content:'✓';margin-right:6px}
body.portal-workspace-images #portalMediaGrid .image-card.is-selected .image-preview{outline:3px solid var(--ws-accent);outline-offset:-3px}
body.portal-workspace-images #portalMediaGrid .image-card.is-selected .image-card__select{outline:2px solid var(--ws-accent);outline-offset:2px}
@media(min-width:1024px){body.portal-workspace-private.ws-nav-open{--ws-rail-offset:var(--ssp-rail-w,232px)}body.portal-workspace-private.ws-nav-open .rail-nav{inset:0 auto 0 0;max-width:none}body.portal-workspace-private .image-confirm{left:calc(var(--ws-rail-offset) + 24px);right:24px;max-width:min(560px,calc(100vw - var(--ws-rail-offset) - 48px))}}
@media(max-width:999px){body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers,body.portal-workspace-psd #psdEditor .ws-body.ws-with-right,body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers.ws-with-right{grid-template-columns:minmax(0,1fr)}body.portal-workspace-psd #psdEditor .ws-dock{position:fixed;z-index:73;left:16px;right:16px;bottom:calc(var(--ssp-tab-bar-h,64px) + 8px + env(safe-area-inset-bottom,0px));max-height:min(55dvh,max(80px,calc(100dvh - 230px)));padding:12px;border:1px solid var(--ws-line);border-radius:12px;box-shadow:0 -6px 24px #29253b33}body.portal-workspace-psd #psdEditor .psd-preview-panel{max-height:none;overflow:visible}body.portal-workspace-psd #psdEditor #psdViewport{height:clamp(200px,calc(100dvh - 310px),540px)}}
@media(max-width:650px){body.portal-workspace-private .portal-workspace-navhost{padding-inline:16px}body.portal-workspace-psd main#main.content{padding-inline:16px}body.portal-workspace-psd .ws-host{gap:4px}body.portal-workspace-psd .ws-host .ws-button,body.portal-workspace-psd .ws-host summary{padding-inline:9px}body.portal-workspace-psd #psdEditor .psd-tools{grid-template-columns:repeat(6,minmax(0,1fr))}body.portal-workspace-psd #psdEditor .psd-stage{padding:22px}}
@media(max-width:300px){body.portal-workspace-psd .ws-host .ws-tabs{flex-basis:100%}body.portal-workspace-psd #psdEditor .psd-tools{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* 上部は共通操作1段、左端は道具、画像と枠の状態は製品側が保持する。 */
body.portal-workspace-psd .portal-workspace-navhost{display:none}
body.portal-workspace-psd main#main.content{padding:0 16px 16px;overflow-x:clip}
body.portal-workspace-psd main#main.content>.page-title{display:none}
body.portal-workspace-psd .ws-shell{position:relative;max-width:100%;width:100%;box-sizing:border-box}
body.portal-workspace-psd #psdEditor.ws-editor{position:static;width:100%;max-width:100%}
body.portal-workspace-psd .ws-host{position:relative;top:auto;z-index:75;box-sizing:border-box;min-height:44px;padding:4px 0 4px var(--ws-reserved,260px);flex-wrap:nowrap;justify-content:flex-end;gap:2px;border-bottom:1px solid var(--ws-line)}
body.portal-workspace-psd.ws-nav-open .ws-host{z-index:auto}
body.portal-workspace-psd.ws-nav-open .ws-host #portalWorkspaceNav{z-index:85}
body.portal-workspace-psd .ws-host>.ws-tabs{flex-wrap:nowrap;gap:1px}
body.portal-workspace-psd .ws-host #portalWorkspaceNav{position:absolute;left:0;top:4px;width:auto;min-height:36px;padding:6px 9px;font-size:14px;border:0}
body.portal-workspace-psd .ws-host>.ws-button,body.portal-workspace-psd .ws-host>.ws-tabs>.ws-button,body.portal-workspace-psd .ws-host>.ws-menu>summary{min-height:36px;padding:6px 9px;border:0;border-radius:5px;white-space:nowrap;font-size:13px}
body.portal-workspace-psd .ws-host>.ws-menu{order:10;margin-left:3px}
body.portal-workspace-psd .ws-host>.ws-menu>.ws-menu-list{left:auto;right:0;max-width:calc(100vw - 32px)}
body.portal-workspace-psd #psdEditor>#psdMainToolbar{position:absolute;left:calc(var(--ws-nav-width,36px) + 8px);top:4px;z-index:76;min-height:36px;gap:2px;flex-wrap:nowrap;margin:0;padding:0;background:var(--ws-paper)}
body.portal-workspace-psd #psdMainToolbar .btn{box-sizing:border-box;min-height:36px;height:36px;padding:6px 9px;border:0;border-radius:5px;font-size:13px;white-space:nowrap}
body.portal-workspace-psd #psdMainToolbar button:not(#psdCancel):not(#psdNewDocumentButton){width:36px;padding:5px}
body.portal-workspace-psd #psdMainToolbar svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.portal-workspace-psd #psdEditor>#psdWarnings{position:absolute;left:calc(var(--ws-nav-width,36px) + 16px + var(--ws-actions,180px));top:4px;z-index:78;box-sizing:border-box;width:max-content;max-width:calc(100% - 56px);padding:0;margin:0;border:0;background:none}
body.portal-workspace-psd #psdWarnings>summary{display:flex;align-items:center;justify-content:center;min-height:36px;padding:0 7px;box-sizing:border-box;font-size:12px;list-style:none;cursor:pointer;color:var(--ws-ink);border:0;border-radius:5px;background:none}
body.portal-workspace-psd #psdWarnings>summary::-webkit-details-marker{display:none}
body.portal-workspace-psd #psdWarnings>summary:hover,body.portal-workspace-psd #psdWarnings[open]>summary{background:var(--ws-soft)}
body.portal-workspace-psd #psdEditor #psdWarnings[open]>.ws-warning-body{position:fixed;top:48px;left:16px;right:auto;width:min(560px,calc(100vw - 32px));max-height:min(50dvh,360px);z-index:90}
body.portal-workspace-psd #portalPsdWarningClose{display:none!important}
body.portal-workspace-psd #psdEditor>#psdStatus{margin:0;padding:4px 2px;font-size:12px}
body.portal-workspace-psd #psdEditor>#psdDocumentInfo{margin:0 0 4px;padding:2px;font-size:11px;overflow-wrap:anywhere}
body.portal-workspace-psd #psdEditor .ws-body{width:100%;max-width:100%;min-width:0;box-sizing:border-box;gap:10px;padding-top:6px}
body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers{grid-template-columns:minmax(170px,210px) minmax(0,1fr)}
body.portal-workspace-psd #psdEditor .ws-body.ws-with-right{grid-template-columns:minmax(0,1fr) minmax(220px,280px)}
body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers.ws-with-right{grid-template-columns:minmax(170px,210px) minmax(0,1fr) minmax(220px,280px)}
body.portal-workspace-psd #psdEditor .ws-dock{max-height:calc(100dvh - 100px);padding:0 6px 8px;box-sizing:border-box}
body.portal-workspace-psd #psdEditor .ws-dock h2{font-size:13px;margin:6px 0}
body.portal-workspace-psd #psdEditor #psdWorkspace{width:100%;max-width:100%;min-width:0}
body.portal-workspace-psd #psdEditor .psd-preview-panel{display:grid;grid-template-columns:56px minmax(0,1fr);grid-template-rows:auto 1fr auto;gap:6px;min-width:0;max-width:100%;width:100%;box-sizing:border-box;max-height:none;overflow:visible;padding:0}
body.portal-workspace-psd #psdEditor #psdPreviewHeading,body.portal-workspace-psd #psdEditor #psdPreviewKind{display:none}
body.portal-workspace-psd #psdEditor #psdTools{grid-column:1;grid-row:1/4;display:flex;flex-direction:column;gap:2px;width:56px;max-height:calc(100dvh - 100px);overflow-y:auto;overflow-x:hidden;align-self:start;padding:0 3px 5px;box-sizing:border-box;scrollbar-width:thin}
body.portal-workspace-psd #psdEditor #psdTools .psd-tool{flex:none;min-height:40px;height:40px;width:46px;gap:0;padding:6px 0;border:0;border-radius:5px}
body.portal-workspace-psd #psdTools .psd-tool>span{display:none}
body.portal-workspace-psd #psdEditor #psdTools .psd-zoombar{display:flex;flex-direction:column;gap:1px;width:46px;margin:10px 0 0;padding:0;align-items:stretch}
body.portal-workspace-psd #psdTools .psd-zoombar>.btn,body.portal-workspace-psd #psdTools>.ws-capture-tools>.btn{display:flex;justify-content:center;align-items:center;flex:none;min-height:36px;height:36px;min-width:0;width:46px;border:0;background:none;padding:5px;border-radius:5px;color:var(--psd-accent);font-size:20px}
body.portal-workspace-psd #psdTools .psd-zoombar>#psdZoom{display:block;text-align:center;min-width:0;padding:2px 0;line-height:20px;font-size:11px}
body.portal-workspace-psd #psdTools>.ws-capture-tools{display:flex;flex-direction:column;gap:2px;margin-top:10px}
body.portal-workspace-psd #psdTools>.ws-capture-tools svg,body.portal-workspace-psd #psdTools .psd-zoombar svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.portal-workspace-psd #psdEditor #psdOptions{grid-column:2;grid-row:1;min-width:0;gap:4px 8px;margin:0;padding:4px}
body.portal-workspace-psd #psdEditor #psdViewport{grid-column:2;grid-row:2;min-width:0;max-width:100%;width:100%;box-sizing:border-box;height:clamp(220px,calc(100dvh - 118px),920px);min-height:0;overflow:auto}
body.portal-workspace-psd #psdEditor #psdFramePosition{grid-column:2;grid-row:3;font-size:12px;gap:5px;min-width:0}
body.portal-workspace-psd #psdEditor #psdOutputPlacement{display:none!important}
body.portal-workspace-psd #psdEditor .psd-layers-header{display:flex;align-items:center;justify-content:space-between;gap:5px;min-height:34px}
body.portal-workspace-psd #psdEditor .psd-layers-header>h2{margin:0;font-size:13px}
body.portal-workspace-psd #psdEditor .psd-group-actions{display:flex;gap:2px;margin:0}
body.portal-workspace-psd #psdEditor .psd-group-actions>.btn{min-height:30px;width:30px;height:30px;padding:4px;border:0;background:none;border-radius:5px}
body.portal-workspace-psd #psdEditor .psd-group-actions svg,body.portal-workspace-psd #psdEditor .ws-layer-footer svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
body.portal-workspace-psd #psdEditor .psd-image-actions.ws-layer-footer{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:1px;margin:5px 0 0;padding:5px 0 0;border-top:1px solid var(--ws-line);min-width:0}
body.portal-workspace-psd #psdEditor .ws-layer-footer>.btn{flex:0 1 30px;display:flex;align-items:center;justify-content:center;min-width:24px;min-height:32px;height:32px;width:30px;box-sizing:border-box;margin:0;padding:3px;border:0;border-radius:4px;background:none}
body.portal-workspace-psd #psdEditor .psd-tool:hover:not(:disabled),body.portal-workspace-psd #psdEditor #psdTools .btn:hover:not(:disabled),body.portal-workspace-psd #psdEditor .ws-layer-footer>.btn:hover,body.portal-workspace-psd #psdEditor .psd-group-actions>.btn:hover{background:var(--ws-soft)}
body.portal-workspace-psd #psdEditor .psd-display-surface.has-export-frame{overflow:clip}
body.portal-workspace-psd #psdEditor .has-export-frame canvas{image-rendering:pixelated}
@media(max-width:1099px){
body.portal-workspace-psd .ws-host{padding:48px 0 4px;flex-wrap:wrap;min-height:88px;justify-content:flex-end}
body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers.ws-with-right{grid-template-columns:180px minmax(0,1fr) 240px}
body.portal-workspace-psd #psdEditor #psdViewport{height:clamp(220px,calc(100dvh - 162px),920px)}
body.portal-workspace-psd #psdEditor #psdTools{max-height:calc(100dvh - 144px)}
}
@media(max-width:999px){
body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers,body.portal-workspace-psd #psdEditor .ws-body.ws-with-right,body.portal-workspace-psd #psdEditor .ws-body.ws-with-layers.ws-with-right{grid-template-columns:minmax(0,1fr)}
body.portal-workspace-psd #psdEditor .ws-dock{max-height:55dvh;bottom:0;left:0;right:0}
body.portal-workspace-psd .ws-host>.ws-menu>.ws-menu-list{position:fixed;top:94px;left:auto;right:16px;max-height:calc(100dvh - 130px)}
}
@media(max-width:650px){
body.portal-workspace-psd main#main.content{padding-left:8px;padding-right:8px}
body.portal-workspace-psd .ws-host{gap:1px;justify-content:flex-start}
body.portal-workspace-psd .ws-host>.ws-button,body.portal-workspace-psd .ws-host>.ws-tabs>.ws-button,body.portal-workspace-psd .ws-host>.ws-menu>summary{padding:6px;font-size:12px}
body.portal-workspace-psd .ws-host>.ws-menu{margin-left:auto}
body.portal-workspace-psd #psdEditor .psd-preview-panel{grid-template-columns:52px minmax(0,1fr);gap:4px}
body.portal-workspace-psd #psdEditor #psdTools{width:52px}
body.portal-workspace-psd #psdEditor #psdViewport{height:clamp(190px,calc(100dvh - 172px),760px)}
body.portal-workspace-psd #psdEditor #psdTools{max-height:calc(100dvh - 145px)}
body.portal-workspace-psd #psdMainToolbar #psdCancel{max-width:116px;font-size:11px}
body.portal-workspace-psd #psdEditor #psdWarnings{left:calc(var(--ws-nav-width,36px) + 12px + var(--ws-actions,180px))}
}
@media(min-width:1024px){
body.psd-editor-page,body.psd-editor-page #portalForm{height:100dvh;overflow:hidden}
body.psd-editor-page .main-col{display:flex;flex-direction:column;height:100dvh;min-height:0;padding-bottom:0}
body.psd-editor-page main#main.content{display:flex;flex:1 1 auto;flex-direction:column;height:100%;min-height:0;margin:0;padding-bottom:0;overflow:hidden}
body.psd-editor-page .ws-shell{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}
body.psd-editor-page #psdEditor.ws-editor{display:flex;flex:1 1 auto;flex-direction:column;height:100%;min-height:0;overflow:hidden}
body.psd-editor-page #psdEditor #psdWorkspace{flex:1 1 auto;min-height:0;overflow:hidden}
body.psd-editor-page #psdEditor .ws-body{height:100%;min-height:0}
}

/* A4: non-blocking help, tours, and success notices for the PSD editor. */
body.portal-workspace-psd .ws-host>#portalPsdHelpButton{order:11}
.portal-psd-a4-floaters{position:fixed;right:16px;bottom:16px;z-index:110;display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-width:calc(100vw - 32px);pointer-events:none}
.portal-psd-a4-toast-stack{display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-width:100%}
body[data-psd-toasts] #psdEditor #psdStatus,body[data-psd-toasts] #psdEditor #psdResult,body[data-psd-toasts] #psdEditor #psdVariantResult{display:none!important}
.portal-psd-a4-progress,.portal-psd-a4-alert{box-sizing:border-box;max-width:min(360px,calc(100vw - 32px));padding:11px 14px;border:1px solid #cfc6ef;border-radius:10px;background:#fff;color:#29253b;box-shadow:0 8px 24px #29253b2a;font-size:14px;line-height:1.5;pointer-events:auto;white-space:pre-line}
.portal-psd-a4-alert{display:flex;align-items:flex-start;gap:8px;padding-right:6px;border-color:#e0a3a3;background:#fff1f1;color:#7a1d1d}
.portal-psd-a4-alert__text{min-width:0;overflow-wrap:anywhere}
.portal-psd-a4-alert__close{flex:none;min-width:28px;min-height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:inherit;font-size:18px;line-height:1;cursor:pointer}
.portal-psd-a4-alert__close:hover{background:#7a1d1d1a}
.portal-psd-a4-toast{box-sizing:border-box;max-width:min(360px,calc(100vw - 32px));padding:11px 14px;border:1px solid #cfc6ef;border-radius:10px;background:#fff;color:#29253b;box-shadow:0 8px 24px #29253b2a;font-size:14px;line-height:1.5;pointer-events:auto}
.portal-psd-a4-offer{box-sizing:border-box;width:min(420px,calc(100vw - 32px));padding:12px;border:1px solid var(--ws-line,#d9d4e7);border-radius:10px;background:var(--ws-paper,#fff);color:var(--ws-ink,#29253b);box-shadow:0 8px 24px #29253b2a;pointer-events:auto}
.portal-psd-a4-offer__head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;font-weight:700}
.portal-psd-a4-offer__actions{display:flex;flex-wrap:wrap;gap:6px}
.portal-psd-a4-offer .ws-button{min-height:36px;padding:6px 10px}
.portal-psd-a4-help{position:fixed;z-index:105;top:104px;right:16px;bottom:16px;display:flex;flex-direction:column;width:min(280px,calc(100vw - 32px));box-sizing:border-box;border:1px solid var(--ws-line,#d9d4e7);border-radius:10px;background:var(--ws-paper,#fff);color:var(--ws-ink,#29253b);box-shadow:0 8px 24px #29253b33}
.portal-psd-a4-help[hidden]{display:none}
.portal-psd-a4-help__head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border-bottom:1px solid var(--ws-line,#d9d4e7);background:var(--ws-paper,#fff)}
.portal-psd-a4-help__head h2{margin:0;font-size:15px}
.portal-psd-a4-help__body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:10px}
.portal-psd-a4-help article{padding:0 0 14px;margin:0 0 14px;border-bottom:1px solid var(--ws-line,#d9d4e7)}
.portal-psd-a4-help article:last-child{border-bottom:0}
.portal-psd-a4-help h3{margin:0 0 8px;font-size:14px;line-height:1.4}
.portal-psd-a4-help ol{margin:0 0 8px;padding-left:22px;font-size:13px;line-height:1.5}
.portal-psd-a4-help li{margin:0 0 4px}
.portal-psd-a4-help figure{margin:8px 0}
.portal-psd-a4-help figure img{display:block;width:auto;max-width:100%;height:auto;border-radius:6px}
.portal-psd-a4-help .ws-button{min-height:34px;padding:6px 9px}
.portal-psd-a4-tour-target{position:relative!important;z-index:108!important;outline:3px solid #6e58cc!important;outline-offset:3px!important;box-shadow:0 0 0 7px #8d7ad355!important;animation:portal-psd-a4-pulse 1.8s ease-in-out infinite}
@keyframes portal-psd-a4-pulse{50%{box-shadow:0 0 0 11px #8d7ad322!important}}
.portal-psd-a4-tour-bubble{position:fixed;z-index:115;box-sizing:border-box;width:min(320px,calc(100vw - 32px));padding:12px;border:1px solid #cfc6ef;border-radius:10px;background:#fff;color:#29253b;box-shadow:0 8px 24px #29253b33;font-size:14px;line-height:1.5}
.portal-psd-a4-tour-bubble__count{margin:0 0 4px;color:#62578f;font-size:12px;font-weight:700}
.portal-psd-a4-tour-bubble__text{margin:0 0 10px}
.portal-psd-a4-tour-bubble__actions{display:flex;justify-content:flex-end;gap:6px}
.portal-psd-a4-tour-bubble .ws-button{min-height:34px;padding:6px 10px}
@media(prefers-reduced-motion:reduce){.portal-psd-a4-tour-target{animation:none}}
@media(max-width:1099px){.portal-psd-a4-help{width:min(240px,calc(100vw - 32px))}}
@media(max-width:999px){.portal-psd-a4-help{top:104px;left:16px;right:16px;bottom:calc(var(--ssp-tab-bar-h,64px) + 8px + env(safe-area-inset-bottom,0px));width:auto}}
@media(max-width:650px){.portal-psd-a4-floaters{right:8px;bottom:calc(var(--ssp-tab-bar-h,64px) + 8px + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 16px)}.portal-psd-a4-help{left:8px;right:8px}.portal-psd-a4-offer{width:min(420px,calc(100vw - 16px))}.portal-psd-a4-toast{max-width:calc(100vw - 16px)}}

/* A5: 画像の枠と容量は、上の帯の右端に小さく出し、押すと下に浮き窓(ラベル無し・枠無し・帯の高さは変えない) */
body.portal-workspace-images .ws-usage{margin-left:auto;box-sizing:border-box;min-height:36px;padding:6px 8px;border:0;border-radius:6px;background:none;color:var(--ws-muted);font:inherit;font-size:12px;line-height:1.3;white-space:nowrap;font-variant-numeric:tabular-nums;cursor:pointer}
body.portal-workspace-images .ws-usage:hover{background:var(--ws-soft)}
body.portal-workspace-images .ws-usage:focus-visible{outline:3px solid #9681ed;outline-offset:2px}
body.portal-workspace-images .ws-usage[data-level=high]{color:#a35200}
body.portal-workspace-images .ws-usage-pop{position:absolute;top:calc(100% + 4px);right:16px;z-index:86;box-sizing:border-box;width:min(340px,calc(100vw - 32px));max-height:calc(100dvh - 72px);overflow:auto;padding:10px 14px;border:1px solid var(--ws-line);border-radius:10px;background:var(--ws-paper);color:var(--ws-ink);box-shadow:0 8px 24px #29253b2a;font-size:13px}
body.portal-workspace-images .ws-usage-pop #portalOpSection{padding:0;margin:0;border:0;background:none;box-shadow:none;min-width:0}
body.portal-workspace-images .ws-usage-pop #portalOpHeading,body.portal-workspace-images .ws-usage-pop #portalOpRate,body.portal-workspace-images .ws-usage-pop #portalOpNone,body.portal-workspace-images .ws-usage-pop #portalOpForm .form-field{display:none}
body.portal-workspace-images .ws-usage-pop .kv-list{margin:0 0 8px}
body.portal-workspace-images .ws-usage-pop .kv-row{display:flex;justify-content:space-between;gap:12px;padding:4px 0}
body.portal-workspace-images .ws-usage-pop .kv-row dt{color:var(--ws-muted)}
body.portal-workspace-images .ws-usage-pop .kv-row dd{margin:0;font-variant-numeric:tabular-nums}
body.portal-workspace-images .ws-usage-pop #portalOpForm .upload-row{margin:0}
body.portal-workspace-images .ws-usage-pop #portalOpConfirm{margin-top:8px}
body.portal-workspace-images .ws-usage-pop #portalOpStatus:empty{display:none}

/* A5: 道具の設定の帯(40px+余白)が出ている間は、見本の高さをその分だけ縮めて、画面の下からはみ出さないようにする */
body.portal-workspace-psd #psdEditor.has-tool-options #psdViewport{height:clamp(200px,calc(100dvh - 172px),920px)}
@media(max-width:1099px){body.portal-workspace-psd #psdEditor.has-tool-options #psdViewport{height:clamp(200px,calc(100dvh - 216px),920px)}}
@media(max-width:650px){body.portal-workspace-psd #psdEditor.has-tool-options #psdViewport{height:clamp(190px,calc(100dvh - 226px),760px)}}

/* B1: 配置の編集(左右のドックのタブをつかんで入れ替え・つなぎ目で幅を変える・利用者ごとにこのブラウザーへ保存)。
   1000px以上は「左のドック | 画像 | 右のドック」を横に並べ、1000px未満は従来の下から出る板のまま。 */
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop{display:flex;flex-direction:row;align-items:stretch;gap:0;padding-top:6px}
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop>#psdWorkspace{flex:1 1 0;width:auto;min-width:320px;max-width:none}
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop>.ws-stack{display:flex;flex-direction:column;flex:0 1 var(--ws-dock-w,210px);min-width:0;min-height:0;box-sizing:border-box}
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop>.ws-stack-left{--ws-dock-w:210px;min-width:180px;max-width:420px}
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop>.ws-stack-right{--ws-dock-w:280px;min-width:220px;max-width:480px}
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop>.ws-stack>.ws-dock{flex:1 1 0;min-height:0;max-height:none;overflow:auto}
body.portal-workspace-psd #psdEditor .ws-strip{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:flex-end;gap:0 2px;min-height:32px;padding:0 4px;border-bottom:1px solid var(--ws-line)}
body.portal-workspace-psd #psdEditor .ws-strip>.ws-tab{box-sizing:border-box;display:inline-flex;align-items:center;gap:4px;min-height:32px;height:32px;padding:0 10px;border:0;flex:none;border-radius:5px 5px 0 0;background:none;color:var(--ws-muted);font:inherit;font-size:13px;line-height:1;white-space:nowrap;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
body.portal-workspace-psd #psdEditor .ws-strip>.ws-tab:hover{background:var(--ws-soft);color:var(--ws-ink)}
body.portal-workspace-psd #psdEditor .ws-strip>.ws-tab[aria-selected=true]{color:var(--ws-accent);font-weight:700;box-shadow:inset 0 -2px 0 var(--ws-accent)}
body.portal-workspace-psd #psdEditor .ws-strip>.ws-tab:focus-visible{outline:3px solid #9681ed;outline-offset:-3px}
body.portal-workspace-psd #psdEditor .ws-strip>.ws-unread:after{content:'●';font-size:10px;color:var(--ws-accent)}
body.portal-workspace-psd #psdEditor .ws-desktop .psd-layers-header{justify-content:flex-end}
body.portal-workspace-psd #psdEditor .ws-desktop .psd-layers-header>h2,body.portal-workspace-psd #psdEditor .ws-desktop #psdVariantHeading,body.portal-workspace-psd #psdEditor .ws-desktop #psdOutput>h2{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
body.portal-workspace-psd #psdEditor .ws-gutter{flex:0 0 8px;position:relative;box-sizing:border-box;cursor:col-resize;touch-action:none;outline:none}
body.portal-workspace-psd #psdEditor .ws-gutter:after{content:'';position:absolute;top:0;bottom:0;left:3px;width:1px;background:var(--ws-line);transition:background .12s}
body.portal-workspace-psd #psdEditor .ws-gutter:hover:after,body.portal-workspace-psd #psdEditor .ws-gutter:focus-visible:after{left:2px;width:3px;border-radius:2px;background:var(--ws-accent)}
body.ws-dragging{cursor:grabbing!important;user-select:none;-webkit-user-select:none}
body.ws-dragging *{cursor:grabbing!important}
.ws-drag-ghost{position:fixed;left:0;top:0;z-index:130;pointer-events:none;padding:5px 11px;border-radius:6px;background:var(--ws-accent,#3e2e8c);color:#fff;font-size:13px;line-height:1.2;white-space:nowrap;box-shadow:0 6px 18px #29253b44}
.ws-drop-hint{position:fixed;z-index:125;pointer-events:none;box-sizing:border-box;border-radius:6px;background:#6e58cc1f;outline:2px solid #6e58cca6;outline-offset:-2px}
.ws-drop-line{position:fixed;z-index:126;width:3px;pointer-events:none;border-radius:2px;background:#6e58cc}
.ws-layout-note{position:fixed;left:16px;bottom:16px;z-index:112;max-width:calc(100vw - 32px);margin:0;padding:8px 12px;box-sizing:border-box;border:1px solid var(--ws-line);border-radius:8px;background:var(--ws-paper);color:var(--ws-ink);box-shadow:0 8px 24px #29253b2a;font-size:13px}
.ws-layout-json{position:fixed;z-index:111;top:96px;right:16px;display:grid;gap:8px;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 112px);box-sizing:border-box;padding:10px;overflow:auto;border:1px solid var(--ws-line);border-radius:10px;background:var(--ws-paper);color:var(--ws-ink);box-shadow:0 8px 24px #29253b2a}
.ws-layout-json textarea{display:block;width:100%;min-height:160px;box-sizing:border-box;padding:7px;border:1px solid var(--ws-line);border-radius:7px;background:var(--ws-paper);color:var(--ws-ink);font:12px/1.5 ui-monospace,Consolas,monospace;resize:vertical}
.ws-layout-json-actions{display:flex;flex-wrap:wrap;gap:6px}
.ws-layout-json .ws-button{box-sizing:border-box;display:inline-flex;align-items:center;min-height:34px;padding:6px 10px;border:1px solid var(--ws-line);border-radius:7px;background:var(--ws-paper);color:var(--ws-ink);font:inherit;font-size:13px;cursor:pointer}
.ws-layout-json .ws-button:focus-visible,.ws-layout-json textarea:focus-visible{outline:3px solid #9681ed;outline-offset:2px}
.ws-layout-json-status{margin:0;font-size:12px;color:var(--ws-muted)}
.ws-layout-json-status:empty{display:none}
.ws-host .ws-menu-list #portalPsdLayoutUndo:disabled{opacity:.5;cursor:default}
@media(min-width:1000px) and (max-width:1099px){
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop>.ws-stack-left{--ws-dock-w:180px}
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop>.ws-stack-right{--ws-dock-w:240px}
body.portal-workspace-psd .ws-shell.ws-mode-desktop .ws-host{padding:4px 0 4px var(--ws-reserved,260px);flex-wrap:nowrap;min-height:44px}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor #psdViewport{height:clamp(220px,calc(100dvh - 118px),920px)}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor.has-tool-options #psdViewport{height:clamp(200px,calc(100dvh - 172px),920px)}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor #psdTools{max-height:calc(100dvh - 100px)}
}
@media(min-width:1000px) and (max-width:1023px){
body.portal-workspace-psd #psdEditor .ws-body.ws-desktop{height:calc(100dvh - 130px);min-height:420px}
}
/* A81: 道具の帯を浮かせる(1000px 以上)。つまみ = 帯の一番上の点。浮いている間は画像の欄が左の列の分だけ広がる */
body.portal-workspace-psd #psdTools>.ws-tools-grip{display:none}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor #psdTools>.ws-tools-grip{display:flex;flex:none;justify-content:center;align-items:center;width:46px;height:14px;margin:0 0 2px;border-radius:4px;color:var(--ws-muted);cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;outline:none}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor #psdTools>.ws-tools-grip:before{content:'';width:16px;height:6px;background:radial-gradient(circle,currentColor 1.1px,transparent 1.5px) 0 0/5.33px 3px}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor #psdTools>.ws-tools-grip:hover{background:var(--ws-soft);color:var(--ws-ink)}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor #psdTools>.ws-tools-grip:focus-visible{outline:3px solid #9681ed;outline-offset:-3px}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor .psd-preview-panel.ws-tools-floating{grid-template-columns:minmax(0,1fr)}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor .psd-preview-panel.ws-tools-floating>#psdOptions,body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor .psd-preview-panel.ws-tools-floating>#psdViewport,body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor .psd-preview-panel.ws-tools-floating>#psdFramePosition{grid-column:1}
body.portal-workspace-psd .ws-shell.ws-mode-desktop #psdEditor #psdTools.ws-floating{position:fixed;left:var(--ws-tools-x,0);top:var(--ws-tools-y,0);z-index:74;max-height:calc(100dvh - var(--ws-tools-y,0px) - 8px);padding:4px 3px 5px;border-radius:8px;background:var(--ws-paper);box-shadow:0 6px 18px #29253b33}
/* C23: 狭い窓で下から出る板(書き出しの保存など)が開いている間は、右下の使い方の案内を出さない */
@media(max-width:999px){body.portal-workspace-psd:has(#psdEditor .ws-body.ws-with-layers,#psdEditor .ws-body.ws-with-right) #portalPsdTourOffer{display:none}}
/* C47: 文書を開く前はドックを見せず、空画面の位置と保存済み配置は変えない */
body.portal-workspace-psd .ws-shell:has(#psdWorkspace[hidden]) .ws-stack,
body.portal-workspace-psd .ws-shell:has(#psdWorkspace[hidden]) .ws-gutter,
body.portal-workspace-psd .ws-shell:has(#psdWorkspace[hidden]) .ws-body>.ws-dock,
body.portal-workspace-psd .ws-shell:has(#psdWorkspace[hidden]) .ws-host>.ws-tabs,
body.portal-workspace-psd .ws-shell:has(#psdWorkspace[hidden]) #portalPsdLayersToggle,
body.portal-workspace-psd .ws-shell:has(#psdWorkspace[hidden]) #portalPsdDockClose{visibility:hidden}
