@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;700;900&display=swap');
/*
 * AUTOTUBE FACTORY / PRIVATE VISUAL V3 / COMMERCIAL EDITION
 * USER1 ONLY. Visual CSS. No application behavior, routes or API changes.
 * Authored against inspected index.html, styles.css, factory-managed.css.
 * The preexisting light-mode V60/V64/V2 rules use !important. This private
 * stylesheet loads last and selectively overrides their presentation.
 * Layout-critical display, visibility, positioning and workflow sizing kept.
 */
:root {
  --at3-red: #F00016;
  --at3-red-hover: #D70015;
  --at3-black: #101011;
  --at3-paper: #FFFFFF;
  --at3-bg: #F4F4F2;
  --at3-soft: #FAFAF9;
  --at3-line: #E7E7E5;
  --at3-muted: #747477;
  --at3-shadow: 0 12px 32px rgba(23,23,25,.055);
  --at3-heading: 'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  --at3-ui: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

/* 01 / Clean monotone canvas and typography */
html:not([data-autotube-theme="dark"]) body {
  background: var(--at3-bg) !important;
  background-image: none !important;
  color: var(--at3-black) !important;
  font-family: var(--at3-ui) !important;
  -webkit-font-smoothing: antialiased;
}
html:not([data-autotube-theme="dark"]) body :is(button,input,select,textarea) {
  font-family: var(--at3-ui) !important;
}
html:not([data-autotube-theme="dark"]) body :is(h1,h2,h3,h4,.card-heading strong,.voice-column-heading strong,.factory-templates-heading h2) {
  font-family: var(--at3-heading) !important;
  letter-spacing: -.034em !important;
  color: var(--at3-black) !important;
}
html:not([data-autotube-theme="dark"]) body :is(.eyebrow,.card-kicker,.counter,.connection,.factory-templates-heading p) {
  color: var(--at3-muted) !important;
}

/* 02 / Signature brand header; header controls remain in their native positions */
html:not([data-autotube-theme="dark"]) body header.topbar:not(#atv-head-a):not(#atv-head-b) {
  background: var(--at3-paper) !important;
  background-image: none !important;
  border: 1px solid var(--at3-line) !important;
  border-radius: 20px !important;
  min-height: 60px !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.04) !important;
}
html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1 {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 11px !important;
  margin: 0 !important;
  font-family: var(--at3-heading) !important;
  font-size: clamp(20px,1.7vw,24px) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: -.046em !important;
}
html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1::before {
  content: '▶' !important;
  display: inline-flex !important;
  flex: 0 0 36px !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 0 0 2px !important;
  border-radius: 11px !important;
  background: var(--at3-red) !important;
  color: #FFF !important;
  font-family: 'Inter',sans-serif !important;
  font-size: 16px !important;
  line-height: 1 !important;
  box-shadow: 0 6px 15px rgba(240,0,22,.17) !important;
}
html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1 span,
html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1 strong {
  color: var(--at3-black) !important;
  font-family: var(--at3-heading) !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}
html:not([data-autotube-theme="dark"]) body :is(.factory-user-trigger,.factory-theme-toggle,.factory-admin-panel-button,.icon-button) {
  border-radius: 13px !important;
}

/* 03 / Navigation rebuilt visually; isolate V63-V64 optical effects */
html:not([data-autotube-theme="dark"]) body nav.tabs:not(#atv-nav-a):not(#atv-nav-b):not(#atv-nav-c) {
  background: #FFF !important;
  background-color: #FFF !important;
  background-image: none !important;
  border: 1px solid var(--at3-line) !important;
  border-radius: 19px !important;
  padding: 6px !important;
  min-height: 64px !important;
  box-shadow: 0 10px 28px rgba(16,16,18,.045) !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs:not(#atv-nav-a):not(#atv-nav-b):not(#atv-nav-c)::before,
html:not([data-autotube-theme="dark"]) body nav.tabs:not(#atv-nav-a):not(#atv-nav-b):not(#atv-nav-c)::after,
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c)::after {
  content: none !important;
  display: none !important;
  background: none !important;
  box-shadow: none !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  min-width: 0 !important;
  min-height: 50px !important;
  padding: 9px 12px !important;
  border: 1px solid transparent !important;
  border-radius: 13px !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #262629 !important;
  font-family: var(--at3-ui) !important;
  font-size: clamp(12px,.92vw,14px) !important;
  font-weight: 700 !important;
  letter-spacing: -.016em !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(.active):not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):hover {
  background: #F2F2F1 !important;
  color: #111 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c),
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):hover,
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):active {
  background: var(--at3-black) !important;
  background-image: none !important;
  color: #FFF !important;
  border-color: var(--at3-black) !important;
  box-shadow: 0 6px 13px rgba(16,16,17,.16) !important;
  text-shadow: none !important;
}
/* The old nav pseudo-elements were lens flares. Reuse ::before for crisp icons. */
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c)::before {
  content: '' !important;
  display: block !important;
  position: static !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
  background: currentColor !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  -webkit-mask: var(--at3-nav-icon) center / contain no-repeat !important;
  mask: var(--at3-nav-icon) center / contain no-repeat !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button[data-tab="templates"] { --at3-nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2010.5%2012%203l9%207.5V21h-6v-7H9v7H3z%22%2F%3E%3C%2Fsvg%3E"); }
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button[data-tab="rewrite"] { --at3-nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%202h9l5%205v15H6z%22%2F%3E%3Cpath%20d%3D%22M15%202v5h5M9%2012h8M9%2016h7%22%2F%3E%3C%2Fsvg%3E"); }
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button[data-tab="voice"] { --at3-nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2010v4M7%207v10M11%203v18M15%208v8M19%205v14M23%2011v2%22%2F%3E%3C%2Fsvg%3E"); }
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button[data-tab="photos"] { --at3-nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Ccircle%20cx%3D%228.5%22%20cy%3D%228.5%22%20r%3D%221.5%22%2F%3E%3Cpath%20d%3D%22m21%2016-5-5L5%2021%22%2F%3E%3C%2Fsvg%3E"); }
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button[data-tab="montage"] { --at3-nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%2F%3E%3Ccircle%20cx%3D%226%22%20cy%3D%2218%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22m8.1%208.1%2012.8%2012.8M14%2010l7-7M8.1%2015.9l3-3%22%2F%3E%3C%2Fsvg%3E"); }
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button[data-tab="packaging"] { --at3-nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203a9%209%200%200%200%200%2018h2a2%202%200%200%200%201-3.7l-.8-.5A2%202%200%200%201%2015%2013h2a4%204%200%200%200%204-4c0-3.4-4.2-6-9-6Z%22%2F%3E%3Ccircle%20cx%3D%227.5%22%20cy%3D%2211%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%227%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%228%22%20r%3D%221%22%2F%3E%3C%2Fsvg%3E"); }
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:focus:not(:focus-visible) {
  outline: none !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:focus-visible {
  outline: 2px solid var(--at3-red) !important;
  outline-offset: 2px !important;
}

/* 04 / Workflow shell, dark selected segmented tabs, clear visual hierarchy */
html:not([data-autotube-theme="dark"]) body #rewriteTab.active,
html:not([data-autotube-theme="dark"]) body :is(#photosTab.active,#montageTab.active,#packagingTab.active) {
  background: #F9F9F8 !important;
  background-image: none !important;
  border: 1px solid #E9E9E8 !important;
  border-radius: 23px !important;
  box-shadow: 0 12px 31px rgba(17,17,18,.035) !important;
}
html:not([data-autotube-theme="dark"]) body .visual-mode-toggle:not(#atv-mode-a):not(#atv-mode-b) {
  background: #FFF !important;
  background-image: none !important;
  border: 1px solid var(--at3-line) !important;
  border-radius: 16px !important;
  box-shadow: 0 5px 16px rgba(0,0,0,.03) !important;
}
html:not([data-autotube-theme="dark"]) body .visual-mode-toggle .visual-mode-button:not(#atv-mode-a):not(#atv-mode-b) {
  background: transparent !important;
  background-image: none !important;
  color: var(--at3-black) !important;
  border-color: transparent !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 900 !important;
  font-size: 14px !important;
}
html:not([data-autotube-theme="dark"]) body .visual-mode-toggle .visual-mode-button.active:not(#atv-mode-a):not(#atv-mode-b),
html:not([data-autotube-theme="dark"]) body .visual-mode-toggle .visual-mode-button.active:not(#atv-mode-a):not(#atv-mode-b):hover {
  background: var(--at3-black) !important;
  background-image: none !important;
  color: #FFF !important;
  border-color: var(--at3-black) !important;
  box-shadow: 0 5px 12px rgba(0,0,0,.12) !important;
}

/* 05 / Shared editorial surfaces across all six workspaces */
html:not([data-autotube-theme="dark"]) body :is(
  .settings-card,.result-section,.text-section,.factory-template-card,
  .factory-workflow-history-card,.factory-templates-empty,.factory-workflow-run-panel,
  .voice-left-column,.voice-right-column,.voice-compact-control,
  .voice-slider-tile,.voice-speaker-toggle,.voice-library-compact-card,
  .visual-control-column,.visual-script-column,.compact-panel-block,
  .montage-right-card,.montage-row-card,.packaging-source-card,.packaging-results-pane,
  .packaging-copy-card,.factory-template-launch-panel
) {
  background-color: #FFFFFF !important;
  background-image: none !important;
  border-color: var(--at3-line) !important;
  box-shadow: 0 8px 24px rgba(20,20,22,.042) !important;
}
html:not([data-autotube-theme="dark"]) body :is(
  .settings-card,.result-section,.factory-template-card,.factory-templates-empty,
  .voice-left-column,.voice-right-column,.visual-control-column,.visual-script-column,
  .packaging-source-card,.packaging-results-pane,.montage-right-card
) {
  border-radius: 19px !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-panel:not(#atv-card-a):not(#atv-card-b),
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results > .text-section:not(#atv-card-a):not(#atv-card-b) {
  background: #FFFFFF !important;
  background-image: none !important;
  border: 1px solid var(--at3-line) !important;
  border-radius: 20px !important;
  box-shadow: var(--at3-shadow) !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-stage {
  background: var(--at3-soft) !important;
  background-image: none !important;
  border-color: #EDEDEB !important;
  border-radius: 14px !important;
  box-shadow: inset 0 1px 2px rgba(15,15,16,.025) !important;
}
html:not([data-autotube-theme="dark"]) body :is(
 .section-heading>label,.card-heading h2,.card-heading h3,
 .voice-column-heading h2,.voice-column-heading strong,
 .montage-section-heading h2,.visual-control-heading h2,
 .packaging-pane-heading h2,.factory-templates-heading h2
) {
  color: var(--at3-black) !important;
  font-family: var(--at3-heading) !important;
  font-size: clamp(18px,1.38vw,23px) !important;
  font-weight: 900 !important;
  letter-spacing: -.04em !important;
  line-height: 1.17 !important;
  text-shadow: none !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane :is(.scenario-generator-panel,.scenario-generation-results) .section-heading>label {
  font-size: clamp(19px,1.45vw,24px) !important;
}
/* Small red graphic accent on scenario title only; no new DOM elements. */
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-panel>.section-heading>label::before {
  content: '✦' !important;
  color: var(--at3-red) !important;
  font-size: 25px !important;
  font-family: 'Inter',sans-serif !important;
  font-weight: 700 !important;
  display: inline-block !important;
  margin-right: 10px !important;
  vertical-align: -1px !important;
}
html:not([data-autotube-theme="dark"]) body :is(.eyebrow,.card-kicker,.voice-column-heading .card-kicker,.montage-section-heading .card-kicker) {
  color: var(--at3-red) !important;
  font-family: var(--at3-ui) !important;
  letter-spacing: .11em !important;
  font-size: 10px !important;
  font-weight: 900 !important;
}
html:not([data-autotube-theme="dark"]) body .section-heading .counter {
  color: #89898D !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}

/* 06 / Forms — consistent fresh inset surfaces and clear interaction */
html:not([data-autotube-theme="dark"]) body :is(
 .text-input,.select-input,.single-select,.tts-textarea,textarea,
 .montage-compact-select,.montage-zoom-select,.packaging-source-textarea
) {
  color: #202022 !important;
  background: #FBFBFA !important;
  background-image: none !important;
  border-color: #E6E6E5 !important;
  border-radius: 13px !important;
  box-shadow: inset 0 1px 1px rgba(10,10,11,.018) !important;
  font-family: var(--at3-ui) !important;
}
html:not([data-autotube-theme="dark"]) body :is(textarea,.text-input)::placeholder {
  color: #98989B !important;
  opacity: 1 !important;
}
html:not([data-autotube-theme="dark"]) body :is(
 .text-input,.select-input,.single-select,textarea,.montage-compact-select
):focus:not(:disabled) {
  border-color: var(--at3-red) !important;
  box-shadow: 0 0 0 3px rgba(240,0,22,.09) !important;
  outline: none !important;
}
html:not([data-autotube-theme="dark"]) body :is(.field-label,.scenario-generator-field>span,.scenario-profile-control-meta>span) {
  color: #555558 !important;
  font-family: var(--at3-ui) !important;
  font-weight: 700 !important;
}

/* 07 / Button hierarchy. Never enable a disabled button. */
html:not([data-autotube-theme="dark"]) body button:is(.primary-button,.primary-small-button,.voice-library-launch-button,.packaging-generate-button):not(:disabled):not(#atv-action-a):not(#atv-action-b) {
  background: var(--at3-red) !important;
  background-image: none !important;
  border-color: var(--at3-red) !important;
  color: #FFF !important;
  border-radius: 13px !important;
  font-weight: 900 !important;
  box-shadow: 0 7px 18px rgba(240,0,22,.16) !important;
  text-shadow: none !important;
  transition: background-color .16s ease,box-shadow .16s ease !important;
}
html:not([data-autotube-theme="dark"]) body button:is(.primary-button,.primary-small-button,.voice-library-launch-button,.packaging-generate-button):not(:disabled):not(#atv-action-a):not(#atv-action-b):hover {
  background: var(--at3-red-hover) !important;
  background-image: none !important;
  border-color: var(--at3-red-hover) !important;
  box-shadow: 0 9px 23px rgba(240,0,22,.2) !important;
}
html:not([data-autotube-theme="dark"]) body button:is(.secondary-button,.link-button,.icon-button,.factory-user-trigger):not(.primary-button):not(:disabled) {
  color: #19191B !important;
  background: #FFF !important;
  background-image: none !important;
  border-color: var(--at3-line) !important;
  border-radius: 12px !important;
  box-shadow: 0 3px 11px rgba(0,0,0,.025) !important;
  text-shadow: none !important;
}
html:not([data-autotube-theme="dark"]) body button:is(.secondary-button,.link-button,.icon-button):not(.primary-button):not(:disabled):hover {
  background: #F6F6F5 !important;
  border-color: #D5D5D4 !important;
}
html:not([data-autotube-theme="dark"]) body button:disabled:not(#atv-disabled-a):not(#atv-disabled-b) {
  color: #939396 !important;
  background: #EEEEED !important;
  background-image: none !important;
  border-color: #E5E5E3 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
}
html:not([data-autotube-theme="dark"]) body button:is(.primary-button,.primary-small-button):focus-visible {
  outline: 2px solid var(--at3-black) !important;
  outline-offset: 3px !important;
}

/* 08 / Scenario selectors + dynamic topics; no hidden/disabled state changes */
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-controls .select-input {
  background-color: #FFF !important;
  border-color: var(--at3-line) !important;
  color: var(--at3-black) !important;
  border-radius: 11px !important;
  font-weight: 700 !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-controls button:is(.scenario-new-profile-button,.scenario-generate-topics-button) {
  border-radius: 12px !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-topic-item {
  background-color: #FFF !important;
  border-color: var(--at3-line) !important;
  border-radius: 13px !important;
  box-shadow: 0 3px 11px rgba(0,0,0,.027) !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-topic-item.selected {
  background-color: #FFF7F7 !important;
  border-color: #F8BFC5 !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-topic-item.selected .scenario-topic-number {
  background-color: var(--at3-red) !important;
  color: #FFF !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-topic-empty {
  color: #8D8D90 !important;
}

/* 09 / Voice, media, montage, packaging and templates — matching visual language */
html:not([data-autotube-theme="dark"]) body :is(
 .voice-compact-control,.voice-slider-tile,.voice-speaker-toggle,
 .voice-library-compact-card,.compact-panel-block,.montage-row-card,.montage-preset-tile,
 .packaging-copy-card,.factory-template-card
) {
  border-color: var(--at3-line) !important;
  border-radius: 14px !important;
}
html:not([data-autotube-theme="dark"]) body :is(
 .voice-library-launch-button,.voice-library-compact-card .voice-library-launch-button
):not(:disabled) {
  background: var(--at3-red) !important;
  background-image: none !important;
  border-color: var(--at3-red) !important;
  color: #FFF !important;
  box-shadow: 0 7px 18px rgba(240,0,22,.15) !important;
}
html:not([data-autotube-theme="dark"]) body :is(.voice-right-column,.voice-left-column,.montage-right-card) {
  background-color: #FFF !important;
}
html:not([data-autotube-theme="dark"]) body :is(
 .factory-template-nav,.factory-template-card .factory-template-card-head,
 .factory-templates-heading,.packaging-result-heading
) {
  color: var(--at3-black) !important;
}
html:not([data-autotube-theme="dark"]) body :is(input[type="range"],input[type="checkbox"],input[type="radio"]) {
  accent-color: var(--at3-red) !important;
}
html:not([data-autotube-theme="dark"]) body .toggle-field input:checked + .toggle-visual {
  background: var(--at3-black) !important;
  border-color: var(--at3-black) !important;
}

/* 10 / Cross-device constraints: keep layout from original responsive rules */
@media (max-width: 1100px) {
  html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) {
    gap: 6px !important;
    padding-inline: 6px !important;
    font-size: 12px !important;
  }
  html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c)::before {
    width: 16px !important;
    height: 16px !important;
    flex-basis: 16px !important;
  }
}
@media (max-width: 780px) {
  html:not([data-autotube-theme="dark"]) body header.topbar:not(#atv-head-a):not(#atv-head-b) { min-height: 48px !important; }
  html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1 {font-size: 21px !important;}
  html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1::before {width: 28px !important;height: 28px !important;flex-basis: 28px !important;font-size: 12px !important;}
  html:not([data-autotube-theme="dark"]) body nav.tabs:not(#atv-nav-a):not(#atv-nav-b):not(#atv-nav-c) { min-height: 50px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-autotube-theme="dark"]) body .tabs .tab-button,
  html:not([data-autotube-theme="dark"]) body .primary-button { transition: none !important; }
}

/* 11 / V3.1: Header depth (white card distinctly separated from page background) */
html:not([data-autotube-theme="dark"]) body header.topbar:not(#atv-head-a):not(#atv-head-b) {
  background: #FFFFFF !important;
  border: 1px solid #DFDFDE !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 32px rgba(19,19,22,.105), 0 2px 6px rgba(19,19,22,.035) !important;
}

/* 12 / V3.1: Clear navigation hover and stable icon contrast */
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(.active):not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):hover {
  background: #FFF0F1 !important;
  background-image: none !important;
  color: #BB0015 !important;
  border-color: #F6B9BF !important;
  box-shadow: 0 2px 8px rgba(240,0,22,.055) !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(.active):not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):hover::before {
  background: #BB0015 !important;
  background-color: #BB0015 !important;
  opacity: 1 !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c)::before,
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):hover::before {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  color: #FFFFFF !important;
  opacity: 1 !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):focus:not(:focus-visible) {
  outline: none !important;
  outline-offset: 0 !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):focus-visible {
  outline: 2px solid #E20019 !important;
  outline-offset: 2px !important;
}

/* 13 / V3.1: Inter-only text; preserve monospace editors and icon glyphs */
html body {
  font-family: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: normal;
}
html body :is(
  p,span,strong,b,em,small,label,legend,summary,a,li,dt,dd,th,td,
  button,input,textarea,select,option,h1,h2,h3,h4,h5,h6
):not(:is(
  code,pre,.material-icons,.material-symbols-outlined,.material-symbols-rounded,
  .fa,.fas,.far,.fab,[class*="fa-"],[class*="icon-font"],[class*="monospace"],
  .lucide,.codicon,.cm-icon,.monaco-icon-label
)) {
  font-family: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
}
html body :is(p,small,li,dt,dd,td,summary,span,em) {
  font-weight: 500 !important;
  letter-spacing: normal;
}
html body :is(input:not([type="range"]),textarea,select,option) {
  font-weight: 500 !important;
  letter-spacing: normal !important;
}
html body :is(input,textarea)::placeholder {
  font-family: 'Inter',sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
}
html body :is(strong,b,th,.field-label,.scenario-generator-field>span,
  .scenario-profile-control-meta>span,.factory-run-status,.badge,.status-badge,
  .counter,.card-kicker,.eyebrow) {
  font-weight: 700 !important;
}
html body :is(button,.tab-button,.visual-mode-button) {
  font-weight: 700 !important;
  letter-spacing: -.015em !important;
}
html body :is(.secondary-button,.link-button,.icon-button,.field-label,
  .scenario-generator-field>span,.scenario-profile-control-meta>span,
  .counter,.factory-run-status) {
  font-weight: 700 !important;
}
html body :is(.primary-button,.primary-small-button,.voice-library-launch-button,
  .packaging-generate-button,.scenario-mode-button,.metric-value,.stat-value,.stat-number,.kpi-value) {
  font-weight: 900 !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) {
  font-family: 'Inter',sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: -.015em !important;
}
html body :is(h1,h2,h3,h4,h5,h6,
  .section-heading>label,.card-heading h2,.card-heading h3,
  .voice-column-heading h2,.voice-column-heading strong,
  .montage-section-heading h2,.visual-control-heading h2,
  .packaging-pane-heading h2,.factory-templates-heading h2) {
  font-family: 'Inter',sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: -.03em !important;
}
html body .factory-brand-heading h1,
html body .factory-brand-heading h1 :is(span,strong) {
  font-family: 'Inter',sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: -.03em !important;
}
html body :is(pre,code,kbd,samp,pre *,code *,.CodeMirror,.CodeMirror *,
  .monaco-editor,.monaco-editor *,.cm-editor,.cm-editor *,
  [class*="code-editor"],[class*="code-editor"] *) {
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace !important;
}
/* AUTOTUBE PRIVATE VISUAL V3.1 END */


/* AUTOTUBE VISUAL V3.2 COMPACT PATCH */
/* User1 only. Presentation-only overrides on top of V3.1. */

/* 01 / Remove the white header plate and tighten vertical rhythm */
html:not([data-autotube-theme="dark"]) body header.topbar:not(#atv-head-a):not(#atv-head-b) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: 44px !important;
  margin: 6px 0 2px !important;
  padding: 0 !important;
}
html:not([data-autotube-theme="dark"]) body .topbar .factory-brand-heading,
html:not([data-autotube-theme="dark"]) body .topbar .factory-brand-heading h1 {
  margin: 0 !important;
}
html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1 {
  font-family: var(--at3-ui) !important;
  font-size: clamp(18px, 1.6vw, 22px) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: -0.03em !important;
  gap: 10px !important;
}
html:not([data-autotube-theme="dark"]) body .factory-brand-heading h1::before {
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  box-shadow: 0 6px 15px rgba(240,0,22,.14) !important;
}
html:not([data-autotube-theme="dark"]) body .topbar :is(.factory-user-trigger,.factory-theme-toggle,.factory-admin-panel-button,.icon-button) {
  border-radius: 12px !important;
}

/* 02 / Compact spacing between header, function tabs and work area */
html:not([data-autotube-theme="dark"]) body main.app-shell,
html:not([data-autotube-theme="dark"]) body .app-shell {
  padding-top: 6px !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs:not(#atv-nav-a):not(#atv-nav-b):not(#atv-nav-c) {
  margin-top: 0 !important;
  min-height: 58px !important;
  padding: 4px !important;
  border-radius: 18px !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) {
  min-height: 46px !important;
  padding: 8px 12px !important;
  border-radius: 13px !important;
  font-family: var(--at3-ui) !important;
  font-size: clamp(12px,.92vw,14px) !important;
  font-weight: 900 !important;
  letter-spacing: -0.015em !important;
}
html:not([data-autotube-theme="dark"]) body :is(#rewriteTab.active,#photosTab.active,#montageTab.active,#packagingTab.active) {
  margin-top: 10px !important;
  border-radius: 20px !important;
}
html:not([data-autotube-theme="dark"]) body .visual-mode-toggle:not(#atv-mode-a):not(#atv-mode-b) {
  margin-top: 0 !important;
  padding: 4px !important;
  border-radius: 14px !important;
}
html:not([data-autotube-theme="dark"]) body .visual-mode-toggle .visual-mode-button:not(#atv-mode-a):not(#atv-mode-b) {
  min-height: 40px !important;
  padding: 8px 18px !important;
  border-radius: 11px !important;
  font-family: var(--at3-ui) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  letter-spacing: -0.015em !important;
}
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generator-panel,
html:not([data-autotube-theme="dark"]) body #scenarioGeneratePane .scenario-generation-results > .text-section {
  padding-top: 14px !important;
}

/* 03 / Top function navigation states: white default, black hover, black active */
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) {
  color: #111111 !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c)::before {
  color: currentColor !important;
  background: currentColor !important;
  opacity: 1 !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(.active):not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):hover,
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(.active):not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):focus-visible {
  background: var(--at3-black) !important;
  background-image: none !important;
  color: #FFFFFF !important;
  border-color: var(--at3-black) !important;
  box-shadow: 0 6px 13px rgba(16,16,17,.14) !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c),
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):hover,
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):focus-visible,
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c):active {
  background: var(--at3-black) !important;
  background-image: none !important;
  color: #FFFFFF !important;
  border-color: var(--at3-black) !important;
  box-shadow: 0 6px 13px rgba(16,16,17,.16) !important;
}

/* 04 / Force icon color to follow the same state as text */
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) > :is(svg,i,span,[class*="icon"],[class^="icon-"]) {
  color: inherit !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  opacity: 1 !important;
  filter: none !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) > :is(svg) :is(path,rect,circle,line,polyline,polygon) {
  stroke: currentColor !important;
}
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button.active:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) > :is(svg,i,span,[class*="icon"],[class^="icon-"]),
html:not([data-autotube-theme="dark"]) body nav.tabs .tab-button:not(.active):hover:not(#atv-tab-a):not(#atv-tab-b):not(#atv-tab-c) > :is(svg,i,span,[class*="icon"],[class^="icon-"]) {
  color: #FFFFFF !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

/* 05 / Unify typography strictly to Inter 500/700/900 */
html:not([data-autotube-theme="dark"]) body :is(
  h1,h2,h3,h4,
  .factory-brand-heading h1,
  .section-heading label,
  .text-section > .section-heading label,
  .scenario-generation-results .section-heading label,
  .voice-column-heading strong,
  .factory-templates-heading h2,
  nav.tabs .tab-button,
  .primary-button,
  .visual-mode-toggle .visual-mode-button
) {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-weight: 900 !important;
}
html:not([data-autotube-theme="dark"]) body :is(
  label,.field-label,.settings-label,
  .secondary-button,.text-button,.badge,.status-badge,
  .scenario-generator-controls .select-label,
  .voice-param-title,.table-head,.workflow-status
) {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-weight: 700 !important;
}
html:not([data-autotube-theme="dark"]) body :is(
  body,p,span,li,
  input,textarea,select,option,
  .helper-text,.empty-state,.placeholder,.muted,
  .section-description,.field-hint,.subtle-note
) {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-weight: 500 !important;
}
/* AUTOTUBE_VISUAL_V3_2_END */
