/* Image Converter — app-specific styles. Inherits the shared LIGHT design system
   (tokens + fonts) from ../styles.css and builds on its --surface / --line /
   --line-strong / --shadow / --accent-soft vocabulary so the tool matches
   Compress PDF and the rest of the catalog. (Do NOT use --panel / --bg2 — those
   are dead tokens from the old navy theme and render transparent.) */

.wrap { max-width: 880px; padding-bottom: 40px; position: relative; z-index: 1; }

/* Warm peach hue rising from the bottom-left, painted behind the content
   (z-index:-1) over the light gray body — matches Merge/Compress PDF. The white
   cards sit on top of it, so only the page background is tinted, not the cards. */
body.shell::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(65% 60% at 0% 100%, rgba(237, 131, 54, .55), rgba(246, 181, 69, .22) 45%, transparent 78%),
    radial-gradient(38% 36% at 100% 100%, rgba(246, 181, 69, .20), transparent 70%);
}

/* --- Controls --- */
.controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-top: 20px;
}
.ctrl { display: flex; flex-direction: column; gap: 8px; }
.ctrl > label { font-weight: 600; font-size: 15px; }
.ctrl .hint { color: var(--muted); font-size: 13px; }
select, input[type="number"] {
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 15px;
}
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 109, 240, .18); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* --- Drop zone --- */
.dropzone {
  margin-top: 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-hover); }
.empty { display: grid; place-items: center; gap: 12px; padding: 46px 24px; text-align: center; }
.empty svg { color: var(--accent); }
.empty-title { font-weight: 600; font-size: 18px; }
.empty-sub { color: var(--muted); font-size: 14px; max-width: 460px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff;
  border-color: transparent; box-shadow: 0 6px 22px rgba(47, 109, 240, .35); cursor: pointer;
}
.btn-ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); cursor: pointer; }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn-sm {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-sm:hover { background: #2159cf; border-color: #2159cf; }

/* --- Results bar --- */
.resbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-top: 24px;
}
.resbar-left { display: flex; flex-direction: column; gap: 2px; }
.resbar-left .summary { color: var(--muted); font-size: 14px; }
.resbar-right { display: flex; gap: 10px; flex-wrap: wrap; }
.resbar .btn { padding: 10px 18px; font-size: 14px; box-shadow: none; }
#download-all:not(:disabled) { box-shadow: 0 6px 22px rgba(47, 109, 240, .35); }

/* --- Per-image rows --- */
.list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
.row-main { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.thumb {
  width: 54px; height: 54px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); flex: none;
}
/* HEIC/HEIF can't be shown by <img>, so its row gets a format-badge placeholder. */
.thumb-ph {
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .02em; background: var(--bg);
}
.row-body { flex: 1; min-width: 0; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-note { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.row-warn { color: #b45309; font-size: 12.5px; margin-top: 3px; }
.row-right { display: flex; align-items: center; gap: 12px; flex: none; }
.row-meta { font-size: 13px; color: var(--muted); }
.row-meta strong { color: var(--text); }
.row-status { color: var(--muted); font-size: 13px; }
.row-status.err { color: #b91c1c; }
.badge-pct { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge-pct.save { color: var(--good); background: rgba(28, 164, 99, .14); }
.badge-pct.same { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.badge-pct.grow { color: #b91c1c; background: #fee2e2; }

/* --- Privacy line — MUST be a <div>, not <footer>: the shared design system has
   an unscoped footer{} navy-chrome rule that would otherwise paint it dark. --- */
.privacy {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.privacy .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.privacy .dot.good { background: var(--good); box-shadow: 0 0 0 3px rgba(28, 164, 99, .18); }
.privacy .ledger { margin-left: auto; opacity: .85; }
.privacy .ledger b { color: var(--text); }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--text); color: #fff;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .row-main { flex-wrap: wrap; }
  .row-right { width: 100%; justify-content: flex-end; }
  .privacy .ledger { margin-left: 0; width: 100%; }
}
