:root {
  --bg: #eef2f8;
  --panel: #ffffff;
  --panel-raised: #eef1f7;
  --line: #dde3ec;
  --text: #12172a;
  --text-muted: #646d80;
  --accent-a: #3b82f6;
  --accent-b: #8b5cf6;
  --accent-gradient: linear-gradient(120deg, var(--accent-a), var(--accent-b));
  --accent-soft: rgba(59, 130, 246, 0.09);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --warn: #d97706;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.09);
  --radius: 14px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---- Ambient background ---- */
.arc-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% -10%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(ellipse 55% 35% at 100% 0%, rgba(139, 92, 246, 0.08), transparent 60%);
}

/* ---- Topbar ---- */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.02em; }
.brand-mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.brand-mark-core {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6), 0 0 18px rgba(139, 92, 246, 0.4);
}
.brand-name { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.top-actions { display: flex; align-items: center; gap: 20px; }
.admin-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 12px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.admin-link:hover { border-color: var(--accent-a); color: var(--text); }

.engine-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-pending { background: var(--text-muted); }
.dot-ok { background: var(--success); box-shadow: 0 0 8px rgba(22, 163, 74, 0.5); }
.dot-bad { background: var(--danger); }

/* ---- Stage / intro ---- */
.stage {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 56px) 90px;
}

.intro { text-align: center; margin: 0 auto 32px; max-width: 720px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-a);
  margin: 0 0 10px;
}
.intro h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 600;
}
.intro-sub { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; max-width: 460px; margin: 0 auto; }

/* ---- Alert banner ---- */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #a91c1c;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 20px;
}
.alert-banner[data-tone="info"] {
  background: var(--accent-soft);
  border-color: rgba(59, 130, 246, 0.3);
  color: #1d4ed8;
}
.alert-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 13px; opacity: 0.8; }
.alert-close:hover { opacity: 1; }

/* ---- Tabs ---- */
.tabbar {
  display: flex;
  gap: 4px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 18px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--text);
  background: var(--accent-gradient);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px clamp(20px, 4vw, 52px);
  min-height: 460px;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04), 0 12px 32px rgba(20, 30, 50, 0.05);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.hidden { display: none !important; }

/* ---- Dropzone ---- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 64px 24px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-a);
  background: var(--accent-soft);
}
.dropzone-icon { color: var(--text-muted); margin-bottom: 8px; transition: color 0.2s ease; }
.dropzone:hover .dropzone-icon, .dropzone.dragover .dropzone-icon { color: var(--accent-a); }
.dropzone-title { font-size: 16px; margin: 0; }
.dropzone-title span { color: var(--accent-a); text-decoration: underline; }
.dropzone-sub { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ---- File list ---- */
.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  max-height: 340px;
  overflow-y: auto;
  padding: 2px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}
.file-row svg { color: var(--accent-a); flex-shrink: 0; }
.file-row-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

/* ---- Thumbnail preview (shared by list rows and merge cards) ---- */
.thumb-box {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 36px;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(160deg, #f3f5f9, #dfe4ec);
  box-shadow: inset 0 0 0 1px rgba(20, 30, 50, 0.12);
}
.thumb-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.thumb-box img.loaded { opacity: 1; }

.thumb-office {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(160deg, #94a3b8, #64748b);
}
.thumb-office-excel { background: linear-gradient(160deg, #34d399, #16a34a); }
.thumb-office-word { background: linear-gradient(160deg, #60a5fa, #2563eb); }
.thumb-office-ppt { background: linear-gradient(160deg, #fb923c, #ea580c); }

.file-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 13.5px; }
.file-row-size { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }
.file-row-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.file-row-btn:hover { border-color: var(--accent-a); color: var(--text); }
.file-row-remove:hover { border-color: var(--danger); color: var(--danger); }

.btn-add-more {
  background: none;
  border: 1px dashed var(--line);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-add-more:hover { border-color: var(--accent-a); color: var(--text); }

/* ---- Merge arranger ---- */
.arrange-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.arrange-head .section-label { margin: 0; }
.arrange-hint { font-size: 12px; color: var(--text-muted); margin: 0; }

.merge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
  max-height: 460px;
  overflow-y: auto;
  padding: 6px 2px;
}
.merge-card {
  position: relative;
  width: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: grab;
  transition: border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.merge-card:active { cursor: grabbing; }
.merge-card.dragging { opacity: 0.35; }
.merge-card.drag-over { border-color: var(--accent-a); transform: translateY(-2px); }

.merge-card-index {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.merge-card-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  z-index: 2;
}
.merge-card-remove:hover { border-color: var(--danger); color: var(--danger); }

.merge-card-thumb {
  position: relative;
  width: 100px;
  height: 130px;
  border-radius: 5px;
  overflow: hidden;
  background: linear-gradient(160deg, #f3f5f9, #dfe4ec);
  box-shadow: 0 3px 10px rgba(20, 30, 50, 0.12), inset 0 0 0 1px rgba(20, 30, 50, 0.12);
}
.merge-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.merge-card-thumb img.loaded { opacity: 1; }

.merge-card-name {
  font-size: 11px;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merge-card-moves { display: flex; gap: 6px; }
.merge-card-move-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  width: 24px;
  height: 22px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.merge-card-move-btn:hover:not(:disabled) { border-color: var(--accent-a); color: var(--text); }
.merge-card-move-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---- Text field ---- */
.text-field { margin: 0 auto 24px; max-width: 480px; }
.text-input {
  width: 100%;
  background: var(--panel-raised);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  margin-top: 8px;
}
.text-input:focus { outline: none; border-color: var(--accent-a); }
.text-input::placeholder { color: var(--text-muted); }

/* ---- Quality / format select ---- */
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 12px; }
.quality-select { margin-top: 4px; }
.quality-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 28px; }
.quality-opt {
  text-align: left;
  background: var(--panel-raised);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
  color: var(--text);
  font-family: var(--font-body);
}
.quality-opt:hover { border-color: var(--accent-b); }
.quality-opt.active { border-color: var(--accent-a); background: var(--accent-soft); }
.quality-name { font-weight: 600; font-size: 14px; }
.quality-desc { font-size: 12px; color: var(--text-muted); }

/* ---- Buttons ---- */
.btn-primary {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--accent-gradient);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 10px auto 0;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.btn-small {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.btn-small:hover { border-color: var(--accent-a); }

/* ---- Working / arc-lamp animation ---- */
.state-working { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 0; }
.arc-lamp {
  position: relative;
  width: 160px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}
.arc-node {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--panel-raised);
  border: 2px solid var(--accent-a);
  z-index: 2;
}
.arc-line {
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: var(--line);
  overflow: visible;
}
.arc-line::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0.45;
  animation: arcPulse 1.6s ease-in-out infinite;
}
.arc-spark {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 8px; height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent-a);
  box-shadow: 0 0 14px 4px rgba(59, 130, 246, 0.55), 0 0 26px 8px rgba(139, 92, 246, 0.4);
  animation: arcTravel 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes arcTravel {
  0%, 8% { left: 10px; opacity: 1; }
  46%, 54% { left: calc(100% - 18px); opacity: 1; }
  50% { opacity: 0.4; }
  92%, 100% { left: 10px; opacity: 1; }
}
@keyframes arcPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}

.working-text { font-family: var(--font-display); font-weight: 600; margin: 0 0 4px; text-align: center; }
.working-sub { color: var(--text-muted); font-size: 13px; margin: 0; text-align: center; }

/* ---- Results ---- */
.result-summary { text-align: center; font-size: 14px; color: var(--text-muted); margin: 0 0 18px; }
.result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 24px;
  padding: 2px;
}
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
}
.result-row-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--success-soft);
  color: var(--success);
}
.result-row-icon-error { background: var(--danger-soft); color: var(--danger); }
.result-row-body { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.result-row-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row-detail { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.result-row-detail-error { color: var(--danger); font-family: var(--font-body); }

.result-actions { width: 100%; }
#compress-downloadAll, #convert-downloadAll { margin-bottom: 0; }

.result-badge { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 16px; }
.result-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.25);
}
.result-headline { font-family: var(--font-mono); font-size: 15px; color: var(--text); word-break: break-all; text-align: center; }
.result-note { text-align: center; font-size: 13.5px; color: var(--text-muted); margin: 0 0 24px; }

#merge-stateResult { max-width: 480px; margin: 0 auto; }

/* ---- Footer ---- */
.page-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.capability-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 11px;
  background: var(--panel);
}
.retention-note { font-size: 12px; color: var(--text-muted); margin: 0; }

@media (max-width: 640px) {
  .topbar { padding: 18px 20px; }
  .panel { padding: 22px; }
  .file-list, .result-list { grid-template-columns: 1fr; }
}

/* =========================================================
   Admin dashboard
   ========================================================= */
.admin-shell { max-width: 1360px; margin: 0 auto; padding: 40px clamp(20px, 4vw, 56px) 80px; position: relative; z-index: 1; }

.admin-login {
  max-width: 380px;
  margin: 80px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04), 0 12px 32px rgba(20, 30, 50, 0.06);
}
.admin-login h1 { font-family: var(--font-display); font-size: 20px; margin: 0 0 6px; }
.admin-login p { color: var(--text-muted); font-size: 13.5px; margin: 0 0 24px; }
.admin-login .text-input { margin-bottom: 16px; }
.admin-login-error { color: var(--danger); font-size: 13px; margin: 0 0 14px; min-height: 1em; }

.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header h1 { font-family: var(--font-display); font-size: 22px; margin: 0; }
.admin-header p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.btn-logout {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.admin-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 16px;
}
.job-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04), 0 8px 20px rgba(20, 30, 50, 0.04);
}
.job-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.job-type-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.job-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
.job-status { display: inline-flex; align-items: center; gap: 6px; }
.job-delete {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.job-delete:hover { border-color: var(--danger); color: var(--danger); }

.job-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 8px; }
.job-files { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.job-files:last-child { margin-bottom: 0; }
.job-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}
.job-file-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-file-size { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.job-file-actions { display: flex; gap: 6px; }
.job-file-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: none;
}
.job-file-btn:hover { border-color: var(--accent-a); color: var(--text); }
.job-error { color: var(--danger); font-size: 13px; margin: 4px 0 0; }

.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 35, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 30px;
}
.preview-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(900px, 100%);
  height: min(85vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15, 22, 35, 0.35);
}
.preview-box-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.preview-box-head span { font-size: 13px; font-family: var(--font-mono); }
.preview-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; }
.preview-close:hover { color: var(--text); }
.preview-frame { flex: 1; border: none; width: 100%; background: #fff; }
.preview-image-wrap { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background: var(--panel-raised); }
.preview-image-wrap img { max-width: 100%; }
