:root {
  --bg: #0d0f12;
  --panel: #16191f;
  --panel-2: #1d212a;
  --line: #2a2f3a;
  --text: #e8eaed;
  --muted: #8b93a1;
  --accent: #ff7a3d;
  --accent-2: #5ad1c4;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

.topbar {
  padding: 22px 28px 10px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), #b06bff, var(--accent));
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: 0.5px; }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.tagline strong { color: var(--text); }

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 20px 28px 40px;
  align-items: start;
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* dropzone */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  min-height: 150px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  overflow: hidden;
}
.dropzone:hover, .dropzone:focus, .dropzone.drag {
  border-color: var(--accent);
  background: rgba(255,122,61,0.05);
  outline: none;
}
.drop-inner p { margin: 4px 0; }
.drop-icon {
  width: 40px; height: 40px; margin: 0 auto 8px;
  border-radius: 50%; border: 1.5px solid var(--accent);
  color: var(--accent); font-size: 24px; line-height: 37px;
}
.ref-thumb { width: 100%; height: 100%; max-height: 230px; object-fit: cover; border-radius: 10px; display: block; }

.param-hint { font-size: 12px; margin: 12px 2px 0; line-height: 1.45; }

.field { margin-top: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field .val { color: var(--accent); float: right; font-variant-numeric: tabular-nums; }
input[type="text"], select {
  width: 100%; padding: 9px 11px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; font-size: 14px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }

.downloads { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn {
  padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: transform .05s, opacity .15s, background .15s;
}
.btn:hover:not(:disabled) { background: #242935; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1206; }
.btn.primary:hover:not(:disabled) { background: #ff8a52; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.fineprint { font-size: 11.5px; margin-top: 14px; line-height: 1.5; }
.muted { color: var(--muted); }

/* preview */
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.preview-head h2 { margin: 0; font-size: 16px; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg-btn { padding: 7px 12px; font-size: 12.5px; background: transparent; color: var(--muted); border: 0; cursor: pointer; }
.seg-btn.active { background: var(--accent); color: #1a1206; }

.compare {
  position: relative; width: 100%; border-radius: 10px; overflow: hidden;
  background: #000; user-select: none; touch-action: none;
  aspect-ratio: 16 / 10;
}
.compare .layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
#graded { clip-path: inset(0 50% 0 0); }
.handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: rgba(255,255,255,0.9); transform: translateX(-1px); cursor: ew-resize;
}
.handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.95); box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.handle span::before, .handle span::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0;
  border: 5px solid transparent;
}
.handle span::before { left: 5px; border-right-color: #333; transform: translateY(-50%); }
.handle span::after { right: 5px; border-left-color: #333; transform: translateY(-50%); }
.badge {
  position: absolute; top: 10px; font-size: 11px; letter-spacing: .5px; text-transform: uppercase;
  background: rgba(0,0,0,0.55); padding: 3px 8px; border-radius: 6px; color: #fff;
}
.badge.left { left: 10px; }
.badge.right { right: 10px; }
.preview-foot { font-size: 12px; margin: 12px 2px 0; }
