/* Keep free-generate aligned with the normal workstation layout. */
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .topbar {
  display: flex !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .workspace {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  background-image: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .hero-card,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .function-board,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-generate-page,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .works-panel {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .task-panel {
  display: grid !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .content-grid {
  height: calc(100vh - 64px) !important;
  min-height: 0 !important;
  max-height: calc(100vh - 64px) !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  padding: 32px 24px 30px !important;
  background:
    linear-gradient(
      180deg,
      rgba(248, 244, 255, 0.82) 0%,
      rgba(253, 252, 255, 0.78) 42%,
      rgba(255, 255, 255, 0.9) 100%
    ) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .extra-prompt-box {
  position: relative !important;
  z-index: 3 !important;
  display: grid !important;
  gap: 8px !important;
  padding: 18px !important;
  border: 1px solid rgba(214, 210, 236, 0.96) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 10px 22px rgba(105, 91, 164, 0.055) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .extra-prompt-box > span {
  min-height: auto !important;
  color: #30384d !important;
  font-size: 14px !important;
  font-weight: 560 !important;
  line-height: 1.25 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] #extra-prompt {
  height: 280px !important;
  min-height: 280px !important;
  max-height: 280px !important;
  padding: 16px 17px 58px !important;
  border: 1px solid rgba(214, 210, 236, 0.96) !important;
  border-radius: 14px !important;
  color: #20263a !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  resize: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] #extra-prompt:focus {
  border-color: rgba(109, 85, 238, 0.55) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(109, 85, 238, 0.08), 0 12px 24px rgba(105, 91, 164, 0.08) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .prompt-optimize-button {
  position: absolute !important;
  right: 30px !important;
  bottom: 30px !important;
  z-index: 85 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  min-height: 34px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(91, 73, 230, 0.42) !important;
  border-radius: 999px !important;
  color: #5b4be8 !important;
  background: #ffffff !important;
  box-shadow: 0 12px 24px rgba(91, 73, 230, 0.18) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .prompt-optimize-button .lucide {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.2 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .prompt-optimize-button span {
  font-weight: 450 !important;
  -webkit-font-smoothing: antialiased !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .prompt-optimize-button:hover:not(:disabled) {
  border-color: rgba(91, 73, 230, 0.5) !important;
  color: #ffffff !important;
  background: #5b4be8 !important;
  box-shadow: 0 12px 24px rgba(91, 73, 230, 0.2) !important;
  transform: translateY(-1px) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .prompt-optimize-button:disabled {
  color: #5b4be8 !important;
  border-color: rgba(91, 73, 230, 0.32) !important;
  background: #ffffff !important;
  box-shadow: 0 10px 20px rgba(91, 73, 230, 0.1) !important;
  cursor: not-allowed !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .prompt-optimize-button.is-busy {
  color: #ffffff !important;
  background: #5b4be8 !important;
  cursor: wait !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .preview-empty,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .preview-empty-visual,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .preview-empty-actions {
  display: flex !important;
}

body[data-active-feature="free-generate"] .free-generate-empty-message {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
  padding: 32px;
}


body[data-active-feature="free-generate"] .free-generate-empty-message p {
  margin: 0;
  color: #313548;
  font-size: clamp(24px, 1.75vw, 34px);
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 10px 30px rgba(54, 48, 94, 0.08);
  transform-origin: center;
  white-space: nowrap;
  backface-visibility: hidden;
  will-change: transform;
  animation: free-generate-copy-enter 620ms cubic-bezier(0.22, 1, 0.36, 1) both,
    free-generate-copy-drift 4.8s cubic-bezier(0.45, 0, 0.55, 1) 800ms infinite;
}

html[data-theme="dark"] body[data-active-feature="free-generate"] .free-generate-empty-message p {
  color: #ececf7;
  text-shadow: 0 12px 34px rgba(139, 125, 255, 0.14);
}

@keyframes free-generate-copy-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes free-generate-copy-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
  50% {
    transform: translate3d(0, -3px, 0) scale3d(1.008, 1.008, 1);
  }
}


@media (prefers-reduced-motion: reduce) {
  body[data-active-feature="free-generate"] .free-generate-empty-message p {
    animation: none;
  }
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-card {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] #video-storyboard-button,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] #set-ratio-section {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .upload-column:has(.free-upload-strip:not([hidden])) #product-upload {
  align-content: start !important;
  min-height: 236px !important;
  padding: 18px 16px 14px !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  justify-items: stretch !important;
  text-align: left !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .upload-column:has(.free-upload-strip:not([hidden])) #product-upload .upload-icon {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-self: center !important;
  width: 52px !important;
  height: 52px !important;
  border-radius: 16px !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .upload-column:has(.free-upload-strip:not([hidden])) #product-upload .upload-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: stretch !important;
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .upload-column:has(.free-upload-strip:not([hidden])) #product-upload strong {
  font-size: 16px !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] #upload-stack {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  display: flex !important;
  justify-self: stretch !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-top: 6px !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  padding: 0 1px 2px !important;
  scroll-snap-type: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip[hidden] {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip.is-scrollable {
  overflow-x: auto !important;
  scroll-snap-type: x mandatory !important;
  scrollbar-width: thin !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip .video-upload-slot {
  position: relative !important;
  display: grid !important;
  grid-template-rows: auto 20px !important;
  gap: 7px !important;
  place-items: stretch !important;
  flex: 0 0 calc((100% - 16px) / 5) !important;
  width: calc((100% - 16px) / 5) !important;
  min-width: calc((100% - 16px) / 5) !important;
  aspect-ratio: auto !important;
  height: auto !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  scroll-snap-align: start !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip .video-upload-slot img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 4 !important;
  min-height: 0 !important;
  object-fit: cover !important;
  overflow: hidden !important;
  border: 1px solid rgba(226, 230, 242, 0.9) !important;
  border-radius: 10px !important;
  background: #f7f7fb !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip .video-upload-slot small {
  position: static !important;
  display: grid !important;
  place-items: center !important;
  align-self: start !important;
  min-width: 0 !important;
  padding: 0 2px !important;
  color: #4b5368 !important;
  background: transparent !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  pointer-events: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip .upload-stack-delete {
  right: 4px !important;
  top: 4px !important;
  display: grid !important;
  place-items: center !important;
  width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: rgba(19, 24, 38, 0.48) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18) !important;
  opacity: 0.72 !important;
  transform: none !important;
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease !important;
  backdrop-filter: blur(8px) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip .upload-stack-delete .lucide {
  width: 11px !important;
  height: 11px !important;
  stroke-width: 2.6 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip .video-upload-slot:hover .upload-stack-delete,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-upload-strip .upload-stack-delete:focus-visible {
  opacity: 1 !important;
  transform: none !important;
  background: rgba(239, 68, 68, 0.9) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .extra-prompt-box.has-video-highlight #extra-prompt {
  color: transparent !important;
  caret-color: #20263a !important;
  -webkit-text-fill-color: transparent !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .extra-prompt-box.has-video-highlight #extra-prompt::placeholder {
  color: #8a91a3 !important;
  -webkit-text-fill-color: #8a91a3 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-prompt-highlight {
  position: absolute !important;
  z-index: 1 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  white-space: pre-wrap !important;
  overflow-wrap: break-word !important;
  border: 1px solid transparent !important;
  color: #20263a !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  box-sizing: border-box !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-prompt-highlight-token {
  display: inline !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: #5b4be8 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .extra-prompt-box .video-material-mention {
  position: absolute !important;
  left: 30px !important;
  right: auto !important;
  bottom: 30px !important;
  z-index: 80 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention[hidden] {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 66px !important;
  min-height: 34px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(91, 73, 230, 0.32) !important;
  border-radius: 999px !important;
  color: #5b4be8 !important;
  background: #ffffff !important;
  box-shadow: 0 12px 24px rgba(91, 73, 230, 0.12) !important;
  font-size: 12px !important;
  font-weight: 450 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-button:hover:not(:disabled) {
  border-color: rgba(91, 73, 230, 0.5) !important;
  color: #ffffff !important;
  background: #5b4be8 !important;
  box-shadow: 0 12px 24px rgba(91, 73, 230, 0.2) !important;
  transform: translateY(-1px) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-button:disabled {
  color: #5b4be8 !important;
  border-color: rgba(109, 85, 238, 0.18) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 8px 16px rgba(91, 73, 230, 0.07) !important;
  opacity: 0.58 !important;
  cursor: not-allowed !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-menu {
  position: absolute !important;
  left: 0 !important;
  top: auto !important;
  bottom: calc(100% + 6px) !important;
  z-index: 90 !important;
  display: grid !important;
  gap: 4px !important;
  width: 136px !important;
  max-height: 186px !important;
  overflow-y: auto !important;
  padding: 7px !important;
  border: 1px solid rgba(221, 224, 238, 0.92) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 14px 34px rgba(42, 48, 74, 0.16) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-menu[hidden] {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-menu button {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 32px !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 44px !important;
  padding: 6px 7px 6px 10px !important;
  border: 0 !important;
  border-radius: 9px !important;
  color: #20263a !important;
  background: transparent !important;
  text-align: left !important;
  cursor: pointer !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-menu button:hover {
  background: rgba(123, 97, 255, 0.09) !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-menu strong {
  overflow: hidden !important;
  font-size: 13px !important;
  font-weight: 720 !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-thumb {
  display: grid !important;
  place-items: center !important;
  width: 32px !important;
  height: 32px !important;
  overflow: hidden !important;
  border-radius: 8px !important;
  background: #f3f5fb !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .video-material-mention-empty {
  overflow: hidden !important;
  color: #8a91a3 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-bottom-area {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  overflow: visible !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .generate-count-box {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .generate-action-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .free-bottom-ratio-section {
  display: block !important;
  position: relative !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .settings-bottom-area {
  position: relative !important;
  z-index: 120 !important;
  overflow: visible !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) #free-bottom-ratio-section.is-open {
  z-index: 121 !important;
}

/* Print extraction keeps the local extraction-type card, without the shared
 * settings shell around it. */
body.feature-focus-mode.workstation-feature-mode[data-active-feature="print-extract"] #settings-card {
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="print-extract"] #settings-card::before,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="print-extract"] #settings-card::after {
  content: none !important;
  display: none !important;
}

/* Detail-page quantities are chosen per module, so its footer has only ratio
 * and resolution and must not retain an empty middle column. */
body.feature-focus-mode.workstation-feature-mode[data-active-feature="detail-page"][data-active-feature="detail-page"] .settings-bottom-area {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  column-gap: 12px !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="detail-page"][data-active-feature="detail-page"] #free-bottom-ratio-section {
  grid-column: 1 !important;
  width: 100% !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="detail-page"][data-active-feature="detail-page"] #generate-count-box > .generation-resolution-section {
  grid-column: 2 !important;
  width: 100% !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .inline-model-section {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .generate-count-section {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .generation-resolution-section {
  grid-column: 3 !important;
  grid-row: 1 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .create-button.full {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .inline-model-section,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .generate-count-section,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .generation-resolution-section,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .print-compact-select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .mobile-free-ratio-toggle,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .inline-model-section summary,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .print-compact-select summary {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  grid-template-columns: 30px minmax(0, 1fr) 12px !important;
  gap: 2px 7px !important;
  padding: 8px 9px !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] .settings-bottom-area {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px 10px !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] #generate-count-box,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] .generate-action-row {
  display: contents !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] #free-bottom-ratio-section {
  display: block !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] #inline-model-section {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] #generate-count-box > .generate-count-section {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] #generate-count-box > .generation-resolution-section {
  grid-column: 3 !important;
  grid-row: 1 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"][data-active-feature="free-generate"] #generate {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .free-bottom-ratio-section {
  padding: 0 !important;
  border: 1px solid rgba(123, 97, 255, 0.18) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #ffffff 0%, #faf9ff 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), 0 8px 18px rgba(66, 57, 132, 0.06) !important;
  box-sizing: border-box !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .free-ratio-heading {
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .mobile-free-ratio-toggle {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) 12px !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  align-content: center !important;
  justify-items: start !important;
  gap: 2px 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 58px !important;
  padding: 8px 9px !important;
  border: 0 !important;
  border-radius: 16px !important;
  color: #30384d !important;
  background: transparent !important;
  font-family: inherit !important;
  text-align: left !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .mobile-free-ratio-toggle > .lucide {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  align-self: center !important;
  box-sizing: content-box !important;
  width: 18px !important;
  height: 18px !important;
  padding: 4px !important;
  border-radius: 8px !important;
  color: #7869df !important;
  background: rgba(123, 97, 255, 0.07) !important;
  stroke-width: 1.75 !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .mobile-free-ratio-toggle > span {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: end !important;
  color: #30384d !important;
  font-size: 13px !important;
  font-weight: 525 !important;
  line-height: 1.15 !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .mobile-free-ratio-toggle > strong {
  grid-column: 2 !important;
  grid-row: 2 !important;
  overflow: hidden !important;
  align-self: start !important;
  max-width: 100% !important;
  color: #7162e8 !important;
  font-size: 12px !important;
  font-weight: 525 !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .mobile-free-ratio-toggle::after {
  grid-column: 3 !important;
  grid-row: 1 / 3 !important;
  content: "" !important;
  width: 7px !important;
  height: 7px !important;
  border-right: 2px solid rgba(113, 98, 232, 0.52) !important;
  border-bottom: 2px solid rgba(113, 98, 232, 0.52) !important;
  transform: rotate(45deg) translateY(-2px) !important;
  transition: transform 0.16s ease !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) #free-bottom-ratio-section.is-open {
  border-color: rgba(123, 97, 255, 0.38) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 12px 24px rgba(92, 76, 180, 0.1) !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) #free-bottom-ratio-section.is-open .mobile-free-ratio-toggle::after {
  transform: rotate(225deg) translate(-2px, -2px) !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) #free-bottom-ratio-section .free-generate-option-grid {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: calc(100% + 8px) !important;
  z-index: 80 !important;
  display: none !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: min(410px, calc(300% + 20px)) !important;
  padding: 12px !important;
  padding-bottom: 12px !important;
  border: 1px solid rgba(123, 97, 255, 0.16) !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 18px 38px rgba(36, 39, 64, 0.16) !important;
  box-sizing: border-box !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) #free-bottom-ratio-section.is-open .free-generate-option-grid {
  display: grid !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .free-generate-option-grid button {
  display: grid !important;
  grid-template-rows: 26px auto !important;
  place-items: center !important;
  gap: 3px !important;
  min-width: 0 !important;
  min-height: 50px !important;
  padding: 6px 4px !important;
  border: 1px solid rgba(123, 97, 255, 0.14) !important;
  border-radius: 12px !important;
  color: #4d5368 !important;
  background: #fbfbff !important;
  box-sizing: border-box !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .free-generate-option-grid button span {
  overflow: hidden !important;
  max-width: 100% !important;
  font-size: 12px !important;
  font-weight: 525 !important;
  line-height: 1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.feature-focus-mode.workstation-feature-mode:is([data-active-feature="free-generate"], [data-active-feature="print-extract"], [data-active-feature="poster-design"], .uses-free-style-bottom-ratio) .free-generate-option-grid button.selected {
  border-color: rgba(123, 97, 255, 0.68) !important;
  color: #5b4bf0 !important;
  background: #f7f4ff !important;
  box-shadow: inset 0 0 0 1px rgba(123, 97, 255, 0.14) !important;
}

/* Final prompt treatment: free generate uses the workstation prompt field. */
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-column .extra-prompt-box {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px 10px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-column .extra-prompt-box::before {
  content: none !important;
  display: none !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-column .extra-prompt-box > span {
  grid-column: 1 !important;
  min-height: auto !important;
  color: #30384d !important;
  font-size: 14px !important;
  font-weight: 560 !important;
  line-height: 1.25 !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-column .extra-prompt-box textarea {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 280px !important;
  height: 280px !important;
  max-height: 280px !important;
  padding: 16px 17px 58px !important;
  border: 1px solid rgba(214, 210, 236, 0.96) !important;
  border-radius: 14px !important;
  color: #20263a !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(105, 91, 164, 0.055) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  resize: none !important;
}

body[data-active-feature="free-generate"] .free-page-composer,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-page-composer {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-active-feature="free-generate"] .free-page-prompt,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .free-page-prompt {
  position: relative !important;
  display: grid !important;
  min-height: 0 !important;
  gap: 8px !important;
}

body[data-active-feature="free-generate"] #free-page-prompt,
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] #free-page-prompt {
  min-height: 280px !important;
  height: 280px !important;
  max-height: 280px !important;
  padding: 16px 17px 58px !important;
  border: 1px solid rgba(214, 210, 236, 0.96) !important;
  border-radius: 14px !important;
  color: #20263a !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(105, 91, 164, 0.055) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  resize: none !important;
}

/* Hard fallback: the free page can be visible before body state classes are synced. */
#free-generate-page .free-page-composer {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#free-generate-page .free-page-prompt {
  position: relative !important;
  min-height: 0 !important;
  gap: 8px !important;
}

#free-generate-page #free-page-prompt {
  min-height: 280px !important;
  height: 280px !important;
  max-height: 280px !important;
  padding: 16px 17px 58px !important;
  border: 1px solid rgba(214, 210, 236, 0.96) !important;
  border-radius: 14px !important;
  color: #20263a !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(105, 91, 164, 0.055) !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  resize: none !important;
}

#free-generate-page #free-page-prompt:focus {
  border-color: rgba(109, 85, 238, 0.55) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(109, 85, 238, 0.08), 0 12px 24px rgba(105, 91, 164, 0.08) !important;
}

#free-generate-page .free-prompt-optimize-button {
  position: static !important;
  z-index: 2 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  min-height: 34px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(91, 73, 230, 0.42) !important;
  border-radius: 999px !important;
  color: #5b4be8 !important;
  background: #ffffff !important;
  box-shadow: 0 12px 24px rgba(91, 73, 230, 0.18) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease !important;
}

#free-generate-page .free-prompt-optimize-button .lucide {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.2 !important;
}

#free-generate-page .free-prompt-optimize-button span {
  font-weight: 450 !important;
  -webkit-font-smoothing: antialiased !important;
}

#free-generate-page .free-prompt-optimize-button:hover:not(:disabled) {
  border-color: rgba(91, 73, 230, 0.5) !important;
  color: #ffffff !important;
  background: #5b4be8 !important;
  box-shadow: 0 12px 24px rgba(91, 73, 230, 0.2) !important;
  transform: translateY(-1px) !important;
}

#free-generate-page .free-prompt-optimize-button:disabled {
  color: #5b4be8 !important;
  border-color: rgba(91, 73, 230, 0.32) !important;
  background: #ffffff !important;
  box-shadow: 0 10px 20px rgba(91, 73, 230, 0.1) !important;
  cursor: not-allowed !important;
}

#free-generate-page .free-prompt-optimize-button.is-busy {
  color: #ffffff !important;
  background: #5b4be8 !important;
  cursor: wait !important;
}

/* Visible workstation prompt controls: keep the material button clickable and inside the viewport. */
body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-column {
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 12px !important;
  overflow: hidden !important;
}

body.feature-focus-mode.workstation-feature-mode[data-active-feature="free-generate"] .settings-scroll-area {
  display: grid !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Use the same flat gradient canvas for every desktop feature workbench. */
@media (min-width: 981px) {
  html:not([data-mobile-workbench="true"])
    body.feature-focus-mode:not(.library-focus-mode)
    .main-area {
    background: #f6f7fb !important;
  }

  html:not([data-mobile-workbench="true"])
    body.feature-focus-mode:not(.library-focus-mode)
    .content-grid {
    background:
      linear-gradient(
        180deg,
        rgba(248, 244, 255, 0.82) 0%,
        rgba(253, 252, 255, 0.78) 42%,
        rgba(255, 255, 255, 0.9) 100%
      ) !important;
  }

  html:not([data-mobile-workbench="true"])
    body.feature-focus-mode:not(.library-focus-mode)
    .workspace {
    background: transparent !important;
    background-image: none !important;
  }

  html:not([data-mobile-workbench="true"])
    body.feature-focus-mode:not(.library-focus-mode)
    .task-panel {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
  }
}
