/* 콘티 메이커 — 라이트 · 절제된 애플풍 */

/* 앱에 동봉된 폰트 (외부 요청 없음 — fonts/ 폴더에서 로드)
   본문 = Cafe24 PRO Slim(Air 보통·Max 굵게), 브랜드·제목 = Cafe24 Ssurround Air(둥근 제목체),
   말풍선·나레이션 = 나눔바른펜(웹툰 대사 느낌). Pretendard는 예비용 폴백. */
@font-face {
  font-family: "Cafe24PROSlim";
  src: url("../fonts/Cafe24PROSlimAir.woff2") format("woff2");
  font-weight: 300 500;
  font-display: swap;
}
@font-face {
  font-family: "Cafe24PROSlim";
  src: url("../fonts/Cafe24PROSlimMax.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: "Cafe24SsurroundAir";
  src: url("../fonts/Cafe24SsurroundAir.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "NanumBarunpen";
  src: url("../fonts/NanumBarunpenR.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "NanumBarunpen";
  src: url("../fonts/NanumBarunpenB.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Pretendard";
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --line: #e2e2e7;
  --text: #1d1d1f;
  --text-2: #515154;  /* 보조 본문 — 라벨·설명 */
  --text-3: #6e6e73;  /* 3차 — 힌트·비활성 느낌 */
  --muted: #86868b;
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --danger: #d92d20;
  --success: #2f7d32;
  --warning: #8a6400;
  --radius: 14px;
  --radius-btn: 10px; /* 버튼은 둥근 사각형 — 알약(980px)은 상태 칩·토글·스테퍼에만 */
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.06);
}

html, body { height: 100%; }

/* 서체 위계 — 잘 보여야 하는 본문은 Pretendard, 브랜드·제목은 Ssurround Air,
   잘 안 보여도 되는 보조 정보(크레딧·저장 상태 등)만 슬림체 */
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 버튼 4단계 — primary(파란 채움) / 기본=secondary(테두리) / ghost(회색 글자) / danger(빨간 글자·채움)
   강조 파랑은 primary와 선택 상태에만 쓴다. */
button {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: 7px 15px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
button:hover { background: #f2f2f5; }
button:active { transform: scale(.98); }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
button.primary:hover { background: #0077ed; }
button.big { padding: 11px 24px; font-size: 15px; }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: rgba(0,0,0,.05); color: var(--text); }
button.danger { color: var(--danger); }
button.danger.filled { background: var(--danger); color: #fff; border-color: transparent; font-weight: 600; }
button.mini { padding: 3px 10px; font-size: 12px; }
/* 같은 "삭제"가 화면마다 색이 달라지지 않게 — 위험 색이 항상 이긴다 */
button.ghost.cc-del, .sp-head .cc-del, button.ghost.danger { color: var(--danger); }
button.ghost.cc-del:hover, button.ghost.danger:hover { background: rgba(217,45,32,.08); color: var(--danger); }

input, textarea, select {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,.15);
}
/* 브라우저 기본 셀렉트 화살표 대신 통일된 셰브런 (인라인 SVG — 외부 요청 없음) */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6e73' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}

.muted { color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.lead { color: var(--muted); font-size: 15px; }
.badge {
  background: #fff3d6; color: #8a6400;
  font-size: 11px; padding: 2px 8px; border-radius: 10px; vertical-align: 1px;
}

/* ─── 상단 바 ─── */

#topbar {
  display: flex; align-items: center; gap: 10px;
  /* 좌우 여백 = 가운데 작업 공간 박스의 가장자리 — 로고 박스·환경설정 박스가 박스 선과 한 줄 */
  padding: 12px var(--ws-edge, 18px) 0;
  background: transparent; /* 흰 바 대신, 아래 알약 박스들이 결을 만든다 */
  z-index: 10;
}
/* 헤더 박스 — 작업 공간 박스와 같은 결의 둥근 사각형 (흰 배경 + 흐림 + 은은한 그림자) */
.hdr-box {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 5px 9px 5px 16px;
  box-shadow: 0 8px 26px rgba(0,0,0,.08);
}
/* 브랜드 로고 — 콘팁 심볼 + 한글 워드마크 이미지 */
.logo { font-family: "Cafe24SsurroundAir", "Pretendard", sans-serif; display: inline-flex; align-items: center; gap: 7px; }
.logo .logo-sym { height: 22px; width: auto; display: block; }
.logo .logo-kr { height: 15px; width: auto; display: block; }
/* 헤더 글씨는 프리텐다드 하나로 통일 — 위계는 서체가 아니라 크기·굵기·색으로만.
   (보조 정보에 슬림체를 섞었더니 한 박스 안에서 중구난방으로 보여 철회) */
.credit-bal { font-size: 12px; color: var(--text-3); white-space: nowrap; letter-spacing: .2px; }
.logo { font-size: 15px; letter-spacing: .5px; color: var(--muted); }
.logo b { color: var(--text); font-weight: 700; }
/* 프로젝트 전환기(보조) vs 작품 제목(주) — 위계를 분리 */
.proj-group { display: flex; align-items: center; gap: 2px; }
.proj-label { font-size: 12px; color: var(--text-3); }
.vline { width: 1px; height: 16px; background: var(--line); }
#projTitle {
  width: 250px; font-weight: 600; font-size: 15px;
  padding: 6px 10px; /* 전역 input 패딩(9px)보다 얕게 — 좌우 알약과 스테퍼 높이를 맞춘다 */
  border-color: transparent; background: transparent;
  text-overflow: ellipsis;
}
#projTitle:hover { background: #f2f2f5; }
#projTitle:focus { background: #f2f2f5; }
/* 저장 상태 — 점 색으로 상태 표시. 비어 있을 땐(첫 화면) 자리도 차지하지 않는다 */
#saveState:empty { display: none; }
.save-state { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d6d6dc; }
.save-state.saving::before { background: var(--warning); }
.save-state.saved::before { background: var(--success); }
.save-state.failed::before { background: var(--danger); }

/* 단계 스테퍼 — 화면 정중앙, 활성 공간 박스의 위 모서리에 얹혀 함께 다니는 알약.
   활성 단계의 파란 채움이 박스 안 파란 공간 이름과 이어져 "이 박스가 이 단계"로 읽힌다. */
#stepper {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 32;
  display: flex; gap: 3px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 4px;
  box-shadow: 0 8px 26px rgba(0,0,0,.12);
}
#stepper button {
  border: none; background: transparent; border-radius: 9px;
  padding: 7px 18px; font-size: 13.5px; color: var(--text-3);
  display: flex; align-items: center; gap: 7px;
}
#stepper button i {
  font-style: normal; font-size: 11px; font-weight: 700;
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #d6d6dc; color: #fff;
}
#stepper button.on { background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(0,113,227,.35); }
#stepper button.on i { background: #fff; color: var(--accent); }
#stepper button:disabled { opacity: .45; }

/* ─── 뷰 공통 ─── */

/* ─── 작업 공간 캐러셀 ───
   세 공간(원고·그림 콘티·설정)이 가로로 이어진 하나의 제작 흐름.
   활성 공간이 가운데로 오고, 옆 공간은 살짝 작고 흐리게 — 클릭하면 슬라이드해 온다. */
main#carousel {
  flex: 1; min-height: 0;
  position: relative; overflow: hidden;
}
#carTrack {
  display: flex; gap: 24px; height: 100%;
  padding: 34px 0 18px; /* 위 여백 = 스테퍼 알약이 박스 위 모서리에 걸쳐 앉는 자리 */
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.workspace {
  flex: 0 0 auto; min-height: 0;
  background: var(--card); border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: opacity .55s, transform .55s cubic-bezier(.22, 1, .36, 1);
}
.workspace:not(.active) {
  opacity: .5;
  transform: scale(.955);
  cursor: pointer;
}
.workspace:not(.active):hover { opacity: .68; }
.workspace:not(.active) > * { pointer-events: none; } /* 옆 공간은 클릭 = 이동 */

/* 옆 공간 이름표 — 살짝 보이는 쪽 모서리에 세로로, 여기가 어느 공간인지 바로 읽힌다.
   side-* 클래스는 JS(layoutCarousel)가 부여 — 첫 렌더 전에는 이름표가 아예 안 뜬다(오위치 플래시 방지) */
.workspace.side-left::after, .workspace.side-right::after {
  content: attr(data-label);
  position: absolute; z-index: 6;
  writing-mode: vertical-rl; letter-spacing: 3px;
  font-family: "Cafe24SsurroundAir", "Pretendard", sans-serif;
  font-size: 16px; font-weight: 800; color: var(--accent);
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 11px;
  box-shadow: 0 6px 22px rgba(0,0,0,.10);
  pointer-events: none;
  bottom: calc(50% + 46px); /* 가운데의 ‹ › 원형 버튼 위에 세로로 나란히 */
}
.workspace.side-left::after { right: 26px; }
.workspace.side-right::after { left: 26px; }
.workspace:not(.active):hover::after { color: #005bb5; border-color: var(--accent); }
/* 옆 공간이 너무 얇게 보이는 창에선 잘린 알약 대신 숨김 (layoutCarousel이 판정) */
#carousel.no-side-label .workspace::after { display: none; }

/* 좌우 이동 버튼 — 레퍼런스의 ‹ › 원형 버튼 */
.car-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 30;
  width: 46px; height: 46px; border-radius: 50%; padding: 0;
  font-size: 24px; line-height: 1; color: var(--text-2);
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(0,0,0,.14);
  display: flex; align-items: center; justify-content: center;
}
.car-nav:hover { background: #fff; color: var(--accent); border-color: var(--accent); }
#carPrev { left: 22px; }
#carNext { right: 22px; }
.car-nav[hidden] { display: none; }

/* 작업 공간 이름 — 레퍼런스처럼 파란 강조, 브랜드 제목체 */
.ws-name { color: var(--accent); font-weight: 800; font-family: "Cafe24SsurroundAir", "Pretendard", sans-serif; }
.ws-eyebrow { color: var(--accent); font-weight: 800; font-size: 14px; letter-spacing: .3px; font-family: "Cafe24SsurroundAir", "Pretendard", sans-serif; }
/* 큰 제목·단계 이동도 브랜드 제목체로 통일 */
.stage-card h1, .script-head h1, .empty-guide h2, #stepper button {
  font-family: "Cafe24SsurroundAir", "Pretendard", sans-serif;
}

/* ─── ① 원고 — 원고지처럼 읽기 좋은 가운데 단 ─── */

#viewSource { padding: 34px 38px 26px; }
.stage-card {
  width: 100%; max-width: 880px; margin: 0 auto;
  height: 100%; min-height: 0;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.stage-card h1 { font-size: 29px; font-weight: 800; letter-spacing: -.6px; margin-top: 2px; min-height: 1.25em; }
/* 타이핑 애니메이션 — 글자가 바뀌는 자리 공통, 깜빡이는 캐럿 */
.typing::after {
  content: ""; display: inline-block;
  width: 2px; height: .95em; margin-left: 4px; vertical-align: -.08em;
  background: var(--accent);
  animation: caret-blink .75s step-end infinite;
}
.stage-card h1.typing::after { width: 3px; margin-left: 5px; }
@keyframes caret-blink { 50% { opacity: 0; } }
.stage-card .lead { font-size: 15px; color: var(--text-3); line-height: 1.7; margin-bottom: 4px; }
#source {
  flex: 1; min-height: 200px; resize: none;
  font-size: 15.5px; line-height: 1.95; letter-spacing: -.1px; color: var(--text);
  padding: 20px 24px; border-radius: 12px;
  background: #fcfcfd;
}
#source:focus { background: #fff; }
#source::placeholder, .row input::placeholder { color: #a8a8ae; }
.row { display: flex; gap: 10px; }
.row > input { flex: 1; }
.cta-row { display: flex; align-items: center; gap: 10px; }
.status-line { color: var(--accent); font-size: 13px; }
#adaptEst { font-size: 12.5px; white-space: nowrap; }

/* ─── ③ 설정(컷 구성) — 구 글 콘티 ─── */

#viewScript { padding: 0; }
/* 그림 콘티(board-body)와 동일 골격 — 가운데 열만 스크롤, 양옆 패널은 고정 */
.script-body { flex: 1; min-height: 0; display: flex; gap: 0; }
#scriptScroll { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 0 140px; }
/* 제목·요약 = 가운데 열의 문서 머리 — 컷 프레임과 같은 폭·같은 왼쪽 선에 고정
   (원문 패널을 넓혀 가운데 열이 줄어도 왼쪽 선은 그대로 — 중앙정렬이면 왼쪽으로 밀려 보인다) */
.script-head { max-width: 640px; margin: 0 auto 20px; }
.script-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.script-head .lead { margin-top: 4px; }
#scriptLogline {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 등장인물 패널 — 그림 콘티의 왼쪽 도구 패널과 같은 자리·같은 결 */
.char-pane {
  width: 208px; flex-shrink: 0;
  margin: 20px 0 20px 18px;
  position: sticky; top: 0;
  max-height: calc(100vh - 160px);
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 16px 14px; overflow-y: auto;
}
.char-pane h3 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
#charList { display: flex; flex-direction: column; gap: 8px; }
.char-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.char-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.char-head b { font-size: 14px; }
.char-actions { display: none; }
.char-desc {
  font-size: 12.5px; color: var(--text-2); line-height: 1.55;
  border-radius: 6px; padding: 2px 4px;
}
.char-desc:hover { background: #f5f5f7; }
.char-desc:focus { outline: 2px solid var(--accent); background: #fff; }
.char-sheet, .char-cands, .char-status { display: none; }

/* 글 콘티 = 등장인물 + 컷 + 원문 대조, 공간 전체 폭을 3단으로 채운다 */
.script-body {
  width: 100%;
  display: flex; gap: 22px; align-items: flex-start;
}
.src-pane {
  width: 350px; flex-shrink: 0;
  position: sticky; top: 0;
  max-height: calc(100vh - 220px);
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; overflow-y: auto;
}
.src-pane[hidden] { display: none; }
.src-pane h3 {
  font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
/* 원문 글자 크기 조절 — 앱 전체와 무관하게 이 패널만, 바를 끌어서 조절 */
.src-zoom { display: flex; align-items: center; gap: 8px; }
.src-fs-val { font-size: 11px; color: var(--text-3); font-weight: 600; min-width: 30px; text-align: right; }
.src-fs-bar {
  -webkit-appearance: none; appearance: none;
  width: 104px; height: 4px; padding: 0; border: none; border-radius: 2px;
  background: var(--line); cursor: pointer; touch-action: none;
}
.src-fs-bar:focus { outline: none; box-shadow: none; }
.src-fs-bar::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent); cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.src-fs-bar::-webkit-slider-thumb:active { cursor: grabbing; }
.src-fs-bar::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent); cursor: grab;
}
.src-fs-bar::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.src-map { font-size: var(--src-fs, 13.5px); line-height: 2.0; }
.src-map .su-dim { color: #a4a4aa; }
.src-map .su-used { color: #1d1d1f; cursor: pointer; border-radius: 4px; }
.src-map .su-used:hover { background: #f0f6ff; }
.src-map .su-used.on { background: #ffe9a8; }
.src-map .su-used i {
  font-style: normal; font-size: 10px; font-weight: 700; color: #fff;
  background: var(--accent); border-radius: 8px; padding: 1px 6px;
  margin-right: 4px; vertical-align: 2px; white-space: nowrap;
}
#scriptList { flex: 1; min-width: 0; }
.flash { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; transition: outline-color 1s; }

/* 그림 콘티 3단: 요소 패널 + 캔버스 + 원문 지도 */
.board-body { flex: 1; min-height: 0; display: flex; gap: 0; }
.board-body #canvasWrap { flex: 1; }
.board-body .src-pane { margin: 20px 18px 20px 0; }

#elemRail {
  width: 208px; flex-shrink: 0;
  margin: 20px 0 20px 18px;
  position: sticky; top: 0;
  max-height: calc(100vh - 160px);
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 14px; overflow-y: auto; overflow-x: hidden; /* 회전 견본의 미세 넘침이 가로 스크롤을 만들지 않게 */
}
#elemRail h3 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 14px 0 8px; }
.rail-tools { display: flex; flex-wrap: wrap; gap: 5px; }
.rail-tools button { font-size: 12px; padding: 6px 7px; flex: 1 1 45%; min-width: 0; white-space: nowrap; }
#elemRail h3:first-child { margin-top: 0; }
#elemRail h3 .muted { display: block; font-weight: 400; font-size: 11px; margin-top: 2px; }
/* 패널을 넓히면 견본이 가로로 늘어지는 대신 열이 늘어난다 (셀 폭 상한 고정) */
.rail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; }
.rail-grid.sfx-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); } /* 효과음은 글자가 길어 넓은 셀 */
.rail-bubble { max-width: 74px; margin: 0 auto; } /* 아주 넓혀도 풍선 견본이 옆으로 퍼지지 않게 */
.rail-grid.tag-grid { display: flex; flex-wrap: wrap; }

/* 말풍선 견본 — 모양 그대로 보여주는 빈 풍선 + 작은 이름 캡션 */
.rail-cell {
  border: none; background: transparent; padding: 3px 2px 2px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
}
.rail-cell:hover { background: transparent; }
.rail-cell:hover .rail-bubble { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail-cell i { font-style: normal; font-size: 10px; color: var(--text-3); line-height: 1; }
.rail-bubble {
  display: block; width: 100%; height: 30px;
  background: #fff; border: 1.8px solid #111; border-radius: 12px;
  position: relative;
}
/* 대화형 풍선엔 시안처럼 작은 꼬리를 붙인다 */
.rail-bubble.speech::after, .rail-bubble.double::after,
.rail-bubble.black::after, .rail-bubble.whisper::after {
  content: ""; position: absolute; left: 8px; bottom: -4.5px;
  width: 7px; height: 7px;
  background: inherit; border: inherit; border-top: none; border-left: none;
  transform: rotate(45deg);
}
.rail-bubble.thought, .rail-bubble.whisper { border-style: dashed; }
/* 뾰족 계열 — 실제 말풍선과 같은 톱니 실루엣으로 보여준다 */
.rail-bubble.burst, .rail-bubble.spike {
  border: none; background: #111; border-radius: 0;
}
.rail-bubble.burst::before, .rail-bubble.spike::before {
  content: ""; position: absolute; inset: 2.5px; background: #fff;
}
.rail-bubble.burst, .rail-bubble.burst::before {
  clip-path: polygon(2% 12%, 10% 0%, 22% 9%, 34% 0%, 48% 8%, 62% 0%, 74% 9%, 88% 0%, 98% 12%,
    92% 30%, 100% 44%, 93% 60%, 100% 76%, 90% 88%, 76% 100%, 62% 92%, 48% 100%, 34% 91%,
    20% 100%, 8% 88%, 0% 72%, 7% 56%, 0% 40%, 8% 26%);
}
.rail-bubble.spike, .rail-bubble.spike::before {
  clip-path: polygon(0% 8%, 7% 0%, 14% 8%, 21% 0%, 28% 8%, 35% 0%, 42% 8%, 50% 0%, 58% 8%, 65% 0%,
    72% 8%, 79% 0%, 86% 8%, 93% 0%, 100% 8%, 100% 92%, 93% 100%, 86% 92%, 79% 100%, 72% 92%,
    65% 100%, 58% 92%, 50% 100%, 42% 92%, 35% 100%, 28% 92%, 21% 100%, 14% 92%, 7% 100%, 0% 92%);
}
.rail-bubble.scream { transform: skewX(-6deg); border-width: 2.5px; border-radius: 4px; }
.rail-bubble.cloud { border-radius: 50% / 46%; }
.rail-bubble.mono { background: #f0f0f3; border-color: transparent; }
.rail-bubble.weak { border: 1.4px dashed #9a9aa0; color: #8e8e93; font-weight: 400; }
.rail-bubble.wobble { border-radius: 46% 54% 52% 48% / 58% 44% 56% 42%; }
.rail-bubble.shout { border-width: 2.5px; border-radius: 6px; font-weight: 800; }
.rail-bubble.burst { border-radius: 4px; box-shadow: inset 0 0 0 1.5px #111; border-width: 1px; font-weight: 800; }
.rail-bubble.double { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px #111; }
.rail-bubble.box { border-radius: 2px; font-family: "SF Mono", Consolas, monospace; font-weight: 500; }
.rail-bubble.black { background: #111; color: #fff; }
.rail-bubble.radio { border-radius: 3px; border-style: double; border-width: 4px; }
.rail-bubble.flash { outline: 1.5px dashed #999; outline-offset: 2px; }

/* 효과음 견본 — 고정 높이 셀에 가둬서 회전·자간이 이웃과 겹치지 않게 */
.rail-sfx {
  border: none; background: transparent; cursor: pointer;
  height: 38px; padding: 0 2px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; white-space: nowrap;
  font-weight: 900; font-size: 14px; color: #111; transform: rotate(-4deg);
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}
.rail-sfx:hover { background: transparent; outline: 2px solid var(--accent); outline-offset: 1px; }

.rail-tag {
  background: #fff; border: 1.5px solid #111; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.rail-tag:hover { background: #f0f6ff; }
.rail-tag.ghost-tag { border-style: dashed; border-color: #b9b9bf; color: var(--muted); font-weight: 500; }

.rail-input {
  display: flex; gap: 5px; width: 100%; margin-top: 4px;
  grid-column: 1 / -1; min-width: 0; /* 그리드 두 열에 걸치고, 입력창 최소폭이 열을 밀어내지 않게 */
}
.rail-input input { flex: 1 1 0; width: 0; min-width: 0; padding: 5px 9px; font-size: 12.5px; border-radius: 8px; }
.rail-input button {
  font-size: 12px; padding: 5px 11px;
  background: var(--accent); color: #fff; border: none;
}

/* 컷 위 컨트롤 줄 — 평소엔 조용히, 다가가면 선명하게 */
.panel-head { opacity: .45; transition: opacity .15s; }
.cut-block:hover .panel-head { opacity: 1; }
.panel-head button { color: #515154; }
.panel-head button:hover { color: var(--text); }
.panel-head .danger { color: var(--danger); }

/* 컷 카드 = 가운데 열 안에서 왼쪽 정렬(고정 여백) — 원문을 넓혀도 제자리, 제목과 같은 선 */
/* 컷 카드 = 가운데 열 중앙 정렬 — 제목(.script-head)과 같은 640px 기준이라 왼쪽 선도 맞는다 */
.cut-card.sp { margin-bottom: 0; width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.sp-head {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 5px 0; opacity: .45; transition: opacity .15s;
}
.cut-card.sp:hover .sp-head { opacity: 1; }
.sp-head b { min-width: 30px; }
.sp-head select { padding: 3px 7px; font-size: 12px; border-radius: 8px; }
.sp-head .ghost.mini { font-size: 12px; }
.cc-del { color: var(--danger); }

/* 컷 박스 — 실제 웹툰 프레임 느낌 */
.sp-panel {
  position: relative;
  background: #fff; border: 2px solid #111;
  width: 100%;
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow);
}
.sp-art {
  color: #9a9aa0; font-size: 13.5px; line-height: 1.75; text-align: center;
  padding: 6px 16px; margin: auto 0;
  border-radius: 8px;
}
.sp-art:hover { background: #fafafa; color: #6a6a70; }
.sp-art:focus { outline: 2px solid var(--accent); background: #fff; color: var(--text); }

.sp-narr {
  position: relative; align-self: flex-start; max-width: 82%;
  background: #fffdf0; border: 1.5px solid #111;
  padding: 7px 12px; font-size: 13px; line-height: 1.55; color: #222;
}
.sp-bubble {
  position: relative; align-self: flex-start; max-width: 76%;
  background: #fff; border: 2px solid #111; border-radius: 20px;
  padding: 10px 16px; margin-top: 12px;
  font-weight: 600; font-size: 14.5px; line-height: 1.5; text-align: center;
}
.sp-bubble.r { align-self: flex-end; }
.sp-bubble.thought { border-style: dashed; background: #fbfbff; }
.sp-bubble.shout { border-width: 3.5px; border-radius: 8px; font-weight: 800; font-size: 16px; }
.sp-bubble.whisper { border-style: dashed; border-width: 1.5px; font-weight: 400; font-size: 12.5px; color: #555; }
.sp-spk {
  position: absolute; top: -16px; left: 10px;
  font-size: 10.5px; font-weight: 400; color: #666;
  background: #fff; padding: 0 5px; border-radius: 5px;
}
.sp-sfx {
  align-self: flex-end;
  font-weight: 900; font-size: 24px; color: #111; transform: rotate(-4deg);
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff;
  position: relative; padding-right: 4px;
}
.sp-x {
  position: absolute; top: -9px; right: -9px;
  width: 19px; height: 19px; padding: 0; border: none; border-radius: 50%;
  background: #1d1d1f; color: #fff; font-size: 11px; line-height: 1;
  opacity: 0; transition: opacity .12s;
}
.sp-narr:hover .sp-x, .sp-bubble:hover .sp-x, .sp-sfx:hover .sp-x { opacity: 1; }
.sp-purpose {
  margin-top: 5px;
  font-size: 12px; color: var(--text-2); text-align: right;
}
.sp-panel .txt:focus { outline: 2px solid var(--accent); border-radius: 4px; }

/* ─── ③ 그림 콘티 ─── */

/* 2·3단계 공통 서브 툴바 — 같은 높이·같은 슬롯 순서로 도구 지도를 고정 */
.subbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.subbar .bar-info { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
/* 설정의 원문 패널 — 그림 콘티의 원문 패널과 같은 여백·같은 높이 규칙 */
#viewScript .src-pane { margin: 20px 18px 20px 0; top: 0; max-height: calc(100vh - 160px); }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.filebtn { border: 1px solid transparent; border-radius: var(--radius-btn); padding: 7px 15px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.filebtn:hover { background: rgba(0,0,0,.05); color: var(--text); }

#viewBoard { display: flex; flex-direction: column; }
.board-body { min-height: 0; }
/* 한 박스 안의 부속 패널은 카드가 아니라 구역 — 그림자 대신 얇은 경계선 */
.workspace #elemRail, .workspace .src-pane {
  box-shadow: none; border: 1px solid var(--line);
}
/* 백업 불러오기 — 모달 안 파일 버튼은 옆의 일반 버튼과 완전히 같은 모습으로
   (.modal-box label 규칙의 작은 글자·여백이 새어들지 않게 명시 복원) */
.modal-box label.filebtn.file-center {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  text-align: center; font-size: 13px; margin-top: 0;
}
.filebtn.file-center:hover { background: #f2f2f5; }

/* 컷 위 생성 상태 칩 — 컷을 덮지 않는다: 기다리는 동안 글 콘티(지문·대사)가 온전히 읽혀야 한다 */
.panel-live {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.93); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
  font-size: 12px; font-weight: 700; color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  pointer-events: none; /* 칩 아래 지문·말풍선 편집을 막지 않는다 */
}
.panel-live.q { color: var(--text-3); }

/* 타자기 모션 조각 — 깜빡이는 캐럿 바 (스피너 대신 앱 전체의 로딩 언어) */
.tcaret {
  display: inline-block; width: 2px; height: .95em;
  background: var(--accent); vertical-align: -.12em;
  animation: caret-blink .75s step-end infinite;
}

/* 컷 등장 — 위에서부터 한 줄씩 타자 치듯 (renderStrip이 한 번만 부여) */
.cut-block.tin { animation: cut-in .38s both; }
@keyframes cut-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
#canvasWrap { flex: 1; overflow-y: auto; padding: 26px 0 140px; }
/* 폭을 줄인 컷(.cut-block 인라인 width)은 옆 컷과 나란히 흐른다 */
#strip { width: 730px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-start; }
#strip.ovl-hidden .ovl, .panel.ovl-hidden .ovl { display: none; } /* 전역 토글 + 컷별 🚫 — 화면과 PNG가 같아야 한다 */

/* 각색 진행 카드 — 그림 콘티 자리에서 살아있는 진행을 보여준다 */
.adapt-progress {
  width: 100%; margin-top: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center;
}
.adapt-progress b { font-size: 18px; font-weight: 700; min-height: 1.3em; }
.adapt-progress .hint { font-size: 13px; color: var(--text-3); animation: hint-in .5s 1s both; }
@keyframes hint-in { from { opacity: 0; } to { opacity: 1; } }

/* 콘팁 로고 로더 — 심볼의 컷 3개가 차례로 차오른다 (좌상 사각·우상 사각·하단 사시 컷) */
.logo-loader { position: relative; width: 76px; height: 72px; }
.logo-loader i {
  position: absolute; display: block;
  background: linear-gradient(135deg, #1e5bff, #8b1eff);
  border-radius: 12px;
  animation: ll-beat 1.4s ease-in-out infinite;
}
.logo-loader .p1 { left: 0; top: 0; width: 44%; height: 50%; transform: rotate(-3deg); }
.logo-loader .p2 { right: 0; top: 0; width: 46%; height: 42%; animation-delay: .22s; }
.logo-loader .p3 {
  left: 0; bottom: 0; width: 100%; height: 46%;
  clip-path: polygon(0 28%, 100% 0, 100% 100%, 0 82%);
  border-radius: 8px; animation-delay: .44s;
}
@keyframes ll-beat { 0%, 100% { opacity: .18; } 35% { opacity: 1; } }
.logo-loader.sm { width: 24px; height: 22px; }
.logo-loader.sm i { border-radius: 4px; }
.logo-loader.sm .p3 { border-radius: 3px; }

/* 말줄임표 로딩 — 점 세 개가 차례로 찍힌다 (제자리 폭 확보로 흔들림 없음) */
.dots::after {
  content: ""; display: inline-block; width: 1.1em; text-align: left;
  animation: dots-cycle 1.4s steps(1, end) infinite;
}
@keyframes dots-cycle {
  0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; }
}

/* 그림 생성 단계 배너 — 1단계(콘티 짜는 중)와 확실히 다른 모양: 얇은 가로 띠 + 진행 숫자 */
.gen-stage {
  width: 100%; margin: 4px 0 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #f0f6ff; border: 1px solid #cfe3ff; border-radius: 12px;
  padding: 12px 18px;
  position: sticky; top: 8px; z-index: 9; /* 스크롤 내려도 진행이 보인다 */
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.gen-stage b { font-size: 14px; }
.gen-stage span { font-size: 13px; font-weight: 700; color: var(--accent); }

/* 각색 직후 안내 배너 — 다음 할 일(그림 만들기)을 크게 */
.strip-callout {
  width: 100%; margin: 4px 0 22px;
  background: #f0f6ff; border: 1px solid #cfe3ff; border-radius: var(--radius);
  padding: 22px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.strip-callout b { font-size: 17px; }
.strip-callout span { font-size: 13.5px; color: var(--text-2); }
.strip-callout button { margin-top: 8px; }

.empty-guide { width: 100%; margin-top: 120px; text-align: center; color: var(--muted); line-height: 1.9; }
.empty-guide h2 { color: #b7b7bd; margin-bottom: 12px; letter-spacing: 2px; }

.cut-block { margin-bottom: 6px; width: 100%; position: relative; }

/* 이전 그림 목록 — 컷 오른쪽 여백의 작은 썸네일. 클릭 = 그 그림으로 교체.
   평소엔 은은하게, 컷에 다가가면 선명하게 (전체 다시 그리기 후 모든 컷에 생겨도 소란스럽지 않게) */
.cut-history {
  position: absolute; left: calc(100% - 12px); top: 42px;
  width: 58px; display: flex; flex-direction: column; gap: 6px;
  z-index: 4; opacity: .55; transition: opacity .15s;
}
.cut-block:hover .cut-history { opacity: 1; }
.cut-history i {
  font-style: normal; font-size: 10.5px; color: var(--text-3);
  white-space: nowrap; padding-left: 2px;
}
.ch-item { position: relative; width: 58px; }
.ch-item b {
  position: absolute; left: 4px; top: 4px; z-index: 2;
  font-size: 9.5px; font-weight: 700; line-height: 1;
  background: rgba(255,255,255,.92); color: var(--text-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px;
  pointer-events: none;
}
.ch-thumb {
  display: block; width: 58px; height: 44px; object-fit: cover;
  background: #fff; border: 1.5px solid var(--line); border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,.10);
  transition: transform .12s, border-color .12s;
}
.ch-item:hover .ch-thumb {
  transform: scale(2.4); transform-origin: left center;
  border-color: var(--accent); position: relative; z-index: 9;
}

/* 스크롤 여백 — 행 전체를 가로지르는 한 줄, 얇은 세로 선만 (웹툰 호흡 표시) */
.gap { width: 100%; display: flex; align-items: center; justify-content: center; }
.gap i { width: 1px; height: 62%; background: #d9d9de; }

.panel-head {
  display: flex; align-items: center; gap: 5px;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; /* 좁은 컷에서도 한 줄 고정 — 행 정렬 유지 */
  padding: 7px 2px;
}
.panel-head::-webkit-scrollbar { display: none; }
.panel-head button { flex-shrink: 0; }
.panel-head b { color: var(--text); margin-right: 2px; }
.panel-head select { padding: 3px 7px; font-size: 12px; border-radius: 8px; }
.panel-head button { padding: 3px 11px; font-size: 12px; }
/* 컷 위 컨트롤(+말풍선·+효과음·+이름표 등)도 박스 결 — 흰 배경 + 흐림 + 은은한 그림자.
   주의: background 쇼트핸드를 쓰면 전역 셀렉트의 셰브런(background-image)이 지워진다 — 반드시 -color로 */
.panel-head button, .panel-head select,
.sp-head button, .sp-head select {
  background-color: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border: 1px solid rgba(17,17,17,.05);
  box-shadow: 0 1px 5px rgba(0,0,0,.08); /* 확산을 작게 — .panel-head의 overflow-x가 그림자를 자르지 않는 범위 */
}
.panel-head button:hover, .sp-head button:hover { background-color: #f7f7f9; }
.chip { font-size: 11px; padding: 2px 9px; border-radius: 10px; }
.chip.busy { background: #e8f1ff; color: #0059b3; }
.chip.queue { background: #f0f0f3; color: var(--text-3); }
.chip.err { background: #fdecec; color: #c92a2a; }
.chip.warn { background: #fff3d6; color: #8a6400; }

.panel {
  position: relative;
  width: auto; margin: 0 20px; /* 컷 폭 = 블록 − 40px (전체 폭이면 690px) */
  background: #fff;
  border: 2px solid #111;
  overflow: hidden;
  touch-action: none;
  box-shadow: var(--shadow);
}
.cut-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
/* 컷 위 액션 버튼(다시 그리기·그림 조절·지우개) — 호버 시 그림 우상단에 표시 */
.panel-actions {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  display: flex; gap: 6px;
  opacity: 0; transition: opacity .15s;
}
.panel:hover .panel-actions { opacity: 1; }
.panel-redo, .panel-white {
  border: none; font-size: 13px; font-weight: 600; padding: 7px 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.panel-redo { background: var(--accent); color: #fff; }
.panel-redo:hover { background: #0077ed; }
.panel-white { background: #fff; color: var(--text); }
.panel-white:hover { background: #f2f2f5; }

/* 컷 높이·폭 손잡이 — 가장자리 가운데, 호버 시 표시 */
.panel-hgrip {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  width: 72px; height: 10px; border-radius: 5px; z-index: 7;
  cursor: ns-resize; background: rgba(17,17,17,.22);
  opacity: 0; transition: opacity .15s; touch-action: none;
}
.panel-wgrip {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 10px; height: 72px; border-radius: 5px; z-index: 7;
  cursor: ew-resize; background: rgba(17,17,17,.22);
  opacity: 0; transition: opacity .15s; touch-action: none;
}
.panel:hover .panel-hgrip, .panel:hover .panel-wgrip { opacity: 1; }
.panel-hgrip:hover, .panel-hgrip:active,
.panel-wgrip:hover, .panel-wgrip:active { background: var(--accent); }

/* 이미지 생성 진행 상태 — 우하단 카드 */
#genProgress {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 260px; background: var(--card); border-radius: var(--radius);
  box-shadow: 0 12px 44px rgba(0,0,0,.18); border: 1px solid var(--line);
  padding: 14px 16px;
}
#genProgress[hidden] { display: none; }
.gp-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.gp-head span { color: var(--text-2); font-weight: 600; }
.gp-bar { height: 6px; border-radius: 3px; background: #ececf0; overflow: hidden; }
.gp-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .3s; }
.gp-meta { margin-top: 8px; font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* 버튼 안 크레딧 표기 */
#adaptCredit { font-weight: 400; opacity: .85; }

/* 드래그하여 삭제 */
.ovl.drop-del { opacity: .35; outline: 2px dashed var(--danger); outline-offset: 3px; }
#dragTrash {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 85; background: var(--danger); color: #fff;
  border-radius: 980px; padding: 10px 22px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 34px rgba(0,0,0,.3); pointer-events: none;
}
#dragTrash[hidden] { display: none; }

/* 가운데 스냅 가이드 */
.panel.snap-center::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 1px; background: var(--accent); z-index: 7; pointer-events: none;
}

/* 우클릭 메뉴 */
#ctxMenu {
  position: fixed; z-index: 90; min-width: 136px;
  background: #fff; border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 44px rgba(0,0,0,.22); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
#ctxMenu[hidden] { display: none; }
#ctxMenu button {
  border: none; background: none; border-radius: 8px;
  text-align: left; padding: 7px 12px; font-size: 13px;
}
#ctxMenu button:hover { background: #f2f2f5; }
#ctxMenu button.danger { color: var(--danger); }
#ctxMenu hr { border: none; border-top: 1px solid var(--line); margin: 4px 6px; }
#ctxMenu button[hidden] { display: none; }
#ctxMenu button[hidden] + hr { display: none; } /* 앞 구간이 통째로 숨겨지면 구분선도 숨김 */

/* 패널 폭 조절 스플리터 */
/* 폭 조절 손잡이 — 잡기 쉽게 넓은 히트영역(18px), 보이는 선은 가늘게(가운데 ::before) */
.splitter {
  width: 18px; flex-shrink: 0; cursor: col-resize;
  margin: 20px 0; align-self: stretch;
  touch-action: none;  /* 터치 드래그가 페이지 팬으로 가로채이지 않게 */
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.splitter::before {
  content: ""; width: 3px; height: 100%; border-radius: 3px;
  background: var(--line); transition: background .15s;
}
.splitter:hover::before, .splitter:active::before { background: var(--accent); }
.splitter[hidden] { display: none; }
.cut-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 30px; text-align: center;
  color: #a4a4aa; font-size: 15px; line-height: 1.7;
  background: repeating-linear-gradient(45deg, transparent 0 14px, rgba(0,0,0,.02) 14px 28px), #fafafa;
}
.cut-placeholder span { color: #c0c0c6; font-size: 12.5px; letter-spacing: 1px; }

/* 오버레이 공통 */
.ovl { position: absolute; cursor: grab; }
/* 펜으로 그린 선 요소 — 이미지 조각, 세로는 비율 자동 */
.ovl.draw { padding: 0; line-height: 0; }
.ovl.draw > img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.ovl:active { cursor: grabbing; }
.ovl .txt { outline: none; }
.ovl-del {
  position: absolute; top: -10px; right: -10px;
  width: 20px; height: 20px; padding: 0;
  border-radius: 50%; font-size: 12px; line-height: 1;
  background: #1d1d1f; color: #fff; border: none;
  opacity: 0; transition: opacity .12s;
}
.ovl:hover .ovl-del { opacity: 1; }

/* 말풍선 — 글자는 항상 가로·세로 중앙 (서체는 툴바의 글꼴 선택으로) */
.bubble {
  background: #fff; border: 2px solid #111; border-radius: 22px;
  padding: 12px 14px; text-align: center; color: #111;
  font-weight: 600; font-size: 17px; line-height: 1.45;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
}
.bubble .txt { display: block; min-height: 1em; width: 100%; }

/* 말하는 방향 꼬리 */
.bubble .tail {
  position: absolute; width: 15px; height: 15px;
  background: inherit; border-right: 2px solid #111; border-bottom: 2px solid #111;
  pointer-events: none;
}
.bubble.tail-bl .tail { bottom: -8.5px; left: 22px; transform: rotate(45deg); }
.bubble.tail-br .tail { bottom: -8.5px; right: 22px; transform: rotate(45deg); }
.bubble.tail-tl .tail { top: -8.5px; left: 22px; transform: rotate(225deg); }
.bubble.tail-tr .tail { top: -8.5px; right: 22px; transform: rotate(225deg); }
.bubble.black .tail { background: #111; }
/* 생각·구름 방울 꼬리 좌우반전 */
.bubble.thought.flip::after { left: auto; right: 18px; }
.bubble.cloud.flip::before { left: auto; right: 16px; }
.bubble.cloud.flip::after { left: auto; right: 8px; }
.bubble .spk {
  position: absolute; top: -18px; left: 8px;
  font-size: 10.5px; font-weight: 400; color: #333;
  background: rgba(255,255,255,.9); padding: 0 6px; border-radius: 6px;
  pointer-events: none;
}
.bubble.thought { border-style: dashed; background: #fbfbff; }
.bubble.shout { border-width: 4px; border-radius: 8px; font-weight: 800; font-size: 20px; }
.bubble.whisper { border-style: dashed; border-width: 1.5px; font-weight: 400; font-size: 13.5px; color: #555; }

/* 나레이션 */
.narr {
  background: rgba(255,253,240,.97); border: 1.5px solid #111;
  padding: 9px 12px; color: #222; font-size: 13.5px; line-height: 1.55;
}

/* 효과음 — 서체가 연출이다 */
.sfx {
  color: #111; font-weight: 900; transform: rotate(-5deg);
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, 0 3px 0 #fff;
  white-space: nowrap;
}
.sfx-S { font-size: 22px; }
.sfx-M { font-size: 36px; }
.sfx-L { font-size: 54px; }

.sfx-style-outline, .rail-sfx.sfx-style-outline {
  color: transparent; -webkit-text-stroke: 2px #111; text-shadow: none;
}
.sfx-style-brush, .rail-sfx.sfx-style-brush {
  font-family: "Gungsuh", "궁서", "GungsuhChe", serif; font-weight: 700;
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff;
}
.sfx-style-serif, .rail-sfx.sfx-style-serif {
  font-family: "Batang", "바탕", serif; font-weight: 700; letter-spacing: 2px;
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff;
}
.sfx-style-wobble, .rail-sfx.sfx-style-wobble {
  font-style: italic; letter-spacing: 1px;
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, 3px 4px 0 rgba(17,17,17,.25);
}
.sfx-style-soft, .rail-sfx.sfx-style-soft {
  font-weight: 500; color: #777; letter-spacing: 6px; text-shadow: none;
}
.sfx-style-gothic, .rail-sfx.sfx-style-gothic {
  font-family: "Dotum", "돋움", sans-serif; font-weight: 900; letter-spacing: 3px;
}
.sfx-style-shadow3d, .rail-sfx.sfx-style-shadow3d {
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff,
    4px 5px 0 rgba(17,17,17,.35);
}
.sfx-style-invert, .rail-sfx.sfx-style-invert {
  color: #fff; text-shadow: none;
  -webkit-text-stroke: 2.5px #111; paint-order: stroke fill;
}
.sfx-style-flat { letter-spacing: 2px; }
.rail-sfx.sfx-style-tall { transform: rotate(-3deg) scaleY(1.35); }
.rail-sfx.sfx-style-flat { transform: scaleY(.65); }
/* 레일 견본 정리 — 자간·크기를 셀에 맞춰 잘리지 않게 (위 스타일 규칙들보다 뒤에 있어야 함) */
.rail-grid .rail-sfx { overflow: visible; font-size: 13px; letter-spacing: 1px; }
.rail-grid .rail-sfx.sfx-style-soft { letter-spacing: 2px; }
.rail-grid .rail-sfx > span { display: inline-block; white-space: nowrap; transform-origin: center; }

/* ─── SVG 곡선 말풍선 (speech·흑풍선·강조·생각·구름·뾰족/굵은 외침) ───
   CSS 사각형 대신 shapes.js 경로로 그린다 — 크기 바뀌면 fitBubbleSvg가 재계산 */
/* 특이도 3(.ovl.bubble.svgb) — 아래쪽 타입별 규칙(.bubble.black 등)에 덮이지 않게 */
.ovl.bubble.svgb {
  background: transparent; border: none; box-shadow: none;
  z-index: 0; /* 자체 문맥 — 배경 svg(z:-1)가 패널 그림 밑으로 꺼지지 않게 */
  /* 여백은 em 기준 — 글자 크기를 키워도 곡면 안쪽에 글이 머문다 */
  padding: 1.2em 2.2em;
}
.ovl.bubble.burst.svgb::before { display: none; } /* 구 clip-path 가상요소만 무효화 */
.ovl.bubble.svgb .bub-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; z-index: -1; pointer-events: none;
}
.ovl.bubble.burst.svgb, .ovl.bubble.shout.svgb { padding: 1.6em 2.6em; }
.ovl.bubble.thought.svgb, .ovl.bubble.cloud.svgb { padding: 1.3em 2.2em; }

/* 레일 SVG 견본 — 풍선 견본과 같은 폭 상한 */
.rail-shape { display: block; width: 100%; max-width: 74px; margin: 0 auto; height: 30px; overflow: visible; }

/* ─── 오버레이 선택 · 크기 핸들 · 플로팅 툴바 (캔바식 직접 조작) ─── */

.ovl.sel { outline: 2px solid var(--accent); outline-offset: 3px; }
.ovl-handle {
  position: absolute; right: -8px; bottom: -8px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent);
  cursor: nwse-resize; display: none; z-index: 5;
}
.ovl.sel .ovl-handle { display: block; }

#ovlBar {
  position: fixed; z-index: 70;
  display: flex; align-items: center; gap: 4px;
  background: #1d1d1f; border-radius: 12px; padding: 6px 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
#ovlBar[hidden] { display: none; }
#ovlBar button, #ovlBar select {
  background: #333336; color: #fff; border: none; border-radius: 8px;
  font-size: 12.5px; padding: 4px 9px; cursor: pointer;
}
/* 다크 툴바용 흰 셰브런 — 전역 select 규칙이 지운 화살표 복원 */
#ovlBar select {
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
}
#ovlBar button:hover, #ovlBar select:hover { background-color: #48484c; }
#ovlBar .sep { width: 1px; height: 16px; background: #48484c; margin: 0 2px; }
#ovlBar .del { color: #ff6b60; }

/* 효과음 회전 핸들 */
.ovl-rotate {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  font-size: 12px; line-height: 16px; text-align: center; color: var(--accent);
  cursor: ew-resize; display: none; z-index: 5;
  text-shadow: none; font-style: normal; letter-spacing: 0;
}
.ovl.sel .ovl-rotate { display: block; }

/* 지우개 */
.erase-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; /* 그림(.cut-img)과 똑같이 잘라서 채워야 왜곡이 없다 */
  z-index: 8; cursor: crosshair;
}
.panel.erasing .ovl, .panel.adjusting .ovl { pointer-events: none; opacity: .25; }
.panel.erasing .panel-actions, .panel.adjusting .panel-actions,
.panel.erasing .panel-hgrip, .panel.adjusting .panel-hgrip,
.panel.erasing .panel-wgrip, .panel.adjusting .panel-wgrip { display: none; }
.panel.adjusting { cursor: grab; outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.panel.adjusting:active { cursor: grabbing; }

/* 그림 조절 — 컷 밖으로 나간 부분을 반투명으로 (패널이 불투명해 안쪽은 자연히 가려진다) */
.adjust-ghost {
  position: absolute; z-index: 0; opacity: .32; pointer-events: none;
}
.adjust-ghost img { position: absolute; object-fit: cover; }
/* 그림 상자 테두리 + 네 모서리 손잡이 (컷 밖까지 잡을 수 있다) */
.adjust-ui {
  position: absolute; z-index: 40; pointer-events: none;
  outline: 1.5px dashed var(--accent);
}
.adjust-ui .ah {
  position: absolute; width: 15px; height: 15px; pointer-events: auto;
  background: #fff; border: 2.5px solid var(--accent); border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); touch-action: none;
}
.ah-nw { left: -8px; top: -8px; cursor: nwse-resize; }
.ah-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.ah-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.ah-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
#eraseBar, #adjustBar {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 80; display: flex; align-items: center; gap: 6px;
  background: #1d1d1f; color: #fff; border-radius: 980px; padding: 8px 14px;
  box-shadow: 0 10px 34px rgba(0,0,0,.35); font-size: 13px;
}
#eraseBar[hidden], #adjustBar[hidden] { display: none; }
#eraseBar button, #adjustBar button {
  background: #333336; color: #fff; border: none; border-radius: 980px;
  font-size: 12.5px; padding: 5px 13px;
}
#eraseBar button.on, #eraseBar button:hover,
#adjustBar button:hover { background: #48484c; }
#eraseBar button.primary, #adjustBar button.primary { background: var(--accent); }
#eraseBar .sep, #adjustBar .sep { width: 1px; height: 16px; background: #48484c; }
#adjustBar #zoomPct { min-width: 42px; text-align: center; font-weight: 600; }

/* 내 콘티 보관함 — 버튼을 누르면 지난 콘티 목록(열기·삭제)이 내려온다 */
.proj-group { position: relative; }
#projBtn {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 240px; border: none; background-color: transparent;
  padding: 7px 8px; border-radius: 9px; cursor: pointer; font: inherit;
}
#projBtn:hover { background-color: #f2f2f5; }
#projBtn b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
#projBtn .chev { font-style: normal; font-size: 10px; color: var(--text-3); }
#projMenu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  width: 296px; max-height: 380px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
  padding: 6px;
}
.pm-new {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; border: none; background: none; border-radius: 10px;
  font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-align: left;
}
.pm-new:hover { background: #f0f6ff; }
.pm-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.pm-row:hover { background: #f5f5f7; }
.pm-row.cur { background: #f0f6ff; }
.pm-thumb {
  width: 34px; height: 44px; border-radius: 6px; object-fit: cover; object-position: top;
  border: 1px solid var(--line); background: #fafafa; flex: none;
}
.pm-thumb.empty { display: inline-block; }
.pm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-info b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-info small { font-size: 11px; color: var(--text-3); }
.pm-del {
  flex: none; border: none; background: none; border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; font-size: 13px; color: var(--text-3);
  opacity: 0; transition: opacity .12s;
}
.pm-row:hover .pm-del { opacity: 1; }
.pm-del:hover { background: #fdecec; color: #c62828; }
.pm-empty { padding: 14px 12px; font-size: 12px; color: var(--text-3); text-align: center; }
.pm-trash-head {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 9px 12px; border: none; background: none; border-radius: 10px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; text-align: left;
}
.pm-trash-head:hover { background: #f5f5f7; }
.pm-trash-head i { font-style: normal; margin-left: auto; font-size: 10px; }
.pm-row.trash { cursor: default; opacity: .78; }
.pm-row.trash:hover { background: #fafafa; }
.pm-act {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 9px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600;
}
.pm-act:hover { background: #f0f6ff; border-color: #cfe3ff; color: var(--accent); }
.pm-act.danger { width: 26px; padding: 4px 0; text-align: center; color: var(--text-3); }
.pm-act.danger:hover { background: #fdecec; border-color: #f5c6c6; color: #c62828; }

/* ─── 말풍선 타입 확장 ─── */

/* 생각 — 구름 꼬리 */
.bubble.thought::after {
  content: ""; position: absolute; left: 18px; bottom: -14px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fbfbff; border: 2px dashed #111;
}
/* 폭발 — 뾰족 테두리 (클립은 가상요소에만: 핸들·삭제·화자 라벨은 안 잘리게) */
.bubble.burst {
  background: transparent; border: none; box-shadow: none;
  padding: 22px 26px; font-weight: 800; font-size: 19px;
  z-index: 0; /* 가상요소 z-index:-1이 패널 이미지 밑으로 꺼지지 않게 자체 문맥 생성 */
}
.bubble.burst::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #fff; box-shadow: inset 0 0 0 3px #111;
  clip-path: polygon(2% 12%, 10% 0%, 22% 9%, 34% 0%, 48% 8%, 62% 0%, 74% 9%, 88% 0%, 98% 12%,
    92% 30%, 100% 44%, 93% 60%, 100% 76%, 90% 88%, 76% 100%, 62% 92%, 48% 100%, 34% 91%,
    20% 100%, 8% 88%, 0% 72%, 7% 56%, 0% 40%, 8% 26%);
}
/* 강조 겹테 */
.bubble.double { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #111; }
/* 각진 — 기계음·시스템 */
.bubble.box {
  border-radius: 2px; font-family: "SF Mono", Consolas, monospace;
  font-weight: 500; font-size: 14.5px; letter-spacing: .5px;
}
/* 흑풍선 — 위압·저음 */
.bubble.black { background: #111; color: #fff; }
.bubble.black .spk { color: #ddd; background: rgba(0,0,0,.7); }

/* 구름 생각 — 실선 초타원 + 방울 꼬리 */
.bubble.cloud { border-radius: 50% / 42%; padding: 16px 22px; background: #fdfdff; }
.bubble.cloud::before, .bubble.cloud::after {
  content: ""; position: absolute; border-radius: 50%;
  background: #fdfdff; border: 2px solid #111;
}
.bubble.cloud::before { width: 13px; height: 13px; left: 16px; bottom: -16px; }
.bubble.cloud::after { width: 7px; height: 7px; left: 8px; bottom: -27px; }
/* 독백 — 테두리 없는 연회색 */
.bubble.mono { background: #f0f0f3; border-color: transparent; font-weight: 500; color: #3a3a3c; box-shadow: none; }
/* 기어들어감 — 흐린 회색 점선, 작은 글씨 */
.bubble.weak { border: 1.5px dashed #9a9aa0; color: #8e8e93; font-weight: 400; font-size: 12.5px; background: #fdfdfd; }
/* 떨림 — 일그러진 윤곽 */
.bubble.wobble {
  border-radius: 46% 54% 52% 48% / 58% 44% 56% 42%;
  border-width: 2.5px; transform: rotate(-1.2deg);
}
/* 전파·방송 — 지그재그 느낌의 이중 각테 */
.bubble.radio {
  border-radius: 3px; border-style: double; border-width: 5px;
  font-weight: 700; letter-spacing: .5px;
}
/* 회상 — 안 실선 + 밖 점선 이중 */
.bubble.flash { outline: 2px dashed #777; outline-offset: 4px; background: #fffef8; }
/* 민무늬 — 테두리·배경 없이 흰 헤일로 글자 (그림 위 얹는 대사) */
.bubble.bare {
  background: transparent; border-color: transparent; box-shadow: none;
  text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, 0 0 6px #fff;
}
/* 분노 가시 — 사각 톱니 테두리 */
.bubble.spike {
  background: transparent; border: none; box-shadow: none;
  padding: 18px 22px; font-weight: 800; z-index: 0;
}
.bubble.spike::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #fff; box-shadow: inset 0 0 0 2.5px #111;
  clip-path: polygon(0% 8%, 7% 0%, 14% 8%, 21% 0%, 28% 8%, 35% 0%, 42% 8%, 50% 0%, 58% 8%, 65% 0%,
    72% 8%, 79% 0%, 86% 8%, 93% 0%, 100% 8%, 100% 92%, 93% 100%, 86% 92%, 79% 100%, 72% 92%,
    65% 100%, 58% 92%, 50% 100%, 42% 92%, 35% 100%, 28% 92%, 21% 100%, 14% 92%, 7% 100%, 0% 92%);
}
/* 비명 — 기울고 각진 */
.bubble.scream {
  transform: skewX(-6deg); border-width: 3px; border-radius: 4px;
  font-weight: 800; font-style: italic;
}
/* 몽환 — 이중 점선 + 옅은 라벤더 */
.bubble.dream {
  border: 2px dashed #8b7fc7; background: #f7f5ff; color: #4a4466;
  outline: 1px dashed #c9c2e8; outline-offset: 3px; border-radius: 26px;
}

/* 글 콘티 프리뷰에도 같은 타입 반영 */
.sp-bubble.cloud { border-radius: 50% / 45%; }
.sp-bubble.mono { background: #f0f0f3; border-color: transparent; font-weight: 500; }
.sp-bubble.weak { border: 1.5px dashed #9a9aa0; color: #8e8e93; font-weight: 400; font-size: 12px; }
.sp-bubble.wobble { border-radius: 46% 54% 52% 48% / 58% 44% 56% 42%; }
.sp-bubble.radio { border-radius: 3px; border-style: double; border-width: 5px; font-weight: 700; }
.sp-bubble.flash { outline: 2px dashed #777; outline-offset: 3px; }
.sp-bubble.burst { border-radius: 4px; border-width: 3px; font-weight: 800; }
.sp-bubble.double { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #111; }
.sp-bubble.box { border-radius: 2px; font-family: "SF Mono", Consolas, monospace; font-weight: 500; }
.sp-bubble.black { background: #111; color: #fff; }
.sp-bubble.black .sp-spk { background: #333; color: #eee; }

/* 캐릭터 이름표 */
.tag {
  background: #fff; border: 1.5px solid #111; border-radius: 6px;
  padding: 2px 9px; font-size: 12px; font-weight: 700; color: #111;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  white-space: nowrap;
}
.tag .txt { display: inline; }

/* 캡션 / 프롬프트 */
.caption { width: 690px; margin: 6px auto 26px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.cap-label {
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px;
  font-size: 10.5px; padding: 0 5px; margin-right: 6px;
}
.caption .txt { color: #515154; }
.caption .txt:focus { outline: 1px solid var(--accent); border-radius: 3px; }
.excerpt { display: block; color: var(--text-3); font-size: 11.5px; margin-top: 2px; }

.prompt-editor { width: 690px; margin: -16px auto 26px; display: flex; flex-direction: column; gap: 4px; }
.prompt-editor label { color: var(--muted); font-size: 11.5px; }
.prompt-editor textarea { height: 84px; font-size: 12.5px; font-family: "SF Mono", Consolas, monospace; resize: vertical; }

/* ─── 모달 ─── */

.modal {
  position: fixed; inset: 0; z-index: 95; /* 편집 툴바(70~90)보다 항상 위, 토스트(99) 아래 */
  background: rgba(0,0,0,.34);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }
/* 모달이 열려 있는 동안 떠 있는 편집 막대는 숨긴다 (겹침 방지 이중 방어) */
body:has(.modal:not([hidden])) #ovlBar,
body:has(.modal:not([hidden])) #eraseBar,
body:has(.modal:not([hidden])) #adjustBar,
body:has(.modal:not([hidden])) #ctxMenu { display: none; }
.modal-box {
  background: var(--card); border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,.25);
  width: 470px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.modal-box.wide { width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h3 { font-size: 17px; }
.modal-head button { border: none; background: none; font-size: 20px; color: var(--muted); }
.modal-box label { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; min-width: 0; }
#settingsModal .modal-box { padding-bottom: 0; } /* 하단은 sticky 저장 줄이 담당 */
.modal-foot {
  display: flex; justify-content: flex-end;
  position: sticky; bottom: 0; margin: 10px -22px 0; padding: 12px 22px;
  background: var(--card); border-top: 1px solid var(--line);
}
/* 개발자 전용 구역 — 주소에 ?dev=1 이 있을 때만(body.dev) 표시. 고객에게는 그림 품질만 보인다 */
body:not(.dev) .dev-only { display: none; }

/* 로그인 게이트 */
.login-box { width: 400px; text-align: center; align-items: center; gap: 14px; padding: 40px 32px 32px; }
.login-box .legal { font-size: 11px; color: var(--text-3); }
.login-box .legal a { color: var(--text-3); text-decoration: underline; }
.login-box .login-sym { height: 72px; width: auto; }
.login-box .login-word { height: 22px; width: auto; margin-top: 2px; }
.login-box .lead { line-height: 1.7; }
.login-box .hint { line-height: 1.7; }
#btnGoogleLogin { width: 100%; margin-top: 6px; }

/* 환경설정 계정 줄 */
.acct-row { align-items: center; }
.acct-email {
  font-size: 13px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  align-self: center;
}

/* 설정 섹션 구분 */
.set-sec {
  font-size: 13px; color: var(--text-2); font-weight: 700;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.set-sec:first-of-type { margin-top: 2px; padding-top: 0; border-top: none; }
.set-adv { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.set-adv summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-3);
  list-style-position: inside;
}
.set-adv summary:hover { color: var(--text); }
.set-adv[open] summary { margin-bottom: 6px; }
.set-adv > label { display: block; }

.styleref-row { display: flex; align-items: center; gap: 8px; }
.styleref-row img { height: 64px; border-radius: 6px; background: #fff; border: 1px solid var(--line); }

.export-item { margin-bottom: 18px; }
.export-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; }
.export-item img { width: 100%; border-radius: 6px; background: #fff; border: 1px solid var(--line); }

/* ─── 토스트 ─── */

#toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1d1d1f; color: #fff;
  padding: 11px 22px; border-radius: 980px;
  font-size: 13.5px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 99; max-width: 70vw;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #c92a2a; }
