:root {
  color-scheme: light;
  --ink: #17120f;
  --muted: #6e6257;
  --paper: #f5eee2;
  --panel: #fffaf0;
  --line: rgba(23, 18, 15, 0.16);
  --lime: #c8ff5f;
  --coral: #ff654f;
  --cyan: #31bed1;
  --violet: #7c5cff;
  --gold: #f0b84f;
  --shadow: 0 24px 80px rgba(23, 18, 15, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 249, 236, 0.45), rgba(245, 238, 226, 0)),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  align-items: center;
  background: rgba(245, 238, 226, 0.82);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  padding: 14px clamp(18px, 4vw, 48px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
}

.brand,
.nav-links {
  align-items: center;
  display: flex;
}

.brand {
  font-size: 0.9rem;
  font-weight: 800;
  gap: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  color: var(--lime);
  display: inline-flex;
  font-size: 0.72rem;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.nav-links {
  color: var(--muted);
  font-size: 0.9rem;
  gap: clamp(12px, 2.4vw, 26px);
  white-space: nowrap;
}

.nav-links a:hover,
.text-link:hover {
  color: var(--ink);
}

.hero {
  min-height: 92svh;
  overflow: hidden;
  position: relative;
}

.hero-canvas,
.hero-shade {
  inset: 0;
  position: absolute;
}

.hero-canvas {
  background: #17120f;
  height: 100%;
  width: 100%;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(23, 18, 15, 0.92), rgba(23, 18, 15, 0.56) 48%, rgba(23, 18, 15, 0.1)),
    radial-gradient(circle at 76% 24%, rgba(124, 92, 255, 0.32), transparent 34%),
    linear-gradient(0deg, rgba(245, 238, 226, 0.98), rgba(245, 238, 226, 0) 22%);
}

.hero-inner {
  color: var(--panel);
  max-width: 820px;
  padding: 22svh clamp(18px, 6vw, 76px) 16svh;
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 14px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(4rem, 12vw, 10rem);
  letter-spacing: 0;
  line-height: 0.82;
  margin-bottom: 30px;
  max-width: 7ch;
  text-transform: uppercase;
}

.hero-copy {
  color: rgba(255, 250, 240, 0.86);
  font-size: clamp(1.18rem, 2vw, 1.65rem);
  max-width: 690px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 250, 240, 0.36);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 13px 19px;
}

.button.primary {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

.button.secondary {
  color: var(--panel);
}

.ticker {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  overflow-x: auto;
}

.ticker span {
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 18px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.section {
  padding: clamp(68px, 10vw, 124px) clamp(18px, 5vw, 64px);
}

.section-kicker {
  color: var(--coral);
}

.section-heading {
  align-items: end;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.65fr);
  margin-bottom: 38px;
}

h2 {
  font-size: clamp(2.4rem, 5vw, 5.7rem);
  letter-spacing: 0;
  line-height: 0.92;
  margin-bottom: 0;
}

.section-heading p,
.process-layout > div > p,
.studio-copy p {
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  margin-bottom: 0;
}

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

.blocks-section {
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 101, 79, 0.18), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(49, 190, 209, 0.16), transparent 28%),
    #17120f;
  color: var(--panel);
}

.blocks-section .section-heading p {
  color: rgba(255, 250, 240, 0.72);
}

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

.block-card {
  border: 1px solid rgba(255, 250, 240, 0.18);
  display: flex;
  flex-direction: column;
  isolation: isolate;
  justify-content: flex-end;
  min-height: 380px;
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.block-card::before,
.block-card::after {
  content: "";
  position: absolute;
  z-index: -1;
}

.block-card::before {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.08), rgba(255, 250, 240, 0)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
}

.block-card::after {
  height: 170px;
  opacity: 0.86;
  right: -40px;
  top: -36px;
  transform: rotate(18deg);
  width: 170px;
}

.block-card.image::after { background: var(--coral); }
.block-card.video::after { background: var(--violet); }
.block-card.music::after { background: var(--gold); }
.block-card.voice::after { background: var(--cyan); }

.block-index {
  color: rgba(255, 250, 240, 0.54);
  font-size: 0.78rem;
  font-weight: 900;
  left: 20px;
  letter-spacing: 0;
  position: absolute;
  top: 20px;
}

.block-card h3 {
  font-size: clamp(1.7rem, 2.7vw, 2.7rem);
  line-height: 0.95;
  margin: 0 0 14px;
}

.block-card p {
  color: rgba(255, 250, 240, 0.78);
  margin-bottom: 18px;
}

.block-card small {
  border-top: 1px solid rgba(255, 250, 240, 0.18);
  color: rgba(255, 250, 240, 0.62);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  padding-top: 14px;
  text-transform: uppercase;
}

.work-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 430px;
  padding: 18px;
}

.work-card h3 {
  font-size: 1.45rem;
  letter-spacing: 0;
  margin: 24px 0 10px;
}

.work-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.work-visual {
  background: #17120f;
  border-radius: 6px;
  height: 260px;
  overflow: hidden;
  position: relative;
}

.film-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  padding: 12px;
}

.film-strip span {
  background:
    linear-gradient(180deg, rgba(200, 255, 95, 0.1), rgba(49, 190, 209, 0.24)),
    repeating-linear-gradient(0deg, transparent 0 16px, rgba(255, 250, 240, 0.14) 17px 19px);
  border: 1px solid rgba(255, 250, 240, 0.22);
}

.pulse-grid {
  align-content: center;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 22px;
}

.pulse-grid span {
  aspect-ratio: 1;
  background: var(--coral);
  opacity: 0.76;
}

.pulse-grid span:nth-child(2n) {
  background: var(--cyan);
}

.frame-stack span {
  border: 2px solid rgba(255, 250, 240, 0.7);
  display: block;
  height: 58%;
  left: 18%;
  position: absolute;
  top: 21%;
  transform: rotate(-7deg);
  width: 64%;
}

.frame-stack span:nth-child(2) {
  border-color: var(--lime);
  transform: rotate(2deg) translate(8px, -4px);
}

.frame-stack span:nth-child(3) {
  border-color: var(--coral);
  transform: rotate(10deg) translate(18px, 8px);
}

.process-section {
  background: #17120f;
  color: var(--panel);
}

.process-layout {
  display: grid;
  gap: clamp(30px, 6vw, 80px);
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
}

.process-layout .section-kicker,
.process-layout > div > p {
  color: rgba(255, 250, 240, 0.7);
}

.steps {
  counter-reset: steps;
  display: grid;
  gap: 1px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  background: rgba(255, 250, 240, 0.08);
  border: 1px solid rgba(255, 250, 240, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 22px;
}

.steps span {
  color: var(--lime);
  font-size: 0.85rem;
  font-weight: 900;
}

.steps strong {
  font-size: 1.34rem;
}

.steps p {
  color: rgba(255, 250, 240, 0.72);
  margin-bottom: 0;
}

.text-link {
  border-bottom: 2px solid var(--ink);
  font-weight: 850;
  width: fit-content;
}

.studio-section {
  background: #f8f7f2;
  padding: clamp(76px, 8vw, 104px) clamp(14px, 3vw, 34px);
}

.studio-shell,
.director-shell {
  background: #171a1f;
  border: 1px solid rgba(23, 18, 15, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #f8f7f2;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 780px;
  overflow: hidden;
}

.studio-rail {
  background: #f8f7f2;
  border-right: 1px solid rgba(23, 18, 15, 0.13);
  color: #24272d;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 16px;
}

.rail-brand {
  align-items: center;
  display: flex;
  font-size: 0.9rem;
  font-weight: 850;
  gap: 10px;
  padding-bottom: 12px;
}

.rail-nav,
.rail-projects {
  display: grid;
  gap: 6px;
}

.rail-nav a,
.rail-projects button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #5b6068;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 720;
  padding: 10px 11px;
  text-align: left;
}

.rail-nav a.active,
.rail-nav a:hover,
.rail-projects button:hover {
  background: #e9edf4;
  color: #171a1f;
}

.rail-projects {
  border-top: 1px solid rgba(23, 18, 15, 0.1);
  margin-top: auto;
  padding-top: 16px;
}

.rail-projects span {
  color: #777c85;
  font-size: 0.72rem;
  font-weight: 850;
  padding: 0 11px 4px;
  text-transform: uppercase;
}

.studio-console {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.studio-toolbar {
  align-items: end;
  background: #fff;
  border-bottom: 1px solid rgba(23, 18, 15, 0.12);
  color: #171a1f;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 18px 20px;
}

.studio-toolbar h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.8rem);
  line-height: 1.04;
  max-width: 760px;
}

.mode-tabs {
  background: #eef1f6;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
}

.mode-tabs span {
  border-radius: 6px;
  color: #646a74;
  font-size: 0.82rem;
  font-weight: 820;
  padding: 8px 10px;
}

.mode-tabs .active {
  background: #fff;
  color: #171a1f;
  box-shadow: 0 1px 4px rgba(23, 18, 15, 0.12);
}

.studio-stage {
  background: #eef1f6;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 1fr);
  min-height: 0;
  padding: 12px;
}

.film-form,
.film-output {
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  color: #171a1f;
}

.film-form {
  align-content: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
}

.prompt-card {
  background: #f8fafc;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 12px;
}

.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.field {
  display: grid;
  gap: 7px;
}

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

.field label {
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: 6px;
  color: #171a1f;
  font: inherit;
  min-height: 44px;
  padding: 11px 12px;
  width: 100%;
}

.field select {
  appearance: none;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #2f6df6;
  outline: 2px solid rgba(47, 109, 246, 0.16);
}

.film-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 4px;
}

.button.light {
  background: #f8fafc;
  border-color: #d7deea;
  color: #171a1f;
}

.button.light:hover {
  background: #eef1f6;
}

.studio-shell .button.primary,
.director-shell .button.primary {
  background: #2f6df6;
  border-color: #2f6df6;
  color: #fff;
}

.film-output {
  max-height: 676px;
  min-height: 676px;
  overflow: auto;
  padding: 16px;
}

.output-head {
  align-items: start;
  border-bottom: 1px solid #dde3ee;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 18px;
}

.output-head h3 {
  font-size: clamp(1.7rem, 3vw, 3.7rem);
  line-height: 0.98;
  margin: 0;
  text-transform: uppercase;
}

#sceneCount {
  background: #e7f0ff;
  border-radius: 999px;
  color: #245bd6;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 6px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.stage-title-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin-left: auto;
}

.stage-clear-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(220, 239, 255, 0.18);
  border-radius: 999px;
  color: rgba(239, 246, 255, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 5px 9px;
  text-transform: uppercase;
}

.stage-clear-button:hover {
  background: rgba(255, 101, 79, 0.16);
  border-color: rgba(255, 101, 79, 0.4);
  color: #fff;
}

.treatment {
  color: #4f5662;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.36fr);
  padding: 18px 0;
}

.treatment strong {
  color: #171a1f;
}

.pipeline-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.pipeline-item {
  background: #f8fafc;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  min-height: 164px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.pipeline-item::after {
  content: "";
  height: 78px;
  opacity: 0.86;
  position: absolute;
  right: -18px;
  top: -18px;
  transform: rotate(15deg);
  width: 78px;
}

.pipeline-item.image::after { background: var(--coral); }
.pipeline-item.video::after { background: var(--violet); }
.pipeline-item.music::after { background: var(--gold); }
.pipeline-item.voice::after { background: var(--cyan); }

.pipeline-item h4 {
  font-size: 1rem;
  margin: 0 0 10px;
}

.pipeline-item p {
  color: #59616d;
  font-size: 0.9rem;
  margin: 0;
}

.scene-board {
  display: grid;
  gap: 10px;
}

.scene-row {
  align-items: start;
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 78px minmax(0, 1fr) minmax(190px, 0.32fr);
  padding: 14px;
}

.scene-row span {
  color: #245bd6;
  font-weight: 900;
}

.scene-row h4 {
  font-size: 1.25rem;
  margin: 0 0 7px;
}

.scene-row p {
  color: #59616d;
  margin: 0;
}

.scene-prompt {
  color: #757b85;
  font-size: 0.84rem;
}

.studio-status {
  background: #fff;
  border-top: 1px solid #dde3ee;
  color: #626977;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 10px 18px;
  justify-content: space-between;
  padding: 10px 16px;
}

.director-board {
  background: #eef1f6;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(300px, 0.34fr) minmax(360px, 0.48fr) minmax(250px, 0.28fr);
  grid-template-rows: auto minmax(250px, 1fr) auto;
  min-height: 0;
  padding: 12px;
}

.director-board .film-form {
  grid-row: 1 / span 2;
  grid-template-columns: 1fr;
}

.stage-panel,
.cast-panel,
.score-panel,
.inspector-panel {
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  color: #171a1f;
  min-width: 0;
  overflow: hidden;
}

.stage-panel {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto;
}

.panel-head {
  align-items: start;
  border-bottom: 1px solid #dde3ee;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
}

.panel-head h3 {
  font-size: clamp(1.45rem, 2.5vw, 3.1rem);
  line-height: 0.96;
  margin: 0;
  text-transform: uppercase;
}

.panel-head.compact {
  align-items: center;
  padding: 12px 14px;
}

.panel-head.compact .section-kicker {
  margin: 0;
}

.stage-window {
  background:
    linear-gradient(135deg, rgba(47, 109, 246, 0.22), rgba(200, 255, 95, 0.08)),
    #10131a;
  min-height: 340px;
  overflow: hidden;
  position: relative;
}

.stage-grid {
  background:
    repeating-linear-gradient(90deg, rgba(248, 247, 242, 0.12) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(0deg, rgba(248, 247, 242, 0.1) 0 1px, transparent 1px 42px);
  inset: 0;
  position: absolute;
}

.stage-actor {
  align-items: center;
  border: 1px solid rgba(248, 247, 242, 0.7);
  color: #fff;
  display: flex;
  font-size: 0.78rem;
  font-weight: 900;
  justify-content: center;
  letter-spacing: 0;
  position: absolute;
  text-transform: uppercase;
}

.primary-actor {
  background: #2f6df6;
  height: 124px;
  left: 22%;
  top: 42%;
  width: 92px;
  z-index: 3;
}

.signal-actor {
  background: #c8ff5f;
  color: #171a1f;
  height: 68px;
  right: 18%;
  top: 24%;
  width: 138px;
  z-index: 2;
}

.city-actor {
  background: #ff654f;
  bottom: 16%;
  height: 82px;
  right: 26%;
  width: 186px;
  z-index: 1;
}

.camera-frame {
  border: 2px solid rgba(248, 247, 242, 0.82);
  height: 54%;
  left: 14%;
  position: absolute;
  top: 18%;
  width: 72%;
  z-index: 4;
}

.stage-script {
  background: #f8fafc;
  border-top: 1px solid #dde3ee;
  padding: 12px 14px;
}

.stage-script strong {
  color: #626977;
  display: block;
  font-size: 0.72rem;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.stage-script pre {
  color: #171a1f;
  font: 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

.cast-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.cast-bin {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.cast-member {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 66px;
  padding: 10px;
}

.cast-member span {
  align-items: center;
  background: #171a1f;
  color: #c8ff5f;
  display: flex;
  font-size: 0.76rem;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.cast-member strong,
.cast-member small {
  display: block;
  overflow-wrap: anywhere;
}

.cast-member small {
  color: #626977;
  font-size: 0.76rem;
}

.score-panel {
  grid-column: 2 / -1;
}

.score-grid {
  display: grid;
  gap: 1px;
  grid-auto-rows: minmax(34px, auto);
  grid-template-columns: 86px repeat(var(--scene-count, 5), minmax(82px, 1fr));
  max-height: 308px;
  overflow: auto;
  padding: 1px;
}

.score-header,
.score-channel,
.score-cell {
  border: 0;
  font: inherit;
  min-height: 34px;
  padding: 8px;
  text-align: left;
}

.score-header {
  background: #171a1f;
  color: rgba(248, 247, 242, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  position: sticky;
  top: 0;
  text-transform: uppercase;
  z-index: 1;
}

.score-channel {
  background: #fff;
  color: #626977;
  font-size: 0.74rem;
  font-weight: 900;
  position: sticky;
  left: 0;
  text-transform: uppercase;
}

.score-cell {
  background: #e9edf4;
  border-left: 4px solid #d7deea;
  color: #171a1f;
  font-size: 0.72rem;
  font-weight: 780;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-cell.cast { border-left-color: var(--coral); }
.score-cell.behavior { border-left-color: #2f6df6; }
.score-cell.voice { border-left-color: var(--cyan); }
.score-cell.music { border-left-color: var(--gold); }
.score-cell.video { border-left-color: var(--violet); }

.inspector-panel {
  grid-column: 1 / -1;
  max-height: 520px;
  min-height: 0;
}

.inspector-panel .output-head h3 {
  font-size: clamp(1.4rem, 2.5vw, 2.8rem);
}

.ai-cue-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.ai-cue-list article {
  background: #10131a;
  border-radius: 8px;
  color: #f8f7f2;
  padding: 12px;
}

.ai-cue-list span {
  color: #c8ff5f;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.ai-cue-list p {
  color: rgba(248, 247, 242, 0.72);
  font-size: 0.88rem;
  margin: 0;
}

.production-passport {
  border-top: 1px solid rgba(220, 239, 255, 0.14);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

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

.passport-grid article {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(220, 239, 255, 0.12);
  border-radius: 8px;
  padding: 10px;
}

.passport-grid span {
  color: #c8ff5f;
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.passport-grid p {
  margin: 0;
}

.director-shell.retro-director {
  background: #b9bec8;
  border: 1px solid #11151b;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #11151b;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 920px;
  overflow: hidden;
  position: relative;
}

.studio-boot {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(17, 21, 27, 0.92), rgba(40, 48, 62, 0.86)),
    #11151b;
  color: #f8f7f2;
  display: none;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: absolute;
  z-index: 8;
}

.boot-card {
  background: #f8fafc;
  border: 1px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  color: #11151b;
  display: grid;
  gap: 12px;
  justify-items: start;
  max-width: 420px;
  padding: 24px;
  width: min(100%, 420px);
}

.boot-card strong {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  letter-spacing: 0;
  line-height: 0.9;
  text-transform: uppercase;
}

.boot-card p {
  color: #596272;
  font-weight: 800;
  margin: 0;
}

.boot-steps {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.boot-steps span {
  background: #e6ebf3;
  border: 1px solid #c6cedb;
  border-radius: 5px;
  color: #11151b;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 9px 10px;
  text-transform: uppercase;
}

.studio-entering .studio-boot {
  animation: bootExit 0.9s ease forwards;
  display: flex;
}

.studio-entering .boot-card {
  animation: bootCard 0.78s ease forwards;
}

.studio-entering .boot-steps span {
  animation: bootStep 0.66s ease forwards;
  opacity: 0.32;
}

.studio-entering .boot-steps span:nth-child(2) { animation-delay: 0.08s; }
.studio-entering .boot-steps span:nth-child(3) { animation-delay: 0.16s; }
.studio-entering .boot-steps span:nth-child(4) { animation-delay: 0.24s; }

.studio-entering .director-menubar,
.studio-entering .tool-palette,
.studio-entering .director-window,
.studio-entering .studio-status {
  animation: windowEnter 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.studio-entering .director-menubar { animation-delay: 0.28s; }
.studio-entering .tool-palette { animation-delay: 0.32s; }
.studio-entering .director-stage-window { animation-delay: 0.35s; }
.studio-entering .director-cast-window { animation-delay: 0.38s; }
.studio-entering .intent-window { animation-delay: 0.41s; }
.studio-entering .director-score-window { animation-delay: 0.44s; }
.studio-entering .script-window { animation-delay: 0.47s; }
.studio-entering .property-window { animation-delay: 0.5s; }
.studio-entering .studio-status { animation-delay: 0.53s; }

.studio-entered .studio-boot {
  display: none;
}

.studio-entering .studio-hero,
.studio-entering .studio-story-section,
.studio-entering .studio-features {
  display: none;
}

.director-menubar {
  align-items: center;
  background: linear-gradient(180deg, #f8fafc, #cfd5df);
  border-bottom: 1px solid #8a94a4;
  display: flex;
  gap: 18px;
  min-height: 38px;
  overflow: visible;
  padding: 0 12px;
  position: relative;
  white-space: nowrap;
  z-index: 5000;
}

.director-menubar strong {
  background: #11151b;
  color: #c8ff5f;
  font-size: 0.76rem;
  margin-right: 6px;
  padding: 5px 7px;
  text-transform: uppercase;
}

.director-menubar span {
  color: #2d333d;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 820;
}

.menu-button {
  background: transparent;
  border: 0;
  color: #2d333d;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 820;
  padding: 0;
}

.window-menu,
.member-menu,
.edit-menu,
.cast-menu {
  display: inline-flex;
  position: relative;
  z-index: 5010;
}

.window-menu-list,
.member-menu-list,
.edit-menu-list,
.cast-menu-list {
  background: #f8fafc;
  border: 1px solid #778292;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(17, 21, 27, 0.2);
  display: none;
  gap: 2px;
  left: 0;
  min-width: 150px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 8px);
  z-index: 7000;
}

.window-menu.open .window-menu-list,
.member-menu.open .member-menu-list,
.member-menu:hover .member-menu-list,
.member-menu:focus-within .member-menu-list,
.edit-menu.open .edit-menu-list,
.edit-menu:hover .edit-menu-list,
.edit-menu:focus-within .edit-menu-list,
.cast-menu.open .cast-menu-list,
.cast-menu:hover .cast-menu-list,
.cast-menu:focus-within .cast-menu-list {
  display: grid;
}

.window-menu-list button,
.member-menu-list button,
.member-menu-list label,
.edit-menu-list button,
.cast-menu-list button,
.cast-menu-list label {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #11151b;
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 760;
  padding: 8px 10px;
  text-align: left;
}

.window-menu-list button:hover,
.member-menu-list button:hover,
.member-menu-list label:hover,
.edit-menu-list button:hover,
.cast-menu-list button:hover,
.cast-menu-list label:hover {
  background: #e3e8f0;
}

.edit-menu-list {
  min-width: 320px;
}

.edit-menu-list button {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.edit-menu-list button:disabled {
  cursor: default;
  opacity: 0.42;
}

.edit-menu-list button:disabled:hover {
  background: transparent;
}

.edit-menu-list i[role="separator"] {
  background: rgba(17, 21, 27, 0.16);
  display: block;
  height: 1px;
  margin: 6px 2px;
}

.edit-menu-icon {
  color: inherit;
  font-size: 0.86rem;
  line-height: 1;
  text-align: center;
}

.edit-menu-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-menu-list kbd {
  color: rgba(17, 21, 27, 0.52);
  font: 850 0.72rem/1 var(--font-ui, inherit);
}

.member-file-input {
  display: none;
}

.director-workbench {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    #aeb5c0;
  background-size: 18px 18px;
  display: grid;
  gap: 10px;
  grid-template-columns: 46px minmax(250px, 0.36fr) minmax(360px, 0.78fr) minmax(260px, 0.36fr);
  grid-template-rows: 360px 210px 260px;
  height: 860px;
  min-height: 0;
  padding: 10px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.tool-palette {
  align-content: start;
  background: #dfe4ec;
  border: 1px solid #778292;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 #fff;
  display: grid;
  gap: 6px;
  grid-row: 1 / -1;
  padding: 8px;
}

.tool-palette button {
  align-items: center;
  background: #fff;
  border: 1px solid #929cac;
  border-radius: 4px;
  color: #11151b;
  display: flex;
  font: 800 0.76rem/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}

.tool-palette button:nth-child(5) {
  background: #c8ff5f;
}

.director-window {
  background: #f8fafc;
  border: 1px solid #596272;
  border-radius: 6px;
  box-shadow:
    0 18px 40px rgba(17, 21, 27, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #11151b;
  min-width: 0;
  overflow: hidden;
  position: absolute;
  resize: none;
}

.window-titlebar {
  align-items: center;
  background: linear-gradient(180deg, #f9fbff, #d4dae5);
  border-bottom: 1px solid #8b96a8;
  display: flex;
  gap: 10px;
  cursor: grab;
  min-height: 34px;
  padding: 7px 10px;
  position: relative;
  user-select: none;
  z-index: 36;
}

.director-window.dragging .window-titlebar {
  cursor: grabbing;
}

.window-titlebar strong {
  font-size: 0.84rem;
  line-height: 1;
  min-width: 0;
}

.window-titlebar em {
  font-style: normal;
}

.window-hidden-value {
  display: none;
}

.window-titlebar small,
.window-titlebar > span:last-child {
  color: #596272;
  font-size: 0.72rem;
  font-weight: 850;
  margin-left: auto;
  text-transform: uppercase;
  white-space: nowrap;
}

.window-controls {
  display: inline-flex;
  gap: 4px;
}

.window-controls button {
  background: #9ba5b5;
  border: 1px solid rgba(17, 21, 27, 0.2);
  border-radius: 999px;
  cursor: pointer;
  display: block;
  height: 9px;
  padding: 0;
  width: 9px;
}

.window-controls button:nth-child(1) { background: #ff6a55; }
.window-controls button:nth-child(2) { background: #f0b84f; }
.window-controls button:nth-child(3) { background: #84d66a; }

.resize-handle {
  border-bottom: 2px solid rgba(17, 21, 27, 0.34);
  border-right: 2px solid rgba(17, 21, 27, 0.34);
  bottom: 5px;
  cursor: nwse-resize;
  height: 14px;
  position: absolute;
  right: 5px;
  width: 14px;
  z-index: 3;
}

.director-window.is-hidden {
  display: none !important;
}

.director-window.is-minimized {
  height: 36px !important;
  min-height: 36px !important;
  overflow: hidden;
}

.director-window.is-minimized > :not(.window-titlebar) {
  display: none !important;
}

.director-window.is-maximized {
  border-radius: 4px;
}

.window-taskbar {
  align-items: center;
  background: rgba(223, 228, 236, 0.94);
  border: 1px solid #778292;
  border-radius: 6px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  left: 64px;
  max-width: calc(100% - 84px);
  min-height: 34px;
  overflow-x: auto;
  padding: 4px;
  position: absolute;
  z-index: 25;
}

.window-taskbar:empty {
  display: none;
}

.window-taskbar button {
  background: #fff;
  border: 1px solid #9ba5b5;
  border-radius: 4px;
  color: #11151b;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
  min-height: 24px;
  padding: 3px 8px;
  white-space: nowrap;
}

.director-stage-window {
  display: grid;
  grid-template-rows: auto 1fr;
}

.director-stage-window .stage-window {
  border: 12px solid #eef2f7;
  min-height: 320px;
}

.director-cast-window {
  display: grid;
  grid-template-rows: auto 1fr;
}

.director-cast-window .cast-bin {
  align-content: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  overflow: auto;
}

.director-cast-window .cast-member {
  align-content: start;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  padding: 10px;
}

.director-cast-window .cast-member span {
  height: 34px;
  width: 34px;
}

.director-cast-window .cast-member strong {
  font-size: 0.82rem;
}

.intent-window {
  display: grid;
  grid-template-rows: auto 1fr;
}

.intent-window .film-form {
  border: 0;
  border-radius: 0;
  max-height: none;
  overflow: auto;
}

.script-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.script-window .stage-script {
  border-top: 0;
  max-height: none;
  overflow: auto;
}

.script-window .ai-cue-list {
  border-top: 1px solid #dde3ee;
  margin: 0;
  max-height: 124px;
  overflow: auto;
  padding: 10px;
}

.script-window .ai-cue-list article {
  border-radius: 5px;
  padding: 10px;
}

.director-score-window {
  display: grid;
  grid-template-rows: auto 1fr;
}

.director-score-window .score-grid {
  max-height: none;
  min-height: 0;
}

.property-window {
  display: block;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.property-window .treatment,
.property-window .pipeline-grid,
.property-window .scene-board {
  margin-left: 12px;
  margin-right: 12px;
}

/* El .treatment de la página es un grid de dos columnas cuya segunda pide 220px
   de mínimo. Dentro de esta ventana quedan ~245px útiles, así que las dos
   columnas no caben: se desbordaban una sobre otra y el texto salía superpuesto.
   En un panel estrecho lo que toca es apilar. */
.property-window .treatment {
  grid-template-columns: minmax(0, 1fr);
}

.property-window .pipeline-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  overflow-x: auto;
}

.property-window .scene-row {
  grid-template-columns: 58px minmax(0, 1fr) minmax(160px, 0.34fr);
}

.retro-director .studio-status {
  background: #dfe4ec;
  border-top: 1px solid #8a94a4;
}

.studio-page {
  background:
    radial-gradient(circle at 50% -10%, rgba(153, 255, 99, 0.14), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(113, 76, 255, 0.2), transparent 26%),
    radial-gradient(circle at 22% 72%, rgba(20, 192, 255, 0.16), transparent 28%),
    #060a11;
}

.studio-page::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 1px),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.16), transparent 1px),
    radial-gradient(circle at 42% 82%, rgba(255, 255, 255, 0.12), transparent 1px);
  background-size: 100% 4px, 170px 170px, 230px 230px, 290px 290px;
  content: "";
  inset: 0;
  opacity: 0.48;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.studio-page main,
.studio-page .site-header,
.studio-page .site-footer {
  position: relative;
  z-index: 1;
}

.studio-entering .workspace-heading,
.studio-entered .workspace-heading {
  display: none;
}

.studio-workspace {
  background:
    radial-gradient(circle at 50% 0%, rgba(160, 255, 97, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(5, 9, 16, 0.26), rgba(5, 9, 16, 0.94));
  color: #eef5ff;
  min-height: 100svh;
  padding: clamp(88px, 10vw, 126px) clamp(18px, 4vw, 54px) clamp(42px, 6vw, 74px);
}

.director-shell.retro-director {
  background:
    linear-gradient(180deg, rgba(18, 24, 34, 0.94), rgba(8, 12, 20, 0.96)),
    rgba(8, 12, 20, 0.92);
  border: 1px solid rgba(216, 235, 255, 0.24);
  border-radius: 22px;
  box-shadow:
    0 34px 120px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(160, 255, 97, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #eff6ff;
  max-width: 1180px;
  min-height: 820px;
  margin: 0 auto;
}

.director-shell.retro-director::before {
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 5px;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.director-shell.retro-director > * {
  position: relative;
  z-index: 2;
}

.director-shell.retro-director > .director-menubar {
  z-index: 5000;
}

.director-shell.retro-director > .director-workbench {
  z-index: 1;
}

.studio-collab-bar {
  align-items: center;
  background: rgba(17, 24, 36, 0.86);
  border: 1px solid rgba(218, 231, 255, 0.18);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.24);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(120px, 1fr) auto auto auto;
  margin: 20px 18px 10px;
  min-height: 64px;
  padding: 10px 14px;
}

.invite-button,
.share-button {
  border: 1px solid rgba(226, 239, 255, 0.24);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
  min-height: 42px;
  padding: 0 18px;
}

.invite-button {
  background: rgba(255, 255, 255, 0.05);
  color: #f7fbff;
}

.share-button {
  background: linear-gradient(180deg, #b8ff73, #85ff4c);
  border-color: rgba(189, 255, 128, 0.8);
  box-shadow: 0 0 26px rgba(146, 255, 79, 0.38);
  color: #09110a;
}

.studio-tool-icons {
  align-items: center;
  display: flex;
  gap: 14px;
}

.studio-tool-icons span {
  border: 1px solid rgba(235, 244, 255, 0.48);
  border-radius: 50%;
  height: 16px;
  opacity: 0.78;
  position: relative;
  width: 16px;
}

.studio-tool-icons span:nth-child(2) {
  border-radius: 4px;
  transform: rotate(12deg);
}

.studio-tool-icons span:nth-child(3)::after {
  background: rgba(235, 244, 255, 0.72);
  content: "";
  height: 1px;
  left: 3px;
  position: absolute;
  top: 7px;
  transform: rotate(-36deg);
  width: 10px;
}

.studio-tool-icons span:nth-child(4) {
  border-color: transparent;
  border-top-color: rgba(235, 244, 255, 0.76);
}

.avatar-stack {
  display: flex;
  padding-left: 10px;
}

.avatar-stack span {
  align-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75), transparent 18%),
    linear-gradient(135deg, #665dff, #172036 58%, #9dff5a);
  border: 2px solid rgba(15, 20, 31, 0.94);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 0.62rem;
  font-weight: 950;
  height: 38px;
  justify-content: center;
  margin-left: -10px;
  width: 38px;
}

.avatar-stack span:nth-child(2) { background: linear-gradient(135deg, #18c6ff, #172036 58%, #b8ff73); }
.avatar-stack span:nth-child(3) { background: linear-gradient(135deg, #ff6b84, #172036 58%, #18c6ff); }
.avatar-stack span:nth-child(4) { background: linear-gradient(135deg, #ffb84a, #172036 58%, #8b6cff); }
.avatar-stack span:nth-child(5) { background: rgba(255, 255, 255, 0.1); }

.competent-badge {
  color: rgba(240, 247, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 760;
  white-space: nowrap;
}

.director-menubar {
  background:
    linear-gradient(180deg, rgba(16, 22, 33, 0.96), rgba(9, 13, 20, 0.96));
  border-bottom: 1px solid rgba(210, 228, 255, 0.12);
  border-top: 1px solid rgba(210, 228, 255, 0.1);
  gap: 12px;
  min-height: 49px;
  padding: 0 14px;
}

.director-menubar strong {
  background: transparent;
  color: #f7fbff;
  font-size: 1rem;
  letter-spacing: 0;
  margin-right: 4px;
  padding: 0;
}

.director-brand-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #f7fbff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 850;
  gap: 8px;
  letter-spacing: 0;
  padding: 5px 0;
  white-space: nowrap;
}

.director-brand-mark {
  color: #a6ff65;
  font-size: 0.86rem;
  line-height: 1;
}

.director-brand-button:hover,
.settings-menu.open .director-brand-button {
  color: #a6ff65;
}

.settings-menu {
  margin-left: auto;
  position: relative;
}

.director-menubar .settings-menu {
  cursor: default;
}

.settings-menu-list {
  background: rgba(9, 13, 20, 0.98);
  border: 1px solid rgba(210, 228, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  color: #edf6ff;
  display: none;
  min-width: 178px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
}

.settings-menu.open .settings-menu-list {
  display: grid;
  gap: 8px;
}

.settings-menu-list strong {
  color: #edf6ff;
  font-size: 0.74rem;
  font-weight: 900;
  margin: 0;
  text-transform: uppercase;
}

.settings-menu-row {
  background: rgba(239, 246, 255, 0.08);
  border: 1px solid rgba(210, 228, 255, 0.1);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
}

.settings-menu-row button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: rgba(239, 246, 255, 0.74);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 850;
  min-height: 26px;
}

.settings-menu-row button[aria-pressed="true"] {
  background: #a6ff65;
  color: #071009;
}

.director-menubar strong::before {
  color: #a6ff65;
  content: "◆";
  margin-right: 8px;
}

.director-menubar span,
.menu-button {
  color: rgba(239, 246, 255, 0.72);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 760;
}

.director-menubar span:hover,
.menu-button:hover {
  color: #fff;
}

.window-menu-list,
.member-menu-list,
.edit-menu-list,
.cast-menu-list {
  background: rgba(12, 17, 27, 0.98);
  border: 1px solid rgba(221, 236, 255, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.window-menu-list button,
.member-menu-list button,
.member-menu-list label,
.edit-menu-list button,
.cast-menu-list button,
.cast-menu-list label {
  color: rgba(239, 246, 255, 0.78);
}

.window-menu-list button:hover,
.member-menu-list button:hover,
.member-menu-list label:hover,
.edit-menu-list button:hover,
.cast-menu-list button:hover,
.cast-menu-list label:hover {
  background: rgba(166, 255, 101, 0.16);
  color: #fff;
}

.edit-menu-list i[role="separator"] {
  background: rgba(221, 236, 255, 0.14);
}

.edit-menu-list kbd {
  color: rgba(239, 246, 255, 0.46);
}

.director-workbench {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 48% 28%, rgba(56, 201, 255, 0.12), transparent 34%),
    #070b12;
  background-size: 32px 32px, 32px 32px, 100% 100%, auto;
  height: 730px;
  padding: 14px;
}

.tool-palette {
  background: rgba(14, 20, 31, 0.78);
  border: 1px solid rgba(218, 233, 255, 0.14);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  bottom: 16px;
  display: flex;
  gap: 6px;
  grid-row: auto;
  left: 16px;
  padding: 6px;
  position: absolute;
  z-index: 24;
}

.tool-palette button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(218, 233, 255, 0.14);
  border-radius: 10px;
  color: rgba(239, 246, 255, 0.84);
}

.tool-palette button:hover,
.tool-palette button:nth-child(5) {
  background: linear-gradient(180deg, #b8ff73, #82ff4b);
  color: #071009;
}

.director-window {
  background:
    linear-gradient(180deg, rgba(20, 27, 40, 0.88), rgba(10, 15, 24, 0.9));
  border: 1px solid rgba(218, 233, 255, 0.18);
  border-radius: 14px;
  box-shadow:
    0 18px 58px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #edf6ff;
  backdrop-filter: blur(18px);
}

.window-titlebar {
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(218, 233, 255, 0.1);
  min-height: 34px;
  padding: 6px 9px;
}

.window-titlebar strong {
  color: #f6fbff;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.window-titlebar small,
.window-titlebar > span:last-child {
  color: rgba(239, 246, 255, 0.58);
}

.window-controls button {
  border: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  height: 10px;
  width: 10px;
}

.resize-handle {
  border-bottom-color: rgba(166, 255, 101, 0.65);
  border-right-color: rgba(166, 255, 101, 0.65);
}

.director-stage-window .stage-window {
  border: 0;
  min-height: 0;
}

.stage-window {
  --stage-ruler-x: 24px;
  --stage-ruler-y: 38px;
  background: #070b12;
  border-radius: 0 0 14px 14px;
  color: rgba(220, 235, 255, 0.78);
}

.stage-ruler {
  color: rgba(220, 235, 255, 0.68);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0;
  position: absolute;
  user-select: none;
  z-index: 8;
}

.stage-ruler b {
  color: #a6ff65;
  font-size: 0.54rem;
  font-weight: 950;
  text-transform: uppercase;
}

.stage-ruler-x {
  background:
    linear-gradient(180deg, rgba(237, 243, 255, 0.12), rgba(237, 243, 255, 0.03)),
    repeating-linear-gradient(90deg, rgba(210, 228, 255, 0.42) 0 1px, transparent 1px 100px);
  border-bottom: 1px solid rgba(210, 228, 255, 0.22);
  height: var(--stage-ruler-x);
  left: var(--stage-ruler-y);
  padding: 0 6px 3px;
  right: 10px;
  top: 0;
}

.stage-ruler-y {
  background:
    linear-gradient(90deg, rgba(237, 243, 255, 0.12), rgba(237, 243, 255, 0.03)),
    repeating-linear-gradient(0deg, rgba(210, 228, 255, 0.42) 0 1px, transparent 1px 100px);
  border-right: 1px solid rgba(210, 228, 255, 0.22);
  bottom: 10px;
  left: 0;
  padding: 6px 3px;
  top: var(--stage-ruler-x);
  width: var(--stage-ruler-y);
}

.stage-ruler-y b {
  left: 3px;
  position: absolute;
  top: 6px;
}

.stage-ruler-x b {
  left: calc((var(--stage-ruler-y) * -1) + 6px);
  position: absolute;
  top: 6px;
}

.stage-ruler-x span,
.stage-ruler-y span {
  display: block;
  line-height: 1;
  position: absolute;
  white-space: nowrap;
}

.stage-ruler-x span {
  bottom: 4px;
  transform: translateX(-50%);
}

.stage-ruler-y span {
  display: grid;
  height: 18px;
  place-items: center;
  right: 5px;
  transform: translateY(-50%);
  width: 32px;
}

.stage-canvas {
  background: var(--stage-fill, linear-gradient(135deg, #0b1327, #152640 45%, #10141f));
  bottom: 10px;
  left: var(--stage-ruler-y);
  overflow: hidden;
  position: absolute;
  right: 10px;
  top: var(--stage-ruler-x);
  z-index: 1;
}

.stage-ruler-toggle {
  align-items: center;
  background: rgba(8, 13, 22, 0.92);
  border: 0;
  border-bottom: 1px solid rgba(210, 228, 255, 0.22);
  border-right: 1px solid rgba(210, 228, 255, 0.22);
  color: rgba(220, 235, 255, 0.78);
  cursor: pointer;
  display: flex;
  font: 900 0.52rem/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  height: var(--stage-ruler-x);
  justify-content: center;
  left: 0;
  letter-spacing: 0;
  padding: 0;
  position: absolute;
  top: 0;
  width: var(--stage-ruler-y);
  z-index: 10;
}

.stage-ruler-toggle:hover,
.stage-ruler-toggle[aria-pressed="true"] {
  color: #a6ff65;
}

.stage-window.rulers-hidden .stage-ruler,
.stage-window.rulers-hidden .stage-grid {
  opacity: 0;
}

.stage-grid {
  background:
    repeating-linear-gradient(90deg, rgba(190, 231, 255, 0.11) 0 1px, transparent 1px 100px),
    repeating-linear-gradient(0deg, rgba(190, 231, 255, 0.1) 0 1px, transparent 1px 100px);
  opacity: 0.72;
}

.stage-canvas::before {
  content: none;
}

.stage-canvas::after {
  content: none;
}

.stage-actor {
  border: 1px solid rgba(220, 240, 255, 0.8);
  border-radius: 999px 999px 14px 14px;
  box-shadow: 0 0 32px rgba(49, 190, 209, 0.28);
  font-size: 0;
  z-index: 3;
}

.stage-actor::before {
  background: rgba(238, 247, 255, 0.9);
  border-radius: 50%;
  content: "";
  height: 22%;
  position: absolute;
  top: 10%;
  width: 44%;
}

.primary-actor {
  background: linear-gradient(180deg, #d7ecff, #334bff 42%, #101827);
  height: 150px;
  left: 42%;
  top: 46%;
  width: 58px;
}

.signal-actor {
  background: linear-gradient(180deg, #ffb8ef, #7356ff 48%, #101827);
  height: 118px;
  left: 30%;
  top: 54%;
  width: 46px;
}

.city-actor {
  background: linear-gradient(180deg, #b9ff73, #16a6ff 48%, #101827);
  bottom: 15%;
  height: 104px;
  right: 26%;
  width: 44px;
}

.stage-imported-member {
  border: 1px solid rgba(230, 246, 255, 0.86);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42), 0 0 22px rgba(49, 190, 209, 0.2);
  margin: 0;
  /* La opacidad la fija el keyframe; el fantasma la atenúa sin pisarla. */
  opacity: var(--stage-opacity, 1);
  overflow: hidden;
  position: absolute;
  z-index: 4;
}

.stage-imported-member.is-selected {
  border-color: #a6ff65;
  box-shadow: 0 0 0 2px rgba(166, 255, 101, 0.28), 0 14px 36px rgba(0, 0, 0, 0.44), 0 0 22px rgba(166, 255, 101, 0.18);
}

.stage-imported-member.is-out-of-frame,
.stage-text-item.is-out-of-frame {
  display: none;
}

/* Fantasma: el miembro seleccionado sigue agarrable fuera de su tramo, para
   poder llevarlo a un fotograma más allá del final del clip. Se ve translúcido
   y punteado para que quede claro que ahí todavía no hay nada montado. */
.stage-imported-member.is-out-of-frame.is-ghost,
.stage-text-item.is-out-of-frame.is-ghost {
  display: block;
  filter: grayscale(0.4);
  opacity: calc(var(--stage-opacity, 1) * 0.32);
  outline: 1px dashed rgba(255, 230, 92, 0.85);
  outline-offset: 2px;
}

.stage-imported-member img,
.stage-imported-member video,
.stage-imported-member audio {
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  width: 100%;
}

.stage-imported-member.audio-member {
  background:
    radial-gradient(circle at 50% 34%, rgba(238, 247, 255, 0.14), transparent 0 24%),
    repeating-linear-gradient(90deg, rgba(166, 255, 101, 0.28) 0 3px, transparent 3px 10px),
    linear-gradient(180deg, rgba(8, 12, 20, 0.96), rgba(20, 27, 40, 0.94));
  display: flex;
  justify-content: center;
}

.stage-imported-member.audio-member.sound-member {
  background:
    radial-gradient(circle at 50% 38%, rgba(124, 215, 255, 0.2), transparent 0 26%),
    repeating-linear-gradient(90deg, rgba(124, 215, 255, 0.32) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, rgba(6, 12, 23, 0.98), rgba(10, 33, 50, 0.94));
}

.stage-imported-member.audio-member.music-member {
  background:
    repeating-linear-gradient(90deg, rgba(255, 238, 169, 0.68) 0 4px, rgba(10, 15, 24, 0.28) 4px 6px, transparent 6px 14px),
    linear-gradient(180deg, rgba(18, 14, 8, 0.98), rgba(58, 38, 8, 0.94));
}

.stage-imported-member.audio-member audio {
  height: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
}

.stage-audio-glyph {
  align-items: center;
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.34);
  display: inline-flex;
  height: min(42%, 68px);
  justify-content: center;
  left: 50%;
  min-height: 34px;
  min-width: 34px;
  position: absolute;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(28%, 68px);
  z-index: 2;
}

.stage-audio-glyph.audio {
  background: linear-gradient(180deg, #dff6ff, #70cdf4);
  border: 1px solid rgba(213, 246, 255, 0.86);
}

.stage-audio-glyph.audio::before {
  background: #08121f;
  clip-path: polygon(0 34%, 34% 34%, 78% 0, 78% 100%, 34% 66%, 0 66%);
  content: "";
  height: 42%;
  width: 46%;
}

.stage-audio-glyph.audio::after {
  border: 2px solid #08121f;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  content: "";
  height: 38%;
  margin-left: -8%;
  width: 22%;
}

.stage-audio-glyph.music {
  background: linear-gradient(180deg, #fff5b8, #f2b84b);
  border: 1px solid rgba(255, 242, 176, 0.9);
  color: #171107;
  font: 950 clamp(1.15rem, 4vw, 2.4rem)/1 var(--font-ui, inherit);
}

.stage-audio-glyph.music::before {
  content: "♪";
}

.stage-imported-member figcaption {
  background: linear-gradient(180deg, transparent, rgba(5, 8, 14, 0.92));
  bottom: 0;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 850;
  left: 0;
  overflow: hidden;
  padding: 16px 6px 5px;
  position: absolute;
  right: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-member-resize {
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(166, 255, 101, 0.95) 43% 55%, transparent 56%),
    linear-gradient(135deg, transparent 0 62%, rgba(166, 255, 101, 0.9) 63% 76%, transparent 77%);
  bottom: 2px;
  cursor: nwse-resize;
  height: 18px;
  position: absolute;
  right: 2px;
  width: 18px;
  z-index: 6;
}

.camera-frame {
  border-color: rgba(239, 246, 255, 0.82);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.08);
  height: 68%;
  left: 8%;
  top: 14%;
  width: 84%;
}

.cast-bin {
  gap: 5px;
  padding: 8px;
}

.cast-toolbar {
  align-items: center;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(217, 222, 232, 0.94));
  border-bottom: 1px solid #a7b0bf;
  color: #17202d;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 34px;
  padding: 4px 8px;
}

.cast-toolbar[hidden] {
  display: none !important;
}

.cast-title-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.window-titlebar .cast-title-actions {
  color: inherit;
}

.cast-filter-group,
.cast-view-group {
  align-items: center;
  display: flex;
  gap: 4px;
  min-width: 0;
}

.cast-filter-group {
  overflow-x: auto;
  scrollbar-width: none;
}

.cast-filter-group::-webkit-scrollbar {
  display: none;
}

.cast-filter-group button,
.cast-view-group button {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #d6dce7);
  border: 1px solid #9aa5b5;
  border-radius: 4px;
  color: #2a3546;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: 900 0.58rem/1 var(--font-ui, inherit);
  height: 22px;
  justify-content: center;
  padding: 0 7px;
}

.cast-filter-group button {
  padding: 0;
  width: 24px;
}

.window-titlebar .cast-view-group button {
  height: 22px;
}

.cast-view-group button {
  font-size: 0.74rem;
  padding: 0;
  width: 24px;
}

.cast-filter-group button[aria-pressed="true"],
.cast-view-group button[aria-pressed="true"] {
  background: linear-gradient(180deg, #cfff7d, #8df044);
  border-color: #5b9a2d;
  color: #10220a;
}

.cast-count {
  color: rgba(239, 246, 255, 0.58);
  font-size: 0.62rem;
  font-weight: 900;
  white-space: nowrap;
}

.cast-type-icon {
  display: block;
  height: 14px;
  position: relative;
  width: 14px;
}

.cast-type-icon::before,
.cast-type-icon::after {
  content: "";
  position: absolute;
}

.cast-type-icon-image {
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.cast-type-icon-image::before {
  background: currentColor;
  border-radius: 50%;
  height: 2.5px;
  right: 2px;
  top: 2px;
  width: 2.5px;
}

.cast-type-icon-image::after {
  border-bottom: 5px solid currentColor;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  bottom: 2px;
  left: 2px;
}

.cast-type-icon-video {
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.cast-type-icon-video::before,
.cast-type-icon-video::after {
  background: currentColor;
  border-radius: 1px;
  height: 2px;
  left: 2px;
  right: 2px;
}

.cast-type-icon-video::before {
  top: 2px;
}

.cast-type-icon-video::after {
  bottom: 2px;
}

.cast-type-icon-audio::before {
  border-bottom: 4px solid transparent;
  border-right: 6px solid currentColor;
  border-top: 4px solid transparent;
  height: 0;
  left: 1px;
  top: 3px;
  width: 0;
}

.cast-type-icon-audio::after {
  border: 1.5px solid currentColor;
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  height: 10px;
  right: 1px;
  top: 2px;
  transform: rotate(45deg);
  width: 10px;
}

.cast-type-icon-music::before {
  background: currentColor;
  border-radius: 2px;
  height: 10px;
  right: 4px;
  top: 1px;
  width: 2px;
}

.cast-type-icon-music::after {
  background: currentColor;
  border-radius: 50%;
  bottom: 1px;
  height: 5px;
  left: 2px;
  width: 7px;
  box-shadow: 5px -9px 0 -2px currentColor;
}

.director-cast-window .cast-bin {
  grid-template-columns: repeat(auto-fill, 122px);
  grid-auto-rows: 74px;
  justify-content: start;
  overflow-y: auto;
}

.director-cast-window .cast-bin:has(.cast-empty-state) {
  align-content: center;
  grid-auto-rows: auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.director-cast-window .cast-member {
  background:
    radial-gradient(circle at 38% 26%, rgba(255, 255, 255, 0.9), transparent 12%),
    linear-gradient(135deg, rgba(49, 190, 209, 0.9), rgba(124, 92, 255, 0.76) 48%, rgba(8, 12, 20, 0.96));
  border: 1px solid rgba(220, 239, 255, 0.14);
  border-radius: 8px;
  aspect-ratio: auto;
  min-height: 0;
  overflow: hidden;
  padding: 6px;
  position: relative;
  transform-origin: center;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.director-cast-window .cast-member:active {
  transform: scale(0.97);
}

.director-cast-window .cast-member[role="button"] {
  cursor: grab;
}

.director-cast-window .cast-member.is-dragging {
  cursor: grabbing;
  opacity: 0.72;
  transform: scale(0.96);
}

body.is-cast-pointer-dragging .director-cast-window {
  pointer-events: none;
}

.director-cast-window .cast-member.is-on-stage {
  box-shadow: inset 0 0 0 2px rgba(166, 255, 101, 0.82), 0 0 22px rgba(166, 255, 101, 0.18);
}

.cast-empty-state {
  align-items: center;
  color: rgba(237, 246, 255, 0.58);
  display: flex;
  font-size: 0.72rem;
  font-weight: 850;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 96px;
  text-align: center;
}

/* Los estados vacíos dejan de ser un cartel y pasan a ofrecer la entrada, así que
   apilan texto + botón en vez de ir en una sola línea. */
.cast-empty-state,
.score-empty-state {
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.cast-empty-state p,
.score-empty-state p,
.cast-empty-state small {
  margin: 0;
}

.cast-empty-state small {
  font-size: 0.66rem;
  font-weight: 650;
  opacity: 0.72;
}

.cast-empty-state .button,
.score-empty-state .button {
  font-size: 0.72rem;
  padding: 6px 14px;
}

.director-cast-window .cast-member img,
.director-cast-window .cast-member video,
.director-cast-window .cast-member-kind {
  border-radius: 6px;
  height: calc(100% - 20px);
  inset: 4px 4px auto 4px;
  object-fit: cover;
  position: absolute;
  width: calc(100% - 8px);
  z-index: 0;
}

.director-cast-window .cast-member img,
.director-cast-window .cast-member video {
  display: block;
  max-height: 54px;
  max-width: 114px;
}

.director-cast-window .cast-member img,
.director-cast-window .cast-member video {
  opacity: 0.88;
}

.director-cast-window .cast-member-kind {
  align-items: center;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  font-size: 0.68rem;
  justify-content: center;
  letter-spacing: 0;
  text-transform: uppercase;
}

.director-cast-window .cast-member.imported-member::after {
  background: linear-gradient(180deg, transparent 42%, rgba(5, 8, 14, 0.88));
  content: "";
  inset: 0;
  position: absolute;
  z-index: 1;
}

.director-cast-window .cast-member.imported-member div {
  align-self: end;
  position: relative;
  z-index: 2;
}

.director-cast-window .cast-member:nth-child(2n) {
  background:
    radial-gradient(circle at 44% 30%, rgba(255, 255, 255, 0.86), transparent 11%),
    linear-gradient(135deg, rgba(255, 101, 79, 0.88), rgba(47, 109, 246, 0.76) 48%, rgba(8, 12, 20, 0.96));
}

.director-cast-window .cast-member:nth-child(3n) {
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.86), transparent 12%),
    linear-gradient(135deg, rgba(200, 255, 95, 0.88), rgba(49, 190, 209, 0.7) 48%, rgba(8, 12, 20, 0.96));
}

.director-cast-window .cast-member span,
.director-cast-window .cast-member small {
  display: none;
}

.director-cast-window .cast-member strong {
  align-self: end;
  color: #fff;
  font-size: 0.52rem;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.director-cast-window .cast-bin[data-cast-view="list"] {
  grid-template-columns: 1fr;
  grid-auto-rows: 46px;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 5px 8px;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member img,
.director-cast-window .cast-bin[data-cast-view="list"] .cast-member video,
.director-cast-window .cast-bin[data-cast-view="list"] .cast-member-kind {
  height: 34px;
  inset: auto;
  max-height: none;
  max-width: none;
  position: relative;
  width: 38px;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member.imported-member::after {
  content: none;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member div {
  align-self: center;
  min-width: 0;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member span,
.director-cast-window .cast-bin[data-cast-view="list"] .cast-member small {
  display: block;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member > span {
  color: rgba(221, 232, 246, 0.7);
  font-size: 0.62rem;
  font-weight: 900;
  grid-column: 3;
  grid-row: 1;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member strong {
  display: block;
  font-size: 0.68rem;
  line-height: 1.1;
}

.director-cast-window .cast-bin[data-cast-view="list"] .cast-member small {
  color: rgba(221, 232, 246, 0.6);
  font-size: 0.58rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intent-window .film-form {
  background: transparent;
  color: #edf6ff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 10px;
}

.intent-window .field:not(.prompt-card),
.intent-window .film-actions {
  display: none;
}

.intent-window .prompt-card {
  background: transparent;
  border: 0;
  grid-column: 1 / -1;
  padding: 0;
}

.intent-window textarea {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(220, 239, 255, 0.18);
  color: #edf6ff;
  min-height: 46px;
}

.intent-window .prompt-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.director-shell .button.primary {
  background: linear-gradient(180deg, #aefe6b, #78f94d);
  border-color: rgba(183, 255, 116, 0.8);
  box-shadow: 0 0 24px rgba(150, 255, 80, 0.26);
  color: #071009;
}

.button.light {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(220, 239, 255, 0.16);
  color: #edf6ff;
}

.stage-script,
.script-window .ai-cue-list {
  background: transparent;
  border-color: rgba(220, 239, 255, 0.1);
}

.stage-script strong,
.stage-script pre {
  color: #edf6ff;
}

.score-grid {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 100%, 100% 42px;
  gap: 0;
  padding: 8px;
}

.score-header {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(239, 246, 255, 0.46);
}

.score-channel {
  background: rgba(255, 255, 255, 0.035);
  color: rgba(239, 246, 255, 0.52);
}

.score-cell {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(220, 239, 255, 0.08);
  border-left-width: 4px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.86);
  margin: 4px;
}

.score-cell.stage,
.score-cell.cast {
  background: linear-gradient(90deg, rgba(255, 101, 198, 0.78), rgba(72, 170, 255, 0.62));
}

.score-cell.behavior {
  background: linear-gradient(90deg, rgba(191, 255, 99, 0.88), rgba(120, 255, 95, 0.64));
  color: #071009;
}

.score-cell.voice,
.score-cell.music {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0 2px, transparent 2px 7px),
    linear-gradient(90deg, rgba(49, 190, 209, 0.86), rgba(255, 101, 226, 0.68));
}

.score-cell.video {
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.82), rgba(255, 101, 79, 0.7));
}

.property-window {
  background:
    linear-gradient(180deg, rgba(24, 31, 45, 0.92), rgba(13, 18, 28, 0.94));
}

.property-window .treatment,
.property-window .pipeline-grid,
.property-window .scene-board {
  margin-left: 10px;
  margin-right: 10px;
}

.treatment,
.pipeline-item,
.scene-row {
  color: rgba(239, 246, 255, 0.72);
}

.treatment strong,
.pipeline-item h4,
.scene-row h4 {
  color: #f7fbff;
}

.pipeline-grid {
  gap: 8px;
}

.pipeline-item,
.scene-row {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(220, 239, 255, 0.1);
}

#sceneCount {
  background: rgba(166, 255, 101, 0.12);
  color: #b8ff73;
}

.window-taskbar {
  background: rgba(11, 16, 25, 0.92);
  border-color: rgba(220, 239, 255, 0.16);
  left: 72px;
}

.window-taskbar button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(220, 239, 255, 0.14);
  color: #edf6ff;
}

.retro-director .studio-status {
  background: rgba(8, 12, 20, 0.9);
  border-top-color: rgba(220, 239, 255, 0.12);
  color: rgba(239, 246, 255, 0.66);
}

.site-footer {
  align-items: center;
  background: var(--ink);
  color: rgba(255, 250, 240, 0.74);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  justify-content: space-between;
  padding: 28px clamp(18px, 5vw, 64px);
}

.site-footer span:first-child {
  color: var(--panel);
  font-weight: 900;
  text-transform: uppercase;
}

.site-footer a {
  color: var(--lime);
}

.home-page {
  background: #0f1115;
  color: #f8f7f2;
}

.home-page .site-header {
  background: rgba(15, 17, 21, 0.84);
  border-bottom-color: rgba(248, 247, 242, 0.14);
}

.home-page .brand,
.home-page .nav-links {
  color: #f8f7f2;
}

.home-page .nav-links {
  color: rgba(248, 247, 242, 0.68);
}

.home-page .nav-links a:hover {
  color: #f8f7f2;
}

.home-hero {
  align-items: center;
  background:
    radial-gradient(circle at 78% 24%, rgba(47, 109, 246, 0.28), transparent 34%),
    linear-gradient(180deg, #0f1115 0%, #171a1f 100%);
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(0, 0.92fr) minmax(380px, 0.82fr);
  min-height: 96svh;
  overflow: hidden;
  padding: 15svh clamp(18px, 5vw, 72px) 8svh;
}

.home-copy {
  max-width: 840px;
}

.home-copy h1 {
  color: #f8f7f2;
  font-size: clamp(3.5rem, 6.4vw, 7.2rem);
  line-height: 0.86;
  max-width: 9ch;
}

.home-copy .hero-copy {
  color: rgba(248, 247, 242, 0.74);
  max-width: 720px;
}

.home-page .button.secondary {
  color: #f8f7f2;
}

.hero-film {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #171a1f;
  min-width: 0;
  overflow: visible;
}

.hero-digital-twin {
  align-self: center;
  filter: drop-shadow(0 22px 60px rgba(255, 44, 193, 0.2));
}

.hero-digital-twin img {
  display: block;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  width: min(100%, 920px);
}

.film-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #d7deea;
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}

.film-topbar span {
  background: #d7deea;
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.film-topbar strong {
  font-size: 0.82rem;
  margin-left: auto;
}

.film-stage {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(200, 255, 95, 0.16), rgba(47, 109, 246, 0.16)),
    repeating-linear-gradient(90deg, rgba(248, 247, 242, 0.1) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(248, 247, 242, 0.08) 0 1px, transparent 1px 48px),
    #171a1f;
  overflow: hidden;
  position: relative;
}

.film-object,
.film-caption,
.film-frame,
.film-playhead {
  position: absolute;
}

.film-object {
  align-items: center;
  border: 1px solid rgba(248, 247, 242, 0.72);
  display: flex;
  font-size: 0.78rem;
  font-weight: 950;
  justify-content: center;
  text-transform: uppercase;
}

.film-cast {
  animation: castMove 7.5s infinite ease-in-out;
  background: #2f6df6;
  color: #fff;
  height: 29%;
  left: 18%;
  top: 42%;
  width: 18%;
}

.film-stage-object {
  animation: stageMove 7.5s infinite ease-in-out;
  background: #ff654f;
  bottom: 16%;
  color: #fff;
  height: 18%;
  right: 22%;
  width: 38%;
}

.film-ai {
  animation: aiPulse 7.5s infinite ease-in-out;
  background: #c8ff5f;
  color: #171a1f;
  height: 18%;
  right: 14%;
  top: 22%;
  width: 30%;
}

.film-frame {
  animation: frameScan 7.5s infinite ease-in-out;
  border: 2px solid rgba(248, 247, 242, 0.82);
  height: 58%;
  left: 13%;
  top: 20%;
  width: 74%;
}

.film-playhead {
  animation: playhead 7.5s infinite linear;
  background: #c8ff5f;
  bottom: 0;
  top: 0;
  width: 2px;
}

.film-caption {
  background: rgba(248, 247, 242, 0.94);
  border-radius: 999px;
  color: #171a1f;
  font-size: clamp(0.72rem, 1vw, 0.86rem);
  font-weight: 900;
  left: 18px;
  opacity: 0;
  padding: 9px 12px;
  top: 18px;
  white-space: nowrap;
}

.caption-one { animation: captionCycle 7.5s infinite; }
.caption-two { animation: captionCycle 7.5s infinite 2.5s; }
.caption-three { animation: captionCycle 7.5s infinite 5s; }

.film-score {
  align-items: center;
  background: #fff;
  display: grid;
  gap: 8px;
  grid-template-columns: 62px repeat(5, 1fr);
  padding: 12px;
}

.film-score span:not(.score-label) {
  animation: scorePulse 7.5s infinite ease-in-out;
  background: #171a1f;
  border-radius: 5px;
  height: 44px;
}

.film-score span:nth-child(3),
.film-score span:nth-child(5) {
  background: #2f6df6;
}

.score-label {
  color: #626977;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.home-statement {
  background: #c8ff5f;
  color: #17120f;
  padding: clamp(26px, 5vw, 56px) clamp(18px, 5vw, 72px);
}

.home-statement p {
  font-size: clamp(1.7rem, 4.2vw, 5.2rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.94;
  margin: 0;
  max-width: 1200px;
  text-transform: uppercase;
}

.home-blocks,
.home-next {
  padding: clamp(72px, 9vw, 118px) clamp(18px, 5vw, 72px);
}

.home-blocks {
  background: #f8f7f2;
  color: #171a1f;
}

.home-page #work {
  background: #f8f7f2;
  color: #171a1f;
}

.home-section-head {
  display: grid;
  gap: 18px;
  margin-bottom: 34px;
  max-width: 980px;
}

.home-section-head h2,
.home-next h2 {
  font-size: clamp(2.8rem, 6.4vw, 7.2rem);
  line-height: 0.88;
  margin: 0;
  max-width: 10ch;
}

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

.home-block {
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  color: #171a1f;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 20px;
}

.home-block:hover {
  border-color: #2f6df6;
  transform: translateY(-2px);
}

.home-block span {
  color: #2f6df6;
  font-size: 0.78rem;
  font-weight: 950;
}

.home-block h3 {
  font-size: clamp(2rem, 3.5vw, 4.2rem);
  line-height: 0.9;
  margin: auto 0 14px;
  text-transform: uppercase;
}

.home-block p {
  color: #626977;
  margin: 0;
}

.home-next {
  align-items: end;
  background: #171a1f;
  color: #f8f7f2;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.home-next p:not(.section-kicker) {
  color: rgba(248, 247, 242, 0.68);
  font-size: 1.08rem;
  margin: 22px 0 0;
  max-width: 660px;
}

@keyframes castMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  32% { transform: translate(60%, -18%) scale(0.82); }
  66% { transform: translate(145%, 6%) scale(1.08); }
}

@keyframes stageMove {
  0%, 100% { transform: translateY(0); }
  32% { transform: translate(-12%, -42%); }
  66% { transform: translate(-36%, -18%); }
}

@keyframes aiPulse {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  32% { filter: brightness(1.08); transform: scale(1.12); }
  66% { filter: brightness(0.94); transform: scale(0.92) translate(-18%, 32%); }
}

@keyframes frameScan {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5%, -4%); }
}

@keyframes playhead {
  0% { left: 0; }
  100% { left: 100%; }
}

@keyframes captionCycle {
  0%, 12% { opacity: 0; transform: translateY(-6px); }
  18%, 45% { opacity: 1; transform: translateY(0); }
  52%, 100% { opacity: 0; transform: translateY(6px); }
}

@keyframes scorePulse {
  0%, 100% { transform: scaleY(0.62); }
  50% { transform: scaleY(1); }
}

@keyframes bootExit {
  0%, 78% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes bootCard {
  0% { transform: translateY(18px) scale(0.96); }
  16%, 72% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-12px) scale(0.98); }
}

@keyframes bootStep {
  0% { background: #e6ebf3; opacity: 0.32; }
  42%, 100% { background: #c8ff5f; opacity: 1; }
}

@keyframes windowEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .film-cast,
  .film-stage-object,
  .film-ai,
  .film-frame,
  .film-playhead,
  .film-caption,
  .film-score span:not(.score-label) {
    animation: none;
  }

  .caption-one {
    opacity: 1;
  }

  .studio-entering .studio-boot,
  .studio-entering .director-menubar,
  .studio-entering .tool-palette,
  .studio-entering .director-window,
  .studio-entering .studio-status,
  .studio-entering .boot-card,
  .studio-entering .boot-steps span {
    animation: none;
  }

  .studio-entering .studio-boot {
    display: none;
  }
}

.studio-page {
  background: #0f1115;
  color: #f8f7f2;
}

.studio-site-header {
  background: rgba(15, 17, 21, 0.86);
  border-bottom-color: rgba(248, 247, 242, 0.14);
  color: #f8f7f2;
}

.studio-site-header .nav-links {
  color: rgba(248, 247, 242, 0.68);
}

.studio-site-header .nav-links a:hover,
.studio-site-header .nav-links [aria-current="page"] {
  color: #f8f7f2;
}

.studio-hero {
  align-items: center;
  background:
    radial-gradient(circle at 78% 22%, rgba(47, 109, 246, 0.28), transparent 34%),
    linear-gradient(180deg, #0f1115 0%, #171a1f 100%);
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.78fr);
  min-height: 94svh;
  padding: 14svh clamp(18px, 5vw, 72px) 8svh;
}

.studio-hero h1 {
  font-size: clamp(3.4rem, 8vw, 8.8rem);
  line-height: 0.86;
  max-width: 9ch;
}

.studio-hero-copy p:not(.eyebrow) {
  color: rgba(248, 247, 242, 0.74);
  font-size: clamp(1.1rem, 1.7vw, 1.42rem);
  max-width: 680px;
}

.studio-hero-visual {
  background: #f8f7f2;
  border: 1px solid rgba(248, 247, 242, 0.18);
  border-radius: 8px;
  box-shadow: 0 28px 110px rgba(0, 0, 0, 0.38);
  color: #171a1f;
  overflow: hidden;
}

.preview-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #d7deea;
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}

.preview-topbar span {
  background: #d7deea;
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.preview-topbar strong {
  font-size: 0.82rem;
  margin-left: auto;
}

.preview-frame {
  align-content: end;
  background:
    linear-gradient(135deg, rgba(200, 255, 95, 0.18), rgba(47, 109, 246, 0.22)),
    repeating-linear-gradient(90deg, rgba(15, 17, 21, 0.86) 0 1px, transparent 1px 62px),
    repeating-linear-gradient(0deg, rgba(15, 17, 21, 0.72) 0 1px, transparent 1px 46px),
    #171a1f;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 460px;
  padding: 18px;
}

.frame-chip {
  background: rgba(248, 247, 242, 0.92);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 820;
  padding: 9px 12px;
}

.preview-timeline {
  background: #fff;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, 1fr);
  padding: 12px;
}

.preview-timeline span {
  background: #171a1f;
  border-radius: 5px;
  height: 44px;
}

.preview-timeline span:nth-child(2n) {
  background: #2f6df6;
}

.studio-story-section,
.studio-features,
.studio-workspace {
  padding: clamp(72px, 9vw, 118px) clamp(18px, 5vw, 72px);
}

.studio-story-section {
  background: #f8f7f2;
  color: #171a1f;
}

.studio-story-section h2,
.studio-features h2,
.workspace-heading h2 {
  font-size: clamp(2.6rem, 6vw, 6.4rem);
  max-width: 940px;
}

.production-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 40px;
}

.production-grid article {
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  min-height: 320px;
  padding: 20px;
}

.production-grid span {
  color: #2f6df6;
  font-size: 0.78rem;
  font-weight: 900;
}

.production-grid h3,
.feature-list h3 {
  font-size: clamp(1.35rem, 2vw, 2.1rem);
  line-height: 1;
  margin: 52px 0 12px;
}

.production-grid p,
.feature-list p,
.workspace-heading p {
  color: #626977;
  margin-bottom: 0;
}

.studio-features {
  background: #171a1f;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1fr);
}

.feature-list {
  display: grid;
  gap: 1px;
}

.feature-list article {
  background: rgba(248, 247, 242, 0.08);
  border: 1px solid rgba(248, 247, 242, 0.12);
  border-radius: 8px;
  padding: 22px;
}

.feature-list h3 {
  margin-top: 0;
}

.feature-list p {
  color: rgba(248, 247, 242, 0.68);
}

.studio-workspace {
  background: #f8f7f2;
  color: #171a1f;
}

.workspace-heading {
  align-items: end;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.48fr);
  margin-bottom: 34px;
}

.studio-workspace .studio-shell {
  min-height: 760px;
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    justify-content: space-between;
    width: 100%;
  }

  .hero-inner {
    padding-top: 26svh;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(23, 18, 15, 0.94), rgba(23, 18, 15, 0.46)),
      radial-gradient(circle at 76% 24%, rgba(124, 92, 255, 0.28), transparent 34%),
      linear-gradient(0deg, rgba(245, 238, 226, 0.98), rgba(245, 238, 226, 0) 18%);
  }

  .section-heading,
  .work-grid,
  .blocks-grid,
  .home-hero,
  .home-block-grid,
  .home-next,
  .director-workbench,
  .studio-hero,
  .production-grid,
  .studio-features,
  .workspace-heading,
  .director-board,
  .studio-stage,
  .film-form,
  .treatment,
  .pipeline-grid,
  .process-layout {
    grid-template-columns: 1fr;
  }

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

  .work-card {
    min-height: auto;
  }

  .block-card {
    min-height: 310px;
  }

  .studio-hero {
    padding-top: 18svh;
  }

  .home-hero {
    align-items: start;
    min-height: auto;
    padding-top: 130px;
  }

  .home-next {
    align-items: start;
  }

  .home-block {
    min-height: 230px;
  }

  .film-output {
    max-height: none;
    min-height: auto;
  }

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

  .director-board .film-form,
  .director-stage-window,
  .director-cast-window,
  .intent-window,
  .script-window,
  .score-panel,
  .director-score-window,
  .inspector-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .director-shell.retro-director {
    min-height: auto;
  }

  .director-workbench {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    min-height: auto;
  }

  .tool-palette {
    display: flex;
    grid-row: auto;
    overflow-x: auto;
  }

  /* Un grid item nace con min-width:auto, así que NO se encoge por debajo de su
     contenido: la banda de la Timeline (240 columnas de fotogramas) estiraba el
     banco de trabajo a 939px dentro de una pantalla de 390 y todas las ventanas
     heredaban ese ancho, cortadas por la mitad. Con min-width:0 vuelven a caber,
     y la Timeline se desplaza dentro de lo suyo. */
  /* `1fr` es `minmax(auto, 1fr)`, y ese mínimo *auto* crece con el contenido: la
     regla de fotogramas (1646px) estiraba la columna y con ella el banco entero
     a 939px dentro de una pantalla de 390, dejando todas las ventanas cortadas.
     `minmax(0, 1fr)` le permite encogerse y que sea la Timeline la que se
     desplace por dentro. */
  /* El shell es quien define la columna: medía 390px de ancho pero su
     grid-template-columns se resolvía a 939px, y el banco de trabajo, que es su
     item, heredaba ese ancho. Por eso no bastaba con arreglar el banco. */
  /* Va con las DOS clases a propósito: `.director-shell.retro-director` ya fija
     `grid-template-columns: 1fr` en este mismo media query y, con una sola
     clase, esta regla perdía por especificidad y no llegaba a aplicarse. */
  .director-shell.retro-director,
  .director-shell,
  .director-workbench {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .director-workbench .score-ruler,
  .director-workbench .score-grid {
    min-width: 0;
  }

  .director-window {
    height: auto !important;
    left: auto !important;
    min-width: 0 !important;
    position: relative;
    top: auto !important;
    width: auto !important;
  }

  /* La paleta se declara absolute fuera del media query y ganaba por
     especificidad: en móvil flotaba sobre el resto tapando media pantalla. */
  .director-window.tool-palette,
  .tool-palette {
    position: relative !important;
  }

  /* La barra de menú mide 925px de contenido en una pantalla de 390 y estaba en
     overflow visible: de «Score» en adelante no había forma de llegar. Ahora se
     desplaza con el dedo. */
  .director-menubar {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .director-menubar::-webkit-scrollbar {
    display: none;
  }

  /* El Stage se quedaba en 46px de alto con el lienzo a 0: la ventana existía
     pero no había dónde ver la pieza. */
  .director-stage-window .stage-canvas {
    min-height: 46svh;
  }

  /* La paleta enseñaba 63px de sus 519: las herramientas de debajo eran
     inalcanzables. Se le da altura y, si no cabe, se desplaza por dentro. */
  .tool-palette .tool-palette-body {
    /* Sin min-height la ventana se quedaba en 63px de sus 519 de contenido: se
       podía desplazar, pero enseñando dos botones no sirve de nada. */
    max-height: 40svh;
    min-height: 220px;
    overflow-y: auto;
  }

  /* El Score y la regla de fotogramas se desplazan dentro de su ventana en vez
     de empujar el ancho de todo lo demás. */
  .score-panel .score-grid,
  .score-panel .score-ruler {
    overflow-x: auto;
  }

  .resize-handle,
  .window-taskbar {
    display: none;
  }

  .director-cast-window .cast-bin {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .property-window .scene-row,
  .scene-row {
    grid-template-columns: 1fr;
  }

  .score-grid {
    grid-template-columns: 76px repeat(var(--scene-count, 5), minmax(120px, 1fr));
  }
}

@media (max-width: 700px) {
  .studio-shell,
  .director-shell {
    grid-template-columns: 1fr;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .studio-rail {
    border-bottom: 1px solid rgba(23, 18, 15, 0.13);
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .nav-links {
    font-size: 0.82rem;
    gap: 10px;
    overflow-x: auto;
  }

  h1 {
    font-size: clamp(3.3rem, 19vw, 5.2rem);
  }

  .home-copy h1 {
    font-size: clamp(3.1rem, 16vw, 5rem);
  }

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

  .ticker {
    grid-template-columns: repeat(6, minmax(132px, 1fr));
  }

  .work-visual {
    height: 220px;
  }

  .film-score {
    grid-template-columns: 1fr;
  }

  .film-score span:not(.score-label) {
    height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Final skin overrides: keep the Admira Director workspace in the dark neon product look. */
.studio-page {
  background:
    radial-gradient(circle at 50% -10%, rgba(153, 255, 99, 0.14), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(113, 76, 255, 0.2), transparent 26%),
    radial-gradient(circle at 22% 72%, rgba(20, 192, 255, 0.16), transparent 28%),
    #060a11;
}

.studio-workspace {
  background:
    radial-gradient(circle at 50% 0%, rgba(160, 255, 97, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(5, 9, 16, 0.2), rgba(5, 9, 16, 0.96));
  color: #eef5ff;
  min-height: 100svh;
  padding: clamp(88px, 10vw, 126px) clamp(18px, 4vw, 54px) clamp(42px, 6vw, 74px);
}

.studio-entering .workspace-heading,
.studio-entered .workspace-heading {
  display: none;
}

.studio-entering .studio-workspace,
.studio-entered .studio-workspace {
  padding-top: 96px;
}

.director-shell.retro-director {
  background:
    linear-gradient(180deg, rgba(18, 24, 34, 0.94), rgba(8, 12, 20, 0.96)),
    rgba(8, 12, 20, 0.92);
  border: 1px solid rgba(216, 235, 255, 0.24);
  border-radius: 22px;
  color: #eff6ff;
  max-width: 1180px;
  min-height: 820px;
}

.studio-entering,
.studio-entered {
  overflow: hidden;
}

.studio-entering .studio-site-header,
.studio-entered .studio-site-header,
.studio-entering .site-footer,
.studio-entered .site-footer {
  display: none;
}

.studio-entering main,
.studio-entered main {
  height: 100svh;
  overflow: hidden;
}

.studio-entering .studio-workspace,
.studio-entered .studio-workspace {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  padding: 0;
}

.studio-entering .director-shell.retro-director,
.studio-entered .director-shell.retro-director {
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100svh;
  margin: 0;
  max-width: none;
  min-height: 0;
  overflow: visible;
  width: 100vw;
}

.studio-entering .studio-collab-bar,
.studio-entered .studio-collab-bar {
  margin: 12px 12px 8px;
}

.studio-entering .director-workbench,
.studio-entered .director-workbench {
  height: auto;
  min-height: 0;
}

.studio-collab-bar.is-hidden {
  display: none;
}

.studio-collab-bar {
  grid-template-columns: auto minmax(120px, 1fr) auto auto auto auto;
}

.collab-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 239, 255, 0.18);
  border-radius: 10px;
  color: rgba(239, 246, 255, 0.74);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.collab-close:hover {
  background: rgba(255, 101, 79, 0.18);
  border-color: rgba(255, 101, 79, 0.42);
  color: #fff;
}

.menubar-action {
  background: transparent;
  border: 0;
  color: rgba(239, 246, 255, 0.72);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 760;
  padding: 0;
}

.menubar-action[data-open-window] {
  text-align: left;
}

.menubar-action:hover {
  color: #fff;
}

.tools-menu-label {
  align-items: center;
  display: inline-flex;
  user-select: none;
}

.import-menu {
  background: rgba(9, 13, 21, 0.98);
  border: 1px solid rgba(218, 233, 255, 0.18);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  display: none;
  gap: 4px;
  min-width: 210px;
  padding: 7px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
}

.tool-palette.open .import-menu {
  display: grid;
}

.tool-palette .import-menu button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: rgba(239, 246, 255, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 760;
  height: auto;
  justify-content: flex-start;
  min-height: 34px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.stage-member-remove {
  align-items: center;
  background: rgba(255, 101, 79, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: 900 14px/1 ui-sans-serif, system-ui, sans-serif;
  height: 20px;
  justify-content: center;
  opacity: 0;
  padding: 0;
  position: absolute;
  right: -8px;
  text-shadow: none;
  top: -8px;
  transition: opacity 0.12s ease, transform 0.12s ease;
  width: 20px;
  z-index: 8;
}

.stage-imported-member:hover .stage-member-remove,
.stage-imported-member.is-selected .stage-member-remove {
  opacity: 1;
}

.stage-member-remove:hover {
  background: #ff3f35;
  transform: scale(1.05);
}

.tool-palette .import-menu button:hover {
  background: rgba(166, 255, 101, 0.16);
  color: #fff;
}

.studio-entering .tool-palette,
.studio-entered .tool-palette {
  background:
    linear-gradient(180deg, rgba(20, 27, 40, 0.88), rgba(10, 15, 24, 0.9));
  border: 1px solid rgba(218, 233, 255, 0.18);
  border-radius: 14px;
  bottom: auto;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #edf6ff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  left: 10px;
  max-height: calc(100% - 20px);
  overflow: hidden;
  padding: 0;
  position: absolute;
  top: 10px;
  z-index: 60;
}

.tool-palette.is-hidden {
  display: none;
}

.tool-palette .window-titlebar {
  min-height: 29px;
  padding: 5px 7px;
}

.tool-palette .window-titlebar strong {
  color: #edf6ff;
  font-size: 0.78rem;
  min-width: 0;
}

.tool-palette-body {
  align-content: start;
  background: linear-gradient(180deg, #eef1f6, #c9d0dc);
  border-radius: 0 0 12px 12px;
  display: grid;
  gap: 7px;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  padding: 7px 7px 11px;
}

.tool-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(2, 36px);
}

.tool-palette .tool-grid button,
.tool-symbols span {
  align-items: center;
  background: linear-gradient(180deg, #fff, #d8dee8);
  border: 1px solid #8f9aaa;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #1b2737;
  cursor: pointer;
  display: flex;
  font: 900 0.56rem/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.tool-palette .tool-grid button:hover,
.tool-palette .tool-grid button[aria-pressed="true"],
.tool-palette .tool-grid button[data-import-trigger="ai"] {
  background: linear-gradient(180deg, #b8ff73, #82ff4b);
  color: #071009;
}

.tool-symbols {
  border-top: 1px solid rgba(82, 92, 108, 0.46);
  padding-top: 6px;
}

.tool-symbols button {
  font-size: 0.82rem;
}

.tool-swatches {
  display: grid;
  gap: 0;
  grid-template-columns: 40px 28px;
  justify-content: center;
  min-height: 52px;
  position: relative;
}

.tool-palette .tool-color-swatch {
  background: #fff;
  border: 1px solid #7d8796;
  border-radius: 0;
  cursor: pointer;
  display: block;
  height: 36px;
  padding: 0;
  width: 36px;
}

.tool-color-swatch:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.tool-palette .foreground-swatch {
  background: #070b12;
  z-index: 2;
}

.tool-palette .stage-background-swatch {
  background: #10141f;
  margin-left: -13px;
  margin-top: 13px;
}

.foreground-color-input,
.stage-color-input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.tool-text-controls {
  border-top: 1px solid rgba(82, 92, 108, 0.46);
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 24px);
  justify-content: center;
  padding: 7px 2px 2px;
}

.tool-text-controls button {
  align-items: center;
  appearance: none;
  background: linear-gradient(180deg, #f8fafc, #d6dde8);
  border: 1px solid #8792a3;
  border-radius: 2px;
  color: #17202d;
  cursor: pointer;
  display: inline-flex;
  font: 900 0.68rem/1 ui-sans-serif, system-ui, sans-serif;
  height: 22px;
  justify-content: center;
  padding: 0;
  width: 24px;
}

.tool-text-controls button[data-text-style="italic"] {
  font-style: italic;
}

.tool-text-controls button[data-text-style="underline"] {
  text-decoration: underline;
}

.tool-text-controls button[aria-pressed="true"] {
  background: linear-gradient(180deg, #b8ff73, #82ff4b);
  border-color: #57ad2d;
  color: #071009;
}

.tool-strokes {
  border-top: 1px solid rgba(82, 92, 108, 0.46);
  display: grid;
  gap: 5px;
  padding: 7px 4px 2px;
}

.tool-palette .resize-handle {
  display: none;
}

.tool-strokes span {
  background: #11151b;
  display: block;
  height: 2px;
}

.tool-strokes span:nth-child(2) {
  height: 4px;
}

.tool-strokes span:nth-child(3) {
  height: 6px;
}

.tool-shortcuts {
  border-top: 1px solid rgba(82, 92, 108, 0.46);
  display: grid;
  gap: 4px;
  padding: 7px 0 0;
  width: 78px;
}

.tool-shortcuts a {
  align-items: center;
  background: linear-gradient(180deg, #fbfcff, #d9e0ea);
  border: 1px solid #8792a3;
  border-radius: 2px;
  color: #17202d;
  display: flex;
  font: 900 0.58rem/1 ui-sans-serif, system-ui, sans-serif;
  height: 22px;
  justify-content: center;
  overflow: hidden;
  padding: 0 3px;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-shortcuts a:hover,
.tool-shortcuts a:focus-visible {
  background: linear-gradient(180deg, #b8ff73, #82ff4b);
  color: #071009;
  outline: 0;
}

.stage-canvas[data-stage-tool="hand"] .stage-imported-member,
.stage-canvas[data-stage-tool="hand"] .stage-text-item,
.stage-canvas[data-stage-tool="hand"] .stage-shape-item {
  cursor: grab;
}

.stage-canvas[data-stage-tool="hand"] .stage-imported-member:active,
.stage-canvas[data-stage-tool="hand"] .stage-text-item:active,
.stage-canvas[data-stage-tool="hand"] .stage-shape-item:active {
  cursor: grabbing;
}

.stage-canvas[data-stage-tool="text"] {
  cursor: text;
}

.stage-canvas[data-stage-tool="line"] {
  cursor: crosshair;
}

.stage-canvas[data-stage-tool="rect-fill"],
.stage-canvas[data-stage-tool="rect"],
.stage-canvas[data-stage-tool="oval-fill"],
.stage-canvas[data-stage-tool="oval"] {
  cursor: crosshair;
}

.stage-text-item {
  align-items: start;
  background: rgba(7, 11, 18, 0.34);
  border: 1px solid rgba(237, 246, 255, 0.42);
  border-radius: 6px;
  color: var(--stage-foreground, #edf6ff);
  display: inline-grid;
  font-size: clamp(12px, 1.4vw, 22px);
  font-weight: 850;
  left: 0;
  line-height: 1.1;
  min-width: 64px;
  padding: 0;
  position: absolute;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.62);
  top: 0;
  z-index: 5;
}

.stage-text-item.is-selected {
  border-color: #a6ff65;
  box-shadow: 0 0 0 2px rgba(166, 255, 101, 0.2);
}

.stage-text-content {
  display: block;
  min-height: 1.1em;
  min-width: 64px;
  padding: 8px 28px 8px 10px;
}

.stage-text-content:focus {
  border-color: #a6ff65;
  box-shadow: 0 0 0 2px rgba(166, 255, 101, 0.2);
  outline: none;
}

.stage-text-remove {
  align-items: center;
  background: rgba(255, 101, 79, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: 900 14px/1 ui-sans-serif, system-ui, sans-serif;
  height: 20px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: -8px;
  text-shadow: none;
  top: -8px;
  width: 20px;
  z-index: 7;
}

.stage-text-remove:hover {
  background: #ff3f35;
}

.stage-line-item {
  background: var(--stage-foreground, #edf6ff);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(237, 246, 255, 0.32);
  height: 3px;
  left: 0;
  position: absolute;
  top: 0;
  transform-origin: 0 50%;
  z-index: 5;
}

.stage-shape-item {
  background: transparent;
  border: 2px solid var(--stage-foreground, #edf6ff);
  box-shadow: 0 0 10px rgba(237, 246, 255, 0.22);
  left: 0;
  min-height: 4%;
  min-width: 4%;
  position: absolute;
  top: 0;
  z-index: 5;
}

.stage-shape-item.is-filled {
  background: var(--stage-foreground, #edf6ff);
}

.stage-shape-item.is-oval {
  border-radius: 999px;
}

.stage-shape-item.is-selected {
  box-shadow: 0 0 0 2px rgba(166, 255, 101, 0.34), 0 0 14px rgba(166, 255, 101, 0.2);
}

.stage-shape-resize {
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(166, 255, 101, 0.95) 43% 55%, transparent 56%),
    linear-gradient(135deg, transparent 0 62%, rgba(166, 255, 101, 0.9) 63% 76%, transparent 77%);
  bottom: 0;
  cursor: nwse-resize;
  height: 18px;
  position: absolute;
  right: 0;
  width: 18px;
}

.tool-palette .import-menu {
  left: calc(100% + 8px);
  right: auto;
  top: 26px;
}

.studio-entering .director-workbench,
.studio-entered .director-workbench {
  padding: 0;
}

.studio-entering .director-workbench,
.studio-entered .director-workbench {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.studio-entering .studio-status,
.studio-entered .studio-status {
  min-height: 44px;
}

.studio-entering .window-taskbar,
.studio-entered .window-taskbar {
  bottom: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
}

/* Fullscreen studio corrections: the work area owns the full viewport. */
body.studio-entering,
body.studio-entered {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
}

.studio-entering .studio-workspace,
.studio-entered .studio-workspace {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 32%, rgba(56, 201, 255, 0.12), transparent 38%),
    #070b12;
  inset: 0;
  position: fixed;
}

.studio-entering .director-shell.retro-director,
.studio-entered .director-shell.retro-director {
  background: #070b12;
}

.studio-entering .director-workbench,
.studio-entered .director-workbench {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 48% 24%, rgba(56, 201, 255, 0.12), transparent 34%),
    #070b12;
  background-size: 32px 32px, 32px 32px, 100% 100%, auto;
}

.studio-entering .studio-status,
.studio-entered .studio-status {
  background: rgba(8, 12, 20, 0.96);
}

.studio-entering .director-score-window,
.studio-entered .director-score-window {
  border-radius: 12px;
}

.director-score-window .score-grid {
  background: #edf1f7;
  color: #17202d;
  display: block;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.director-score {
  contain: layout paint;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  grid-template-rows: 46px 26px repeat(7, minmax(30px, 1fr));
  height: 100%;
  min-height: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.score-member-title,
.score-row-label {
  background: linear-gradient(180deg, #f8fafc, #d9dee8);
  border-bottom: 1px solid #b7bfcc;
  border-right: 1px solid #a7b0bf;
}

.score-tools {
  align-items: center;
  background: rgba(237, 241, 247, 0.82);
  border: 1px solid rgba(167, 176, 191, 0.78);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  display: flex;
  flex-direction: row;
  gap: 5px;
  justify-content: space-between;
  left: 24px;
  max-width: calc(100% - 176px);
  min-width: 340px;
  padding: 3px 5px;
  position: absolute;
  top: 4px;
  z-index: 11;
}

.director-score-window .window-titlebar .score-tools {
  background: rgba(237, 241, 247, 0.9);
  cursor: default;
  left: auto;
  margin-left: 2px;
  padding: 2px 11px 2px 5px;
  position: static;
  top: auto;
}

.director-score-window .window-titlebar .score-tools.is-resizing {
  cursor: ew-resize;
  user-select: none;
}

.score-tools.is-wide {
  gap: 9px;
}

.score-tools.is-wide .score-play-cluster,
.score-tools.is-wide .score-transport,
.score-tools.is-wide .score-zoom-stepper {
  flex: 1 1 0;
}

.score-tools.is-wide .score-mark-entry {
  flex: 1.35 1 126px;
}

.score-tools-resize {
  bottom: 3px;
  cursor: ew-resize;
  position: absolute;
  right: 2px;
  top: 3px;
  width: 8px;
}

.score-tools-resize::before {
  background:
    linear-gradient(90deg, rgba(92, 103, 120, 0.55) 0 1px, transparent 1px 3px);
  content: "";
  display: block;
  height: 100%;
  margin-left: 2px;
  width: 5px;
}

.score-play-cluster {
  display: grid;
  gap: 2px;
  grid-template-columns: 22px 28px 22px;
  justify-content: center;
}

.score-fps-stepper {
  align-items: center;
  display: grid;
  gap: 1px;
  grid-template-columns: 20px 9px;
  width: 30px;
}

.score-fps-value {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #d8dde8);
  border: 1px solid #9aa5b5;
  border-radius: 3px;
  color: #1d2838;
  display: flex;
  font: 800 0.62rem/1 var(--font-ui, inherit);
  height: 18px;
  justify-content: center;
  width: 20px;
}

.score-fps-buttons {
  display: grid;
  grid-template-rows: 9px 9px;
  height: 18px;
}

.score-transport {
  display: grid;
  gap: 2px;
  grid-template-columns: 20px 30px 20px;
  justify-content: center;
}

.score-transport button,
.score-zoom-stepper button,
.score-play-top,
.score-bound-button {
  align-items: center;
  appearance: none;
  background: linear-gradient(180deg, #ffffff, #d6dce7);
  border: 1px solid #9aa5b5;
  border-radius: 3px;
  color: #5f6978;
  cursor: pointer;
  display: flex;
  font: 900 0.74rem/1 var(--font-ui, inherit);
  height: 18px;
  justify-content: center;
  padding: 0;
}

.score-zoom-stepper {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-template-columns: 18px 42px 18px;
  justify-content: center;
  width: 82px;
}

.score-mark-entry {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #d8dde8);
  border: 1px solid #9aa5b5;
  border-radius: 3px;
  display: grid;
  gap: 3px;
  grid-template-columns: auto 62px 18px;
  height: 22px;
  padding: 0 2px 0 5px;
}

.score-mark-entry span {
  color: #5f6978;
  font: 900 0.52rem/1 var(--font-ui, inherit);
  text-transform: uppercase;
}

.score-mark-entry input {
  background: transparent;
  border: 0;
  color: #1d2838;
  font: 850 0.58rem/1 var(--font-ui, inherit);
  min-width: 0;
  outline: 0;
}

.score-mark-entry button {
  align-items: center;
  appearance: none;
  background: linear-gradient(180deg, #ffffff, #d6dce7);
  border: 1px solid #9aa5b5;
  border-radius: 3px;
  color: #233047;
  cursor: pointer;
  display: flex;
  font: 950 0.68rem/1 var(--font-ui, inherit);
  height: 16px;
  justify-content: center;
  padding: 0;
  width: 18px;
}

.score-zoom-stepper input {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #d8dde8);
  border: 1px solid #9aa5b5;
  border-radius: 3px;
  color: #1d2838;
  display: flex;
  font: 850 0.58rem/1 var(--font-ui, inherit);
  height: 18px;
  justify-content: center;
  min-width: 0;
  outline: 0;
  padding: 0 2px;
  text-align: center;
  width: 42px;
}

.score-zoom-stepper input::-webkit-outer-spin-button,
.score-zoom-stepper input::-webkit-inner-spin-button {
  margin: 0;
}

.score-zoom-stepper button {
  font-size: 0.64rem;
  width: 18px;
}

.score-fps-buttons button {
  border-radius: 2px;
  font-size: 0.45rem;
  height: 9px;
  width: 9px;
}

.score-play-top {
  width: 28px;
}

.score-bound-button {
  font-size: 0.58rem;
  width: 22px;
}

.score-transport button:hover,
.score-zoom-stepper button:hover,
.score-play-top:hover,
.score-bound-button:hover {
  background: linear-gradient(180deg, #ffffff, #c8d7ef);
  color: #233047;
}

.score-play-top[aria-pressed="true"] {
  background: linear-gradient(180deg, #f7d3df, #d74271);
  border-color: #9e274d;
  color: #ffffff;
}

.score-member-title {
  align-items: center;
  display: flex;
  font-size: 0.78rem;
  font-weight: 850;
  grid-column: 1;
  grid-row: 1 / 3;
  gap: 6px;
  justify-content: space-between;
  padding: 0 8px;
}

.score-audio-mute-all {
  align-items: center;
  appearance: none;
  background: linear-gradient(180deg, #ffffff, #d6dce7);
  border: 1px solid #9aa5b5;
  border-radius: 3px;
  color: #233047;
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  height: 18px;
  justify-content: center;
  padding: 0;
  width: 22px;
}

.score-audio-mute-all:hover {
  background: linear-gradient(180deg, #ffffff, #c8d7ef);
}

.score-audio-mute-all.is-muted,
.score-audio-mute-all[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffe3e7, #d74271);
  border-color: #9e274d;
  color: #ffffff;
}

.score-audio-icon {
  border: 5px solid transparent;
  border-right-color: currentColor;
  display: block;
  height: 0;
  position: relative;
  width: 0;
}

.score-audio-icon::before {
  background: currentColor;
  content: "";
  height: 8px;
  position: absolute;
  right: -7px;
  top: -4px;
  width: 4px;
}

.score-audio-icon::after {
  border: 1px solid currentColor;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  content: "";
  height: 10px;
  left: 3px;
  position: absolute;
  top: -5px;
  width: 6px;
}

.score-audio-mute-all.is-muted .score-audio-icon::after,
.score-audio-mute-all[aria-pressed="true"] .score-audio-icon::after {
  background: currentColor;
  border: 0;
  height: 2px;
  left: 2px;
  top: -1px;
  transform: rotate(-35deg);
  width: 12px;
}

.score-ruler {
  background:
    repeating-linear-gradient(90deg, #cfd5df 0 1px, transparent 1px 12px),
    linear-gradient(180deg, #ffffff, #edf1f7);
  border-bottom: 1px solid #b7bfcc;
  grid-column: 2;
  grid-row: 1 / 3;
  position: relative;
  touch-action: none;
}

.score-frame-number {
  color: #7d8796;
  font-size: 0.54rem;
  font-weight: 850;
  position: absolute;
  top: 34px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.score-marker-layer {
  inset: 2px 0 auto;
  height: 20px;
  position: absolute;
  z-index: 7;
}

.score-marker {
  appearance: none;
  background: #fff6a8;
  border: 1px solid #b6a348;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  color: #2b3140;
  cursor: text;
  font: 900 0.58rem/1 var(--font-ui, inherit);
  max-width: 70px;
  min-width: 24px;
  overflow: hidden;
  padding: 2px 4px;
  position: absolute;
  text-align: center;
  text-overflow: ellipsis;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.score-marker span {
  display: block;
  outline: none;
}

.score-playhead {
  background: #d74271;
  border-left: 1px solid rgba(70, 10, 30, 0.65);
  border-right: 1px solid rgba(70, 10, 30, 0.65);
  bottom: -210px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 18px rgba(215, 66, 113, 0.36);
  cursor: ew-resize;
  display: block;
  position: absolute;
  top: 26px;
  touch-action: none;
  transform: translateX(-50%);
  width: 6px;
  z-index: 8;
}

.score-playhead::before {
  background: #d74271;
  border: 1px solid rgba(70, 10, 30, 0.65);
  content: "";
  height: 16px;
  left: 50%;
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
  width: 12px;
}

.score-playhead::after {
  background: rgba(23, 32, 45, 0.92);
  border: 1px solid rgba(215, 66, 113, 0.55);
  border-radius: 3px;
  color: #fff;
  content: "F" attr(data-frame);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 850;
  left: 12px;
  line-height: 1;
  opacity: 0;
  padding: 4px 5px;
  position: absolute;
  top: -20px;
  transition: opacity 0.12s ease;
  white-space: nowrap;
}

.score-playhead:hover::after,
.score-playhead.is-dragging::after {
  opacity: 1;
}

.score-row-label {
  align-items: center;
  color: #697382;
  cursor: default;
  display: flex;
  font-size: 0.74rem;
  font-weight: 850;
  gap: 4px;
  justify-content: flex-end;
  min-width: 0;
  outline: 0;
  overflow: hidden;
  padding: 0 6px;
}

.score-row-label span {
  cursor: text;
  min-width: 0;
  outline: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row-label:hover,
.score-row-label:focus-within {
  background: linear-gradient(180deg, #fff, #dceeff);
  box-shadow: inset 0 0 0 1px rgba(36, 91, 214, 0.32);
  color: #17202d;
}

.score-audio-mute {
  align-items: center;
  appearance: none;
  background: linear-gradient(180deg, #ffffff, #d6dce7);
  border: 1px solid #9aa5b5;
  border-radius: 3px;
  color: #233047;
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  font: 950 0.54rem/1 var(--font-ui, inherit);
  height: 16px;
  justify-content: center;
  padding: 0;
  width: 18px;
}

.score-audio-mute:hover {
  background: linear-gradient(180deg, #ffffff, #c8d7ef);
}

.score-audio-mute.is-muted,
.score-audio-mute[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffe3e7, #d74271);
  border-color: #9e274d;
  color: #fff;
}

.score-track {
  background:
    repeating-linear-gradient(90deg, rgba(91, 101, 116, 0.08) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(90deg, rgba(91, 101, 116, 0.12) 0 1px, transparent 1px 60px),
    linear-gradient(180deg, #fbfcff, #f3f5f9);
  border-bottom: 1px solid #dde2eb;
  position: relative;
}

.score-empty-state {
  align-items: center;
  background: linear-gradient(180deg, #fbfcff, #eef3f9);
  border-bottom: 1px solid #dde2eb;
  color: #6d7786;
  display: flex;
  font-size: 0.78rem;
  font-weight: 850;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 112px;
}

.score-sprite {
  align-items: center;
  background: linear-gradient(180deg, #d8d2ff, #b8b2f0);
  border: 1px solid #8f8ac8;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: #273042;
  cursor: pointer;
  display: flex;
  gap: 5px;
  height: 19px;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  padding: 0 5px;
  position: absolute;
  top: 5px;
  white-space: nowrap;
}

.score-sprite::before,
.score-sprite::after {
  background: #f5f6ff;
  border: 1px solid #676f86;
  content: "";
  height: 12px;
  position: absolute;
  top: 3px;
  width: 4px;
}

.score-sprite::before {
  left: -1px;
}

.score-sprite::after {
  right: -1px;
}

.score-sprite span {
  font-size: 0.72rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-sprite small {
  color: rgba(39, 48, 66, 0.56);
  font-size: 0.62rem;
  font-weight: 800;
}

.score-sprite.stage {
  background: linear-gradient(180deg, #eeeaff, #c6c0ff);
}

.score-sprite.cast {
  background: linear-gradient(180deg, #ddf3ff, #b9d7ff);
}

.score-sprite.behavior {
  background: linear-gradient(180deg, #d9ffd1, #9ee984);
  border-color: #74bd5a;
}

.score-sprite.voice {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.82) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #dff8ff, #ace9ff);
  border-color: #83bdd4;
}

.score-sprite.music {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.78) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #fff0c5, #f4c66d);
  border-color: #d19d39;
}

.score-sprite.video {
  background: linear-gradient(180deg, #ffd6dc, #e7a0ae);
  border-color: #c06f7e;
}

.score-sprite.imported-member {
  cursor: ew-resize;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 0 0 1px rgba(32, 96, 255, 0.18);
}

.score-sprite.imported-member.is-selected {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 0 0 2px rgba(166, 255, 101, 0.6), 0 7px 15px rgba(40, 60, 20, 0.18);
  outline: 0;
}

.score-sprite-remove {
  align-items: center;
  background: rgba(255, 101, 79, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: 900 11px/1 ui-sans-serif, system-ui, sans-serif;
  height: 15px;
  justify-content: center;
  margin-left: 2px;
  opacity: 0;
  position: relative;
  text-shadow: none;
  width: 15px;
  z-index: 4;
}

.score-sprite:hover .score-sprite-remove,
.score-sprite.is-selected .score-sprite-remove {
  opacity: 1;
}

.score-sprite-remove:hover {
  background: #ff3f35;
}

.score-sprite-handle {
  bottom: 1px;
  cursor: ew-resize;
  position: absolute;
  top: 1px;
  width: 14px;
  z-index: 3;
}

.score-sprite-handle.start {
  left: -5px;
}

.score-sprite-handle.end {
  right: -5px;
}

.score-sprite.imported-member.is-dragging {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 0 0 2px rgba(32, 96, 255, 0.34), 0 8px 20px rgba(32, 96, 255, 0.18);
}

/* Marca de keyframe: un ASTERISCO, no un punto. Dice "aquí hay un cambio
   guardado" y se distingue de las marcas de la regla de un vistazo. */
.score-keyframe-dot {
  align-items: center;
  background: #101827;
  border: 2px solid #ffe65c;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(16, 24, 39, 0.28), 0 2px 6px rgba(0, 0, 0, 0.2);
  color: #ffe65c;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  height: 14px;
  justify-content: center;
  line-height: 1;
  margin-left: -7px;
  /* El glifo "*" se dibuja alto en su caja; se baja para centrarlo óptimamente. */
  padding: 3px 0 0;
  position: absolute;
  top: 1px;
  width: 14px;
  z-index: 12;
}

.score-keyframe-dot:hover,
.score-keyframe-dot:focus,
.score-keyframe-dot.is-selected,
.score-keyframe-dot.is-dragging {
  background: #ffe65c;
  border-color: #101827;
  color: #101827;
  outline: 0;
}

.stock-import-tray {
  align-items: center;
  background: rgba(4, 7, 12, 0.58);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 100;
}

.stock-import-tray.open {
  display: flex;
}

.stock-tray-panel {
  background: linear-gradient(180deg, #141b27, #0b1019);
  border: 1px solid rgba(167, 255, 91, 0.3);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.46);
  color: #eef5ff;
  max-width: min(820px, calc(100vw - 32px));
  padding: 14px;
  width: 820px;
}

.stock-tray-header,
.stock-tray-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.stock-tray-header {
  border-bottom: 1px solid rgba(191, 211, 235, 0.14);
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  padding: 0 0 12px;
}

.stock-tray-header div {
  display: grid;
  gap: 2px;
}

.stock-tray-header strong {
  font-size: 0.92rem;
  font-weight: 900;
}

.stock-tray-header span {
  color: rgba(221, 232, 246, 0.68);
  font-size: 0.72rem;
  font-weight: 760;
}

.stock-tray-header button {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #eef5ff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.stock-tray-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stock-tray-filters button {
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(191, 211, 235, 0.2);
  border-radius: 6px;
  color: rgba(238, 245, 255, 0.72);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 900;
  height: 28px;
  padding: 0 10px;
  width: auto;
}

.stock-tray-filters button.is-active {
  background: rgba(167, 255, 91, 0.18);
  border-color: rgba(167, 255, 91, 0.72);
  color: #a7ff5b;
}

.stock-tray-filters button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.stock-tray-filters button.is-empty:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.stock-tray-search {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 211, 235, 0.16);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(120px, 1fr);
  min-height: 32px;
  padding: 0 9px;
}

.stock-tray-search span {
  color: rgba(221, 232, 246, 0.62);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-tray-search input {
  background: transparent;
  border: 0;
  color: #eef5ff;
  font: 800 0.74rem/1 ui-sans-serif, system-ui, sans-serif;
  min-width: 0;
  outline: 0;
}

.stock-tray-search input::placeholder {
  color: rgba(221, 232, 246, 0.42);
}

.stock-tray-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 14px 0 18px;
  scroll-snap-type: x proximity;
  scrollbar-color: #a7ff5b rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.stock-tray-list::-webkit-scrollbar {
  height: 10px;
}

.stock-tray-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.stock-tray-list::-webkit-scrollbar-thumb {
  background: #a7ff5b;
  border-radius: 999px;
}

.stock-tray-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 211, 235, 0.16);
  border-radius: 7px;
  color: inherit;
  cursor: pointer;
  flex: 0 0 258px;
  font: inherit;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  scroll-snap-align: start;
  text-align: left;
}

.stock-tray-item[hidden] {
  display: none;
}

.stock-tray-item.is-selected {
  background: rgba(167, 255, 91, 0.12);
  border-color: rgba(167, 255, 91, 0.82);
  box-shadow: 0 0 0 2px rgba(167, 255, 91, 0.16);
}

.stock-tray-check {
  align-items: center;
  background: rgba(11, 16, 25, 0.86);
  border: 1px solid rgba(167, 255, 91, 0.82);
  border-radius: 999px;
  color: #a7ff5b;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 950;
  height: 22px;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  z-index: 2;
}

.stock-tray-preview {
  align-items: center;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.035) 75%),
    #080d15;
  background-size: 14px 14px;
  display: flex;
  justify-content: center;
}

.stock-tray-preview img,
.stock-tray-preview video {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.stock-tray-audio {
  align-items: center;
  background: #a7ff5b;
  border-radius: 999px;
  color: #0b1019;
  display: inline-flex;
  font-size: 1.05rem;
  font-weight: 950;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.stock-tray-copy {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 10px;
}

.stock-tray-copy span {
  color: #a7ff5b;
  font-size: 0.68rem;
  font-weight: 900;
}

.stock-tray-copy strong {
  font-size: 0.78rem;
  line-height: 1.22;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-tray-copy small {
  color: rgba(221, 232, 246, 0.62);
  font-size: 0.68rem;
  font-weight: 760;
}

.stock-tray-copy em {
  color: rgba(221, 232, 246, 0.48);
  display: -webkit-box;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 720;
  line-height: 1.28;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stock-tray-actions {
  border-top: 1px solid rgba(191, 211, 235, 0.14);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  padding-top: 12px;
}

.stock-tray-actions [data-stock-selected-count] {
  align-self: center;
  color: rgba(221, 232, 246, 0.68);
  font-size: 0.72rem;
  font-weight: 850;
}

.stock-tray-actions button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #eef5ff;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  min-height: 32px;
  padding: 0 12px;
}

.stock-tray-actions [data-stock-tray-compose] {
  background: #a7ff5b;
  border-color: #a7ff5b;
  color: #0b1019;
}

.stock-tray-actions [data-stock-tray-compose]:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

body.studio-page[data-interface-theme="light"] .stock-import-tray {
  background: rgba(28, 38, 54, 0.36);
}

body.studio-page[data-interface-theme="light"] .stock-tray-panel {
  background: linear-gradient(180deg, #ffffff, #edf2f8);
  border-color: rgba(104, 118, 138, 0.26);
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .stock-tray-header span,
body.studio-page[data-interface-theme="light"] .stock-tray-copy small {
  color: rgba(23, 32, 48, 0.62);
}

body.studio-page[data-interface-theme="light"] .stock-tray-item {
  background: rgba(23, 32, 48, 0.045);
  border-color: rgba(104, 118, 138, 0.18);
}

body.studio-page[data-interface-theme="light"] .stock-tray-item.is-selected {
  background: rgba(82, 168, 35, 0.12);
  border-color: rgba(82, 168, 35, 0.74);
}

body.studio-page[data-interface-theme="light"] .stock-tray-header button,
body.studio-page[data-interface-theme="light"] .stock-tray-actions button {
  background: rgba(23, 32, 48, 0.06);
  border-color: rgba(104, 118, 138, 0.18);
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .stock-tray-filters button {
  color: rgba(23, 32, 48, 0.64);
}

body.studio-page[data-interface-theme="light"] .stock-tray-filters button.is-active {
  background: rgba(82, 168, 35, 0.14);
  border-color: rgba(82, 168, 35, 0.64);
  color: #316d15;
}

body.studio-page[data-interface-theme="light"] .stock-tray-search {
  background: rgba(23, 32, 48, 0.045);
  border-color: rgba(104, 118, 138, 0.18);
}

body.studio-page[data-interface-theme="light"] .stock-tray-search span,
body.studio-page[data-interface-theme="light"] .stock-tray-copy em {
  color: rgba(23, 32, 48, 0.54);
}

body.studio-page[data-interface-theme="light"] .stock-tray-search input {
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .stock-tray-actions [data-stock-selected-count] {
  color: rgba(23, 32, 48, 0.62);
}

@media (max-width: 720px) {
  .stock-import-tray {
    align-items: stretch;
    padding: 12px;
  }

  .stock-tray-panel {
    max-width: 100%;
    overflow-y: auto;
    width: 100%;
  }

  .stock-tray-header {
    grid-template-columns: 1fr auto;
  }

  .stock-tray-filters,
  .stock-tray-search {
    grid-column: 1 / -1;
  }

  .stock-tray-list {
    flex-direction: column;
    overflow-x: visible;
  }

  .stock-tray-item {
    flex-basis: auto;
  }
}

body.studio-page[data-interface-theme="light"] {
  background:
    linear-gradient(180deg, #eef3f9, #dfe6ef 44%, #cfd8e5);
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .director-shell.retro-director {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(222, 230, 241, 0.96));
  border-color: rgba(105, 119, 140, 0.28);
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .director-menubar {
  background: linear-gradient(180deg, #ffffff, #e3e9f2);
  border-bottom-color: rgba(104, 118, 138, 0.26);
  border-top-color: rgba(255, 255, 255, 0.86);
}

body.studio-page[data-interface-theme="light"] .director-menubar strong,
body.studio-page[data-interface-theme="light"] .director-brand-button {
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .director-brand-button:hover,
body.studio-page[data-interface-theme="light"] .settings-menu.open .director-brand-button {
  color: #3b7b15;
}

body.studio-page[data-interface-theme="light"] .director-menubar span,
body.studio-page[data-interface-theme="light"] .menu-button {
  color: rgba(23, 32, 48, 0.72);
}

body.studio-page[data-interface-theme="light"] .settings-menu-list {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(104, 118, 138, 0.22);
  box-shadow: 0 16px 32px rgba(42, 54, 76, 0.18);
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .settings-menu-list strong {
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .settings-menu-row {
  background: rgba(23, 32, 48, 0.06);
  border-color: rgba(104, 118, 138, 0.16);
}

body.studio-page[data-interface-theme="light"] .settings-menu-row button {
  color: rgba(23, 32, 48, 0.72);
}

body.studio-page[data-interface-theme="light"] .director-window,
body.studio-page[data-interface-theme="light"].studio-entering .tool-palette,
body.studio-page[data-interface-theme="light"].studio-entered .tool-palette {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(225, 233, 244, 0.94));
  border-color: rgba(104, 118, 138, 0.24);
  box-shadow: 0 18px 46px rgba(42, 54, 76, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .window-titlebar {
  background: rgba(23, 32, 48, 0.045);
  border-bottom-color: rgba(104, 118, 138, 0.18);
}

body.studio-page[data-interface-theme="light"] .window-titlebar strong,
body.studio-page[data-interface-theme="light"] .tool-palette .window-titlebar strong {
  color: #172030;
}

body.studio-page[data-interface-theme="light"] .window-titlebar small,
body.studio-page[data-interface-theme="light"] .window-titlebar > span:last-child {
  color: rgba(23, 32, 48, 0.58);
}

body.studio-page[data-interface-theme="light"] .stage-window {
  background: #f8fbff;
  color: rgba(23, 32, 48, 0.74);
}

body.studio-page[data-interface-theme="light"] .stage-ruler {
  color: rgba(23, 32, 48, 0.62);
}

body.studio-page[data-interface-theme="light"] .stage-ruler-x {
  background:
    linear-gradient(180deg, rgba(23, 32, 48, 0.07), rgba(23, 32, 48, 0.02)),
    repeating-linear-gradient(90deg, rgba(56, 70, 92, 0.3) 0 1px, transparent 1px 100px);
  border-bottom-color: rgba(56, 70, 92, 0.18);
}

body.studio-page[data-interface-theme="light"] .stage-ruler-y {
  background:
    linear-gradient(90deg, rgba(23, 32, 48, 0.07), rgba(23, 32, 48, 0.02)),
    repeating-linear-gradient(0deg, rgba(56, 70, 92, 0.3) 0 1px, transparent 1px 100px);
  border-right-color: rgba(56, 70, 92, 0.18);
}

body.studio-page[data-interface-theme="light"] .score-grid,
body.studio-page[data-interface-theme="light"] .score-ruler,
body.studio-page[data-interface-theme="light"] .score-row-label {
  color: #172030;
}

.director-window .resize-handle {
  background: transparent;
  border: 0;
  display: block;
  position: absolute;
  z-index: 28;
}

.director-window.tool-palette .resize-handle {
  display: none;
}

.director-window .resize-n,
.director-window .resize-s {
  cursor: ns-resize;
  height: 10px;
  left: 16px;
  right: 16px;
  width: auto;
}

.director-window .resize-n {
  top: -4px;
}

.director-window .resize-s {
  bottom: 0;
}

.director-window .resize-e,
.director-window .resize-w {
  bottom: 16px;
  cursor: ew-resize;
  height: auto;
  top: 16px;
  width: 10px;
}

.director-window .resize-e {
  right: 0;
}

.director-window .resize-w {
  left: 0;
}

.director-window .resize-ne,
.director-window .resize-se,
.director-window .resize-sw,
.director-window .resize-nw {
  height: 18px;
  width: 18px;
}

.director-window .resize-ne {
  cursor: nesw-resize;
  right: 0;
  top: 0;
}

.director-window .resize-se {
  border-bottom: 2px solid rgba(166, 255, 101, 0.65);
  border-right: 2px solid rgba(166, 255, 101, 0.65);
  bottom: 5px;
  cursor: nwse-resize;
  right: 5px;
}

.director-window .resize-sw {
  bottom: 0;
  cursor: nesw-resize;
  left: 0;
}

.director-window .resize-nw {
  cursor: nwse-resize;
  left: 0;
  top: 0;
}

.studio-entering .director-shell.retro-director,
.studio-entered .director-shell.retro-director {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
}

.studio-entering .director-shell.retro-director:has(.studio-collab-bar.is-hidden),
.studio-entered .director-shell.retro-director:has(.studio-collab-bar.is-hidden) {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.studio-entering .director-workbench,
.studio-entered .director-workbench {
  min-height: 0;
}

.studio-entering .studio-status,
.studio-entered .studio-status {
  align-self: end;
  flex: 0 0 auto;
}

.director-score-window {
  box-sizing: border-box;
  contain: layout paint;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  max-width: 100%;
  min-width: 220px;
  overflow: hidden;
}

.director-score-window.is-docked {
  bottom: auto !important;
  left: 0 !important;
  right: auto !important;
}

.director-score-window .window-titlebar,
.director-score-window .score-grid {
  box-sizing: border-box;
  min-width: 0;
}

/* Engine section CTA (OpenMontage) — added 20260704 */
.engine-cta { margin-top: 2.5rem; display: flex; justify-content: center; }
#engine .work-card h3 { color: rgb(23, 26, 31); }
#engine .work-card p { color: rgb(60, 64, 72); }

/* Engine showcase video (first zero-key piece) — added 20260704 */
.engine-showcase { margin: 2.5rem auto 0; max-width: 900px; }
.engine-showcase video { width: 100%; display: block; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); background: #14110f; }
.engine-showcase figcaption { margin-top: 0.85rem; text-align: center; font-size: 0.9rem; color: rgba(248,247,242,0.66); }

/* Engine CTA -> Studio Live */
.engine-cta { text-align: center; margin-top: 1.1rem; }

/* ============================================================================
 * XPL — Director interactivo (editor de reglas · sprites · modo Play)
 * ========================================================================== */

/* El menú Control se comporta como los demás menús de la barra. */
.control-menu {
  display: inline-flex;
  position: relative;
  z-index: 5010;
}

.control-menu-list {
  background: #f8fafc;
  border: 1px solid #778292;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(17, 21, 27, 0.2);
  display: none;
  gap: 2px;
  left: 0;
  min-width: 190px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 8px);
  z-index: 7000;
}

.control-menu.open .control-menu-list,
.control-menu:hover .control-menu-list,
.control-menu:focus-within .control-menu-list {
  display: grid;
}

.control-menu-list button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #11151b;
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 760;
  padding: 8px 10px;
  text-align: left;
}

.control-menu-list button:hover {
  background: #e3e8f0;
}

.control-menu-list button[aria-pressed="true"] {
  background: #1f6feb;
  color: #fff;
}

/* --- Ventana Behaviour: el editor de reglas ------------------------------- */
.stage-script.xpl-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.78rem;
  overflow: auto;
  padding: 8px;
}

.xpl-tabs {
  align-items: center;
  border-bottom: 1px solid #c3cad6;
  display: flex;
  gap: 4px;
  padding-bottom: 6px;
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 2;
}

.xpl-spacer { flex: 1; }

.xpl-tab {
  background: #e7ebf2;
  border: 1px solid #b6bfcd;
  border-radius: 5px;
  color: #11151b;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 760;
  padding: 4px 9px;
}

.xpl-tab.is-active { background: #11151b; border-color: #11151b; color: #fff; }
.xpl-tab.is-live { background: #d2372b; border-color: #a82a20; color: #fff; }

.xpl-rules { display: grid; gap: 8px; }

.xpl-rule {
  background: #f2f5f9;
  border: 1px solid #c3cad6;
  border-left: 4px solid #1f6feb;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.xpl-rule.is-off { border-left-color: #9aa3b1; opacity: 0.62; }

.xpl-rule-head { align-items: center; display: flex; gap: 6px; }

.xpl-block { display: grid; gap: 4px; }

.xpl-block-head {
  align-items: center;
  color: #485261;
  display: flex;
  gap: 6px;
}

.xpl-block-head b {
  color: #1f6feb;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.xpl-row { align-items: center; display: flex; flex-wrap: wrap; gap: 4px; }

.xpl-select,
.xpl-input,
.xpl-name {
  background: #fff;
  border: 1px solid #b6bfcd;
  border-radius: 4px;
  color: #11151b;
  font: inherit;
  font-size: 0.74rem;
  min-width: 0;
  padding: 3px 5px;
}

.xpl-input { width: 82px; }
.xpl-input.wide { width: 132px; }
.xpl-name { flex: 1; font-weight: 760; }
.xpl-check { accent-color: #1f6feb; }

.xpl-mini {
  background: #e7ebf2;
  border: 1px solid #b6bfcd;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  padding: 3px 6px;
}

.xpl-mini.danger:hover { background: #f6d5d2; border-color: #d2372b; }

.xpl-add {
  background: transparent;
  border: 1px dashed #9aa3b1;
  border-radius: 4px;
  color: #485261;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  justify-self: start;
  padding: 3px 8px;
}

.xpl-add.primary {
  background: #11151b;
  border-style: solid;
  border-color: #11151b;
  color: #fff;
}

.xpl-sentence {
  background: #fff;
  border-radius: 4px;
  color: #2b3340;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7rem;
  margin: 0;
  padding: 5px 7px;
}

.xpl-empty,
.xpl-hint { color: #5a6472; font-size: 0.74rem; margin: 0; }

.xpl-sprites { display: grid; gap: 5px; }
.xpl-sprite-row { background: #f2f5f9; border-radius: 5px; padding: 4px 6px; }

.xpl-sprite-label {
  flex: 1;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xpl-sprite-type { color: #6b7583; font-size: 0.68rem; }

/* Un sprite interactivo se nota: es un hotspot, no decorado. */
body.xpl-live .stage-imported-member[data-xpl-hot],
body.xpl-live .stage-item[data-xpl-hot] { cursor: pointer; }

.xpl-hidden { display: none !important; }

/* --- A5 · MODO PLAY: el proyector ---------------------------------------- */
/* Misma página, otra clase en el body — sin recarga, patrón portería. */
body.ain-play { background: #000; margin: 0; overflow: hidden; }

body.ain-play .site-header,
body.ain-play .site-footer,
body.ain-play .studio-hero,
body.ain-play .studio-story-section,
body.ain-play .studio-features,
body.ain-play .workspace-heading,
body.ain-play .studio-boot,
body.ain-play .studio-collab-bar,
body.ain-play .director-menubar,
body.ain-play .studio-status,
body.ain-play .window-taskbar,
body.ain-play .stage-ruler,
body.ain-play .stage-ruler-toggle,
body.ain-play .stage-title-actions,
body.ain-play .window-titlebar,
body.ain-play .resize-handle,
body.ain-play .stage-grid,
body.ain-play .stage-imported-member figcaption,
body.ain-play .stage-member-resize,
body.ain-play .stage-shape-resize,
body.ain-play .stage-text-remove,
body.ain-play .director-window:not(.director-stage-window) { display: none !important; }

/* Nada de marcos ni selección: en el proyector no hay nada que seleccionar. */
body.ain-play .stage-imported-member,
body.ain-play .stage-item {
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

body.ain-play .stage-imported-member.is-selected,
body.ain-play .stage-item.is-selected { outline: 0 !important; }

body.ain-play main,
body.ain-play .studio-workspace,
body.ain-play .studio-section { margin: 0 !important; padding: 0 !important; }

body.ain-play .director-shell {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.ain-play .director-workbench {
  background: #000 !important;
  display: block !important;
  height: 100vh !important;
  padding: 0 !important;
}

body.ain-play .director-stage-window {
  background: #000 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 100vh !important;
  inset: 0 !important;
  position: fixed !important;
  transform: none !important;
  width: 100vw !important;
  z-index: 99999 !important;
}

body.ain-play .stage-window {
  background: #000 !important;
  height: 100vh !important;
  padding: 0 !important;
  width: 100vw !important;
}

/* Cursor de kiosko: el dedo solo aparece sobre lo que responde. */
body.ain-play,
body.ain-play .stage-canvas { cursor: default; }
body.ain-play .stage-imported-member,
body.ain-play .stage-item { cursor: default; user-select: none; }
body.ain-play [data-xpl-hot] { cursor: pointer !important; }

/* ── Menú de propiedades (botón derecho sobre un miembro del Stage) ──────────
   Escribe en el fotograma donde está el cabezal: cambiar un valor aquí y en
   otro fotograma deja la animación hecha entre los dos. */
.stage-properties-menu {
  background: #101827;
  border: 1px solid rgba(255, 230, 92, 0.55);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  color: #edf6ff;
  font-size: 0.72rem;
  min-width: 232px;
  padding: 10px 12px 12px;
  position: fixed;
  z-index: 999;
}

.stage-properties-title {
  align-items: baseline;
  display: flex;
  font-weight: 850;
  gap: 8px;
  justify-content: space-between;
  margin: 0 0 8px;
}

.stage-properties-title small {
  color: rgba(237, 246, 255, 0.6);
  font-weight: 650;
}

.stage-properties-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) 40px;
}

.stage-properties-row input[type="range"] {
  accent-color: #ffe65c;
  width: 100%;
}

.stage-properties-row output {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stage-properties-hint {
  color: rgba(237, 246, 255, 0.55);
  margin: 8px 0 0;
}

.stage-properties-action {
  background: rgba(255, 230, 92, 0.14);
  border: 1px solid rgba(255, 230, 92, 0.55);
  border-radius: 6px;
  color: #ffe65c;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 6px 10px;
  width: 100%;
}

.stage-properties-action:hover:not(:disabled),
.stage-properties-action:focus-visible:not(:disabled) {
  background: #ffe65c;
  color: #101827;
  outline: 0;
}

.stage-properties-action:disabled {
  cursor: default;
  opacity: 0.45;
}

.stage-properties-row-wide {
  grid-template-columns: auto minmax(0, 1fr);
}

.stage-properties-row select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(220, 239, 255, 0.24);
  border-radius: 6px;
  color: #edf6ff;
  font: inherit;
  padding: 4px 6px;
  width: 100%;
}

.stage-properties-list {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 0;
}

.stage-properties-list li {
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.stage-properties-list button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(220, 239, 255, 0.18);
  border-radius: 6px;
  color: #edf6ff;
  cursor: pointer;
  font: inherit;
  overflow: hidden;
  padding: 5px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-properties-list button:hover,
.stage-properties-list button:focus-visible {
  border-color: rgba(255, 230, 92, 0.75);
  outline: 0;
}

.stage-properties-remove {
  color: rgba(237, 246, 255, 0.6) !important;
  text-align: center !important;
}

.stage-properties-remove:hover {
  background: rgba(255, 106, 106, 0.22) !important;
  border-color: rgba(255, 106, 106, 0.7) !important;
  color: #fff !important;
}
