/* AutoTube Factory / User1 only / Script UX V3.5 */
/* Pure presentation. All generation fields, IDs, API calls and JavaScript remain unchanged. */

@media (min-width: 851px) {
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }
}

/* Step 1: topic-generation pane is explicit and beginner-friendly. */
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-panel > .section-heading label {
  font-family: Inter, sans-serif !important;
  font-size: clamp(17px, 1.34vw, 22px) !important;
  font-weight: 900 !important;
  letter-spacing: -.03em !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-stage {
  background: #FBFBFA !important;
  border-color: #E9E9E7 !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane #scenarioTopicView:has(#scenarioTopicsList:empty) > #scenarioTopicEmpty:not(.hidden):not([hidden]) {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 20px 32px !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 13px;
  text-align: center;
  color: #181818 !important;
  font-family: Inter, sans-serif !important;
  font-size: clamp(17px, 1.4vw, 22px) !important;
  font-weight: 900 !important;
  letter-spacing: -.03em !important;
  line-height: 1.4 !important;
  text-wrap: balance;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane #scenarioTopicView:has(#scenarioTopicsList:empty) > #scenarioTopicEmpty:not(.hidden):not([hidden])::before {
  content: '✦';
  color: #F00016;
  font-size: 43px;
  line-height: 1;
  margin-bottom: 4px;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane #scenarioTopicView:has(#scenarioTopicsList:empty) > #scenarioTopicEmpty:not(.hidden):not([hidden])::after {
  content: 'Тут з’являться готові теми для ваших відео';
  color: #77777B;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: normal;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane #scenarioTopicsList:empty {
  display: none !important;
}

/* Step 2: keep the English textarea in the DOM for app logic, never show it in the generator UI. */
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results > .text-section:has(#scenarioGeneratedEnglish) {
  display: none !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  gap: 0 !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results > .text-section:has(#scenarioGeneratedLocalized) {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results .at-private-script-title {
  font-family: Inter, sans-serif !important;
  font-size: clamp(17px,1.34vw,22px) !important;
  font-weight: 900 !important;
  color: #101011 !important;
  letter-spacing: -.03em !important;
  line-height: 1.2 !important;
}
/* Preserve original label's DOM and announced language for screen readers and existing scripts. */
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane #scenarioGeneratedLocalizedLabel {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .at-private-script-empty {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 14px;
  padding: 24px;
  border: 1px solid #E9E9E7;
  border-radius: 12px;
  background: #FBFBFA;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .at-private-script-empty svg {
  width: 45px;
  height: 45px;
  color: #8B8F95;
  stroke: currentColor;
  flex: 0 0 auto;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .at-private-script-empty strong {
  display: block;
  max-width: 420px;
  font-family: Inter, sans-serif !important;
  font-size: clamp(17px,1.35vw,22px) !important;
  font-weight: 900 !important;
  line-height: 1.4 !important;
  letter-spacing: -.025em !important;
  color: #27272A !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .at-private-script-empty p {
  max-width: 420px;
  margin: 0;
  font-family: Inter, sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #838388 !important;
  line-height: 1.6 !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results:has(#scenarioGeneratedLocalized:placeholder-shown) .at-private-script-empty {
  display: flex !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results:has(#scenarioGeneratedLocalized:placeholder-shown) #scenarioGeneratedLocalized {
  display: none !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results:not(:has(#scenarioGeneratedLocalized:placeholder-shown)) .at-private-script-empty {
  display: none !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results:not(:has(#scenarioGeneratedLocalized:placeholder-shown)) #scenarioGeneratedLocalized {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #FBFBFA !important;
}
/* User sees clear readiness instructions without new event handlers. */
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane:has(#scenarioScriptControls:not(.hidden)) .at-private-script-empty .at-private-step-initial {
  display: none !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane:not(:has(#scenarioScriptControls:not(.hidden))) .at-private-script-empty .at-private-step-ready {
  display: none !important;
}

@media (max-width: 850px) {
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results {
    min-height: 300px !important;
  }
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results > .text-section:has(#scenarioGeneratedLocalized) {
    min-height: 300px !important;
  }
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane #scenarioTopicEmpty {
    padding: 30px 16px !important;
  }
}
/* AUTOTUBE_PRIVATE_SCENARIO_UX_V3_5_END */

/* Hide the technical English output regardless of color theme. */
body #scenarioGeneratePane .scenario-generation-results > .text-section:has(#scenarioGeneratedEnglish) {
  display: none !important;
}
/* Retain state switching when someone changes to the legacy dark theme. */
html[data-autotube-theme="dark"] body #scenarioGeneratePane .scenario-generation-results {
  display: flex !important;
  flex-direction: column !important;
}
html[data-autotube-theme="dark"] body #scenarioGeneratePane .scenario-generation-results > .text-section:has(#scenarioGeneratedLocalized) {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
}
html[data-autotube-theme="dark"] body #scenarioGeneratePane .scenario-generation-results:has(#scenarioGeneratedLocalized:placeholder-shown) #scenarioGeneratedLocalized {
  display: none !important;
}
html[data-autotube-theme="dark"] body #scenarioGeneratePane .scenario-generation-results:not(:has(#scenarioGeneratedLocalized:placeholder-shown)) #scenarioGeneratedLocalized {
  display: block !important;
  flex: 1 1 auto !important;
}
html[data-autotube-theme="dark"] body #scenarioGeneratePane .at-private-script-empty {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  background: #202124;
  color: #F5F5F5;
  padding: 24px;
  border-radius: 12px;
}
html[data-autotube-theme="dark"] body #scenarioGeneratePane .at-private-script-empty strong {color: #F5F5F5;}
html[data-autotube-theme="dark"] body #scenarioGeneratePane .at-private-script-empty p {color: #BFC0C4;}
html[data-autotube-theme="dark"] body #scenarioGeneratePane .scenario-generation-results:not(:has(#scenarioGeneratedLocalized:placeholder-shown)) .at-private-script-empty {display: none !important;}
html[data-autotube-theme="dark"] body #scenarioGeneratePane #scenarioGeneratedLocalizedLabel {position:absolute!important;width:1px!important;height:1px!important;clip-path:inset(50%)!important;overflow:hidden!important;}
/* Topic options replace the guidance immediately, even when legacy JS only fills the list. */
body #scenarioGeneratePane #scenarioTopicView:has(#scenarioTopicsList:not(:empty)) > #scenarioTopicEmpty {
  display: none !important;
}
