/* AUTOTUBE USER1 PRIVATE SCENARIO UX V4.1 — presentation only */
:root{--at41-red:#F00016;--at41-black:#101011;--at41-gray:#8B8F95;}

/* Scenario-generation: hide two redundant captions only, never their data/control machinery */
/* USER1_V42: "generate more" removed from HTML and app.js.
   Also suppress stale cached DOM versions, even against old !important rules. */
#scenarioGeneratePane #scenarioTopicMoreActions,
#scenarioGeneratePane #generateMoreScenarioTopicsButton {
  display: none !important;
  visibility: hidden !important;
}
#scenarioGeneratePane .at41-hide-copy{display:none!important;}

/* Analysis modal — primary action visually agrees with AutoTube */
html:not([data-autotube-theme="dark"]) body #scenarioProfileModal #scenarioProfileStartAnalysis:not(:disabled){
  background:var(--at41-red)!important;background-image:none!important;color:white!important;
  border-color:var(--at41-red)!important;box-shadow:0 8px 18px rgba(240,0,22,.14)!important;
  font:900 14px/1.2 Inter,Arial,sans-serif!important;letter-spacing:-.015em!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioProfileModal #scenarioProfileStartAnalysis:hover:not(:disabled){
  background:#D60014!important;border-color:#D60014!important;
}

/* Unified layout — same content footprint and proportions as Scenario Generation */
html:not([data-autotube-theme="dark"]) body #rewriteTab > #scenarioRewritePane:not(.hidden){
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:12px!important;align-items:stretch!important;min-width:0!important;min-height:0!important;
  width:100%!important;height:100%!important;max-height:none!important;overflow:hidden!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel,
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-results-column .localized-result-section {
  box-sizing:border-box!important;min-height:0!important;height:100%!important;width:100%!important;
  border:1px solid #E8E8E6!important;border-radius:20px!important;background:#FFFFFF!important;
  background-image:none!important;box-shadow:0 10px 25px rgba(14,14,14,.035)!important;
  padding:12px!important;overflow:hidden!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel {
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:auto minmax(0,1fr) auto!important;
  grid-template-areas:"heading heading" "input input" "controls action"!important;
  align-items:stretch!important;column-gap:10px!important;row-gap:8px!important;position:relative!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel > .section-heading{grid-area:heading!important;}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel > #source{
  grid-area:input!important;height:100%!important;width:100%!important;min-height:0!important;
  border:1px solid #E8E8E6!important;border-radius:12px!important;background:#FBFBFA!important;
  padding:14px 15px!important;resize:none!important;font:500 14px/1.55 Inter,Arial,sans-serif!important;
  color:#181818!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel > #source::placeholder{color:transparent!important;}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel > .rewrite-source-controls{
  grid-area:controls!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;
  flex-wrap:nowrap!important;min-width:0!important;gap:8px!important;margin:0!important;padding:0!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-language-field {
  margin:0!important;width:auto!important;min-width:125px!important;flex:0 1 174px!important;
}
html body #scenarioRewritePane .rewrite-language-field > .field-label{display:none!important;}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane #targetLanguage,
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane #importButton{
  margin:0!important;min-height:41px!important;height:41px!important;border-radius:11px!important;
  font-family:Inter,Arial,sans-serif!important;font-weight:700!important;font-size:13px!important;
  border:1px solid #E0E0E0!important;background:#FFFFFF!important;color:#111!important;
  box-shadow:none!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane #importButton{padding:8px 13px!important;white-space:nowrap!important;}
html body #scenarioRewritePane #clearButton{display:none!important;}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel > .rewrite-action-area{
  grid-area:action!important;margin:0!important;padding:0!important;display:flex!important;
  justify-content:flex-end!important;align-items:center!important;flex-wrap:nowrap!important;gap:8px!important;
  min-width:0!important;position:relative!important;
}
html body #scenarioRewritePane #rewriteButton{display:none!important;}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane #at-v41-unique-button {
  display:inline-flex!important;justify-content:center!important;align-items:center!important;
  border:1px solid var(--at41-red)!important;border-radius:12px!important;
  background:var(--at41-red)!important;color:#fff!important;min-height:41px!important;
  min-width:175px!important;padding:9px 18px!important;
  font:900 14px/1.2 Inter,Arial,sans-serif!important;letter-spacing:-.015em!important;
  box-shadow:0 7px 18px rgba(240,0,22,.13)!important;cursor:pointer!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane #at-v41-unique-button:hover:not(:disabled){background:#D60014!important;}
html body #scenarioRewritePane #at-v41-unique-button:disabled{background:#EAEAEA!important;color:#777!important;border-color:#EAEAEA!important;box-shadow:none!important;cursor:wait!important;}
html body #scenarioRewritePane #progress{position:absolute!important;overflow:hidden!important;width:1px!important;height:1px!important;clip-path:inset(50%)!important;white-space:nowrap!important;}
html body #scenarioRewritePane #warning:empty,html body #scenarioRewritePane #error:empty{display:none!important;}
/* Errors remain available above action when nonempty. */
html body #scenarioRewritePane #warning:not(:empty),html body #scenarioRewritePane #error:not(:empty){
  position:absolute!important;bottom:calc(100% + 10px)!important;right:0!important;z-index:3!important;
  min-width:240px!important;max-width:460px!important;white-space:normal!important;
  background:#FFF2F3!important;color:#990010!important;border:1px solid #F4B3BA!important;
  border-radius:9px!important;padding:9px!important;font:700 12px/1.4 Inter,Arial,sans-serif!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel .section-heading label,
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .localized-result-section .section-heading label{
  font:900 clamp(17px,1.34vw,22px)/1.25 Inter,Arial,sans-serif!important;
  letter-spacing:-.03em!important;color:#101011!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-results-column{
  display:flex!important;flex-direction:column!important;min-width:0!important;min-height:0!important;
  height:100%!important;gap:0!important;
}
/* English text stays in its original textarea and JS model; it is simply not visible to User1. */
html body #scenarioRewritePane .english-result-section{display:none!important;}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .localized-result-section{
  display:flex!important;flex-direction:column!important;position:relative!important;gap:8px!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane #localizedResult{
  flex:1 1 auto!important;height:auto!important;min-height:0!important;width:100%!important;
  background:#FBFBFA!important;border:1px solid #E8E8E6!important;border-radius:12px!important;
  font:500 14px/1.55 Inter,Arial,sans-serif!important;color:#161616!important;resize:none!important;
}
html body #scenarioRewritePane:not(.at-v41-has-result) #localizedResult,
html body #scenarioRewritePane:not(.at-v41-has-result) .localized-result-section .result-actions{display:none!important;}
html body #scenarioRewritePane .localized-result-section > .section-heading{flex:0 0 auto!important;}
html body #scenarioRewritePane .localized-result-section .result-actions{flex:0 0 auto!important;}
html body #scenarioRewritePane .at-v41-unique-empty,
html body #scenarioRewritePane .at-v41-unique-progress{
  display:none;flex:1 1 auto;min-height:0;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;gap:14px;padding:25px;background:#FBFBFA;border:1px solid #E8E8E6;border-radius:12px;
}
html body #scenarioRewritePane:not(.at-v41-has-result):not(.at-v41-working) .at-v41-unique-empty{display:flex!important;}
html body #scenarioRewritePane.at-v41-working .at-v41-unique-progress{display:flex!important;}
html body #scenarioRewritePane.at-v41-working #localizedResult,
html body #scenarioRewritePane.at-v41-working .localized-result-section .result-actions,
html body #scenarioRewritePane.at-v41-working .at-v41-unique-empty{display:none!important;}
html body #scenarioRewritePane .at-v41-unique-empty svg,
html body #scenarioRewritePane .at-v41-source-empty svg{width:40px;height:40px;stroke:currentColor;fill:none;flex:0 0 auto;}
html body #scenarioRewritePane .at-v41-unique-empty svg{color:#8B8F95;}
html body #scenarioRewritePane .at-v41-unique-empty strong,
html body #scenarioRewritePane .at-v41-source-empty strong{color:#101011;font:900 clamp(17px,1.4vw,22px)/1.4 Inter,Arial,sans-serif;letter-spacing:-.03em;max-width:460px;}
html body #scenarioRewritePane .at-v41-unique-empty p,
html body #scenarioRewritePane .at-v41-source-empty p{color:#848488;font:500 13px/1.5 Inter,Arial,sans-serif;margin:0;max-width:450px;}
/* Native textarea remains editable and clickable; instructional overlay never steals pointer events. */
html body #scenarioRewritePane .at-v41-source-empty{
  position:absolute;left:15px;right:15px;top:60px;bottom:69px;display:none;
  pointer-events:none;flex-direction:column;justify-content:center;align-items:center;gap:14px;
  z-index:1;text-align:center;padding:20px;
}
html body #scenarioRewritePane:not(.at-v41-has-source) .at-v41-source-empty{display:flex!important;}
html body #scenarioRewritePane .at-v41-source-empty svg{color:#F00016;stroke-width:1.9;}
html body #scenarioRewritePane .at-v41-unique-progress .at-v41-progress-ring{width:min(240px,55%);height:auto;max-height:40vh;overflow:visible;}
html body #scenarioRewritePane .at-v41-ring-track{fill:none;stroke:#EBEBEB;stroke-width:13;}
html body #scenarioRewritePane .at-v41-ring-value{fill:none;stroke:#F00016;stroke-width:13;stroke-linecap:round;transform-origin:120px 120px;transform:rotate(-90deg);transition:stroke-dashoffset .4s linear;}
html body #scenarioRewritePane .at-v41-percent{fill:#101011;font:900 49px/1 Inter,Arial,sans-serif;letter-spacing:-.05em;}
html body #scenarioRewritePane .at-v41-loading-label{color:#101011;font:900 clamp(19px,1.55vw,25px)/1.25 Inter,Arial,sans-serif;letter-spacing:-.03em;}
html body #scenarioRewritePane #at-v41-unique-button:focus-visible{outline:3px solid rgba(240,0,22,.34)!important;outline-offset:2px;}
@media(max-width:850px){
  html:not([data-autotube-theme="dark"]) body #rewriteTab > #scenarioRewritePane:not(.hidden){grid-template-columns:1fr!important;height:auto!important;overflow:auto!important;}
  html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel{min-height:420px!important;}
  html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .localized-result-section{min-height:420px!important;}
}
@media(max-width:600px){
  html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel{grid-template-areas:"heading heading" "input input" "controls controls" "action action"!important;grid-template-rows:auto minmax(260px,1fr) auto auto!important;}
  html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel .rewrite-action-area{justify-content:stretch!important;}
  html:not([data-autotube-theme="dark"]) body #scenarioRewritePane #at-v41-unique-button{width:100%!important;}
  html body #scenarioRewritePane .at-v41-source-empty{bottom:115px;}
}
@media(prefers-reduced-motion:reduce){html body #scenarioRewritePane .at-v41-ring-value{transition:none!important;}}
/* AUTOTUBE_USER1_SCENARIO_UNIFY_V41_END */
/* V4.1 final alignment: controls are a single level bottom toolbar. */
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel > .rewrite-source-controls,
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-panel > .rewrite-action-area {
  box-sizing:border-box!important;height:41px!important;min-height:41px!important;max-height:41px!important;
  align-self:end!important;align-items:center!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .rewrite-source-controls #importButton{
  align-self:center!important;margin-top:0!important;margin-bottom:0!important;
}
/* Keep native localized label for application data/a11y; visually use the shared heading. */
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .localized-result-section .section-heading label{
  font-size:0!important;
}
html:not([data-autotube-theme="dark"]) body #scenarioRewritePane .localized-result-section .section-heading label::before{
  content:'Сценарій'!important;font:900 clamp(17px,1.34vw,22px)/1.25 Inter,Arial,sans-serif!important;
  letter-spacing:-.03em!important;color:#101011!important;
}
