/* 사진·JPG → PDF 변환기 '제본대' — 결과 줄 → 그림 단추 설정 → 화질 자 → 쪽 판(만들 PDF 그대로 = 순서 정리판). 종이는 다크에서도 흰 종이 */
.jtp-work{position:relative;container:jtpw/inline-size}
.jtp-work [hidden]{display:none!important} /* .jtp-sum 같은 display 규칙이 hidden을 덮지 않게 */
.jtp-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.jtp-work:not([data-state="empty"]) .jtp-drop{display:none}

/* ---------- 빈 상태: 끌어 놓기 + 예시 ---------- */
.jtp-drop{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}
.jtp-dropbox{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;margin:14px;padding:22px 18px 24px;border:1.5px dashed var(--line);border-radius:var(--radius);background:var(--paper);text-align:center;cursor:pointer;transition:border-color var(--ease),background var(--ease)}
.jtp-dropbox:hover,.jtp-work.is-over .jtp-dropbox{border-color:var(--ink);background:var(--accent-wash)}
.jtp-dropbox b{font-family:var(--serif);font-size:19px;font-weight:800;letter-spacing:-.02em}
.jtp-dropbox > span:not(.v2-btn){max-width:36ch;font-family:var(--sans);font-size:13px;line-height:1.55;color:var(--muted)}
.jtp-pickbtn{margin-top:4px;height:var(--v2-ctl)}
/* 파일 고르기 칸은 숨긴 input이라, 키보드 초점이 오면 끌어 놓기 상자(빈 상태)나 더 넣기 칸(사진이 있을 때)에 표시한다 */
.jtp-input:focus-visible + .jtp-drop .jtp-dropbox,.jtp-input:focus-visible ~ .jtp-board .jtp-add{outline:2px solid var(--accent);outline-offset:2px}
.jtp-art{width:190px;height:auto;margin-bottom:2px;overflow:visible}
.jtp-art-pg rect{fill:#fff;stroke:var(--ink);stroke-width:1.4}
.jtp-art-pg path{stroke:var(--line);stroke-width:2;stroke-linecap:round}
.jtp-art-ph rect{fill:color-mix(in srgb,var(--accent) 16%,var(--paper));stroke:var(--ink);stroke-width:1.3}
.jtp-art-ph path{fill:none;stroke:var(--ink);stroke-width:1.2;stroke-linejoin:round;opacity:.6}
.jtp-art-a{animation:jtp-in-a 5s cubic-bezier(.3,.7,.2,1) infinite}
.jtp-art-b{animation:jtp-in-b 5s cubic-bezier(.3,.7,.2,1) infinite}
@keyframes jtp-in-a{0%,18%{transform:none;opacity:1}46%,70%{transform:translate(56px,6px) scale(1.04);opacity:0}71%{transform:none;opacity:0}86%,100%{transform:none;opacity:1}}
@keyframes jtp-in-b{0%,34%{transform:none;opacity:1}60%,80%{transform:translate(-56px,10px);opacity:0}81%{transform:none;opacity:0}96%,100%{transform:none;opacity:1}}
.jtp-sample{display:flex;flex-direction:column;justify-content:center;gap:10px;padding:20px 20px 20px 6px}
.jtp-sthumb{width:100%;max-width:236px;height:auto}
.jtp-sp{fill:#fff;stroke:var(--line);stroke-width:1.2}
.jtp-sf{fill:color-mix(in srgb,var(--ink) 22%,var(--paper))}
.jtp-sample p{display:flex;flex-direction:column;gap:3px;margin:0}
.jtp-sample p b{font-family:var(--serif);font-size:15.5px;font-weight:800}
.jtp-sample p span{font-family:var(--sans);font-size:12.5px;line-height:1.55;color:var(--muted)}
.jtp-sample .v2-btn{align-self:flex-start}
.jtp-facts{list-style:none;margin:2px 0 0;padding:0;display:flex;flex-direction:column;gap:4px}
.jtp-facts li{position:relative;padding-left:14px;font-family:var(--sans);font-size:12px;line-height:1.5;color:var(--muted)}
.jtp-facts li::before{content:"";position:absolute;left:2px;top:.55em;width:5px;height:5px;background:var(--accent)}

.jtp-feats{grid-column:1 / -1;list-style:none;margin:0;padding:14px 18px 16px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 18px;border-top:1px solid var(--soft)}
.jtp-feats li{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"i t" "i s";align-items:center;gap:1px 10px}
.jtp-feats .jtp-ico{grid-area:i;width:30px;height:30px;color:var(--ink)}
.jtp-feats b{grid-area:t;font-family:var(--sans);font-size:13px;font-weight:750}
.jtp-feats span{grid-area:s;font-family:var(--sans);font-size:12px;line-height:1.45;color:var(--muted)}

/* ---------- 결과 줄 ---------- */
.jtp-sum{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;padding:16px 18px;border-bottom:1px solid var(--soft);border-radius:var(--radius) var(--radius) 0 0}
.jtp-snum{min-width:0}
.jtp-big{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px;margin:4px 0 0;font-family:var(--sans);font-size:34px;font-weight:800;line-height:1.05;letter-spacing:-.02em;color:var(--ink);font-variant-numeric:tabular-nums lining-nums}
.jtp-big small{font-size:21px;font-weight:750;letter-spacing:-.01em;color:var(--accent)}
.jtp-ssub{margin:6px 0 0;font-family:var(--sans);font-size:12.5px;line-height:1.5;color:var(--muted)}
.jtp-save{position:relative;overflow:hidden;min-width:156px;justify-content:center;font-size:13.5px}
.jtp-save .i{width:16px;height:16px}
.jtp-save.is-wait::after{content:"";position:absolute;left:0;bottom:0;height:3px;width:calc(var(--p,0) * 100%);background:var(--accent);transition:width .25s}

/* ---------- 그림 단추 설정 ---------- */
.jtp-set{display:grid;grid-template-columns:repeat(5,auto);justify-content:space-between;gap:12px 14px;padding:14px 18px 4px}
.jtp-g{display:flex;flex-direction:column;gap:6px;min-width:0;transition:opacity var(--ease)}
.jtp-g.is-off{opacity:.42}
.v2-seg.jtp-pics{flex-wrap:nowrap}
.v2-seg.jtp-pics button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;height:auto;min-width:50px;padding:4px 7px 5px;color:var(--muted)}
.v2-seg.jtp-pics button:disabled{cursor:not-allowed}
.v2-seg.jtp-pics button[aria-pressed="true"]{color:var(--on-fill)}
.jtp-pics button > span{font-size:11.5px;line-height:1.3;white-space:nowrap}
.jtp-ico{width:26px;height:26px;overflow:visible}
.jtp-pp{fill:var(--paper);stroke:currentColor;stroke-width:1.3}
.jtp-pp2{fill:color-mix(in srgb,var(--paper) 70%,transparent);stroke-dasharray:2 1.6}
.jtp-pf{fill:currentColor;opacity:.34}
.jtp-pm{fill:none;stroke:currentColor;stroke-width:1.2;stroke-linejoin:round}
.jtp-pc{fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round}
.jtp-pt{font-family:var(--sans);font-size:6.6px;font-weight:800;fill:currentColor;text-anchor:middle}
.v2-seg.jtp-pics button[aria-pressed="true"] .jtp-pp{fill:transparent}
.v2-seg.jtp-pics button[aria-pressed="true"] .jtp-pf{opacity:.5}

/* ---------- 화질 자: 단계마다 실제 PDF 크기 막대 ---------- */
.jtp-ruler{padding:10px 18px 16px;border-bottom:1px solid var(--soft)}
.v2-seg.jtp-lvs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:6px}
.v2-seg.jtp-lvs button{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"n s" "d d" "b b";align-items:baseline;gap:1px 8px;height:auto;min-width:0;padding:8px 10px 9px;text-align:left;color:var(--ink)}
.jtp-lvs b{grid-area:n;min-width:0;font-size:13px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jtp-lvs em{grid-area:s;font-style:normal;font-size:12.5px;font-weight:750;font-variant-numeric:tabular-nums lining-nums;white-space:nowrap}
.jtp-lvs small{grid-area:d;font-size:11px;font-weight:500;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jtp-bar{grid-area:b;display:block;height:5px;margin-top:6px;border-radius:3px;background:var(--wash);overflow:hidden}
.jtp-bar i{display:block;width:0;height:100%;border-radius:3px;background:var(--ink);opacity:.5;transition:width .55s cubic-bezier(.2,.7,.2,1)}
.jtp-lvs button.is-wait em{font-weight:500;color:var(--muted)}
.jtp-lvs button.is-wait .jtp-bar{background:linear-gradient(90deg,var(--wash) 30%,color-mix(in srgb,var(--line) 70%,var(--wash)) 50%,var(--wash) 70%) 0 0/300% 100%;animation:jtp-shine 1.4s linear infinite}
.v2-seg.jtp-lvs button[aria-pressed="true"],.v2-seg.jtp-lvs button[aria-pressed="true"] small{color:var(--on-fill)}
.v2-seg.jtp-lvs button[aria-pressed="true"] small{opacity:.78}
.v2-seg.jtp-lvs button[aria-pressed="true"] .jtp-bar{background:color-mix(in srgb,var(--on-fill) 22%,transparent)}
.v2-seg.jtp-lvs button[aria-pressed="true"] .jtp-bar i{background:var(--on-fill);opacity:.92}
@keyframes jtp-shine{to{background-position:-300% 0}}

/* ---------- 쪽 판 ---------- */
.jtp-board{padding:14px 18px 16px}
.jtp-bhead{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin-bottom:16px}
.jtp-selname{flex:1 1 160px;min-width:0;margin:0;font-family:var(--sans);font-size:12.5px;font-weight:650;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jtp-acts,.jtp-tools{display:flex;flex-wrap:wrap;gap:4px}
.jtp-acts .v2-btn{padding:0 9px;gap:3px}
.jtp-tools{margin-left:auto}
.jtp-pages{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:20px 16px;align-items:end} /* 열 수는 JS가 쪽 수에 맞춰 정한다(cols) */
.jtp-pl,.jtp-addli{display:flex;flex-direction:column;gap:7px;min-width:0}
.jtp-pg{position:relative;width:100%;background:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(30,25,20,.1),0 3px 8px -2px rgba(30,25,20,.16)}
.jtp-pg::after{content:"";position:absolute;right:-7px;top:-7px;width:20px;height:20px;border-radius:50%;background:var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.4l3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;opacity:0;transform:scale(.3);transition:opacity .2s,transform .3s cubic-bezier(.2,.9,.3,1.4);pointer-events:none;z-index:3}
.jtp-pl.is-bound .jtp-pg{animation:jtp-bind .55s cubic-bezier(.2,.7,.2,1)}
.jtp-pl.is-bound .jtp-pg::after{opacity:1;transform:none}
@keyframes jtp-bind{40%{transform:translateY(-5px) scale(.965)}}
.jtp-ph{position:absolute;z-index:1;margin:0;padding:0;border:0;border-radius:0;background:#e9e6e1;cursor:grab;overflow:hidden;transition:transform .34s cubic-bezier(.2,.7,.2,1),box-shadow var(--ease);-webkit-user-select:none;user-select:none}
.jtp-ph canvas{display:block;width:100%;height:100%;object-fit:cover}
.jtp-ph.is-wait{background:linear-gradient(90deg,#e9e6e1 30%,#f5f3ef 50%,#e9e6e1 70%) 0 0/300% 100%;animation:jtp-shine 1.4s linear infinite}
.jtp-ph[aria-current="true"]{z-index:2;box-shadow:0 0 0 2px var(--accent),0 0 0 4px #fff}
.jtp-ph:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.jtp-ph.is-drag{opacity:.3}
.jtp-badge{position:absolute;left:3px;top:3px;display:none;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:rgba(24,22,20,.74);color:#fff;font-family:var(--sans);font-size:10px;font-style:normal;font-weight:700;line-height:16px;text-align:center}
.jtp-work.is-multi .jtp-badge{display:block}
.jtp-pcap{display:flex;justify-content:space-between;align-items:baseline;gap:6px;min-height:16px;margin:0;font-family:var(--mono);font-size:11px;line-height:16px;color:var(--muted);font-variant-numeric:tabular-nums}
.jtp-pcap b{font-weight:700;color:var(--ink)}
.jtp-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;aspect-ratio:210/297;border:1.5px dashed var(--line);border-radius:2px;color:var(--muted);font-family:var(--sans);font-size:12px;font-weight:650;text-align:center;cursor:pointer;transition:border-color var(--ease),color var(--ease),background var(--ease)}
.jtp-add svg{width:22px;height:22px}
.jtp-add:hover,.jtp-work.is-over .jtp-add{border-color:var(--ink);color:var(--ink);background:var(--accent-wash)}
.jtp-addli::after{content:"";height:16px}
.jtp-keys{margin:16px 0 0;font-family:var(--sans);font-size:11.5px;line-height:1.5;color:var(--muted)}
.jtp-mark{position:absolute;z-index:6;width:3px;border-radius:2px;background:var(--accent);pointer-events:none}
.jtp-mark.is-v{height:3px}
.jtp-ghost{position:fixed;left:0;top:0;z-index:1000;width:72px;border:2px solid #fff;box-shadow:0 8px 20px rgba(0,0,0,.28);pointer-events:none}
.jtp-ghost canvas{display:block;width:100%;height:auto}
.jtp-work.is-dragging,.jtp-work.is-dragging .jtp-ph{cursor:grabbing}
.jtp-status{margin:0;padding:0 18px 14px}
.jtp-status:empty{display:none}
.jtp-noscript{margin:0;padding:16px 18px;font-family:var(--sans);font-size:13px;color:var(--accent)}

/* ---------- 좁은 작업면: 다섯 묶음이 한 줄에 안 들어가면 3 + 2로 나눠 단추를 늘려 채운다(빈 칸 없음) ---------- */
@container jtpw (max-width:860px){
  .jtp-set{grid-template-columns:repeat(6,minmax(0,1fr))}
  .jtp-g{grid-column:span 2}
  .jtp-g:nth-child(n+4){grid-column:span 3}
  .v2-seg.jtp-pics{display:flex;width:100%}
  .v2-seg.jtp-pics button{flex:1 1 0;min-width:0}
}
@container jtpw (max-width:700px){
  .jtp-drop{grid-template-columns:1fr}
  .jtp-sample{padding:4px 18px 20px}
  .jtp-feats{grid-template-columns:1fr}
  .v2-seg.jtp-lvs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jtp-tools{margin-left:0}
}
@container jtpw (max-width:520px){
  .jtp-set{grid-template-columns:auto minmax(0,1fr);gap:8px 12px;padding:14px 18px 8px}
  .jtp-g,.jtp-g:nth-child(n+4){display:contents}
  .jtp-g > .v2-label{align-self:center}
  .jtp-g.is-off > *{opacity:.42}
}
@container jtpw (max-width:420px){
  .jtp-sum{padding:14px 14px}
  .jtp-big{font-size:30px}
  .jtp-save{flex:1 1 100%}
  .jtp-set,.jtp-ruler,.jtp-board{padding-left:14px;padding-right:14px}
  .v2-seg.jtp-pics button{min-width:0;padding:4px 6px 5px}
  .jtp-pages{gap:16px 12px}
  .jtp-acts .v2-btn{padding:0 8px}
}
@media (pointer:coarse){.jtp-keys{display:none}} /* 손가락 화면에는 키보드 안내가 필요 없다 */
@media (prefers-reduced-motion:reduce){
  .jtp-art-a,.jtp-art-b,.jtp-ph.is-wait,.jtp-lvs button.is-wait .jtp-bar{animation:none}
  .jtp-ph,.jtp-bar i{transition:none}
}
