/* PortraitCraft arrangement: image controls / large preview / output and context. */
body[data-page="home"] .header .mainnav{display:none}
body[data-page="tool"] .header{height:84px;min-height:84px}
body[data-page="tool"] .header .brand-logo{width:76px}
body[data-page="tool"] .moremenu{top:78px}
.image-studio{max-width:none;padding:0 12px 20px}
.image-studio .studio-title{padding:13px 2px 15px;gap:18px;flex-direction:row;align-items:center}
.image-studio .studio-title>div:first-child{display:flex;align-items:center;gap:14px;min-width:0}
.image-studio .studio-title h1{font-size:21px;margin:0}
.image-studio .studio-title p{display:none}
.image-studio .studio-top-actions{max-width:none;width:auto;flex-shrink:0}
.portraitcraft-layout{grid-template-columns:264px minmax(0,1fr) 280px;gap:12px;align-items:start;padding:0}
.portraitcraft-layout>*{min-width:0}
.portraitcraft-layout .left-panel{position:sticky;top:8px;max-height:calc(100dvh - 16px);display:flex;flex-direction:column}
.portraitcraft-layout .portraitcraft-options-slot{min-height:0;overflow:auto;scrollbar-width:thin}
.studio-canvas-presets{padding:12px;flex:0 0 auto;border-bottom:1px solid var(--line);background:var(--theme-surface)}
.studio-ratio-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px}
.studio-ratio-heading h2{font-size:12px;margin:0}
.studio-ratio-heading small{font-size:9px;color:var(--muted);font-variant-numeric:tabular-nums}
.studio-ratio-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin-bottom:10px}
.image-studio .studio-ratio-grid button{min-height:30px;padding:5px 2px;font-size:10px;border-radius:5px}
.studio-fit-control{margin:0 0 10px}
.studio-fit-title{margin:0 0 6px;font-size:10px;font-weight:700;color:var(--text)}
.studio-fit-choice{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.image-studio .studio-fit-choice button{min-height:34px;padding:6px 4px;border:1px solid var(--line);border-radius:6px;background:var(--theme-surface);color:var(--text);font-size:10px;line-height:1.25}
.image-studio .studio-fit-choice button[aria-pressed="true"]{border-color:var(--accent,#6558e8);background:color-mix(in srgb,var(--accent,#6558e8) 12%,var(--theme-surface));font-weight:700}
.studio-fit-help{margin:6px 0 0;color:var(--muted);font-size:9px;line-height:1.45}
.studio-canvas-presets .studio-field{display:flex;flex-direction:column;gap:5px;font-size:10px;color:var(--muted)}
.studio-canvas-presets input{padding:7px;min-height:34px}
.image-studio .studio-ratio-apply{width:100%;min-height:31px;margin-top:9px;padding:5px;font-size:10px}
.portraitcraft-layout .workflow{grid-template-columns:repeat(3,minmax(0,1fr));padding:8px;gap:4px}
.portraitcraft-layout .workflow button{min-width:0;padding:9px 3px;font-size:10px;text-align:center;min-height:36px}
.portraitcraft-layout .studio-tools{padding:10px 10px 0;gap:3px}
.portraitcraft-layout .studio-tools button{min-width:64px;font-size:10px;padding:7px 4px}
.portraitcraft-layout .studio-inspector{border:0;padding:17px}
.portraitcraft-layout .studio-inspector h2{font-size:14px;margin-bottom:15px}
.portraitcraft-layout .studio-inspector [data-ui="panel"],.studio-selection-inspector [data-ui="selectionPanel"]{display:flex;flex-direction:column;gap:14px}
.studio-selection-inspector{padding:18px}
.studio-selection-inspector h2{font-size:14px;margin:0 0 16px}
.studio-selection-inspector .studio-section-label{padding-top:0;border:0}
.portraitcraft-layout .stage-card{min-width:0;display:flex;flex-direction:column;min-height:calc(100dvh - 184px)}
.portraitcraft-layout .studio-history{flex-direction:column;align-items:stretch;gap:9px;margin:0;padding:11px 14px;background:var(--theme-surface);border:0;border-bottom:1px solid var(--line)}
.portraitcraft-layout .studio-history>div{width:100%;flex-wrap:wrap}
.portraitcraft-layout .studio-history>div:last-child{justify-content:flex-start;gap:5px}
.portraitcraft-layout .studio-history button{min-width:0;padding:5px 8px;font-size:10px;min-height:30px;white-space:nowrap}
.portraitcraft-layout .studio-history [data-ui="fileMeta"]{max-width:calc(100% - 90px);font-size:10px}
.portraitcraft-layout .studio-history label{margin-left:auto;font-size:10px;gap:5px}
.portraitcraft-layout .studio-history input[type="range"]{width:65px}
.portraitcraft-layout .studio-workarea{padding:14px;min-height:calc(100dvh - 285px);flex:1}
.portraitcraft-layout .studio-empty{min-height:0;flex:none;width:min(100%,calc(54dvh * var(--empty-ratio,1.77778)));margin:auto;padding:20px;background:var(--theme-surface)}
.portraitcraft-layout .studio-empty>div{width:44px;height:44px;font-size:25px;margin-bottom:12px}
.portraitcraft-layout .studio-empty h2{font-size:18px;margin-bottom:10px}
.portraitcraft-layout .studio-empty p{font-size:12px;margin-bottom:12px}
.portraitcraft-layout .studio-empty small{font-size:10px}
.portraitcraft-layout .studio-before-stage,.portraitcraft-layout .studio-scroll,.portraitcraft-layout .studio-sheet{background:var(--theme-surface);background-image:none}
.portraitcraft-layout .studio-comparison{grid-template-columns:1fr 1fr;gap:12px;flex:1}
.portraitcraft-layout .studio-comparison:is(.is-result,.is-original,.is-wipe){grid-template-columns:minmax(0,1fr)}
.portraitcraft-layout .studio-comparison.is-result .studio-before,.portraitcraft-layout .studio-comparison.is-original .studio-after{display:none}
.portraitcraft-layout .studio-before-stage,.portraitcraft-layout .studio-scroll{min-height:calc(100dvh - 370px);padding:24px 16px;align-items:center}
.portraitcraft-layout .studio-before-stage canvas{max-height:62dvh}
.portraitcraft-layout .studio-sheet{width:min(100%,calc(62dvh * var(--document-ratio)))}
.portraitcraft-layout .studio-bottom-meta{padding:12px 0 0;gap:5px;flex-direction:column}
.portraitcraft-layout .studio-bottom-meta [role="status"]{max-width:100%;text-align:left}
.portraitcraft-output{position:sticky;top:8px;max-height:calc(100dvh - 16px);overflow:auto;scrollbar-width:thin;display:flex;flex-direction:column;gap:10px}
.studio-dock-card{border:1px solid var(--line);border-radius:8px;background:var(--theme-surface);overflow:hidden;flex-shrink:0}
.studio-dock-card>h2{margin:0;padding:13px 14px;font-size:12px;font-weight:700;border-bottom:1px solid var(--line)}
.studio-dock-card>h2:has(button){padding:0}
.studio-dock-card>h2>button{border:0;border-radius:0;background:transparent;width:100%;display:flex;justify-content:space-between;align-items:center;padding:13px 14px;min-height:42px;font-size:12px;text-align:left}
.studio-dock-card>h2>button[aria-expanded="true"]{color:var(--blue);background:var(--theme-accent-soft)}
.studio-output-meta{font-size:14px;font-weight:700;padding:12px 14px 0;margin:0;letter-spacing:-.3px}
.studio-dock-content{display:flex;flex-direction:column;gap:12px;padding:14px}
.studio-dock-content .studio-field{display:flex;flex-direction:column;gap:7px;font-size:10px;line-height:1.5}
.studio-dock-content .studio-fields-row{gap:8px}
.studio-dock-content .studio-fields-row>button{padding:8px 4px;font-size:11px}
.studio-dock-content .studio-help{font-size:10px;line-height:1.6}
.portraitcraft-output .studio-inspector{padding:14px}
.portraitcraft-output .studio-inspector>[data-ui="panelTitle"]{display:none}
.portraitcraft-output .studio-inspector .studio-field{font-size:11px}
.portraitcraft-layout .studio-layers{margin:0;padding:14px;border:0}
.portraitcraft-layout .studio-layers [data-ui="layers"]{flex-direction:column}
.portraitcraft-layout .studio-layers [data-ui="layers"]>button{max-width:none}
.portraitcraft-layout .studio-layers h2{font-size:12px;margin:0}
.portraitcraft-layout .studio-layers p{font-size:11px;color:var(--muted)}
@media(max-width:1250px){
 .portraitcraft-layout{grid-template-columns:224px minmax(0,1fr) 248px;gap:9px}
 .portraitcraft-layout .studio-inspector,.studio-selection-inspector{padding:14px}
 .portraitcraft-layout .studio-workarea{padding:12px}
 .image-studio .studio-title p{max-width:370px}
 .portraitcraft-layout .studio-history label{margin-left:0}
}
@media(max-width:980px){
 .portraitcraft-layout{grid-template-columns:235px minmax(0,1fr)}
 .portraitcraft-output{position:static;max-height:none;grid-column:2;display:grid;grid-template-columns:1fr 1fr;align-items:start;overflow:visible}
 .portraitcraft-output .studio-output-card{grid-row:span 2}
 .portraitcraft-output .studio-layer-card{grid-column:1/-1}
 .portraitcraft-layout .left-panel{grid-row:span 2}
 .portraitcraft-layout .stage-card{min-height:600px}
 .image-studio .studio-title{flex-wrap:wrap;gap:10px}
 .image-studio .studio-title p{max-width:none}
}
@media(max-width:700px){
 body[data-page="tool"] .header{height:78px;min-height:78px}
 body[data-page="tool"] .header .brand-logo{width:70px}
 .image-studio{padding:0 8px 16px}
 .image-studio .studio-title{align-items:flex-start;flex-direction:column}
 .image-studio .studio-top-actions{width:100%;gap:5px}
 .image-studio .studio-top-actions button{padding:8px 5px;font-size:10px;flex:1}
 .portraitcraft-layout{display:flex;flex-direction:column;gap:9px}
 .portraitcraft-layout .left-panel{position:static;width:100%;max-height:none;overflow:hidden;order:2}
 .portraitcraft-layout .portraitcraft-options-slot{overflow:auto;max-height:240px}
 .portraitcraft-layout .workflow{grid-template-columns:repeat(3,1fr)}
 .portraitcraft-layout .studio-inspector [data-ui="panel"]{display:flex}
 .portraitcraft-layout .stage-card{width:100%;min-height:430px;order:1}
 .portraitcraft-layout .studio-workarea{min-height:320px;padding:10px}
 .portraitcraft-layout .studio-empty{min-height:160px;padding:14px}
 .portraitcraft-layout .studio-empty h2{font-size:16px}
 .portraitcraft-layout .studio-empty small{display:none}
 .portraitcraft-layout .studio-before-stage,.portraitcraft-layout .studio-scroll{min-height:240px;padding:24px 10px}
 .portraitcraft-layout .studio-sheet{width:min(100%,calc(45dvh * var(--document-ratio)))}
 .portraitcraft-layout .studio-history{padding:9px;gap:7px}
 .portraitcraft-layout .studio-history>div:last-child{justify-content:flex-start}
 .portraitcraft-output{width:100%;display:flex;order:3}
 .portraitcraft-layout .studio-layers{display:block}
}
