*{box-sizing:border-box}body{margin:0;font:13px/1.45 'Noto Sans CJK KR',sans-serif;color:#1d2330;background:#f3f4f7}
header{display:flex;gap:16px;align-items:center;padding:8px 16px;background:#14284b;color:#fff}h1{font-size:16px;margin:0}h1 small{opacity:.7;font-weight:400}
nav button{background:#24406f;color:#fff;border:0;padding:6px 12px;margin-right:4px;border-radius:4px;cursor:pointer}nav button.on{background:#5fa8ff;color:#08203f}
.sync{margin-left:auto;font-size:12px;background:#fff2;padding:3px 8px;border-radius:4px}
.view{display:none;padding:14px 16px}body[data-view=templates] #v-templates,body[data-view=batch] #v-batch,body[data-view=output] #v-output{display:block}body[data-view=edit] #v-edit{display:grid}
h2{font-size:15px;margin:0 0 10px}h3{font-size:13px;margin:12px 0 6px}
#tplList{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:12px}
.tpl{position:relative;text-align:left;background:#fff;border:1px solid #dde1ea;border-radius:8px;padding:10px;cursor:pointer}.tpl:hover{border-color:#5fa8ff}
.tpl .th{display:flex;gap:6px;align-items:center;height:120px}.tpl .th svg{height:100%;width:auto;max-width:48%;box-shadow:0 1px 4px #0003}
.tpl .meta{display:flex;flex-direction:column;margin-top:6px}.tpl small{color:#7a8396}.new{position:absolute;top:6px;right:6px;background:#e5484d;color:#fff;font-size:11px;padding:1px 6px;border-radius:3px;z-index:2}
.edit{grid-template-columns:250px 1fr 320px;gap:12px}.left,.right{background:#fff;border-radius:8px;padding:10px;max-height:calc(100vh - 80px);overflow:auto}
label{display:block;margin:4px 0;font-size:12px}input,select,textarea{width:100%;padding:4px 6px;border:1px solid #c9cfdb;border-radius:4px;font:inherit}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:6px 0}.row button,#people button,#batchApply,#makePdf{padding:5px 10px;border:1px solid #c9cfdb;background:#fff;border-radius:4px;cursor:pointer}
.row button.on,#people button.on{background:#14284b;color:#fff}#people{display:flex;flex-wrap:wrap;gap:4px}
#stage{background:#e8eaef;border-radius:8px;padding:10px;display:flex;justify-content:center}#stage svg{width:100%;max-height:68vh;height:auto;background:#fafafa}
#specInfo{font-size:12px}.red{color:#e5484d}
#issues{list-style:none;padding:0;margin:0;font-size:12px}#issues li{padding:4px 6px;border-radius:4px;margin:2px 0}li.block{background:#fde7e8}li.warn{background:#fff1dc}li.ok{background:#e6f6ea}
.legend{font-size:12px;margin-top:6px}.legend i{display:inline-block;width:18px;height:0;border-top:2px dashed;vertical-align:middle;margin:0 3px 0 10px}.lb{color:#e5484d}.lt{color:#111;border-top-style:solid!important}.ls{color:#1e88e5}.lk{color:#fb8c00}.lz{color:#e5484d;height:10px!important;background:#e5484d55;border:0!important}
.hint{color:#6b7487;font-size:12px}textarea{font-family:'IBM Plex Mono',monospace}
table{border-collapse:collapse;margin:8px 0;background:#fff}td,th{border:1px solid #dde1ea;padding:3px 8px;font-size:12px}td.block{color:#e5484d}td.warn{color:#c76b00}td.ok{color:#1b873f}
#batchPreview{display:flex;gap:8px;flex-wrap:wrap}.mini svg{width:260px;height:auto;box-shadow:0 1px 4px #0003}
.out{display:grid;grid-template-columns:1fr 420px;gap:12px}#pdfPages{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}figure{margin:0;background:#fff;padding:6px;border-radius:6px}figure img{width:100%;border:1px solid #ddd}figcaption{font-size:12px}
pre{background:#0f1729;color:#cfe3ff;padding:10px;border-radius:6px;font-size:11px;max-height:70vh;overflow:auto}
#measure{position:absolute;left:-10000px;top:0;width:1000px}

.io{display:flex;gap:4px;align-items:center;font-size:12px}.io button,.fileBtn{background:#fff;color:#14284b;border:0;padding:4px 8px;border-radius:4px;cursor:pointer;margin:0}.fileBtn input{display:none}#saveMsg{max-width:260px}
.legend{display:flex;flex-wrap:wrap;gap:4px 14px;background:#fff;border-radius:6px;padding:6px 10px}.lg{display:inline-flex;align-items:center;gap:4px}

.batchGrid{display:grid;grid-template-columns:1fr 300px;gap:12px}.teamBox{background:#fff;border-radius:8px;padding:8px 10px}.lock{font-weight:600}.lock input{width:auto}
#batchMap{font-size:12px;margin:4px 0;display:flex;flex-wrap:wrap;gap:4px;align-items:center}.chip{padding:1px 7px;border-radius:10px;background:#eef1f6;border:1px solid #d5dbe6}.chip.okc{background:#e6f6ea;border-color:#a8dbb5}.chip.unk{background:#fff1dc;border-color:#f3c98b}.chip.lockd{background:#ece6ff;border-color:#c5b4ff}
.bd{display:inline-block;font-size:11px;padding:0 5px;margin:1px;border-radius:3px}.bd.block{background:#fde7e8;color:#c62828}.bd.warn{background:#fff1dc;color:#9a5300}
tr.rb td:first-child{box-shadow:inset 3px 0 #e5484d}tr.rw td:first-child{box-shadow:inset 3px 0 #fb8c00}td.cellbad{background:#fff1dc;color:#9a5300}#batchTable tr[data-row]{cursor:pointer}
#batchPreview{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:8px}#batchPreview .mini{background:#fff;padding:6px;border-radius:6px;border:2px solid #dde1ea}#batchPreview .mini.block{border-color:#e5484d}#batchPreview .mini.warn{border-color:#fb8c00}
#batchPreview .mini div{display:flex;gap:4px}#batchPreview .mini svg{width:50%;height:auto;max-height:150px;box-shadow:0 1px 3px #0003}

#issues li.info{color:#5b4300;background:#fff6d6}
.rasterNote{margin:6px 0;padding:6px 10px;border-radius:6px;background:#fff6d6;color:#5b4300;font-size:13px}
.bd.info{background:#fff6d6;color:#5b4300}

.samples{margin:6px 0;font-size:13px;line-height:1.9}.samples a{margin-right:8px;color:#1d4ed8}.filebtn{margin-left:8px;padding:2px 8px;border:1px solid #94a3b8;border-radius:5px;cursor:pointer}.filebtn input{display:none}

.pdfnote{margin:6px 0 10px;padding:6px 10px;font-size:13px;line-height:1.5;color:#1F2937;background:#EEF2FF;border-left:3px solid #3B4BC8;border-radius:4px}

/* 모바일(폭 700px 이하, 터치): 한 줄 배치, 터치 대상 44px, 입력칸 16px(iOS 자동 확대 방지), 가로 스크롤 없음 */
@media (max-width:700px){
 body{font-size:14px}
 header{flex-wrap:wrap;gap:6px;padding:8px 10px}header h1{width:100%}
 nav{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;width:100%}nav button{margin:0;min-height:44px;font-size:14px}
 .io{flex-wrap:wrap;width:100%;gap:6px}.io button,.fileBtn{min-height:44px;min-width:44px;display:inline-flex;align-items:center;flex:1 1 40%;justify-content:center}#saveMsg{max-width:100%}
 .sync{margin-left:0}
 .view{padding:10px}
 #tplList{grid-template-columns:1fr}
 .edit,body[data-view=edit] #v-edit{grid-template-columns:minmax(0,1fr)}.left,.right{max-height:none;overflow:visible}
 .edit main{order:-1}#stage{padding:6px}#stage svg{max-height:none}
 input,select,textarea{font-size:16px;min-height:44px;padding:8px}textarea{min-height:120px}
 input[type=checkbox],input[type=radio]{width:22px;height:22px;min-height:0;vertical-align:middle}
 label:has(> input[type=checkbox]){display:flex;align-items:center;gap:8px;min-height:44px}
 .row button,#people button,#batchApply,#makePdf{min-height:44px;min-width:44px;padding:8px 12px;font-size:14px}
 .samples a{display:inline-flex;align-items:center;min-height:44px;min-width:44px;padding:0 4px}.filebtn{display:inline-flex;align-items:center;min-height:44px;margin:4px 0}#pdfLink{display:inline-flex;align-items:center;min-height:44px;padding:0 6px}
 .batchGrid,.out{grid-template-columns:minmax(0,1fr)}
 #batchTable{display:block;max-width:100%;overflow-x:auto}#batchTable td,#batchTable th{padding:13px 8px;white-space:nowrap}
 #batchPreview{grid-template-columns:minmax(0,1fr)}#batchPreview .mini svg{max-height:none}
 #pdfPages{grid-template-columns:minmax(0,1fr)}pre{max-width:100%;max-height:50vh}
 .legend{font-size:13px}
}

/* 입력 중 미리보기·미세조정: 데스크톱에서는 숨김(기존 화면 그대로) */
.miniPrev,.nudge{display:none}
@media (max-width:700px){
 body[data-view=edit] .miniPrev{display:block;position:sticky;top:var(--vvTop,0px);z-index:5;background:#f3f4f7;padding:4px 0 6px;margin:-4px 0 0}
 .mpBar{display:flex;align-items:center;justify-content:space-between;gap:8px}.mpBar button{min-height:44px;min-width:72px;padding:8px 12px;border:1px solid #c9cfdb;background:#fff;border-radius:4px;font-size:14px}
 #mpCard{display:flex;justify-content:center}#mpCard svg{height:min(120px,calc(var(--vvH,844px)*.24));width:auto;max-width:100%;box-shadow:0 1px 4px #0003;background:#fff}
 .miniPrev.closed #mpCard,.miniPrev.dup #mpCard{display:none}
 .mpBar .ur{display:flex;gap:6px;margin-left:auto}.mpBar .ur button{min-width:44px;padding:8px 8px}.mpBar .ur button:disabled{opacity:.45}
 #v-edit input,#v-edit select,#v-edit textarea{scroll-margin-top:calc(var(--mpH,0px) + 12px)}
 .nudge{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:8px 0}.nudge button{min-height:48px;min-width:48px;font-size:20px;border:1px solid #c9cfdb;background:#fff;border-radius:6px;touch-action:none;user-select:none;-webkit-user-select:none}
}

/* 13차: 데스크톱 되돌리기/다시하기(편집 도구줄 오른쪽 끝), 이어서 하기 안내(화면 아래 고정, 닫히면 자리 차지 없음) */
#v-edit main>.row:first-child{position:relative}.deskUr{display:inline-flex;gap:6px;position:absolute;right:0;top:0}.deskUr button:disabled{opacity:.45;cursor:default}
.resumeBar{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:50;background:#fff;color:#14284b;border:1px solid #c9cfdb;border-radius:6px;box-shadow:0 4px 16px rgba(0,0,0,.18);padding:10px 14px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;max-width:min(560px,calc(100vw - 24px));font-size:14px}
.resumeBar[hidden]{display:none}.resumeBar p{margin:0;flex:1 1 100%}.resumeBar .note{font-size:12px;color:#555}.resumeBar button{min-height:40px;padding:6px 14px;border:1px solid #c9cfdb;background:#fff;border-radius:4px;cursor:pointer;font-size:14px}#resumeYes{background:#14284b;color:#fff}
/* 14차: 공용 PC 안내(버튼 아래 한 줄, 13px ≈ 9.75pt) */
.resumeBar .pcNote{font-size:13px;line-height:1.35;color:#3d4655}
@media (max-width:700px){.deskUr{display:none}.resumeBar button{min-height:44px;flex:1 1 40%}.resumeBar{left:12px;right:12px;transform:none;max-width:none}}
/* 17차 용지 선택·투명 용지 제한(카드명함만) */
.paperBox[hidden],.clearNote[hidden]{display:none}.clearNote{margin:6px 0;padding:6px 10px;border-radius:6px;background:#eef4ff;color:#1d3a6b;font-size:13px}.clearNote.bad{background:#fff1e6;color:#7a3300}
.tpl:disabled{cursor:not-allowed;opacity:.55}.tpl .why{font-style:normal;font-size:12px;color:#9a3b00;margin-top:2px}.hint.soft{color:#7a5a00}button[data-side]:disabled{opacity:.45;cursor:not-allowed}
/* 18차: 투명 전용 템플릿 미리보기 체크무늬(화면 전용, PDF·SVG에는 없음) */
#stage.clearbg svg,.tpl.clearTpl .th svg{background-color:#fff;background-image:linear-gradient(45deg,#d9dce3 25%,transparent 25%,transparent 75%,#d9dce3 75%),linear-gradient(45deg,#d9dce3 25%,transparent 25%,transparent 75%,#d9dce3 75%);background-size:16px 16px;background-position:0 0,8px 8px}
.clearTag{display:inline-block;font-size:11px;font-weight:600;color:#1e3256;border:1px solid #1e3256;border-radius:3px;padding:0 4px;vertical-align:1px}

#qtySel[hidden],#qty[hidden],.qtyNote[hidden]{display:none}.qtyNote{font-size:13px;color:#1d3a6b;background:#eef4ff;border-radius:6px;padding:2px 8px}
.qrBox{border:1px solid #7c4dff;border-radius:6px;padding:8px;margin:0 0 8px;background:#f6f2ff}.qrBox input{width:100%;box-sizing:border-box}.qrBox button{margin-top:6px}
#qr-slot-dialog{max-width:420px;border:1px solid #7c4dff;border-radius:8px;padding:16px}#qr-slot-dialog textarea{width:100%;box-sizing:border-box;font-size:14px}#qr-slot-dialog [role=alert]{color:#c62828}
/* [namecard cleanup 20261030s] hide dev/explanatory items */
header h1 small,#saveFile,header .fileBtn,nav button[data-view=batch],#legend,#pdfNote,.out>div:has(#payload),#tplList small,#resumePcNote{display:none!important}
.marks rect.mk-warn{opacity:0;transition:opacity .12s}.marks rect.mk-warn.mk-on,.marks rect.mk-warn.mk-hov{opacity:1}
