.studio-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  margin: 40px 0;
  align-items: start;
}

/* Sticky & Scrollable Sidebar for Left Column */
.studio-sidebar {
  position: sticky;
  top: 85px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.4) transparent;
  padding-right: 4px;
}

.studio-sidebar::-webkit-scrollbar {
  width: 5px;
}

.studio-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.studio-sidebar::-webkit-scrollbar-thumb {
  background: rgba(236, 72, 153, 0.35);
  border-radius: var(--radius-full);
}

.studio-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-pink);
}

/* Upload & Preview Card */
.upload-card {
  padding: 28px;
}

.dropzone {
  border: 2px dashed rgba(236, 72, 153, 0.4);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  background: rgba(236, 72, 153, 0.03);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.08);
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--accent-pink);
  margin-bottom: 14px;
}

.dropzone-text {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.dropzone-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.preview-container {
  display: none;
  width: 100%;
  height: 340px;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.change-img-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 11, 16, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
}

/* Body Controls */
.controls-section {
  margin-top: 24px;
}

.control-group {
  margin-bottom: 20px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-main);
}

.segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segment-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

/* Presets Grid */
.presets-category-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 12px 0;
}

/* Preset Subtabs (Poses vs Collections) */
.preset-subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.subtab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.subtab-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-card-hover);
}

.subtab-btn.active {
  background: rgba(236, 72, 153, 0.15);
  border-color: var(--accent-pink);
  color: #fff;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.25);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

/* Vertical Preset Card with Media Support */
.preset-card {
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
}

.preset-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.preset-card.active {
  border-color: var(--accent-pink);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.35), 0 0 0 1px var(--accent-pink);
}

.preset-card-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.35s ease;
}

.preset-card:hover .preset-card-media {
  transform: scale(1.06);
}

.preset-card-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, rgba(32, 28, 48, 0.85), rgba(16, 13, 26, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: var(--text-dim);
  font-size: 2.4rem;
}

.preset-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(10, 10, 18, 0.1) 0%, rgba(10, 10, 18, 0.45) 50%, rgba(10, 10, 18, 0.95) 100%);
  z-index: 2;
  pointer-events: none;
}

.preset-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-pink);
  display: flex;
  align-items: center;
  gap: 3px;
}

.preset-card-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.preset-card.active .preset-card-check {
  background: var(--accent-pink);
  border-color: var(--accent-pink);
  color: #fff;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

.preset-card-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preset-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.preset-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.badge-optional-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
}

.collection-notice-box {
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.collection-notice-box i {
  color: var(--accent-pink);
  font-size: 1.25rem;
  margin-top: 1px;
  flex-shrink: 0;
}

.collection-override-banner {
  display: none;
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: #fff;
  align-items: center;
  gap: 8px;
}

.controls-section.disabled-by-collection {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.5);
  transition: all 0.3s ease;
}

.custom-param-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 9px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.custom-param-select:focus {
  outline: none;
  border-color: var(--accent-pink);
}

.custom-param-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Cost Summary Bar */
.cost-summary-box {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cost-summary-label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.cost-summary-value {
  color: var(--accent-pink);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Generation Progress Box */
.progress-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin-top: 20px;
}

.progress-bar-wrapper {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.4s ease;
}

/* Photo Studio Mode Selector */
.studio-mode-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 30px 0;
}

.mode-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.mode-tab:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.mode-tab.active {
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.08);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.2);
}

.mode-tab .mode-icon {
  font-size: 2rem;
  color: var(--accent-pink);
  margin-bottom: 8px;
}

.mode-tab .mode-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.mode-tab .mode-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dual Upload Grid for Face Swap */
.dual-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.dual-dropzone {
  min-height: 200px;
  padding: 20px 12px;
}

.dual-dropzone .dropzone-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.prompt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-chip:hover {
  color: #fff;
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.1);
}

.form-select-custom {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.9rem;
}

.form-select-custom:focus {
  outline: none;
  border-color: var(--accent-pink);
}

.prompt-textarea {
  width: 100%;
  min-height: 110px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.prompt-textarea:focus {
  outline: none;
  border-color: var(--accent-pink);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

/* Studio Maintenance & Mode Disabled Banners */
.studio-global-disabled-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 20px 0 28px 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.studio-global-disabled-banner .maintenance-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #f87171;
}

.studio-global-disabled-banner h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 4px;
}

.studio-global-disabled-banner p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.45;
}

.mode-maintenance-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fbbf24;
}

.mode-maintenance-notice i {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.mode-maintenance-notice .notice-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 2px;
  color: #fbbf24;
}

.mode-maintenance-notice .notice-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.mode-disabled-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
  display: inline-block;
}


@media (max-width: 900px) {
  .studio-container { grid-template-columns: 1fr; }
  .studio-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
  .dual-upload-grid { grid-template-columns: 1fr; }
}
