:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #1d2129; --muted: #6b7280; --line: #e3e6ea;
  --primary: #c8102e; --primary-dark: #a00d25; --ok: #1a7f37; --warn: #b26a00; --err: #c62828;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--err); min-height: 1em; }
h1 { margin: 0 0 4px; font-size: 24px; }
h2 { margin: 0 0 14px; font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
label.check { flex-direction: row; align-items: center; font-weight: 500; }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f3b5bf; border-color: var(--primary); }
.row { display: flex; gap: 12px; }
.row > label { flex: 1; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 9px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { background: #f0f1f3; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.center-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; }

.topbar { display: flex; align-items: center; gap: 18px; padding: 0 20px; min-height: 56px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; color: var(--primary); font-size: 17px; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: #fbe9ec; color: var(--primary); }
.userbox { display: flex; align-items: center; gap: 8px; }

.tab-page { padding: 20px; max-width: 1900px; margin: 0 auto; }
.create-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
/* 도구 목록 (2026-11-24 정리): 이미지 / 영상 묶음, 한 줄 설명, 긴 입력 칸을 내려도 옆에 붙어 있게 */
.tool-list { display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(var(--hdr-h, 56px) + 20px); max-height: calc(100vh - var(--hdr-h, 56px) - 40px); overflow: auto; }
.tool-group { font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 4px 2px; }
.tool-group:first-child { padding-top: 0; }
.tool { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 1px; }
.tool b { font-size: 13.5px; }
.tool span { color: var(--muted); font-size: 11.5px; }
.tool:hover { border-color: #cfd4da; }
.tool.active { border-color: var(--primary); background: #fff5f6; box-shadow: 0 0 0 2px #fbe9ec; }
/* 등장인물 탭으로 가는 바로가기: 도구와 구별되게 점선 */
.tool-link { text-align: left; background: transparent; border: 1px dashed #cfd4da; border-radius: var(--radius); padding: 8px 12px; cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 1px; }
.tool-link b { font-size: 13.5px; }
.tool-link span { color: var(--muted); font-size: 11.5px; }
.tool-link:hover { border-color: var(--primary); background: #fff; color: var(--primary); }

.pickers { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px; }   /* 이름표가 두 줄이어도 상자는 한 줄로 */
.picker { width: 120px; }
.picker .plabel { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.picker .pbox { width: 120px; height: 120px; border: 2px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: #fafafa center/cover no-repeat; color: var(--muted); font-size: 12px; position: relative; text-align: center; }
.picker .pbox:hover { border-color: var(--primary); }
.picker .pbox.filled { border-style: solid; }
.picker .pclear { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.badge-video { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; }

.tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }
.tagbar button { border: 1px solid var(--line); background: #fafafa; border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.tagbar button:hover { border-color: var(--primary); }
/* 모델 라이선스 안내 (MiniMax H3 등) */
.model-notice { margin: 8px 0 4px; padding: 10px 12px; border: 1px solid #f0c36d; border-left: 4px solid #e0a020; border-radius: 8px; background: #fff8e6; color: #5c4400; font-size: 13px; }
.model-notice ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
/* 힉스필드(외부 · 유료) 모델: 표시 + 그 모델에서 안 쓰는 칸 숨김 (얼굴·손 다듬기·투명 배경·퇴근 후 예약·나오지 말아야 할 것) */
.hf-tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: #6d28d9; color: #fff; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.sb-vm.hf { border-style: dashed; }
.tform.hf-on .fix-people, .tform.hf-on #edit-transparent, .tform.hf-on .negbox,
.tform.hf-on .run-line label:has(select[name=schedule]) { display: none; }
#hf-usage th, #hf-usage td { white-space: nowrap; }
#hf-usage .hf-limit { width: 72px; }
/* 멀티참조: 사진마다 역할 고르기 */
.mr-roles { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 2px; margin-bottom: 12px; background: #fcfcfd; }
.mr-roles .field-label { margin-bottom: 8px; }
.mr-role { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mr-role b { font-size: 13px; min-width: 52px; }
.mr-role select { flex: 1 1 220px; min-width: 0; max-width: 320px; padding: 6px 8px; }
.mr-thumb { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line); background: #eee center/cover no-repeat; flex: none; }
.mr-at { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.mr-at input { width: 72px; padding: 6px 8px; }
/* 멀티참조 ① 넣을 사진·영상: 작은 제목(사진 / 참고 영상 / 소리), 영상 칸 아래 '시작 N초' */
.mr-sub { font-size: 13px; font-weight: 600; margin: 2px 0 6px; }
.mr-slot { display: flex; flex-direction: column; gap: 4px; width: 120px; }
.pickers:has(> .mr-slot) { align-items: flex-start; }   /* '시작 N초'가 붙은 칸과 빈 칸의 상자 높이를 맞춤 */
.mr-vstart { flex-direction: row; align-items: center; gap: 4px; margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.mr-vstart input { width: 58px; padding: 4px 6px; font-size: 12px; }
.mr-vmode { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.mr-vmode select { flex: 1 1 320px; min-width: 0; padding: 6px 8px; }
/* 얼굴·손 다듬기 */
.fix-off { color: var(--warn); font-weight: 500; }
.fix-report { margin-top: 4px; padding: 5px 8px; border-radius: 6px; background: #eef6f0; color: #1d4d2c; font-size: 12px; line-height: 1.45; }
.fix-report.muted { background: #f4f5f7; color: var(--muted); }
/* 스토리보드: 컷 AI 시간 구성 · 원고 정리 */
.sb-motion-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.sb-raw textarea { width: 100%; background: #f7f8fa; }
#sb-form .sb-refined textarea, .sb-drawer textarea[name=script] { font-size: 13px; line-height: 1.55; }
/* 영상 프롬프트 풀어 쓰기 */
.pe-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -4px 0 12px; }
.pe-bar .pe-go { border-color: var(--primary); color: var(--primary); }
.pe-bar label.pe-action { margin: 0; white-space: nowrap; gap: 6px; }
/* 텍스트/이미지 → 영상: 사진을 참조로 쓰기 (멀티참조로 옮기기) */
/* 입력 단계 묶음 (텍스트/이미지 → 영상): ① ② ③ 번호 제목, 묶음 사이 얇은 줄 */
.fsec { border-top: 1px solid var(--line); padding-top: 14px; }
.fsec-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
label > .fsec-h { margin-bottom: 2px; }
.fsec-h .pe-step { width: 20px; height: 20px; font-size: 12px; }
.fsec-tip { font-size: 12px; line-height: 1.6; color: #5c4400; background: #fff8e6; border: 1px solid #f3dca6; border-radius: 8px; padding: 7px 10px; margin: -4px 0 12px; }
.fsec-tip .linkish { font-weight: 700; }
.fsec-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding-bottom: 14px; }
.fsec-inline .fsec-h { margin: 0; }
.fsec-inline label { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.fsec-inline select { padding: 6px 8px; }
.fsec-inline input[type=number] { width: 72px; padding: 6px 8px; }
.fsec > .fsec-inline { padding-bottom: 10px; }
.fsec-inline .fsec-note { flex-basis: 100%; margin: 0; }
/* 설명이 긴 체크 칸: 글을 한 덩어리(span)로 감싸 줄이 바뀌어도 체크 상자 옆에 붙게 */
.tform label.check:has(> span) { align-items: flex-start; }
.tform label.check:has(> span) > input { margin-top: 3px; }
.vf-photos { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 14px; }
.vf-photos .pickers { margin: 0; }
.vf-arrow { height: 120px; display: flex; align-items: center; color: var(--muted); font-size: 18px; }
.vf-photo-note { flex: 1 1 220px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-bottom: 2px; }
.vf-photo-note p { margin: 0; line-height: 1.5; }
.vf-photo-note .btn { margin-top: 4px; }
/* 영상 마무리: 로고·음악 칸 오른쪽에 설명과 설정(넣었을 때만) */
.cc-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 14px; }
.cc-opts { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; padding-bottom: 2px; }
.cc-opts p { margin: 0; line-height: 1.5; }
.cc-set { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.cc-set label { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.cc-set select { padding: 6px 8px; max-width: 100%; }
.cc-join { margin-bottom: 14px; }
.cc-row .plabel { display: none; }   /* 칸 이름(로고·배경음악)은 바로 위 제목과 같음 */
/* 접어 둔 '세부 설정': 닫혀 있어도 바꾼 것은 제목 옆에 빨갛게 */
details.more { border: 1px solid var(--line); border-radius: 8px; background: #fcfcfd; padding: 0 12px; margin: 0 0 12px; }
details.more > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; font-weight: 600; font-size: 13px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more[open] > summary { border-bottom: 1px dashed var(--line); margin-bottom: 4px; }
.more-sum { font-weight: 400; font-size: 12px; color: var(--muted); }
.more-sum.set { color: var(--primary); font-weight: 600; }
/* 만들기 버튼 바로 위 한 줄: 같은 설정으로 N개 · 시작 예약 · 예상 시간 */
.run-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; }
.run-line label { flex-direction: row; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.run-line select { width: auto; padding: 5px 8px; }
.run-line .eta-line { margin-left: auto; }
.pe-box { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 8px; padding: 12px 12px 4px; margin-bottom: 12px; background: #fcfcfd; }
.pe-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.pe-head .muted { font-weight: 400; }
.pe-step { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.pe-box textarea { font-size: 13px; line-height: 1.55; }
.pe-box textarea[name=prompt_en] { background: #f7f8fa; }
.pe-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.pe-warn { margin: -4px 0 10px; padding: 8px 10px; border-radius: 8px; background: #fff8e6; color: #7a4d00; font-size: 12px; line-height: 1.5; }
details.help { margin-bottom: 12px; font-size: 13px; }
details.help summary { cursor: pointer; color: var(--muted); }
details.help ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }
details.help textarea { width: 100%; margin-top: 6px; }

/* --hdr-h: 헤더 높이 (좁은 화면에서 헤더가 두 줄이 되면 커짐, app.js 가 잼) */
.jobs { position: sticky; top: calc(var(--hdr-h, 56px) + 20px); max-height: calc(100vh - var(--hdr-h, 56px) - 40px); overflow: auto; }
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.job-title { font-weight: 700; font-size: 13px; flex: 1; }
.job-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; border-radius: 4px; }
.job-x:hover { color: #d33; background: rgba(220, 50, 50, .1); }
.job-prompt { color: var(--muted); font-size: 12px; margin: 4px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.job-prompt.full { display: block; overflow: visible; -webkit-line-clamp: unset; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.job-more { display: block; background: none; border: 0; padding: 0; margin: -2px 0 4px; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; }
.job-more:hover { color: var(--text); }
.status { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.status.queued { background: #fff4e0; color: var(--warn); }
.status.running { background: #e6f0ff; color: #1a5fd0; }
.status.done { background: #e5f5ea; color: var(--ok); }
.status.error, .status.canceled { background: #fdecec; color: var(--err); }
.job-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.job-files img { width: 72px; height: 72px; object-fit: contain; background: #e6e8eb; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); }   /* 사람 전신이 잘리지 않게 전체를 보여 줌 */
.job .err { color: var(--err); font-size: 12px; word-break: break-all; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chips { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.small-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 60vh; overflow: auto; padding: 2px; }
.pick-empty { grid-column: 1 / -1; margin: 8px 2px; line-height: 1.6; }   /* 고르기 창의 빈 안내는 격자 전체 폭으로 */
.item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.item .thumb { aspect-ratio: 1 / 1; background: #e6e8eb center/contain no-repeat; cursor: pointer; position: relative; }   /* 사람 전신이 잘리지 않게 전체를 보여 줌 */
.item .meta { padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .acts { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 8px; }
.item .acts .btn { padding: 4px 8px; font-size: 11px; }
.shared-on { color: var(--primary); font-weight: 700; }
/* 공유함에서 내가 공유한 파일 */
.badge-mine { position: absolute; left: 6px; top: 6px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pick-item { cursor: pointer; }
.pick-item:hover { outline: 2px solid var(--primary); }
.drop-hint { outline: 3px dashed var(--primary); outline-offset: -10px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.modal-box { background: #fff; border-radius: 12px; padding: 16px; width: min(900px, 100%); max-height: 90vh; overflow: auto; }
.small-box { width: 360px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.viewer-box { width: min(1100px, 100%); }
#viewer-body img, #viewer-body video { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: 8px; background: #000; }
/* 투명 PNG 는 바둑판 위에 (불투명한 사진에는 영향 없음) */
#viewer-body img { background: repeating-conic-gradient(#d6dae0 0% 25%, #fff 0% 50%) 50% / 24px 24px; }

/* 관리자: 회원 관리 · 서버 상태 · 설정 관리 탭 (2026-11-24) */
#tab-admin { max-width: 1440px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.subtabs { display: flex; gap: 2px; }
.subtab { border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; padding: 10px 18px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-me { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; font-size: 13px; }
.admin-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.admin-pane > *, .admin-grid > * { min-width: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.admin-narrow { max-width: 760px; }
.add-user { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.add-user label { flex: 1 1 160px; margin-bottom: 0; }
.add-user label:has(select) { flex: 0 1 150px; }
.add-user .btn { flex: none; }
.table-wrap { overflow-x: auto; }
.user-table th, .user-table td { white-space: nowrap; vertical-align: middle; }
.user-table tr.off td:not(:last-child) { color: var(--muted); }
.user-table td.acts .btn + .btn { margin-left: 4px; }
.user-table .role-sel { padding: 4px 6px; font-size: 12px; font-weight: 700; border-radius: 6px; }
.role { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.role.r2, .role-sel.r2 { background: #fbe9ec; color: var(--primary); }
.role.r1, .role-sel.r1 { background: #fff4e0; color: var(--warn); }
.role.r0, .role-sel.r0 { background: #f0f1f3; color: var(--muted); }
.me-tag { display: inline-block; padding: 0 6px; border-radius: 8px; background: #e6f0ff; color: #1a5fd0; font-size: 11px; font-weight: 700; }
.role-guide { margin-top: 12px; display: grid; gap: 4px; line-height: 1.7; }
.role-guide .role { margin-right: 4px; }
.llm-form input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
#llm-result { margin-top: 10px; word-break: break-word; }
#llm-result .sample { margin-top: 4px; padding: 6px 8px; background: #f6f6f6; border-radius: 6px; }
#sns-admin-result { margin-top: 10px; word-break: break-word; }
/* 외부 AI (Claude · ChatGPT): 관리자 칸, 설정 탭 고르기, 위쪽 표시 */
.llm-form input[type=radio] { width: auto; }
.llm-form select { width: 100%; }
.llmx-prov { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0 0 10px; }
.llmx-prov legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
#llmx-result { margin-top: 10px; word-break: break-word; line-height: 1.6; }
#llmx-result .sample { margin-top: 4px; padding: 6px 8px; background: #f6f6f6; border-radius: 6px; }
#llmx-usage .table { font-size: 12px; }
#llmx-usage td, #llmx-usage th { padding: 5px 4px; }
.llm-opts { display: grid; gap: 6px; margin-bottom: 10px; }
.llm-opt { flex-direction: row; align-items: flex-start; gap: 10px; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 500; }
.llm-opt > .llm-opt-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.llm-opt input { margin-top: 3px; }
.llm-opt:has(input:checked) { border-color: var(--primary); background: #fff5f6; }
.llm-opt.off { opacity: .55; cursor: default; }
.llm-warn { font-size: 12px; line-height: 1.6; color: #5c4400; background: #fff8e6; border: 1px solid #f3dca6; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.llm-keys .llm-key-row { display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; }
.llm-keys .llm-key-row label { flex: 1; margin: 0; }
.llm-keys .llm-key-row input { width: 100%; box-sizing: border-box; }
.llm-keys #llm-keys-save { margin-top: 10px; }
#llm-key-result { margin-top: 8px; word-break: break-word; }
.llm-chip { border: 1px solid #f3dca6; background: #fff8e6; color: #5c4400; border-radius: 16px; padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.llm-chip.dry, .llm-warn.dry { border-color: #f1b8b8; background: #fdecec; color: var(--err); }
/* 설정 탭 (2026-11-24): 위 내 계정 한 줄, 아래 두 칸 */
#tab-settings { max-width: 1280px; }
.me-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 18px; }
.me-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.me-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fbe9ec; color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex: none; }
.me-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.set-col { display: grid; gap: 16px; min-width: 0; }
.set-head { margin-bottom: 12px; }
.set-head h3 { margin-bottom: 4px; }
.set-head p { margin: 0; line-height: 1.6; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.llm-tag { flex: none; align-self: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.llm-tag.in { background: #e5f5ea; color: var(--ok); }
.llm-tag.out { background: #fff4e0; color: var(--warn); }
.tok-ext { margin: 8px 0 0; color: var(--warn); }
.tok-note { margin: 8px 0 4px; }
.tok-help { margin: 10px 0 0; }
.sns-form { display: grid; gap: 10px; }
.sns-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.sns-form label { margin-bottom: 0; }
.sns-form p { margin: 0; }
.sns-form .error:empty { display: none; }
.sns-form .sns-state { margin: 0; }
.sns-form input:not([type=checkbox]) { width: 100%; box-sizing: border-box; }
.sns-state { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; margin: 8px 0 12px; line-height: 1.6; }
.sns-sent { color: var(--ok); font-weight: 700; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; }
.table td .btn { padding: 3px 8px; font-size: 11px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1d2129; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 30; max-width: 80vw; }

@media (max-width: 1100px) {
  .create-layout { grid-template-columns: 1fr; }
  .tool-list { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
  .tool-group { grid-column: 1 / -1; padding: 4px 2px 0; }
  .tool span, .tool-link span { display: none; }
  .jobs { position: static; max-height: none; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* 서버 대기열 */
.queue-badge { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.queue-badge.busy { background: #fff4e0; border-color: #f3d19b; color: var(--warn); }
.queue-badge.idle { background: #e5f5ea; border-color: #b7dfc3; color: var(--ok); }
.queue-badge.mine { background: #e6f0ff; border-color: #b3cdf5; color: #1a5fd0; }
.queue-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 16px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.q-row { display: flex; gap: 8px; align-items: baseline; }
.q-row .q-pos { min-width: 44px; font-weight: 700; color: var(--muted); font-size: 12px; }
.q-row .q-who { font-weight: 600; }
.q-row .q-time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.q-row.mine { background: #e6f0ff; border-radius: 6px; padding: 4px 6px; margin: 0 -6px; }
.q-row.mine .q-who { color: #1a5fd0; }
.q-run .q-pos { color: #1a5fd0; }
.q-row { flex-wrap: wrap; }
.q-live { flex-basis: 100%; padding-left: 52px; color: #1a5fd0; font-size: 12px; }
.job-live { color: #1a5fd0; font-size: 12px; margin-top: 4px; }
.job-live:empty { display: none; }
.q-sum { border-top: 1px dashed var(--line); padding-top: 6px; color: var(--muted); font-size: 12px; }

/* 헤더 서버 상태 (모든 탭 공통): CPU·RAM·GPU·VRAM·온도 작은 막대(값은 오른쪽 위·이름은 왼쪽 아래) + VRAM 모델 / 서버 대기열 레이어 */
.hdr-status { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.hdr-pop-wrap { position: relative; }
.sys-btn { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 9px 3px 3px; cursor: pointer; font: inherit; }
.sys-btn:hover, .sys-btn[aria-expanded=true] { border-color: #b3cdf5; background: #f5f9ff; }
.sys-btn:focus-visible, .queue-badge:focus-visible { outline: 2px solid #8fb4ee; outline-offset: 1px; }
.sys-bars { display: flex; gap: 3px; }
.sys-bar { display: block; position: relative; width: 44px; height: 30px; border-radius: 5px; background: #2b2f36; overflow: hidden; color: #fff; font-size: 11px; line-height: 1; }
.sys-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--c, #3b82f6); transition: width .6s ease; }
.sys-bar b { position: absolute; right: 4px; top: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sys-bar span { position: absolute; left: 4px; bottom: 4px; opacity: .85; font-size: 10px; }
.sys-bar b, .sys-bar span { text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.sys-bar.hot b { color: #fff3c4; }
.sys-chip { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sys-chip b { color: var(--text); }
.hdr-pop { position: fixed; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); padding: 12px; max-height: min(70vh, 600px); overflow: auto; font-size: 13px; }
.hdr-pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hdr-pop-head .sys-free, .hdr-pop-head .linkish { margin-left: auto; flex: none; }
.sys-detail { margin-bottom: 8px; line-height: 1.5; }
.hdr-pop .queue-box { margin-bottom: 0; }
.sys-model-list { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.sys-model { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; }
.sys-model .m-main { flex: 1; min-width: 0; }
.sys-model .m-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-model .m-file { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-model .m-mb { color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sys-model .m-kind { color: var(--muted); font-size: 11px; font-weight: 400; }
/* GPU 가 여럿일 때 (5090 + 4090): 헤더는 GPU 마다 [사용률][VRAM] 묶음, 레이어는 GPU 마다 올라간 모델 */
.sys-grp { display: flex; gap: 3px; }
.sys-grp + .sys-grp, .sys-bar + .sys-grp { margin-left: 4px; }
.sys-grp.idle { opacity: .55; }
.sys-gpu { display: flex; flex-direction: column; gap: 4px; }
.sys-gpu + .sys-gpu { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
.sys-gpu-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; font-size: 13px; }
.sys-gpu-head .muted { margin-left: auto; }
.sys-gpu-tag { font-size: 11px; font-weight: 700; color: #1d4ed8; background: #e8f0fe; border-radius: 10px; padding: 1px 7px; }
.sys-gpu-tag.off { color: var(--muted); background: #f1f3f5; font-weight: 600; }
.sys-gpu > p { margin: 0; }
.sys-model .m-res { font-size: 10px; font-weight: 700; color: #6d28d9; background: #f1ebff; border-radius: 8px; padding: 0 6px; }

details.tr { font-size: 12px; margin: 4px 0; }
details.tr summary { cursor: pointer; color: #1a5fd0; }
details.tr div { white-space: pre-wrap; background: #f6f8fb; border-radius: 6px; padding: 6px 8px; margin-top: 4px; color: var(--text); }

/* 가이드 영상 · 장면 캡처 */
.badge-tag { position: absolute; right: 4px; top: 4px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.presetbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.presetbar button { border: 1px solid var(--line); background: #fff5f6; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.presetbar button:hover { border-color: var(--primary); }
.viewer-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.viewer-acts:empty { display: none; }
.viewer-acts .viewer-del { margin-left: auto; color: var(--primary); border-color: var(--primary); }
.viewer-acts .viewer-del:hover { background: #fbe9ec; }

/* 같은 설정으로 N개 · 다시 만들기 · 다중 각도 */
.repeat-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.repeat-row label { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.repeat-row select { width: auto; padding: 5px 8px; }
.job-btns { display: flex; gap: 6px; margin-top: 6px; }
.field-label { font-weight: 600; margin: 4px 0 6px; }
.angle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 420px; margin-bottom: 12px; }
.angle-grid label { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; }
.angle-grid label:has(input:checked) { border-color: var(--primary); background: #fff5f6; }
.angle-center { display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #f0f1f3; color: var(--muted); font-size: 12px; }

/* 나오지 말아야 할 것 */
.negbox { margin: 10px 0 4px; }
.neg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 6px 0 8px; }
.neg-grid label { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; }
.neg-grid label:has(input:checked) { border-color: var(--primary); background: #fff5f6; }
.negbox input[name=negative] { width: 100%; }

/* 스토리보드 */
.sb-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; padding: 16px; }
.sb-side { position: sticky; top: calc(var(--hdr-h, 56px) + 16px); display: flex; flex-direction: column; gap: 10px; }
.sb-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 170px); overflow: auto; }
.sb-item { display: flex; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px; cursor: pointer; font: inherit; }
.sb-item.active { border-color: var(--primary); background: #fff5f6; }
.sb-cover { width: 56px; height: 36px; flex: none; border-radius: 4px; background: #eef0f3 center/cover no-repeat; }
.sb-item-text { display: flex; flex-direction: column; min-width: 0; }
.sb-item-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.sb-main { min-width: 0; }
#sb-shared-box { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
#sb-shared-box.hidden { display: none; }
.sb-shared-list { max-height: 40vh; }
.sb-shared-tag { color: var(--primary); font-weight: 700; }
.sbp-box { width: min(1100px, 100%); }
.sbp-acts { display: flex; gap: 6px; flex: none; }
.sbp-refs { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.sbp-ref { width: 64px; height: 64px; border-radius: 6px; background: #eef0f3 center/cover no-repeat; cursor: pointer; border: 1px solid var(--line); }
.sbp-script { white-space: pre-wrap; margin: 6px 0; }
.sbp-cuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 10px 0; }
.sbp-cut { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.sbp-cut .sb-img.empty { cursor: default; }
.sbp-text p { margin: 4px 0 0; }
.sb-title { font-size: 20px; font-weight: 700; flex: 1; min-width: 0; border-color: transparent; padding: 6px 8px; }
.sb-title:hover, .sb-title:focus { border-color: var(--line); }
.sb-status { padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.sb-status.busy { background: #fff8e6; color: #8a5a00; }
.sb-status.err { background: #fdecec; color: #b42318; }
.sb-status.warn { background: #fff1e6; color: #9a3412; }
.sb-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.sb-settings > label { min-width: 160px; }
.sb-settings .pickers { margin: 0; }
.sb-refs { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin-bottom: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.sb-refs .pickers { margin: 0; }
.sb-refs-base { flex: 1; min-width: 260px; }
.sb-refs-base ol.hint { margin: 4px 0 0; padding-left: 18px; }
.sb-refs-base ol.hint li { margin: 2px 0; }
.sb-img { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: #eef0f3 center/cover no-repeat; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sb-img.portrait { aspect-ratio: 9 / 16; width: 60%; margin: 0 auto; }
.sb-img.square { aspect-ratio: 1; width: 80%; margin: 0 auto; }
/* 등장인물 사진과 비교한 결과 (컷 이미지 아래) */
.sb-look { line-height: 1.35; }
.sb-look.ok { color: #1a7f37; }
.sb-look.bad { color: #b42318; background: #fff4f2; border: 1px solid #f3c1b9; border-radius: 6px; padding: 4px 6px; }
.sb-look-tail { display: block; color: #8a5a00; margin-top: 2px; }
.linkish { background: none; border: 0; padding: 0; color: #2457c5; text-decoration: underline; cursor: pointer; font: inherit; }
.sb-grow { flex: 1; }
/* 스토리보드 장소 목록 (2026-11-20): 장소마다 사진·이름·모습, 컷이 고름 */
.sb-place-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-top: 8px; }
.sb-place { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.sb-place .picker.sb-place-photo { flex: none; width: 104px; }
.sb-place .picker .pbox { width: 104px; height: 78px; font-size: 12px; }
.sb-place-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sb-place-fields input, .sb-place-fields textarea { width: 100%; font-size: 13px; padding: 6px 8px; }
.sb-place-fields input { font-weight: 600; }
.sb-place-meta { display: flex; align-items: center; gap: 8px; }
.sb-place-src { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.sb-place-src.user { color: #2457c5; }
.sb-place-add { border: 1px dashed #c9ced6; background: #fff; border-radius: 10px; min-height: 100px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.sb-place-add:hover { border-color: var(--primary); }

/* 스토리보드 편집 화면 (2026-11-20 목업 '③ 컷·영상'으로 다시 짬): 위 프로젝트 줄·서랍 / 가운데 3단(컷 목록·고른 컷·샷 패널) / 아래 타임라인 */
.sb-layout.sb-open { grid-template-columns: minmax(0, 1fr); }
.sb-layout.sb-open > .sb-side { display: none; }
.sb-main.sb-editing { background: transparent; border: 0; padding: 0; }
#sb-edit { display: flex; flex-direction: column; gap: 12px; }
.sb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.sb-bar .sb-title { flex: 1 1 260px; min-width: 200px; font-size: 18px; font-weight: 800; }
.sb-dbtns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 좁은 화면: 제목 줄의 '8컷 · 약 29초 · 이미지 6/8 · 영상 2/8'은 ③ 단계 버튼·컷 목록 머리에도 있어 숨김 (제목 줄이 두 줄로 늘지 않게) */
@media (max-width: 1360px) { #sb-sum { display: none; } }
.sb-dbtn.on, .sb-dbtn.on:hover { border-color: var(--text); background: var(--text); color: #fff; }
.sb-dcount { font-weight: 400; opacity: .7; }
.sb-bar .sb-share { flex: none; white-space: nowrap; margin: 0 0 0 4px; }
.sb-menu { position: relative; }
.sb-menu > summary { list-style: none; }
.sb-menu > summary::-webkit-details-marker { display: none; }
.sb-menu-pop { position: absolute; z-index: 6; top: calc(100% + 4px); left: 0; min-width: 170px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12); padding: 4px; display: flex; flex-direction: column; }
.sb-menu-pop.right { left: auto; right: 0; }
.sb-menu-pop button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); white-space: nowrap; }
.sb-menu-pop button:hover { background: #f0f1f3; }
.sb-menu-pop button.danger, .linkish.danger { color: var(--err); }
#sb-status:empty { display: none; }
#sb-status .sb-status { margin: 0 0 6px; }
#sb-status .sb-status:last-child { margin: 0; }
.sb-drawer { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.sb-drawer[hidden] { display: none; }
.sb-drawer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sb-drawer textarea[name=script] { width: 100%; }
.sb-drawer .sb-refs { border: 0; padding: 0; margin: 0; }
.sb-drawer .sb-place-list + .hint { margin: 10px 0 0; }
.sb-replan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.sb-settings-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-bottom: 8px; }
.sb-settings-checks label.check { margin: 0; }
label.sb-inl { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
label.sb-inl select { padding: 6px 8px; }

.sb-work { display: grid; grid-template-columns: 250px minmax(0, 1fr) 400px; gap: 12px; align-items: start; }
.sb-nav, .sb-stage, .sb-shot { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
/* 처음 열었을 때(위 제목 줄 아래)도 패널 끝의 만들기 단추가 화면 안에 들도록 높이를 넉넉히 줄임 */
.sb-nav, .sb-shot { position: sticky; top: calc(var(--hdr-h, 56px) + 12px); max-height: calc(100vh - var(--hdr-h, 56px) - 130px); }
/* 왼쪽 컷 목록 */
.sb-nav { display: flex; flex-direction: column; overflow: hidden; }
.sb-nav-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 12px 0; }
.sb-nav-head b { font-size: 15px; }
.sb-filters { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px 12px 0; }
.sb-filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 7px; font: inherit; font-size: 11.5px; cursor: pointer; color: var(--text); white-space: nowrap; }
.sb-filters button.bad { border-color: #f3c2cb; background: #fdecef; color: #9b0c24; }
.sb-filters button.on { background: var(--text); border-color: var(--text); color: #fff; }
.sb-bulk { display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px 6px; align-items: center; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); }
.sb-bulk > span { grid-column: 1 / -1; }
.sb-bulk > .btn { white-space: nowrap; padding: 5px 6px; }
.sb-nav-list { overflow-y: auto; flex: 1 1 auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.sb-nav-list > *, .sb-scn-list > * { flex-shrink: 0; }   /* 컷·씬이 많아 넘칠 때 묶음 이름·줄이 납작해지지 않게 */
.sb-nav-grp { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 6px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav-empty { padding: 8px 6px; margin: 0; }
.sb-row { display: flex; gap: 8px; align-items: center; border: 1px solid transparent; background: #fff; border-radius: 6px; padding: 5px; text-align: left; font: inherit; cursor: pointer; color: var(--text); min-width: 0; }
.sb-row:hover { background: #f7f8fa; }
.sb-row.sel { border-color: var(--primary); background: #fff5f6; }
.sb-row-th { position: relative; width: 56px; height: 32px; flex: none; border-radius: 4px; background: #e9ebee center/cover no-repeat; }
.sb-row-th i { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-size: 9px; color: #fff; text-shadow: 0 0 3px #000; }
.sb-row-tx { display: flex; flex-direction: column; min-width: 0; font-size: 12px; gap: 1px; }
.sb-row-l1, .sb-row-sc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-row-st { font-size: 11px; color: var(--muted); }
.sb-row-st.ok { color: var(--ok); }
.sb-row-st.bad { color: var(--err); font-weight: 600; }
.sb-row-st.warn, .sb-row-st.busy { color: #9a5b00; }
.sb-row-sc { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav-add { margin: 6px 12px 12px; }
/* 가운데: 고른 컷 */
.sb-stage { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sb-stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sb-stage-head h3 { margin: 0; font-size: 18px; color: var(--primary); }
.sb-view { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; background: #23262b; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.sb-view.portrait { aspect-ratio: 4 / 5; max-height: 70vh; }
.sb-view.square { aspect-ratio: 4 / 3; }
.sb-view img, .sb-view video { width: 100%; height: 100%; object-fit: contain; display: block; }
.sb-view img { cursor: zoom-in; }
.sb-view-empty { color: #e8eaed; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; text-align: center; padding: 20px; }
.sb-view-empty span { color: #aab0b8; font-size: 13px; }
.sb-view-badge { position: absolute; left: 10px; top: 8px; font-size: 12px; background: rgba(20, 22, 26, .72); color: #e8eaed; padding: 3px 9px; border-radius: 10px; pointer-events: none; }
.sb-view-open { position: absolute; right: 8px; top: 6px; border: 0; background: rgba(20, 22, 26, .72); color: #e8eaed; font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 10px; cursor: pointer; }
.sb-view-open:hover { background: rgba(20, 22, 26, .9); }
.sb-view-note { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(20, 22, 26, .78); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 10px; white-space: nowrap; pointer-events: none; }
.sb-view-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); color: #8a5a00; font-weight: 700; pointer-events: none; }
.sb-cands { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sb-cand { width: 72px; height: 41px; padding: 0; border-radius: 5px; border: 2px solid transparent; background: #e9ebee center/cover no-repeat; cursor: pointer; opacity: .8; }
.sb-cand:hover { opacity: 1; }
.sb-cand.on { border-color: var(--primary); opacity: 1; }
.sb-stage-fields label { margin-bottom: 8px; }
.sb-stage-fields textarea, .sb-stage-fields input:not([type=checkbox]) { width: 100%; }
.sb-stage-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.sb-stage-row select { min-width: 200px; }
.sb-stage-row input[data-f=seconds] { width: 76px; padding: 6px 8px; }
.sb-stage-ops { display: flex; gap: 16px; align-items: center; }
.sb-stage-ops .linkish { color: var(--muted); text-decoration: none; }
.sb-stage-ops .linkish:hover { text-decoration: underline; }
.sb-stage-ops .linkish.danger { color: var(--err); }
.sb-stage-ops .linkish:disabled { opacity: .4; cursor: default; text-decoration: none; }
/* 오른쪽: 샷 패널 */
.sb-shot { overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.sb-shot-head { display: flex; align-items: center; gap: 8px; }
.sb-shot-head b { font-size: 15px; }
.sb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sb-seg button { border: 0; background: #fff; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.sb-seg button.on { background: var(--text); color: #fff; }
.sb-shot-sec { display: flex; flex-direction: column; gap: 6px; }
.sb-shot-sec textarea { width: 100%; font-size: 12.5px; line-height: 1.5; }
.sb-shot-sec .hint, .sb-shot > .hint { margin: 0; }
.sb-shot .pe-warn { margin: 0; }
.sb-shot .sb-motion-bar { margin: 0; }
.sb-shot details.help { margin: 0; }
.sb-shot .sb-refimg { align-self: flex-start; }
.sb-shot-place { margin: 0; }
.sb-cams { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.sb-cam, .sb-vm { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; text-align: left; color: var(--text); }
.sb-cam { padding: 4px; align-items: center; }
.sb-cam svg { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 5px; background: #2a2e35; }
.sb-cam svg rect { fill: none; stroke: #7a828e; stroke-width: 1; stroke-dasharray: 2 2; }
.sb-cam svg path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sb-cam b { font-size: 11.5px; white-space: nowrap; }
.sb-cam-note { margin: 0; }
.sb-cam span { font-size: 11px; color: var(--muted); line-height: 1.3; }
.sb-cam:hover, .sb-vm:hover { border-color: #c9ced6; }
.sb-cam.on, .sb-vm.on { border-color: var(--primary); background: #fff5f6; }
.sb-vms { display: flex; flex-direction: column; gap: 6px; }
.sb-vm { padding: 7px 10px; gap: 1px; }
.sb-vm b { font-size: 13px; }
.sb-vm span { font-size: 11px; color: var(--muted); }
.sb-vm .sb-vm-def { font-size: 11px; font-weight: 600; color: var(--primary); }
.sb-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sb-chips .chip { padding: 3px 10px; font-size: 12px; }
.sb-shot-checks label.check { margin: 0; font-size: 13px; }
.sb-shot-go { padding: 11px 14px; font-size: 14px; }
/* 만들기 단추는 패널을 내려도 늘 보이게 (패널 아래에 붙음) */
.sb-shot-foot { position: sticky; bottom: -14px; margin: 0 -14px -14px; padding: 10px 14px 14px; background: #fff; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; z-index: 1; }
/* 전체 타임라인 (2026-11-24 컷 작업 칸 위로): 왼쪽 전체 길이·진행 / 가운데 컷 띠 + 눈금 / 오른쪽 ④ 완성으로 */
.sb-tl { display: grid; grid-template-columns: 150px minmax(0, 1fr) 190px; gap: 18px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.sb-tl-sum { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sb-tl-total { display: flex; align-items: baseline; gap: 6px; }
.sb-tl-total b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.sb-tl-total span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sb-tl-meter { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; }
.sb-tl-meter i { display: block; flex-basis: 0; height: 100%; }
.sb-tl-counts { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); }
.sb-tl-counts span { white-space: nowrap; }
.sb-tl-counts i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.sb-tl-meter .v, .sb-tl-counts .v { background: var(--ok); }
.sb-tl-meter .i, .sb-tl-counts .i { background: #e0a43a; }
.sb-tl-meter .n, .sb-tl-counts .n { background: #d5d9de; }
.sb-tl-scroll { overflow-x: auto; min-width: 0; }
.sb-tl-in { display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.sb-tl-track { display: flex; gap: 3px; }
/* 컷 칸: 컷 길이만큼 폭, 아래 색 줄 = 영상 있음(초록) · 이미지만(주황) · 없음(회색), 만드는 중이면 줄이 움직임 */
.sb-tl-b { container-type: inline-size; flex-basis: 0; min-width: 40px; height: 58px; padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  position: relative; cursor: pointer; font: inherit; background: #e9ebee center/cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07);
  transition: transform .12s, box-shadow .12s; }
.sb-tl-b::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, 0) 55%); }
.sb-tl-b::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: #c9ced6; }
.sb-tl-b.v::after { background: var(--ok); }
.sb-tl-b.i::after { background: #e0a43a; }
.sb-tl-b.n { background: repeating-linear-gradient(135deg, #f3f4f6 0 6px, #e9ebee 6px 12px); }
.sb-tl-b.n::before { display: none; }
.sb-tl-b.busy::after { height: 6px; background: repeating-linear-gradient(90deg, var(--primary) 0 8px, #f5b9c3 8px 16px); background-size: 32px 100%;
  animation: sb-tl-busy 1s linear infinite; }
@keyframes sb-tl-busy { to { background-position: 32px 0; } }
.sb-tl-no, .sb-tl-sec { position: absolute; top: 4px; z-index: 1; color: #fff; text-shadow: 0 0 3px rgba(0, 0, 0, .7); line-height: 1.2; }
.sb-tl-no { left: 6px; font-size: 12px; font-weight: 800; }
.sb-tl-sec { right: 6px; font-size: 10.5px; font-weight: 600; opacity: .95; }
.sb-tl-b.n .sb-tl-no, .sb-tl-b.n .sb-tl-sec { color: var(--muted); text-shadow: none; }
@container (max-width: 72px) { .sb-tl-sec { display: none; } }
.sb-tl-play { position: absolute; z-index: 1; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 9px; font-style: normal; display: grid; place-items: center; padding-left: 2px; }
.sb-tl-b:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07), 0 3px 8px rgba(0, 0, 0, .15); }
.sb-tl-b.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
.sb-tl-b:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 시간 눈금 (컷 사이 틈 때문에 대략의 위치) */
.sb-tl-ruler { position: relative; height: 14px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-tl-ruler span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sb-tl-ruler span:first-child { transform: none; }
.sb-tl-ruler span.end { transform: translateX(-100%); font-weight: 700; color: var(--text); }
.sb-tl-empty { margin: 0; padding: 20px 0; text-align: center; }
.sb-tl-go { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sb-tl-final { padding: 11px 14px; font-size: 14.5px; font-weight: 700; }
.sb-tl-final:not(.primary) { border-color: var(--text); }
.sb-tl-final:disabled { opacity: .45; cursor: default; }
.sb-tl-note { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.35; }
.sb-tl-watch { align-self: center; font-size: 12.5px; color: var(--text); font-weight: 600; text-decoration: none; }
.sb-tl-watch:hover { text-decoration: underline; }
@media (max-width: 1399px) { .sb-tl { grid-template-columns: 128px minmax(0, 1fr) 170px; gap: 14px; } }
@media (max-width: 900px) {   /* 좁은 화면: 위 줄 = 길이·진행 | 완성으로, 아래 줄 = 컷 띠 (옆으로 넘김) */
  .sb-tl { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 10px 12px; }
  .sb-tl-sum { grid-column: 1; grid-row: 1; }
  .sb-tl-go { grid-column: 2; grid-row: 1; max-width: 180px; }
  .sb-tl-scroll { grid-column: 1 / -1; grid-row: 2; }
  .sb-tl-final { padding: 9px 12px; font-size: 13.5px; }
  .sb-tl-b { height: 50px; }
}

@media (max-width: 1399px) {
  .sb-work { grid-template-columns: 210px minmax(0, 1fr) 340px; }
}
@media (max-width: 1099px) {   /* 좁은 화면: 한 줄로 쌓음 — 컷 목록은 가로로 넘기기, 샷 패널은 고른 컷 아래 */
  .sb-work { grid-template-columns: minmax(0, 1fr); }
  .sb-nav, .sb-shot { position: static; max-height: none; }
  .sb-nav-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .sb-row { flex: 0 0 200px; }
  .sb-nav-grp { display: none; }
  .sb-cams { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .sb-vms { flex-direction: row; flex-wrap: wrap; }
  .sb-vm { flex: 1 1 200px; }
}
@media (max-width: 900px) {
  .sb-layout { grid-template-columns: 1fr; }
  .sb-side { position: static; }
  .sb-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .sb-step { padding: 6px 8px; gap: 6px; }
  .sb-step-tx span { display: none; }
}

/* 스토리보드 단계 탭 ① 기획 ② 대본 ③ 컷·영상 (2026-11-20 목업) */
.sb-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sb-step { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px;
  font: inherit; text-align: left; cursor: pointer; color: var(--text); min-width: 0; }
.sb-step:hover { border-color: #c9ced6; }
.sb-step.on { border-color: var(--text); box-shadow: inset 0 -3px 0 var(--primary); }
.sb-step-no { font-size: 20px; font-weight: 800; color: #b3b8c0; line-height: 1; }
.sb-step.on .sb-step-no { color: var(--primary); }
.sb-step-tx { display: flex; flex-direction: column; min-width: 0; }
.sb-step-tx b { font-size: 14px; }
.sb-step-tx span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-step.busy .sb-step-tx span { color: #9a5b00; font-weight: 600; }
.sb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-chip { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.sb-chip:hover { border-color: #c9ced6; }
.sb-chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.sb-cgrp { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.sb-clab { font-size: 13px; font-weight: 600; }
.sb-new-brief { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 8px; background: #fafbfc; }
.sb-new-brief label { margin: 0; }
.sb-new-brief textarea { width: 100%; }
.sb-new-or { font-size: 14px; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.sb-fromscript { margin-bottom: 10px; }

/* ① 기획: 왼쪽 아이디어 · 오른쪽 기획안 */
.sb-pv { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 12px; align-items: start; }
.sb-brief, .sb-plans { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.sb-brief { position: sticky; top: calc(var(--hdr-h, 56px) + 12px); display: flex; flex-direction: column; gap: 10px; }
.sb-brief h3 { margin: 0; font-size: 16px; }
.sb-brief label { margin: 0; }
.sb-brief textarea, .sb-brief input { width: 100%; }
.sb-brief textarea[data-b=idea] { min-height: 170px; resize: vertical; line-height: 1.55; }
.sb-brief .hint, .sb-brief-set { margin: 0; }
.sb-other { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.sb-ptabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sb-ptab { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.sb-ptab.on { background: var(--text); color: #fff; border-color: var(--text); }
.sb-ptab.busy { color: #9a5b00; border-style: dashed; cursor: default; font-weight: 400; }
.sb-ptab-pick { font-size: 11px; font-weight: 700; color: var(--primary); background: #fdecef; border-radius: 6px; padding: 1px 5px; margin-left: 6px; }
.sb-plan-empty, .sb-sv-empty { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; padding: 48px 20px; color: var(--muted); }
.sb-plan-empty b, .sb-sv-empty b { color: var(--text); font-size: 15px; }
.sb-sv-empty-acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.sb-plan-card { display: flex; flex-direction: column; gap: 8px; }
.sb-plan-card h4 { margin: 10px 0 0; font-size: 14px; }
.sb-plan-card h4 span { font-weight: 400; color: var(--muted); font-size: 12px; }
.sb-plan-meta { font-size: 12px; color: var(--muted); }
.sb-picked { color: var(--primary); }
.sb-plan-title { font-size: 20px; font-weight: 800; width: 100%; }
.sb-plan-card textarea { width: 100%; }
.sb-acts { display: flex; gap: 4px; }
.sb-act { flex-basis: 0; min-width: 72px; border-radius: 8px; padding: 6px 9px; display: flex; flex-direction: column; gap: 1px; font-size: 12px; overflow: hidden; }
.sb-act b { font-size: 13px; }
.sb-act-d { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ps { display: flex; flex-direction: column; gap: 4px; }
.sb-ps-row { display: grid; grid-template-columns: 8px 44px 22px 150px 70px minmax(0, 1fr) 140px 18px; gap: 6px; align-items: center; }
.sb-ps-row input, .sb-ps-row select { padding: 5px 7px; font-size: 13px; min-width: 0; width: 100%; }
.sb-ps-dot { width: 8px; height: 8px; border-radius: 50%; }
.sb-ps-no { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* 씬 순서 바꾸기 ▲▼ (막은 그 자리에 남고 씬 내용만 옮김) */
.sb-ps-mv { display: flex; flex-direction: column; align-items: center; }
.sb-ps-mv button { border: 0; background: none; padding: 0; width: 22px; height: 14px; font-size: 9px; line-height: 14px; color: var(--muted); cursor: pointer; border-radius: 3px; }
.sb-ps-mv button:hover:not(:disabled) { color: var(--text); background: #eef0f3; }
.sb-ps-mv button:disabled { opacity: .25; cursor: default; }
label.sb-ps-sec { display: flex; flex-direction: row; align-items: center; gap: 3px; margin: 0; font-size: 12px; }
.sb-add-row { align-self: flex-start; }
.sb-pc { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
.sb-pc-row { display: flex; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; align-items: flex-start; background: #fff; }
.sb-pc-ph { flex: none; width: 52px; height: 52px; border-radius: 8px; background: #eef0f3; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); text-align: center; }
.sb-pc-ph.voice { background: #f7f8fa; border: 1px dashed var(--line); }
.sb-pc-f { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sb-pc-f input:not([type=checkbox]) { width: 100%; padding: 5px 7px; font-size: 13px; }
.sb-pc-name { font-weight: 700; }
.sb-pc-f label.check { margin: 0; }
.sb-add-card { min-height: 60px; }
.sb-plan-refs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sb-plan-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.sb-plan-card > .hint { margin: 0; }

/* ② 대본: 씬 목록 · 고른 씬 · 분량·점검·컷으로 나누기 (2026-11-24 글자 줄임: 설명은 마우스를 올리면, 화면에는 숫자·막대·짧은 표시) */
.sb-sv { display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.sb-sv.empty { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.sb-scn-nav, .sb-scn-edit, .sb-sbox { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.sb-scn-nav, .sb-scn-side { position: sticky; top: calc(var(--hdr-h, 56px) + 12px); max-height: calc(100vh - var(--hdr-h, 56px) - 130px); }
.sb-scn-nav { display: flex; flex-direction: column; overflow: hidden; }
.sb-scn-list { overflow-y: auto; flex: 1 1 auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
/* 씬 줄: 1줄 번호·이름·(!)·길이, 2줄 말 길이 막대 + 상태 */
.sb-scn-row { display: flex; flex-direction: column; gap: 5px; border: 1px solid transparent; background: #fff; border-radius: 7px; padding: 7px 9px;
  text-align: left; font: inherit; cursor: pointer; color: var(--text); min-width: 0; }
.sb-scn-row:hover { background: #f7f8fa; }
.sb-scn-row.sel { border-color: var(--primary); background: #fff5f6; }
.sb-scn-l1 { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.sb-scn-l1 > b { flex: none; min-width: 18px; height: 18px; border-radius: 9px; background: #eef0f3; color: var(--muted); font-size: 11px;
  display: grid; place-items: center; padding: 0 4px; }
.sb-scn-row.sel .sb-scn-l1 > b { background: var(--primary); color: #fff; }
.sb-scn-nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sb-scn-warn { flex: none; width: 15px; height: 15px; border-radius: 50%; background: #e0a43a; color: #fff; font-size: 10px; font-weight: 800; font-style: normal;
  display: grid; place-items: center; }
.sb-scn-dur { flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-scn-l2 { display: flex; align-items: center; gap: 8px; padding-left: 25px; }
.sb-scn-l2 .sb-sbar { flex: 1; }
.sb-scn-tag { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
.sb-scn-tag.ok { color: var(--ok); font-weight: 600; }
.sb-scn-tag.warn { color: #9a5b00; font-weight: 600; }
.sb-scn-tag.busy { color: #9a5b00; font-weight: 700; }
/* 말 길이 막대 (씬 길이 중 말) · 분량 막대 (합계 / 목표) */
.sb-sbar { display: block; height: 5px; border-radius: 3px; background: #eceef1; overflow: hidden; min-width: 40px; }
.sb-sbar i { display: block; height: 100%; border-radius: 3px; background: #7f93ad; }
.sb-sbar.over i { background: #e0a43a; }
.sb-sbar.wide { height: 6px; }
/* 가운데 고른 씬 */
.sb-scn-edit { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.sb-scn-head { display: flex; align-items: center; gap: 10px; }
.sb-scn-head b { font-size: 18px; color: var(--primary); white-space: nowrap; }
.sb-scn-name { font-size: 16px; font-weight: 700; flex: 1 1 200px; min-width: 0; }
.sb-scn-sum { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.sb-scn-sum span { flex: none; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 0 5px; background: #eef0f3; color: var(--muted); }
.sb-scn-edit label { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; gap: 4px; }
.sb-scn-edit > label textarea { width: 100%; color: var(--text); font-weight: 400; }
.sb-scn-meta { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 96px; gap: 10px; }
.sb-scn-meta select, .sb-scn-meta input { width: 100%; color: var(--text); font-weight: 400; }
.sb-scn-len span { display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 400; }
.sb-scn-len input { padding-right: 4px; }
.sb-lines { display: flex; flex-direction: column; gap: 5px; }
.sb-lines-head { display: flex; align-items: center; gap: 10px; }
.sb-lines-head > b { font-size: 12.5px; color: var(--muted); }
.sb-scn-meter { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sb-scn-meter .sb-sbar { flex: 1; max-width: 220px; }
.sb-scn-meter .over { color: #9a5b00; font-weight: 700; }
.sb-lines-empty { margin: 2px 0; }
.sb-line { display: grid; grid-template-columns: 112px minmax(0, 1fr) 40px 22px; gap: 6px; align-items: start; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px; background: #fff; }
.sb-line.flag { background: #fff6e5; border-color: #f3dcae; }
.sb-line input { padding: 5px 7px; font-size: 13px; width: 100%; min-width: 0; font-weight: 600; }
.sb-line textarea { width: 100%; padding: 5px 7px; font-size: 14px; min-height: 32px; resize: vertical; }
.sb-line-flag { display: block; font-size: 11px; color: #9a5b00; margin-top: 2px; }
.sb-line-sec { font-size: 11.5px; color: var(--muted); padding-top: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.sb-line-del { border: 0; background: none; color: #b3b8c0; font-size: 17px; line-height: 1; padding: 6px 0 0; cursor: pointer; font-family: inherit; }
.sb-line-del:hover { color: var(--err); }
.sb-line-add { align-self: flex-start; }
.sb-scn-ai { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; flex-wrap: wrap; }
.sb-scn-note { flex: 1 1 260px; min-width: 0; }
.sb-scn-ops { display: flex; gap: 6px; flex: none; }
.sb-scn-busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .62); display: flex; align-items: center; justify-content: center; color: #8a5a00; font-weight: 700; border-radius: 10px; }
/* 오른쪽 */
.sb-scn-side { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.sb-sbox { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.sb-sbox > p { margin: 0; }
.sb-sbox label.check { margin: 0; }
.sb-big { font-size: 22px; font-weight: 800; }
.sb-dur-l1 { display: flex; align-items: baseline; gap: 6px; }
.sb-dur-off { color: #9a5b00; }
.sb-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sb-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.sb-checks li > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.sb-checks i { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--ok); }
.sb-checks li.warn i { background: #e0a43a; }
.sb-checks li.info i { background: #8fa3bf; }
.sb-checks li.ok div { font-size: 12px; }
.sb-chk-scns { display: contents; }
.sb-chk-scn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 7px; font: inherit; font-size: 11.5px; line-height: 19px; cursor: pointer; color: var(--text); }
.sb-chk-scn:hover { border-color: #c9ced6; }
.sb-chk-scn.on { border-color: var(--primary); color: var(--primary); }
.sb-checks .btn { padding: 3px 10px; }
.sb-split-which { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sb-split-which label { flex: 1; margin: 0; padding: 6px 8px; text-align: center; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); flex-direction: row; justify-content: center; }
.sb-split-which label + label { border-left: 1px solid var(--line); }
.sb-split-which label.on { background: var(--text); color: #fff; }
.sb-split-which input { position: absolute; opacity: 0; pointer-events: none; }
.sb-split-which label:focus-within { outline: 2px solid var(--primary); outline-offset: -2px; }
.sb-split .hint { font-size: 11.5px; }
.sb-castbox > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.sb-castbox > summary::-webkit-details-marker { display: none; }
.sb-castbox > summary b::after { content: " ▾"; color: var(--muted); font-weight: 400; }
.sb-castbox[open] > summary b::after { content: " ▴"; }
.sb-castbox > summary span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-castbox[open] { gap: 8px; }
.sb-cw { display: flex; flex-direction: column; gap: 6px; }
.sb-cw-row { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.sb-cw-row input:not([type=checkbox]) { width: 100%; padding: 4px 6px; font-size: 12px; min-width: 0; }
.sb-cw-l1 { display: flex; gap: 6px; align-items: center; }
.sb-cw-l1 .sb-cw-name { flex: 1; font-weight: 700; }
.sb-cw-l1 .sb-line-del { padding: 0; }
.sb-cw-l1 label.check { white-space: nowrap; }
.sb-cw-acts { display: flex; gap: 6px; flex-wrap: wrap; }
/* ①·② 좁은 화면 — 기본 규칙보다 뒤에 있어야 함 (위 @media 묶음에 두었을 때는 이 아래 기본 규칙이 덮어써 휴대폰에서 세 칸이 옆으로 찌그러짐) */
@media (max-width: 1399px) {
  .sb-pv { grid-template-columns: 320px minmax(0, 1fr); }
  .sb-sv { grid-template-columns: 200px minmax(0, 1fr) 270px; }
  .sb-ps-row { grid-template-columns: 8px 40px 22px 120px 66px minmax(0, 1fr) 110px 16px; }
}
@media (max-width: 1099px) {
  .sb-pv, .sb-sv { grid-template-columns: minmax(0, 1fr); }
  .sb-brief, .sb-scn-nav, .sb-scn-side { position: static; max-height: none; }
  .sb-scn-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .sb-scn-row { flex: 0 0 180px; }
  .sb-scn-list .sb-nav-grp { display: none; }
  .sb-scn-side { overflow: visible; }
  .sb-ps-row { grid-template-columns: 8px 40px 22px minmax(0, 1fr) 66px 16px; }
  .sb-ps-row [data-ps=summary] { grid-column: 4 / 6; }
  .sb-ps-row select { grid-column: 4 / 6; }
  .sb-ps-row > .danger { grid-column: 6; grid-row: 1; }
}
@media (max-width: 640px) {   /* 휴대폰: 말 줄은 누가(위) · 말(아래 전체 폭) */
  .sb-scn-meta { grid-template-columns: minmax(0, 1fr) 84px; }
  .sb-scn-meta label:first-child { grid-column: 1 / -1; }
  .sb-line { grid-template-columns: minmax(0, 1fr) 22px; }
  .sb-line input[data-l=who] { max-width: 160px; }
  .sb-line-t { grid-column: 1 / -1; grid-row: 2; }
  .sb-line-sec { display: none; }
  .sb-scn-ops { width: 100%; }
  .sb-scn-ops .btn.primary { flex: 1; }
}

/* 사용 모델 */
.model-row { margin: -4px 0 12px; display: flex; flex-direction: column; gap: 2px; }
.model-row:empty { display: none; }
.model-fixed { font-size: 13px; color: var(--muted); }
.model-fixed b { color: var(--text); font-weight: 600; margin: 0 4px; }
.model-pick { flex-direction: row !important; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.model-pick select { padding: 5px 8px; font-size: 13px; }
.model-desc { margin-left: 2px; }

/* 멀티참조 태그 점검 */
.tag-warn { margin: 8px 0 4px; padding: 10px 12px; border-radius: 8px; background: #fff8e6; color: #7a4d00; font-size: 13px; line-height: 1.5; }
.tag-warn ul { margin: 4px 0 0; padding-left: 18px; }
.tag-warn li + li { margin-top: 3px; }

/* 참고 영상으로 만든 컷: 원본 장면 */
.sb-refimg { display: flex; align-items: center; gap: 8px; border: 1px dashed var(--line); border-radius: 6px; background: #fafafa; padding: 3px; cursor: pointer; font: inherit; text-align: left; }
.sb-refimg:hover { border-color: var(--primary); }
.sb-refimg img { width: 84px; border-radius: 4px; display: block; }
.sb-refimg span { font-size: 11px; color: var(--muted); }
.sb-castmap { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; background: #fafafa; }
.sb-castmap-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sb-castmap-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.sb-castmap-tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 2px 4px; }
.sb-castmap-tbl td { padding: 2px 4px; }
.sb-castmap-tbl td:first-child { white-space: nowrap; }
.sb-castmap-tbl td:nth-child(2) { width: 9em; }
.sb-castmap-tbl input { width: 100%; }
.sb-castmap .hint { margin: 6px 0 0; }
.sb-castmap-tbl input.bad { border-color: #d33; background: #fff3f3; }
.sb-castmap-warn { color: #b42318; margin: 6px 0 0; }
.sb-fromvideo { margin-bottom: 14px; }
.sb-videohint { margin: -4px 0 10px; }
.sb-vid { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px; cursor: pointer; font: inherit; text-align: left; }
.sb-vid:hover { border-color: var(--primary); }
.sb-vthumb { width: 64px; height: 40px; flex: none; border-radius: 4px; background: #222 center/cover no-repeat; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; text-shadow: 0 1px 3px #000; }

/* 글자 넣기 */
.tx-preview { position: relative; width: fit-content; max-width: 100%; margin: 6px auto 0; }
.tx-preview:not(.ready) { width: 100%; }
.tx-preview img { display: none; max-width: 100%; max-height: 460px; border-radius: 8px; cursor: crosshair; user-select: none; touch-action: none; }
.tx-preview.ready img { display: block; }
.tx-preview.ready .tx-empty { display: none; }
.tx-preview.loading img { opacity: .85; }
.tx-empty { padding: 36px 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.tx-mark { display: none; position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); pointer-events: none; }
.tx-preview.ready .tx-mark { display: block; }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 250px; overflow: auto; padding: 2px; margin-bottom: 12px; }
.font-opt { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 6px; cursor: pointer; text-align: left; font: inherit; }
.font-opt img { display: block; width: 100%; height: 30px; object-fit: contain; object-position: left center; }
.font-opt span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-opt.active { border-color: var(--primary); background: #fff5f6; box-shadow: 0 0 0 1px var(--primary); }
.tx-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tx-sliders input[type=range] { width: 100%; }
.rv { color: var(--primary); font-weight: 700; font-size: 12px; }
input[type=color] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.finish-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.finish-grid label { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; }
.finish-grid label small { color: var(--muted); font-weight: 400; }
.finish-grid label:has(input:checked) { border-color: var(--primary); background: #fff5f6; }
.model-row.dim { opacity: .45; }
@media (max-width: 700px) {
  .finish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tx-sliders { grid-template-columns: 1fr; }
}

/* 영상에 글자 붙이기: 멈춘 장면 위에 네 모서리 영역 · 글자·그림 층 */
.vt-stage { margin: 4px 0 12px; }
.vt-view { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; user-select: none; touch-action: none; }
.vt-video, .vt-prev { display: block; max-width: 100%; max-height: 520px; border-radius: 8px; background: #000; }
.vt-prev { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.vt-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.vt-poly { fill: rgba(200, 16, 46, .12); stroke: #ff3b55; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: all; cursor: move; }
.vt-prev:not(.hidden) ~ .vt-svg .vt-poly { fill: none; stroke-dasharray: 5 4; }
.vt-h { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; border: 3px solid #ff3b55; box-shadow: 0 1px 4px rgba(0,0,0,.45); cursor: grab; touch-action: none; }
.vt-h:active { cursor: grabbing; }
.vt-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.vt-bar .vt-time { flex: 1 1 200px; padding: 0; }
.vt-bar .vt-tlabel { min-width: 92px; }
.vt-refinfo { color: var(--primary); }
.vt-layers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.vt-layer { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 8px; padding: 10px 12px 0; background: #fcfcfd; }
.vt-layer[data-kind=image] { border-left-color: #2f6fde; }
.vt-lhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.vt-times { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.vt-times input { width: 70px; padding: 5px 6px; }
.vt-times .btn, .vt-acts .btn { padding: 4px 8px; font-size: 12px; }
.vt-acts { margin-left: auto; display: inline-flex; gap: 4px; }
.vt-layer textarea { width: 100%; margin-bottom: 8px; }
.vt-irow { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.vt-irow label { flex: 1 1 220px; }
.vt-add { display: flex; gap: 8px; margin-bottom: 14px; }
.vt-touchbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; }
.vt-tlist { flex: 1 1 300px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; line-height: 1.5; }
.vt-tchip { border: 1px solid #ff3b55; background: #fff5f6; color: var(--primary); border-radius: 14px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.vt-tmark { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: rgba(255, 59, 85, .9); color: #fff; font-size: 14px; line-height: 24px; text-align: center; font-weight: 800; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
@media (max-width: 700px) { .vt-acts { margin-left: 0; } }

/* 소리 입히기 (2026-11-24): 영상 · 시간 줄(장면 띠 · 원래 소리 파형 · 내레이션 조각 · 배경음악 · 눈금) · 목소리 · 줄 목록 */
.db-stage { margin: 8px 0 4px; }
.db-video { display: block; max-width: 100%; max-height: 420px; margin: 0 auto; border-radius: 8px; background: #000; cursor: pointer; }
/* 자막 미리보기: 영상 위 같은 자리 (dbSubPlace 가 영상 크기에 맞춤), 모양은 finishing.sub_box 와 같게 (반투명 검은 띠 + 흰 굵은 글자) */
.db-vbox { position: relative; }
.db-sub { position: absolute; pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.db-sub img { display: block; max-width: 100%; }   /* 서버가 그린 자막 그림 (완성과 같은 글꼴·모양) */
.db-subfont { max-width: 210px; }
.db-subrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; }
.db-subrow .check { margin: 0; }
.db-subrow .db-inline select { padding: 5px 8px; }
.db-subrow.off .db-subopt { opacity: .45; }
.db-subtip { margin: 0 0 12px; }
.db-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.db-tlabel { font-variant-numeric: tabular-nums; min-width: 96px; }
.db-note.warn { color: var(--err); font-weight: 600; }
.db-tl { position: relative; border: 1px solid var(--line); border-radius: 8px; background: #fbfbfc; padding: 5px 0 2px; user-select: none; touch-action: none; }
.db-lane { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; padding: 2px 10px 2px 0; }
.db-ln { font-size: 11.5px; color: var(--muted); text-align: right; padding-right: 8px; white-space: nowrap; overflow: hidden; }
.db-track { position: relative; height: 26px; border-radius: 4px; background: #eef0f3; overflow: hidden; cursor: pointer; }
.db-strip { height: 38px; background: #2a2d33 no-repeat; background-size: 100% 100%; }
.db-origt canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.db-wnote, .db-empty-lane { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.db-nlane .db-track { height: 34px; background: #f1f3f6; }
.db-blk { position: absolute; top: 2px; bottom: 2px; min-width: 8px; display: flex; align-items: center; gap: 5px; padding: 0 6px; border-radius: 5px;
  background: #2f6fde; color: #fff; font-size: 11.5px; cursor: grab; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.25); touch-action: none; }
.db-blk:active { cursor: grabbing; }
.db-blk b { flex: none; }
.db-blk span { overflow: hidden; text-overflow: ellipsis; }
.db-blk.stale { background: #8aa7da; }
.db-blk.bad { background: var(--err); }
.db-bgmbar { position: absolute; inset: 0; background: #cfe9d6; display: flex; align-items: center; padding: 0 8px; font-size: 11.5px; color: #1a5f30; }
.db-bgmbar span { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-dip { position: absolute; top: 0; height: 62%; background: rgba(255, 255, 255, .78); pointer-events: none; }   /* 내레이션 동안 음악이 줄어드는 곳 (막대가 낮아 보이게) */
.db-rlane .db-track { height: 15px; background: none; overflow: visible; cursor: default; }
.db-ruler span { position: absolute; top: 1px; font-size: 10.5px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-ruler span:first-child { transform: none; }
.db-headwrap { position: absolute; top: 3px; bottom: 19px; left: 64px; right: 10px; pointer-events: none; }
.db-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--primary); box-shadow: 0 0 0 1px rgba(255,255,255,.6);
           pointer-events: auto; cursor: ew-resize; z-index: 2; }
/* 빨간 줄 잡기: 양옆 6px 까지 잡히게 (보이지 않는 넓은 자리) + 위쪽 손잡이 */
.db-head::before { content: ""; position: absolute; top: 0; bottom: 0; left: -6px; right: -6px; }
.db-head::after { content: ""; position: absolute; top: -4px; left: -5px; width: 12px; height: 10px; border-radius: 3px 3px 6px 6px; background: var(--primary); }
.db-tl:focus { outline: none; }
.db-tl:focus-visible, .db-tl.kb { box-shadow: 0 0 0 2px #f3b5bf; }
.db-tl.scrubbing, .db-tl.scrubbing * { cursor: ew-resize !important; }
.db-tip { margin: 6px 0 0; }
.db-seg { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-bottom: 12px; }
.db-seg label { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.db-voice { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.db-voice label { margin: 0; }
.db-voice textarea { width: 100%; font-weight: 400; }
.db-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.db-pre { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text); }
.db-pre:hover { border-color: #c9ced6; }
.db-pre.on { border-color: var(--primary); color: var(--primary); font-weight: 700; background: #fff5f6; }
.db-voice-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.db-lines { display: flex; flex-direction: column; gap: 6px; }
.db-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 34px 74px 30px; gap: 6px; align-items: center; }
.db-no { width: 20px; height: 20px; border-radius: 50%; background: #eef0f3; color: var(--muted); font-size: 11px; display: grid; place-items: center; }
.db-line.ok .db-no { background: #2f6fde; color: #fff; }
.db-text { width: 100%; min-width: 0; padding: 7px 9px; }
.db-at { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.db-start { width: 60px; padding: 6px; }
.db-lplay, .db-ldel { padding: 5px 0; }
.db-lst { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.db-lst.ok { color: var(--ok); }
.db-lst.new, .db-lst.stale { color: var(--warn); font-weight: 600; }
.db-lst.bad { color: var(--err); font-weight: 700; }
.db-empty { margin: 2px 0; }
.db-lacts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.db-vol { flex-direction: row; align-items: center; gap: 8px; margin: 0 0 12px; }
.db-vol input { flex: 0 1 220px; padding: 0; }
.db-volv { min-width: 40px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.db-inline { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.db-inline input { width: 72px; padding: 6px 8px; }
.db-bgmset { display: flex; flex-direction: column; gap: 8px; }
.db-bgmset .db-vol { margin: 0; }
/* 좁은 화면: 줄 이름 칸을 좁히고, 내레이션 줄은 글(위 전체 폭) / 시각·듣기·상태·빼기(아래) */
@media (max-width: 640px) {
  .db-lane { grid-template-columns: 50px minmax(0, 1fr); padding-right: 6px; }
  .db-headwrap { left: 50px; right: 6px; }
  .db-ln { font-size: 10.5px; padding-right: 5px; }
  .db-line { grid-template-columns: 22px auto 34px 1fr 30px; row-gap: 4px; }
  .db-line .db-no { grid-area: 1 / 1; }
  .db-line .db-text { grid-area: 1 / 2 / 2 / -1; }
  .db-line .db-at { grid-area: 2 / 2; }
  .db-line .db-lplay { grid-area: 2 / 3; }
  .db-line .db-lst { grid-area: 2 / 4; }
  .db-line .db-ldel { grid-area: 2 / 5; }
}

/* 배경음악 만들기 · AI 목소리 만들기 (2026-11-24): 예시 단추는 소리 입히기의 .db-pre, 목소리 칸은 .db-voice 를 같이 씀 */
.mu-presets { margin-bottom: 10px; }
form[data-form=voice] textarea[name=script] { width: 100%; line-height: 1.6; }
.vo-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.vo-lines { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; position: relative; }
.vo-lines:empty { display: none; }
.vo-line { display: grid; grid-template-columns: 34px minmax(0, 1fr) 64px 34px; gap: 6px; align-items: center; padding: 3px 4px; border-radius: 6px; }
.vo-line.now { background: #fff5f6; }
.vo-line .db-no { width: auto; min-width: 20px; padding: 0 5px; border-radius: 10px; }
.vo-line.ok .db-no { background: #2f6fde; color: #fff; }
.vo-text { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vo-line .db-lst { text-align: right; }
.vo-lplay { padding: 5px 0; }
.vo-sum { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.vo-sum.warn { color: var(--err); font-weight: 600; }
/* 내 작업의 소리 결과 (그림이 없어 ♪ 와 길이) */
.job-audio { width: 72px; height: 72px; border-radius: 6px; border: 1px solid var(--line); background: #eef2f8; color: #2f6fde; font-size: 24px;
             cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; }
.job-audio span { font-size: 11px; color: var(--muted); }

/* 만들기 전 예상 시간 · 고품질로 다시 만들기 */
.eta-line { margin: 2px 0 8px; }
.eta-line:empty { display: none; }
.eta-line.eta-long { color: var(--warn); font-weight: 600; }
.job-btns .btn.hq { border-color: #b3cdf5; color: #1a5fd0; }

/* 소리 파일 */
.item .thumb.audio-thumb { display: flex; align-items: center; justify-content: center; font-size: 44px; color: #1a5fd0; background: #eef3fb; }
.audio-box { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 36px 12px; font-size: 56px; color: #1a5fd0; background: #eef3fb; border-radius: 8px; }
.audio-box audio { width: min(520px, 100%); }

/* 보기 창: 장면 훑어보기 */
.vstrip { display: flex; gap: 2px; margin: 8px auto 0; max-width: 100%; }
.vstrip button { flex: 1; aspect-ratio: 16 / 9; min-width: 0; border: 2px solid transparent; border-radius: 4px; padding: 0; cursor: pointer; background-repeat: no-repeat; background-color: #000; }
.vstrip button:hover { border-color: #9cb8e6; }
.vstrip button.on { border-color: var(--primary); }

/* 인물 뽑기: 영상 장면 고르기 */
.cast-scene { margin-bottom: 12px; }
.cast-video { display: block; width: 100%; max-height: 300px; background: #000; border-radius: 8px; }
.cast-strip { margin: 6px 0 8px; }
.cast-t { max-width: 160px; }
form[data-form=cast] .radio-row, form[data-form=cast] .radio-col { margin-bottom: 12px; }

/* 파일 고르기 창: 등장인물 */
.pick-chars, .pick-files-label { grid-column: 1 / -1; }
.pick-chars { display: flex; flex-direction: column; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 10px; }
.pick-char { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.pick-char > .muted { grid-column: 1; }
.pick-char-imgs { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pick-char-imgs button { flex: none; width: 76px; height: 96px; border: 1px solid var(--line); border-radius: 6px; background: #f0f1f3 center/cover no-repeat; cursor: pointer; position: relative; padding: 0; }
.pick-char-imgs button:hover { border-color: var(--primary); }
.pick-char-imgs button span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; padding: 1px 2px; border-radius: 0 0 5px 5px; }
/* 고르기 창 · 고른 사진: 사람 전신이 잘리지 않게 사진 전체를 보여 줌 (남는 곳은 회색) */
.pick-char-imgs button, .picker .pbox.filled { background-size: contain; background-color: #e6e8eb; }

/* 선택 줄 (인물 뽑기 등) */
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.radio-col { display: flex; flex-direction: column; gap: 4px; }

/* 설정: 개인 API 토큰 */
.tok-new input { flex: 1; }
.tok-once { margin: 10px 0; padding: 10px; border: 1px solid #f0c36d; background: #fff8e6; border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.tok-once code { word-break: break-all; font-size: 13px; background: #fff; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); }
.tok-once .btn { align-self: flex-start; }
.tok-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tok-row b { white-space: nowrap; }
.tok-row .muted { flex: 1 1 180px; }
.tok-row .btn { margin-left: auto; white-space: nowrap; }
.tok-ex { font-size: 12px; white-space: pre-wrap; word-break: break-all; background: #f6f7f9; padding: 8px; border-radius: 6px; }
@media (max-width: 760px) { .pick-char { grid-template-columns: 1fr; } .pick-char-imgs { grid-column: 1; grid-row: auto; } }

/* 헤더가 좁을 때 (서버 상태가 헤더로 옮겨 와 폭이 늘어남) */
@media (max-width: 1560px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .tab { padding: 8px 10px; }
  .sys-bar { width: 38px; }
}
@media (max-width: 1300px) {
  .topbar { flex-wrap: wrap; row-gap: 0; padding: 6px 14px 0; }
  .tabs { order: 5; flex: 1 1 100%; overflow-x: auto; padding-bottom: 4px; }
  .tab { white-space: nowrap; }
}
@media (max-width: 640px) {
  .topbar { padding: 6px 8px 0; gap: 6px; }
  .brand { font-size: 15px; }
  .userbox #user-name { display: none; }
  .sys-bar { width: 32px; height: 26px; font-size: 10px; }
  .sys-bar span { font-size: 9px; }
  .sys-chip { display: none; }
}

/* ④ 완성 (2026-11-20 목업 '완성'): 왼쪽 완성본 재생·트랙·목록 / 오른쪽 준비 상태·소리·화면·만들기·내보내기 */
.sb-fv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
.sb-fv-main, .sb-fv-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.sb-fv-main { display: flex; flex-direction: column; gap: 14px; }
.sb-fv-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sb-fv-box { display: flex; flex-direction: column; gap: 8px; }
.sb-fv-box > b { font-size: 15px; }
.sb-fv-box label { margin: 0; }
#sb-fv-player video { width: 100%; max-height: 66vh; background: #111; border-radius: 8px; display: block; }
.sb-fv-cap { font-size: 13px; color: var(--muted); margin-top: 6px; }
.sb-fv-cap b { color: var(--text); }
.sb-fv-empty { aspect-ratio: 16 / 9; max-height: 60vh; width: 100%; background: #23262b; color: #c9cdd3; border-radius: 8px; display: flex; flex-direction: column;
  gap: 8px; align-items: center; justify-content: center; text-align: center; padding: 20px; box-sizing: border-box; font-size: 13px; }
.sb-fv-empty b { color: #fff; font-size: 15px; }
.sb-fv-tracks { overflow-x: auto; }
.sb-fv-tl { position: relative; display: flex; flex-direction: column; gap: 5px; }
.sb-fv-tr { display: flex; align-items: center; gap: 8px; }
.sb-fv-tn { width: 58px; flex: none; font-size: 12px; color: var(--muted); }
.sb-fv-tb { flex: 1; display: flex; gap: 2px; height: 22px; min-width: 0; }
.sb-fv-tb > span { flex-basis: 0; min-width: 0; border-radius: 3px; background: #f3f4f6; }
.sb-fv-tb > span[data-fseek] { cursor: pointer; }
.sb-fv-tb > span.v { background: #4a505a; }
.sb-fv-tb > span.s { background: #e0a43a; }
.sb-fv-tb > span.logo { background: #c8102e; }
.sb-fv-tb > span.n { background: #f8dde3; border: 1px dashed #e7a3b0; box-sizing: border-box; }
.sb-fv-tb > span.m { background: #b9d3f2; }
.sb-fv-tb > span.m.duck { background: #e3edf9; height: 45%; align-self: flex-end; }
.sb-fv-tb > span.t { background: #cfd4da; }
.sb-fv-tb > .sb-fv-none { background: none; font-size: 12px; color: var(--muted); align-self: center; flex: 1; }
.sb-fv-ruler { flex: 1; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.sb-fv-head { position: absolute; top: 0; bottom: 18px; width: 2px; margin-left: -1px; background: var(--primary); pointer-events: none; }
.sb-fv-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 6px 0 0; }
.sb-fv-legend i { display: inline-block; width: 10px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.sb-fv-legend i.v { background: #4a505a; }
.sb-fv-legend i.s { background: #e0a43a; }
.sb-fv-legend i.n { background: #f8dde3; border: 1px dashed #e7a3b0; }
.sb-fv-vers h4 { margin: 0 0 8px; font-size: 14px; }
.sb-fv-vers h4 span { font-weight: 400; color: var(--muted); font-size: 12px; }
.sb-fv-ver { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; flex-wrap: wrap; }
.sb-fv-ver.on { border-color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.sb-fv-th { width: 64px; height: 36px; border-radius: 4px; background: #3a3f47 center / cover no-repeat; flex: none; }
.sb-fv-vt { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0; }
a.btn { text-decoration: none; }
.sb-fv-grp { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.sb-fv-box > b + .sb-fv-grp { border-top: 0; padding-top: 0; }
.sb-fv-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-fv-row select { width: auto; padding: 5px 8px; }
.sb-fv-dis, .sb-fv-dis .sb-clab { color: var(--muted); }
.sb-soon { font-size: 11px; color: #9a5b00; font-weight: 500; margin-left: 4px; }
.sb-fv-fname { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-fv-logo { width: 64px; height: 36px; border: 1px solid var(--line); border-radius: 4px; background: #000 center / 70% no-repeat; }
.sb-fv-logo.white { background-color: #fff; }
.sb-fv-start { align-self: flex-start; }
.sb-warn { color: #b42318; }
.sb-fv-go { width: 100%; padding: 13px 14px; font-size: 15px; }
.sb-fv-busy { border: 1px solid #f0d9a8; background: #fff8ea; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sb-fv-busy .linkish { align-self: flex-start; }
.sb-fv-bar { height: 6px; background: #f3e3c0; border-radius: 3px; overflow: hidden; }
.sb-fv-bar i { display: block; height: 100%; background: #e0a43a; transition: width .4s; }
@media (max-width: 1099px) {
  .sb-fv { grid-template-columns: minmax(0, 1fr); }
}

/* 내 자료함 (2026-11-24): 왼쪽 폴더 · 위 경로·찾기·올리기 · 거르기 · 여러 개 선택 · 끌어서 폴더로 */
.lib-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.lib-side { position: sticky; top: calc(var(--hdr-h, 56px) + 20px); max-height: calc(100vh - var(--hdr-h, 56px) - 40px); overflow: auto; padding: 12px; }
.lib-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.lib-folders { display: flex; flex-direction: column; gap: 1px; }
.lib-fd { display: flex; align-items: center; gap: 2px; border-radius: 6px; margin-left: calc(var(--d, 0) * 14px); position: relative; }
.lib-fd:hover { background: #f5f6f8; }
.lib-fd.on { background: #fff0f2; }
.lib-fd[data-folder="none"] { margin-bottom: 9px; }
.lib-fd[data-folder="none"]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -5px; border-bottom: 1px solid var(--line); }
.lib-fd-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 13px; text-align: left; padding: 6px 4px 6px 8px; cursor: pointer; color: var(--text); }
.lib-fd.sys .lib-fd-name { font-weight: 600; }
.lib-fd.on .lib-fd-name { color: var(--primary); font-weight: 700; }
.lib-fd-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-fd-n { font-size: 11px; color: var(--muted); padding-right: 6px; }
.lib-fd-menu > summary { padding: 2px 6px; border-radius: 4px; cursor: pointer; color: var(--muted); visibility: hidden; }
.lib-fd:hover .lib-fd-menu > summary, .lib-fd.on .lib-fd-menu > summary, .lib-fd-menu[open] > summary { visibility: visible; }
.lib-fd-menu > summary:hover { background: #e9ebee; }
.fd-ico { width: 16px; height: 13px; flex: none; fill: #f4c96f; stroke: #d6a23c; stroke-width: 1; }
.lib-fd.drop-on, .lib-subfd.drop-on { outline: 2px dashed var(--primary); outline-offset: -2px; background: #fff0f2; }
body.lib-dragging .lib-fd[data-drop] .lib-fd-name, body.lib-dragging .lib-subfd { cursor: copy; }
.lib-fd-empty { margin: 6px 8px; }
.lib-side-tip { margin: 10px 4px 0; line-height: 1.5; }
.lib-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.lib-head, .lib-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-grow { flex: 1; }
.lib-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 15px; min-width: 0; }
.lib-crumb { border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.lib-crumb:hover { color: var(--text); background: #eef0f3; }
.lib-sep { color: #b7bdc6; }
#lib-search { width: 220px; padding: 7px 10px; }
.lib-tools .chips { flex-wrap: wrap; }
.lib-subfolders { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-subfolders:empty { display: none; }
.lib-subfd { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.lib-subfd:hover { border-color: #cfd4da; }
.lib-subfd .fd-ico { width: 20px; height: 16px; }
/* 칸: 작게(170px~) · 아래 버튼은 다운로드·공유·⋯ 한 줄 */
.lib-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.lib-grid .item { overflow: visible; position: relative; }
.lib-grid .item .thumb { border-radius: var(--radius) var(--radius) 0 0; }
.lib-grid .item:has(details[open]) { z-index: 4; }
/* 단추 줄: 1080p 최대화(카드 170px)에서 '다운로드 · 공유 끄기 · ⋯' 가 넘쳐 단추 속 글자가 두 줄로 꺾이던 것(2026-11-24)
   → 꺾지 않고, 여백·글자 간격·단추 사이를 조금씩 줄여 한 줄에 (필요 164px → 147px, 안쪽 폭 156px) */
.lib-grid .item .acts { flex-wrap: nowrap; margin-top: auto; gap: 3px; padding: 0 6px 8px; }
.lib-grid .item .acts .btn { white-space: nowrap; padding: 4px 6px; letter-spacing: -0.02em; }
.lib-grid .item .acts .btn.on { color: var(--primary); border-color: #f3b5bf; }
.lib-grid .item .acts .sb-menu { margin-left: auto; }
.lib-grid .item .acts summary.btn { padding: 4px 7px; font-size: 11px; }
.lib-in { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); min-width: 0; }
.lib-in span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-in .fd-ico { width: 12px; height: 10px; }
.lib-grid:not(.selecting) .item .thumb:hover::after { content: "크게 보기"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 12px; pointer-events: none; white-space: nowrap; }
.item-check { display: none; position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #fff; background: rgba(0, 0, 0, .25); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.lib-grid.selecting .item-check { display: block; }
.lib-grid.selecting .item { cursor: pointer; }
.lib-grid.selecting .item.sel { outline: 3px solid var(--primary); outline-offset: -1px; }
.lib-grid.selecting .item.sel .item-check { background: var(--primary); border-color: var(--primary); }
.lib-grid.selecting .item.sel .item-check::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; height: 100%; }
.lib-selbar { position: sticky; bottom: 12px; z-index: 8; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #1d2129; color: #fff; border-radius: 12px; padding: 10px 14px; margin-top: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.lib-selbar .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.lib-selbar .btn:disabled { opacity: .45; }
.lib-more { display: flex; justify-content: center; }
.lib-foot { margin: 4px 0 0; }
.lib-empty { padding: 20px 0; }
/* 폴더 고르기 창 */
.folder-box { width: min(480px, 100%); }
.folder-pick { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.folder-opt { display: flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 13px; text-align: left; padding: 8px 10px 8px calc(10px + var(--d, 0) * 16px); border-radius: 6px; cursor: pointer; color: var(--text); }
.folder-opt:hover:not(:disabled) { background: #f0f1f3; }
.folder-opt.cur { background: #fff5f6; }
.folder-opt:disabled { opacity: .45; cursor: not-allowed; }
.folder-opt .muted { margin-left: auto; }
.folder-new { margin-bottom: 4px; }
.folder-new input { flex: 1; min-width: 0; }
#folder-new-where { margin: 0; }
.picker-folder { padding: 5px 8px; font-size: 13px; max-width: 220px; }
@media (max-width: 900px) {
  .lib-layout { grid-template-columns: minmax(0, 1fr); }
  .lib-side { position: static; max-height: 240px; }
  #lib-search { width: 100%; order: 3; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
.lib-grid .shared-on, .lib-grid .sns-sent { white-space: nowrap; }

/* 등장인물 탭 (2026-11-24 정리) */
.ch-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 170px); overflow: auto; }
.ch-group { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin: 6px 2px 0; }
.ch-group span { font-weight: 400; }
.ch-empty { text-align: center; padding: 14px 4px; line-height: 1.6; margin: 0; }
.ch-item { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px; cursor: pointer; font: inherit; color: inherit; }
.ch-item:hover { border-color: #c9ced6; }
.ch-item.active { border-color: var(--primary); background: #fdf3f5; }
.ch-cover { flex: none; width: 44px; height: 56px; border-radius: 6px; background: #e6e8eb center top / cover no-repeat; }
.ch-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.ch-meta b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ch-sub { font-size: 12px; color: var(--muted); }
.ch-st { font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 999px; margin-top: 2px; }
.ch-st.busy { background: #e6f0ff; color: #1a5fd0; }
.ch-st.error { background: #fdecee; color: var(--err); }
.ch-st.shared { background: #e5f5ea; color: var(--ok); }

/* 새 등장인물: ①②③ */
.ch-form { max-width: 780px; display: flex; flex-direction: column; gap: 14px; }
.ch-new-head h2 { margin: 0 0 6px; }
.ch-new-head .hint { margin: 0 0 8px; line-height: 1.6; }
.ch-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.ch-flow span { background: #f0f1f3; border-radius: 999px; padding: 3px 10px; }
.ch-flow i { font-style: normal; color: var(--muted); }
.ch-flow em { font-style: normal; color: var(--muted); margin-left: 4px; }
.ch-name-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ch-name-row input[name=name] { flex: 1 1 260px; min-width: 0; }
.ch-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; max-width: 100%; }
.ch-seg label { margin: 0; cursor: pointer; position: relative; }
.ch-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ch-seg span { display: block; padding: 8px 14px; font-size: 13px; font-weight: 500; border-left: 1px solid var(--line); background: #fff; white-space: nowrap; }
.ch-seg label:first-child span { border-left: 0; }
.ch-seg input:checked + span { background: var(--primary); color: #fff; font-weight: 700; }
.ch-seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -3px; }
.ch-src { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
label.ch-src-opt { position: relative; display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 10px 12px 10px 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.ch-src-opt input { position: absolute; left: 11px; top: 12px; margin: 0; }
.ch-src-opt b { font-size: 13px; }
.ch-src-opt span { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.45; }
.ch-src-opt:hover { border-color: #c9ced6; }
.ch-src-opt:has(input:checked) { border-color: var(--primary); background: #fdf3f5; }
.ch-src-pick { margin-top: 10px; }
.ch-src-pick .hint { margin: 6px 0 0; }
label.ch-desc { margin: 0; gap: 0; }
.ch-form .fsec-inline.ch-gen { padding: 10px 0 0; }
.ch-form .ch-gen label.check { font-weight: 500; }

/* 등장인물 보기 */
.ch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ch-title { min-width: 0; }
.ch-head h2 { margin: 0 0 6px; overflow-wrap: anywhere; }
.ch-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ch-tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #f0f1f3; color: #4b5563; }
.ch-tag.on { background: #e5f5ea; color: var(--ok); font-weight: 600; }
.ch-tag.other { background: #eef1fb; color: #3b4cc0; }
.ch-head-acts { display: flex; align-items: center; gap: 6px; }
.ch-busy { margin-bottom: 12px; }
.ch-busy p { margin: 4px 0 0; }
.ch-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-steps span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #f0f1f3; color: var(--muted); }
.ch-steps span.done { background: #e5f5ea; color: var(--ok); }
.ch-steps span.on { background: #e6f0ff; color: #1a5fd0; font-weight: 700; }
.ch-err { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding: 8px 10px; border-radius: 8px; background: #fdecec; color: #b42318; font-size: 13px; }
#ch-main .fix-report { margin: 0 0 12px; }
.ch-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.ch-body.no-hero { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.ch-body.portrait { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); }   /* 시트가 아직 없으면 세로 사진(기본 모습)이라 좁게 */
.ch-body.portrait .ch-hero-img img { max-height: 400px; }
.ch-hero { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ch-hero-img { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #eef0f3; cursor: zoom-in; overflow: hidden; }
.ch-hero-img img { display: block; width: 100%; max-height: 460px; object-fit: contain; }
.ch-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ch-side h3, .ch-photos h3 { font-size: 14px; margin: 0 0 8px; }
.ch-btns.use { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ch-btns.use .btn { padding-top: 8px; padding-bottom: 8px; }
.ch-use .hint { margin: 8px 0 0; line-height: 1.55; }
.ch-desc-box { display: flex; flex-direction: column; gap: 8px; }
.ch-desc-box h3 { margin: 0; }
.ch-desc-box details.more { margin: 0; }
.ch-desc-box details.more > summary { flex-wrap: wrap; row-gap: 0; }
.ch-en-t { white-space: nowrap; }
.ch-desc-box details.more textarea { width: 100%; box-sizing: border-box; margin: 8px 0 4px; }
.ch-desc-box details.more p { margin: 0 0 10px; }
.ch-desc-box .btn { align-self: flex-start; }
.ch-photos { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.ch-photos-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ch-photos-head h3 { margin: 0; }
.ch-pgroups { display: flex; flex-wrap: wrap; gap: 12px 28px; }   /* 넓으면 기본·각도와 표정을 한 줄에 */
.ch-pgroup { min-width: 0; }
.ch-pgroup-h { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.ch-pgroup-h span { font-weight: 400; }
.ch-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-img { position: relative; display: flex; flex-direction: column; gap: 4px; width: 96px; font-size: 12px; text-align: center; color: var(--muted); min-width: 0; }
.ch-img > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-img-thumb { aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 8px; background: #e6e8eb center / contain no-repeat; cursor: zoom-in; padding: 0; }
.ch-img-thumb:hover { border-color: #b8bec8; }
.ch-img .job-x { position: absolute; top: 3px; right: 3px; background: rgba(255, 255, 255, .9); }
@media (hover: hover) {
  .ch-img .job-x { opacity: 0; transition: opacity .12s; }
  .ch-img:hover .job-x, .ch-img .job-x:focus-visible { opacity: 1; }
}
@media (max-width: 1100px) {
  .ch-src { grid-template-columns: minmax(0, 1fr); }
  label.ch-src-opt { padding-top: 8px; padding-bottom: 8px; }
  .ch-src-opt input { top: 10px; }
}
@media (max-width: 900px) {
  #tab-chars .sb-layout { grid-template-columns: minmax(0, 1fr); }   /* 옆으로 넘기는 목록이 화면 폭을 늘리지 않게 */
  #tab-chars .sb-side { min-width: 0; }
  .ch-list { flex-direction: row; max-height: none; overflow-x: auto; padding-bottom: 4px; }
  .ch-group { display: none; }
  .ch-item { flex: 0 0 180px; }
  .ch-body, .ch-body.portrait { grid-template-columns: minmax(0, 1fr); }
  .ch-hero-img img, .ch-body.portrait .ch-hero-img img { max-height: 340px; }
  .ch-pgroup { flex: 1 1 100%; }
  .ch-img { width: calc((100% - 24px) / 4); }
}
@media (max-width: 520px) {
  .ch-btns.use { grid-template-columns: minmax(0, 1fr); }
}

/* 공유함 (2026-11-24 정리): 내 자료함과 같은 틀 (.lib-layout · .lib-side · .lib-grid) + 공유한 사람 · 스토리보드 줄 */
.sh-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; min-width: 0; }
#sh-search { width: 240px; padding: 7px 10px; }
.chip-n { font-size: 11px; opacity: .7; margin-left: 1px; }
.sh-people .lib-fd-name { gap: 8px; }
.sh-ava { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-style: normal; color: #fff; background: hsl(var(--h, 210) 42% 52%); }
.sh-ava.me { background: var(--primary); }
.sh-ava.all { background: #8a929e; font-size: 10px; }
.sh-people .lib-fd.sys { margin-bottom: 9px; }
.sh-people .lib-fd.sys::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -5px; border-bottom: 1px solid var(--line); }
.sh-boards:empty { display: none; }
.sh-sec-h { font-size: 13px; font-weight: 700; color: #4b5563; margin: 2px 0 6px; }
.sh-sec-h span { font-weight: 400; color: var(--muted); }
.sh-files-h { margin-top: 14px; margin-bottom: 0; }
.sh-board-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.sh-board { display: flex; gap: 10px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.sh-board-cover { position: relative; flex: none; width: 120px; aspect-ratio: 16 / 10; border: 0; border-radius: 6px; padding: 0; background: #e6e8eb center / cover no-repeat; cursor: pointer; }
.sh-board-cover .badge-mine { left: 4px; top: 4px; font-size: 11px; padding: 1px 7px; }
.sh-board-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sh-board-body b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-board-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.sh-grid .badge-mine { font-size: 11px; padding: 1px 7px; }
.sh-grid .item .acts .sh-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-grid .item .acts .btn.copy { color: var(--primary); border-color: #f3b5bf; }
.sh-grid .item .acts .btn.copy:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.sh-grid .item .acts .btn.done { color: var(--ok); border-color: #b7e0c3; background: #f1faf4; }
.sh-grid .item .acts .btn:disabled { opacity: 1; cursor: default; }
@media (max-width: 900px) {
  .sh-side { max-height: none; padding: 8px; }
  .sh-side .lib-side-head, .sh-side .lib-side-tip { display: none; }
  .sh-people { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .sh-people .lib-fd { flex: none; border: 1px solid var(--line); border-radius: 999px; padding-right: 2px; }
  .sh-people .lib-fd.on { border-color: var(--primary); }
  .sh-people .lib-fd.sys { margin-bottom: 0; }
  .sh-people .lib-fd.sys::after { display: none; }
  #sh-search { width: 100%; order: 3; }
  .sh-board-row { grid-template-columns: minmax(0, 1fr); }
}
