/* Photo tools. Builds on style.css and pdf.css (dropzone, status, primary button, steps, privacy note). */

.img-tool [hidden] { display: none !important; }

.img-targets { margin: 16px 0 0; }
.img-segmented { flex-wrap: wrap; }
.img-segmented label { flex: 1 1 30%; }
.img-segmented span { white-space: nowrap; }

.img-custom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.img-custom .field { margin-top: 12px; }
.img-custom .field:last-child { align-self: end; }

.img-results { list-style: none; padding: 0; margin: 8px 0 0; }
.img-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.img-item:last-child { border-bottom: 0; }
.img-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--bg); }
.img-thumb:not([src]) { visibility: hidden; }
.img-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.img-meta-result { display: flex; flex-direction: column; gap: 2px; font-size: 15px; color: var(--muted); }
.img-meta-result b { color: var(--text); }
.img-saved { color: var(--accent); font-weight: 600; }
.img-dims { font-size: 14px; }
.img-meta-result .is-warn, .img-meta-result .hint { font-size: 14px; margin: 0; }
.img-dl {
  white-space: nowrap;
  font-size: 15px;
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.img-dl:hover { text-decoration: none; filter: brightness(0.97); }
.img-tool [data-download-all] { margin-top: 12px; }

.img-size-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 0.9fr); gap: 8px; align-items: end; }
.img-size-row .field { margin-top: 12px; }
.img-times { padding-bottom: 12px; color: var(--muted); }
.img-swap { margin-top: 12px; }
.img-fit { margin: 16px 0 0; }

.img-stage { margin: 16px 0 0; text-align: center; }
.img-preview {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.img-preview.is-movable { cursor: grab; touch-action: none; }
.img-preview.is-movable:active { cursor: grabbing; }
.img-preview:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.img-stage .hint { margin-top: 8px; }

.img-summary { margin-top: 12px; }
.img-summary:empty { display: none; }
.img-note { display: block; font-weight: 400; font-size: 15px; margin-top: 4px; }
.img-tool a.primary-button[hidden] { display: none; }

@media (max-width: 400px) {
  .img-size-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .img-size-row .field:last-child { grid-column: 1 / -1; }
  .img-item { grid-template-columns: 52px minmax(0, 1fr); }
  .img-thumb { width: 52px; height: 52px; }
  .img-dl { grid-column: 2; justify-self: start; }
}

/* Collage: photo order and a full-width preview. */
.img-order { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.img-order-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.img-order-thumb { display: block; width: 72px; height: 72px; border-radius: 10px; background: var(--bg); }
.img-order-n {
  position: absolute; top: 4px; inset-inline-start: 4px; min-width: 20px; padding: 0 5px; border-radius: 999px;
  background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px; text-align: center;
}
.img-order-tools { display: flex; gap: 2px; }
.img-order-tools .copy { min-width: 30px; min-height: 30px; padding: 2px 6px; font-size: 14px; }
.img-order-tools .copy:disabled { opacity: 0.35; cursor: default; }
.img-collage-preview { max-width: 100%; max-height: 70vh; width: auto; }
.img-tool [data-download] { margin-top: 12px; }

/* Passport photo, background removal and ID card printing. */
.idp-spec-card { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 15px; color: var(--muted); }
.idp-spec-card b { color: var(--text); font-weight: 600; }
.idp-tool .field select, .idp .field select { width: 100%; }
.idp .dropzone { margin-top: 16px; }
.idp-editor { max-width: 300px; touch-action: none; }
.idp-zoom { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.idp-zoom label { flex: 0 1 220px; }
.idp-zoom input[type="range"] { width: 100%; }
.idp-zoom .copy { min-width: 40px; }
.idp-remove { margin-top: 16px; }
.idp [data-bg-box] input[type="color"] { display: block; margin: 8px auto 0; width: 64px; height: 36px; border: 0; background: none; }
.idp [data-bg-box] input[type="color"][hidden] { display: none; }
.idp-sheet { margin: 20px 0 0; }
.idp-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; }
.idp-row .field { margin-top: 8px; }
.idp-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.idp-buttons[hidden] { display: none; }
.idp-specs { list-style: none; padding: 0; margin: 0; }
.idp-specs li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.idp-specs li:last-child { border-bottom: 0; }
.idp-specs h3 { margin: 0 0 4px; font-size: 17px; }
.idp-specs p { margin: 4px 0 0; }
.idp-req, .idp-src { font-size: 15px; color: var(--muted); }

.idc-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.idc-side h2 { font-size: 17px; margin: 0 0 8px; }
.idc-editor { max-width: 100%; touch-action: none; }
.idc-bw { display: flex; align-items: center; gap: 8px; margin-top: 16px; }

/* Printing a sheet: only the sheet image, at its real size. */
.idp-print-sheet { display: none; }
@media print {
  body.is-printing { margin: 0; background: #fff; }
  body.is-printing > :not(.idp-print-sheet) { display: none !important; }
  body.is-printing .idp-print-sheet { display: block; margin: 0; }
}
