/* The supplied reference: full-width viewing bar, photo, tools, then upload and examples. */
.local-file-notice[hidden] { display:none!important; }
.local-file-notice { width:min(620px,calc(100% - 32px)); margin:40px auto; padding:28px; border:1px solid #4b7b94; border-radius:16px; background:#0a2533; color:#edf8ff; }
.local-file-notice h2 { margin:0 0 12px; font-size:28px; line-height:1.25; }
.local-file-notice p { margin:0 0 22px; font-size:17px; line-height:1.5; }
.local-file-notice .button { display:inline-flex; min-height:46px; font-size:17px; padding:10px 18px; text-decoration:none; }
body.local-file-preview .workspace,body.local-file-preview .visualizer-footnote { display:none!important; }
body:not(.is-editing):not(.preview-expanded) .workspace,
body.controls-open:not(.is-editing):not(.preview-expanded) .workspace {
  grid-template-rows:auto minmax(0,1fr);
  column-gap:14px;
  row-gap:12px;
}
.workspace > .viewer-toolbar { grid-column:1/-1; grid-row:1; }
.workspace > .visualizer { grid-column:1; grid-row:2; }
.workspace > .finish-panel { grid-column:2; grid-row:2; }
.photo-workspace { grid-template-columns:minmax(0,var(--fitted-photo-width,1fr)) 80px; justify-content:center; }
.photo-workspace[data-has-photos=false] { grid-template-columns:minmax(0,var(--fitted-photo-width,1fr)); }
body .viewer-toolbar { border-radius:0; background:transparent; padding:2px 0 8px; }
body .viewer-toolbar .viewer-tip { margin-left:auto; }
.viewer-toolbar #saveButton {
  flex:0 0 auto; min-width:120px; min-height:44px; padding:7px 20px;
  color:#06131b; background:linear-gradient(120deg,#cdf5ff,#99dcf4);
  border:1px solid #c8f3ff; border-radius:12px; font-size:17px;
}
.viewer-toolbar #saveButton:disabled { background:#466073; border-color:#536f81; color:#102331; }
body .viewer-toolbar .saved-looks-controls { margin-left:auto; }

/* A single lower panel replaces the upload bar and tiny moving thumbnail. */
.cleanup-showcase {
  display:grid; grid-template-columns:minmax(150px,19%) minmax(0,1fr);
  align-items:stretch; gap:16px; flex:0 0 auto; min-width:0;
  padding:14px 16px 12px; border:2px solid #60e7ff; border-radius:19px;
  background:linear-gradient(125deg,#0b2938,#03141e);
  box-shadow:0 0 12px #34d9ff50,inset 0 0 13px #46d8ff20;
}
body .cleanup-showcase .garage-upload-banner {
  position:static; display:flex; flex-direction:column; justify-content:center; align-items:center;
  grid-column:1; grid-row:1; gap:10px; width:100%; max-width:none; aspect-ratio:auto;
  padding:12px 8px; border:1px solid #a1d8e8; border-radius:16px;
  background:linear-gradient(140deg,#103747,#03151d); color:#f5fcff; text-align:center;
  animation:ecc-upload-glow 2.8s ease-in-out infinite; overflow:visible;
}
.cleanup-showcase .garage-upload-icon { grid-area:auto; width:52px; height:42px; }
.cleanup-showcase .garage-upload-title { grid-area:auto; font-size:clamp(16px,1.5vw,23px); line-height:1.25; white-space:normal; }
.cleanup-showcase .garage-upload-subtitle {
  grid-area:auto; margin:0; padding:5px 8px; border:1px solid #4b91ae; border-radius:18px;
  background:#163f54; font-size:13px; line-height:1.25; white-space:normal;
}
.cleanup-showcase .upload-allowance { max-width:150px; margin:0; font-size:12px; line-height:1.4; color:#c3e5f1; }
.cleanup-comparison { display:flex; flex-direction:column; min-width:0; gap:9px; margin:0; }
.cleanup-preview-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; min-width:0; }
.cleanup-example { position:relative; min-width:0; overflow:hidden; border:1px solid #4f7283; border-radius:14px; background:#071b25; }
.cleanup-example img { display:block; width:100%; height:auto; aspect-ratio:1672/941; object-fit:contain; }
.cleanup-example > span { position:absolute; left:10px; top:8px; padding:4px 13px; border-radius:8px; background:#061b28eb; color:#fff; font-size:19px; line-height:1.3; font-weight:700; }
.cleanup-comparison figcaption { display:flex; align-items:center; gap:18px; min-width:0; }
.cleanup-comparison figcaption strong { flex:0 0 auto; font-size:15px; line-height:1.35; }
body .cleanup-comparison .preview-note { margin:0; padding-left:18px; border-left:1px solid #85afc2; text-align:left; color:#d5e7f0; font-size:12px; line-height:1.4; }
body.is-editing .cleanup-showcase,body.preview-expanded .cleanup-showcase { display:none!important; }
body.is-editing .workspace > .viewer-toolbar { display:none!important; }
body.is-editing .workspace > .visualizer,body.preview-expanded .workspace > .visualizer { grid-row:1; grid-column:1; }
body.preview-expanded .viewer-toolbar { grid-row:1; grid-column:1; width:auto; border:0; padding:0; }
body.preview-expanded #saveButton { display:none; }

/* Keep photo actions in More; transient cleanup feedback uses no layout space. */
body .settings-pane .uploaded-photo-tools { justify-content:flex-start; margin:0 0 12px; }
body #stageFrame > .cleanup-inline-status {
  position:absolute; z-index:8; left:10px; right:10px; bottom:10px;
  width:fit-content; max-width:calc(100% - 20px); margin:0 auto; padding:7px 12px;
  border:1px solid #42687b; border-radius:9px; background:#071c28ee;
  box-sizing:border-box; font-size:13px; line-height:1.35;
}

/* A slimmer header and tools give their space back to the photograph. */
@media(min-width:741px) and (min-height:521px) {
  body .site-header { height:54px; min-height:54px; flex-basis:54px; }
  body .site-header h1 { font-size:clamp(24px,2.5vw,36px); }
  body .brand-symbol { width:54px; }
  body .brand-wordmark { width:138px; }
  body .brand-divider { height:30px; }
  body:not(.is-editing):not(.preview-expanded) .primary-tools { padding:2px 4px; }
  body:not(.is-editing):not(.preview-expanded) .primary-tools > button {
    min-height:36px; padding:3px 6px; gap:7px; font-size:14px;
  }
  body .primary-tools .icon { width:21px; height:21px; }
}

@media(min-width:1100px) {
  body .viewer-toolbar .segmented button { padding-inline:28px; }
  body .visualizer-footnote { min-height:36px; padding-block:4px; }
  .cleanup-showcase { height:220px; }
  .cleanup-comparison { min-height:0; }
  .cleanup-preview-pair { flex:1; min-height:0; }
  .cleanup-example img { height:100%; object-fit:cover; }
}
@media(min-width:741px) and (max-width:1099px) and (min-height:521px) {
  body .site-header h1 { left:auto; right:18px; transform:none; font-size:28px; }
  .cleanup-showcase { grid-template-columns:135px minmax(0,1fr); gap:10px; padding:10px; }
  .cleanup-preview-pair { gap:10px; }
  .cleanup-showcase .garage-upload-icon { width:36px; height:31px; }
  .cleanup-showcase .garage-upload-title { font-size:15px; }
  .cleanup-showcase .garage-upload-subtitle { font-size:11px; }
  .cleanup-comparison figcaption { align-items:flex-start; flex-direction:column; gap:3px; }
  body .cleanup-comparison .preview-note { padding:0; border:0; font-size:11px; }
  .cleanup-example > span { left:6px; top:6px; padding:3px 7px; font-size:14px; }
  .viewer-toolbar #saveButton { min-width:90px; padding-inline:12px; }
}
@media(max-width:740px) {
  body:not(.is-editing):not(.preview-expanded) .workspace { row-gap:7px; }
  body.controls-open:not(.is-editing):not(.preview-expanded) .workspace { grid-template-rows:auto minmax(0,1fr) auto; }
  .workspace > .finish-panel { grid-column:1; grid-row:3; }
  body .viewer-toolbar { min-height:40px; gap:6px; padding:0 0 4px; }
  body .viewer-toolbar > .segmented { flex:1; width:auto; min-width:0; }
  body .viewer-toolbar .segmented button { flex:1; min-width:0; padding:5px; font-size:13px; }
  .viewer-toolbar #saveButton { min-width:59px; min-height:38px; padding:6px; gap:4px; font-size:12px; border-radius:9px; }
  .viewer-toolbar #saveButton .icon { width:16px; height:16px; }
  body .viewer-toolbar:has(.saved-looks-controls:not([hidden])) { display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .viewer-toolbar:has(.saved-looks-controls:not([hidden])) > .segmented { grid-column:1; grid-row:1; }
  .viewer-toolbar:has(.saved-looks-controls:not([hidden])) #saveButton { grid-column:2; grid-row:1; }
  body .viewer-toolbar .saved-looks-controls { grid-column:1/-1; grid-row:2; width:100%; margin:0; }
  body .saved-looks-controls select { width:100%; max-width:none; min-height:30px; font-size:12px; }
  .cleanup-showcase { grid-template-columns:94px minmax(0,1fr); gap:8px; padding:8px; border-radius:13px; }
  body .cleanup-showcase .garage-upload-banner { gap:5px; padding:7px 4px; border-radius:10px; min-height:0; }
  .cleanup-showcase .garage-upload-icon { width:30px; height:25px; }
  .cleanup-showcase .garage-upload-title { font-size:12px; line-height:1.2; }
  .cleanup-showcase .garage-upload-subtitle { font-size:9px; padding:3px 4px; }
  .cleanup-showcase .upload-allowance { font-size:10px; line-height:1.25; }
  .cleanup-comparison { gap:5px; justify-content:center; }
  .cleanup-preview-pair { gap:6px; }
  .cleanup-example { border-radius:7px; }
  .cleanup-example > span { left:3px; top:3px; padding:2px 5px; border-radius:4px; font-size:10px; }
  .cleanup-comparison figcaption { display:block; }
  .cleanup-comparison figcaption strong { font-size:11px; }
  body .cleanup-comparison .preview-note { display:none; }
  body .photo-workspace { min-height:140px; }
  .photo-workspace { grid-template-columns:minmax(0,var(--fitted-photo-width,1fr)) 55px; }
  body.is-editing .photo-workspace,body.preview-expanded .photo-workspace { min-height:0; }
}
@media(max-height:520px) and (min-width:600px) {
  body.controls-open:not(.is-editing):not(.preview-expanded) .workspace { grid-template-rows:auto minmax(0,1fr); }
  .workspace > .finish-panel { grid-column:2; grid-row:2; }
  body .viewer-toolbar { min-height:36px; }
  body .viewer-toolbar > .segmented { width:auto; flex:0 1 auto; }
  body .viewer-toolbar .segmented button { font-size:12px; min-height:34px; padding:4px 10px; }
  .viewer-toolbar #saveButton { min-width:68px; min-height:34px; padding:4px 8px; font-size:12px; }
  .viewer-toolbar #saveButton .icon { width:15px; height:15px; }
  .cleanup-showcase { grid-template-columns:125px minmax(0,1fr); gap:8px; padding:5px 7px; border-radius:10px; }
  body .cleanup-showcase .garage-upload-banner { min-height:0; gap:2px; padding:4px; }
  .cleanup-showcase .garage-upload-icon,.cleanup-showcase .garage-upload-subtitle { display:none; }
  .cleanup-showcase .garage-upload-title { font-size:12px; }
  .cleanup-showcase .garage-upload-title br { display:none; }
  .cleanup-showcase .upload-allowance { font-size:10px; }
  .cleanup-preview-pair { gap:7px; }
  .cleanup-example img { max-height:54px; object-fit:cover; }
  .cleanup-example > span { top:3px; left:3px; padding:2px 5px; border-radius:4px; font-size:10px; }
  .cleanup-comparison figcaption { display:none; }
  body .photo-workspace { min-height:0; }
  .photo-workspace { grid-template-columns:minmax(0,var(--fitted-photo-width,1fr)) 58px; }
}
/* Small phones may scroll the supporting panels; never squeeze or overlap the photo. */
@media(max-width:740px) and (orientation:portrait) {
  html:has(body:not(.is-editing):not(.preview-expanded)) { overflow-y:auto; }
  body:not(.is-editing):not(.preview-expanded) { height:auto; min-height:100dvh; overflow:visible; }
  body:not(.is-editing):not(.preview-expanded) .workspace,
  body.controls-open:not(.is-editing):not(.preview-expanded) .workspace {
    flex:0 0 auto; grid-template-rows:auto auto auto; align-content:start;
  }
  body:not(.is-editing):not(.preview-expanded) .photo-workspace {
    flex:0 0 auto; min-height:0;
    height:calc(min(60dvh,(100vw - 20px) / var(--photo-ratio,1.5) + 4px) + var(--photo-shelf-height,0px));
  }
}
@media(max-width:740px) and (min-height:521px) {
  body:not(.is-editing):not(.preview-expanded) .site-header,
  body.controls-open.colours-active:not(.is-editing):not(.preview-expanded) .site-header { height:44px; min-height:44px; flex-basis:44px; padding-block:2px; }
  body:not(.is-editing):not(.preview-expanded) .primary-tools > button { min-height:44px; gap:2px; }
}
@media(prefers-reduced-motion:reduce) { body .cleanup-showcase .garage-upload-banner { animation:none; } }

/* One aligned before/after comparison, with the same moving divider everywhere. */
  .cleanup-preview-pair { position:relative; display:grid; grid-template-columns:minmax(0,1fr); gap:0; overflow:hidden; border:1px solid #4f7283; border-radius:7px; isolation:isolate; }
  .cleanup-preview-pair .cleanup-example { grid-area:1/1; border:0; border-radius:0; }
  .cleanup-preview-pair .cleanup-example:first-child { z-index:2; clip-path:inset(0 50% 0 0); animation:cleanup-wipe-photo 8s ease-in-out infinite; }
  .cleanup-preview-pair .cleanup-example + .cleanup-example { z-index:1; clip-path:inset(0 0 0 50%); animation:cleanup-wipe-after 8s ease-in-out infinite; }
  .cleanup-example img { max-height:none; height:auto; object-fit:contain; }
  .cleanup-example > span { display:block; top:3px; left:3px; padding:3px 7px; font-size:14px; pointer-events:none; }
  .cleanup-example + .cleanup-example > span { left:auto; right:3px; }
  .cleanup-wipe-line { display:block; position:absolute; z-index:3; top:0; bottom:0; left:50%; width:2px; margin-left:-1px; background:white; box-shadow:0 0 5px #0008; pointer-events:none; animation:cleanup-wipe-divider 8s ease-in-out infinite; }
  .cleanup-wipe-line::after { content:''; position:absolute; top:50%; left:50%; width:6px; height:22px; border-radius:4px; background:white; transform:translate(-50%,-50%); box-shadow:0 1px 5px #0006; }
@keyframes cleanup-wipe-photo { 0%,10%,100% { clip-path:inset(0 100% 0 0); } 45%,60% { clip-path:inset(0 0 0 0); } }
@keyframes cleanup-wipe-after { 0%,10%,100% { clip-path:inset(0 0 0 0); } 45%,60% { clip-path:inset(0 0 0 100%); } }
@keyframes cleanup-wipe-divider { 0%,10%,100% { left:0%; } 45%,60% { left:100%; } }
@media(prefers-reduced-motion:reduce) {
  .cleanup-preview-pair .cleanup-example:first-child,.cleanup-preview-pair .cleanup-example + .cleanup-example,.cleanup-wipe-line { animation:none; }
}

@media(min-width:741px) and (min-height:521px) {
  .cleanup-comparison { flex-direction:row; align-items:center; gap:18px; }
  .cleanup-comparison .cleanup-preview-pair { flex:0 1 332px; width:52%; max-width:332px; height:auto; aspect-ratio:1672/941; }
  .cleanup-comparison figcaption { flex:1; flex-direction:column; align-items:flex-start; gap:10px; }
  .cleanup-comparison figcaption strong { font-size:17px; }
  body .cleanup-comparison .preview-note { border:0; padding:0; font-size:14px; }
}

/* Desktop viewing row: 42.75 px, reduced by 25% from its previous 57 px. */
@media(min-width:1100px) and (min-height:521px) {
  body .viewer-toolbar { height:42.75px; min-height:42.75px; padding:1px 0 6px; box-sizing:border-box; }
  body .viewer-toolbar > .segmented { padding:1px; }
  body .viewer-toolbar .segmented button { min-height:32px; padding-block:3px; font-size:16px; }
  .viewer-toolbar #saveButton { min-height:33px; padding-block:3px; font-size:16px; }
  body .saved-looks-controls select { min-height:28px; padding-block:3px; }
}

/* Larger swatches in two columns; all colours stay available by scrolling down. */
body #blendGrid {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:none;
  grid-auto-flow:row; grid-auto-rows:max-content; align-content:start; align-items:start;
  flex:1 1 auto; width:100%; max-width:100%; height:100%; min-height:0; gap:12px;
  padding:3px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
  touch-action:pan-y; scroll-snap-type:none; scrollbar-width:thin; scrollbar-color:#60748b transparent;
}
body #blendGrid .blend-card { flex:none; width:100%; height:auto; min-height:0; scroll-snap-align:none; }
body #blendGrid .blend-art { flex:none; width:100%; height:auto; min-height:0; aspect-ratio:3/2; }
body #blendGrid .blend-name { font-size:16px; line-height:22px; }
body #blendGrid::-webkit-scrollbar { width:7px; height:0; }
body #blendGrid::-webkit-scrollbar-thumb { background:#60748b; border-radius:4px; }
@media(max-width:740px) and (orientation:portrait) {
  body.colours-active:not(.is-editing):not(.preview-expanded) .finish-panel { height:clamp(320px,54dvh,520px); min-height:320px; }
  body.colours-active:not(.is-editing):not(.preview-expanded) #controlsBody { flex:1 1 auto; min-height:0; overflow:hidden; }
  body.colours-active:not(.is-editing):not(.preview-expanded) #blendsPane { height:100%; overflow:hidden; }
}
.upload-cleanup-prompt h2 { margin-top:0; letter-spacing:0; line-height:1.25; }
.upload-cleanup-prompt > img { display:block; width:100%; max-height:230px; object-fit:contain; border-radius:10px; background:#071923; }
.upload-cleanup-prompt .cleanup-prompt-privacy { font-size:14px; line-height:1.4; color:#bad1df; }
.cleanup-prompt-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:20px; }
.cleanup-prompt-actions .button { flex:1; min-height:46px; padding:9px 12px; font-size:16px; }

/* Put today's photos above the full-width photograph on phones. */
@media(max-width:740px), (max-width:1100px) and (max-height:500px) {
  body:not(.is-editing):not(.preview-expanded) .photo-workspace {
    --photo-shelf-placement:top; display:flex; flex-direction:column; gap:7px; justify-content:flex-start;
  }
  body:not(.is-editing):not(.preview-expanded) .photo-workspace > .stage-frame { flex:1; min-height:0; width:100%; }
  body:not(.is-editing):not(.preview-expanded) .photo-shelf {
    order:-1; flex:0 0 auto; width:100%; overflow-x:auto; overflow-y:hidden;
  }
  .photo-shelf-list { flex-direction:row; width:max-content; min-width:100%; gap:7px; padding:1px 1px 3px; align-items:stretch; }
  .photo-shelf-tile { flex:0 0 76px; width:76px; padding:4px; font-size:12px; }
  .photo-shelf-tile img { height:40px; }
  .photo-shelf-tile small { display:none; }
}

/* Desktop tools use a left rail, leaving the photograph's row uninterrupted. */
@media(min-width:1100px) and (min-height:521px) {
  body:not(.is-editing):not(.preview-expanded) .workspace {
    padding-inline:14px; column-gap:12px;
  }
  body.controls-open:not(.is-editing):not(.preview-expanded) .workspace {
    grid-template-columns:minmax(0,1fr) 320px;
  }
  body:not(.is-editing):not(.preview-expanded) .visualizer {
    display:grid; grid-template-columns:112px minmax(0,1fr);
    grid-template-rows:minmax(0,1fr) auto; column-gap:10px; row-gap:10px;
  }
  body:not(.is-editing):not(.preview-expanded) #photoWorkspace { grid-column:2; grid-row:1; }
  body:not(.is-editing):not(.preview-expanded) .primary-tools {
    grid-column:1; grid-row:1; flex-direction:column; align-self:start;
    justify-content:flex-start; gap:6px; padding:6px; border-radius:12px;
    min-height:0; max-height:100%; overflow-y:auto; scrollbar-width:thin;
  }
  body:not(.is-editing):not(.preview-expanded) .primary-tools > button {
    flex:0 0 auto; flex-direction:column; min-height:82px; width:100%;
    padding:8px 4px; gap:6px; font-size:14px; line-height:1.2; border-radius:10px;
  }
  body:not(.is-editing):not(.preview-expanded) .primary-tools .icon { width:30px; height:30px; }
  body:not(.is-editing):not(.preview-expanded) .primary-tools > button span { white-space:normal; }
  body:not(.is-editing):not(.preview-expanded) #photoActions { grid-column:1/-1; grid-row:2; }
}
