/* ── Studio layout ───────────────────────────────────────────────────────── */
.studio-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.studio-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.studio-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.studio-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.studio-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── Section ─────────────────────────────────────────────────────────────── */
.studio-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
}

.studio-section-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.studio-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.studio-section-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Compact gallery grid ────────────────────────────────────────────────── */
.studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}

.studio-card {
  position: relative;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.15s;
  background: var(--surface2);
}

.studio-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

.studio-card.selected {
  border-color: var(--accent);
}

.studio-card-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Order number badge */
.studio-card-num {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a0f06;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.studio-card.selected .studio-card-num {
  opacity: 1;
}

/* Unselected indicator */
.studio-card:not(.selected):hover::after {
  content: "+";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.studio-card-name {
  padding: 5px 6px 6px;
  font-size: 0.68rem;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-card-length {
  display: inline-block;
  font-size: 0.58rem;
  color: var(--text-muted);
  margin: 0 6px 5px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 99px;
}

/* ── Length dividers in grid ─────────────────────────────────────────────── */
.studio-length-hdr {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.studio-length-hdr:first-child { margin-top: 0; }

.studio-length-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.studio-length-line { flex: 1; height: 1px; background: var(--border); }

/* Empty state */
.studio-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 40px 0;
  line-height: 1.7;
}

/* ── Sequence section ────────────────────────────────────────────────────── */
.studio-seq-section {
  border-color: var(--accent);
}

.studio-seq-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 14px;
}
.studio-seq-row::-webkit-scrollbar { display: none; }

.studio-seq-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.studio-seq-num {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--accent);
}

.studio-seq-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.studio-seq-name {
  font-size: 0.62rem;
  color: var(--text-muted);
  max-width: 56px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-seq-arrow {
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
  padding-bottom: 18px;
}

.studio-seq-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.studio-seq-info {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.studio-create-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.btn-collage:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Video section ───────────────────────────────────────────────────────── */
.studio-video-section {
  border-color: var(--border-hi);
}

.studio-video-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

@media (max-width: 600px) {
  .studio-main { padding: 16px 12px 40px; }
  .studio-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
  .studio-header { padding: 10px 16px; }
}
