/* ============================================================
   IMG+ — Upscaling x4
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background: #0a0d14;
  color: #e8ecf3;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84em;
  letter-spacing: 0.02em;
}
.mono-num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.01em;
}

button { font-family: inherit; cursor: pointer; }

:root {
  --bg: #0a0d14;
  --bg-1: #0e131c;
  --bg-2: #131927;
  --bg-3: #1a2233;
  --line: #1f2839;
  --line-2: #2a3447;
  --text: #e8ecf3;
  --text-dim: #9ba8bf;
  --text-faint: #5d6a82;
  --accent: #3b82f6;
}

html[data-density="compact"] .stage { padding: 24px 32px; }
html[data-density="spacious"] .stage { padding: 56px 32px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 20, 0.6);
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.logo-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.logo-plus { font-weight: 800; }
.logo-divider {
  width: 1px;
  height: 16px;
  background: var(--line-2);
  margin: 0 6px;
}
.logo-tag {
  color: var(--text-dim);
  font-size: 11px;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-dim);
}
.topbar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 5;
}

.stage {
  width: 100%;
  max-width: 1080px;
  padding: 40px 32px 80px;
}

/* ============================================================
   PHASE INDICATOR
   ============================================================ */
.phase-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 28px 32px 8px;
  max-width: 720px;
  margin: 0 auto;
}
.pstep {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.45;
  transition: opacity 0.3s;
}
.pstep.is-active, .pstep.is-done { opacity: 1; }
.pstep-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-faint);
  transition: all 0.3s;
  background: var(--bg-1);
}
.pstep.is-active .pstep-num {
  background: var(--bg-2);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.pstep-label { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.pstep.is-active .pstep-label { color: var(--text); }
.pconn {
  flex: 1;
  height: 1.5px;
  background: var(--line);
  max-width: 50px;
  position: relative;
  margin: 0 6px;
}
.pconn-fill {
  height: 100%;
  transition: width 0.6s ease;
}

/* ============================================================
   PHASE — UPLOAD
   ============================================================ */
.phase--upload {
  display: flex;
  flex-direction: column;
  gap: 36px;
  align-items: center;
}
.phase-headline {
  text-align: center;
  max-width: 640px;
  margin-top: 16px;
}
.phase-headline h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.phase-headline p {
  font-size: 16px;
  color: var(--text-dim);
  margin: 0;
  text-wrap: pretty;
}

/* DropZone */
.dropzone {
  width: 100%;
  max-width: 760px;
  position: relative;
  border: 1.5px dashed var(--line-2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19, 25, 39, 0.6), rgba(14, 19, 28, 0.4));
  padding: 56px 32px;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}
.dropzone:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.06), rgba(14, 19, 28, 0.4));
}
.dropzone.is-over {
  border-color: var(--accent);
  border-style: solid;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.1), rgba(14, 19, 28, 0.5));
  transform: scale(1.005);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.08), 0 20px 60px -20px rgba(59, 130, 246, 0.3);
}

.dropzone-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1px;
  opacity: 0.04;
  pointer-events: none;
}
.dropzone-cell {
  background: linear-gradient(135deg, var(--accent), transparent);
}
.dropzone:hover .dropzone-grid { opacity: 0.08; }
.dropzone.is-over .dropzone-grid { opacity: 0.16; }

.dropzone-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.dropzone-icon-stack {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 4px;
}
.dropzone-icon {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  transition: transform 0.3s ease;
}
.dropzone-icon--back {
  top: 6px;
  left: 6px;
  color: var(--text-faint);
  transform: rotate(-8deg);
}
.dropzone-icon--front {
  bottom: 0;
  right: 0;
  color: white;
  border-color: transparent;
  box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
.dropzone:hover .dropzone-icon--back { transform: rotate(-12deg) translate(-4px, -2px); }
.dropzone:hover .dropzone-icon--front { transform: translate(2px, -2px); }
.dropzone.is-over .dropzone-icon--front { transform: scale(1.1) translateY(-4px); }

.dropzone-headline {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.dropzone-sub {
  color: var(--text-dim);
  font-size: 14px;
}
.dropzone-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.dropzone-formats {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.format-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--text-dim);
  background: var(--bg-1);
}
.format-chip--accent {
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.06);
}

/* Hints */
.hints {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 760px;
}
.hint {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hint-num {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.hint-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.hint-desc { color: var(--text-faint); font-size: 11px; }

/* ============================================================
   SETUP PANEL
   ============================================================ */
.setup-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  max-width: 760px;
  margin: 0 auto;
}
.setup-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.setup-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.setup-summary-text { flex: 1; }
.setup-summary-title { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.setup-summary-detail { color: var(--text-dim); font-size: 12px; }

.thumbstrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.thumbstrip-item {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  position: relative;
}
.thumbstrip-more {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2) !important;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
}

.setup-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.setup-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setup-label {
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.setup-format-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.format-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  color: var(--text);
  transition: all 0.15s ease;
}
.format-card:hover { border-color: var(--line-2); background: var(--bg-3); }
.format-card.is-active {
  background: rgba(59, 130, 246, 0.08);
}
.format-card-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.format-card-desc { font-size: 11px; color: var(--text-dim); }

.model-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.model-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.model-card-text { flex: 1; }
.model-card-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.model-card-desc { font-size: 11.5px; color: var(--text-dim); }
.model-card-tag {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 6px;
  font-weight: 600;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.btn-launch:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -8px rgba(59, 130, 246, 0.6); }
.btn-launch:active { transform: translateY(0); }
.btn-launch-meta {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.8;
  font-weight: 500;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.25);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); background: var(--bg-2); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 9px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.12s ease;
}
.btn-primary:hover { transform: translateY(-1px); }

/* ============================================================
   PROCESSING VIEW
   ============================================================ */
.processing-view {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.processing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.processing-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.processing-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.processing-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: pulse-grow 1.4s ease-in-out infinite;
}
@keyframes pulse-grow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}
.processing-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.processing-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stat {
  background: var(--bg-2);
  padding: 16px 18px;
}
.stat-label {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value--small { font-size: 14px; font-weight: 500; }
.stat-unit { font-size: 14px; color: var(--text-dim); margin-left: 2px; font-weight: 500; }

/* Big bar */
.processing-bigbar {
  position: relative;
  height: 6px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}
.processing-bigbar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px currentColor;
}
.processing-bigbar-shimmer {
  position: absolute;
  top: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100px); }
  100% { transform: translateX(100px); }
}

/* Queue */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.queue-list::-webkit-scrollbar { width: 6px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.queue-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all 0.2s ease;
}
.queue-row--processing { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.04); }
.queue-row--pending { opacity: 0.55; }
.queue-row--done { opacity: 0.85; }

.queue-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  position: relative;
}
.queue-thumb-check {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid var(--bg-1);
}
.queue-meta { flex: 1; min-width: 0; }
.queue-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.queue-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.queue-arrow { color: var(--text-faint); }
.queue-dot { color: var(--text-faint); }
.mono--accent { color: var(--accent); }
.queue-bar {
  height: 3px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}
.queue-bar-fill { height: 100%; transition: width 0.2s ease; border-radius: 99px; }
.queue-status {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
  min-width: 64px;
  text-align: right;
  font-weight: 600;
}

/* ============================================================
   RESULTS VIEW
   ============================================================ */
.results-view {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1080px;
  margin: 0 auto;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.results-success {
  display: flex;
  align-items: center;
  gap: 14px;
}
.results-success-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 6px 20px -6px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  animation: success-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes success-in {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.results-title { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.results-sub { font-size: 13px; color: var(--text-dim); }
.results-header-right { display: flex; gap: 8px; }

.results-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.rstat {
  background: var(--bg-1);
  padding: 14px 18px;
}
.rstat-label {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.rstat-value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.rstat-value--small { font-size: 13px; font-weight: 600; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.result-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.result-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 12px 32px -16px rgba(0,0,0,0.6);
}
.result-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.result-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7));
  opacity: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px;
  transition: opacity 0.2s ease;
}
.result-card:hover .result-thumb-overlay { opacity: 1; }
.result-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  background: rgba(20, 25, 38, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: white;
  font-size: 11px;
  font-weight: 500;
}
.result-action--primary {
  border: none;
  padding: 7px 9px;
}
.result-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  color: white;
}
.result-info { padding: 10px 12px; }
.result-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.result-detail { font-size: 10.5px; color: var(--text-dim); }

/* ============================================================
   COMPARE PANEL
   ============================================================ */
.compare-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.compare-panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  overflow: hidden;
}
.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.compare-name { font-size: 14px; font-weight: 500; }
.compare-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: ew-resize;
}
.compare-side {
  position: absolute;
  inset: 0;
}
.compare-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 5px 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  font-size: 11px;
  color: white;
  font-weight: 600;
}
.compare-tag--right { left: auto; right: 16px; }
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 12px currentColor;
}
.compare-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* ============================================================
   AMBIENT BACKGROUND
   ============================================================ */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient-blob {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
}
.ambient-blob--1 {
  top: -200px;
  right: -100px;
  animation: float-1 18s ease-in-out infinite;
}
.ambient-blob--2 {
  bottom: -300px;
  left: -150px;
  opacity: 0.08;
  animation: float-2 22s ease-in-out infinite;
}
@keyframes float-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-60px, 80px); }
}
@keyframes float-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(80px, -60px); }
}
.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 70%);
}

/* Tweaks quick buttons */
.tweak-quick-btn {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 12px;
  padding: 7px 10px;
  font-family: inherit;
}
.tweak-quick-btn:hover { background: var(--bg-3); color: var(--text); }

/* Responsive */
@media (max-width: 720px) {
  .stage { padding: 24px 16px; }
  .processing-stats, .results-stats { grid-template-columns: repeat(2, 1fr); }
  .setup-format-grid { grid-template-columns: repeat(2, 1fr); }
  .hints { grid-template-columns: 1fr; }
  .phase-indicator { padding: 16px 8px 0; }
  .pstep-label { display: none; }
  .pconn { max-width: 24px; }
  .topbar { padding: 14px 16px; }
}
