/*
 * BEITA Production UI System v2
 *
 * This is the semantic contract for production workspaces. Legacy pages may
 * keep their historical selectors, but assets and storyboards consume only
 * these tokens for theme, hierarchy, focus, and state. The canonical theme
 * source is body[data-theme].
 */

:root {
  --ui-canvas: #050b13;
  --ui-canvas-raised: #07111d;
  --ui-surface: rgba(9, 21, 34, 0.97);
  --ui-surface-raised: rgba(13, 29, 43, 0.98);
  --ui-surface-soft: rgba(93, 157, 187, 0.075);
  --ui-surface-hover: rgba(73, 187, 233, 0.115);
  --ui-border: rgba(105, 159, 185, 0.18);
  --ui-border-strong: rgba(57, 201, 255, 0.42);
  --ui-text: #d9e7f1;
  --ui-text-strong: #f2f8fc;
  --ui-text-muted: #8195a5;
  --ui-text-faint: #5c7181;
  --ui-accent: #39c9ff;
  --ui-accent-strong: #62d5ff;
  --ui-accent-soft: rgba(57, 201, 255, 0.13);
  --ui-info: #39c9ff;
  --ui-info-soft: rgba(57, 201, 255, 0.11);
  --ui-success: #4fc9a3;
  --ui-warning: #e8b56a;
  --ui-danger: #eb8798;
  --ui-focus: rgba(57, 201, 255, 0.72);
  --ui-radius-xs: 6px;
  --ui-radius-sm: 8px;
  --ui-radius-md: 12px;
  --ui-radius-lg: 16px;
  --ui-shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.16);
  --ui-shadow-md: 0 18px 46px rgba(0, 0, 0, 0.24);
  --ui-duration-fast: 140ms;
  --ui-duration-normal: 200ms;
  --ui-nav-width: 232px;
  --ui-topbar-height: 72px;
  --ui-content-max: 1760px;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-8: 32px;
  --ui-type-caption: 11px;
  --ui-type-label: 12px;
  --ui-type-control: 14px;
  --ui-type-navigation: 15px;
}

body[data-theme="light"] {
  --ui-canvas: #edf4f8;
  --ui-canvas-raised: #f7fbfd;
  --ui-surface: rgba(255, 255, 255, 0.98);
  --ui-surface-raised: #ffffff;
  --ui-surface-soft: rgba(58, 114, 140, 0.055);
  --ui-surface-hover: rgba(5, 141, 202, 0.075);
  --ui-border: rgba(62, 111, 135, 0.16);
  --ui-border-strong: rgba(5, 141, 202, 0.34);
  --ui-text: #2b4252;
  --ui-text-strong: #122838;
  --ui-text-muted: #5c7180;
  --ui-text-faint: #8294a0;
  --ui-accent: #058dca;
  --ui-accent-strong: #047bb1;
  --ui-accent-soft: rgba(5, 141, 202, 0.09);
  --ui-info: #057fb5;
  --ui-info-soft: rgba(5, 127, 181, 0.08);
  --ui-success: #08765a;
  --ui-warning: #9a5d08;
  --ui-danger: #b4233a;
  --ui-focus: rgba(5, 141, 202, 0.62);
  --ui-shadow-sm: 0 8px 24px rgba(34, 49, 74, 0.075);
  --ui-shadow-md: 0 20px 48px rgba(34, 49, 74, 0.11);
}

body[data-ui-system="production-v2"] :focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}

/* Production workspace foundation. */
body[data-ui-system="production-v2"] .theater-project-detail-page {
  --theater-line: var(--ui-border);
  --theater-line-strong: var(--ui-border-strong);
  --theater-text: var(--ui-text);
  --theater-text-strong: var(--ui-text-strong);
  --theater-text-soft: var(--ui-text-muted);
  --theater-control-bg: var(--ui-surface-soft);
  --theater-control-hover-bg: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .theater-project-detail-page :is(
  .asset-workbench,
  .asset-storyboard-workbench
) {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-md);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-toolbar {
  border-bottom-color: var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface-raised) 94%, transparent);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-type-tabs button {
  border-color: transparent;
  color: var(--ui-text-muted);
  background: transparent;
  transition:
    color var(--ui-duration-fast) ease,
    border-color var(--ui-duration-fast) ease,
    background var(--ui-duration-fast) ease,
    transform var(--ui-duration-fast) ease;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-type-tabs button:hover {
  color: var(--ui-text-strong);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-type-tabs button.active,
body[data-ui-system="production-v2"] .theater-project-detail-page .asset-type-tabs button[aria-selected="true"] {
  border-color: var(--ui-border-strong);
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
  box-shadow: none;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-type-tabs button b {
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-type-tabs button.active b {
  color: var(--ui-accent-strong);
  background: color-mix(in srgb, var(--ui-accent-soft) 76%, var(--ui-surface-raised));
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-tools :is(
  .asset-create,
  .asset-extract,
  .asset-batch-menu > summary
) {
  min-height: 38px;
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  box-shadow: none;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-tools .asset-extract {
  border-color: var(--ui-border-strong);
  color: var(--ui-text-strong);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-table,
body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-list {
  color: var(--ui-text);
  background: var(--ui-canvas-raised);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-list {
  padding: 20px 22px 40px;
  scrollbar-color: color-mix(in srgb, var(--ui-text-faint) 34%, transparent) transparent;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .standard-asset-grid {
  grid-template-columns:
    minmax(170px, 0.72fr)
    96px
    minmax(250px, 1fr)
    minmax(310px, 1.24fr)
    minmax(90px, 0.36fr)
    0;
  column-gap: 16px;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-head {
  margin-bottom: 14px;
  padding: 12px 22px;
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text-muted);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-head span {
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-card {
  margin-bottom: 16px;
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-sm);
  transition:
    border-color var(--ui-duration-normal) ease,
    box-shadow var(--ui-duration-normal) ease,
    transform var(--ui-duration-normal) ease;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--ui-accent), var(--ui-info));
  opacity: 0.72;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-card:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-1px);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-row {
  height: 188px;
  min-height: 188px;
  padding: 22px;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-name-editor {
  color: var(--ui-text-strong);
  font-weight: 760;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-meta-editor {
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 3px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
  font-size: 11px;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  align-self: stretch;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  font-size: 13px;
  line-height: 1.68;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor::before {
  content: "内容";
  color: var(--ui-text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor[data-asset-field="setting"]::before {
  content: "资产设定";
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor[data-asset-field="prompt"]::before {
  content: "生成提示词";
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor span {
  max-height: 8.4em;
  color: inherit;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor:hover,
body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor:focus-visible {
  border-color: var(--ui-border-strong);
  color: var(--ui-text-strong);
  background: var(--ui-accent-soft);
  box-shadow: none;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor.active {
  display: block;
  padding: 0;
  border-color: transparent;
  background: transparent;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .asset-copy-editor.active::before {
  display: none;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-preview-cell button {
  border-color: var(--ui-border);
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .episode-multi-select__trigger.asset-episode-editor {
  border-color: var(--ui-border);
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-variant {
  border-top-color: var(--ui-border);
  background: var(--ui-surface-soft);
  box-shadow: inset 3px 0 var(--ui-info);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .role-add-form {
  border-top-color: var(--ui-border);
  color: var(--ui-accent-strong);
  background: var(--ui-surface-soft);
}

/* Storyboard cards share the same hierarchy and state vocabulary. */
body[data-ui-system="production-v2"] .theater-project-detail-page :is(
  .shot-card,
  .seedance-shot-card
) {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-shot-head,
body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-shot-footer,
body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-asset-section {
  border-color: var(--ui-border);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-prompt-shell,
body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-edit-fields {
  color: var(--ui-text);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-prompt-view p {
  color: var(--ui-text);
  line-height: 1.72;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .storyboard-source-anchor {
  border-color: color-mix(in srgb, var(--ui-info) 42%, transparent);
  color: var(--ui-info);
  background: var(--ui-info-soft);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .storyboard-asset-chip {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: var(--ui-surface-soft);
}

/*
 * Asset tables keep every operational column visible at 1440/1280 desktop
 * widths. The legacy role grid had a fixed 1116px minimum inside a 877px
 * workbench and the card's overflow:hidden silently clipped prompt and episode
 * columns. Compact tracks preserve the complete row without horizontal traps.
 */
@media (max-width: 1599px) {
  body[data-ui-system="production-v2"] .theater-project-detail-page .role-asset-grid {
    grid-template-columns:
      minmax(110px, 0.6fr)
      72px
      minmax(118px, 0.7fr)
      minmax(150px, 1fr)
      minmax(180px, 1.2fr)
      minmax(72px, 0.4fr)
      0;
    column-gap: 10px;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .standard-asset-grid {
    grid-template-columns: 150px 84px minmax(220px, 1fr) minmax(260px, 1.12fr) 78px 0;
    column-gap: 12px;
  }
}

/*
 * At the exact 1280 desktop baseline the project rail and script source remain
 * visible, but the legacy 380px script pane left the shot title only 5px wide.
 * Rebalance the two work panes and let the title/tool row wrap before text is
 * crushed. Mobile keeps its independent stacked contract below 900px.
 */
@media (min-width: 900px) and (max-width: 1365px) {
  body[data-ui-system="production-v2"] .theater-project-detail-page .script-sidebar:not(.collapsed) {
    width: 300px;
    flex-basis: 300px;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-shot-card {
    padding: 20px;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .seedance-shot-card .shot-card-main {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 18px;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .shot-card-head {
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .shot-card-head h4 {
    flex: 1 1 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-system="production-v2"] .theater-project-detail-page *,
  body[data-ui-system="production-v2"] .theater-project-detail-page *::before,
  body[data-ui-system="production-v2"] .theater-project-detail-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*
 * BEITA Production Shell v1
 *
 * One document scroll owns the page. Navigation is a reusable application
 * landmark, command controls remain in normal flow, and project cards expose
 * real actions without relying on hover.
 */
body[data-ui-system="production-v2"] .ui-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

body[data-ui-system="production-v2"] .ui-skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text-strong);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

body[data-ui-system="production-v2"] .ui-skip-link:focus {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body[data-ui-system="production-v2"] .beta-theater-project-page {
  --theater-bg: var(--ui-canvas);
  --theater-bg-deep: var(--ui-canvas);
  --theater-line: var(--ui-border);
  --theater-line-strong: var(--ui-border-strong);
  --theater-text: var(--ui-text);
  --theater-text-strong: var(--ui-text-strong);
  --theater-text-soft: var(--ui-text-muted);
  --theater-accent: var(--ui-accent);
  --theater-accent-soft: var(--ui-accent-soft);
  --theater-danger: var(--ui-danger);
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--ui-nav-width) minmax(0, 1fr);
  align-items: start;
  overflow: visible;
  color: var(--ui-text);
  background:
    linear-gradient(rgba(119, 143, 177, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 143, 177, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 44% 0%, rgba(75, 135, 177, 0.1), transparent 34%),
    var(--ui-canvas);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

body[data-ui-system="production-v2"] .beta-theater-project-page::before,
body[data-ui-system="production-v2"] .beta-theater-project-page::after {
  content: none;
}

body[data-ui-system="production-v2"] .production-global-nav {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  width: var(--ui-nav-width);
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-6);
  box-sizing: border-box;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-canvas-raised) 96%, transparent);
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.08);
}

body[data-ui-system="production-v2"] .production-global-brand {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--ui-radius-md);
  color: var(--ui-text-strong);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

body[data-ui-system="production-v2"] .production-global-brand:hover {
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .production-global-brand .theater-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
}

body[data-ui-system="production-v2"] .beita-mark {
  --beita-mark-shell: #071522;
  --beita-mark-line: #dff8ff;
  --beita-mark-accent: #45d4ff;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 8px 16px rgba(22, 177, 236, 0.2));
}

body[data-ui-system="production-v2"] .beita-mark-shell {
  fill: var(--beita-mark-shell);
  stroke: var(--beita-mark-accent);
  stroke-width: 2;
}

body[data-ui-system="production-v2"] .beita-mark-spine,
body[data-ui-system="production-v2"] .beita-mark-frame {
  fill: none;
  stroke: var(--beita-mark-line);
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-ui-system="production-v2"] .beita-mark-spine {
  stroke: var(--beita-mark-accent);
  stroke-width: 3.3;
}

body[data-ui-system="production-v2"] .beita-mark-frame {
  stroke-width: 2.6;
}

body[data-ui-system="production-v2"] .beita-mark-play {
  fill: var(--beita-mark-accent);
}

body[data-ui-system="production-v2"] .beita-mark-signal {
  fill: #7cffb2;
}

body[data-theme="light"][data-ui-system="production-v2"] .beita-mark {
  --beita-mark-shell: #f6fcff;
  --beita-mark-line: #16425d;
  --beita-mark-accent: #058dca;
  filter: drop-shadow(0 7px 14px rgba(5, 141, 202, 0.16));
}

body[data-ui-system="production-v2"] :is(
  .beita-brand-crop,
  .beita-login-stage-mark,
  .theater-brand-mark
) > .beita-mark {
  width: 100%;
  height: 100%;
}

body[data-ui-system="production-v2"] .beita-login-hero-mark {
  width: clamp(112px, 12vw, 176px);
  height: clamp(112px, 12vw, 176px);
}

body[data-ui-system="production-v2"] .beita-password-mark {
  width: 92px;
  height: 92px;
}

body[data-ui-system="production-v2"] .production-global-brand-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

body[data-ui-system="production-v2"] .production-global-brand-copy strong {
  color: var(--ui-text-strong);
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

body[data-ui-system="production-v2"] .production-global-brand-copy small {
  color: var(--ui-accent-strong);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.2em;
}

body[data-ui-system="production-v2"] .production-global-nav-groups {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-border-strong) transparent;
}

body[data-ui-system="production-v2"] .production-global-nav-group {
  min-width: 0;
}

body[data-ui-system="production-v2"] .production-global-nav-group > p {
  margin: 0 10px 8px;
  color: var(--ui-text-faint);
  font-size: var(--ui-type-caption);
  font-weight: 800;
  letter-spacing: 0.14em;
}

body[data-ui-system="production-v2"] .production-global-nav-group > div {
  display: grid;
  gap: 4px;
}

body[data-ui-system="production-v2"] .production-global-nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ui-text-muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color var(--ui-duration-fast) ease,
    border-color var(--ui-duration-fast) ease,
    background var(--ui-duration-fast) ease;
}

body[data-ui-system="production-v2"] .production-global-nav-item > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ui-text-faint);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .production-global-nav-item svg {
  width: 17px;
  height: 17px;
}

body[data-ui-system="production-v2"] .production-global-nav-item strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--ui-type-navigation);
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-system="production-v2"] .production-global-nav-item:hover {
  color: var(--ui-text-strong);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .production-global-nav-item.active {
  border-color: color-mix(in srgb, var(--ui-info) 32%, var(--ui-border));
  color: var(--ui-text-strong);
  background: color-mix(in srgb, var(--ui-info-soft) 82%, var(--ui-surface));
  box-shadow: inset 3px 0 var(--ui-info);
}

body[data-ui-system="production-v2"] .production-global-nav-item.active > span {
  color: var(--ui-info);
  background: var(--ui-info-soft);
}

body[data-ui-system="production-v2"] .production-global-nav-root {
  min-height: 46px;
}

body[data-ui-system="production-v2"] .production-global-nav-directory {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .production-global-nav-folder {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ui-text);
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition:
    color var(--ui-duration-fast) ease,
    background var(--ui-duration-fast) ease;
}

body[data-ui-system="production-v2"] .production-global-nav-folder:hover {
  color: var(--ui-text-strong);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .production-global-nav-folder.production-global-nav-planned {
  cursor: default;
}

body[data-ui-system="production-v2"] .production-global-nav-folder > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .production-global-nav-folder svg {
  width: 17px;
  height: 17px;
}

body[data-ui-system="production-v2"] .production-global-nav-folder > strong {
  min-width: 0;
  font-size: var(--ui-type-navigation);
  font-weight: 720;
  line-height: 1.25;
}

body[data-ui-system="production-v2"] .production-global-nav-directory.active > .production-global-nav-folder {
  color: var(--ui-text-strong);
}

body[data-ui-system="production-v2"] .production-global-nav-children {
  margin: -1px 0 2px 23px;
  padding-left: 10px;
  border-left: 1px solid var(--ui-border);
  display: grid;
  gap: 3px;
}

@media (min-width: 900px) {
  body[data-ui-system="production-v2"] .production-global-nav-children.is-collapsed {
    display: none;
  }
}

body[data-ui-system="production-v2"] .production-global-nav-children .production-global-nav-item {
  min-height: 38px;
  grid-template-columns: 24px minmax(0, 1fr);
  padding-block: 4px;
}

body[data-ui-system="production-v2"] .production-global-nav-children .production-global-nav-item > span {
  width: 24px;
  height: 24px;
  background: transparent;
}

body[data-ui-system="production-v2"] .production-global-nav-children .production-global-nav-item strong {
  font-size: var(--ui-type-control);
  font-weight: 620;
}

body[data-ui-system="production-v2"] .production-global-nav-planned {
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .production-global-nav-planned small {
  padding: 2px 6px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--ui-text-faint);
  font-size: 10px;
  font-weight: 700;
}

body[data-ui-system="production-v2"] .production-global-nav-foot {
  margin-top: auto;
  flex: 0 0 auto;
  padding: 12px 0 0;
  border-top: 1px solid var(--ui-border);
}

body[data-ui-system="production-v2"] .production-global-nav-theme {
  margin-bottom: 9px;
  padding: 5px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .production-global-nav-theme .theater-theme-segment {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

body[data-ui-system="production-v2"] .production-global-nav-theme .theater-theme-segment > button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ui-text-faint);
  font-size: var(--ui-type-label);
  font-weight: 750;
  background: transparent;
  cursor: pointer;
}

body[data-ui-system="production-v2"] .production-global-nav-theme .theater-theme-segment > button:hover {
  color: var(--ui-text);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .production-global-nav-theme .theater-theme-segment > button.active {
  border-color: var(--ui-border-strong);
  color: var(--ui-text-strong);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .production-global-nav-theme .theme-icon,
body[data-ui-system="production-v2"] .production-global-nav-theme .theme-icon svg {
  width: 15px;
  height: 15px;
}

body[data-ui-system="production-v2"] .production-global-nav-theme .theme-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

body[data-ui-system="production-v2"] .production-account-trigger {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ui-text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

body[data-ui-system="production-v2"] .production-account-trigger:hover {
  border-color: var(--ui-border);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .production-account-trigger .team-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

body[data-ui-system="production-v2"] .production-account-trigger > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body[data-ui-system="production-v2"] .production-account-trigger strong,
body[data-ui-system="production-v2"] .production-account-trigger small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-system="production-v2"] .production-account-trigger strong {
  color: var(--ui-text-strong);
  font-size: 13px;
}

body[data-ui-system="production-v2"] .production-account-trigger small {
  color: var(--ui-text-faint);
  font-size: 11px;
}

body[data-ui-system="production-v2"] .production-account-trigger > svg {
  width: 15px;
  color: var(--ui-text-faint);
  transform: rotate(-90deg);
}

body[data-ui-system="production-v2"] .production-shell-workspace {
  position: relative;
  z-index: 1;
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

body[data-ui-system="production-v2"] .production-account-backdrop {
  position: fixed;
  z-index: 260;
  inset: 0;
  background: rgba(1, 7, 13, 0.34);
  backdrop-filter: blur(3px);
}

body[data-ui-system="production-v2"] .production-account-panel {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--ui-border-strong);
  border-radius: 18px;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 12% 0%, var(--ui-accent-soft), transparent 42%),
    color-mix(in srgb, var(--ui-surface-raised) 98%, transparent);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

body[data-ui-system="production-v2"] .production-account-panel > header {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 11px;
  padding: 15px;
  border-bottom: 1px solid var(--ui-border);
}

body[data-ui-system="production-v2"] .production-account-panel > header .team-avatar {
  width: 42px;
  height: 42px;
}

body[data-ui-system="production-v2"] .production-account-panel > header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .production-account-panel > header strong {
  color: var(--ui-text-strong);
  font-size: 16px;
}

body[data-ui-system="production-v2"] .production-account-panel > header small {
  overflow: hidden;
  color: var(--ui-text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-system="production-v2"] .production-account-panel > header button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
  cursor: pointer;
}

body[data-ui-system="production-v2"] .production-account-panel > header button svg {
  width: 16px;
}

body[data-ui-system="production-v2"] .production-account-team {
  margin: 14px 14px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 13px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .production-account-team small {
  grid-column: 1 / -1;
  color: var(--ui-text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

body[data-ui-system="production-v2"] .production-account-team strong {
  color: var(--ui-text-strong);
  font-size: 14px;
}

body[data-ui-system="production-v2"] .production-account-team span {
  color: var(--ui-accent-strong);
  font-size: 11px;
}

body[data-ui-system="production-v2"] .production-account-theme {
  margin: 0 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ui-text-muted);
  font-size: 12px;
}

body[data-ui-system="production-v2"] .production-account-panel > nav {
  display: grid;
  gap: 4px;
  padding: 4px 10px 12px;
}

body[data-ui-system="production-v2"] .production-account-panel > nav > button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ui-text-muted);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

body[data-ui-system="production-v2"] .production-account-panel > nav > button:hover {
  border-color: var(--ui-border);
  color: var(--ui-text-strong);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .production-account-panel > nav > button > svg:first-child {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 9px;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .production-account-panel > nav > button > svg:last-child {
  width: 14px;
}

body[data-ui-system="production-v2"] .production-account-panel > nav > button > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body[data-ui-system="production-v2"] .production-account-panel > nav strong {
  color: var(--ui-text-strong);
  font-size: 13px;
}

body[data-ui-system="production-v2"] .production-account-panel > nav small {
  color: var(--ui-text-faint);
  font-size: 11px;
}

body[data-ui-system="production-v2"] .production-account-panel > nav > button.is-danger > svg:first-child,
body[data-ui-system="production-v2"] .production-account-panel > nav > button.is-danger strong {
  color: var(--ui-danger);
}

body[data-ui-system="production-v2"] .account-password-fields {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

body[data-ui-system="production-v2"] .account-password-fields label {
  display: grid;
  gap: 7px;
  color: var(--ui-text-muted);
  font-size: 12px;
}

body[data-ui-system="production-v2"] .account-password-fields input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  color: var(--ui-text-strong);
  background: var(--ui-surface-soft);
  outline: 0;
}

body[data-ui-system="production-v2"] .account-password-fields input:focus {
  border-color: var(--ui-border-strong);
}

body[data-ui-system="production-v2"] .account-password-visibility {
  margin-top: 10px;
  border: 0;
  color: var(--ui-accent);
  background: transparent;
  cursor: pointer;
}

body[data-ui-system="production-v2"] .account-password-error {
  color: var(--ui-danger);
  font-size: 12px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .beta-production-topbar {
  position: sticky;
  z-index: 9;
  top: 0;
  width: 100%;
  height: var(--ui-topbar-height);
  min-height: var(--ui-topbar-height);
  flex: 0 0 var(--ui-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-sizing: border-box;
  padding: 14px clamp(20px, 2.4vw, 40px);
  border-bottom: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-canvas) 91%, transparent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
}

body[data-ui-system="production-v2"] .production-topbar-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .production-topbar-title > span {
  color: var(--ui-text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

body[data-ui-system="production-v2"] .production-topbar-title h1 {
  margin: 0;
  color: var(--ui-text-strong);
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

body[data-ui-system="production-v2"] .beta-theater-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .theater-project-container {
  width: min(100%, var(--ui-content-max));
  min-width: 0;
  min-height: calc(100vh - var(--ui-topbar-height));
  box-sizing: border-box;
  margin: 0 auto;
  padding: clamp(24px, 2.5vw, 40px);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .project-view-content {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
}

body[data-ui-system="production-v2"] .project-directory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

body[data-ui-system="production-v2"] .project-directory-heading > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body[data-ui-system="production-v2"] .project-directory-heading > div > span {
  color: var(--ui-info);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

body[data-ui-system="production-v2"] .project-directory-heading h2 {
  margin: 0;
  color: var(--ui-text-strong);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 780;
  letter-spacing: -0.035em;
}

body[data-ui-system="production-v2"] .project-directory-heading p {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 13px;
}

body[data-ui-system="production-v2"] .project-directory-primary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text-strong);
  background: var(--ui-accent-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .project-directory-primary:hover {
  border-color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent-soft) 74%, var(--ui-surface-hover));
}

body[data-ui-system="production-v2"] .project-directory-primary svg {
  width: 17px;
  height: 17px;
}

body[data-ui-system="production-v2"] .project-directory-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 8px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--ui-surface) 90%, transparent);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .project-directory-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

body[data-ui-system="production-v2"] .project-directory-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ui-text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-ui-system="production-v2"] .project-directory-tabs button:hover {
  color: var(--ui-text-strong);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .project-directory-tabs button.active {
  border-color: var(--ui-border-strong);
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .project-directory-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body[data-ui-system="production-v2"] .project-directory-search {
  position: relative;
  min-width: 260px;
  width: min(34vw, 440px);
  height: 38px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 34px 58px;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  color: var(--ui-text-muted);
  background: var(--ui-canvas-raised);
}

body[data-ui-system="production-v2"] .project-directory-search:focus-within {
  border-color: var(--ui-border-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-focus) 20%, transparent);
}

body[data-ui-system="production-v2"] .project-directory-search-icon {
  display: grid;
  place-items: center;
}

body[data-ui-system="production-v2"] .project-directory-search-icon svg {
  width: 16px;
  height: 16px;
}

body[data-ui-system="production-v2"] .project-directory-search .floating-search-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px 0 0;
  border: 0;
  outline: 0;
  color: var(--ui-text-strong);
  background: transparent;
  font-size: 13px;
  opacity: 1;
  visibility: visible;
}

body[data-ui-system="production-v2"] .project-directory-search .floating-search-input::placeholder {
  color: var(--ui-text-faint);
}

body[data-ui-system="production-v2"] .project-directory-search-clear,
body[data-ui-system="production-v2"] .project-directory-search-submit,
body[data-ui-system="production-v2"] .project-directory-trash {
  border: 0;
  color: var(--ui-text-muted);
  background: transparent;
  cursor: pointer;
}

body[data-ui-system="production-v2"] .project-directory-search-clear {
  width: 34px;
  height: 36px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

body[data-ui-system="production-v2"] .project-directory-search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}

body[data-ui-system="production-v2"] .project-directory-search-clear svg {
  width: 15px;
  height: 15px;
}

body[data-ui-system="production-v2"] .project-directory-search-submit {
  height: 30px;
  margin-right: 4px;
  border-radius: 7px;
  color: var(--ui-info);
  font-size: 12px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .project-directory-search-submit:hover {
  color: var(--ui-text-strong);
  background: var(--ui-info-soft);
}

body[data-ui-system="production-v2"] .project-directory-trash {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-ui-system="production-v2"] .project-directory-trash:hover,
body[data-ui-system="production-v2"] .project-directory-trash.active {
  border-color: color-mix(in srgb, var(--ui-danger) 38%, var(--ui-border));
  color: var(--ui-danger);
  background: color-mix(in srgb, var(--ui-danger) 9%, transparent);
}

body[data-ui-system="production-v2"] .project-directory-trash svg {
  width: 15px;
  height: 15px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .theater-production-filter-row {
  display: flex;
  justify-content: flex-start;
  margin: -6px 0 18px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .theater-production-filter {
  border-color: var(--ui-border);
  background: var(--ui-surface);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .theater-production-filter button {
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .theater-production-filter button.active {
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
  box-shadow: none;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .create-card,
body[data-ui-system="production-v2"] .beta-theater-project-page .theater-project-card.script-card,
body[data-ui-system="production-v2"] .beta-theater-project-page .theater-empty-card.script-card {
  height: 252px;
  min-height: 252px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .create-card {
  background:
    linear-gradient(145deg, var(--ui-info-soft), transparent 58%),
    var(--ui-surface);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .create-card:hover,
body[data-ui-system="production-v2"] .beta-theater-project-page .create-card:focus-visible {
  border-color: var(--ui-border-strong);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--ui-info-soft) 84%, var(--ui-surface-hover)), transparent 58%),
    var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-2px);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .create-emblem {
  border-color: var(--ui-border-strong);
  color: var(--ui-info);
  background: var(--ui-info-soft);
  box-shadow: none;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .theater-project-card.script-card {
  background:
    linear-gradient(145deg, var(--project-card-start, #20283d), var(--project-card-end, #15192a));
  transition:
    transform var(--ui-duration-normal) ease,
    border-color var(--ui-duration-normal) ease,
    box-shadow var(--ui-duration-normal) ease;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .theater-project-card:hover {
  border-color: var(--project-card-accent-soft, var(--ui-border-strong));
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-2px);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .card-action-stack {
  top: 14px;
  right: 14px;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.34);
  opacity: 1;
  transform: none;
  backdrop-filter: blur(10px);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .card-action-btn {
  width: 30px;
  height: 30px;
  color: rgba(205, 214, 227, 0.72);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .script-card-body {
  padding: 24px 24px 12px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .quote-mark {
  margin-bottom: 6px;
  font-size: 44px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .script-card-body h3 {
  max-width: calc(100% - 72px);
  font-size: 21px;
  font-weight: 680;
  line-height: 1.42;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .status-pill {
  width: fit-content;
  margin: 0 0 8px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 24%, transparent);
  border-radius: 999px;
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
  font-size: 10px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .status-pill.success {
  border-color: color-mix(in srgb, var(--ui-success) 28%, transparent);
  color: var(--ui-success);
  background: color-mix(in srgb, var(--ui-success) 10%, transparent);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .script-card-footer {
  min-height: 72px;
  gap: 12px;
  box-sizing: border-box;
  padding: 14px 18px;
  border-top-color: rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.14);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .script-owner {
  min-width: 0;
  max-width: 42%;
  align-items: center;
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .project-producer-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .project-producer-copy small {
  color: var(--ui-text-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .owner-name {
  max-width: 140px;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 650;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .project-meta {
  max-width: none;
  align-items: flex-start;
  gap: 12px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .meta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .meta-value {
  max-width: 96px;
  color: var(--ui-text-strong);
  font-size: 13px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .meta-copy {
  color: var(--ui-text-faint);
  font-size: 10px;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .pagination-shell {
  position: relative;
  inset: auto;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin: 28px 0 0;
  pointer-events: auto;
}

body[data-ui-system="production-v2"] .beta-theater-project-page .pagination-actions {
  border-color: var(--ui-border);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: none;
}

body[data-ui-system="production-v2"] .beta-theater-project-page :is(.ghost-btn, .page-number-btn) {
  min-height: 32px;
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .beta-theater-project-page .page-number-btn.active {
  border-color: var(--ui-border-strong);
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
  box-shadow: none;
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-theater-project-page {
  background:
    linear-gradient(rgba(71, 85, 105, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 85, 105, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 44% 0%, rgba(79, 70, 229, 0.07), transparent 34%),
    var(--ui-canvas);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

body[data-theme="light"][data-ui-system="production-v2"] .production-global-nav,
body[data-theme="light"][data-ui-system="production-v2"] .beta-theater-project-page .beta-production-topbar {
  background: rgba(255, 255, 255, 0.94);
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-theater-project-page .theater-project-card.script-card {
  color: var(--ui-text);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--project-card-accent, #6d5bd0) 6%, #ffffff), #f8fafc);
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-theater-project-page .script-card-scanline {
  opacity: 0.18;
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-theater-project-page .script-card-footer {
  border-top-color: var(--ui-border);
  background: rgba(241, 245, 249, 0.82);
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-theater-project-page .card-action-stack {
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.84);
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-theater-project-page .card-action-btn {
  color: #64748b;
}

body[data-ui-system="production-v2"] .beta-home-production-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  height: auto;
  display: grid;
  grid-template-columns: var(--ui-nav-width) minmax(0, 1fr);
  align-items: start;
  overflow: visible;
  color: var(--ui-text);
  background:
    linear-gradient(rgba(119, 143, 177, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 143, 177, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 52% 0%, rgba(75, 135, 177, 0.1), transparent 36%),
    var(--ui-canvas);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

body[data-ui-system="production-v2"] .beta-home-production-shell .home-top {
  position: sticky;
  z-index: 9;
  top: 0;
  min-height: var(--ui-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-sizing: border-box;
  padding: 14px clamp(20px, 2.4vw, 40px);
  border-bottom: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-canvas) 91%, transparent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
}

body[data-ui-system="production-v2"] .production-home-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

body[data-ui-system="production-v2"] .beta-home-production-shell .home-main {
  width: min(100%, var(--ui-content-max));
  min-height: calc(100vh - var(--ui-topbar-height));
  box-sizing: border-box;
  margin: 0 auto;
  padding: clamp(24px, 2.5vw, 40px);
  overflow: visible;
}

body[data-ui-system="production-v2"] .beta-home-production-shell .hero-card,
body[data-ui-system="production-v2"] .beta-home-production-shell .home-tool {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .beta-home-production-shell .hero-card:hover,
body[data-ui-system="production-v2"] .beta-home-production-shell .home-tool:hover:not(:disabled) {
  border-color: var(--ui-border-strong);
  box-shadow: var(--ui-shadow-md);
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-home-production-shell {
  background:
    linear-gradient(rgba(71, 85, 105, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 85, 105, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 52% 0%, rgba(79, 70, 229, 0.07), transparent 36%),
    var(--ui-canvas);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

body[data-theme="light"][data-ui-system="production-v2"] .beta-home-production-shell .home-top {
  background: rgba(255, 255, 255, 0.94);
}

body[data-ui-system="production-v2"] .production-home-hero {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: #060d17;
  box-shadow: var(--ui-shadow-md);
  isolation: isolate;
}

body[data-ui-system="production-v2"] .production-home-hero-media {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, #060d17 0%, rgba(6, 13, 23, 0.98) 29%, rgba(6, 13, 23, 0.46) 59%, rgba(6, 13, 23, 0.12) 100%),
    linear-gradient(0deg, rgba(3, 9, 16, 0.88) 0%, transparent 42%),
    url("./assets/storyboard-contact-sheet.png") right center / 62% auto no-repeat;
  filter: saturate(0.9) contrast(1.06);
}

body[data-ui-system="production-v2"] .production-home-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49%, rgba(57, 201, 255, 0.08)),
    radial-gradient(circle at 76% 28%, rgba(57, 201, 255, 0.12), transparent 28%);
  pointer-events: none;
}

body[data-ui-system="production-v2"] .production-home-hero-copy {
  width: min(54%, 720px);
  min-height: 278px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  padding: 42px clamp(28px, 3vw, 54px) 38px;
}

body[data-ui-system="production-v2"] .production-home-hero-copy > span {
  color: var(--ui-accent-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.22em;
}

body[data-ui-system="production-v2"] .production-home-hero-copy h2 {
  margin: 14px 0 12px;
  color: #f3f9fc;
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

body[data-ui-system="production-v2"] .production-home-hero-copy h2 strong {
  color: var(--ui-accent-strong);
  font-weight: 850;
}

body[data-ui-system="production-v2"] .production-home-hero-copy p {
  max-width: 600px;
  margin: 0;
  color: rgba(217, 231, 241, 0.72);
  font-size: 14px;
  line-height: 1.8;
}

body[data-ui-system="production-v2"] .production-home-hero-copy > div {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

body[data-ui-system="production-v2"] :is(.production-home-primary, .production-home-secondary) {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .production-home-primary {
  color: #031019;
  background: var(--ui-accent);
  box-shadow: 0 10px 28px rgba(57, 201, 255, 0.18);
}

body[data-ui-system="production-v2"] .production-home-primary svg {
  width: 15px;
  height: 15px;
}

body[data-ui-system="production-v2"] .production-home-secondary {
  color: #eef8fc;
  background: rgba(5, 14, 24, 0.7);
}

body[data-ui-system="production-v2"] .production-home-flow {
  min-height: 82px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(105, 159, 185, 0.2);
  background: rgba(5, 14, 24, 0.82);
  backdrop-filter: blur(14px);
}

body[data-ui-system="production-v2"] .production-home-flow > span {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: center;
  column-gap: 10px;
}

body[data-ui-system="production-v2"] .production-home-flow > span:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -4px;
  color: rgba(217, 231, 241, 0.26);
  transform: translateY(-50%);
}

body[data-ui-system="production-v2"] .production-home-flow i {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 50%;
  color: var(--ui-accent-strong);
  background: rgba(57, 201, 255, 0.08);
}

body[data-ui-system="production-v2"] .production-home-flow i svg {
  width: 16px;
  height: 16px;
}

body[data-ui-system="production-v2"] .production-home-flow small {
  color: rgba(217, 231, 241, 0.42);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

body[data-ui-system="production-v2"] .production-home-flow b {
  color: #e8f2f8;
  font-size: 12px;
  font-weight: 720;
}

body[data-ui-system="production-v2"] .production-home-section {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .production-home-section-head {
  min-height: 46px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

body[data-ui-system="production-v2"] .production-home-section-head > div > span {
  color: var(--ui-text-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

body[data-ui-system="production-v2"] .production-home-section-head h2 {
  margin: 4px 0 0;
  color: var(--ui-text-strong);
  font-size: 18px;
}

body[data-ui-system="production-v2"] .production-home-section-head > :is(button, small) {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

body[data-ui-system="production-v2"] .production-home-projects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body[data-ui-system="production-v2"] .production-home-project {
  min-height: 168px;
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text);
  background:
    radial-gradient(circle at 92% 0%, rgba(57, 201, 255, 0.1), transparent 34%),
    linear-gradient(145deg, var(--ui-surface-raised), var(--ui-canvas-raised));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  transition: transform var(--ui-duration-normal) ease, border-color var(--ui-duration-normal) ease;
}

body[data-ui-system="production-v2"] .production-home-project:hover {
  border-color: var(--ui-border-strong);
  transform: translateY(-2px);
}

body[data-ui-system="production-v2"] .production-home-project-state {
  padding: 3px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
  font-size: 9px;
}

body[data-ui-system="production-v2"] .production-home-project > strong {
  margin: 18px 0 20px;
  color: var(--ui-text-strong);
  font-size: 17px;
  line-height: 1.35;
}

body[data-ui-system="production-v2"] .production-home-project-meta {
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ui-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body[data-ui-system="production-v2"] .production-home-project-meta > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .production-home-project-meta small {
  color: var(--ui-text-faint);
  font-size: 9px;
}

body[data-ui-system="production-v2"] .production-home-project-meta b {
  overflow: hidden;
  color: var(--ui-text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-system="production-v2"] .production-home-empty {
  min-height: 150px;
  border: 1px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius-md);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--ui-text-muted);
  text-align: center;
}

body[data-ui-system="production-v2"] .production-home-empty strong {
  color: var(--ui-text-strong);
}

body[data-ui-system="production-v2"] .production-home-empty p {
  margin: 0;
  font-size: 12px;
}

body[data-ui-system="production-v2"] .production-home-empty button {
  margin-top: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .production-home-tools {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body[data-ui-system="production-v2"] .production-home-tool {
  min-height: 258px;
  padding: 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  color: var(--ui-text);
  background: var(--ui-surface-raised);
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: transform var(--ui-duration-normal) ease, border-color var(--ui-duration-normal) ease;
}

body[data-ui-system="production-v2"] .production-home-tool:hover {
  border-color: var(--ui-border-strong);
  transform: translateY(-2px);
}

body[data-ui-system="production-v2"] .production-home-tool-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

body[data-ui-system="production-v2"] .production-home-tool-head > i {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 10px;
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .production-home-tool-head > i svg {
  width: 18px;
  height: 18px;
}

body[data-ui-system="production-v2"] .production-home-tool-head > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .production-home-tool-head b {
  color: var(--ui-text-strong);
  font-size: 14px;
}

body[data-ui-system="production-v2"] .production-home-tool-head small {
  color: var(--ui-text-faint);
  font-size: 9px;
}

body[data-ui-system="production-v2"] .production-home-tool > p {
  min-height: 38px;
  margin: 14px 0 12px;
  color: var(--ui-text-muted);
  font-size: 11px;
  line-height: 1.7;
}

body[data-ui-system="production-v2"] .production-home-tool-visual {
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body[data-ui-system="production-v2"] .production-home-tool-visual :is(i, em) {
  color: var(--ui-text-muted);
  font-size: 9px;
  font-style: normal;
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-dual i,
body[data-ui-system="production-v2"] .production-home-tool-visual.is-resolution i,
body[data-ui-system="production-v2"] .production-home-tool-visual.is-assets i {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--ui-surface-raised);
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-dual em {
  width: 20px;
  height: 1px;
  background: var(--ui-accent);
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-poster i {
  width: 48px;
  height: 30px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 4px;
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-poster i + i {
  width: 24px;
  height: 42px;
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-analysis {
  flex-direction: column;
  align-items: stretch;
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-analysis i {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ui-accent) 0 68%, var(--ui-border) 68%);
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-analysis i:nth-child(2) {
  background: linear-gradient(90deg, var(--ui-accent) 0 52%, var(--ui-border) 52%);
}

body[data-ui-system="production-v2"] .production-home-tool-visual.is-analysis i:nth-child(3) {
  background: linear-gradient(90deg, var(--ui-accent) 0 78%, var(--ui-border) 78%);
}

body[data-ui-system="production-v2"] .production-home-tool-link {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ui-border);
  display: flex;
  justify-content: space-between;
  color: var(--ui-text-faint);
  font-size: 10px;
}

body[data-ui-system="production-v2"] .production-home-tool-link b {
  color: var(--ui-accent-strong);
}

body[data-theme="light"][data-ui-system="production-v2"] .production-home-hero {
  background: #07111d;
}

body[data-theme="light"][data-ui-system="production-v2"] .production-home-section {
  background: rgba(255, 255, 255, 0.82);
}

/* Shared cinematic workspace shell for every production route. */
body[data-ui-system="production-v2"] .production-page-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--ui-nav-width) minmax(0, 1fr);
  align-items: start;
  overflow: visible;
  color: var(--ui-text);
  background:
    linear-gradient(rgba(119, 143, 177, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 143, 177, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 48% -8%, rgba(57, 201, 255, 0.095), transparent 34%),
    var(--ui-canvas);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

/*
 * A concrete theater project is a focused production workspace. The global
 * directory rail belongs to the project list, not beside the project's own
 * workflow rail.
 */
body[data-ui-system="production-v2"] .production-page-shell.production-project-focus-shell {
  grid-template-columns: minmax(0, 1fr);
}

body[data-ui-system="production-v2"] .production-project-focus-shell > .production-shell-workspace {
  grid-column: 1;
}

body[data-theme="light"][data-ui-system="production-v2"] .production-page-shell {
  background:
    linear-gradient(rgba(62, 111, 135, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 111, 135, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 48% -8%, rgba(5, 141, 202, 0.075), transparent 34%),
    var(--ui-canvas);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

body[data-ui-system="production-v2"] .production-shared-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  width: 100%;
  height: var(--ui-topbar-height);
  min-height: var(--ui-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-sizing: border-box;
  padding: 12px clamp(20px, 2.4vw, 40px);
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-canvas) 91%, transparent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
}

body[data-theme="light"][data-ui-system="production-v2"] .production-shared-topbar {
  background: rgba(247, 251, 253, 0.94);
}

body[data-ui-system="production-v2"] .production-shared-heading,
body[data-ui-system="production-v2"] .production-shared-actions {
  min-width: 0;
  display: flex;
  align-items: center;
}

body[data-ui-system="production-v2"] .production-shared-heading {
  gap: 12px;
}

body[data-ui-system="production-v2"] .production-shared-actions {
  justify-content: flex-end;
  gap: 10px;
}

body[data-ui-system="production-v2"] .production-project-focus-brand {
  flex: 0 0 auto;
  margin-right: 8px;
}

body[data-ui-system="production-v2"] .production-project-focus-brand .theater-brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

body[data-ui-system="production-v2"] .production-project-focus-topbar .theater-theme-segment {
  flex: 0 0 auto;
}

body[data-ui-system="production-v2"] .production-project-focus-account {
  flex: 0 1 230px;
}

body[data-app-route="theaterProject"][data-ui-system="production-v2"] .production-account-panel {
  inset: calc(var(--ui-topbar-height) + 10px) 14px auto auto;
}

body[data-ui-system="production-v2"] :is(
  .home-top,
  .beta-production-topbar,
  .production-shared-topbar
) .theater-theme-segment button.active {
  border-color: var(--ui-border-strong);
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 16%, transparent);
}

body[data-ui-system="production-v2"] .production-shared-back,
body[data-ui-system="production-v2"] .production-shared-logout {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
  cursor: pointer;
  transition:
    color var(--ui-duration-fast) ease,
    border-color var(--ui-duration-fast) ease,
    background var(--ui-duration-fast) ease;
}

body[data-ui-system="production-v2"] .production-shared-back {
  display: grid;
  place-items: center;
  padding: 0;
}

body[data-ui-system="production-v2"] .production-shared-back svg {
  width: 19px;
  height: 19px;
}

body[data-ui-system="production-v2"] .production-shared-logout {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
}

body[data-ui-system="production-v2"] :is(.production-shared-back, .production-shared-logout):hover {
  border-color: var(--ui-border-strong);
  color: var(--ui-text-strong);
  background: var(--ui-surface-hover);
}

/* Project overview, asset, storyboard and episode stages retain their event DOM. */
body[data-ui-system="production-v2"] .theater-project-detail-page {
  --theater-bg: var(--ui-canvas);
  --theater-bg-deep: var(--ui-canvas);
  --theater-accent: var(--ui-accent);
  --theater-accent-soft: var(--ui-accent-soft);
  --theater-text: var(--ui-text);
  --theater-text-strong: var(--ui-text-strong);
  --theater-text-soft: var(--ui-text-muted);
  height: auto;
  overflow: visible;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .detail-container {
  width: 100%;
  height: calc(100vh - var(--ui-topbar-height));
  min-height: 620px;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  box-sizing: border-box;
  padding: 16px clamp(16px, 2vw, 30px) 24px 16px;
  background: transparent;
}

/*
 * Full-bleed project states do not render the 64px project rail. Keep their
 * single-column contract more specific than the shared project-detail grid;
 * otherwise the whole script importer is squeezed into the rail column and
 * the editor column appears as a page-sized blank panel.
 */
body[data-ui-system="production-v2"] .theater-project-detail-page .detail-container:is(
  .is-script-import,
  .is-empty-project
) {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .project-rail.side-nav,
body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell .project-rail.side-nav {
  border-color: var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface) 94%, transparent);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .project-rail .side-nav-item,
body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell .project-rail .side-nav-item {
  color: var(--ui-text-muted);
  transition:
    color var(--ui-duration-fast) ease,
    border-color var(--ui-duration-fast) ease,
    background var(--ui-duration-fast) ease,
    transform var(--ui-duration-fast) ease;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .project-rail .side-nav-item:hover,
body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell .project-rail .side-nav-item:hover {
  border-color: var(--ui-border);
  color: var(--ui-text-strong);
  background: var(--ui-surface-hover);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .project-rail .side-nav-item.active,
body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell .project-rail .side-nav-item.active {
  border-color: var(--ui-border-strong);
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
  box-shadow: inset 3px 0 var(--ui-accent), var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .project-stage {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background:
    linear-gradient(rgba(99, 144, 167, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 144, 167, 0.05) 1px, transparent 1px),
    var(--ui-canvas-raised);
  background-size: 44px 44px, 44px 44px, auto;
  box-shadow: var(--ui-shadow-md);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .project-stage::before {
  background:
    radial-gradient(circle at 76% 0%, rgba(57, 201, 255, 0.1), transparent 34%),
    radial-gradient(circle at 18% 88%, rgba(57, 201, 255, 0.055), transparent 38%);
}

body[data-theme="light"][data-ui-system="production-v2"] .theater-project-detail-page .project-stage {
  background:
    linear-gradient(rgba(62, 111, 135, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 111, 135, 0.04) 1px, transparent 1px),
    var(--ui-canvas-raised);
  background-size: 44px 44px, 44px 44px, auto;
}

body[data-ui-system="production-v2"] .theater-project-detail-page :is(
  .overview-hero,
  .episode-workspace,
  .episode-editor,
  .episode-list-panel,
  .storyboard-workbench
) {
  color: var(--ui-text);
}

body[data-ui-system="production-v2"] .theater-project-detail-page :is(
  .asset-status-card,
  .pipeline-step,
  .episode-card,
  .episode-editor-card,
  .storyboard-card,
  .storyboard-workbench-toolbar
) {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .empty-script-guide {
  color: var(--ui-text);
  background:
    radial-gradient(circle at 50% 38%, var(--ui-accent-soft), transparent 28%),
    linear-gradient(rgba(99, 144, 167, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 144, 167, 0.045) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}

body[data-ui-system="production-v2"] .theater-project-detail-page .empty-script-copy {
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .theater-project-detail-page .empty-script-action {
  border-color: var(--ui-border-strong);
  color: var(--ui-text-strong);
  background: var(--ui-accent-soft);
  box-shadow: var(--ui-shadow-sm);
}

/* Feature workflows share the same shell while preserving paid-action contracts. */
body[data-ui-system="production-v2"] .feature-production-page {
  --feature-bg: var(--ui-canvas);
  --feature-surface: var(--ui-surface);
  --feature-surface-strong: var(--ui-surface-raised);
  --feature-surface-soft: var(--ui-surface-soft);
  --feature-border: var(--ui-border);
  --feature-border-strong: var(--ui-border-strong);
  --feature-text: var(--ui-text-strong);
  --feature-muted: var(--ui-text-muted);
  --feature-subtle: var(--ui-text-faint);
  --feature-accent: var(--ui-accent);
  --feature-accent-rgb: 57, 201, 255;
  --feature-violet: var(--ui-accent-strong);
  color-scheme: dark;
  background-color: var(--ui-canvas);
}

body[data-theme="light"][data-ui-system="production-v2"] .feature-production-page {
  --feature-accent-rgb: 5, 141, 202;
  color-scheme: light;
  background-color: var(--ui-canvas);
}

body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell {
  width: 100%;
  min-height: calc(100vh - var(--ui-topbar-height));
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  box-sizing: border-box;
  padding: 16px clamp(16px, 2vw, 30px) 40px 16px;
}

body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell-focused {
  grid-template-columns: minmax(0, 1fr);
  padding-left: clamp(16px, 2vw, 30px);
}

body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell-focused > .feature-page-main {
  width: min(100%, var(--ui-content-max));
  margin-inline: auto;
}

body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell .project-rail.side-nav {
  top: calc(var(--ui-topbar-height) + 16px);
  height: calc(100vh - var(--ui-topbar-height) - 32px);
  min-height: 520px;
}

body[data-ui-system="production-v2"] .feature-production-page .feature-page-main {
  max-width: var(--ui-content-max);
}

body[data-ui-system="production-v2"] .feature-production-page :is(.feature-page-hero, .feature-panel) {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .feature-production-page .feature-page-hero {
  min-height: 188px;
  padding: clamp(28px, 3vw, 44px);
}

body[data-ui-system="production-v2"] .feature-production-page .feature-page-hero::before {
  border-color: color-mix(in srgb, var(--ui-accent) 18%, transparent);
  box-shadow: 0 0 0 52px color-mix(in srgb, var(--ui-accent) 2.5%, transparent);
}

body[data-ui-system="production-v2"] .feature-production-page .feature-page-hero h1 {
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(28px, 3.2vw, 46px);
}

/*
 * Fullscreen readability floor. Production pages are used for long editing
 * sessions on 1280-1920px desktop viewports, so operational labels must not
 * inherit the 9-10px decorative typography of the legacy feature pages.
 */
body[data-ui-system="production-v2"] .feature-production-page :is(
  .feature-page-hero > div > span,
  .feature-panel-head > div > span,
  .feature-task-card > div > small,
  .poster-billing-card header small
) {
  font-size: var(--ui-type-caption);
}

body[data-ui-system="production-v2"] .feature-production-page .adaptation-workflow-step strong {
  font-size: var(--ui-type-control);
}

body[data-ui-system="production-v2"] .feature-production-page .adaptation-workflow-step small {
  font-size: var(--ui-type-caption);
}

body[data-ui-system="production-v2"] .feature-production-page :is(
  .feature-field > span,
  .poster-selected-list label > span,
  .adaptation-source-toolbar label > span,
  .adaptation-source-toolbar > span,
  .adaptation-source-toolbar > small
) {
  font-size: var(--ui-type-label);
}

body[data-ui-system="production-v2"] .feature-production-page .feature-field > span small {
  font-size: 10px;
}

body[data-ui-system="production-v2"] .poster-episode-context {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background:
    linear-gradient(90deg, var(--ui-accent-soft), transparent 52%),
    var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .poster-episode-context > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  color: var(--ui-accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .poster-episode-context > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .poster-episode-context strong {
  color: var(--ui-text-strong);
  font-size: 14px;
}

body[data-ui-system="production-v2"] .poster-episode-context small {
  color: var(--ui-accent-strong);
  font-size: 10px;
}

body[data-ui-system="production-v2"] .poster-episode-context p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ui-text-muted);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* AI workbench: replace fixed viewport offsets with the shared production frame. */
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-page.ai-studio-page {
  width: 100%;
  height: auto;
  min-height: calc(100vh - var(--ui-topbar-height));
  overflow: visible;
  color: var(--ui-text);
  background: transparent;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-wrap {
  min-height: calc(100vh - var(--ui-topbar-height));
  padding: 16px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-frame {
  min-height: calc(100vh - var(--ui-topbar-height) - 32px);
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-panel {
  position: sticky;
  z-index: 5;
  top: calc(var(--ui-topbar-height) + 16px);
  left: auto;
  width: auto;
  height: calc(100vh - var(--ui-topbar-height) - 32px);
  min-height: 520px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-brand {
  display: none;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(
  .studio-library-panel,
  .studio-filter-shell,
  .studio-queue-panel,
  .studio-history-item,
  .studio-composer-wrap
) {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-center-panel {
  min-width: 0;
  min-height: calc(100vh - var(--ui-topbar-height) - 32px);
  margin-left: 0;
  padding: 0 0 280px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-filter-bar {
  position: sticky;
  z-index: 12;
  top: calc(var(--ui-topbar-height) + 16px);
  right: auto;
  justify-content: flex-end;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(
  .studio-left-head h2,
  .studio-asset-section h3,
  .studio-history-group h3,
  .studio-history-item strong,
  .studio-prompt-input
) {
  color: var(--ui-text-strong);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(
  .studio-left-head button,
  .studio-filter-pill,
  .studio-control-trigger,
  .studio-toggle-control,
  .studio-history-item p,
  .studio-history-item small
) {
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(
  .studio-add-item,
  .studio-asset-item,
  .studio-audio-row,
  .studio-control-trigger,
  .studio-toggle-control,
  .studio-prompt-input
) {
  border-color: var(--ui-border);
  background-color: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-wrap {
  max-width: var(--ui-content-max);
  width: 100%;
  margin: 0 auto;
  padding: 18px clamp(16px, 2vw, 28px) 24px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-frame {
  min-height: calc(100dvh - var(--ui-topbar-height) - 42px);
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 18px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-panel {
  top: calc(var(--ui-topbar-height) + 18px);
  height: calc(100dvh - var(--ui-topbar-height) - 42px);
  min-height: 480px;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, var(--ui-accent-soft), transparent 140px),
    var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-library-panel {
  height: 100%;
  min-height: 0;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-head {
  position: sticky;
  top: 0;
  min-height: 78px;
  margin: 0;
  padding: 15px 16px;
  border-bottom: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface-raised) 92%, transparent);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-head > div {
  display: grid;
  gap: 3px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-head small,
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-canvas-head small {
  color: var(--ui-accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-head h2 {
  font-size: 18px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-head > span {
  padding: 5px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--ui-text-muted);
  font-size: 10px;
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-library-stack {
  flex: 1;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-border-strong) transparent;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-section {
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--ui-accent) 5%, transparent), transparent 58%),
    var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-section-head {
  min-height: 26px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-section h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-section h3 > span {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 38%, var(--ui-border));
  border-radius: 8px;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-section h3 svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-section-head > small {
  color: var(--ui-text-faint);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-grid {
  gap: 8px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-grid.role-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-add-item {
  min-height: 50px;
  gap: 8px;
  border-color: color-mix(in srgb, var(--ui-accent) 38%, var(--ui-border));
  color: var(--ui-accent-strong);
  background:
    linear-gradient(135deg, var(--ui-accent-soft), transparent),
    var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-add-item.role-add {
  min-height: 68px;
  aspect-ratio: auto;
  flex-direction: row;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-add-item > i {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 32%, transparent);
  border-radius: 8px;
  color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 10%, transparent);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-add-item > i svg {
  width: 14px;
  height: 14px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-add-item > span {
  color: var(--ui-text);
  font-size: 11px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-item {
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  color: var(--ui-text);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-asset-item strong {
  color: var(--ui-text);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-audio-row {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-audio-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-audio-add {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 11px;
  border: 1px dashed color-mix(in srgb, var(--ui-accent) 38%, var(--ui-border));
  border-radius: 10px;
  color: var(--ui-text);
  background:
    linear-gradient(135deg, var(--ui-accent-soft), transparent),
    var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-audio-add > span {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 32%, transparent);
  border-radius: 8px;
  color: var(--ui-accent);
  background: color-mix(in srgb, var(--ui-accent) 10%, transparent);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-audio-add svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-audio-add > b {
  font-size: 11px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(.studio-add-item, .studio-audio-add):hover {
  border-color: color-mix(in srgb, var(--ui-accent) 72%, var(--ui-border));
  color: var(--ui-text-strong);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ui-accent) 18%, transparent), transparent),
    var(--ui-surface-raised);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-center-panel {
  display: flex;
  min-height: calc(100dvh - var(--ui-topbar-height) - 42px);
  gap: 12px;
  padding: 0;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-canvas-head {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  color: var(--ui-text);
  background:
    linear-gradient(90deg, var(--ui-accent-soft), transparent 45%),
    var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-canvas-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-canvas-head h2 {
  margin: 0;
  color: var(--ui-text-strong);
  font-size: 19px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-canvas-head p {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 11px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-filter-bar {
  position: relative;
  z-index: 16;
  top: auto;
  right: auto;
  flex: 0 0 auto;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-filter-shell {
  height: 42px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--ui-surface-soft);
  box-shadow: none;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-filter-pill {
  color: var(--ui-text-muted);
  font-size: 12px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(.studio-dropdown-menu, .studio-control-menu) {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow-md);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(.studio-dropdown-menu, .studio-control-menu) button {
  color: var(--ui-text);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell :is(.studio-dropdown-menu, .studio-control-menu) button:hover,
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-control-menu button.active {
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-queue-panel {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  border-radius: 14px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-list {
  flex: 1 1 auto;
  min-height: 390px;
  padding: 0;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty {
  position: relative;
  width: 100%;
  min-height: clamp(360px, 52vh, 590px);
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  color: var(--ui-text-muted);
  background:
    linear-gradient(rgba(119, 143, 177, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 143, 177, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 44%, var(--ui-accent-soft), transparent 38%),
    var(--ui-surface);
  background-size: 32px 32px, 32px 32px, auto, auto;
  box-shadow: var(--ui-shadow-sm);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty::before,
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 86px;
  border: 1px solid var(--ui-border);
  pointer-events: none;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty::before {
  top: 22px;
  left: 22px;
  border-right: 0;
  border-bottom: 0;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty::after {
  right: 22px;
  bottom: 22px;
  border-top: 0;
  border-left: 0;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty > span {
  width: 58px;
  height: 58px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 18px;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  box-shadow: 0 0 34px color-mix(in srgb, var(--ui-accent) 18%, transparent);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty strong {
  color: var(--ui-text-strong);
  font-size: 20px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty small {
  max-width: 440px;
  color: var(--ui-text-muted);
  font-size: 12px;
  text-align: center;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty > div {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-history-empty > div i {
  padding: 5px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  color: var(--ui-text-faint);
  font-size: 9px;
  font-style: normal;
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-composer-dock {
  position: sticky;
  z-index: 30;
  bottom: 16px;
  left: auto;
  align-self: center;
  width: min(980px, 100%);
  transform: none;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-composer-wrap {
  max-width: none;
  padding: 12px;
  border-color: var(--ui-border-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, var(--ui-accent-soft), transparent 62%),
    color-mix(in srgb, var(--ui-surface-raised) 98%, transparent);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.36);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-composer-head {
  min-height: 88px;
  padding: 8px;
  border: 1px solid var(--ui-border);
  border-radius: 13px;
  background: var(--ui-surface-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-prompt-picker {
  width: 76px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-prompt-picker > button {
  width: 64px;
  height: 76px;
  border: 1px dashed var(--ui-border-strong);
  border-radius: 11px;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
  box-shadow: none;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-prompt-picker > button > span,
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-prompt-picker > button img,
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-prompt-picker > button i {
  width: 64px;
  height: 76px;
  border-radius: 10px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-prompt-input {
  min-height: 76px;
  padding: 6px 4px;
  color: var(--ui-text-strong);
  font-size: 14px;
  background: transparent;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-control-trigger,
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-toggle-control {
  min-height: 34px;
  border-radius: 9px;
  color: var(--ui-text);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-control-trigger strong {
  color: var(--ui-text);
  font-size: 11px;
  font-weight: 750;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-control-trigger small {
  color: var(--ui-text-faint);
  font-size: 9px;
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-control-trigger.primary {
  border-color: color-mix(in srgb, var(--ui-accent) 42%, var(--ui-border));
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-control-trigger.primary strong,
body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-toggle-control.active {
  color: var(--ui-accent-strong);
}

body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-send-btn:disabled {
  border: 1px solid var(--ui-border);
  color: var(--ui-text-faint);
  background: var(--ui-surface-soft);
  opacity: 1;
}

body[data-theme="light"][data-ui-system="production-v2"] .ai-studio-production-shell .studio-composer-wrap {
  box-shadow: 0 20px 48px rgba(34, 49, 74, 0.16);
}

/* Team assets retain real upload, edit, move, delete and vendor sync actions. */
body[data-ui-system="production-v2"] .team-assets-page {
  height: auto;
  min-height: 100vh;
  display: grid;
  overflow: visible;
  background-color: var(--ui-canvas);
}

body[data-ui-system="production-v2"] .team-assets-page .team-assets-main {
  min-height: calc(100vh - var(--ui-topbar-height));
  overflow: visible;
}

body[data-ui-system="production-v2"] .team-assets-page .team-assets-layout {
  min-height: calc(100vh - var(--ui-topbar-height));
}

body[data-ui-system="production-v2"] .team-assets-page :is(
  .team-asset-side-nav,
  .team-asset-category-section,
  .team-asset-card,
  .team-asset-pagination,
  .team-asset-detail-drawer
) {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background-color: var(--ui-surface);
}

body[data-ui-system="production-v2"] .team-assets-page .team-asset-side-nav button {
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .team-assets-page .team-asset-side-nav button:is(.active, :hover) {
  border-color: var(--ui-border-strong);
  color: var(--ui-accent-strong);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .development-lock-main {
  min-height: calc(100vh - var(--ui-topbar-height));
  color: var(--ui-text);
  background: radial-gradient(circle at 50% 22%, var(--ui-accent-soft), transparent 38%);
}

body[data-ui-system="production-v2"] .development-lock-card {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  color: var(--ui-text-strong);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-md);
}

body[data-ui-system="production-v2"] .development-lock-card p {
  color: var(--ui-text-muted);
}

body[data-ui-system="production-v2"] .development-lock-icon {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

body[data-ui-system="production-v2"] .development-lock-card > button {
  border-color: var(--ui-border-strong);
  background: var(--ui-accent);
}

@media (max-width: 1599px) {
  body[data-ui-system="production-v2"] .beta-theater-project-page .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-ui-system="production-v2"] .production-home-projects,
  body[data-ui-system="production-v2"] .production-home-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/*
 * A browser advertised as 1280px wide still has to accommodate the permanent
 * production directory. The old 1279px cutoff left exactly 1280px laptops on
 * the wide-screen grid, shrinking project cards to ~307px and tool cards to
 * ~175px. Use the real workspace width boundary instead of a device-name
 * boundary so 1280/1366 class desktop browsers receive readable cards.
 */
@media (max-width: 1365px) {
  :root {
    --ui-nav-width: 216px;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-system="production-v2"] .project-directory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-ui-system="production-v2"] .project-directory-tools {
    justify-content: space-between;
  }

  body[data-ui-system="production-v2"] .project-directory-search {
    width: min(100%, 520px);
  }

  body[data-ui-system="production-v2"] .production-home-projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-system="production-v2"] .production-home-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  body[data-ui-system="production-v2"] :is(.beta-theater-project-page, .beta-home-production-shell, .production-page-shell) {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-system="production-v2"] .production-global-nav {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-border);
  }

  body[data-ui-system="production-v2"] .production-shell-workspace {
    grid-column: 1;
  }

  body[data-ui-system="production-v2"] .production-global-brand {
    width: auto;
    flex: 0 0 auto;
  }

  body[data-ui-system="production-v2"] .production-global-brand .theater-brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  body[data-ui-system="production-v2"] .production-global-brand-copy {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-global-nav-groups {
    min-width: 0;
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-ui-system="production-v2"] :is(.production-global-nav-group, .production-global-nav-directory) {
    flex: 0 0 auto;
  }

  body[data-ui-system="production-v2"] .production-global-nav-group > p {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-global-nav-foot {
    flex: 0 0 auto;
    padding: 0;
    border-top: 0;
  }

  body[data-ui-system="production-v2"] .production-global-nav-theme {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-account-trigger {
    width: 42px;
    min-height: 42px;
    grid-template-columns: 34px;
    padding: 4px;
  }

  body[data-ui-system="production-v2"] .production-account-trigger > span:nth-child(2),
  body[data-ui-system="production-v2"] .production-account-trigger > svg {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-global-nav-group > div {
    display: flex;
  }

  body[data-ui-system="production-v2"] .production-global-nav-directory {
    display: flex;
    align-items: center;
  }

  body[data-ui-system="production-v2"] .production-global-nav-folder:not(.production-global-nav-planned) {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-global-nav-planned {
    min-width: 42px;
    grid-template-columns: 28px;
    padding: 6px;
  }

  body[data-ui-system="production-v2"] .production-global-nav-planned :is(strong, small) {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-global-nav-children {
    margin: 0;
    padding: 0;
    border-left: 0;
    display: flex;
    gap: 6px;
  }

  body[data-ui-system="production-v2"] .production-global-nav-item {
    width: auto;
    grid-template-columns: 24px minmax(0, auto);
    padding-inline: 8px 10px;
  }

  body[data-ui-system="production-v2"] .production-global-nav-item > span {
    width: 24px;
    height: 24px;
    background: transparent;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .beta-production-topbar {
    position: relative;
  }

  body[data-ui-system="production-v2"] .beta-home-production-shell .home-top {
    position: relative;
  }

  body[data-ui-system="production-v2"] .production-shared-topbar {
    position: relative;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-system="production-v2"] .production-home-hero {
    min-height: 420px;
  }

  body[data-ui-system="production-v2"] .production-home-hero-media {
    opacity: 0.5;
    background-position: center;
    background-size: cover;
  }

  body[data-ui-system="production-v2"] .production-home-hero-copy {
    width: 100%;
    padding-right: 28px;
  }

  body[data-ui-system="production-v2"] .production-home-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-system="production-v2"] .production-home-flow > span:nth-child(2)::after {
    content: none;
  }

  body[data-ui-system="production-v2"] .production-home-projects,
  body[data-ui-system="production-v2"] .production-home-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .detail-container,
  body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell {
    height: auto;
    min-height: calc(100vh - var(--ui-topbar-height));
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .project-rail.side-nav,
  body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell .project-rail.side-nav {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: row;
    justify-content: center;
    padding: 8px;
    overflow-x: auto;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .project-rail .side-nav-item,
  body[data-ui-system="production-v2"] .feature-production-page .feature-project-shell .project-rail .side-nav-item {
    width: auto;
    min-width: 70px;
    min-height: 56px;
  }

  body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-left-panel {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-filter-bar {
    top: 8px;
  }

  body[data-ui-system="production-v2"] .ai-studio-production-shell .studio-canvas-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 639px) {
  body[data-ui-system="production-v2"] .production-project-focus-brand :is(
    .theater-brand-name,
    .theater-brand-en
  ) {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-project-focus-brand {
    margin-right: 0;
  }

  body[data-ui-system="production-v2"] .production-project-focus-topbar .production-topbar-title {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-global-nav-item strong {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-global-nav-item {
    grid-template-columns: 28px;
    padding: 5px;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .beta-production-topbar {
    min-height: 68px;
    height: auto;
    padding: 10px 14px;
  }

  body[data-ui-system="production-v2"] .beta-home-production-shell .home-top {
    min-height: 68px;
    height: auto;
    padding: 10px 14px;
  }

  body[data-ui-system="production-v2"] .production-topbar-title > span {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-topbar-title h1 {
    font-size: 17px;
  }

  body[data-ui-system="production-v2"] .beta-theater-topbar-actions .theater-theme-segment span:not(.theme-icon) {
    display: none;
  }

  body[data-ui-system="production-v2"] .production-home-actions .theater-theme-segment span:not(.theme-icon),
  body[data-ui-system="production-v2"] .production-home-actions .home-logout span,
  body[data-ui-system="production-v2"] .production-shared-actions .production-shared-logout span {
    display: none;
  }

  body[data-ui-system="production-v2"] .beta-home-production-shell .home-main {
    padding: 20px 14px 28px;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .theater-project-container {
    padding: 20px 14px 28px;
  }

  body[data-ui-system="production-v2"] .project-directory-heading {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-ui-system="production-v2"] .project-directory-primary {
    align-self: flex-start;
  }

  body[data-ui-system="production-v2"] .project-directory-tabs {
    width: 100%;
    overflow-x: auto;
  }

  body[data-ui-system="production-v2"] .project-directory-tools {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-ui-system="production-v2"] .project-directory-search {
    width: 100%;
    min-width: 0;
  }

  body[data-ui-system="production-v2"] .project-directory-trash {
    justify-content: center;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .script-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .script-owner {
    max-width: 100%;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .project-meta {
    width: 100%;
    justify-content: space-between;
  }

  body[data-ui-system="production-v2"] .beta-theater-project-page .meta-block {
    align-items: flex-start;
  }

  body[data-ui-system="production-v2"] .production-home-projects,
  body[data-ui-system="production-v2"] .production-home-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-system="production-v2"] .production-home-hero-copy {
    padding: 34px 20px 180px;
  }

  body[data-ui-system="production-v2"] .production-home-hero-copy h2 {
    font-size: 34px;
  }

  body[data-ui-system="production-v2"] .production-home-flow {
    inset: auto 12px 12px;
  }

  body[data-ui-system="production-v2"] .production-shared-topbar {
    min-height: 68px;
    height: auto;
    padding: 10px 14px;
  }

  body[data-ui-system="production-v2"] .production-shared-actions .beta-team-trigger {
    display: none;
  }

  body[data-ui-system="production-v2"] .theater-project-detail-page .overview-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 32px 20px;
  }

  body[data-ui-system="production-v2"] .feature-production-page .feature-page-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-system="production-v2"] .beta-theater-project-page *,
  body[data-ui-system="production-v2"] .beta-theater-project-page *::before,
  body[data-ui-system="production-v2"] .beta-theater-project-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  body[data-ui-system="production-v2"] .beta-home-production-shell *,
  body[data-ui-system="production-v2"] .beta-home-production-shell *::before,
  body[data-ui-system="production-v2"] .beta-home-production-shell *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  body[data-ui-system="production-v2"] .production-page-shell *,
  body[data-ui-system="production-v2"] .production-page-shell *::before,
  body[data-ui-system="production-v2"] .production-page-shell *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
