.layout-shell { max-width: 1050px; }
.layout-counts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.layout-counts label { position: relative; cursor: pointer; }
.layout-counts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.layout-counts span { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--border); border-radius: 12px; font-weight: 700; }
.layout-counts input:checked + span { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.layout-counts input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 3px; }
.layout-slots { display: grid; direction: ltr; background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.layout-slot { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; background: #edf2f8; color: #526787; cursor: pointer; overflow: hidden; }
.layout-slot img { width: 100%; height: 100%; position: absolute; inset: 0; background: white; }
.layout-slot span { font-size: clamp(1rem, 4vw, 2rem); }
.layout-slot:focus-visible { outline: 3px solid #2563eb; outline-offset: -4px; z-index: 1; }
.layout-slot:disabled { cursor: wait; }
@media(max-width: 575px) { .layout-counts { gap: 6px; } }
/* Preview cells follow the actual export proportions. */
.layout-slots { border: 0; outline: 1px solid var(--border); }
.layout-slot { aspect-ratio: auto; min-height: 0; }
.layout-photo { display: grid; place-items: center; width: 100%; height: 100%; border: 0; padding: 0; background: #edf2f8; color: #526787; font-size: clamp(1rem, 4vw, 2rem); cursor: pointer; }
.layout-photo canvas { display: block; width: 100%; height: 100%; }
.layout-photo:focus-visible { outline: 3px solid #2563eb; outline-offset: -4px; }
.layout-zoom { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 12px; background: #152035e8; color: white; box-shadow: 0 2px 8px #0002; }
.layout-zoom button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: #ffffff18; color: white; font-size: 22px; cursor: pointer; }
.layout-zoom button:disabled { opacity: .4; }
.layout-zoom button:focus-visible { outline: 2px solid #8bb4ff; }
.layout-zoom output { min-width: 42px; font-size: 11px; text-align: center; }
@media(max-width: 575px) { .layout-zoom { gap: 0; padding: 2px; bottom: 2px; } .layout-zoom button { width: 24px; height: 28px; } .layout-zoom output { min-width: 28px; font-size: 9px; } }
.layout-slot { container-type: inline-size; }
.layout-photo { min-width: 0; min-height: 0; overflow: hidden; }
.layout-zoom { width: calc(100% - 8px); max-width: 120px; justify-content: center; box-sizing: border-box; }
.layout-zoom button { flex: 1 1 24px; min-width: 0; max-width: 32px; }
@container (max-width: 100px) { .layout-zoom output { display: none; } }
.layout-preview-stage { display: flex; justify-content: center; padding: 12px; margin-bottom: 24px; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; }
.layout-settings { padding: 16px; border: 1px solid var(--border); border-radius: 14px; }
.layout-settings summary { cursor: pointer; font-weight: 600; color: var(--text); }
.layout-settings summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.layout-photo-info { display: grid; gap: 10px; }
.layout-photo-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.layout-photo-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.layout-photo-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.layout-photo-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.layout-photo-row .btn { flex-shrink: 0; }
@media(max-width: 575px) { .layout-photo-row { gap: 8px; padding: 8px; } .layout-photo-thumb { width: 36px; height: 36px; } .layout-photo-row .btn { font-size: .75rem; } }
#layout-files, #layout-count { height: 52px; min-height: 52px; border-radius: 12px; font-size: 1rem; line-height: 1.5; }
#layout-files { padding: 0 12px; line-height: 50px; }
#layout-files::file-selector-button { height: 50px; margin-block: 0; margin-inline-start: -12px; margin-inline-end: 12px; padding: 0 14px; line-height: normal; }
.layout-photo.is-draggable { cursor: grab; touch-action: none; user-select: none; }
.layout-photo.is-dragging { cursor: grabbing; }
.layout-rotate { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); display: flex; direction: ltr; gap: 4px; padding: 3px; border-radius: 10px; background: #152035e8; max-width: calc(100% - 8px); }
.layout-rotate button { width: 32px; height: 32px; min-width: 0; display: grid; place-items: center; border: 0; border-radius: 7px; padding: 0; background: #ffffff18; color: white; font-size: 24px; line-height: 1; cursor: pointer; }
.layout-rotate button:disabled { opacity: .4; }
.layout-rotate button:focus-visible { outline: 2px solid #8bb4ff; }
@container (max-width: 100px) { .layout-rotate { gap: 2px; top: 2px; padding: 2px; } .layout-rotate button { width: 24px; height: 26px; } }
