:root {
  --bg: #f5f4f0; --panel: #fff; --line: #e4e2dc; --text: #17191f; --muted: #6a6f7a;
  --brand: #2350ad; --brand-ink: #15306e; --brand-weak: #e9eefa;
  --accent: #f26b1d; --accent-ink: #c7520f;
  --ok: #13865a; --danger: #c8372d; --warn-bg: #fff6df; --warn-ink: #7a5300;
  --radius: 12px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); font-size: 14px; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
a { color: inherit; }

/* ---------- 헤더 ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 12px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 16px; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-size: 11px; }
.logo { width: 34px; height: 34px; display: grid; place-items: center; background: var(--brand); color: #fff; border-radius: 9px; }
.logo svg { width: 22px; height: 22px; }
.topnav { display: flex; gap: 22px; }
.topnav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.topnav a:hover { color: var(--brand); }
.topact { margin-left: auto; display: flex; gap: 8px; }
body.editing .topnav { display: none; }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 9px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { box-shadow: 0 4px 14px rgba(35,80,173,.22); }
.btn:active { transform: translateY(1px); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 15px 22px; font-size: 16px; border-radius: 11px; }
.btn.ghost { background: #fff; color: var(--brand); border-color: #c8d3ee; }
.btn.ghost:hover { background: var(--brand-weak); box-shadow: none; }
.btn.ghost.light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn.ghost.light:hover { background: rgba(255,255,255,.12); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-ink); box-shadow: 0 4px 14px rgba(242,107,29,.3); }
.btn.danger { background: #fff; color: var(--danger); border-color: #efc4c0; }
.btn.primary { padding: 12px; font-size: 15px; }
.btn.success { background: var(--ok); border-color: var(--ok); padding: 12px; font-size: 15px; }
.btn.full { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.link { color: var(--brand); cursor: pointer; }
.small { font-size: 13px; }

/* ---------- 랜딩 ---------- */
#landing { flex: 1; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 64px 28px 56px; }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; padding: 12px 14px; border: 1px solid #c8d3ee; background: #fff; border-radius: 12px; font-size: 14px; box-shadow: 0 4px 14px rgba(35,80,173,.08); }
.resume b { color: var(--brand); }
.eyebrow { display: inline-block; margin: 0 0 18px; padding: 5px 12px; border-radius: 999px; background: var(--brand-weak); color: var(--brand); font-weight: 700; font-size: 13px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.18; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand); background: linear-gradient(transparent 68%, rgba(242,107,29,.28) 68%); }
.lead { font-size: 17px; line-height: 1.7; color: #3d424d; margin: 20px 0 28px; max-width: 520px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta .primary.over { outline: 3px dashed var(--accent); outline-offset: 3px; }
.trust { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.trust b { display: block; color: var(--text); font-size: 15px; }
.hero-art { position: relative; }
#heroArt svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 24px 40px rgba(21,48,110,.18)); }

.band { max-width: 1180px; margin: 0 auto; padding: 56px 28px; }
.band.alt { max-width: none; background: #fff; border-block: 1px solid var(--line); }
.band.alt > * { max-width: 1124px; margin-left: auto; margin-right: auto; }
.band h2 { font-size: 28px; font-weight: 800; }
.band .sub { color: var(--muted); margin: 8px 0 0; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.case { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.case:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.08); }
.case img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #eceae4; padding: 16px; display: block; }
.case > div { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.case h3 { font-size: 18px; }
.case p { margin: 0 0 6px; color: #4a4f59; line-height: 1.6; flex: 1; }
.case .btn { align-self: flex-start; }
.how { list-style: none; padding: 0; margin: 28px auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.how li { position: relative; padding: 20px; border-radius: 14px; background: var(--bg); }
.how li b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; margin-bottom: 12px; }
.how h3 { font-size: 16px; margin-bottom: 6px; }
.how p { margin: 0; color: #4a4f59; line-height: 1.6; font-size: 13.5px; }
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.feats > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.feats h3 { font-size: 16px; margin-bottom: 6px; }
.feats p { margin: 0; color: #4a4f59; line-height: 1.65; }
.printband { max-width: 1124px; margin: 8px auto 0; padding: 34px 36px; border-radius: 20px; background: linear-gradient(120deg, var(--brand-ink), var(--brand)); color: #fff; display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.printband h2 { font-size: 24px; }
.printband p { margin: 8px 0 0; color: rgba(255,255,255,.82); max-width: 560px; line-height: 1.6; }
.printband-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 20px; }
.guides a { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color .15s, transform .15s; }
.guides a:hover { border-color: var(--brand); transform: translateY(-2px); }
.guides b { font-size: 15px; } .guides span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.faq { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 860px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; list-style: none; position: relative; padding-right: 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 20px; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 16px; color: #4a4f59; line-height: 1.7; }

/* ---------- 편집기 ---------- */
.layout { flex: 1; display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; gap: 16px; padding: 16px 24px; align-items: start; }
.mobile-note { display: none; grid-column: 1 / -1; background: var(--warn-bg); color: var(--warn-ink); padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.steps, .props { display: flex; flex-direction: column; gap: 12px; }
.step, .props { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.props { position: sticky; top: 76px; }
.step h2, .props h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.step h2 b { width: 22px; height: 22px; border-radius: 50%; background: #c9cdd6; color: #fff; font-size: 12px; display: grid; place-items: center; }
.step.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.step.current h2 b { background: var(--brand); }
.step.done h2 b { background: var(--ok); }
.hint { color: var(--muted); margin: 0 0 10px; line-height: 1.55; font-size: 13px; }
.hint.tiny { font-size: 12px; margin-top: -2px; }
.hint em { font-style: normal; color: var(--text); font-weight: 700; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px; border: 1.5px dashed #bfc5d0; border-radius: 10px; cursor: pointer; text-align: center; background: #fbfbfa; transition: .15s; }
.drop.compact { padding: 14px 10px; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-weak); }
.drop span { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.row.wrap { flex-wrap: wrap; }

.info { margin-top: 10px; padding: 10px; background: #f6f6f3; border-radius: 9px; font-size: 13px; line-height: 1.5; word-break: break-all; }
.info table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.info th, .info td { border-bottom: 1px solid var(--line); padding: 3px 4px; text-align: left; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info .x { float: right; border: 0; background: none; color: var(--danger); cursor: pointer; }
.warn { margin-top: 8px; padding: 8px 10px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; font-size: 12px; line-height: 1.5; }
.errors { margin-top: 8px; padding: 10px; background: #fdecea; color: #8c2219; border-radius: 8px; font-size: 12px; line-height: 1.6; max-height: 200px; overflow: auto; }
.errors a { font-weight: 700; }

.slotlist { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }
.slotlist li { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 13px; }
.slotlist li.sel { border-color: var(--brand); background: var(--brand-weak); }
.slotlist .tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #eeeee9; color: var(--muted); }
.slotlist .tpl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.slotlist .warnmark { color: var(--accent); font-weight: 800; }

.tabs { display: flex; gap: 4px; background: #eeeee9; padding: 3px; border-radius: 9px; margin-bottom: 10px; }
.tab { flex: 1; border: 0; background: none; padding: 6px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.tab.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.field input, .field select, .field output { padding: 7px 9px; border: 1px solid #cfd3da; border-radius: 7px; background: #fff; color: var(--text); font-size: 13px; min-width: 0; width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid var(--brand-weak); border-color: var(--brand); }
.field output { background: #f6f6f3; }
.field input[type=color] { padding: 2px; height: 34px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0 6px; }
.rule { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.rule summary { cursor: pointer; font-weight: 700; font-size: 13px; }
code { background: #eeeee9; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.radio, .check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 8px; cursor: pointer; }
.mini { width: 56px; padding: 3px 6px; border: 1px solid #cfd3da; border-radius: 6px; }
.summary { background: #f6f6f3; border-radius: 9px; padding: 10px; font-size: 13px; line-height: 1.6; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { border: 1px solid #c8d3ee; background: var(--brand-weak); color: var(--brand); border-radius: 20px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
.chip.sys { background: #f1f1ee; border-color: #deded8; color: #444; }
.quality { list-style: none; margin: 10px 0 0; padding: 8px 10px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; font-size: 12px; line-height: 1.55; }
.quality li::before { content: "⚠ "; }

.progress { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.bar { height: 8px; background: #e7e7e2; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.done { margin-top: 12px; border: 1px solid #bfe3d1; background: #f1fbf6; border-radius: 10px; padding: 12px; }
.done-head { font-weight: 800; color: var(--ok); }
.done-head span { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.upsell { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #bfe3d1; font-size: 13px; }
.upsell p { margin: 0 0 4px; line-height: 1.55; color: #3d424d; }
.upsell .link { display: inline-block; margin-top: 8px; }

.canvas { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 70vh; display: flex; flex-direction: column; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: flex; background: #eeeee9; padding: 3px; border-radius: 9px; }
.seg button { border: 0; background: none; padding: 5px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pages button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 9px; cursor: pointer; font-size: 12px; }
.pages button.on { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.tools { display: flex; gap: 4px; }
.icon { width: 30px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 15px; }
.icon:disabled { opacity: .35; cursor: default; }
.recnav { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.recnav button { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 30px; height: 28px; cursor: pointer; }
.recnav #recLabel { min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.nextstep { padding: 9px 14px; background: var(--brand-weak); color: var(--brand-ink); font-size: 13px; border-bottom: 1px solid #d6dff3; }
.nextstep:empty { display: none; }
.nextstep b { color: var(--brand); }

.stagewrap { flex: 1; padding: 20px; overflow: auto; background: #e7e6e1; display: flex; justify-content: center; align-items: flex-start; position: relative; }
.stage { position: relative; width: 100%; max-width: 900px; box-shadow: 0 2px 14px rgba(0,0,0,.15); background: #fff; user-select: none; touch-action: none; cursor: crosshair; }
.stage img { display: block; width: 100%; height: auto; }
.overlay { position: absolute; inset: 0; }
.slot { position: absolute; border: 1.5px dashed var(--brand); background: rgba(35, 80, 173, .10); cursor: move; display: flex; align-items: center; justify-content: center; }
.slot.sel { border-style: solid; background: rgba(35, 80, 173, .18); z-index: 2; }
.slot.bad { border-color: var(--accent); background: rgba(242,107,29,.12); }
.slot .lbl { position: absolute; left: -1px; top: -18px; font-size: 10px; background: var(--brand); color: #fff; padding: 1px 5px; border-radius: 3px 3px 0 0; white-space: nowrap; pointer-events: none; }
.slot.bad .lbl { background: var(--accent); }
.slot .ico { font-size: 11px; color: var(--brand); font-weight: 700; pointer-events: none; text-align: center; overflow: hidden; padding: 2px; }
.slot .h { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid var(--brand); border-radius: 2px; }
.slot:not(.sel) .h { display: none; }
.h.nw { left: -6px; top: -6px; cursor: nwse-resize; } .h.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.h.sw { left: -6px; bottom: -6px; cursor: nesw-resize; } .h.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ghostbox { position: absolute; border: 1.5px solid var(--brand); background: rgba(35, 80, 173, .15); pointer-events: none; }
.stage.preview { cursor: default; }
.stage.preview .overlay { display: none; }
.previewmsg { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); background: rgba(23,25,31,.88); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px; max-width: 80%; z-index: 5; }

.valuebox { margin-top: 12px; font-size: 12px; background: #f6f6f3; border-radius: 8px; padding: 8px 10px; word-break: break-all; line-height: 1.5; }
.valuebox.err { background: #fdecea; color: #8c2219; }

/* ---------- 푸터 ---------- */
.foot { margin-top: 48px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; }
body.editing .foot { margin-top: 0; }
.foot-main { max-width: 1180px; margin: 0 auto; padding: 28px; display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.foot-main p { margin: 6px 0 0; line-height: 1.6; }
.foot-main > div > b { color: var(--text); font-size: 15px; }
.provider { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 14px 0 0; font-size: 13px; }
.provider dt { color: var(--muted); }
.provider dd { margin: 0; color: var(--text); font-weight: 600; }
.provider a { color: var(--brand); text-decoration: none; cursor: pointer; }
.provider a:hover { text-decoration: underline; }
.copyright { border-top: 1px solid var(--line); max-width: 1180px; margin: 0 auto; padding: 14px 28px 20px; font-size: 12px; color: var(--muted); }
.family { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.family-title { width: 100%; font-size: 12px; font-weight: 700; color: var(--muted); }
.family a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-width: 190px; }
.family a:hover { border-color: var(--brand); background: var(--brand-weak); }
.family a b { color: var(--text); font-size: 13px; }
.family a small { color: var(--muted); font-size: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #17191f; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 50; max-width: 90vw; }
.toast.err { background: var(--danger); }

@media (max-width: 1200px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr); }
  .props { grid-column: 1 / -1; position: static; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 28px; }
  .hero-art { max-width: 460px; }
  .cards, .how { grid-template-columns: 1fr 1fr; }
  .topnav { display: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .mobile-note { display: block; }
  .top { padding: 10px 14px; gap: 10px; }
  .topact #btnExport, .topact #btnImportWrap { display: none !important; }
  .canvas { min-height: 50vh; }
  .stagewrap { padding: 10px; }
  .cards, .how, .feats { grid-template-columns: 1fr; }
  .band { padding: 40px 18px; }
  .printband { margin: 8px 14px 0; padding: 26px 22px; }
  .hero { padding: 32px 18px 24px; }
  .family a { min-width: 0; flex: 1 1 100%; }
}
