/* 채팅 웹 틀(확정사항 #14 — 챗지피티·클로드 웹 채팅): 왼쪽 목록 / 가운데 대화 / 결과는 오른쪽 패널.
   흰 바탕, 선은 거의 없음, 강조색은 하늘색 하나.
   글자 = 30 인사말 / 16 대화·제목·창 제목 / 14 화면 글(목록·단추·메뉴) / 13 보조·작은 이름표(최근 · 결과 · 직접 조절). 굵기 = 400 · 600 둘. 글자색 = 본문 · 보조(--muted) · 하늘 잉크(--ink) 셋(+ 자리 표시 글 --ph).
   여백 = 4·8·12·16·24·32 눈금. 누르는 것의 높이 = 36(아이콘 단추·보내기·목록 항목·영상 받기) / 28(번호·칩·작은 알약). 그림자 = --lift(영상·입력칸) · --shadow(팝오버) 둘.
   둥글기 = 8 항목(--r1) / 14 팝오버·메뉴(--r2) / 20 창·사진 팝오버·말풍선(--r3) / 26 입력칸(--r4), 단추·한 줄 입력은 알약(--pill). 🔒 캔버스만 6px.
   r20(11/19) 새로 씀 → r21~r26 은 덧칠 없이 해당 규칙 자리에서 고침. 이전 판: 앱/_보관_디자인_r19 · _r21 · _r22 · _r23 · _r24 · _r25
   r25: 결과 패널은 위에서부터 채우는 옅은 면(--side), 팝오버는 아래로(자리가 없으면 app.js 가 .up), 한국어는 낱말 단위로 줄바꿈(keep-all)
   r26: 스크롤 막대는 옅게(scrollbar-color 는 물려받는다) · 첫 요청을 보내면 결과 패널을 미리 연다(#main.making — app.js 대화칸이 붙임)
   r27: 목록 항목의 ⋯(이름 바꾸기 · 지우기)와 '지운 프로젝트' 줄 · 첫 결과가 도착해도 첫 그림 전에는 '만드는 중' 자리를 이어 둔다(#main.firstwait). 이전 판: 앱/_보관_디자인_r26
   r29: 로그인·가입 창(dialog#auth — 서버가 로그인을 요구할 때만) · 계정 줄과 메뉴 · 묻는 창(#dlgAsk) · 알림은 넓은 화면에서 제목 줄 오른쪽 · 팝오버는 늘 아래로(모자라면 조금만 당김). 이전 판: 앱/_보관_디자인_r28
   r30: 결과 없는 영상 자리 = 흰 면 + 안쪽 1px 선(만드는 중만 흰색 → 옅은 하늘) · 영상에 옅은 두 겹 그림자 · 작은 이름표 한 모양 · 대화 턴 리듬(턴 안 12 / 턴 사이 28) · 빈 화면 인사말 위 하늘색 한 점 · 조절 막대 아래 줄(.knobbar) 없앰. 이전 판: 앱/_보관_디자인_r29
   r31: 옅은 글자 대비 올림(--muted 6.0 · --faint 4.4 : 1, 자리 표시 글만 옛 색) · 대화의 '결과 N' 칩은 선(고른 것만 옅은 하늘 면) · 멈춤·오류 줄의 [다시 시도]는 작은 알약 · 결과 번호 옆 '만드는 중'은 점만 · 좁은 화면 영상 높이는 대화 자리를 남김 · ⋯ 메뉴 맨 아래 '대화 지우기'는 스크롤돼도 보임. 이전 판: 앱/_보관_디자인_r30
   r33: 색·그림자·여백을 변수와 한 눈금으로 정리(위 두 줄) · 조절 막대 위 선 없앰 · 막대 이름 칸 폭 맞춤(--klw) · 진행 줄 아래 한 줄(.eta) · '앞 결과 n개'(.prevres) · 전문가용 안 '다른 Claude 창' 한 줄. 이전 판: 앱/_보관_디자인_r32
   r34: 답글은 문단(.para — 사이 8px) + 조절 이름 굵게(.kn) · 조절 막대 두 칸 · '고른 것 = 회색 면(--sel-bg) / 누르는 것 = 하늘' · 제목 줄 14px·500 · 글자 링크는 --ink 하나 · 대화 중에도 고치기용 예시 한 줄(body.fixhint). 이전 판: 앱/_보관_디자인_r33
   r35: 대화 칸 스크롤 막대(세모 단추 없는 옅은 8px · 자리 미리 잡기 — 막대가 생겨도 말풍선 끝 = 입력칸 끝) · 고치기용 예시는 대화가 맨 아래일 때만(body.hintend) + 흰 받침 64 · 좁은 화면도 글자 단추 · 단계 말이 바뀌는 순간(.busy span.chg). 이전 판: 앱/_보관_디자인_r34
   r38: 글자 4단(30·16·14·13 — 12px 이름표는 13/400 으로) · 굵기 2단(400·600) · 회색 한 단씩 덜기(--faint → --muted, --soft → --hover) · 결과 줄–영상 12 · 대화 칸 스크롤 손잡이는 마우스를 올렸거나 스크롤 중일 때만 · 고치기 낱말은 하늘 잉크 · 태블릿(601~900)은 640 기둥 가운데. 이전 판: 앱/_보관_디자인_r37
   r28: 한 번이라도 보낸 프로젝트는 결과가 없어도 두 칸(패널 자리에 옅은 면) · 결과가 하나뿐이면 '결과' 줄은 자리만 · 조절 막대 위 '직접 조절 / 처음대로' · 좁은 화면의 조절은 늘 접힌 채 시작 · 알림은 제목 줄 아래 본문 가운데. 이전 판: 앱/_보관_디자인_r27 */
:root {
  color-scheme: light;
  --bg: #ffffff; --side: #f8fafc; --hover: #f0f3f6; --bubble: #f0f3f6; --sel-bg: #e9eef3; --track: #dfe5eb;
  --line: #e7ebef; --line2: #cfd8e1;
  --text: #1f2933; --muted: #586471; --ph: #8590a0;
  --accent: #3b9be0; --accent-ink: #ffffff; --tint: #eef6fd; --tint2: #e3f0fb; --ink: #1f6fb0; --sel: #3b9be0;
  /* R5(Q12 대비): 흰 글자가 얹히는 주요 단추 바탕은 #1f6fb0(5.3 : 1 — 전 #3b9be0 은 3.0) · 글자로 쓰는 ok·warn·bad 는 흰 바탕에서 4.5 : 1 넘게 */
  --btn: #1f6fb0; --btn-hover: #1a5f98;
  --warn: #946210; --bad: #c0392b; --ok: #1e7a43;
  --shadow: 0 8px 28px rgba(20, 40, 60, .12); --lift: 0 1px 2px rgba(20, 40, 60, .06), 0 8px 24px rgba(20, 40, 60, .10);
  --r1: 8px; --r2: 14px; --r3: 20px; --r4: 26px; --pill: 999px; --col: 720px;
  --f1: 30px; --f2: 16px; --fu: 14px; --f3: 13px;
  font-family: "Pretendard Variable", "Pretendard", "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
  font-size: var(--fu); line-height: 1.55; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-width: thin; scrollbar-color: #dde3e9 transparent; }
html, body { margin: 0; height: 100%; color: var(--text); background: var(--bg); }
/* 한국어는 낱말 중간에서 끊지 않는다(긴 영어·주소만 어쩔 수 없을 때 끊음) */
body { word-break: keep-all; overflow-wrap: break-word; }
body { display: flex; overflow: hidden; }
body.offline { padding-top: 38px; }
button, .btn, select, input, textarea { font: inherit; letter-spacing: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: var(--pill); }
button, .btn { padding: 6px 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
button:hover, .btn:hover { background: var(--hover); }
button:disabled { opacity: .4; cursor: default; }
button:disabled:hover { background: #fff; }
button.primary { background: var(--btn); color: var(--accent-ink); font-weight: 600; border-color: transparent; }
button.primary:hover { background: var(--btn-hover); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: inherit; }
button.link:hover { color: var(--text); background: none; }
button.icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border-color: transparent; color: var(--muted); border-radius: var(--r1); }
button.icon:hover, button.icon[aria-expanded="true"] { background: var(--hover); color: var(--text); }
input, select, textarea { padding: 8px 14px; }
/* 선택 상자: 브라우저 기본 화살표 대신 얇은 꺾쇠 */
select { -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%23586471' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") right 13px center / 10px no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input:disabled { opacity: .5; }
textarea { resize: none; border-radius: var(--r2); }
.muted { color: var(--muted); }
.bad { color: var(--bad); } .warn { color: var(--warn); } .ok { color: var(--ok); }
small { font-weight: 400; font-size: var(--f3); margin-left: 6px; }
.small { font-size: var(--f3); font-weight: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grow { flex: 1; }
.msg { color: var(--muted); font-size: var(--f3); white-space: pre-line; }
.msg:empty { display: none; }
.msg.bad { color: var(--bad); } .msg.warn { color: var(--warn); } .msg.ok { color: var(--ok); } .msg.busy { color: var(--text); }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 12px; }
/* 접힌 묶음(더 보기 · 전문가용 · 세부 설정 · 작업 기록)의 꺾쇠 */
details.logs > summary, details.adv > summary, details.imgmore > summary, details.vidmore > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; font-size: var(--f3); color: var(--muted); }
details.logs > summary::-webkit-details-marker, details.adv > summary::-webkit-details-marker, details.imgmore > summary::-webkit-details-marker, details.vidmore > summary::-webkit-details-marker { display: none; }
details.logs > summary::after, details.adv > summary::after, details.imgmore > summary::after, details.vidmore > summary::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); }
details.logs[open] > summary::after, details.adv[open] > summary::after, details.imgmore[open] > summary::after, details.vidmore[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
details.logs > summary:hover, details.adv > summary:hover, details.imgmore > summary:hover, details.vidmore > summary:hover { color: var(--text); }

#netBanner { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #1f2933; color: #fff; padding: 8px 14px; text-align: center; font-size: var(--f3); }
#netBanner small { opacity: .75; }
#toast { position: fixed; right: 56px; top: 7px; z-index: 1001; max-width: min(520px, calc(100vw - 32px)); background: #1f2933; color: #fff; border-radius: var(--r2); padding: 10px 16px; font-size: var(--f3); box-shadow: var(--shadow); white-space: pre-line; }
#toast.bad { background: var(--bad); }
body.offline #toast { top: 45px; }
#toast button.link { margin-left: 12px; font-weight: 600; color: #fff; text-decoration: underline; }
#toastWarn { margin-top: 6px; color: #ffd98a; }
#toast .selpath { display: block; margin-top: 4px; font: 12px/1.5 Consolas, monospace; user-select: all; word-break: break-all; }
#helpBox { position: fixed; right: 16px; top: 56px; z-index: 901; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); padding: 14px 18px; font-size: var(--f3); box-shadow: var(--shadow); }
#helpBox dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; }
#helpBox dt { font-family: Consolas, monospace; }
#helpBox dd { margin: 0; color: var(--muted); }

/* ── 로그인·가입(서버가 로그인을 요구할 때만) — 흰 바탕 가운데 좁은 칸 하나. 칸의 위 끝은 고정(가입으로 바꿔 칸이 늘어도 위가 움직이지 않는다) ── */
dialog.auth { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; border-radius: 0; box-shadow: none; background: var(--bg); overflow-y: auto; }
dialog.auth[open] { display: flex; justify-content: center; align-items: flex-start; padding: max(40px, 15vh) 20px 40px; }
dialog.auth::backdrop { background: var(--bg); }
.authcard { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
/* 이름 위 하늘색 한 점 — 첫 화면 인사말 위의 그 점과 같은 모양(r30) */
.authcard::before { content: ''; align-self: center; width: 10px; height: 10px; margin-bottom: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px var(--tint); }
.authcard .brand { text-align: center; font-size: 22px; }
.authsub { margin: -8px 0 14px; text-align: center; color: var(--muted); font-size: var(--f2); }
.authtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: var(--sel-bg); border-radius: var(--pill); }
.authtabs button { height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.authtabs button:hover { color: var(--text); background: transparent; }
.authtabs button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(20, 40, 60, .18); }
.authfield { display: flex; flex-direction: column; gap: 6px; font-size: var(--f3); color: var(--muted); }
.authfield small { color: var(--muted); }
.authfield input { width: 100%; height: 46px; padding: 0 18px; font-size: var(--f2); border-color: var(--line2); }
.authfield input:focus { box-shadow: 0 0 0 3px rgba(59, 155, 224, .18); }
.pwwrap { position: relative; display: block; }
.pwwrap input { padding-right: 52px; }
.pwwrap button.icon { position: absolute; right: 6px; top: 6px; border-radius: 50%; }
.pwwrap .i-eyeoff, .pwwrap button[aria-pressed="true"] .i-eye { display: none; }
.pwwrap button[aria-pressed="true"] .i-eyeoff { display: block; }
/* 오류 한 줄 자리는 늘 잡아 둔다(오류가 나올 때 단추가 밀리지 않게) */
#authMsg, #authMsg:empty { display: block; min-height: 20px; margin: -4px 4px -2px; white-space: normal; }
#authGo { height: 46px; font-size: var(--f2); }
/* 단추 아래 한 줄: '처음이신가요? 가입하기' / '이미 가입하셨나요? 로그인' — 탭을 못 본 사람도 넘어가게 */
.authnote { margin: 2px 0 0; text-align: center; font-size: var(--f3); color: var(--muted); }
.authnote button.link { margin-left: 4px; font-weight: 600; color: var(--ink); }
.authnote button.link:hover { color: var(--ink); text-decoration: underline; }
/* r30: 메일 확인 · 비밀번호 다시 정하기 — 같은 칸 안에서 한 단계씩. 안내 한 줄 · 동의 한 줄 · 아래 작은 줄 */
.authstep { margin: 0; text-align: center; font-size: var(--f2); line-height: 1.6; color: var(--text); white-space: pre-line; }
.authstep[hidden], .authmore button[hidden] { display: none; }
.authagree { display: flex; align-items: flex-start; gap: 8px; font-size: var(--f3); line-height: 1.5; color: var(--muted); cursor: pointer; }
.authagree[hidden] { display: none; }
.authagree input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.authagree a, .bizfoot a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.authmore { margin-top: -6px; }
.authmore button.link { font-weight: 400; color: var(--muted); margin: 0 6px; }
.authmore:not(:has(button:not([hidden]))) { display: none; }
#authOtp { letter-spacing: .3em; font-variant-numeric: tabular-nums; }
/* r30: 사업자 정보 · 약관 주소 — 값이 있을 때만. 작고 흐린 글 한 덩어리(화면 맨 아래) */
.bizfoot { margin-top: 18px; text-align: center; font-size: 11px; line-height: 1.7; color: var(--muted); word-break: keep-all; }
.bizfoot[hidden] { display: none; }
.bizfoot .links a { margin: 0 6px; }
#homeFoot { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; padding: 0 20px; pointer-events: none; }
#homeFoot a { pointer-events: auto; }
/* r30: 내 계정 — 한 화면. 사실 줄(단계 · 크레딧 · 쓴 양) + 비밀번호 바꾸기 + 탈퇴(눌러야 펴짐) */
.acctfacts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: var(--f2); }
.acctfacts dt { color: var(--muted); font-size: var(--f3); align-self: center; }
.acctfacts dd { margin: 0; font-variant-numeric: tabular-nums; }
.acctfacts dd small { margin-left: 8px; color: var(--muted); }
.acctform { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.acctform[hidden] { display: none; }
.acctform b { font-size: var(--f3); font-weight: 600; }
.acctform input { height: 40px; padding: 0 14px; }
.acctnote { margin: 0; font-size: var(--f3); line-height: 1.6; color: var(--muted); }
.acctdlg button.danger { color: #fff; background: var(--bad); border-color: var(--bad); }
.acctdlg .acctend { align-items: center; }
.acctdlg .acctend button.link { height: auto; padding: 0; font-size: var(--f3); color: var(--muted); }
.acctdlg .acctend .grow { flex: 1; }

/* ── 왼쪽 목록 ── */
#side { flex: none; width: 260px; height: 100%; background: var(--side); padding: 8px 8px 24px; display: flex; flex-direction: column; gap: 4px; transition: margin-left .18s ease; }
.sidetop { flex: none; display: flex; align-items: center; height: 36px; padding: 0 12px; }
.brand { font-weight: 600; font-size: var(--f2); letter-spacing: -.02em; color: var(--text); }
#newProj { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; margin: 4px 0; text-align: left; font-weight: 600; border: 0; border-radius: var(--r1); background: transparent; padding: 0 12px; }
#newProj svg { color: var(--muted); }
#newProj:hover { background: var(--hover); }
/* 목록 머리 '최근' — 프로젝트가 하나도 없으면 숨김 */
.sidehead { flex: none; padding: 12px 12px 4px; font-size: var(--f3); font-weight: 400; letter-spacing: 0; color: var(--muted); }
#side:has(#projList:empty) .sidehead { display: none; }
#projList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
#projList li { flex: none; display: flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--r1); cursor: pointer; min-width: 0; color: var(--text); }
#projList li:hover { background: var(--hover); }
#projList li.on { background: var(--sel-bg); color: var(--text); font-weight: 600; }
#projList img, #projList .sub { display: none; }
#projList .pin { flex: 1; min-width: 0; }
#projList .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 항목의 ⋯(이름 바꾸기 · 지우기): 마우스를 올린 항목과 지금 연 항목에만. 자리는 늘 잡아 둔다(이름이 밀리지 않게) */
#projList .pmore { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0 -4px 0 4px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); visibility: hidden; }
#projList li:hover .pmore, #projList li.on .pmore, #projList .pmore:focus-visible, #projList .pmore[aria-expanded="true"] { visibility: visible; }
#projList .pmore:hover, #projList .pmore[aria-expanded="true"] { background: var(--track); color: var(--text); }
#projList li.editing .pmore { display: none; }
#projList .prename { width: 100%; height: 26px; margin: -3px 0; padding: 0 6px; border-radius: 6px; border-color: var(--line2); font-weight: 400; }
/* 지운 프로젝트(있을 때만): 계정 위 작은 줄 — 누르면 목록 + [되돌리기] */
.trashbtn { flex: none; display: flex; align-items: center; gap: 8px; min-height: 32px; margin-top: 4px; padding: 0 12px; text-align: left; border: 0; border-radius: var(--r1); background: transparent; font-size: var(--f3); color: var(--muted); }
.trashbtn:hover { background: var(--hover); color: var(--text); }
.trashbtn::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); }
.trashbtn[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }
.trashlist { flex: none; list-style: none; margin: 0; padding: 0; max-height: 28vh; overflow-y: auto; scrollbar-width: thin; }
.trashlist li { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: var(--f3); color: var(--muted); }
.trashlist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trashlist button.link { flex: none; color: var(--ink); }
.trashlist button.link:hover { color: var(--ink); text-decoration: underline; }
/* 계정 줄(로그인했을 때만 — 로컬 모드에서는 숨김): 동그라미 안 첫 글자 + 아이디. 누르면 위로 작은 메뉴(오늘 남은 횟수 · 로그아웃) */
.acct { flex: none; display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 4px; text-align: left; border: 0; border-radius: var(--r1); background: transparent; padding: 8px 12px; color: var(--text); }
.acct:hover, .acct[aria-expanded="true"] { background: var(--hover); }
.acct .av { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #dbe7f2; color: #2c6ea3; font-size: 12px; font-weight: 600; line-height: 24px; text-align: center; }
.acct .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acctmenu { min-width: 180px; }
.acct .cr { flex: none; font-size: var(--f3); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; } /* r29: 남은 크레딧(늘 보이는 작은 한 줄) */
.acct .cr[hidden] { display: none; }
.acctinfo { white-space: pre-line; padding: 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: var(--f3); color: var(--muted); }
#scrim { display: none; }

/* ── 본문 ── */
#main { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.top { flex: none; position: relative; display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 12px 0 8px; }
#pName { font-size: var(--fu); font-weight: 400; letter-spacing: -.01em; border-color: transparent; border-radius: var(--r1); background: transparent; padding: 4px 8px; min-width: 100px; max-width: 46vw; field-sizing: content; text-overflow: ellipsis; }
#pName:hover { background: var(--hover); }
#pName:focus { background: #fff; border-color: var(--line2); }
body:has(#proj[hidden]) .top #pName { visibility: hidden; }
/* 위 줄 ⋯ = 결과 패널이 아직 없는 프로젝트에서만(영상 크기 · 대화 지우기). 결과가 생기면 패널의 ⋯ 하나만 */
#topMore { flex: none; }
body:has(#proj[hidden]) #topMore, #main:not(:has(#vers:empty)) #topMore { display: none; }
.topbox { position: absolute; right: 12px; top: 48px; z-index: 120; width: 208px; padding: 8px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }
.topbox button { text-align: left; background: none; border: 0; border-radius: var(--r1); padding: 8px 12px; }
.topbox button:hover { background: var(--hover); }
/* 되돌릴 수 없는 항목(대화 지우기): 맨 아래 · 구분선 · 빨간 글자 */
.topbox button.danger, .morebox.pop button.danger { position: relative; margin-top: 9px; color: var(--bad); }
.topbox button.danger::before, .morebox.pop button.danger::before { content: ''; position: absolute; left: -8px; right: -8px; top: -5px; border-top: 1px solid var(--line); }
.topbox button.danger:hover, .morebox.pop button.danger:hover:not(:disabled) { background: #fdf1f1; }
/* 낮은 화면에서 '전문가용'을 펴 메뉴가 안에서 스크롤돼도 '대화 지우기'는 맨 아래에 붙어 보인다(선 아래 4px 도 흰색으로 — 지나가는 항목이 비치지 않게) */
.morebox.pop button.danger { position: sticky; bottom: 0; z-index: 1; background: #fff; box-shadow: 0 8px 0 #fff; }
.morebox.pop button.danger::before { height: 5px; background: #fff; }
/* 첫 화면 = 빈 대화와 같은 자리·같은 모양: 인사말 + 입력칸 + 예시 */
#empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 0 0 10vh; text-align: center; }
.home { width: 100%; display: flex; flex-direction: column; }
.home .composer { margin-bottom: 16px; text-align: left; }
/* r16(실사용1): 하루 한도 한 줄 — 입력칸 바로 아래, 남는 글(알림처럼 사라지지 않음). 글만 바뀐다 */
.quotaline { width: min(var(--col), calc(100% - 40px)); margin: -4px auto 16px; padding: 0 16px; font-size: var(--f3); line-height: 1.5; color: var(--muted); text-align: left; }
.quotaline[hidden] { display: none; }
.emptytext { display: flex; flex-direction: column; gap: 8px; padding: 0 20px; }
.emptytext:empty { display: none; }
/* r37: 인사말 위의 하늘색 점은 뺐다 — '만드는 중' 의 점과 같은 모양이라 '불러오는 중' 으로 읽혔다. 제목 + 한 줄 + 입력칸만 */
.emptytext b { font-size: var(--f1); font-weight: 600; letter-spacing: -.03em; line-height: 1.3; }
.emptytext span { color: var(--muted); font-size: var(--f2); }
#emptyNew { height: 42px; padding: 0 24px; }
#proj { flex: 1; min-height: 0; }

/* 대화(왼쪽) + 결과 패널(오른쪽). 결과가 아직 없으면 패널 없이 대화만 가운데 */
.work { height: 100%; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.8fr); }
.right { order: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
/* 결과 패널: 옅은 면(왼쪽 목록과 같은 색) 하나, [결과 고르기 · 캔버스 · 조작 줄]을 위에서부터 채운다 — '결과' 줄이 대화 첫 줄과 같은 높이 */
.left { order: 2; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; padding: 20px 24px 24px; background: var(--side); overflow-y: auto; scrollbar-width: none; }
.left::-webkit-scrollbar { display: none; }
/* 한 칸 화면은 결과도 대화도 없을 때만. 한 번이라도 보냈으면(대화가 있으면) 결과가 없어도 패널 자리를 지킨다 — 한 칸 → 두 칸은 첫 말을 보내는 순간 한 번뿐이고,
   멈추거나 실패해도 내 말풍선이 옮겨 가지 않는다. 결과가 도착하면 그 자리에 영상만 뜬다 */
#main:has(#vers:empty):has(#chatLog:empty):not(.making) .work { grid-template-columns: 1fr; }
#main:has(#vers:empty):has(#chatLog:empty):not(.making) .left { display: none; }

/* ── 결과 패널 ── */
#cMsg:not(.bad):not(.warn) { display: none; }
#cMsg { margin-bottom: 6px; }
.msg .mm, #glErr .mm { color: var(--warn); }
.warnlist { color: var(--warn); font-size: var(--f3); margin: 0 0 8px; line-height: 1.5; }
.warnlist button.link { color: var(--warn); }
.arrive { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r2); font-size: var(--f3); background: var(--tint); }
.arrive button.link { color: var(--text); text-decoration: underline; }
/* 영상 칸은 줄어들지 않는다 — 전에는 세로로 긴 영상 + 조절 막대가 창 높이를 넘으면 이 칸이 눌리면서 영상 아래쪽이 잘렸다(작품을 깎지 않는다). 넘치면 패널이 스크롤된다 */
.stage { flex: none; display: flex; justify-content: center; }
.stagecol { min-width: 0; max-width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
/* 결과 고르기: 캔버스 바로 위 왼쪽 — '결과 1 2 3'. 고를 것이 없으면(결과가 하나뿐이거나 없고, 만드는 중도 아님) 자리만 지키고 안 보인다 — 영상이 움직이지 않게.
   하나뿐인 결과의 숨기기 ⋯ 는 이 줄에 마우스를 올리거나 Tab 으로 들어오면 나온다(기능은 그대로) */
.versbox { position: relative; flex: none; display: flex; align-items: center; gap: 8px; min-height: 28px; max-width: 100%; }
.versbox:has(.vers.one):not(:has(.versbusy:not([hidden]))):not(:hover):not(:focus-within) { opacity: 0; }
.versbox:has(.vers.one):not(:has(.versbusy:not([hidden]))):not(:hover):not(:focus-within) .vers button { pointer-events: none; }
#main:has(#vers:empty) .versbox, #main.firstwait .versbox { visibility: hidden; }
.vers.one #followBtn { display: none; }
.verslbl { flex: none; font-size: var(--f3); font-weight: 400; letter-spacing: 0; color: var(--muted); }
.vers { position: relative; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.vers button { min-width: 28px; height: 28px; padding: 0 8px; font-size: var(--f3); background: transparent; border-color: transparent; color: var(--muted); font-variant-numeric: tabular-nums; }
.vers button:hover { background: var(--hover); color: var(--text); }
.vers button.on, .vers button.on:hover { background: var(--sel-bg); color: var(--text); font-weight: 600; }
/* 숨기기 ⋯ 는 줄 끝에 겹쳐 놓는다(자리를 차지하지 않음 — 번호 뒤에 빈칸이 생기지 않게). 번호에 마우스를 올리면 '만드는 중' 글 자리에 나온다 */
.vers .vmore { position: absolute; left: 100%; top: 0; visibility: hidden; padding: 0 6px; font-weight: 600; }
.vers:hover .vmore, .vers .vmore:focus-visible { visibility: visible; }
.versbox:has(.vers:hover) .versbusy, .versbox:has(.vmore:focus-visible) .versbusy { visibility: hidden; }
.vers .dot { display: none; }
.vers .culprit, .vers .cul { color: var(--warn); }
.vers .cul, .vers .slow { margin-left: 4px; }
.vers .varch { display: inline-flex; align-items: center; gap: 4px; }
.vers button.arch { opacity: .5; }
.vers .new { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: var(--pill); background: var(--btn); color: #fff; font-size: 11px; font-weight: 600; line-height: 15px; vertical-align: middle; }
#followBtn.on { display: none; }
/* 만드는 중: 번호 바로 뒤의 하늘색 점 하나(불투명도만 오간다). 글('만드는 중…')은 화면 낭독용으로만 남기고 보이지 않는다 — 말과 걸리는 시간은 대화 줄 하나에만 */
.versbusy { flex: none; display: inline-flex; align-items: center; gap: 0; height: 28px; margin-left: -2px; font-size: 0; color: var(--muted); white-space: nowrap; }
#main.making:has(#vers:empty) .versbusy { display: none; }
.versbusy::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: breathe 1.4s ease-in-out infinite alternate; }
/* '최신 결과 보기 →' 는 번호 칩이 아니라 글자 단추(켜진 번호와 나란히 둘 다 켜진 것처럼 보이지 않게) */
#followBtn:not(.on) { min-width: 0; margin-left: 8px; padding: 0 4px; background: none; color: var(--ink); }
#followBtn:not(.on):hover { background: none; color: var(--ink); text-decoration: underline; }
.versold { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; width: min(480px, 80vw); max-height: 50vh; overflow-y: auto; scrollbar-width: thin; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); padding: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.versold .vrow { border-radius: var(--r1); display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 8px 12px; font-size: var(--f3); white-space: nowrap; }
.versold .vrow:hover, .versold .vrow:focus-visible, .versold .vrow.on { background: var(--hover); }
.versold .vrow .dot { display: none; }
.versold .vrow .nt { overflow: hidden; text-overflow: ellipsis; }
.versold .vrow .dt { color: var(--muted); }
/* 🔒 미리보기는 작품을 깎지 않는다 — 모서리 둥글기 6px 이하. 영상은 옅은 두 겹 그림자로 면에서 살짝 뜬다 */
.viewer { position: relative; max-width: 100%; background: #0d1520; border-radius: 6px; overflow: hidden; box-shadow: var(--lift); }
/* 영상 자리는 캔버스 내부 크기가 아니라 프로젝트 영상 비율로 잡는다(--ar · --arn · --capw 는 app.js stageAspect 가 .viewer 에 넣는다):
   폭 = min(1280px 또는 출력 폭, 높이 한도 × 비율, 칸 폭). 내부 해상도(보이는 크기 × 화면 배율)가 바뀌어도, 결과가 없어도 자리는 같다 */
/* 높이 한도 = 창 높이 − 제목 줄 52 − (위 여백·결과 줄 58 + 재생 줄·조절 막대 한 줄 136 + 아래 여백 24) — 세로 영상도 조절 막대까지 한 화면에 */
.viewer { --glmaxh: calc(100vh - 52px - 220px); }
#gl { display: block; width: min(var(--capw, 1280px), calc(var(--glmaxh) * var(--arn, 1.7777778))); height: auto; aspect-ratio: var(--ar, 16 / 9); max-width: 100%; background: #0d1520; }
.viewer .ovl { position: absolute; right: 10px; top: 10px; z-index: 5; background: rgba(255, 255, 255, .85); color: var(--text); opacity: 0; transition: opacity .15s; }
.viewer:hover .ovl, .viewer .ovl:focus-visible { opacity: 1; }
.viewer .refview { position: absolute; right: 10px; bottom: 10px; width: 92px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.viewer:hover .refview { opacity: .95; }
.refview img { width: 100%; border-radius: 6px; display: block; background: #000; border: 2px solid rgba(255, 255, 255, .9); }
.refview:not(:has(img[src]:not([src=""]))) { display: none; }
.refview .cap { display: none; }
.cap { font-size: var(--f3); margin-top: 4px; }
#glErr { margin: 0; padding: 10px 12px; background: rgba(30, 0, 0, .92); color: #ffb3b3; font: 12px/1.5 Consolas, monospace; overflow: auto; max-height: 280px; }
#glErr.over { position: absolute; inset: 0; max-height: none; }
#glErr .ttl { color: #fff; font-weight: 600; margin-bottom: 4px; }
#glErr .sec { margin-top: 6px; }
#glErr .sec b { color: #fff; font-weight: 600; }
#glErr pre { margin: 2px 0 0 10px; font: inherit; white-space: pre-wrap; word-break: break-word; color: #ffb3b3; }
#glErr details summary { cursor: pointer; }
#glWait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 12px; font-size: var(--fu); color: var(--muted); }
/* 그 아래 작은 한 줄(멈추거나 실패한 뒤 — 대화가 있을 때만): 다음에 할 일 */
#glWait small { margin: 0; font-size: var(--f3); }
#main:has(#chatLog:empty) #glWait small { display: none; }
/* 첫 요청 직후(결과 0 + 만드는 중): 캔버스 자리에 흰색 → 옅은 하늘 면 + 가운데 '만드는 중…' — 결과가 도착하면 이 자리에 영상이 뜬다. 조작 줄은 자리만 잡아 둔다 */
.glmaking { position: absolute; inset: 0; z-index: 6; display: none; background: linear-gradient(100deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0) 65%) 100% 0 / 300% 100% no-repeat, linear-gradient(180deg, #fff, var(--tint)); box-shadow: inset 0 0 0 1px var(--line); border-radius: inherit; }
/* r36: 이 자리에는 낱말·점을 두지 않는다 — 단계 말은 대화의 진행 줄 한 군데에서만(전에는 같은 낱말이 대화와 여기 두 군데에 떴다) */
/* 기다리는 동안(실측: '생각하는 중' 이 70초) 화면이 멈춘 듯 보이지 않게 — 빈 영상 자리 위로 옅은 빛 띠가 3.2초에 한 번 천천히 지나간다(배경 자리만 움직인다 — 크기·자리·글자는 그대로) */
#main.making:has(#vers:empty) .glmaking, #main.firstwait .glmaking { animation: sheen 3.2s ease-in-out infinite; }
@keyframes sheen { from { background-position: 100% 0, 0 0; } to { background-position: 0 0, 0 0; } }
#main.making:has(#vers:empty) .glmaking, #main.firstwait .glmaking { display: block; }
/* 결과가 아직 없는 패널(만드는 중 · 멈추거나 실패한 뒤): 영상 자리는 흰 종이 — 흰 면 + 안쪽 1px 선, 그림자 없음(회색 위 회색 상자는 '꺼진 화면'으로 읽혔다).
   만드는 중이 아니면 가운데 작은 글 '아직 결과가 없어요'(#glWait) */
#main:has(#vers:empty) .viewer, #main.firstwait .viewer { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
#main:has(#vers:empty) #gl, #main.firstwait #gl { visibility: hidden; }
#main:has(#vers:empty) .ctrls, #main.firstwait .ctrls { visibility: hidden; }
/* 첫 결과가 도착했지만 첫 그림 전(.firstwait — app.js): 같은 자리를 그대로 두고 번호 줄도 아직 비워 둔다 */
#main.firstwait .vers, #main.firstwait .versbusy, #main.firstwait .glbusy { visibility: hidden; }
.viewer:focus { outline: none; }
/* 좁은 화면에서 붙은 영상 밑의 옅어지는 띠(r36 — 아래 좁은 화면 묶음). 넓은 화면에는 없다 */
.vfade { display: none; }
.glbusy { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 120px); padding: 5px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .9); font-size: var(--f3); pointer-events: none; }
.glnote { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 32px); padding: 10px 14px; border-radius: var(--r2); background: rgba(255, 255, 255, .95); font-size: var(--f3); line-height: 1.6; text-align: center; box-shadow: var(--shadow); }
.glnote.warn { color: var(--warn); } .glnote.bad { color: var(--bad); }
.glnote button.link { margin-left: 6px; font-weight: 600; color: var(--text); text-decoration: underline; }
.viewer:fullscreen { display: flex; align-items: center; justify-content: center; border-radius: 0; }
.viewer:fullscreen #gl { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.viewer:fullscreen #glErr:not(.over), .viewer:fullscreen .ovl { display: none; }
.touchbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 0; font-size: var(--f3); }
.touchbar .tb-h { font-weight: 600; }
.touchbar button { font-size: var(--f3); padding: 3px 10px; }

/* 조작 줄: ▶ 0:00 | 조절 막대 | 영상 받기 ⋯ */
.ctrls { flex: none; position: relative; margin-top: 16px; }
.playrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; }
.playrow #vMsg { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playrow #vMsg.msg:not(.bad):not(.warn):not(.ok):not(.busy) { display: none; }
#btnPause { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; border-color: var(--line2); display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
#btnPause .i-play, #btnPause[aria-pressed="true"] .i-pause { display: none; }
#btnPause[aria-pressed="true"] .i-play { display: block; }
.tnow { flex: none; min-width: 44px; padding: 4px 8px; border: 0; background: none; font-size: var(--f3); color: var(--muted); font-variant-numeric: tabular-nums; text-align: left; }
.tnow:hover { color: var(--text); }
.tnow:disabled { visibility: hidden; }
/* r36: 재생 시간(끝없이 도는 영상의 '4:44')은 ⋯ → 전문가용을 펴 둔 동안에만 보인다 — 보통 화면에서는 뜻 없는 숫자(편집 프로그램의 타임코드처럼 읽혔다). 시점 입력칸(.tin)도 같이 */
#main:not(:has(details.adv[open])) .tnow, #main:not(:has(details.adv[open])) .tin { display: none; }
.tin { flex: none; width: 76px; height: 30px; padding: 0 8px; font-size: var(--f3); }
/* 조절 막대는 단추 줄 아래 한 묶음(두 칸 — 좁으면 한 칸). 그 위 머리 줄: 왼쪽 작은 이름표 '직접 조절', 오른쪽은 값을 바꿨을 때만 '처음대로'. 재생 줄 ~ 이름표 ~ 막대 = 24 / 12 / 막대 사이 12 */
.knobhead { order: 5; flex: 1 1 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 16px 0 0; font-size: var(--f3); line-height: 16px; color: var(--muted); }
.knobhead > span { font-size: var(--f3); font-weight: 400; letter-spacing: 0; }
.playrow:has(.knobs:empty) .knobhead { display: none; }
.knobhead button.link { color: var(--ink); }
.knobhead button.link:hover { color: var(--ink); text-decoration: underline; }
.playrow .knobs { order: 5; flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 32px; margin: 4px 0 0; }
.knobs:empty { display: none; }
.knobfold { display: none; }
/* r16(실사용1): 좁은 화면 접힌 '직접 조절' 옆 막대 수(· 4). 이 창에서 새 결과가 왔는데 아직 안 펴 봤으면 하늘색 — 색만 바뀐다(움직임 없음) */
.knobfold .kcount { margin-left: -4px; }
.knobfold .kcount:empty { display: none; }
.knobfold .kcount.fresh { color: var(--ink); font-weight: 600; }
.knob { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: var(--fu); color: var(--text); }
.knob label { flex: none; white-space: nowrap; width: var(--klw, auto); min-width: 48px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.knob label .muted { display: none; }
.knob input { flex: 1; min-width: 80px; padding: 0; border: 0; background: none; }
.knob .kval { display: none; }
.knob .kdot { color: var(--accent); font-size: 9px; margin-right: 4px; vertical-align: 1px; cursor: help; }
.knob.fixed { grid-column: 1 / -1; display: block; color: var(--muted); }
.knob input[type=range] { -webkit-appearance: none; appearance: none; height: 18px; cursor: pointer; }
.knob input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: var(--pill); background: linear-gradient(90deg, var(--accent) var(--fill, 0%), var(--track) var(--fill, 0%)); }
.knob input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 1px solid var(--line2); box-shadow: 0 1px 4px rgba(20, 40, 60, .2); }
.knob input[type=range]::-moz-range-track { height: 4px; border-radius: var(--pill); background: var(--track); }
.knob input[type=range]::-moz-range-progress { height: 4px; border-radius: var(--pill); background: var(--accent); }
.knob input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid var(--line2); }
/* 영상 받기 = 이 서비스의 끝 목표: 옅은 하늘 면 + 진한 하늘 글씨(꽉 찬 하늘색은 '보내기' 하나) */
#btnVideo { flex: none; margin-left: auto; height: 36px; padding: 0 16px; background: var(--tint2); color: var(--ink); border-color: transparent; font-weight: 600; }
#btnVideo:hover, #btnVideo[aria-expanded="true"] { background: #d5e8f8; }
/* ⋯ 의 점 셋(36px 단추 안 18px 그림)이 영상 오른쪽 끝에 맞게 */
#btnMore { flex: none; margin-right: -9px; }

/* 팝오버: 영상 받기 · ⋯ · 메모 — 늘 아래로 연다(영상을 가리지 않게). 아래 자리가 모자라면 app.js 가 조작 줄 높이만큼만 위로 당기고(top), 그래도 넘치면 안에서 스크롤 */
.vidpanel, .morebox.pop, details.memo[open] { position: absolute; z-index: 58; top: 48px; overflow-y: auto; scrollbar-width: thin; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }
/* 영상 받기: [크기 ▾][받기] 한 줄 → 요약(MP4 · 크기 · 길이) → 접힌 '세부 설정'(이름은 칸 위, 세 칸 나란히) */
.vidpanel { right: 44px; width: 368px; max-width: calc(100vw - 32px); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 8px; padding: 16px; font-size: var(--f3); color: var(--muted); }
.vidpanel select, .vidpanel button, .vidpanel input[type=number] { height: 36px; }
.vidpanel select, .vidpanel input[type=number] { border-color: var(--line2); color: var(--text); font-size: var(--fu); }
.vidpanel #vidSize { flex: 1; min-width: 0; padding: 0 34px 0 14px; }
.vidpanel #vidGo { padding: 0 20px; }
.vidpanel progress { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 6px; border: 0; border-radius: var(--pill); background: var(--line); overflow: hidden; }
.vidpanel progress::-webkit-progress-bar { background: var(--line); }
.vidpanel progress::-webkit-progress-value { background: var(--accent); }
.vidpanel progress::-moz-progress-bar { background: var(--accent); }
.vidpanel #vidMsg, .vidpanel details.vidmore, .vidpanel .vidsumrow { flex-basis: 100%; }
/* 굽는 동안에는 세부 설정을 접어 둔다(그때는 못 바꾸고, 펴 둔 채면 창이 넘쳐 안에서 스크롤됐다) */
.vidpanel:has(#vidStop:not([hidden])) details.vidmore { display: none; }
/* 요약 줄: 'MP4 · 크기 · 길이'. 영상의 모양(가로형·세로형…)을 바꾸는 글자 단추는 세부 설정 맨 아래(r30 — 받을 크기 고르기와 나란히 있어 '크기'가 둘로 보였다) */
.vidsumrow { display: flex; align-items: baseline; gap: 10px; margin-top: -4px; padding: 0 2px; }
.vidsum { flex: 1 1 0; min-width: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.vidpanel #vidShape { grid-column: 1 / -1; justify-self: start; height: auto; margin-top: 2px; }
.vidgrid button.link { color: var(--ink); }
.vidgrid button.link:hover { color: var(--ink); text-decoration: underline; }
.vidgrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px 10px; margin-top: 12px; }
.vidgrid label.wide { grid-column: 1 / -1; }
.vidgrid .unit button.link { flex: none; height: auto; margin-left: 6px; }
.vidgrid label { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.vidgrid .unit { display: flex; align-items: center; gap: 6px; width: 100%; }
.vidgrid input[type=number] { flex: 1; min-width: 0; width: 100%; padding: 0 12px; }
.vidgrid select { width: 100%; padding: 0 28px 0 12px; background-position: right 11px center; }
/* r21: '폰으로 보기' 를 고르면 길이·부드러움은 정해져 있어(5초/12초 · 30fps) 흐리게 */
.vidgrid label.fixed { opacity: .45; }
/* r24 반복 — 체크 하나 + 보조 글(이름표와 같은 결) */
.vidgrid label.loopopt { cursor: pointer; }
.vidgrid label.loopopt .unit { gap: 8px; }
.vidgrid label.loopopt input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.vidgrid label.loopopt small { color: var(--muted); font-size: var(--f3); opacity: .8; }
/* r21: 받기 창 맨 아래 한 줄 — '비교 한 장' 이름표 + 글자 단추 둘(PNG). 위에 가는 선 하나로 영상 받기와 가름 */
.gridrow { flex-basis: 100%; display: flex; align-items: center; gap: 16px; margin-top: 2px; padding: 12px 2px 0; border-top: 1px solid var(--line); }
.gridrow .lbl { flex: 1 1 auto; min-width: 0; color: var(--muted); }
.vidpanel .gridrow button.link { flex: none; height: auto; color: var(--ink); }
.vidpanel .gridrow button.link:hover:not(:disabled) { color: var(--ink); text-decoration: underline; }
.vidpanel .gridrow button.link:disabled { color: var(--muted); opacity: .45; }
.vidpanel:has(#vidStop:not([hidden])) .gridrow { display: none; }
/* r25: 낮은 화면에서 받기 창이 안에서 스크롤될 때 — 맨 위 [크기 ▾][받기] 와 맨 아래 '비교 한 장' 줄은 붙어 늘 보이고 가운데(요약·세부 설정)만 움직인다.
   흰 그림자는 붙은 줄 둘레(창 안쪽 여백 16 · 두 칸 사이 8)를 덮는 몫 — 스크롤하지 않을 때는 흰 바탕 위라 안 보인다.
   붙는 자리의 기준은 창 안쪽 여백을 뺀 안쪽 상자(크롬 실측) — 그래서 top·bottom 은 0 이고 여백 16 은 그림자로 덮는다 */
.vidpanel > #vidSize, .vidpanel > #vidGo { position: sticky; top: 0; z-index: 1; box-shadow: 0 -16px 0 #fff, 0 0 0 5px #fff; }
.vidpanel > .gridrow { position: sticky; bottom: 0; z-index: 1; background: #fff; box-shadow: 0 16px 0 #fff; }
/* r21: 좁은 화면에서 받기 창이 열려 있는 동안은 입력칸 위 고치기 낱말(떠 있는 줄)을 숨긴다 — 창이 길어지면(세부 설정을 펴면) 창 아래 끝과 겹쳤다 */
@media (max-width: 900px) { body:has(#vidPanel:not([hidden])) .hints { visibility: hidden; } }
.morebox.pop { right: 0; width: 240px; padding: 8px; }
.morebox.pop .bar.menu { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; }
.morebox.pop button { text-align: left; background: none; border: 0; border-radius: var(--r1); padding: 8px 12px; }
.morebox.pop button:hover:not(:disabled) { background: var(--hover); }
.morebox.pop button:disabled { display: none; }
/* 서버가 꺼 둔 기능(공개 모드)의 단추는 숨긴다 — body.nogen = AI 그림 · body.notd = 터치디자이너 */
body.nogen #btnGen, body.nogen #btnImport, body.notd #btnExport, body.notd #btnPush { display: none !important; }
/* 가벼운 모드 서버(body.light)는 서버가 검사를 하지 않는다 — 누르면 거절만 돌아오는 '자동 검사'를 숨긴다 */
body.light #btnCheck { display: none !important; }
/* 전문가용(코드 · 자동 검사 · 터치디자이너) — 기본 접힘 */
details.adv { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
details.adv > summary { justify-content: space-between; padding: 8px 12px; border-radius: var(--r1); font-size: inherit; }
details.adv > summary:hover { background: var(--hover); }
details.adv button:not(:disabled) { display: block; width: 100%; }
/* 전문가용 안 작은 한 줄: 다른 Claude 창(MCP)의 버전이 다를 때만 — 개발자용 정보라 일반 화면의 알림으로 띄우지 않는다(r33) */
details.mixed > summary { list-style: none; cursor: pointer; padding: 8px 12px 4px; font-size: 12px; color: var(--muted); white-space: normal; }
details.mixed > summary::-webkit-details-marker { display: none; }
details.mixed > summary:hover { color: var(--text); }
details.mixed > div { padding: 0 12px 8px; font-size: 12px; line-height: 1.5; color: var(--muted); white-space: pre-line; word-break: break-all; }
details.memo > summary { display: none; }
details.memo:not([open]) { display: none; }
/* 설명·메모: 이름표(설명 · 메모)는 본문색 600, 입력칸은 본문 크기, 도움말만 작은 회색. 작업 기록은 선으로 떼어 맨 아래 */
details.memo[open] { right: 0; width: min(520px, 100%); max-height: 60vh; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fu); font-weight: 600; color: var(--text); }
.field textarea, .field input { font-weight: 400; color: var(--text); border-color: var(--line2); }
#pBrief { min-height: 82px; line-height: 1.55; }
.field input { height: 40px; }
.field small { color: var(--muted); }
details.memo details.logs { padding-top: 12px; border-top: 1px solid var(--line); }
.field button.link { align-self: flex-start; }
.fbrow input { width: 100%; }
.fbmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; padding-left: 14px; font-size: var(--f3); }
.fbmeta:not(:has(:not([hidden]):not(:empty))) { display: none; }
.fbto.warn { color: var(--warn); font-weight: 600; }
.fblist { list-style: none; padding: 0; margin: 0; font-size: var(--f3); }
.fblist:empty { display: none; }
.fblist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.fblist li:last-child { border-bottom: 0; }
.fblist li.pending { color: var(--warn); }
.fblist .who, .fblist .kn { color: var(--muted); margin-right: 6px; }
#checkOut { font-size: var(--f3); }
#checkOut:empty { display: none; }
#checkOut img { max-width: 100%; margin-top: 8px; border-radius: var(--r1); }
.verdict { font-weight: 600; }
.verdict.ok { color: var(--ok); } .verdict.warn { color: var(--warn); } .verdict.bad { color: var(--bad); }
details.logs > summary { display: inline-flex; }
.events { list-style: none; padding: 0; margin: 6px 0 0; line-height: 1.7; font-size: var(--f3); }
.events li { color: var(--muted); word-break: break-all; }
.events li:nth-child(n+9) { display: none; }
.events.all li { display: list-item; }
.events b { color: var(--text); font-weight: 600; }

/* ── 대화 ── */
#imgSum { display: none !important; }
.chatlog { flex: 1; min-height: 0; list-style: none; margin: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; font-size: var(--f2); line-height: 1.65;
  padding: 20px max(20px, calc((100% - var(--col)) / 2)) 24px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
/* r38: 대화 칸 스크롤 손잡이는 평소 안 보인다 — 마우스를 대화 칸에 올렸거나 스크롤 중(.scrolling — app.js)일 때만. 패널 경계 바로 옆에 회색 막대가 늘 서 있어 세로선이 하나 더 그어져 보였다.
   자리(8px)는 그대로 잡아 둔다 — 보였다 사라져도 글이 안 밀린다. 보이는 폭은 6px(양옆 1px 은 투명 테) */
.chatlog:hover, .chatlog.scrolling { scrollbar-color: var(--line2) transparent; }
/* 대화 칸 스크롤 막대(크롬 계열): 위·아래 세모 단추 없이 옅은 8px 막대. 막대 자리(8px)를 늘 잡아 두고 오른쪽 여백을 그만큼 줄인다 — 막대가 있든 없든 말풍선 오른쪽 끝 = 입력칸 오른쪽 끝.
   ::-webkit-scrollbar 는 scrollbar-width·scrollbar-color 가 auto 일 때만 먹는다(html 에서 물려받은 값도 여기서 되돌린다). 좁은 화면은 쪽 전체가 스크롤이라 아래 묶음에서 여백을 다시 준다 */
@supports selector(::-webkit-scrollbar) {
  .chatlog, .chatlog:hover, .chatlog.scrolling { scrollbar-width: auto; scrollbar-color: auto; scrollbar-gutter: stable; padding-right: calc(max(20px, (100% - var(--col)) / 2) - 8px); }
  .chatlog::-webkit-scrollbar { width: 8px; }
  .chatlog::-webkit-scrollbar-track { background: transparent; }
  .chatlog::-webkit-scrollbar-thumb { background: transparent; border: 1px solid transparent; background-clip: padding-box; border-radius: 4px; }
  .chatlog:hover::-webkit-scrollbar-thumb, .chatlog.scrolling::-webkit-scrollbar-thumb { background-color: var(--line2); }
  .chatlog::-webkit-scrollbar-thumb:hover, .chatlog::-webkit-scrollbar-thumb:active { background-color: var(--ph); }
  .chatlog::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  .chatlog:empty { padding-right: max(20px, calc((100% - var(--col)) / 2)); }
}
.chatlog li { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; text-wrap: pretty; }
/* 답글: 줄바꿈마다 문단 하나(문단 사이 12 — r36, 전 8: 줄 26 / 문단 34 라 여덟 줄이 한 덩어리로 읽혔다 / 답 사이 12 / 턴 사이 24). 조절 막대 이름은 굵게 — 이름 안에서는 줄이 끊기지 않는다 */
.chatlog li.assistant .para { display: block; }
.chatlog li.assistant .para + .para { margin-top: 12px; }
.chatlog .kn { font-weight: 600; white-space: nowrap; }
/* 대화 기록이 오기 전의 자리 지킴 줄(대화가 있는 프로젝트 — app.js chatHold): 보이지 않지만 '빈 대화' 화면(:empty)으로 그려지지 않게 한다 */
.chatlog li.hold { display: none; }
/* 내 말풍선은 줄을 끝까지 채운다(r35 — pretty 는 첫 줄을 일찍 끊어 말풍선 안 오른쪽이 70~100px 비었다) */
.chatlog li.user { align-self: flex-end; max-width: 90%; background: var(--bubble); padding: 8px 16px; border-radius: var(--r3); text-wrap: wrap; }
/* 턴 리듬: 내 말 → 답 사이는 12px, 답 → 다음 내 말 사이는 24px */
.chatlog li.user:not(:first-child) { margin-top: 12px; }
/* 만드는 중: 하늘색 점 하나가 불투명도만 천천히 오간다(자리·크기는 그대로) */
.chatlog li.busy { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; color: var(--muted); }
/* 진행 줄 아래 작은 한 줄: 예상 시간. 그 실행의 중간 말이 있으면 그 자리에 그 말(.mid — 한 줄, 넘치면 말줄임. 끝나면 사라진다) */
.chatlog li.busy .eta { flex-basis: 100%; min-width: 0; margin: 0; padding-left: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 답 글 끝의 '결과 N' — 누르면 그 결과로. 글과는 12px(문단 사이와 같은 값 — r36) */
.chatlog .resrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; white-space: normal; }
/* 한 요청이 결과를 여럿 만들었으면 마지막 칩 하나 + 작은 글자 단추 '앞 결과 n개'(누르면 그 뒤로 펼침) */
.chatlog .resrow button.prevres { height: 28px; padding: 0 4px; font-size: var(--f3); color: var(--muted); }
.chatlog .resrow button.prevres:hover { color: var(--text); text-decoration: underline; }
.chatlog li.chips .resrow { margin-top: 0; }
/* 이름표에 가깝게 한 단 낮춘다(선만) — 채워진 하늘 면은 끝 목표 '영상 받기' 쪽에 남긴다 */
.chatlog .reschip { height: 28px; padding: 0 12px; font-size: var(--f3); font-weight: 600; background: transparent; color: var(--ink); border-color: var(--line2); }
.chatlog .reschip:hover { background: var(--tint); }
/* 지금 오른쪽에 보이는 결과의 칩 = 회색 면 + 본문색(선 없음) — 왼쪽 목록의 고른 항목 · 영상 위 고른 번호와 같은 모양. 하늘은 누르는 것에만 */
.chatlog .reschip.on, .chatlog .reschip.on:hover { background: var(--sel-bg); color: var(--text); border-color: transparent; }
.chatlog li.busy::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: breathe 1.4s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: .25; } to { opacity: 1; } }
/* 단계 말이 바뀌는 순간(app.js 가 .chg 를 붙인다): 새 낱말이 하늘 잉크에서 제 색으로 가라앉는다 — 색·불투명도만 바뀐다 */
.chatlog li.busy span.chg { animation: stagein 1.6s ease-out; }
@keyframes stagein { from { color: var(--ink); opacity: .35; } 25% { color: var(--ink); opacity: 1; } }
/* 결과 줄 옆의 같은 낱말은 색만 */
.versbusy.chg { animation: stageink 1.6s ease-out; }
@keyframes stageink { from, 25% { color: var(--ink); } }
/* 안내·오류: 상자 없이 작은 ⓘ + 쉬운 한 줄 · [다시 시도] · 접힌 '자세히'(원문). 단추와 자세히는 한 묶음(.acts)으로 같이 줄바꿈 */
.chatlog li.system { position: relative; align-self: flex-start; margin-top: 4px; max-width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding-left: 24px; color: var(--muted); font-size: var(--fu); }
.chatlog li.system::before { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23586471' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.3'/%3E%3Cpath d='M8 7.4v3.6'/%3E%3Ccircle cx='8' cy='5' r='.5' fill='%23586471'/%3E%3C/svg%3E") center / 16px no-repeat; }
/* 알약 단추가 붙은 줄은 줄 높이가 28px — 아이콘을 글자 가운데에 맞춘다 */
.chatlog li.system:has(button.retry)::before { top: 6px; }
.chatlog li.system .acts { display: inline-flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.chatlog li.system .acts:has(details[open]) { display: contents; }
/* [다시 시도]·[로그인] = 작은 알약(옅은 하늘 면) — 멈추거나 실패한 화면에서 할 일이 가장 먼저 보이게 */
.chatlog li.system button.retry { height: 28px; padding: 0 12px; border-radius: var(--pill); background: var(--tint); color: var(--ink); font-size: var(--f3); font-weight: 600; }
.chatlog li.system button.retry:hover { background: var(--tint2); color: var(--ink); }
.chatlog li.system summary { cursor: pointer; color: var(--muted); font-size: var(--f3); list-style: none; }
.chatlog li.system summary::-webkit-details-marker { display: none; }
.chatlog li.system summary:hover { color: var(--text); text-decoration: underline; }
.chatlog li.system details[open] { flex-basis: 100%; }
.chatlog li.system details div { margin-top: 4px; color: var(--muted); white-space: pre-wrap; word-break: normal; }
.composer { flex: none; position: relative; width: min(var(--col), calc(100% - 40px)); margin: 0 auto 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--r4); padding: 12px 12px 12px 16px; box-shadow: var(--lift); transition: border-color .12s, box-shadow .12s; }
/* 글을 쓰는 동안 옅은 하늘색 테 */
.composer:focus-within { border-color: #a9d2f0; box-shadow: 0 0 0 3px rgba(59, 155, 224, .12), var(--lift); }
.composer textarea { width: 100%; border: 0; border-radius: 0; background: transparent; padding: 2px 0; min-height: 30px; max-height: 160px; font-size: var(--f2); line-height: 1.6; overflow: hidden; display: block; }
/* 자리 표시 글은 옅게 둔다(적은 글과 헷갈리지 않게 — --faint 를 올린 뒤에도 옛 색) */
.composer textarea::placeholder { color: var(--ph); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 0 -8px; }
#imgClip[aria-expanded="true"] { color: var(--accent); background: var(--tint); }
/* 보내기 = 동그란 화살표. 만드는 중에는 그 자리가 멈춤(짙은 동그라미 안 네모) 하나로 바뀐다 */
.composer .send, .composer .stop { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.composer .stop { background: var(--text); color: #fff; border-color: transparent; }
.composer .stop:hover { background: #0f161d; }
#chatStop:not([hidden]) ~ #chatSend { display: none; }
.composer .send.empty { background: var(--track); color: #fff; }
/* R5(크레딧 v2 §6): 보내면 쓰는 크레딧이 단추 안에 — 동그라미가 알약으로 늘어난다(숫자 + 화살표). 값이 0 이면 동그라미 그대로 */
.composer .send.hascr { width: auto; min-width: 36px; padding: 0 12px 0 14px; gap: 6px; border-radius: var(--pill); }
.composer .send .sendcr { font-size: var(--f3); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.composer .send .sendcr::before { content: '✦'; margin-right: 3px; font-size: 11px; opacity: .85; }
/* r17(실사용2 위험 3): 하루 한도를 다 쓰면 그 안내가 보내기 단추 왼쪽 줄에 남는다(안내 글은 칩·입력에 지워졌다). 글만 — 자리·높이는 그대로(36px 단추 줄 안) */
.composer-bar .cq { min-width: 0; font-size: var(--f3); line-height: 1.35; color: var(--muted); }
body.quotaout .composer textarea { cursor: default; }
/* 다 썼을 때 말을 넣는 칩은 흐리게·눌리지 않게(사진 칩은 그대로 — 횟수에 안 듦) */
body.quotaout .hints button[data-say] { opacity: .45; pointer-events: none; }
.hints { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(var(--col), calc(100% - 40px)); margin: 0 auto; }
#chatLog:not(:empty) ~ .hints { display: none; }
/* 예시 칩은 입력칸보다 한 단 낮게(선 옅게 · 작은 회색 글) — 눈이 입력칸으로 먼저 가게 */
.hints button { height: 32px; padding: 0 12px; font-size: var(--f3); color: var(--muted); background: #fff; border-color: var(--line); }
.hints button:hover { background: #fff; color: var(--text); border-color: var(--line2); }
/* r37: 고치기 낱말(.h-edit)은 빈 대화에서도 대화 중과 같은 모양 — 테두리 없는 13px 글자 단추("새로 만들기 = 알약, 고치기 = 글자"). 자리는 그대로 */
/* r38: 글자색은 하늘 잉크 — '누르는 것 = 하늘'(지난 결과 칩과 같은 색). 회색일 때는 가운데에 놓이면 설명 글처럼 읽혔다 */
.hints button.h-edit { padding: 0 10px; border-color: transparent; background: transparent; box-shadow: none; color: var(--ink); }
.hints button.h-edit:hover { background: var(--hover); color: var(--ink); border-color: transparent; }
#main:not(:has(#vers:empty)) .hints { gap: 4px; }
/* 예시는 상황에 맞는 것만: 결과가 아직 없으면 만들기용(.h-new), 있으면 고치기용(.h-edit) */
#main:has(#vers:empty) .hints .h-edit, #main:not(:has(#vers:empty)) .hints .h-new { display: none; }
/* 빈 대화(결과 없음): 인사말 + 입력칸을 화면 가운데에, 예시는 그 아래 */
.right:has(#chatLog:empty) { justify-content: center; padding-bottom: 10vh; }
.right:has(#chatLog:empty) #chatLog { flex: none; overflow: visible; padding-top: 0; padding-bottom: 32px; }
.chatlog:empty::before { content: '무엇을 만들까요?'; font-size: var(--f1); font-weight: 600; letter-spacing: -.03em; line-height: 1.3; text-align: center; color: var(--text); }
.right:has(#chatLog:empty) .composer { order: 2; margin-bottom: 16px; }
.right:has(#chatLog:empty) .hints { order: 3; }
/* 빈 대화(결과 있음): 큰 인사말 대신 작은 안내 한 줄. 넓은 화면의 자리는 아래 min-width 묶음에 */
#main:not(:has(#vers:empty)) .chatlog:empty::before { content: '이 영상을 어떻게 바꿀까요?'; font-size: var(--f2); font-weight: 400; letter-spacing: inherit; color: var(--muted); }
/* 빈 대화(결과 없음): 인사말 아래 한 줄 — 무엇이 나오는지 */
#main:has(#vers:empty) .chatlog:empty::after { content: '말로 설명하면 움직이는 영상을 만들어 드려요'; margin-top: -4px; font-size: var(--f2); line-height: 1.55; text-align: center; color: var(--muted); }

/* 사진 = 입력칸 위 팝오버: 영상에 쓸 사진 → [+ 사진 올리기] → 더 보기(AI로 그림 만들기 · 만들어 둔 그림 고르기 · 분위기만 참고할 사진) */
.composer > .imgs { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); max-height: min(520px, 64vh); overflow-y: auto; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.imghead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: var(--f2); font-weight: 600; letter-spacing: -.02em; }
.imghead small, .refsbox .lbl small { display: block; margin: 2px 0 0; color: var(--muted); letter-spacing: -.01em; }
#foldBtn { width: 28px; height: 28px; margin-right: -6px; }
#foldBtn[aria-expanded="true"]:not(:hover) { background: transparent; color: var(--muted); }
#upCandBtn { height: 36px; padding: 0 16px; }
.imgs .arch-toggle { height: 30px; padding: 0 12px; font-size: var(--f3); color: var(--muted); }
details.imgmore > summary { display: inline-flex; }
/* 더 보기 안: 선 없는 글자 단추 목록 → 참고 사진(선 두른 상자는 비어 있을 때만) */
.imgmore .morein { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.imgmore .morelist { display: flex; flex-direction: column; align-items: flex-start; }
.imgmore .morelist button { background: none; border: 0; border-radius: var(--r1); margin-left: -8px; padding: 6px 8px; color: var(--text); }
.imgmore .morelist button:hover { background: var(--hover); }
.refsbox .bar { gap: 6px 12px; align-items: flex-start; }
.refsbox .lbl { flex: 1; min-width: 0; }
.refsbox .bar button.link { color: var(--ink); font-size: var(--f3); }
.refsbox .bar button.link:hover { color: var(--ink); text-decoration: underline; }
.imgs .strip.drop:has(img) { border: 0; padding: 0; min-height: 0; }
.refsbox { display: flex; flex-direction: column; gap: 8px; }
.refsbox .lbl { font-size: var(--f3); color: var(--muted); }
.strip { display: flex; gap: 6px; overflow-x: auto; min-height: 64px; padding: 6px; border: 1px dashed var(--line2); border-radius: var(--r2); align-items: center; }
.strip:has(.hint) { justify-content: center; }
.strip img { height: 52px; border-radius: var(--r1); cursor: zoom-in; }
.rth { position: relative; flex: none; display: flex; }
.rth img { display: block; }
.rth.arch img, .card.arch img { opacity: .35; filter: grayscale(.7); }
.rth .more, .card .more { position: absolute; top: 4px; right: 4px; padding: 0 7px; line-height: 20px; font-size: var(--f3); font-weight: 600; background: rgba(255, 255, 255, .9); opacity: 0; border: 0; }
.card .more { right: auto; left: 6px; top: 6px; }
.rth:hover .more, .rth:focus-within .more, .card:hover .more, .card:focus-within .more, .more:focus-visible { opacity: 1; }
.rth .restore, .card .restore { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 3px 10px; font-size: var(--f3); background: #fff; color: var(--ink); }
.card.arch { cursor: default; }
.arch-toggle[aria-pressed="true"] { background: var(--btn) !important; color: #fff !important; }
.cardmenu { position: fixed; z-index: 1002; display: flex; flex-direction: column; min-width: 140px; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); padding: 8px; box-shadow: var(--shadow); }
.cardmenu button { text-align: left; border: 0; border-radius: var(--r1); background: none; padding: 8px 12px; }
.cardmenu button:hover, .cardmenu button:focus-visible { background: var(--hover); }
.cardmenu button.danger { color: var(--bad); }
.cardmenu button.danger:hover, .cardmenu button.danger:focus-visible { background: #fdf1f1; }
.strip.small { min-height: 0; border: 0; padding: 4px 0; margin: 0; }
.strip.small label { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.strip.small img { height: 48px; cursor: default; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 72px); gap: 8px; min-height: 72px; border: 1px dashed transparent; border-radius: var(--r2); }
.grid:has(.hint) { border-color: var(--line2); padding: 6px; grid-template-columns: 1fr; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 60vh; overflow-y: auto; scrollbar-width: thin; border: 0; }
.hint { align-self: center; justify-self: center; font-size: var(--f3); color: var(--muted); text-align: center; }
.drop.over { border-color: var(--accent); background: var(--tint); }
.card { position: relative; border-radius: var(--r1); overflow: hidden; cursor: pointer; background: var(--sel-bg); outline: 2px solid transparent; outline-offset: -2px; }
.card:focus-visible, .rth img:focus-visible { outline: 2px dashed var(--accent); outline-offset: 2px; }
.card img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; }
/* 못 불러온 그림: 빈 네모 대신 옅은 그림 아이콘 */
.card.broken { background: var(--hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab4bf' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='14' rx='2.5'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='M4.5 17l4.8-4.6 3.4 3.2 2.6-2.3 4.2 3.7'/%3E%3C/svg%3E") center / 24px no-repeat; }
.card.broken img { visibility: hidden; }
.grid.small .card img { aspect-ratio: 16 / 9; }
.card.sel { outline: 2.5px solid var(--sel); outline-offset: 1px; }
.card .tag, .card .star { display: none; }
.grid.small .card .tag { display: block; position: absolute; left: 6px; bottom: 6px; font-size: 11px; line-height: 1.35; color: #fff; background: rgba(0, 0, 0, .7); padding: 2px 6px; border-radius: var(--r1); max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .tag .l1, .card .tag .l2 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .tag .l2 { color: #c9cad0; }
.card.skel { cursor: default; }
.card.skel .skimg { aspect-ratio: 1; background: linear-gradient(100deg, var(--sel-bg) 30%, var(--hover) 50%, var(--sel-bg) 70%); background-size: 300% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .card.skel .skimg, .chatlog li.busy::before, .versbusy::before, #main.making:has(#vers:empty) .glmaking, #main.firstwait .glmaking, #main.making:has(#vers:empty) .glmaking.chg, #main.firstwait .glmaking.chg, .versbusy.chg, .chatlog li.busy span.chg { animation: none; } #side { transition: none; } }
.card.pick { outline-color: #8fb4ff; }
.card .chk { position: absolute; right: 6px; top: 6px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .4); }
.card.pick .chk { background: #8fb4ff; }
.card.have { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }

/* ── 창 ── */
dialog { background: #fff; color: var(--text); border: 0; border-radius: var(--r3); padding: 0; max-width: 92vw; box-shadow: 0 24px 60px rgba(20, 40, 60, .25); }
dialog::backdrop { background: rgba(20, 30, 40, .35); }
.dlg { padding: 24px; width: 520px; max-width: calc(92vw - 2px); display: flex; flex-direction: column; gap: 16px; }
.dlg.wide { width: 1000px; }
.dlg.narrow { width: 380px; }
.dlg > select { height: 42px; font-size: var(--f2); border-color: var(--line2); }
.dlg h3 { margin: 0; font-size: var(--f2); font-weight: 600; letter-spacing: -.02em; line-height: 1.4; }
.dlg h3 small { display: block; margin: 4px 0 0; color: var(--muted); letter-spacing: -.01em; }
.dlg h3.inline small { display: inline; margin: 0 0 0 10px; }
.dlg h3 small:empty { display: none; }
.dlg label { display: flex; flex-direction: column; gap: 6px; font-size: var(--f3); color: var(--muted); }
.dlg label input, .dlg label textarea, .dlg label select { font-size: var(--f2); color: var(--text); border-color: var(--line2); }
.dlg input:focus, .dlg textarea:focus, .dlg select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 155, 224, .18); }
.dlg .row label { flex: 1; }
.dlg .row.end { margin-top: 4px; }
.dlg .row.end .msg { margin-right: auto; }
.dlg .row.end button { height: 38px; padding: 0 18px; }
#nCustom input { width: 110px; }
/* 묻는 창: 글 한 덩어리 + [취소][확인]. 되돌릴 수 없는 일(대화 지우기)의 확인 단추는 빨강 */
.asktext { margin: 0; font-size: var(--f2); line-height: 1.6; white-space: pre-line; }
button.primary.dangerbtn { background: var(--bad); }
button.primary.dangerbtn:hover { background: #c23a3a; }
.cost { padding: 10px 14px; background: var(--hover); border-radius: var(--r2); font-size: var(--f3); white-space: pre-line; }
.cost .warn { margin-bottom: 4px; }
.cost b { color: var(--text); }
.cost.bad { color: var(--bad); }
#gRefN.bad { font-weight: 600; }
/* 코드 창 — 줄 높이(18px)·위 여백(8px)은 app.js 의 LH·PAD 와 같아야 한다 */
.code-wrap { display: flex; height: 60vh; border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; background: #fff; }
#codeGutter { flex: none; margin: 0; padding: 8px 8px 48px 10px; min-width: 48px; text-align: right; color: #a3b2c2; font: 12px/18px Consolas, monospace; letter-spacing: 0; overflow: hidden; user-select: none; background: var(--side); border-right: 1px solid var(--line); }
#codeGutter .err { color: #fff; background: var(--bad); border-radius: 3px; padding: 0 3px; }
.code-main { position: relative; flex: 1; min-width: 0; overflow: hidden; }
#codeHl { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
#codeHl div { position: absolute; left: 0; right: 0; height: 18px; background: rgba(240, 122, 122, .14); border-left: 3px solid var(--bad); }
#codeTa { position: relative; display: block; width: 100%; height: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 0; font: 12px/18px Consolas, monospace; letter-spacing: 0; background: transparent; white-space: pre; overflow: auto; scrollbar-width: thin; tab-size: 4; }
#codeTa:focus-visible { outline: none; }
.code-errs { list-style: none; margin: 0; padding: 0; max-height: 120px; overflow-y: auto; scrollbar-width: thin; font: 12px/1.6 Consolas, monospace; color: var(--bad); }
.code-errs:empty, .code-warns:empty { display: none; }
.code-errs button.link, .code-errs .noline { color: var(--bad); margin-right: 6px; }
.code-warns { list-style: none; margin: 0; padding: 0; max-height: 90px; overflow-y: auto; scrollbar-width: thin; font-size: var(--f3); color: var(--warn); }
#codeNote { flex: 1; min-width: 200px; }
#dlgBig { background: #000; }
#dlgBig img { max-width: 90vw; max-height: 78vh; display: block; margin: 0 auto; }
#dlgBig .bigbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; flex-wrap: wrap; }
#dlgBig .bigbar .cap { flex: 1; min-width: 160px; margin: 0; }
#dlgBig .bigbar form { margin: 0; }

/* 넓은 화면: ☰ 로 왼쪽 목록 접기(body.sideOpen = 접힘). 프로젝트가 없으면 항상 펼침 */
@media (min-width: 901px) {
  body.sideOpen:not(.noproj) #side { margin-left: -260px; }
  body.noproj #sideToggle { visibility: hidden; }
  /* 빈 대화(결과 없음)에서는 입력칸이 화면 가운데라 사진 팝오버를 아래로 연다(위로 열면 위 줄을 덮음) */
  #main:has(#vers:empty) .right:has(#chatLog:empty) .composer > .imgs { bottom: auto; top: calc(100% + 10px); max-height: min(380px, 40vh); }
  /* 빈 대화(결과 있음): 작은 안내 + 고치기용 예시 묶음은 영상 눈높이(남는 높이의 위 2 : 아래 3), 입력칸은 대화 중과 같은 아래 자리(보낼 때 안 튐) */
  #main:not(:has(#vers:empty)) .right:has(#chatLog:empty) { justify-content: flex-start; padding-bottom: 0; }
  #main:not(:has(#vers:empty)) .right:has(#chatLog:empty) #chatLog { flex: 2 1 0; justify-content: flex-end; padding-bottom: 14px; }
  #main:not(:has(#vers:empty)) .right:has(#chatLog:empty) .hints { order: 2; flex: 3 1 0; align-content: flex-start; margin-bottom: 0; }
  #main:not(:has(#vers:empty)) .right:has(#chatLog:empty) .composer { order: 3; margin-bottom: 24px; }
  /* 대화 중의 고치기용 예시(body.fixhint — app.js hintSync): 입력칸 바로 위 8px 에 작은 글자 단추 한 줄. 자리를 차지하지 않고(높이 0) 대화 칸의 아래 여백 위에 얹는다
     — 나타나고 사라져도 대화·입력칸이 움직이지 않는다. 그 자리만큼 대화 아래 여백을 늘 둔다(56). 뒤의 흰 받침은 위로 올려 읽는 글이 겹쳐 보이지 않게 */
  /* r35: 대화가 맨 아래일 때만(body.hintend) 보인다 · 흰 받침 64(옅어지는 띠 20) · 대화 아래 여백 72 — 끝 답과 단추 사이에 흰 띠 36px */
  .chatlog { padding-bottom: 72px; }
  /* r36: 대화 칸 위 끝 — 제목 줄 밑에서 글이 그냥 잘리지 않게 16px 옅어지는 띠(아래쪽 받침과 같은 방식). 대화가 맨 위일 때는 첫 말풍선 위 여백(20px) 안이라 안 보인다. 스크롤 막대(8px)는 덮지 않는다 */
  .right:has(#chatLog:not(:empty))::after { content: ''; position: absolute; z-index: 2; left: 0; right: 8px; top: 0; height: 16px; background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0)); pointer-events: none; }
  body.fixhint.hintend #chatLog:not(:empty) ~ .hints { display: flex; position: relative; z-index: 1; top: -8px; height: 0; flex-wrap: nowrap; justify-content: flex-start; align-items: flex-end; gap: 4px; }
  body.fixhint.hintend #chatLog:not(:empty) ~ .hints::before { content: ''; position: absolute; z-index: -1; left: -12px; right: -12px; bottom: -8px; height: 64px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 20px); pointer-events: none; }
  body.fixhint #chatLog:not(:empty) ~ .hints button { height: 28px; margin-left: -10px; margin-right: 10px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--ink); }
  body.fixhint #chatLog:not(:empty) ~ .hints button:hover { background: var(--hover); color: var(--ink); border-color: transparent; }
}
/* 1280 근처(901~1360): 목록을 220px 로 줄이고 대화 칸을 넓힌다(대화 최소 400 · 패널 1.5) */
@media (min-width: 901px) and (max-width: 1360px) {
  #side { width: 220px; }
  body.sideOpen:not(.noproj) #side { margin-left: -220px; }
  .work { grid-template-columns: minmax(400px, 1fr) minmax(0, 1.5fr); }
}

/* ── 좁은 화면: 목록은 서랍, 결과 → 대화 순으로 쌓고 입력칸은 아래 고정 ── */
@media (max-width: 900px) {
  html, body { height: auto; min-height: 100%; }
  body { display: block; overflow: auto; padding-bottom: 130px; }
  #side { position: fixed; z-index: 800; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  body.sideOpen #side { transform: none; }
  body:not(.sideOpen) #side { box-shadow: none; visibility: hidden; }
  /* 닫힌 서랍 안의 ⋯ 는 스스로 visibility: visible 이라(연 항목) 서랍이 숨어도 혼자 남았다 — 서랍이 닫히는 0.18초 동안 ⋯ 만 미끄러져 나갔다 */
  body:not(.sideOpen) #projList .pmore { visibility: hidden; }
  #scrim { position: fixed; inset: 0; z-index: 790; background: rgba(20, 30, 40, .3); }
  body.sideOpen #scrim { display: block; }
  #main { height: auto; min-height: calc(100vh - 130px); }
  .top { position: sticky; top: 0; z-index: 100; background: #fff; padding: 0 12px 0 8px; }
  /* 고정 입력칸 뒤 흰 받침 — 지나가는 말풍선이 입력칸 아래·옆으로 삐져나오지 않게(위 20px 은 옅어지며 사라짐) */
  body::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 128px; z-index: 198; pointer-events: none; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 20px); }
  #pName { flex: 1 1 auto; min-width: 0; max-width: none; field-sizing: fixed; }
  .top .grow { display: none; }
  #empty { min-height: calc(100vh - 52px - 190px); padding-bottom: 0; }
  #proj:not([hidden]) { display: flex; flex-direction: column; }
  .work { flex: 1 0 auto; display: flex; flex-direction: column; height: auto; }
  /* 결과 패널의 틀(.left · .stage · .stagecol)을 풀어 영상(.viewer)을 .work 의 바로 아래 칸으로 — 대화가 길어져도 영상을 제목 줄 아래에 붙여 둘 수 있다.
     붙이는 것(.stick)은 app.js 가 영상 높이가 화면의 35% 이하일 때만 */
  .left, .stage, .stagecol { display: contents; }
  .left > :not(.stage), .stagecol > * { margin-left: 16px; margin-right: 16px; }
  .versbox { margin-top: 4px; margin-bottom: 12px; }
  /* 결과 번호가 한 줄을 꽉 채우면 줄 밖(left: 100%)에 숨겨 둔 ⋯ 가 쪽을 옆으로 13px 넓혔다(r35 — 결과 10개에서 가로 스크롤). 좁은 화면에서는 줄 안 오른쪽 끝에 자리를 잡아 둔다 */
  /* r37: 결과가 많아도 한 줄 — 줄을 꺾지 않고 가로로 넘긴다(스크롤 막대는 숨김 · 고른 번호가 보이게는 app.js versReveal). ⋯ 는 줄 맨 끝 칸으로(전에는 줄 안 오른쪽 끝에 겹쳐 둠).
     위아래 2px 는 초점 테가 잘리지 않게 */
  .vers { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 0; margin: -2px 0; }
  .vers::-webkit-scrollbar { display: none; }
  .vers > * { flex: none; white-space: nowrap; }
  .vers .vmore { position: static; order: 99; }
  /* 결과가 아직 없으면 숨겨 둔 '결과' 줄의 자리(약 42px 빈 띠)도 없앤다 — 제목 줄 아래 12px 에 바로 영상 자리 */
  #main:has(#vers:empty) .versbox, #main.firstwait .versbox { display: none; }
  #main:has(#vers:empty) .viewer, #main.firstwait .viewer { margin-top: 12px; }
  .viewer.stick { position: sticky; top: 52px; z-index: 40; box-shadow: 0 0 0 6px #fff; }
  body.offline .viewer.stick { top: 90px; }
  /* r37: 흰 16 + 옅어짐 12(전 12 + 16 — 지나가는 글·칩 테두리가 반투명 조각으로 남았다). 조작 줄이 다 지나간 뒤에만 켠다(app.js stuckSync)
     r36: 붙은 영상 밑 — 흰 바탕을 12px 더 내리고 그 밑에 16px 옅어지는 띠(지나가는 대화 글·말풍선이 영상 아래 끝에서 반 토막으로 잘려 보였다). 자리를 차지하지 않고(아래 여백 −28)
     영상이 실제로 붙어 있을 때만(.stuck — app.js stuckSync) 보인다. 폭은 영상의 흰 테(6px)와 같다 */
  .stagecol > .viewer.stick ~ .vfade { display: block; position: sticky; top: calc(52px + var(--vh, 0px)); z-index: 39; height: 28px; margin: 0 10px -28px; background: linear-gradient(to bottom, #fff 16px, rgba(255, 255, 255, 0)); pointer-events: none; opacity: 0; transition: opacity .15s; }
  .stagecol > .viewer.stick.stuck ~ .vfade { opacity: 1; }
  body.offline .stagecol > .viewer.stick ~ .vfade { top: calc(90px + var(--vh, 0px)); }
  .right { order: 2; flex: 1 0 auto; }
  /* 영상은 폭에 맞추되 화면 높이의 70%(그리고 화면 높이 − 400px)를 넘지 않는다(R4-web-05 — 세로로 아주 긴 영상이 조작 줄·대화를 수천 px 아래로 밀었다). 폭이 남으면 가운데 */
  .viewer { align-self: center; max-width: calc(100% - 32px); }
  /* 세로 영상이 화면을 다 차지하지 않게: 제목 52 + 결과 줄 46 + 재생 줄 60 + 입력칸 130 + 답 한두 줄 110 = 400px 은 남긴다(가로 영상은 영향 없음) */
  .viewer { --glmaxh: max(240px, min(70vh, calc(100dvh - 400px))); }
  .viewer .refview { display: none; }
  .ctrls { margin-top: 12px; }
  /* 결과가 아직 없으면(만드는 중 · 멈춘 뒤) 숨겨 둔 조작 줄의 자리도 없앤다 — 영상 자리와 내 말풍선 사이에 빈 띠가 생기지 않게 */
  #main:has(#vers:empty) .ctrls, #main.firstwait .ctrls { display: none; }
  /* 조절 막대 = 접는 한 줄('조절 ▾') 아래. 늘 접힌 채로 시작하고(대화 자리를 먼저) 누르면 펼친다 — 누른 뒤에는 그 프로젝트에서 펼친 채(.kopen 은 app.js).
     머리 줄('직접 조절')은 '조절 ▾' 이 대신하므로 '처음대로'만 그 줄 오른쪽 끝에(펼쳤고 값을 바꿨을 때) */
  .playrow:has(.knobs:not(:empty)) .knobfold { order: 4; flex: 1 1 100%; display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 0 0; border: 0; border-radius: 0; background: none; font-size: var(--f3); font-weight: 400; letter-spacing: 0; color: var(--muted); text-align: left; }
  .knobfold::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); }
  .knobfold[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }
  .playrow .knobs { grid-template-columns: 1fr; gap: 8px; margin-top: 0; padding-top: 8px; border-top: 0; }
  #main:not(.kopen) .playrow .knobs, #main:not(.kopen) .knobhead, .knobhead:has(#knobReset[hidden]) { display: none; }
  .playrow:has(.knobs:not(:empty)) .knobfold:has(+ .knobhead #knobReset:not([hidden])) { flex: 1 1 calc(100% - 74px); }
  .knobhead { order: 4; flex: 0 0 66px; justify-content: flex-end; margin: 8px 0 0 -8px; padding: 8px 0 0; }
  .knobhead > span { display: none; }
  .knob label { width: var(--klw, 64px); }
  /* 영상 받기도 ⋯ 메뉴처럼 아래로 연다(위로 열면 영상을 덮음) */
  .vidpanel { right: 0; left: 0; width: auto; max-width: none; }
  details.memo[open] { position: static; box-shadow: none; margin-top: 10px; }
  .chatlog { overflow: visible; padding: 20px 16px 12px; }
  .composer { position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; margin: 0 !important; z-index: 200; box-shadow: 0 6px 24px rgba(20, 40, 60, .16); }
  .composer > .imgs { max-height: 56vh; }
  /* 예시는 입력칸 바로 위에 붙여 한 줄로(넘치면 옆으로 민다). 글을 쓰기 시작하면 숨김 */
  .hints { position: fixed; left: 0; right: 0; bottom: 116px; z-index: 199; width: auto; margin: 0; padding: 0 12px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .hints::-webkit-scrollbar { display: none; }
  .hints button { flex: none; box-shadow: 0 1px 6px rgba(20, 40, 60, .08); }
  /* r37: 고치기 글자 단추 — 글 왼쪽 끝이 대화 글과 같은 줄(16px)에 오게(대화 중의 것과 같은 값) */
  #main:not(:has(#vers:empty)) .hints { padding: 0 6px; }
  /* 결과가 있는 빈 대화: 예시 칩도 흰 받침 위에 놓이게 받침·아래 여백을 칩 높이만큼 키운다(조절·메모를 펼쳐 화면이 길어져도 칩이 글 위에 뜨지 않게) */
  body:has(#main:not(:has(#vers:empty)) #chatLog:empty) { padding-bottom: 176px; }
  body:has(#main:not(:has(#vers:empty)) #chatLog:empty)::after { height: 176px; }
  body:has(#main:not(:has(#vers:empty)) #chatLog:empty) #main { min-height: calc(100vh - 176px); }
  /* 대화 중의 고치기용 예시(body.fixhint): 같은 자리(입력칸 바로 위) · 같은 받침 높이. 아래 여백은 받침보다 8px 더 — 끝 답의 칩 줄이 받침의 옅어지는 띠에 닿지 않게 */
  /* r35: 넓은 화면과 같은 모양(선·그림자 없는 13px 옅은 글자 단추 — 글 왼쪽 끝 16px = 대화 글과 같은 줄) · 쪽이 맨 아래일 때만(body.hintend). 아래 여백(자리)은 fixhint 만 정한다 — 보였다 숨어도 쪽 길이는 그대로 */
  body.fixhint.hintend #chatLog:not(:empty) ~ .hints { display: flex; gap: 4px; padding: 0 6px; }
  body.fixhint #chatLog:not(:empty) ~ .hints button { height: 32px; padding: 0 10px; border-color: transparent; background: transparent; box-shadow: none; color: var(--ink); }
  body.fixhint { padding-bottom: 184px; }
  body.fixhint.hintend::after { height: 176px; }
  body.fixhint #main { min-height: calc(100vh - 184px); }
  /* '사진으로 만들기' 칩은 한 줄에 다 들어가는 넓은 화면에서만(좁은 화면은 클립 단추로) */
  .hints button[data-photo] { display: none; }
  .composer:has(textarea:not(:placeholder-shown)) ~ .hints, .hints:has(~ .composer textarea:not(:placeholder-shown)) { display: none; }
  /* 빈 대화의 인사말은 첫 화면(#empty)과 같은 자리 */
  .right:has(#chatLog:empty) { min-height: calc(100vh - 52px - 130px); justify-content: center; padding: 0; }
  /* 결과가 이미 있으면 영상 → (남는 자리 가운데에 작은 안내 한 줄) → 예시 · 입력칸 */
  #main:not(:has(#vers:empty)) .right:has(#chatLog:empty) { min-height: 96px; padding-bottom: 36px; }
  #main:not(:has(#vers:empty)) .right:has(#chatLog:empty) #chatLog { padding: 0; }
  /* 알림은 제목 줄 아래 */
  #toast { top: 60px; right: auto; left: 50%; transform: translateX(-50%); width: max-content; }
  body.offline #toast { top: 98px; }
  .chatlog:empty::before { font-size: 24px; }
  .emptytext b { font-size: 24px; }
}
/* ── r38 태블릿(601~900): 짜임은 좁은 화면 그대로(결과 → 대화, 입력칸 아래 고정)인데 내용은 640px 기둥 하나로 가운데에 — 결과 줄·영상·재생 줄·조절·대화·입력칸·고치기 낱말이 모두 같은 두 줄(왼쪽·오른쪽 끝)에 선다.
   전에는 휴대폰 화면이 그대로 늘어났다(768: 영상 736×414 · 글 한 줄 50자 · 입력칸이 끝에서 끝). 672px 밑으로는 양옆 16px 가 남아 휴대폰과 같다 ── */
@media (min-width: 601px) and (max-width: 900px) {
  .work, .hints { --tm: max(16px, calc((100% - 640px) / 2)); }
  .left > :not(.stage), .stagecol > * { margin-left: var(--tm); margin-right: var(--tm); }
  .viewer { max-width: min(640px, calc(100% - 32px)); }
  .stagecol > .viewer.stick ~ .vfade { margin-left: calc(var(--tm) - 6px); margin-right: calc(var(--tm) - 6px); }
  .chatlog { padding-left: var(--tm); padding-right: var(--tm); }
  .composer { left: 0; right: 0; width: min(640px, calc(100% - 24px)); margin: 0 auto !important; }
  .hints { padding: 0 var(--tm); }
  #main:not(:has(#vers:empty)) .hints, body.fixhint.hintend #chatLog:not(:empty) ~ .hints { padding: 0 calc(var(--tm) - 10px); }
  /* 첫 화면 · 새 프로젝트(결과 없는 빈 대화)는 넓은 화면 짜임 — 인사말 밑에 입력칸, 그 밑에 예시 칩 가운데(전에는 제목만 가운데 · 입력칸은 바닥 끝에서 끝 · 칩은 왼쪽 구석) */
  #empty { min-height: calc(100vh - 52px - 130px); padding-bottom: 10vh; }
  #home .composer, #main:has(#vers:empty) .right:has(#chatLog:empty) .composer { position: relative; left: auto; right: auto; bottom: auto; z-index: auto; width: min(640px, calc(100% - 40px)); margin: 0 auto 16px !important; box-shadow: var(--lift); }
  #homeHints, #main:has(#vers:empty) .right:has(#chatLog:empty) .hints { position: static; width: min(640px, calc(100% - 40px)); margin: 0 auto; padding: 0; flex-wrap: wrap; justify-content: center; overflow: visible; }
  #homeHints button, #main:has(#vers:empty) .right:has(#chatLog:empty) .hints button { box-shadow: none; }
  #main:has(#vers:empty) .right:has(#chatLog:empty) { padding-bottom: 10vh; }
}
/* 손가락으로 쓰는 화면(hover 없음)에는 키보드 안내를 보이지 않는다 */
@media (hover: none) { #helpItem { display: none; } }

/* ── r39 ── */
/* ⋯ 메뉴: 자리는 접힌 높이로 잡고(app.js placeMenu) '전문가용' 은 메뉴 왼쪽 옆 칸으로 연다(.fly — 넓은 화면에서 옆 자리가 있을 때만 app.js 가 붙인다).
   메뉴 본체는 펴고 접어도 자리·높이가 그대로다. 옆 칸의 위 끝·높이 한도는 app.js flyPlace 가 누른 줄 높이에 맞춘다. .fly 가 없으면(좁은 화면 등) 전처럼 제자리에서 아래로 편다 */
.morebox.pop.fly { overflow: visible; }
.morebox.fly details.adv > summary::after, .morebox.fly details.adv[open] > summary::after { margin-top: 0; transform: rotate(-45deg); }
.morebox.fly details.adv[open] > summary { background: var(--hover); color: var(--text); }
.morebox.fly .advbox { position: absolute; right: calc(100% + 4px); top: 0; width: 240px; padding: 8px; overflow-y: auto; scrollbar-width: thin; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow); }
/* 좁은 화면: 편 메뉴의 맨 아래 줄('대화 지우기')이 고정 입력칸 위 옅어지는 띠(z 198)에 씻겨 반쯤 지워져 보였다 — 메뉴를 띠·입력칸보다 위에 */
@media (max-width: 900px) { .morebox.pop { z-index: 210; } }
/* 왼쪽 목록의 스크롤 손잡이도 대화 칸과 같은 규칙: 평소 투명 · 목록에 마우스를 올렸거나 스크롤 중(.scrolling — app.js)일 때만 --line2 6px. 세모 단추 없음 */
#projList { scrollbar-color: transparent transparent; }
#projList:hover, #projList.scrolling { scrollbar-color: var(--line2) transparent; }
@supports selector(::-webkit-scrollbar) {
  #projList, #projList:hover, #projList.scrolling { scrollbar-width: auto; scrollbar-color: auto; }
  #projList::-webkit-scrollbar { width: 8px; }
  #projList::-webkit-scrollbar-track { background: transparent; }
  #projList::-webkit-scrollbar-thumb { background: transparent; border: 1px solid transparent; background-clip: padding-box; border-radius: 4px; }
  #projList:hover::-webkit-scrollbar-thumb, #projList.scrolling::-webkit-scrollbar-thumb { background-color: var(--line2); }
  #projList::-webkit-scrollbar-thumb:hover, #projList::-webkit-scrollbar-thumb:active { background-color: var(--ph); }
  #projList::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}
/* 901~1100px(눕힌 태블릿 · 작은 노트북): 목록을 접은 채 시작한다(app.js sideSync — ☰ 로 편다). 첫 화면에서도 접히고 ☰ 가 보인다 */
@media (min-width: 901px) and (max-width: 1100px) {
  body.sideOpen #side { margin-left: -220px; }
  body.noproj #sideToggle { visibility: visible; }
}
/* 손가락으로 쓰는 화면: '전체 화면' 상자는 영상을 눌렀을 때만 3초(.tapped — app.js). 전에는 쪽을 내리기만 해도(붙은 hover) 영상 귀퉁이에 상자가 나타났다. 안 보이는 동안에는 눌리지도 않는다 */
@media (hover: none) {
  .viewer:hover .ovl { opacity: 0; }
  .viewer .ovl { pointer-events: none; }
  .viewer.tapped .ovl, .viewer .ovl:focus-visible { opacity: 1; pointer-events: auto; }
}
/* 첫 화면 한 줄 설명이 좁은 화면에서 두 줄이 될 때 줄 길이를 고르게(가운뎃점만 줄 끝에 남지 않게) */
.emptytext span { text-wrap: balance; }
@media (max-width: 900px) { .quotaline { margin: 0 auto; text-align: center; } } /* r16: 좁은 화면은 입력칸이 바닥에 붙어 있어 인사말 아래 가운데에 남긴다 */
/* r27 입력 이미지 여러 장 — 사진 카드: 같이 쓰는 순서 번호(2장 이상일 때만) · [+] 같이 쓰기(고른 사진이 있을 때 다른 카드에). 결과 밑 '쓴 사진' 한 줄(2장 이상 쓴 결과만) */
.card .ord { position: absolute; right: 5px; top: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--sel); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.card.also { outline-style: dashed; }
.card .addm { position: absolute; right: 5px; bottom: 5px; height: 22px; padding: 0 8px; border: 0; border-radius: var(--pill); background: rgba(255, 255, 255, .94); color: var(--ink); font-size: 11px; font-weight: 600; line-height: 22px; text-align: center; white-space: nowrap; box-shadow: 0 1px 3px rgba(20, 40, 60, .25); opacity: .88; transition: opacity .12s; }
.card:hover .addm, .card:focus-within .addm, .card .addm:focus-visible { opacity: 1; }
.card .addm:hover { background: var(--tint); }
.imgsused:not([hidden]) { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; flex-wrap: wrap; }
@media (max-width: 900px) { .imgsused:not([hidden]) { margin: 8px 16px 0; } } /* 좁은 화면: 조작 줄과 같은 왼쪽 여백 */
.imgsused .iu-h { font-size: var(--f3); color: var(--muted); margin-right: 2px; }
.imgsused .iu { position: relative; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; background: var(--sel-bg); cursor: zoom-in; }
.imgsused .iu img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgsused .iu .gone { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--sel-bg) 0 4px, #fff 4px 8px); }
.imgsused .iu b { position: absolute; right: 2px; bottom: 2px; min-width: 13px; padding: 0 3px; border-radius: 4px; background: rgba(20, 30, 40, .7); color: #fff; font-size: 10px; font-weight: 700; line-height: 13px; text-align: center; }
/* ---- r31(실사용4) ---- */
/* 요금 안내 — 표 하나. 좁은 화면에서도 가로로 밀지 않게 마지막 칸이 줄을 바꾼다 */
.plansdlg { width: min(720px, calc(100vw - 32px)); }
.planswrap { overflow-x: auto; }
.planstable { width: 100%; border-collapse: collapse; font-size: var(--f3); line-height: 1.5; font-variant-numeric: tabular-nums; }
.planstable th, .planstable td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-weight: 400; }
.planstable thead th { color: var(--muted); font-size: 12px; white-space: nowrap; }
.planstable tbody th { font-weight: 600; white-space: nowrap; }
.planstable td:nth-child(2), .planstable td:nth-child(3) { white-space: nowrap; }
.planstable td:last-child { color: var(--muted); }
.planstable tr.mine th, .planstable tr.mine td { background: var(--tint); }
.planstable tbody th small { margin-left: 6px; font-weight: 400; color: var(--ink); }
.plansdlg a.btnlike { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--pill); color: var(--ink); text-decoration: none; font-size: var(--f3); }
.plansdlg a.btnlike[hidden], #plansSoon[hidden] { display: none; }
/* 좁은 화면: 한 단계 = 두 줄(이름 · 값 · 크레딧 / 쓸 수 있는 것) — 네 칸 표는 마지막 칸이 다섯 줄로 꺾였다 */
@media (max-width: 600px) {
  .planstable thead { display: none; }
  .planstable tbody tr { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 14px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .planstable tbody th, .planstable tbody td { padding: 0; border: 0; background: none; }
  .planstable tr.mine { background: var(--tint); }
  .planstable td:nth-child(3)::after { content: ' 크레딧'; color: var(--muted); }
  .planstable td:last-child { grid-column: 1 / -1; font-size: 12px; }
}
/* [요금 안내] 글자 단추 — 크레딧 줄 · 내 계정의 단계 줄 */
button.link.plansgo { height: auto; padding: 0; margin-left: 6px; font-size: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.acctfacts dd button.plansgo { font-size: var(--f3); }
/* R11 결제 — 요금표 아래 [시작하기]·[충전하기] · 고지 목록 · 동의 칸 · 계정 창의 결제 덩어리 */
.plansbuy { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.paysplit { display: block; color: var(--muted); }
.paynotice { margin: 12px 0; padding-left: 18px; font-size: var(--f3); line-height: 1.6; color: var(--ink); }
.paynotice li + li { margin-top: 4px; }
.paycheck, .payphone { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: var(--f2); }
.payphone { flex-wrap: wrap; }
.payphone small { color: var(--muted); }
.payphone input { flex: 1 1 160px; min-width: 0; }
.acctpay { margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--line, #e3e3e3); font-size: var(--f2); }
.acctpay .row { gap: 10px; flex-wrap: wrap; }
.paysub { margin: 6px 0; }
.paysub small { margin-left: 6px; color: var(--muted); }
.payreceipts { margin: 4px 0 8px; padding-left: 18px; font-size: var(--f3); }
.acctpay textarea { width: 100%; box-sizing: border-box; }
/* 깨진 결과 판(공개 서버): 쉬운 말 한 줄 + [다시 만들기], 자세한 글은 접어 둔다 */
#glErr.easy { font: inherit; font-size: var(--f3); background: rgba(22, 30, 40, .9); color: #fff; }
#glErr.easy.over { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
#glErr.easy .easyrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
#glErr.easy .easyrow b { font-size: var(--f2); font-weight: 600; }
#glErr.easy .easymore { max-width: 100%; color: #c9d3de; font: 12px/1.5 Consolas, monospace; text-align: left; }
#glErr.easy .easymore > summary { font-family: system-ui, sans-serif; font-size: 12px; text-align: center; color: #c9d3de; cursor: pointer; list-style: none; }
#glErr.easy .easymore > summary::-webkit-details-marker { display: none; }
#glErr.easy .easymore[open] { align-self: stretch; overflow: auto; }
/* 사업자 정보: 넓은 화면은 늘 펴 둔다(제목 줄 숨김) · 좁은 화면은 접어 둔다. 항목은 중간에서 줄이 바뀌지 않는다 */
.bizfoot details.biz > summary { display: none; }
.bizfoot details.biz span { white-space: nowrap; }
@media (max-width: 900px) {
  .bizfoot details.biz > summary { display: inline-block; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; list-style: none; padding: 8px 8px; pointer-events: auto; }
  .bizfoot details.biz > summary::-webkit-details-marker { display: none; }
  .bizfoot .links { display: inline; }
  .bizfoot .links a { display: inline-block; padding: 8px 2px; }
  .bizfoot details.biz { display: inline; }
  .bizfoot details.biz[open] { display: block; }
  /* 첫 화면: 크레딧 줄은 입력칸(예시 칩) 바로 위에 붙이고, 약관·사업자 줄은 그 위에 — 입력칸 밑에 깔리지 않는다 */
  #home .quotaline { position: fixed; left: 12px; right: 12px; bottom: 156px; z-index: 199; width: auto; margin: 0; padding: 0; text-align: center; }
  #home:has(textarea:not(:placeholder-shown)) .quotaline { bottom: 116px; }
  #homeFoot { position: fixed; bottom: 202px; z-index: 198; padding: 0 12px; background: #fff; } /* 크레딧 줄이 두 줄이 돼도(모자랄 때) 겹치지 않는 높이 */
}

/* ===== R5(출시 화면) — 동의 칸 · 사람 확인 · 공지 띠 · 처음 안내 · 크레딧 표시 · 요금 v2 · 겹 길 · 접근성 · 390 폭 ===== */
/* 화면 낭독기만 읽는 칸(Q11) */
.sronly { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* 공지 띠(D5) — 끊김 띠와 같은 자리 · 옅은 하늘. 끊김 띠가 뜨면 그쪽이 위 */
.noticebar { position: fixed; top: 0; left: 0; right: 0; z-index: 990; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 4px 8px 4px 16px; background: var(--tint2); color: var(--text); font-size: var(--f3); text-align: center; }
.noticebar #noticeText { flex: 0 1 auto; min-width: 0; }
.noticebar button.icon { width: 28px; height: 28px; flex: none; }
body.hasnotice { padding-top: 36px; }
body.hasnotice.offline { padding-top: 38px; }
/* 동의 칸(P3·P4·P5): [모두 동의] 한 줄 + 하나씩 세 줄(안으로 조금 들임) */
.authagrees { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r2); background: var(--side); }
.authagrees .authagree.all { font-weight: 600; color: var(--text); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.authagrees .authagree.sub { padding-left: 4px; }
.authagrees .authagree small { margin-left: 4px; color: var(--ink); font-size: 12px; }
.authagrees .authagree input { width: 18px; height: 18px; accent-color: var(--btn); }
/* 사람 확인 자리(S56) — 위젯 높이(65)를 미리 잡아 둔다 */
.authbot { display: flex; justify-content: center; min-height: 65px; }
/* 처음 안내(D1) — 인사말 아래 작은 세 걸음 한 줄 */
.homeguide { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; width: min(var(--col), calc(100% - 40px)); margin: 0 auto 12px; font-size: var(--f3); color: var(--muted); }
.homeguide ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
.homeguide li { display: inline-flex; align-items: center; gap: 6px; }
.homeguide li b { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--tint); color: var(--ink); font-size: 12px; font-weight: 600; }
.homeguide button.link { color: var(--ink); padding: 6px 4px; }
/* 크레딧(v2 §6): 위쪽 줄 숫자(좁은 화면만) · 작품에 쓴 양 · 내 계정의 막대 */
.topcr { display: none; height: 32px; padding: 0 12px; font-size: var(--f3); color: var(--muted); font-variant-numeric: tabular-nums; background: var(--side); border-color: transparent; }
@media (max-width: 900px) { .topcr:not([hidden]) { display: inline-flex; align-items: center; } }
.pspent { flex: none; font-size: var(--f3); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { .pspent { display: none; } }
.crbar { display: flex; width: 100%; max-width: 260px; height: 6px; margin-top: 6px; border-radius: var(--pill); background: var(--track); overflow: hidden; }
.crbar .sub { background: var(--btn); }
.crbar .top { background: var(--accent); }
.acctfacts dd .crsplit { display: block; margin: 4px 0 0; }
#acctExportMsg:empty { display: none; }
/* 요금 v2: 매달 / 1년 · 원 / 달러 두 토막 단추 */
.planstog { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.planstog .seg { display: inline-flex; padding: 2px; border-radius: var(--pill); background: var(--side); border: 1px solid var(--line); }
.planstog .seg button { height: 30px; padding: 0 14px; border: 0; background: transparent; font-size: var(--f3); color: var(--muted); }
.planstog .seg button[aria-pressed="true"] { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 40, 60, .12); }
.planstog .seg button small { margin-left: 4px; color: var(--ink); font-weight: 600; }
.planstable td small { display: block; margin: 0; color: var(--muted); font-size: 12px; }
.planstop { font-size: var(--f3); }
.planstop ul { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.planstop li.muted { flex-basis: 100%; font-size: 12px; }
/* 겹 길(#37): 고른 사진 한 줄 · 여러 장 겹 창 · 올리기 권리 줄(P17) */
.layernote { margin: 6px 2px 0; font-size: var(--f3); line-height: 1.45; color: var(--muted); }
.layernote.ok { color: var(--ok); }
.layernote.warn { color: var(--warn); }
.rightsline { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }
.rightsline a { margin-left: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.stackgrid { max-height: 50vh; }
.stackgrid .card { padding: 0; border: 0; border-radius: var(--r1); }
.stackgrid .card.sel { outline-color: var(--btn); }
.stackgrid .card .ord { position: absolute; left: 6px; top: 6px; padding: 1px 8px; border-radius: var(--pill); background: var(--btn); color: #fff; font-size: 12px; font-weight: 600; }
/* 받기 창 한 줄(P19) · 실패의 [다시 받기](Q17) */
.vidai { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .vidsumrow { flex-wrap: wrap; } .vidai { white-space: normal; } }
#vidMsg button.vidretry { margin-left: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
/* 지운 프로젝트의 영구 삭제(P8) */
.trashlist button.link.danger { color: var(--bad); }
.trashlist li.trashall { justify-content: flex-end; }
/* Q6(390 폭 A6): 손가락으로 누르는 작은 것 — 보이는 크기는 그대로 두고 누르는 자리만 넓힌다(옆 것과 겹치지 않는 만큼) · 링크 줄은 높이를 늘린다 */
@media (max-width: 900px) {
  .card .addm { height: 28px; line-height: 28px; padding: 0 10px; font-size: 12px; }
  .vers button { position: relative; }
  .vers button::after { content: ''; position: absolute; inset: -8px -2px; }
  .vidpanel button.link, .vidpanel .gridrow button.link, .vidpanel #vidShape { min-height: 36px; padding: 6px 0; }
  .authagrees .authagree { min-height: 32px; align-items: center; }
  .authnote button.link, .authmore button.link { min-height: 36px; padding: 6px 4px; }
  .rightsline a { display: inline-block; padding: 8px 2px; }
  button.link.plansgo { position: relative; }
  button.link.plansgo::after { content: ''; position: absolute; inset: -12px -4px; }
}

/* 출시 R12(S15): 2단계 인증 — 계정 창 한 줄 · #dlgTotp(인증 앱 그림 · 직접 넣는 키 · 복구 번호) */
.accttotp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; font-size: 13px; }
.accttotp .acctnote { margin: 0; }
.totpdlg { max-width: 380px; }
.totpstep { white-space: pre-line; font-size: 13.5px; line-height: 1.55; margin: 4px 0 10px; }
.totpqr { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 10px; }
.totpqr canvas { width: 196px; height: 196px; image-rendering: pixelated; background: #fff; border-radius: 6px; }
.totpkey { font-size: 12px; color: var(--muted); text-align: center; margin: 0; word-break: break-all; }
.totpkeyv { font-family: ui-monospace, Consolas, monospace; color: var(--ink); letter-spacing: .04em; user-select: all; }
.totprec { columns: 2; font-family: ui-monospace, Consolas, monospace; font-size: 14px; margin: 4px 0 10px; padding-left: 22px; }
.totprec li { margin: 2px 0; }

/* 출시 R15: 움직임 틀 창(web/template.js) — 왼쪽 미리보기 · 오른쪽 틀 목록 */
.tpwrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.tpview canvas { display: block; width: 100%; height: auto; background: #0d1014; border-radius: var(--r1); }
.tpview p { margin: 8px 0 0; font-size: var(--f3); min-height: 1.4em; }
.tpknobs { display: grid; gap: 6px; margin-top: 10px; }
.tpknobs label { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); align-items: center; gap: 8px; flex-direction: row; }
.tpknobs input { width: 100%; accent-color: var(--accent); }
.tplist { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow-x: hidden; overflow-y: auto; }
.tpitem { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 12px; border: 1px solid var(--line2); border-radius: var(--r1); background: #fff; text-align: left; height: auto; white-space: normal; flex: none; }
.tpitem b { font-weight: 600; font-size: var(--f3); }
.tpitem span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.tpitem[aria-pressed="true"] { border-color: var(--accent); background: var(--tint, #eef6fd); }
.tpitem:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 700px) { .tpwrap { grid-template-columns: minmax(0, 1fr); } .tplist { max-height: 260px; } }

/* ===== R18(QA_0530 — 새 사용자 흐름 QA) ===== */
/* #4 결제 전 고지 창: 휴대폰 칸 · 동의 칸은 가로 한 줄(.dlg label 의 세로 쌓기를 이긴다) · 고지 글은 본문 색 · 창 안이 길면 고지 목록만 내려 보고 [결제하기] 줄은 늘 보인다 */
dialog#dlgPay { max-height: calc(100dvh - 24px); }
.paydlg { max-height: calc(100dvh - 24px); box-sizing: border-box; gap: 12px; }
.paydlg .acctfacts { flex: none; }
.paydlg .paynotice { flex: 0 1 auto; min-height: 72px; overflow-y: auto; margin: 0; color: var(--text); }
.paydlg label.payphone, .paydlg label.paycheck { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--text); font-size: var(--f2); }
.paydlg label.payphone small { flex: 1 1 auto; }
.paydlg label.payphone input { flex: 1 0 100%; height: 44px; border-radius: var(--pill); padding: 0 16px; }
.paydlg label.paycheck { min-height: 44px; cursor: pointer; }
.paydlg label.paycheck input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--btn); }
.paydlg > .row { flex: none; flex-wrap: wrap; row-gap: 8px; }
.paydlg #payMsg { flex-basis: 100%; }
/* #5 · #6 요금표의 한 줄 안내(바꿀 수 없는 결제 · 수업 기간 단계) */
.paynote { margin: 0; flex-basis: 100%; font-size: var(--f3); line-height: 1.55; color: var(--text); }
.paynote button.link { font-size: inherit; }
/* #2 누구나 가입 서버의 [초대 코드가 있어요] */
.authcodeopen { margin: -4px 0 0; text-align: left; }
/* #14 복구 번호 옮겨 두기 */
.totprecacts { gap: 8px; margin: -4px 0 6px; }
/* #16 빈 보내기 단추의 크레딧 숫자 — 옅은 단추 위에서 읽히게 */
.composer .send.empty .sendcr { color: var(--muted); }
/* #17 키보드 초점 — 프로젝트 이름 칸 · 조절 막대 */
#pName:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.knob input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
/* #18 영상 받기 창 요약 줄 — 'AI 로 만든…' 이 옆에 끼어 요약이 '영상 파일 ·' 에서 끊기지 않게(자리가 모자라면 아래 줄로) */
.vidsumrow { flex-wrap: wrap; }
.vidsum { flex: 1 0 auto; }
/* #15 손가락으로 누르는 곳 44px — 결제 동의 · 가입 동의 · 계정 창의 [켜기]·[충전]·[요금 안내] · 아래 약관 줄 */
@media (max-width: 900px), (pointer: coarse) {
  .authagrees .authagree { min-height: 44px; }
  .authagrees .authagree input { width: 22px; height: 22px; }
  .acctfacts dd button.link, .accttotp button, #acctTotpGo { min-height: 44px; min-width: 44px; padding: 0 8px; }
  button.link.plansgo { min-height: 44px; padding: 0 6px; margin-left: 2px; }
  button.link.plansgo::after { content: none; }
  .authcodeopen button.link, .totprecacts button { min-height: 44px; }
}
