/* Native Big Video workspace. This is the sole production-page stylesheet. */
:root {
  color-scheme: dark;
  --ui-bg: #121212;
  --ui-panel: #18181b;
  --ui-panel-raised: #27272a;
  --ui-field: #18181b;
  --ui-line: #3f3f46;
  --ui-line-soft: #303036;
  --ui-text: #f4f4f5;
  --ui-muted: #b0b0ba;
  --ui-accent: #93c5fd;
  --ui-accent-ink: #172554;
  --ui-danger: #ff9aab;
  --ui-radius: 14px;
}
html {
  scroll-padding-top: 104px;
}
body.kafak-workspace {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font: 14px/1.55 Inter, "Noto Sans Malayalam", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.kafak-workspace *, .kafak-workspace *::before, .kafak-workspace *::after {
  box-sizing: border-box;
}
.kafak-workspace [hidden] {
  display: none !important;
}
.kafak-workspace a {
  color: var(--ui-accent);
  text-decoration: none;
  margin: 0;
  overflow-wrap: anywhere;
}
.kafak-workspace a:hover {
  text-decoration: underline;
}
.kafak-workspace h1, .kafak-workspace h2, .kafak-workspace h3, .kafak-workspace p {
  overflow-wrap: anywhere;
}
.kafak-workspace small {
  color: var(--ui-muted);
  line-height: 1.65;
}
.kafak-workspace button, .kafak-workspace input, .kafak-workspace select, .kafak-workspace textarea {
  font: inherit;
}
.kafak-workspace button, .kafak-workspace .ui-link-button {
  min-height: 40px;
  padding: 9px 14px;
  margin: 0;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-panel-raised);
  color: var(--ui-text);
  cursor: pointer;
  line-height: 1.4;
  font-weight: 550;
  transition: background-color 140ms, border-color 140ms, color 140ms;
}
.kafak-workspace button:hover:not(:disabled), .kafak-workspace .ui-link-button:hover {
  background: #242d38;
  border-color: #465260;
  text-decoration: none;
}
.kafak-workspace button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.kafak-workspace button.primary, .kafak-workspace button.wizard-primary, .kafak-workspace #new {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: var(--ui-accent-ink);
  font-weight: 750;
}
.kafak-workspace button.primary:hover:not(:disabled), .kafak-workspace button.wizard-primary:hover:not(:disabled), .kafak-workspace #new:hover:not(:disabled) {
  background: #bfdbfe;
  border-color: #bfdbfe;
}
.kafak-workspace :is(button,a,input,select,textarea,summary):focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 3px;
}
.kafak-workspace :is(input,select,textarea) {
  padding: 10px 12px;
  margin: 6px 0 0;
  background: var(--ui-field);
  border: 1px solid #34404f;
  color: var(--ui-text);
  border-radius: 8px;
  max-width: 100%;
  min-width: 0;
}
.kafak-workspace :is(input,select,textarea):focus {
  border-color: var(--ui-accent);
}
.kafak-workspace textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 110px;
  line-height: 1.8;
}
.kafak-workspace input[type=checkbox] {
  accent-color: var(--ui-accent);
  width: 17px;
  height: 17px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}
.kafak-workspace input[type=range] {
  accent-color: var(--ui-accent);
  padding: 0;
}
.kafak-workspace input[type=file] {
  width: 100%;
  font-size: 12px;
  padding: 8px;
}
.kafak-workspace input::file-selector-button {
  background: var(--ui-panel-raised);
  color: var(--ui-text);
  border: 1px solid #405063;
  border-radius: 5px;
  padding: 6px 9px;
  margin-right: 10px;
  cursor: pointer;
}
.kafak-workspace label {
  color: #c6ceda;
  font-size: 13px;
  font-weight: 550;
}
.kafak-workspace select {
  min-height: 42px;
}
.kafak-workspace pre {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  overflow: auto;
}
.kafak-workspace * {
  scrollbar-width: thin;
  scrollbar-color: #3a4655 transparent;
}
.kafak-workspace ::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.kafak-workspace ::-webkit-scrollbar-thumb {
  background: #3a4655;
  border-radius: 8px;
}
.kafak-workspace .ui-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}
.kafak-workspace header {
  height: 78px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ui-bg);
  border-bottom: 1px solid var(--ui-line-soft);
  gap: 20px;
}
.kafak-workspace .ui-header-title {
  min-width: 0;
  flex: 1;
}
.kafak-workspace .ui-header-title .ui-eyebrow {
  display: block;
  font-size: 10px;
  color: var(--ui-muted);
  letter-spacing: .16em;
  font-weight: 650;
  text-transform: uppercase;
}
.kafak-workspace #channelHeading {
  color: var(--ui-text);
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.kafak-workspace #channelHeading + small {
  font-size: 11px;
}
.kafak-workspace .ui-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.kafak-workspace #ui-help-toggle {
  background: transparent;
  font-size: 12px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.kafak-workspace #ui-help-toggle[aria-pressed=true] {
  color: var(--ui-accent);
  border-color: #3e5778;
  background: #202d40;
}
.kafak-workspace #studio {
  color: var(--ui-text);
  font-size: 12px;
  padding: 10px 14px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
}
.kafak-workspace #ui-menu-button {
  display: none;
}
.kafak-workspace main {
  display: grid;
  grid-template-columns: 236px minmax(0,1fr);
  padding: 0;
  gap: 0;
  max-width: 1920px;
  margin: 0 auto;
  align-items: start;
}
.kafak-workspace main > aside {
  border: 0;
  border-right: 1px solid var(--ui-line-soft);
  border-radius: 0;
  background: var(--ui-bg);
  padding: 24px 16px;
  position: sticky;
  top: 78px;
  height: calc(100dvh - 78px);
  overflow-y: auto;
  min-width: 0;
}
.kafak-workspace .ui-side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ui-text);
  margin: 0 8px 28px;
}
.kafak-workspace .ui-brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--ui-accent);
  border-radius: 10px;
  background: #202d40;
  color: var(--ui-accent);
  font-size: 21px;
  font-weight: 750;
}
.kafak-workspace .ui-side-brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: .13em;
}
.kafak-workspace .ui-side-brand small {
  display: block;
  font-size: 10px;
  letter-spacing: .06em;
}
.kafak-workspace #ui-project-controls {
  display: grid;
  gap: 12px;
  padding: 0 4px 20px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.kafak-workspace #ui-project-controls label, .kafak-workspace #ui-project-controls select {
  display: block;
  width: 100%;
}
.kafak-workspace #ui-project-controls label {
  font-size: 11px;
  font-weight: 500;
}
.kafak-workspace #ui-project-controls select {
  font-size: 12px;
}
.kafak-workspace #new {
  width: 100%;
  margin: 0;
}
.kafak-workspace .ui-nav-label {
  display: flex;
  justify-content: space-between;
  margin: 22px 10px 10px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #95a0af;
  font-weight: 650;
}
.kafak-workspace #ui-workflow-count {
  letter-spacing: 0;
  color: #738091;
}
.kafak-workspace .phase-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}
.kafak-workspace .phase-nav button {
  width: 100%;
  display: flex;
  gap: 11px;
  align-items: center;
  text-align: left;
  padding: 10px 11px;
  min-height: 46px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 12px;
  color: #a9b4c3;
  font-weight: 500;
}
.kafak-workspace .phase-nav button::before {
  content: attr(data-step);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  border: 1px solid #37414e;
  border-radius: 7px;
  color: #aab5c5;
  font-size: 11px;
}
.kafak-workspace .phase-nav button[aria-current=step] {
  color: var(--ui-accent);
  background: #202d40;
  border-color: #3e5778;
  font-weight: 650;
}
.kafak-workspace .phase-nav button[aria-current=step]::before {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: var(--ui-accent-ink);
}
.kafak-workspace .phase-nav button.wizard-done {
  border-bottom-width: 1px;
}
.kafak-workspace .phase-nav button.wizard-done:not([aria-current=step])::before {
  content: "✓";
  color: var(--ui-accent);
  border-color: #3e5778;
}
.kafak-workspace .phase-nav button:disabled {
  opacity: .64;
}
.kafak-workspace .ui-nav-note {
  margin: 14px 10px 20px;
  font-size: 11px;
  line-height: 1.65;
  color: #7c8899;
}
.kafak-workspace #ui-workspace-settings {
  margin-top: 22px;
  border-top: 1px solid var(--ui-line-soft);
}
.kafak-workspace aside details {
  font-size: 12px;
}
.kafak-workspace aside details details {
  background: var(--ui-bg);
}
.kafak-workspace aside details input:not([type=checkbox]), .kafak-workspace aside details button {
  width: 100%;
}
.kafak-workspace #deleteProject {
  color: var(--ui-danger);
  background: #301d25;
  border-color: #56313d;
}
.kafak-workspace .ui-retention-note {
  font-size: 11px;
  margin: 10px 0;
  color: var(--ui-muted);
}
.kafak-workspace #production-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) 350px;
  column-gap: 24px;
  row-gap: 20px;
  padding: 30px 28px 48px;
  align-items: start;
}
.kafak-workspace #wizard-heading {
  grid-column: 1 / -1;
  grid-row: 1;
  padding: 0;
}
.kafak-workspace #wizard-count {
  display: inline-block;
  color: var(--ui-accent);
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 650;
}
.kafak-workspace #wizard-title {
  color: var(--ui-text);
  font-size: clamp(25px,2.4vw,34px);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.3;
  margin: 9px 0 8px;
}
.kafak-workspace #wizard-help {
  color: var(--ui-muted);
  font-size: 13px;
  max-width: 850px;
  line-height: 1.7;
}
.kafak-workspace .production-phase {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0 !important;
  padding: 24px;
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
}
.kafak-workspace .production-phase > h2 {
  font-size: 16px;
  letter-spacing: -.01em;
  margin: 0 0 20px;
  color: var(--ui-text);
  font-weight: 650;
}
.kafak-workspace #category-controls {
  background: transparent;
  padding: 0;
  border: 0;
}
.kafak-workspace #category-controls > label {
  margin: 18px 0;
}
.kafak-workspace #category-controls label:has(textarea) {
  display: block;
  margin-top: 16px;
}
.kafak-workspace #topic-input {
  height: 150px !important;
  min-height: 130px;
}
.kafak-workspace #source-link {
  height: 132px !important;
}
.kafak-workspace #source-transcript {
  min-height: 190px;
}
.kafak-workspace #topic-prompt {
  height: 220px;
  max-height: none;
}
.kafak-workspace .ui-project-config {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ui-line-soft);
}
.kafak-workspace .ui-project-config > label {
  display: block;
  font-size: 11px;
  font-weight: 600;
}
.kafak-workspace .ui-project-config select {
  width: 100%;
  display: block;
  font-size: 12px;
}
.kafak-workspace .ui-source-heading {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 5px;
}
.kafak-workspace .ui-source-caption {
  font-size: 12px;
  color: var(--ui-muted);
  margin: 0 0 14px;
}
.kafak-workspace .ui-source-methods {
  display: grid !important;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 8px !important;
  margin: 0 0 18px !important;
}
.kafak-workspace .ui-source-methods button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 78px;
  padding: 10px 4px;
  font-size: 11px;
  border: 1px solid var(--ui-line);
  background: var(--ui-field);
  color: #abb7c8;
  border-radius: 9px;
}
.kafak-workspace .ui-source-methods button.primary {
  background: #202d40;
  color: var(--ui-accent);
  border-color: #3e5778;
}
.kafak-workspace .ui-source-methods button.primary:hover {
  background: #243b55;
  color: var(--ui-accent);
}
.kafak-workspace .ui-source-methods .ui-icon {
  width: 20px;
  height: 20px;
}
.kafak-workspace .ui-source-methods button small {
  font-size: 10px;
  line-height: 1.2;
  color: inherit;
  opacity: .8;
}
.kafak-workspace #audio-transcript-upload {
  border: 1px dashed var(--ui-line);
  border-radius: 10px;
  background: var(--ui-panel);
  padding: 18px;
  margin: 12px 0 18px;
}
.kafak-workspace #audio-transcript-upload label {
  display: block;
  margin-bottom: 14px;
}
.kafak-workspace #audio-transcript-upload > small {
  font-size: 11px;
  margin-top: 12px;
}
.kafak-workspace #audio-transcript-status {
  margin-bottom: 0;
  font-size: 12px;
}
.kafak-workspace #generate-link {
  display: inline-flex;
  font-size: 12px;
  margin: 10px 0 0;
  background: var(--ui-panel-raised);
  color: var(--ui-text);
  border-color: var(--ui-line);
}
.kafak-workspace #transcribe-source {
  margin: 0 0 10px;
  font-size: 12px;
}
.kafak-workspace details {
  margin: 12px 0 0;
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  overflow-wrap: anywhere;
  background: var(--ui-panel);
}
.kafak-workspace summary {
  padding: 13px 14px;
  background: transparent;
  font-size: 12px;
  font-weight: 550;
  color: #b8c3d3;
  border-radius: 8px;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: center;
}
.kafak-workspace summary::-webkit-details-marker {
  display: none;
}
.kafak-workspace summary::before {
  content: "›";
  font-size: 20px;
  line-height: 1;
  color: #7f90a4;
  display: inline-block;
  transform: rotate(0);
}
.kafak-workspace details[open] > summary {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ui-line-soft);
  border-radius: 8px 8px 0 0;
}
.kafak-workspace details[open] > summary::before {
  transform: rotate(90deg);
}
.kafak-workspace details[open] {
  padding-bottom: 14px;
}
.kafak-workspace details > :not(summary) {
  margin-left: 14px;
  margin-right: 14px;
  max-width: calc(100% - 28px);
}
.kafak-workspace details > label {
  display: block;
  margin-top: 14px;
}
.kafak-workspace details > :is(button,a) {
  margin-top: 10px;
}
.kafak-workspace details > small {
  display: block;
  margin-top: 8px;
}
.kafak-workspace details > textarea {
  width: calc(100% - 28px);
}
.kafak-workspace details > label > :is(input:not([type=checkbox]),select,textarea) {
  display: block;
  width: 100%;
}
.kafak-workspace details .stage-provider {
  display: block;
}
.kafak-workspace #ui-automation-settings label:has(input[type=checkbox]) {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.8;
}
.kafak-workspace #ui-automation-warning {
  background: #302a1b;
  border: 1px solid #5d4d28;
  color: #efd499;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin: 14px 0;
}
.kafak-workspace #ui-automation-summary {
  display: block;
  margin: 2px 0 14px;
  font-size: 11px;
  color: var(--ui-muted);
}
.kafak-workspace #output-voice-hint {
  display: block;
  margin-top: 12px;
  font-size: 11px;
}
.kafak-workspace #save-topic {
  margin-top: 18px;
  font-size: 12px;
}
.kafak-workspace #topic-status {
  grid-column: 1 / -1;
  grid-row: 3;
  padding: 12px 16px;
  margin: 0;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-panel);
  color: var(--ui-text);
  font-size: 12px;
}
.kafak-workspace #topic-status:empty {
  display: none;
}
.kafak-workspace .field-help-ml {
  display: none;
}
.kafak-workspace.ui-help-visible .field-help-ml:not([hidden]) {
  display: block;
  color: #aebccc;
  font-size: 12px;
  line-height: 1.85;
  margin: 7px 0 12px;
}
.kafak-workspace.ui-help-visible .ui-project-config > .field-help-ml {
  grid-column: 1 / -1;
}
.kafak-workspace .wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  padding: 20px 0 0;
  border-top: 1px solid var(--ui-line);
}
.kafak-workspace .wizard-actions .wizard-primary {
  flex: 1 1 210px;
  min-width: 0;
  min-height: 46px;
  padding: 12px 16px;
  font-size: 13px;
}
.kafak-workspace .ui-action-hint {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--ui-muted);
  margin: 0;
}
.kafak-workspace .ui-output-panel {
  grid-column: 2;
  grid-row: 2;
  margin: 0 !important;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ui-line);
  background: var(--ui-panel);
  border-radius: var(--ui-radius);
  position: sticky;
  top: 102px;
}
.kafak-workspace .ui-output-panel > .bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.kafak-workspace .ui-output-panel > .bar h2 {
  font-size: 14px;
  margin: 0;
  color: var(--ui-text);
}
.kafak-workspace #status {
  padding: 4px 8px;
  font-size: 11px;
  color: #becbd9;
  border: 1px solid #344353;
  background: var(--ui-panel-raised);
  border-radius: 5px;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.kafak-workspace #ui-output-expand {
  min-height: 28px;
  padding: 4px 7px;
  margin-left: auto;
  background: transparent;
  border: 0;
}
.kafak-workspace #ui-output-expand .ui-icon {
  width: 16px;
  height: 16px;
}
.kafak-workspace .output-tabs {
  gap: 0;
  margin: 18px 0 16px;
  padding: 4px;
  border: 1px solid var(--ui-line-soft);
  border-radius: 8px;
  background: var(--ui-field);
}
.kafak-workspace .output-tabs button {
  flex: 1;
  min-height: 32px;
  padding: 7px 9px;
  font-size: 11px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #99a7b9;
}
.kafak-workspace .output-tabs button[aria-selected=true] {
  background: #27323c;
  color: var(--ui-text);
  font-weight: 650;
}
.kafak-workspace #console {
  background: #0d1218;
  color: #b0c5c1;
  border-radius: 8px;
  padding: 14px;
  min-height: 180px;
  height: 240px !important;
  max-height: 45vh !important;
  font: 11px/1.75 ui-monospace,Consolas,monospace;
}
.kafak-workspace #console:empty {
  display: none;
}
.kafak-workspace #console-phase-badge {
  font-size: 11px;
  font-weight: 550;
  padding: 5px 9px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.kafak-workspace #cancel-generation {
  color: var(--ui-danger);
  border-color: #603744;
  margin: 4px 0 10px;
  font-size: 11px;
}
.kafak-workspace #live-phase-progress {
  font-size: 11px;
  color: var(--ui-muted);
  line-height: 1.8;
}
.kafak-workspace .ui-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 18px;
  background: var(--ui-field);
  border: 1px dashed #2d3a48;
  border-radius: 10px;
  min-height: 225px;
}
.kafak-workspace .ui-empty-state .ui-icon {
  width: 32px;
  height: 32px;
  color: #78a99a;
  margin-bottom: 2px;
}
.kafak-workspace .ui-empty-state strong {
  font-size: 13px;
  font-weight: 550;
}
.kafak-workspace .ui-empty-state p {
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--ui-muted);
}
.kafak-workspace #video {
  max-height: 55vh;
  background: #080c12;
}
.kafak-workspace #video:not([src]) {
  display: none;
}
.kafak-workspace #downloads {
  margin-top: 16px;
  border-top: 1px solid var(--ui-line-soft);
  padding-top: 12px;
  gap: 8px;
}
.kafak-workspace #downloads:empty {
  display: none;
}
.kafak-workspace #downloads a {
  font-size: 11px;
  border: 1px solid var(--ui-line);
  border-radius: 5px;
  padding: 5px 8px;
  color: #c0d0df;
}
.kafak-workspace .ui-output-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 10px;
  line-height: 1.7;
  color: #7f8d9f;
  margin: 16px 0 0;
}
.kafak-workspace .ui-output-note .ui-icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}
.kafak-workspace #output-pane-Frame > section {
  border: 0;
  padding: 0;
  margin: 0 !important;
  background: transparent;
}
.kafak-workspace #output-pane-Frame {
  max-height: calc(100dvh - 280px);
  overflow-y: auto;
}
.kafak-workspace #output-pane-Frame :is(button,a) {
  font-size: 11px;
}
.kafak-workspace #output-pane-Frame .bar {
  gap: 7px;
}
.kafak-workspace #output-pane-Frame h2 {
  font-size: 13px;
  color: var(--ui-text);
}
.kafak-workspace #output-pane-Frame :is(p,label,span,figcaption) {
  font-size: 11px;
  line-height: 1.65;
}
.kafak-workspace #output-pane-Frame input {
  width: 100%;
}
.kafak-workspace #preview-canvas {
  max-height: 55vh;
}
.kafak-workspace #preview-status {
  color: var(--ui-muted);
}
.kafak-workspace #preview-remove {
  color: var(--ui-danger);
}
.kafak-workspace #script {
  white-space: normal;
}
.kafak-workspace #script > div {
  background: #10151c;
  border-color: var(--ui-line);
  border-radius: 10px !important;
  margin: 16px 0 !important;
}
.kafak-workspace #script > div > strong {
  display: block;
  color: var(--ui-accent);
  font-size: 12px;
  margin-bottom: 12px;
}
.kafak-workspace #script > div > button {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 11px;
  margin-right: 7px;
}
.kafak-workspace #script label {
  margin-top: 16px;
  font-size: 12px;
}
.kafak-workspace #script textarea[dir=rtl] {
  font-size: 20px;
  line-height: 2;
}
.kafak-workspace #script > p {
  font-size: 12px;
  color: var(--ui-muted);
}
.kafak-workspace #phase-4 > h2 {
  display: block;
}
.kafak-workspace #phase-4 > h2 label {
  display: block;
  margin-top: 14px;
}
.kafak-workspace #phase-4 > h2 select {
  display: block;
  width: 100%;
  font-size: 12px;
}
.kafak-workspace #phase-4 > audio {
  margin: 18px 0 10px;
}
.kafak-workspace #phase-4 > div:has(#voiceChunks) {
  margin-top: 18px;
}
.kafak-workspace #clips {
  margin-bottom: 20px;
}
.kafak-workspace #clips > p {
  font-size: 12px;
  color: var(--ui-muted);
  margin: 15px 0 8px;
}
.kafak-workspace #wizard-regenerate-voice {
  margin: 20px 0 8px;
}
.kafak-workspace #wizard-regenerate-voice + small {
  display: block;
  font-size: 11px;
}
.kafak-workspace #design-branding {
  display: block;
}
.kafak-workspace #design-branding > label {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  gap: 6px;
  margin: 8px 14px;
  max-width: calc(100% - 28px);
  font-size: 11px;
}
.kafak-workspace #design-branding > label:has(input[type=file]) {
  width: calc(100% - 28px);
}
.kafak-workspace #design-branding > .bar {
  width: auto !important;
}
.kafak-workspace #design-branding .bar > label {
  flex: 1 1 140px;
}
.kafak-workspace #design-branding .bar input {
  flex: 1 1 140px;
}
.kafak-workspace #design-branding .bar select {
  display: block;
  width: 100%;
}
.kafak-workspace #design-branding > button {
  display: block;
  margin: 14px;
}
.kafak-workspace #channel-path {
  font-size: 10px;
  color: var(--ui-muted);
}
.kafak-workspace #wizard-nature-style {
  background: #14241e;
  padding: 18px;
  border-color: #365444;
}
.kafak-workspace #wizard-nature-style strong {
  color: var(--ui-accent);
  font-size: 17px;
}
.kafak-workspace #wizard-nature-style p {
  font-size: 12px;
  color: #afc3ba;
}
.kafak-workspace .ui-render-checks {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}
.kafak-workspace .ui-render-checks li {
  padding: 13px 14px;
  background: var(--ui-field);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.kafak-workspace .ui-render-checks span {
  color: #bac4d3;
}
.kafak-workspace .ui-render-checks strong {
  color: var(--ui-accent);
  font-size: 11px;
}
.kafak-workspace .ui-render-checks strong[data-ready=false] {
  color: #ddbc86;
}
.kafak-workspace #phase-6 > label {
  font-size: 12px;
  margin: 22px 0 6px;
}
.kafak-workspace #phase-6 > small {
  font-size: 11px;
}
.kafak-workspace #phase-6 #publish-thumb-prompt {
  min-height: 180px !important;
}
.kafak-workspace #phase-6 .stage-provider {
  display: block;
}
.kafak-workspace #phase-6 .stage-provider select {
  width: 100%;
}
.kafak-workspace #phase-6 > p {
  color: var(--ui-muted);
  font-size: 12px;
}
.kafak-workspace #thumb-preview {
  max-width: 100%;
  border-radius: 10px;
}
.kafak-workspace #youtube-connection {
  background: #16281f;
  border-color: #3b5b48;
  font-size: 12px;
  color: #c3dfce;
}
.kafak-workspace #youtube-setup {
  background: var(--ui-field);
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  padding: 16px;
}
.kafak-workspace #youtube-setup > label {
  margin-top: 0;
  font-size: 12px;
}
.kafak-workspace #youtube-setup small {
  font-size: 11px;
}
.kafak-workspace #youtube-visibility {
  display: block;
  width: 100%;
  margin: 8px 0 16px;
}
.kafak-workspace #upload-youtube {
  margin: 10px 0;
}
.kafak-workspace #phase-7 > a {
  display: block;
  margin: 12px 0;
  font-size: 12px;
}
.kafak-workspace #publish-channel {
  font-size: 15px;
}
.kafak-workspace.ui-output-expanded #production-workspace {
  grid-template-columns: minmax(0,1fr);
}
.kafak-workspace.ui-output-expanded .ui-output-panel {
  grid-column: 1;
  grid-row: 2;
  position: static;
}
.kafak-workspace.ui-output-expanded .production-phase {
  grid-row: 3;
}
.kafak-workspace.ui-output-expanded #topic-status {
  grid-row: 4;
}
.kafak-workspace.ui-output-expanded #output-pane-Frame {
  max-height: none;
}
@media (min-width:1700px) {
  .kafak-workspace #production-workspace {
    grid-template-columns: minmax(0,1fr) 400px;
    padding: 36px 40px;
    gap: 28px;
  }
}
@media (max-width:1250px) {
  .kafak-workspace #production-workspace {
    grid-template-columns: minmax(0,1fr);
    padding: 24px;
  }
  .kafak-workspace .ui-output-panel {
    grid-column: 1;
    grid-row: 3;
    position: static;
  }
  .kafak-workspace #topic-status {
    grid-row: 4;
  }
  .kafak-workspace #ui-output-expand {
    display: none;
  }
  .kafak-workspace #output-pane-Frame {
    max-height: none;
  }
  .kafak-workspace #wizard-title {
    font-size: 30px;
  }
}
@media (max-width:800px) {
  .kafak-workspace header {
    height: 70px;
    padding: 0 16px;
    gap: 12px;
  }
  .kafak-workspace #ui-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
  }
  .kafak-workspace main {
    grid-template-columns: minmax(0,1fr);
  }
  .kafak-workspace main > aside {
    display: none;
    position: static;
    height: auto;
    border: 0;
    border-bottom: 1px solid var(--ui-line);
    padding: 20px;
  }
  .kafak-workspace.ui-sidebar-open main > aside {
    display: block;
  }
  .kafak-workspace .ui-side-brand {
    margin-bottom: 20px;
  }
  .kafak-workspace .phase-nav {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .kafak-workspace #ui-project-controls {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .kafak-workspace #new {
    grid-column: 1 / -1;
  }
  .kafak-workspace #production-workspace {
    padding: 24px 16px;
  }
  .kafak-workspace .production-phase {
    padding: 20px;
  }
  .kafak-workspace #studio {
    padding: 9px;
    font-size: 11px;
  }
  .kafak-workspace #ui-help-toggle {
    padding: 9px;
    font-size: 11px;
  }
  .kafak-workspace #ui-help-toggle .ui-help-label {
    display: none;
  }
}
@media (max-width:480px) {
  .kafak-workspace header {
    gap: 8px;
    padding: 0 12px;
  }
  .kafak-workspace #channelHeading {
    font-size: 12px;
  }
  .kafak-workspace .ui-header-title .ui-eyebrow {
    font-size: 8px;
  }
  .kafak-workspace #channelHeading + small {
    font-size: 9px;
  }
  .kafak-workspace .ui-header-actions {
    gap: 6px;
  }
  .kafak-workspace #studio {
    font-size: 10px;
    padding: 9px 7px;
  }
  .kafak-workspace #ui-menu-button {
    padding: 9px 7px;
  }
  .kafak-workspace #ui-menu-button span {
    display: none;
  }
  .kafak-workspace #production-workspace {
    padding: 22px 12px;
    row-gap: 16px;
  }
  .kafak-workspace .production-phase {
    padding: 16px;
  }
  .kafak-workspace .ui-source-methods {
    gap: 5px !important;
  }
  .kafak-workspace .ui-source-methods button {
    font-size: 10px;
    min-height: 72px;
  }
  .kafak-workspace .ui-source-methods button small {
    font-size: 9px;
  }
  .kafak-workspace #wizard-title {
    font-size: 27px;
  }
  .kafak-workspace #wizard-help {
    font-size: 12px;
  }
  .kafak-workspace .ui-project-config {
    gap: 10px;
  }
  .kafak-workspace .ui-project-config select {
    font-size: 11px;
    padding: 10px 7px;
  }
  .kafak-workspace .wizard-actions {
    gap: 8px;
  }
  .kafak-workspace .wizard-actions .wizard-primary {
    font-size: 12px;
    padding: 12px;
  }
}
@media (prefers-reduced-motion:reduce) {
  .kafak-workspace * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .kafak-workspace header, .kafak-workspace aside, .kafak-workspace .wizard-actions {
    display: none !important;
  }
  .kafak-workspace main, .kafak-workspace #production-workspace {
    display: block;
  }
}
/* Keep actions in document flow: no settings are covered at shorter heights. */
.kafak-workspace .wizard-actions {
  position: static;
  background: var(--ui-panel);
}
.kafak-workspace #ui-advanced-settings {
  margin-top: 20px;
}
.kafak-workspace #ui-advanced-settings > details {
  margin-bottom: 12px;
}
.kafak-workspace .ui-source-description {
  font-size: 11px;
  color: var(--ui-muted);
}
.kafak-workspace #save-topic {
  margin-top: 14px;
}
.kafak-workspace .ui-side-brand small {
  font-size: 9px;
  letter-spacing: .03em;
  white-space: nowrap;
}
@media (max-width:480px) {
  .kafak-workspace #ui-advanced-settings > summary {
    font-size: 11px;
  }
}
/* Shared controls and panels; formerly duplicated across inline/layout styles. */
.kafak-workspace .bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.kafak-workspace summary {
  cursor: pointer;
}
.kafak-workspace h2 {
  font-size: 18px;
}
.kafak-workspace h3 {
  font-size: 15px;
}
.kafak-workspace video, .kafak-workspace audio {
  width: 100%;
  border-radius: 8px;
}
.kafak-workspace #preview-canvas, .kafak-workspace #rendered-frame img {
  display: block;
  width: 100%;
  height: auto;
  background: #080c12;
  border-radius: 8px;
}
.kafak-workspace #rendered-frame {
  margin: 14px 0;
}
.kafak-workspace #channel-logo-preview {
  max-width: 140px;
  max-height: 70px;
  object-fit: contain;
}
.kafak-workspace #thumb-preview {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}
.kafak-workspace .stage-provider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.kafak-workspace .stage-provider select {
  min-width: 130px;
}
.kafak-workspace .stage-provider small {
  flex-basis: 100%;
}
.kafak-workspace #voice-provider-status {
  display: block;
  margin-top: 12px;
}
.kafak-workspace #voice-parts-list audio {
  margin: 10px 0;
}
.kafak-workspace input[type=color] {
  width: 60px;
  height: 38px;
  padding: 3px;
}
.kafak-workspace noscript {
  display: block;
  padding: 14px;
  color: var(--ui-danger);
}
.kafak-workspace #phase-6 > label, .kafak-workspace #youtube-setup > label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 600;
}
.kafak-workspace #phase-6 > label > input, .kafak-workspace #phase-6 > label > textarea, .kafak-workspace #youtube-setup > label > input {
  display: block;
  margin-top: 8px;
  width: 100%;
}
.kafak-workspace #phase-6 > small, .kafak-workspace #youtube-setup > small {
  display: block;
  margin: 8px 0 16px;
}
.kafak-workspace #youtube-connection {
  padding: 14px;
  border-style: solid;
  border-width: 1px;
  border-radius: 10px;
}
.kafak-workspace #youtube-redirect {
  overflow-wrap: anywhere;
}
.kafak-workspace .channel-image-preview {
  width: 100px;
  height: 60px;
  object-fit: contain;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: repeating-conic-gradient(#d7dbe1 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  padding: 5px;
}
.kafak-workspace #console-phase-badge {
  display: inline-block;
  color: #fff;
  border-radius: 6px;
  margin-bottom: 6px;
}

.background-media-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:16px; }
.background-media-card { min-width:0; padding:12px; border:1px solid #37414e; border-radius:12px; background:var(--ui-panel); }
.background-media-card strong { display:block; margin-top:10px; }
.background-media-card p { overflow-wrap:anywhere; font-size:13px; color:#a9b4c3; }
.kafak-workspace .background-media-thumb { display:block; padding:0; width:100%; overflow:hidden; border-radius:8px; }
.background-media-thumb img,.background-media-thumb video { display:block; width:100%; aspect-ratio:16/9; object-fit:cover; background:#05080b; }
#background-media-modal { width:min(1000px,90vw); max-height:90vh; background:var(--ui-panel); color:#edf4f8; border:1px solid #658b9d; border-radius:16px; padding:20px; }
#background-media-modal::backdrop { background:#000b; }
#background-media-modal .bar { display:flex; justify-content:space-between; align-items:center; gap:16px; }
#background-media-preview img,#background-media-preview video { display:block; width:100%; max-height:72vh; object-fit:contain; }

.kafak-workspace #islamic-presentation-field { display: grid; gap: 8px; margin: 18px 0; }
.kafak-workspace #islamic-presentation-field select { max-width: 320px; }
.kafak-workspace #history-research-panel { margin-bottom: 16px; }

#project-loading-notice{padding:24px;border:1px solid #34505f;border-radius:12px;color:var(--ui-text);background:var(--ui-panel)}html[data-app-ready="true"]:not([data-project-loading="true"]) #project-loading-notice{display:none}
/* Mobile drawers remain in the DOM so output tabs and media retain state. */
.kafak-workspace #ui-output-button,
.kafak-workspace .ui-drawer-close,
.kafak-workspace #ui-drawer-backdrop { display: none; }
@media (max-width:800px) {
  body.kafak-workspace { padding-top: 70px; }
  .kafak-workspace header { position: fixed; inset: 0 0 auto; z-index: 80; height: 70px; }
  .kafak-workspace #ui-menu-button { min-width: 44px; min-height: 44px; padding: 10px; }
  .kafak-workspace #ui-menu-button span { display: none; }
  .kafak-workspace #studio { font-size: 0; min-width: 36px; padding: 8px; }
  .kafak-workspace #studio::after { content: "↗"; font-size: 18px; }
  .kafak-workspace #ui-output-button { display: inline-flex; min-height: 44px; align-items: center; padding: 10px; }
  body.kafak-workspace.ui-drawer-open { position: fixed; width: 100%; overflow: hidden; }
  .kafak-workspace #ui-sidebar, .kafak-workspace #ui-output-panel {
    display: block; position: fixed; top: 70px; bottom: 0; height: calc(100dvh - 70px);
    width: min(92vw, 420px); max-width: none; margin: 0 !important; padding: 18px;
    z-index: 70; overflow-y: auto; overscroll-behavior: contain; border-radius: 0;
    background: var(--ui-panel); visibility: hidden; pointer-events: none;
    transition: transform 260ms ease, visibility 0s linear 260ms;
  }
  .kafak-workspace #ui-sidebar { left: 0; right: auto; transform: translateX(-105%); border-right: 1px solid var(--ui-line); }
  .kafak-workspace #ui-output-panel { right: 0; left: auto; transform: translateX(105%); border-left: 1px solid var(--ui-line); }
  .kafak-workspace.ui-sidebar-open #ui-sidebar, .kafak-workspace.ui-output-open #ui-output-panel {
    transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s;
  }
  .kafak-workspace .ui-drawer-close { display: block; margin: 0 0 16px auto; min-height: 44px; }
  .kafak-workspace #ui-drawer-backdrop {
    display: block; position: fixed; inset: 70px 0 0; width: 100%; height: calc(100dvh - 70px);
    z-index: 60; border: 0; border-radius: 0; background: rgba(0,0,0,.6); opacity: 0;
    visibility: hidden; pointer-events: none; transition: opacity 260ms ease, visibility 0s linear 260ms;
  }
  .kafak-workspace.ui-drawer-open #ui-drawer-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
}

.kafak-workspace #ui-sidebar #studio { display:flex; justify-content:center; margin:0 0 18px; padding:12px; font-size:14px; }
.kafak-workspace #ui-sidebar #studio::after { content:none; }

.kafak-workspace .scene-playing { box-shadow:0 0 20px 3px color-mix(in srgb, var(--ui-accent, var(--ui-accent)) 28%, transparent); scroll-margin-block:90px; }
.kafak-workspace .scene-play-status { width:100%; color:var(--ui-accent, var(--ui-accent)); }

/* Scene actions must not inherit the full-width section disclosure styles. */
.kafak-workspace details.scene-actions-menu { width:40px; min-width:40px; flex:0 0 40px; padding:0; margin:0 0 0 auto; border:0; background:transparent; overflow:visible; }
.kafak-workspace details.scene-actions-menu > summary { display:flex; align-items:center; justify-content:center; width:40px; min-height:40px; padding:4px !important; margin:0; border-radius:8px; }
.kafak-workspace details.scene-actions-menu > summary::before,.kafak-workspace details.scene-actions-menu > summary::after,.kafak-workspace details.scene-actions-menu > summary::-webkit-details-marker { display:none; content:none; }
.kafak-workspace details.scene-actions-menu > div { width:140px; min-width:140px; box-sizing:border-box; }
.kafak-workspace details.scene-actions-menu button { width:100%; min-width:0; white-space:nowrap; word-break:normal; overflow-wrap:normal; }
.kafak-workspace #production-workspace { overflow-anchor:none; }

.kafak-workspace .ai-media-card {border:1px solid #355369;border-radius:12px;padding:16px;margin:16px 0;} .kafak-workspace .ai-media-card textarea{width:100%;} .kafak-workspace .ai-media-card a {display:inline-block;margin:12px;}

.kafak-workspace .media-library-tabs{display:flex;gap:6px;padding:6px;background:var(--ui-bg);border:1px solid #2b3d47;border-radius:14px;margin:18px 0;max-width:520px;}
.kafak-workspace .media-library-tabs button{flex:1;margin:0;border:0;background:transparent;color:#9caeba;border-radius:10px;}
.kafak-workspace .media-library-tabs button[aria-selected="true"]{background:var(--ui-accent);color:var(--ui-accent-ink);box-shadow:0 3px 12px #0003;}
.kafak-workspace .media-source-options{display:flex;flex-wrap:wrap;gap:12px 24px;}
.kafak-workspace .media-source-options label{display:flex;gap:8px;align-items:center;margin:0;}
.kafak-workspace .ai-scene-card{display:grid;grid-template-columns:minmax(180px,30%) minmax(0,1fr);gap:22px;align-items:start;}
.kafak-workspace .ai-media-preview{aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;background:#0b151b;border:1px dashed #426358;border-radius:12px;overflow:hidden;color:#95afa5;text-align:center;padding:8px;box-sizing:border-box;}
.kafak-workspace .ai-media-preview img,.kafak-workspace .ai-media-preview video{width:100%;height:100%;object-fit:contain;}
.kafak-workspace .ai-scene-asset input{width:100%;margin-top:12px;}
.kafak-workspace .ai-scene-prompt{min-width:0;}.kafak-workspace .ai-scene-prompt h4{margin-top:0;}
@media(max-width:600px){.kafak-workspace .ai-scene-card{grid-template-columns:1fr;}.kafak-workspace .media-library-tabs button{padding:12px 8px;font-size:14px;}}

.workspace-brand-row{display:flex;align-items:center;gap:8px;position:relative}.workspace-brand-row .ui-side-brand{flex:1;min-width:0}.workspace-project-menu{position:relative;flex:none}.workspace-project-menu>summary{list-style:none;cursor:pointer;font-size:26px;padding:6px 10px;border-radius:8px;color:var(--ui-accent)}.workspace-project-menu>summary::-webkit-details-marker{display:none}.workspace-project-menu>div{position:absolute;right:0;top:100%;z-index:40;width:210px;padding:8px;background:var(--ui-panel);border:1px solid #40525c;border-radius:10px;box-shadow:0 8px 24px #0008}.workspace-project-menu button{width:100%;white-space:normal;font-size:14px}

.kafak-workspace details.workspace-project-menu{margin:0;padding:0;border:0;background:transparent;overflow:visible}.kafak-workspace details.workspace-project-menu>summary{margin:0;border:0;padding:6px 10px!important;font-size:26px;color:var(--ui-accent)}.kafak-workspace details.workspace-project-menu>summary::before,.kafak-workspace details.workspace-project-menu>summary::after{display:none;content:none}.kafak-workspace details.workspace-project-menu>div{margin:0;max-width:none;box-sizing:border-box}

/* Match the other output tabs and keep batch history inside its own viewport. */
.kafak-workspace #output-pane-Batches{max-height:calc(100dvh - 280px);overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;padding-right:6px;font-size:11px;line-height:1.65;min-height:0;}
.kafak-workspace #output-pane-Batches .batch-voice-panel{margin:0!important;padding:10px!important;border-color:var(--ui-line)!important;}
.kafak-workspace #output-pane-Batches :is(p,small,span){font-size:11px;line-height:1.65;}
.kafak-workspace #output-pane-Batches :is(strong,h4){font-size:12px;line-height:1.5;}
.kafak-workspace #output-pane-Batches h4{margin:16px 0 8px;}
.kafak-workspace #output-pane-Batches button{font-size:11px;line-height:1.4;padding:8px 10px;min-height:32px;border-radius:8px;margin:3px 4px 3px 0;min-width:0;width:auto;}
.kafak-workspace #output-pane-Batches .batch-history-row button{justify-self:start;}
.kafak-workspace #output-pane-Batches::-webkit-scrollbar{width:7px;}
.kafak-workspace #output-pane-Batches::-webkit-scrollbar-thumb{background:#40525c;border-radius:8px;}
.kafak-workspace.ui-output-expanded #output-pane-Batches{max-height:calc(100dvh - 180px);}
@media(max-width:800px){.kafak-workspace #output-pane-Batches{max-height:calc(100dvh - 210px);}}

/* Shared Charcoal / Light Blue controls across every production step. */
.kafak-workspace button,.kafak-workspace select{min-height:44px}
.kafak-workspace button{margin:4px 6px 4px 0;padding:10px 16px;line-height:1.4}
.kafak-workspace input,.kafak-workspace textarea,.kafak-workspace select{background:var(--ui-field);color:var(--ui-text);border-color:var(--ui-line)}
.kafak-workspace button:focus-visible,.kafak-workspace input:focus-visible,.kafak-workspace select:focus-visible,.kafak-workspace textarea:focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}
.kafak-workspace .audio-source-card,.kafak-workspace #audio-transcript-upload,.kafak-workspace .part-editor,.kafak-workspace .part-editor-bar,.kafak-workspace .word-review-panel,.kafak-workspace .background-media-card,.kafak-workspace #background-media-modal,.kafak-workspace .ai-media-card,.kafak-workspace .media-library-tabs,.kafak-workspace .ai-media-preview,.kafak-workspace .workspace-project-menu>div{background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
.kafak-workspace .audio-source-card audio{background:var(--ui-panel)!important}
.kafak-workspace .media-library-tabs button[aria-selected="true"]{background:var(--ui-accent);color:var(--ui-accent-ink)}
.kafak-workspace .workspace-project-menu>summary{color:var(--ui-accent)!important}
.kafak-workspace #phase-1 .field-help-ml,.kafak-workspace #phase-1 #ui-step-hint-1,.kafak-workspace #phase-1 #ui-automation-summary{display:none!important}
.kafak-workspace #topic-input{min-height:90px}
.kafak-workspace .sources-heading{margin-top:28px}
.kafak-workspace #category-controls>div>label,.kafak-workspace .script-user-instructions{margin-top:24px}
.kafak-workspace #source-transcript-panel{margin:20px 0}
.kafak-workspace .source-add-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:20px 0 28px}
.kafak-workspace .source-add-row select{width:auto;max-width:100%}
.kafak-workspace .source-add-row button{margin:0}
.kafak-workspace #script-options{margin:24px 0}
.kafak-workspace #script-options .ui-project-config{margin-top:16px}
.kafak-workspace #ui-advanced-settings,.kafak-workspace #save-source-instructions,.kafak-workspace #save-topic,.kafak-workspace #add-audio-source{display:none!important}
.kafak-workspace #phase-1 .wizard-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start}
.kafak-workspace #phase-1 .wizard-actions>button{flex:1 1 240px;margin:0;width:auto}
.kafak-workspace #phase-1 .wizard-actions>p,.kafak-workspace #external-script-panel{flex-basis:100%;width:100%;margin:0}
.kafak-workspace #external-script-panel{margin-top:16px}
.kafak-workspace #script-package-status:empty{display:none}
.kafak-workspace #script-instructions{min-height:110px}
.kafak-workspace .audio-source-card{padding:16px;margin:16px 0}
.kafak-workspace .audio-source-card details{margin:12px 0}
.kafak-workspace .audio-source-card textarea{min-height:160px}
.kafak-workspace .audio-source-row,.kafak-workspace .audio-batch-toolbar{gap:12px}
.kafak-workspace .audio-source-row button,.kafak-workspace .audio-batch-toolbar button{margin:0}
.kafak-workspace .audio-source-row input{min-width:0!important}
.kafak-workspace .audio-source-card .audio-source-head button{min-width:44px}
.kafak-workspace .project-input-heading{gap:12px;flex-wrap:wrap}
@media(max-width:800px){.kafak-workspace #phase-1 .wizard-actions>button{flex-basis:100%;min-height:48px}.kafak-workspace input,.kafak-workspace textarea,.kafak-workspace select{font-size:16px}.kafak-workspace .audio-source-row{align-items:stretch}.kafak-workspace .audio-source-row input{flex-basis:100%}.kafak-workspace .project-input-heading h2{flex-basis:100%}}

.kafak-workspace .phase-nav button[aria-current="step"]{background:#202d40;border-color:#3e5778;color:var(--ui-accent)}
.kafak-workspace details,.kafak-workspace details>summary,.kafak-workspace .output-tabs,.kafak-workspace #console,.kafak-workspace #instruction-dialog{background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line)}
.kafak-workspace button:not(.primary):not(.wizard-primary):not([aria-current="step"]){background:var(--ui-panel-raised);border-color:var(--ui-line);color:var(--ui-text)}
.kafak-workspace #instruction-upload,.kafak-workspace #instruction-save{background:var(--ui-panel-raised);color:var(--ui-accent);border-color:var(--ui-line)}
.kafak-workspace #console-api-key,.kafak-workspace #console span{background:var(--ui-panel-raised)!important;color:var(--ui-accent)!important;border-color:var(--ui-line)!important}
.kafak-workspace #audio-transcript-upload{border:0;padding:0;background:transparent!important}
.kafak-workspace #script-options>label{margin-top:16px}
.kafak-workspace .audio-source-card details[hidden]{display:none!important}
.kafak-workspace #topic-input{height:90px;min-height:90px!important}

.project-input-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.project-input-heading h2{margin:0}#instruction-upload,#instruction-save{background:var(--ui-panel-raised);color:#fff;border:1px solid var(--ui-line)}#instruction-dialog{width:min(820px,92vw);max-height:88vh;overflow:auto;background:var(--ui-panel);color:#e7edf3;border:1px solid var(--ui-line);border-radius:16px;padding:24px}#instruction-dialog::backdrop{background:#000a}#instruction-dialog textarea{display:block;width:100%;min-height:330px;box-sizing:border-box;resize:vertical}#instruction-drop{border:2px dashed var(--ui-line);border-radius:10px;padding:20px;margin:12px 0;text-align:center;cursor:pointer}#instruction-drop.dragging{background:var(--ui-panel-raised)}.instruction-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:16px}#instruction-dialog button{margin:4px}#instruction-status{min-height:24px}#instruction-file-name{overflow-wrap:anywhere}

#instruction-dialog:not([open]){display:none}
/* Compact source workspace */


.kafak-workspace .script-primary-actions{position:sticky;top:86px;z-index:35;display:flex;gap:12px;padding:12px;margin:0 0 24px;background:var(--ui-bg,#121212);border-radius:12px;box-shadow:0 6px 18px #0003}
.kafak-workspace .script-primary-actions button{flex:1;min-height:48px;margin:0;font-weight:650}
.kafak-workspace #export-script-package{background:#93c5fd!important;color:#172554!important;border:0}
.kafak-workspace .script-primary-actions #wizard-next-1{background:#60a5fa!important;color:#101827!important;border:0}
.kafak-workspace .audio-source-card{padding:12px 14px!important;margin:10px 0!important;border:0!important;background:#222225!important;border-radius:12px}
.kafak-workspace .audio-source-head{display:flex;gap:12px;align-items:center;margin:0;flex-wrap:wrap}
.kafak-workspace .audio-source-head h3{font-size:14px;flex:1;min-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kafak-workspace .audio-source-status{font-size:12px;color:var(--ui-muted);margin:0;max-width:100%;overflow-wrap:anywhere}
.kafak-workspace .audio-source-head button{margin:0;padding:8px;min-height:44px;font-size:14px;color:var(--ui-accent)}
.kafak-workspace .audio-source-head .audio-source-status{order:2}
.kafak-workspace .audio-source-head .audio-edit-button{order:3}
.kafak-workspace .audio-source-card > audio,.kafak-workspace .audio-source-card > .audio-transcript-details{display:none!important}
.kafak-workspace .audio-source-options{border:0;background:transparent;margin:0!important;font-size:12px}
.kafak-workspace .audio-source-options:not([open]){margin-top:4px!important}
.kafak-workspace .audio-source-options summary{padding:4px 0;color:var(--ui-muted)}
.kafak-workspace .link-source-preview{padding:14px;background:#222225;border:0;border-radius:12px}
.kafak-workspace .link-source-preview>textarea{height:160px!important;min-height:100px!important;max-height:220px!important;overflow-y:auto!important;border:0;resize:vertical}
.kafak-workspace .link-source-preview h3{font-size:14px;margin:0 0 10px}
.kafak-workspace .link-source-preview button{margin:0 8px 8px 0;max-width:100%;overflow-wrap:anywhere}
@media(max-width:800px){
 .kafak-workspace .script-primary-actions{top:70px;gap:8px;padding:8px;margin-bottom:16px;flex-wrap:wrap}
 .kafak-workspace .script-primary-actions button{flex-basis:100%;font-size:13px}
 .kafak-workspace .audio-source-head{gap:8px}
 .kafak-workspace .audio-source-status{flex-basis:100%;order:4!important}
}

.kafak-workspace .script-primary-actions{flex-wrap:wrap}
.kafak-workspace .script-primary-actions #script-package-status{flex-basis:100%;margin:0;font-size:13px}

.kafak-workspace #audio-active-progress{white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;background:#20334b;color:#bfdbfe;border-radius:8px;font-size:13px;line-height:1.6}
.kafak-workspace .audio-source-card.is-transcribing{box-shadow:inset 3px 0 #60a5fa}

/* Compact, vertically centred scene selectors. Keep a 44px touch target. */
.kafak-workspace .batch-scene-label{padding:0;line-height:1;margin-block:0}
.kafak-workspace .scene-voice-controls > strong{align-self:center;margin:0}

.kafak-workspace .script-tools{margin:12px 0;padding:0 12px;border:1px solid var(--ui-line,#34343a);border-radius:10px;background:var(--ui-panel,#18181b)}
.kafak-workspace .script-tools>summary{padding:14px 0;cursor:pointer;font-weight:600}
.kafak-workspace .script-tools .master-voice-panel{border:0!important;padding:8px 0!important;margin:0 0 12px!important;border-radius:0!important}
.kafak-workspace .script-tools .master-voice-panel>br{display:none}
.kafak-workspace .script-tools button,.kafak-workspace .script-tools select{margin:4px;max-width:100%}
.kafak-workspace .script-tools p:empty,.kafak-workspace #script>p:empty{display:none}

.kafak-workspace .voice-provider-radios{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;margin:8px 0 12px}
.kafak-workspace .voice-provider-radios label{display:inline-flex;align-items:center;gap:8px;min-height:44px;margin:0;padding:0;cursor:pointer;line-height:1.4}
.kafak-workspace .voice-provider-radios input[type=radio]{display:block;flex:0 0 18px;width:18px;height:18px;min-width:18px;min-height:18px;margin:0;padding:0;accent-color:var(--ui-accent,#8bc7ff)}

.kafak-workspace .scene-insert-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0}.kafak-workspace .scene-insert-tools input{width:80px}.kafak-workspace .scene-insert-tools button,.kafak-workspace .scene-insert-tools input,.kafak-workspace .scene-insert-tools select{margin:0;height:44px;min-height:44px;padding:8px 12px;box-sizing:border-box}

.kafak-workspace .scene-actions-menu{position:relative;margin-left:auto;flex-shrink:0}
.kafak-workspace .scene-actions-menu>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:center;width:40px;min-height:40px;font-size:24px}
.kafak-workspace .scene-actions-menu>div{position:absolute;right:0;top:100%;z-index:100;width:min(260px,80vw)!important;box-sizing:border-box;padding:8px;background:var(--ui-panel,#18181b);border:1px solid var(--ui-line,#444);border-radius:10px;box-shadow:0 6px 18px #0006}
.kafak-workspace .scene-actions-menu>div>button{display:block!important;width:100%!important;min-width:0!important;max-width:100%;height:auto!important;min-height:44px;margin:4px 0!important;padding:10px 12px!important;white-space:normal!important;overflow-wrap:anywhere;line-height:1.35;text-align:left;box-sizing:border-box}

.kafak-workspace #voice-parts-list>div{position:relative}.kafak-workspace #voice-parts-list>div>.scene-actions-menu{position:absolute;right:8px;top:8px}.kafak-workspace #voice-parts-list>div>strong{padding-right:40px;display:inline-block}

.scene-note{width:100%;box-sizing:border-box;margin:8px 0;padding:8px;border-radius:8px}.scene-note.needs-fix{background:#423515;border:1px solid #b89332;color:#ffe298}.scene-note p{white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0}.scene-note textarea{width:100%;box-sizing:border-box;min-height:90px}.scene-note button{font-size:13px;white-space:normal}.scene-note.needs-fix>button{color:#ffe298}
