:root {
  --bg: #0a1220;
  --card: #111b2e;
  --card-2: #16253f;
  --text: #e8f0ff;
  --muted: #9eb2cf;
  --accent: #4cc9f0;
  --accent-2: #90f1b8;
  --danger: #f26d85;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1600px 700px at 20% -20%, #17345f 0%, rgba(23, 52, 95, 0) 60%),
    radial-gradient(1000px 500px at 100% 10%, #204152 0%, rgba(32, 65, 82, 0) 55%),
    var(--bg);
  min-height: 100vh;
}

.app {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.panel {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

h1,
h2,
h3 {
  margin: 0 0 0.6rem;
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.4;
}

label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.7rem 0 0.35rem;
}

textarea,
input,
select,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

textarea,
input,
select {
  padding: 0.66rem 0.74rem;
}

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

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

button {
  margin-top: 1rem;
  padding: 0.8rem;
  cursor: pointer;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  color: #07101e;
  border: none;
  font-weight: 700;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pill {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.pill.idle {
  background: rgba(255, 255, 255, 0.12);
}

.pill.running {
  background: rgba(76, 201, 240, 0.2);
}

.pill.queued {
  background: rgba(120, 153, 220, 0.24);
}

.pill.completed {
  background: rgba(144, 241, 184, 0.22);
}

.pill.failed {
  background: rgba(242, 109, 133, 0.22);
}

.progress-shell {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

#phase-text {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
}

.step-tracker {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem;
  margin-bottom: 0.8rem;
  background: rgba(6, 14, 26, 0.35);
}

.step-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
}

.step-row + .step-row {
  margin-top: 0.2rem;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.step-label {
  font-size: 0.86rem;
}

.step-badge {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.step-badge.pending {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.step-badge.running {
  color: #0d1b2c;
  background: rgba(76, 201, 240, 0.9);
}

.step-badge.completed {
  color: #0d1b2c;
  background: rgba(144, 241, 184, 0.9);
}

.step-badge.failed {
  color: #fff;
  background: rgba(242, 109, 133, 0.9);
}

.log-box {
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  padding: 0.8rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  line-height: 1.42;
  margin: 0;
  white-space: pre-wrap;
}

.assets {
  margin-top: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(6, 14, 26, 0.35);
}

.assets h3 {
  margin-bottom: 0.4rem;
}

.assets-meta {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.assets-meta a {
  color: var(--accent-2);
}

.assets-list {
  display: grid;
  gap: 0.45rem;
}

.scene-assets {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.03);
}

.scene-assets-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.scene-assets-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.asset {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.76rem;
  text-decoration: none;
}

.asset.ready {
  color: #0d1b2c;
  background: rgba(144, 241, 184, 0.92);
}

.asset.pending {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.result {
  margin-top: 1rem;
}

.result video {
  width: min(320px, 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.result-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.result a {
  color: var(--accent-2);
}

.hidden {
  display: none;
}

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