/* Custom styles supplementing Tailwind */

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: #475569; background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s;
}
.nav-btn:hover { background: #f1f5f9; color: #1e293b; }
.nav-btn.active { background: #2563eb; color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,0.3); }
.nav-btn.active:hover { background: #1d4ed8; }

.form-label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; background: #fff;
  transition: border 0.15s, box-shadow 0.15s;
}
.form-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.form-input::placeholder { color: #cbd5e1; }

.drop-zone {
  border: 2px dashed #e2e8f0; border-radius: 12px;
  padding: 32px 16px; text-align: center;
  cursor: pointer; transition: all 0.15s; background: #f8fafc;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: #3b82f6; background: #eff6ff;
}

.ref-thumb {
  position: relative; aspect-ratio: 1;
  background-size: cover; background-position: center;
  border-radius: 8px; border: 1px solid #e2e8f0;
  transition: transform 0.15s;
}
.ref-thumb:hover { transform: scale(1.05); }
.ref-thumb .tag-toggle {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  display: flex; gap: 2px;
}
.ref-thumb .tag-toggle button {
  flex: 1; font-size: 9px; padding: 2px 4px; border-radius: 4px;
  background: rgba(255,255,255,0.9); color: #475569; border: 0;
  font-weight: 600; cursor: pointer; backdrop-filter: blur(4px);
  transition: all 0.1s;
}
.ref-thumb .tag-toggle button.active { background: #2563eb; color: #fff; }
.ref-thumb .tag-toggle button.active.comp { background: #8b5cf6; }
.ref-thumb .tag-toggle button.active.review { background: #f59e0b; }
.ref-thumb .tag-toggle button.active.recipe { background: #16a34a; }
.ref-tag-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
  vertical-align: middle;
}
.ref-tag-real { background: #2563eb; }
.ref-tag-comp { background: #8b5cf6; }
.ref-tag-review { background: #f59e0b; }
.ref-tag-recipe { background: #16a34a; }

.ref-thumb .rm {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #ef4444; color: #fff; border: 2px solid #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
}

/* Product table */
#product-tbody tr { transition: background 0.1s; }
#product-tbody tr:hover { background: #f8fafc; }
#product-tbody td { padding: 12px 16px; vertical-align: middle; }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.status-대기 { background: #f1f5f9; color: #64748b; }
.status-카피생성중, .status-이미지생성중 { background: #fef3c7; color: #92400e; }
.status-카피생성중::before, .status-이미지생성중::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.status-완료 { background: #d1fae5; color: #065f46; }
.status-실패 { background: #fee2e2; color: #991b1b; }
.status-카피검토대기 { background: #dbeafe; color: #1e40af; }

.detail-action-btn {
  background: #2563eb; color: #fff;
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  border: none; cursor: pointer; transition: background 0.1s;
}
.detail-action-btn:hover { background: #1d4ed8; }

.delete-btn {
  background: #fff; color: #b91c1c;
  padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  border: 1px solid #fecaca; cursor: pointer;
  transition: all 0.1s;
}
.delete-btn:hover { background: #fef2f2; border-color: #ef4444; color: #991b1b; }

/* Section card */
.section-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 20px; transition: box-shadow 0.15s;
}
.section-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.section-card h3 {
  margin: 0 0 16px; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; color: #0f172a;
}
.section-card h3 .section-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.copy-btn {
  background: transparent; border: 1px solid transparent;
  padding: 2px 6px; border-radius: 4px;
  font-size: 11px; cursor: pointer; color: #94a3b8;
  transition: all 0.1s;
}
.copy-btn:hover { color: #2563eb; background: #eff6ff; border-color: #dbeafe; }
.copy-btn.copied { color: #10b981; background: #d1fae5; border-color: #a7f3d0; }
.copy-btn.small { font-size: 11px; padding: 4px 8px; }

.image-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.image-card {
  position: relative;
  border-radius: 10px; overflow: hidden;
  border: 1px solid #e2e8f0; cursor: pointer;
  transition: all 0.15s; background: #fff;
  display: flex; flex-direction: column;
}
.image-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.image-card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: #f8fafc;
}
.image-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-card.selected { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }

.card-idea-caption {
  padding: 6px 8px;
  background: #fef3c7;
  border-top: 1px solid #fde68a;
  font-size: 11px;
  color: #78350f;
  display: flex; align-items: center; gap: 6px;
  overflow: hidden;
}
.card-idea-caption.muted { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }
.card-idea-caption .card-num {
  flex-shrink: 0;
  background: #f59e0b; color: #fff;
  padding: 1px 6px; border-radius: 4px;
  font-weight: 700; font-family: monospace;
  font-size: 10px;
}
.card-idea-caption.muted .card-num { background: #cbd5e1; color: #fff; }
.card-idea-caption .card-idea-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.image-card .pick {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #64748b;
  opacity: 0; transition: opacity 0.15s;
}
.shot-badge {
  position: absolute; top: 8px; left: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 4px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px;
  font-family: ui-monospace, monospace;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  z-index: 5;
}
.provider-badge {
  position: absolute; top: 8px; right: 8px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
}
.provider-badge.gemini { background: rgba(139, 92, 246, 0.95); color: #fff; }
.provider-badge.openai { background: rgba(16, 185, 129, 0.95); color: #fff; }
.image-card:hover .pick { opacity: 1; }
.image-card.selected .pick { opacity: 1; background: #3b82f6; color: #fff; }

.empty {
  padding: 24px; text-align: center;
  color: #cbd5e1; font-size: 13px;
  border: 2px dashed #f1f5f9; border-radius: 10px;
}

/* Progress banner — detail view */
.progress-banner {
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.progress-banner.done {
  background: #ecfdf5; border-color: #a7f3d0;
}
.progress-banner.error {
  background: #fef2f2; border-color: #fecaca;
}
.progress-spinner {
  width: 22px; height: 22px;
  border: 3px solid #c7d2fe; border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.progress-banner.done .progress-spinner { display: none; }
.progress-banner.error .progress-spinner { display: none; }
.progress-body { flex: 1; min-width: 0; }
.progress-label {
  font-size: 13px; font-weight: 600; color: #1e293b;
  display: flex; align-items: center; gap: 8px;
}
.progress-count {
  font-family: monospace; color: #2563eb; font-weight: 700;
}
.progress-bar-bg {
  margin-top: 6px;
  height: 6px; background: #ddd6fe; border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.progress-banner.done .progress-bar-fill { background: #10b981; }
.progress-banner.error .progress-bar-fill { background: #ef4444; }
.progress-banner.done .progress-label { color: #065f46; }
.progress-banner.error .progress-label { color: #991b1b; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox.hidden { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.92); backdrop-filter: blur(8px); }
.lightbox-img {
  position: relative; max-width: 90vw; max-height: 88vh;
  border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute; top: 24px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-dl {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #fff; color: #0f172a; padding: 10px 20px;
  border-radius: 999px; font-size: 14px; font-weight: 500;
  text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.1s;
}
.lightbox-dl:hover { transform: translateX(-50%) translateY(-1px); }

/* === v1.1: input panel + axis chips + regen modal === */
.input-panel {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  overflow: hidden;
}
.input-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer;
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px; font-weight: 600; color: #1e293b;
}
.input-panel-header:hover { filter: brightness(0.98); }
.input-panel-toggle { font-size: 11px; color: #64748b; }
.input-panel-body { padding: 16px; }
.input-panel-body.collapsed { display: none; }
.input-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; font-size: 13px;
}
.input-field { display: flex; flex-direction: column; gap: 2px; }
.input-field .lbl { font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.4px; }
.input-field .val { color: #0f172a; min-height: 18px; }
.input-field .val.muted { color: #cbd5e1; font-style: italic; }
.ref-thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px; margin-top: 10px;
}
.ref-thumbs img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 6px; border: 1px solid #e2e8f0; cursor: pointer;
  transition: transform 0.1s;
}
.ref-thumbs img:hover { transform: scale(1.05); border-color: #3b82f6; }

/* axis chips on image cards */
.axis-chips {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  display: flex; flex-wrap: wrap; gap: 3px;
  pointer-events: none;
}
.axis-chip {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  background: rgba(15,23,42,0.78); color: #fff;
  backdrop-filter: blur(6px);
  font-weight: 600; letter-spacing: 0.2px;
  pointer-events: auto;
}
.axis-chip.idea {
  background: rgba(245, 158, 11, 0.92);
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-card-tools {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 3px;
  opacity: 0; transition: opacity 0.15s;
}
.image-card:hover .image-card-tools { opacity: 1; }
.image-card-tools button {
  padding: 3px 7px; height: 22px;
  border-radius: 11px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  border: 0; color: #1e293b; font-size: 10px; font-weight: 600;
  cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.image-card-tools button:hover { background: #3b82f6; color: #fff; }
.image-card-tools button.spinning { animation: spin 1s linear infinite; pointer-events: none; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.image-card.regenerating { pointer-events: none; outline: 2px solid #2563eb; outline-offset: 2px; }
.regen-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(255,255,255,0.72); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
}
.regen-spinner {
  width: 36px; height: 36px;
  border: 3px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.regen-status {
  font-size: 11px; font-weight: 600; color: #1e40af;
  background: #fff; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  white-space: nowrap;
}
.regen-status.error { color: #b91c1c; background: #fef2f2; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.45); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative; background: #fff; border-radius: 16px;
  width: 100%; max-width: 640px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: modal-in 0.15s ease-out;
  overflow: hidden;
}
.modal-panel.modal-wide { max-width: 820px; }
.modal-body { overflow-x: hidden; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
}
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid #f1f5f9;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #8b5cf6); color: #fff;
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 13px;
  border: 0; cursor: pointer; transition: filter 0.1s;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary {
  background: #fff; color: #475569; border: 1px solid #e2e8f0;
  padding: 8px 16px; border-radius: 8px; font-weight: 500; font-size: 13px;
  cursor: pointer; transition: all 0.1s;
}
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.axis-lock-row {
  display: grid; grid-template-columns: 22px 110px minmax(0, 1fr);
  gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: #fafbfc; border: 1px solid #f1f5f9;
}
.axis-lock-row label { font-size: 12px; font-weight: 600; color: #475569; cursor: pointer; }
.axis-lock-row select {
  font-size: 12px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid #e2e8f0; background: #fff; color: #0f172a;
  width: 100%; min-width: 0;
  text-overflow: ellipsis;
}
.axis-lock-row select:disabled { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
@media (max-width: 560px) {
  .axis-lock-row { grid-template-columns: 22px 1fr; }
  .axis-lock-row select { grid-column: 1 / -1; }
}

.axis-picker-row {
  display: grid; grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px; align-items: center;
  padding: 4px 0;
}
.axis-picker-label {
  font-size: 12px; font-weight: 600; color: #475569;
}
.axis-picker-select {
  font-size: 12px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid #e2e8f0; background: #fff; color: #0f172a;
  width: 100%; min-width: 0;
  text-overflow: ellipsis;
}
.axis-picker-select:hover { border-color: #cbd5e1; }
.axis-picker-select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

/* meta 토글 (axes / shot intent) */
.meta-toggle {
  margin-top: 12px; padding: 0;
  background: transparent;
}
.meta-toggle summary {
  cursor: pointer; padding: 6px 10px;
  font-size: 12px; color: #64748b;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px;
  list-style: none; user-select: none;
}
.meta-toggle summary::-webkit-details-marker { display: none; }
.meta-toggle summary:hover { background: #f1f5f9; }
.meta-toggle[open] summary { background: #e2e8f0; }
.meta-body {
  padding: 10px 12px; margin-top: 6px;
  background: #fafbfc; border: 1px solid #f1f5f9;
  border-radius: 6px; font-size: 12px;
}
.meta-row { display: flex; gap: 10px; margin-bottom: 6px; align-items: flex-start; }
.meta-row:last-child { margin-bottom: 0; }
.meta-key {
  flex-shrink: 0; width: 80px;
  font-size: 11px; font-weight: 700;
  color: #94a3b8; text-transform: uppercase;
  padding-top: 2px;
}
.meta-val { flex: 1; color: #334155; line-height: 1.5; }
.meta-axes { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; }
.meta-axes .axis-chip {
  font-size: 11px; padding: 3px 8px;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 4px; color: #334155;
}
.meta-axes .axis-key {
  font-weight: 700; color: #64748b; margin-right: 4px;
}

/* 상품 정의 행 (사용자 grounding 입력) */
.definition-row {
  padding: 12px 14px; margin-bottom: 12px;
  background: #fffbeb; border-left: 3px solid #f59e0b;
  border-radius: 6px;
}
.definition-row .lbl { font-size: 12px; font-weight: 600; color: #92400e; margin-bottom: 6px; }
.definition-row .muted { font-weight: 400; color: #a16207; }
.definition-edit { display: flex; gap: 8px; align-items: stretch; }
.definition-edit input { flex: 1; }
.definition-hint { font-size: 11px; color: #b45309; margin-top: 4px; }

/* (v11) 통합 프롬프트 패널 제거 — 마스터 배치 프롬프트로 단일화 */

/* v9 storyboard 콘티보드 (한눈에 보이는 grid) */
.conti-board {
  margin: 0 0 24px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
}
.conti-board-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 12px;
}
.conti-board-title { font-size: 15px; font-weight: 700; color: #f1f5f9; }
.conti-board-sub { font-size: 12px; color: #94a3b8; margin-left: 10px; }
.conti-board-actions .btn-secondary {
  background: #f1f5f9; color: #0f172a; border-color: #cbd5e1;
}
.conti-board-actions .btn-secondary:hover { background: #fff; }
.conti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.conti-cell {
  background: #fff; color: #0f172a;
  border-radius: 8px; overflow: hidden;
  border: 1px solid #1e293b;
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
  display: flex; flex-direction: column;
}
.conti-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.conti-cell-img-wrap {
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.conti-cell-img {
  width: 100%; height: 100%; object-fit: cover;
  cursor: zoom-in;
}
.conti-cell-err {
  font-size: 12px; color: #b91c1c; padding: 8px;
}
.conti-cell-loading {
  font-size: 12px; color: #64748b; padding: 8px;
}
.conti-cell-meta {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 4px 10px;
}
.conti-cell-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  background: #0f172a; color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 5px;
}
.conti-cell-name {
  font-size: 12px; font-weight: 600; color: #334155;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.conti-cell-copy {
  font-size: 12px; color: #475569;
  padding: 0 10px 10px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .conti-grid { grid-template-columns: repeat(2, 1fr); }
}

/* v9 storyboard mockup card */
.storyboard-card {
  margin-top: 14px; padding: 14px;
  border-radius: 10px; border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fafbff 0%, #f5f7fb 100%);
}
.storyboard-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.storyboard-tag {
  font-size: 12px; font-weight: 700; color: #1d4ed8;
  background: #dbeafe; padding: 3px 8px; border-radius: 6px;
}
.storyboard-intent { font-size: 12px; color: #64748b; }
.storyboard-mock-wrap {
  display: flex; justify-content: center;
  background: #fff; border-radius: 8px; padding: 8px;
  border: 1px solid #e2e8f0;
}
.storyboard-mock-img {
  max-width: 100%; max-height: 360px;
  border-radius: 6px; cursor: zoom-in;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.storyboard-mock-err {
  padding: 12px; border-radius: 8px;
  background: #fef2f2; border: 1px solid #fecaca;
  color: #b91c1c; font-size: 13px;
}
.storyboard-mock-loading {
  padding: 16px; text-align: center; color: #64748b; font-size: 13px;
  background: #fff; border-radius: 8px; border: 1px dashed #cbd5e1;
}
.console-prompt {
  margin-top: 10px; padding: 10px 12px;
  background: #fff; border-radius: 8px; border: 1px solid #e2e8f0;
}
.console-prompt-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.console-prompt-label { font-size: 12px; font-weight: 600; color: #475569; }
.console-prompt-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.55; color: #1e293b;
  white-space: pre-wrap; word-break: break-word;
  background: #f8fafc; padding: 8px 10px; border-radius: 6px;
  border: 1px solid #f1f5f9;
  max-height: 200px; overflow-y: auto;
  margin: 0;
}

/* ===== v10 콘솔 프롬프트 UI ===== */

/* 공용 레퍼런스 스트립 */
.ref-strip {
  margin: 0 0 16px 0; padding: 12px 14px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
}
.ref-strip.empty-ref {
  background: #f8fafc; border-color: #e2e8f0; color: #94a3b8;
  font-size: 12px;
}
.ref-strip-head { font-size: 12px; font-weight: 600; color: #92400e; margin-bottom: 8px; }
.ref-strip-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.ref-strip-imgs img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 8px;
  border: 1px solid #fde68a; cursor: zoom-in; transition: transform .12s;
}
.ref-strip-imgs img:hover { transform: scale(1.04); }
.ref-strip.recipe-strip { margin-top: 14px; background: #f0fdf4; border-color: #bbf7d0; }
.ref-strip.recipe-strip .ref-strip-head { color: #15803d; }
.ref-strip.recipe-strip .ref-strip-imgs img { border-color: #bbf7d0; }

/* 단락 개요 (텍스트 콘티) */
.overview-board {
  margin: 0 0 24px 0; padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); color: #e2e8f0;
}
.overview-head { display: flex; align-items: baseline; margin-bottom: 12px; }
.overview-title { font-size: 15px; font-weight: 700; color: #f1f5f9; }
.overview-sub { font-size: 12px; color: #94a3b8; margin-left: 10px; }
.overview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.overview-cell {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: all .15s;
}
.overview-cell:hover { background: rgba(255,255,255,0.1); border-color: rgba(99,102,241,0.5); }
.overview-cell-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.overview-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px;
  background: #6366f1; color: #fff; font-size: 11px; font-weight: 700;
}
.overview-name { font-size: 13px; font-weight: 600; color: #f1f5f9; }
.overview-size {
  margin-left: auto; font-size: 10px; font-family: ui-monospace, monospace;
  color: #cbd5e1; background: rgba(255,255,255,0.08); padding: 1px 6px; border-radius: 4px;
}
.overview-intent { font-size: 12px; line-height: 1.5; color: #cbd5e1; }

/* 단락별 최종 프롬프트 블록 */
.final-prompt {
  margin-top: 14px; padding: 14px 16px; border-radius: 10px;
  background: #f0f9ff; border: 1px solid #bae6fd;
}
.final-prompt.note { background: #f8fafc; border-color: #e2e8f0; color: #64748b; font-size: 13px; }
.final-prompt-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.final-prompt-label { font-size: 14px; font-weight: 700; color: #0369a1; }
.fp-mode {
  font-size: 10px; font-weight: 700; color: #0369a1;
  background: #e0f2fe; padding: 2px 7px; border-radius: 4px; margin-left: 4px;
}
.final-prompt-actions { display: flex; align-items: center; gap: 8px; }
.btn-secondary.xs { font-size: 11px; padding: 4px 8px; }
.final-prompt-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.6; color: #0f172a;
  white-space: pre-wrap; word-break: break-word;
  background: #fff; padding: 12px 14px; border-radius: 6px;
  border: 1px solid #e0f2fe; margin: 0;
}

/* 부분 수정(surgical repair) 프롬프트 */
.repair-box { margin-top: 10px; }
.repair-box > summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: #0369a1;
  list-style: none; user-select: none;
}
.repair-box > summary::-webkit-details-marker { display: none; }
.repair-box[open] > summary { margin-bottom: 8px; }
.repair-hint { font-size: 11px; color: #64748b; margin: 0 0 6px 0; }
.repair-input {
  width: 100%; min-height: 70px; resize: vertical;
  font-size: 12px; line-height: 1.5; color: #0f172a;
  padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px;
  background: #fff; margin-bottom: 8px;
}
.repair-input:focus { outline: none; border-color: #0ea5e9; }

.summary-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }

/* QA 체크리스트 */
.qa-checklist {
  margin-top: 4px; padding: 14px 16px; border-radius: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
}
.qa-head { font-size: 13px; font-weight: 700; color: #15803d; margin-bottom: 8px; }
.qa-checklist ul { margin: 0; padding-left: 18px; }
.qa-checklist li { font-size: 12px; line-height: 1.7; color: #166534; }

.anchor-note { margin: 8px 0; padding: 8px 10px; border-radius: 8px;
  background: #fff7ed; border: 1px solid #fed7aa; font-size: 11px; color: #9a3412; }

/* ===== v13: 작업 2단 그리드 — 카피(좌) | 이미지 프롬프트(우) ===== */
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 24px; align-items: start; margin-top: 6px;
}
.work-col { min-width: 0; }
/* 우측 프롬프트 — 독립 스크롤 없이 좌측 카피와 함께 전체 페이지 스크롤에 흐름 */
.work-prompts { padding: 2px 0 20px 0; }

/* 사용법 안내 — 콘솔 한 번에 1장 한계 설명 */
.prompt-guide {
  background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid #f59e0b;
  border-radius: 10px; padding: 12px 16px; margin: 0 0 16px;
}
.prompt-guide > summary {
  cursor: pointer; list-style: none; font-size: 13.5px; color: #92400e;
  display: flex; align-items: center; gap: 6px;
}
.prompt-guide > summary::-webkit-details-marker { display: none; }
.prompt-guide > summary::after { content: '▾'; margin-left: auto; color: #b45309; transition: transform .15s; }
.prompt-guide[open] > summary::after { transform: rotate(180deg); }
.pg-why { font-size: 13px; line-height: 1.7; color: #78350f; margin: 10px 0 0; }
.pg-why b { color: #b45309; }
.pg-steps { margin: 10px 0 0; padding-left: 20px; }
.pg-steps li { font-size: 13px; line-height: 1.85; color: #78350f; }
.pg-steps li b { color: #0369a1; }
.pg-note { font-size: 12px; line-height: 1.65; color: #a16207; margin: 11px 0 0; padding-top: 9px; border-top: 1px dashed #fcd34d; }
.work-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 2px 11px; margin-bottom: 14px;
  border-bottom: 2px solid #0369a1;
  font-size: 15px; font-weight: 800; color: #0369a1;
}
.work-head-count { font-size: 12px; font-weight: 800; color: #fff; background: #0ea5e9; border-radius: 999px; padding: 1px 9px; }
.work-head-hint { margin-left: auto; font-size: 11px; font-weight: 600; color: #94a3b8; }
.work-batch-btn {
  margin-left: auto; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #2563eb); border: none; border-radius: 8px;
  padding: 7px 14px; cursor: pointer; transition: filter .15s, transform .1s;
  box-shadow: 0 1px 3px rgba(37,99,235,.3);
}
.work-batch-btn:hover { filter: brightness(1.08); }
.work-batch-btn:active { transform: translateY(1px); }
@media (max-width: 1024px) {
  .work-grid { grid-template-columns: 1fr; gap: 30px; }
  .work-prompts { position: static; max-height: none; overflow: visible; padding: 0; }
}

/* ===== v13: 카피 문서 — 에디토리얼 교정지(proof) 뷰 ===== */
.work-copy .copy-doc { max-width: none; margin: 0; }
.work-prompts .img-sec:first-of-type { margin-top: 0; }
.copy-doc { max-width: 880px; margin: 4px auto 0; }
.copy-doc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 0 2px 12px; margin-bottom: 18px;
  border-bottom: 2px solid #0f172a;
}
.copy-doc-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; margin: 0; }
.copy-doc-meta { font-size: 12px; font-weight: 600; color: #94a3b8; }
.copy-all-btn {
  margin-left: auto; font-size: 12px; font-weight: 700; color: #334155;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 6px 14px; cursor: pointer; transition: all .15s;
}
.copy-all-btn:hover { border-color: #2563eb; color: #2563eb; }
.copy-all-btn.flash { background: #2563eb; color: #fff; border-color: #2563eb; }

/* GPT/Gemini 비교 토글 */
.copy-prov-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.copy-prov-tag.gpt { background: #dcfce7; color: #15803d; }
.copy-prov-tag.gemini { background: #ede9fe; color: #6d28d9; }
.copy-prov { display: inline-flex; gap: 3px; background: #eef2f6; padding: 3px; border-radius: 9px; }
.cp-tab { font-size: 12px; font-weight: 700; color: #64748b; padding: 4px 11px; border: none; background: transparent; border-radius: 6px; cursor: pointer; transition: all .14s; }
.cp-tab .cp-sub { font-size: 10px; opacity: .7; font-weight: 600; margin-left: 3px; }
.cp-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.cp-tab.cp-gen { color: #94a3b8; }
.cp-tab.cp-gen .cp-sub { color: #6d28d9; opacity: .9; }
.cp-tab.cp-gen:hover { color: #6d28d9; }
.cp-gen-btn { font-size: 12px; font-weight: 700; color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px; padding: 6px 12px; cursor: pointer; transition: all .15s; }
.cp-gen-btn:hover:not(:disabled) { background: #ede9fe; border-color: #c4b5fd; }
.cp-gen-btn:disabled { opacity: .7; cursor: default; }

/* 구성 카드 */
.csec {
  background: #fff; border: 1px solid #e8ecf1; border-radius: 14px;
  margin: 0 0 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  animation: csecIn .34s cubic-bezier(.2,.7,.2,1) backwards;
  animation-delay: calc(var(--d,0) * 45ms);
}
@keyframes csecIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.csec-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fcfdfe, #f7f9fb);
}
.csec-num {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: #0f172a; color: #fff; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.csec-title { font-size: 14.5px; font-weight: 700; color: #0f172a; margin: 0; letter-spacing: -.01em; }
.cv-tabs { margin-left: auto; display: inline-flex; gap: 3px; background: #eef2f6; padding: 3px; border-radius: 9px; }
.cv-tab {
  font-size: 12px; font-weight: 700; color: #64748b; letter-spacing: .02em;
  padding: 4px 12px; border: none; background: transparent; border-radius: 6px;
  cursor: pointer; transition: all .14s;
}
.cv-tab:hover { color: #0f172a; }
.cv-tab.active { background: #fff; color: #2563eb; box-shadow: 0 1px 2px rgba(15,23,42,.13); }
.cv-copy {
  flex: none; font-size: 12px; font-weight: 700; color: #64748b;
  background: transparent; border: 1px solid #e2e8f0; border-radius: 7px;
  padding: 5px 11px; cursor: pointer; transition: all .15s;
}
.cv-copy:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.cv-copy.flash { background: #16a34a; color: #fff; border-color: #16a34a; }

/* 프루프 본문 (실제 카피) — 따뜻한 종이톤으로 UI와 구분 */
.cv-panel { display: none; padding: 18px 22px 22px; background: #fbfaf7; }
.cv-panel.active { display: block; animation: pfFade .2s ease-out; }
@keyframes pfFade { from { opacity: 0; } to { opacity: 1; } }
.pf-line { font-size: 14.5px; line-height: 1.72; color: #45423b; letter-spacing: -.003em; }
.pf-lead {
  font-size: 17.5px; font-weight: 700; line-height: 1.45; color: #1a1917;
  margin-bottom: 7px; letter-spacing: -.02em;
}
.pf-gap { height: 13px; }

/* Q&A */
.cqa {
  background: #fff; border: 1px solid #e8ecf1; border-radius: 14px;
  margin: 22px 0 0; overflow: hidden; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.cqa-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; font-size: 14px; font-weight: 800; color: #0f172a;
  border-bottom: 1px solid #f1f5f9; background: #f7f9fb;
}
.cqa-icon { font-size: 15px; }
.cqa-count { margin-left: auto; font-size: 12px; font-weight: 700; color: #fff; background: #94a3b8; border-radius: 999px; padding: 1px 9px; }
.cqa-list { padding: 4px 8px; }
.cqa-item { padding: 13px 12px; border-bottom: 1px solid #f4f6f8; }
.cqa-item:last-child { border-bottom: none; }
.cqa-q { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 700; color: #0f172a; line-height: 1.5; }
.cqa-badge {
  flex: none; width: 19px; height: 19px; margin-top: 1px; border-radius: 6px;
  background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.cqa-a { margin: 6px 0 0 27px; font-size: 13.5px; line-height: 1.7; color: #64748b; white-space: pre-wrap; }

.copy-empty {
  max-width: 880px; margin: 4px auto; padding: 40px; text-align: center;
  color: #94a3b8; font-size: 14px; background: #fff;
  border: 1px dashed #e2e8f0; border-radius: 14px;
}
.img-sec{margin:0 0 28px}
.img-sec-head{display:flex;align-items:center;gap:8px;margin:0 0 8px}
.img-sec-num{
  width:26px;height:26px;border-radius:7px;flex-shrink:0;
  background:linear-gradient(135deg,#3b82f6,#8b5cf6);color:#fff;
  font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;
}
.img-sec-name{font-size:15px;font-weight:700;color:#0f172a}
