/* web/styles.css — darkroom / contact-sheet: cool graphite surfaces, one tungsten amber accent,
   monospace numerals as instrument readouts, sprocket-edged job sheet. */
:root {
  --bg: #101317;
  --bg-deep: #0a0c0f;
  --panel: #171b21;
  --panel-hi: #1d222a;
  --line: #272d37;
  --line-soft: #1f242c;
  --ink: #e8eaee;
  --ink-dim: #9aa3b0;
  --ink-faint: #6b7482;
  --amber: #e0a458;
  --amber-soft: rgba(224, 164, 88, 0.14);
  --amber-line: rgba(224, 164, 88, 0.42);
  --ok: #86b06a;
  --fail: #d97a72;
  --radius: 10px;
  --radius-sm: 7px;
  --gap: 12px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", "Liberation Mono", monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- app shell: instrument rail + work area ---------- */
.shell { display: flex; min-height: 100vh; }
.rail {
  width: 188px;
  flex: none;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rail .brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: block;
}
.rail .brand span { display: block; color: var(--ink-faint); font-size: 11px; font-family: var(--mono); margin-top: 2px; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  color: var(--ink-dim);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
}
.rail nav a:hover { color: var(--ink); background: var(--panel); }
.rail nav a.active {
  color: var(--ink);
  background: var(--panel);
  border-left-color: var(--amber);
}
.rail nav .nav-group {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 10px 2px;
}
.rail nav .nav-group:first-child { padding-top: 0; }
.rail .status {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.rail .status::before { content: "● "; color: var(--amber); }

.work { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#app { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 26px 26px 40px; }

/* ---------- page header ---------- */
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--ink-dim); max-width: 62ch; }
.page-head code { font-family: var(--mono); font-size: 12px; color: var(--amber); }

/* ---------- panels & fields ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.panel-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 0 0 12px; }
.row:last-child { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { color: var(--ink-dim); font-size: 12px; }
.hint { color: var(--ink-faint); font-size: 12px; }

input, select {
  background: var(--bg-deep);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font: inherit;
  min-width: 0;
}
input[type="number"] { width: 92px; font-family: var(--mono); }
input[type="range"] { padding: 0; width: 140px; accent-color: var(--amber); }
input[type="checkbox"] { accent-color: var(--amber); width: 15px; height: 15px; }
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-dim); }

/* ---------- buttons ---------- */
.btn {
  background: var(--amber);
  border: 1px solid var(--amber);
  color: #17130c;
  font: inherit;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn:hover { filter: brightness(1.07); }
.btn.secondary { background: var(--panel-hi); border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.secondary:hover { border-color: var(--amber-line); }
.btn.secondary.active { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

/* ---------- drop bay ---------- */
.drop-bay {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.drop-bay .drop-hint { color: var(--ink-faint); font-size: 12px; }
.drop-bay.hot { border-color: var(--amber); background: var(--amber-soft); }

/* ---------- progress with inline readout ---------- */
.progress {
  height: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
  transition: width 0.18s linear;
}
.pct {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.batch {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.zip-progress { margin-top: -6px; }
.zip-progress .row { align-items: center; margin-bottom: 6px; }
.zip-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
}
.zip-pct {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.zip-progress .progress > i { background: var(--ink-dim); }
@media (prefers-reduced-motion: reduce) {
  .progress > i { transition: none; }
}

/* ---------- job sheet: contact sheet with sprocket edge ---------- */
.sheet {
  position: relative;
  margin-top: 4px;
  padding-left: 16px;
  margin-bottom: 0;
}
.sheet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--line) 0 8px,
    transparent 8px 16px
  );
  border-radius: 2px;
  opacity: 0.75;
}
table.jobs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.jobs th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
table.jobs td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.jobs tr:last-child td { border-bottom: 0; }
td.name { font-family: var(--mono); font-size: 12px; color: var(--ink); word-break: break-all; }
td.thumb { width: 52px; }
td.thumb img {
  width: 44px;
  height: 30px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  display: block;
}
td.status { width: auto; }
.st-pending, .st-running, .st-done, .st-failed, .st-cancelled {
  display: inline-block;
  vertical-align: middle;
  font-size: 12px;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-pending { color: var(--ink-faint); border-color: var(--line); }
.st-running { color: var(--amber); border-color: var(--amber-line); background: var(--amber-soft); }
.st-done { color: var(--ok); border-color: rgba(134, 176, 106, 0.4); }
.st-failed { color: var(--fail); border-color: rgba(217, 122, 114, 0.45); }
.st-cancelled { color: var(--ink-dim); border-color: var(--line); }

/* ---------- messages ---------- */
pre.err { color: var(--fail); white-space: pre-wrap; font-size: 12px; margin: 8px 0 0; }
.note {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--amber-line);
  border-radius: var(--radius-sm);
  color: var(--ink-dim);
  background: var(--panel);
}
.note a { color: var(--amber); }
.home-help {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
}
.home-help a {
  color: var(--ink-dim);
  text-decoration: underline dotted;
}
.home-help a:hover { color: var(--amber); }
.stats-summary {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-dim);
  white-space: pre-wrap;
}
.stats-detail {
  max-height: 180px;
  overflow: auto;
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ---------- static landing pages ---------- */
.lp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-deep);
}
.lp-head nav { display: flex; gap: 12px; align-items: center; }
.lp-head nav a:not(.btn) { color: var(--ink-dim); text-decoration: none; font-size: 13px; }
.lp-head nav a:not(.btn):hover { color: var(--amber); }
.lp-brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.lp-brand span { color: var(--amber); font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.lp-main { max-width: 780px; margin: 0 auto; padding: 44px 24px 72px; }
.lp-main h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.25; letter-spacing: -0.02em; }
.lp-lead { margin: 0; font-size: 16px; color: var(--ink-dim); max-width: 62ch; }
.lp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 26px 0 8px; }
.lp-cta small { color: var(--ink-faint); font-family: var(--mono); font-size: 12px; }
.lp-main h2 { margin: 40px 0 12px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.lp-main p, .lp-main li { color: var(--ink-dim); max-width: 68ch; }
.lp-main ul { padding-left: 22px; }
.lp-main li { margin: 6px 0; }
.lp-steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 10px; }
.lp-steps li {
  counter-increment: step;
  position: relative;
  padding: 12px 14px 12px 46px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  margin: 0;
}
.lp-steps li::before {
  content: counter(step);
  position: absolute;
  left: 15px;
  top: 12px;
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 700;
}
.lp-faq { display: grid; gap: 10px; }
.lp-faq details {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.lp-faq summary { cursor: pointer; font-weight: 600; }
.lp-faq p { margin: 8px 0 2px; }
.lp-note {
  margin-top: 26px;
  border-left: 2px solid var(--amber-line);
  background: var(--panel);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-dim);
}
.lp-note a { color: var(--amber); }
.lp-foot {
  border-top: 1px solid var(--line-soft);
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 12px;
}
.lp-foot-links { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-foot a { color: var(--ink-dim); text-decoration: none; }
.lp-foot a:hover { color: var(--amber); }

/* ---------- home ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--gap); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.card:hover { border-color: var(--amber-line); background: var(--panel-hi); }
.card b { display: block; font-weight: 600; margin-bottom: 4px; }
.card small { display: block; color: var(--ink-dim); font-size: 12px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 12px 26px 18px;
  color: var(--ink-faint);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
}
.footer .mono { font-family: var(--mono); }
.footer a { color: var(--ink-dim); }

/* ---------- narrow screens ---------- */
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .rail .brand { display: none; }
  .rail {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    overflow-x: auto;
  }
  .rail nav { flex-direction: row; }
  .rail nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .rail nav a.active { border-left: 0; border-bottom-color: var(--amber); }
  .rail .status { margin: 0 0 0 auto; border: 0; padding: 0; white-space: nowrap; }
  #app { padding: 18px 16px 30px; }
  .footer { padding: 12px 16px 16px; }
}

.mobile-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: 6px;
  padding: 8px 10px;
}

/* ---------- toast notifications ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-hi);
  border: 1px solid var(--line);
  border-left: 3px solid #58a6ff;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-width: 240px;
  max-width: 380px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.2s ease-out;
}
.toast-success { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--fail); }
.toast-warning { border-left-color: #d29922; }
.toast-info { border-left-color: #58a6ff; }
.toast-msg { flex: 1; font-size: 13px; }
.toast-close {
  background: none;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 15px;
  padding: 0 2px;
}
.toast-close:hover { color: var(--ink); }
.toast.out { opacity: 0; transform: translateX(12px); transition: all 0.25s; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- shortcut help panel ---------- */
.shortcut-help {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
.shortcut-help.open { display: flex; }
.shortcut-help-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 320px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}
.shortcut-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 12px;
}
.shortcut-help-close {
  background: none;
  border: 0;
  color: var(--ink-faint);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.shortcut-help-close:hover { color: var(--ink); }
.shortcut-help-table { width: 100%; border-collapse: collapse; }
.shortcut-help-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.shortcut-help-table tr:last-child td { border-bottom: 0; }
.shortcut-help-table td.mono {
  font-family: var(--mono);
  color: var(--amber);
  white-space: nowrap;
}

/* ---------- job list empty state ---------- */
.jobs-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

/* ---------- settings nav ---------- */
.rail nav a.nav-settings { margin-top: 8px; color: var(--ink-faint); }

/* ---------- light theme ---------- */
body.light {
  --bg: #f6f7f9;
  --bg-deep: #ffffff;
  --panel: #ffffff;
  --panel-hi: #f0f2f5;
  --line: #d8dde3;
  --line-soft: #e6eaef;
  --ink: #1c2128;
  --ink-dim: #57606a;
  --ink-faint: #8b949e;
}

/* ---------- home hero + trust ---------- */
.home-hero { text-align: center; padding: 18px 0 8px; }
.home-hero h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.home-hero p { color: var(--ink-dim); max-width: 56ch; margin: 0 auto 18px; }
.home-drop {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  padding: 26px 18px;
  max-width: 620px;
  margin: 0 auto;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.home-drop:hover, .home-drop.hot { border-color: var(--amber); background: var(--amber-soft); }
.home-drop-main { display: block; font-weight: 600; margin-bottom: 6px; }
.home-drop-formats { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.home-trust {
  display: flex;
  gap: var(--gap);
  justify-content: center;
  margin: 22px 0 4px;
  flex-wrap: wrap;
}
.trust {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 150px;
}
.trust b { display: block; font-size: 18px; font-weight: 700; color: var(--amber); }
.trust small { display: block; color: var(--ink-dim); font-size: 12px; margin-top: 2px; }

/* ---------- desktop comparison ---------- */
table.compare { width: 100%; border-collapse: collapse; font-size: 13px; }
table.compare th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
table.compare th:first-child { width: 34%; }
table.compare td { padding: 8px; border-bottom: 1px solid var(--line-soft); }
table.compare tr:last-child td { border-bottom: 0; }
table.compare td.yes { color: var(--ok); font-weight: 600; }
table.compare td.no { color: var(--ink-faint); }

/* ---------- onboarding tour ---------- */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}
.onboarding-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  max-width: 420px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.45);
}
.onboarding-step {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.onboarding-card h2 { margin: 0 0 8px; font-size: 18px; }
.onboarding-card p { margin: 0 0 18px; color: var(--ink-dim); }
.onboarding-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- error modal ---------- */
.error-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}
.error-modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  max-width: 440px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.45);
}
.error-modal-card h2 { margin: 0 0 10px; font-size: 17px; color: var(--fail); }
.error-modal-body { color: var(--ink-dim); font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.error-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- browser compat banner ---------- */
.compat-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(210, 153, 34, 0.12);
  border-bottom: 1px solid var(--amber-line);
  color: var(--ink);
  font-size: 12px;
  padding: 8px 16px;
}
.compat-banner span { flex: 1; }
.compat-close {
  background: none;
  border: 0;
  color: var(--ink-faint);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.compat-close:hover { color: var(--ink); }

/* ---------- image 3-column layout ---------- */
.img-layout {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.img-files {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.img-files-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.img-files-head .btn { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.img-file-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.img-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
}
.img-file:hover { background: var(--panel-hi); }
.img-file.selected { border-color: var(--amber-line); background: var(--amber-soft); }
.img-file-icon { flex: none; }
.img-file-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  word-break: break-all;
}
.img-preview { min-width: 0; }
.preview-stage {
  position: relative;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-stage canvas { display: block; max-width: 100%; }
.preview-empty { color: var(--ink-faint); font-size: 13px; }
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--amber);
  cursor: ew-resize;
  transform: translateX(-1px);
}
.compare-handle::after {
  content: "◂ ▸";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--amber);
  color: #17130c;
  font-size: 10px;
  padding: 3px 5px;
  border-radius: 999px;
  white-space: nowrap;
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.preview-info { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.img-params .panel { margin-bottom: 12px; }
.img-actionbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.actionbar-pct { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
@media (max-width: 1100px) {
  .img-layout { grid-template-columns: 1fr; }
}

/* ---------- gif player + gallery ---------- */
.gif-layout {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.gif-preview { min-width: 0; }
.gif-player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.gif-player-bar .gif-speed { width: 76px; }
.gif-player-bar input[type="range"] { flex: 1; }
.gif-gallery { margin-top: 14px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.gallery-item {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-deep);
  cursor: zoom-in;
}
.gif-params .panel { margin-bottom: 12px; }
@media (max-width: 1100px) {
  .gif-layout { grid-template-columns: 1fr; }
}

/* ---------- video player ---------- */
.video-preview { min-width: 0; }
.video-preview video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: var(--radius-sm);
  display: block;
}
.video-timeline { margin-top: 10px; }
.timeline-track {
  position: relative;
  height: 22px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--amber-soft);
  border-right: 1px solid var(--amber);
}
.timeline-playhead {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--amber);
  left: 0;
}
.timeline-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 30px;
  border-radius: 2px;
  transform: translateX(-2px);
  cursor: ew-resize;
}
.timeline-marker.in { background: var(--ok); }
.timeline-marker.out { background: var(--fail); }
.video-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.engine-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.output-estimate {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.estimate-line { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }

/* ---------- unpack info card + file tree ---------- */
.unpack-main { min-width: 0; }
.info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.info-card img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-deep);
}
.info-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); line-height: 1.7; }
.file-tree {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  max-height: 380px;
  overflow-y: auto;
  font-size: 13px;
}
.tree-folder > summary {
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  color: var(--ink-dim);
  list-style: none;
}
.tree-folder > summary:hover { background: var(--panel-hi); }
.tree-folder > summary::before { content: "▸ "; }
.tree-folder[open] > summary::before { content: "▾ "; }
.tree-inner { padding-left: 16px; }
.tree-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.tree-file:hover { background: var(--panel-hi); }
.tree-name { font-family: var(--mono); font-size: 12px; color: var(--ink); flex: 1; word-break: break-all; }
.tree-size { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.tree-file .btn { padding: 2px 8px; font-size: 11px; }
.tex-preview {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.tex-preview img {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-deep);
  display: block;
  margin-bottom: 10px;
}
.unpack-params .panel { margin-bottom: 12px; }

/* ---------- job center ---------- */
.job-ops {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}
.job-ops .btn {
  padding: 3px 8px;
  font-size: 11px;
}
.jobs-empty {
  padding: 24px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

/* ---------- animation system (section 7) ---------- */
.page-head {
  animation: page-in 0.2s ease-out;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.onboarding-card,
.error-modal-card,
.shortcut-help-card {
  animation: modal-in 0.25s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.toast {
  animation: toast-in 0.2s ease-out;
}
.img-files.hot {
  border-color: var(--amber);
  background: var(--amber-soft);
}
.btn {
  transition: filter 0.15s, border-color 0.15s, background 0.15s;
}
@media (prefers-reduced-motion: reduce) {
  .page-head, .onboarding-card, .error-modal-card, .shortcut-help-card, .toast {
    animation: none;
  }
}
