/* 화면 디자인(SB-UI-P1 시안 A 작업대 · SB-UI-P2 다듬기): 소개·요금제 화면과 같은 말투(Pretendard·둥근 모서리·옅은 선·부드러운 그림자) */
:root {
  --bg: #f5f4f0;
  --panel: #ffffff;
  --ink: #17171a;
  --muted: #5f5f66;
  --faint: #6c6c73;
  --line: #e6e4de;
  --line-strong: #d4d1ca;
  --hover: #f1f0ec;
  --field: #ffffff;
  --accent: #2f5bd3;
  --accent-ink: #ffffff;
  --accent-soft: #e7ecfb;
  --warn: #b3402a;
  --ok: #2f8f57;
  --board-bg: #fbfbf9;
  --grid: #e7e7e2;
  --grid-strong: #cfcfc8;
  --fov: rgba(47, 91, 211, 0.12);
  --badge: #f6e7c8;
  --badge-ink: #7a5310;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.05);
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.06), 0 12px 32px rgba(20, 20, 30, 0.08);
  --shadow-lg: 0 2px 6px rgba(20, 20, 30, 0.08), 0 24px 60px rgba(20, 20, 30, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121317; --panel: #1b1d23; --ink: #ecebe6; --muted: #a6a7af; --faint: #9a9ba3; --line: #2c2e36; --line-strong: #3b3e48;
    --hover: #252831; --field: #1b1d23; --accent: #7c9bf2; --accent-ink: #0e1016; --accent-soft: #232b45; --warn: #e07a62; --ok: #6cc28f;
    --board-bg: #1c1c1a; --grid: #2b2b28; --grid-strong: #42423d; --fov: rgba(125, 156, 240, 0.16); --badge: #4a3a17; --badge-ink: #f2d69a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121317; --panel: #1b1d23; --ink: #ecebe6; --muted: #a6a7af; --faint: #9a9ba3; --line: #2c2e36; --line-strong: #3b3e48;
  --hover: #252831; --field: #1b1d23; --accent: #7c9bf2; --accent-ink: #0e1016; --accent-soft: #232b45; --warn: #e07a62; --ok: #6cc28f;
  --board-bg: #1c1c1a; --grid: #2b2b28; --grid-strong: #42423d; --fov: rgba(125, 156, 240, 0.16); --badge: #4a3a17; --badge-ink: #f2d69a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 14px; line-height: 1.5; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 17px; }
h2 { font-size: 15px; }
h2 small, .sub, .lbl small { color: var(--muted); font-weight: 450; font-size: 12px; letter-spacing: 0; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.big { width: 28px; height: 28px; stroke-width: 1.5; }

/* 단추: 기본 · 강조(primary) · 옅은(ghost) */
button, select, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button, .filebtn, a.btnlike {
  height: 34px; padding: 0 13px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; font-size: 13.5px; font-weight: 550; line-height: 1;
  box-shadow: var(--shadow-sm); transition: background 0.12s, border-color 0.12s, color 0.12s;
}
button:hover, .filebtn:hover, a.btnlike:hover { background: var(--hover); border-color: var(--line-strong); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:disabled:hover { background: var(--panel); border-color: var(--line); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .filebtn:focus-within, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button.primary, a.btnlike.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; box-shadow: 0 1px 2px rgba(47, 91, 211, 0.25); }
button.primary:hover, a.btnlike.primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.07); }
button.primary:disabled:hover { background: var(--accent); filter: none; }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover { background: var(--hover); border-color: transparent; }
button.ghost:disabled:hover { background: transparent; }
button.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); box-shadow: none; font-weight: 650; }
button.soft:hover { background: var(--accent-soft); filter: brightness(0.97); }
button.danger { color: var(--warn); }
button.small, .filebtn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
button.small .ic { width: 15px; height: 15px; }
button.icon { padding: 0; width: 34px; }
button.small.icon { width: 28px; }
button.big { width: 100%; height: 44px; font-size: 15px; border-radius: 11px; }
button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  border: 1px solid var(--line); background: var(--field); border-radius: 8px; padding: 6px 9px; min-width: 0; transition: border-color 0.12s, box-shadow 0.12s;
}
input[type="text"]:hover, input[type="number"]:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { height: 32px; padding: 0 8px; }
textarea { width: 100%; resize: vertical; line-height: 1.55; }
.filebtn { position: relative; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.seg { display: inline-flex; background: var(--hover); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 28px; border: 0; background: transparent; box-shadow: none; padding: 0 11px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg button:hover { background: transparent; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 20, 30, 0.12); }
.seg button:disabled { opacity: 0.45; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-btns.end { justify-content: flex-end; }
.grow { flex: 1; }

/* ---------- 위 막대 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: 60px;
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  padding: 10px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
.title { display: flex; gap: 10px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-size: 15px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.mark { width: 22px; height: 22px; position: relative; flex: none; }
.mark i { position: absolute; width: 14px; height: 9px; background: var(--accent); border-radius: 2.5px; }
.mark i:first-child { left: 0; top: 2px; }
.mark i:last-child { right: 0; bottom: 2px; opacity: 0.55; }
.badge { background: var(--hover); color: var(--muted); border-radius: 6px; padding: 2px 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.01em; }
.doc { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 0 1 auto; padding-left: 14px; margin-left: 2px; border-left: 1px solid var(--line); }
.doc-title { border-color: transparent !important; background: transparent !important; box-shadow: none !important; font-weight: 650; font-size: 15px; width: 260px; max-width: 30vw; padding: 5px 8px; letter-spacing: -0.015em; }
.doc-title:hover { background: var(--hover) !important; }
.doc-title:focus { background: var(--panel) !important; border-color: var(--accent) !important; }
body.editing .doc-title { display: none; }
body.editing .doc { border-left: 0; padding-left: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#boardActions { margin-left: auto; }
#editActions { flex: 1 1 auto; }
.bar-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.cut-nav { display: inline-flex; align-items: center; gap: 2px; }
.cut-label { font-variant-numeric: tabular-nums; min-width: 66px; text-align: center; font-size: 14px; }
.frame-info { white-space: nowrap; }
.account { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
/* 로그인 확인 전에도 자리(「구글로 로그인」 폭)를 차지해, 나타날 때 위 막대 줄바꿈이 바뀌어 표가 밀리지 않게 한다(SB-CLS-007) */
.account.pending { visibility: hidden; }
.credit { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 5px 11px; background: var(--hover); border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.avatar { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 750; font-size: 13px; box-shadow: none; }
.avatar:hover { background: var(--accent-soft); filter: brightness(0.96); border-color: transparent; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 230px; display: grid; gap: 1px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-pop > button, .menu-pop > .filebtn, .menu-pop > a {
  height: 36px; justify-content: flex-start; border: 0; background: transparent; box-shadow: none; padding: 0 12px; border-radius: 8px; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; display: flex; align-items: center;
}
.menu-pop > button:hover, .menu-pop > .filebtn:hover, .menu-pop > a:hover, .menu-pop > button:focus-visible, .menu-pop > a:focus-visible { background: var(--hover); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; width: auto; }
.menu-who { font-size: 12.5px; color: var(--muted); padding: 8px 12px 6px; white-space: normal; max-width: 300px; line-height: 1.5; }

/* 저장 상태 */
.save-state { height: 26px; font-size: 12px; font-weight: 500; padding: 0 8px; border-radius: 999px; color: var(--muted); border-color: transparent; background: transparent; box-shadow: none; white-space: nowrap; }
.save-state:disabled { cursor: default; opacity: 1; }
.save-state:disabled:hover { background: transparent; border-color: transparent; }
.save-state[data-state="saved"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.save-state[data-state="error"], .save-state[data-state="conflict"] { color: #fff; background: var(--warn); border-color: var(--warn); }

/* 알림 상자 */
/* .modal(position: relative)보다 뒤에 와도 지지 않게 두 클래스로 */
.modal.paid-only { position: fixed; z-index: 60; left: 50%; top: 84px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); }
.paid-only p { margin: 0 0 14px; }
.edit-lock { position: sticky; top: 60px; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 20px;
  background: var(--accent-soft); border-bottom: 1px solid var(--accent); font-size: 13px; }
.edit-lock span { flex: 1 1 280px; }
body.read-only #boardView, body.read-only #editorView { opacity: 0.6; }
.small-screen { display: none; margin: 0; padding: 10px 16px; background: var(--badge); color: var(--badge-ink); font-size: 14px; line-height: 1.5; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--panel);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg);
}
.note, .readout { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; line-height: 1.55; }
.readout { color: var(--ink); }
.empty { color: var(--muted); }
.biz-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 24px 16px 32px; color: var(--muted); font-size: 12px; text-align: center; }
.biz-foot a { color: inherit; }

/* ---------- 창(모달) ---------- */
.modal { position: relative; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 18px; }
.modal-x { width: 32px !important; height: 32px; color: var(--muted); margin: -6px -8px -6px 0; }
.modal-lead { margin: -4px 0 0; font-size: 13px; }

/* ---------- 스토리보드 화면 ---------- */
.sb { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: calc(100vh - 60px); }
/* 첫 그리기 전(컷 목록이 빈 채)에는 표 영역을 안 보이게 둔다(SB-CLS-001). 스크립트가 멈춰도 4초 뒤에는 보인다 */
.sb.booting { visibility: hidden; animation: sb-boot-reveal 0s 4s forwards; }
@keyframes sb-boot-reveal { to { visibility: visible; } }
@media print { .sb.booting { visibility: visible; animation: none; } } /* 인쇄는 애니메이션을 기다리지 않는다(교차 검수 1차 P2) */
.side {
  position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow: auto;
  border-right: 1px solid var(--line); background: var(--panel); padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 26px;
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 6px; padding: 0 4px; min-height: 28px; }
.side-title, .side-head h2 { font-size: 12px; color: var(--muted); font-weight: 650; letter-spacing: 0.02em; }
.side-fold { height: 28px; padding: 0 6px 0 2px; margin-left: -4px; border: 0; background: transparent; box-shadow: none; gap: 4px; color: var(--muted); }
.side-fold:hover { background: var(--hover); color: var(--ink); }
.side-fold .ic { width: 14px; height: 14px; transition: transform 0.15s; }
.my-boards.collapsed .side-fold .ic { transform: rotate(-90deg); }
.side-tools { display: inline-flex; gap: 2px; }
.side-tools button { color: var(--muted); }
.side-msg { margin: 0 6px 6px; font-size: 12.5px; color: var(--faint); }
.side-msg:empty { display: none; }
.side-guest { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--hover); font-size: 13px; color: var(--muted); line-height: 1.55; }
.side-tip { margin: 10px 6px 0; font-size: 12px; color: var(--faint); line-height: 1.5; }
.side .note { margin: 6px 6px 0; }
.my-boards.collapsed .my-board-list, .my-boards.collapsed .side-msg { display: none; }
.my-board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.my-board { position: relative; border-radius: 9px; }
.my-board-open {
  width: 100%; height: auto; min-height: 44px; padding: 7px 36px 7px 10px; border: 0; border-radius: 9px; background: transparent; box-shadow: none;
  display: grid; justify-items: start; gap: 1px; text-align: left; white-space: normal; font-weight: 500;
}
.my-board-open:hover { background: var(--hover); }
.my-board-open:disabled { opacity: 1; cursor: default; }
.my-board-open:disabled:hover { background: transparent; }
.my-board.on .my-board-open, .my-board.on .my-board-open:hover { background: var(--accent-soft); }
.my-board-title { font-size: 13.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-board.on .my-board-title { color: var(--accent); }
.my-board .sub { font-size: 11.5px; }
.my-board-del { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--muted); }
.my-board-del.armed { opacity: 1; width: auto !important; padding: 0 8px; background: var(--warn); color: #fff; }
.my-board:hover .my-board-del, .my-board:focus-within .my-board-del { opacity: 1; }
.cards-panel { display: grid; }
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.card-item { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px; border-radius: 10px; }
.card-item:hover, .card-item:focus-within { background: var(--hover); }
.card-thumb { width: 44px; height: 58px; margin: 0 auto; border-radius: 8px; background: var(--hover) no-repeat; border: 1px solid var(--line); display: grid; place-items: center; color: var(--faint); font-size: 10.5px; text-align: center; line-height: 1.2; overflow: hidden; }
.card-thumb .ic { width: 18px; height: 18px; }
.card-item:hover .card-thumb:not([style]) { background: var(--panel); }
.card-fields { display: grid; gap: 0; min-width: 0; align-content: start; padding-right: 22px; }
.card-fields input, .card-fields textarea { width: 100%; border-color: transparent; background: transparent; box-shadow: none !important; padding: 2px 4px; margin-left: -4px; }
.card-fields input { font-weight: 650; font-size: 13.5px; height: 24px; }
.card-fields textarea { resize: none; min-height: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; overflow: hidden; }
.card-fields input:hover, .card-fields textarea:hover { border-color: transparent; }
.card-fields input:focus, .card-fields textarea:focus { background: var(--panel); border-color: var(--accent); }
.card-meta { font-size: 11.5px; color: var(--faint); padding: 1px 0 0; }
.card-del { position: absolute; right: 6px; top: 8px; opacity: 0; color: var(--muted); }
.card-del.armed { opacity: 1; width: auto !important; padding: 0 8px; background: var(--warn); color: #fff; }
.card-item:hover .card-del, .card-item:focus-within .card-del { opacity: 1; }

.sb-main { padding: 32px 40px 48px; min-width: 0; max-width: 1320px; width: 100%; display: grid; gap: 12px; align-content: start; }
.sb-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; }
.sb-heading { font-size: 26px; letter-spacing: -0.03em; font-weight: 800; }
.sb-summary { margin: 0; font-size: 13px; color: var(--muted); font-weight: 550; font-variant-numeric: tabular-nums; }
.cloud-offer, .example-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; font-size: 13px; }
.cloud-offer span, .example-hint span { flex: 1 1 320px; }

/* 줄 보기 */
.sb-cols, .cut-row { display: grid; grid-template-columns: 30px minmax(220px, 300px) minmax(0, 1fr) minmax(0, 1fr) 84px 28px; gap: 20px; }
.sb-cols { font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; color: var(--faint); padding: 0 21px; }
.sb.grid-mode .sb-cols { display: none; }
.cut-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cut-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; align-items: start; box-shadow: var(--shadow-sm); transition: border-color 0.12s, box-shadow 0.12s; }
.cut-row:hover, .cut-row:focus-within { border-color: var(--line-strong); box-shadow: var(--shadow); }
.cut-num { font-size: 15px; font-weight: 750; color: var(--faint); font-variant-numeric: tabular-nums; text-align: left; line-height: 34px; }
.cut-row:focus-within .cut-num, .cut-row:hover .cut-num { color: var(--accent); }
.cut-pic { display: grid; gap: 8px; min-width: 0; }
.cut-frame { position: relative; aspect-ratio: var(--ar, 3 / 2); max-width: 100%; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.cut-frame img, .cut-frame canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 「AI 생성」 표시(SB-LEGAL-P2-002·003): 그림 오른쪽 위에 작게. 인쇄에도 그대로 찍힌다 */
.ai-badge { position: absolute; right: 6px; top: 6px; font-size: 10.5px; font-weight: 650; line-height: 1.5; color: #17171a; background: rgba(255, 255, 255, 0.9); border-radius: 5px; padding: 0 6px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); pointer-events: none; }
.ai-badge.inline { position: static; display: inline-block; vertical-align: 1px; }
.ai-notice { margin: 0; }
.cut-missing { position: absolute; left: 6px; bottom: 6px; right: 6px; font-size: 11px; color: #333; background: rgba(255, 255, 255, 0.88); border-radius: 6px; padding: 2px 6px; }
.cut-shot { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-pic-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.cut-row .cut-pic-btns button { padding: 0 8px; gap: 4px; font-size: 12px; }
.cut-row .cut-pic-btns .ic { width: 14px; height: 14px; }
.cut-field { display: grid; gap: 4px; min-width: 0; font-size: 12px; }
.cut-field-name { color: var(--faint); font-size: 11.5px; font-weight: 650; display: none; }
.cut-field textarea {
  font-size: 14px; line-height: 1.65; min-height: 92px; padding: 6px 10px; margin: -6px 0 0 -10px; width: calc(100% + 10px);
  resize: none; overflow: hidden; border-color: transparent; background: transparent; box-shadow: none;
}
.cut-field textarea::placeholder { color: var(--faint); opacity: 0.75; }
.cut-field textarea:hover { background: var(--hover); border-color: transparent; }
.cut-field textarea:focus { background: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cut-time { display: block; }
.cut-sec { display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 8px 0 2px; border-radius: 8px; background: var(--hover); }
.cut-sec input { width: 6ch; appearance: textfield; -moz-appearance: textfield; height: 26px; padding: 0 2px; text-align: right; border-color: transparent; background: transparent; box-shadow: none !important; font-weight: 650; font-variant-numeric: tabular-nums; }
/* 숫자 화살표가 「3.1」 뒷자리를 가려 숨긴다(방향키로는 그대로 바뀐다) */
.cut-sec input::-webkit-inner-spin-button, .cut-sec input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; display: none; }
.cut-sec input:hover { border-color: transparent; }
.cut-sec input:focus { background: var(--panel); border-color: var(--accent); }
.cut-sec-unit { font-size: 12.5px; color: var(--muted); }
.cut-tools { display: grid; gap: 2px; justify-items: center; }
/* 컷 도구는 늘 옅게 보이고(SB-UX-001) 마우스를 올리거나 초점이 가면 진하게 */
.cut-tools button { width: 28px; height: 28px; padding: 0; border-color: transparent; background: transparent; box-shadow: none; color: var(--faint); opacity: 0.5; }
.cut-tools button .ic { width: 15px; height: 15px; }
.cut-row:hover .cut-tools button, .cut-row:focus-within .cut-tools button { opacity: 1; }
.cut-tools button:hover:not(:disabled) { color: var(--ink); background: var(--hover); }
.cut-tools button.danger:hover:not(:disabled) { color: var(--warn); }
.cut-tools button.armed { width: auto; padding: 0 8px; opacity: 1; background: var(--warn); color: #fff; font-size: 11.5px; }
/* 끌어 옮기기 손잡이(SB-UX-002): 컷 번호. 올리면 손잡이 표시가 붙는다 */
.drag-handle { cursor: grab; user-select: none; border-radius: 6px; }
.cut-num.drag-handle { padding-left: 2px; }
.cut-row:hover .cut-num.drag-handle::before { content: '⋮⋮'; letter-spacing: -3px; margin-right: 3px; font-size: 12px; color: var(--faint); vertical-align: 1px; }
.drag-handle:active { cursor: grabbing; }
.cut-row.dragging, .cut-tile.dragging { opacity: 0.45; }
.cut-row.drop-on, .cut-tile.drop-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.add-cut { justify-self: stretch; height: 52px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); border-radius: var(--radius); box-shadow: none; font-weight: 600; }
.add-cut:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sb.grid-mode .add-cut { display: none; }
.print-text { display: none; }

/* 격자 보기 */
.cut-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.cut-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; align-content: start; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s; }
.cut-tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tile-pic { position: relative; }
.tile-pic .cut-frame { border-radius: 0; box-shadow: none; }
.tile-num { z-index: 1; position: absolute; left: 10px; top: 10px; background: rgba(255, 255, 255, 0.94); color: #17171a; border-radius: 7px; padding: 1px 8px; font-weight: 750; font-size: 12.5px; font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.tile-sec { position: absolute; right: 10px; bottom: 10px; background: rgba(23, 23, 26, 0.72); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-pic .cut-pic-btns { position: absolute; inset: 0; align-content: center; justify-content: center; padding: 12px; background: rgba(23, 23, 26, 0.38); opacity: 0; transition: opacity 0.15s; }
.cut-tile:hover .tile-pic .cut-pic-btns, .cut-tile:focus-within .tile-pic .cut-pic-btns { opacity: 1; }
.tile-text { display: block; width: 100%; height: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 12px 14px 14px; text-align: left; white-space: normal; cursor: text; font-weight: 400; line-height: 1.5; }
.tile-text:hover { background: var(--hover); border: 0; }
.tile-video { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.tile-audio { font-size: 12.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-empty { color: var(--faint); }
.cut-grid .tile-add { aspect-ratio: var(--ar, 3 / 2); height: auto; border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; color: var(--muted); border-radius: var(--radius); align-self: start; width: 100%; font-weight: 600; }
.cut-grid .tile-add:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (max-width: 1380px) { .cut-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .cut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 컷 편집 화면 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: calc(100vh - 60px); min-height: 560px; }
.stage { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.cam-area { position: relative; container-type: size; min-height: 0; margin: 16px 16px 10px; }
/* 큰 칸: 3:2를 지키며 칸 안에 가득(넘치지 않게 가로·세로 중 작은 쪽에 맞춘다) */
.cam-area > .preview-wrap, .stage.plan-big .cam-area > .plan-pip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(100cqw, calc(var(--arn, 1.5) * 100cqh)); height: auto; aspect-ratio: var(--ar, 3 / 2); right: auto; bottom: auto;
}
.preview-wrap { border-radius: 14px; overflow: hidden; background: #fff; touch-action: none; cursor: grab; user-select: none; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.preview-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.preview-wrap .photo-ghost { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.45; pointer-events: none; }
.preview-wrap.photo-drop { outline: 3px dashed var(--accent); outline-offset: -3px; }
.preview-wrap.dragging { cursor: grabbing; }
.preview-wrap.over-person { cursor: move; }
#overlay { pointer-events: none; }
/* 평면도 작은 창(구석) */
.plan-pip {
  position: absolute; right: 14px; bottom: 14px; z-index: 4; width: min(320px, 34cqw); display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.plan-pip #board { height: 150px; }
.pip-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 6px 4px 12px; font-size: 12px; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); }
.pip-head small { color: var(--faint); font-weight: 450; margin-left: 4px; }
.pip-head .row-btns { gap: 0; flex-wrap: nowrap; }
.pip-head button { color: var(--muted); }
#board { width: 100%; display: block; background: var(--board-bg); touch-action: none; cursor: grab; }
#board.dragging { cursor: grabbing; }
/* 자리 바꾸기: 평면도가 크게, 카메라 화면이 구석 작은 창 */
.stage.plan-big .cam-area > .plan-pip { z-index: 1; box-shadow: var(--shadow); border-radius: 14px; }
.stage.plan-big .plan-pip #board { height: 100%; min-height: 0; }
.stage.plan-big .pip-head > span:first-child { visibility: hidden; }
.stage.plan-big .cam-area > .preview-wrap {
  left: auto; top: auto; right: 14px; bottom: 14px; transform: none; z-index: 4; width: min(320px, 34cqw); box-shadow: var(--shadow-lg); border-radius: 12px;
}
.cam-tools { position: absolute; left: 14px; top: 14px; right: 14px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; pointer-events: none; }
.cam-tools > *, .tool-group > * { pointer-events: auto; }
.cam-tools button, .tool-group label.check, .tool-label { color: #17171a; }
.cam-tools > button { background: rgba(255, 255, 255, 0.95); border-color: transparent; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16); }
.cam-tools > button:hover { background: #fff; }
.tool-group { display: inline-flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16); }
.tool-group button { border-color: transparent; background: transparent; box-shadow: none; }
.tool-group button:hover { background: rgba(0, 0, 0, 0.06); border-color: transparent; }
.tool-group label.check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 0 6px; }
.tool-group label.check input { margin: 0; }
.tool-group select { height: 26px; padding: 0 4px; font-size: 12.5px; background: #fff; color: #17171a; border-color: #e1e1dc; }
.tool-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 0 6px 0 8px; color: #5f5f66 !important; }
.drop-item { touch-action: none; cursor: grab; }
.drop-ghost { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -120%); background: var(--accent); color: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.drop-target { outline: 3px dashed var(--accent); outline-offset: -3px; }
.help-pop {
  position: absolute; left: 14px; top: 56px; z-index: 8; width: min(400px, calc(100% - 28px));
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 13px;
}
.help-title { display: block; font-size: 13.5px; margin-bottom: 6px; }
.help-steps { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.help-more summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 12.5px; margin-bottom: 8px; }
.help-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.help-pop dt { color: var(--muted); white-space: nowrap; font-weight: 600; }
.help-pop dd { margin: 0; }
.help-pop p { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cam-msg { position: absolute; left: 14px; right: 14px; top: 56px; z-index: 6; margin: 0; pointer-events: none; }
.cam-msg:has(#photoMsg:empty) { display: none; }
#photoMsg { display: inline-block; max-width: 720px; background: rgba(23, 23, 26, 0.84); color: #fff; font-size: 12.5px; padding: 6px 12px; border-radius: 9px; }
.cam-foot { position: absolute; left: 14px; bottom: 14px; z-index: 5; display: grid; gap: 4px; justify-items: start; max-width: calc(100% - 360px); pointer-events: none; }
.cam-foot p { margin: 0; background: rgba(23, 23, 26, 0.72); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.cam-foot p:empty { display: none; }
.stage.plan-big .cam-foot { max-width: calc(100% - 28px); }

/* 이 컷의 그림 줄 */
.gen-strip { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 16px 12px; min-width: 0; }
.strip-head { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.strip-head b { color: var(--ink); font-weight: 700; }
.gen-strip .note { margin: 4px 0 0; }
.gen-strip .gen-results { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 2px; }
.gen-card { position: relative; }
.gen-card .ai-badge { top: 6px; right: 6px; }
.gen-card { flex: 0 0 150px; height: auto; display: grid; gap: 4px; padding: 0; border: 0; background: transparent; box-shadow: none; text-align: left; font-size: 11.5px; font-weight: 450; color: var(--muted); white-space: normal; align-content: start; line-height: 1.4; }
.gen-card:hover { background: transparent; }
.gen-card img { width: 150px; aspect-ratio: var(--ar, 3 / 2); object-fit: cover; border-radius: 9px; background: var(--bg); display: block; box-shadow: inset 0 0 0 1px var(--line); outline: 2px solid transparent; outline-offset: 1px; transition: outline-color 0.12s; }
.gen-card:hover img { outline-color: var(--line-strong); }
.gen-card.picked img { outline-color: var(--accent); }
.gen-card span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gen-card.missing img { visibility: hidden; }
.gen-card.missing::after { content: "그림은 생성 서버에서만 보입니다"; font-size: 11px; color: var(--muted); }

/* 오른쪽 탭 패널 */
.insp { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; flex: none; }
.tabs [role="tab"] { height: 46px; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0 10px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs [role="tab"]:hover { background: transparent; color: var(--ink); border-color: transparent; border-bottom-color: var(--line-strong); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panes { flex: 1; min-height: 0; overflow: auto; }
.pane { padding: 6px 18px 18px; }
.group-label { font-size: 12px; color: var(--muted); font-weight: 650; margin: 16px 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.group-label small { font-weight: 450; color: var(--faint); }
.ctrl { display: grid; grid-template-columns: 96px minmax(0, 1fr) 62px; gap: 10px; align-items: center; margin: 8px 0; }
.ctrl .lbl { font-size: 13px; line-height: 1.25; font-weight: 550; }
.ctrl .lbl small { display: block; margin-top: 1px; }
.ctrl input[type="range"] { width: 100%; accent-color: var(--accent); }
.ctrl > input[type="number"] { width: 100%; height: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.ctrl.lens { grid-template-columns: 1fr; margin-top: 0; }
.lens-row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.lens-row select { flex: 1 1 110px; }
.lens-fine { display: inline-flex; gap: 2px; align-items: center; margin-left: 4px; }
.lens-row input { width: 52px; height: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.ctrl.pos { grid-template-columns: 1fr 1fr; margin-top: 0; }
.ctrl.pos label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.ctrl.pos input { width: 100%; height: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chip { height: 30px; border-radius: 999px; padding: 0 13px; }
.chip.sel { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 650; }
.chip .star { color: var(--accent); margin-left: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.form-grid input, .form-grid select { width: 100%; color: var(--ink); height: 32px; font-weight: 450; }
.form-grid .wide { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; align-items: center; margin: 12px 0 8px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.btn-grid { display: grid; gap: 6px; }
.btn-grid.shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.btn-grid.levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.btn-grid button { height: 34px; padding: 0 6px; font-size: 12.5px; white-space: normal; line-height: 1.2; }
.block { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; margin-top: 12px; }
#promptEn { font: 12px/1.55 ui-monospace, Consolas, monospace; background: var(--bg); }
.prompt-sum { margin: 0; padding: 10px 12px 10px 28px; font-size: 13px; line-height: 1.6; background: var(--bg); border-radius: 9px; display: grid; gap: 4px; }
.prompt-en { margin-top: 14px; }
.prompt-en summary { cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.prompt-en .row-btns { margin-bottom: 6px; }
.prompt-en textarea { width: 100%; }
/* 고정 생성 칸 */
.gen { flex: none; border-top: 1px solid var(--line); padding: 14px 18px 16px; display: grid; gap: 8px; background: var(--panel); }
.gen-head { font-size: 13px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.gen p { margin: 0; }
.gen-cards { color: var(--ink); }
.gen-pass { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gen-pass input { flex: 1; }
/* 생성 단추의 크레딧 표시와 「구도 잡기에는 크레딧이 들지 않음」 줄(SB-UXF3-001) */
.gen-cost { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 12px; font-weight: 600; white-space: nowrap; }
.gen p.gen-free { font-size: 12px; color: var(--muted); text-align: center; }

/* 크게 보기·창 */
.gen-viewer { position: fixed; inset: 0; z-index: 50; background: rgba(14, 16, 22, 0.62); backdrop-filter: blur(2px); display: grid; place-items: safe center; padding: 20px; overflow-y: auto; }
.gen-viewer figure { margin: 0; max-width: min(1200px, 100%); }
.viewer-card { padding: 18px; gap: 12px; }
.viewer-card .modal-x { position: absolute; right: 10px; top: 10px; margin: 0; z-index: 2; background: rgba(255, 255, 255, 0.9); }
.gen-viewer img { max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; display: block; margin: 0 auto; border-radius: 8px; }
/* 말로 고치기 칸을 열면 그림을 줄여 칸과 단추가 한 화면에 들어오게 한다 */
.gen-viewer figure:has(#editPanel:not([hidden])) img { max-height: max(200px, calc(100vh - 420px)); }
.gen-viewer figcaption { font-size: 13px; color: var(--muted); padding-right: 36px; }
.viewer-stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; touch-action: none; overflow: hidden; border-radius: 8px; }
.viewer-stage.drawing { cursor: crosshair; }
.crop-box { position: absolute; border: 2px solid #ffd23f; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); cursor: move; }
.crop-h { position: absolute; width: 14px; height: 14px; background: #ffd23f; border: 1px solid #222; border-radius: 3px; }
.crop-h[data-h="nw"] { left: -2px; top: -2px; cursor: nwse-resize; }
.crop-h[data-h="ne"] { right: -2px; top: -2px; cursor: nesw-resize; }
.crop-h[data-h="sw"] { left: -2px; bottom: -2px; cursor: nesw-resize; }
.crop-h[data-h="se"] { right: -2px; bottom: -2px; cursor: nwse-resize; }
.card-maker { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--bg); }
.edit-label { font-size: 13px; font-weight: 550; }
.edit-panel textarea { min-height: 60px; }
.edit-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.edit-meta .over { color: var(--warn); }
.conflict-card { max-width: 580px; }
/* 배경·소품 장면 창(SB-SCENE-P1) */
.scene-box { max-width: 600px; width: 100%; gap: 18px; }
.scene-part { display: grid; gap: 8px; }
.scene-part h3 { font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.scene-part textarea { min-height: 76px; }
.scene-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 26px 20px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--bg); color: var(--muted); transition: border-color 0.12s, background 0.12s;
}
.scene-drop .drop-main { font-size: 13.5px; color: var(--ink); font-weight: 550; }
.scene-drop .note { margin: 2px 0 0; max-width: 420px; font-size: 12px; }
.scene-drop.over { border-color: var(--accent); background: var(--accent-soft); }
/* 카드 그림 고르기 창(SB-CARDIMG-P1) */
.pick-box { max-width: 760px; width: 100%; }
.pick-choose { display: grid; gap: 14px; }
.pick-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--bg); }
.pick-upload .note { margin: 0; }
.pick-upload .pick-privacy { flex-basis: 100%; font-size: 12px; } /* 사진 인물 카드 처리 안내(SB-LEGAL-007) */
.pick-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-height: 52vh; overflow: auto; padding: 2px; }
.pick-item { height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; display: grid; gap: 4px; text-align: left; font-weight: 450; }
.pick-item:hover { background: transparent; }
.pick-item img { width: 100%; aspect-ratio: var(--ar, 3 / 2); object-fit: cover; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line); outline: 2px solid transparent; outline-offset: 1px; display: block; background: var(--bg); }
.pick-item:hover img, .pick-item:focus-visible img { outline-color: var(--accent); }
.pick-item .sub { font-size: 11.5px; }
.pick-crop { display: grid; gap: 12px; }
.pick-crop .viewer-stage img { max-width: 100%; max-height: 58vh; display: block; }
.card-pic { height: auto; width: auto; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 8px; }
.card-pic:hover { background: transparent; }
.card-pic:hover .card-thumb { border-color: var(--accent); color: var(--accent); }
.card-thumb .card-add { font-size: 10.5px; font-weight: 600; }
@media (max-width: 760px) { .pick-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 편의성 고침(SB-UX-P1) ---------- */
.hist { display: inline-flex; gap: 2px; margin-left: 4px; }
.hist button { width: 32px; height: 32px; padding: 0; }
.hist button:disabled { opacity: 0.35; }
.cam-guide {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; width: min(440px, calc(100% - 32px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 16px 18px; display: grid; gap: 10px; font-size: 13.5px; line-height: 1.6;
}
.cam-guide ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.cam-guide button { justify-self: end; }
.help-pop #btnGuideAgain { margin-top: 6px; }
/* 카메라 화면 왼쪽 아래 읽기 글과 같은 어두운 띠. 글 띠는 누를 수 없지만(pointer-events) 이 상자는 누를 수 있다 */
.cam-foot .pole-note { pointer-events: auto; background: rgba(23, 23, 26, 0.72); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 7px; gap: 6px; cursor: pointer; }
.cam-foot .pole-note .sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.75); }
.cam-foot .pole-note input { margin: 0; }
.looks { display: grid; gap: 6px; }
.looks-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.looks-row > .sub { min-width: 52px; font-size: 11.5px; }
.chip-btn { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 999px; }
.chip-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
.face-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; align-content: center; flex: 1; }
.face-btns button { height: 28px; padding: 0 6px; font-size: 12px; }
.facing { display: grid; gap: 6px; }
.facing-label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.facing-row { display: flex; gap: 12px; align-items: center; }
.face-dial { width: 92px; height: 92px; flex: none; border-radius: 50%; cursor: grab; touch-action: none; color: var(--ink); }
.face-dial:active { cursor: grabbing; }
.face-dial:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.face-dial svg { width: 100%; height: 100%; display: block; }
.dial-ring { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.5; }
.dial-n { font-size: 9px; font-weight: 700; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.dial-cam { fill: var(--muted); }
.dial-hand { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; fill: none; }
.dial-hub { fill: var(--accent); }
.num-fold summary { cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.num-fold .form-grid { margin-top: 8px; }
.btn-grid.shots button { display: flex; align-items: center; gap: 8px; justify-content: flex-start; height: 44px; }
.btn-grid.levels button { display: flex; flex-direction: column; align-items: center; gap: 2px; height: auto; padding: 6px 4px; }
.lvl-ic { width: 44px; height: 56px; color: var(--muted); }
.btn-grid.levels button.on .lvl-ic { color: currentColor; }
.shot-ic { width: auto; height: 32px; aspect-ratio: var(--ar, 3 / 2); flex: none; border-radius: 3px; background: var(--hover); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.btn-grid.shots button.on .shot-ic { background: rgba(255, 255, 255, 0.22); color: currentColor; box-shadow: none; }
.scene-login { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; font-weight: 600; }
.scene-login span { flex: 1 1 220px; }
.scene-drop.locked { opacity: 0.55; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1100px) {
  .sb-cols { display: none; }
  .cut-row { grid-template-columns: 30px minmax(0, 1fr); gap: 12px 16px; }
  .cut-row > :not(.cut-num) { grid-column: 2; }
  .cut-num { grid-row: 1 / span 5; }
  .cut-field-name { display: block; }
  .cut-tools { grid-template-columns: repeat(4, auto); justify-content: start; }
  .cut-tools button { opacity: 1; }
  .cut-pic { max-width: 420px; }
  .cut-field textarea { min-height: 64px; }
  .sb-main { padding: 24px; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .cam-area { height: 62vw; }
  .insp { border-left: 0; border-top: 1px solid var(--line); }
  .panes { overflow: visible; }
}
@media (max-width: 760px) {
  .small-screen { display: block; }
  .topbar { position: static; padding: 10px 14px; }
  .side { top: 0; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); gap: 16px; }
  .edit-lock { top: 0; }
  .sb { grid-template-columns: minmax(0, 1fr); }
  .sb-main { padding: 18px 16px; }
  .cut-row { padding: 16px; }
  .cut-grid { grid-template-columns: minmax(0, 1fr); }
  .doc { flex: 1 1 100%; order: 3; border-left: 0; padding-left: 0; }
  .doc-title { width: 100%; max-width: none; }
  .plan-pip { width: min(220px, 46cqw); }
  .cam-foot { max-width: calc(100% - 28px); }
  .card-del, .my-board-del { opacity: 1; }
}
/* 휴대폰 표(SB-UX-009): 그림을 작게 왼쪽에, 글은 오른쪽에 나란히 — 한 화면에 여러 컷 */
@media (max-width: 640px) {
  /* 휴대폰 첫 화면에 컷이 보이게(SB-UX2-006): 위 막대 단추는 그림만, 인물 카드·계정 안내는 컷 아래로 */
  .topbar { gap: 6px 8px; padding: 8px 12px; }
  .brand-name, .bar-sep { display: none; }
  #boardActions { gap: 6px; }
  #boardActions > button, #boardActions .seg button { font-size: 0; gap: 0; padding: 0 9px; }
  #btnLogin { font-size: 12.5px; padding: 0 10px; height: 32px; }
  .small-screen { font-size: 12.5px; padding: 6px 12px; }
  .sb { display: flex; flex-direction: column; }
  .sb-main { order: 1; }
  .side { order: 2; border-bottom: 0; border-top: 1px solid var(--line); }
  /* 휴대폰 컷 칸 더 촘촘하게(SB-UX2-020): 칸 이름은 화면 읽기 프로그램에만, 시간과 도구는 한 줄 */
  .cut-row { grid-template-columns: 20px 96px minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px; }
  .cut-row > :not(.cut-num) { grid-column: 3 / span 2; }
  .cut-row > .cut-pic { grid-column: 2; grid-row: 1 / span 3; max-width: none; }
  .cut-num { grid-row: 1 / span 3; font-size: 13px; line-height: 22px; }
  .cut-row > .cut-time { grid-column: 3; grid-row: 3; flex-direction: row; align-items: center; gap: 6px; }
  .cut-row > .cut-tools { grid-column: 4; grid-row: 3; align-self: center; }
  .cut-row .cut-field:not(.cut-time) > .cut-field-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cut-row .cut-shot { display: none; }
  .cut-row .cut-pic-btns { flex-direction: column; }
  .cut-row .cut-pic-btns button { width: 100%; justify-content: center; font-size: 11.5px; padding: 0 4px; height: 28px; }
  .cut-field textarea { min-height: 0; field-sizing: content; font-size: 13.5px; line-height: 1.5; padding-block: 4px; }
  .cut-field-name { font-size: 11px; }
}
@media (max-width: 480px) {
  .ctrl { grid-template-columns: 80px minmax(0, 1fr) 58px; }
  .btn-grid.levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .edit-lock, .topbar, .small-screen, .cut-tools, .cut-edit, .cut-redo, .cut-scene, #scenePanel, .add-cut, .sb .note, #editorView, .toast, .cards-panel, .my-boards, .cloud-offer, .example-hint, #conflictBox { display: none !important; }
  #boardSide, #cutGrid, .side-guest, #cardPicker, #shareBox, #paidOnly, #tour { display: none !important; }
  #cutList { display: grid !important; }
  body { background: #fff; color: #000; }
  .sb { display: block; min-height: 0; }
  .sb-main { padding: 0; max-width: none; }
  .sb-heading { font-size: 20px; color: #000; }
  .sb-cols { display: grid !important; grid-template-columns: 32px 240px 1fr 1fr 60px; color: #000; padding: 0 6px; }
  .cut-row { grid-template-columns: 32px 240px 1fr 1fr 60px; break-inside: avoid; border-color: #999; border-radius: 0; padding: 6px; box-shadow: none; }
  .cut-row > * { grid-column: auto !important; grid-row: auto !important; }
  .cut-field-name { display: none !important; }
  .cut-field textarea, .cut-sec { display: none !important; }
  .print-text { display: block; white-space: pre-wrap; font-size: 12px; }
  .cut-num { color: #000; }
  .ai-badge { display: inline-block !important; color: #000; background: #fff; box-shadow: 0 0 0 1px #666; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* 체험 계정(SB-PAY-012): 단축키로 인쇄해도 표 대신 안내만 찍는다 */
  .paid-only, .biz-foot, body.no-export .sb { display: none !important; }
  body.no-export::after { content: '인쇄는 유료 요금제에서 쓸 수 있습니다 · slatebloc.com/pricing'; display: block; padding: 40px 24px; font-size: 16px; }
}

/* 화면 비율(SB-UX2-008): 방향이 다른 옛 그림은 자르지 않고 여백, 세로 스토리보드의 컷 그림 칸은 좁게, 크게 보기는 쓰지 않는 띠를 덮는다 */
img.ar-off { object-fit: contain !important; background: var(--bg); }
.ar-portrait .cut-row .cut-frame { width: min(100%, 190px); margin-inline: auto; }
.ar-portrait .gen-card img { width: 96px; }
.ar-portrait .gen-card { flex-basis: 96px; }
.viewer-band { position: absolute; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); outline: 1.5px dashed rgba(255, 255, 255, 0.85); z-index: 1; }
.aspect-pick { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.aspect-pick select { height: 30px; font-size: 13px; }.viewer-stage:has(.crop-box:not([hidden])) .viewer-band { display: none; }
.pick-gen { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; margin-bottom: 10px; }
.pick-gen .sub { display: block; margin-top: 2px; }
/* 공유 링크 창(SB-UX2-012·013) */
/* 유료 안내 상자(SB-UXF3-003) */
.share-upsell { display: grid; gap: 8px; background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; }
.share-upsell p { margin: 0; }
.paid-only p.paid-pitch { margin: 0 0 8px; }
.modal.share-box {width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.share-live { display: grid; gap: 8px; }
.share-link { display: flex; gap: 6px; }
.share-link input { flex: 1; min-width: 0; height: 34px; font-size: 13px; }
.share-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.share-comment { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.share-comment .sc-who { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; }
.share-comment .sc-who button { margin-left: auto; height: 24px; }
.share-comment p { margin: 4px 0 0; white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; }
/* 따라 하기 안내(SB-UX2-017): 밝힌 요소 밖은 어둡게, 밝힌 요소는 눌러 쓸 수 있다 */
.tour { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 12, 20, 0.5); outline: 2px solid #ffd23f; transition: all 0.2s; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 16px)); pointer-events: auto; background: var(--panel); color: var(--ink); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 16px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.55; }
.tour-card p { margin: 0; }
.help-pop #btnTour { margin: 4px 0 2px; }
.cam-guide .row-btns { justify-content: flex-end; }
/* 외모·옷 골라서 넣기(SB-UX2-018) */
.looks-title { font-size: 12.5px; color: var(--muted); font-weight: 600; }
/* 샷 크기 미리보기(SB-UX2-019): 지금 장면의 구도를 그림으로 */
.btn-grid.shots button.has-prev { height: auto; min-height: 44px; padding: 5px 6px; }
.btn-grid.shots button.has-prev .shot-ic { display: none; }
.shot-prev { width: 64px; height: auto; flex: none; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
