/* 사진모아 PDF */
:root {
  --bg: #f2f4f6;
  --card: #ffffff;
  --text: #191f28;
  --sub: #4e5968;
  --muted: #8b95a1;
  --line: #e5e8eb;
  --fill: #f2f4f6;
  --primary: #3182f6;
  --primary-d: #1b64da;
  --primary-l: #e8f3ff;
  --success: #15b886;
  --danger: #f04452;
  --danger-l: #fff0f1;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 2px 6px rgba(0, 25, 60, .04), 0 10px 30px rgba(0, 25, 60, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.025em; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
kbd { font-family: inherit; font-size: .85em; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; }
.text-link { color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 머리글 ---------- */
.site-header { background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(0, 0, 0, .05); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; letter-spacing: -0.03em; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--sub); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--fill); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; color: var(--sub); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--fill); }
.menu-panel { position: absolute; right: 0; top: 52px; background: #fff; border-radius: var(--r-md); box-shadow: 0 12px 40px rgba(0, 25, 60, .16); padding: 8px; min-width: 200px; display: grid; }
.menu-panel a { padding: 12px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.menu-panel a:hover { background: var(--fill); }

/* ---------- 첫 화면 ---------- */
.hero { text-align: center; padding-top: 44px; padding-bottom: 6px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; margin: 0 0 12px; }
.hl { color: var(--primary); }
.lead { color: var(--sub); font-size: clamp(16px, 2.4vw, 19px); margin: 0 auto 26px; }

/* ---------- 단계 표시 ---------- */
.stepper { list-style: none; display: flex; justify-content: center; gap: 6px; padding: 0; margin: 0 0 16px; }
.stepper li { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 999px; transition: background .2s, color .2s; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; background: #e2e6ea; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; transition: background .2s; }
.stepper li + li::before { content: ""; width: 14px; height: 2px; background: #dde1e6; border-radius: 2px; margin-right: 4px; margin-left: -6px; }
body[data-step="1"] .stepper li[data-s="1"],
body[data-step="2"] .stepper li[data-s="2"],
body[data-step="3"] .stepper li[data-s="3"] { color: var(--primary); background: var(--primary-l); }
body[data-step="1"] .stepper li[data-s="1"] span,
body[data-step="2"] .stepper li[data-s="2"] span,
body[data-step="3"] .stepper li[data-s="3"] span { background: var(--primary); }
body[data-step="2"] .stepper li[data-s="1"] span,
body[data-step="3"] .stepper li[data-s="1"] span,
body[data-step="3"] .stepper li[data-s="2"] span { background: var(--success); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-sm); border: 0;
  background: var(--fill); color: var(--text); font: inherit; font-weight: 700; font-size: 16px;
  cursor: pointer; text-decoration: none; user-select: none; -webkit-user-select: none;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(49, 130, 246, .28); }
.btn-primary:hover { background: var(--primary-d); }
.btn-soft { background: var(--primary-l); color: var(--primary-d); }
.btn-soft:hover { background: #dbebff; }
.btn-text { background: none; color: var(--sub); font-weight: 600; min-height: 44px; padding: 0 12px; }
.btn-text:hover { background: var(--fill); }
.btn-danger-soft { background: var(--danger-l); color: var(--danger); }
.btn-danger-soft:hover { background: #ffe1e4; }
.btn-huge { min-height: 60px; font-size: 18px; border-radius: var(--r-md); width: 100%; }
.btn-block { width: 100%; }
.btn .ic { width: 22px; height: 22px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--fill); color: var(--sub); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.chip:hover { background: #e8ebee; color: var(--text); }
.chip .ic { width: 18px; height: 18px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; color: var(--sub); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--fill); }

.box { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px; }
.box-title { font-size: 20px; font-weight: 700; margin: 0; }

/* ---------- 1단계: 사진 고르기 ---------- */
.upload { text-align: center; padding: 36px 22px 26px; cursor: pointer; border: 2px solid transparent; transition: border-color .2s, background .2s; outline: none; }
.upload:hover { border-color: #cfe2fd; }
.art { width: 220px; height: auto; display: block; margin: 0 auto 14px; }
.upload-title { font-size: clamp(21px, 3.6vw, 26px); font-weight: 800; margin: 0 0 6px; }
.upload-sub { color: var(--sub); margin: 0 0 22px; font-size: 16px; }
.upload-btn { max-width: 340px; font-size: 19px; min-height: 64px; }
.upload-btn .ic { width: 24px; height: 24px; stroke-width: 2.4; }
.upload-drop { color: var(--muted); font-size: 14.5px; margin: 14px 0 0; }
.howto { max-width: 460px; margin: 18px auto 0; text-align: left; background: var(--fill); border-radius: var(--r-md); cursor: default; }
.howto summary { list-style: none; padding: 13px 16px; font-weight: 600; font-size: 15px; color: var(--sub); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.howto[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.howto ul { margin: 0; padding: 0 18px 0 18px; list-style: none; display: grid; gap: 10px; }
.howto li { font-size: 14.5px; color: var(--sub); }
.howto li b { display: block; color: var(--text); font-size: 15px; }
.howto p { font-size: 14px; color: var(--muted); margin: 12px 18px 0; padding-bottom: 16px; }
.trust { list-style: none; padding: 0; margin: 22px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
.trust li { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--sub); }
.trust .ic { width: 18px; height: 18px; color: var(--success); }

/* ---------- 2단계: 확인하기 ---------- */
.workspace { display: grid; gap: 16px; }
.settings { display: grid; gap: 14px; }
.presets { display: grid; gap: 8px; }
.preset { position: relative; cursor: pointer; display: block; }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset-in { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); border: 2px solid var(--line); transition: border-color .15s, background .15s; }
.preset:hover .preset-in { border-color: #cfd6dd; }
.preset-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--fill); color: var(--sub); display: flex; align-items: center; justify-content: center; flex: none; transition: background .15s, color .15s; }
.preset-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.preset-txt b { font-size: 16.5px; }
.preset-txt small { font-size: 14px; color: var(--muted); }
.radio-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #d1d6db; flex: none; position: relative; transition: border-color .15s, background .15s; }
.preset input:checked + .preset-in { border-color: var(--primary); background: #f7fbff; }
.preset input:checked + .preset-in .preset-ic { background: var(--primary); color: #fff; }
.preset input:checked + .preset-in .radio-dot { border-color: var(--primary); background: var(--primary); }
.preset input:checked + .preset-in .radio-dot::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.preset input:focus-visible + .preset-in { outline: 3px solid rgba(49, 130, 246, .35); outline-offset: 2px; }

.more { border-top: 1px solid var(--line); padding-top: 4px; }
.more summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; font-weight: 600; color: var(--sub); font-size: 15px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 6px; transition: transform .2s; }
.more[open] summary::after { transform: rotate(-135deg); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; line-height: 1.35; }
.switch-row b { font-size: 15.5px; font-weight: 600; }
.switch-row small { color: var(--muted); font-size: 13.5px; }
.switch-row.off { opacity: .45; cursor: default; }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 999px; background: #d1d6db; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .15); transition: transform .2s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { cursor: default; }
.switch:focus-visible { outline: 3px solid rgba(49, 130, 246, .35); outline-offset: 2px; }
.name-field { padding: 8px 2px 4px; }
.name-field label { display: block; font-weight: 600; font-size: 15.5px; margin-bottom: 6px; }
.name-row { display: flex; align-items: center; gap: 8px; }
.name-row input { flex: 1; min-width: 0; height: 50px; border: 0; background: var(--fill); border-radius: var(--r-sm); padding: 0 14px; font: inherit; font-size: 16px; color: var(--text); }
.name-row input:focus { outline: 2px solid var(--primary); background: #fff; }
.name-row span { color: var(--muted); font-weight: 600; }
.estimate { color: var(--muted); font-size: 14px; margin: 0; text-align: center; }
#warn { background: #fff8e6; color: #946200; border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; margin: 0; }

.photos-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.photos-head .muted { margin: 2px 0 0; font-size: 14.5px; }
.count { color: var(--primary); }
.photos-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 15px; top: 15px; width: 7px; height: 7px; border-right: 2px solid var(--primary-d); border-bottom: 2px solid var(--primary-d); transform: rotate(45deg); pointer-events: none; }
.select-wrap select { appearance: none; -webkit-appearance: none; height: 40px; border: 0; border-radius: 999px; background: var(--primary-l); color: var(--primary-d); font: inherit; font-size: 15px; font-weight: 700; padding: 0 36px 0 16px; cursor: pointer; }
.chip-quiet { background: none; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.card {
  position: relative; border-radius: 14px; overflow: hidden; background: var(--fill); cursor: pointer;
  content-visibility: auto; contain-intrinsic-size: 98px 131px; outline: none;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { box-shadow: 0 6px 18px rgba(0, 25, 60, .14); }
.card:focus-visible { box-shadow: 0 0 0 3px var(--primary); }
.card.dragging { opacity: .3; }
.card.ins-before { box-shadow: -5px 0 0 -1px var(--primary); }
.card.ins-after { box-shadow: 5px 0 0 -1px var(--primary); }
.thumb { position: relative; aspect-ratio: 3 / 4; overflow: hidden; }
@supports not (aspect-ratio: 1) { .thumb { padding-top: 133%; } }
.thumb img { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; object-fit: cover; transform: translate(-50%, -50%); opacity: 0; transition: opacity .25s; }
.thumb img.ok { opacity: 1; }
.thumb img.o2 { transform: translate(-50%, -50%) scaleX(-1); }
.thumb img.o3 { transform: translate(-50%, -50%) rotate(180deg); }
.thumb img.o4 { transform: translate(-50%, -50%) scaleY(-1); }
.thumb img.o5, .thumb img.o6, .thumb img.o7, .thumb img.o8 { width: 133.34%; height: 75%; }
.thumb img.o5 { transform: translate(-50%, -50%) scaleX(-1) rotate(90deg); }
.thumb img.o6 { transform: translate(-50%, -50%) rotate(90deg); }
.thumb img.o7 { transform: translate(-50%, -50%) scaleY(-1) rotate(90deg); }
.thumb img.o8 { transform: translate(-50%, -50%) rotate(-90deg); }
.card.nothumb .thumb::after { content: "미리보기 없음"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.num { position: absolute; left: 6px; bottom: 6px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--text); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); font-variant-numeric: tabular-nums; }
.del { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(25, 31, 40, .55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; opacity: 0; transition: opacity .15s, background .15s; }
.del .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.card:hover .del { opacity: 1; }
.del:hover { background: var(--danger); }
@media (hover: none) { .del { display: none; } }

/* ---------- 책 페이지 번호 ---------- */
.pg { position: absolute; left: 6px; top: 6px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); font-variant-numeric: tabular-nums; }
.pg.dup { background: #f59f00; }
.gapcard {
  border: 2px dashed #f5b544; background: #fff8eb; border-radius: 14px; color: #a35f00; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px;
  aspect-ratio: 3 / 4; padding: 8px; line-height: 1.3;
}
.gapcard:hover { background: #fff1d6; }
.gapcard .ic { width: 26px; height: 26px; margin-bottom: 4px; }
.gapcard b { font-size: 16px; color: #8a4f00; }
.gapcard span { font-size: 12.5px; font-weight: 600; }
.gapcard small { font-size: 11.5px; color: #c17a1a; margin-top: 4px; }
.ocr { background: var(--fill); border-radius: var(--r-md); padding: 14px 16px; margin: 0 0 14px; }
.ocr.is-run { background: var(--primary-l); }
.ocr.is-ok { background: #e9faf3; }
.ocr.is-warn { background: #fff6e5; }
.ocr-head { display: flex; align-items: center; gap: 12px; }
.ocr-ic { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.ocr.is-ok .ocr-ic { color: var(--success); }
.ocr.is-warn .ocr-ic { color: #e08600; }
.ocr-txt { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.ocr-txt b { font-size: 16px; }
.ocr-txt small { font-size: 13.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.ocr-bar { height: 6px; background: rgba(49, 130, 246, .18); border-radius: 999px; overflow: hidden; margin: 12px 0 2px; }
.ocr-bar > div { height: 100%; background: var(--primary); transform-origin: left; transform: scaleX(0); transition: transform .3s; }
.ocr-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.ocr-list:empty { display: none; }
.ocr-list li { font-size: 14.5px; padding-left: 22px; position: relative; color: var(--sub); }
.ocr-list li::before { content: ""; position: absolute; left: 6px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.ocr-list li.warn { color: #a35f00; font-weight: 700; }
.ocr-list li.ok { color: #0f8a63; font-weight: 700; }
.ocr-list li.muted { color: var(--muted); font-size: 13.5px; }
.ocr-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ocr-btns:empty { display: none; }
.ocr-btns .chip { background: #fff; }
.ocr-btns .chip-primary { background: var(--primary); color: #fff; }
.ocr-btns .chip-primary:hover { background: var(--primary-d); color: #fff; }
.page-note { font-size: 14px; text-align: center; color: var(--primary-d); background: var(--primary-l); border-radius: var(--r-sm); padding: 10px 12px; margin: 0; }
.page-note.warn { color: #a35f00; background: #fff6e5; font-weight: 600; }
.viewer-page { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 4px 4px 4px 14px; background: var(--fill); border-radius: var(--r-sm); }
.viewer-page label { font-weight: 600; font-size: 15px; }
.vp-input { display: flex; align-items: center; gap: 6px; }
.vp-input input { width: 92px; height: 44px; border: 0; border-radius: 10px; background: #fff; text-align: center; font: inherit; font-size: 17px; font-weight: 700; color: var(--text); }
.vp-input input:focus { outline: 2px solid var(--primary); }
.vp-input span { color: var(--sub); font-weight: 600; margin-right: 8px; }

/* ---------- 창(모달) ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.modal-back { position: absolute; inset: 0; background: rgba(0, 12, 30, .5); animation: fade .2s; }
.modal-panel { position: relative; background: #fff; width: 100%; max-width: 520px; border-radius: 26px 26px 0 0; padding: 18px 20px calc(20px + var(--safe-b)); max-height: 94vh; overflow-y: auto; animation: up .28s cubic-bezier(.2, .9, .3, 1); }
.modal-center { align-items: center; padding: 16px; }
.modal-center .modal-panel { border-radius: 26px; padding: 34px 24px 22px; animation: pop .28s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head b { font-size: 18px; }
.viewer-img { position: relative; background: var(--fill); border-radius: var(--r-md); height: min(52vh, 460px); display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.viewer-img.zoomed { cursor: grab; }
.viewer-img.dragging { cursor: grabbing; }
.viewer-img img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center;-webkit-user-drag: none; pointer-events: none; }
.viewer-img img.anim { transition: transform .22s cubic-bezier(.2, .9, .3, 1); }
.v-nav { position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--text); box-shadow: 0 2px 10px rgba(0, 25, 60, .18); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.v-nav:hover { background: #fff; }
.v-nav:disabled { opacity: 0; pointer-events: none; }
.v-nav .ic { width: 22px; height: 22px; }
.v-nav-prev { left: 10px; }
.v-nav-next { right: 10px; }
.v-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; background: rgba(255, 255, 255, .92); border-radius: 999px; box-shadow: 0 2px 10px rgba(0, 25, 60, .18); padding: 3px; z-index: 2; }
.v-zoom button { height: 38px; min-width: 38px; border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0 6px; }
.v-zoom button:hover { background: var(--fill); }
.v-zoom button:disabled { opacity: .35; cursor: default; background: none; }
.v-zoom #vZoomPct { min-width: 54px; }
.v-zoom .ic { width: 18px; height: 18px; }
.v-hint { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.v-sub { margin: 14px 0 0; font-size: 13.5px; font-weight: 600; color: var(--sub); }
.viewer-move { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 8px; }
.viewer-move button { min-height: 52px; border: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--text); font: inherit; font-weight: 600; font-size: 15.5px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.viewer-move button:hover { background: #e8ebee; }
.viewer-move button:disabled { opacity: .35; cursor: default; }
.viewer-move .ic { width: 20px; height: 20px; }

.job-panel { text-align: center; max-width: 420px; }
.ring { position: relative; width: 150px; height: 150px; margin: 0 auto 20px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--primary-l); }
.ring-fg { stroke: var(--primary); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset .3s ease; }
.ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.ring-num b { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
.ring-num span { font-size: 18px; font-weight: 700; color: var(--muted); margin: 10px 0 0 2px; }
.job-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.job-text { font-size: 16.5px; color: var(--sub); margin: 0; font-variant-numeric: tabular-nums; }
.job-sub { margin: 2px 0 0; font-size: 15px; min-height: 1.5em; font-variant-numeric: tabular-nums; }
.job-note { font-size: 13.5px; color: var(--muted); background: var(--fill); border-radius: 999px; display: table; padding: 6px 14px; margin: 18px auto 8px; }
#cancel { display: flex; margin: 0 auto; }
.done-mark { width: 84px; height: 84px; border-radius: 50%; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; animation: pop .4s cubic-bezier(.2, .9, .3, 1.4); box-shadow: 0 10px 26px rgba(21, 184, 134, .35); }
.done-mark .ic { width: 44px; height: 44px; stroke-width: 3; }
.done-btns { display: grid; gap: 10px; margin: 22px 0 0; }
.save-hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.done-links { display: flex; justify-content: center; gap: 4px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.failed { margin-top: 14px; background: var(--danger-l); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; color: #b42331; text-align: left; }
.failed summary { cursor: pointer; font-weight: 600; }
.failed ul { margin: 8px 0 0; padding-left: 18px; max-height: 160px; overflow: auto; }

.drag-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(232, 243, 255, .92); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drag-overlay > div { border: 3px dashed var(--primary); border-radius: 32px; padding: 50px 70px; text-align: center; color: var(--primary); background: #fff; }
.drag-overlay .ic { width: 48px; height: 48px; }
.drag-overlay p { font-size: 22px; font-weight: 800; margin: 8px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translate(-50%, 16px); z-index: 90;
  background: #252a31; color: #fff; padding: 8px 8px 8px 20px; border-radius: 16px; font-size: 15.5px; font-weight: 500;
  display: flex; align-items: center; gap: 12px; min-height: 52px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}
.toast:not(:has(button:not([hidden]))) { padding-right: 20px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
/* 창이 열려 있을 때는 아래쪽 버튼을 가리지 않게 위에 띄움 */
body.modal-open .toast, body.modal-open.has-photos .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -16px); }
body.modal-open .toast.show { transform: translate(-50%, 0); }
.toast button { border: 0; background: rgba(255, 255, 255, .14); color: #8ec0ff; font: inherit; font-weight: 700; border-radius: 10px; height: 38px; padding: 0 14px; cursor: pointer; white-space: nowrap; }

/* ---------- 본문 ---------- */
.content { padding-top: 40px; }
.content > h2 { font-size: 24px; font-weight: 800; margin: 30px 0 14px; }
.content p { color: var(--sub); }
.content h3 { font-size: 17px; margin: 12px 0 6px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; background: #fff; border-radius: var(--r-md); padding: 18px 18px 18px 66px; position: relative; display: flex; flex-direction: column; }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-l); color: var(--primary); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps b { font-size: 17px; }
.steps span { color: var(--sub); font-size: 15px; }
.features { display: grid; gap: 10px; }
.features > div { background: #fff; border-radius: var(--r-md); padding: 22px; }
.features p { margin: 0; font-size: 15px; }
.f-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--primary-l); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 15px; min-width: 460px; }
.tbl th, .tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 14px; color: var(--muted); font-weight: 600; }
.tbl td { color: var(--sub); }
.tbl td b { color: var(--text); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.faq { background: #fff; border-radius: var(--r-md); margin-bottom: 8px; }
.faq summary { padding: 18px 50px 18px 20px; font-weight: 700; font-size: 16.5px; cursor: pointer; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 22px; top: 24px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.faq[open] summary::after { transform: rotate(-135deg); top: 28px; }
.faq p { margin: 0; padding: 0 20px 20px; }

/* ---------- 글 페이지 ---------- */
.article { background: #fff; border-radius: var(--r-lg); padding: 32px 24px; margin-top: 24px; margin-bottom: 10px; }
.article h1 { font-size: clamp(26px, 4.8vw, 34px); font-weight: 800; margin: 0 0 8px; }
.article .meta { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.article h2 { font-size: 21px; font-weight: 800; margin: 36px 0 10px; }
.article h3 { font-size: 17.5px; margin: 22px 0 6px; }
.article p, .article li { color: #333d4b; font-size: 16.5px; line-height: 1.75; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article .tbl { min-width: 0; }
.tip { background: var(--primary-l); border-radius: var(--r-md); padding: 16px 18px; margin: 16px 0; }
.tip strong { color: var(--primary-d); margin-right: 6px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 18px -6px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--primary-l); color: var(--primary-d); font-weight: 700; font-size: 15px; text-decoration: none; }
.back-link:hover { background: #dbebff; }
.back-link .ic { width: 20px; height: 20px; }
.cta { text-align: center; margin: 36px 0 4px; }
.cta .btn { min-height: 58px; padding: 0 30px; font-size: 17px; }
.toc { background: var(--fill); border-radius: var(--r-md); padding: 16px 20px; }
.toc ol { margin: 6px 0 0; }
.toc a { text-decoration: none; }

/* ---------- 바닥글 ---------- */
.site-footer { margin-top: 56px; padding: 30px 0 calc(34px + var(--safe-b)); background: #fff; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-nav a { color: var(--sub); text-decoration: none; font-size: 14.5px; padding: 6px 0; }
.foot-nav a:hover { color: var(--text); }
.copy { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }

/* ---------- 컴퓨터 화면 ---------- */
@media (min-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .ws-side { grid-column: 2; grid-row: 1; position: sticky; top: 76px; }
  .ws-main { grid-column: 1; grid-row: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .card { contain-intrinsic-size: 120px 160px; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .upload { padding: 48px 30px 32px; }
  .art { width: 250px; }
  .article { padding: 48px 56px; }
  .box { padding: 28px; }
  /* 컴퓨터에서는 사진 크게 보기 창을 가운데에 */
  .modal { align-items: center; padding: 16px; }
  .modal-panel { border-radius: 26px; max-height: calc(100vh - 32px); padding-bottom: 20px; animation: pop .28s cubic-bezier(.2, .9, .3, 1.1); }
  .viewer-img { height: min(50vh, 460px); }
}

/* ---------- 휴대폰 화면 ---------- */
@media (max-width: 899px) {
  .pc-only { display: none !important; }
  /* 'PDF 만들기' 버튼을 화면 아래에 항상 보이게 */
  .cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + var(--safe-b)); background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 -1px 0 rgba(0, 0, 0, .06); }
  .cta-bar .btn-huge { max-width: 560px; margin: 0 auto; display: flex; }
  body.has-photos { padding-bottom: calc(86px + var(--safe-b)); }
  body.has-photos .toast { bottom: calc(100px + var(--safe-b)); }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .menu { display: block; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 30px; }
  .lead { margin-bottom: 20px; }
  .box { padding: 20px 18px; border-radius: 22px; }
  .upload { padding: 30px 18px 22px; }
  .art { width: 190px; }
  .stepper li { font-size: 13px; padding-right: 10px; }
  .stepper li + li::before { width: 8px; }
  .content > h2 { font-size: 21px; }
  .modal-panel { border-radius: 24px 24px 0 0; }
}
@media (max-width: 380px) {
  .stepper li { font-size: 12px; gap: 5px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .preset-in { padding: 12px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
