:root {
  --bg: #121216;
  --surface: #1b1b21;
  --surface-2: #232329;
  --line: #2e2e36;
  --text: #ececf1;
  --muted: #9298a3;
  --accent: #f59e0b;
  --accent-ink: #1a1206;
  --ok: #4ade80;
  --bad: #f87171;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 24px 48px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  max-width: 1120px;
  margin-inline: auto;
}

/* ---------- header ---------- */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 0 20px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 19px; margin: 0; letter-spacing: -0.2px; }

.tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.engines { display: flex; gap: 6px; flex-wrap: wrap; }

.engine {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.engine.on { color: var(--ok); border-color: #2c4a35; }
.engine.off { color: #6b7280; opacity: .6; text-decoration: line-through; }

/* ---------- layout ---------- */

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 860px) { main { grid-template-columns: 1fr; } }

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

.card h2 { font-size: 14px; margin: 0 0 14px; font-weight: 600; }
.jobs { margin-top: 18px; }

.jobs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.jobs-head h2 { margin: 0; }
.jobs-actions { display: flex; align-items: center; gap: 12px; }

.hint { color: var(--muted); font-size: 12px; margin: -6px 0 14px; }
.muted { color: var(--muted); font-size: 12px; }
.empty { margin: 4px 0; }
.hidden { display: none !important; }

/* ---------- dropzone ---------- */

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dropzone span { color: var(--muted); font-size: 12px; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); outline: none; }
.dropzone.over { border-color: var(--accent); background: rgba(245, 158, 11, .07); }

/* ---------- controls ---------- */

.row { display: flex; gap: 8px; }

input[type=url], input[type=text], input[type=number], select {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

button {
  font: inherit;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 15px;
  cursor: pointer;
  white-space: nowrap;
}
button:disabled { opacity: .45; cursor: default; }

.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.primary:hover:not(:disabled) { filter: brightness(1.08); }

.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }

.chip {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
}
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip.unavailable { opacity: .4; cursor: not-allowed; }

.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- file entries ---------- */

.file {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  margin-top: 12px;
}

.file-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.file-name { font-weight: 600; font-size: 13px; word-break: break-all; }

.options { display: flex; flex-wrap: wrap; gap: 6px; }

.group-label {
  font-size: 11px;
  color: var(--muted);
  width: 100%;
  margin-top: 6px;
}

/* ---------- link preview ---------- */

.preview {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.preview img {
  width: 128px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
  flex-shrink: 0;
}
.preview-body { flex: 1; min-width: 0; }
.preview-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; word-break: break-word; }
.preview-meta { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.preview-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.preview-controls select { flex: 0 1 auto; min-width: 92px; }

.error {
  margin-top: 14px;
  color: var(--bad);
  font-size: 12px;
  background: rgba(248, 113, 113, .08);
  border: 1px solid rgba(248, 113, 113, .25);
  border-radius: 8px;
  padding: 9px 12px;
}

/* ---------- jobs ---------- */

.job {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}

.job-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.job-title { font-weight: 600; font-size: 13px; word-break: break-all; }
.job-target { color: var(--muted); font-size: 11px; white-space: nowrap; }
.job-status { font-size: 12px; color: var(--muted); margin-top: 3px; }
.job.done .job-status { color: var(--ok); }
.job.failed .job-status { color: var(--bad); }

.bar {
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  margin-top: 10px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s;
}
.bar.indeterminate i {
  width: 35% !important;
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0% { margin-left: -35%; }
  100% { margin-left: 100%; }
}

.job-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.job-actions a {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
.job-actions a:hover { border-color: var(--accent); }

footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- konto und kopfzeile ---------- */

.head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account #whoami { font-size: 12px; color: var(--text); }
.account button { padding: 6px 12px; font-size: 12px; }

/* ---------- anmelden ---------- */

.login { max-width: 420px; margin: 40px auto 0; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.field em { font-style: normal; opacity: .75; }
.field input, .field select { width: 100%; }

input[type=password] {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
}

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); }
.check input { margin-top: 2px; accent-color: var(--accent); }
.check em { font-style: normal; opacity: .75; }
.check.inline { align-items: center; }

.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ok);
  background: rgba(74, 222, 128, .08);
  border: 1px solid rgba(74, 222, 128, .25);
  border-radius: 8px;
  padding: 9px 12px;
}

.banner {
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--accent);
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .3);
  border-radius: 8px;
  padding: 9px 13px;
}

/* ---------- ein angelegter zugang ---------- */

.secret {
  margin-top: 16px;
  padding: 14px 15px;
  background: var(--surface-2);
  border: 1px solid #3c3a2a;
  border-radius: 10px;
}
.secret-head { font-size: 13px; margin-bottom: 4px; }
.secret p { margin: 6px 0 10px; }

.secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.secret-row code {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  overflow-wrap: anywhere;
}
.secret-row.small code { font-size: 11px; }
.secret-row button { padding: 6px 11px; font-size: 12px; }

/* ---------- konten ---------- */

.user {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}
.user-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.user .note { margin-top: 6px; color: var(--muted); background: none; border: none; padding: 0; }
.user .job-actions button { padding: 5px 11px; font-size: 12px; }

.user-message {
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.state {
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 9px;
  white-space: nowrap;
}
.state.ok { color: var(--ok); border-color: #2c4a35; }
.state.bad { color: var(--bad); border-color: #4a2c2c; }

/* ---------- protokoll ---------- */

.log { display: flex; flex-direction: column; gap: 2px; }

.log-row {
  display: grid;
  grid-template-columns: 112px 110px 130px 1fr 110px;
  gap: 10px;
  font-size: 12px;
  padding: 5px 2px;
  border-bottom: 1px solid var(--line);
}
.log-row:last-child { border-bottom: none; }
.log-when, .log-where { color: var(--muted); }
.log-who { font-weight: 600; overflow-wrap: anywhere; }
.log-what { color: var(--accent); }
.log-detail { color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .log-row { grid-template-columns: 1fr 1fr; }
  .log-detail { grid-column: 1 / -1; }
  .log-where { display: none; }
}

/* ---------- ablage ---------- */

.settings { padding: 14px 20px; margin-bottom: 18px; }
.settings-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.settings-note { margin: 0 0 3px; }

.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline select { width: auto; min-width: 150px; }

textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  width: 100%;
}
textarea:focus { outline: none; border-color: var(--accent); }

.ablage {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}
.ablage.fuermich {
  border-color: #4a3c1f;
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.ablage-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 3px;
}
.nowrap { white-space: nowrap; }

.vorschau {
  margin-top: 7px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.ablage-text {
  margin-top: 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 340px;
  overflow: auto;
}
.ablage-text pre {
  margin: 0;
  padding: 11px 13px;
  font-size: 12px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- schneiden ---------- */

.player { margin-bottom: 14px; }
.player video {
  width: 100%;
  max-height: 440px;
  border-radius: 10px;
  background: #000;
  display: block;
}
.player audio { width: 100%; display: block; }

/* der behaltene Bereich im Verhaeltnis zur ganzen Aufnahme */
.spanbar {
  position: relative;
  height: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: 0 0 14px;
  overflow: hidden;
}
.spanfill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: left .12s, width .12s;
}

.marks {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.marks .field.inline input[type=number] { width: 92px; flex: 0 0 auto; }
.marks .field.inline.grow { flex: 1 1 220px; }
.marks button { padding: 7px 12px; font-size: 12px; }

input[type=range] {
  flex: 1;
  min-width: 140px;
  accent-color: var(--accent);
  background: transparent;
}

.summary {
  margin: 14px 0 12px;
  font-size: 12px;
  color: var(--accent);
  background: rgba(245, 158, 11, .07);
  border: 1px solid rgba(245, 158, 11, .25);
  border-radius: 8px;
  padding: 9px 12px;
}
.summary.bad {
  color: var(--bad);
  background: rgba(248, 113, 113, .08);
  border-color: rgba(248, 113, 113, .25);
}

#schnittEditor .check { margin-bottom: 4px; }
#schnittGo { width: 100%; }
