#googleKeyCard,#claudeCard,#apiKeyCard,#photoManagedConfigCard,#videoManagedConfigCard{display:none!important}
.language-field:has(#rewriteEngine){display:none!important}
#changeApiKeyButton{display:none!important}
.factory-provider-status{overflow:hidden}
.factory-provider-status .card-heading{margin-bottom:8px}
.factory-provider-status .inline-message:empty{display:none}
.factory-style-row{display:grid;grid-template-columns:minmax(260px,520px);gap:18px;margin-top:18px}
[hidden]{display:none!important}

.factory-top-left{display:flex;align-items:center;gap:18px;min-width:0}
.factory-user-control{position:relative;flex:0 0 auto;--tone-rgb:48,139,91;--tone-text:#286f4a}
.factory-user-control.tone-yellow{--tone-rgb:206,150,28;--tone-text:#8a6411}
.factory-user-control.tone-red{--tone-rgb:198,66,57;--tone-text:#96382f}
.factory-user-trigger{appearance:none;border:1px solid rgba(var(--tone-rgb),.28);background:rgba(var(--tone-rgb),.105);border-radius:15px;padding:7px 11px 7px 7px;display:flex;align-items:center;gap:9px;color:#2b2925;cursor:pointer;font:inherit;text-align:left;box-shadow:0 7px 22px rgba(42,35,23,.055);transition:background .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease}
.factory-user-trigger:hover,.factory-user-control.menu-open .factory-user-trigger{background:rgba(var(--tone-rgb),.155);border-color:rgba(var(--tone-rgb),.42);box-shadow:0 9px 25px rgba(42,35,23,.09)}
.factory-user-trigger:active{transform:translateY(1px)}
.factory-user-trigger:focus-visible{outline:3px solid rgba(var(--tone-rgb),.22);outline-offset:2px}
.factory-user-avatar{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:rgba(var(--tone-rgb),.19);color:var(--tone-text)}
.factory-user-avatar svg{width:21px;height:21px;fill:currentColor}
.factory-user-copy{display:grid;gap:2px;white-space:nowrap;line-height:1.15}
.factory-user-copy strong{font-size:13px;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.factory-user-copy span{font-size:11px;font-weight:700;color:var(--tone-text)}
.factory-user-chevron{width:14px;height:14px;margin-left:1px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;opacity:.55;transition:transform .18s ease}
.factory-user-control.menu-open .factory-user-chevron{transform:rotate(180deg)}
.factory-user-menu{position:absolute;left:0;top:calc(100% + 8px);z-index:1000;width:100%;min-width:170px;padding:6px;border:1px solid rgba(52,45,35,.13);border-radius:13px;background:rgba(255,253,248,.97);box-shadow:0 16px 42px rgba(40,32,20,.16);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.factory-logout-button{width:100%;appearance:none;border:0;border-radius:9px;background:transparent;padding:10px 11px;display:flex;align-items:center;gap:9px;color:#8d342e;font:inherit;font-size:13px;font-weight:750;cursor:pointer;text-align:left}
.factory-logout-button:hover{background:rgba(198,66,57,.09)}
.factory-logout-button:disabled{opacity:.55;cursor:wait}
.factory-logout-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

@media(max-width:760px){
  .factory-top-left{width:100%;align-items:flex-start;flex-direction:column;gap:14px}
  .factory-user-control{order:-1}
  .factory-user-trigger{max-width:calc(100vw - 42px)}
}

/* v0.5: server-rendered account control; no client-side fetch required. */
.factory-user-control>summary{list-style:none}
.factory-user-control>summary::-webkit-details-marker{display:none}
.factory-user-control[open] .factory-user-trigger{background:rgba(var(--tone-rgb),.155);border-color:rgba(var(--tone-rgb),.42);box-shadow:0 9px 25px rgba(42,35,23,.09)}
.factory-user-control[open] .factory-user-chevron{transform:rotate(180deg)}
.factory-user-menu form{margin:0}

.factory-template-nav{display:inline-flex;align-items:center;justify-content:center;padding:12px 18px;border-radius:12px;text-decoration:none;color:#5f594f;font-weight:800;white-space:nowrap;background:rgba(166,120,25,.08);border:1px solid rgba(166,120,25,.18)}
.factory-template-nav:hover{background:rgba(166,120,25,.14);color:#3d382f}
.factory-template-dialog{border:0;padding:0;background:transparent;max-width:min(620px,calc(100vw - 28px));width:100%}
.factory-template-dialog::backdrop{background:rgba(31,27,22,.42);backdrop-filter:blur(4px)}
.factory-template-dialog-shell{background:#fffdf8;border:1px solid rgba(69,58,42,.16);border-radius:22px;padding:24px;box-shadow:0 30px 90px rgba(39,31,21,.24);display:grid;gap:17px}
.factory-template-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:14px;border-radius:14px;background:#f5f1e8}
.factory-template-preview>div{display:grid;gap:2px}.factory-template-preview span{font-size:11px;color:#81796e}.factory-template-preview strong{font-size:13px}
#saveWorkflowTemplateStatus a{color:#2e6a55;font-weight:800}
@media(max-width:720px){.factory-template-nav{width:100%}.factory-template-preview{grid-template-columns:1fr}}

.factory-admin-panel-button{display:flex;align-items:center;width:100%;padding:10px 12px;border-radius:10px;color:#2f6656;text-decoration:none;font-weight:800}.factory-admin-panel-button:hover{background:rgba(47,102,86,.08)}

/* v0.8: workflow templates live inside the same tab system as the rest of the app. */
.factory-templates-workspace{display:grid;gap:22px}
.factory-templates-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;padding:2px 0 4px}
.factory-templates-heading h2{margin:0 0 8px;font-size:clamp(28px,3vw,42px)}
.factory-templates-heading p{margin:0;max-width:760px;color:#746d62}
.factory-templates-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:18px}
.factory-template-card,.factory-templates-empty{background:#fffdf8;border:1px solid rgba(67,56,40,.16);border-radius:20px;padding:22px;box-shadow:0 13px 36px rgba(63,48,22,.055)}
.factory-template-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.factory-template-card h2{margin:2px 0 0;font-size:24px}
.factory-template-badge{display:inline-flex;padding:6px 9px;border-radius:999px;background:rgba(47,102,86,.11);color:#2f6656;font-size:11px;font-weight:850}
.factory-template-description{min-height:42px;color:#756e63}
.factory-template-card-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:17px 0}
.factory-template-card-summary>div{display:grid;gap:3px;padding:10px 11px;border-radius:11px;background:#f4f0e7}
.factory-template-card-summary span{font-size:11px;color:#837b70}
.factory-template-card-summary strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.factory-templates-empty{grid-column:1/-1;text-align:center;padding:64px 25px}
.factory-templates-empty h2{margin-bottom:10px}
.factory-templates-empty p{max-width:620px;margin:0 auto;color:#746d62}
.factory-danger-button{color:#94362f;border-color:rgba(180,63,52,.23)}
.factory-template-launch-panel,.factory-workflow-run-panel,.factory-workflow-history-card{margin:0}
.factory-template-launch-panel .card-heading,.factory-workflow-run-panel .card-heading{align-items:flex-start}
.factory-workflow-source{width:100%;min-height:320px;resize:vertical}
.factory-run-status{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#efebe3;color:#6f675c;font-size:12px;font-weight:850}
.factory-run-status.status-running,.factory-run-status.status-queued,.factory-run-status.status-cancel_requested{background:#fff0c9;color:#785707}
.factory-run-status.status-completed{background:#e4f3e7;color:#28643a}
.factory-run-status.status-error,.factory-run-status.status-cancelled{background:#fde4e1;color:#8d2d25}
.factory-run-progress{display:block;margin-top:14px}
.factory-workflow-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:20px 0}
.factory-workflow-steps span{padding:12px;border-radius:11px;background:#f0ece4;color:#776f64;text-align:center;font-size:12px;font-weight:800}
.factory-workflow-steps span.active{background:#2f6656;color:#fff}
.factory-workflow-result{margin-top:20px}
.factory-workflow-result video{width:100%;max-height:680px;border-radius:15px;background:#111;margin-bottom:16px}
.factory-workflow-runs-list{display:grid;gap:8px}
.factory-workflow-run-item{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;align-items:stretch}.factory-workflow-run-item.can-delete{grid-template-columns:minmax(0,1fr) 42px}
.factory-workflow-run-row{width:100%;display:grid;grid-template-columns:minmax(220px,1fr) auto minmax(250px,1.2fr);align-items:center;gap:14px;padding:13px 14px;border:1px solid rgba(67,56,40,.13);border-radius:12px;background:#fff;text-align:left;font:inherit;cursor:pointer}
.factory-workflow-run-row:hover{background:#faf7f0;border-color:rgba(47,102,86,.25)}
.factory-workflow-run-row>span:first-child{display:grid;gap:3px}
.factory-workflow-run-row small{color:#837b70}
.factory-workflow-run-delete{border:1px solid rgba(141,45,37,.2);border-radius:12px;background:rgba(255,255,255,.75);color:#8d2d25;font-size:23px;font-weight:500;cursor:pointer}
.factory-workflow-run-delete:hover{background:#fde4e1;border-color:rgba(141,45,37,.4)}
.factory-run-row-progress{color:#70685d;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:850px){
  .factory-templates-heading{flex-direction:column}
  .factory-workflow-run-row{grid-template-columns:1fr auto}.factory-run-row-progress{grid-column:1/-1}
  .factory-workflow-run-item.can-delete{grid-template-columns:minmax(0,1fr) 42px}
  .factory-workflow-steps{grid-template-columns:1fr 1fr}
}
@media(max-width:620px){
  .factory-templates-grid,.factory-template-card-summary{grid-template-columns:1fr}
  .factory-workflow-steps{grid-template-columns:1fr}
}


/* v0.10: compact SaaS workspace layout. Visual-only overrides. */
body{
  background:
    radial-gradient(circle at 0% 0%,rgba(198,151,88,.14),transparent 26%),
    radial-gradient(circle at 100% 5%,rgba(47,93,80,.07),transparent 24%),
    #f5f1e8;
}
.app-shell{
  width:min(1480px,calc(100% - 48px));
  margin:0 auto;
  padding:16px 0 44px;
  gap:14px;
}
.topbar{
  position:relative;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
}
.factory-top-left{
  width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:0;
}
.factory-top-left>div:not(.factory-user-control),
.factory-brand-heading{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
}
.factory-brand-heading h1{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif;
  font-size:clamp(25px,2.1vw,32px);
  line-height:1;
  letter-spacing:-.04em;
  font-weight:650;
}
.factory-brand-heading h1 span{color:#22211e}
.factory-brand-heading h1 strong{
  color:#a87819;
  font-weight:820;
  letter-spacing:-.035em;
}
.top-statuses{display:none!important}
.factory-user-control{
  position:fixed;
  top:14px;
  left:14px;
  z-index:1500;
}
.factory-user-trigger{
  min-height:48px;
  padding:6px 10px 6px 6px;
  border-radius:14px;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.factory-user-avatar{width:36px;height:36px;border-radius:11px}
.factory-user-copy strong{font-size:13px}
.factory-user-copy span{font-size:10.5px}
.tabs{
  width:100%;
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  padding:5px;
  border-radius:15px;
  background:rgba(255,254,250,.72);
  box-shadow:0 8px 24px rgba(75,61,42,.055);
}
.tab-button{
  width:100%;
  min-height:46px;
  padding:9px 12px;
  border-radius:11px;
  font-size:14px;
  font-weight:720;
  white-space:nowrap;
}
.tab-panel.active{gap:16px}
.settings-card,.result-section,.account-strip{
  border-radius:18px;
}
.text-section textarea,#source,.tts-textarea,.factory-workflow-source{
  min-height:300px;
}

@media(max-width:1120px){
  .app-shell{width:min(100% - 28px,1480px)}
  .tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .app-shell{width:min(100% - 18px,1480px);padding:72px 0 32px;gap:12px}
  .topbar{min-height:38px}
  .factory-top-left{width:100%;display:flex;align-items:center;justify-content:center;flex-direction:row}
  .factory-user-control{top:10px;left:10px}
  .factory-user-trigger{max-width:calc(100vw - 20px)}
  .factory-brand-heading h1{font-size:24px}
  .tabs{grid-template-columns:repeat(2,minmax(0,1fr));border-radius:13px}
  .tab-button{min-height:42px;font-size:13px;white-space:normal}
}
@media(max-width:430px){
  .factory-brand-heading{display:none!important}
  .tabs{grid-template-columns:1fr}
}


/* v0.11: dense workspace — smaller gaps and controls, not larger scaling. */
.app-shell{
  width:min(1360px,calc(100% - 32px));
  padding:10px 0 28px;
  gap:10px;
}
.topbar{min-height:42px}
.factory-brand-heading h1{font-size:clamp(23px,1.8vw,28px)}
.factory-user-control{top:10px;left:10px}
.factory-user-trigger{min-height:42px;padding:5px 9px 5px 5px;border-radius:13px}
.factory-user-avatar{width:32px;height:32px;border-radius:10px}
.factory-user-avatar svg{width:18px;height:18px}
.factory-user-copy strong{font-size:12px}
.factory-user-copy span{font-size:10px}
.factory-user-chevron{width:12px;height:12px}
.tabs{padding:4px;border-radius:13px}
.tab-button{
  min-height:40px;
  padding:7px 10px;
  border-radius:9px;
  font-size:13px;
}
.tab-panel.active,.voice-workspace,.factory-templates-workspace{gap:12px}
.text-section{gap:7px}
.section-heading{gap:10px}
.section-heading>label{font-size:18px}
.counter{font-size:10px}
.text-section textarea,#source,.tts-textarea,.photo-textarea,.factory-workflow-source{
  min-height:220px;
  padding:13px 14px;
  border-radius:12px;
  line-height:1.45;
}
.result-section textarea{min-height:190px}
.settings-card,.result-section,.account-strip{
  border-radius:14px;
}
.settings-card{padding:14px}
.card-heading{gap:14px}
.card-heading p:not(.card-kicker){margin-top:5px;line-height:1.42}
.card-kicker,.eyebrow{font-size:10px}
h2{font-size:19px}
.field-label{margin:9px 0 5px;font-size:12px}
.text-input,.select-input,.single-select{min-height:38px;padding:8px 10px}
.secondary-button,.cancel-button,.link-button{min-height:35px;padding:7px 12px;font-size:12px}
.primary-button,.primary-small-button{min-height:37px;padding:8px 13px}
.section-actions{gap:6px}
.localization-settings{
  gap:12px;
  padding:11px 13px;
  border-radius:11px;
}
.account-strip{gap:10px;padding:10px 12px}
.voice-control-grid{gap:12px}
.voice-library-launch-button{min-height:54px;font-size:15px}
.selected-voice-meta{padding:9px 11px}
.photo-controls-grid,.photo-regenerate-grid,.photo-cloud-grid{gap:12px}
.photo-toggle-field{min-height:62px}
.compact-textarea{min-height:88px!important}
.photo-action-area{min-height:78px}
.montage-input-grid{gap:10px}
.montage-upload-card{
  min-height:110px;
  gap:7px;
  padding:11px;
  border-radius:11px;
}
.montage-script{min-height:170px!important}
.montage-presets{gap:8px}
.montage-presets>div{gap:3px;padding:9px 10px;border-radius:10px}
.montage-volume-field{margin-top:10px}
.montage-action-area{min-height:88px}
.factory-templates-heading{gap:14px;padding:0}
.factory-templates-heading h2{font-size:26px}
.factory-templates-grid{gap:12px}
.factory-template-card,.factory-templates-empty{padding:16px;border-radius:15px}
.factory-template-card h2{font-size:20px}
.factory-template-card-summary{gap:6px;margin:12px 0}
.factory-template-card-summary>div{padding:8px 9px}
.factory-templates-empty{padding:38px 20px}
.factory-workflow-source{min-height:210px}
.factory-workflow-steps{gap:6px;margin:14px 0}
.factory-workflow-steps span{padding:9px}

@media(max-width:1120px){
  .app-shell{width:min(100% - 24px,1360px)}
}
@media(max-width:760px){
  .app-shell{width:min(100% - 14px,1360px);padding:62px 0 24px;gap:9px}
  .factory-user-control{top:8px;left:8px}
  .factory-brand-heading h1{font-size:22px}
  .text-section textarea,#source,.tts-textarea,.photo-textarea,.factory-workflow-source{min-height:190px}
}

/* v0.13: rewrite workspace aligned to user spec. Layout only. */
#rewriteTab.active{
  display:block;
}
.rewrite-compact-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(420px,1fr);
  gap:12px;
  align-items:stretch;
  height:calc(100svh - 150px);
  min-height:640px;
  max-height:920px;
}
.rewrite-source-panel,
.rewrite-results-column .text-section{
  min-width:0;
  min-height:0;
  margin:0;
  padding:15px;
  border:1px solid #ddd4c7;
  border-radius:17px;
  background:rgba(255, 254, 250, 0.43);
  box-shadow:0 10px 28px rgba(75, 61, 42, 0.045);
}
.rewrite-source-panel{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto auto;
  gap:10px;
  height:100%;
}
.rewrite-results-column{
  display:grid;
  grid-template-rows:minmax(0,1fr) minmax(0,1fr);
  gap:12px;
  min-width:0;
  min-height:0;
  height:100%;
}
.rewrite-results-column .text-section{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:9px;
}
.rewrite-compact-layout .section-heading{
  margin:0;
  min-height:25px;
}
.rewrite-compact-layout .section-heading label{
  font-size:20px;
  line-height:1.15;
}
.rewrite-compact-layout textarea{
  width:100%;
  height:100%;
  min-height:0!important;
  resize:none;
  padding:14px 15px;
  border-radius:12px;
  font-size:14px;
  line-height:1.5;
}
.rewrite-source-controls,
.rewrite-results-column .result-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin:0;
}
.rewrite-source-controls{
  padding-top:2px;
}
.rewrite-language-field{
  width:min(250px,50%);
  min-width:180px;
  margin-right:auto;
}
.rewrite-language-field .field-label{
  margin-bottom:5px;
  font-size:11px;
}
.rewrite-language-field .select-input{
  height:39px;
  padding:7px 34px 7px 10px;
  font-size:13px;
}
.rewrite-import-button,
.rewrite-results-column .result-actions button{
  min-height:34px;
  padding:7px 10px;
  font-size:11px;
}
.rewrite-import-button{
  min-height:39px;
  padding:8px 12px;
  white-space:nowrap;
  font-size:12px;
}
.rewrite-clear-button{
  min-height:39px;
  padding:8px 7px;
  white-space:nowrap;
  font-size:12px;
}
.rewrite-action-area{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:7px 10px;
  margin:0;
  padding:0;
}
.rewrite-action-area .primary-button{
  width:min(430px,78%);
  min-height:43px;
  padding:10px 18px;
  font-size:14px;
}
.rewrite-action-area .cancel-button{
  min-height:39px;
}
.rewrite-action-area .message{
  flex-basis:100%;
  margin:0;
  padding:0;
  text-align:center;
  font-size:11px;
  line-height:1.3;
}
.rewrite-action-area .message:empty{
  display:none;
}
.localized-result-section{
  border-color:rgba(47, 93, 80, 0.34);
  background:rgba(239, 247, 242, 0.42);
}
.rewrite-hidden-config{
  display:none!important;
}
@media(max-width:1100px){
  .rewrite-compact-layout{
    grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);
  }
  .rewrite-compact-layout .section-heading label{font-size:17px}
}
@media(max-width:850px){
  .rewrite-compact-layout{
    height:auto;
    max-height:none;
    min-height:0;
    grid-template-columns:1fr;
  }
  .rewrite-source-panel{min-height:620px}
  .rewrite-results-column{grid-template-rows:repeat(2,minmax(420px,auto))}
}
@media(max-width:580px){
  .rewrite-source-controls{
    display:grid;
    grid-template-columns:1fr auto;
    align-items:end;
  }
  .rewrite-language-field{width:auto;min-width:0;grid-column:1/-1;margin-right:0}
  .rewrite-clear-button{justify-self:end;height:auto}
  .rewrite-action-area .primary-button{width:100%}
}


/* v0.14: compact single-card video workspace. Layout only. */
#videoTab.active{
  display:block;
}
.video-workspace-card{
  padding:14px;
}
.video-workspace-grid{
  display:grid;
  grid-template-columns:minmax(320px,.82fr) minmax(460px,1.18fr);
  gap:14px;
  align-items:stretch;
  min-height:calc(100svh - 165px);
  max-height:880px;
}
.video-control-column,
.video-script-column{
  min-width:0;
  min-height:0;
  border:1px solid #ddd4c7;
  border-radius:14px;
  background:rgba(255,254,250,.48);
}
.video-control-column{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:16px;
}
.video-control-heading{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:12px;
}
.video-control-heading h2{
  margin:0;
  font-size:23px;
}
.video-style-block,
.video-parameter-block{
  display:grid;
  gap:8px;
}
.video-style-block .field-label,
.video-parameter-title{
  margin:0;
  font-size:16px;
}
.video-style-block .select-input{
  height:43px;
  padding:8px 38px 8px 12px;
  font-size:14px;
}
.video-style-hint{
  margin:0;
  min-height:0;
  font-size:11px;
  line-height:1.35;
}
.video-style-hint:empty,
.video-style-block .inline-message:empty{
  display:none;
}
.video-fixed-parameters{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.video-fixed-parameters span{
  padding:6px 9px;
  border:1px solid #ddd4c7;
  border-radius:999px;
  background:rgba(255,254,250,.72);
  color:#716b62;
  font-size:11px;
  line-height:1;
}
.video-toggle-stack{
  display:grid;
  gap:7px;
  margin-top:2px;
}
.video-compact-toggle{
  min-height:48px;
  margin:0;
  padding:9px 10px;
  border:1px solid #ddd4c7;
  border-radius:11px;
  background:rgba(255,254,250,.62);
  font-size:12px;
}
.video-compact-toggle strong{
  line-height:1.3;
}
.video-generation-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:auto;
}
.video-generation-actions .primary-button{
  width:100%;
  min-height:45px;
  padding:10px 16px;
  font-size:15px;
}
.video-generation-status{
  display:grid;
  gap:8px;
  min-height:44px;
}
.video-generation-status .inline-message{
  margin:0;
  text-align:center;
}
.video-generation-status .download-card{
  margin:0;
}
.video-script-column{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:9px;
  padding:15px;
}
.video-script-column .section-heading{
  margin:0;
}
.video-script-column .section-heading label{
  font-size:20px;
  line-height:1.15;
}
.video-script-column textarea{
  width:100%;
  height:100%;
  min-height:0!important;
  resize:none;
  padding:14px 15px;
  border-radius:12px;
  font-size:14px;
  line-height:1.5;
}
.video-script-actions{
  justify-content:flex-end;
  gap:7px;
  margin:0;
}
.video-script-actions button{
  min-height:34px;
  padding:7px 10px;
  font-size:11px;
}
@media(max-width:1050px){
  .video-workspace-grid{
    grid-template-columns:minmax(300px,.9fr) minmax(390px,1.1fr);
  }
}
@media(max-width:820px){
  .video-workspace-grid{
    min-height:0;
    max-height:none;
    grid-template-columns:1fr;
  }
  .video-control-column{min-height:520px}
  .video-script-column{min-height:520px}
}


/* v0.16: framed visual mode switch + compact photo workspace. Visual only. */
.visual-switch-shell{
  padding:12px 14px;
  max-width:360px;
}
.visual-switch-shell .card-heading{
  margin-bottom:10px;
}
.visual-switch-shell .visual-mode-toggle{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  width:100%;
}
.visual-switch-shell .visual-mode-button{
  width:100%;
  min-width:0;
}
.photo-workspace-card{
  padding:14px;
}
.photo-workspace-grid{
  display:grid;
  grid-template-columns:minmax(320px,.82fr) minmax(460px,1.18fr);
  gap:14px;
  align-items:stretch;
  min-height:calc(100svh - 245px);
  max-height:880px;
}
.photo-control-column,
.photo-script-column{
  min-width:0;
  min-height:0;
  border:1px solid #ddd4c7;
  border-radius:14px;
  background:rgba(255,254,250,.48);
}
.photo-control-column{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:16px;
}
.photo-control-heading{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:12px;
}
.photo-control-heading h2{
  margin:0;
  font-size:23px;
}
.photo-style-block,
.photo-parameter-block{
  display:grid;
  gap:8px;
}
.photo-main-controls,
.photo-delay-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  align-items:end;
}
.photo-style-block .field-label{
  margin:0 0 5px;
  font-size:16px;
}
.photo-style-block .select-input,
.photo-delay-grid .select-input{
  height:43px;
  padding:8px 38px 8px 12px;
  font-size:14px;
}
.photo-config-help{
  margin:0;
  font-size:11px;
  line-height:1.35;
}
.photo-toggle-stack{
  display:grid;
  gap:7px;
  margin-top:2px;
}
.photo-compact-toggle{
  min-height:48px;
}
.photo-generation-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:auto;
}
.photo-generation-actions .primary-button{
  width:100%;
  min-height:45px;
  padding:10px 16px;
  font-size:15px;
}
.photo-generation-status{
  display:grid;
  gap:8px;
  min-height:44px;
}
.photo-generation-status .message{
  margin:0;
  text-align:center;
}
.photo-script-column{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:9px;
  padding:15px;
}
.photo-script-column .section-heading{
  margin:0;
}
.photo-script-column .section-heading label{
  font-size:20px;
  line-height:1.15;
}
.photo-script-column textarea{
  width:100%;
  height:100%;
  min-height:0!important;
  resize:none;
  padding:14px 15px;
  border-radius:12px;
  font-size:14px;
  line-height:1.5;
}
.photo-script-actions{
  justify-content:flex-end;
  gap:7px;
  margin:0;
}
.photo-script-actions button{
  min-height:34px;
  padding:7px 10px;
  font-size:11px;
}
@media(max-width:1050px){
  .photo-workspace-grid{
    grid-template-columns:minmax(300px,.9fr) minmax(390px,1.1fr);
  }
}
@media(max-width:820px){
  .photo-workspace-grid{
    min-height:0;
    max-height:none;
    grid-template-columns:1fr;
  }
  .photo-main-controls,
  .photo-delay-grid{
    grid-template-columns:1fr;
  }
  .photo-control-column{min-height:520px}
  .photo-script-column{min-height:520px}
}


/* v0.17: one-frame visual generation tab, no visible regenerate card, compact no-scroll desktop layout. */
#photosTab.tab-panel.active{gap:0;min-height:0}
.visual-tab-shell{
  display:grid;
  grid-template-rows:auto 1fr;
  gap:12px;
  overflow:hidden;
}
.visual-shell-top{display:flex;justify-content:flex-start}
.visual-tab-shell .visual-mode-toggle{
  width:min(320px,100%);
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  padding:5px;
  border:1px solid rgba(67,56,40,.15);
  border-radius:15px;
  background:rgba(255,254,250,.78);
}
.visual-tab-shell .visual-mode-button{
  width:100%;
  min-height:44px;
  border-radius:11px;
}
.visual-pane{display:none;min-height:0}
.visual-pane.active{display:block;min-height:0;height:100%}
.visual-frame-grid{
  display:grid;
  grid-template-columns:minmax(330px,.82fr) minmax(500px,1.18fr);
  gap:14px;
  min-height:0;
  height:100%;
}
.visual-control-column,
.visual-script-column{
  min-width:0;
  min-height:0;
  border:1px solid rgba(67,56,40,.14);
  border-radius:16px;
  background:rgba(255,254,250,.44);
}
.visual-control-column{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:14px;
}
.visual-control-heading{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
}
.visual-control-heading h2{margin:0;font-size:24px}
.compact-panel-block{display:grid;gap:8px}
.compact-two-col-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:end}
.compact-inline-help{margin:0;font-size:12px;line-height:1.38;color:#756d62}
.compact-delay-grid .select-input,
.compact-two-col-grid .select-input,
.compact-two-col-grid .text-input{height:42px;padding:8px 12px;font-size:14px}
.photo-toggle-stack,.video-toggle-stack{display:grid;gap:8px}
.visual-generation-actions{display:flex;gap:8px;align-items:center;justify-content:center;margin-top:auto}
.visual-generation-actions .primary-button{width:100%;min-height:46px}
.visual-generation-status{display:grid;gap:8px;min-height:64px}
.visual-generation-status .message,.visual-generation-status .inline-message{margin:0;text-align:center}
.photo-inline-result,.video-generation-status .download-card{margin-top:0}
.photo-hidden-utility{display:none!important}
.compact-script-column{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:10px;
  padding:14px;
}
.compact-script-column .section-heading{margin:0}
.compact-script-column .section-heading label{font-size:21px;line-height:1.16}
.compact-script-column textarea{
  width:100%;
  height:100%;
  min-height:0!important;
  resize:none;
  padding:14px 15px;
  border-radius:13px;
  font-size:15px;
  line-height:1.48;
}
.compact-script-actions{justify-content:flex-end;gap:8px;margin:0}
.compact-script-actions button{min-height:36px;padding:7px 12px;font-size:12px}
@media(min-width:1024px){
  .visual-tab-shell{height:calc(100svh - 150px)}
}
@media(max-width:1120px){
  .visual-frame-grid{grid-template-columns:minmax(300px,.88fr) minmax(420px,1.12fr)}
  .visual-control-heading h2{font-size:22px}
}
@media(max-width:900px){
  .visual-tab-shell{overflow:visible}
  .visual-frame-grid{grid-template-columns:1fr;height:auto}
  .compact-two-col-grid{grid-template-columns:1fr}
  .visual-pane.active{height:auto}
}


/* v0.18: compact no-scroll montage workspace */
#montageTab.active{display:block;min-height:0}
.montage-compact-shell{
  min-height:0;
  height:calc(100svh - 150px);
  overflow:hidden;
  display:block;
}
.montage-main-grid{
  display:grid;
  grid-template-columns:minmax(660px,1.14fr) minmax(360px,.86fr);
  gap:14px;
  height:100%;
  min-height:0;
}
.montage-left-column,.montage-right-column{min-width:0;min-height:0}
.montage-left-column{
  display:grid;
  grid-template-rows:auto 1fr;
  gap:10px;
  min-height:0;
}
.montage-section-heading{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
}
.montage-section-heading h2{margin:0;font-size:24px}
.montage-section-heading .inline-message{margin:0;text-align:right;max-width:45%}
.montage-stack-grid{
  display:grid;
  grid-template-rows:repeat(5,auto) minmax(0,1fr);
  gap:10px;
  min-height:0;
}
.montage-row-card,.montage-right-card{
  border:1px solid rgba(67,56,40,.14);
  border-radius:14px;
  background:rgba(255,254,250,.48);
  padding:11px 12px;
  display:grid;
  gap:7px;
  min-width:0;
}
.montage-source-row small,.montage-upload-row small{font-size:12px;line-height:1.35;color:#756d62}
.montage-row-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.montage-inline-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.compact-montage-script{min-height:0!important;height:100%;resize:none;padding:12px 14px}
.montage-script-row{min-height:0;grid-template-rows:auto minmax(0,1fr) auto}
.montage-script-row .compact-script-actions{justify-content:flex-end}
.montage-right-column{
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  gap:10px;
}
.montage-right-heading{align-items:flex-start}
.compact-montage-presets{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.compact-montage-presets>div{
  border:1px solid rgba(67,56,40,.12);
  background:rgba(255,255,255,.45);
}
.compact-montage-presets .montage-subtitle-control,
.compact-montage-presets .montage-subtitle-toggle,
.compact-montage-presets .montage-zoom-preset{display:grid;gap:4px}
.compact-montage-volume{margin-top:8px}
.compact-montage-action-area{
  min-height:0;
  display:grid;
  gap:8px;
  align-content:start;
}
.compact-montage-action-area .primary-button,
.compact-montage-action-area .cancel-button{width:100%}
.compact-montage-action-area .message{margin:0}
.montage-result-card{
  display:grid;
  gap:10px;
  min-height:0;
  align-content:start;
}
.montage-result-card.hidden{display:none!important}
.montage-preview{
  width:100%;
  max-height:240px;
  border-radius:12px;
  background:#000;
}
.montage-result-actions{justify-content:flex-start;flex-wrap:wrap}
@media(max-width:1280px){
  .montage-main-grid{grid-template-columns:minmax(560px,1.08fr) minmax(340px,.92fr)}
  .compact-montage-presets{grid-template-columns:1fr 1fr}
}
@media(max-width:980px){
  .montage-compact-shell{height:auto;overflow:visible}
  .montage-main-grid{grid-template-columns:1fr;height:auto}
  .montage-inline-pair,.compact-montage-presets{grid-template-columns:1fr}
  .montage-right-column{grid-template-rows:auto auto auto}
}


/* v0.19: collapsible montage settings */
.montage-fixed-card-collapsible{padding:0;overflow:hidden}
.collapsible-card-toggle{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;
  border:0;background:transparent;padding:14px 16px;cursor:pointer;
  font-family:inherit;font-size:24px;font-weight:800;line-height:1.1;color:#2b241c;text-align:left;
}
.collapsible-card-arrow{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;transition:transform .18s ease}
.montage-fixed-card-collapsible:not(.collapsed) .collapsible-card-arrow{transform:rotate(180deg)}
.collapsible-card-body{padding:0 12px 12px;display:grid;gap:8px}
.montage-fixed-card-collapsible.collapsed .collapsible-card-body{display:none}
.montage-fixed-card-collapsible.collapsed .collapsible-card-toggle{padding-bottom:12px}
.montage-fixed-card-collapsible .card-heading h2{font-size:22px}


/* v0.20: montage accordion + ultra-compact settings */
.montage-accordion-stack{
  display:grid;
  grid-template-rows:none;
  grid-auto-rows:min-content;
  gap:10px;
  min-height:0;
  overflow:hidden;
  align-content:start;
}
.montage-accordion-card{padding:0;gap:0;overflow:hidden}
.montage-accordion-toggle{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;
  border:0;background:transparent;padding:14px 16px;cursor:pointer;
  font-family:inherit;font-size:17px;font-weight:800;line-height:1.15;color:#2b241c;text-align:left;
}
.montage-accordion-arrow{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;transition:transform .18s ease}
.montage-accordion-card.active .montage-accordion-arrow{transform:rotate(180deg)}
.montage-accordion-body{display:grid;gap:8px;padding:0 12px 12px}
.montage-accordion-card .montage-script{height:130px}
.montage-accordion-card .compact-script-actions{justify-content:flex-end;flex-wrap:wrap}
.montage-accordion-card.hidden{display:none!important}

.montage-settings-meta{display:flex;justify-content:flex-end;align-items:center;min-height:22px}
.compact-montage-presets-nine{
  display:grid;
  grid-template-columns:repeat(9,minmax(0,1fr));
  gap:6px;
  align-items:stretch;
}
.compact-montage-presets-nine>div{
  min-height:84px;
  padding:8px;
  border-radius:12px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:6px;
}
.montage-preset-tile span,
.montage-preset-tile label{font-size:12px;line-height:1.15;color:#776d61;font-weight:700}
.montage-preset-tile strong{font-size:13px;line-height:1.2;color:#375e54}
.montage-compact-select{min-height:40px;padding:8px 34px 8px 10px;font-size:13px;font-weight:700}
.montage-preset-tile .mini-toggle{font-size:13px;font-weight:700;color:#375e54}
.montage-preset-tile input[type="color"]{width:100%;height:40px;border-radius:10px;border:1px solid rgba(67,56,40,.18);padding:4px;background:rgba(255,255,255,.72)}
.montage-outline-tile input[type="range"]{width:100%}
.montage-outline-tile small{font-size:11px;color:#6f675e}
.montage-fixed-card-collapsible .collapsible-card-body{gap:10px}
.montage-fixed-card-collapsible .collapsible-card-toggle{padding:12px 16px}
.montage-run-card{min-height:170px}
.montage-result-card{align-content:start}
.montage-preview{max-height:300px}

@media(max-width:1500px){
  .compact-montage-presets-nine{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:1100px){
  .compact-montage-presets-nine{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* v0.21: no duplicated accordion titles; requested default open state. */
.montage-body-toggle-row{justify-content:flex-end}
.montage-body-meta{display:flex;justify-content:flex-end;align-items:center;min-height:16px}
.montage-accordion-body>.file-input:first-child,
.montage-accordion-body>.select-input:first-child{margin-top:0}


/* v0.22: one-block compact voice workspace, no account quota strip */
#voiceTab.active{display:block;min-height:0}
#voiceWorkspace.voice-workspace{display:block;min-height:0;height:calc(100svh - 150px)}
.voice-compact-shell{height:100%;min-height:0;overflow:hidden}
.voice-compact-grid{
  display:grid;
  grid-template-columns:minmax(540px,1.18fr) minmax(390px,.82fr);
  gap:14px;
  height:100%;
  min-height:0;
}
.voice-left-column,.voice-right-column{
  min-width:0;min-height:0;
  border:1px solid rgba(67,56,40,.14);
  border-radius:16px;
  background:rgba(255,254,250,.46);
  padding:14px;
}
.voice-left-column{
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  gap:10px;
}
.voice-right-column{
  display:grid;
  grid-template-rows:auto auto auto auto auto minmax(0,1fr);
  gap:10px;
  align-content:start;
}
.voice-column-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.voice-column-heading h2{margin:0;font-size:24px}
.voice-library-compact-card{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
.voice-library-compact-card .voice-library-launch-button{min-height:46px;padding:9px 14px;font-size:15px}
.voice-library-compact-card .selected-voice-meta{padding:8px 10px;font-size:11px;line-height:1.3}
.voice-library-settings-card{padding:9px 10px;border:1px solid rgba(67,56,40,.13);border-radius:12px;background:rgba(255,255,255,.44)}
.voice-library-settings-card .voice-library-launch-button{min-height:42px;padding:8px 12px;font-size:14px}
.voice-script-workspace{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto auto;
  gap:8px;
  min-height:0;
}
.voice-script-workspace textarea{
  width:100%;height:100%;min-height:0!important;resize:none;
  padding:13px 14px;border-radius:13px;font-size:14px;line-height:1.48;
}
.compact-voice-help{margin:0;font-size:10px;line-height:1.3}
.voice-script-actions{justify-content:flex-end;gap:7px;margin:0;flex-wrap:wrap}
.voice-script-actions button{min-height:34px;padding:7px 10px;font-size:11px}
.voice-right-heading{align-items:center}
.voice-model-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.voice-compact-control{
  padding:9px 10px;border:1px solid rgba(67,56,40,.13);border-radius:12px;
  background:rgba(255,255,255,.44);min-width:0;
}
.voice-compact-control .field-label{margin:0 0 5px;font-size:11px}
.voice-compact-control .select-input{min-height:38px;padding:7px 32px 7px 9px;font-size:12px}
.compact-voice-model-help{margin:5px 0 0;font-size:9px;line-height:1.2;max-height:22px;overflow:hidden}
.voice-sliders-compact{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.voice-slider-tile{
  gap:6px;padding:9px 10px;border:1px solid rgba(67,56,40,.13);
  border-radius:12px;background:rgba(255,255,255,.44);
}
.voice-slider-tile strong,.voice-slider-tile output{font-size:11px}
.voice-speaker-toggle{
  margin:0;min-height:50px;padding:8px 10px;border:1px solid rgba(67,56,40,.13);
  border-radius:12px;background:rgba(255,255,255,.44);
}
.voice-speaker-toggle small{font-size:9px}
.voice-generation-compact{display:grid;gap:6px;align-content:start}
.voice-generation-compact .primary-button,.voice-generation-compact .cancel-button{width:100%;min-height:42px}
.voice-generation-compact .message{margin:0;text-align:center;font-size:11px}
.voice-result-compact{
  display:grid;gap:7px;align-content:start;padding:10px 11px;
  border:1px solid rgba(47,93,80,.24);border-radius:12px;background:rgba(239,247,242,.48);
}
.voice-result-compact.hidden{display:none!important}
.voice-result-compact .card-heading{margin:0}
.voice-result-compact h2{font-size:17px}
.voice-result-compact .final-audio{height:38px}
.voice-result-actions{gap:6px;flex-wrap:wrap}
.voice-result-actions a{min-height:32px;padding:6px 9px;font-size:10px}
.voice-hidden-account{display:none!important}
@media(max-width:1050px){
  .voice-compact-grid{grid-template-columns:minmax(460px,1.1fr) minmax(360px,.9fr)}
}
@media(max-width:850px){
  #voiceWorkspace.voice-workspace{height:auto}
  .voice-compact-shell{overflow:visible}
  .voice-compact-grid{grid-template-columns:1fr;height:auto}
  .voice-left-column{min-height:620px}
  .voice-model-grid,.voice-sliders-compact{grid-template-columns:1fr}
}

/* v0.24: Crispy Ivory / Authentic Black theme */
:root{
  color:#070809;
  background:#EADBCA;
}
body{
  background:#EADBCA !important;
  color:#070809;
}
.factory-user-control,
.factory-user-control.tone-yellow,
.factory-user-control.tone-red{
  --tone-rgb:7,8,9;
  --tone-text:#070809;
}
.factory-brand-heading h1 span,
.factory-brand-heading h1 strong,
.eyebrow,
.card-kicker,
.account-label,
.counter,
.field-label,
.connection,
.factory-user-copy span,
.card-heading p:not(.card-kicker),
.factory-template-description,
.factory-templates-heading p,
.factory-run-row-progress,
.factory-workflow-run-row small,
.factory-template-card-summary span,
.factory-template-preview span,
.text-button,
.inline-message,
.progress{
  color:rgba(7,8,9,.68) !important;
}
.factory-brand-heading h1,
h1,h2,h3,
label,
.section-heading>label,
.factory-user-copy strong,
.factory-template-card h2,
.factory-workflow-steps span.active,
.factory-template-card-summary strong,
.factory-template-preview strong,
.factory-run-status,
.tab-button.active,
.visual-mode-button.active,
.primary-button,
.primary-small-button,
.voice-library-launch-button,
.factory-admin-panel-button,
.factory-template-nav,
.factory-template-badge,
.factory-workflow-steps span,
.factory-run-status.status-completed,
.factory-run-status.status-running,
.factory-run-status.status-queued,
.factory-run-status.status-cancel_requested,
.factory-run-status.status-error,
.factory-run-status.status-cancelled{
  color:#EADBCA;
}
.tabs,
.visual-mode-toggle,
.settings-card,
.result-section,
.account-strip,
.factory-template-card,
.factory-templates-empty,
.factory-template-dialog-shell,
.factory-user-menu,
.factory-template-preview,
.factory-template-card-summary>div,
.factory-workflow-run-row,
.voice-library-compact-card,
.voice-library-settings-card,
.provider-diagnostic,
.factory-run-status,
.file-drop-zone,
.compact-card,
.compact-panel,
.montage-shell,
.voice-compact-grid > *,
#voiceLibraryDialog .dialog-shell,
#voicePreviewPlayer,
#voiceSearchResults .voice-item,
#voiceLibraryResults .voice-item{
  background:rgba(255,251,246,.42) !important;
  border-color:rgba(7,8,9,.15) !important;
  box-shadow:0 8px 24px rgba(7,8,9,.04) !important;
}
.tab-button,
.visual-mode-button,
.factory-template-nav,
.secondary-button,
.cancel-button,
.link-button,
.icon-button,
.text-button,
.factory-admin-panel-button,
.factory-workflow-run-row,
.factory-run-status,
.factory-template-badge{
  color:#070809 !important;
}
.tab-button.active,
.visual-mode-button.active,
.primary-button,
.primary-small-button,
.voice-library-launch-button,
.factory-workflow-steps span.active,
.factory-admin-panel-button:hover,
.factory-template-nav:hover,
.factory-template-badge,
.factory-run-status.status-completed,
.factory-run-status.status-running,
.factory-run-status.status-queued,
.factory-run-status.status-cancel_requested,
.factory-run-status.status-error,
.factory-run-status.status-cancelled{
  background:#070809 !important;
  color:#EADBCA !important;
  border-color:#070809 !important;
  box-shadow:0 8px 18px rgba(7,8,9,.12) !important;
}
.primary-button:hover:not(:disabled),
.primary-small-button:hover:not(:disabled),
.voice-library-launch-button:hover:not(:disabled),
.tab-button.active:hover,
.visual-mode-button.active:hover{
  background:#111315 !important;
}
textarea,
.text-input,
.select-input,
.single-select,
.file-input,
.file-input::file-selector-button,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="email"],
select{
  background:rgba(255,251,246,.72) !important;
  color:#070809 !important;
  border-color:rgba(7,8,9,.18) !important;
  box-shadow:none !important;
}
textarea::placeholder,
.text-input::placeholder,
input::placeholder{
  color:rgba(7,8,9,.42) !important;
}
textarea:focus,
.text-input:focus,
.select-input:focus,
input:focus,
select:focus{
  border-color:#070809 !important;
  box-shadow:0 0 0 3px rgba(7,8,9,.08) !important;
}
.secondary-button,
.cancel-button,
.link-button,
.icon-button,
.factory-template-nav,
.factory-user-trigger,
.factory-logout-button,
.file-input::file-selector-button{
  background:rgba(255,251,246,.42) !important;
  border:1px solid rgba(7,8,9,.18) !important;
}
.secondary-button:hover:not(:disabled),
.cancel-button:hover:not(:disabled),
.link-button:hover,
.icon-button:hover,
.factory-template-nav:hover,
.factory-workflow-run-row:hover,
.factory-user-trigger:hover,
.factory-user-control.menu-open .factory-user-trigger,
.factory-user-control[open] .factory-user-trigger,
.factory-logout-button:hover,
.file-input::file-selector-button:hover{
  background:rgba(7,8,9,.06) !important;
  color:#070809 !important;
  border-color:rgba(7,8,9,.28) !important;
}
.factory-user-avatar{
  background:rgba(7,8,9,.08) !important;
  color:#070809 !important;
}
.factory-user-menu{background:rgba(255,251,246,.96) !important}
.factory-logout-button{color:#070809 !important}
input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress,
meter{
  accent-color:#070809;
}
.message,
.error,
.warning,
.danger-text{
  color:#070809 !important;
}
.provider-diagnostic summary,
.provider-diagnostic pre{color:#070809 !important}

/* v0.25: stronger dark text contrast */
body,
.page-shell,
.workspace-shell,
.workspace-header,
.workspace-main,
.settings-card,
.result-section,
.account-strip,
.factory-template-card,
.factory-templates-empty,
.factory-template-dialog-shell,
.factory-user-menu,
.factory-template-preview,
.factory-template-card-summary,
.voice-library-compact-card,
.voice-library-settings-card,
.provider-diagnostic,
.compact-card,
.compact-panel,
.montage-shell,
.voice-compact-grid > * {
  color:#070809 !important;
}

p,
label,
small,
legend,
summary,
li,
td,
th,
.section-heading > label,
.card-heading p,
.card-heading span,
.card-kicker,
.eyebrow,
.field-label,
.inline-message,
.progress,
.help-text,
.helper-text,
.muted,
.description,
.counter,
.connection,
.account-label,
.factory-user-copy span,
.factory-template-description,
.factory-templates-heading p,
.factory-run-row-progress,
.factory-workflow-run-row small,
.factory-template-card-summary span,
.factory-template-preview span,
.provider-diagnostic summary,
.provider-diagnostic pre {
  color:#070809 !important;
  opacity:1 !important;
}

h1,h2,h3,h4,h5,h6,
.card-heading h1,
.card-heading h2,
.card-heading h3,
.section-heading h1,
.section-heading h2,
.section-heading h3,
.factory-brand-heading h1,
.factory-user-copy strong,
.factory-template-card h2,
.factory-template-card-summary strong,
.factory-template-preview strong,
.factory-run-status,
.tabs .tab-button,
.visual-mode-toggle .visual-mode-button {
  color:#070809 !important;
}

/* keep inverse controls readable */
.tab-button.active,
.visual-mode-button.active,
.primary-button,
.primary-small-button,
.voice-library-launch-button,
.factory-workflow-steps span.active,
.factory-admin-panel-button:hover,
.factory-template-nav:hover,
.factory-template-badge,
.factory-run-status.status-completed,
.factory-run-status.status-running,
.factory-run-status.status-queued,
.factory-run-status.status-cancel_requested,
.factory-run-status.status-error,
.factory-run-status.status-cancelled,
button.primary,
.button-primary {
  color:#EADBCA !important;
}

textarea::placeholder,
.text-input::placeholder,
input::placeholder {
  color:rgba(7,8,9,.52) !important;
}

/* v0.26: lighter ivory background + modern bold sans typography */
:root{
  --factory-ivory:#F1E8D9;
  --factory-ink:#070809;
  font-family:Inter,"SF Pro Text","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
body{
  background:var(--factory-ivory) !important;
  color:var(--factory-ink) !important;
  font-family:Inter,"SF Pro Text","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
}
.settings-card,
.result-section,
.account-strip,
.factory-template-card,
.factory-templates-empty,
.factory-template-dialog-shell,
.factory-user-menu,
.factory-template-preview,
.factory-template-card-summary>div,
.factory-workflow-run-row,
.voice-library-compact-card,
.voice-library-settings-card,
.provider-diagnostic,
.compact-card,
.compact-panel,
.montage-shell,
.voice-compact-grid > *{
  background:rgba(255,253,249,.62) !important;
}
textarea,
.text-input,
.select-input,
.single-select,
.file-input,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="email"],
select{
  background:rgba(255,253,249,.86) !important;
}

h1,h2,h3,h4,h5,h6,
.factory-brand-heading h1,
.section-heading>label,
.card-heading h1,
.card-heading h2,
.card-heading h3,
.factory-template-card h2,
.montage-accordion-toggle,
.collapsible-card-toggle,
.voice-column-heading h2,
.visual-control-heading h2,
.photo-control-heading h2,
.factory-templates-heading h2{
  font-family:Inter,"SF Pro Display","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
  font-weight:800 !important;
  letter-spacing:-.035em !important;
}

body,
p,small,label,legend,summary,li,td,th,
button,input,textarea,select,
.field-label,
.counter,
.account-label,
.factory-user-copy,
.factory-template-description,
.factory-run-row-progress,
.factory-workflow-run-row,
.tab-button,
.visual-mode-button,
.primary-button,
.primary-small-button,
.secondary-button,
.text-button,
.link-button{
  font-family:Inter,"SF Pro Text","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
}

.tab-button,
.visual-mode-button,
.primary-button,
.primary-small-button,
.voice-library-launch-button,
.secondary-button,
.factory-template-nav,
.factory-admin-panel-button{
  font-weight:750 !important;
  letter-spacing:-.015em !important;
}

.card-kicker,
.eyebrow,
.account-label{
  font-weight:800 !important;
  letter-spacing:.14em !important;
}

/* v0.37: keep final montage actions visible inside the fixed no-scroll workspace */
.montage-result-card{
  grid-template-rows:auto minmax(110px,1fr) auto auto;
  min-height:0;
  overflow:hidden;
}
.montage-result-card .card-heading{
  min-height:0;
}
.montage-result-card .montage-preview{
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  max-height:none;
  object-fit:contain;
}
.montage-result-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  margin:0;
  flex-wrap:nowrap;
  align-items:stretch;
}
.montage-result-actions > *{
  width:100%;
  min-width:0;
  min-height:38px;
  padding:7px 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  white-space:nowrap;
  font-size:11px;
}
#saveWorkflowTemplateButton{
  background:#070809 !important;
  color:#F1E8D9 !important;
  border-color:#070809 !important;
}
#saveWorkflowTemplateStatus{
  min-height:16px;
  margin:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
@media(max-height:820px) and (min-width:981px){
  .montage-right-column{gap:7px}
  .montage-run-card{min-height:126px;padding:9px 10px}
  .montage-result-card{padding:9px 10px;gap:7px;grid-template-rows:auto minmax(90px,1fr) auto auto}
  .montage-result-card .card-heading h2{font-size:20px}
  .montage-result-actions > *{min-height:34px;font-size:10px;padding:5px 6px}
}
@media(max-width:1180px) and (min-width:981px){
  .montage-result-actions{grid-template-columns:1fr 1fr}
  #saveWorkflowTemplateButton{grid-column:1 / -1}
}

/* v0.38: final voice result moved below the script in the left column */
.voice-left-column{
  grid-template-rows:auto minmax(0,1fr) auto;
}
.voice-left-column .voice-script-workspace{
  height:100%;
  min-height:0;
}
.voice-left-column .voice-result-compact{
  min-height:118px;
  max-height:132px;
  overflow:hidden;
}
.voice-left-column .voice-result-compact .compact-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.voice-left-column .voice-result-actions{
  justify-content:flex-end;
  flex-wrap:nowrap;
}
.voice-right-column{
  grid-template-rows:auto auto auto auto auto minmax(0,1fr);
}
@media(max-height:820px) and (min-width:851px){
  .voice-left-column .voice-result-compact{
    min-height:108px;
    max-height:118px;
    padding:8px 10px;
    gap:5px;
  }
  .voice-left-column .voice-result-compact h2{font-size:15px}
  .voice-left-column .voice-result-compact .final-audio{height:34px}
  .voice-left-column .voice-result-actions a{min-height:28px;padding:5px 8px}
}

/* AUTOTUBE_NIGHT_MODE_V1_BEGIN */
:root{
  --at-night-bg:#17181a;
  --at-night-bg-soft:#1d1f22;
  --at-night-surface:#222428;
  --at-night-surface-2:#282a2f;
  --at-night-surface-3:#303238;
  --at-night-text:#eee9e1;
  --at-night-muted:#aaa49b;
  --at-night-border:rgba(238,233,225,.12);
  --at-night-border-strong:rgba(238,233,225,.20);
  --at-night-accent:#d6b37b;
  --at-night-accent-hover:#e2c28f;
  --at-night-accent-ink:#181713;
  --at-night-danger:#e58a82;
  --at-night-success:#8fbea0;
}

.factory-theme-toggle{
  position:fixed;
  top:14px;
  right:14px;
  z-index:1700;
  width:48px;
  height:48px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid rgba(7,8,9,.14);
  border-radius:14px;
  color:#171713;
  background:rgba(255,253,249,.72);
  box-shadow:0 8px 24px rgba(42,35,23,.07);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;
}
.factory-theme-toggle:hover{
  transform:translateY(-1px);
  background:rgba(255,253,249,.96);
  border-color:rgba(7,8,9,.24);
  box-shadow:0 11px 30px rgba(42,35,23,.11);
}
.factory-theme-toggle:active{transform:translateY(0)}
.factory-theme-toggle:focus-visible{
  outline:3px solid rgba(166,120,25,.24);
  outline-offset:2px;
}
.factory-theme-toggle svg{
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.factory-theme-toggle .theme-icon-sun{display:none}

html[data-autotube-theme="dark"]{
  color-scheme:dark;
  background:var(--at-night-bg)!important;
}
html[data-autotube-theme="dark"] body{
  color:var(--at-night-text)!important;
  background:
    radial-gradient(circle at 0% 0%,rgba(214,179,123,.095),transparent 28%),
    radial-gradient(circle at 100% 4%,rgba(118,154,137,.07),transparent 26%),
    linear-gradient(180deg,#18191b 0%,#151618 100%)!important;
}
html[data-autotube-theme="dark"] .factory-theme-toggle{
  color:var(--at-night-text);
  background:rgba(34,36,40,.84);
  border-color:var(--at-night-border);
  box-shadow:0 10px 30px rgba(0,0,0,.24);
}
html[data-autotube-theme="dark"] .factory-theme-toggle:hover{
  color:#fff8ee;
  background:#2c2e33;
  border-color:var(--at-night-border-strong);
}
html[data-autotube-theme="dark"] .factory-theme-toggle .theme-icon-moon{display:none}
html[data-autotube-theme="dark"] .factory-theme-toggle .theme-icon-sun{display:block}

/* Main surfaces */
html[data-autotube-theme="dark"] .tabs,
html[data-autotube-theme="dark"] .visual-mode-toggle,
html[data-autotube-theme="dark"] .settings-card,
html[data-autotube-theme="dark"] .result-section,
html[data-autotube-theme="dark"] .account-strip,
html[data-autotube-theme="dark"] .rewrite-source-panel,
html[data-autotube-theme="dark"] .rewrite-results-column .text-section,
html[data-autotube-theme="dark"] .video-workspace-card,
html[data-autotube-theme="dark"] .photo-workspace-card,
html[data-autotube-theme="dark"] .voice-compact-shell,
html[data-autotube-theme="dark"] .montage-row-card,
html[data-autotube-theme="dark"] .montage-right-card,
html[data-autotube-theme="dark"] .montage-accordion-card,
html[data-autotube-theme="dark"] .montage-fixed-card-collapsible,
html[data-autotube-theme="dark"] .montage-result-card,
html[data-autotube-theme="dark"] .factory-template-card,
html[data-autotube-theme="dark"] .factory-templates-empty,
html[data-autotube-theme="dark"] .factory-template-dialog-shell,
html[data-autotube-theme="dark"] .factory-template-preview,
html[data-autotube-theme="dark"] .factory-template-card-summary>div,
html[data-autotube-theme="dark"] .factory-workflow-run-row,
html[data-autotube-theme="dark"] .voice-library-compact-card,
html[data-autotube-theme="dark"] .voice-library-settings-card,
html[data-autotube-theme="dark"] .provider-diagnostic,
html[data-autotube-theme="dark"] .compact-card,
html[data-autotube-theme="dark"] .compact-panel,
html[data-autotube-theme="dark"] .voice-compact-grid>*,
html[data-autotube-theme="dark"] .compact-montage-presets>div,
html[data-autotube-theme="dark"] .compact-montage-presets-nine>div{
  color:var(--at-night-text)!important;
  background:rgba(34,36,40,.84)!important;
  border-color:var(--at-night-border)!important;
  box-shadow:0 10px 28px rgba(0,0,0,.16)!important;
}

/* Slightly elevated/secondary cards */
html[data-autotube-theme="dark"] .factory-template-preview,
html[data-autotube-theme="dark"] .factory-template-card-summary>div,
html[data-autotube-theme="dark"] .compact-montage-presets>div,
html[data-autotube-theme="dark"] .compact-montage-presets-nine>div,
html[data-autotube-theme="dark"] .factory-workflow-steps span,
html[data-autotube-theme="dark"] .montage-presets>div{
  background:rgba(44,46,51,.82)!important;
}

/* Typography */
html[data-autotube-theme="dark"] body,
html[data-autotube-theme="dark"] h1,
html[data-autotube-theme="dark"] h2,
html[data-autotube-theme="dark"] h3,
html[data-autotube-theme="dark"] h4,
html[data-autotube-theme="dark"] h5,
html[data-autotube-theme="dark"] h6,
html[data-autotube-theme="dark"] label,
html[data-autotube-theme="dark"] legend,
html[data-autotube-theme="dark"] summary,
html[data-autotube-theme="dark"] p,
html[data-autotube-theme="dark"] li,
html[data-autotube-theme="dark"] td,
html[data-autotube-theme="dark"] th,
html[data-autotube-theme="dark"] .factory-user-copy strong,
html[data-autotube-theme="dark"] .factory-template-card-summary strong,
html[data-autotube-theme="dark"] .factory-template-preview strong,
html[data-autotube-theme="dark"] .montage-accordion-toggle,
html[data-autotube-theme="dark"] .collapsible-card-toggle{
  color:var(--at-night-text)!important;
}
html[data-autotube-theme="dark"] .card-kicker,
html[data-autotube-theme="dark"] .eyebrow,
html[data-autotube-theme="dark"] .counter,
html[data-autotube-theme="dark"] .field-label,
html[data-autotube-theme="dark"] .connection,
html[data-autotube-theme="dark"] .card-heading p,
html[data-autotube-theme="dark"] .factory-template-description,
html[data-autotube-theme="dark"] .factory-templates-heading p,
html[data-autotube-theme="dark"] .factory-run-row-progress,
html[data-autotube-theme="dark"] .factory-workflow-run-row small,
html[data-autotube-theme="dark"] .factory-template-card-summary span,
html[data-autotube-theme="dark"] .factory-template-preview span,
html[data-autotube-theme="dark"] .montage-source-row small,
html[data-autotube-theme="dark"] .montage-upload-row small,
html[data-autotube-theme="dark"] .montage-volume-field small,
html[data-autotube-theme="dark"] .compact-inline-help,
html[data-autotube-theme="dark"] .montage-preset-tile span,
html[data-autotube-theme="dark"] .montage-preset-tile label,
html[data-autotube-theme="dark"] .montage-outline-tile small,
html[data-autotube-theme="dark"] .factory-user-copy span{
  color:var(--at-night-muted)!important;
  opacity:1!important;
}
html[data-autotube-theme="dark"] .factory-brand-heading h1 span{
  color:var(--at-night-text)!important;
}
html[data-autotube-theme="dark"] .factory-brand-heading h1 strong{
  color:var(--at-night-accent)!important;
}

/* Form controls */
html[data-autotube-theme="dark"] textarea,
html[data-autotube-theme="dark"] .text-input,
html[data-autotube-theme="dark"] .select-input,
html[data-autotube-theme="dark"] .single-select,
html[data-autotube-theme="dark"] .file-input,
html[data-autotube-theme="dark"] .montage-zoom-select,
html[data-autotube-theme="dark"] .montage-compact-select,
html[data-autotube-theme="dark"] input[type="text"],
html[data-autotube-theme="dark"] input[type="number"],
html[data-autotube-theme="dark"] input[type="password"],
html[data-autotube-theme="dark"] input[type="search"],
html[data-autotube-theme="dark"] input[type="email"],
html[data-autotube-theme="dark"] input[type="url"],
html[data-autotube-theme="dark"] select{
  color:var(--at-night-text)!important;
  background:#1c1e21!important;
  border-color:var(--at-night-border)!important;
  box-shadow:none!important;
}
html[data-autotube-theme="dark"] textarea::placeholder,
html[data-autotube-theme="dark"] input::placeholder{
  color:#777a80!important;
}
html[data-autotube-theme="dark"] textarea:focus,
html[data-autotube-theme="dark"] .text-input:focus,
html[data-autotube-theme="dark"] .select-input:focus,
html[data-autotube-theme="dark"] input:focus,
html[data-autotube-theme="dark"] select:focus{
  border-color:rgba(214,179,123,.7)!important;
  box-shadow:0 0 0 3px rgba(214,179,123,.11)!important;
}
html[data-autotube-theme="dark"] .file-input::file-selector-button{
  color:var(--at-night-text)!important;
  background:#2c2e33!important;
  border:0!important;
}
html[data-autotube-theme="dark"] input[type="checkbox"],
html[data-autotube-theme="dark"] input[type="radio"],
html[data-autotube-theme="dark"] input[type="range"],
html[data-autotube-theme="dark"] progress,
html[data-autotube-theme="dark"] meter{
  accent-color:var(--at-night-accent);
}

/* Navigation + primary actions */
html[data-autotube-theme="dark"] .tab-button,
html[data-autotube-theme="dark"] .visual-mode-button{
  color:#b9b3aa!important;
  background:transparent!important;
}
html[data-autotube-theme="dark"] .tab-button:hover,
html[data-autotube-theme="dark"] .visual-mode-button:hover{
  color:#f4eee5!important;
  background:rgba(255,255,255,.045)!important;
}
html[data-autotube-theme="dark"] .tab-button.active,
html[data-autotube-theme="dark"] .visual-mode-button.active,
html[data-autotube-theme="dark"] .primary-button,
html[data-autotube-theme="dark"] .primary-small-button,
html[data-autotube-theme="dark"] .voice-library-launch-button,
html[data-autotube-theme="dark"] .factory-workflow-steps span.active{
  color:var(--at-night-accent-ink)!important;
  background:var(--at-night-accent)!important;
  border-color:var(--at-night-accent)!important;
  box-shadow:0 8px 22px rgba(0,0,0,.22)!important;
}
html[data-autotube-theme="dark"] .primary-button:hover:not(:disabled),
html[data-autotube-theme="dark"] .primary-small-button:hover:not(:disabled),
html[data-autotube-theme="dark"] .voice-library-launch-button:hover:not(:disabled),
html[data-autotube-theme="dark"] .tab-button.active:hover,
html[data-autotube-theme="dark"] .visual-mode-button.active:hover{
  background:var(--at-night-accent-hover)!important;
}

/* Secondary actions */
html[data-autotube-theme="dark"] .secondary-button,
html[data-autotube-theme="dark"] .cancel-button,
html[data-autotube-theme="dark"] .link-button,
html[data-autotube-theme="dark"] .icon-button,
html[data-autotube-theme="dark"] .factory-template-nav,
html[data-autotube-theme="dark"] .factory-admin-panel-button,
html[data-autotube-theme="dark"] .text-button{
  color:#ddd7ce!important;
  background:rgba(255,255,255,.035)!important;
  border-color:var(--at-night-border)!important;
}
html[data-autotube-theme="dark"] .secondary-button:hover:not(:disabled),
html[data-autotube-theme="dark"] .cancel-button:hover:not(:disabled),
html[data-autotube-theme="dark"] .link-button:hover,
html[data-autotube-theme="dark"] .icon-button:hover,
html[data-autotube-theme="dark"] .factory-template-nav:hover,
html[data-autotube-theme="dark"] .factory-admin-panel-button:hover,
html[data-autotube-theme="dark"] .text-button:hover:not(:disabled){
  color:#fff8ee!important;
  background:rgba(255,255,255,.075)!important;
  border-color:var(--at-night-border-strong)!important;
}

/* Account menu */
html[data-autotube-theme="dark"] .factory-user-trigger{
  color:var(--at-night-text)!important;
  background:rgba(34,36,40,.88)!important;
  border-color:var(--at-night-border)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.18)!important;
}
html[data-autotube-theme="dark"] .factory-user-trigger:hover,
html[data-autotube-theme="dark"] .factory-user-control.menu-open .factory-user-trigger,
html[data-autotube-theme="dark"] .factory-user-control[open] .factory-user-trigger{
  background:#2b2d31!important;
  border-color:var(--at-night-border-strong)!important;
}
html[data-autotube-theme="dark"] .factory-user-avatar{
  background:rgba(214,179,123,.12)!important;
  color:var(--at-night-accent)!important;
}
html[data-autotube-theme="dark"] .factory-user-menu{
  color:var(--at-night-text)!important;
  background:rgba(31,33,36,.98)!important;
  border-color:var(--at-night-border)!important;
  box-shadow:0 18px 48px rgba(0,0,0,.34)!important;
}
html[data-autotube-theme="dark"] .factory-logout-button{
  color:var(--at-night-danger)!important;
  background:transparent!important;
  border:0!important;
}
html[data-autotube-theme="dark"] .factory-logout-button:hover{
  background:rgba(229,138,130,.08)!important;
}

/* Status and diagnostics */
html[data-autotube-theme="dark"] .progress{color:#b7b1a8!important}
html[data-autotube-theme="dark"] .warning{color:#e4bb76!important}
html[data-autotube-theme="dark"] .error,
html[data-autotube-theme="dark"] .danger-text{color:var(--at-night-danger)!important}
html[data-autotube-theme="dark"] .factory-run-status.status-completed{
  color:#b8dfc4!important;background:rgba(89,150,109,.16)!important
}
html[data-autotube-theme="dark"] .factory-run-status.status-running,
html[data-autotube-theme="dark"] .factory-run-status.status-queued,
html[data-autotube-theme="dark"] .factory-run-status.status-cancel_requested{
  color:#e6c887!important;background:rgba(202,161,75,.14)!important
}
html[data-autotube-theme="dark"] .factory-run-status.status-error,
html[data-autotube-theme="dark"] .factory-run-status.status-cancelled{
  color:#efaaa4!important;background:rgba(203,91,82,.14)!important
}
html[data-autotube-theme="dark"] .provider-diagnostic pre,
html[data-autotube-theme="dark"] code,
html[data-autotube-theme="dark"] pre{
  color:#d8d2c9!important;
}
html[data-autotube-theme="dark"] .photo-cloud-card code,
html[data-autotube-theme="dark"] .photo-result-card code,
html[data-autotube-theme="dark"] .photo-regenerate-card code{
  color:#b9d5c5!important;
  background:rgba(143,190,160,.10)!important;
}

/* Video/audio remain truly dark without filters. */
html[data-autotube-theme="dark"] video,
html[data-autotube-theme="dark"] audio{
  filter:none!important;
}
html[data-autotube-theme="dark"] .montage-preview{background:#090a0b!important}

/* Native dialogs */
html[data-autotube-theme="dark"] dialog .dialog-shell,
html[data-autotube-theme="dark"] dialog .factory-template-dialog-shell{
  color:var(--at-night-text)!important;
  background:#222428!important;
  border-color:var(--at-night-border)!important;
}
html[data-autotube-theme="dark"] dialog::backdrop{
  background:rgba(7,8,10,.72)!important;
}

/* Mobile: keep account left, theme control right. */
@media(max-width:760px){
  .factory-theme-toggle{top:10px;right:10px;width:46px;height:46px;border-radius:13px}
}
/* AUTOTUBE_NIGHT_MODE_V1_END */

/* AUTOTUBE_NIGHT_MODE_BLOCKS_V1_1_BEGIN */

/*
  v1.1 — remove the remaining translucent ivory surfaces in night mode.
  Target visual reference: the localization screen where major blocks are
  approximately #1c1e21 and nested controls are slightly lighter graphite.
*/
html[data-autotube-theme="dark"] .video-control-column,
html[data-autotube-theme="dark"] .video-script-column,
html[data-autotube-theme="dark"] .photo-control-column,
html[data-autotube-theme="dark"] .photo-script-column,
html[data-autotube-theme="dark"] .visual-control-column,
html[data-autotube-theme="dark"] .visual-script-column,
html[data-autotube-theme="dark"] .voice-left-column,
html[data-autotube-theme="dark"] .voice-right-column,
html[data-autotube-theme="dark"] .montage-row-card,
html[data-autotube-theme="dark"] .montage-right-card,
html[data-autotube-theme="dark"] .rewrite-source-panel,
html[data-autotube-theme="dark"] .rewrite-results-column .text-section{
  background:#1c1e21 !important;
  border-color:#3a3c40 !important;
  color:#eee9e1 !important;
  box-shadow:none !important;
}

/* Nested blocks: same family, only one step lighter for separation. */
html[data-autotube-theme="dark"] .video-compact-toggle,
html[data-autotube-theme="dark"] .photo-compact-toggle,
html[data-autotube-theme="dark"] .voice-library-settings-card,
html[data-autotube-theme="dark"] .voice-compact-control,
html[data-autotube-theme="dark"] .voice-slider-tile,
html[data-autotube-theme="dark"] .voice-speaker-toggle,
html[data-autotube-theme="dark"] .voice-result-compact,
html[data-autotube-theme="dark"] .compact-montage-presets>div,
html[data-autotube-theme="dark"] .compact-montage-presets-nine>div,
html[data-autotube-theme="dark"] .montage-presets>div,
html[data-autotube-theme="dark"] .factory-template-card-summary>div,
html[data-autotube-theme="dark"] .factory-workflow-steps span{
  background:#24262a !important;
  border-color:#3a3c40 !important;
  color:#eee9e1 !important;
  box-shadow:none !important;
}

/* Chips / fixed video parameters should not remain ivory. */
html[data-autotube-theme="dark"] .video-fixed-parameters span,
html[data-autotube-theme="dark"] .photo-fixed-parameters span,
html[data-autotube-theme="dark"] .visual-fixed-parameters span{
  background:#2a2c30 !important;
  border-color:#414348 !important;
  color:#cfc9c0 !important;
}

/* The local visual-mode shell also had its own light rgba background. */
html[data-autotube-theme="dark"] .visual-tab-shell .visual-mode-toggle,
html[data-autotube-theme="dark"] .visual-switch-shell .visual-mode-toggle{
  background:#222428 !important;
  border-color:#3a3c40 !important;
}

/* Keep textareas/inputs at the darker level used on the good reference screen. */
html[data-autotube-theme="dark"] .video-script-column textarea,
html[data-autotube-theme="dark"] .photo-script-column textarea,
html[data-autotube-theme="dark"] .visual-script-column textarea,
html[data-autotube-theme="dark"] .voice-script-workspace textarea,
html[data-autotube-theme="dark"] .rewrite-source-panel textarea,
html[data-autotube-theme="dark"] .rewrite-results-column textarea{
  background:#1c1e21 !important;
  border-color:#3a3c40 !important;
  color:#eee9e1 !important;
}

/* Remove washed-out light disabled surfaces while preserving disabled state. */
html[data-autotube-theme="dark"] button:disabled,
html[data-autotube-theme="dark"] .primary-button:disabled,
html[data-autotube-theme="dark"] .secondary-button:disabled{
  opacity:.48 !important;
  filter:none !important;
}

/* Labels/help inside the newly darkened blocks. */
html[data-autotube-theme="dark"] .video-control-column .video-style-hint,
html[data-autotube-theme="dark"] .photo-control-column .photo-config-help,
html[data-autotube-theme="dark"] .visual-control-column .inline-message,
html[data-autotube-theme="dark"] .voice-left-column .compact-voice-help,
html[data-autotube-theme="dark"] .voice-right-column .compact-voice-model-help,
html[data-autotube-theme="dark"] .montage-row-card small,
html[data-autotube-theme="dark"] .montage-right-card small{
  color:#aaa49b !important;
}

/* AUTOTUBE_NIGHT_MODE_BLOCKS_V1_1_END */

/* AUTOTUBE_NIGHT_MODE_WHITE_SURFACES_FIX_V1_BEGIN */
/* Remove the remaining light/white cards in night mode. */
html[data-autotube-theme="dark"] .packaging-run-card,
html[data-autotube-theme="dark"] .packaging-result-card,
html[data-autotube-theme="dark"] .packaging-copy-card,
html[data-autotube-theme="dark"] .packaging-thumb-card,
html[data-autotube-theme="dark"] .library-card{
  background:#1c1e21 !important;
  border-color:transparent !important;
  box-shadow:none !important;
  color:var(--at-night-text) !important;
}

html[data-autotube-theme="dark"] .library-dialog{
  background:#1c1e21 !important;
  border-color:transparent !important;
  box-shadow:0 24px 70px rgba(0,0,0,.42) !important;
}

html[data-autotube-theme="dark"] .library-card-description,
html[data-autotube-theme="dark"] .library-dialog .dialog-heading p:not(.card-kicker),
html[data-autotube-theme="dark"] .empty-state{
  color:var(--at-night-muted) !important;
}

html[data-autotube-theme="dark"] .library-card-tags{
  color:var(--at-night-accent) !important;
}

html[data-autotube-theme="dark"] .dialog-footer{
  border-top-color:var(--at-night-border) !important;
}
/* AUTOTUBE_NIGHT_MODE_WHITE_SURFACES_FIX_V1_END */

/* AUTOTUBE_PACKAGING_COMPACT_V13_DARK_BEGIN */
html[data-autotube-theme="dark"] .packaging-style-picker > span{
  color:var(--at-night-text)!important;
}
html[data-autotube-theme="dark"] .packaging-title-translation{
  color:var(--at-night-muted)!important;
}
/* AUTOTUBE_PACKAGING_COMPACT_V13_DARK_END */

/* AUTOTUBE_PACKAGING_VIEWPORT_WORKSPACE_V14_BEGIN */
html[data-autotube-theme="dark"] .packaging-source-pane,
html[data-autotube-theme="dark"] .packaging-center-pane,
html[data-autotube-theme="dark"] .packaging-results-pane,
html[data-autotube-theme="dark"] .packaging-copy-card,
html[data-autotube-theme="dark"] .packaging-thumb-card{
  background:#1c1e21 !important;
  border-color:transparent !important;
  box-shadow:none !important;
  color:var(--at-night-text) !important;
}
html[data-autotube-theme="dark"] .packaging-empty-state,
html[data-autotube-theme="dark"] .packaging-style-bottom>span,
html[data-autotube-theme="dark"] .packaging-title-translation,
html[data-autotube-theme="dark"] .packaging-center-meta .counter{
  color:var(--at-night-muted) !important;
}
html[data-autotube-theme="dark"] .packaging-center-meta{
  border-top-color:var(--at-night-border) !important;
}
/* AUTOTUBE_PACKAGING_VIEWPORT_WORKSPACE_V14_END */


/* AUTOTUBE_PACKAGING_RESULT_READABILITY_V17_DARK_BEGIN */
html[data-autotube-theme="dark"] .packaging-title-original {
  color: var(--at-night-text) !important;
}
html[data-autotube-theme="dark"] .packaging-title-translation {
  color: #e2b36f !important;
  font-weight: 700 !important;
}
html[data-autotube-theme="dark"] .packaging-thumb-actions .packaging-fullscreen-button {
  background: #25282c !important;
  border-color: #44484e !important;
  color: var(--at-night-text) !important;
}
html[data-autotube-theme="dark"] .packaging-thumb-actions .packaging-download-button {
  background: #e0b875 !important;
  border-color: #e0b875 !important;
  color: #111 !important;
}
/* AUTOTUBE_PACKAGING_RESULT_READABILITY_V17_DARK_END */


/* AUTOTUBE_PACKAGING_DOWNLOAD_PRIMARY_V19_BEGIN */
.packaging-thumb-actions a.packaging-download-button,
html[data-autotube-theme="light"] .packaging-thumb-actions a.packaging-download-button,
html[data-autotube-theme="dark"] .packaging-thumb-actions a.packaging-download-button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:34px !important;
  padding:7px 14px !important;
  border:0 !important;
  border-radius:11px !important;
  background:#080808 !important;
  color:#f3e8d8 !important;
  opacity:1 !important;
  visibility:visible !important;
  text-decoration:none !important;
  font-size:10px !important;
  line-height:1 !important;
  font-weight:800 !important;
  box-shadow:0 8px 20px rgba(0,0,0,.16) !important;
}
.packaging-thumb-actions a.packaging-download-button:hover{
  background:#1b1b1b !important;
  color:#fff5e7 !important;
}
/* AUTOTUBE_PACKAGING_DOWNLOAD_PRIMARY_V19_END */


/* AUTOTUBE_WORKFLOW_PROJECT_MODE_V1_BEGIN */
.factory-project-mode-banner{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px 18px;
  align-items:center;
  margin:0 0 14px;
  padding:14px 18px;
  border:1px solid var(--border-color,#ded5c8);
  border-radius:18px;
  background:var(--card-bg,rgba(255,254,250,.92));
}
.factory-project-mode-main{display:flex;align-items:center;justify-content:space-between;gap:18px;min-width:0}
.factory-project-mode-main h2{margin:2px 0 0;font-size:20px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.factory-project-mode-main p{margin:2px 0 0;color:#777168;font-size:12px}
.factory-project-mode-status{flex:0 0 auto;padding:7px 12px;border-radius:999px;background:#0c0c0c;color:#fff;font-size:12px;font-weight:800}
.factory-project-mode-stages{grid-column:1/2;display:flex;flex-wrap:wrap;gap:7px}
.factory-project-mode-stages span{padding:5px 9px;border-radius:999px;background:rgba(33,132,83,.09);color:#2f6d50;font-size:11px;font-weight:800}
.factory-project-mode-stages span.error{background:rgba(174,56,43,.09);color:#9a3028}
.factory-project-mode-back{grid-column:2;grid-row:1/3;align-self:center;text-decoration:none;white-space:nowrap}
html[data-autotube-theme="dark"] .factory-project-mode-banner{background:#1c1e21!important;border-color:transparent!important;color:var(--at-night-text)!important}
html[data-autotube-theme="dark"] .factory-project-mode-main p{color:var(--at-night-muted)!important}
@media(max-width:900px){.factory-project-mode-banner{grid-template-columns:1fr}.factory-project-mode-back{grid-column:1;grid-row:auto;justify-self:start}.factory-project-mode-stages{grid-column:1}.factory-project-mode-main{align-items:flex-start}.factory-project-mode-main h2{white-space:normal}}
/* AUTOTUBE_WORKFLOW_PROJECT_MODE_V1_END */

/* AUTOTUBE_NAVIGATION_LIQUID_GLASS_V56_BEGIN */
/* Isolated enhancement: only the main six-section navigation is affected. */
.tabs{
  overflow:visible!important;
  border:1px solid rgba(55,48,39,.16)!important;
  background-color:rgba(255,253,248,.24)!important;
  background-image:none!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.86),inset 0 -1px 0 rgba(75,62,45,.07),0 13px 34px rgba(73,59,40,.08)!important;
  backdrop-filter:blur(28px) saturate(155%) contrast(1.025)!important;
  -webkit-backdrop-filter:blur(28px) saturate(155%) contrast(1.025)!important;
}

.tabs .tab-button{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
  border-radius:12px!important;
  border:1px solid transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  transition:color .20s ease,border-color .20s ease,background-color .20s ease,box-shadow .20s ease,transform .20s ease!important;
}

.tabs .tab-button:not(.active):hover{
  color:#171713!important;
  border-color:rgba(64,55,44,.18)!important;
  background-color:rgba(255,255,255,.20)!important;
  background-image:none!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92),inset 0 -1px 0 rgba(65,54,41,.09),0 8px 22px rgba(69,55,38,.09)!important;
  backdrop-filter:blur(22px) saturate(170%) contrast(1.035)!important;
  -webkit-backdrop-filter:blur(22px) saturate(170%) contrast(1.035)!important;
  transform:translateY(-1px)!important;
}

.tabs .tab-button.active{
  color:#fff!important;
  border-color:rgba(255,255,255,.16)!important;
  background-color:rgba(5,6,7,.78)!important;
  background-image:none!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),inset 0 -1px 0 rgba(0,0,0,.48),0 9px 24px rgba(25,21,16,.18)!important;
  backdrop-filter:blur(24px) saturate(145%) brightness(.78)!important;
  -webkit-backdrop-filter:blur(24px) saturate(145%) brightness(.78)!important;
}

.tabs .tab-button.active:hover{
  background-color:rgba(10,11,12,.72)!important;
  border-color:rgba(255,255,255,.24)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.23),inset 0 -1px 0 rgba(0,0,0,.42),0 11px 28px rgba(25,21,16,.22)!important;
}

html[data-autotube-theme="dark"] .tabs{
  border-color:rgba(225,231,239,.14)!important;
  background-color:rgba(11,13,16,.30)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.11),inset 0 -1px 0 rgba(0,0,0,.34),0 14px 36px rgba(0,0,0,.22)!important;
  backdrop-filter:blur(28px) saturate(145%) brightness(.82)!important;
  -webkit-backdrop-filter:blur(28px) saturate(145%) brightness(.82)!important;
}
html[data-autotube-theme="dark"] .tabs .tab-button:not(.active):hover{
  color:#fff!important;
  border-color:rgba(235,240,248,.17)!important;
  background-color:rgba(235,240,248,.075)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),inset 0 -1px 0 rgba(0,0,0,.28),0 9px 24px rgba(0,0,0,.18)!important;
}
/* AUTOTUBE_NAVIGATION_LIQUID_GLASS_V56_END */

/* AUTOTUBE_CONVEX_NAV_GLASS_LENS_V57_BEGIN */
/* Convex optical lens matching the supplied mobile liquid-glass references. */
.tabs{
  padding:5px!important;
  border-radius:18px!important;
  background-color:rgba(255,252,245,.34)!important;
  border-color:rgba(86,72,53,.14)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92),0 10px 26px rgba(71,56,37,.07)!important;
  backdrop-filter:blur(20px) saturate(145%)!important;
  -webkit-backdrop-filter:blur(20px) saturate(145%)!important;
}

.tabs .tab-button,
.tabs .tab-button.active,
.tabs .tab-button:not(.active):hover{
  border-radius:999px!important;
}

.tabs .tab-button::before,
.tabs .tab-button::after{
  content:""!important;
  position:absolute!important;
  pointer-events:none!important;
  border-radius:inherit!important;
  opacity:0!important;
  transition:opacity .18s ease!important;
}

/* Refraction body: bright crown, darker lower rim and curved side highlights. */
.tabs .tab-button::before{
  inset:0!important;
  z-index:-1!important;
  background:
    radial-gradient(ellipse at 50% -18%,rgba(255,255,255,.88) 0%,rgba(255,255,255,.20) 39%,transparent 64%),
    radial-gradient(ellipse at 5% 50%,rgba(255,255,255,.34),transparent 28%),
    radial-gradient(ellipse at 96% 50%,rgba(255,255,255,.28),transparent 29%),
    linear-gradient(180deg,rgba(255,255,255,.19),rgba(210,218,224,.12) 46%,rgba(56,64,72,.19))!important;
}

/* Narrow specular streak makes the lens read as curved rather than frosted. */
.tabs .tab-button::after{
  z-index:2!important;
  top:3px!important;
  left:14%!important;
  right:14%!important;
  height:1px!important;
  background:rgba(255,255,255,.88)!important;
  box-shadow:0 1px 5px rgba(255,255,255,.58)!important;
}

.tabs .tab-button:not(.active){
  color:#171713!important;
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}

.tabs .tab-button:not(.active):hover{
  color:#111317!important;
  border:1px solid rgba(91,103,114,.40)!important;
  background-color:rgba(224,231,235,.20)!important;
  background-image:none!important;
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.86),
    inset 0 -4px 9px rgba(48,58,67,.22),
    inset 4px 0 10px rgba(255,255,255,.20),
    inset -4px 0 10px rgba(61,71,81,.10),
    0 0 0 1px rgba(255,255,255,.48),
    0 8px 19px rgba(50,58,66,.17)!important;
  backdrop-filter:blur(9px) saturate(185%) contrast(1.08) brightness(1.04)!important;
  -webkit-backdrop-filter:blur(9px) saturate(185%) contrast(1.08) brightness(1.04)!important;
}

.tabs .tab-button.active{
  color:#15171a!important;
  border:1px solid rgba(77,91,104,.52)!important;
  background-color:rgba(207,218,225,.24)!important;
  background-image:none!important;
  text-shadow:0 1px 0 rgba(255,255,255,.70)!important;
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.94),
    inset 0 -5px 11px rgba(38,49,59,.30),
    inset 5px 0 13px rgba(255,255,255,.24),
    inset -5px 0 13px rgba(52,63,74,.13),
    0 0 0 1px rgba(255,255,255,.62),
    0 10px 23px rgba(47,56,64,.21)!important;
  backdrop-filter:blur(10px) saturate(195%) contrast(1.10) brightness(1.03)!important;
  -webkit-backdrop-filter:blur(10px) saturate(195%) contrast(1.10) brightness(1.03)!important;
  transform:none!important;
}

.tabs .tab-button.active::before,
.tabs .tab-button.active::after,
.tabs .tab-button:not(.active):hover::before,
.tabs .tab-button:not(.active):hover::after{opacity:1!important}

.tabs .tab-button.active:hover{
  color:#111317!important;
  background-color:rgba(216,226,232,.27)!important;
  border-color:rgba(69,84,98,.58)!important;
  transform:translateY(-1px)!important;
}

html[data-autotube-theme="dark"] .tabs .tab-button.active,
html[data-autotube-theme="dark"] .tabs .tab-button:not(.active):hover{
  color:#fff!important;
  text-shadow:0 1px 2px rgba(0,0,0,.72)!important;
  background-color:rgba(46,58,72,.30)!important;
  border-color:rgba(198,218,238,.48)!important;
  box-shadow:
    inset 0 2px 1px rgba(235,246,255,.56),
    inset 0 -5px 12px rgba(0,6,15,.54),
    inset 5px 0 13px rgba(215,232,248,.14),
    inset -5px 0 13px rgba(0,4,10,.22),
    0 0 0 1px rgba(225,238,250,.24),
    0 10px 25px rgba(0,0,0,.32)!important;
  backdrop-filter:blur(11px) saturate(190%) contrast(1.10) brightness(.86)!important;
  -webkit-backdrop-filter:blur(11px) saturate(190%) contrast(1.10) brightness(.86)!important;
}
/* AUTOTUBE_CONVEX_NAV_GLASS_LENS_V57_END */

/* AUTOTUBE_CHROME_LIQUID_GLASS_LENS_V58_BEGIN */
/* High-depth glass/chrome lens: explicit caustics replace the flat frosted fill. */
.tabs .tab-button.active,
.tabs .tab-button:not(.active):hover{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
  border-radius:999px!important;
  color:#101214!important;
  border:1px solid rgba(50,57,63,.72)!important;
  background-color:rgba(214,218,219,.72)!important;
  background-image:
    radial-gradient(ellipse at 50% 51%,rgba(255,255,255,.94) 0%,rgba(244,246,246,.88) 24%,rgba(206,211,213,.80) 58%,rgba(112,120,126,.72) 100%),
    linear-gradient(180deg,rgba(26,30,33,.92) 0%,rgba(205,211,214,.78) 13%,rgba(255,255,255,.86) 43%,rgba(151,158,163,.78) 79%,rgba(36,41,45,.92) 100%)!important;
  background-blend-mode:screen,normal!important;
  text-shadow:0 1px 0 rgba(255,255,255,.92),0 -1px 0 rgba(20,23,25,.08)!important;
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.96),
    inset 0 5px 8px rgba(14,18,21,.42),
    inset 0 -3px 2px rgba(255,255,255,.78),
    inset 0 -8px 11px rgba(24,29,33,.36),
    inset 5px 0 8px rgba(255,255,255,.82),
    inset -5px 0 9px rgba(28,34,38,.32),
    0 0 0 1px rgba(255,255,255,.72),
    0 10px 19px rgba(59,54,46,.26),
    0 18px 34px rgba(61,56,48,.11)!important;
  backdrop-filter:blur(7px) saturate(180%) contrast(1.16)!important;
  -webkit-backdrop-filter:blur(7px) saturate(180%) contrast(1.16)!important;
}

/* Curved left caustic and dark inner rim. */
.tabs .tab-button.active::before,
.tabs .tab-button:not(.active):hover::before{
  content:""!important;
  position:absolute!important;
  z-index:0!important;
  pointer-events:none!important;
  opacity:1!important;
  inset:2px!important;
  border-radius:inherit!important;
  background:
    radial-gradient(ellipse at 7% 50%,rgba(255,255,255,.98) 0%,rgba(255,255,255,.75) 5%,rgba(255,255,255,.12) 17%,transparent 30%),
    radial-gradient(ellipse at 50% 112%,rgba(255,255,255,.80) 0%,rgba(255,255,255,.16) 31%,transparent 55%),
    radial-gradient(ellipse at 50% -22%,rgba(20,24,27,.72) 0%,rgba(38,43,47,.34) 31%,transparent 57%)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.38),inset 0 0 12px rgba(255,255,255,.18)!important;
  mix-blend-mode:soft-light!important;
}

/* Distinct right-hand specular reflection from the supplied reference. */
.tabs .tab-button.active::after,
.tabs .tab-button:not(.active):hover::after{
  content:""!important;
  position:absolute!important;
  z-index:1!important;
  pointer-events:none!important;
  opacity:1!important;
  top:31%!important;
  right:3.7%!important;
  left:auto!important;
  width:7px!important;
  height:17px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.98)!important;
  box-shadow:0 0 4px rgba(255,255,255,.92),-2px 2px 6px rgba(255,255,255,.42)!important;
  transform:rotate(25deg)!important;
}

.tabs .tab-button:not(.active):hover{
  background-color:rgba(221,225,226,.56)!important;
  filter:brightness(1.035)!important;
  transform:translateY(-1px)!important;
}
.tabs .tab-button.active:hover{filter:brightness(1.025)!important}

/* Keep labels above the optical layers in browsers that support text painting isolation. */
.tabs .tab-button{font-weight:720!important}
/* AUTOTUBE_CHROME_LIQUID_GLASS_LENS_V58_END */

/* AUTOTUBE_CHROME_LIQUID_GLASS_NAV_SHELL_V59_BEGIN */
/* The full navigation carrier is now a quieter, elongated version of the same glass material. */
.tabs{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
  padding:5px!important;
  border-radius:24px!important;
  border:1px solid rgba(72,78,81,.48)!important;
  background-color:rgba(222,220,212,.42)!important;
  background-image:
    radial-gradient(ellipse at 7% 48%,rgba(255,255,255,.68) 0%,rgba(255,255,255,.16) 13%,transparent 27%),
    radial-gradient(ellipse at 93% 52%,rgba(255,255,255,.48) 0%,rgba(255,255,255,.10) 13%,transparent 28%),
    radial-gradient(ellipse at 50% -90%,rgba(255,255,255,.90) 0%,rgba(255,255,255,.19) 50%,transparent 72%),
    linear-gradient(180deg,rgba(65,68,68,.34) 0%,rgba(255,255,255,.64) 12%,rgba(248,245,237,.38) 51%,rgba(137,137,132,.25) 84%,rgba(47,50,51,.32) 100%)!important;
  background-blend-mode:screen,screen,screen,normal!important;
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.96),
    inset 0 5px 8px rgba(42,43,42,.18),
    inset 0 -2px 1px rgba(255,255,255,.70),
    inset 0 -7px 11px rgba(61,61,58,.19),
    inset 5px 0 10px rgba(255,255,255,.40),
    inset -5px 0 10px rgba(61,64,66,.13),
    0 0 0 1px rgba(255,255,255,.72),
    0 12px 25px rgba(72,61,45,.16)!important;
  backdrop-filter:blur(13px) saturate(170%) contrast(1.08)!important;
  -webkit-backdrop-filter:blur(13px) saturate(170%) contrast(1.08)!important;
}

/* Long, restrained specular line across the curved upper face. */
.tabs::before{
  content:""!important;
  position:absolute!important;
  z-index:0!important;
  pointer-events:none!important;
  top:3px!important;
  left:3.5%!important;
  right:3.5%!important;
  height:1px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.72)!important;
  box-shadow:0 1px 7px rgba(255,255,255,.46)!important;
}
.tabs > .tab-button{z-index:1!important}

html[data-autotube-theme="dark"] .tabs{
  border-color:rgba(191,207,221,.34)!important;
  background-color:rgba(26,33,42,.42)!important;
  background-image:
    radial-gradient(ellipse at 7% 48%,rgba(223,238,252,.23),transparent 27%),
    radial-gradient(ellipse at 93% 52%,rgba(223,238,252,.16),transparent 28%),
    radial-gradient(ellipse at 50% -90%,rgba(226,240,252,.31),transparent 72%),
    linear-gradient(180deg,rgba(5,9,14,.76),rgba(66,77,89,.34) 14%,rgba(28,35,44,.42) 56%,rgba(4,8,13,.68) 100%)!important;
  background-blend-mode:screen,screen,screen,normal!important;
  box-shadow:
    inset 0 2px 1px rgba(225,239,251,.36),
    inset 0 5px 9px rgba(0,0,0,.42),
    inset 0 -2px 1px rgba(208,225,239,.20),
    inset 0 -7px 12px rgba(0,0,0,.42),
    0 0 0 1px rgba(221,235,247,.17),
    0 13px 28px rgba(0,0,0,.28)!important;
  backdrop-filter:blur(14px) saturate(165%) contrast(1.09) brightness(.87)!important;
  -webkit-backdrop-filter:blur(14px) saturate(165%) contrast(1.09) brightness(.87)!important;
}
/* AUTOTUBE_CHROME_LIQUID_GLASS_NAV_SHELL_V59_END */

/* AUTOTUBE_LUXURY_PORCELAIN_PALETTE_V60_BEGIN */
:root{
  --v60-canvas:#f1f2f3;
  --v60-surface:#f7f8f8;
  --v60-surface-soft:#f5f6f6;
  --v60-inset:#fbfcfc;
  --v60-line:rgba(45,53,62,.17);
  --v60-line-soft:rgba(45,53,62,.12);
  --v60-text:#16191d;
  --v60-muted:#6e747b;
}

html[data-autotube-theme="light"],
html[data-autotube-theme="light"] body{
  color:var(--v60-text)!important;
  background-color:var(--v60-canvas)!important;
  background-image:none!important;
}

html[data-autotube-theme="light"] body::before{
  display:block!important;
  content:""!important;
  position:fixed!important;
  inset:0!important;
  z-index:-1!important;
  pointer-events:none!important;
  opacity:.22!important;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E")!important;
  mix-blend-mode:multiply!important;
}

html[data-autotube-theme="light"] .settings-card,
html[data-autotube-theme="light"] .result-section,
html[data-autotube-theme="light"] .account-strip,
html[data-autotube-theme="light"] .rewrite-source-panel,
html[data-autotube-theme="light"] .rewrite-results-column .text-section,
html[data-autotube-theme="light"] .video-workspace-card,
html[data-autotube-theme="light"] .photo-workspace-card,
html[data-autotube-theme="light"] .voice-compact-shell,
html[data-autotube-theme="light"] .voice-left-column,
html[data-autotube-theme="light"] .voice-right-column,
html[data-autotube-theme="light"] .visual-control-column,
html[data-autotube-theme="light"] .visual-script-column,
html[data-autotube-theme="light"] .montage-row-card,
html[data-autotube-theme="light"] .montage-right-card,
html[data-autotube-theme="light"] .montage-accordion-card,
html[data-autotube-theme="light"] .montage-fixed-card-collapsible,
html[data-autotube-theme="light"] .montage-result-card,
html[data-autotube-theme="light"] .packaging-source-pane,
html[data-autotube-theme="light"] .packaging-center-pane,
html[data-autotube-theme="light"] .packaging-results-pane,
html[data-autotube-theme="light"] .packaging-copy-card,
html[data-autotube-theme="light"] .packaging-thumb-card,
html[data-autotube-theme="light"] .factory-template-card,
html[data-autotube-theme="light"] .library-card{
  color:var(--v60-text)!important;
  background-color:rgba(247,248,248,.92)!important;
  background-image:none!important;
  border-color:var(--v60-line)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.94),0 15px 36px rgba(39,46,54,.065)!important;
}

html[data-autotube-theme="light"] textarea,
html[data-autotube-theme="light"] input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-autotube-theme="light"] select,
html[data-autotube-theme="light"] .select-input,
html[data-autotube-theme="light"] .single-select,
html[data-autotube-theme="light"] .file-input,
html[data-autotube-theme="light"] .voice-compact-control,
html[data-autotube-theme="light"] .voice-slider-tile,
html[data-autotube-theme="light"] .voice-speaker-toggle,
html[data-autotube-theme="light"] .voice-library-settings-card,
html[data-autotube-theme="light"] .selected-voice-meta{
  color:var(--v60-text)!important;
  background-color:var(--v60-inset)!important;
  background-image:none!important;
  border-color:var(--v60-line-soft)!important;
  box-shadow:inset 0 1px 0 #fff,0 7px 18px rgba(39,46,54,.045)!important;
}

html[data-autotube-theme="light"] textarea::placeholder,
html[data-autotube-theme="light"] input::placeholder,
html[data-autotube-theme="light"] .counter,
html[data-autotube-theme="light"] .field-help,
html[data-autotube-theme="light"] small{color:var(--v60-muted)!important}

html[data-autotube-theme="light"] .factory-user-trigger,
html[data-autotube-theme="light"] .factory-user-menu,
html[data-autotube-theme="light"] .factory-theme-toggle,
html[data-autotube-theme="light"] .secondary-button,
html[data-autotube-theme="light"] .link-button,
html[data-autotube-theme="light"] .icon-button,
html[data-autotube-theme="light"] .text-button{
  color:var(--v60-text)!important;
  background-color:rgba(248,249,249,.90)!important;
  background-image:none!important;
  border-color:var(--v60-line)!important;
  box-shadow:inset 0 1px 0 #fff,0 8px 21px rgba(39,46,54,.055)!important;
}
html[data-autotube-theme="light"] .factory-user-meta{color:var(--v60-muted)!important}

html[data-autotube-theme="light"] button:disabled{
  color:#94999e!important;
  background-color:#eceeee!important;
  background-image:none!important;
  border-color:rgba(45,53,62,.10)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.80)!important;
}

/* Neutralise the warm tint in the chrome carrier without flattening its optics. */
html[data-autotube-theme="light"] .tabs{
  border-color:rgba(65,72,77,.46)!important;
  background-color:rgba(223,226,227,.48)!important;
  background-image:
    radial-gradient(ellipse at 7% 48%,rgba(255,255,255,.72) 0%,rgba(255,255,255,.17) 13%,transparent 27%),
    radial-gradient(ellipse at 93% 52%,rgba(255,255,255,.52) 0%,rgba(255,255,255,.11) 13%,transparent 28%),
    radial-gradient(ellipse at 50% -90%,rgba(255,255,255,.94) 0%,rgba(255,255,255,.21) 50%,transparent 72%),
    linear-gradient(180deg,rgba(67,72,75,.33) 0%,rgba(255,255,255,.69) 12%,rgba(241,243,243,.43) 51%,rgba(132,138,141,.25) 84%,rgba(45,50,53,.31) 100%)!important;
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.98),
    inset 0 5px 8px rgba(39,43,45,.17),
    inset 0 -2px 1px rgba(255,255,255,.75),
    inset 0 -7px 11px rgba(55,61,64,.18),
    inset 5px 0 10px rgba(255,255,255,.44),
    inset -5px 0 10px rgba(54,60,64,.12),
    0 0 0 1px rgba(255,255,255,.76),
    0 12px 25px rgba(38,45,52,.12)!important;
}
/* AUTOTUBE_LUXURY_PORCELAIN_PALETTE_V60_END */

/* AUTOTUBE_MATTE_BLACK_CONTROLS_V61_BEGIN */
:root{
  --v61-black:#07090b;
  --v61-black-soft:#111418;
  --v61-black-edge:#2b3035;
  --v61-porcelain:#f1f2f3;
}

/* Native controls inherit the monochrome identity everywhere. */
input[type="range"],
input[type="checkbox"],
input[type="radio"]{accent-color:var(--v61-black)!important}

input[type="range"]{
  --range-fill:0%;
  appearance:none!important;
  -webkit-appearance:none!important;
  height:9px!important;
  border:1px solid rgba(31,37,42,.30)!important;
  border-radius:999px!important;
  background-color:#dfe2e3!important;
  background-image:linear-gradient(to right,var(--v61-black) 0%,var(--v61-black) var(--range-fill),#dfe2e3 var(--range-fill),#dfe2e3 100%)!important;
  box-shadow:inset 0 1px 2px rgba(23,28,32,.20),inset 0 1px 0 rgba(255,255,255,.78)!important;
}
input[type="range"]::-webkit-slider-runnable-track{
  height:9px!important;background:transparent!important;border:0!important;border-radius:999px!important
}
input[type="range"]::-webkit-slider-thumb{
  appearance:none!important;-webkit-appearance:none!important;
  width:24px!important;height:24px!important;margin-top:-8px!important;border-radius:50%!important;
  border:1px solid #000!important;
  background:var(--v61-black)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15),inset 0 -5px 8px rgba(0,0,0,.48),0 0 0 2px rgba(255,255,255,.62),0 4px 10px rgba(12,15,18,.30)!important;
}
input[type="range"]::-moz-range-track{
  height:9px!important;border:1px solid rgba(31,37,42,.30)!important;border-radius:999px!important;background:#dfe2e3!important
}
input[type="range"]::-moz-range-progress{
  height:9px!important;border-radius:999px!important;background:var(--v61-black)!important
}
input[type="range"]::-moz-range-thumb{
  width:24px!important;height:24px!important;border-radius:50%!important;border:1px solid #000!important;
  background:var(--v61-black)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 0 0 2px rgba(255,255,255,.62),0 4px 10px rgba(12,15,18,.30)!important
}

.slider-field output{color:#24282c!important;text-shadow:none!important}

/* Toggle rail and knob are matte-black when enabled, neutral porcelain when disabled. */
.toggle-visual,
label.toggle-field > input[type="checkbox"] + span.toggle-visual{
  border:1px solid rgba(25,30,34,.32)!important;
  background:#d9dcdd!important;
  background-image:none!important;
  box-shadow:inset 0 1px 3px rgba(17,21,24,.22),inset 0 1px 0 rgba(255,255,255,.76)!important;
}
.toggle-field input:checked + .toggle-visual,
label.toggle-field > input[type="checkbox"]:checked + span.toggle-visual{
  border-color:#000!important;
  background:var(--v61-black)!important;
  background-image:none!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14),inset 0 -5px 9px rgba(0,0,0,.48),0 4px 12px rgba(10,13,15,.18)!important;
}
.toggle-visual::after,
label.toggle-field > input[type="checkbox"] + span.toggle-visual::after{
  background:#f7f8f8!important;
  background-image:none!important;
  border-color:rgba(24,29,33,.22)!important;
  box-shadow:inset 0 1px 0 #fff,0 2px 7px rgba(15,18,21,.28)!important;
}
.toggle-field input:checked + .toggle-visual::after,
label.toggle-field > input[type="checkbox"]:checked + span.toggle-visual::after{
  background:var(--v61-black-soft)!important;
  background-image:none!important;
  border-color:rgba(255,255,255,.34)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 0 0 1px #000,0 2px 7px rgba(0,0,0,.36)!important;
}

input[type="checkbox"]:not(.toggle-field input):checked{
  border-color:#000!important;
  background-color:var(--v61-black)!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m4 9 3 3 7-7' fill='none' stroke='%23f1f2f3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 2px 6px rgba(0,0,0,.20)!important;
}
input[type="radio"]:checked{
  border-color:#000!important;
  background-color:var(--v61-black)!important;
  background-image:radial-gradient(circle,var(--v61-porcelain) 0 27%,transparent 31%)!important;
}

/* Text on every principal black action uses exactly the porcelain canvas colour. */
.primary-button:not(:disabled),
.primary-small-button:not(:disabled),
.voice-library-launch-button:not(:disabled),
.packaging-download-button:not(:disabled),
.factory-admin-panel-button:hover,
.factory-template-nav:hover{
  color:var(--v61-porcelain)!important;
}
/* AUTOTUBE_MATTE_BLACK_CONTROLS_V61_END */

/* AUTOTUBE_CONTROL_GEOMETRY_REFINEMENT_V62_BEGIN */
/* Slider thumb: exactly half of v61, optically centred on the 9px track. */
input[type="range"]::-webkit-slider-thumb{
  width:12px!important;
  height:12px!important;
  margin-top:-2px!important;
  border-width:1px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 0 0 1px rgba(255,255,255,.58),0 2px 5px rgba(12,15,18,.24)!important;
}
input[type="range"]::-moz-range-thumb{
  width:12px!important;
  height:12px!important;
  border-width:1px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 0 0 1px rgba(255,255,255,.58),0 2px 5px rgba(12,15,18,.24)!important;
}

/* Toggle knob uses the canvas colour and mathematical vertical centring. */
.toggle-visual,
label.toggle-field > input[type="checkbox"] + span.toggle-visual{
  position:relative!important;
  box-sizing:border-box!important;
  width:42px!important;
  height:24px!important;
  min-width:42px!important;
  padding:0!important;
}
.toggle-visual::after,
label.toggle-field > input[type="checkbox"] + span.toggle-visual::after,
.toggle-field input:checked + .toggle-visual::after,
label.toggle-field > input[type="checkbox"]:checked + span.toggle-visual::after{
  position:absolute!important;
  top:50%!important;
  left:3px!important;
  width:18px!important;
  height:18px!important;
  margin:0!important;
  background-color:#f1f2f3!important;
  background-image:none!important;
  border-color:rgba(24,29,33,.22)!important;
  transform:translate(0,-50%)!important;
  box-shadow:inset 0 1px 0 #fff,0 2px 6px rgba(15,18,21,.27)!important;
}
.toggle-field input:checked + .toggle-visual::after,
label.toggle-field > input[type="checkbox"]:checked + span.toggle-visual::after{
  transform:translate(17px,-50%)!important;
}
/* AUTOTUBE_CONTROL_GEOMETRY_REFINEMENT_V62_END */

/* AUTOTUBE_MATTE_SLIDER_FINISH_V63_BEGIN */
input[type="range"]{
  border-color:rgba(31,37,42,.28)!important;
  box-shadow:none!important;
}
input[type="range"]::-webkit-slider-thumb{
  border:1px solid #000!important;
  background:#07090b!important;
  box-shadow:0 2px 4px rgba(10,13,15,.18)!important;
}
input[type="range"]::-moz-range-track{
  box-shadow:none!important;
}
input[type="range"]::-moz-range-progress{
  box-shadow:none!important;
}
input[type="range"]::-moz-range-thumb{
  border:1px solid #000!important;
  background:#07090b!important;
  box-shadow:0 2px 4px rgba(10,13,15,.18)!important;
}
/* AUTOTUBE_MATTE_SLIDER_FINISH_V63_END */

/* AUTOTUBE_NAV_LENS_CENTERING_V64_BEGIN */
.tabs{
  align-items:center!important;
}
.tabs .tab-button,
.tabs .tab-button:hover,
.tabs .tab-button:active,
.tabs .tab-button:focus,
.tabs .tab-button:focus-visible,
.tabs .tab-button.active,
.tabs .tab-button.active:hover,
.tabs .tab-button.active:active,
.tabs .tab-button:not(.active):hover,
.tabs .tab-button:not(.active):active{
  top:auto!important;
  bottom:auto!important;
  margin-top:0!important;
  margin-bottom:0!important;
  transform:none!important;
}
/* AUTOTUBE_NAV_LENS_CENTERING_V64_END */

/* AUTOTUBE_PORCELAIN_UI_ALIGNMENT_V64_BEGIN */
/* One porcelain ink colour for every selected black control. */
html[data-autotube-theme="light"] .visual-mode-toggle .visual-mode-button.active,
html[data-autotube-theme="light"] .visual-mode-toggle .visual-mode-button.active:hover,
html[data-autotube-theme="light"] .visual-mode-toggle .visual-mode-button.active:focus,
html[data-autotube-theme="light"] .visual-mode-toggle .visual-mode-button.active:focus-visible,
html[data-autotube-theme="light"] .primary-button:not(:disabled),
html[data-autotube-theme="light"] .primary-small-button:not(:disabled),
html[data-autotube-theme="light"] .packaging-generate-button:not(:disabled){
  color:var(--v61-porcelain)!important;
}

/* Photo/video switch: equal geometry and exact optical centring. */
html[data-autotube-theme="light"] .visual-mode-toggle{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch!important;
  padding:7px!important;
}
html[data-autotube-theme="light"] .visual-mode-button{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:64px!important;
  height:64px!important;
  margin:0!important;
  padding:0 24px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1.15!important;
}

/* Script action rows use one height, baseline and footprint. */
html[data-autotube-theme="light"] .compact-script-actions,
html[data-autotube-theme="light"] .section-actions.video-script-actions,
html[data-autotube-theme="light"] .section-actions.photo-script-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch!important;
  gap:12px!important;
}
html[data-autotube-theme="light"] .compact-script-actions > button,
html[data-autotube-theme="light"] .section-actions.video-script-actions > button,
html[data-autotube-theme="light"] .section-actions.photo-script-actions > button{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:56px!important;
  min-height:56px!important;
  margin:0!important;
  padding:0 20px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  line-height:1.15!important;
  white-space:normal!important;
}
html[data-autotube-theme="light"] button.text-button,
html[data-autotube-theme="light"] .compact-script-actions > button.text-button,
html[data-autotube-theme="light"] .section-actions > button.text-button{
  color:var(--v60-text)!important;
  background:transparent!important;
  background-image:none!important;
  border-color:transparent!important;
  box-shadow:none!important;
}
html[data-autotube-theme="light"] button.text-button:hover:not(:disabled){
  background:rgba(21,25,29,.045)!important;
  border-color:transparent!important;
  box-shadow:none!important;
}

/* Packaging must use exactly the same neutral porcelain cards as every tab. */
html[data-autotube-theme="light"] .packaging-workspace-shell,
html[data-autotube-theme="light"] .packaging-source-card,
html[data-autotube-theme="light"] .packaging-results-pane,
html[data-autotube-theme="light"] .packaging-empty-state{
  color:var(--v60-text)!important;
  background-color:rgba(247,248,248,.92)!important;
  background-image:none!important;
  border-color:var(--v60-line)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.94),0 15px 36px rgba(39,46,54,.065)!important;
}
html[data-autotube-theme="light"] .packaging-source-controls{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:stretch!important;
  gap:12px!important;
}
html[data-autotube-theme="light"] .packaging-source-controls > button,
html[data-autotube-theme="light"] .packaging-source-controls > .packaging-style-control,
html[data-autotube-theme="light"] .packaging-source-controls > .packaging-style-control select{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:58px!important;
  min-height:58px!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .packaging-source-controls > button,
html[data-autotube-theme="light"] .packaging-source-controls > .packaging-style-control select{
  padding:0 18px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  line-height:1.15!important;
}

/* Montage setting tiles share one composition instead of individually drifting. */
html[data-autotube-theme="light"] .compact-montage-presets-nine{
  align-items:stretch!important;
  gap:14px!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile{
  box-sizing:border-box!important;
  min-height:158px!important;
  padding:18px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:14px!important;
  color:var(--v60-text)!important;
  background-color:rgba(247,248,248,.92)!important;
  border-color:var(--v60-line)!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > label,
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > span{
  display:block!important;
  min-height:28px!important;
  margin:0!important;
  color:var(--v60-text)!important;
  line-height:1.2!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > strong{
  flex:1 1 auto!important;
  min-height:68px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  color:var(--v60-text)!important;
  line-height:1.2!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine .montage-compact-select{
  box-sizing:border-box!important;
  width:100%!important;
  height:68px!important;
  min-height:68px!important;
  margin:0!important;
  padding:0 18px!important;
}
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  flex:1 1 auto!important;
  min-height:68px!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  color:var(--v60-text)!important;
}
html[data-autotube-theme="light"] .montage-subtitle-control input[type="color"]{
  box-sizing:border-box!important;
  display:block!important;
  width:min(100%,180px)!important;
  height:auto!important;
  aspect-ratio:16/9!important;
  min-height:72px!important;
  margin:0!important;
  padding:7px!important;
  opacity:1!important;
  border:1px solid var(--v60-line)!important;
  border-radius:14px!important;
  background:var(--v60-inset)!important;
  box-shadow:none!important;
}
html[data-autotube-theme="light"] .montage-subtitle-control input[type="color"]::-webkit-color-swatch-wrapper{padding:0!important}
html[data-autotube-theme="light"] .montage-subtitle-control input[type="color"]::-webkit-color-swatch{border:0!important;border-radius:9px!important}
html[data-autotube-theme="light"] .montage-subtitle-control input[type="color"]::-moz-color-swatch{border:0!important;border-radius:9px!important}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]{
  width:100%!important;
  margin:18px 0 4px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile small{
  margin:0!important;
  color:var(--v60-muted)!important;
  line-height:1.2!important;
}
html[data-autotube-theme="light"] .montage-settings-meta,
html[data-autotube-theme="light"] .compact-montage-volume,
html[data-autotube-theme="light"] .compact-montage-volume strong,
html[data-autotube-theme="light"] .compact-montage-volume output,
html[data-autotube-theme="light"] #montageFfmpegBadge{
  color:var(--v60-text)!important;
}

@media (max-width:760px){
  html[data-autotube-theme="light"] .packaging-source-controls{grid-template-columns:1fr!important}
  html[data-autotube-theme="light"] .compact-script-actions{grid-template-columns:1fr!important}
}
/* AUTOTUBE_PORCELAIN_UI_ALIGNMENT_V64_END */

/* AUTOTUBE_COMPACT_UI_CORRECTION_V65_BEGIN */
/* v64 correction: preserve the original compact scale. */
html[data-autotube-theme="light"] .visual-mode-toggle{
  width:min(320px,100%)!important;
  padding:5px!important;
}
html[data-autotube-theme="light"] .visual-mode-button{
  min-height:44px!important;
  height:44px!important;
  padding:8px 18px!important;
}

/* Hidden service controls must never become grid items. */
html[data-autotube-theme="light"] .packaging-source-controls > [hidden],
html[data-autotube-theme="light"] .packaging-source-controls > .hidden,
html[data-autotube-theme="light"] #packagingUseRewriteButton,
html[data-autotube-theme="light"] #packagingClearButton{
  display:none!important;
}

/* Compact, optically aligned script actions. */
html[data-autotube-theme="light"] .compact-script-actions,
html[data-autotube-theme="light"] .section-actions.video-script-actions,
html[data-autotube-theme="light"] .section-actions.photo-script-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
}
html[data-autotube-theme="light"] .compact-script-actions > button,
html[data-autotube-theme="light"] .section-actions.video-script-actions > button,
html[data-autotube-theme="light"] .section-actions.photo-script-actions > button{
  flex:0 0 142px!important;
  width:142px!important;
  min-width:142px!important;
  height:40px!important;
  min-height:40px!important;
  padding:0 12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .rewrite-source-controls{
  align-items:flex-end!important;
}
html[data-autotube-theme="light"] .rewrite-import-button,
html[data-autotube-theme="light"] .rewrite-clear-button{
  box-sizing:border-box!important;
  height:39px!important;
  min-height:39px!important;
  margin:0!important;
  padding:0 12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
}

/* Packaging: equal controls without oversized rows or phantom space. */
html[data-autotube-theme="light"] .packaging-source-controls{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:center!important;
  gap:8px!important;
}
html[data-autotube-theme="light"] .packaging-source-controls > button,
html[data-autotube-theme="light"] .packaging-source-controls > .packaging-style-control,
html[data-autotube-theme="light"] .packaging-source-controls > .packaging-style-control select{
  height:40px!important;
  min-height:40px!important;
}
html[data-autotube-theme="light"] .packaging-source-controls > button,
html[data-autotube-theme="light"] .packaging-source-controls > .packaging-style-control select{
  padding:0 10px!important;
  font-size:12px!important;
  line-height:1.05!important;
}

/* Settings tiles remain aligned, but return to their compact density. */
html[data-autotube-theme="light"] .compact-montage-presets-nine{
  gap:8px!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile{
  min-height:92px!important;
  padding:10px!important;
  gap:7px!important;
  justify-content:space-between!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > label,
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > span{
  min-height:0!important;
  font-size:12px!important;
  line-height:1.1!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > strong{
  flex:0 1 auto!important;
  min-height:40px!important;
  font-size:13px!important;
  line-height:1.15!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine .montage-compact-select{
  height:40px!important;
  min-height:40px!important;
  padding:7px 34px 7px 10px!important;
  font-size:13px!important;
}
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  flex:0 1 auto!important;
  min-height:40px!important;
  gap:8px!important;
}
html[data-autotube-theme="light"] .montage-subtitle-control input[type="color"]{
  width:min(100%,128px)!important;
  min-height:0!important;
  height:auto!important;
  aspect-ratio:16/9!important;
  padding:4px!important;
  border-radius:10px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]{
  margin:8px 0 2px!important;
}

@media(max-width:760px){
  html[data-autotube-theme="light"] .compact-script-actions,
  html[data-autotube-theme="light"] .section-actions.video-script-actions,
  html[data-autotube-theme="light"] .section-actions.photo-script-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  html[data-autotube-theme="light"] .compact-script-actions > button,
  html[data-autotube-theme="light"] .section-actions.video-script-actions > button,
  html[data-autotube-theme="light"] .section-actions.photo-script-actions > button{
    width:100%!important;
    min-width:0!important;
  }
}
/* AUTOTUBE_COMPACT_UI_CORRECTION_V65_END */

/* AUTOTUBE_DENSE_MONTAGE_SETTINGS_V66_BEGIN */
html[data-autotube-theme="light"] .montage-fixed-card-collapsible .collapsible-card-body{
  gap:7px!important;
}
html[data-autotube-theme="light"] .montage-settings-meta{
  min-height:16px!important;
  margin:0!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine{
  gap:7px!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile{
  min-height:72px!important;
  padding:8px!important;
  gap:2px!important;
  justify-content:flex-start!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > label,
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > span{
  min-height:14px!important;
  margin:0!important;
  font-size:11px!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > strong{
  min-height:34px!important;
  margin:0!important;
  font-size:12px!important;
  line-height:1.05!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine .montage-compact-select{
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:5px 30px 5px 9px!important;
  border-radius:9px!important;
  font-size:12px!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  min-height:34px!important;
  margin:0!important;
  gap:7px!important;
  font-size:12px!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .montage-subtitle-control input[type="color"]{
  width:88px!important;
  height:50px!important;
  min-height:50px!important;
  aspect-ratio:16/9!important;
  margin:0!important;
  padding:3px!important;
  border-radius:8px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]{
  width:100%!important;
  height:7px!important;
  margin:8px 0 3px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]::-webkit-slider-runnable-track{
  height:7px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]::-moz-range-track,
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]::-moz-range-progress{
  height:7px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile small{
  margin:0!important;
  font-size:10px!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .compact-montage-volume{
  gap:5px!important;
  padding-top:2px!important;
}
html[data-autotube-theme="light"] .compact-montage-volume > span{
  margin:0!important;
  line-height:1.05!important;
}
html[data-autotube-theme="light"] .compact-montage-volume input[type="range"]{
  height:7px!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .compact-montage-volume input[type="range"]::-webkit-slider-runnable-track{
  height:7px!important;
}
html[data-autotube-theme="light"] .compact-montage-volume input[type="range"]::-moz-range-track,
html[data-autotube-theme="light"] .compact-montage-volume input[type="range"]::-moz-range-progress{
  height:7px!important;
}
/* AUTOTUBE_DENSE_MONTAGE_SETTINGS_V66_END */

/* AUTOTUBE_ULTRA_COMPACT_MONTAGE_SETTINGS_V67_BEGIN */
/* Make every tile as dense as the Style select: no reserved value well. */
html[data-autotube-theme="light"] .compact-montage-presets-nine{
  gap:6px!important;
  align-items:start!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile{
  min-height:64px!important;
  height:64px!important;
  padding:7px!important;
  gap:2px!important;
  justify-content:flex-start!important;
  overflow:hidden!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > label,
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > span{
  min-height:12px!important;
  line-height:12px!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > strong{
  display:block!important;
  flex:0 0 auto!important;
  min-height:0!important;
  height:auto!important;
  margin:1px 0 0!important;
  line-height:1.05!important;
}
html[data-autotube-theme="light"] .compact-montage-presets-nine .montage-compact-select{
  height:34px!important;
  min-height:34px!important;
}
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  flex:0 0 auto!important;
  min-height:0!important;
  height:34px!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .montage-subtitle-control input[type="color"]{
  width:64px!important;
  height:36px!important;
  min-height:36px!important;
  padding:2px!important;
  border-radius:7px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]{
  height:6px!important;
  margin:6px 0 2px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]::-webkit-slider-runnable-track,
html[data-autotube-theme="light"] .compact-montage-volume input[type="range"]::-webkit-slider-runnable-track{
  height:6px!important;
}
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]::-moz-range-track,
html[data-autotube-theme="light"] .montage-outline-tile input[type="range"]::-moz-range-progress,
html[data-autotube-theme="light"] .compact-montage-volume input[type="range"]::-moz-range-track,
html[data-autotube-theme="light"] .compact-montage-volume input[type="range"]::-moz-range-progress{
  height:6px!important;
}
/* AUTOTUBE_ULTRA_COMPACT_MONTAGE_SETTINGS_V67_END */

/* AUTOTUBE_FRAMED_MONTAGE_VALUES_V68_BEGIN */
/* Static values use the same compact inset control treatment as Font/Style. */
html[data-autotube-theme="light"] .compact-montage-presets-nine > .montage-preset-tile > strong{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:0 9px!important;
  border:1px solid var(--v60-line)!important;
  border-radius:9px!important;
  background:var(--v60-inset)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92)!important;
  color:var(--v60-text)!important;
  line-height:1!important;
}
/* AUTOTUBE_FRAMED_MONTAGE_VALUES_V68_END */

/* AUTOTUBE_FRAMED_SUBTITLE_TOGGLE_V69_BEGIN */
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:0 9px!important;
  gap:7px!important;
  border:1px solid var(--v60-line)!important;
  border-radius:9px!important;
  background:var(--v60-inset)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92)!important;
  color:var(--v60-text)!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle input{
  flex:0 0 auto!important;
  margin:0!important;
}
/* AUTOTUBE_FRAMED_SUBTITLE_TOGGLE_V69_END */

/* AUTOTUBE_CENTERED_SUBTITLE_TOGGLE_V70_BEGIN */
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  justify-content:center!important;
  text-align:center!important;
}
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle input[type="checkbox"]{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  vertical-align:middle!important;
  margin:0!important;
}
/* AUTOTUBE_CENTERED_SUBTITLE_TOGGLE_V70_END */

/* AUTOTUBE_OPTICAL_SUBTITLE_CENTER_V71_BEGIN */
/* Native checkbox alignment differs by browser; use exact optical centering. */
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  align-items:flex-start!important;
  padding:7px 9px 0!important;
  line-height:18px!important;
}
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle input[type="checkbox"]{
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  min-height:18px!important;
  margin:0!important;
}
/* AUTOTUBE_OPTICAL_SUBTITLE_CENTER_V71_END */

/* AUTOTUBE_ALIGNED_SUBTITLE_TOGGLE_V72_BEGIN */
html[data-autotube-theme="light"] .montage-subtitle-toggle .mini-toggle{
  justify-content:flex-start!important;
  text-align:left!important;
  font-size:12px!important;
  font-weight:800!important;
}
/* AUTOTUBE_ALIGNED_SUBTITLE_TOGGLE_V72_END */

/* AUTOTUBE_CLASSIC_VOICE_RESULT_V73_BEGIN */
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
  min-height:0!important;
  max-height:none!important;
  padding:11px 12px!important;
  gap:8px!important;
  color:var(--v60-text)!important;
  background-color:rgba(247,248,248,.94)!important;
  background-image:none!important;
  border:1px solid var(--v60-line)!important;
  border-radius:14px!important;
  box-shadow:inset 0 1px 0 #fff,0 9px 24px rgba(39,46,54,.055)!important;
}
html[data-autotube-theme="light"] .voice-result-compact .card-kicker,
html[data-autotube-theme="light"] .voice-result-compact h2,
html[data-autotube-theme="light"] .voice-result-compact .counter{
  color:var(--v60-text)!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-glass-audio{
  grid-template-columns:36px minmax(0,1fr) auto 36px!important;
  gap:10px!important;
  min-height:44px!important;
  padding:4px 0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-button{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  min-height:36px!important;
  padding:0!important;
  border:1px solid var(--v60-line)!important;
  border-radius:10px!important;
  color:var(--v61-black)!important;
  background:var(--v60-inset)!important;
  box-shadow:inset 0 1px 0 #fff!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-mute{
  position:relative!important;
  font-size:0!important;
  color:transparent!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-mute::before{
  content:""!important;
  display:block!important;
  width:20px!important;
  height:20px!important;
  background:var(--v61-black)!important;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 9v6h4l5 4V5L8 9H4zm12.5-1.5a6 6 0 0 1 0 9l-1.4-1.4a4 4 0 0 0 0-6.2l1.4-1.4zm2.8-2.8a10 10 0 0 1 0 14.6l-1.4-1.4a8 8 0 0 0 0-11.8l1.4-1.4z'/%3E%3C/svg%3E") center/contain no-repeat!important;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 9v6h4l5 4V5L8 9H4zm12.5-1.5a6 6 0 0 1 0 9l-1.4-1.4a4 4 0 0 0 0-6.2l1.4-1.4zm2.8-2.8a10 10 0 0 1 0 14.6l-1.4-1.4a8 8 0 0 0 0-11.8l1.4-1.4z'/%3E%3C/svg%3E") center/contain no-repeat!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-progress{
  height:6px!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-progress::-webkit-slider-runnable-track,
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-progress::-moz-range-track,
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-progress::-moz-range-progress{
  height:6px!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-time{
  color:var(--v60-text)!important;
  font-size:12px!important;
}
html[data-autotube-theme="light"] .voice-result-compact .voice-result-actions{
  margin:0!important;
  min-height:0!important;
}
/* AUTOTUBE_CLASSIC_VOICE_RESULT_V73_END */

/* AUTOTUBE_SINGLE_ROW_VOICE_RESULT_V74_BEGIN */
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
  display:grid!important;
  grid-template-columns:210px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:12px!important;
  min-height:0!important;
  height:auto!important;
  padding:8px 10px!important;
  overflow:visible!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .compact-heading{
  display:grid!important;
  grid-template-columns:1fr!important;
  align-content:center!important;
  justify-content:stretch!important;
  gap:2px!important;
  min-width:0!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .compact-heading > div{
  min-width:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .card-kicker{
  margin:0 0 2px!important;
  font-size:9px!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact h2{
  margin:0!important;
  font-size:15px!important;
  line-height:1!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .counter{
  display:block!important;
  margin:2px 0 0!important;
  font-size:9px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-glass-audio{
  width:100%!important;
  grid-template-columns:32px minmax(0,1fr) auto 32px!important;
  gap:8px!important;
  min-height:36px!important;
  padding:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-button{
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  border-radius:9px!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .voice-result-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  width:auto!important;
  gap:6px!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton{
  min-width:126px!important;
  min-height:34px!important;
  height:34px!important;
  padding:0 12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
}
@media(max-width:900px){
  html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
    grid-template-columns:1fr!important;
  }
  html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .voice-result-actions{
    justify-content:flex-start!important;
  }
}
/* AUTOTUBE_SINGLE_ROW_VOICE_RESULT_V74_END */

/* AUTOTUBE_FULL_WIDTH_VOICE_PLAYER_V75_BEGIN */
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:30px 36px!important;
  grid-template-areas:
    "voice-ready voice-actions"
    "voice-player voice-player"!important;
  align-items:center!important;
  gap:6px 10px!important;
  padding:8px 10px!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .compact-heading{
  grid-area:voice-ready!important;
  display:block!important;
  min-width:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .card-kicker{
  margin:0!important;
  font-size:10px!important;
  line-height:30px!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact h2,
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .counter{
  display:none!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-glass-audio{
  grid-area:voice-player!important;
  align-self:center!important;
  width:100%!important;
  max-width:none!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .voice-result-actions{
  grid-area:voice-actions!important;
  align-self:center!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton{
  height:30px!important;
  min-height:30px!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-mute{
  position:relative!important;
  display:block!important;
}
html[data-autotube-theme="light"] .voice-result-compact .autotube-audio-mute::before{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:18px!important;
  height:18px!important;
  margin:0!important;
  transform:translate(-50%,-50%)!important;
}
@media(max-width:900px){
  html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:30px 36px!important;
    grid-template-areas:
      "voice-ready voice-actions"
      "voice-player voice-player"!important;
  }
}
/* AUTOTUBE_FULL_WIDTH_VOICE_PLAYER_V75_END */

/* AUTOTUBE_INLINE_VOICE_ACTIONS_V76_BEGIN */
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
  grid-template-columns:minmax(0,1fr) 32px!important;
  grid-template-rows:24px 36px!important;
  grid-template-areas:
    "voice-ready voice-ready"
    "voice-player voice-actions"!important;
  column-gap:6px!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .card-kicker{
  line-height:24px!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-glass-audio,
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-glass-audio.autotube-glass-audio{
  display:grid!important;
  grid-template-columns:32px minmax(0,1fr) auto 32px!important;
  grid-template-rows:32px!important;
  align-items:center!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-play,
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-progress,
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-time,
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-mute{
  grid-column:auto!important;
  grid-row:1!important;
  align-self:center!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-progress{
  width:100%!important;
  min-width:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .voice-result-actions{
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  overflow:visible!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton{
  position:relative!important;
  box-sizing:border-box!important;
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  padding:0!important;
  border:1px solid var(--v60-line)!important;
  border-radius:9px!important;
  color:transparent!important;
  font-size:0!important;
  background:var(--v60-inset)!important;
  box-shadow:inset 0 1px 0 #fff!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton::before{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:18px!important;
  height:18px!important;
  transform:translate(-50%,-50%)!important;
  background:var(--v61-black)!important;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v10.2l3.6-3.6 1.4 1.4-6 6-6-6 1.4-1.4 3.6 3.6V3zM5 19h14v2H5v-2z'/%3E%3C/svg%3E") center/contain no-repeat!important;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 3h2v10.2l3.6-3.6 1.4 1.4-6 6-6-6 1.4-1.4 3.6 3.6V3zM5 19h14v2H5v-2z'/%3E%3C/svg%3E") center/contain no-repeat!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .voice-result-actions > .hidden{
  display:none!important;
}
@media(max-width:900px){
  html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
    grid-template-columns:minmax(0,1fr) 32px!important;
    grid-template-rows:24px 36px!important;
    grid-template-areas:
      "voice-ready voice-ready"
      "voice-player voice-actions"!important;
  }
}
/* AUTOTUBE_INLINE_VOICE_ACTIONS_V76_END */

/* AUTOTUBE_POLISHED_VOICE_RESULT_V77_BEGIN */
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact{
  grid-template-rows:20px 36px!important;
  row-gap:1px!important;
  padding:8px 10px!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .card-kicker{
  margin:0!important;
  color:var(--v61-black)!important;
  font-size:15px!important;
  font-weight:900!important;
  line-height:20px!important;
  letter-spacing:.08em!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .voice-result-actions{
  display:grid!important;
  place-items:center!important;
  align-self:center!important;
  justify-self:center!important;
  width:32px!important;
  height:32px!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton{
  position:relative!important;
  inset:auto!important;
  align-self:center!important;
  justify-self:center!important;
  margin:0!important;
  transform:none!important;
  line-height:0!important;
  transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton:hover{
  color:transparent!important;
  background:var(--v61-black)!important;
  border-color:var(--v61-black)!important;
  box-shadow:none!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton:hover::before{
  background:var(--v60-canvas)!important;
}
/* AUTOTUBE_POLISHED_VOICE_RESULT_V77_END */

/* AUTOTUBE_PRECISE_VOICE_ALIGNMENT_V78_BEGIN */
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .card-kicker{
  box-sizing:border-box!important;
  padding-left:40px!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .voice-result-actions{
  display:contents!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton{
  grid-area:voice-actions!important;
  align-self:center!important;
  justify-self:center!important;
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  margin:0!important;
  inset:auto!important;
  transform:none!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-mute{
  transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-mute:hover{
  color:transparent!important;
  background:var(--v61-black)!important;
  border-color:var(--v61-black)!important;
  box-shadow:none!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .autotube-audio-mute:hover::before{
  background:var(--v60-canvas)!important;
}
/* AUTOTUBE_PRECISE_VOICE_ALIGNMENT_V78_END */

/* AUTOTUBE_FINAL_VOICE_ALIGNMENT_V79_BEGIN */
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact .card-kicker{
  padding-left:0!important;
}
html[data-autotube-theme="light"] .voice-left-column .voice-result-compact #downloadAudioButton{
  top:0!important;
  bottom:auto!important;
  transform:translateY(-4px)!important;
}
/* AUTOTUBE_FINAL_VOICE_ALIGNMENT_V79_END */

/* AUTOTUBE_COMPACT_SCRIPT_FOOTERS_V82_BEGIN */
/* Rewrite: one dense full-width control row; language caption sits below its select. */
html[data-autotube-theme="light"] .rewrite-source-panel{
  row-gap:6px!important;
}
html[data-autotube-theme="light"] .rewrite-source-controls{
  display:grid!important;
  grid-template-columns:minmax(240px,1fr) minmax(150px,220px) minmax(90px,140px)!important;
  align-items:start!important;
  gap:8px!important;
  width:100%!important;
  padding-top:0!important;
  margin-top:-1px!important;
}
html[data-autotube-theme="light"] .rewrite-language-field{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .rewrite-language-field #targetLanguage{
  order:1!important;
  box-sizing:border-box!important;
  width:100%!important;
  height:39px!important;
  min-height:39px!important;
  margin:0!important;
}
html[data-autotube-theme="light"] .rewrite-language-field .field-label{
  order:2!important;
  margin:4px 0 0 2px!important;
  font-size:11px!important;
  line-height:1.1!important;
}
html[data-autotube-theme="light"] .rewrite-source-controls .rewrite-import-button,
html[data-autotube-theme="light"] .rewrite-source-controls .rewrite-clear-button{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:39px!important;
  min-height:39px!important;
  align-self:start!important;
  margin:0!important;
}

/* Packaging: only two visible controls, each consuming exactly half the row. */
html[data-autotube-theme="light"] .packaging-source-controls{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:center!important;
  justify-content:stretch!important;
  gap:8px!important;
  width:100%!important;
}
html[data-autotube-theme="light"] .packaging-source-controls #packagingImportButton,
html[data-autotube-theme="light"] .packaging-source-controls .packaging-style-control,
html[data-autotube-theme="light"] .packaging-source-controls .packaging-style-control select{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
}
@media(max-width:700px){
  html[data-autotube-theme="light"] .rewrite-source-controls{
    grid-template-columns:1fr 1fr!important;
  }
  html[data-autotube-theme="light"] .rewrite-language-field{
    grid-column:1/-1!important;
  }
}
/* AUTOTUBE_COMPACT_SCRIPT_FOOTERS_V82_END */

/* AUTOTUBE_FRAMELESS_CLEAR_ACTIONS_V83_BEGIN */
/* Every script Clear action is true frameless text with no reserved card width. */
html[data-autotube-theme="light"] #clearButton,
html[data-autotube-theme="light"] #ttsClearButton,
html[data-autotube-theme="light"] #photoClearButton,
html[data-autotube-theme="light"] #videoClearButton,
html[data-autotube-theme="light"] #montageClearScriptButton,
html[data-autotube-theme="light"] #workflowClearSourceButton{
  box-sizing:border-box!important;
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  height:39px!important;
  min-height:39px!important;
  margin:0!important;
  padding:0 3px!important;
  color:var(--v60-text)!important;
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}
html[data-autotube-theme="light"] #clearButton:hover:not(:disabled),
html[data-autotube-theme="light"] #ttsClearButton:hover:not(:disabled),
html[data-autotube-theme="light"] #photoClearButton:hover:not(:disabled),
html[data-autotube-theme="light"] #videoClearButton:hover:not(:disabled),
html[data-autotube-theme="light"] #montageClearScriptButton:hover:not(:disabled),
html[data-autotube-theme="light"] #workflowClearSourceButton:hover:not(:disabled){
  color:var(--v61-black)!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  text-decoration:underline!important;
  text-underline-offset:3px!important;
}

/* Original script: compact content-width controls grouped tightly on the left. */
html[data-autotube-theme="light"] .rewrite-source-controls{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  gap:5px!important;
}
html[data-autotube-theme="light"] .rewrite-language-field{
  flex:0 0 240px!important;
  width:240px!important;
  max-width:240px!important;
}
html[data-autotube-theme="light"] .rewrite-language-field #targetLanguage{
  width:240px!important;
  padding-left:12px!important;
  padding-right:32px!important;
}
html[data-autotube-theme="light"] .rewrite-source-controls .rewrite-import-button{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  padding-inline:12px!important;
}

/* All other script action pairs use content width and a minimal gap. */
html[data-autotube-theme="light"] .voice-script-actions,
html[data-autotube-theme="light"] .photo-script-actions,
html[data-autotube-theme="light"] .video-script-actions,
html[data-autotube-theme="light"] .montage-script-row .compact-script-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:5px!important;
}
html[data-autotube-theme="light"] .voice-script-actions #ttsImportButton,
html[data-autotube-theme="light"] .photo-script-actions #photoImportButton,
html[data-autotube-theme="light"] .video-script-actions #videoImportButton,
html[data-autotube-theme="light"] .montage-script-row #montageUseVoiceTextButton{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  padding-inline:12px!important;
}
html[data-autotube-theme="light"] #workflowTemplateLaunchPanel > .section-actions{
  gap:5px!important;
}
html[data-autotube-theme="light"] #workflowImportSourceButton{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  padding-inline:12px!important;
}
@media(max-width:700px){
  html[data-autotube-theme="light"] .rewrite-source-controls{
    flex-wrap:wrap!important;
  }
  html[data-autotube-theme="light"] .rewrite-language-field{
    flex-basis:100%!important;
    width:100%!important;
    max-width:none!important;
  }
  html[data-autotube-theme="light"] .rewrite-language-field #targetLanguage{
    width:100%!important;
  }
}
/* AUTOTUBE_FRAMELESS_CLEAR_ACTIONS_V83_END */

/* AUTOTUBE_REWRITE_ACTIONS_RIGHT_V84_BEGIN */
html[data-autotube-theme="light"] .rewrite-source-controls .rewrite-import-button{
  margin-left:auto!important;
}
@media(max-width:700px){
  html[data-autotube-theme="light"] .rewrite-source-controls .rewrite-import-button{
    margin-left:0!important;
  }
}
/* AUTOTUBE_REWRITE_ACTIONS_RIGHT_V84_END */

/* AUTOTUBE_SCENARIO_PROFILE_ANALYZER_V88_BEGIN */
.scenario-mode-tabs{display:flex;justify-content:center;gap:5px;margin:0 auto 12px;padding:4px;width:max-content;border:1px solid #d2d4d5;border-radius:16px;background:rgba(255,255,255,.58)}
.scenario-mode-button{min-width:155px;padding:10px 18px;border:0;border-radius:12px;background:transparent;color:#17191c;font:700 14px/1.1 inherit;cursor:pointer}
.scenario-mode-button.active{background:#050607;color:#fff;box-shadow:0 8px 20px rgba(0,0,0,.13)}
.scenario-profile-workspace{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:12px;align-items:start}
.scenario-profile-create-card,.scenario-profiles-card,.scenario-profile-result{margin:0;padding:18px;border-radius:22px}
.scenario-profile-create-card .card-heading{margin-bottom:13px}
.scenario-profile-create-card .text-input{width:100%;margin:6px 0 10px}
.scenario-dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:112px;padding:18px;border:1.5px dashed #aaaeb1;border-radius:17px;background:rgba(255,255,255,.42);color:#17191c;cursor:pointer;transition:.16s ease}
.scenario-dropzone:hover,.scenario-dropzone.dragging{border-color:#050607;background:#fff;transform:translateY(-1px)}
.scenario-dropzone strong{font-size:17px}.scenario-dropzone span{margin-top:5px;color:#717780;font-size:12px}
.scenario-reference-list{display:grid;gap:5px;margin-top:9px}
.scenario-reference-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 10px;border:1px solid #d6d8da;border-radius:11px;background:rgba(255,255,255,.55);font-size:12px}
.scenario-reference-row .text-button{padding:2px 0;min-height:0}
.scenario-profile-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:12px}
.scenario-profile-actions .primary-button{width:auto;min-height:42px;padding:10px 17px}
.scenario-profiles-list{display:grid;gap:7px}
.scenario-profile-list-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:11px 12px;border:1px solid #d4d6d8;border-radius:13px;background:rgba(255,255,255,.5);color:#17191c;text-align:left;cursor:pointer}
.scenario-profile-list-item:hover{border-color:#050607;background:#fff}
.scenario-profile-list-item span{display:flex;flex-direction:column;gap:3px}.scenario-profile-list-item small{color:#747a82}.scenario-profile-list-item b{font-size:11px}
.scenario-profile-result{grid-column:1/-1}.scenario-profile-result .card-heading{align-items:center}
.scenario-profile-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}
.scenario-profile-summary>div{display:flex;flex-direction:column;gap:4px;padding:11px;border:1px solid #d5d7d9;border-radius:13px;background:rgba(255,255,255,.48)}
.scenario-profile-summary span{color:#747a82;font-size:11px}.scenario-profile-summary strong{font-size:14px}
.scenario-profile-result details{border:1px solid #d5d7d9;border-radius:13px;padding:11px}.scenario-profile-result summary{font-weight:700;cursor:pointer}
.scenario-profile-result pre{max-height:620px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:11px;line-height:1.5}
html[data-autotube-theme="dark"] .scenario-mode-tabs,html[data-autotube-theme="dark"] .scenario-dropzone,html[data-autotube-theme="dark"] .scenario-reference-row,html[data-autotube-theme="dark"] .scenario-profile-list-item,html[data-autotube-theme="dark"] .scenario-profile-summary>div{background:rgba(20,20,22,.72);border-color:#3a3b3e;color:#f5f5f5}
html[data-autotube-theme="dark"] .scenario-mode-button{color:#f4f4f4}html[data-autotube-theme="dark"] .scenario-mode-button.active{background:#f5f5f5;color:#050607}
@media(max-width:900px){.scenario-profile-workspace{grid-template-columns:1fr}.scenario-profile-summary{grid-template-columns:repeat(2,1fr)}}

/* Scenario topic portfolio planner v99 */
.scenario-topic-card{grid-column:1/-1;margin:0;padding:18px;border-radius:22px}
.scenario-topic-card .card-heading{margin-bottom:13px}
.scenario-topic-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) 150px auto;gap:9px;align-items:end}
.scenario-topic-field{display:flex;flex-direction:column;gap:6px;color:#17191c;font-size:12px;font-weight:750}
.scenario-topic-field .select-input{width:100%;min-height:44px}
.scenario-topic-toolbar .primary-button{width:auto;min-height:44px;padding:10px 20px;white-space:nowrap}
.scenario-topic-selection{display:flex;flex-direction:column;gap:4px;margin:14px 0 10px;padding:12px 14px;border:1px solid #090a0b;border-radius:14px;background:#090a0b;color:#fff}
.scenario-topic-selection span{font-size:9px;font-weight:850;letter-spacing:.18em}.scenario-topic-selection strong{font-size:16px}.scenario-topic-selection p{margin:0;color:#d7d9db;font-size:12px;line-height:1.4}
.scenario-topics-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:12px}
.scenario-topic-item{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:10px;align-items:start;width:100%;padding:11px 12px;border:1px solid #d4d6d8;border-radius:13px;background:rgba(255,255,255,.5);color:#17191c;text-align:left;cursor:pointer;transition:.15s ease}
.scenario-topic-item:hover{border-color:#050607;background:#fff;transform:translateY(-1px)}
.scenario-topic-item.selected{border-color:#050607;box-shadow:inset 0 0 0 1px #050607;background:#fff}
.scenario-topic-number{padding-top:1px;color:#858a91;font-size:10px;font-weight:800;letter-spacing:.08em}
.scenario-topic-copy{display:flex;flex-direction:column;gap:4px}.scenario-topic-copy strong{font-size:14px;line-height:1.25}.scenario-topic-copy small{color:#6f757d;font-size:11px;line-height:1.38}
.scenario-topic-item b{padding-top:2px;font-size:10px}.scenario-topic-item.selected b{color:#050607}.scenario-topic-item.selected b::after{content:' ✓'}
.scenario-topic-more-actions{display:flex;justify-content:center;margin-top:13px}.scenario-topic-more-actions .secondary-button{width:auto}
html[data-autotube-theme="dark"] .scenario-topic-field{color:#f5f5f5}
html[data-autotube-theme="dark"] .scenario-topic-item{background:rgba(20,20,22,.72);border-color:#3a3b3e;color:#f5f5f5}
html[data-autotube-theme="dark"] .scenario-topic-item:hover,html[data-autotube-theme="dark"] .scenario-topic-item.selected{background:#17181a;border-color:#f3f3f3;box-shadow:inset 0 0 0 1px #f3f3f3}
html[data-autotube-theme="dark"] .scenario-topic-item.selected b{color:#fff}
@media(max-width:900px){.scenario-topic-toolbar{grid-template-columns:1fr 130px}.scenario-topic-toolbar .primary-button{grid-column:1/-1}.scenario-topics-list{grid-template-columns:1fr}}
/* AUTOTUBE_SCENARIO_PROFILE_ANALYZER_V88_END */

/* Compact scenario generation workspace v100 */
.scenario-generate-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(420px,1fr);gap:12px;align-items:stretch;height:calc(100svh - 150px);min-height:640px;max-height:920px}
.scenario-generator-panel,.scenario-generation-results .text-section{min-width:0;min-height:0;margin:0;padding:15px;border:1px solid #ddd4c7;border-radius:17px;background:rgba(255,254,250,.43);box-shadow:0 10px 28px rgba(75,61,42,.045)}
.scenario-generator-panel{display:flex;flex-direction:column;gap:9px;height:100%;overflow:hidden}
.scenario-generator-panel>.section-heading{flex:0 0 auto;margin:0}.scenario-generator-panel>.section-heading label,.scenario-generation-results .section-heading label{font-size:20px;line-height:1.15}
.scenario-profile-builder{flex:0 0 auto;border:1px solid #d4d6d8;border-radius:12px;background:rgba(255,255,255,.42);overflow:hidden}
.scenario-profile-builder>summary{padding:10px 12px;font-size:12px;font-weight:800;cursor:pointer;list-style-position:inside}
.scenario-profile-builder-body{display:grid;gap:8px;padding:0 10px 10px}.scenario-profile-builder-body .text-input{width:100%;height:38px;margin:0;padding:8px 11px;font-size:12px}
.scenario-profile-builder .scenario-dropzone{min-height:68px;padding:12px}.scenario-profile-builder .scenario-dropzone strong{font-size:13px}.scenario-profile-builder .scenario-dropzone span{font-size:10px}
.scenario-profile-builder .scenario-reference-list{max-height:124px;overflow:auto}.scenario-profile-builder .scenario-reference-row{padding:7px 9px;font-size:10px}
.scenario-profile-builder .scenario-profile-actions{margin:0}.scenario-profile-builder .scenario-profile-actions .primary-button{min-height:36px;padding:7px 12px;font-size:11px}
.scenario-profile-builder .message{margin:0;text-align:center;font-size:10px}.scenario-profile-builder .message:empty{display:none}
.scenario-profile-result{margin:0;padding:9px;border:1px solid #d5d7d9;border-radius:11px}.scenario-profile-result-bar{display:flex;align-items:center;justify-content:space-between;gap:8px}.scenario-profile-result-bar strong{font-size:12px}
.scenario-profile-result .scenario-profile-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:8px 0}.scenario-profile-result .scenario-profile-summary>div{padding:7px}.scenario-profile-result .scenario-profile-summary span{font-size:9px}.scenario-profile-result .scenario-profile-summary strong{font-size:11px}
.scenario-profile-json-details{padding:7px!important}.scenario-profile-json-details pre{max-height:220px!important}
.scenario-topic-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:0 0 auto}.scenario-topic-head>strong{font-size:15px}.scenario-topic-generate-actions{display:flex;align-items:center;gap:7px}.scenario-topic-generate-actions .select-input{width:72px;height:36px;padding:6px 28px 6px 9px;font-size:11px}.scenario-topic-generate-actions .secondary-button{min-height:36px;padding:7px 11px;font-size:11px}
.scenario-generator-panel>.message{flex:0 0 auto;margin:0;text-align:center;font-size:10px}.scenario-generator-panel>.message:empty{display:none}
.scenario-generator-panel .scenario-topic-selection{flex:0 0 auto;margin:0;padding:9px 11px}.scenario-generator-panel .scenario-topic-selection span{font-size:8px}.scenario-generator-panel .scenario-topic-selection strong{font-size:13px}.scenario-generator-panel .scenario-topic-selection p{font-size:10px}
.scenario-generator-panel .scenario-topics-list{display:grid;grid-template-columns:1fr;gap:6px;flex:1 1 auto;min-height:120px;margin:0;overflow:auto;padding-right:3px}
.scenario-generator-panel .scenario-topic-item{grid-template-columns:25px minmax(0,1fr) auto;padding:9px 10px}.scenario-generator-panel .scenario-topic-copy strong{font-size:12px}.scenario-generator-panel .scenario-topic-copy small{font-size:10px}.scenario-generator-panel .scenario-topic-item b{font-size:9px}
.scenario-generator-panel .scenario-topic-more-actions{flex:0 0 auto;margin:0;min-height:18px}.scenario-generator-panel .scenario-topic-more-actions .text-button{padding:2px 7px;font-size:10px}
.scenario-generator-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex:0 0 auto;align-items:start}.scenario-generator-field{display:flex;flex-direction:column;gap:4px}.scenario-generator-field .select-input{width:100%;height:39px;padding:7px 32px 7px 10px;font-size:12px}.scenario-generator-field span{padding-left:3px;font-size:10px;font-weight:750}
.scenario-generation-results{display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:12px;min-width:0;min-height:0;height:100%}.scenario-generation-results .text-section{display:grid;grid-template-rows:auto minmax(0,1fr);gap:9px}.scenario-generation-results .section-heading{margin:0}.scenario-generation-results textarea{width:100%;height:100%;min-height:0!important;resize:none;padding:14px 15px;border-radius:12px;font-size:14px;line-height:1.5}
html[data-autotube-theme="dark"] .scenario-generator-panel,html[data-autotube-theme="dark"] .scenario-generation-results .text-section,html[data-autotube-theme="dark"] .scenario-profile-builder{background:rgba(20,20,22,.72);border-color:#3a3b3e;color:#f5f5f5}
@media(max-width:1100px){.scenario-generate-layout{grid-template-columns:minmax(0,1fr) minmax(360px,.9fr)}.scenario-generator-panel>.section-heading label,.scenario-generation-results .section-heading label{font-size:17px}}
@media(max-width:850px){.scenario-generate-layout{height:auto;max-height:none;min-height:0;grid-template-columns:1fr}.scenario-generator-panel{min-height:680px}.scenario-generation-results{grid-template-rows:repeat(2,minmax(420px,auto))}}
@media(max-width:580px){.scenario-generator-controls{grid-template-columns:1fr}.scenario-profile-result .scenario-profile-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* AUTOTUBE_SCENARIO_GENERATION_WORKSPACE_V100_END */

/* Single-stage scenario generator v101 */
.scenario-generator-stage{display:flex;flex:1 1 auto;min-height:0;overflow:hidden;border:1px solid #d4d6d8;border-radius:12px;background:rgba(255,255,255,.42)}
.scenario-topic-view{display:flex;flex-direction:column;gap:8px;width:100%;height:100%;min-height:0;padding:14px}
.scenario-topic-empty{margin:4px 2px;color:#747a82;font-size:14px;line-height:1.5}
.scenario-generator-stage .scenario-profile-builder{display:flex;flex-direction:column;gap:9px;width:100%;height:100%;min-height:0;padding:14px;border:0;border-radius:0;background:transparent;overflow:auto}
.scenario-profile-builder-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.scenario-profile-builder-heading strong{font-size:15px}.scenario-profile-builder-heading .text-button{padding:3px 6px;font-size:10px}
.scenario-generator-stage .scenario-profile-builder>.text-input{flex:0 0 auto;width:100%;height:39px;margin:0;padding:8px 11px;font-size:12px}.scenario-generator-stage .scenario-profile-builder>.scenario-dropzone{flex:1 1 auto;min-height:130px}
.scenario-generator-stage .scenario-profile-builder>.scenario-reference-list{flex:0 1 auto;max-height:170px;overflow:auto}
.scenario-generator-stage .scenario-profile-builder>.scenario-profile-actions{flex:0 0 auto;margin:0}
.scenario-generator-stage .scenario-profile-builder>.message{flex:0 0 auto;margin:0;text-align:center;font-size:10px}.scenario-generator-stage .scenario-profile-builder>.message:empty{display:none}
.scenario-generator-controls{display:flex;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-end;gap:7px;overflow-x:auto;padding-bottom:1px}
.scenario-generator-controls .secondary-button{flex:0 0 auto;width:auto;min-height:39px;padding:8px 11px;white-space:nowrap;font-size:11px}
.scenario-generator-controls .scenario-new-profile-button{font-weight:750}.scenario-generator-controls .scenario-new-profile-button.active{background:#050607;color:#fff;border-color:#050607}
.scenario-generator-controls .scenario-generator-field{flex:0 0 auto;width:205px}.scenario-generator-controls .scenario-generator-field:nth-of-type(2){width:158px}.scenario-generator-controls .scenario-topic-count-control{width:105px}
.scenario-generator-controls .scenario-generator-field .select-input{height:39px;padding:7px 29px 7px 9px;font-size:11px}
.scenario-generator-controls .scenario-generator-field span{font-size:9px}.scenario-generator-controls .scenario-generate-topics-button{font-weight:800}
.scenario-generator-panel .scenario-topic-view .scenario-topics-list{flex:1 1 auto;min-height:0}
html[data-autotube-theme="dark"] .scenario-generator-stage{background:rgba(20,20,22,.72);border-color:#3a3b3e}
@media(max-width:850px){.scenario-generator-controls{justify-content:flex-start}.scenario-generator-stage{min-height:520px}}
/* AUTOTUBE_SCENARIO_GENERATOR_STAGE_V101_END */

/* Fitted scenario control row v102 */
.scenario-generator-controls{display:grid;grid-template-columns:max-content minmax(135px,1fr) minmax(110px,.72fr) 82px max-content;align-items:start;gap:6px;width:100%;overflow:visible}
.scenario-generator-controls .scenario-generator-field,.scenario-generator-controls .scenario-generator-field:nth-of-type(2),.scenario-generator-controls .scenario-topic-count-control{width:auto;min-width:0}
.scenario-generator-controls .scenario-generator-field .select-input{width:100%;min-width:0;height:36px;padding:6px 23px 6px 8px;font-size:10px}
.scenario-generator-controls .secondary-button{width:auto;min-width:0;min-height:36px;padding:7px 8px;font-size:10px}
.scenario-generator-controls .scenario-new-profile-button{max-width:none}.scenario-generator-controls .scenario-generator-field span{padding-left:2px;font-size:8px}
@media(max-width:1050px){.scenario-generator-controls{grid-template-columns:max-content minmax(120px,1fr) minmax(100px,.7fr) 76px max-content;gap:5px}.scenario-generator-controls .secondary-button{padding-inline:6px;font-size:9px}.scenario-generator-controls .scenario-generator-field .select-input{font-size:9px}}
@media(max-width:850px){.scenario-generator-controls{display:flex;overflow-x:auto}.scenario-generator-controls .scenario-generator-field{flex:0 0 150px}.scenario-generator-controls .scenario-topic-count-control{flex-basis:86px}}
/* AUTOTUBE_SCENARIO_CONTROLS_FITTED_V102_END */

/* Scenario profile management v103 */
.scenario-new-profile-control{display:flex;flex-direction:column;gap:4px;min-width:0}.scenario-new-profile-control>span{padding-left:2px;font-size:8px;font-weight:750;white-space:nowrap}
.scenario-profile-control-meta{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:12px}.scenario-profile-control-meta>span{padding-left:2px;font-size:8px;font-weight:750}.scenario-profile-control-meta .text-button{min-height:0;padding:0 2px;font-size:8px;line-height:1.2}
.scenario-profile-control-meta .text-button:disabled{visibility:hidden}
/* AUTOTUBE_SCENARIO_PROFILE_MANAGEMENT_V103_END */

/* Scenario control typography v105 */
.scenario-generator-controls .scenario-new-profile-control,
.scenario-generator-controls .scenario-generator-field{
  gap:2px;
}
.scenario-generator-controls .scenario-new-profile-button,
.scenario-generator-controls .scenario-generator-field .select-input,
.scenario-generator-controls .scenario-generate-topics-button{
  color:#111315;
  font-weight:800;
}
.scenario-generator-controls .scenario-new-profile-control>span,
.scenario-generator-controls .scenario-generator-field>span,
.scenario-generator-controls .scenario-profile-control-meta>span{
  padding-left:2px;
  color:#747a82;
  font-size:8px;
  font-weight:400;
  line-height:1.05;
}
.scenario-generator-controls .scenario-profile-control-meta{
  min-height:9px;
  margin-top:0;
  line-height:1.05;
}
.scenario-generator-controls .scenario-profile-control-meta .text-button{
  color:#747a82;
  font-weight:400;
}
html[data-autotube-theme="dark"] .scenario-generator-controls .scenario-new-profile-button,
html[data-autotube-theme="dark"] .scenario-generator-controls .scenario-generator-field .select-input,
html[data-autotube-theme="dark"] .scenario-generator-controls .scenario-generate-topics-button{
  color:#f5f5f5;
}
html[data-autotube-theme="dark"] .scenario-generator-controls .scenario-new-profile-control>span,
html[data-autotube-theme="dark"] .scenario-generator-controls .scenario-generator-field>span,
html[data-autotube-theme="dark"] .scenario-generator-controls .scenario-profile-control-meta>span,
html[data-autotube-theme="dark"] .scenario-generator-controls .scenario-profile-control-meta .text-button{
  color:#9a9da3;
}
/* AUTOTUBE_SCENARIO_CONTROL_TYPOGRAPHY_V105_END */

/* Full topic canvas and in-place selection v106 */
.scenario-generator-panel .scenario-topic-view{
  gap:0;
  padding:10px;
}
.scenario-generator-panel .scenario-topic-view .message:empty,
.scenario-generator-panel .scenario-topic-selection.hidden{
  display:none;
}
.scenario-generator-panel .scenario-topic-view .scenario-topics-list{
  width:100%;
  min-height:0;
  margin:0;
  padding:0 3px 0 0;
}
.scenario-generator-panel .scenario-topic-item.selected,
.scenario-generator-panel .scenario-topic-item.selected:hover{
  border-color:#050607;
  background:#050607;
  color:#f7f7f5;
  box-shadow:none;
  transform:none;
}
.scenario-generator-panel .scenario-topic-item.selected .scenario-topic-number,
.scenario-generator-panel .scenario-topic-item.selected .scenario-topic-copy small,
.scenario-generator-panel .scenario-topic-item.selected b{
  color:#f7f7f5;
}
.scenario-generator-panel .scenario-topic-item.selected b::after{
  content:' ✓';
}
html[data-autotube-theme="dark"] .scenario-generator-panel .scenario-topic-item.selected,
html[data-autotube-theme="dark"] .scenario-generator-panel .scenario-topic-item.selected:hover{
  border-color:#f5f5f5;
  background:#f5f5f5;
  color:#111315;
}
html[data-autotube-theme="dark"] .scenario-generator-panel .scenario-topic-item.selected .scenario-topic-number,
html[data-autotube-theme="dark"] .scenario-generator-panel .scenario-topic-item.selected .scenario-topic-copy small,
html[data-autotube-theme="dark"] .scenario-generator-panel .scenario-topic-item.selected b{
  color:#111315;
}
/* AUTOTUBE_SCENARIO_TOPIC_CANVAS_V106_END */

/* Scenario generation action v108 */
.scenario-script-controls{
  display:flex;
  flex:0 0 auto;
  align-items:flex-start;
  justify-content:flex-end;
  gap:7px;
  width:100%;
  padding-top:8px;
  border-top:1px solid #d4d6d8;
}
.scenario-script-controls.hidden{display:none}
.scenario-script-duration-field{
  display:flex;
  flex-direction:column;
  gap:2px;
  width:92px;
  color:#747a82;
  font-size:8px;
  font-weight:400;
  line-height:1.05;
}
.scenario-script-duration-field .select-input{
  width:100%;
  height:36px;
  padding:6px 25px 6px 9px;
  color:#111315;
  font-size:10px;
  font-weight:800;
}
.scenario-script-controls .primary-button{
  width:auto;
  min-height:36px;
  padding:7px 13px;
  font-size:10px;
  white-space:nowrap;
}
.scenario-script-progress{
  flex:0 0 auto;
  margin:3px 0 0;
  text-align:right;
  font-size:9px;
  line-height:1.25;
}
.scenario-script-progress:empty{display:none}
html[data-autotube-theme="dark"] .scenario-script-controls{border-top-color:#3a3b3e}
html[data-autotube-theme="dark"] .scenario-script-duration-field{color:#9a9da3}
html[data-autotube-theme="dark"] .scenario-script-duration-field .select-input{color:#f5f5f5}
/* AUTOTUBE_SCENARIO_GENERATION_ACTION_V107_END */

/* AUTOTUBE_SCENARIO_OUTER_CONTAINER_V4_BEGIN */

/*
  Велика зовнішня рамка всієї вкладки "Сценарії":
  перемикач + обидві колонки.
  Аналог контейнера у вкладці "Генерація кадрів".
*/

#rewriteTab.active {
  box-sizing: border-box !important;

  padding: 16px !important;

  border: 1px solid #d3d5d7 !important;
  border-radius: 20px !important;

  background: #f7f8f8 !important;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 8px 26px rgba(0, 0, 0, 0.035) !important;

  gap: 14px !important;

  overflow: hidden !important;
}

/* перемикач тепер знаходиться ВСЕРЕДИНІ великої рамки */
#rewriteTab.active > .scenario-mode-tabs {
  margin: 0 !important;
  flex: 0 0 auto !important;
  align-self: flex-start !important;
}

/* основний контент займає решту місця всередині рамки */
#rewriteTab.active > #scenarioGeneratePane:not(.hidden),
#rewriteTab.active > #scenarioRewritePane:not(.hidden) {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
}

/* трохи компактніше на невисоких екранах */
@media (max-height: 850px) {
  #rewriteTab.active {
    padding: 12px !important;
    gap: 10px !important;
  }
}

/* AUTOTUBE_SCENARIO_OUTER_CONTAINER_V4_END */

/* AUTOTUBE_SCENARIO_COMPACT_LAYOUT_CLEAN_V6_BEGIN */

/* Keep the compact one-screen Scenario layout,
   but DO NOT define dimensions/styles for the mode switch here.
   The switch now reuses the exact Фото / Відео classes. */

body:has(#rewriteTab.active) {
  overflow: hidden !important;
}

body:has(#rewriteTab.active) .app-shell {
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

body:has(#rewriteTab.active) .topbar,
body:has(#rewriteTab.active) .tabs {
  flex: 0 0 auto !important;
}

#rewriteTab.active {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

/* Position only. Size/appearance comes from .visual-mode-toggle. */
#rewriteTab > .scenario-mode-tabs.visual-mode-toggle {
  flex: 0 0 auto !important;
  align-self: flex-start !important;
  margin: 0 !important;
}

#rewriteTab > #scenarioGeneratePane:not(.hidden),
#rewriteTab > #scenarioRewritePane:not(.hidden) {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
}

#rewriteTab > #scenarioGeneratePane:not(.hidden) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 16px !important;
}

#scenarioGeneratePane .scenario-generator-panel {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#scenarioGeneratePane .scenario-generator-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#scenarioGeneratePane .scenario-topic-view,
#scenarioGeneratePane .scenario-profile-builder {
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: auto !important;
}

#scenarioGeneratePane .scenario-generator-controls {
  flex: 0 0 auto !important;
  margin-top: 10px !important;
}

#scenarioGeneratePane .scenario-generation-results {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 16px !important;
  overflow: hidden !important;
}

#scenarioGeneratePane .scenario-generation-results > .text-section {
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#scenarioGeneratePane .scenario-generation-results textarea {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  resize: none !important;
}

#rewriteTab > #scenarioRewritePane:not(.hidden) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 16px !important;
}

#scenarioRewritePane .rewrite-source-panel,
#scenarioRewritePane .rewrite-results-column,
#scenarioRewritePane .result-section {
  min-height: 0 !important;
  overflow: hidden !important;
}

#scenarioRewritePane .rewrite-source-panel {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

#scenarioRewritePane .rewrite-source-panel > #source {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  resize: none !important;
}

#scenarioRewritePane .rewrite-results-column {
  height: 100% !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 16px !important;
}

#scenarioRewritePane .result-section {
  display: flex !important;
  flex-direction: column !important;
}

#scenarioRewritePane .result-section textarea {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  resize: none !important;
}

@media (max-height: 850px) {
  #rewriteTab.active {
    gap: 10px !important;
  }

  #scenarioGeneratePane .scenario-generation-results,
  #scenarioRewritePane .rewrite-results-column {
    gap: 10px !important;
  }
}

/* AUTOTUBE_SCENARIO_COMPACT_LAYOUT_CLEAN_V6_END */

/* AUTOTUBE_SCENARIO_EXACT_VISUAL_TOGGLE_V6_BEGIN */

/*
  IMPORTANT:
  Scenario switch intentionally has NO copied width/height/font values here.
  It uses the same classes as Фото / Відео:
    .visual-mode-toggle
    .visual-mode-button
  Therefore both switches are driven by the exact same CSS source.
*/

#rewriteTab > .scenario-mode-tabs.visual-mode-toggle {
  align-self: flex-start !important;
}

/* AUTOTUBE_SCENARIO_EXACT_VISUAL_TOGGLE_V6_END */

/* AUTOTUBE_SCENARIO_CONTROLS_BOTTOM_TIGHT_V7_BEGIN */

/*
  Final spacing pass:
  - captions sit almost flush under the controls;
  - the entire control row sits at the very bottom of the left card;
  - bottom breathing room stays deliberately small.
*/

#scenarioGeneratePane .scenario-generator-panel {
  padding-bottom: 8px !important;
}

#scenarioGeneratePane .scenario-generator-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Push the controls to the bottom of the left card. */
#scenarioGeneratePane .scenario-generator-controls {
  margin-top: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Captions nearly touch their control. */
#scenarioGeneratePane .scenario-profile-control,
#scenarioGeneratePane label.scenario-generator-field,
#scenarioGeneratePane .scenario-topic-count-control {
  row-gap: 1px !important;
  gap: 1px !important;
}

#scenarioGeneratePane .scenario-profile-control-meta,
#scenarioGeneratePane .scenario-generator-field > span {
  margin-top: 1px !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  line-height: 1 !important;
}

/* No hidden extra space under the icon control. */
#scenarioGeneratePane .scenario-new-profile-control {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Keep the isolated Create button aligned with the tops of the selects. */
#scenarioGeneratePane #generateScenarioTopicsButton {
  align-self: flex-start !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* On shorter laptop screens, bring the row even closer to the frame. */
@media (max-height: 850px) {
  #scenarioGeneratePane .scenario-generator-panel {
    padding-bottom: 6px !important;
  }
}

/* AUTOTUBE_SCENARIO_CONTROLS_BOTTOM_TIGHT_V7_END */

/* AUTOTUBE_SCENARIO_HIDE_BOTTOM_CAPTIONS_V8_BEGIN */

/* Hide the three helper captions under the Scenario generation controls. */
#scenarioGeneratePane .scenario-profile-control-meta > span,
#scenarioGeneratePane label.scenario-generator-field > span {
  display: none !important;
}

/* Remove the vertical space that belonged to those captions. */
#scenarioGeneratePane .scenario-profile-control,
#scenarioGeneratePane label.scenario-generator-field,
#scenarioGeneratePane .scenario-topic-count-control {
  gap: 0 !important;
  row-gap: 0 !important;
}

/* Keep the final row visually centered and compact. */
#scenarioGeneratePane .scenario-generator-controls {
  align-items: flex-start !important;
  margin-bottom: 0 !important;
}

/* AUTOTUBE_SCENARIO_HIDE_BOTTOM_CAPTIONS_V8_END */

/* AUTOTUBE_SCENARIO_CONTROLS_EQUAL_GAPS_V9_BEGIN */

/*
  Final alignment:
  - equal vertical gap above and below the bottom controls row;
  - remove the beige/orange border from the left Scenario card;
  - keep all current button/select sizes unchanged.
*/

#scenarioGeneratePane .scenario-generator-panel {
  /* same neutral grey family as the other cards */
  border-color: #d7dadd !important;

  /*
    Bottom gap under the controls.
    Top gap is set on .scenario-generator-controls below.
  */
  padding-bottom: 12px !important;
}

/*
  Equal distance:
    textarea/card above
        ↓ 12px
    controls row
        ↓ 12px
    outer card border
*/
#scenarioGeneratePane .scenario-generator-controls {
  margin-top: 12px !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Do not let an older rule push the row with auto margin. */
#scenarioGeneratePane .scenario-generator-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Keep the inner topic panel flush at its bottom edge. */
#scenarioGeneratePane .scenario-topic-view {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* On short laptop screens preserve symmetry with a slightly tighter gap. */
@media (max-height: 850px) {
  #scenarioGeneratePane .scenario-generator-panel {
    padding-bottom: 10px !important;
  }

  #scenarioGeneratePane .scenario-generator-controls {
    margin-top: 10px !important;
  }
}

/* AUTOTUBE_SCENARIO_CONTROLS_EQUAL_GAPS_V9_END */

/* AUTOTUBE_SCENARIO_CONTROLS_REFERENCE_FIT_V15_BEGIN */

/*
  Reference style = "Вставити текст з озвучки":
  compact rounded control, text + only a small amount of breathing room.
  Width is calculated from the CURRENT visible text by JS.
*/

#scenarioGeneratePane .scenario-generator-controls {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

/* wrappers must never stretch */
#scenarioGeneratePane .scenario-new-profile-control,
#scenarioGeneratePane .scenario-profile-control,
#scenarioGeneratePane label.scenario-generator-field,
#scenarioGeneratePane .scenario-topic-count-control {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* icon: same compact height as every other control */
#scenarioGeneratePane .scenario-new-profile-control {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
}

#scenarioGeneratePane #newScenarioProfileButton.scenario-icon-button {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;

  padding: 0 !important;
  margin: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border: 1px solid #d7dadd !important;
  border-radius: 11px !important;
  background: #fff !important;
  box-shadow: none !important;
  flex: 0 0 38px !important;
}

#scenarioGeneratePane #newScenarioProfileButton .scenario-profile-add-icon {
  width: 17px !important;
  height: 17px !important;
  display: block !important;
  flex: 0 0 17px !important;
}

/* selects: exact compact reference geometry */
#scenarioGeneratePane #scenarioTopicProfile,
#scenarioGeneratePane #scenarioChannelLanguage,
#scenarioGeneratePane #scenarioTopicCount {
  appearance: none !important;
  -webkit-appearance: none !important;

  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;

  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;

  margin: 0 !important;
  padding: 0 28px 0 12px !important;

  border: 1px solid #d7dadd !important;
  border-radius: 11px !important;

  background-color: #fff !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #17191c 50%),
    linear-gradient(135deg, #17191c 50%, transparent 50%) !important;
  background-position:
    calc(100% - 13px) 50%,
    calc(100% - 9px) 50% !important;
  background-size: 4px 4px, 4px 4px !important;
  background-repeat: no-repeat !important;

  box-shadow: none !important;

  font-size: 14px !important;
  line-height: 1 !important;
  font-weight: 700 !important;

  box-sizing: border-box !important;
  white-space: nowrap !important;
}

/* captions stay hidden */
#scenarioGeneratePane .scenario-profile-control-meta > span,
#scenarioGeneratePane label.scenario-generator-field > span {
  display: none !important;
}

/* generate: same compact reference geometry, only black */
#scenarioGeneratePane #generateScenarioTopicsButton {
  margin-left: auto !important;

  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;

  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;

  padding: 0 12px !important;

  border: 1px solid #000 !important;
  border-radius: 11px !important;

  background: #000 !important;
  background-color: #000 !important;
  background-image: none !important;

  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;

  color: #fff !important;

  font-size: 14px !important;
  line-height: 1 !important;
  font-weight: 700 !important;

  opacity: 1 !important;
  box-sizing: border-box !important;
}

#scenarioGeneratePane #generateScenarioTopicsButton::before,
#scenarioGeneratePane #generateScenarioTopicsButton::after {
  content: none !important;
  display: none !important;
}

#scenarioGeneratePane #generateScenarioTopicsButton:hover,
#scenarioGeneratePane #generateScenarioTopicsButton:focus,
#scenarioGeneratePane #generateScenarioTopicsButton:active,
#scenarioGeneratePane #generateScenarioTopicsButton:disabled {
  background: #000 !important;
  background-image: none !important;
  border-color: #000 !important;
  color: #fff !important;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

/* AUTOTUBE_SCENARIO_CONTROLS_REFERENCE_FIT_V15_END */

/* AUTOTUBE_SCENARIO_CONTROLS_ALIGN_V16_BEGIN */

/* Remove the leftover helper text under the profile icon. */
#scenarioGeneratePane .scenario-new-profile-control > span {
  display: none !important;
}

/* Force every control in the bottom row to start on exactly the same Y position. */
#scenarioGeneratePane .scenario-generator-controls {
  align-items: flex-start !important;
}

#scenarioGeneratePane .scenario-new-profile-control,
#scenarioGeneratePane .scenario-profile-control,
#scenarioGeneratePane label.scenario-generator-field,
#scenarioGeneratePane .scenario-topic-count-control,
#scenarioGeneratePane #newScenarioProfileButton,
#scenarioGeneratePane #scenarioTopicProfile,
#scenarioGeneratePane #scenarioChannelLanguage,
#scenarioGeneratePane #scenarioTopicCount,
#scenarioGeneratePane #generateScenarioTopicsButton {
  margin-top: 0 !important;
  top: auto !important;
  transform: none !important;
  align-self: flex-start !important;
}

/* Language and topic-count wrappers must not carry any hidden vertical offset. */
#scenarioGeneratePane label.scenario-generator-field,
#scenarioGeneratePane .scenario-topic-count-control {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  row-gap: 0 !important;
  gap: 0 !important;
}

/* Their selects use the exact same compact 38px control height as the others. */
#scenarioGeneratePane #scenarioChannelLanguage,
#scenarioGeneratePane #scenarioTopicCount {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  margin-bottom: 0 !important;
  vertical-align: top !important;
}

/* AUTOTUBE_SCENARIO_CONTROLS_ALIGN_V16_END */

/* AUTOTUBE_SCENARIO_PROFILE_ICON_APPLE_V18_BEGIN */

/*
  Softer Apple-like icon weight:
  clean rounded strokes, medium visual weight, no over-bold appearance.
*/

#scenarioGeneratePane #newScenarioProfileButton {
  font-weight: 600 !important;
}

#scenarioGeneratePane #newScenarioProfileButton svg,
#scenarioGeneratePane .scenario-new-profile-control button svg,
#scenarioGeneratePane .scenario-new-profile-button svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;

  display: block !important;

  stroke: currentColor !important;
  fill: none !important;

  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;

  overflow: visible !important;
}

#scenarioGeneratePane #newScenarioProfileButton svg *,
#scenarioGeneratePane .scenario-new-profile-control button svg *,
#scenarioGeneratePane .scenario-new-profile-button svg * {
  stroke-width: 1.9 !important;
  vector-effect: non-scaling-stroke !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Font-icon fallback */
#scenarioGeneratePane #newScenarioProfileButton i,
#scenarioGeneratePane #newScenarioProfileButton .icon,
#scenarioGeneratePane #newScenarioProfileButton .material-symbols-outlined,
#scenarioGeneratePane #newScenarioProfileButton .material-icons {
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

/* AUTOTUBE_SCENARIO_PROFILE_ICON_APPLE_V18_END */

/* AUTOTUBE_SCENARIO_PROFILE_MODAL_V19_BEGIN */
#scenarioGeneratePane #scenarioProfileBuilder { display: none !important; }

body.scenario-profile-modal-open { overflow: hidden !important; }

.scenario-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.scenario-profile-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.scenario-profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(236, 239, 242, 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(118%);
  backdrop-filter: blur(20px) saturate(118%);
}

.scenario-profile-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 56px));
  max-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  border: 1px solid rgba(210, 214, 218, 0.95);
  border-radius: 30px;
  background: rgba(250, 250, 251, 0.96);
  box-shadow: 0 28px 80px rgba(31, 37, 43, 0.20), 0 2px 10px rgba(31, 37, 43, 0.05);
  transform: translateY(12px) scale(0.985);
  transition: transform 200ms cubic-bezier(.2,.8,.2,1);
}

.scenario-profile-modal.is-open .scenario-profile-modal-dialog {
  transform: translateY(0) scale(1);
}

.scenario-profile-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 22px;
  border-bottom: 1px solid #e1e3e5;
}

.scenario-profile-modal-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #111417;
}

.scenario-profile-modal-header p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #717780;
}

.scenario-profile-modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d8dadd;
  border-radius: 15px;
  background: #fff;
  color: #15181b;
  cursor: pointer;
}

.scenario-profile-modal-close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.scenario-profile-modal-body {
  max-height: calc(min(760px, 100vh - 56px) - 112px);
  overflow: auto;
  padding: 26px 30px 30px;
}

.scenario-profile-source-card,
.scenario-profile-analysis-visual {
  padding: 22px;
  border: 1px solid #dedfe1;
  border-radius: 20px;
  background: #fff;
}

.scenario-profile-source-label {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 750;
  color: #171a1d;
}

.scenario-profile-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.scenario-profile-url-field {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid #d8dade;
  border-radius: 15px;
  background: #fafafa;
}

.scenario-profile-url-field:focus-within {
  border-color: #111417;
  box-shadow: 0 0 0 3px rgba(17, 20, 23, 0.07);
}

.scenario-profile-url-field svg {
  width: 19px;
  height: 19px;
  min-width: 19px;
  margin-right: 10px;
  fill: none;
  stroke: #7b8088;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scenario-profile-url-field input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111417;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}

.scenario-profile-url-field input::placeholder {
  color: #9a9fa6;
  font-weight: 500;
}

.scenario-profile-start-button {
  height: 52px;
  padding: 0 21px;
  border: 1px solid #050505;
  border-radius: 15px;
  background: #050505;
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  font-weight: 750;
  cursor: pointer;
}

.scenario-profile-start-button:disabled {
  cursor: default;
  opacity: 0.34;
}

.scenario-profile-source-hint {
  margin: 10px 2px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #858b93;
}

.scenario-profile-analysis-visual {
  display: none;
  margin-top: 18px;
}

.scenario-profile-analysis-visual.is-visible {
  display: block;
  animation: scenarioProfileAnalysisIn 220ms ease both;
}

@keyframes scenarioProfileAnalysisIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.scenario-profile-analysis-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.scenario-profile-analysis-kicker {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #7c828a;
}

.scenario-profile-analysis-heading h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 800;
  color: #111417;
}

.scenario-profile-analysis-percent {
  font-size: 17px;
  font-weight: 800;
  color: #111417;
}

.scenario-profile-progress-track {
  height: 6px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef0;
}

.scenario-profile-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #111417;
  transition: width 420ms cubic-bezier(.2,.8,.2,1);
}

.scenario-profile-analysis-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.scenario-profile-analysis-step {
  position: relative;
  min-width: 0;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border: 1px solid #e0e2e4;
  border-radius: 16px;
  background: #fafafa;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.scenario-profile-analysis-step.is-active {
  border-color: #1b1e21;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(25, 29, 33, 0.08);
}

.scenario-profile-analysis-step.is-done {
  border-color: #d3d6d9;
  background: #f6f7f7;
}

.scenario-profile-analysis-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 1px solid #d9dbde;
  border-radius: 11px;
  background: #fff;
  color: #1b1e21;
}

.scenario-profile-analysis-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scenario-profile-analysis-step strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 800;
  color: #191c1f;
}

.scenario-profile-analysis-step span {
  font-size: 11px;
  line-height: 1.35;
  color: #7f858d;
}

.scenario-profile-step-state {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d7dade;
}

.scenario-profile-analysis-step.is-active .scenario-profile-step-state {
  background: #111417;
  box-shadow: 0 0 0 5px rgba(17, 20, 23, 0.08);
  animation: scenarioProfilePulse 1.2s ease-in-out infinite;
}

.scenario-profile-analysis-step.is-done .scenario-profile-step-state {
  background: #111417;
}

@keyframes scenarioProfilePulse {
  0%, 100% { transform: scale(0.88); }
  50% { transform: scale(1.12); }
}

.scenario-profile-analysis-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 650;
  color: #656b73;
}

.scenario-profile-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #111417;
}

.scenario-profile-analysis-visual.is-running .scenario-profile-status-dot {
  animation: scenarioProfilePulse 1.2s ease-in-out infinite;
}

@media (max-width: 900px) {
  .scenario-profile-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scenario-profile-source-row {
    grid-template-columns: 1fr;
  }

  .scenario-profile-start-button {
    width: 100%;
  }
}
/* AUTOTUBE_SCENARIO_PROFILE_MODAL_V19_END */

/* AUTOTUBE_YOUTUBE_CHANNEL_PREVIEW_V21_BEGIN */
.scenario-channel-preview-list {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #e5e7e9;
}

.scenario-channel-preview-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.scenario-channel-preview-title strong {
  font-size: 13px;
  font-weight: 800;
  color: #171a1d;
}

.scenario-channel-preview-title span {
  font-size: 11px;
  color: #838991;
}

.scenario-channel-preview-items {
  display: grid;
  gap: 7px;
}

.scenario-channel-preview-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #e3e5e7;
  border-radius: 11px;
  background: #fafafa;
}

.scenario-channel-preview-rank {
  font-size: 11px;
  font-weight: 800;
  color: #8a9097;
  text-align: center;
}

.scenario-channel-preview-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 650;
  color: #202326;
}

.scenario-channel-preview-views {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
  color: #5f656c;
}

.scenario-profile-analysis-status.is-error {
  color: #b42318;
}

.scenario-profile-analysis-status.is-error .scenario-profile-status-dot {
  background: #b42318;
}
/* AUTOTUBE_YOUTUBE_CHANNEL_PREVIEW_V21_END */

/* AUTOTUBE_SCENARIO_ANALYSIS_PROCESS_V23_BEGIN */

#scenarioProfileAnalysisVisual .scenario-channel-preview-list,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-status {
  display: none !important;
}

#scenarioProfileAnalysisVisual {
  position: relative;
  padding: 24px !important;
  border: 1px solid #dde0e3 !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(249,250,251,.98) 100%) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 10px 30px rgba(18,24,31,.035);
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-heading {
  align-items: center !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-kicker {
  margin-bottom: 7px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .18em !important;
  color: #899099 !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-heading h3 {
  font-size: 21px !important;
  line-height: 1.15 !important;
  font-weight: 800 !important;
  letter-spacing: -.025em !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-percent {
  padding: 7px 10px !important;
  border: 1px solid #e0e3e6 !important;
  border-radius: 11px !important;
  background: #fff !important;
  font-size: 15px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-progress-track {
  height: 5px !important;
  margin-top: 17px !important;
  background: #e9ecef !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-progress-fill {
  background: #111417 !important;
  box-shadow: none !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-grid {
  position: relative;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-top: 19px !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-grid::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 36px;
  height: 1px;
  background: #dfe2e5;
  z-index: 0;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step {
  position: relative !important;
  z-index: 1 !important;
  min-height: 150px !important;
  padding: 14px !important;
  border: 1px solid #e1e4e7 !important;
  border-radius: 17px !important;
  background: rgba(250,251,252,.96) !important;
  box-shadow: none !important;
  transform: none !important;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-icon {
  width: 42px !important;
  height: 42px !important;
  margin-bottom: 18px !important;
  border: 1px solid #dfe2e5 !important;
  border-radius: 13px !important;
  background: #fff !important;
  color: #202428 !important;
  box-shadow: 0 1px 2px rgba(18,24,31,.035) !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 1.75 !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong {
  margin-bottom: 7px !important;
  font-size: 13px !important;
  line-height: 1.18 !important;
  font-weight: 800 !important;
  letter-spacing: -.012em !important;
  color: #171a1d !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step > div:nth-child(2) > span {
  display: block !important;
  max-width: 150px !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  color: #7d848c !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-step-state {
  top: 16px !important;
  right: 16px !important;
  width: 9px !important;
  height: 9px !important;
  border: 2px solid #fff !important;
  border-radius: 999px !important;
  background: #d9dde1 !important;
  box-shadow: 0 0 0 1px #d9dde1 !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done {
  border-color: #cfd4d9 !important;
  background: #fff !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done .scenario-profile-analysis-icon {
  border-color: #202428 !important;
  background: #202428 !important;
  color: #fff !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done .scenario-profile-step-state {
  background: #202428 !important;
  box-shadow: 0 0 0 1px #202428 !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active {
  border-color: #202428 !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(18,24,31,.08) !important;
  transform: translateY(-2px) !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active .scenario-profile-step-state {
  background: #202428 !important;
  box-shadow: 0 0 0 1px #202428, 0 0 0 6px rgba(32,36,40,.08) !important;
  animation: scenarioProcessPulseV23 1.35s ease-in-out infinite !important;
}

@keyframes scenarioProcessPulseV23 {
  0%, 100% { transform: scale(.9); opacity: .75; }
  50% { transform: scale(1.08); opacity: 1; }
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:not(.is-done):not(.is-active) {
  opacity: .86 !important;
}

.scenario-channel-preview-list {
  display: none !important;
}

@media (max-width: 980px) {
  #scenarioProfileAnalysisVisual .scenario-profile-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #scenarioProfileAnalysisVisual .scenario-profile-analysis-grid::before {
    display: none !important;
  }
}

/* AUTOTUBE_SCENARIO_ANALYSIS_PROCESS_V23_END */

/* AUTOTUBE_SCENARIO_PROCESS_CARDS_V28_BEGIN */

/*
  v28:
  - source PNGs are shown in their original 1:1 proportions, without zoom/crop
  - step cards themselves are square to match the source icon files
  - title plaque is ~50% smaller
  - plaque is essentially transparent and behaves like glass
  - all labels stay on one line
*/

#scenarioProfileAnalysisVisual .scenario-profile-analysis-grid {
  align-items: stretch !important;
  gap: 12px !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step {
  position: relative !important;

  aspect-ratio: 1 / 1 !important;
  min-height: 0 !important;
  height: auto !important;

  padding: 0 !important;
  overflow: hidden !important;

  border: 0 !important;
  border-radius: 28px !important;

  background: transparent !important;
  box-shadow: none !important;

  transform: none !important;
}

/* The original PNG itself is the whole card. No zoom, no crop. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step::before {
  content: "" !important;

  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;

  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: contain !important;

  transform: none !important;
}

/* Remove the old dark readability gradient. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step::after {
  display: none !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(1)::before {
  background-image: url("/scenario-icons/neon_glass_play_icon.png?v=50") !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(2)::before {
  background-image: url("/scenario-icons/neon_video_to_transcript_icon.png?v=50") !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(3)::before {
  background-image: url("/scenario-icons/neon_branching_flow_icon.png?v=50") !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(4)::before {
  background-image: url("/scenario-icons/neon_glass_analytics_chart.png?v=50") !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(5)::before {
  background-image: url("/scenario-icons/neon_glass_profile_star_icon.png?v=50") !important;
}

/* Old little SVG holder/descriptions stay gone. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-icon,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step > div:nth-child(2) > span {
  display: none !important;
}

/*
  TRUE transparent glass plaque:
  almost no color fill; the icon remains visible through it.
  The "glass" is created by refraction-like blur/saturation,
  edge highlights and inset reflections rather than gray paint.
*/
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong {
  position: absolute !important;
  left: 50% !important;
  bottom: 11% !important;
  z-index: 5 !important;

  transform: translateX(-50%) !important;
  transform-origin: center center !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: max-content !important;
  max-width: calc(100% - 18px) !important;

  min-height: 28px !important;
  height: 28px !important;

  margin: 0 !important;
  padding: 0 11px !important;

  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;

  border-radius: 999px !important;

  /* Nearly 100% transparent centre. */
  background: rgba(255, 255, 255, 0.015) !important;

  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  outline: 1px solid rgba(20, 28, 38, 0.16) !important;
  outline-offset: -2px !important;

  -webkit-backdrop-filter:
    blur(4px)
    saturate(185%)
    brightness(1.08)
    contrast(1.04) !important;

  backdrop-filter:
    blur(4px)
    saturate(185%)
    brightness(1.08)
    contrast(1.04) !important;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(15, 22, 31, 0.28),
    inset 1px 0 0 rgba(255, 255, 255, 0.30),
    inset -1px 0 0 rgba(255, 255, 255, 0.20),
    0 1px 1px rgba(255, 255, 255, 0.20),
    0 5px 14px rgba(0, 0, 0, 0.16) !important;

  color: rgba(7, 10, 15, 0.96) !important;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 1px rgba(255, 255, 255, 0.18) !important;

  font-size: 12.5px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: -0.018em !important;
  text-align: center !important;
}

/* Small upper glass glint, like the Liquid Glass control. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong::before {
  content: "" !important;
  position: absolute !important;

  left: 10% !important;
  right: 10% !important;
  top: 2px !important;

  height: 40% !important;
  border-radius: 999px !important;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.50) 0%,
      rgba(255, 255, 255, 0.10) 65%,
      rgba(255, 255, 255, 0.00) 100%
    ) !important;

  opacity: 0.55 !important;
  pointer-events: none !important;
}

/* Keep state dot above the image/glass plaque. */
#scenarioProfileAnalysisVisual .scenario-profile-step-state {
  z-index: 7 !important;
  top: 12px !important;
  right: 12px !important;
}

/* v23/v27 active/done rules must not repaint or move our square icon. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* AUTOTUBE_SCENARIO_PROCESS_CARDS_V28_END */

/* AUTOTUBE_SCENARIO_PROCESS_CARDS_V29_BEGIN */

/*
  v29 visual polish:
  - pure white labels
  - no white text shadow
  - remove blurry blob behind text
  - brighter clean glass plaque
  - subtle iridescent glass edge reflections
  - source PNG cards/icons at 100% opacity
  - stronger saturation/brightness
  - only a tiny soft shadow behind PNG artwork
*/

/* Never dim inactive cards: source PNG must stay at full opacity. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:not(.is-done):not(.is-active),
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done {
  opacity: 1 !important;
}

/* PNG artwork: fully opaque, vivid and clean. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step::before {
  opacity: 1 !important;

  filter:
    saturate(1.42)
    brightness(1.14)
    contrast(1.06)
    drop-shadow(0 2px 3px rgba(7, 15, 28, 0.20))
    !important;
}

/* Main title glass plaque. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong {
  color: #ffffff !important;
  opacity: 1 !important;

  text-shadow: none !important;
  -webkit-text-stroke: 0 transparent !important;

  /*
    Keep the plaque transparent/glassy, but do NOT blur the artwork
    behind the text. The glass impression now comes from highlights,
    reflections and edge refraction instead of backdrop blur.
  */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.30) 0%,
      rgba(255, 255, 255, 0.15) 45%,
      rgba(255, 255, 255, 0.19) 100%
    ),
    linear-gradient(
      105deg,
      rgba(65, 236, 255, 0.17) 0%,
      rgba(116, 178, 255, 0.12) 27%,
      rgba(194, 116, 255, 0.14) 51%,
      rgba(255, 121, 192, 0.12) 74%,
      rgba(105, 255, 219, 0.14) 100%
    ) !important;

  border: 1px solid rgba(255, 255, 255, 0.78) !important;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(255, 255, 255, 0.30),
    inset 1px 0 0 rgba(255, 255, 255, 0.20),
    inset -1px 0 0 rgba(255, 255, 255, 0.18),
    0 4px 11px rgba(4, 10, 22, 0.16)
    !important;

  overflow: hidden !important;
  isolation: isolate !important;
}

/*
  Replace old large white blurred/glowing area with a thin
  iridescent glass edge only.
*/
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong::before {
  content: "" !important;

  position: absolute !important;
  inset: 0 !important;

  width: auto !important;
  height: auto !important;

  border-radius: inherit !important;
  padding: 1px !important;

  background:
    linear-gradient(
      105deg,
      rgba(255,255,255,0.96) 0%,
      rgba(99,240,255,0.86) 18%,
      rgba(126,174,255,0.74) 34%,
      rgba(203,127,255,0.78) 52%,
      rgba(255,139,201,0.70) 69%,
      rgba(122,255,219,0.74) 85%,
      rgba(255,255,255,0.94) 100%
    ) !important;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0) !important;
  -webkit-mask-composite: xor !important;

  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0) !important;
  mask-composite: exclude !important;

  opacity: 0.72 !important;

  filter: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  pointer-events: none !important;
  z-index: 0 !important;
}

/* Tiny sharp specular reflection on the upper glass edge. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong::after {
  content: "" !important;

  position: absolute !important;
  left: 13% !important;
  right: 13% !important;
  top: 2px !important;

  width: auto !important;
  height: 1px !important;

  border-radius: 999px !important;

  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.78) 20%,
      rgba(112,241,255,0.90) 38%,
      rgba(255,255,255,0.96) 51%,
      rgba(207,142,255,0.80) 66%,
      rgba(255,255,255,0.62) 82%,
      rgba(255,255,255,0) 100%
    ) !important;

  opacity: 0.82 !important;

  filter: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  pointer-events: none !important;
  z-index: 0 !important;
}

/* AUTOTUBE_SCENARIO_PROCESS_CARDS_V29_END */

/* AUTOTUBE_SCENARIO_ICONS_MONO_V30_BEGIN */
/* artwork-only update: #111417 deep black + #FAFBFC off-white */
/* AUTOTUBE_SCENARIO_ICONS_MONO_V30_END */

/* AUTOTUBE_SCENARIO_TEXT_PLAQUE_REMOVE_V31_BEGIN */
/* Use the new full-image cards and remove the old liquid-glass title plaque. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step strong::after {
  display: none !important;
  content: none !important;
}
/* AUTOTUBE_SCENARIO_TEXT_PLAQUE_REMOVE_V31_END */

/* AUTOTUBE_SCENARIO_ICONS_STATE_PATCH_V32_BEGIN */
/* v32 fixed: alignment + states */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-grid {
  align-items: start !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step {
  opacity: 1 !important;
}

/* Remove small legacy button/dot in top-right corner. */
#scenarioProfileAnalysisVisual .scenario-profile-step-state {
  display: none !important;
}

/* Keep all PNG cards on one optical baseline. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step::before {
  background-size: 96% auto !important;
  background-repeat: no-repeat !important;
  background-position: center 49% !important;
  opacity: 1 !important;
  transform: none !important;
  transition: filter .18s ease, opacity .18s ease, transform .18s ease !important;
}

/* Not started yet: gray and quieter. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:not(.is-active):not(.is-done)::before {
  filter: grayscale(1) saturate(0) brightness(.96) contrast(.92) opacity(.68) !important;
}

/* Active: full appearance + soft emphasis. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::before {
  filter:
    grayscale(0)
    saturate(1)
    brightness(1.04)
    contrast(1.03)
    drop-shadow(0 8px 18px rgba(17,20,23,.20))
    !important;
  transform: translateY(-1px) !important;
}

/* Done: normal appearance + green contour following PNG alpha pixels. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done::before {
  filter:
    grayscale(0)
    saturate(1)
    brightness(1)
    contrast(1)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 5px 12px rgba(46,190,107,.16))
    !important;
}

/* Transitional active+done state. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done.is-active::before {
  filter:
    grayscale(0)
    saturate(1)
    brightness(1.04)
    contrast(1.03)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 8px 18px rgba(17,20,23,.20))
    !important;
}
/* AUTOTUBE_SCENARIO_ICONS_STATE_PATCH_V32_END */

/* AUTOTUBE_SCENARIO_FIRST_ICON_FIX_V33_BEGIN */
/* v33 fixed: final first icon + optical scale correction */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(1)::before {
  background-size: 92% auto !important;
  background-position: center 49% !important;
}
/* AUTOTUBE_SCENARIO_FIRST_ICON_FIX_V33_END */

/* AUTOTUBE_SCENARIO_UNIFORM_PULSE_PATCH_V34_BEGIN */
/* v34: force all 5 icons to the same visual scale/alignment and add active green pulse */

/* Uniform container geometry */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-grid {
  align-items: start !important;
}
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step {
  position: relative !important;
  opacity: 1 !important;
  animation: none !important;
  box-shadow: none !important;
}

/* Remove any legacy top-right state chip/dot if still present */
#scenarioProfileAnalysisVisual .scenario-profile-step-state {
  display: none !important;
}

/* Force identical icon placement for all 5 steps */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step::before {
  background-repeat: no-repeat !important;
  background-position: center 49% !important;
  background-size: 94% auto !important;
  transform: none !important;
  opacity: 1 !important;
  transition: filter .24s ease, opacity .24s ease, transform .24s ease !important;
}
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(1)::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(2)::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(3)::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(4)::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(5)::before {
  background-repeat: no-repeat !important;
  background-position: center 49% !important;
  background-size: 94% auto !important;
}

/* Not active yet */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:not(.is-active):not(.is-done)::before {
  filter: grayscale(1) saturate(0) brightness(0.965) contrast(0.93) opacity(0.70) !important;
}

/* Done */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done::before {
  filter:
    saturate(1)
    grayscale(0)
    brightness(1)
    contrast(1)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 5px 12px rgba(46, 190, 107, 0.16))
    !important;
}

/* Active pulse around the current step */
@keyframes autotubeScenarioActivePulseV34 {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 190, 107, 0.24), 0 0 0 0 rgba(46, 190, 107, 0.16);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(46, 190, 107, 0.14), 0 0 18px 2px rgba(46, 190, 107, 0.16);
  }
  75% {
    box-shadow: 0 0 0 10px rgba(46, 190, 107, 0.04), 0 0 22px 3px rgba(46, 190, 107, 0.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 190, 107, 0), 0 0 0 0 rgba(46, 190, 107, 0);
  }
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active {
  animation: autotubeScenarioActivePulseV34 1.85s ease-out infinite !important;
  border-radius: 22px !important;
}
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::before {
  filter:
    saturate(1)
    grayscale(0)
    brightness(1.02)
    contrast(1.02)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 6px 16px rgba(46, 190, 107, 0.20))
    !important;
}

/* If already done and currently active, keep full-color green outline + pulse */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done.is-active::before {
  filter:
    saturate(1)
    grayscale(0)
    brightness(1.02)
    contrast(1.02)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 6px 16px rgba(46, 190, 107, 0.20))
    !important;
}

/* AUTOTUBE_SCENARIO_UNIFORM_PULSE_PATCH_V34_END */

/* AUTOTUBE_SCENARIO_FIRST_ICON_UPDATE_V35_BEGIN */
/* v35: updated rounded first icon asset */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:nth-child(1)::before {
  background-size: 94% auto !important;
  background-position: center 49% !important;
}
/* AUTOTUBE_SCENARIO_FIRST_ICON_UPDATE_V35_END */

/* AUTOTUBE_SCENARIO_ACTIVE_PULSE_BOOST_V36_BEGIN */
/* v36: make the active step pulse much more clearly than completed steps */

/* Replace the previous pulse with a stronger, more visible pulse. */
@keyframes autotubeScenarioActivePulseV36 {
  0% {
    box-shadow:
      0 0 0 0 rgba(46, 190, 107, 0.48),
      0 0 0 0 rgba(46, 190, 107, 0.22),
      0 0 10px 2px rgba(46, 190, 107, 0.18);
  }
  35% {
    box-shadow:
      0 0 0 10px rgba(46, 190, 107, 0.24),
      0 0 18px 4px rgba(46, 190, 107, 0.18),
      0 0 28px 8px rgba(46, 190, 107, 0.12);
  }
  70% {
    box-shadow:
      0 0 0 16px rgba(46, 190, 107, 0.06),
      0 0 24px 6px rgba(46, 190, 107, 0.08),
      0 0 34px 10px rgba(46, 190, 107, 0.04);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(46, 190, 107, 0),
      0 0 0 0 rgba(46, 190, 107, 0),
      0 0 0 0 rgba(46, 190, 107, 0);
  }
}

/* Active step gets a stronger animated halo + brighter green edge. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active {
  border-radius: 22px !important;
  animation: autotubeScenarioActivePulseV36 1.25s cubic-bezier(.22,.61,.36,1) infinite !important;
  z-index: 3 !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::before {
  filter:
    saturate(1)
    grayscale(0)
    brightness(1.03)
    contrast(1.03)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 0 10px rgba(46, 190, 107, 0.26))
    drop-shadow(0 6px 18px rgba(46, 190, 107, 0.24))
    !important;
}

/* If a step is done but not active, keep it calmer so active remains clearly distinguishable. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done:not(.is-active)::before {
  filter:
    saturate(1)
    grayscale(0)
    brightness(1)
    contrast(1)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 3px 8px rgba(46, 190, 107, 0.10))
    !important;
}

/* AUTOTUBE_SCENARIO_ACTIVE_PULSE_BOOST_V36_END */

/* AUTOTUBE_SCENARIO_VISIBLE_ACTIVE_GLOW_V37_BEGIN */
/* v37: animate the PNG layer itself so the green pulse cannot be clipped by container overflow */

@keyframes autotubeScenarioActiveGlowV37 {
  0%, 100% {
    filter:
      saturate(1)
      grayscale(0)
      brightness(1.02)
      contrast(1.02)
      drop-shadow(0 0 0 #2EBE6B)
      drop-shadow(1px 0 0 #2EBE6B)
      drop-shadow(-1px 0 0 #2EBE6B)
      drop-shadow(0 1px 0 #2EBE6B)
      drop-shadow(0 -1px 0 #2EBE6B)
      drop-shadow(0 0 5px rgba(46,190,107,.22));
    transform: scale(1);
  }
  35% {
    filter:
      saturate(1)
      grayscale(0)
      brightness(1.035)
      contrast(1.025)
      drop-shadow(0 0 0 #2EBE6B)
      drop-shadow(1px 0 0 #2EBE6B)
      drop-shadow(-1px 0 0 #2EBE6B)
      drop-shadow(0 1px 0 #2EBE6B)
      drop-shadow(0 -1px 0 #2EBE6B)
      drop-shadow(0 0 8px rgba(46,190,107,.48))
      drop-shadow(0 0 16px rgba(46,190,107,.34))
      drop-shadow(0 0 28px rgba(46,190,107,.22));
    transform: scale(1.012);
  }
  65% {
    filter:
      saturate(1)
      grayscale(0)
      brightness(1.03)
      contrast(1.02)
      drop-shadow(0 0 0 #2EBE6B)
      drop-shadow(1px 0 0 #2EBE6B)
      drop-shadow(-1px 0 0 #2EBE6B)
      drop-shadow(0 1px 0 #2EBE6B)
      drop-shadow(0 -1px 0 #2EBE6B)
      drop-shadow(0 0 6px rgba(46,190,107,.34))
      drop-shadow(0 0 13px rgba(46,190,107,.22));
    transform: scale(1.006);
  }
}

/* Disable the old card-box animation; the pulse now follows the PNG/card shape itself. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active {
  animation: none !important;
  box-shadow: none !important;
  z-index: 4 !important;
}

/* Active = obvious animated green halo around the PNG itself. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::before {
  animation: autotubeScenarioActiveGlowV37 1.35s ease-in-out infinite !important;
  transform-origin: center center !important;
  will-change: filter, transform !important;
}

/* Completed but not active = static green edge only, no pulse. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done:not(.is-active)::before {
  animation: none !important;
  filter:
    saturate(1)
    grayscale(0)
    brightness(1)
    contrast(1)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 3px 7px rgba(46,190,107,.10))
    !important;
}

/* AUTOTUBE_SCENARIO_VISIBLE_ACTIVE_GLOW_V37_END */

/* AUTOTUBE_SCENARIO_ACTIVE_RING_PULSE_V38_BEGIN */
/* v38: move the active pulse to a dedicated ::after ring. */
/* This avoids the old !important filter rules that blocked the v37 keyframe. */

@keyframes autotubeScenarioActiveRingV38 {
  0% {
    opacity: 0;
    transform: scale(0.985);
    box-shadow: 0 0 0 0 rgba(46,190,107,.00), 0 0 8px rgba(46,190,107,.00);
  }
  14% {
    opacity: .90;
    transform: scale(1.00);
    box-shadow: 0 0 0 2px rgba(46,190,107,.34), 0 0 12px rgba(46,190,107,.24);
  }
  48% {
    opacity: .58;
    transform: scale(1.045);
    box-shadow: 0 0 0 5px rgba(46,190,107,.18), 0 0 18px rgba(46,190,107,.18);
  }
  78% {
    opacity: .20;
    transform: scale(1.085);
    box-shadow: 0 0 0 8px rgba(46,190,107,.07), 0 0 24px rgba(46,190,107,.10);
  }
  100% {
    opacity: 0;
    transform: scale(1.105);
    box-shadow: 0 0 0 10px rgba(46,190,107,0), 0 0 28px rgba(46,190,107,0);
  }
}

/* Stop the v37 animation on the image itself. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::before {
  animation: none !important;
  transform: none !important;
}

/* Let the pulse extend a little outside the active card. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active {
  overflow: visible !important;
  z-index: 8 !important;
  animation: none !important;
  box-shadow: none !important;
}

/* The dedicated animated pulse ring. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 2.5% !important;
  z-index: 9 !important;
  pointer-events: none !important;
  border-radius: 24px !important;
  border: 2px solid rgba(46,190,107,.88) !important;
  background: transparent !important;
  filter: none !important;
  transform-origin: center center !important;
  animation: autotubeScenarioActiveRingV38 1.55s cubic-bezier(.20,.68,.34,1) infinite !important;
  will-change: transform, opacity, box-shadow !important;
}

/* Completed stages stay static: no pulse ring. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done:not(.is-active)::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

/* Active stage keeps a brighter static green edge underneath the animated ring. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::before {
  filter:
    saturate(1)
    grayscale(0)
    brightness(1.03)
    contrast(1.025)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 0 7px rgba(46,190,107,.18))
    !important;
}

/* AUTOTUBE_SCENARIO_ACTIVE_RING_PULSE_V38_END */

/* AUTOTUBE_SCENARIO_STATE_BRIDGE_V39_BEGIN */
/* v39: pulse is driven by a dedicated JS-managed class, not only native .is-active. */

@keyframes autotubeScenarioBridgePulseV39 {
  0% {
    opacity: 0;
    transform: scale(.985);
    box-shadow: 0 0 0 0 rgba(46,190,107,0), 0 0 8px rgba(46,190,107,0);
  }
  15% {
    opacity: .95;
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(46,190,107,.44), 0 0 13px rgba(46,190,107,.30);
  }
  48% {
    opacity: .62;
    transform: scale(1.045);
    box-shadow: 0 0 0 6px rgba(46,190,107,.22), 0 0 20px rgba(46,190,107,.22);
  }
  78% {
    opacity: .22;
    transform: scale(1.085);
    box-shadow: 0 0 0 9px rgba(46,190,107,.08), 0 0 27px rgba(46,190,107,.12);
  }
  100% {
    opacity: 0;
    transform: scale(1.11);
    box-shadow: 0 0 0 11px rgba(46,190,107,0), 0 0 30px rgba(46,190,107,0);
  }
}

/* Disable v38's native-active ring. v39 owns the pulse state. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-pulse-active {
  overflow: visible !important;
  z-index: 20 !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-pulse-active::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 2.5% !important;
  z-index: 21 !important;
  pointer-events: none !important;
  border-radius: 24px !important;
  border: 2px solid rgba(46,190,107,.94) !important;
  background: transparent !important;
  filter: none !important;
  transform-origin: center center !important;
  animation: autotubeScenarioBridgePulseV39 1.45s cubic-bezier(.20,.68,.34,1) infinite !important;
  will-change: transform, opacity, box-shadow !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-pulse-active::before {
  filter:
    saturate(1)
    grayscale(0)
    brightness(1.03)
    contrast(1.025)
    drop-shadow(0 0 0 #2EBE6B)
    drop-shadow(1px 0 0 #2EBE6B)
    drop-shadow(-1px 0 0 #2EBE6B)
    drop-shadow(0 1px 0 #2EBE6B)
    drop-shadow(0 -1px 0 #2EBE6B)
    drop-shadow(0 0 8px rgba(46,190,107,.20))
    !important;
}

/* AUTOTUBE_SCENARIO_STATE_BRIDGE_V39_END */

/* AUTOTUBE_SCENARIO_STATIC_FRAME_UNDER_GLOW_V48_BEGIN */
/* v48:
   1) active artwork is full black/white;
   2) green frame is completely static;
   3) ONLY the glow underneath pulses;
   4) old SVG icon container is reused as a cheap glow-only layer;
   5) removes white/bright strip artifacts from the pulse layer. */

@keyframes autotubeScenarioGlowOnlyV48 {
  0%, 100% { opacity: .16; }
  48% { opacity: .90; }
  68% { opacity: .58; }
}

/* Future stages stay gray. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step:not(.is-active):not(.is-done):not(.autotube-pulse-active):not(.autotube-latest-green)::before {
  filter: grayscale(1) saturate(0) brightness(.965) contrast(.93) opacity(.70) !important;
}

/* Active/current stage becomes normal black/white immediately. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-pulse-active::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-latest-green::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done::before {
  filter: grayscale(0) saturate(1) brightness(1) contrast(1) opacity(1) !important;
  animation: none !important;
  transform: none !important;
}

/* Repurpose the old hidden SVG holder as a glow layer BELOW the PNG and frame. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-icon {
  display: none !important;
}
#scenarioProfileAnalysisVisual .scenario-profile-analysis-icon svg {
  display: none !important;
}

#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active .scenario-profile-analysis-icon,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-pulse-active .scenario-profile-analysis-icon,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-latest-green .scenario-profile-analysis-icon {
  display: block !important;
  position: absolute !important;
  inset: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  pointer-events: none !important;
  z-index: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 27px !important;
  background: transparent !important;
  color: transparent !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  /* Static glow geometry. Only opacity changes frame-to-frame. */
  box-shadow:
    0 0 10px 3px rgba(46,190,107,.28),
    0 0 20px 8px rgba(46,190,107,.16),
    0 0 32px 13px rgba(46,190,107,.08) !important;
  will-change: opacity !important;
  animation: autotubeScenarioGlowOnlyV48 1.85s ease-in-out infinite !important;
}

/* PNG/image layer stays above the glow. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step::before {
  z-index: 1 !important;
}

/* Static green frame ABOVE both glow and PNG. Never pulses. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active::after,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-pulse-active::after,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-latest-green::after,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  z-index: 3 !important;
  border-radius: 27px !important;
  background: transparent !important;
  border: 2px solid rgba(46,190,107,.95) !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  opacity: 1 !important;
  will-change: auto !important;
  animation: none !important;
}

/* The host itself remains static and unclipped. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-active,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-pulse-active,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.autotube-latest-green,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step.is-done {
  position: relative !important;
  overflow: visible !important;
  isolation: isolate !important;
  box-shadow: none !important;
  transform: none !important;
  animation: none !important;
}

/* AUTOTUBE_SCENARIO_STATIC_FRAME_UNDER_GLOW_V48_END */

/* AUTOTUBE_SCENARIO_BLACK_CLEAN_EDGES_V50_BEGIN */
/* v50:
   - current/pulsing card must be full black/white immediately;
   - completed cards stay full black/white;
   - future cards remain gray;
   - edge-cleaned PNGs remove micro white resampling strips. */

/* Future only = gray. Explicitly exclude every pulse/current helper state. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step]
:not(.is-active):not(.is-done):not(.autotube-pulse-active):not(.autotube-latest-green)::before {
  filter: grayscale(1) saturate(0) brightness(.965) contrast(.93) opacity(.70) !important;
  opacity: 1 !important;
}

/* Current/pulsing = immediately restore original black/white PNG. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-active::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-pulse-active::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-latest-green::before,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-done::before {
  filter: grayscale(0) saturate(1) brightness(1) contrast(1) opacity(1) !important;
  opacity: 1 !important;
}

/* Prevent older parent-opacity rules from washing out an active or completed card. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-active,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-pulse-active,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-latest-green,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-done {
  opacity: 1 !important;
}

/* AUTOTUBE_SCENARIO_BLACK_CLEAN_EDGES_V50_END */

/* AUTOTUBE_SCENARIO_DONE_GREEN_RESTORE_V51_BEGIN */
/* v51:
   Restore the static green frame for every completed stage.
   Keep the current v48/v50 behavior for the active pulsing stage.
   This block is intentionally high-specificity so older gray/inactive rules cannot win. */

/* Completed stages must stay full black/white. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-done::before {
  filter: grayscale(0) saturate(1) brightness(1) contrast(1) opacity(1) !important;
  opacity: 1 !important;
}

/* Completed stages keep the static green outline after finishing. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-done::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  z-index: 3 !important;
  border-radius: 27px !important;
  background: transparent !important;
  border: 2px solid rgba(46,190,107,.95) !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  opacity: 1 !important;
  animation: none !important;
}

/* Active/current stage still keeps the same static frame + pulsing under-glow. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-active::after,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-pulse-active::after,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-latest-green::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  z-index: 3 !important;
  border-radius: 27px !important;
  background: transparent !important;
  border: 2px solid rgba(46,190,107,.95) !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  opacity: 1 !important;
}

/* Make sure completed/current cards remain fully visible. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-done,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].is-active,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-pulse-active,
#scenarioProfileAnalysisVisual .scenario-profile-analysis-step[data-analysis-step].autotube-latest-green {
  opacity: 1 !important;
}

/* AUTOTUBE_SCENARIO_DONE_GREEN_RESTORE_V51_END */

/* AUTOTUBE_CHANNEL_TRANSCRIPTS_V24_BEGIN */

/* No debug/video list in the profile-analysis UI. */
.scenario-channel-preview-list {
  display: none !important;
}

/* The process itself is the UI; hide the old technical status line. */
#scenarioProfileAnalysisVisual .scenario-profile-analysis-status {
  display: none !important;
}

/* A compact error is shown only when acquisition actually fails. */
.scenario-transcript-acquisition-error {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #ead6d4;
  border-radius: 12px;
  background: #fffafa;
  color: #9b2c24;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}

/* AUTOTUBE_CHANNEL_TRANSCRIPTS_V24_END */

/* AUTOTUBE_THUMBNAIL_SCENARIO_MODAL_V8 */
/* Reuse the existing scenario profile modal's structure, spacing, progress and steps. */
.thumbnail-style-scenario-modal {
  width: min(980px, calc(100vw - 42px));
  max-width: min(980px, calc(100vw - 42px));
  max-height: min(760px, calc(100vh - 42px));
  padding: 0;
  margin: auto;
  overflow: auto;
  border: 1px solid rgba(210, 214, 218, .95);
  border-radius: 30px;
  background: rgba(250, 250, 251, .98);
  color: #111417;
  box-shadow: 0 28px 80px rgba(31,37,43,.20), 0 2px 10px rgba(31,37,43,.05);
}
.thumbnail-style-scenario-modal::backdrop {
  background: rgba(236,239,242,.55);
  -webkit-backdrop-filter: blur(20px) saturate(118%);
  backdrop-filter: blur(20px) saturate(118%);
}
.thumbnail-style-scenario-modal .thumbnail-style-scenario-form {display: block; padding: 0; margin: 0; gap: 0; background: transparent; color: #111417;}
.thumbnail-style-scenario-modal .scenario-profile-modal-header {padding: 28px 30px 22px;}
.thumbnail-style-scenario-modal .scenario-profile-modal-header p {color: #717780; margin: 8px 0 0;}
.thumbnail-style-scenario-modal .scenario-profile-modal-close {color: #15181b; background: #fff;}
.thumbnail-style-scenario-modal .scenario-profile-modal-body {max-height: none; padding: 26px 30px 30px;}
.thumbnail-style-scenario-modal .scenario-profile-source-card {display: block; background: #fff; padding: 22px;}
.thumbnail-style-scenario-modal .scenario-profile-source-label {color: #171a1d; margin-bottom: 10px;}
.thumbnail-style-scenario-modal .thumbnail-style-url-label {margin-top: 20px;}
.thumbnail-style-scenario-modal .thumbnail-style-form input,
.thumbnail-style-scenario-modal .thumbnail-style-name-input {
  width: 100%; min-height: 52px; box-sizing: border-box;
  border: 1px solid #d8dade; border-radius: 15px;
  background: #fafafa; padding: 0 15px; color: #111417;
  outline: none; font: inherit; font-size: 15px; font-weight: 600;
}
.thumbnail-style-scenario-modal .scenario-profile-url-field {background: #fafafa;}
.thumbnail-style-scenario-modal .scenario-profile-url-field input {
  min-height: 40px; height: 40px; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none;
}
.thumbnail-style-scenario-modal .thumbnail-style-form input:focus,
.thumbnail-style-scenario-modal .thumbnail-style-name-input:focus {outline: none; border-color: #111417; box-shadow: 0 0 0 3px rgba(17,20,23,.07);}
.thumbnail-style-scenario-modal .scenario-profile-url-field input:focus {border: 0; box-shadow: none;}
.thumbnail-style-scenario-modal .scenario-profile-source-hint {color: #858b93; margin: 10px 2px 0; font-weight: 500;}
.thumbnail-style-scenario-modal .thumbnail-style-start-button {
  display: block; width: 100%; margin-top: 20px; border-radius: 15px;
  background: #050505; color: #fff; font-size: 14px; font-weight: 750;
}
.thumbnail-style-scenario-modal .thumbnail-style-start-button:disabled {opacity: .34; cursor: default;}
.thumbnail-style-scenario-modal .scenario-profile-analysis-visual {display: none; background: #fff; margin-top: 18px; padding: 22px;}
.thumbnail-style-scenario-modal .scenario-profile-analysis-visual.is-visible {display: block;}
.thumbnail-style-scenario-modal .thumbnail-style-analysis-grid {grid-template-columns: repeat(4, minmax(0,1fr));}
.thumbnail-style-scenario-modal .thumbnail-style-message {display: none; margin: 15px 0 0; min-height: 0; padding: 12px 14px; border: 1px solid #e0e2e4; border-radius: 12px; background: #f8f8f9; color: #333840; font-size: 13px; line-height: 1.45; font-weight: 650;}
.thumbnail-style-scenario-modal .thumbnail-style-message.is-error {display: block; border-color: #e5c6c6; background: #fff6f6; color: #983333;}
.thumbnail-style-scenario-modal .thumbnail-style-scenario-form.is-refresh .thumbnail-style-source-card {display: none;}
.thumbnail-style-scenario-modal .thumbnail-style-scenario-form.is-refresh .scenario-profile-analysis-visual {margin-top: 0;}
.thumbnail-style-scenario-modal .scenario-profile-analysis-visual.is-error .scenario-profile-status-dot {background: #983333; animation: none;}
@media(max-width:700px) {
  .thumbnail-style-scenario-modal {width: calc(100vw - 20px); max-width: calc(100vw - 20px); border-radius: 20px;}
  .thumbnail-style-scenario-modal .scenario-profile-modal-header {padding: 20px 18px;}
  .thumbnail-style-scenario-modal .scenario-profile-modal-header h2 {font-size: 22px;}
  .thumbnail-style-scenario-modal .scenario-profile-modal-body {padding: 18px;}
  .thumbnail-style-scenario-modal .thumbnail-style-analysis-grid {grid-template-columns: repeat(2,minmax(0,1fr));}
}

/* AUTOTUBE_THUMBNAIL_CUSTOM_ONLY_DELETE_V9 */
.thumbnail-style-refresh-button,
.thumbnail-style-delete-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 7px 12px 0 0;
  padding: 4px 1px;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.thumbnail-style-delete-button { color: #a23c3c !important; }
.thumbnail-style-refresh-button[hidden],
.thumbnail-style-delete-button[hidden] { display: none !important; }
.thumbnail-style-refresh-button:disabled,
.thumbnail-style-delete-button:disabled { opacity: .5; cursor: wait; }
/* AUTOTUBE_THUMBNAIL_CUSTOM_ONLY_DELETE_V9_END */

/* AUTOTUBE_THUMBNAIL_STYLE_DROPDOWN_V10 */
.packaging-style-control { position: relative !important; min-width:0 !important; }
.packaging-style-control select.thumbnail-style-v10-native-hidden {display:none!important;}
.thumbnail-style-v10-picker {width:100%;min-width:0;}
.thumbnail-style-v10-trigger {
  box-sizing:border-box!important;width:100%!important;min-width:0!important;
  height:40px!important;min-height:40px!important;margin:0!important;
  padding:0 10px!important;border-radius:12px;border:1px solid #d9dce0;
  background:#fafbfc;color:#131619;cursor:pointer;
  display:flex!important;align-items:center;justify-content:space-between!important;
  gap:8px;text-align:left!important;font-size:12px!important;font-weight:650;
}
.thumbnail-style-v10-caption {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;}
.thumbnail-style-v10-chevron {flex:0 0 auto;font-size:18px;font-weight:400;color:#62666b;}
.thumbnail-style-v10-trigger:focus-visible,.thumbnail-style-v10-choose:focus-visible,
.thumbnail-style-v10-trash:focus-visible,.thumbnail-style-v10-add:focus-visible {outline:2px solid #3976d9;outline-offset:2px;}
.thumbnail-style-v10-menu {
  position:fixed;z-index:2147482000;box-sizing:border-box;overflow-y:auto;
  padding:6px;border:1px solid #d3d6da;border-radius:13px;
  background:#fff;color:#131619;box-shadow:0 15px 32px rgba(20,26,35,.20);
}
.thumbnail-style-v10-menu[hidden] {display:none!important;}
.thumbnail-style-v10-rows {display:flex;flex-direction:column;gap:2px;}
.thumbnail-style-v10-row {display:flex;align-items:center;gap:4px;min-height:36px;border-radius:8px;}
.thumbnail-style-v10-row:has([aria-checked="true"]) {background:#edf2f9;}
.thumbnail-style-v10-choose {
  flex:1;min-width:0;text-align:left;border:0;border-radius:8px;
  background:transparent;color:inherit;padding:9px 11px;
  font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;
}
.thumbnail-style-v10-trash {
  display:flex;align-items:center;justify-content:center;
  flex:0 0 32px;width:32px;height:32px;padding:6px;
  border:0;border-radius:8px;background:transparent;color:#858b93;cursor:pointer;
}
.thumbnail-style-v10-trash svg {display:block;width:17px;height:17px;}
.thumbnail-style-v10-trash:hover {background:#fff0ef;color:#aa3535;}
.thumbnail-style-v10-row:hover {background:#f1f3f5;}
.thumbnail-style-v10-footer {margin-top:5px;padding-top:5px;border-top:1px solid #e6e8ec;display:flex;flex-direction:column;gap:2px;}
.thumbnail-style-v10-menu .thumbnail-style-refresh-button,
.thumbnail-style-v10-add {
  box-sizing:border-box!important;width:100%!important;min-height:36px!important;
  padding:8px 11px!important;margin:0!important;border:0!important;
  background:transparent!important;color:#181a1d!important;
  display:flex!important;align-items:center;justify-content:flex-start!important;
  font-size:13px!important;font-weight:650!important;text-align:left!important;cursor:pointer;
  border-radius:8px;
}
.thumbnail-style-v10-menu .thumbnail-style-refresh-button[hidden] {display:none!important;}
.thumbnail-style-v10-menu .thumbnail-style-refresh-button:hover,.thumbnail-style-v10-add:hover {background:#f1f3f5!important;}
.thumbnail-style-v10-empty {padding:9px 11px;margin:0;color:#7c828a;font-size:12px;}
html[data-autotube-theme="dark"] .thumbnail-style-v10-menu {background:#23262a;color:#eef0f2;border-color:#4b4e52;}
html[data-autotube-theme="dark"] .thumbnail-style-v10-trigger {background:#292d32;color:#edf0f2;border-color:#555b62;}
html[data-autotube-theme="dark"] .thumbnail-style-v10-row:hover,
html[data-autotube-theme="dark"] .thumbnail-style-v10-row:has([aria-checked="true"]),
html[data-autotube-theme="dark"] .thumbnail-style-v10-menu .thumbnail-style-refresh-button:hover,
html[data-autotube-theme="dark"] .thumbnail-style-v10-add:hover {background:#3c434a!important;}
html[data-autotube-theme="dark"] .thumbnail-style-v10-menu .thumbnail-style-refresh-button,
html[data-autotube-theme="dark"] .thumbnail-style-v10-add {color:#edf0f2!important;}
/* AUTOTUBE_THUMBNAIL_STYLE_DROPDOWN_V10_END */
/* AUTOTUBE_THUMBNAIL_DROPDOWN_RETRY_V11 */
.packaging-style-control > select#packagingStyleSelect {display:none !important;}
.thumbnail-style-v10-menu[hidden] {display:none !important;}
.thumbnail-style-v10-menu .thumbnail-style-v10-trash {display:flex !important;}
/* AUTOTUBE_THUMBNAIL_DROPDOWN_RETRY_V11_END */
