/* 웹툰용 Canvas(/webtoon/canvas) — 2026-11-23 대표 「웹 버전으로 구현 … 말풍선 달고 글자 배치 … pdf로 다운받거나 이미지 저장」
   ★ 2026-11-23 대표 「캔바는 흰색으로 할까?」 「기존 canvas가 소프트웨어라서 그런지 실제 제작 도구 처럼 보인다. 그런 느낌이 들게 Ui 만들어봐」
     → 밤 푸른 바탕 위의 흰 프로그램 창(.wc-app). 각진 단추 · 촘촘한 칸 · 회색 작업대 위의 흰 원고. 창 안의 색은 tokens.css 의 .wc-light 묶음.
   색은 tokens.css 의 변수만 쓴다. 한 화의 폭은 690(웹툰 낱장 규격). */
@font-face { font-family: "Black Han Sans"; src: url("/assets/fonts/black-han-sans/BlackHanSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Nanum Pen Script"; src: url("/assets/fonts/nanum-pen-script/NanumPenScript-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }

.wc-head { margin-bottom: 18px; }
.wc-terms { margin: 10px 0 0; font-size: 13px; line-height: 1.65; color: var(--wt-text-3); word-break: keep-all; }
.wc-terms a { color: var(--wt-text-2); text-decoration: underline; }
.wc-terms a:hover, .wc-terms a:focus-visible { color: var(--wt-yellow); }

/* ── 창 ── */
.wc-app { border: 1px solid var(--wt-line-2); border-radius: 12px; background: var(--wt-bg-2); color: var(--wt-text); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); font-size: 13px; }
.wc-top { position: sticky; top: 68px; z-index: 12; border-radius: 12px 12px 0 0; background: var(--wt-bg); border-bottom: 1px solid var(--wt-line-2); transition: top .22s ease; }
/* ★ 2026-11-23 대표 「Canvas메뉴바를 상단에 고정해」 — 사이트 맨 위 줄은 아래로 내리면 접힌다(html.wh-fold). 그때 도구 줄이 68px 아래에 남아 틈으로 그림이 비쳤다 → 접히면 화면 맨 위에 붙는다 */
html.wh-fold .wc-top { top: 0; border-radius: 0; box-shadow: 0 6px 18px rgba(11, 26, 51, .18); }
html.wh-fold .wc-cuts, html.wh-fold .wc-prop { top: 108px; max-height: calc(100vh - 126px); }
.wc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--wt-line); }
.wc-title__name { font-size: 15px; font-weight: 800; color: var(--wt-text); }
.wc-title__meta { font-size: 12px; font-weight: 600; color: var(--wt-text-3); }
.wc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; }
.wc-bar__cap { margin-right: 2px; font-size: 11px; font-weight: 700; color: var(--wt-text-3); }
.wc-bar__sep { width: 1px; align-self: stretch; margin: 2px 6px; background: var(--wt-line-2); }

/* 단추 — 각진 작은 단추(프로그램 도구 줄) */
.wc-btn { min-height: 30px; padding: 0 11px; border: 1px solid var(--wt-line-3); border-radius: 5px; background: var(--wt-bg); color: var(--wt-text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.wc-btn:hover:not(:disabled), .wc-btn:focus-visible { border-color: var(--wt-text); background: var(--wt-chip); outline: none; }
.wc-btn:disabled { opacity: .4; cursor: default; }
.wc-btn--y { border-color: var(--wt-text); background: var(--wt-text); color: var(--wc-on); }
.wc-btn--y:hover:not(:disabled), .wc-btn--y:focus-visible { background: var(--wt-text-soft); color: var(--wc-on); }
.wc-btn--line { border-color: var(--wt-text); }
.wc-btn--wide { width: 100%; }
.wc-btn--del { border-color: var(--wc-hot); color: var(--wc-hot); }
.wc-btn--del:hover:not(:disabled), .wc-btn--del:focus-visible { border-color: var(--wc-hot); background: var(--wc-hot); color: var(--wc-on); }
.wc-note { min-height: 18px; margin: 0; padding: 6px 14px; font-size: 12px; color: var(--wt-text-2); }
.wc-note:empty { min-height: 0; padding: 0; }

/* ── 세 칸: 컷 목록 / 작업대 / 속성 ── */
.wc-body { display: grid; grid-template-columns: 176px minmax(0, 1fr) 288px; gap: 10px; align-items: start; padding: 10px; }
.wc-cuts, .wc-prop { position: sticky; top: 176px; max-height: calc(100vh - 194px); transition: top .22s ease; overflow-y: auto; padding: 10px; border: 1px solid var(--wt-line-2); border-radius: 6px; background: var(--wt-bg); }
.wc-cuts h2, .wc-prop h2 { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--wt-line); font-size: 12px; font-weight: 800; color: var(--wt-text-2); }
.wc-cuts ol { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: cut; }
.wc-cut { counter-increment: cut; display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: start; padding: 5px; border: 1px solid var(--wt-line); border-radius: 4px; background: var(--wt-bg-2); }
.wc-cut::before { content: counter(cut) "번 컷"; grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--wt-text-3); }
.wc-cut img { display: block; width: 100%; height: auto; max-height: 110px; object-fit: cover; object-position: top; border-radius: 2px; cursor: pointer; }
.wc-cut__acts { display: grid; gap: 3px; }
.wc-cut__acts button { width: 24px; height: 24px; border: 1px solid var(--wt-line-2); border-radius: 4px; background: var(--wt-bg); color: var(--wt-text-2); font-size: 12px; line-height: 1; cursor: pointer; }
.wc-cut__acts button:hover:not(:disabled), .wc-cut__acts button:focus-visible { border-color: var(--wt-text); color: var(--wt-text); outline: none; }
.wc-cut__acts button:disabled { opacity: .35; cursor: default; }

.wc-wrap { min-height: 560px; padding: 24px 12px 60px; border: 1px solid var(--wt-line-2); border-radius: 6px; background: var(--wc-work); overflow: hidden; }
.wc-wrap.is-over { border-color: var(--wt-text); box-shadow: inset 0 0 0 2px var(--wt-text); }
.wc-empty { display: grid; justify-items: center; gap: 12px; width: min(460px, 100%); margin: 70px auto 0; padding: 56px 24px; border: 1px dashed var(--wt-line-3); border-radius: 4px; background: var(--wt-bg); text-align: center; }
.wc-empty b { font-size: 17px; font-weight: 800; color: var(--wt-text); }
.wc-empty span { max-width: 380px; font-size: 13px; line-height: 1.6; color: var(--wt-text-2); word-break: keep-all; }
.wc-empty[hidden], .wc-scale[hidden] { display: none; }
.wc-scale { margin: 0 auto; }
.wc-stage { position: relative; width: 690px; transform-origin: 0 0; box-shadow: 0 2px 14px rgba(11, 26, 51, .22); user-select: none; -webkit-user-select: none; touch-action: none; }
.wc-stage > img { position: absolute; left: 0; width: 690px; pointer-events: none; }
.wc-ov { position: absolute; cursor: move; }
.wc-ov canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.wc-ov.is-on { outline: 2px dashed var(--wc-hot); outline-offset: 2px; }
.wc-tail { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid var(--wt-ink); border-radius: 50%; background: var(--wt-yellow); cursor: grab; }

/* 속성 칸 — 작은 이름표 + 각진 입력 */
.wc-f { display: grid; gap: 4px; margin: 0 0 12px; font-size: 11.5px; font-weight: 700; color: var(--wt-text-3); }
.wc-f > span { display: flex; justify-content: space-between; gap: 8px; }
.wc-f output { font-weight: 700; color: var(--wt-text); }
.wc-f textarea, .wc-f select { width: 100%; padding: 7px 8px; border: 1px solid var(--wt-line-3); border-radius: 4px; background: var(--wt-bg); color: var(--wt-text); font: inherit; font-size: 13px; font-weight: 500; resize: vertical; }
.wc-f textarea:focus, .wc-f select:focus { border-color: var(--wt-text); outline: none; }
.wc-f input[type="range"] { width: 100%; accent-color: var(--wt-text); }
.wc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wc-seg { display: flex; flex-wrap: wrap; gap: 0; }
.wc-seg button { min-height: 28px; padding: 0 12px; margin-left: -1px; border: 1px solid var(--wt-line-3); border-radius: 0; background: var(--wt-bg); color: var(--wt-text-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.wc-seg button:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.wc-seg button:last-child { border-radius: 0 4px 4px 0; }
.wc-seg button.is-on { position: relative; border-color: var(--wt-text); background: var(--wt-text); color: var(--wc-on); }
.wc-check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 12px; line-height: 1.5; color: var(--wt-text-2); cursor: pointer; }
.wc-check input { margin-top: 3px; accent-color: var(--wt-text); }
.wc-row { display: flex; flex-wrap: wrap; gap: 6px; }
.wc-fine { margin: 0; padding: 8px; border-radius: 4px; background: var(--wt-bg-2); font-size: 12px; line-height: 1.65; color: var(--wt-text-2); word-break: keep-all; }
.wc-status { margin: 0; padding: 7px 14px; border-top: 1px solid var(--wt-line-2); border-radius: 0 0 12px 12px; background: var(--wt-bg); font-size: 11.5px; color: var(--wt-text-3); }

@media (max-width: 1180px) { .wc-body { grid-template-columns: minmax(0, 1fr) 264px; } .wc-cuts { position: static; grid-column: 1 / -1; max-height: none; } .wc-cuts ol { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } }
@media (max-width: 760px) { .wc-top { position: static; } .wc-body { grid-template-columns: minmax(0, 1fr); padding: 6px; } .wc-prop { position: static; max-height: none; } .wc-wrap { min-height: 420px; padding: 12px 6px 40px; } .wc-empty { margin-top: 24px; padding: 36px 14px; } }

/* PDF 에서 쓸 쪽 고르기 */
.wc-pdf { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--wt-line-2); border-radius: 10px; background: var(--wt-bg); color: var(--wt-text); overflow: hidden; }
.wc-pdf[open] { display: flex; flex-direction: column; }
.wc-pdf::backdrop { background: rgba(0, 0, 0, .72); }
.wc-pdf__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--wt-line-2); }
.wc-pdf__bar b { font-size: 15px; font-weight: 800; }
.wc-pdf__note { min-height: 20px; margin: 10px 14px 0; font-size: 12.5px; color: var(--wt-text-2); }
.wc-pdf__grid { flex: 1; min-height: 160px; margin: 0; padding: 14px; overflow-y: auto; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; align-content: start; background: var(--wc-work); }
.wc-pdf__grid button { position: relative; display: grid; gap: 6px; justify-items: center; width: 100%; padding: 8px; border: 2px solid var(--wt-line-2); border-radius: 4px; background: var(--wt-bg); color: var(--wt-text-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.wc-pdf__grid button canvas { display: block; max-width: 100%; height: auto; min-height: 60px; border-radius: 2px; background: var(--wt-line); }
.wc-pdf__grid button[aria-pressed="true"] { border-color: var(--wt-text); color: var(--wt-text); }
.wc-pdf__grid button:focus-visible { outline: 2px solid var(--wt-text); outline-offset: 2px; }
.wc-pdf__foot { display: flex; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--wt-line-2); }
