/* ============================================
   Wall Cropper — cropper UI styles.
   Ported from the FR /recadrage/ reference.
   Selectors scoped under .wall-cropper to avoid global collisions.
   Modal namespace renamed .dpi-modal → .app-modal so both the
   DPI warning and the iOS canvas-limit warning share the same CSS.
   ============================================ */

.wall-cropper {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
  font-size: 15px;
  line-height: 1.5;
}

.wall-cropper h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.2rem;
  margin: 0 0 .5rem;
  color: var(--color-text);
  letter-spacing: 0.3px;
}
.wall-cropper .subtitle {
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
  font-size: 1rem;
}
.wall-cropper .intro {
  margin-bottom: 2rem;
  font-size: .95rem;
  color: var(--color-text);
}
.wall-cropper .intro p { margin: 0 0 .6rem; }

.wall-cropper input[type="text"] {
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: .55rem .7rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  flex: 1;
  min-width: 200px;
  outline: none;
  transition: border-color 0.15s;
}
.wall-cropper input[type="text"]:focus {
  border-color: var(--color-primary);
}

/* Dropzone */
.wall-cropper .dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.25rem;
  text-align: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--color-surface);
  margin-bottom: 1.5rem;
  user-select: none;
}
.wall-cropper .dropzone:hover,
.wall-cropper .dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.07); /* primary blue @ 7% — soft tint on cream */
}
.wall-cropper .dropzone p { margin: 0; font-size: .95rem; }

.wall-cropper .link {
  background: none;
  border: none;
  color: var(--color-primary-dark);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.wall-cropper .link:hover { color: var(--color-primary); }

/* Empty state */
.wall-cropper .empty {
  text-align: center;
  color: var(--color-text-muted);
  font-size: .9rem;
  padding: 1.5rem 0;
  font-style: italic;
}

/* ============================================
   Step 2 — Batch settings strip (auto-suggest + apply-same-formats).
   ============================================ */
.wall-cropper .batch-settings {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.4rem;
  margin: 0 0 1.25rem;
  padding: .75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .88rem;
}
.wall-cropper .batch-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}
.wall-cropper .batch-toggle[hidden] { display: none; }
.wall-cropper .batch-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.wall-cropper .edit-master-link {
  background: none;
  border: none;
  color: var(--color-primary-dark);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  margin-left: auto; /* pushes the link to the right edge of the strip */
}
.wall-cropper .edit-master-link:hover { color: var(--color-primary); }
.wall-cropper .edit-master-link[hidden] { display: none; }

/* ============================================
   Step 2 — Per-card chip (Master / Customized).
   ============================================ */
.wall-cropper .filename-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.wall-cropper .filename-row .filename {
  min-width: 0;
}
.wall-cropper .card-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.4;
}
.wall-cropper .card-chip--master {
  background: var(--color-primary);
  color: white;
}
/* Step 2 / Issue D — Customized chip is informational/secondary → outlined navy. */
.wall-cropper .card-chip--customized {
  background: transparent;
  color: var(--color-primary-dark);
  border: 1px solid var(--color-primary);
}

/* Step 2.C — Duplicate badge in the card header. Muted warning palette to
   signal "heads up" without alarming. Cleared on first design-name edit. */
.wall-cropper .duplicate-badge {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  padding: 1px 8px;
  background: var(--color-warning-bg);
  color: #8a5a1a;
  border: 1px solid var(--color-warning-border);
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}

/* ============================================
   Step 2 — Per-card Design name input row.
   ============================================ */
.wall-cropper .design-name-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 .9rem;
  flex-wrap: wrap;
}
.wall-cropper .design-name-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  font-weight: 700;
  white-space: nowrap;
}
.wall-cropper input.design-name-input {
  flex: 1;
  min-width: 180px;
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: .45rem .65rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: border-color 0.15s;
}
.wall-cropper input.design-name-input:focus {
  border-color: var(--color-primary);
}

/* ============================================
   Step 2 — Batched-card placeholder + Customize/Rejoin buttons.
   ============================================ */
.wall-cropper .batched-placeholder {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: .85rem 0 .3rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  align-items: flex-start;
}
.wall-cropper .batched-placeholder p {
  margin: 0;
  font-size: .88rem;
  color: var(--color-text-muted);
}
.wall-cropper .batched-placeholder__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
/* Step 2 / Issue D — Category 4 (secondary configuration actions): outlined navy.
   Make-this-master, Customize-this-design, Rejoin-batch all share this treatment. */
.wall-cropper .batch-toggle-btn {
  background: transparent;
  color: var(--color-primary-dark);
  border: 1px solid var(--color-primary);
  padding: .35rem .85rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.wall-cropper .batch-toggle-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}
.wall-cropper .controls-row--rejoin {
  margin: .35rem 0 .35rem;
}

/* ============================================
   Step 2 — Global Generate-all button.
   ============================================ */
.wall-cropper .generate-all-btn {
  display: block;
  width: 100%;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: .95rem 1.4rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  margin: 1.5rem 0 1.25rem;
  transition: background 0.15s;
}
.wall-cropper .generate-all-btn:hover { background: var(--color-primary-dark); }
.wall-cropper .generate-all-btn:disabled { opacity: 0.7; cursor: wait; }
.wall-cropper .generate-all-btn[hidden] { display: none; }

/* ============================================
   Brief 3b-2 Output Zone — three-state post-generation panel.
   States set as classes on #output-section by JS:
     .output-zone--idle   (no prints yet)            → outputs hidden, single gen button
     .output-zone--fresh  (hasPrints && !isStale)    → outputs navy active, gen ghost
     .output-zone--stale  (hasPrints && isStale)     → outputs dimmed, gen orange
   Mirror principle: ZIP and Drive share the same navy treatment — they're
   two ways to receive the same thing, not competing options.
   ============================================ */
.wall-cropper .output-zone {
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px dashed var(--color-border);
}
.wall-cropper .output-zone[hidden] { display: none; }

/* Heading — emerald check is the only place that color appears in this zone. */
.wall-cropper .output-zone__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .9rem;
  flex-wrap: wrap;
}
.wall-cropper .output-zone__h {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.wall-cropper .output-zone__check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-success);
  color: white;
  font-size: .7rem;
  font-weight: 700;
}
.wall-cropper .output-zone__meta {
  font-size: .82rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* The two output cards, side by side, mirrored — navy frame, navy CTA. */
.wall-cropper .output-zone__outputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}
.wall-cropper .output-zone__card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  box-shadow: 0 1px 0 rgba(37,99,235,0.05), 0 8px 24px -12px rgba(37,99,235,0.25);
  transition: opacity .15s, border-color .15s, box-shadow .15s;
}
.wall-cropper .output-zone__card-head {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.wall-cropper .output-zone__ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--color-primary);
  flex: 0 0 36px;
}
.wall-cropper .output-zone__ico svg { width: 20px; height: 20px; }
.wall-cropper .output-zone__card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.wall-cropper .output-zone__card-sub {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.wall-cropper .output-zone__card-copy {
  margin: 0;
  font-size: .87rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  min-height: 2.6em;
}
.wall-cropper .output-zone__cta {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: .8rem 1.1rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  letter-spacing: -0.005em;
  transition: background .15s;
}
.wall-cropper .output-zone__cta:hover { background: var(--color-primary-dark); }
.wall-cropper .output-zone__cta:disabled { opacity: 0.7; cursor: wait; }

/* Save-to-Drive progress line under the Drive card's CTA. */
.wall-cropper .save-drive-status {
  margin: .15rem 0 0;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  font-style: italic;
}
.wall-cropper .save-drive-status[hidden] { display: none; }

/* Divider between outputs and gen-row. */
.wall-cropper .output-zone__divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 1.25rem 0 1rem;
}

/* Gen-row: single button, three flavors via state class on the zone. */
.wall-cropper .output-zone__gen-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.wall-cropper .output-zone__gen-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 240px;
}
.wall-cropper .output-zone__gen-t {
  font-size: .88rem;
  font-weight: 500;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.wall-cropper .output-zone__gen-s {
  font-size: .8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.wall-cropper .output-zone__gen-btn {
  background: transparent;
  border: 1.4px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: 10px;
  padding: .65rem 1.05rem;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.wall-cropper .output-zone__gen-btn:disabled { cursor: not-allowed; opacity: 0.9; }

/* — STATE: idle (no prints yet). Heading + outputs + divider hidden. */
.wall-cropper .output-zone--idle .output-zone__heading,
.wall-cropper .output-zone--idle .output-zone__outputs,
.wall-cropper .output-zone--idle .output-zone__divider,
.wall-cropper .output-zone--idle .output-zone__footer {
  display: none;
}
.wall-cropper .output-zone--idle .output-zone__gen-row {
  justify-content: center;
}
.wall-cropper .output-zone--idle .output-zone__gen-text { display: none; }
.wall-cropper .output-zone--idle .output-zone__gen-btn {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  font-size: .98rem;
  font-weight: 700;
  padding: .8rem 1.5rem;
}
.wall-cropper .output-zone--idle .output-zone__gen-btn:not(:disabled):hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* — STATE: stale (changes waiting). Outputs dim, gen-row turns orange. */
.wall-cropper .output-zone--stale .output-zone__card {
  opacity: 0.55;
  box-shadow: none;
  border-color: #d4cdbe;
}
.wall-cropper .output-zone--stale .output-zone__card .output-zone__ico {
  background: #ecead9;
  color: #7a7460;
}
.wall-cropper .output-zone--stale .output-zone__cta {
  background: #9a9482;
}
.wall-cropper .output-zone--stale .output-zone__cta:hover { background: #7d7866; }
.wall-cropper .output-zone--stale .output-zone__h { color: var(--color-text-muted); }
.wall-cropper .output-zone--stale .output-zone__check {
  background: #b8b3a4;
}
.wall-cropper .output-zone--stale .output-zone__gen-row {
  background: #fcefe7;
  border: 1.2px solid #f0c9b3;
  border-radius: 12px;
  padding: .85rem 1rem;
}
.wall-cropper .output-zone--stale .output-zone__gen-t {
  color: #8a3d18;
  font-weight: 600;
}
.wall-cropper .output-zone--stale .output-zone__gen-s {
  color: #9a5132;
}
.wall-cropper .output-zone--stale .output-zone__gen-btn {
  background: var(--color-pending);
  border-color: var(--color-pending);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(217,110,60,0.4);
}
.wall-cropper .output-zone--stale .output-zone__gen-btn:not(:disabled):hover {
  background: #c25f30;
  border-color: #c25f30;
}
.wall-cropper .output-zone__pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-pending);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(217,110,60,0.18);
}

/* Footer reset — small ghost link, bottom-right. */
.wall-cropper .output-zone__footer {
  margin-top: 1.1rem;
  display: flex;
  justify-content: flex-end;
}
.wall-cropper .output-zone__reset {
  background: transparent;
  border: 1.2px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: 8px;
  padding: .4rem .75rem;
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.wall-cropper .output-zone__reset:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  background: var(--color-surface);
}

/* Stack on narrow screens. */
@media (max-width: 640px) {
  .wall-cropper .output-zone__outputs { grid-template-columns: 1fr; }
  .wall-cropper .output-zone__gen-row { flex-direction: column; align-items: stretch; }
  .wall-cropper .output-zone__gen-btn { width: 100%; }
}

/* ============================================
   Brief 3b-2 part 2 — Drive folder-names confirmation modal.
   Sits on top of the shared .app-modal primitives. Body is built per call.
   ============================================ */
.drive-names-modal__intro {
  margin: 0 0 1rem;
  padding: .7rem .9rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: .88rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.drive-names-modal__intro strong { color: var(--color-text); }

.drive-names-modal__list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: .25rem;
}

.drive-names-modal__row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: .85rem;
  align-items: start;
  padding: .65rem .8rem .8rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.drive-names-modal__thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
}
.drive-names-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.drive-names-modal__fields {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}
.drive-names-modal__source {
  font-size: .78rem;
  color: var(--color-text-muted);
  display: flex;
  gap: .35rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.drive-names-modal__source-label {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .68rem;
}
.drive-names-modal__source-name {
  color: var(--color-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.drive-names-modal__input-label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .68rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.drive-names-modal__input {
  font-family: inherit;
  font-size: .95rem;
  padding: .5rem .65rem;
  border: 1.4px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  text-transform: none;
  letter-spacing: 0;
}
.drive-names-modal__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.drive-names-modal__input.is-invalid {
  border-color: var(--color-pending);
  background: #fcefe7;
}
.drive-names-modal__warning {
  margin: .15rem 0 0;
  font-size: .78rem;
  line-height: 1.4;
  color: #8a3d18;
  background: #fcefe7;
  border-left: 3px solid var(--color-pending);
  border-radius: var(--radius);
  padding: .35rem .55rem;
}
.drive-names-modal__warning[hidden] { display: none; }

/* Optional confirmation line in the whats-next block — neutral, works for
   both ZIP-finalized and Drive-finalized flows. */
.wall-cropper .whats-next__confirm {
  margin: 0 0 .85rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.wall-cropper .whats-next__confirm strong { color: var(--color-text); }

/* Step 2 / Issue B — "What's next?" workflow continuation, text-style.
   Replaces the promotional gateway-cta cards. Reads as natural workflow links. */
.wall-cropper .whats-next {
  margin-top: .25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.wall-cropper .whats-next[hidden] { display: none; }
.wall-cropper .whats-next__confirm {
  margin: 0 0 .85rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.wall-cropper .whats-next__confirm strong { color: var(--color-text); }
.wall-cropper .whats-next__title {
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  margin: 0 0 .65rem;
}
.wall-cropper .whats-next__link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  padding: .25rem 0;
  cursor: pointer;
  line-height: 1.5;
  text-decoration: none; /* override global `a` underline */
}
.wall-cropper a.whats-next__link { color: var(--color-text); }
.wall-cropper a.whats-next__link:hover { color: var(--color-primary-dark); }
.wall-cropper .whats-next__link:disabled {
  cursor: not-allowed;
  color: var(--color-text-muted);
}
.wall-cropper .whats-next__suffix {
  color: var(--color-text-muted);
  font-size: .82rem;
  font-style: italic;
  margin-left: .35rem;
}

/* Image card */
.wall-cropper .card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}
/* Step 2.C — Master card visual identifier. 4-px primary stripe on the left
   edge. Padding-left compensates for the 3-px width gain to keep content aligned. */
.wall-cropper .card.card--master {
  border-left: 4px solid var(--color-primary);
  padding-left: calc(1.2rem - 3px);
}
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wall-cropper .card--entering {
  animation: cardEnter 250ms ease-out;
}

/* Cards controls bar — Reset button row, sits above the cards list when images > 0. */
.wall-cropper .cards-controls {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 1rem;
}
.wall-cropper .cards-controls[hidden] {
  display: none;
}
.wall-cropper .reset-btn {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: .4rem .85rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.wall-cropper .reset-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  background: var(--color-surface);
}

/* "Selection changed" banner above stale results. */
.wall-cropper .results-stale-banner {
  background: var(--color-warning-bg);
  border-left: 3px solid var(--color-warning-border);
  padding: .55rem .8rem;
  border-radius: var(--radius);
  font-size: .82rem;
  color: #8a5a1a;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: -.25rem;
}

/* Manual-crop disabled state (when zero formats selected). */
.wall-cropper button.toggle[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.wall-cropper .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .8rem;
  margin-bottom: .9rem;
}
.wall-cropper .card-title {
  flex: 1;
  min-width: 0;
}
.wall-cropper .filename {
  font-weight: 600;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wall-cropper .meta {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: .15rem;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.wall-cropper .badge-warn {
  display: inline-block;
  background: var(--color-warning-bg);
  color: #8a5a1a;
  border: 1px solid var(--color-warning-border);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: .72rem;
  font-weight: 600;
}

.wall-cropper .cropper-upscayl-cta {
  margin: -.25rem 0 .9rem;
  font-size: .85rem;
  color: var(--color-text-muted);
  background: var(--color-warning-bg);
  border-left: 3px solid var(--color-warning-border);
  padding: .55rem .8rem;
  border-radius: var(--radius);
}
.wall-cropper .cropper-upscayl-cta a {
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* Remove (×) button */
.wall-cropper .remove-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.wall-cropper .remove-btn:hover {
  color: #b03030;
  border-color: #b03030;
  background: #fdf0f0;
}

/* Preview area */
.wall-cropper .preview-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}
.wall-cropper .preview-img {
  display: block;
  max-width: 100%;
}
.wall-cropper .crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.wall-cropper .crop-overlay.active { pointer-events: auto; }
.wall-cropper .crop-overlay .crop-rect-handle { cursor: move; }
.wall-cropper .crop-overlay.dragging .crop-rect-handle { cursor: grabbing; }

/* Resize handles — 4 corner grippers on the manual-crop overlay. Visible only
   when the overlay is .active. Rendered after .crop-rect-handle so corner
   pointerdown events go to these instead of the move target. */
.wall-cropper .resize-handle {
  fill: var(--color-primary);
  stroke: white;
  stroke-width: 1.5;
  cursor: nwse-resize;
}
.wall-cropper .resize-handle[data-corner="ne"],
.wall-cropper .resize-handle[data-corner="sw"] {
  cursor: nesw-resize;
}
.wall-cropper .resize-handle:hover {
  fill: var(--color-primary-dark);
}
.wall-cropper .crop-overlay:not(.active) .resize-handle { display: none; }

/* Controls (orientation / sizes / manual crop) */
.wall-cropper .controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .8rem 0 .3rem;
  align-items: center;
}
.wall-cropper .controls-row + .controls-row { margin-top: .3rem; }
.wall-cropper .label-tag {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  margin-right: .25rem;
  font-weight: 700;
}

/* Size groups — US / EU sub-headers with master checkbox.
   Square orientation reuses .size-group--flat (no master checkbox, no sub-header content). */
.wall-cropper .size-group {
  margin: .85rem 0 .3rem;
}
.wall-cropper .size-group + .size-group {
  margin-top: .9rem;
}
.wall-cropper .size-group__header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .45rem;
}
.wall-cropper .size-group__header--flat {
  /* Square orientation: just the label, no checkbox alignment slot. */
  margin-bottom: .35rem;
}
.wall-cropper .size-group__master {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.wall-cropper .size-group__label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.wall-cropper .size-group--flat .size-group__label {
  cursor: default;
}
.wall-cropper .size-group__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.wall-cropper button.toggle,
.wall-cropper button.size-btn,
.wall-cropper button.orient-btn {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid #c9c3b5;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.wall-cropper button.size-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  padding: .35rem .6rem;
  min-width: 56px;
}
.wall-cropper button.size-btn .dims {
  font-size: .62rem;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 1px;
  letter-spacing: 0.2px;
}
.wall-cropper button.size-btn.active .dims { opacity: 0.95; }
.wall-cropper button.toggle:hover,
.wall-cropper button.size-btn:hover,
.wall-cropper button.orient-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}
/* Step 2 / Issue D — Category 1 (selection states): outlined navy, not filled.
   Active = ON state, distinct from filled-navy transformation actions (Cat 2). */
.wall-cropper button.toggle.active,
.wall-cropper button.size-btn.active,
.wall-cropper button.orient-btn.active {
  background: transparent;
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
  font-weight: 600;
}
.wall-cropper button.toggle.active:hover,
.wall-cropper button.size-btn.active:hover,
.wall-cropper button.orient-btn.active:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* Orientation-tab markers: ● pending (orange, action needed) vs ✓ done.
   --color-pending is a dedicated token; stays orange through Block 7's rebrand. */
.wall-cropper .tab-marker {
  margin-left: .25rem;
  font-weight: 700;
  line-height: 1;
}
.wall-cropper .tab-marker--pending {
  color: var(--color-pending);
  font-size: .85em;
}
/* Step 2 / Issue D — Done marker uses --color-success (emerald) for semantic
   consistency with Download buttons (Category 3). Pending dot stays orange. */
.wall-cropper .tab-marker--done {
  color: var(--color-success);
  font-size: .9em;
}

.wall-cropper select {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: .4rem .55rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  outline: none;
}
.wall-cropper select:focus { border-color: var(--color-primary); }
.wall-cropper select:disabled { cursor: not-allowed; }

/* Live ZIP-size estimation line — sits between the manual-crop controls and
   the Generate button. Refreshes surgically on size/master toggle, and via
   renderApp() on orientation switch / image add / efficiency-coefficient ready. */
.wall-cropper .estimation-line {
  margin: .9rem 0 .35rem;
  font-size: .82rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.wall-cropper button.generate-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: .7rem 1.3rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .35rem;
  transition: background 0.15s;
  letter-spacing: 0.2px;
}
.wall-cropper button.generate-btn:hover { background: var(--color-primary-dark); }
.wall-cropper button.generate-btn:disabled { opacity: 0.6; cursor: wait; }

/* Step 2 / Issue D — Category 3 (output/recovery actions): filled emerald.
   Per-tile Download, per-card Download print pack, and the global mega-button. */
.wall-cropper button.download-btn,
.wall-cropper a.download-btn {
  background: var(--color-success);
  color: white;
  border: 1px solid var(--color-success);
  padding: .3rem .65rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.12s, border-color 0.12s;
}
.wall-cropper button.download-btn:hover,
.wall-cropper a.download-btn:hover {
  background: var(--color-success-dark);
  border-color: var(--color-success-dark);
}

.wall-cropper button.download-all {
  background: var(--color-success);
  color: white;
  border: none;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .8rem;
  transition: background 0.15s;
}
.wall-cropper button.download-all:hover { background: var(--color-success-dark); }
.wall-cropper button.download-all:disabled { opacity: 0.7; cursor: wait; }

/* Results groups — US / EU sub-headers above tiles (portrait/landscape). */
.wall-cropper .results-group {
  margin-top: 1rem;
}
.wall-cropper .results-group + .results-group {
  margin-top: 2.5rem;
}
.wall-cropper .results-group__header {
  font-family: var(--font-sans);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  font-weight: 700;
  margin: 0 0 .5rem;
}

.wall-cropper .results {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.wall-cropper .results-group .results { margin-top: 0; }
.wall-cropper .result-tile {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .55rem;
  text-align: center;
  font-size: .72rem;
}
.wall-cropper .result-tile img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  background: #f0ede5;
  display: block;
  margin: 0 auto .4rem;
}
.wall-cropper .result-label {
  font-weight: 600;
  color: var(--color-text);
  font-size: .8rem;
}
.wall-cropper .result-dims {
  color: var(--color-text-muted);
  font-size: .68rem;
  margin-bottom: .4rem;
}

/* Always-visible "no frame" advice */
.wall-cropper .cropper-advice {
  background: #fef9e7;
  border-left: 3px solid var(--color-warning-border);
  padding: .65rem .9rem;
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--color-text);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

/* Collapsible "Recommended sizes" */
.wall-cropper .sizes-collapsible {
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.wall-cropper .sizes-collapsible__toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text);
  padding: .8rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wall-cropper .sizes-collapsible__toggle::after {
  content: '▾';
  font-size: .9rem;
  color: var(--color-text-muted);
  transition: transform .15s;
}
.wall-cropper .sizes-collapsible[data-open="true"] .sizes-collapsible__toggle::after {
  transform: rotate(180deg);
}
.wall-cropper .sizes-collapsible__panel {
  padding: 0 1rem 1rem;
  font-size: .9rem;
  line-height: 1.55;
  border-top: 1px solid var(--color-border);
}
.wall-cropper .sizes-collapsible[data-open="false"] .sizes-collapsible__panel { display: none; }
.wall-cropper .sizes-collapsible__intro { margin: .75rem 0; }
.wall-cropper .sizes-collapsible__table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .3rem .9rem;
  margin: .5rem 0 1rem;
  font-size: .88rem;
}
.wall-cropper .sizes-collapsible__table div { font-variant-numeric: tabular-nums; }
.wall-cropper .sizes-collapsible__table strong { font-weight: 600; color: var(--color-primary-dark); }
.wall-cropper .sizes-collapsible__tip { margin: .5rem 0; font-size: .88rem; color: var(--color-text); }

/* Per-tile DPI warning badge */
.wall-cropper .dpi-tile-warning {
  display: block;
  margin-top: .35rem;
  font-size: .68rem;
  color: #8a5a1a;
  font-weight: 600;
  line-height: 1.3;
}

/* .app-modal* primitives moved to /css/style.css so the Mockup Maker (and
   future services) share the same modal styles without re-loading this file. */
