/* ==========================================================================
   무료 이력서 PDF 빌더 — styles.css
   1) 앱 UI  2) 에디터  3) A4 미리보기  4) 템플릿 3종  5) 인쇄
   ========================================================================== */

/* ---------- 1. 기본 토큰 ---------- */
:root{
  --bg:#f5f6fa;
  --panel:#ffffff;
  --ink:#12141a;
  --ink-2:#3d424e;
  --muted:#6b7280;
  --line:#e5e7ee;
  --line-2:#eef0f6;
  --accent:#2f5bea;
  --accent-weak:#eef2ff;
  --ok:#0f8a5f;
  --danger:#c62828;
  --radius:14px;
  --shadow:0 1px 2px rgba(16,24,40,.05),0 8px 28px rgba(16,24,40,.07);
  --font:"Inter","NanumGothic",-apple-system,BlinkMacSystemFont,"Malgun Gothic","Apple SD Gothic Neo",sans-serif;
}

@font-face{
  font-family:"NanumGothic";
  src:url("vendor/NanumGothic-Regular.ttf") format("truetype");
  font-weight:400;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"NanumGothic";
  src:url("vendor/NanumGothic-Bold.ttf") format("truetype");
  font-weight:700;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"Inter";
  src:url("vendor/Inter-Regular.ttf") format("truetype");
  font-weight:400;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"Inter";
  src:url("vendor/Inter-SemiBold.ttf") format("truetype");
  font-weight:600 900;font-style:normal;font-display:swap;
}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);
  font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;
}
button{font:inherit;color:inherit}
h1,h2,h3,h4,p,ul,ol{margin:0}
a{color:var(--accent)}
::selection{background:#cfdaff}

.skip-link{
  position:absolute;left:-9999px;top:0;z-index:100;
  background:#fff;padding:10px 14px;border-radius:0 0 8px 0;
}
.skip-link:focus{left:0}

/* ---------- 2. 앱 바 ---------- */
.appbar{
  position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:14px;
  padding:0 16px;height:58px;background:rgba(255,255,255,.92);
  backdrop-filter:blur(8px);border-bottom:1px solid var(--line);
}
.appbar__brand{display:flex;align-items:center;gap:10px;min-width:0}
.appbar__mark{
  display:grid;place-items:center;width:34px;height:34px;border-radius:10px;
  background:var(--accent);color:#fff;flex:none;
  box-shadow:0 2px 8px rgba(47,91,234,.28);
}
.appbar__title{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.appbar__title strong{font-size:15px;letter-spacing:-.01em;white-space:nowrap}
.appbar__sub{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.appbar__actions{margin-left:auto;display:flex;align-items:center;gap:6px;flex:none}

.langswitch{display:flex;padding:2px;background:#eef0f6;border-radius:9px;margin-right:4px}
.langswitch button{
  border:0;background:transparent;border-radius:7px;padding:5px 9px;
  font-size:12.5px;font-weight:600;color:var(--muted);cursor:pointer;
}
.langswitch button.is-on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(16,24,40,.12)}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  height:34px;padding:0 11px;border:1px solid var(--line);border-radius:9px;
  background:#fff;font-size:13px;font-weight:600;color:var(--ink-2);cursor:pointer;
  white-space:nowrap;transition:.12s border-color,.12s background,.12s transform;
}
.btn:hover{border-color:#cfd4e2;background:#fbfbfd}
.btn:active{transform:translateY(1px)}
.btn--ghost{background:transparent;border-color:transparent;color:var(--ink-2)}
.btn--ghost:hover{background:#eff1f7;border-color:transparent}
.btn--primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 2px 10px rgba(47,91,234,.28)}
.btn--primary:hover{background:#2549c9;border-color:#2549c9}
.btn__ico,.ico{font-size:13px;line-height:1}
.btn[disabled]{opacity:.55;cursor:default}

.menu{position:relative}
.menu__pop{
  position:absolute;right:0;top:calc(100% + 6px);z-index:50;min-width:160px;
  background:#fff;border:1px solid var(--line);border-radius:11px;
  box-shadow:var(--shadow);padding:6px;display:flex;flex-direction:column;
}
.menu__pop[hidden]{display:none}
.menu__pop button{
  text-align:left;border:0;background:transparent;padding:9px 10px;border-radius:8px;
  font-size:13px;cursor:pointer;
}
.menu__pop button:hover{background:#f2f4fa}

/* ---------- 3. 레이아웃 ---------- */
.app{
  display:grid;grid-template-columns:minmax(360px,430px) minmax(0,1fr);
  height:calc(100vh - 58px);
}
.editor{
  overflow-y:auto;padding:14px 14px 40px;border-right:1px solid var(--line);
  background:var(--bg);overscroll-behavior:contain;
}
.preview{
  display:flex;flex-direction:column;min-width:0;min-height:0;background:#eceef4;
}

/* ---------- 4. 에디터 ---------- */
.sec{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  margin-bottom:10px;overflow:hidden;
}
.sec__head{
  display:flex;align-items:center;gap:9px;width:100%;padding:13px 14px;
  border:0;background:transparent;cursor:pointer;text-align:left;
}
.sec__num{
  display:grid;place-items:center;width:22px;height:22px;border-radius:7px;
  background:var(--accent-weak);color:var(--accent);font-size:11.5px;font-weight:700;flex:none;
}
.sec__title{font-size:14px;font-weight:700;letter-spacing:-.01em}
.sec__sum{font-size:11.5px;color:var(--muted);margin-left:auto;margin-right:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:52%}
.sec__chev{width:16px;height:16px;flex:none;color:#9aa1b2;transition:transform .16s}
.sec[open] .sec__chev{transform:rotate(180deg)}
.sec__body{padding:0 14px 15px;border-top:1px solid var(--line-2);margin-top:-1px;padding-top:13px}
.sec[open] .sec__body{display:block}
.sec:not([open]) .sec__body{display:none}

.field{margin-bottom:11px}
.field:last-child{margin-bottom:0}
.field__label{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  font-size:11.5px;font-weight:600;color:var(--ink-2);margin-bottom:5px;letter-spacing:.01em;
}
.field__label .hint{font-weight:400;color:#9aa1b2;font-size:11px}
input[type=text],input[type=email],input[type=tel],input[type=url],input[type=month],textarea,select{
  width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:9px;
  background:#fff;font:inherit;font-size:13px;color:var(--ink);
  transition:border-color .12s, box-shadow .12s;
}
input:focus,textarea:focus,select:focus{
  outline:0;border-color:#9db2ff;box-shadow:0 0 0 3px rgba(47,91,234,.13);
}
textarea{resize:vertical;min-height:64px;line-height:1.55}
::placeholder{color:#a9afbd}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:9px}

.check{
  display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--ink-2);
  cursor:pointer;user-select:none;
}
.check input{accent-color:var(--accent);width:15px;height:15px}

.addbtn{
  display:flex;align-items:center;justify-content:center;gap:6px;width:100%;
  padding:9px;border:1px dashed #c8cedd;border-radius:10px;background:#fbfcff;
  color:var(--accent);font-size:12.5px;font-weight:700;cursor:pointer;
}
.addbtn:hover{background:var(--accent-weak);border-color:#9db2ff}

.item{
  border:1px solid var(--line);border-radius:11px;padding:11px;margin-bottom:9px;background:#fdfdff;
}
.item__head{display:flex;align-items:center;gap:6px;margin-bottom:9px}
.item__title{font-size:12px;font-weight:700;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item__tools{margin-left:auto;display:flex;gap:2px}
.iconbtn{
  display:grid;place-items:center;width:26px;height:26px;border:1px solid transparent;
  border-radius:7px;background:transparent;color:#8b92a3;cursor:pointer;font-size:12px;
}
.iconbtn:hover{background:#eef1f8;color:var(--ink)}
.iconbtn[disabled]{opacity:.35;cursor:default}
.iconbtn--danger:hover{background:#fdecec;color:var(--danger)}

.bullets{margin-top:9px;border-top:1px dashed var(--line);padding-top:9px}
.bullet-row{display:flex;gap:6px;align-items:flex-start;margin-bottom:6px}
.bullet-row .bullet-dot{padding-top:9px;color:#9aa1b2;font-size:12px}
.bullet-row textarea{min-height:38px;padding:7px 9px;font-size:12.5px}
.bullet-row .bullet-tools{display:flex;flex-direction:column;gap:1px}

/* 사진 업로드 */
.photo-row{display:flex;gap:11px;align-items:center;margin-bottom:12px}
.photo-thumb{
  width:58px;height:58px;border-radius:12px;border:1px solid var(--line);
  background:#f2f4f9 center/cover no-repeat;flex:none;display:grid;place-items:center;
  color:#b6bcc9;font-size:10px;overflow:hidden;
}
.photo-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.photo-actions{display:flex;flex-direction:column;gap:5px}
.photo-actions .row{display:flex;gap:5px}
.btn--sm{height:28px;padding:0 9px;font-size:12px;border-radius:8px}

/* 기술 태그 */
.tag-add{display:flex;gap:6px;margin-bottom:9px}
.tag-add input{flex:1}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{
  display:inline-flex;align-items:center;gap:6px;background:#f1f3fa;border:1px solid var(--line);
  border-radius:999px;padding:4px 4px 4px 10px;font-size:12px;
}
.chip b{font-weight:600}
.chip select{
  width:auto;padding:1px 4px;font-size:11px;border-radius:6px;border-color:#dfe3ee;background:#fff;
}
.chip button{
  border:0;background:transparent;color:#9aa1b2;cursor:pointer;font-size:14px;
  line-height:1;padding:0 3px;border-radius:50%;
}
.chip button:hover{color:var(--danger)}
.chip.is-empty{color:var(--muted)}

/* 디자인 패널 */
.tpl-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}
.tpl-card{
  border:1.5px solid var(--line);border-radius:11px;background:#fff;padding:7px;cursor:pointer;
  display:flex;flex-direction:column;gap:6px;align-items:stretch;text-align:left;
}
.tpl-card.is-on{border-color:var(--accent);box-shadow:0 0 0 3px rgba(47,91,234,.12)}
.tpl-card__thumb{height:56px;border-radius:6px;background:#f4f5f9;position:relative;overflow:hidden}
.tpl-card__thumb i{position:absolute;background:#c9d0e2;border-radius:1px}
.tpl-card__name{font-size:11.5px;font-weight:700;text-align:center}
.tpl-thumb--minimal i.l1{left:8px;right:8px;top:8px;height:3px;background:#31343c}
.tpl-thumb--minimal i.l2{left:8px;top:15px;width:30%;height:2px;background:#9aa3b8}
.tpl-thumb--minimal i.l3{left:8px;right:8px;top:26px;height:2px}
.tpl-thumb--minimal i.l4{left:8px;right:8px;top:32px;height:2px}
.tpl-thumb--minimal i.l5{left:8px;right:26px;top:38px;height:2px}
.tpl-thumb--modern i.bar{left:0;top:0;bottom:0;width:34%;background:#2f5bea;opacity:.85}
.tpl-thumb--modern i.l1{left:40%;right:8px;top:9px;height:3px;background:#31343c}
.tpl-thumb--modern i.l2{left:40%;right:20px;top:16px;height:2px}
.tpl-thumb--modern i.l3{left:40%;right:8px;top:26px;height:2px}
.tpl-thumb--modern i.l4{left:40%;right:14px;top:32px;height:2px}
.tpl-thumb--modern i.c1{left:6px;top:8px;width:22%;height:2px;background:#fff}
.tpl-thumb--creative i.hero{left:0;right:0;top:0;height:24px;background:#2f5bea}
.tpl-thumb--creative i.l1{left:8px;top:8px;width:40%;height:3px;background:#fff}
.tpl-thumb--creative i.l2{left:8px;top:15px;width:24%;height:2px;background:#cdd8ff}
.tpl-thumb--creative i.card1{left:8px;right:8px;top:30px;height:9px;background:#eef1f9;border-left:2px solid #2f5bea}
.tpl-thumb--creative i.card2{left:8px;right:16px;top:43px;height:9px;background:#eef1f9;border-left:2px solid #2f5bea}

.swatches{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.swatch{
  width:26px;height:26px;border-radius:8px;border:2px solid #fff;cursor:pointer;
  box-shadow:0 0 0 1px var(--line);position:relative;
}
.swatch.is-on{box-shadow:0 0 0 2px var(--ink)}
.swatch-custom{
  width:26px;height:26px;padding:0;border:1px solid var(--line);border-radius:8px;background:#fff;cursor:pointer;
}
.sliders{display:grid;gap:11px;margin-top:14px}
.slider{display:grid;grid-template-columns:74px 1fr 44px;align-items:center;gap:10px;font-size:12px;color:var(--ink-2)}
.slider input[type=range]{width:100%;accent-color:var(--accent)}
.slider output{font-size:11.5px;color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}

.note{
  display:flex;gap:7px;background:#f6f8ff;border:1px solid #e2e8ff;border-radius:9px;
  padding:9px 10px;font-size:11.5px;color:#4a5673;line-height:1.5;margin-top:11px;
}
.note b{color:#2f4bb3}

.editor__foot{
  text-align:center;font-size:11px;color:#9aa1b2;margin-top:16px;line-height:1.6;
}

/* 광고 슬롯(승인 전 자리) */
.ad-slot{
  border:1px dashed #d7dbe6;border-radius:10px;color:#b3b9c7;
  display:flex;align-items:center;justify-content:center;font-size:10px;letter-spacing:.2em;
  background:repeating-linear-gradient(135deg,#fafbfe,#fafbfe 8px,#f4f6fb 8px,#f4f6fb 16px);
}
.ad-slot--inline{height:46px;margin-bottom:10px;font-size:9px}
.ad-slot--preview{height:0;border:0;overflow:hidden;background:none}
.ad-slot--footer{height:90px;margin:26px 0 14px;max-width:760px}

/* ---------- 5. 미리보기 ---------- */
.preview__bar{
  display:flex;align-items:center;gap:10px;padding:9px 14px;background:#fff;
  border-bottom:1px solid var(--line);flex:none;
}
.segmented{display:flex;gap:2px;padding:3px;background:#f0f2f8;border-radius:10px}
.segmented button{
  border:0;background:transparent;padding:6px 12px;border-radius:8px;
  font-size:12.5px;font-weight:600;color:var(--muted);cursor:pointer;white-space:nowrap;
}
.segmented button.is-on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(16,24,40,.12)}
.preview__meta{margin-left:auto;display:flex;align-items:center;gap:10px}
.pill{
  font-size:11.5px;font-weight:600;color:#4a5470;background:#f1f3fa;border:1px solid var(--line);
  padding:4px 9px;border-radius:999px;white-space:nowrap;
}
.pill.is-warn{background:#fff6e8;border-color:#ffe0ae;color:#8a5a00}
.zoom{display:flex;align-items:center;background:#fff;border:1px solid var(--line);border-radius:9px;overflow:hidden}
.zoom button{border:0;background:transparent;width:28px;height:28px;cursor:pointer;font-size:14px;color:var(--ink-2)}
.zoom button:hover{background:#f2f4fa}
.zoom__val{width:52px !important;font-size:11.5px;font-weight:600}

.preview__scroll{flex:1;overflow:auto;padding:22px 16px 60px;overscroll-behavior:contain}
.preview__stage{display:flex;justify-content:center;min-height:100%}
.preview__clip{position:relative;flex:none}
.preview__scaler{transform-origin:top left;position:absolute;top:0;left:0;width:210mm}

/* 종이 */
.paper-host{position:relative;width:210mm}
.paper{
  --fs:10.6pt;
  --accent-ink:#2f5bea;
  --scale:1;
  --pad:15mm;
  --accent:#2f5bea;
  width:210mm;min-height:297mm;background:#fff;color:#15171c;
  font-family:"Inter","NanumGothic",sans-serif;
  font-size:calc(var(--fs) * var(--scale));
  line-height:1.52;
  position:relative;
  box-shadow:0 1px 2px rgba(16,24,40,.10),0 18px 50px rgba(16,24,40,.13);
  -webkit-font-smoothing:antialiased;
}
.paper *{box-sizing:border-box}
.page-guide{
  position:absolute;left:-6px;right:-6px;height:0;border-top:1px dashed rgba(40,60,120,.28);
  pointer-events:none;z-index:5;
}
.page-guide span{
  position:absolute;right:2px;top:-9px;background:#3a4a72;color:#fff;font-size:9px;
  padding:1px 5px;border-radius:4px;font-family:var(--font);
}

/* 공통 이력서 요소 */
.r-h2{
  font-size:.74em;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--accent-ink);margin:0 0 2.6mm;
}
.r-entry{margin-bottom:4mm;break-inside:avoid;page-break-inside:avoid}
.r-entry:last-child{margin-bottom:0}
.r-company{font-size:1.02em;font-weight:700;letter-spacing:-.005em}
.r-role{font-size:.94em;font-weight:600;color:#3b4250}
.r-period{font-size:.83em;color:#7a8090;font-variant-numeric:tabular-nums;white-space:nowrap}
.r-desc{font-size:.92em;color:#3c414d;margin-top:1.4mm;line-height:1.58}
.r-bullets{list-style:none;margin:1.6mm 0 0;padding:0}
.r-bullets li{display:flex;gap:1.8mm;font-size:.92em;color:#33383f;line-height:1.55;margin-bottom:.7mm}
.r-bullets li:last-child{margin-bottom:0}
.r-bullets .b{color:var(--accent-ink);flex:none;font-size:.95em;line-height:1.55}
.r-bullets .t{flex:1;min-width:0}
.r-line{display:flex;align-items:baseline;gap:3mm}
.r-line .grow{flex:1;min-width:0}
.r-sec{margin-top:6.5mm;break-inside:auto}
.r-sec:first-child{margin-top:0}

/* 빈 상태 */
.r-empty{color:#9aa0ad;font-size:.9em}

/* ---------- 6-1. 템플릿: 미니멀(MINIMAL) ---------- */
.tpl-minimal{--accent:#2f5bea}
.tpl-minimal .mn-in{padding:var(--pad) calc(var(--pad) + 1mm)}
.tpl-minimal .mn-head{
  display:flex;gap:8mm;align-items:flex-start;justify-content:space-between;
  padding-bottom:4.5mm;border-bottom:1.4pt solid #1b1d22;
}
.tpl-minimal .mn-headmain{flex:1;min-width:0}
.tpl-minimal .mn-name{font-size:2.32em;font-weight:700;letter-spacing:-.03em;line-height:1.12}
.tpl-minimal .mn-title{font-size:1.02em;font-weight:600;color:var(--accent-ink);margin-top:1.4mm;letter-spacing:.005em}
.tpl-minimal .mn-photo{
  width:23mm;height:23mm;object-fit:cover;display:block;border:1px solid #e3e5ea;flex:none;
}
.tpl-minimal .mn-contact{
  display:flex;flex-wrap:wrap;gap:1.2mm 3.4mm;margin-top:3.4mm;
  font-size:.84em;color:#4c5260;
}
.tpl-minimal .mn-contact .dot{color:#c2c7d2}
.tpl-minimal .mn-sec{margin-top:6mm}
.tpl-minimal .mn-entry{
  display:grid;grid-template-columns:1fr auto;column-gap:4mm;
  padding-top:2.6mm;break-inside:avoid;page-break-inside:avoid;
}
.tpl-minimal .mn-entry:first-of-type{padding-top:0}
.tpl-minimal .mn-entry + .mn-entry{border-top:.6pt solid #e8eaf0;margin-top:2.6mm}
.tpl-minimal .mn-e-head{grid-column:1;min-width:0}
.tpl-minimal .mn-e-period{grid-column:2;text-align:right;padding-top:.4mm}
.tpl-minimal .mn-e-body{grid-column:1 / span 2;margin-top:.6mm}
.tpl-minimal .mn-skills{display:flex;flex-wrap:wrap;gap:1.8mm 2mm}
.tpl-minimal .sk{
  display:inline-flex;align-items:baseline;gap:1.6mm;border:.6pt solid #dfe3ec;
  border-radius:999px;padding:.7mm 2.6mm;font-size:.86em;color:#2b303b;line-height:1.3;
}
.tpl-minimal .sk em{font-style:normal;font-size:.85em;color:#8b92a2}
.tpl-minimal .mn-list{display:grid;grid-template-columns:1fr 1fr;gap:1.2mm 7mm;margin-top:.6mm}
.tpl-minimal .mn-list + .mn-list{margin-top:2mm}
.tpl-minimal .mn-li{display:flex;justify-content:space-between;align-items:baseline;gap:3mm;font-size:.89em;border-bottom:.4pt solid #eef0f5;padding-bottom:.9mm}
.tpl-minimal .mn-li .n{font-weight:600;color:#22262f}
.tpl-minimal .mn-li .m{color:#7d8494;font-size:.88em;text-align:right;white-space:nowrap}

/* ---------- 6-2. 템플릿: 모던(MODERN) ---------- */
.tpl-modern{--side-w:62mm}
.tpl-modern .md-grid{display:grid;grid-template-columns:var(--side-w) 1fr;min-height:297mm;align-items:stretch}
.tpl-modern .md-side{
  background:var(--side-bg);color:var(--side-fg);padding:var(--pad) 9mm;
}
.tpl-modern .md-photo{
  width:100%;aspect-ratio:1/1;object-fit:cover;display:block;
  background:rgba(255,255,255,.15);
}
.tpl-modern .md-photo-wrap{margin-bottom:6mm}
.tpl-modern .md-side-name{font-size:1.6em;font-weight:700;letter-spacing:-.02em;line-height:1.2}
.tpl-modern .md-side-title{font-size:.9em;color:var(--side-muted);margin-top:1mm}
.tpl-modern .md-sblock{margin-top:6.5mm}
.tpl-modern .md-shead{
  font-size:.68em;font-weight:700;letter-spacing:.16em;text-transform:uppercase;
  color:var(--side-muted);padding-bottom:1.6mm;border-bottom:.6pt solid var(--side-line);margin-bottom:2.4mm;
}
.tpl-modern .md-contact{display:flex;flex-direction:column;gap:1.8mm;font-size:.82em;line-height:1.45}
.tpl-modern .md-contact span{word-break:break-word}
.tpl-modern .md-skill{margin-bottom:2.2mm}
.tpl-modern .md-skill-name{font-size:.84em;font-weight:600}
.tpl-modern .md-level{display:flex;gap:1mm;margin-top:1.1mm}
.tpl-modern .md-dot{width:6.2mm;height:.9mm;border-radius:.6mm;background:var(--side-line)}
.tpl-modern .md-dot.on{background:var(--side-accent)}
.tpl-modern .md-dot.on{background:var(--side-accent)}
.tpl-modern .md-lang{display:flex;justify-content:space-between;gap:2mm;font-size:.8em;color:var(--side-muted);margin-bottom:1.4mm}
.tpl-modern .md-lang b{color:var(--side-fg);font-weight:600}
.tpl-modern .md-main{padding:var(--pad) calc(var(--pad) + 1mm) var(--pad) 11mm}
.tpl-modern .md-name{font-size:2.5em;font-weight:700;letter-spacing:-.035em;line-height:1.1}
.tpl-modern .md-title{font-size:1.02em;font-weight:600;color:var(--accent-ink);margin-top:1.6mm}
.tpl-modern .md-rule{height:2pt;width:14mm;background:var(--accent-ink);margin:4mm 0 0}
.tpl-modern .md-sec{margin-top:6.5mm}
.tpl-modern .md-entry{padding:2.6mm 0;border-bottom:.6pt solid #eceef4;break-inside:avoid;page-break-inside:avoid}
.tpl-modern .md-entry:last-child{border-bottom:0;padding-bottom:0}
.tpl-modern .md-e-head{display:flex;justify-content:space-between;gap:4mm;align-items:baseline}
.tpl-modern .md-e-left{min-width:0}
.tpl-modern .md-chip{
  display:inline-block;font-size:.76em;font-weight:600;color:var(--accent);
  background:var(--accent-soft);border-radius:999px;padding:.7mm 2.2mm;margin:0 .8mm .8mm 0;
}

/* ---------- 6-3. 템플릿: 크리에이티브(CREATIVE) ---------- */
.tpl-creative .cr-hero{
  background:var(--accent);color:var(--hero-fg);padding:calc(var(--pad) + 1mm) var(--pad) calc(var(--pad) - 5mm);
  display:flex;gap:9mm;align-items:center;justify-content:space-between;
}
.tpl-creative .cr-hero-main{flex:1;min-width:0}
.tpl-creative .cr-kicker{
  font-size:.7em;font-weight:700;letter-spacing:.2em;text-transform:uppercase;
  color:var(--hero-kicker);margin-bottom:2.4mm;
}
.tpl-creative .cr-name{font-size:2.65em;font-weight:700;letter-spacing:-.035em;line-height:1.05}
.tpl-creative .cr-title{font-size:1.05em;font-weight:600;margin-top:2mm;color:var(--hero-kicker)}
.tpl-creative .cr-pills{display:flex;flex-wrap:wrap;gap:1.8mm;margin-top:4.2mm}
.tpl-creative .cr-pill{
  background:var(--hero-pill);border-radius:999px;padding:1.4mm 3mm;
  font-size:.79em;color:var(--hero-fg);white-space:nowrap;
}
.tpl-creative .cr-photo{
  width:28mm;height:28mm;object-fit:cover;display:block;
  border:2px solid var(--hero-pill);flex:none;
}
.tpl-creative .cr-body{padding:var(--pad) calc(var(--pad) + .5mm);display:flex;flex-direction:column;gap:5mm}
.tpl-creative .cr-card{
  background:#f6f7fb;border-radius:1.6mm;padding:4.4mm 5mm;
  border-left:2.6pt solid var(--accent);break-inside:avoid;page-break-inside:avoid;
}
.tpl-creative .cr-card .r-h2{margin-bottom:2.8mm}
.tpl-creative .cr-entry + .cr-entry{margin-top:3mm;padding-top:3mm;border-top:.6pt solid #e3e6ef}
.tpl-creative .cr-head{display:flex;justify-content:space-between;gap:4mm;align-items:baseline}
.tpl-creative .cr-badges{display:flex;flex-wrap:wrap;gap:1.6mm;margin-top:.6mm}
.tpl-creative .cr-sub{
  font-size:.7em;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#8b92a3;
  margin:4mm 0 2mm;padding-top:3mm;border-top:.6pt solid #e2e5ee;
}
.tpl-creative .cr-badge{
  background:#fff;border:1px solid var(--accent-line);color:var(--accent-ink);
  border-radius:999px;padding:.9mm 2.6mm;font-size:.79em;font-weight:600;
}
.tpl-creative .cr-badge b{color:#3a4150;font-weight:700;margin-left:1mm}

/* ---------- 7. 하단 정적 콘텐츠 ---------- */
.site{background:#fff;border-top:1px solid var(--line);padding:44px 18px 30px}
.site__inner{max-width:820px;margin:0 auto}
.site h2{font-size:21px;letter-spacing:-.02em;margin-bottom:10px}
.site h3{font-size:16px;margin:30px 0 12px;letter-spacing:-.01em}
.site__lead{color:var(--ink-2);font-size:14px;line-height:1.7;margin-bottom:22px}
.steps{list-style:none;padding:0;display:grid;gap:10px}
.steps li{display:flex;gap:12px;align-items:flex-start;background:#f7f8fc;border:1px solid var(--line);border-radius:12px;padding:14px}
.steps b{
  flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:8px;
  background:var(--accent);color:#fff;font-size:12px;
}
.steps strong{display:block;font-size:13.5px;margin-bottom:2px}
.steps span{font-size:12.5px;color:var(--muted);line-height:1.55}
.site details{border-bottom:1px solid var(--line);padding:12px 2px}
.site summary{cursor:pointer;font-size:13.5px;font-weight:600}
.site details p{font-size:13px;color:var(--muted);line-height:1.65;margin-top:8px}
.site__note{font-size:11.5px;color:#9aa1b2;text-align:center}

/* ---------- 8. 오버레이/모달/토스트 ---------- */
.overlay{
  position:fixed;inset:0;z-index:80;background:rgba(16,20,30,.45);
  display:grid;place-items:center;backdrop-filter:blur(2px);
}
.overlay[hidden]{display:none}
.overlay__card{
  background:#fff;border-radius:16px;padding:26px 30px;text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.25);min-width:250px;
}
.overlay__card p{font-weight:700;margin-top:14px}
.overlay__card small{display:block;color:var(--muted);margin-top:5px;font-size:11.5px}
.spinner{
  width:30px;height:30px;margin:0 auto;border-radius:50%;
  border:3px solid #dfe5ff;border-top-color:var(--accent);animation:sp 0.8s linear infinite;
}
@keyframes sp{to{transform:rotate(360deg)}}

.modal{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:18px}
.modal[hidden]{display:none}
.modal__backdrop{position:absolute;inset:0;background:rgba(16,20,30,.45)}
.modal__card{
  position:relative;background:#fff;border-radius:16px;padding:22px 22px 18px;max-width:440px;width:100%;
  box-shadow:0 24px 70px rgba(0,0,0,.3);
}
.modal__card h2{font-size:17px;letter-spacing:-.01em}
.modal__body{font-size:13.5px;color:var(--ink-2);line-height:1.65;margin:10px 0 16px}
.modal__body ul{padding-left:18px;margin:8px 0}
.modal__body li{margin-bottom:5px}
.modal__body kbd{
  background:#f1f3fa;border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;
  padding:0 5px;font-size:12px;font-family:var(--font);
}
.modal__actions{display:flex;gap:8px;justify-content:flex-end}

.toast{
  position:fixed;left:50%;bottom:26px;transform:translateX(-50%);z-index:95;
  background:#1b2130;color:#fff;padding:11px 18px;border-radius:12px;font-size:13px;
  box-shadow:0 10px 30px rgba(0,0,0,.3);max-width:90vw;text-align:center;
}
.toast[hidden]{display:none}

/* ---------- 9. 반응형 ---------- */
.tabbar{display:none}
.only-mobile{display:none}
@media (max-width:1080px){
  .appbar__sub{display:none}
}
@media (max-width:900px){
  .appbar{height:52px;padding:0 10px;gap:8px}
  .appbar__title strong{font-size:13.5px}
  .appbar__actions{gap:2px}
  .btn{padding:0 9px;font-size:12.5px}
  .btn .ico{display:none}
  #btnSample,#btnReset,#btnDataMenu,#btnPrint{display:none}
  .only-mobile{display:block}
  .langswitch{margin-right:2px}
  .langswitch button{padding:5px 7px;font-size:12px}

  .tabbar{
    display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:6px 8px 7px;
    background:#fff;border-bottom:1px solid var(--line);position:sticky;top:52px;z-index:30;
  }
  .tabbar button{
    border:0;background:#f2f4fa;border-radius:9px;padding:8px;font-size:13px;font-weight:700;color:var(--muted);
  }
  .tabbar button.is-on{background:var(--accent);color:#fff}

  .app{display:block;height:calc(100vh - 52px - 55px)}
  .editor,.preview{height:100%;border-right:0}
  body.view-edit .preview{display:none}
  body.view-preview .editor{display:none}
  body.view-preview .preview{display:flex}
  .preview__scroll{padding:12px 8px 40px}
  .preview__bar{flex-wrap:wrap;row-gap:7px;padding:8px 10px;gap:6px}
  .preview__meta{margin-left:auto}
  .segmented button{padding:6px 9px;font-size:12px}
  .page-guide{left:-2px;right:-2px}
  .site{padding:32px 14px 24px}
}
@media (max-width:430px){
  .appbar__title{display:none}
  .btn--ghost{padding:0 8px}
  .grid2{grid-template-columns:1fr}
  .grid3{grid-template-columns:1fr 1fr}
}

/* ---------- 10. 인쇄 ---------- */
#printRoot{display:none}
@media print{
  @page{size:A4;margin:0}
  html,body{background:#fff !important;margin:0 !important;padding:0 !important}
  body > *{display:none !important}
  body > #printRoot{display:block !important}
  #printRoot .paper{
    box-shadow:none !important;margin:0 !important;
    width:210mm !important;min-height:0 !important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
  #printRoot .r-entry,#printRoot .tpl-creative .cr-card,#printRoot .mn-entry,#printRoot .md-entry{
    break-inside:avoid;page-break-inside:avoid;
  }
  #printRoot .r-h2{break-after:avoid;page-break-after:avoid}
}
