.director-workshop {
  --director-success: #27824a;
  --director-success-bg: #edf8f1;
  --director-warning: #9a6700;
  --director-warning-bg: #fff8e6;
  --director-danger: #b4232d;
  --director-danger-bg: #fff1f2;
  --director-locked: #a21caf;
  --director-locked-bg: #fdf4ff;
  --director-muted-bg: #e7e9ec;
  container-type: inline-size;
  background: var(--ds-bg, #f3f4f6);
  color: var(--ds-text, #17191d);
  font-family: var(--ds-font-ui);
  font-optical-sizing: auto;
  font-synthesis: none;
  letter-spacing: 0;
}

@media (min-width: 768px) {
  .drama-director-workspace > main {
    display: flex;
    flex-direction: column;
  }
}

.dark .director-workshop {
  --director-success: #7dd89a;
  --director-success-bg: #16251c;
  --director-warning: #efc567;
  --director-warning-bg: #292315;
  --director-danger: #f28b94;
  --director-danger-bg: #2c171a;
  --director-locked: #e879f9;
  --director-locked-bg: #29162c;
  --director-muted-bg: #24282e;
}

.drama-director-workspace > .uouo-workspace-sidebar :is(
  [class*="text-[#18181B]"],
  [class*="text-gray-900"],
  [class*="text-zinc-900"]
) {
  color: #eef0f2 !important;
}

.director-workshop > div {
  padding: 10px 12px 12px;
}

.director-workshop .director-layout,
.director-workshop .director-content {
  width: 100%;
  min-width: 0;
}

.director-workshop .director-content {
  gap: 6px;
}

.director-workspace-header {
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 11px;
  border: 1px solid var(--ds-border, #b8bec6);
  border-radius: 5px;
  background: var(--ds-surface, #fff);
}

.director-workspace-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.director-workspace-kind {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--ds-border, #b8bec6);
  border-radius: 3px;
  color: var(--ds-text-3, #59616a);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}

.director-workspace-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0;
  margin-top: 2px;
  color: var(--ds-text-3, #59616a);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.director-workspace-meta > span {
  min-width: 0;
}

.director-workspace-meta > span + span::before {
  margin: 0 7px;
  color: var(--ds-border-strong, #858c95);
  content: "/";
}

.director-workspace-actions {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.director-header-action,
.director-overview-command,
.director-overview-close,
.director-confirm-command {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ds-border, #b8bec6);
  border-radius: 4px;
  background: var(--ds-surface, #fff);
  color: var(--ds-text-2, #40464e);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.director-header-action {
  height: 34px;
  padding: 0 9px;
  white-space: nowrap;
}

.director-header-action:hover:not(:disabled),
.director-overview-command:hover:not(:disabled),
.director-overview-close:hover:not(:disabled) {
  border-color: var(--ds-border-strong, #858c95);
  background: var(--ds-surface-2, #eef0f2);
  color: var(--ds-text, #17191d);
}

.director-header-action:disabled,
.director-overview-command:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.director-header-action.is-confirmed {
  border-color: color-mix(in srgb, var(--director-success) 45%, transparent);
  background: var(--director-success-bg);
  color: var(--director-success);
}

.director-header-action.is-pending {
  border-color: color-mix(in srgb, var(--director-warning) 45%, transparent);
  background: var(--director-warning-bg);
  color: var(--director-warning);
}

.director-workshop .director-brand-icon {
  display: inline-block;
  background: var(--ds-text, #17191d);
  -webkit-mask: url("/icons/modules/director.svg") center / contain no-repeat;
  mask: url("/icons/modules/director.svg") center / contain no-repeat;
}

.director-primary-nav {
  min-height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  border-color: var(--ds-border, #b8bec6) !important;
  border-radius: 5px !important;
  background: var(--ds-surface, #fff) !important;
  box-shadow: none;
}

.director-primary-tabs {
  min-height: 40px;
  align-items: stretch;
  border-bottom: 0 !important;
  scrollbar-width: thin;
}

.director-primary-tab {
  position: relative;
  min-width: 98px;
  min-height: 40px;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--ds-border, #b8bec6) 58%, transparent);
  border-radius: 0;
  background: transparent;
  font-size: 12px;
}

.director-primary-tab::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 2px;
  background: transparent;
  content: "";
}

.director-primary-tab.is-active {
  background: color-mix(in srgb, var(--ds-accent, #3457d5) 8%, transparent);
  color: var(--ds-accent, #3457d5) !important;
}

.director-primary-tab.is-active::after {
  background: var(--ds-accent, #3457d5);
}

.director-primary-tab:not(.is-active):not(:disabled):hover {
  background: var(--ds-surface-2, #eef0f2);
  color: var(--ds-text, #17191d) !important;
}

.director-nav-state {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ds-border-strong, #858c95);
}

.director-nav-state.is-complete {
  background: var(--director-success);
}

.director-nav-state.is-locked {
  background: var(--ds-text-3, #59616a);
}

.director-stage-toolbar {
  display: flex;
  min-height: 50px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--ds-border, #b8bec6);
  border-radius: 5px;
  background: var(--ds-surface, #fff);
}

.director-stage-heading {
  display: flex;
  min-width: 150px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.director-stage-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ds-border, #b8bec6);
  border-radius: 4px;
  background: var(--ds-surface-2, #eef0f2);
  color: var(--ds-accent, #3457d5);
}

.director-stage-eyebrow {
  display: block;
  color: var(--ds-text-3, #59616a);
  font-size: 10px;
  font-weight: 600;
  line-height: 13px;
}

.director-stage-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.director-stage-control {
  min-width: 310px;
  flex: 0 0 auto;
}

.director-stage-control.is-compact {
  min-width: 190px;
}

.director-stage-ready {
  color: var(--ds-text-3, #59616a);
  font-size: 12px;
}

.director-workshop .director-segmented {
  min-height: 34px;
  gap: 2px;
  padding: 2px;
  border-color: var(--ds-border, #b8bec6);
  border-radius: 4px;
  background: var(--ds-surface-2, #eef0f2);
}

.director-workshop .director-segmented-tab {
  min-height: 28px;
  padding-top: 4px;
  padding-bottom: 4px;
  border-radius: 3px;
  font-size: 12px;
  box-shadow: none !important;
}

.director-workshop .director-segmented-tab[aria-selected="true"] {
  background: var(--ds-accent, #3457d5) !important;
  color: #fff !important;
}

.director-workshop .director-segmented-tab:not([aria-selected="true"]):not(:disabled):hover {
  background: var(--ds-surface, #fff) !important;
  color: var(--ds-text, #17191d) !important;
}

.director-task-progress {
  border: 1px solid color-mix(in srgb, var(--ds-accent, #3457d5) 32%, transparent);
  border-radius: 3px !important;
  background: color-mix(in srgb, var(--ds-accent, #3457d5) 9%, transparent) !important;
  color: var(--ds-accent, #3457d5) !important;
}

.director-body {
  min-width: 0;
  padding-top: 2px;
}

.director-pane-layout {
  gap: 8px !important;
}

.director-detail-toolbar {
  height: auto;
  flex-wrap: wrap;
  row-gap: 6px !important;
}

.director-detail-toolbar > :first-child {
  min-width: 0;
  flex: 1 1 260px;
  flex-wrap: wrap;
}

.director-detail-toolbar > :last-child {
  max-width: 100%;
  margin-left: auto;
}

.director-manual-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
}

.director-manual-toolbar-actions {
  flex-wrap: wrap;
  row-gap: 6px;
}

.director-manual-toolbar-actions > input {
  min-width: min(280px, 100%) !important;
  flex: 1 1 320px;
}

.director-workshop .director-panel {
  min-width: 0;
  border-color: var(--ds-border, #b8bec6) !important;
  border-radius: 5px !important;
  background: var(--ds-surface, #fff);
  box-shadow: none !important;
}

.director-workshop .director-panel .director-panel {
  border-color: color-mix(in srgb, var(--ds-border, #b8bec6) 72%, transparent) !important;
  box-shadow: none !important;
}

.director-workshop .director-list-button,
.director-workshop .director-status-row {
  min-height: 40px;
  border-radius: 4px;
  box-shadow: none;
}

.director-workshop .director-list-button {
  border-color: color-mix(in srgb, var(--ds-border, #b8bec6) 78%, transparent);
  background: var(--ds-surface, #fff);
  color: var(--ds-text-2, #40464e);
}

.director-workshop .director-list-button[aria-pressed="true"] {
  border-color: var(--ds-accent, #3457d5) !important;
  background: color-mix(in srgb, var(--ds-accent, #3457d5) 8%, var(--ds-surface, #fff)) !important;
  color: var(--ds-text, #17191d) !important;
  box-shadow: inset 3px 0 0 var(--ds-accent, #3457d5) !important;
}

.director-workshop .director-list-button:hover,
.director-workshop .director-status-row:hover {
  border-color: var(--ds-border-strong, #858c95);
  filter: none;
}

.director-workshop .director-status-row[aria-pressed="true"] {
  border-color: var(--ds-accent, #3457d5) !important;
  box-shadow: inset 3px 0 0 var(--ds-accent, #3457d5) !important;
}

.director-workshop .director-status-row--confirmed {
  border-color: color-mix(in srgb, var(--director-success) 45%, transparent) !important;
  background: color-mix(in srgb, var(--director-success) 5%, var(--ds-surface, #fff)) !important;
  color: var(--ds-text-2, #40464e) !important;
}

.director-workshop .director-status-row--pending {
  border-color: color-mix(in srgb, var(--ds-accent, #3457d5) 44%, transparent) !important;
  background: color-mix(in srgb, var(--ds-accent, #3457d5) 6%, var(--ds-surface, #fff)) !important;
  color: var(--ds-text-2, #40464e) !important;
}

.director-workshop .director-status-row--unconfirmed {
  border-color: color-mix(in srgb, var(--director-warning) 48%, transparent) !important;
  background: color-mix(in srgb, var(--director-warning) 6%, var(--ds-surface, #fff)) !important;
  color: var(--ds-text-2, #40464e) !important;
}

.director-workshop .director-status-row--generating {
  border-color: color-mix(in srgb, var(--director-danger) 48%, transparent) !important;
  background: color-mix(in srgb, var(--director-danger) 7%, var(--ds-surface, #fff)) !important;
  color: var(--ds-text-2, #40464e) !important;
}

.director-workshop .director-status-row--locked {
  border-color: color-mix(in srgb, var(--director-locked) 48%, transparent) !important;
  background: color-mix(in srgb, var(--director-locked) 6%, var(--ds-surface, #fff)) !important;
  color: var(--ds-text-2, #40464e) !important;
}

.director-workshop .director-status-row--incomplete {
  border-color: var(--ds-border, #b8bec6) !important;
  background: var(--director-muted-bg) !important;
  color: var(--ds-text-3, #59616a) !important;
}

.director-workshop .director-status-row[aria-pressed="true"] {
  border-color: var(--ds-accent, #3457d5) !important;
  background: color-mix(in srgb, var(--ds-accent, #3457d5) 8%, var(--ds-surface, #fff)) !important;
  color: var(--ds-text, #17191d) !important;
}

.director-workshop .director-status-badge--confirmed {
  border-color: color-mix(in srgb, var(--director-success) 45%, transparent) !important;
  background: var(--director-success-bg) !important;
  color: var(--director-success) !important;
}

.director-workshop .director-status-badge--pending {
  border-color: color-mix(in srgb, var(--ds-accent, #3457d5) 48%, transparent) !important;
  background: color-mix(in srgb, var(--ds-accent, #3457d5) 9%, var(--ds-surface, #fff)) !important;
  color: var(--ds-accent, #3457d5) !important;
}

.director-workshop .director-status-badge--unconfirmed {
  border-color: color-mix(in srgb, var(--director-warning) 48%, transparent) !important;
  background: var(--director-warning-bg) !important;
  color: var(--director-warning) !important;
}

.director-workshop .director-status-badge--generating {
  border-color: color-mix(in srgb, var(--director-danger) 48%, transparent) !important;
  background: var(--director-danger-bg) !important;
  color: var(--director-danger) !important;
}

.director-workshop .director-status-badge--locked {
  border-color: color-mix(in srgb, var(--director-locked) 48%, transparent) !important;
  background: var(--director-locked-bg) !important;
  color: var(--director-locked) !important;
}

.director-workshop .director-status-badge--incomplete {
  border-color: var(--ds-border, #b8bec6) !important;
  background: var(--director-muted-bg) !important;
  color: var(--ds-text-3, #59616a) !important;
}

.director-workshop .director-status-badge {
  border-radius: 3px;
  font-size: 11px;
  line-height: 16px;
}

.director-workshop .director-status-row:focus-visible,
.director-workshop :is(button, input, textarea, select):focus-visible {
  outline: 2px solid var(--ds-focus, #6d86e8);
  outline-offset: 2px;
}

.director-workshop .director-empty {
  min-height: 140px;
  border-color: var(--ds-border, #b8bec6);
  border-radius: 5px;
  background: color-mix(in srgb, var(--ds-surface-2, #eef0f2) 60%, transparent);
  padding: 24px;
  color: var(--ds-text-3, #59616a);
}

.director-workshop :is(input, textarea, select, button) {
  font: inherit;
  letter-spacing: 0;
}

.director-workshop :is(input, textarea, select) {
  border-color: var(--ds-border-strong, #858c95);
  border-radius: 4px;
  box-shadow: none;
}

.director-workshop :is(input, textarea, select):focus {
  border-color: var(--ds-focus, #6d86e8);
  box-shadow: none !important;
}

.director-workshop button.bg-blue-600 {
  border-color: var(--ds-accent, #3457d5) !important;
  background: var(--ds-accent, #3457d5) !important;
}

.director-workshop button.bg-blue-600:hover:not(:disabled) {
  background: var(--ds-accent-hover, #2948b8) !important;
}

.director-workshop :is(.rounded-xl, .rounded-2xl) {
  border-radius: 6px;
}

.director-workshop [class*="backdrop-blur"] {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.director-workshop [class*="bg-white/10"] {
  background: var(--ds-surface, #15181c) !important;
}

.director-workshop :is(.shadow-sm, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl) {
  box-shadow: none !important;
}

.director-workshop img {
  color: transparent;
}

.director-overview-layer {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: flex;
  justify-content: flex-end;
}

.director-overview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.46);
}

.director-workshop-sidebar {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(390px, calc(100vw - 28px));
  height: 100%;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--ds-border, #b8bec6);
  background: var(--ds-bg, #f3f4f6);
  color: var(--ds-text, #17191d);
}

.director-workshop-sidebar:focus {
  outline: 0;
}

.director-overview-header {
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ds-border, #b8bec6);
  background: var(--ds-surface, #fff);
}

.director-overview-close {
  height: 32px;
  flex: 0 0 auto;
  padding: 0 10px;
}

.director-overview-scroll {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 8px;
  overscroll-behavior: contain;
}

.director-workshop .director-overview-section {
  flex: 0 0 auto;
  background: var(--ds-surface, #fff);
}

.director-overview-command {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
}

.director-overview-progress {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ds-text-2, #40464e);
  text-align: left;
}

.director-overview-progress:hover:not(:disabled) {
  background: var(--ds-surface-2, #eef0f2);
}

.director-workshop .director-confirm-card.is-complete {
  border-color: color-mix(in srgb, var(--director-success) 42%, transparent) !important;
  background: var(--director-success-bg);
}

.director-workshop .director-confirm-card.is-pending {
  border-color: color-mix(in srgb, var(--director-warning) 42%, transparent) !important;
  background: var(--director-warning-bg);
}

.director-confirm-command {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border-color: var(--ds-accent, #3457d5);
  background: var(--ds-accent, #3457d5);
  color: #fff;
}

.director-confirm-command:hover {
  border-color: var(--ds-accent-hover, #2948b8);
  background: var(--ds-accent-hover, #2948b8);
}

@container (max-width: 1280px) {
  .director-workshop .director-body {
    overflow-x: hidden !important;
  }

  .director-workspace-header {
    gap: 10px;
  }

  .director-workspace-meta > span:first-child {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .director-header-action {
    padding-inline: 7px;
  }

  .director-primary-tab {
    min-width: 90px;
  }
}

@container (max-width: 980px) {
  .director-workspace-header {
    align-items: flex-start;
  }

  .director-workspace-actions {
    max-width: 52%;
    flex-wrap: wrap;
  }

  .director-pane-layout--triple {
    min-height: 720px !important;
    height: auto !important;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) !important;
    grid-template-rows: minmax(340px, 1fr) minmax(340px, 1fr) !important;
    overflow: visible !important;
  }

  .director-pane-layout--triple > :nth-child(1) {
    grid-row: 1 / span 2;
  }

  .director-pane-layout--triple > :nth-child(2),
  .director-pane-layout--triple > :nth-child(3) {
    grid-column: 2;
  }

  .director-pane-layout--anchor,
  .director-pane-layout--magic {
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr) !important;
  }

  .director-workshop .director-body {
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .director-confirm-items-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@container (max-width: 860px) {
  .director-workshop .director-body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .director-manual-task-layout {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .director-manual-toolbar,
  .director-manual-toolbar-actions {
    width: 100%;
  }

  .director-manual-workspace-grid {
    width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible !important;
  }

  .director-manual-workspace-grid > * {
    width: 100%;
    min-width: 0;
    min-height: 480px;
    height: min(640px, 70vh) !important;
  }
}

@container (max-width: 760px) {
  .director-workshop > div {
    padding: 7px;
    padding-bottom: 68px;
  }

  .director-workspace-header {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .director-workspace-actions {
    width: 100%;
    max-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: thin;
  }

  .director-stage-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
  }

  .director-stage-heading {
    min-width: 0;
  }

  .director-stage-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .director-stage-control,
  .director-stage-control.is-compact {
    min-width: min(330px, calc(100cqw - 28px));
  }

  .director-stage-ready {
    display: none;
  }

  .director-workshop .director-body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .director-pane-layout {
    width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    overflow: visible !important;
  }

  .director-pane-layout > * {
    grid-column: 1 !important;
    grid-row: auto !important;
    min-height: 320px;
    height: auto !important;
    overflow: visible !important;
  }

  .director-confirm-items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .director-anchor-command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .director-anchor-command-grid button {
    min-height: 38px;
    height: auto;
    white-space: normal;
  }

  .director-workshop-sidebar {
    padding-bottom: 68px;
  }
}

@media (max-width: 520px) {
  .director-workshop > div {
    padding: 6px;
    padding-bottom: 66px;
  }

  .director-workspace-kind,
  .director-workspace-meta > span:nth-child(n + 3) {
    display: none;
  }

  .director-workspace-meta > span:first-child {
    max-width: 58vw;
  }

  .director-header-action {
    height: 32px;
  }

  .director-task-progress {
    order: -1;
  }

  .director-primary-tab {
    min-width: 84px;
    padding-inline: 9px;
  }

  .director-stage-icon {
    width: 28px;
    height: 28px;
  }

  .director-workshop-sidebar {
    width: 100%;
  }

  .director-confirm-items-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .director-workshop *,
  .director-workshop *::before,
  .director-workshop *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
