@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/BricolageGrotesque-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/BricolageGrotesque-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/BricolageGrotesque-800.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/JetBrainsMono-Variable.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --spruce: #11110f;
  --snow: #f2eee3;
  --green: #a8e82c;
  --green-hover: #b9f04e;
  --coral: #e05a46;
  --coral-soft: #f18776;
  --canvas: #11110f;
  --rail: #090a08;
  --surface: #1e201c;
  --surface-raised: #272923;
  --surface-soft: #181916;
  --ink: #f2eee3;
  --ink-muted: #aaa89f;
  --line: rgba(242, 238, 227, 0.12);
  --line-strong: rgba(242, 238, 227, 0.2);
  --green-wash: rgba(168, 232, 44, 0.11);
  --highlight: #3a3934;
  --highlight-soft: #262622;
  --focus-ring: #a09c8f;
  --coral-wash: rgba(224, 90, 70, 0.13);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --canvas: #f2eee3;
  --rail: #ded9cd;
  --surface: #e9e4d8;
  --surface-raised: #faf7ef;
  --surface-soft: #eee9de;
  --ink: #11110f;
  --ink-muted: #66635b;
  --line: rgba(17, 17, 15, 0.13);
  --line-strong: rgba(17, 17, 15, 0.22);
  --green-wash: rgba(115, 164, 25, 0.11);
  --highlight: #d9d2c3;
  --highlight-soft: #e4ded1;
  --focus-ring: #5c5a52;
  --coral-wash: rgba(224, 90, 70, 0.1);
  --shadow: 0 16px 42px rgba(53, 48, 38, 0.1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

a {
  color: inherit;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink-muted);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--spruce);
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--canvas);
}

.project-rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--rail);
  border-right: 1px solid var(--line);
}

.rail-head {
  min-height: 70px;
  padding: 18px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-size: 18px;
  white-space: nowrap;
}

.wordmark .brand-mark {
  width: 26px;
  height: 26px;
  font-size: 18px;
}

.wordmark span:last-child {
  color: var(--ink);
}

.icon-button.rail-close {
  display: none;
}

.new-video-button,
.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.new-video-button,
.primary-button {
  background: var(--green);
  color: var(--spruce);
}

.new-video-button:hover,
.primary-button:hover {
  background: var(--green-hover);
}

.new-video-button:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.new-video-button {
  margin: 2px 14px 16px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.section-title {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
}

.project-list-head {
  padding: 0 16px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-count {
  color: var(--ink-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.project-list {
  padding: 0 9px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.project-item {
  width: 100%;
  min-height: 68px;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.project-item:hover {
  background: color-mix(in srgb, var(--highlight) 65%, transparent);
}

.project-item.is-active {
  background: var(--highlight);
}

.project-thumb {
  position: relative;
  width: 34px;
  height: 42px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

.project-thumb::before,
.project-thumb::after {
  content: "";
  position: absolute;
  inset: auto 7px 9px;
  height: 1px;
  background: var(--line-strong);
  box-shadow: 0 -6px 0 var(--line-strong), 0 -12px 0 var(--line-strong);
}

.project-thumb::after {
  inset: 0;
  height: 3px;
  box-shadow: none;
  background: var(--green);
  transform-origin: left;
  transform: scaleX(var(--project-progress, 0));
}

.project-copy {
  min-width: 0;
}

.project-name,
.project-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-name {
  margin: 1px 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.project-meta {
  color: var(--ink-muted);
  font-size: 11px;
}

.rail-account {
  margin: 12px;
  padding: 11px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}

.account-name,
.account-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name {
  font-size: 12px;
  font-weight: 600;
}

.account-meta {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 10px;
}

.demo-pill {
  padding: 3px 6px;
  border-radius: 99px;
  background: var(--green-wash);
  color: var(--green);
  font-size: 9px;
  font-weight: 600;
}

.app-main {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-left,
.topbar-actions,
.status-row,
.job-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar-start {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--green);
  color: var(--spruce);
  font-size: 12px;
  font-weight: 700;
}

.topbar-start:hover {
  filter: brightness(1.04);
}

.icon-button.mobile-menu {
  display: none;
}

.topbar-title {
  font-weight: 600;
  letter-spacing: -0.015em;
}

.topbar-subtitle {
  color: var(--ink-muted);
  font-size: 12px;
}

.credits-pill {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.credits-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--ink-muted);
}

.icon-button:hover {
  background: var(--surface);
  color: var(--ink);
}

.icon-button svg,
.new-video-button svg,
.button-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.create-layout {
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.7fr);
  gap: 24px;
  align-items: stretch;
}

.brief-intro,
.create-card {
  border-radius: 18px;
}

.brief-intro {
  position: relative;
  overflow: hidden;
  min-height: 600px;
  padding: clamp(28px, 5vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.brief-intro::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -26%;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 56px var(--canvas), inset 0 0 0 57px var(--line);
  opacity: 0.55;
  pointer-events: none;
}

.intro-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.intro-kicker {
  margin: 0 0 20px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.intro-title {
  max-width: 720px;
  margin: 0;
  font-size: clamp(42px, 6vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.06em;
  font-weight: 600;
}

.intro-description {
  max-width: 590px;
  margin: 24px 0 0;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.6vw, 18px);
}

.mini-stage-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.mini-stage {
  min-height: 86px;
  padding: 14px;
  background: var(--surface);
}

.mini-stage strong,
.mini-stage span {
  display: block;
}

.mini-stage strong {
  font-size: 13px;
}

.mini-stage span {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 11px;
}

.mini-stage:first-child {
  background: var(--highlight);
}

.create-card {
  padding: 24px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.create-card h2,
.job-title,
.panel-title {
  margin: 0;
  letter-spacing: -0.03em;
}

.create-card h2 {
  font-size: 24px;
}

.form-help,
.field-help {
  color: var(--ink-muted);
}

.form-help {
  margin: 7px 0 22px;
  font-size: 13px;
}

.examples {
  display: grid;
  gap: 7px;
  margin-bottom: 19px;
}

.example-button {
  width: 100%;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.example-button:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--ink) 4%, var(--surface));
}

.example-button span {
  color: var(--ink-muted);
  font-size: 11px;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field > span:first-child,
.settings-label {
  font-size: 12px;
  font-weight: 600;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}

textarea {
  min-height: 124px;
  padding: 12px 13px;
  resize: vertical;
}

input,
select {
  height: 42px;
  padding: 0 11px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.mode-note,
.reference-banner,
.failure-panel,
.cpa-panel {
  border-radius: 10px;
}

.mode-note {
  margin-top: 15px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  background: var(--highlight);
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  font-size: 11px;
}

.mode-note::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--focus-ring);
}

.mode-note strong {
  color: var(--ink);
}

.create-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 14px;
}

.secondary-button {
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  background: color-mix(in srgb, var(--ink) 5%, var(--surface-raised));
}

.danger-button {
  background: var(--coral-wash);
  color: var(--coral-soft);
  border: 1px solid color-mix(in srgb, var(--coral) 28%, transparent);
}

.danger-button:hover {
  background: color-mix(in srgb, var(--coral) 18%, var(--surface));
}

.text-button {
  padding: 5px 2px;
  background: transparent;
  color: var(--ink-muted);
}

.text-button:hover {
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none !important;
}

.job-page {
  display: grid;
  gap: 18px;
}

.walkthrough-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(320px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-soft);
}

.walkthrough-copy {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.walkthrough-copy h2,
.walkthrough-copy p {
  margin: 0;
}

.walkthrough-copy h2 {
  font-size: 17px;
  letter-spacing: -0.025em;
}

.walkthrough-copy p {
  max-width: 560px;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
}

.walkthrough-kicker {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 99px;
  background: var(--highlight);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.walkthrough-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
  color: var(--ink-muted);
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
}

.walkthrough-action {
  min-width: 112px;
  min-height: 42px;
}

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.job-title {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
}

.job-summary {
  max-width: 750px;
  margin: 9px 0 0;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.state-badge,
.mode-badge,
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.state-badge,
.mode-badge {
  min-height: 27px;
  padding: 0 9px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.state-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.state-badge.failed::before,
.state-badge.canceled::before {
  background: var(--coral);
}

.state-badge.awaiting_approval::before {
  background: #e8be5b;
}

.reference-banner {
  padding: 11px 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.reference-banner.is-live {
  background: var(--highlight-soft);
  border-color: var(--line-strong);
}

.run-cost {
  flex: 0 0 auto;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  white-space: nowrap;
}

.reference-banner strong {
  color: var(--ink);
}

.reference-banner code,
.job-id {
  font-family: "JetBrains Mono", monospace;
}

.reference-banner code {
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.stage-rail {
  display: grid;
  grid-template-columns: repeat(8, minmax(86px, 1fr));
  min-width: 760px;
}

.stage-scroll {
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.stage-step {
  position: relative;
  padding: 13px 8px 11px 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.stage-step::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-strong);
}

.stage-step::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
}

.stage-step.is-complete,
.stage-step.is-active {
  color: var(--ink);
}

.stage-step.is-complete::before {
  background: var(--green);
}

.stage-step.is-complete::after {
  background: var(--green);
  border-color: var(--green);
}

.stage-step.is-active::after {
  background: var(--canvas);
  border: 2px solid var(--focus-ring);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--highlight) 70%, transparent);
}

.stage-step span {
  display: block;
  padding-top: 6px;
}

.production-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  min-height: 560px;
}

.living-cut,
.activity-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.living-cut {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-head {
  min-height: 66px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  font-size: 17px;
}

.panel-subtitle {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.version-badge {
  min-height: 24px;
  padding: 0 8px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--ink-muted);
}

.cut-body {
  flex: 1;
  min-height: 0;
  padding: clamp(18px, 3vw, 34px);
}

.stage-placeholder {
  height: 100%;
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.stage-orbit {
  position: relative;
  width: 138px;
  height: 138px;
  margin-bottom: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.stage-orbit::before,
.stage-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.stage-orbit::before {
  inset: 23px;
  border: 1px solid var(--line);
}

.stage-orbit::after {
  width: 14px;
  height: 14px;
  top: 14px;
  left: 50%;
  margin-left: -7px;
  background: var(--green);
  transform-origin: 7px 55px;
  animation: orbit 3.2s linear infinite;
}

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

.stage-placeholder h2 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: -0.045em;
}

.stage-placeholder p {
  max-width: 490px;
  margin: 12px 0 0;
  color: var(--ink-muted);
}

.progress-track {
  width: min(340px, 78vw);
  height: 3px;
  margin-top: 24px;
  overflow: hidden;
  background: var(--line);
}

.progress-fill {
  height: 100%;
  background: var(--green);
  transform-origin: left;
}

.script-page {
  max-width: 760px;
  margin: 0 auto;
}

.script-intro {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.script-intro h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.script-section {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 20px;
  padding: 19px 0;
  border-top: 1px solid var(--line);
}

.script-time {
  color: var(--ink-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.script-copy strong,
.script-copy p {
  display: block;
}

.script-copy strong {
  margin-bottom: 5px;
  font-size: 12px;
}

.script-copy p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.55;
}

.approval-actions {
  margin-top: 22px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.approval-copy {
  color: var(--ink-muted);
  font-size: 11px;
}

.revision-box {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.revision-box.is-open {
  display: grid;
  gap: 10px;
}

.scene-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.scene-card {
  min-height: 150px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.scene-card:nth-child(2),
.scene-card:nth-child(5) {
  background: var(--highlight-soft);
}

.scene-number {
  color: var(--ink-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.scene-card strong {
  font-size: 14px;
}

.scene-card span:last-child {
  color: var(--ink-muted);
  font-size: 10px;
}

.video-stage {
  display: grid;
  gap: 16px;
}

.video-frame {
  overflow: hidden;
  border-radius: 12px;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.1);
  aspect-ratio: 16 / 9;
}

.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.delivery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.delivery-meta {
  display: flex;
  gap: 18px;
  color: var(--ink-muted);
  font-size: 11px;
}

.delivery-meta strong {
  color: var(--ink);
}

.failure-panel,
.cpa-panel {
  max-width: 620px;
  margin: 70px auto 0;
  padding: 22px;
  background: var(--coral-wash);
  border: 1px solid color-mix(in srgb, var(--coral) 26%, transparent);
}

.failure-panel h2,
.cpa-panel h2 {
  margin: 0;
  font-size: 22px;
}

.failure-panel p,
.cpa-panel p {
  color: var(--ink-muted);
}

.activity-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.activity-head {
  min-height: 66px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.activity-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.activity-head p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.activity-list {
  margin: 0;
  padding: 6px 16px 16px;
  list-style: none;
  overflow-y: auto;
}

.activity-item {
  position: relative;
  padding: 14px 0 14px 19px;
  border-bottom: 1px solid var(--line);
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.activity-item:last-child::before {
  background: var(--green);
}

.activity-message {
  margin: 0;
  font-size: 12px;
}

.activity-meta {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 9px;
  font-family: "JetBrains Mono", monospace;
}

.activity-empty {
  padding: 28px 16px;
  color: var(--ink-muted);
  text-align: center;
  font-size: 12px;
}

.overlay {
  display: none;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: min(380px, calc(100vw - 40px));
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 12px;
}

.toast.error {
  border-color: color-mix(in srgb, var(--coral) 40%, transparent);
}

.empty-projects {
  padding: 22px 12px;
  color: var(--ink-muted);
  font-size: 11px;
  text-align: center;
}

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

  .activity-panel {
    max-height: 360px;
  }

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

  .brief-intro {
    min-height: 460px;
  }

  .walkthrough-card {
    grid-template-columns: 1fr auto;
  }

  .walkthrough-steps {
    grid-column: 1;
    grid-row: 2;
  }

  .walkthrough-action {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

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

  .app-main {
    grid-column: 1;
  }

  .project-rail {
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  body.rail-open .project-rail {
    transform: translateX(0);
  }

  .icon-button.rail-close,
  .icon-button.mobile-menu {
    display: inline-grid;
  }

  .overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.45);
  }

  body.rail-open .overlay {
    display: block;
  }

  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .topbar-subtitle,
  .credits-pill {
    display: none;
  }

  .topbar-start {
    min-height: 36px;
    padding: 0 10px;
  }

  .page {
    padding: 16px;
  }

  .create-layout {
    min-height: auto;
    gap: 14px;
  }

  .brief-intro {
    min-height: 380px;
    padding: 26px 22px;
  }

  .intro-title {
    font-size: clamp(42px, 14vw, 64px);
  }

  .mini-stage-strip {
    grid-template-columns: 1fr 1fr;
  }

  .mini-stage {
    min-height: 68px;
  }

  .create-card {
    padding: 19px;
    box-shadow: none;
  }

  .walkthrough-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .walkthrough-copy {
    display: grid;
  }

  .walkthrough-steps,
  .walkthrough-action {
    grid-column: 1;
    grid-row: auto;
  }

  .walkthrough-action {
    width: 100%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .job-head,
  .approval-actions,
  .delivery-row,
  .reference-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .job-actions,
  .button-row {
    width: 100%;
  }

  .job-actions > *,
  .button-row > * {
    flex: 1;
    min-height: 44px;
  }

  .reference-banner code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .production-grid {
    min-height: auto;
  }

  .panel-head,
  .activity-head {
    min-height: 60px;
    padding: 14px;
  }

  .cut-body {
    padding: 18px 14px;
  }

  .stage-placeholder {
    min-height: 360px;
  }

  .script-section {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .scene-strip {
    grid-template-columns: 1fr 1fr;
  }

  .delivery-meta {
    flex-wrap: wrap;
  }
}

@media (max-width: 360px) {
  .page {
    padding: 12px;
  }

  .topbar-title {
    font-size: 13px;
  }

  .scene-strip,
  .mini-stage-strip {
    grid-template-columns: 1fr;
  }

  .scene-card {
    min-height: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.legal-notice {
  display: grid;
  gap: 3px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  font: 500 10px/1.4 var(--mono);
  color: var(--muted);
}

.legal-notice a {
  color: var(--text-secondary);
  text-decoration: none;
}

.legal-notice a:hover,
.legal-notice a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}
