.layout-work,.layout-settings,.font-layout-settings{display:contents}
.layout-dialog{width:min(500px,calc(100vw - 32px));background:var(--panel,#222);color:var(--text,#ddd);border:1px solid var(--edge,#666);border-radius:8px;padding:26px}.layout-dialog::backdrop{background:#0009}.layout-dialog h2{font-size:19px}.layout-dialog p{font-size:13px;line-height:1.8}.layout-dialog-actions{display:flex;gap:8px;flex-wrap:wrap}.layout-dialog-actions button{flex:1;white-space:normal}.layout-save-note{color:var(--muted,#aaa)}
@media all{
 html[data-layout=pc] :is(#image-page,:is(#font-page,#text-page)){max-width:none;padding:18px var(--tool-inline-gutter) 30px}
 html[data-layout=pc] .workspace-heading{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
 html[data-layout=pc] .workspace-heading h1{font-size:24px;margin:0;letter-spacing:-1px}
 html[data-layout=pc] .workspace-heading .eyebrow{margin:0}
 html[data-layout=pc] .workspace-heading .tool-description{margin:0;font-size:12px}
 html[data-layout=pc] .workspace-layout{grid-template-columns:var(--tool-ad-columns,minmax(0,1fr));gap:18px;margin-top:18px}
 html[data-layout=pc] #image-page #workspace{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:12px;align-items:start;min-width:0}
 html[data-layout=pc] .layout-work,html[data-layout=pc] .layout-settings{display:block;min-width:0;max-height:calc(100dvh - 170px);overflow:auto;scrollbar-gutter:stable;padding-bottom:16px}
 html[data-layout=pc] #settings{margin-top:0;padding:18px}
 html[data-layout=pc] .setting-grid{grid-template-columns:1fr 1fr;gap:10px}
 html[data-layout=pc] .setting-grid>label:first-child{grid-column:1/-1}
 html[data-layout=pc] .quality-row{flex-wrap:wrap;gap:12px}
 html[data-layout=pc] .quality-row>input[type=range]{min-width:100px;width:100%}
 html[data-layout=pc] #settings .actions{grid-template-columns:1fr}
 html[data-layout=pc] .generation-motion{height:90px}
 html[data-layout=pc] .save-section{margin-top:16px;padding:18px}

 html[data-layout=pc] #results{max-height:none}
 html[data-layout=pc] .file-row{grid-template-columns:20px 44px minmax(0,1fr)}
 html[data-layout=pc] .row-actions{grid-column:3;justify-content:flex-end;flex-wrap:wrap}
 html[data-layout=pc] .file-metadata{grid-template-columns:minmax(90px,1fr) 100px 70px 70px;gap:8px}
 html[data-layout=pc] :is(#font-editor,#text-editor){height:calc(100dvh - 170px)!important;min-height:600px}
 html[data-layout=pc] #app{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px}
 html[data-layout=pc] .font-layout-settings{display:block;max-height:calc(100dvh - 24px);overflow:auto}
 html[data-layout=pc] #app>.vavav-section{min-width:0;max-height:calc(100dvh - 24px);overflow:auto}
 html[data-layout=pc] .font-setup{grid-template-columns:1fr}
}
@media(max-width:600px){.layout-dialog-actions{flex-direction:column}}

@media all{
html.font-document[data-layout=pc] #app{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:12px}
html.font-document[data-layout=pc] .font-layout-settings{display:block;max-height:calc(100dvh - 8px);overflow:auto}
html.font-document[data-layout=pc] #app>.vavav-section{min-width:0;max-height:calc(100dvh - 8px);overflow:auto}
html.font-document[data-layout=pc] .font-setup{grid-template-columns:1fr}
html.font-document[data-layout=pc] .vavav-section{padding:16px}
html.font-document[data-layout=pc] .preview{height:340px}
}

/* Image work and settings scrollbars: transparent track and a 4px content gap. */
@media all{
html[data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info){padding-right:4px;scrollbar-color:#202020 transparent;scrollbar-width:thin}
/* Match the font work column: no extra reserved space beside the panel. */
html[data-layout=pc] #image-page .layout-work{padding-right:0;scrollbar-gutter:auto}
html[data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info)::-webkit-scrollbar{width:6px;height:6px;background:transparent}
html[data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info)::-webkit-scrollbar-track{background:transparent}
html[data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info)::-webkit-scrollbar-thumb{background:#202020;border-radius:3px}
html[data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info)::-webkit-scrollbar-thumb:hover{background:#303030}
html[data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info)::-webkit-scrollbar-corner{background:transparent}
}
/* Keep the iframe document fixed; only the two editor columns scroll. */
@media all{
html.font-document[data-layout=pc]{height:100%;overflow:hidden}
html.font-document[data-layout=pc] body{height:100dvh;max-height:100dvh;overflow:hidden;display:flex;flex-direction:column}
html.font-document[data-layout=pc] #app{flex:1;min-height:0;overflow:hidden;align-items:stretch}
html.font-document[data-layout=pc] #app>.vavav-section,html.font-document[data-layout=pc] .font-layout-settings{height:100%;max-height:100%;min-height:0;overflow:auto;margin-bottom:0;scrollbar-gutter:stable;scrollbar-color:#202020 transparent;scrollbar-width:thin}
html.font-document[data-layout=pc] .font-layout-settings{padding-right:4px}
html.font-document[data-layout=pc] #app>.vavav-section{padding-right:20px}
html.font-document[data-layout=pc] .statusbar{flex:none;max-height:70px;overflow:auto}
html.font-document[data-layout=pc] :is(#app>.vavav-section,.font-layout-settings)::-webkit-scrollbar{width:6px;background:transparent}
html.font-document[data-layout=pc] :is(#app>.vavav-section,.font-layout-settings)::-webkit-scrollbar-track{background:transparent}
html.font-document[data-layout=pc] :is(#app>.vavav-section,.font-layout-settings)::-webkit-scrollbar-thumb{background:#202020;border-radius:3px}
html.font-document[data-layout=pc] :is(#app>.vavav-section,.font-layout-settings)::-webkit-scrollbar-thumb:hover{background:#303030}
html.font-document[data-layout=pc] :is(#app>.vavav-section,.font-layout-settings)::-webkit-scrollbar-corner{background:transparent}
}

@media all{html.font-document[data-layout=pc] .font-layout-settings>.vavav-section{margin-bottom:10px}}


/* PC font canvas uses the full work column without a second panel frame. */
@media all{
html.font-document[data-layout=pc] #app>.vavav-section{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;scrollbar-gutter:auto}
html.font-document[data-layout=pc] #app>.vavav-section>.workspace.panel{margin:0;min-height:100%;display:flex;flex-direction:column;box-sizing:border-box}
html.font-document[data-layout=pc] #font-split{flex:1 0 auto}
html.font-document[data-layout=pc] .workspace>:not(#font-split){flex-shrink:0}
}

/* The desktop font editor fills the viewport below the shared header. */
@media all{
html[data-layout=pc]:has(:is(#font-page,#text-page):not([hidden])) body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
html[data-layout=pc]:has(:is(#font-page,#text-page):not([hidden])) .site-header{flex-shrink:0}
html[data-layout=pc]:has(:is(#font-page,#text-page):not([hidden])) body>footer{display:none}
html[data-layout=pc] :is(#font-page,#text-page):not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column;margin:0;width:100%;box-sizing:border-box;padding-bottom:8px}
html[data-layout=pc] :is(#font-page,#text-page) .workspace-heading{flex-shrink:0}
html[data-layout=pc] :is(#font-page,#text-page) .workspace-layout{flex:1;min-height:0}
html[data-layout=pc] :is(#font-page,#text-page) .font-workspace{min-height:0}
html[data-layout=pc] :is(#font-editor,#text-editor){height:100%!important;min-height:0}

}

#image-page .image-menu-heading{margin:0;font-size:13px;font-weight:650;line-height:1.6;letter-spacing:0}
html body #image-page #workspace button.menu-disclosure{display:flex;align-items:center;justify-content:flex-start;gap:6px;width:100%;height:24px;min-height:24px;padding:0;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:inherit;font:inherit;text-align:left}
#image-page .menu-disclosure>span{width:13px;flex:0 0 13px}
#image-page .image-menu-body{margin-top:18px}
@media all{
html[data-layout=pc]:has(#image-page:not([hidden])) body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
html[data-layout=pc]:has(#image-page:not([hidden])) .site-header{flex-shrink:0}
html[data-layout=pc]:has(#image-page:not([hidden])) body>footer{display:none}
html[data-layout=pc] #image-page:not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column;margin:0;width:100%;box-sizing:border-box;padding-bottom:8px}
html[data-layout=pc] #image-page .workspace-heading{flex-shrink:0}
html[data-layout=pc] #image-page .workspace-layout{flex:1;min-height:0}
html[data-layout=pc] #image-page #workspace{min-height:0;align-items:stretch}
html[data-layout=pc] #image-page :is(.layout-work,.layout-settings){height:100%;max-height:100%;min-height:0;box-sizing:border-box}
html[data-layout=pc] #image-page .save-section{margin-top:10px}
}
html body #image-page .row-actions .file-icon-action{width:36px;min-width:36px;height:36px;min-height:36px;padding:8px}
.file-icon-action svg{width:19px;height:19px;display:block}
@media(min-width:851px){
html body #image-page .file-row{grid-template-columns:20px 52px minmax(0,1fr) 122px;gap:12px}
html body #image-page .row-actions{grid-column:4;grid-row:1;flex-wrap:nowrap;gap:4px;align-self:center;justify-content:flex-end}
html body #image-page .file-info{grid-column:3;overflow-x:auto;padding-bottom:6px}
html body #image-page .file-metadata{grid-template-columns:var(--file-col-0,200px) var(--file-col-1,105px) var(--file-col-2,75px) var(--file-col-3,85px);gap:10px}
#image-page .metadata-name{overflow:hidden;white-space:nowrap}
#image-page .metadata-name strong{white-space:nowrap;overflow-wrap:normal;overflow:hidden;text-overflow:ellipsis}
#image-page .metadata-heading{position:relative;padding-right:10px;border-bottom:0}
.column-resize{position:absolute;right:0;top:0;bottom:0;width:8px;cursor:col-resize;touch-action:none;border-right:1px solid #8886}
.column-resize:hover,.column-resize:focus-visible{border-right-color:currentColor;outline:none}
}
@media(max-width:850px){.column-resize{display:none}}
html body #image-page #workspace .row-actions button{border:0!important;background:transparent!important;box-shadow:none!important}

@media(min-width:851px){
html body #image-page .file-row .file-info{border-left:1px solid var(--edge,#444);padding-left:12px}
}

/* Consistent spacing and control sizes in the desktop image settings. */
@media all{
html[data-layout=pc] #image-page #settings .image-menu-body{display:grid;gap:16px;margin-top:16px}
html[data-layout=pc] #image-page #settings .image-menu-body[hidden]{display:none}
html[data-layout=pc] #image-page #settings fieldset{display:grid;gap:12px;margin:0;padding:0}
html[data-layout=pc] #image-page #settings .setting-grid{gap:12px}
html[data-layout=pc] #image-page #settings .setting-grid label{gap:6px;line-height:1.6}
html[data-layout=pc] #image-page #settings :is(.toggles,.quality-row){margin:0;gap:12px}
html[data-layout=pc] #image-page #settings .toggles{display:flex;flex-wrap:wrap;row-gap:8px}
html[data-layout=pc] #image-page #settings :is(#ratio-note,#format-note){margin:0;line-height:1.7}
html[data-layout=pc] #image-page #settings :is(input[type=number],select){height:40px;min-height:40px;padding:8px 10px;box-sizing:border-box}
html[data-layout=pc] #image-page #settings .quality-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px}
html[data-layout=pc] #image-page #settings .quality-row>input[type=range]{width:100%;min-width:0}
html[data-layout=pc] #image-page #settings .quality-row .color-label{grid-column:1/-1;gap:8px}
html[data-layout=pc] #image-page #settings #quality-value{width:60px;padding:6px}
html[data-layout=pc] #image-page #settings .actions{gap:8px;margin:0}
html[data-layout=pc] #image-page :is(#settings .actions,.save-actions) button{height:40px;min-height:40px;padding:8px 12px;line-height:1.6;box-sizing:border-box}
html[data-layout=pc] #image-page #settings .generation-motion{margin-top:0}
html[data-layout=pc] #image-page .save-actions{gap:8px}
}
/* Softer scroll thumbs on white surfaces. */
html[data-theme=ivory][data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info){scrollbar-color:#b9b9b9 transparent}
html[data-theme=ivory][data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info)::-webkit-scrollbar-thumb{background:#b9b9b9}
html[data-theme=ivory][data-layout=pc] #image-page :is(.layout-work,.layout-settings,.file-info)::-webkit-scrollbar-thumb:hover{background:#a5a5a5}

/* Explicit PC selection takes precedence over the available viewport width. */
html[data-layout=pc]:has(:is(#image-page,#font-page,#text-page):not([hidden])){overflow-x:auto}
html[data-layout=pc]:has(:is(#image-page,#font-page,#text-page):not([hidden])) body{min-width:1200px}

