/* ── 파스텔 다이어리 팔레트 ───────────────────── */
:root {
  --paper: #fff7fa;
  --grid-line: #ffe3ec;
  --ink: #5d4a5f;
  --muted: #a28aa4;
  --pink: #ff8fb8;
  --pink-dark: #f0679a;
  --pink-soft: #ffe0ec;
  --lavender: #d9ccff;
  --lavender-soft: #f1ecff;
  --mint: #c4f0de;
  --mint-soft: #f2fbf7;
  --butter: #fff2b3;
  --sky: #cfe8ff;
  --stitch: #ffc2d6;
  --blue: #7aa7ff;
  --radius: 22px;
  --panel-width: 230px;
  --control-height: 46px;
  --font-body: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-cute: "Fredoka", "Jua", "Malgun Gothic", sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* 화면 전체는 스크롤되지 않고, 페이지 영역과 썸네일 목록만 필요할 때 스크롤돼요 */
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ── 아이콘 ───────────────────────────────────── */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 버튼 ─────────────────────────────────────── */
button, input { font: inherit; color: inherit; }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 2px solid var(--pink-soft);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-cute);
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--pink-soft);
  transition: transform .12s, box-shadow .12s, background .12s;
}
button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--pink); box-shadow: 0 4px 0 var(--stitch); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--stitch); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
button.primary {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  font-size: 1.1rem;
  padding: 10px 22px;
  box-shadow: 0 4px 0 var(--pink-dark);
}
button.primary:hover:not(:disabled) { background: var(--pink-dark); border-color: var(--pink-dark); box-shadow: 0 4px 0 #c84c7c; }

/* ── 상단: 리본 로고 + 검색바 + 인쇄하기 ───────── */
.toolbar {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 12px 24px 16px;
  background: var(--pink-soft);
}
/* 가리비 모양 아랫단 */
.toolbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 10px;
  background: radial-gradient(circle at 9px 0, var(--pink-soft) 8px, transparent 8.5px) 0 0 / 18px 10px repeat-x;
}

.logo {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cute);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: .5px;
  color: var(--pink-dark);
  text-shadow: 2px 2px 0 #fff;
  white-space: nowrap;
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.logo-link:hover .logo-bow { transform: rotate(8deg) scale(1.1); }
.logo-link:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 12px; }
.logo-bow {
  width: 1.3em;
  height: 1.3em;
  color: var(--pink);
  stroke: var(--pink-dark);
  stroke-width: 1.2;
  transform: rotate(-10deg);
  transition: transform .2s;
}

.search {
  flex: 0 1 340px;
  margin-left: auto;        /* 로고는 왼쪽, 검색바와 인쇄하기는 오른쪽 */
  margin-right: -10px;      /* 인쇄하기 버튼 쪽으로 10px 붙여요 */
  min-width: 200px;
  height: var(--control-height);
  display: flex;
  align-items: stretch;
  padding: 4px;
  border: 2px dashed var(--pink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 0 var(--stitch);   /* 검색창 그림자는 연한 분홍 */
}
.search:focus-within { border-style: solid; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 14px;
  font-size: 1rem;
  background: transparent;
}
.search input::placeholder { color: var(--muted); }
.search button {
  border: 0;
  background: var(--pink);
  color: #fff;
  padding: 0 18px;
  font-size: 1rem;
  box-shadow: none;
}
.search button:hover:not(:disabled) { background: var(--pink-dark); box-shadow: none; transform: none; }

.print-btn {
  height: var(--control-height);
  padding-block: 0;
}

/* ── 왼쪽 사이드바 + 오른쪽 페이지 ─────────────── */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--panel-width) minmax(0, 1fr);
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 8px 18px 20px;
}

/* 다이어리 스티커 카드: 안쪽 바느질선 */
.panel-section {
  position: relative;
  margin: 0;
  padding: 16px 14px 14px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 0 var(--pink-soft), 0 6px 18px rgba(240, 103, 154, .08);
}
.panel-section::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px dashed var(--stitch);
  border-radius: calc(var(--radius) - 5px);
  pointer-events: none;
}

.page-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--lavender-soft);
}
.page-list::before { border-color: var(--lavender); }

.panel-buttons {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--mint-soft);
}
.panel-buttons::before { border-color: var(--mint); }

.summary {
  margin: 0;
  text-align: center;
  font-family: var(--font-cute);
  color: var(--ink);
}

/* 사이드바 페이지 썸네일 */
.page-thumbs {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
}
.page-thumbs::-webkit-scrollbar { width: 8px; }
.page-thumbs::-webkit-scrollbar-thumb { background: var(--lavender); border-radius: 999px; }

.side-thumb {
  position: relative;
  flex: none;
}
.side-thumb-open {
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.side-thumb-open:hover:not(:disabled),
.side-thumb-open:active:not(:disabled) { box-shadow: none; }
.side-thumb-number {
  width: 22px;
  text-align: right;
  font-size: .9rem;
  color: var(--muted);
}
.side-thumb .thumb-paper { border-radius: 4px; outline: 3px solid transparent; outline-offset: 2px; }
.side-thumb:hover .thumb-paper { outline-color: var(--stitch); }
.side-thumb.selected .thumb-paper { outline-color: var(--pink); }
.side-thumb.selected .side-thumb-number { color: var(--pink-dark); font-weight: 700; }

/* 썸네일 오른쪽 위 페이지 삭제(X) */
.side-thumb-remove {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 13px;
  color: var(--pink-dark);
  opacity: 0;
  transition: opacity .15s, transform .12s;
}
.side-thumb:hover .side-thumb-remove,
.side-thumb:focus-within .side-thumb-remove,
.side-thumb.selected .side-thumb-remove { opacity: 1; }
.side-thumb-remove:disabled { opacity: 0 !important; }
.side-thumb-remove:hover:not(:disabled) { background: var(--pink-soft); }
@media (hover: none) { .side-thumb-remove { opacity: 1; } }

.thumb-paper { border-radius: 4px; outline: 3px solid transparent; outline-offset: 2px; }
.side-thumb:hover .thumb-paper { outline-color: var(--stitch); }
.side-thumb.selected .thumb-paper { outline-color: var(--pink); }
.side-thumb.selected .side-thumb-number { color: var(--pink-dark); font-weight: 700; }

.thumb-paper {
  line-height: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(93, 74, 95, .15);
}
.thumb-paper .sheet { box-shadow: none; border-radius: 0; }
.thumb-paper .sheet::before,
.thumb-paper .sheet::after { display: none; }
.thumb-paper .cell { outline: none; }
.thumb-paper .slot { background: none; border-width: 2mm; border-color: #fbe6ee; }

/* ── 페이지 미리보기 (인쇄 영역) ──────────────── */
.pages {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 28px;               /* app.js의 PAGES_GAP_PX와 맞춰요 */
  padding: 20px 24px 20px 12px;
}
.pages::-webkit-scrollbar { width: 12px; height: 12px; }
.pages::-webkit-scrollbar-thumb { background: var(--stitch); border-radius: 999px; border: 3px solid var(--paper); }

.page-wrap {
  flex: none;
  display: flex;
  flex-direction: column;
}

/* 페이지 위 버튼 줄: 왼쪽 몇 개씩 / 오른쪽 페이지 삭제 (높이는 app.js의 PAGE_HEAD_PX) */
.page-head {
  height: 38px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
}
.page-counts {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.count-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: .85rem;
  border-width: 0;
  background: var(--butter);
  box-shadow: 0 2px 0 #f4dc79;
}
.count-btn:nth-of-type(3n+2) { background: var(--sky); box-shadow: 0 2px 0 #a9d0f5; }
.count-btn:nth-of-type(3n) { background: var(--mint); box-shadow: 0 2px 0 #97dcc0; }
.count-btn[aria-pressed="true"] { background: var(--pink); color: #fff; box-shadow: 0 2px 0 var(--pink-dark); }
.page-remove {
  flex: none;
  padding: 5px 12px;
  font-size: .85rem;
  color: var(--pink-dark);
}

.sheet {
  position: relative;
  width: 210mm;
  height: 296mm;          /* 297mm 그대로 쓰면 빈 페이지가 끼는 브라우저가 있어요 */
  padding: 10mm;
  background: #fff;
  border-radius: 2mm;
  box-shadow: 0 2mm 0 var(--pink-soft), 0 3mm 10mm rgba(240, 103, 154, .15);
  display: grid;
  align-content: start;
  gap: 6mm;
  overflow: hidden;
  outline: 1.5mm solid transparent;
  cursor: pointer;
}
.page-wrap.selected .sheet { outline-color: var(--pink); cursor: default; }
.page-wrap.drop-target .sheet { outline: 2mm dashed var(--lavender); }

/* 페이지 위 마스킹테이프 (인쇄되지 않아요) */
.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  top: 1.5mm;
  width: 34mm;
  height: 7mm;
  opacity: .85;
  background: repeating-linear-gradient(45deg, var(--pink-soft) 0 2.5mm, #fff 2.5mm 5mm);
  pointer-events: none;
}
.sheet::before { left: 8mm; transform: rotate(-4deg); }
.sheet::after {
  right: 8mm;
  transform: rotate(5deg);
  background: repeating-linear-gradient(90deg, var(--mint) 0 3mm, #e9fbf3 3mm 6mm);
}

.cell {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 2mm;
  outline: 1px dashed var(--pink-soft);
}
.cell img,
.cell canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--image-width, 100%);
  height: var(--image-height, 100%);
  transform: translate(-50%, -50%) rotate(var(--image-rotation, 0deg));
  object-fit: contain;
  display: block;
}

.cell img[hidden] { display: none; }

.cell.broken img { visibility: hidden; }
.cell.broken::after {
  content: "그림을 불러오지 못했어요";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2mm;
  text-align: center;
  color: var(--muted);
  font-size: 4mm;
}

/* 그림 위 버튼들: 화면 배율과 상관없이 같은 크기로 보이도록 app.js가 zoom을 맞춰요 */
.cell-tools {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100% - 12px);
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.cell:hover .cell-tools,
.cell:focus-within .cell-tools { opacity: 1; }
@media (hover: none) { .cell-tools { opacity: 1; } }
.cell-tools button {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 15px;
  box-shadow: 0 2px 0 var(--pink-soft);
}
.cell-tools button.remove { color: var(--pink-dark); }
.cell-tools button.remove:hover { background: var(--pink-soft); }

.cell-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-family: var(--font-cute);
  font-size: 13px;
  pointer-events: none;
}
.cell-badge span {
  min-width: 24px;
  text-align: center;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  box-shadow: 0 2px 0 var(--pink-dark);
}
.cell-badge .low-res { background: #ffc93c; color: var(--ink); box-shadow: 0 2px 0 #e0a800; }

.freeze-btn {
  background: var(--lavender);
  border-color: #fff;
  box-shadow: 0 2px 0 #b6a3f0;
}
.cell.frozen .freeze-btn { background: var(--mint); box-shadow: 0 2px 0 #97dcc0; }

.cell[draggable="true"] { cursor: grab; }
.cell.dragging { opacity: .4; cursor: grabbing; }
.cell[data-drop-edge]::before {
  content: "";
  position: absolute;
  z-index: 1;
  background: var(--pink);
  pointer-events: none;
}
.cell[data-drop-edge="left"]::before { inset: 0 auto 0 0; width: 4px; }
.cell[data-drop-edge="right"]::before { inset: 0 0 0 auto; width: 4px; }
.cell[data-drop-edge="top"]::before { inset: 0 0 auto; height: 4px; }
.cell[data-drop-edge="bottom"]::before { inset: auto 0 0; height: 4px; }

.slot {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3mm;
  padding: 3mm;
  text-align: center;
  color: var(--muted);
  font-size: 4.5mm;
  line-height: 1.5;
  border: 3px dashed var(--stitch);
  border-radius: 5mm;
  background: radial-gradient(circle, var(--pink-soft) .6mm, transparent .7mm) 0 0 / 6mm 6mm;
}
.slot.hint { font-family: var(--font-cute); font-size: 6mm; color: var(--pink-dark); }
.slot.hint small { display: block; margin-top: 2mm; font-family: var(--font-body); font-size: 4.2mm; color: var(--muted); }
.slot.hint .icon {
  width: 16mm;
  height: 16mm;
  color: var(--pink);
  stroke: var(--pink-dark);
  stroke-width: 1.2;
}

/* ── 레이어 (사용 방법 · 인쇄 고르기) ─────────── */
.help {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 24px 28px;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
  line-height: 32px;
  background:
    linear-gradient(90deg, transparent 38px, var(--stitch) 38px 40px, transparent 40px),
    repeating-linear-gradient(#fff 0 31px, var(--sky) 31px 32px);
  box-shadow: 0 8px 0 var(--pink-soft), 0 20px 60px rgba(93, 74, 95, .3);
  overflow: auto;
}
.help::backdrop { background: rgba(255, 170, 200, .35); backdrop-filter: blur(2px); }
.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: 22px;
}
.help h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cute);
  font-size: 1.5rem;
  color: var(--pink-dark);
}
.help h2 .icon { color: var(--pink); }
.help-close {
  width: 38px;
  height: 38px;
  padding: 0;
}
.help ol { margin: 8px 0 16px; padding-left: 42px; }
.help-ok { display: flex; margin-left: auto; }
kbd {
  display: inline-block;
  padding: 0 7px;
  line-height: 1.5;
  border: 2px solid var(--lavender);
  border-radius: 8px;
  background: var(--lavender-soft);
  font: inherit;
  font-size: .9em;
}

.print-dialog {
  width: min(760px, calc(100vw - 32px));
  line-height: 1.5;
  background: #fff;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
  margin: 18px 0;
  padding: 14px;
  border: 2px dashed var(--stitch);
  border-radius: 18px;
  background: var(--paper);
  max-height: 58vh;
  overflow-y: auto;
}
.thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.thumb input {
  position: absolute;
  top: -6px;
  left: 4px;
  z-index: 1;
  width: 24px;
  height: 24px;
  accent-color: var(--pink-dark);
  cursor: pointer;
}
.thumb .thumb-paper { outline: 3px solid transparent; outline-offset: 3px; border-radius: 3px; }
.thumb:has(input:checked) .thumb-paper { outline-color: var(--pink); }
.thumb.is-empty { opacity: .45; cursor: not-allowed; }
.thumb-caption { font-family: var(--font-cute); }
.print-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── 끌어다 놓기 / 알림 ───────────────────────── */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(255, 143, 184, .12);
  border: 8px dashed var(--pink);
  pointer-events: none;
}
.drop-overlay-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 36px;
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-cute);
  font-size: 1.6rem;
  color: var(--pink-dark);
  box-shadow: 0 6px 0 var(--pink-soft), 0 12px 30px rgba(240, 103, 154, .25);
}
.drop-overlay-box .icon { color: var(--pink); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 24px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--pink);
  color: var(--pink-dark);
  font-family: var(--font-cute);
  box-shadow: 0 4px 0 var(--pink-soft), 0 8px 20px rgba(240, 103, 154, .2);
}

/* 좁은 화면에서는 사이드바를 위, 페이지를 아래로 */
@media (max-width: 640px) {
  body { overflow: auto; height: auto; }
  .workspace { grid-template-columns: 1fr; }
  .panel { padding: 20px 16px 0; }
  .page-thumbs { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .pages { overflow: visible; padding: 20px 16px 40px; }
  .search { margin-left: 0; margin-right: 0; }
}

/* ── 인쇄 ─────────────────────────────────────── */
@page {
  size: A4 portrait;
  margin: 0;   /* 브라우저가 붙이는 날짜·주소 머리글을 없앱니다 */
}

@media print {
  html, body { height: auto; overflow: visible; background: #fff; display: block; }
  .no-print, .cell-tools, .cell-badge, .freeze-btn, .slot { display: none !important; }
  .workspace, .pages { display: block; overflow: visible; padding: 0; }
  .page-wrap { display: block; width: auto !important; }
  .page-wrap.skip-print { display: none; }
  /* 인쇄되는 페이지 앞에 인쇄되는 페이지가 있을 때만 새 장으로 넘겨요 (맨 앞 빈 장 방지) */
  .page-wrap:not(.skip-print) ~ .page-wrap:not(.skip-print) { break-before: page; }
  .sheet { zoom: 1 !important; box-shadow: none; border-radius: 0; outline: none !important; }
  .sheet::before, .sheet::after { display: none; }
  .cell { outline: none; }
  .cell.broken { visibility: hidden; }
}

/* 입체도형 전개도 */
.panel { overflow-y: auto; }
.page-list { flex: 1 0 220px; }
.net-controls { display:flex; flex-direction:column; gap:10px; background:#fff9ed; flex:none; }
.net-controls[hidden] { display:none; }
.net-controls strong { font-family:var(--font-cute); color:var(--pink-dark); }
.net-controls label { display:flex; flex-direction:column; gap:4px; font-size:14px; }
.net-controls select,.net-controls input[type=number] { width:100%; min-width:0; border:1px solid var(--stitch); border-radius:9px; background:white; padding:7px; font:inherit; }
.net-controls small { font-size:12px; line-height:1.5; }
.net-controls button { padding:7px 8px; font-size:13px; }
.net-rotate-buttons { display:flex; gap:6px; }
.net-rotate-buttons button { flex:1; }
.net-page-title { font-family:var(--font-cute); color:var(--pink-dark); }
.net-sheet { display:block; }
.net-svg { display:block; width:190mm; height:276mm; overflow:visible; }
.net-print-title { font-size:4px; fill:#333; }
.net-print-note { font-size:2.6px; fill:#444; }
.net-outline { fill:none; stroke:#333; stroke-width:.3; pointer-events:none; }
.net-tab { fill:url(#net-hatch); stroke:#333; stroke-width:.3; }
.net-fold,.net-fold-cover { fill:none; stroke:#444; stroke-width:.3; stroke-dasharray:1.5 1; pointer-events:none; }
.net-fold-cover { stroke:white; stroke-width:.65; stroke-dasharray:none; }
.net-face-bg { fill:white; }
.net-face.active .net-face-bg { fill:#fff4f8; }
.net-face.over .net-face-bg { fill:#d7f5e9; }
.net-placeholder { fill:#ba7893; font-size:3px; pointer-events:none; }
.net-image-holder { width:100%; height:100%; position:relative; }
.net-image-holder img { width:100%; height:100%; object-fit:contain; display:block; transform-origin:center; user-select:none; }
.net-image-holder.broken::after { content:'그림을 불러오지 못했어요'; position:absolute; inset:0; background:white; font-size:3px; display:grid; place-items:center; }
.net-face { cursor:pointer; touch-action:none; }
.net-handle { cursor:grab; touch-action:none; }
.net-handle line { stroke:#ed6b9f; stroke-width:.4; stroke-dasharray:1 1; }
.net-handle circle { fill:#fff; stroke:#ed6b9f; stroke-width:.5; }
.net-handle text { fill:#d94b85; font-size:4px; pointer-events:none; }
.net-handle:focus { outline:none; }
.net-handle:focus circle { stroke:#5743ca; stroke-width:1; }
@media print {
 .net-face-bg,.net-face.active .net-face-bg { fill:white; }
 .net-sheet { print-color-adjust:exact; -webkit-print-color-adjust:exact; }
}

/* 도형 라이브러리와 레이아웃 셀 */
.net-library { flex:none; background:#fff9ed; display:flex; flex-direction:column; gap:8px; }
.net-library > strong { font-family:var(--font-cute); color:var(--pink-dark); }
.net-library > small { font-size:12px; }
.net-palette { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.net-palette-card { flex-direction:column; white-space:normal; padding:7px 2px; border-radius:12px; font-size:12px; cursor:grab; }
.net-palette-card svg { width:54px; height:46px; pointer-events:none; }
.net-palette-card:active { cursor:grabbing; }
.cell.net-cell { border-radius:0; }
.net-cell > .net-svg { width:100%; height:100%; }
.net-cell .net-image-holder img { position:static; left:auto; top:auto; width:100%; height:100%; }
.net-cell-tools { z-index:2; }
.net-cell-tools button { width:auto; min-width:30px; padding:0 7px; font-size:12px; }
.net-move { cursor:grab; }
.slot.drop-target,.cell.drop-target { outline:3px dashed var(--pink); background:#fff0f7; }
.net-editor { width:min(1000px,94vw); max-height:92vh; border:0; border-radius:22px; background:#fffafc; padding:20px; color:var(--ink); }
.net-editor::backdrop { background:#67425466; }
.net-editor-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; font-family:var(--font-cute); }
.net-editor-body { display:grid; grid-template-columns:220px minmax(0,1fr); align-items:start; gap:24px; }
.net-editor .net-controls { padding:14px; border-radius:14px; }
#net-editor-preview { background:white; width:100%; max-height:70vh; border:1px solid var(--stitch); }
#net-editor-preview .net-svg { width:100%; height:100%; max-height:70vh; }
@media(max-width:640px){.net-editor-body{grid-template-columns:1fr;} .net-editor .net-controls{max-height:30vh;overflow:auto;} .net-palette{grid-template-columns:repeat(3,1fr);}}
@media print{.net-cell{outline:none;} .net-cell .net-face-bg{fill:white;} .net-cell{print-color-adjust:exact;-webkit-print-color-adjust:exact;}}

@media print { .sheet > .slot { display:block !important; visibility:hidden; } }

/* 오른쪽 도형 목록, 면 단위 드롭 안내, 선택한 그림의 크기 손잡이 */
.workspace { grid-template-columns:var(--panel-width) minmax(0,1fr) 200px; }
.net-right-panel { padding:24px 16px 18px 0; min-height:0; overflow:auto; }
.net-right-panel .net-library { padding:16px 12px; }
.net-face-drop { display:none; fill:#ff8fb844; stroke:#ec5794; stroke-width:.7; stroke-dasharray:2 1; pointer-events:none; }
.net-drop-label { display:none; fill:#d9417d; stroke:white; stroke-width:1.2; paint-order:stroke; font-family:var(--font-cute); font-size:3.5px; pointer-events:none; }
.net-face.over .net-face-drop,.net-face.over .net-drop-label { display:block; }
.net-resize-handle { display:none; cursor:nwse-resize; touch-action:none; }
.net-face.active .net-resize-handle { display:block; }
.net-resize-handle rect { fill:white; stroke:#dc558b; stroke-width:.5; }
.net-resize-handle text { fill:#dc558b; font-size:5px; pointer-events:none; }
.net-resize-handle:focus rect { stroke:#5743ca; stroke-width:1; }
@media(max-width:900px) and (min-width:641px){.workspace{grid-template-columns:180px minmax(0,1fr) 155px;}.net-right-panel{padding-right:8px;}.net-palette-card svg{width:44px;height:40px;}}
@media(max-width:640px){.workspace{grid-template-columns:1fr;}.net-right-panel{grid-row:2;padding:12px 16px 0;}.pages{grid-row:3;}.net-palette{grid-template-columns:repeat(3,1fr);}}
