/* ==========================================================================
   무료 바코드제작 스타일
   - 색: 잉크(글자·버튼), 크라프트(라벨이 놓이는 상자 면), 도장 빨강(무료출력)
   - 글꼴: IBM Plex Sans KR / 바코드 번호 입력칸만 IBM Plex Mono
           도구의 단계 제목만 G마켓 산스('SB Title', assets/fonts — 한글 2,350자만 담은 웹용 파일)
   ========================================================================== */

@font-face {
  font-family: 'SB Title'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/sb-title-500.woff2') format('woff2');
}
@font-face {
  font-family: 'SB Title'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/sb-title-700.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --ink: #1d1c1a;
  --ink-2: #57544e;
  --ink-3: #8a867e;
  --line: #dcd9d3;
  --line-2: #ecebe7;
  --bg: #f2f3f4;
  --paper: #ffffff;
  --kraft: #c5a679;
  --kraft-light: #d9c39d;
  --kraft-ink: #3a2c1b;
  --stamp: #d42f28;
  --stamp-dark: #b3231d;
  --laser: #ff2d2d;
  --ok: #146c43;
  --ok-bg: #e5f3eb;
  --warn: #93560a;
  --err: #bf2a1c;
  --err-bg: #fbeceb;
  --focus: #1f5fd6;
  --sky: #e7f4fd;
  --sky-line: #b8dbf2;
  --font: 'IBM Plex Sans KR', 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', sans-serif;
  --mono: 'IBM Plex Mono', Consolas, 'D2Coding', monospace;
  --title: 'SB Title', 'IBM Plex Sans KR', 'Malgun Gothic', '맑은 고딕', sans-serif;
  --kraft-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .45' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .1 0 0 0 1.1 -.42'/%3E%3C/filter%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='8'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .17 0 0 0 0 .08 0 0 0 1.4 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) {
  .wrap, .wrap-narrow { padding: 0 24px; }
}

/* ---------------------------------------------------------------- 헤더 */

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: flex-end; min-height: 62px; }
.free-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--stamp);
  color: var(--stamp); font-weight: 700; font-size: 14.5px; text-decoration: none; white-space: nowrap;
}
.free-pill .icon { width: 16px; height: 16px; }
.free-pill:hover { background: var(--stamp); color: #fff; }

@media (max-width: 760px) {
  .header-row { min-height: 54px; }
}

/* ---------------------------------------------------------------- 버튼 · 입력 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-lg { min-height: 56px; font-size: 17px; border-radius: 12px; }
.btn-lg .icon { width: 22px; height: 22px; }
.btn-free {
  background: var(--stamp); color: #fff;
  box-shadow: inset 0 0 0 2px var(--stamp), inset 0 0 0 3.5px rgba(255, 255, 255, .6);
}
.btn-free:hover { background: var(--stamp-dark); box-shadow: inset 0 0 0 2px var(--stamp-dark), inset 0 0 0 3.5px rgba(255, 255, 255, .6); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }
.btn-line { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-file { position: relative; }
.btn-file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; font-size: 0; }
.btn-file:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.link-btn {
  border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 700;
  color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; white-space: nowrap;
}

input, select, textarea, button { font: inherit; color: inherit; }
input[type='text'], input[type='number'], select, textarea {
  height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
  width: 100%; min-width: 0;
}
textarea { height: auto; padding: 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(31, 95, 214, .2); }
input[type='number'] { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 히어로 */

.hero { padding-top: 30px; padding-bottom: 20px; }
.hero h1 {
  margin: 0 0 10px; font-size: clamp(1.65rem, 1.1rem + 2vw, 2.4rem);
  line-height: 1.22; letter-spacing: -0.035em; font-weight: 700; max-width: 22em;
}
.hero-lead { margin: 0; font-size: 17px; color: var(--ink-2); max-width: 44em; }
.hero-free { margin: 14px 0 0; font-weight: 500; }
.free-note { display: block; font-size: 12.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- 도구 */

.tool { padding-bottom: 8px; }
.tool-grid { display: grid; gap: 20px; }
.tool-main {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 8px 18px 20px; min-width: 0;
}
.tool-side { min-width: 0; }
@media (min-width: 1024px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr) 430px; gap: 24px; }
  .tool-main { align-self: start; }
  .tool-main { padding: 10px 26px 26px; }
  .side-sticky { position: sticky; top: 16px; }
}
@media (max-width: 1023px) {
  .tool-side { order: -1; }
}

.step { border: 0; margin: 0; padding: 22px 0 20px; min-width: 0; border-top: 1px solid var(--line-2); }
.step:first-child { border-top: 0; }
.step-title {
  float: left; width: 100%;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0; margin: 0 0 12px; font-family: var(--title); font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}
.step-title + * { clear: both; }
.step-no {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none;
  border: 1.5px solid var(--ink); border-radius: 6px; font-size: 13px; line-height: 1;
}
.step-aside { font-size: 14px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.step-hint { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }

.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice .chip {
  position: relative; display: flex; flex-direction: column; gap: 1px; min-width: 96px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); transition: border-color .12s;
}
.chip-badge {
  position: absolute; top: -9px; right: -6px; padding: 1px 7px; border-radius: 999px;
  background: var(--stamp); color: #fff; font-size: 11.5px; font-weight: 700; font-style: normal; line-height: 1.5;
}
.choice .chip b { font-size: 15px; letter-spacing: -0.01em; }
.choice .chip small { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.choice label:hover .chip { border-color: #b8b4ad; }
.choice input:checked + .chip { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:focus-visible + .chip { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-preset .chip { min-width: 128px; }
.choice-mini .chip { min-width: 0; padding: 6px 12px; font-size: 14px; }

/* 라벨 크기: 크라프트지 위에 놓인 라벨 견본 */
.free-line {
  display: flex; align-items: center; gap: 6px; margin: -4px 0 10px;
  color: var(--stamp); font-weight: 700; font-size: 14px;
}
.free-line .icon { width: 16px; height: 16px; }
.size-grid {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 4px;
  padding: 14px 12px 10px; border-radius: 12px;
  background: var(--kraft-light) var(--kraft-tex);
}
.size-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 54px; padding: 6px 5px 4px; border-radius: 8px; cursor: pointer;
}
.size-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.size-box { display: grid; place-items: end center; }
.size-svg { display: block; overflow: visible; }
.size-svg rect, .size-svg circle {
  fill: #fff; stroke: rgba(58, 44, 27, .18); stroke-width: 1px; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 1px rgba(58, 44, 27, .25));
}
.size-tile-custom .size-svg rect { fill: rgba(255, 255, 255, .45); stroke: var(--kraft-ink); stroke-width: 1.2px; filter: none; }
.size-name { font-size: 12px; font-weight: 500; color: var(--kraft-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.size-tile:hover { background: rgba(255, 255, 255, .28); }
.size-tile input:checked ~ .size-box .size-svg rect,
.size-tile input:checked ~ .size-box .size-svg circle { stroke: var(--ink); stroke-width: 2.5px; }
.size-tile input:checked ~ .size-name { color: var(--ink); font-weight: 700; }
.size-tile:has(input:checked) { background: rgba(255, 255, 255, .42); }
.size-tile input:focus-visible ~ .size-name { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.custom-size { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.custom-size label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.custom-size input { width: 84px; }
.custom-size .field-note { flex-basis: 100%; }
.field-note { margin: 0; font-size: 13px; color: var(--ink-2); }

/* 라벨에 넣을 내용: 바코드 번호 → 표시 항목 → 켠 항목의 입력칸 */
.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
input.mono { font-family: var(--mono); font-size: 15px; letter-spacing: -0.01em; }
input.mono::placeholder { font-family: var(--font); letter-spacing: 0; }
.field.has-error input { border-color: var(--err); }
.cell-msg { display: block; font-size: 12.5px; line-height: 1.45; color: var(--err); }
.cell-msg:empty { display: none; }

.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font-size: 14px; cursor: pointer; user-select: none;
}
.toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.toggle:has(input:checked) { border-color: var(--ink); }
.toggle[hidden] { display: none; }
.fields { display: grid; gap: 12px; margin-top: 16px; }
.fields:not(:has(.field:not([hidden]))) { display: none; }
.inline-pair { display: flex; gap: 8px; }
.inline-pair select { width: auto; flex: none; }
.inline-pair input { flex: 1; }

@media (max-width: 719px) {
  .tool-main { padding: 4px 14px 16px; }
}

/* ---------------------------------------------------------------- 미리보기 무대 */

.stage {
  position: relative; display: grid; place-items: center;
  /* max-width: 최소 높이가 비율을 타고 가로로 번져 360px 휴대폰에서 넘치는 것 방지 */
  aspect-ratio: 5 / 4; min-height: 250px; max-width: 100%; border-radius: 16px; overflow: hidden;
  background: var(--kraft) var(--kraft-tex);
  box-shadow: inset 0 0 0 1px rgba(58, 44, 27, .14), inset 0 -40px 60px -40px rgba(58, 44, 27, .25);
}
@media (max-width: 1023px) {
  .stage { aspect-ratio: 16 / 11; max-height: 62vh; }
}
.stage-label { position: relative; cursor: grab; touch-action: none; }
.stage-label.is-dragging { cursor: grabbing; }
.stage-label svg {
  display: block;
  filter: drop-shadow(0 1px .5px rgba(58, 40, 16, .35)) drop-shadow(0 12px 18px rgba(58, 40, 16, .28));
}
.stamp-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sample-chip {
  position: absolute; left: 14px; top: 14px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .82); color: var(--kraft-ink); font-size: 12.5px; font-weight: 700;
}
/* 내용이 안 들어가 인쇄할 수 없는 라벨 (화면은 확대돼서 멀쩡해 보이므로 따로 표시) */
.risk-chip {
  position: absolute; right: 14px; top: 14px; padding: 3px 10px; border-radius: 999px;
  background: var(--err); color: #fff; font-size: 12.5px; font-weight: 700;
}

/* 스캔 확인: 바코드가 정상일 때 한 번 */
.scanline {
  position: absolute; height: 2px; margin-top: -1px; border-radius: 2px; pointer-events: none;
  background: var(--laser);
  box-shadow: 0 0 5px 1px rgba(255, 45, 45, .8), 0 0 18px 5px rgba(255, 45, 45, .32);
  animation: scan-flash 950ms ease-out forwards;
}
.scanline-qr { margin-top: 0; animation: scan-sweep 1150ms ease-in-out forwards; }
@keyframes scan-flash {
  0% { transform: scaleX(.05); opacity: 0; }
  14% { transform: scaleX(1); opacity: 1; }
  28% { opacity: .55; }
  38% { opacity: 1; }
  72% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
@keyframes scan-sweep {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  88% { transform: translateY(var(--travel, 60px)); opacity: 1; }
  100% { transform: translateY(var(--travel, 60px)); opacity: 0; }
}

.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 8px; }
.pager { display: flex; align-items: center; margin-right: auto; }
.drag-hint { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }
.pager:not([hidden]) + .drag-hint { display: none; }
.pager-count { min-width: 62px; text-align: center; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chip-meta {
  padding: 3px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
  font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip-meta:empty { display: none; }

.status {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; line-height: 1.5;
}
.status .icon { margin-top: 1px; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-error { background: var(--err-bg); color: var(--err); }
.status-info { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.issues { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.issues:empty { display: none; }
.issue { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.issue .icon { width: 16px; height: 16px; margin-top: 2px; }
.issue > span { flex: 1; }
.issue-error { color: var(--err); }
.issue-warn { color: var(--warn); }
.issue-info { color: var(--ink-2); }

/* 크기·위치 조절 (라벨 크기는 그대로, 내용만) */
.adjust {
  display: grid; gap: 6px; margin-top: 12px; padding: 12px 14px 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.adjust-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.adjust-title { margin: 0; font-family: var(--title); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.adj-row { display: grid; grid-template-columns: 44px 32px minmax(0, 1fr) 32px 44px; align-items: center; gap: 4px; min-height: 36px; }
.adj-label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.adj-step { width: 32px; height: 32px; font-size: 19px; line-height: 1; border: 1px solid var(--line); }
.adj-row input[type='range'] { width: 100%; margin: 0; accent-color: var(--ink); }
.adj-val { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.adj-row-pos { grid-template-columns: 44px auto minmax(0, 1fr); }
.adj-row:last-child { grid-template-columns: 44px minmax(0, 1fr); }
.nudge { display: flex; gap: 4px; }
.nudge .icon-btn { width: 34px; height: 32px; border: 1px solid var(--line); }
.icon-up { transform: rotate(90deg); }
.icon-down { transform: rotate(-90deg); }
.adj-pos { text-align: right; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.actions { display: grid; gap: 8px; margin-top: 14px; }

/* 휴대폰·태블릿(미리보기가 위, 만들기 단계가 아래): 두 영역을 띠로 나누고, 크기·위치 조절은 하늘색 칸으로 구분 */
.make-below { display: none; }
@media (max-width: 1023px) {
  .make-below {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 22px 0 0; padding: 13px 14px; border-radius: 12px;
    background: var(--ink); color: #fff; font-family: var(--title); font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  }
  .make-below .icon { width: 16px; height: 16px; }
  .adjust { margin-top: 16px; margin-bottom: 4px; background: var(--sky); border-color: var(--sky-line); }
}

.print-settings { margin-top: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.print-settings > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 700; font-size: 15px;
}
.print-settings > summary::-webkit-details-marker { display: none; }
.print-settings > summary::after {
  content: ''; width: 8px; height: 8px; margin-left: 4px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg) translateY(-2px); transition: transform .15s;
}
.print-settings[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.ps-summary { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.ps-body { display: grid; gap: 14px; padding: 2px 14px 16px; }
.ps-body .toggle { border: 0; padding: 4px 0; border-radius: 0; background: none; display: flex; }
.field-row, .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.field-row label, .field-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
[data-roll-only], [data-a4-only] { display: grid; gap: 10px; }
[data-roll-only][hidden], [data-a4-only][hidden], [data-a4-manual][hidden] { display: none; }

.request-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: var(--paper); border: 2px solid var(--stamp);
}
.request-banner p { margin: 0; }
.request-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 모바일 하단 고정 버튼 */
.mobile-bar { display: none; }
@media (max-width: 1023px) {
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line); transition: transform .2s ease;
  }
  .mobile-bar.is-hidden { transform: translateY(115%); }
  body.has-tool { padding-bottom: 72px; }
}

/* ---------------------------------------------------------------- 대화상자 · 알림 */

.dlg {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0;
  border: 0; border-radius: 18px; background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -24px rgba(20, 18, 14, .5);
}
.dlg::backdrop { background: rgba(29, 28, 26, .52); }
.dlg-inner { display: grid; gap: 14px; padding: 20px 22px 22px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-head h2 { margin: 0; font-size: 20px; }
.dlg-text { margin: 0; color: var(--ink-2); font-size: 15px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.free-summary {
  display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 14px;
  background: var(--kraft) var(--kraft-tex); color: var(--kraft-ink);
}
.free-thumb svg { display: block; width: 128px; height: auto; filter: drop-shadow(0 6px 10px rgba(58, 40, 16, .3)); }
.free-what { margin: 0; font-size: 18px; color: #241a0e; }
.free-sub { margin: 2px 0 0; font-size: 14px; }
.free-qty { display: flex; align-items: center; gap: 6px; padding: 2px 2px 0; }
.free-qty-label { margin-right: auto; font-weight: 700; }
.free-qty .icon-btn { border: 1px solid var(--line); font-size: 19px; line-height: 1; }
.free-qty-val { min-width: 56px; text-align: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.free-steps { counter-reset: fs; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.free-steps li { counter-increment: fs; display: grid; grid-template-columns: 26px 1fr; gap: 6px 10px; }
.free-steps li::before {
  content: counter(fs); display: grid; place-items: center; width: 24px; height: 24px; grid-row: span 2;
  border: 1.5px solid var(--ink); border-radius: 6px; font-size: 13px; font-weight: 700;
}
.free-steps li > * { grid-column: 2; }
.free-steps p { margin: 1px 0 0; font-weight: 500; }
.free-steps .btn { justify-self: start; }
.free-steps .free-apply-sub { margin: -4px 0 0; font-size: 13.5px; color: var(--err); }
.channel-naver { background: #03c75a; border-color: #03c75a; color: #fff; }
.channel-naver:hover { background: #02b351; border-color: #02b351; color: #fff; }
.channel-kakao { background: #fee500; border-color: #fee500; color: #191919; }
.channel-talktalk { background: #03c75a; border-color: #03c75a; color: #fff; }
.free-fine { margin: 0; font-size: 13px; color: var(--ink-3); }
.free-warn { margin: 12px 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; background: var(--err-bg); color: var(--err); }
.free-info {
  display: grid; justify-items: start; gap: 8px; margin: 12px 0; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.5; background: var(--sky); border: 1px solid var(--sky-line); color: var(--ink);
}
.free-info p { margin: 0; }
.free-fallback-note { grid-column: 2; margin: 4px 0 0; font-size: 13px; color: var(--err); }
.free-fallback { grid-column: 2; width: 100%; height: auto; font-size: 14px; line-height: 1.5; resize: vertical; }
.free-dev { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; background: #fff7dd; color: #6f5600; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14.5px; line-height: 1.5;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .18s, transform .18s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--err); }
.toast-ok { background: #17321f; }
@media (max-width: 1023px) {
  body.has-tool .toast { bottom: 88px; }
}

/* ---------------------------------------------------------------- 본문 섹션 */

.section { margin-top: 64px; }
.section-title { margin: 0 0 18px; font-size: 24px; letter-spacing: -0.03em; }
.section-lead { margin: -8px 0 20px; color: var(--ink-2); max-width: 44em; }

/* 용도별 추천 사이즈 · 바코드 (탭) */
.use-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.use-tab {
  min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); font-size: 15px; font-weight: 700; cursor: pointer;
}
.use-tab:hover { border-color: var(--ink); }
.use-tab[aria-selected='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.use-panel { display: grid; gap: 16px; padding: 20px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.use-lead { margin: 0; font-size: 16.5px; }
.use-meta { display: grid; gap: 10px; margin: 0; }
.use-meta div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; }
.use-meta dt { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.use-meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.use-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.use-example {
  display: grid; grid-template-rows: 1fr auto auto; justify-items: center; gap: 10px; min-width: 0; margin: 0;
  padding: 18px 14px 14px; border-radius: 14px; background: var(--kraft-light) var(--kraft-tex); color: var(--kraft-ink);
}
.use-label { display: grid; place-items: center; min-height: 110px; max-width: 100%; }
.use-label svg {
  display: block; max-width: 100%; height: auto;
  filter: drop-shadow(0 1px .5px rgba(58, 40, 16, .35)) drop-shadow(0 8px 12px rgba(58, 40, 16, .25));
}
.use-example figcaption { display: grid; justify-items: center; gap: 1px; text-align: center; }
.use-example figcaption strong { font-size: 15.5px; color: #241a0e; }
.use-example figcaption span { font-size: 13px; font-variant-numeric: tabular-nums; }
.use-note { margin: 0; font-size: 13.5px; color: var(--ink-3); }
@media (max-width: 560px) {
  .use-panel { padding: 16px 12px; }
  .use-meta div { grid-template-columns: 1fr; gap: 2px; }
  /* 휴대폰에선 예시 4개를 2×2로 */
  .use-examples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .use-example { padding: 12px 8px 10px; gap: 8px; }
  .use-label { min-height: 72px; }
  .use-example figcaption strong { font-size: 13.5px; }
  .use-example figcaption span { font-size: 12px; }
  .use-example .btn { padding: 0 8px; font-size: 13px; }
}

.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: ht; }
.howto li { counter-increment: ht; display: grid; grid-template-columns: 30px 1fr; gap: 2px 14px; align-content: start; }
.howto li::before {
  content: counter(ht); grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px;
  border: 1.5px solid var(--ink); border-radius: 7px; font-weight: 700; font-size: 14px;
}
.howto b { font-size: 17px; }
.howto span { color: var(--ink-2); }
@media (min-width: 900px) {
  .howto { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .howto li { grid-template-columns: 1fr; }
  .howto li::before { grid-row: auto; margin-bottom: 8px; }
}

/* 무료출력 안내 띠: 옅은 하늘색 바탕 위에 빨간 도장이 또렷하게 */
.free-band {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px 28px;
  padding: 26px 28px; border-radius: 18px; background: var(--sky); border: 1px solid var(--sky-line); color: var(--ink);
}
.free-band .stamp-svg { width: 168px; color: var(--stamp); transform: rotate(-6deg); mix-blend-mode: multiply; }
.free-band h2 { margin: 0 0 6px; font-size: 22px; }
.free-band p { margin: 0; color: var(--ink-2); }
.free-band .free-note { color: var(--ink-3); margin-top: 6px; }
.free-band .btn { margin-top: 14px; }
@media (max-width: 640px) {
  .free-band { grid-template-columns: 1fr; padding: 22px 20px; }
  .free-band .stamp-svg { width: 132px; }
}

.faq { margin-top: 64px; }
.faq > *, .prose-col > * { max-width: 760px; }
.faq h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.03em; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary {
  position: relative; padding: 16px 34px 16px 0; cursor: pointer; list-style: none; font-weight: 700; font-size: 16.5px;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: ''; position: absolute; right: 8px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg); transition: transform .15s;
}
.faq-item[open] > summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq-a { padding: 0 0 18px; color: var(--ink-2); }
.faq-a p:last-child { margin-bottom: 0; }

.prose { font-size: 16.5px; line-height: 1.8; }
.prose h2 { margin: 44px 0 12px; font-size: 22px; }
.prose h3 { margin: 28px 0 8px; font-size: 18px; }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 700; }
.prose .note {
  margin: 18px 0; padding: 12px 16px; border-radius: 0 10px 10px 0;
  background: var(--paper); border-left: 3px solid var(--ink); font-size: 15px; color: var(--ink-2);
}
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 15px; line-height: 1.6; }
.prose th, .prose td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.table-scroll { overflow-x: auto; }

.article { padding-top: 36px; padding-bottom: 8px; }
.article h1 { margin: 0 0 10px; font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.2rem); letter-spacing: -0.035em; }
.article-meta { margin: 0 0 28px; color: var(--ink-3); font-size: 14px; }
.article-lead { font-size: 18px; color: var(--ink-2); margin-bottom: 28px; }
.crumbs { margin: 0 0 14px; font-size: 14px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }

.cta-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
  margin: 40px 0 0; padding: 20px 22px; border-radius: 16px; background: var(--kraft-light) var(--kraft-tex); color: #241a0e;
}
.cta-box p { margin: 0; font-weight: 700; font-size: 17px; }

.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.guide-list a { display: grid; gap: 4px; padding: 18px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.guide-list strong { font-size: 18px; letter-spacing: -0.02em; }
.guide-list span { color: var(--ink-2); font-size: 15px; }
.guide-list a:hover strong { text-decoration: underline; }

/* 홈 '어떤 바코드 스티커를 만들까요?' — 페이지별 검색어가 담긴 링크 묶음 */
.kind-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.kind-links a {
  display: grid; gap: 4px; height: 100%; padding: 16px 18px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--line); color: inherit; text-decoration: none;
}
.kind-links a:hover { border-color: var(--ink); }
.kind-links strong { font-size: 16.5px; letter-spacing: -0.02em; }
.kind-links span { color: var(--ink-2); font-size: 14px; line-height: 1.5; }

.gallery {
  list-style: none; margin: 0; padding: 26px 22px 20px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px;
  border-radius: 18px; background: var(--kraft-light) var(--kraft-tex);
}
.gallery-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--kraft-ink); font-variant-numeric: tabular-nums; }
.gallery .size-svg rect, .gallery .size-svg circle { stroke: none; filter: drop-shadow(0 2px 2px rgba(58, 40, 16, .28)); }

.free-hero { display: grid; gap: 24px; align-items: center; padding-top: 36px; padding-bottom: 12px; }
.free-hero .stamp-svg { width: min(300px, 70vw); color: var(--stamp); transform: rotate(-6deg); }
.free-hero h1 { margin: 0 0 12px; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.7rem); letter-spacing: -0.035em; line-height: 1.2; }
.free-hero p { font-size: 18px; color: var(--ink-2); margin: 0; max-width: 34em; }
.free-hero .btn { margin-top: 20px; }
@media (min-width: 900px) {
  .free-hero { grid-template-columns: 1fr auto; }
}

.legal { padding-top: 36px; }
.legal h1 { font-size: 28px; margin: 0 0 8px; }

.not-found { padding-top: 80px; padding-bottom: 40px; }

/* ---------------------------------------------------------------- 운영자 방문자 통계 (/stats/) */
/* 차트 색은 한 가지(파랑) — 크기 비교용. 글자는 항상 글자색, 격자는 흐리게 */
.stats-page {
  --series-1: #2a78d6; --grid: #e1e0d9; --axis: #c3c2b7; --muted: #898781;
  padding-top: 32px; padding-bottom: 8px;
}
.stats-page h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); letter-spacing: -0.03em; }
.stats-lead { margin: 0 0 22px; color: var(--ink-2); max-width: 46em; }
.stats-login { display: grid; gap: 10px; max-width: 420px; padding: 20px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.stats-login > label:first-child { font-weight: 700; }
.stats-login-row { display: flex; gap: 8px; }
.stats-login-row input { flex: 1; height: 44px; }
.stats-remember { border: 0; padding: 0; background: none; }
.stats-msg { margin: 0; color: var(--err); font-size: 14px; }
.stats-msg:empty { display: none; }
.stats-setup { margin: 0; padding: 14px 16px; border-radius: 12px; background: #fff8e6; border: 1px solid #ecd9a6; color: #5c4510; max-width: 46em; }
.stats-setup code { font-family: var(--mono); background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 4px; }
.stats-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.stats-me { margin-left: auto; }

.kpi-row { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { padding: 16px 18px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.kpi p { margin: 0; }
.kpi-label { font-size: 14px; color: var(--ink-2); }
.kpi-value { margin-top: 2px !important; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-hero .kpi-value { font-size: 48px; line-height: 1.1; }
@media (max-width: 860px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-hero { grid-column: 1 / -1; }
}

.viz-card { padding: 18px 20px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.viz-card h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.viz-sub { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.viz-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.viz-h3 { margin: 18px 0 8px; font-size: 14px; color: var(--ink-2); }
.viz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 860px) { .viz-grid { grid-template-columns: minmax(0, 1fr); } }

.daily { position: relative; overflow: hidden; }
.daily svg { display: block; max-width: 100%; height: auto; }
.daily .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.daily .grid.base { stroke: var(--axis); }
.daily .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.daily .cap { fill: var(--ink); font-size: 12px; font-weight: 700; }
.daily .col { fill: var(--series-1); }
.daily .hit { fill: transparent; cursor: pointer; }
.daily .hit.on { fill: rgba(42, 120, 214, .08); }
.daily-tip {
  position: absolute; top: 0; z-index: 2; display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 13px; white-space: nowrap; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4);
}
.viz-table { margin-top: 10px; font-size: 14px; }
.viz-table summary { cursor: pointer; color: var(--ink-2); }
.viz-table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.viz-table th, .viz-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); text-align: right; }
.viz-table th:first-child, .viz-table td:first-child { text-align: left; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 11em) minmax(40px, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 12px; }
.hb-bar { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--series-1); }
.hb-val { min-width: 3.5em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb-val small { margin-left: 6px; font-weight: 400; color: var(--muted); }
.hbars .hb-empty { display: block; color: var(--muted); }
.stats-foot { margin: 14px 2px 0; font-size: 13px; color: var(--muted); }

/* 광고 · 제휴 */
.ad-slot { margin: 40px auto 0; text-align: center; }
.adfit-mobile { display: none; }
@media (max-width: 767px) {
  .adfit-desktop { display: none; }
  .adfit-mobile { display: block; }
}
.affiliate-notice { margin: 16px auto 0; font-size: 13px; color: var(--ink-2); }
.affiliate { margin-top: 48px; padding: 20px 22px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.affiliate h2 { margin: 0 0 6px; font-size: 18px; }
.affiliate-notice-inline { margin: 0 0 12px; font-size: 13px; color: var(--ink-3); }
.affiliate ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.affiliate a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; }
.affiliate a span { color: var(--ink-2); font-size: 14px; }

/* ---------------------------------------------------------------- 푸터 */

.site-footer { margin-top: 80px; padding: 44px 0 28px; background: var(--ink); color: #cfccc5; font-size: 14.5px; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 820px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-name { margin: 0 0 6px; color: #fff; font-weight: 700; font-size: 17px; }
.footer-name a { color: inherit; text-decoration: none; }
.footer-name a:hover { text-decoration: underline; }
.footer-brand p:last-child { max-width: 30em; }
.footer-col h2 { margin: 0 0 10px; font-size: 14px; color: #fff; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-col a { color: #cfccc5; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid #3a3833; font-size: 13px; color: #9d9991; }
.footer-legal p { margin: 0 0 6px; }
.operator { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.operator a { color: inherit; }

/* ---------------------------------------------------------------- 인쇄 */

#print-root { display: none; }

@media print {
  body.is-printing { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.is-printing > *:not(#print-root) { display: none !important; }
  body.is-printing #print-root { display: block !important; }
  .pr-page { position: relative; overflow: hidden; break-after: page; page-break-after: always; }
  .pr-page:last-child { break-after: auto; page-break-after: auto; }
  .pr-label, .pr-cell { position: absolute; }
  .pr-label svg, .pr-cell svg { display: block; width: 100%; height: 100%; }
  .pr-a4 { position: relative; width: 210mm; height: 296.8mm; overflow: hidden; break-after: page; page-break-after: always; }
  .pr-a4:last-child { break-after: auto; page-break-after: auto; }
  .pr-cut { outline: .1mm dashed #9a9a9a; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
