/* 이름표·라벨 만들기 (/labels/, /en/labels/): loaded on these two pages only. Markup: pipeline/site_labels.py, logic: labels.js.
   Screen: the form on the left (on top on a narrow screen), the A4 sheets on the right. Print: nothing but the sheets,
   each on its own page at true size (the @page rule itself is written by labels.js: portrait or landscape). */
.lb-head .post-head-in { grid-template-columns: 1fr; }
.lb-head .date { max-width: 62ch; }
.lb-sec { padding-top: 34px; }
.lb [hidden] { display: none !important; }
.lb { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 24px; align-items: start; }

/* ---------- the form ---------- */
.lb-panel { display: grid; gap: 16px; min-width: 0; }
.lb fieldset { min-width: 0; margin: 0; padding: 14px 16px 16px; border: 0; border-radius: 22px; background: var(--white); box-shadow: var(--lift-sm); }
.lb legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-family: var(--display); font-size: 21px; line-height: 1.3; }
.lb legend + * { clear: both; }
.lb-l { display: block; margin: 12px 0 5px; font-family: var(--display); font-size: 16px; color: var(--ink); }
.lb legend + .lb-l { margin-top: 0; }
.lb textarea, .lb input[type="text"], .lb input[type="number"], .lb select {
  width: 100%; font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink); background: #fff;
  border: 2px solid #d9c3a0; border-radius: 12px; padding: 9px 12px;
}
.lb textarea { display: block; resize: vertical; min-height: 150px; font-family: var(--display); font-size: 18px; }
.lb input[type="number"] { width: 92px; }
.lb textarea:focus-visible, .lb input:focus-visible, .lb select:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; border-radius: 12px; }
.lb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.lb-row select { width: auto; flex: 1 1 150px; min-width: 0; }
.lb-hint { margin-top: 7px; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.lb-count { font-size: 14px; color: var(--ink-soft); }
.lb-priv { margin-top: 12px; padding: 9px 12px; border-radius: 12px; background: #e6f4d6; font-size: 14.5px; line-height: 1.5; }
.lb-b {
  font-family: var(--display); font-size: 15px; line-height: 1; color: var(--ink); background: var(--white); cursor: pointer;
  border: 2px solid var(--ink); border-radius: 999px; padding: 8px 13px; min-height: 36px;
}
.lb-b:hover { background: #ffecc4; }
.lb-b:disabled { opacity: .4; cursor: default; }
.lb-b:focus-visible { outline-offset: 2px; border-radius: 999px; }
.lb-check { display: inline-flex; align-items: center; gap: 8px; font-size: 15.5px; cursor: pointer; margin-right: auto; }
.lb-check input { width: 20px; height: 20px; accent-color: var(--orange); flex: none; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-opt, .lb-opt2 { margin-top: 12px; }
.lb-chip { position: relative; cursor: pointer; }
.lb-chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lb-chip span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--ink);
  font-family: var(--display); font-size: 16px; line-height: 1.15; background: var(--white);
}
.lb-chip input:checked + span { background: var(--orange); border-color: #c9560a; color: #fff; }
.lb-chip input:focus-visible + span { outline: 4px solid var(--ink); outline-offset: 2px; }
.lb-size .lb-l { margin: 0 auto 0 0; }
.lb-pm { width: 40px; padding: 0; font-size: 22px; }
#lb-scale { min-width: 52px; text-align: center; font-family: var(--display); }
.lb-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin-top: 8px; max-height: 260px; overflow: auto; padding: 2px; }
.lb-months label { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.lb-months span { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); }
.lb-months select { width: auto; flex: none; padding: 5px 6px; font-size: 15px; }

/* ---------- the preview ---------- */
.lb-out { min-width: 0; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding: 4px 4px 16px; scrollbar-gutter: stable; }
.lb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.lb-info { font-size: 15px; color: var(--ink-soft); }
.lb-warn { flex: 1 0 100%; padding: 8px 12px; border-radius: 12px; background: #ffe9b8; font-size: 14.5px; line-height: 1.5; }
.lb-pages { display: grid; gap: 22px; justify-items: center; }
.lb-page { margin: 0; width: min(100%, 540px); }
.lb-land .lb-page { width: min(100%, 760px); }
.lb-sheet { background: #fff; border: 1px solid #d9c3a0; box-shadow: var(--lift); }
.lb-svg { display: block; width: 100%; height: auto; }
.lb-page figcaption { display: flex; flex-flow: row-reverse wrap; align-items: center; justify-content: space-between; /* the button on the left: the feedback button sits bottom right */ gap: 8px; margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); }
.lb-hit { cursor: pointer; outline: none; }
.lb-hit:hover { fill: rgba(255, 122, 26, .13); }
.lb-hit:focus-visible { stroke: #ff7a1a; stroke-width: 1.2; fill: rgba(255, 122, 26, .13); }

/* ---------- the picture picker ---------- */
.lb-pick { width: min(760px, 100vw - 20px); max-height: min(86vh, 760px); border: 0; border-radius: 22px; padding: 16px; background: var(--paper); color: var(--ink); box-shadow: var(--lift); }
.lb-pick::backdrop { background: rgba(40, 20, 8, .5); }
.lb-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lb-pick-head h2 { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.3; }
.lb-tchip[aria-pressed="true"] { background: var(--orange); border-color: #c9560a; color: #fff; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 14px; font-size: 15px; }
.lb-th { aspect-ratio: 1; width: 100%; padding: 0; background-color: #fff; background-repeat: no-repeat; border: 2px solid #e2cfae; border-radius: 12px; cursor: pointer; }
.lb-th:hover { border-color: var(--orange); }
.lb-th[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange); }

.lb-note { max-width: 860px; }
.lb-steps { list-style: decimal; padding-left: 1.4em; }
.lb-steps li + li { margin-top: 8px; }
.lb-steps li::marker { font-family: var(--display); color: var(--orange); }
.lb-use { margin-top: 14px; font-family: var(--display); }

@media (max-width: 860px) {
  .lb { grid-template-columns: minmax(0, 1fr); }
  .lb-head .date { padding-bottom: 70px; }
  .lb-out { position: static; max-height: none; overflow: visible; padding: 0; }
}

/* ---------- print: the sheets and nothing else ---------- */
@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body::before, #lb-sec::before, #lb-sec::after { display: none !important; }
  body > :not(main), main > :not(#lb-sec), #lb-sec > .wrap > :not(.lb), .lb > :not(.lb-out), .lb-out > :not(.lb-pages), .lb-page figcaption, .lb-hit { display: none !important; }
  main, #lb-sec, #lb-sec > .wrap, .lb, .lb-out, .lb-pages, .lb-page {
    display: block !important; position: static !important; width: auto !important; max-width: none !important; max-height: none !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; overflow: visible !important;
  }
  .lb-sheet { width: 190mm; height: 276.8mm; overflow: hidden; border: 0; box-shadow: none; break-inside: avoid; break-after: page; page-break-after: always; }
  .lb-land .lb-sheet { width: 277mm; height: 189.8mm; }
  .lb-page:last-child .lb-sheet { break-after: auto; page-break-after: auto; }
  .lb-svg { width: 210mm; height: 297mm; max-width: none; margin: -10mm 0 0 -10mm; }
  .lb-land .lb-svg { width: 297mm; height: 210mm; }
}
