/* 진지 캐릭터 스튜디오 — 내부 도구 (humor_studio.css 관례: 경량 유틸리티 없이 단독 시트) */

* { box-sizing: border-box; }
body {
  margin: 0; background: #f4f6f4; color: #1f2937;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; font-size: 14px;
}

.studio-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #14532d; color: #fff; position: sticky; top: 0; z-index: 10;
}
.studio-header h1 { margin: 0; font-size: 17px; }
.header-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { background: rgba(255,255,255,.15); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.badge.warn { background: #b45309; }

.btn {
  border: 1px solid #d1d5db; background: #fff; color: #1f2937; border-radius: 6px;
  padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #16a34a; border-color: #15803d; color: #fff; }
.btn-primary:hover { background: #15803d; }
.btn-danger { background: #dc2626; border-color: #b91c1c; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-link { background: transparent; border-color: transparent; color: #fff; text-decoration: none; }

.login-panel { max-width: 360px; margin: 80px auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 24px; }
.login-panel h2 { margin: 0 0 6px; font-size: 16px; }
.login-panel .hint { color: #6b7280; font-size: 12px; margin: 0 0 14px; }
.login-panel form { display: flex; flex-direction: column; gap: 8px; }
.login-panel input { border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.error { color: #dc2626; font-size: 13px; }

.studio-main { display: flex; gap: 0; height: calc(100vh - 52px); }
.asset-list-pane { width: 320px; min-width: 260px; overflow-y: auto; border-right: 1px solid #e5e7eb; background: #fff; }
.detail-pane { flex: 1; overflow-y: auto; padding: 16px 20px; }
.detail-empty { color: #9ca3af; margin-top: 60px; text-align: center; }

.cat-group-title {
  position: sticky; top: 0; background: #f9fafb; border-bottom: 1px solid #e5e7eb;
  padding: 6px 12px; font-size: 12px; font-weight: 700; color: #374151; z-index: 1;
}
.asset-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.asset-card:hover { background: #f0fdf4; }
.asset-card.selected { background: #dcfce7; }
.asset-card canvas { image-rendering: pixelated; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 4px; flex: none; }
.asset-card .meta { min-width: 0; flex: 1; }
.asset-card .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card .sub { color: #6b7280; font-size: 11px; }
.chips { font-size: 12px; letter-spacing: 1px; }
.chip-live { color: #16a34a; }
.chip-none { color: #9ca3af; }
.chip-job { color: #d97706; }
.chip-review { color: #2563eb; }
.chip-fail { color: #dc2626; }
.chip-lock { color: #6b7280; }

.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.detail-head h2 { margin: 0; font-size: 18px; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  border: none; background: transparent; padding: 7px 14px; font-size: 13px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; color: #4b5563;
}
.tabs button.active { border-bottom-color: #16a34a; color: #14532d; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; align-items: start; max-width: 860px; }
.form-grid label { padding-top: 6px; font-size: 12px; color: #374151; font-weight: 600; }
.form-grid input[type=text], .form-grid input[type=number], .form-grid select, .form-grid textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 9px; font-size: 13px; font-family: inherit;
}
.form-grid textarea { min-height: 74px; resize: vertical; line-height: 1.45; }
.phase-row { display: flex; gap: 6px; margin-bottom: 6px; }
.phase-row textarea { flex: 1; min-height: 56px; }
.inline-opts { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.form-actions { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.warn-box { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px; padding: 8px 12px; margin: 10px 0; font-size: 12px; color: #92400e; white-space: pre-wrap; }
.info-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 8px 12px; margin: 10px 0; font-size: 12px; color: #1e40af; white-space: pre-wrap; }
.error-box { background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 12px; margin: 10px 0; font-size: 12px; color: #991b1b; white-space: pre-wrap; }

.preview-strip { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0; }
.preview-box { text-align: center; }
.preview-box canvas { image-rendering: pixelated; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid #e5e7eb; border-radius: 6px; }
.preview-box .cap { font-size: 11px; color: #6b7280; margin-top: 3px; }

.job-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; margin: 8px 0; background: #fff; font-size: 13px; }
.job-card .job-head { display: flex; gap: 10px; align-items: center; }
.status-pill { border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; color: #fff; }
.st-PENDING, .st-DISPATCHED { background: #9ca3af; }
.st-RUNNING { background: #d97706; }
.st-REVIEW { background: #2563eb; }
.st-DONE { background: #16a34a; }
.st-FAILED, .st-REJECTED { background: #dc2626; }
.st-CANCELLED { background: #6b7280; }

.version-row { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #f3f4f6; padding: 8px 0; }
.version-row img { image-rendering: pixelated; max-height: 64px; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 4px; }
.version-row .vmeta { flex: 1; font-size: 12px; color: #374151; }
.live-mark { color: #16a34a; font-weight: 700; font-size: 11px; }

.log-row { border-bottom: 1px solid #f3f4f6; padding: 7px 0; font-size: 12px; }
.log-row summary { cursor: pointer; color: #374151; }
.log-row pre { white-space: pre-wrap; background: #f9fafb; border-radius: 6px; padding: 8px; margin: 6px 0 0; font-size: 11px; max-height: 220px; overflow: auto; }
.log-fail { color: #dc2626; }

/* 프롬프트 한/영 번역 버튼(js/prompt-translate.js) — 입력창을 .prompt-tr-wrap 이 감싼다.
   .form-grid 는 label|field 2열 그리드라 형제로 끼우면 열이 밀린다(그래서 감싼다).
   .phase-row 는 flex 라 wrap 이 textarea 의 flex:1 을 대신 받아야 한다. */
.prompt-tr-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.phase-row .prompt-tr-wrap { flex: 1; }
.prompt-tr-bar { display: flex; gap: 4px; align-self: flex-start; }
.prompt-tr-btn {
  font-size: 11px; padding: 2px 8px; border: 1px solid #d1d5db; border-radius: 6px;
  background: #fff; color: #374151; cursor: pointer;
}
.prompt-tr-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.prompt-tr-btn:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 760px) {
  .studio-main { flex-direction: column; height: auto; }
  .asset-list-pane { width: 100%; max-height: 40vh; }
}
