/* AUTOTUBE USER1 VISUAL V3.4 — SCENARIO FULL WORKSPACE */
/* Restores viewport-filling scenario canvas after V3.3 empty-state clamp.
   Visual only: no DOM, IDs, JavaScript, API or generation behavior changes. */

@media (min-width: 1101px) {
  /* Keep the compact upper navigation, but let the scenario workspace
     occupy the remaining viewport, with matching outer page gutters. */
  html:not([data-autotube-theme="dark"]) body:has(#rewriteTab.active) .app-shell {
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    width: calc(100% - 36px) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-bottom: 14px !important;
    overflow: hidden !important;
  }

  html:not([data-autotube-theme="dark"]) body #rewriteTab.active {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    align-self: stretch !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  /* V3.3 deliberately clamped EMPTY scenarios to 440–520px.
     Override precisely that rule so empty AND populated cases are full height. */
  html:not([data-autotube-theme="dark"]) body #rewriteTab.active:has(#scenarioTopicsList:empty):has(#scenarioGeneratedEnglish:placeholder-shown):has(#scenarioGeneratedLocalized:placeholder-shown) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
  }
  html:not([data-autotube-theme="dark"]) body #rewriteTab.active:has(#scenarioTopicsList:empty):has(#scenarioGeneratedEnglish:placeholder-shown):has(#scenarioGeneratedLocalized:placeholder-shown) > #scenarioGeneratePane:not(.hidden) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
  }

  /* Both scenarios modes fill the same canvas, 2 proportional columns. */
  html:not([data-autotube-theme="dark"]) body #rewriteTab.active > #scenarioGeneratePane:not(.hidden),
  html:not([data-autotube-theme="dark"]) body #rewriteTab.active > #scenarioRewritePane:not(.hidden) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
    align-self: stretch !important;
  }
  html:not([data-autotube-theme="dark"]) body #rewriteTab.active > #scenarioGeneratePane:not(.hidden) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-panel,
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results {
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
  }
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results {
    display: grid !important;
    grid-template-rows: minmax(0,1fr) minmax(0,1fr) !important;
    gap: 9px !important;
  }
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results > .text-section {
    min-height: 0 !important;
    height: 100% !important;
  }
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-stage,
  html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results textarea {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
}

/* Avoid trapping controls offscreen on unusually short desktop windows. */
@media (min-width: 1101px) and (max-height: 600px) {
  html:not([data-autotube-theme="dark"]) body:has(#rewriteTab.active) {
    overflow-y: auto !important;
  }
  html:not([data-autotube-theme="dark"]) body:has(#rewriteTab.active) .app-shell {
    height: auto !important;
    min-height: 600px !important;
    max-height: none !important;
    overflow: visible !important;
  }
  html:not([data-autotube-theme="dark"]) body #rewriteTab.active {
    min-height: 440px !important;
  }
}

/* AUTOTUBE_PRIVATE_VISUAL_V3_4_END */
