:root {
  --bg: #101114;
  --panel: #181b20;
  --line: #2c3138;
  --text: #f4f1ea;
  --muted: #9aa19a;
  --accent: #e4a322;
  --accent-ink: #1a1406;
  --danger: #e15d4c;
  --stage: #07080a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Outfit, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h2 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 640;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong {
  font-family: Fraunces, serif;
  font-size: 26px;
  font-weight: 560;
  display: block;
  line-height: 1;
}
.brand small { color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }
.mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: conic-gradient(from 120deg, var(--accent), #f3d48a, var(--accent));
  box-shadow: inset 0 0 0 6px #101114;
}
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.ghost, .solid, .pick {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 8px 14px;
}
.ghost:disabled, .solid:disabled, .slim:disabled { opacity: 0.4; cursor: not-allowed; }
.solid {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 640;
}
.slim { padding: 6px 10px; font-size: 14px; }
.pick {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  font-weight: 640;
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 0;
}
.panel {
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 16px;
  background: var(--panel);
}
.panel section { margin-bottom: 22px; }
.panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}
.panel input[type="number"] {
  width: 110px;
  background: #101216;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.panel input[type="range"] { width: 140px; accent-color: var(--accent); }
.drop {
  border: 1px dashed #4a4332;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  background: #14120e;
}
.drop p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.drop.over { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--line);
  background: #101216;
  border-radius: 999px;
  padding: 6px 10px;
}
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.text-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #101216;
}
.card.on { border-color: var(--accent); }
.card input[type="text"], .card input[type="number"], .card input[type="color"] {
  width: 100%;
  margin-top: 6px;
  background: #181b20;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.card .mini { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.stage-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--stage);
}
.stage {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 18px;
}
#view {
  max-width: 100%;
  max-height: calc(100vh - 250px);
  background: #000;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}
.empty.hide { display: none; }
#source {
  position: fixed;
  width: 240px;
  height: 135px;
  left: -4000px;
  top: 0;
}

.transport {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 0;
}
.play {
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: var(--text); color: #111;
  font-size: 16px;
}
.play:disabled { opacity: 0.35; }
#clock { font-variant-numeric: tabular-nums; }
.hint { margin-left: auto; color: var(--muted); font-size: 12px; }

.timeline {
  position: relative;
  height: 84px;
  margin: 12px 16px 16px;
  border-radius: 12px;
  background: #1a1e24;
  overflow: hidden;
  touch-action: none;
}
.strip { position: absolute; inset: 0; display: flex; }
.strip img { flex: 1; height: 100%; object-fit: cover; opacity: 0.85; }
.shade { position: absolute; top: 0; bottom: 0; background: rgba(0,0,0,.62); pointer-events: none; }
.sel {
  position: absolute; top: 0; bottom: 0;
  box-shadow: inset 0 0 0 2px var(--accent);
  pointer-events: none;
}
.handle {
  position: absolute; top: 0; bottom: 0; width: 14px;
  margin-left: -7px; border: 0; padding: 0;
  background: transparent;
}
.handle::after {
  content: "";
  position: absolute; left: 4px; top: 8px; bottom: 8px; width: 6px;
  border-radius: 4px; background: var(--accent);
}
.head {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #fff; pointer-events: none;
}

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: grid; place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.dialog {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.dialog h3 { margin: 0 0 8px; font-family: Fraunces, serif; font-weight: 560; }
.dialog p { margin: 0 0 14px; color: var(--muted); }
.bar { height: 8px; background: #101216; border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .hint { display: none; }
  #view { max-height: 52vh; }
}
