/* ═══════════════════════════════════════
   AI 영상 제작 페이지 전용 스타일 v2
═══════════════════════════════════════ */

/* ── 전체 래퍼 ── */
.avideo-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  font-family: 'Gowun Dodum', 'Noto Sans KR', sans-serif;
}

/* ── 페이지 헤더 ── */
.avideo-page-header { margin-bottom: 24px; }
.avideo-page-title { font-size: 1.55rem; font-weight: 700; color: #1a2a3a; }
.avideo-page-sub { font-size: 0.88rem; color: #6b7280; margin-top: 4px; }

/* ── 잠금 안내 ── */
.avideo-lock-notice { border-radius: 12px; margin-bottom: 20px; font-size: 0.9rem; }

/* ── 공통 안내 배너 ── */
.avideo-notice {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 8px 12px; font-size: 0.82rem; color: #1d4ed8;
}
.avideo-notice.avideo-notice-warning {
  background: #fffbeb; border-color: #fde68a; color: #92400e; margin-bottom: 12px;
}

/* ── 툴바 ── */
.avideo-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px;
}

.avideo-btn-model {
  display: flex; align-items: center;
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
  color: #fff; border: none; border-radius: 12px; padding: 10px 18px;
  font-size: 0.92rem; font-weight: 600; font-family: 'Gowun Dodum', sans-serif;
  transition: all 0.2s; box-shadow: 0 4px 14px rgba(26,54,93,0.25);
}
.avideo-btn-model:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e4280 0%, #3182ce 100%);
  box-shadow: 0 6px 18px rgba(26,54,93,0.35); color: #fff; transform: translateY(-1px);
}
.avideo-btn-model:disabled { opacity: 0.5; cursor: not-allowed; }
.avideo-model-badge {
  background: rgba(255,255,255,0.22); border-radius: 6px; padding: 2px 8px;
  font-size: 0.72rem; font-weight: 500; margin-left: 6px;
}
.avideo-chevron { font-size: 0.72rem; opacity: 0.8; }

/* 모드 토글 */
.avideo-mode-group {
  display: flex; gap: 0; border-radius: 12px; overflow: hidden;
  border: 1px solid #d1d9e6; background: #f5f7fa;
}
.avideo-mode-label {
  display: flex; align-items: center; padding: 9px 14px; font-size: 0.85rem;
  font-weight: 500; color: #64748b; cursor: pointer; transition: all 0.18s;
  margin: 0; user-select: none; white-space: nowrap;
}
.avideo-mode-label input[type="radio"] { display: none; }
.avideo-mode-label.active {
  background: linear-gradient(135deg, #2b6cb0 0%, #3182ce 100%); color: #fff; font-weight: 600;
}
.avideo-mode-label:hover:not(.active) { background: #e8edf5; color: #2b6cb0; }

/* 보조 버튼 */
.avideo-btn-secondary {
  background: #fff; border: 1px solid #d1d9e6; color: #374151; border-radius: 10px;
  padding: 9px 16px; font-size: 0.88rem; font-family: 'Gowun Dodum', sans-serif;
  transition: all 0.18s;
}
.avideo-btn-secondary:hover:not(:disabled) { background: #f0f4f9; border-color: #9ab0cc; color: #1e3a5f; }
.avideo-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 메인 그리드 ── */
.avideo-main-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start;
}
@media (max-width: 900px) { .avideo-main-grid { grid-template-columns: 1fr; } }

/* ── 공통 카드 ── */
.avideo-card {
  background: #fff; border: 1px solid #dde5f0; border-radius: 16px;
  overflow: hidden; box-shadow: 0 2px 12px rgba(18,40,70,0.05); margin-bottom: 16px;
}
.avideo-card:last-child { margin-bottom: 0; }
.avideo-card-header {
  display: flex; align-items: center; padding: 13px 18px;
  background: linear-gradient(90deg, #f0f5fc 0%, #f8fafd 100%);
  border-bottom: 1px solid #dde5f0; font-size: 0.9rem; font-weight: 700; color: #21344d;
}
.avideo-card-header-collapsible {
  cursor: pointer; justify-content: space-between; user-select: none;
}
.avideo-card-header-collapsible:hover { background: #e8eef8; }
.avideo-collapse-chevron { font-size: 0.72rem; color: #6b7280; transition: transform 0.2s; }
.avideo-card-header-collapsible[aria-expanded="true"] .avideo-collapse-chevron { transform: rotate(180deg); }
.avideo-card-body { padding: 16px 18px; }

/* ── 섹션 구분선 ── */
.avideo-section-divider {
  display: flex; flex-direction: column; gap: 3px;
  margin: 16px 0 10px; padding: 10px 12px;
  background: linear-gradient(90deg, #edf2ff, #f8fafd);
  border-left: 3px solid #4361ee; border-radius: 0 8px 8px 0;
  font-size: 0.85rem; font-weight: 700; color: #21344d;
}
.avideo-section-desc { font-size: 0.78rem; color: #6b7280; font-weight: 400; }

/* ── 이미지 드롭존 ── */
.avideo-image-dropzone {
  border: 2px dashed #b8c9e0; border-radius: 12px; padding: 28px 20px;
  text-align: center; background: #f8fafd; transition: border-color 0.2s, background 0.2s;
  margin-bottom: 12px;
}
.avideo-image-dropzone.drag-over { border-color: #2b6cb0; background: #ebf2fb; }
.avideo-dropzone-sm { padding: 16px 14px; margin-top: 10px; }
.avideo-drop-icon { font-size: 2.2rem; color: #93b4d4; margin-bottom: 10px; display: block; }
.avideo-drop-icon-sm { font-size: 1.4rem; color: #93b4d4; margin-bottom: 6px; display: block; }
.avideo-drop-text { font-size: 0.88rem; color: #6b7280; margin-bottom: 16px; }
.avideo-drop-text-sm { font-size: 0.82rem; color: #6b7280; margin-bottom: 10px; }
.avideo-image-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.avideo-btn-upload {
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%); color: #fff; border: none;
  border-radius: 9px; padding: 8px 16px; font-size: 0.85rem;
  font-family: 'Gowun Dodum', sans-serif; cursor: pointer; transition: all 0.2s;
}
.avideo-btn-upload:hover { background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #fff; transform: translateY(-1px); }

.avideo-btn-gallery-pick {
  background: linear-gradient(135deg, #276749 0%, #38a169 100%); color: #fff; border: none;
  border-radius: 9px; padding: 8px 16px; font-size: 0.85rem;
  font-family: 'Gowun Dodum', sans-serif; transition: all 0.2s;
}
.avideo-btn-gallery-pick:hover:not(:disabled) {
  background: linear-gradient(135deg, #1c4532 0%, #276749 100%); color: #fff; transform: translateY(-1px);
}
.avideo-btn-gallery-pick:disabled { opacity: 0.5; cursor: not-allowed; }

/* 이미지 프리뷰 */
.avideo-image-preview-wrap {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid #d1d9e6; margin-top: 4px;
}
.avideo-image-preview-wrap img { width: 100%; max-height: 240px; object-fit: contain; display: block; background: #f5f7fa; }
.avideo-image-remove-btn {
  position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5); color: #fff;
  border: none; border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
  cursor: pointer; transition: background 0.15s;
}
.avideo-image-remove-btn:hover { background: rgba(220,38,38,0.8); }
.avideo-image-filename {
  padding: 6px 12px; font-size: 0.78rem; color: #6b7280; background: #f8f9fa;
  border-top: 1px solid #e5e7eb; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}

/* ── 참조 이미지 그리드 ── */
.avideo-ref-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 600px) { .avideo-ref-grid { grid-template-columns: 1fr; } }

.avideo-ref-slot {
  border: 1px solid #dde5f0; border-radius: 12px; overflow: hidden;
  background: #f8fafd; display: flex; flex-direction: column;
}
.avideo-ref-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 10px; color: #9ca3af; font-size: 0.78rem; gap: 6px; min-height: 90px;
}
.avideo-ref-plus { font-size: 1.4rem; color: #c4d0de; }
.avideo-ref-filled { flex: 1; position: relative; min-height: 90px; }
.avideo-ref-thumb { width: 100%; height: 100px; object-fit: cover; display: block; }
.avideo-ref-remove {
  position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem;
  cursor: pointer; transition: background 0.15s;
}
.avideo-ref-remove:hover { background: rgba(220,38,38,0.85); }
.avideo-ref-actions { padding: 8px; border-top: 1px solid #e5edf7; background: #fff; }

/* ── 텍스트에어리어 ── */
.avideo-textarea {
  width: 100%; border: 1px solid #cfd9e6; border-radius: 10px; padding: 12px 14px;
  font-size: 0.9rem; font-family: 'Gowun Dodum', sans-serif; color: #223246;
  resize: vertical; transition: border-color 0.18s, box-shadow 0.18s; line-height: 1.6;
}
.avideo-textarea:focus { outline: none; border-color: #457b9d; box-shadow: 0 0 0 3px rgba(69,123,157,0.15); }
.avideo-textarea:disabled { background: #f5f7fa; color: #9ca3af; cursor: not-allowed; }
.avideo-textarea-sm { font-size: 0.85rem; }
.avideo-prompt-footer { display: flex; justify-content: flex-end; margin-top: 6px; }
.avideo-char-count { font-size: 0.78rem; color: #9ca3af; }

/* 프롬프트 액션 버튼 (클리어 / 붙여넣기) — aimg-translate-btn 스타일에 맞춤 */
.avideo-prompt-actions { display: inline-flex; align-items: center; gap: 5px; }
.avideo-prompt-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid #457b9d; background: #fff;
  color: #457b9d; cursor: pointer; transition: all 0.2s ease;
}
.avideo-prompt-icon-btn:hover {
  background: #457b9d; color: #fff;
}
.avideo-prompt-icon-btn:active { transform: scale(0.92); }

/* ── 생성 버튼 ── */
.avideo-btn-generate {
  background: linear-gradient(135deg, #1a365d 0%, #2d6a4f 50%, #40916c 100%);
  color: #fff; border: none; border-radius: 12px; padding: 14px 20px;
  font-size: 1rem; font-weight: 700; font-family: 'Gowun Dodum', sans-serif;
  transition: all 0.25s; box-shadow: 0 4px 16px rgba(26,54,93,0.3); margin-bottom: 16px;
}
.avideo-btn-generate:hover:not(:disabled) {
  box-shadow: 0 6px 22px rgba(26,54,93,0.4); color: #fff; transform: translateY(-2px);
}
.avideo-btn-generate:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── 작업 로그 ── */
.avideo-log-wrap { background: #0f1923; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.avideo-log-header { padding: 8px 14px; background: #1a2535; color: #7dd3fc; font-size: 0.8rem; font-weight: 600; }
.avideo-log-body {
  padding: 12px 14px; font-size: 0.8rem; color: #a7c3dc;
  font-family: 'Courier New', monospace; max-height: 160px; overflow-y: auto; line-height: 1.7;
}
.avideo-log-body .log-ok { color: #4ade80; }
.avideo-log-body .log-err { color: #f87171; }
.avideo-log-body .log-info { color: #7dd3fc; }

/* ── 결과 카드 ── */
.avideo-result-card { min-height: 280px; }
.avideo-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: #b0bec5; text-align: center;
}
.avideo-placeholder-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.35; }
.avideo-placeholder p { font-size: 0.88rem; line-height: 1.6; margin: 0; }

.avideo-result-list { display: flex; flex-direction: column; gap: 16px; }
.avideo-result-item { border-radius: 12px; overflow: hidden; background: #0f1923; }
.avideo-result-video { width: 100%; display: block; border-radius: 12px 12px 0 0; }
.avideo-result-meta { padding: 8px 12px 4px; font-size: 0.78rem; color: #7dd3fc; word-break: break-all; }
.avideo-result-actions { padding: 6px 12px 12px; display: flex; gap: 8px; }

/* ── 설정 요약 ── */
.avideo-settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.avideo-setting-item { background: #f8fafd; border: 1px solid #e5edf7; border-radius: 10px; padding: 10px 12px; }
.avideo-setting-key { display: block; font-size: 0.75rem; color: #8898aa; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.avideo-setting-val { display: block; font-size: 0.9rem; font-weight: 700; color: #1a365d; }

/* 기능 뱃지 */
.avideo-feature-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.avideo-fbadge {
  background: #dbeafe; color: #1d4ed8; border-radius: 20px;
  padding: 3px 10px; font-size: 0.75rem; font-weight: 600;
}


/* ═══════════════════════════════════════
   모달 공통
═══════════════════════════════════════ */
.avideo-modal-content {
  border-radius: 18px; overflow: hidden; border: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.avideo-modal-header {
  background: linear-gradient(135deg, #1a2a3a 0%, #1a365d 100%);
  color: #fff; border-bottom: none; padding: 16px 22px;
}
.avideo-modal-footer { border-top: 1px solid #e5edf7; background: #f8fafd; padding: 12px 20px; }

.avideo-btn-confirm {
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%); color: #fff; border: none;
  border-radius: 9px; padding: 8px 20px; font-family: 'Gowun Dodum', sans-serif;
  font-weight: 600; transition: all 0.18s;
}
.avideo-btn-confirm:hover { background: linear-gradient(135deg, #1e4280 0%, #3182ce 100%); color: #fff; transform: translateY(-1px); }

.avideo-btn-danger {
  background: #fff; border: 1px solid #fca5a5; color: #dc2626; border-radius: 9px;
  font-family: 'Gowun Dodum', sans-serif; transition: all 0.18s;
}
.avideo-btn-danger:hover:not(:disabled) { background: #fee2e2; border-color: #f87171; color: #b91c1c; }
.avideo-btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }


/* ═══════════════════════════════════════
   모델 선택 모달 - 사이드바+패널 레이아웃
═══════════════════════════════════════ */
.avideo-model-picker-layout {
  display: grid; grid-template-columns: 210px 1fr; min-height: 420px;
}
@media (max-width: 650px) { .avideo-model-picker-layout { grid-template-columns: 1fr; } }

/* 사이드바 */
.avideo-model-sidebar {
  background: #0f1923; border-right: 1px solid #1e2d40;
  display: flex; flex-direction: column; overflow-y: auto;
}
.avideo-model-sidebar-group {
  padding: 10px 14px 6px; font-size: 0.68rem; font-weight: 700;
  color: #4b6882; text-transform: uppercase; letter-spacing: 0.8px;
}
.avideo-model-item {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 12px 14px; background: transparent; border: none;
  border-left: 3px solid transparent; color: #94a3b8;
  cursor: pointer; transition: all 0.18s; font-family: 'Gowun Dodum', sans-serif;
  text-align: left;
}
.avideo-model-item:hover { background: rgba(255,255,255,0.05); color: #cbd5e1; }
.avideo-model-item.active { background: rgba(59,130,246,0.12); border-left-color: #3b82f6; color: #fff; }
.avideo-model-item-name { font-size: 0.88rem; font-weight: 700; line-height: 1.2; }
.avideo-model-item-id { font-size: 0.65rem; color: #4b6882; font-family: monospace; margin-top: 2px; }
.avideo-model-item.active .avideo-model-item-id { color: #7dd3fc; }
.avideo-model-item-tags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }

.avideo-mtag {
  border-radius: 4px; padding: 1px 6px; font-size: 0.65rem; font-weight: 700;
}
.avideo-mtag-blue { background: rgba(59,130,246,0.25); color: #93c5fd; }
.avideo-mtag-green { background: rgba(52,211,153,0.2); color: #6ee7b7; }
.avideo-mtag-orange { background: rgba(251,191,36,0.2); color: #fcd34d; }
.avideo-mtag-gray { background: rgba(148,163,184,0.15); color: #94a3b8; }

/* 옵션 패널 */
.avideo-model-panel-area { overflow-y: auto; max-height: 520px; }
.avideo-model-panel { padding: 20px 22px; }

.avideo-model-panel-header { margin-bottom: 16px; }
.avideo-model-id {
  background: #edf2ff; color: #4361ee; border-radius: 6px;
  padding: 2px 8px; font-size: 0.75rem;
}
.avideo-model-desc { font-size: 0.85rem; color: #64748b; line-height: 1.55; }

/* 기능 뱃지 행 */
.avideo-feature-row { display: flex; flex-wrap: wrap; gap: 6px; }
.avideo-feat-badge {
  background: #f0f4f9; border: 1px solid #d1d9e6; border-radius: 20px;
  padding: 3px 10px; font-size: 0.74rem; font-weight: 600; color: #475569;
}
.avideo-feat-badge-blue { background: #dbeafe; border-color: #bfdbfe; color: #1d4ed8; }
.avideo-feat-badge-green { background: #d1fae5; border-color: #a7f3d0; color: #065f46; }
.avideo-feat-badge-gray { background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; }

/* 옵션 그리드 */
.avideo-options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 600px) { .avideo-options-grid { grid-template-columns: 1fr; } }

.avideo-option-card {
  background: #f8fafd; border: 1px solid #dde5f0; border-radius: 12px; padding: 14px 16px;
}
.avideo-option-label {
  font-size: 0.85rem; font-weight: 700; color: #21344d; margin-bottom: 4px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.avideo-option-badge {
  background: #e2e8f0; color: #475569; border-radius: 5px;
  padding: 1px 7px; font-size: 0.7rem; font-weight: 500; font-family: monospace;
}
.avideo-option-badge-new { background: #dbeafe; color: #1d4ed8; }
.avideo-option-desc { font-size: 0.78rem; color: #6b7280; margin-bottom: 10px; line-height: 1.45; }

/* 라디오 필 */
.avideo-radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.avideo-radio-pill {
  display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 20px;
  border: 1px solid #cfd9e6; background: #fff; font-size: 0.82rem; color: #374151;
  cursor: pointer; transition: all 0.15s; margin: 0; user-select: none;
}
.avideo-radio-pill input[type="radio"] { display: none; }
.avideo-radio-pill.active,
.avideo-radio-pill:has(input:checked) {
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
  color: #fff; border-color: #2b6cb0; font-weight: 600;
}
.avideo-radio-pill:hover:not(.active):not(:has(input:disabled)) { border-color: #93b4d4; background: #eef4fb; }

/* 모델 노트 */
.avideo-model-note {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 12px 16px; font-size: 0.83rem; color: #1e40af; line-height: 1.55;
}
.avideo-model-note-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }


/* ═══════════════════════════════════════
   갤러리 레이아웃
═══════════════════════════════════════ */
.avideo-gallery-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 360px;
}
@media (max-width: 600px) { .avideo-gallery-layout { grid-template-columns: 1fr; } }

.avideo-gallery-list {
  border: 1px solid #e5edf7; border-radius: 12px; overflow-y: auto;
  max-height: 420px; background: #f8fafd;
}
.avideo-gallery-group-header {
  padding: 6px 12px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: #fff;
  background: linear-gradient(90deg, #2b6cb0, #3182ce);
  position: sticky; top: 0; z-index: 1;
}
.avideo-gallery-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid #eef2f7; transition: background 0.15s;
  font-size: 0.8rem; color: #374151;
}
.avideo-gallery-item:hover { background: #e8eef8; }
.avideo-gallery-item.selected { background: #dbeafe; color: #1e3a8a; font-weight: 600; }
.avideo-gallery-cb { flex-shrink: 0; width: 15px; height: 15px; cursor: pointer; accent-color: #3b82f6; }
.avideo-gallery-item-thumb {
  width: 40px; height: 30px; object-fit: cover; border-radius: 5px;
  border: 1px solid #d1d9e6; flex-shrink: 0;
}
.avideo-gallery-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avideo-gallery-empty { padding: 30px 16px; text-align: center; color: #9ca3af; font-size: 0.85rem; }

/* 목록 + 페이지네이션 세로 배치 */
.avideo-gallery-list-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* 페이지네이션 */
.avideo-gallery-pagination {
  display: flex; flex-wrap: nowrap; justify-content: center; gap: 4px;
}
.avideo-gallery-pagination:empty { display: none; }
.avideo-page-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid #d8e2ef; background: #fff; color: #475569;
  border-radius: 8px; font-size: 0.8rem; font-family: 'Gowun Dodum', sans-serif;
  cursor: pointer; transition: all 0.15s;
}
.avideo-page-btn:hover:not(:disabled):not(.active) { background: #eef4fb; border-color: #b9cce6; }
.avideo-page-btn.active {
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
  border-color: #2b6cb0; color: #fff; font-weight: 700; cursor: default;
}
.avideo-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 갤러리 푸터 - 전체선택(좌) / 액션(우) */
.avideo-gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avideo-gallery-footer-actions { display: flex; align-items: center; gap: 8px; }
.avideo-select-all {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  font-size: 0.82rem; color: #475569; cursor: pointer; user-select: none;
}
.avideo-select-all input { width: 16px; height: 16px; cursor: pointer; accent-color: #3b82f6; }

.avideo-gallery-preview {
  border: 1px solid #e5edf7; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #f0f4f9; overflow: hidden;
}
.avideo-gallery-placeholder { text-align: center; color: #b0bec5; padding: 30px; }
.avideo-gallery-placeholder i { font-size: 2.8rem; margin-bottom: 12px; display: block; opacity: 0.4; }
.avideo-gallery-placeholder span { font-size: 0.85rem; line-height: 1.6; }
.avideo-gallery-preview img,
.avideo-gallery-preview video { max-width: 100%; max-height: 400px; border-radius: 8px; object-fit: contain; }


/* ═══════════════════════════════════════
   모델 탭 (수평선 위에 맞닿은 탭)
═══════════════════════════════════════ */
.avideo-tabs {
  display: flex; gap: 4px; border-bottom: 2px solid #d8e1ee;
  margin-bottom: 22px; padding-left: 2px;
}
.avideo-tab {
  position: relative; background: #eef2f8;
  border: 1px solid #d8e1ee; border-bottom: none;
  border-radius: 12px 12px 0 0; padding: 11px 26px;
  font-size: 0.95rem; font-weight: 700; color: #64748b; cursor: pointer;
  margin-bottom: -2px; transition: all 0.18s; font-family: 'Gowun Dodum', sans-serif;
}
.avideo-tab:hover:not(.active) { background: #e3eaf4; color: #334155; }
.avideo-tab.active { background: #fff; color: #1a365d; border-color: #d8e1ee; border-bottom: 2px solid #fff; }
.avideo-tab.active::before {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: 28px; top: 0; height: 3px; border-radius: 3px;
}
.avideo-tab[data-tab="veo"].active { color: #1a365d; }
.avideo-tab[data-tab="veo"].active::before { background: linear-gradient(90deg, #1a365d, #3182ce); }
.avideo-tab[data-tab="seedance"].active { color: #6d28d9; }
.avideo-tab[data-tab="seedance"].active::before { background: linear-gradient(90deg, #6d28d9, #a855f7); }


/* ═══════════════════════════════════════
   Seedance 모델 탭 - 보라/바이올렛 테마
═══════════════════════════════════════ */
.avideo-seedance .avideo-card-header {
  background: linear-gradient(90deg, #f6f0fd 0%, #fbf8fe 100%);
  border-bottom-color: #eae0fb; color: #3b1670;
}
.avideo-seedance .avideo-card-header-collapsible:hover { background: #f0e6fb; }
.avideo-seedance .avideo-section-divider {
  background: linear-gradient(90deg, #f3ebff, #fbf8fe);
  border-left-color: #7c3aed; color: #3b1670;
}
.avideo-seedance .avideo-option-badge-new { background: #ede0fd; color: #6d28d9; }
.avideo-seedance .avideo-radio-pill.active,
.avideo-seedance .avideo-radio-pill:has(input:checked) {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  border-color: #7c3aed; color: #fff;
}
.avideo-seedance .avideo-radio-pill:hover:not(.active):not(:has(input:disabled)) {
  border-color: #c4a8f0; background: #f5effd;
}
.avideo-seedance .avideo-btn-generate {
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 50%, #a855f7 100%);
  box-shadow: 0 4px 16px rgba(76,29,149,0.3);
}
.avideo-seedance .avideo-btn-generate:hover:not(:disabled) { box-shadow: 0 6px 22px rgba(76,29,149,0.4); }
.avideo-seedance .avideo-btn-gallery-pick {
  background: linear-gradient(135deg, #9d174d 0%, #db2777 100%);
}
.avideo-seedance .avideo-btn-gallery-pick:hover:not(:disabled) {
  background: linear-gradient(135deg, #831843 0%, #be185d 100%);
}
.avideo-seedance .avideo-setting-val { color: #4c1d95; }
.avideo-seedance .avideo-fbadge { background: #ede0fd; color: #6d28d9; }
.avideo-seedance .avideo-notice {
  background: #faf5ff; border-color: #e9d5ff; color: #6b21a8;
}
.avideo-seedance .avideo-prompt-icon-btn { border-color: #7c3aed; color: #7c3aed; }
.avideo-seedance .avideo-prompt-icon-btn:hover { background: #7c3aed; color: #fff; }
.avideo-seedance .avideo-textarea:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.avideo-seedance code,
.avideo-seedance .avideo-notice code {
  background: #f3e8ff; color: #7c3aed; padding: 1px 5px; border-radius: 4px; font-size: 0.92em;
}

/* 모델 칩 */
.avideo-sd-model-chip {
  display: flex; align-items: center;
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
  color: #fff; border-radius: 12px; padding: 10px 18px;
  font-size: 0.92rem; font-weight: 600; box-shadow: 0 4px 14px rgba(76,29,149,0.25);
}
.avideo-sd-model-name { font-weight: 700; }
.avideo-sd-model-chip .avideo-model-badge { background: rgba(255,255,255,0.22); }

/* 참조 개수 표시 */
.avideo-sd-count {
  font-size: 0.78rem; font-weight: 600; color: #7c3aed;
  background: #f3e8ff; border-radius: 20px; padding: 2px 10px;
}

/* 참조 그리드 */
.avideo-sd-ref-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.avideo-sd-ref-grid:empty { display: none; }
@media (max-width: 600px) { .avideo-sd-ref-grid { grid-template-columns: repeat(2, 1fr); } }
.avideo-sd-aud-list { grid-template-columns: 1fr; }

.avideo-sd-ref-item {
  position: relative; border: 1px solid #e9d5ff; border-radius: 10px;
  overflow: hidden; background: #faf5ff;
}
.avideo-sd-ref-item img, .avideo-sd-ref-item video {
  width: 100%; height: 90px; object-fit: cover; display: block; background: #1e1b2e;
}
.avideo-sd-ref-tag {
  position: absolute; top: 5px; left: 5px; background: rgba(76,29,149,0.85);
  color: #fff; font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 5px;
}
.avideo-sd-ref-x {
  position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem;
  cursor: pointer; transition: background 0.15s;
}
.avideo-sd-ref-x:hover { background: rgba(220,38,38,0.85); }
.avideo-sd-ref-name {
  padding: 4px 8px; font-size: 0.72rem; color: #6b21a8; background: #fff;
  border-top: 1px solid #f0e6fb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 오디오 항목 */
.avideo-sd-aud-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.avideo-sd-aud-item audio { flex: 1; height: 34px; min-width: 0; }
.avideo-sd-aud-item .avideo-sd-ref-tag { position: static; flex-shrink: 0; }
.avideo-sd-aud-item .avideo-sd-ref-x { position: static; flex-shrink: 0; }
.avideo-sd-aud-item .avideo-sd-ref-name {
  flex: 1; padding: 0; background: none; border: none; min-width: 0;
}

/* 토글 스위치 */
.avideo-sd-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin: 0; }
.avideo-sd-switch input { display: none; }
.avideo-sd-switch-track {
  position: relative; width: 42px; height: 24px; border-radius: 20px;
  background: #cbd5e1; transition: background 0.2s; flex-shrink: 0;
}
.avideo-sd-switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.avideo-sd-switch input:checked + .avideo-sd-switch-track { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.avideo-sd-switch input:checked + .avideo-sd-switch-track::after { transform: translateX(18px); }
.avideo-sd-switch-label { font-size: 0.85rem; font-weight: 700; color: #21344d; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }


/* ═══════════════════════════════════════
   이미지 픽 모달 - 카테고리 탭
═══════════════════════════════════════ */
.avideo-pick-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid #e5edf7;
}
.avideo-pick-tabs:empty { display: none; }
.avideo-pick-tab {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f1f5f9; border: 1px solid #dde5f0; color: #475569;
  border-radius: 20px; padding: 6px 14px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-family: 'Gowun Dodum', sans-serif;
}
.avideo-pick-tab:hover:not(.active) { background: #e3eaf4; border-color: #b9cce6; color: #1e3a5f; }
.avideo-pick-tab.active {
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
  border-color: #2b6cb0; color: #fff;
}
.avideo-pick-tab-count {
  background: rgba(255,255,255,0.25); color: inherit; border-radius: 10px;
  padding: 0 7px; font-size: 0.72rem; font-weight: 700; min-width: 20px; text-align: center;
}
.avideo-pick-tab:not(.active) .avideo-pick-tab-count { background: #e2e8f0; color: #64748b; }


/* ═══════════════════════════════════════
   프롬프트 영어 번역 버튼
═══════════════════════════════════════ */
.avideo-translate-btn {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 8px; border: 1px solid #457b9d; background: #fff; color: #457b9d;
  font-size: 0.78rem; font-weight: 600; font-family: 'Gowun Dodum', sans-serif;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.avideo-translate-btn:hover:not(:disabled) { background: #457b9d; color: #fff; }
.avideo-translate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.avideo-seedance .avideo-translate-btn { border-color: #7c3aed; color: #7c3aed; }
.avideo-seedance .avideo-translate-btn:hover:not(:disabled) { background: #7c3aed; color: #fff; }
