/* AI Studio - 페르소나 쇼츠 자동생성 시스템 */

/* 폰트 임포트 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --border: #2a2a3a;
  --border-active: #7c3aed;
  --accent: #7c3aed;
  --accent-light: #a855f7;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-primary: #f1f1f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
}

body {
  font-family: 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── 헤더 ─── */
.header {
  background: linear-gradient(135deg, #0d0d18 0%, #120f1f 100%);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), #c026d3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #e0d7ff, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ─── 메인 레이아웃 ─── */
.main-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  min-height: calc(100vh - 65px);
}

.left-panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
}

.right-panel {
  background: var(--bg-primary);
  overflow-y: auto;
  padding: 1.5rem;
}

/* ─── 섹션 ─── */
.section {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title .step-badge {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: white;
  font-weight: 700;
}

/* ─── 인풋 스타일 ─── */
.input-group {
  margin-bottom: 0.875rem;
}

.input-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  display: block;
  font-weight: 500;
}

.input-field {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field.textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* ─── 플랫폼 탭 ─── */
.platform-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.platform-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-weight: 500;
}

.platform-tab.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ─── 페르소나 카드 ─── */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.persona-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.persona-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}

.persona-card.selected {
  background: rgba(124, 58, 237, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.persona-card .persona-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.3rem;
}

.persona-card .persona-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
}

.persona-card .persona-tone {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.persona-card.selected .persona-name {
  color: var(--accent-light);
}

.selected-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: white;
}

/* ─── 키워드 태그 ─── */
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.keyword-tag {
  padding: 0.3rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  user-select: none;
}

.keyword-tag.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ─── 프리셋 선택 ─── */
.preset-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preset-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-item:hover {
  border-color: rgba(124, 58, 237, 0.4);
}

.preset-item.selected {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--accent);
}

.preset-radio {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: all 0.2s;
  flex-shrink: 0;
}

.preset-item.selected .preset-radio {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.preset-info {
  flex: 1;
}

.preset-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.preset-font-preview {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ─── 보이스 카드 ─── */
.voice-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.voice-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-item:hover {
  border-color: rgba(124, 58, 237, 0.4);
}

.voice-item.selected {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--accent);
}

.voice-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.voice-info {
  flex: 1;
}

.voice-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.voice-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ─── CTA 버튼 ─── */
.btn-generate {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), #c026d3);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5);
}

.btn-generate:active:not(:disabled) {
  transform: translateY(0);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--text-primary);
}

.btn-accent {
  padding: 0.5rem 1rem;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-light);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-accent:hover {
  background: rgba(124, 58, 237, 0.25);
}

/* ─── 우측 패널: 스테이지 뷰어 ─── */
.stage-viewer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.stage-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  position: relative;
}

.stage-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.stage-step.done:not(:last-child)::after {
  background: var(--success);
}

.stage-step.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--accent) 0%, var(--border) 100%);
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}

.stage-step.done .step-circle {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  color: var(--success);
}

.stage-step.active .step-circle {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse-step 1.5s infinite;
}

@keyframes pulse-step {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
  50% { box-shadow: 0 0 18px rgba(124, 58, 237, 0.5); }
}

.step-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: center;
  white-space: nowrap;
}

.stage-step.done .step-label { color: var(--success); }
.stage-step.active .step-label { color: var(--accent-light); }

/* ─── 대본 뷰어 ─── */
.script-viewer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.script-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.script-viewer-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.script-actions {
  display: flex;
  gap: 0.4rem;
}

.script-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-primary);
  min-height: 120px;
  position: relative;
  white-space: pre-wrap;
}

.script-content.editable {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.script-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.script-char-count {
  text-align: right;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ─── 자막 미리보기 ─── */
.subtitle-preview {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 9/16;
  max-width: 200px;
  position: relative;
  border: 2px solid var(--border);
}

.preview-video-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.2);
  font-size: 2rem;
}

.preview-subtitle {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  padding: 0 12px;
  text-align: center;
}

.preview-subtitle-text {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
}

/* ─── TTS 섹션 ─── */
.tts-player {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.play-btn {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.play-btn:hover { background: var(--accent-light); }

.audio-waveform {
  flex: 1;
  height: 32px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  gap: 2px;
}

.wave-bar {
  flex: 1;
  background: var(--accent);
  opacity: 0.4;
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.2s; }
.wave-bar:nth-child(7) { animation-delay: 0.1s; }
.wave-bar:nth-child(8) { animation-delay: 0.3s; }

@keyframes wave {
  0%, 100% { height: 20%; }
  50% { height: 80%; }
}

/* ─── 히스토리 ─── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: rgba(124, 58, 237, 0.4);
  background: var(--bg-card-hover);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.history-persona {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.history-status {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
}

.status-pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-script_ready { background: rgba(16,185,129,0.15); color: #10b981; }
.status-tts_ready { background: rgba(59,130,246,0.15); color: #3b82f6; }
.status-complete { background: rgba(124,58,237,0.15); color: #a855f7; }
.status-error { background: rgba(239,68,68,0.15); color: #ef4444; }

.history-url {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.4rem;
}

.history-script-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ─── API 키 알림 배너 ─── */
.api-alert {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: #fcd34d;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.api-alert.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ─── 탭 시스템 ─── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

/* ─── 로딩 스피너 ─── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── 토스트 알림 ─── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slide-in 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.success { background: rgba(16,185,129,0.9); color: white; }
.toast.error { background: rgba(239,68,68,0.9); color: white; }
.toast.info { background: rgba(59,130,246,0.9); color: white; }

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── n8n 프로그레스 ─── */
.n8n-status {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.n8n-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
}

.n8n-dot.connected { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.n8n-dot.processing { background: var(--accent); animation: pulse-step 1s infinite; }

/* ─── 반응형 ─── */
@media (max-width: 900px) {
  /* 레이아웃: 1컬럼 스택 */
  .main-layout {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  /* 왼쪽 패널: sticky 해제, 높이 auto */
  .left-panel {
    height: auto;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* 오른쪽 패널: 패딩 줄이기 */
  .right-panel {
    padding: 1rem;
  }

  /* 섹션 패딩 줄이기 */
  .section {
    padding: 1rem;
  }

  /* 헤더 간소화 */
  .header {
    padding: 0 1rem;
    height: 52px;
  }
  .logo-sub {
    display: none;
  }

  /* 페르소나 그리드: 모바일에서 5열 유지하되 폰트 작게 */
  .persona-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3rem;
  }
  .persona-card {
    padding: 0.4rem 0.2rem;
    font-size: 0.6rem;
  }
  .persona-card .persona-icon {
    font-size: 1.2rem;
  }

  /* 탭 버튼 */
  .tab-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }

  /* 버튼 전체 */
  .btn-generate {
    font-size: 0.82rem;
    padding: 0.7rem 1rem;
  }

  /* 워크스페이스 카드 */
  .workspace-card {
    padding: 0.75rem;
  }

  /* 히스토리 리스트 */
  .job-item {
    padding: 0.6rem 0.75rem;
  }

  /* 폼 인풋 */
  .input-field,
  .input-textarea,
  select {
    font-size: 0.9rem;
  }

  /* 자막 설정 그리드 2컬럼 → 2컬럼 유지 (폭 있으므로 OK) */
}

/* 480px 이하: 소형 스마트폰 */
@media (max-width: 480px) {
  .main-layout {
    font-size: 14px;
  }

  /* 헤더 */
  .header {
    height: 48px;
  }
  .logo-title {
    font-size: 1rem;
  }

  /* 페르소나 5열 → 좀 더 꽉 채우기 */
  .persona-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
  }
  .persona-card {
    padding: 0.35rem 0.1rem;
    border-radius: 6px;
  }
  .persona-card .persona-icon {
    font-size: 1.1rem;
  }
  .persona-card span:last-child {
    font-size: 0.58rem;
  }

  /* 탭 */
  .tab-btn {
    font-size: 0.65rem;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
  }

  /* 섹션 */
  .section {
    padding: 0.75rem;
  }
  .section-title {
    font-size: 0.65rem;
  }

  /* 생성 버튼 */
  .btn-generate {
    font-size: 0.78rem;
  }

  /* 오른쪽 패널 */
  .right-panel {
    padding: 0.75rem;
  }

  /* range 슬라이더 터치 영역 */
  input[type="range"] {
    height: 28px;
  }
}

/* ─── 스크롤바 ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a4a; }

/* ─── 유틸리티 ─── */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.divider { height: 1px; background: var(--border); margin: 0.75rem 0; }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ─── 영상 합성 / 렌더링 ─── */
#renderProgressBar {
  transition: width 0.4s ease;
}

@keyframes renderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.rendering-active {
  animation: renderPulse 1.5s ease-in-out infinite;
}

/* ─── 속도 버튼 ─── */
.speed-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.68rem;
  transition: all 0.15s;
}
.speed-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}
.speed-btn.active {
  background: rgba(124,58,237,0.25);
  border-color: #7c3aed;
  color: #a78bfa;
}

/* ─── 다운로드 버튼 강조 ─── */
.btn-download-video {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 0.65rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.btn-download-video:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

