:root {
  color-scheme: light dark;
  --bg: #16171a;
  --panel: #1c1d21;
  --text: #f4f1ea;
  --muted: #a29b91;
  --accent: #c6753d;
  --border: #ffffff1c;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 2.25rem 1.5rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0 0 0.4rem;
  font: 600 1.9rem/1 var(--serif);
  letter-spacing: -0.02em;
}
header h1 .q { color: var(--accent); }
header p { color: var(--muted); margin: 0; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.dropzone:hover { border-color: var(--accent); color: var(--text); }

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.controls label { color: var(--muted); font-size: 0.9rem; }

.checkbox { display: flex; align-items: center; gap: 0.4rem; }

.videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.videos video, .videos canvas {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: 8px;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

button:disabled { opacity: 0.4; cursor: not-allowed; }
button:hover:not(:disabled) { filter: brightness(1.1); }

.progress {
  margin-top: 1rem;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s ease;
}

.status { color: var(--muted); min-height: 1.2em; }
.description { color: var(--text); background: #10141c; padding: 0.75rem; border-radius: 8px; }
.description:empty { display: none; }

#history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#history li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .videos { grid-template-columns: 1fr; }
}
