/* Studio — tabs, gallery grid, media results */

.studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.studio-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.studio-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.studio-tab.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.35);
}

.studio-tab.hidden { display: none; }

.studio-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--dim);
}

.studio-panel.hidden { display: none; }

.studio-form { display: flex; flex-direction: column; gap: 0.85rem; }

.studio-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .studio-row { grid-template-columns: 1fr; }
}

.studio-field { min-width: 0; }

.studio-textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 4.5rem;
}

.studio-textarea:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.prompt-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prompt-row .studio-textarea { flex: 1; }

.studio-result {
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.studio-result img,
.studio-result video {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
}

.studio-result audio { width: 100%; padding: 1rem; }

.studio-image-fallback {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--glass-border);
}

.studio-image-fallback a { color: #a5b4fc; }

.studio-status {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  color: #c4b5fd;
  font-size: 0.88rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}

.gallery-item {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.gallery-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-audio {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.88rem;
}

.gallery-meta { padding: 0.65rem; }

.gallery-prompt {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.video-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
  margin: 0.35rem 0 0.75rem;
}

.video-progress-track.hidden {
  display: none;
}

.video-progress-fill {
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.3s ease;
}

.gallery-actions .btn { flex: 1; }
