:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #71716c;
  --line: #e4e4df;
  --accent: #e8590c;
  --accent-soft: #fff0e6;
  --error: #c92a2a;
  --radius: 14px;
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --card: #1d1d1b;
    --text: #ececea;
    --muted: #96968f;
    --line: #2c2c29;
    --accent: #ff7b33;
    --accent-soft: #2b1d13;
    --error: #ff6b6b;
  }
}

* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
main { max-width: 760px; margin: 0 auto; padding: 1rem; display: grid; gap: 1rem; }
a { color: var(--accent); }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; margin-bottom: .6rem; }
.muted { color: var(--muted); font-size: .875rem; }
.error { color: var(--error); font-size: .9rem; margin-top: .5rem; }

.topbar {
  display: flex; align-items: baseline; gap: .75rem;
  max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem .25rem;
}
.tagline { flex: 1; }
footer { max-width: 760px; margin: 0 auto; padding: .5rem 1rem 2rem; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem;
}

button {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--card); color: var(--text);
  border-radius: 10px; padding: .5rem 1rem;
}
button.primary {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}
button.primary:disabled { opacity: .5; cursor: default; }
button.big { width: 100%; padding: .75rem; margin-top: 1rem; }
button.ghost { border: none; background: none; color: var(--muted); }
button.linklike {
  border: none; background: none; padding: 0;
  color: var(--accent); text-decoration: underline;
}

input[type="text"], input[type="password"], input[type="url"], textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: .6rem .75rem;
}
textarea { resize: vertical; }
.field { margin-top: 1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }

/* login */
.login-wrap { min-height: 90vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 320px; display: grid; gap: .75rem; text-align: center; }

/* drop zone */
.drop-zone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 2rem 1rem; text-align: center; transition: border-color .15s, background .15s;
}
.drop-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.drop-title { font-weight: 600; }
.file-chosen { margin-top: .5rem; font-weight: 600; color: var(--accent); }

.or-divider {
  display: flex; align-items: center; gap: .75rem;
  color: var(--muted); font-size: .8rem; margin: 1rem 0;
}
.or-divider::before, .or-divider::after {
  content: ""; flex: 1; border-top: 1px solid var(--line);
}

/* presets */
.presets { display: flex; flex-wrap: wrap; gap: .5rem; }
.preset {
  border-radius: 999px; padding: .4rem .9rem; font-size: .9rem;
}
.preset.selected {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}

/* stepper */
.stepper {
  display: flex; flex-wrap: wrap; gap: .25rem .5rem;
  list-style: none; padding: 0; margin: 1rem 0 .5rem;
  font-size: .8rem; color: var(--muted);
}
.stepper li { display: flex; align-items: center; gap: .5rem; }
.stepper li:not(:last-child)::after { content: "→"; opacity: .5; }
.stepper li.active { color: var(--accent); font-weight: 700; }
.stepper li.done { color: var(--text); }

/* candidates */
.candidate {
  display: flex; gap: .75rem; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px;
  padding: .75rem; margin-bottom: .5rem;
}
.candidate input { margin-top: .3rem; }
.candidate .title { font-weight: 600; }
.candidate .times { font-variant-numeric: tabular-nums; color: var(--accent); font-size: .85rem; }
.candidate .reason { font-size: .875rem; color: var(--muted); }
.confidence {
  margin-left: auto; font-size: .75rem; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem;
}

/* clips */
.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.clip video { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 9/16; }
.clip .clip-title { font-size: .85rem; margin-top: .25rem; }

/* history */
.job-row {
  display: flex; gap: .75rem; padding: .4rem 0;
  border-bottom: 1px solid var(--line); font-size: .875rem;
  align-items: baseline; cursor: pointer;
}
.job-row:last-child { border-bottom: none; }
.job-row .status { margin-left: auto; color: var(--muted); }
.job-head { display: flex; justify-content: space-between; align-items: baseline; }
