/* ==========================================================================
   Image Converter — tool page only (/tools/image-converter/)
   Uses the design tokens from main.css, so both themes work automatically.
   ========================================================================== */

:root {
  --imc-checker-a: rgba(255, 255, 255, 0.07);
  --imc-checker-b: rgba(255, 255, 255, 0.02);
  --imc-solid: #0e1126;
}
:root[data-theme="light"] {
  --imc-checker-a: #e7e9f3;
  --imc-checker-b: #ffffff;
  --imc-solid: #ffffff;
}

.workspace.imc { grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); }
@media (max-width: 960px) { .workspace.imc { grid-template-columns: minmax(0, 1fr); } }

.imc [hidden] { display: none !important; }

.imc-checker {
  background-color: var(--imc-checker-b);
  background-image:
    linear-gradient(45deg, var(--imc-checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--imc-checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--imc-checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--imc-checker-a) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* Drop zone ---------------------------------------------------------------- */
.imc-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 2.5rem 1.5rem;
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background-color 0.25s, transform 0.25s var(--ease), min-height 0.4s var(--ease), padding 0.4s var(--ease);
}
.imc-dropzone:hover, .imc-dropzone.drag { border-color: rgba(139, 92, 246, 0.7); background: var(--surface-2); }
.imc-dropzone.drag { transform: scale(1.01); }
.imc-dropzone:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }
.imc-dz-icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 20px;
  color: #fff;
  background: var(--grad);
  box-shadow: var(--glow);
  transition: transform 0.35s var(--ease);
}
.imc-dz-icon .icon { width: 28px; height: 28px; }
.imc-dropzone:hover .imc-dz-icon { transform: translateY(-3px); }
.imc-dz-title { margin: 1.1rem 0 0.3rem; color: var(--text); font: 600 1.3rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.imc-dz-sub { margin: 0; color: var(--text-2); font-size: 0.92rem; }
.imc-link { color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.imc-dz-formats { margin: 1rem 0 0; color: var(--muted); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; }
.imc kbd {
  padding: 2px 6px;
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  font: 600 0.72rem/1 var(--font-body);
}
.imc.has-files .imc-dropzone { min-height: 140px; padding: 1.4rem; }
.imc.has-files .imc-dz-icon { width: 48px; height: 48px; border-radius: 15px; }
.imc.has-files .imc-dz-icon .icon { width: 22px; height: 22px; }
.imc.has-files .imc-dz-title { margin-top: 0.7rem; font-size: 1.1rem; }
.imc.has-files .imc-dz-formats, .imc.has-files .imc-tips { display: none; }

/* Toolbar ------------------------------------------------------------------ */
.imc-toolbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.imc-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; color: var(--text-2); font-size: 0.88rem; }
.imc-stats b { color: var(--text); font-weight: 600; }
.imc-tb-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.imc-tb-actions .btn .icon { width: 16px; height: 16px; }
.btn.is-busy .icon { animation: spin 1s linear infinite; }
.imc-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; opacity: 0; transition: opacity 0.3s; }
.imc-progress.on { opacity: 1; }
.imc-progress span { display: block; width: 0; height: 100%; border-radius: 0 3px 3px 0; background: var(--grad); transition: width 0.35s ease; }

/* File list ---------------------------------------------------------------- */
.imc-files { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.imc-files:empty { display: none; }
.imc-file {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.8rem 0.7rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease), border-color 0.25s;
}
.imc-file.in { opacity: 1; transform: none; }
.imc-file.out { opacity: 0; transform: translateX(24px); }
.imc-file:hover { border-color: var(--border-2); }
.imc-file.is-done { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.imc-file.is-error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.imc-file.is-stale { border-color: var(--border); }

.imc-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  overflow: hidden;
  cursor: zoom-in;
}
.imc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.imc-thumb:disabled { cursor: default; }
.imc-thumb-zoom {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(8, 8, 20, 0.5);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}
.imc-thumb:not(:disabled):hover .imc-thumb-zoom, .imc-thumb:focus-visible .imc-thumb-zoom { opacity: 1; }
.imc-thumb:not(:disabled):hover img { transform: scale(1.08); }
.imc-thumb:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

.imc-file-info { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.imc-file-name { overflow: hidden; color: var(--text); font-weight: 600; font-size: 0.93rem; white-space: nowrap; text-overflow: ellipsis; }
.imc-file-meta, .imc-result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; color: var(--text-2); font-size: 0.8rem; }
.imc-result .icon { width: 14px; height: 14px; color: var(--muted); }
.imc-result.is-error { color: var(--danger-text); }
.imc-result.is-error .icon { color: var(--danger); }
.imc-result.is-muted { color: var(--muted); }
.imc-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.imc-stale { color: var(--muted); font-size: 0.75rem; font-style: italic; }

.imc-fmt {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--c, #94a3b8) 40%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--c, #94a3b8) 16%, transparent);
  color: color-mix(in srgb, var(--c, #94a3b8) 70%, var(--mix-base));
  font: 700 0.66rem/1 var(--font-body);
  letter-spacing: 0.05em;
}
.imc-delta { padding: 2px 7px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.imc-delta.good { color: var(--success-text); background: rgba(52, 211, 153, 0.14); }
.imc-delta.bad { color: var(--danger-text); background: rgba(251, 113, 133, 0.14); }

.imc-file-actions { display: flex; align-items: center; gap: 0.35rem; }
.imc-file-actions .btn .icon { width: 15px; height: 15px; }
.imc-file-actions .icon-btn.icon-only { padding: 0.45rem; }
.imc-file-actions .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.imc-remove:hover { color: var(--danger-text); border-color: rgba(251, 113, 133, 0.5); background: rgba(251, 113, 133, 0.12); }

.imc-card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; opacity: 0; }
.is-working .imc-card-progress, .is-loading .imc-card-progress { opacity: 1; }
.imc-card-progress::after {
  content: "";
  position: absolute; top: 0; bottom: 0;
  width: 40%;
  background: var(--grad);
  animation: imc-indet 1.1s ease-in-out infinite;
}
@keyframes imc-indet { from { left: -40%; } to { left: 100%; } }
.imc-spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--border-2);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.imc-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.imc-tips li { padding: 0.8rem 0.9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.imc-tips b { display: block; color: var(--text); font-size: 0.86rem; font-weight: 600; }
.imc-tips span { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
@media (max-width: 620px) { .imc-tips { grid-template-columns: 1fr; } }

/* Settings ----------------------------------------------------------------- */
.imc-settings { gap: 1.1rem; }
.imc-field { display: flex; flex-direction: column; gap: 0.55rem; }
.imc-hint { color: var(--muted); font-weight: 400; }
.imc-label { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; color: var(--text); font-size: 0.88rem; font-weight: 600; }
.imc-label output {
  padding: 0.2rem 0.5rem;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.imc-format-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; }
.imc-fmt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.2rem 0.6rem;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font: 700 0.8rem/1 var(--font-display);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s;
}
.imc-fmt-btn i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.imc-fmt-btn:hover:not(:disabled) { color: var(--text); border-color: rgba(var(--ink), 0.26); transform: translateY(-1px); }
.imc-fmt-btn.active {
  color: var(--on-soft);
  background: var(--grad-soft);
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: 0 8px 20px -12px rgba(139, 92, 246, 0.9);
}
.imc-fmt-btn.active i { box-shadow: 0 0 10px var(--c); }
.imc-fmt-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.imc-fmt-btn:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

.imc-format-desc { margin: 0; padding: 0.65rem 0.8rem; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 0.84rem; }
.imc-format-desc b { color: var(--text); }
.imc-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.imc-tags .badge { padding: 0.2rem 0.55rem; font-size: 0.7rem; }

.imc-settings .action-buttons .chip-btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* Range slider */
.imc-range {
  --p: 50%;
  width: 100%;
  height: 22px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.imc-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--violet)) 0 / var(--p) 100% no-repeat, var(--surface-3);
}
.imc-range::-moz-range-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
.imc-range::-moz-range-progress { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.imc-range::-webkit-slider-thumb {
  width: 18px; height: 18px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.35);
  -webkit-appearance: none;
}
.imc-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.imc-range:focus-visible { outline: none; }
.imc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.6); }
.imc-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.6); }
.imc-range-hints { display: flex; justify-content: space-between; margin-top: -0.35rem; color: var(--muted); font-size: 0.72rem; }

/* Icon size chips */
.imc-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.imc-chip { position: relative; cursor: pointer; }
.imc-chip input { position: absolute; opacity: 0; pointer-events: none; }
.imc-chip span {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.imc-chip:hover span { color: var(--text); }
.imc-chip input:checked + span { color: var(--on-soft); background: var(--grad-soft); border-color: rgba(139, 92, 246, 0.6); }
.imc-chip input:focus-visible + span { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* Collapsible groups */
.imc-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.imc-group summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.imc-group summary::-webkit-details-marker { display: none; }
.imc-group summary::after {
  content: "";
  width: 7px; height: 7px;
  margin-left: 0.3rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s;
}
.imc-group[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.imc-group summary:focus-visible { outline: 2px solid var(--lilac); outline-offset: -2px; border-radius: var(--radius); }
.imc-summary { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.imc-summary.on { color: var(--lilac); }
.imc-sw { width: 12px; height: 12px; border: 1px solid var(--border-2); border-radius: 4px; background: var(--c); }
.imc-group-body { display: flex; flex-direction: column; gap: 0.9rem; padding: 0.15rem 0.9rem 1rem; }
.imc-group .select { min-height: 42px; font-size: 0.9rem; }
.imc-group .segmented legend { font-size: 0.82rem; }
.imc-group .segmented label { padding: 0.4rem 0.75rem; font-size: 0.82rem; }

.imc-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.imc-num {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--field-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.imc-num:focus-within { border-color: rgba(139, 92, 246, 0.7); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16); }
.imc-num span, .imc-num em { color: var(--muted); font-size: 0.75rem; font-style: normal; font-weight: 600; }
.imc-num input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: 600 0.9rem var(--font-body);
  font-variant-numeric: tabular-nums;
  text-align: right;
  -moz-appearance: textfield;
}
.imc-num input::-webkit-outer-spin-button, .imc-num input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }

.imc-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.imc-toggles.three { grid-template-columns: repeat(3, 1fr); }
.imc-toggle { position: relative; }
.imc-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.imc-toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.5rem;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.imc-toggle span:hover { color: var(--text); }
.imc-toggle input:checked + span { color: var(--on-soft); background: var(--grad-soft); border-color: rgba(139, 92, 246, 0.6); }
.imc-toggle input:focus-visible + span { outline: 2px solid var(--lilac); outline-offset: 2px; }

.imc-switch { position: relative; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.imc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.imc-track { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); transition: background 0.25s; }
.imc-track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s var(--ease);
}
.imc-switch input:checked + .imc-track { background: var(--grad); border-color: transparent; }
.imc-switch input:checked + .imc-track::after { transform: translateX(18px); }
.imc-switch input:focus-visible + .imc-track { outline: 2px solid var(--lilac); outline-offset: 2px; }
.imc-switch input:disabled + .imc-track { opacity: 0.6; }
.imc-switch:has(input:disabled) { cursor: default; }
.imc-switch-text { display: flex; flex-direction: column; color: var(--text); font-size: 0.88rem; font-weight: 500; }
.imc-switch-text small { color: var(--muted); font-size: 0.76rem; font-weight: 400; }

.imc-swatches { display: flex; align-items: center; gap: 0.5rem; }
.imc-swatches button, .imc-color-pick {
  position: relative;
  width: 32px; height: 32px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.imc-swatches button:hover, .imc-color-pick:hover { transform: translateY(-2px); }
.imc-swatches button.active, .imc-color-pick.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--violet); }
.imc-swatches button:focus-visible, .imc-color-pick:focus-within { outline: 2px solid var(--lilac); outline-offset: 3px; }
.imc-color-pick { overflow: hidden; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #22d3ee, #8b5cf6, #f43f5e); }
.imc-color-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.imc-color-pick span { position: absolute; inset: 7px; border-radius: 5px; background: var(--c, transparent); pointer-events: none; }

/* Formats table ------------------------------------------------------------- */
.imc-formats { padding: clamp(18px, 3vw, 28px); border-radius: var(--radius-lg); }
.imc-table-wrap { overflow-x: auto; }
.imc-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.imc-table th, .imc-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-2); text-align: left; vertical-align: middle; }
.imc-table thead th { padding-top: 0; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.imc-table tbody th { white-space: nowrap; }
.imc-table td:nth-child(2) { min-width: 200px; }
.imc-table tr:last-child th, .imc-table tr:last-child td { border-bottom: 0; }
.imc-yes { color: var(--success-text) !important; font-weight: 600; }
.imc-note { color: var(--muted); font-size: 0.75rem; }
.imc-reads { margin: 1.1rem 0 0; color: var(--text-2); font-size: 0.9rem; }
.imc-reads b { color: var(--text); }

/* Compare modal ------------------------------------------------------------- */
.imc-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.imc-modal[hidden] { display: none; }
.imc-modal-backdrop { position: absolute; inset: 0; background: rgba(4, 4, 12, 0.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.imc-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  background: var(--imc-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: imc-pop 0.3s var(--ease);
}
@keyframes imc-pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.imc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; }
.imc-modal-titles { min-width: 0; }
.imc-modal-head h2 { margin: 0; overflow: hidden; font-size: 1.1rem; white-space: nowrap; text-overflow: ellipsis; }
.imc-modal-head p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.82rem; }
.imc-modal-head .icon-btn { flex: none; padding: 0.45rem; }
.imc-compare { position: relative; height: min(62vh, 620px); overflow: hidden; user-select: none; }
.imc-cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.imc-cmp-b { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--x, 50%)); }
.imc-cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); pointer-events: none; }
.imc-cmp-handle span {
  position: absolute; top: 50%; left: 50%;
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.imc-cmp-handle span::before, .imc-cmp-handle span::after {
  content: "";
  position: absolute; top: 50%;
  width: 7px; height: 7px;
  margin-top: -4px;
  border-left: 2px solid #111;
  border-bottom: 2px solid #111;
}
.imc-cmp-handle span::before { left: 9px; transform: rotate(45deg); }
.imc-cmp-handle span::after { right: 9px; transform: rotate(-135deg); }
.imc-cmp-label {
  position: absolute; top: 12px;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
}
.imc-cmp-label.left { left: 12px; }
.imc-cmp-label.right { right: 12px; }
.imc-cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.imc-compare:has(.imc-cmp-range:focus-visible) .imc-cmp-handle span { box-shadow: 0 0 0 4px var(--violet); }
.imc-compare.single .imc-cmp-b, .imc-compare.single .imc-cmp-handle,
.imc-compare.single .imc-cmp-label, .imc-compare.single .imc-cmp-range { display: none; }
.imc-modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.2rem; border-top: 1px solid var(--border); }
.imc-modal-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; color: var(--text-2); font-size: 0.88rem; }
.imc-modal-stats .icon { width: 14px; height: 14px; color: var(--muted); }
.imc-modal-stats b { color: var(--text); }
.imc-modal-foot .btn .icon { width: 16px; height: 16px; }

/* Drop overlay -------------------------------------------------------------- */
.imc-drop-overlay {
  position: fixed; inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(10, 8, 30, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.imc-drop-overlay.on { opacity: 1; }
.imc-drop-overlay-inner {
  padding: 3rem 4rem;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  color: #fff;
  font: 600 1.4rem/1 var(--font-display);
}

@media (max-width: 640px) {
  .imc-file { grid-template-columns: 56px minmax(0, 1fr); gap: 0.75rem; }
  .imc-thumb { width: 56px; height: 56px; }
  .imc-file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .imc-tb-actions { width: 100%; }
  .imc-tb-actions .btn { flex: 1; padding: 0 0.6rem; }
  .imc-format-grid { gap: 0.3rem; }
  .imc-fmt-btn { font-size: 0.74rem; }
  .imc-modal { align-items: end; padding: 0; }
  .imc-modal-card { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .imc-compare { height: 55vh; }
  .imc-drop-overlay-inner { padding: 2rem; font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .imc-file, .imc-dropzone, .imc-modal-card, .imc-card-progress::after { transition: none; animation: none; }
}
