/* Batch: the stage holds a contact sheet of every photo instead of one print */
.stage--sheet { place-items: stretch; align-content: start; padding-top: var(--s-5); overflow: auto; }
[data-state='empty'] .stage--sheet { place-items: center; align-content: center; }
.stage--sheet.is-over { outline: 2px dashed var(--accent); outline-offset: -12px; }
.sheet-wrap { width: 100%; display: grid; gap: var(--s-4); align-content: start; }
.sheet-bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; }
.sheet-bar__count { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.sheet-bar__actions { display: flex; gap: var(--s-2); }
.sheet-bar__actions label { cursor: pointer; background: var(--surface); }
.sheet-bar__actions label:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
@media (min-width: 1200px) { .sheet { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.snap { position: relative; display: grid; gap: var(--s-2); align-content: start; }
.snap__print { position: relative; aspect-ratio: 1; padding: var(--s-2); overflow: hidden; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
/* object-fit keeps any shape of output inside the square card */
.snap__print canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.snap.is-busy .snap__print { background: linear-gradient(90deg, var(--paper-200), var(--paper-50), var(--paper-200)) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
.snap.is-busy canvas, .snap.is-error canvas { display: none; }
.snap.is-error .snap__print { background: var(--danger-soft); border-color: transparent; }
.snap__state { position: absolute; left: var(--s-2); bottom: var(--s-2); padding: 3px 6px; border-radius: 4px; background: var(--ink-900); color: var(--text-inverse); font-size: var(--fs-2xs); }
.snap__state:empty { display: none; }
.snap.is-busy .snap__state { position: static; background: none; color: var(--text-muted); }
.snap.is-error .snap__state { position: static; background: none; color: var(--danger); font-weight: 600; }
.snap__meta { min-width: 0; }
.snap__meta p { margin: 0; }
.snap__name { font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snap__info { font-size: var(--fs-2xs); color: var(--text-muted); overflow-wrap: anywhere; }
.snap.is-error .snap__info { color: var(--danger); font-family: var(--font-body); font-size: var(--fs-xs); }
.snap__del {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text-muted);
  opacity: 0; transition: opacity var(--t-fast), color var(--t-fast);
}
.snap__del svg { width: 14px; height: 14px; }
.snap:hover .snap__del, .snap__del:focus-visible, .snap.is-error .snap__del { opacity: 1; }
.snap__del:hover { color: var(--danger); border-color: var(--danger); }
@media (hover: none) { .snap__del { opacity: 1; } }

.picks--tall { max-height: none; grid-template-columns: 1fr; }

/* A plain switch for the batch cutout */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.switch input { appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: var(--r-pill); background: var(--paper-300); cursor: pointer; transition: background var(--t-fast); }
.switch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: var(--sh-raise); transition: transform var(--t-base) var(--ease-out); }
.switch input:checked { background: var(--accent-fill); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Working and finished: a contact sheet of the files on the dark table */
.batch-result .result__table { align-self: stretch; place-items: start stretch; max-height: calc(100dvh - 140px); overflow: auto; padding: var(--s-2); }
.contact { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--s-4); margin: 0; padding: 0; list-style: none; width: 100%; align-items: end; }
.contact li { display: grid; gap: var(--s-1); justify-items: start; animation: drop var(--t-slow) var(--ease-out) both; }
.contact img { width: 100%; height: auto; padding: 4px; background: #FFFFFF; border-radius: var(--r-print); box-shadow: var(--sh-print); object-fit: cover; }
.contact span { font-size: var(--fs-2xs); color: var(--text-inverse-muted); }
.progress { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.progress .delta__bar i { animation: none; transition: width var(--t-base) var(--ease-out); }
.progress .result__note { font-size: var(--fs-xs); overflow-wrap: anywhere; }
@media (max-width: 959px) { .batch-result .result__table { max-height: none; } }
