:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #181a1e;
  --panel-2: #202329;
  --line: #30343c;
  --text: #f3f5f7;
  --muted: #a8b0bc;
  --soft: #737d8b;
  --accent: #54d6a7;
  --accent-2: #f0c95b;
  --danger: #ff6b6b;
  --blue: #72a7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 260px 1fr;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #141518;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 24px rgba(84, 214, 167, 0.2);
}

.brand small,
.system small,
.eyebrow,
.muted {
  color: var(--muted);
}

nav {
  display: grid;
  gap: 8px;
}

.nav {
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.nav.active,
.nav:hover {
  background: var(--panel-2);
  color: var(--text);
}

.system {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

main {
  min-width: 0;
}

.topbar {
  min-height: 104px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

#app {
  padding: 26px 28px 48px;
}

.actions,
.row,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  margin-bottom: 18px;
  justify-content: space-between;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 14px;
}

.card,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 16px;
}

.card {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h3,
.panel h2,
.panel h3 {
  margin-bottom: 8px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #252a31;
  color: var(--muted);
  font-size: 12px;
}

.status-rendered,
.status-completed {
  color: var(--accent);
}

.status-failed {
  color: var(--danger);
}

.status-rendering,
.status-mixing_audio,
.status-composing_video {
  color: var(--accent-2);
}

.btn,
.secondary,
.danger,
.ghost {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--accent);
  color: #06130f;
  font-weight: 700;
}

.secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger {
  background: #3a1f24;
  color: #ffd2d2;
  border: 1px solid #66343c;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.icon {
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  background: #111317;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  min-height: 38px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.full {
  grid-column: 1 / -1;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tab {
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
}

.tab.active {
  color: #06130f;
  background: var(--accent);
  border-color: var(--accent);
}

.layer,
.asset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #15171b;
  display: grid;
  gap: 10px;
}

.progress {
  width: 100%;
  height: 10px;
  background: #111317;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: var(--accent);
}

.checklist {
  display: grid;
  gap: 9px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.checklist input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.dialog {
  padding: 18px;
  position: relative;
}

.close {
  position: absolute;
  right: 12px;
  top: 12px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

audio,
video,
img.preview {
  width: 100%;
  max-height: 280px;
  border-radius: 8px;
  background: #0c0d0f;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  background: #0e1013;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
}

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

  .sidebar {
    position: static;
    min-height: auto;
  }

  .layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
