/* ── Header (copied from ai-extend/src/style.css) ────── */
:root {
  --color-black: #000000;
  --color-accent: #fa6500;   /* Figma: color/brand/orange */
  --cull-text: #0c161d;      /* Figma: color/text/on-dark */
  --cull-muted: #606060;     /* Figma: color/text/muted */
  --cull-border: #dfdfdf;    /* Figma: Neutral/200 */
  --cull-secondary: #808080; /* Figma: Neutral/500 */
  --cull-ink: #0a0a0a;
  --cull-accent-soft: #fed1b3;  /* Figma: color/brand/orange-light */
}

/* `element.hidden` is how every screen and panel here is toggled. A normal-priority
   author `display` declaration beats the UA stylesheet's `[hidden] { display: none }`,
   so without this any element whose class sets `display` silently ignores `hidden`. */
[hidden] { display: none !important; }

.header {
  position: relative; z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  box-shadow: 0px 0px 10px 0px #00000080;
}

.header__back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-black);
  text-decoration: none;
  font-size: 16px;   /* matches every other tool's header — do not rescale */
  font-weight: 500;
}

.header__back:hover {
  opacity: 0.7;
}

.header__cta {
  font-size: 14px;   /* matches every other tool's header — do not rescale */
  color: #000000;
}

.header__link {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ── Screens ─────────────────────────────────────────── */
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #fff;
  color: var(--cull-text);
  min-height: 100vh;
}

/* Same treatment as the playground home page — see css/index.css. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../../images/background-graphic.png');
  background-repeat: repeat;
  background-size: cover;
  background-position: center;
  transform: scaleX(-1);
  opacity: 0.75;
  z-index: -1;
}

.cull { max-width: 1200px; margin: 0 auto; padding: 24px 20px 116px; }

.screen__title { font-size: 26px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.44px; }
.screen__step  { font-size: 13px; color: var(--cull-text); margin: 0 0 24px; }

/* ── Sticky footer bar ───────────────────────────────── */
.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid #e2e8f0;
  padding: 13px 20px; z-index: 20;
  box-shadow: 0 -4px 3px rgba(0,0,0,.04), 0 -10px 7.5px rgba(0,0,0,.04);
}
.footer-bar__inner {
  max-width: 1074px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  border: none; border-radius: 999px; padding: 9px 20px;
  font-size: 14px; cursor: pointer;
}
.btn--primary {
  background: var(--color-accent); color: #fff; min-width: 196px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn--primary:hover:not(:disabled) { background: #e05c00; }
.btn--primary:disabled { background: #f5c9a6; cursor: not-allowed; }
.btn--ghost { background: #fff; color: var(--cull-text); border: 1px solid #35373f; min-width: 196px; font-weight: 500; }
.btn--soft {
  background: var(--cull-accent-soft); border: 1px solid var(--color-accent);
  color: var(--cull-text); font-weight: 500;
}
.btn--soft:hover:not(:disabled) { background: #fdc296; }

/* ── Error banner (mirrors ai-art/src/style.css) ─────── */
.error-banner {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: #d92d20; color: #fff; border-radius: 8px;
  /* Above the stack modal (80) and the drag preview (90): an error raised while
     the modal is open used to render behind its backdrop. */
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; z-index: 100;
}
.error-banner__content { flex: 1; font-size: 13px; }
.error-banner__close { background: none; border: none; color: #fff; font-size: 17px; cursor: pointer; opacity: .8; }
.error-banner__close:hover { opacity: 1; }

/* ── Loader (mirrors css/index.css) ──────────────────── */
/* The Lottie loader (culling/Loader.json, same asset ai-art uses) mounts into
   this box. Until it does — or if the fetch fails — the CSS ring from
   css/index.css shows instead, so a loading state is never blank. */
.loader { width: 96px; height: 96px; }
.loader:not([data-lottie="on"]) {
  border-radius: 50%;
  border: 3px solid var(--color-accent); border-top-color: transparent;
  animation: cull-spin 1s linear infinite;
}
.loader[data-lottie="on"] { border: none; animation: none; }
.loader svg { display: block; width: 100%; height: 100%; }
@keyframes cull-spin { to { transform: rotate(360deg); } }

/* ── Upload screen (Task 2) ──────────────────────────── */
.panel {
  background: #fff; border: 1px solid rgba(0,0,0,.1); border-radius: 14px;
  padding: 20px; box-shadow: 0 2px 4px rgba(0,0,0,.06);
}

.dropzone {
  border: 1px dashed #d8d8d8; border-radius: 12px;
  padding: 36px 20px; text-align: center;
}
.dropzone__icon {
  width: 38px; height: 38px; margin: 0 auto 16px; border-radius: 10px;
  background: #fdf1e7; display: grid; place-items: center;
}
.dropzone__title { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.dropzone__copy  { font-size: 12px; color: #8a8a8a; margin: 0 0 20px; }

.folder-card {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--cull-border); border-radius: 15px;
  padding: 20px; margin-bottom: 12px; background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
}

/* 40x40 tinted tile behind the folder glyph. The tint and the glyph's stroke
   are what distinguish uploading / ready / error — same SVG in all three. */
.folder-card__icon {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: #f3f4f6; color: var(--cull-muted);
}
.folder-card--ready .folder-card__icon { background: #dcfce7; color: #00a63e; }
.folder-card--error .folder-card__icon { background: #fee2e2; color: #bf0003; }

.folder-card__body { flex: 1; min-width: 0; }
.folder-card__status { font-size: 14px; font-weight: 500; margin: 0 0 2px; letter-spacing: -.31px; }
.folder-card--ready .folder-card__status { color: #0d542b; }
.folder-card--error .folder-card__status { color: #bf0003; }
.folder-card__path   { font-size: 13px; color: var(--cull-muted); margin: 0 0 12px; word-break: break-all; }
.folder-card__detail { font-size: 13px; margin: 0; }
.folder-card__sub    { font-size: 13px; color: var(--cull-muted); margin: 0; }
.folder-card__sub:empty { display: none; }
.folder-card__notice { font-size: 13px; color: #bf0003; margin: 4px 0 0; }

/* Outlined red pill, per Figma: white fill, #ff7a7c border, #bf0003 text. */
.folder-card__remove {
  flex: 0 0 auto; align-self: flex-start;
  background: #fff; border: 1px solid #ff7a7c; color: #bf0003;
  border-radius: 100px; padding: 7px 15px; min-width: 156px;
  font-size: 13px; font-weight: 500; letter-spacing: -.15px;
  cursor: pointer;
}
.folder-card__remove:hover { background: #fff5f5; }
.folder-card__retry {
  flex: 0 0 auto; align-self: flex-start;
  background: none; border: 1px solid var(--cull-border);
  border-radius: 100px; padding: 7px 15px; font-size: 13px; cursor: pointer; margin-right: 8px;
}

/* Icon sits left of the label inside a button. */
.btn__icon { display: inline-flex; vertical-align: -3px; margin-right: 8px; }

.loader--sm { width: 56px; height: 56px; flex: 0 0 auto; align-self: center; }
.loader--sm:not([data-lottie="on"]) { border-width: 2px; }

.btn--wide { width: 100%; }

.instructions {
  background: #fff;
  border: 2px dashed var(--color-accent); border-radius: 14px;
  padding: 10px 18px; margin-top: 24px; font-size: 12px;
}
.instructions ul { margin: 8px 0 0; padding-left: 20px; }
.instructions li { margin-bottom: 4px; }

/* ── Configure screen (Task 4) ───────────────────────── */
.preset__label {
  display: block;
  font-size: 17px; font-weight: 700; color: var(--cull-ink);
  letter-spacing: -.45px; margin-bottom: 12px;
}
.preset__select {
  width: 100%; height: 42px; padding: 0 44px 0 16px;
  border: 1px solid var(--cull-border); border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--cull-ink);
  background-color: #fff;
  /* Figma's chevron-down, inlined so the native select arrow is replaced. */
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23808080' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
}

/* Styled stand-in for the native preset menu (src/dropdown.js). The list matches
   the field's width; the highlighted item uses the playground orange. */
.dropdown { position: relative; }
.dropdown__button { display: block; text-align: left; font-family: inherit; }
.dropdown__button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.dropdown__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--cull-border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.dropdown__option {
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #000;
}
.dropdown__option--active { background: var(--color-accent); color: #fff; }

.preset-summary { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 40px; }
.summary__key { display: block; font-size: 15px; color: var(--cull-secondary); }
.summary__val { display: block; font-size: 14px; font-weight: 600; color: var(--cull-ink); }
.summary__sub { display: block; margin-top: 2px; font-size: 14px; color: var(--cull-ink); }
.summary__status { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--cull-secondary); }

/* The detector cards sit inside their own white card, as in the design. */
.config-panel { margin-top: 16px; display: flex; flex-direction: column; gap: 13px; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
@media (max-width: 900px) { .card-grid, .preset-summary { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--cull-border);
  border-radius: 15px; padding: 20px;
}
.card--disabled { opacity: .5; }
.card--wide { grid-column: 1 / -1; }
.card__head { display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.card__title {
  font-size: 17px; font-weight: 500; color: var(--cull-ink);
  letter-spacing: -.45px; margin: 0;
}
.card--wide > .card__title { font-weight: 700; }
.card__sub  { font-size: 14px; color: var(--cull-secondary); letter-spacing: -.31px; margin: 0 0 10px; }
.card__desc { font-size: 14px; color: var(--cull-secondary); letter-spacing: -.31px; margin: 13px 0 0; }
.card__head + .card__desc { margin-top: 0; }

/* Radios: filled orange-light disc with an accent ring; the selected one adds a dot. */
.radio {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; line-height: 24px; color: var(--cull-ink); letter-spacing: -.31px;
  margin-bottom: 5px; cursor: pointer;
}
.radio input {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 16px; height: 16px; border-radius: 80px;
  background: rgba(254, 209, 179, .5); border: 2px solid var(--cull-accent-soft);
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.radio input:checked {
  background: var(--cull-accent-soft); border-color: var(--color-accent);
}
.radio input:checked::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent);
}
.radio input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.radio input:disabled { opacity: .5; cursor: not-allowed; }

/* Toggle — Figma switcher/toogle: 30x15 track (r7.5), 13.125px white knob,
   knob centre at x=22.5 when on (so ~1px inset at each end). */
.switch { position: relative; display: inline-block; width: 30px; height: 15px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
  position: absolute; inset: 0; background: #d9d9d9;
  border-radius: 7.5px; transition: background .15s; cursor: pointer;
}
.switch__track::after {
  content: ''; position: absolute; top: 0.94px; left: 0.94px;
  width: 13.125px; height: 13.125px; background: #fff; border-radius: 50%;
  box-shadow: 0 0 7.5px rgba(0,0,0,.15); transition: transform .15s;
}
.switch input:checked + .switch__track { background: var(--color-accent); }
.switch input:checked + .switch__track::after { transform: translateX(15px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.switch input:disabled + .switch__track { opacity: .5; cursor: not-allowed; }

/* Borderline block: hint, divider, then the label and inline radios on one row. */
.card__borderline { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cull-border); }
.card__hint { font-size: 14px; color: var(--cull-secondary); letter-spacing: -.31px; margin: 0 0 12px; }
.slider__note { font-size: 13px; color: var(--cull-secondary); letter-spacing: -.31px; margin: 10px 0 0; }
.borderline {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 16px;
}
.borderline__label { font-size: 13px; font-weight: 600; color: #000; }
.borderline__options { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.borderline__options .radio { margin-bottom: 0; }

/* Strictness sliders */
.slider { margin-top: 16px; }
.slider + .slider { margin-top: 12px; }
.slider__scale {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 12px; color: var(--cull-secondary);
}
.slider__row { display: flex; align-items: baseline; justify-content: space-between; }
.slider__label { font-size: 13px; font-weight: 600; color: #000; }
.slider__value { font-size: 13px; font-weight: 600; color: var(--cull-secondary); }
input[type="range"] {
  width: 100%; margin: 10px 0 0; appearance: none; -webkit-appearance: none;
  background: transparent; cursor: pointer;
}
/* WebKit has no ::-moz-range-progress equivalent, so the filled portion is a
   gradient stop driven by --pct, which config.js updates as the handle moves. */
input[type="range"]::-webkit-slider-runnable-track {
  height: 12px; border-radius: 30px;
  background: linear-gradient(to right,
    var(--color-accent) 0 var(--pct, 0%), #d9d9d9 var(--pct, 0%) 100%);
}
input[type="range"]::-moz-range-track { height: 12px; border-radius: 30px; background: #d9d9d9; }
input[type="range"]::-moz-range-progress { height: 12px; border-radius: 30px; background: var(--color-accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; margin-top: -2px;
  width: 16px; height: 16px; border-radius: 40px;
  background: #fff; border: 2px solid var(--color-accent);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 40px;
  background: #fff; border: 2px solid var(--color-accent);
}
input[type="range"]:disabled { opacity: .5; cursor: not-allowed; }

/* Arrow inside a primary button */
.btn__arrow { margin-left: 10px; vertical-align: -3px; }

/* ── Processing ───────────────────────────────────────── */
/* Loader and text sit together on one semi-transparent panel, so the doodle
   background does not compete with the progress text. */
.processing {
  display: grid; place-items: center; gap: 12px; text-align: center;
  max-width: 480px; margin: 96px auto 0; padding: 40px 32px 24px;
  background: rgba(255,255,255,.85); border: 1px solid var(--cull-border);
  border-radius: 15px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.processing__title  { font-size: 17px; font-weight: 600; margin: 8px 0 0; }
.processing__detail { font-size: 13px; color: #6a6a6a; margin: 0; }
.processing__hint   { font-size: 12px; color: #8a8a8a; margin: 4px 0 16px; }

/* ── Result screen (Task 6) ──────────────────────────── */
/* The result screen may use more width than the other screens, so wide windows
   fit 3 photos per row in each section. Capped so tiles never grow huge. */
.cull:has(> #screen-result:not([hidden])) { max-width: 1600px; }

/* Sections stay side by side while each still fits one photo per row (the tile
   count steps 3 → 2 → 1 via the container queries below); only then do they stack. */
.columns {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  align-items: start;
}
@media (max-width: 600px) { .columns { grid-template-columns: 1fr; } }

/* Same white card as everywhere else: #dfdfdf border, 15px radius, 26px padding.
   A size container, so its tile grid can follow the section's own width. */
.column {
  background: #fff; border: 1px solid var(--cull-border);
  border-radius: 15px; padding: 20px;
  container-type: inline-size;
}
.column__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.column__title {
  font-size: 15px; font-weight: 700; margin: 0;
  letter-spacing: -.4px; line-height: 24px; color: var(--cull-ink);
}
.column__title--rejected { color: red; }
.column__title--approved { color: #00b52a; }
.column__count {
  font-size: 13px; font-weight: 500; color: var(--cull-ink);
  letter-spacing: -.2px; white-space: nowrap;
}
.column__copy {
  font-size: 13px; font-weight: 500; color: var(--cull-secondary);
  letter-spacing: -.2px; line-height: 20px; margin: 13px 0 0;
}
#open-review { margin-top: 13px; height: 32px; }

/* No fixed height and no inner scrollbar — each column is as tall as its
   contents and the PAGE scrolls. The footer is fixed, so it stays put. */
.column__tiles {
  display: grid; grid-template-columns: 1fr; gap: 5px;
  margin-top: 13px;
}
/* Photos per row from the section's width: ~110px+ tiles for 2, ~120px+ for 3. */
@container (min-width: 230px) { .column__tiles { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 370px) { .column__tiles { grid-template-columns: repeat(3, 1fr); } }
.column__empty { grid-column: 1 / -1; font-size: 13px; color: var(--cull-secondary); text-align: center; padding: 24px 0; }

/* 150x150 at the design width, 20px radius, on the dark surface colour. */
.tile {
  position: relative; aspect-ratio: 1; border-radius: 16px;
  overflow: hidden; background: var(--cull-text); cursor: grab;
}
.tile__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__label {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  max-width: calc(100% - 16px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile__stack {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  cursor: pointer;   /* opens the "Change top image" modal */
}
.tile__stack:hover { background: rgba(0,0,0,.85); }

.footer-bar__hint { font-size: 13px; color: var(--cull-text); }



/* ── Drag-and-drop + keyboard move (Task 7) ──────────────── */
/* The source slot becomes an empty dashed outline while its tile is in flight. */
.tile--dragging {
  background: transparent;
  outline: 2px dashed var(--color-accent); outline-offset: -2px;
}
.tile--dragging > * { visibility: hidden; }

/* Where the photo will land. pointer-events:none so inserting it mid-drag can
   never steal a dragover/drop from the column underneath. */
.tile-ghost {
  aspect-ratio: 1; border-radius: 16px; pointer-events: none;
  background: #eceef0; border: 1px solid var(--cull-border);
}

/* Drag preview: a clone that follows the cursor, because the browser composites
   its own drag image onto opaque white and the tile's rounded corners came out
   white. position:fixed and pointer-events:none are LOAD-BEARING — without them
   the clone is a live, draggable .tile sitting in the body that swallows the drop. */
.tile-dragimage {
  position: fixed; z-index: 90; pointer-events: none;
  margin: 0; transform: translate(-50%, -50%);
  border-radius: 16px; overflow: hidden; background: transparent;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); opacity: .95;
}

.column--over { background: #fffaf5; outline: 2px dashed #f5a15c; outline-offset: -8px; }
.tile:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }


/* ── Review one by one (Task 8) ──────────────────────── */
.review { position: relative; text-align: center; padding-top: 0; }

/* The design puts a large soft white glow behind each edge label. */
.review::before, .review::after {
  content: ''; position: fixed; top: 50%; width: 440px; height: 440px;
  transform: translateY(-50%); border-radius: 50%;
  background: #fff; filter: blur(120px); pointer-events: none; z-index: 0;
}
.review::before { left: -260px; }
.review::after  { right: -260px; }

/* Reject / Approve are the edge labels from the design, as real buttons. */
.review__side {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 12;
  font-size: 24px; font-weight: 700; color: var(--cull-ink);
  letter-spacing: -.45px; line-height: 26px;
  user-select: none; pointer-events: none;
}
.review__side--reject  { left: 20px; }
.review__side--approve { right: 20px; }

/* Swipe feedback washes in from the matching edge. */
/* Fixed, so the wash reaches the window edge rather than the content column. */
.review__wash {
  position: fixed; top: 0; bottom: 0; width: 30vw;
  pointer-events: none; z-index: 10; opacity: 0; transition: opacity .15s;
}
.review__wash--reject  { left: 0;  background: linear-gradient(90deg, #ff6b6b, transparent); }
.review__wash--approve { right: 0; background: linear-gradient(270deg, #4ade80, transparent); }
.review--rejecting .review__wash--reject,
.review--approving .review__wash--approve { opacity: .85; }

.review__instruction {
  font-size: 15px; font-weight: 700; color: var(--cull-text);
  margin: 0 0 2px; position: relative; z-index: 11;
}
.review__note {
  font-size: 12px; color: var(--cull-text); margin: 0 0 8px;
  position: relative; z-index: 11;
}

.review__stage {
  position: relative; z-index: 2;
  height: min(600px, 58vh); display: grid; place-items: center;
}

/* EXPERIMENTAL 2026-09-22 — was a fixed 380x600 with object-fit: cover, which cut
   the edges off any photo that was not that shape. --card-w/--card-h are set per
   photo by sizeStage() in review.js; the fallbacks are the original design values,
   used until the first image reports its size. Revert by restoring those two
   literals and object-fit: cover on --active. */
.review__card {
  position: absolute;
  width: var(--card-w, min(380px, 74vw));
  height: var(--card-h, min(600px, 58vh));
  border-radius: 30px; object-fit: cover; background: #fff;
  /* touch-action stops the browser scrolling instead of swiping; the drag/select
     rules stop the native image-drag that would cancel the pointer sequence. */
  touch-action: none;
  -webkit-user-drag: none;
  user-select: none; -webkit-user-select: none;
}
/* contain, not cover: the box already matches this photo's aspect, so nothing is
   letterboxed and nothing is cropped. The cards behind keep `cover` — they share
   the active photo's box so the stack stays tidy, and they are decoration. */
.review__card--active {
  cursor: grab; box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 3;
  object-fit: contain;
}

.review__card--active:active { cursor: grabbing; }

/* Two faded, rotated cards peek out behind, as drawn. */
.review__card--behind { pointer-events: none; }
.review__card--behind1 { transform: rotate(4.47deg);  opacity: .5;  z-index: 2; }
.review__card--behind2 { transform: rotate(-4.12deg); opacity: .25; z-index: 1; }

.review__done { color: var(--cull-secondary); font-size: 14px; }

/* Both actions are 400px and stacked, matching the design. */
.review__actions {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin: 14px 0 0;
}
.review__btn { width: min(360px, 72vw); min-width: 0; height: 32px; padding: 0; }
.review__actions .btn:disabled { opacity: .5; cursor: not-allowed; }

/* The review screen must fit without scrolling, so its heading block is tighter
   than the other screens'. */
#screen-review .screen__title { font-size: 22px; margin-bottom: 0; }
#screen-review .screen__step  { margin-bottom: 8px; }

/* ── Duplicate stack modal — change the top image (Task 9) ──────────── */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(12, 22, 29, .88); }
.modal__body {
  position: relative; text-align: center;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 24px 0;
}
.modal__title {
  position: absolute; top: 32px; left: 0; right: 0;
  font-size: 20px; font-weight: 700; color: #fff; margin: 0; letter-spacing: -.35px;
}
.modal__close {
  position: absolute; top: 22px; right: 22px;
  background: none; border: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.modal__close:hover { opacity: .7; }

/* Figma frame 13: three 600x600 squares at y=137 in a 1440 frame — active at
   x=420 (centre 720 = dead centre), neighbours at x=-200 and x=1040, so each is
   offset by exactly one slot + a 20px gap. Absolute positioning is required:
   a flex row centres the GROUP, which puts the active image off-centre whenever
   there is only one neighbour. */
.modal__stage {
  --slot: min(520px, calc(100vh - 220px), 40vw);
  --gap: 20px;
  flex: 0 0 auto;                 /* never shrink — shrinking crops the square */
  position: relative; width: 100%; height: var(--slot);
  overflow: hidden;
}
/* --offset is the slot's distance from the active one, set by stackRender().
   Slots are built once and only moved, so no <img> is ever recreated — that
   recreation is what made the modal blink on every step. */
.modal__slot {
  position: absolute; top: 0; left: 50%;
  width: var(--slot); height: var(--slot);
  background: #000; border-radius: 8px;
  overflow: hidden; opacity: .85;
  transform: translateX(calc(-50% + (var(--slot) + var(--gap)) * var(--offset, 0)));
}
.modal__slot--active { opacity: 1; }
/* Absolutely positioned against the slot so its box is exactly the slot's box.
   As a grid item with height:100%, the height resolved against an AUTO-sized
   grid row instead — a portrait photo made the row taller than the slot, and the
   slot's overflow:hidden then sliced it, which is why only part of the photo
   showed. object-fit:contain needs a definite height to letterbox against. */
.modal__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain; display: block;
  user-select: none; -webkit-user-drag: none;
}

.modal__controls { display: flex; align-items: center; justify-content: center; gap: 15px; }
.modal__arrow {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.7); background: transparent; color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.modal__arrow:hover { background: rgba(255,255,255,.12); }
.modal__arrow:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.modal__position { font-size: 11px; color: rgba(255,255,255,.7); margin: 0; }
#stack-select { width: 200px; min-width: 0; height: 32px; }
#stack-select:disabled { background: rgba(250,101,0,.45); cursor: default; }

/* ── Save result (Task 10) ───────────────────────────── */
.save__counts {
  background: #fff; border: 1px solid var(--cull-border); border-radius: 15px;
  padding: 20px; display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  font-size: 15px; font-weight: 700; letter-spacing: -.3px; color: var(--cull-ink);
}
.save__count { display: inline-flex; align-items: center; gap: 5px; }
.save__count em { font-style: normal; }
.save__approved { color: #00b52a; }
.save__skipped  { color: var(--cull-secondary); }
.save__rejected { color: red; }

.save__location { display: block; margin-top: 13px; }
.save__location-label {
  display: block; font-size: 12px; color: var(--cull-secondary); margin-bottom: 6px;
}
#save-filename {
  box-sizing: border-box;   /* width:100% plus padding/border overflowed the panel */
  width: 100%; height: 32px; padding: 4px 12px;
  border: 1px solid #35373f; border-radius: 6px; background: #fff;
  font-size: 13px; color: var(--cull-text); letter-spacing: -.15px;
}
#save-filename:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }

.save__preview {
  background: #fff; border: 2px dashed var(--color-accent); border-radius: 14px;
  padding: 10px 18px; margin-top: 13px;
}
.save__preview-title {
  font-size: 14px; font-weight: 700; color: var(--cull-text);
  letter-spacing: -.31px; margin: 0 0 8px;
}

/* Tree rules are drawn with borders rather than box-drawing characters, so they
   line up regardless of the font in use. */
.save__tree { list-style: none; margin: 0; padding: 0 0 0 6px; }
.save__tree li {
  position: relative; padding: 0 0 8px 30px;
  font-size: 13px; color: #314158; letter-spacing: -.15px; line-height: 22px;
}
.save__tree li::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  border-left: 1px solid rgba(12,22,29,.5);
}
.save__tree li:last-child::before { bottom: auto; height: 11px; }
.save__tree li::after {
  content: ''; position: absolute; left: 0; top: 11px; width: 19px;
  border-top: 1px solid rgba(12,22,29,.5);
}
.save__tree-note { color: var(--cull-secondary); }

.save__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 13px; }
#download { min-width: 196px; }

/* While a tile is in flight the fixed footer must not be clickable — releasing a
   drag over it could otherwise register as a click on "Back to upload". */
body.is-dragging .footer-bar { pointer-events: none; }

/* Nothing may be reclassified while an export is running (PDF §7). */
body.is-exporting .tile { pointer-events: none; opacity: .7; }

/* ══════════════════════════════════════════════════════════════════════════
   EXPERIMENTAL 2026-09-22 — full-screen viewer (culling/src/viewer.js)
   Added at a tester's request; not in the Figma design. Self-contained: delete
   this block together with viewer.js and its two call sites to remove it.
   ══════════════════════════════════════════════════════════════════════════ */

/* 95: above the stack modal (80) and the drag preview (90), below the error
   banner (100) so a failure is never hidden behind the overlay. */
.viewer {
  position: fixed; inset: 0; z-index: 95;
  display: grid;
  grid-template-columns: minmax(48px, auto) 1fr minmax(48px, auto);
  align-items: center; gap: 12px;
  /* The controls panel (switcher + hint) is absolutely positioned against the
     viewport, so it ignores this padding — but the centred image does not. The
     bottom value reserves the strip that panel occupies, which stops it landing
     on top of the photo on shorter windows. */
  padding: 24px 24px 104px;
}
/* Explicit columns, because [hidden] on the arrows is display:none — with
   auto-placement the image would then jump into column 1 and sit off-centre
   whenever the viewer shows a single photo (which is how Review opens it). */
.viewer > [data-prev] { grid-column: 1; justify-self: start; }
.viewer__stage       { grid-column: 2; }
.viewer > [data-next] { grid-column: 3; justify-self: end; }
.viewer__backdrop { position: absolute; inset: 0; background: rgba(12,22,29,.82); }

.viewer__stage {
  position: relative; margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  min-width: 0; min-height: 0;
}
/* contain, so the whole photo is visible whatever its shape — the point of the
   feature. The cursor is the mode indicator: default while the magnifier is off,
   crosshair only once it is on, so the pointer itself says whether moving over the
   image will do anything. */
.viewer__img {
  max-width: 100%; max-height: calc(100vh - 170px);
  object-fit: contain; border-radius: 8px;
  cursor: default; user-select: none; -webkit-user-drag: none;
}
.viewer__img--loupe { cursor: crosshair; }

/* Switcher + hint, on the backdrop itself (no panel of their own). The two modes
   form one orange pill; a single thumb slides under the active half. */
.viewer__controls {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.viewer__modes {
  position: relative; display: flex; padding: 2px; gap: 2px;
  border: 1px solid var(--color-accent); border-radius: 999px;
}
.viewer__modes::before {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 30px; height: 22px; border-radius: 999px;
  background: var(--color-accent);
  transition: transform .2s ease;
}
/* One button width (30px) plus the gap (2px). */
.viewer__modes[data-mode="loupe"]::before { transform: translateX(32px); }
.viewer__mode {
  position: relative;   /* above the sliding thumb */
  width: 30px; height: 22px; border-radius: 999px;
  border: none; background: transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  opacity: .7; transition: opacity .12s ease;
}
.viewer__mode:hover { opacity: 1; }
.viewer__mode--active { opacity: 1; }
/* White, not orange: an orange ring next to the orange thumb read as a second
   active mode. */
.viewer__mode:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* The shared icons are near-black SVGs drawn for light backgrounds; the lightbox
   filters them the same way to sit on its dark overlay. */
.viewer__mode img { filter: brightness(0) invert(1); display: block; }
.viewer__caption {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-size: 13px; max-width: 70vw;
}
.viewer__caption > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer__count { flex: 0 0 auto; }

.viewer__close {
  position: absolute; top: 18px; right: 22px; z-index: 2;
  background: none; border: none; color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer;
}
.viewer__close:hover { opacity: .7; }

.viewer__nav {
  position: relative; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(12,22,29,.35); color: #fff;
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.viewer__nav:hover { background: rgba(255,255,255,.12); }
.viewer__close:focus-visible, .viewer__nav:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px;
}

.viewer__hint { color: #fff; font-size: 12px; margin: 0; white-space: nowrap; }

/* The loupe is appended to <body>, not the overlay, so nothing can clip it at the
   edges of the image. The crop's size is set per move by viewer.js (scaled to
   the displayed photo); 280px is only its starting value. */
.viewer__loupe {
  position: fixed; z-index: 96; pointer-events: none;
  padding: 4px; border-radius: 10px; background: rgba(12,22,29,.9);
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
.viewer__loupe-crop {
  position: relative; width: 280px; height: 280px;
  overflow: hidden; border-radius: 6px; background: #000;
}
.viewer__loupe-img { position: absolute; max-width: none; }

@media (max-width: 640px) {
  .viewer { padding: 12px; gap: 6px; }
}
