:root {
  --bg: #101114;
  --panel: #191b20;
  --panel-2: #22252c;
  --text: #f3f5f7;
  --muted: #a8b0bc;
  --line: #343842;
  --accent: #34d399;
  --accent-2: #38bdf8;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

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

button,
textarea,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(360px, 1fr) 380px;
  min-height: 100vh;
}

.panel,
.script-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px;
}

.script-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
  overflow: auto;
}

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

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061014;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
label,
#status,
.card small {
  color: var(--muted);
}

label {
  display: block;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  color: var(--text);
  padding: 12px;
  outline: none;
}

textarea:focus,
select:focus {
  border-color: var(--accent);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary,
.secondary {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
}

.primary {
  background: var(--accent);
  color: #062016;
}

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

.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 24px;
}

.pills {
  display: flex;
  gap: 8px;
}

.pills span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
}

.preview-shell {
  display: grid;
  place-items: center;
  min-height: 520px;
  border: 1px solid var(--line);
  background: #0c0d10;
  overflow: hidden;
}

.preview {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 38px 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 20%, rgba(52, 211, 153, 0.35), transparent 30%),
    linear-gradient(160deg, #16191f 0%, #27313a 54%, #121417 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.preview.vertical {
  width: min(340px, 80vw);
  aspect-ratio: 9 / 16;
}

.preview.square {
  width: min(480px, 80vw);
  aspect-ratio: 1 / 1;
}

.preview.wide {
  width: min(720px, 80vw);
  aspect-ratio: 16 / 9;
}

.scene-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.preview h2 {
  font-size: clamp(30px, 6vw, 54px);
  line-height: 1;
  text-transform: uppercase;
}

.preview p {
  max-width: 32ch;
  color: #dce7ee;
  font-weight: 700;
}

.caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  padding: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 10px;
  margin-top: 18px;
  overflow-x: auto;
}

.clip {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  cursor: pointer;
}

.clip.active {
  border-color: var(--accent);
  background: #173027;
}

.clip strong {
  display: block;
  margin-bottom: 6px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  min-height: 38px;
  background: var(--panel-2);
  color: var(--muted);
}

.tab.active {
  background: var(--accent);
  color: #062016;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: grid;
  gap: 12px;
}

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

.card strong {
  display: block;
  margin-bottom: 8px;
}

.card p {
  margin-bottom: 0;
  color: #d4dae2;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 300px 1fr;
  }

  .script-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .workspace {
    display: block;
  }

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

  .preview-shell {
    min-height: 420px;
  }
}
