/* Design tokens, header/footer, .wrap/.card/.hero and other cross-tool
   chrome now live in /shared/public/site.css, loaded before this file on
   every page. Only Image Toolbox's own UI lives here. */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--accent);
  outline: none;
}
.dz-icon { font-size: 2rem; margin-bottom: 8px; }

.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  margin-top: 16px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 28px;
}
@media (max-width: 720px) {
  .work-grid { grid-template-columns: 1fr; }
}

.preview-col img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  touch-action: none;
  user-select: none;
}
#cropOverlay {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(37, 99, 235, 0.15);
  pointer-events: none;
}

/* #cropOverlay is appended as a direct child of #fileInfo and positioned
   using coordinates measured from previewImg's own top-left corner — so
   #fileInfo, not .preview-col, must be the positioned ancestor its
   position:absolute resolves against. With only .preview-col relative
   (the old setup), the overlay's containing block started at the top of
   .preview-col — above the dropzone, which stays visible after upload —
   instead of at the image, so the crop box appeared over the dropzone. */
#fileInfo { position: relative; margin-top: 18px; }
#fileInfo .expiry-note { margin-top: 12px; }

#toolFormHint {
  padding: 10px 12px;
  margin-bottom: 18px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.tool-col input:disabled,
.tool-col select:disabled,
.tool-col button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.meta-list { display: flex; gap: 18px; margin: 14px 0; flex-wrap: wrap; }
.meta-list > div { min-width: 90px; }
.meta-list dt { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.meta-list dd { margin: 2px 0 0; font-weight: 600; }

.expiry-note { font-size: 0.88rem; color: var(--text-muted); }
.expiry-note strong { color: var(--text); }

.tool-group { margin-bottom: 22px; }
.tool-group h2 { font-size: 1rem; margin: 0 0 10px; }

.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}
input[type="range"] { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.88rem;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.results-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.result-card .r-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  display: block;
}
.result-card .r-preview-unsupported {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.result-card .r-format { font-weight: 700; text-transform: uppercase; font-size: 0.8rem; color: var(--accent); }
.result-card .r-dims { color: var(--text-muted); font-size: 0.85rem; margin: 2px 0 10px; }
.result-card a.download-btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
