/* Photo-first workbench. Processing and saved-photo state stay in app.js. */
main{padding-top:16px}
.intro{position:absolute;width:1px;height:1px;min-height:0;margin:-1px;padding:0!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.topbar{height:56px;background:#fff;border-color:#e1e5e4}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 336px;min-height:480px;height:var(--workbench-height,calc(100dvh - 88px));background:#fff;border:1px solid #dfe4e3;border-radius:12px;box-shadow:0 6px 28px #182d2510;overflow:hidden}
.workspace .editor{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
.editorbar{height:48px;min-height:48px;flex:none;padding:0 18px;border-color:#e4e8e7;background:#fff}
.projectname{font-size:13px;gap:8px}
#collectionname{font-size:13px;font-weight:550}
#count{font-size:12px;color:#69716d}
.workspace .canvasarea{flex:1;display:flex;align-items:stretch;justify-content:stretch;min-height:0;padding:16px;overflow:hidden;background:#f3f5f4;background-image:none}
.previewwrap{display:grid;grid-template-rows:minmax(140px,1fr) 38px 32px 40px;gap:8px;height:100%;width:100%;max-width:none;min-height:0;position:relative;margin:0}
.selected-photo-line{position:absolute;top:10px;right:10px;left:10px;z-index:2;margin:0;pointer-events:none;justify-content:flex-end}
.selected-photo-line>span{display:none}
.selected-photo-line strong{max-width:70%;font-size:11px;font-weight:500;background:#ffffffed;color:#48554e;padding:5px 8px;border:1px solid #e3e7e5;border-radius:5px}
.preview,.preview:has(#compare-panel:not([hidden])){grid-row:1;position:relative;width:100%;height:100%!important;min-height:0;max-height:none;align-self:stretch;box-shadow:none;margin:0;border:1px solid #dce2df;border-radius:8px;overflow:hidden}
#previewimage{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.previewbadge{top:auto;bottom:10px;left:10px;font-size:9px;letter-spacing:.7px;border-color:#dfe4e1}
.previewwrap:has(#compare-panel:not([hidden])) .selected-photo-line{display:none}
#compare-panel{background:#fff}
#compare-stage{cursor:ew-resize;touch-action:none;user-select:none}
#compare-stage img{pointer-events:none;user-select:none}
#compare-line::after{content:'↔';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#fff;color:#193b32;border:1px solid #c9d4c3;box-shadow:0 2px 8px #193b3230;font-size:19px;line-height:1}
#compare-status{font-size:11px;line-height:1.5;color:#58645d}
.compare-label{font-size:11px}
.compare-control{font-size:11px}
.previewtools{grid-row:2;display:flex;align-items:center;justify-content:space-between;max-width:none;min-width:0;margin:0;gap:12px}
.previewtools .segmented{padding:2px;background:#fff;border:1px solid #dce2df;border-radius:7px}
.previewtools .segmented button{min-height:32px;padding:6px 12px;font-size:12px;border-radius:5px}
.previewtools .segmented button[aria-pressed=true]{background:#193b32;color:#fff}
.previewtools .muted{font-size:11px;color:#5e6a63}
.reviewrow{grid-row:3;display:flex;align-items:center;gap:12px;min-width:0;min-height:32px;margin:0;padding:0;background:none;border:0;border-radius:0}
.reviewrow button{font-size:12px;font-weight:500;min-height:32px;padding:4px 0;white-space:nowrap}
#review-count{margin-left:auto;font-size:12px;color:#626e66;line-height:1.4}
.review-guidance{position:relative;flex:none}
.review-guidance>summary{display:flex;align-items:center;gap:5px;min-height:32px;cursor:pointer;font-size:12px;color:#3f5e4b;text-decoration:underline;text-underline-offset:3px;list-style:none}
.review-guidance>summary::-webkit-details-marker{display:none}
.review-popover{position:absolute;bottom:38px;right:0;width:min(480px,62vw);max-height:min(300px,60vh);overflow:auto;z-index:24;margin:0;padding:16px;background:#fff;border:1px solid #cfd9d3;border-radius:9px;box-shadow:0 12px 36px #193b3226;color:#39473f}
.review-popover #reviewsummary{display:block;max-width:none;margin:0;font-size:12px;line-height:1.65;color:#39473f}
.review-popover #removal-warning{position:static;display:block;max-width:none;width:auto;max-height:none;overflow:visible;margin:10px 0 0;padding:0;background:none;border:0;border-radius:0;box-shadow:none;font-size:12px;line-height:1.65;color:#5a645e}
.selected-actions{grid-row:4;display:flex;align-items:center;gap:8px;min-width:0;margin:0;padding:0;border:0}
.selected-actions>#choosefocus,.selected-actions>#refine{font-size:12px;font-weight:500;min-height:36px;padding:7px 11px;border:1px solid #d5ded8;border-radius:6px;background:#fff;white-space:nowrap;justify-content:center}
.selected-actions>.photo-tools{position:static;margin:0 0 0 auto;border:0}
.selected-actions>.photo-tools>summary{display:list-item;cursor:pointer;min-height:36px;padding:7px 8px;font-size:12px;white-space:nowrap;color:#3f5147}
.selected-actions .photo-tools-grid{position:absolute;bottom:46px;left:0;right:0;max-height:min(420px,calc(var(--workbench-height,700px) - 250px),65vh);overflow:auto;z-index:20;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px;border:1px solid #cfd9d3;border-radius:9px;background:#fff;box-shadow:0 12px 36px #193b3226}
.selected-actions .photo-tools-grid>.reviewbackdroptools{grid-column:1/-1;display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin:0;gap:12px;font-size:12px}
.selected-actions .photo-tools-grid>.settingblock{margin:0;padding:12px;background:#f8faf9;border:1px solid #e1e7e3;border-radius:7px}
.selected-actions .photo-tools-grid .hint{font-size:12px;line-height:1.6;color:#606d64}
.selected-actions .photo-tools-grid .textbutton,.selected-actions .photo-tools-grid .secondary{font-size:12px;min-height:38px}
.selected-actions .reviewbackdroptools .segmented{background:#f5f7f6;border-color:#dce3de}
.filmstrip{height:76px;min-height:76px;flex:none;padding:6px 16px;gap:9px;border-color:#e1e6e3;background:#fff}
.thumb{height:64px;width:76px;flex-basis:76px;padding:3px;background:#f7f9f8;border-color:#dfe5e1;border-radius:6px}
.thumb[aria-pressed=true]{padding:2px}
.thumb img{height:40px;flex:1;min-height:0}
.thumbname{font-size:10px;padding:4px 1px 1px;color:#506056}
.addthumb{height:64px;width:44px;min-width:44px;background:#fafbfa;border-color:#cbd6ce;color:#486250;font-size:22px}
.editorfooter{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:30px;padding:2px 16px;border-color:#e4e8e5;background:#fff;color:#637066;font-size:11px}
.editorfooter>.textbutton{min-height:28px;padding:3px 0;font-size:11px}
.activity-log{position:relative;min-width:0}
.activity-log>summary{display:flex;align-items:center;min-height:26px;font-size:11px;color:#617066;cursor:pointer}
.activity-log[open] #message{display:block;position:absolute;left:0;bottom:32px;width:min(560px,62vw);max-height:200px;overflow:auto;padding:13px 15px;margin:0;background:#fff;border:1px solid #cfd9d3;border-radius:8px;box-shadow:0 10px 28px #193b3220;z-index:22;font-size:12px;line-height:1.6;color:#39473f}
.editorfooter.has-error{display:flex;min-height:40px;align-items:flex-start;padding-top:6px;padding-bottom:6px}
.editorfooter.has-error .activity-log{flex:1}
.editorfooter.has-error .activity-log>summary{color:#a63722;font-weight:600}
.editorfooter.has-error .activity-log[open] #message{position:static;width:auto;max-height:120px;padding:8px 10px;background:#fff5f1;border-color:#e8c9bf;box-shadow:none;color:#a63722}
.settings{display:flex;flex-direction:column;min-height:0;overflow:hidden;background:#fff;border-left:1px solid #dfe5e1}
.settingshead{display:none}
.inspector-tabs{order:0;position:static;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;flex:none;margin:0;padding:8px;border:0;border-bottom:1px solid #e3e8e4;border-radius:0;background:#fff;box-shadow:none}
.inspector-tabs button{min-width:0;min-height:40px;padding:8px 4px;border:0;border-radius:6px;background:transparent;font-size:12px;color:#59685e}
.inspector-tabs button[aria-selected=true]{background:#eff3f0;color:#193b32;font-weight:650;box-shadow:none}
.settings #settingsfields{order:1;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;border:0;margin:0;padding:0}
.inspector-panel .settingblock{padding:20px;border-color:#e8ece9}
.cutout-intro h2{margin:0;font-size:17px;line-height:1.3;letter-spacing:-.3px}
.cutout-intro p{margin:7px 0 10px;font-size:13px;line-height:1.5;color:#626e66}
.source-choice .textbutton{font-size:12px;min-height:36px;text-decoration:underline;text-underline-offset:3px}
.palette-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.palette-heading .hint{margin:0;font-size:12px}
.settings .label{letter-spacing:0;font-size:12px;font-weight:600}
.swatches{display:flex;flex-wrap:wrap;gap:7px}
.swatch,.customcolor{width:40px;height:40px;flex:0 0 40px}
.tool-explanation{margin-top:15px;border-top:1px solid #e2e7e3;padding-top:8px}
.tool-explanation>summary{font-size:12px;min-height:36px;cursor:pointer;color:#53665a}
.studiofinish>summary small{display:none}
.inspector-panel .label,.inspector-panel label{font-size:12px}
.inspector-panel .togglelabel strong{font-size:14px}
.inspector-panel .togglelabel small{font-size:12px;line-height:1.5;color:#657268}
.settings select,.customdimensions input{font-size:13px;min-height:42px;border-color:#d5ded8;background:#fff}
.settings input[type=range]{min-height:36px}
.settings .hint{font-size:12px;line-height:1.6;color:#606e64}
.device-note{margin:0 20px 14px;padding-top:8px;border-top:1px solid #e6ebe7;max-width:none}
.device-note .togglelabel{margin:10px 0}
.device-note>summary{min-height:38px;font-size:12px;line-height:1.5;color:#53665a;cursor:pointer}
.device-note p{font-size:12px;line-height:1.7;color:#5d6b61}
.device-note .compactgpu-choice{display:flex;margin-top:10px}
#engine{font-size:12px;line-height:1.6}
#engine:not(.loading):not(.unavailable){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
#engine.loading,#engine.unavailable{margin-top:10px;padding:0 20px}
.inspector-panel #enableengine{min-height:40px;padding:9px 12px;margin:10px 0 0;justify-content:center;font-size:12px;border:1px solid #d1dcd4;border-radius:6px;background:#f5f8f5;color:#193b32}
.style-library{order:2;flex:none;margin:0;border-top:1px solid #e1e7e2;border-bottom:0;background:#fff}
.style-library>summary{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:42px;padding:9px 18px;cursor:pointer;font-size:12px;font-weight:550;color:#4d6254}
.style-library>summary span{display:none}
.style-library .stylesblock{max-height:210px;overflow:auto;padding:12px 18px;border:0;background:#f8faf8}
.style-library .stylesblock select{min-height:40px;font-size:12px}
.style-library .stylebuttons{margin-top:8px}
.style-library .stylebuttons button{font-size:12px;min-height:36px}
.actions{order:3;flex:none;display:flex;flex-direction:column;gap:8px;padding:14px 18px;border-top:1px solid #dfe6e0;background:#fff}
.actions .wide{min-height:46px;padding:12px 14px;font-size:13px;border-radius:7px}
.actions #process,.actions #downloadone{background:#193b32;border-color:#193b32;color:#fff;justify-content:center;font-weight:600}
.actions #process:hover:not(:disabled),.actions #downloadone:hover:not(:disabled){background:#244e40}
.actions #downloadone.secondary{background:#fff;color:#193b32;border-color:#d5ded8}
.actions #progresswrap{margin:0}
.actions:has(#downloadone.primary:not([hidden])) #progresswrap{display:none}
.source-choice{margin-top:16px}
.empty .input-limits{max-width:390px;margin:auto;font-size:12px;color:#586b5e}
.empty .input-limits summary{cursor:pointer;padding:6px}
.empty .input-limits small{margin-top:8px}
.actions #progresstext{font-size:12px;line-height:1.5}
.export-options{display:flex;flex-direction:column;padding:16px 20px 0;gap:8px}
.export-options button{font-size:12px;min-height:42px;padding:10px 12px}
.export-guide{padding:12px 20px}
.export-guide>summary{font-size:12px;cursor:pointer;min-height:36px}
.export-guide>strong{display:block;margin:10px 0}
#export-quality[hidden]{display:none!important}
.bottomrow{display:none;font-size:11px;color:#647168}
#project-shelf:not([open]){display:none}
.bottomrow>.textbutton{font-size:12px;min-height:36px}
.project-shelf{border-color:#dfe6e0;background:#fff}
.project-shelf>summary{font-size:12px;color:#42594a}
.project-shelf>summary small{font-size:11px;color:#68766b}
.workspace:has(#empty:not([hidden])){grid-template-columns:minmax(0,1fr)}
.workspace:has(#empty:not([hidden])) .settings,.workspace:has(#empty:not([hidden])) .editorbar,.workspace:has(#empty:not([hidden])) .filmstrip,.workspace:has(#empty:not([hidden])) .editorfooter:not(.has-error),.workspace:has(#empty:not([hidden])) .editorfooter>#remove{display:none}
.workspace:has(#empty:not([hidden])) .canvasarea{align-items:center;justify-content:center;min-height:0;padding:32px;background:#fff}
.empty{width:100%;max-width:470px;margin:auto;padding:24px 12px}
.empty .emptyicon,.empty .empty-kicker{display:none}
.empty h2{font-size:30px;font-weight:550;letter-spacing:-.8px;line-height:1.2;margin:0 0 14px}
.empty p{font-size:14px;line-height:1.7;color:#637066;max-width:370px;margin:0 auto 23px}
.empty .primary{min-height:48px;font-size:14px;padding:13px 22px;background:#193b32;color:#fff;border-color:#193b32}
.empty .samplebutton{font-size:12px;min-height:40px;margin:12px auto 20px;color:#4b6253}
.empty small{display:block;max-width:390px;margin:auto;font-size:11px;line-height:1.7;color:#6a756e}
.empty .privacy{display:flex;justify-content:center;gap:0;margin:22px auto 0;white-space:normal;text-align:center}
.empty .privacyicon{display:none}
.empty .privacy strong{font-size:12px;font-weight:550;color:#4a6151}
.empty .privacy span:not(.privacyicon){font-size:11px;line-height:1.6;color:#68756c}
@media(max-width:1100px){.workspace{grid-template-columns:minmax(0,1fr) 312px}.selected-actions>#choosefocus,.selected-actions>#refine{font-size:11px;padding:7px 8px}.reviewrow{gap:9px}#review-count,.review-guidance>summary{font-size:11px}}
@media(max-width:900px){
  main{padding-top:14px}
  .workspace{display:flex;flex-direction:column;height:auto;min-height:0;max-height:none;overflow:visible}
  .workspace .editor{height:auto;overflow:visible}
  .workspace .canvasarea{padding:16px;min-height:0;overflow:visible}
  .previewwrap{height:auto;display:flex;flex-direction:column;gap:12px}
  .preview,.preview:has(#compare-panel:not([hidden])){height:clamp(300px,58vw,500px)!important;min-height:280px;flex:none}
  .previewtools .segmented button{min-height:44px;font-size:12px}
  .reviewrow{height:auto;min-height:44px}
  .reviewrow button{min-height:44px;font-size:12px}
  #review-count,.review-guidance>summary{font-size:12px}
  .review-guidance>summary{min-height:44px}
  .selected-actions{position:relative;min-height:44px}
  .selected-actions>#choosefocus,.selected-actions>#refine{min-height:44px;font-size:12px}
  .selected-actions>.photo-tools>summary{min-height:44px;font-size:12px}
  .selected-actions .photo-tools-grid{bottom:52px;max-height:60vh}
  .filmstrip{height:86px;min-height:86px;padding:8px 16px}
  .thumb{height:68px}.thumb img{height:44px}.addthumb{height:68px}
  .editorfooter{min-height:36px;padding:4px 16px}
  .editorfooter>.textbutton,.activity-log>summary{min-height:32px}
  .settings{overflow:visible;border-left:0;border-top:1px solid #dfe5e1}
  .settings #settingsfields{overflow:visible;flex:none}
  .inspector-tabs{position:sticky;top:0;z-index:12;background:#fff}
  .inspector-tabs button{min-height:44px;font-size:13px}
  .inspector-panel .settingblock{padding:20px}
  .style-library>summary{min-height:44px;padding:11px 20px}
  .actions{padding:14px 20px}
  .workspace:has(#empty:not([hidden])) .canvasarea{min-height:calc(100svh - 125px);padding:24px}
}
@media(max-width:700px){
  body:not(.has-editor-photos){padding-bottom:0}
  body.has-editor-photos{padding-bottom:calc(78px + env(safe-area-inset-bottom))}
  .mobile-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(75px,1fr));gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border:0;border-top:1px solid #d8e1da;border-radius:0;background:#fff;box-shadow:0 -3px 12px #193b3210}
  .mobile-actions button{font-size:12px;min-height:46px;border:1px solid #d8e1da;border-radius:6px;background:#f5f8f5;color:#193b32}
  .mobile-actions #mobile-process,.mobile-actions #mobile-download{background:#193b32;border-color:#193b32;color:#fff}
}
@media(max-width:600px){
  main{padding:12px 12px 0}
  .topbar{height:56px;padding:0 16px}
  .topright{gap:16px}.topright .textbutton{font-size:12px}
  .workspace .canvasarea{padding:12px}
  .selected-photo-line{top:9px;right:9px;left:9px}
  .selected-photo-line strong{font-size:10px;max-width:78%}
  .preview,.preview:has(#compare-panel:not([hidden])){height:310px!important;min-height:260px}
  .preview:has(#compare-panel:not([hidden])){height:365px!important}
  .previewtools{gap:8px}
  .previewtools .segmented button{padding:8px 9px;font-size:11px;min-height:44px}
  .previewtools .muted{font-size:10px;max-width:105px;text-align:right;line-height:1.5}
  .reviewrow{display:grid;grid-template-columns:1fr auto;gap:0 8px;align-items:center}
  .reviewrow button{grid-column:1;min-height:44px}
  #review-count{grid-row:2;grid-column:1/-1;margin:0;font-size:11px}
  .review-guidance{grid-row:1;grid-column:2}
  .review-guidance>summary{font-size:11px;min-height:44px}
  .review-popover{position:fixed;left:16px;right:16px;top:20vh;bottom:auto;width:auto;max-height:55vh;z-index:45;font-size:12px}
  .selected-actions{gap:7px}
  .selected-actions>#choosefocus,.selected-actions>#refine{min-width:0;flex:1;white-space:normal;line-height:1.4;padding:8px 7px;font-size:11px;min-height:44px}
  .selected-actions>.photo-tools{margin-left:0;flex:0 0 auto}
  .selected-actions>.photo-tools>summary{min-height:44px;padding:8px 5px;font-size:11px}
  .selected-actions .photo-tools-grid{grid-template-columns:1fr;bottom:52px;padding:12px;max-height:60vh}
  .selected-actions .photo-tools-grid .textbutton,.selected-actions .photo-tools-grid .secondary{min-height:44px;font-size:12px}
  .selected-actions .photo-tools-grid>.reviewbackdroptools{flex-direction:column;align-items:stretch;gap:8px}
  .selected-actions .reviewbackdroptools .segmented button{min-height:40px;font-size:11px}
  .filmstrip{padding:8px 12px}
  .editorfooter{padding:4px 12px;font-size:11px}
  .activity-log[open] #message{position:fixed;left:16px;right:16px;bottom:88px;width:auto;max-height:40vh}
  .editorfooter.has-error .activity-log[open] #message{position:static;width:auto}
  .settings select,.customdimensions input{font-size:16px;min-height:44px}
  .settings input[type=range]{min-height:40px}
  .swatch,.customcolor{width:44px;height:44px;flex-basis:44px}
  .device-note>summary{min-height:44px}
  .inspector-panel #enableengine{min-height:44px;font-size:12px}
  .export-options button{min-height:44px}
  .bottomrow{align-items:flex-start;font-size:11px;line-height:1.6}
  .bottomrow>.textbutton{min-height:40px;font-size:12px}
  .workspace:has(#empty:not([hidden])) .canvasarea{min-height:calc(100svh - 112px);padding:20px 16px}
  .empty{padding:20px 0}
  .empty h2{font-size:27px}
  .empty p{font-size:13px;line-height:1.65}
  .empty small{font-size:11px}
  .empty .privacy{margin-top:18px}
}
