*{box-sizing:border-box}body{margin:0 auto;padding:20px;max-width:1320px;background:#f5f5f7;color:#1d1d1f;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,select{font:inherit}button,select,input[type=text],input[type=number]{border:1px solid #d9d9e0;border-radius:10px;padding:11px;background:white;color:inherit;min-height:44px}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}button:hover:not(:disabled){background:#f0f6ff}button.primary{background:#0066cc;color:white;border-color:#0066cc;font-weight:650}button.primary:hover:not(:disabled){background:#0054a8}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #007aff;outline-offset:3px}.studio{display:grid;grid-template-columns:330px minmax(0,1fr);gap:24px;align-items:start}.settings{padding:24px;background:white;border:1px solid #e2e2e8;border-radius:18px}.settings h2{font-size:23px;line-height:1.2;letter-spacing:-.6px;margin:0 0 12px}.settings h3{font-size:17px;margin:24px 0 14px}.muted,small{color:#65656e;font-size:14px;line-height:1.5}.small,small{font-size:12px}.settings label:not(.upload){display:block;font-size:13px;font-weight:600;margin:15px 0 7px}.settings input:not([type=file]),.settings select,.settings>button{width:100%}#number{font-size:28px;font-weight:750}small{display:block;margin-top:5px}.upload{display:block;position:relative;margin-top:20px;padding:16px;border:1px dashed #82afe0;border-radius:12px;text-align:center;color:#0066cc;background:#f0f6ff;font-weight:600;cursor:pointer}.upload input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.upload:focus-within{outline:3px solid #007aff;outline-offset:3px}.photo-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;max-height:240px;overflow:auto}.photo-item{position:relative}.photo-item>button:first-child{width:100%;padding:3px;aspect-ratio:1}.photo-item img{display:block;width:100%;height:100%;object-fit:cover;border-radius:6px}.photo-item [aria-pressed=true]{outline:2px solid #007aff;outline-offset:-2px}.photo-item .remove{position:absolute;right:0;top:0;min-height:26px;width:26px;padding:0;border-radius:50%;background:#fff;color:#b42318;font-size:18px}.settings #shuffle{margin-top:10px}fieldset{border:1px solid #e2e2e8;border-radius:12px;padding:12px;margin:20px 0 0}legend{font-size:13px;font-weight:600}fieldset .muted{margin-top:2px}input[type=range]{accent-color:#0066cc;min-height:28px}.preview-area{position:sticky;top:20px;min-width:0}.preview-heading{display:flex;justify-content:space-between;gap:12px;margin:4px 4px 16px;font-size:13px;color:#65656e}.paper{padding:24px;min-height:440px;display:flex;justify-content:center;align-items:center;border-radius:18px;background:#fff;box-shadow:0 6px 28px #182a4010;border:1px solid #e2e2e8}canvas{display:block;max-width:100%;max-height:75vh;width:auto;height:auto}#status{font-size:14px;text-align:center;color:#65656e;line-height:1.5;padding:0 12px}[hidden]{display:none!important}@media(max-width:760px){body{padding:12px}.studio{display:flex;flex-direction:column;gap:16px}.preview-area{position:static;order:-1;width:100%}.paper{min-height:240px;padding:16px}canvas{max-height:40vh}.settings{width:100%;padding:20px}.preview-heading{margin-bottom:8px}#status{margin-bottom:0}}
#preview.editable{cursor:grab;touch-action:none}#preview.dragging{cursor:grabbing}#preview:focus-visible{outline:3px solid #007aff;outline-offset:7px;border-radius:4px}.selection-label{text-align:center;color:#0066cc;font-size:14px;font-weight:600;margin:14px 0 5px}.preview-help{max-width:520px;margin:0 auto;text-align:center;color:#65656e;font-size:12px;line-height:1.5}

/* Reserve the viewport for editing; help and status flow below it. */
.collage-price{margin:16px 0;padding:14px;border:1px solid #e2e2e8;border-radius:12px;background:#fafafa}
.collage-price p{display:flex;justify-content:space-between;gap:12px;font-size:14px;margin:8px 0}
.collage-price strong{white-space:nowrap}
.collage-price .collage-price-total{border-top:1px solid #ddd;padding-top:12px;font-size:18px}
.foto-collage-page .preview-area{top:104px}
.foto-collage-page .preview-editor{height:calc(100dvh - 210px);min-height:280px;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.foto-collage-page .paper{min-height:0;min-width:0;padding:16px}
.foto-collage-page #preview{max-width:100%;max-height:100%;width:auto;height:auto;min-width:0;min-height:0}
.foto-collage-page .preview-heading{margin:0 4px 10px}
.foto-collage-page .selection-label{margin:10px 0 5px}
.foto-collage-page #status{margin:8px 0 0}
@media(max-width:760px){
 .foto-collage-page .preview-editor{height:min(520px,calc(100svh - 190px));min-height:260px}
 .foto-collage-page .paper{padding:12px}
}

.sheet-preview-section{margin-top:24px;padding-top:18px;border-top:1px solid #ddd}.sheet-preview-section h2{font-size:18px;margin:0 0 6px}.sheet-previews{display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:16px;max-height:440px;overflow:auto;padding:8px}.sheet-previews figure{margin:0;min-width:0;text-align:center}.sheet-previews canvas{display:block;width:100%;height:auto;max-height:none;max-width:170px;margin:0 auto;background:white;border:1px solid #ccc;box-shadow:0 3px 10px #0001}.sheet-previews figcaption{font-size:12px;color:#65656e;margin-top:7px}.sheet-previews:focus-visible{outline:3px solid #007aff;outline-offset:2px}@media(max-width:760px){.sheet-previews{grid-template-columns:repeat(2,minmax(0,1fr));max-height:370px}}

.sheet-previews{max-height:none;max-width:600px;margin:12px auto;overflow:visible}.sheet-previews.assembled{gap:0;padding:0;border:1px solid #b8bac2}.sheet-previews.assembled figure{position:relative;line-height:0;outline:1px dashed #b8bac2;outline-offset:-1px}.sheet-previews.assembled canvas{width:100%;max-width:none;border:0;box-shadow:none;margin:0}.sheet-previews.assembled figcaption{position:absolute;top:3px;left:3px;margin:0;padding:2px 4px;border-radius:3px;background:#ffffffd9;font-size:10px;line-height:1.2;color:#555}

.collage-header-actions{grid-column:3;grid-row:1;display:flex;align-items:center;gap:8px;justify-self:end}.collage-header-actions button{font-size:13px;white-space:nowrap;border-radius:999px;padding:8px 14px}
@media(max-width:1100px){.collage-header-actions{grid-column:1/-1;grid-row:2;justify-self:end;justify-content:flex-end;flex-wrap:wrap;padding:0 0 10px}.foto-collage-page .cp-calendar-shell .cp-site-header{row-gap:0}.foto-collage-page .preview-area{top:158px}.foto-collage-page .preview-editor{height:calc(100dvh - 265px)}}
@media(max-width:400px){.collage-header-actions{gap:5px}.collage-header-actions button{font-size:11px;padding:7px 9px}}

.photo-progress{position:fixed;z-index:100;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:14px;width:min(410px,calc(100% - 28px));padding:17px 20px;border:1px solid #c9d9e9;border-radius:18px;background:#fff;box-shadow:0 8px 32px #162b4533;color:#183c63;pointer-events:none}.photo-progress>div{flex:1;min-width:0}.photo-progress output{display:block;font-size:14px;font-weight:600;line-height:1.4}.photo-progress progress{display:block;width:100%;height:7px;margin-top:9px;accent-color:#0066cc}.photo-progress-spinner{flex:none;width:25px;height:25px;border:3px solid #deebf6;border-top-color:#0066cc;border-radius:50%;animation:collage-photo-spin .8s linear infinite}@keyframes collage-photo-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.photo-progress-spinner{animation:none}}

.collage-header-menu{grid-column:3;grid-row:1;justify-self:end;position:relative}#collage-menu-toggle{display:none}
@media(min-width:721px) and (max-width:1100px){.collage-header-menu{grid-column:1/-1;grid-row:2}.collage-header-actions{display:flex}}
@media(max-width:720px){
 #collage-menu-toggle{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid #ddd;border-radius:999px;background:#fff;font-size:20px;letter-spacing:2px}
 .collage-header-menu .collage-header-actions{display:none;position:absolute;right:0;top:calc(100% + 8px);z-index:1000;min-width:200px;padding:8px;background:white;border:1px solid #ddd;border-radius:16px;box-shadow:0 12px 32px #0002;flex-direction:column;align-items:stretch;gap:6px}
 .collage-header-menu.open .collage-header-actions{display:flex}
 .collage-header-menu .collage-header-actions button{font-size:14px;padding:12px 16px;text-align:left}
 .foto-collage-page .preview-area{top:105px}.foto-collage-page .preview-editor{height:calc(100dvh - 212px)}
}

@media(max-width:720px){.collage-admin-view .cp-calendar-exit{max-width:100%;font-size:11px;padding:7px 8px;line-height:1.25;text-align:center;white-space:normal}}
