/* AutoTube Factory — USER1 ONLY — Montage visual corrections V4.12.
   The native montage nodes, FFmpeg handlers, and 16:9 player are unchanged. */
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 .at-m411-materials {
  display: none !important; /* UI only: keep all inputs in DOM for automatic handoff. */
}
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsToggle .collapsible-card-arrow,
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsToggle svg {
  display: none !important;
}
/* Match the top and bottom of the actual 16:9 video frame (dynamic pixel sizes). */
@media (min-width: 981px) {
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 .montage-right-column {
    margin-top: var(--at-m412-top-offset, 0px) !important;
    min-height: 0 !important;
    align-self: start !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard {
    box-sizing: border-box !important;
    height: var(--at-m412-card-height, auto) !important;
    min-height: 0 !important;
    max-height: var(--at-m412-card-height, none) !important;
    overflow: hidden !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsBody {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-presets {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    grid-template-rows: repeat(5, minmax(0,1fr)) !important;
  }
}
/* Independent controls are allowed to shrink; do not overflow their row. */
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-preset-tile {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-preset-tile > span,
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-preset-tile > label:not(.mini-toggle) {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  white-space: nowrap !important;
}
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-preset-tile select,
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-preset-tile:nth-child(2) strong {
  box-sizing: border-box !important;
  width: 56% !important;
  flex: 0 1 56% !important;
  min-width: 0 !important;
  max-width: 56% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  margin: 0 !important;
}
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-subtitle-toggle .mini-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0 !important;
  flex: 0 0 auto !important;
  font-size: 0 !important; /* hide 'Авто', preserve native checkbox */
  line-height: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard #montageSubtitlesEnabled {
  box-sizing: border-box !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex: 0 0 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  accent-color: #f00016 !important;
  cursor: pointer !important;
}
/* Subtitles OFF: gray the whole card including input background/border, not just text. */
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412.at-m412-subtitles-off #montageSettingsCard .montage-subtitle-control {
  opacity: .42 !important;
  filter: grayscale(1) !important;
  background: #e6e7e9 !important;
  border: 1px solid #d3d5d9 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412.at-m412-subtitles-off #montageSettingsCard .montage-subtitle-control :is(input,select) {
  background-color: #e2e3e5 !important;
  color: #92949a !important;
  border-color: #cbcdd1 !important;
}
@media (max-width: 980px) {
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 .montage-right-column {
    margin-top: 0 !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard {
    height: auto !important;
    max-height: none !important;
  }
}
/* Prevent the former full-width native subtitle label from pushing the title away. */
html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-subtitle-toggle .mini-toggle {
  box-sizing: border-box !important;
  width: 20px !important;
  max-width: 20px !important;
  min-width: 20px !important;
  flex: 0 0 20px !important;
  padding: 0 !important;
  min-height: 14px !important;
  height: auto !important;
  background: transparent !important;
  border: 0 !important;
}
@media (min-width: 981px) and (max-width: 1360px) {
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard {
    padding: 9px !important;
    gap: 4px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsToggle {
    padding: 2px 3px 5px !important;
    font-size: 19px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .at-m411-music {
    padding: 7px !important;
    gap: 3px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .at-m411-music button {
    min-height: 30px !important;
    padding: 5px 9px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-presets {
    gap: 5px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-presets > .montage-preset-tile {
    min-height: 43px !important;
    padding: 5px 8px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-preset-tile select {
    min-height: 30px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .montage-preset-tile:nth-child(2) strong {
    padding: 5px 7px !important;
  }
  html:not([data-autotube-theme="dark"]) body #montageTab.at-m411.at-m412 #montageSettingsCard .at-m411-launch {
    min-height: 43px !important;
    padding: 7px 10px !important;
  }
}
