/* Shrink page: action-first layout and original-image preview */
.shrink-tool {
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

/* Keep the photo chooser visually consistent with the video tool. */
.shrink-tool .dropzone {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 2rem;
  color: #eaf0ff;
  text-align: center;
  background: rgba(15, 21, 48, 0.96);
  border: 1px dashed rgba(111, 155, 255, 0.55);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.shrink-tool .dropzone:hover,
.shrink-tool .dropzone:focus-within,
.shrink-tool .dropzone.drag-over {
  color: #eaf0ff;
  background: rgba(18, 29, 61, 0.98);
  border-color: #7bf9c8;
}

.shrink-tool .drop-inner {
  width: 100%;
  display: grid;
  place-items: center;
  gap: .7rem;
  padding: .5rem 0;
}

.photo-drop-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: .15rem;
  border-radius: 50%;
  background: rgba(123, 249, 200, 0.12);
  color: #7bf9c8;
  -webkit-text-fill-color: #7bf9c8;
  font-size: 1.45rem;
}

.shrink-tool .drop-title {
  margin: .25rem 0 0;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
  opacity: 1;
}

.shrink-tool .drop-subtitle,
.shrink-tool .drop-formats {
  margin: 0;
  color: #c7d0ea !important;
  -webkit-text-fill-color: #c7d0ea;
  opacity: 1;
}

.shrink-tool #pick {
  width: min(100%, 680px);
  margin-top: .15rem;
  padding: 1rem 1.25rem;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  font-size: 1.08rem;
}

.original-preview {
  margin-top: 1rem;
  padding: clamp(14px, 3vw, 20px);
  color: #f4f7ff;
  background: rgba(15, 21, 48, 0.96);
  border: 1px solid rgba(111, 155, 255, 0.28);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.original-preview-grid {
  display: grid;
  grid-template-columns: minmax(180px, 320px) 1fr;
  gap: 1rem;
  align-items: center;
}

.original-preview-image-wrap {
  min-height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background-color: #eef1f6;
  background-image:
    linear-gradient(45deg, #d7d7d7 25%, transparent 25%),
    linear-gradient(-45deg, #d7d7d7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7d7d7 75%),
    linear-gradient(-45deg, transparent 75%, #d7d7d7 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.original-preview-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.original-preview-copy h3 {
  margin: 0 0 .55rem;
  color: #ffffff;
}

.original-preview-name {
  margin: 0 0 .45rem;
  color: #ffffff;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.original-preview-details {
  margin: 0;
  color: #c5cdea;
  font-variant-numeric: tabular-nums;
}

.original-preview-notice {
  margin: .75rem 0 0;
  padding: .7rem .8rem;
  border: 1px solid rgba(123, 249, 200, .45);
  border-radius: 12px;
  background: rgba(123, 249, 200, .09);
  color: #d9fff1;
  line-height: 1.45;
}

.photo-diagnostics {
  margin-top: 1rem;
  border: 1px solid rgba(244, 197, 66, .45);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10, 15, 34, .98);
  color: #fff;
}

.photo-diagnostics > summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  list-style: none;
  color: #f6d985;
  font-weight: 850;
}

.photo-diagnostics > summary::-webkit-details-marker { display: none; }
.photo-diagnostics > summary::after { content: " +"; color: #7bf9c8; }
.photo-diagnostics[open] > summary::after { content: " −"; }
.photo-diagnostics-body { padding: 0 1.2rem 1.2rem; }
.photo-diagnostics-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.photo-diagnostics-heading strong { display: block; color: #fff; }
.photo-diagnostics-eyebrow { margin: 0 0 .25rem; color: #7bf9c8; font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.photo-diagnostics-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.photo-diagnostics-actions .btn { padding: .7rem .9rem; }
.photo-diagnostics-note { color: #b8c2dc; line-height: 1.55; }
.photo-diagnostics pre { max-height: 420px; margin: 1rem 0 0; padding: 1rem; overflow: auto; border: 1px solid rgba(111, 155, 255, .25); border-radius: 12px; background: #050916; color: #dbe5ff; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; word-break: break-word; text-align: left; }

@media (max-width: 700px) {
  .photo-diagnostics-heading { align-items: flex-start; flex-direction: column; }
  .photo-diagnostics-actions, .photo-diagnostics-actions .btn { width: 100%; }
  .photo-diagnostics-body { padding: 0 .85rem .85rem; }
  .photo-diagnostics > summary { padding: .85rem; }
  .photo-diagnostics pre { max-height: 360px; font-size: 10.5px; }
}

/* Keep secondary actions readable even when the device requests a light color scheme. */
.shrink-tool .btn.secondary,
.shrink-tool .btn.secondary:visited {
  color: #eef3ff;
  background: #2a3352;
  border: 1px solid rgba(139, 169, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.shrink-tool .btn.secondary:hover:not(:disabled) {
  background: #354064;
}

.shrink-tool .btn:disabled {
  color: #8f99b7;
  background: #252c43;
  border-color: rgba(139, 169, 255, 0.14);
  box-shadow: none;
  opacity: 0.72;
  cursor: not-allowed;
}

.shrink-description {
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

@media (min-width: 900px) {
  header.site {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  header.site .container {
    margin-bottom: .35rem;
  }

  .shrink-tool .tool-heading {
    margin-top: 0;
  }
}

@media (max-width: 700px) {
  .shrink-tool .dropzone {
    min-height: 360px;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: none;
  }

  .shrink-tool .drop-inner {
    gap: .75rem;
  }

  .shrink-tool #pick {
    width: 100%;
  }

  .original-preview-grid {
    grid-template-columns: 1fr;
  }

  .original-preview-image-wrap {
    min-height: 160px;
  }

  .original-preview-copy {
    text-align: center;
  }
}
