:root {
  --bg: #07070c;
  --panel: rgba(20, 20, 32, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --muted: #9aa0b4;
  --accent: #7c5cff;
  --accent-2: #ff5c9d;
  --accent-3: #37e2c5;
  --ok: #37e2c5;
  --warn: #ffcc66;
  --bad: #ff6b81;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.aurora {
  position: fixed;
  inset: -30vh -20vw auto -20vw;
  height: 90vh;
  z-index: -1;
  background:
    radial-gradient(38vw 38vw at 18% 30%, rgba(124, 92, 255, 0.5), transparent 65%),
    radial-gradient(32vw 32vw at 72% 18%, rgba(255, 92, 157, 0.38), transparent 62%),
    radial-gradient(34vw 34vw at 52% 62%, rgba(55, 226, 197, 0.28), transparent 60%);
  filter: blur(30px);
  opacity: 0.55;
}

/* ------------------------------------------------------------------ topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(16px, 3vw, 40px) 6px;
  flex-wrap: wrap;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.45);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.providers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.providers span {
  font-size: 11.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 5px 11px;
}

/* ------------------------------------------------------------------ layout */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 26rem) minmax(420px, 1fr) minmax(300px, 22rem);
  gap: 18px;
  padding: 12px clamp(16px, 3vw, 40px) 40px;
  align-items: start;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- composer */
.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.field em {
  font-style: normal;
  color: var(--accent-3);
}

textarea,
input[type="text"],
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(8, 8, 16, 0.7);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.dictate {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

button {
  cursor: pointer;
  font: inherit;
}

.primary {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.primary.small {
  width: auto;
  padding: 11px 18px;
}

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.ghost.recording {
  border-color: var(--accent-2);
  color: #fff;
}

.ghost .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
}

.ghost.recording .dot {
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.25;
    transform: scale(1.35);
  }
}

.link {
  border: none;
  background: none;
  color: var(--accent-3);
  padding: 0;
  text-decoration: underline;
}

.dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone p {
  margin: 2px 0;
  font-size: 13px;
}

.dropzone.hot {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.09);
}

.attachments {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachments li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.attachments button {
  border: none;
  background: none;
  color: var(--muted);
  padding: 0;
  line-height: 1;
}

.tuning {
  margin-bottom: 16px;
}

.tuning summary {
  cursor: pointer;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.switches {
  grid-column: span 2;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 129, 0.12);
  border: 1px solid rgba(255, 107, 129, 0.35);
  color: #ffd7dd;
  font-size: 13px;
}

/* ------------------------------------------------------------------- stage */
.pipeline {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline li {
  display: grid;
  grid-template-columns: 20px 108px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}

.pipeline li.active {
  background: rgba(124, 92, 255, 0.14);
  color: var(--text);
}

.pipeline li.done .marker {
  color: var(--ok);
}

.pipeline li.failed {
  background: rgba(255, 107, 129, 0.12);
  color: #ffd7dd;
}

.pipeline .stage-name {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.pipeline .marker {
  font-size: 12px;
}

.pipeline li.active .marker {
  animation: spin 1.2s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}

.viewer video {
  width: 100%;
  max-height: 60vh;
  border-radius: 14px;
  background: #000;
  display: block;
}

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0 12px;
}

.specs div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.specs dt {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.specs dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.summary {
  color: var(--muted);
  font-size: 13px;
}

.downloads {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.downloads a {
  font-size: 12.5px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 7px 14px;
}

.downloads a:hover {
  border-color: var(--accent);
}

.revise {
  margin-top: 22px;
  border-top: 1px solid var(--panel-border);
  padding-top: 18px;
}

.revise h3 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.revise-row {
  display: flex;
  gap: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chips button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

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

/* --------------------------------------------------------------- inspector */
.brief-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.brief-card span {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.28);
}

.qc {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
  border: 1px solid var(--panel-border);
}

.qc.ok {
  border-color: rgba(55, 226, 197, 0.4);
  background: rgba(55, 226, 197, 0.1);
}

.qc.warn {
  border-color: rgba(255, 204, 102, 0.4);
  background: rgba(255, 204, 102, 0.1);
}

.qc ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.scenes {
  list-style: none;
  counter-reset: scene;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 42vh;
  overflow: auto;
}

.scenes li {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.03);
}

.scenes h4 {
  margin: 0 0 6px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.scenes h4 em {
  font-style: normal;
  color: var(--accent-3);
  font-size: 11.5px;
}

.scenes p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.scenes .shot {
  display: inline-block;
  margin-top: 7px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-title {
  margin-top: 4px;
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
}

.history button:hover {
  border-color: var(--accent);
}

.history .status {
  float: right;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.history .status.done {
  color: var(--ok);
}

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