/* PixelPal styles - tokens on :root, dark theme via OS setting or [data-theme]. */

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f7f7fb;
  --bg-grad: radial-gradient(1100px 480px at 50% -140px, rgba(139, 92, 246, 0.16), transparent 70%);
  --surface: #ffffff;
  --surface-2: #f3f2f9;
  --text: #15132b;
  --text-2: #3b3756;
  --muted: #6b6787;
  --border: #e5e3f0;
  --border-strong: #cfcbe2;
  --accent: #7c3aed;
  --accent-2: #db2777;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-text: #6d28d9;
  --on-accent: #ffffff;
  --good: #16a34a;
  --good-soft: rgba(22, 163, 74, 0.1);
  --good-text: #15803d;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --warn-text: #b45309;
  --bad-soft: rgba(220, 38, 38, 0.09);
  --bad-text: #b91c1c;
  --checker-a: #ffffff;
  --checker-b: #ebe9f3;
  --shadow: 0 1px 2px rgba(21, 19, 43, 0.05), 0 8px 24px rgba(21, 19, 43, 0.07);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0b1a;
    --bg-grad: radial-gradient(1100px 480px at 50% -140px, rgba(139, 92, 246, 0.2), transparent 70%);
    --surface: #161328;
    --surface-2: #1e1a35;
    --text: #ece9fb;
    --text-2: #c9c4e4;
    --muted: #938db3;
    --border: #2a2547;
    --border-strong: #3a3360;
    --accent: #a78bfa;
    --accent-2: #f472b6;
    --accent-soft: rgba(167, 139, 250, 0.14);
    --accent-text: #c4b5fd;
    --on-accent: #120d26;
    --good: #22c55e;
    --good-soft: rgba(34, 197, 94, 0.14);
    --good-text: #4ade80;
    --warn-soft: rgba(245, 158, 11, 0.14);
    --warn-text: #fbbf24;
    --bad-soft: rgba(248, 113, 113, 0.14);
    --bad-text: #fca5a5;
    --checker-a: #221e3a;
    --checker-b: #2b2649;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0b1a;
  --bg-grad: radial-gradient(1100px 480px at 50% -140px, rgba(139, 92, 246, 0.2), transparent 70%);
  --surface: #161328;
  --surface-2: #1e1a35;
  --text: #ece9fb;
  --text-2: #c9c4e4;
  --muted: #938db3;
  --border: #2a2547;
  --border-strong: #3a3360;
  --accent: #a78bfa;
  --accent-2: #f472b6;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --accent-text: #c4b5fd;
  --on-accent: #120d26;
  --good: #22c55e;
  --good-soft: rgba(34, 197, 94, 0.14);
  --good-text: #4ade80;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --warn-text: #fbbf24;
  --bad-soft: rgba(248, 113, 113, 0.14);
  --bad-text: #fca5a5;
  --checker-a: #221e3a;
  --checker-b: #2b2649;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-grad) no-repeat, var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-text); }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-link { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---------------------------------------------------------------- hero */
.hero { text-align: center; padding: 48px 0 28px; max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.hero h1 { margin: 0; font-size: clamp(28px, 4.6vw, 44px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 800; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 16px auto 0; font-size: 17px; color: var(--text-2); max-width: 640px; }

/* ---------------------------------------------------------------- workspace */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.step {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--accent-text); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 16px;
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.disabled { opacity: 0.6; pointer-events: none; }
.dz-icon { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.dropzone strong { font-size: 15px; }
.link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.dz-hint { font-size: 13px; color: var(--muted); }
.dropzone.compact { padding: 14px 16px; flex-direction: row; justify-content: center; gap: 10px; }
.dropzone.compact .dz-icon { width: 22px; height: 22px; margin: 0; }
.dropzone.compact .dz-hint { display: none; }

/* picked files */
.file-grid {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.file-grid:empty { display: none; }
.file-item { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.file-thumb { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.file-thumb.no-preview { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.file-meta { padding: 5px 7px 6px; font-size: 11.5px; line-height: 1.3; }
.file-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.file-size { color: var(--muted); }
.file-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 12, 35, 0.72);
  color: #fff;
  cursor: pointer;
  opacity: 0.9;
}
.file-remove:hover { opacity: 1; background: #dc2626; }
.file-remove .icon { width: 14px; height: 14px; }
.files-summary { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }

/* presets */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

/* tools */
.tool { border: 1px solid var(--border); border-radius: 14px; margin-top: 10px; background: var(--surface); }
.tool.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft); }
.tool-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.tool-static .tool-head { cursor: default; }
.tool-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.tool-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tool-text strong { font-size: 14.5px; }
.tool-text small { color: var(--muted); font-size: 12.5px; }
.tool-body { padding: 2px 14px 14px; display: grid; gap: 12px; }
.tool.disabled .tool-head { cursor: not-allowed; opacity: 0.6; }

/* switch */
.switch {
  appearance: none;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
  margin: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { cursor: not-allowed; }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); justify-self: start; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.field { display: grid; gap: 8px; align-content: start; }
.field-label, .input-wrap > span, .slider > span, .color-row > span { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.times { padding-bottom: 9px; color: var(--muted); }
.input-wrap { display: grid; gap: 5px; position: relative; flex: 1 1 130px; min-width: 0; }
.input-wrap.wide { flex-basis: 100%; }
.input-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 14.5px;
}
.input-wrap.wide input, .input-wrap input[type="text"] { padding-right: 12px; }
.input-wrap input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap em { position: absolute; right: 12px; bottom: 10px; font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.hint:empty { display: none; }

.slider { display: grid; gap: 6px; }
.slider > span { display: flex; justify-content: space-between; }
.slider output { color: var(--text); text-transform: none; letter-spacing: 0; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; }
.color { width: 44px; height: 34px; padding: 2px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.color-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.wm-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.sliders { gap: 12px; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 34px); gap: 5px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); width: max-content; }
.pos-grid label { position: relative; }
.pos-grid input { position: absolute; opacity: 0; pointer-events: none; }
.pos-grid span { display: grid; place-items: center; width: 34px; height: 26px; border-radius: 7px; cursor: pointer; }
.pos-grid span::after { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--border-strong); }
.pos-grid input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.pos-grid input:checked + span::after { background: var(--accent); width: 12px; height: 8px; }
.pos-grid input:focus-visible + span { outline: 2px solid var(--accent); }
.pos-grid.disabled { opacity: 0.45; pointer-events: none; }

/* action bar */
.action-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  bottom: 12px;
  z-index: 10;
}
.action-info { min-width: 0; flex: 1; display: grid; gap: 4px; }
.progress { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: -10px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s ease; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px -8px var(--accent); }
.btn.primary:hover { box-shadow: 0 10px 24px -8px var(--accent); }
.btn.ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.engine-status { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.engine-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.engine-status.loading::before { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.engine-status.ready::before { background: var(--good); }
.engine-status.error { color: var(--bad-text); }
.engine-status.error::before { background: var(--bad-text); }
@keyframes pulse { 50% { opacity: 0.3; } }
.form-error { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--bad-text); }

/* ---------------------------------------------------------------- results */
.results { margin-top: 36px; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.results-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.results-summary { margin: 4px 0 0; color: var(--text-2); }
.result-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.result-preview { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; min-height: 0; overflow: hidden; border: 0; padding: 0; cursor: zoom-in; border-bottom: 1px solid var(--border); }
.result-preview img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.result-preview .state { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.result-preview .state .spinner { display: inline-block; color: var(--accent); }
.result-preview:disabled { cursor: default; }
.checker {
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.result-body { padding: 12px 14px 14px; display: grid; gap: 6px; flex: 1; align-content: start; }
.result-name { margin: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.result-size { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 600; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.notes { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.notes li { font-size: 12px; color: var(--warn-text); background: var(--warn-soft); border-radius: 8px; padding: 5px 8px; }
.result-error { margin: 0; font-size: 13px; color: var(--bad-text); background: var(--bad-soft); border-radius: 8px; padding: 8px 10px; }
.result-actions { display: flex; gap: 8px; margin-top: 6px; }
.result-actions .btn { flex: 1; }

/* ---------------------------------------------------------------- compare dialog */
.compare {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.compare::backdrop { background: rgba(8, 6, 20, 0.7); backdrop-filter: blur(3px); }
.compare-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.compare-head h3 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-stage { position: relative; width: 100%; height: min(62vh, 620px); border-radius: 12px; overflow: hidden; user-select: none; touch-action: none; }
.compare-stage img, .compare-after { position: absolute; inset: 0; width: 100%; height: 100%; }
.compare-stage img { object-fit: contain; }
/* Each side is clipped to its own half, so the original never shows through the
   transparent parts of the result. */
#compareBefore { clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }
.compare-after { clip-path: inset(0 0 0 var(--split, 50%)); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); pointer-events: none; }
.compare-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.compare-tag { position: absolute; top: 10px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(15, 12, 35, 0.7); }
.compare-tag.left { left: 10px; }
.compare-tag.right { right: 10px; }
.compare-range { margin-top: 12px; }
.compare-meta { margin: 8px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- footer & toast */
.site-footer { margin-top: auto; padding: 48px 0 28px; }
.footer-inner { border-top: 1px solid var(--border); padding-top: 18px; display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; font-size: 13.5px; }
.footer-inner p { margin: 0; }
.muted { color: var(--muted); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .hero { padding: 32px 0 20px; }
  .lead { font-size: 15.5px; }
  .panel { padding: 16px 14px; }
  .tool-head { padding: 12px; gap: 10px; }
  .tool-body { padding: 2px 12px 12px; }
  .wm-grid { grid-template-columns: minmax(0, 1fr); }
  .action-bar { flex-direction: column; align-items: stretch; padding: 12px; bottom: 8px; }
  .action-bar .btn { width: 100%; }
  .results-head .btn { width: 100%; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .compare { padding: 12px; }
  .compare-stage { height: 52vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
