:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6470;
  --line: #e2e5ea;
  --line-strong: #c9ced6;
  --brand: #1a3153;
  --brand-accent: #f5862c;
  --accent: #1f4fd8;
  --accent-ink: #ffffff;
  --accent-soft: #eaf0fd;
  --danger: #d13438;
  --radius: 10px;
  --font: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- 헤더·푸터 ---------- */
.site-h { background: var(--brand); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.site-h-in { max-width: 1360px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; color: #fff; text-decoration: none; flex: none; letter-spacing: -0.02em; }
.logo-mark { display: block; width: 30px; height: 30px; }
.site-nav { display: flex; align-self: stretch; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { position: relative; display: flex; align-items: center; padding: 0 14px; color: rgba(255, 255, 255, .72); text-decoration: none; white-space: nowrap; font-size: 15px; font-weight: 500; }
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current='page'] { color: #fff; font-weight: 700; }
.site-nav a[aria-current='page']::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-accent); }
.h-app { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .9); font-size: 14px; font-weight: 500; text-decoration: none; }
.h-app svg { width: 16px; height: 16px; }
.h-app:hover { border-color: #fff; color: #fff; }
main { max-width: 1360px; margin: 0 auto; padding: 0 24px 48px; }
.site-f { border-top: 1px solid var(--line); background: var(--surface); padding: 24px; color: var(--muted); font-size: 13px; text-align: center; }
.site-f nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 8px; }
.site-f nav a { color: var(--muted); text-decoration: none; }
.site-f p { margin: 4px 0; }

/* ---------- 히어로 ---------- */
.hero { padding: 28px 0 18px; }
.hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.35; letter-spacing: -0.02em; }
.hero .lead { margin: 0; color: var(--muted); }

/* ---------- 버튼·폼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.row-btns { display: flex; align-items: center; gap: 8px; }
.row-btns.wrap { flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.card-h { margin: 0 0 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.card-h small { font-weight: 400; color: var(--muted); }
details.card > summary { cursor: pointer; margin: 0; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '▾'; margin-left: auto; color: var(--muted); }
details.card[open] > summary { margin-bottom: 12px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.fld > span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.fld input, .fld select, .fld textarea, .items input, .discount input {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); outline: none;
}
.fld textarea { resize: vertical; min-height: 72px; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .items input:focus, .discount input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check small { color: var(--muted); }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.disclaimer { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 10px; flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--accent); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.tip { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; flex: none; }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 260px; padding: 8px 10px; border-radius: 8px; background: #1d2128; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.5; text-align: left; white-space: normal; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 30; }
.tip:hover::after, .tip:focus::after { opacity: 1; }

/* ---------- 편집기 레이아웃 ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ed-preview { position: sticky; top: 76px; }
.pv-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pv-status { font-size: 13px; color: var(--muted); }
.saved-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.saved-count b { color: var(--brand); }
.preview { position: relative; overflow: hidden; }
.sheets { width: 794px; transform-origin: top left; display: flex; flex-direction: column; gap: 16px; }
.m-bar { display: none; }

/* 도장 */
.stamp-box { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.stamp-preview { width: 76px; height: 76px; flex: none; display: grid; place-items: center; border-radius: 8px; background: repeating-conic-gradient(#f0f1f4 0 25%, #fff 0 50%) 0 0 / 12px 12px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); overflow: hidden; }
.stamp-preview img { max-width: 70px; max-height: 70px; }
.stamp-side { flex: 1; min-width: 0; }
.stamp-ctrls { margin-top: 8px; display: grid; gap: 4px; }
.range { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.range span { width: 30px; flex: none; }
.range input { flex: 1; accent-color: var(--accent); }

/* 품목 */
.items-head, .item { display: grid; gap: 6px; align-items: center; }
.items-head { font-size: 12px; color: var(--muted); padding: 0 0 6px; }
.items-head .r { text-align: right; justify-content: flex-end; display: flex; align-items: center; gap: 4px; }
.items-head.has-spec, #items.has-spec .item { grid-template-columns: 20px minmax(0, 1.7fr) minmax(0, .8fr) 58px 88px 88px minmax(0, .8fr) 26px; }
.items-head.has-date.has-spec, #items.has-date.has-spec .item { grid-template-columns: 20px 54px minmax(0, 1.5fr) minmax(0, .7fr) 54px 84px 84px minmax(0, .7fr) 26px; }
.items-head.has-date:not(.has-spec), #items.has-date:not(.has-spec) .item { grid-template-columns: 20px 64px minmax(0, 1.8fr) 64px 96px 96px 26px; }
.item { padding: 4px 0; border-radius: 8px; background: var(--surface); }
.item input { min-height: 36px; padding: 6px 8px; font-size: 14px; }
.item input.num { text-align: right; }
.it-drag { width: 20px; height: 36px; border: 0; background: none; color: var(--line-strong); cursor: grab; touch-action: none; padding: 0; font-size: 14px; letter-spacing: -3px; }
.it-drag:hover { color: var(--muted); }
.item.dragging { box-shadow: 0 4px 16px rgba(0, 0, 0, .15); position: relative; z-index: 5; }
.item.dragging .it-drag { cursor: grabbing; }
.it-amt { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; padding-right: 2px; }
.it-amt.neg { color: var(--danger); }
.it-del { width: 26px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 6px; }
.it-del:hover { background: #fdecec; color: var(--danger); }
.items-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.discount { display: flex; align-items: center; gap: 6px; }
.discount input { width: 70px; text-align: right; min-height: 40px; }
.ed-totals { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.ed-totals div { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.ed-totals b { color: var(--text); font-variant-numeric: tabular-nums; }
.ed-totals .grand { font-size: 16px; color: var(--text); }
.ed-totals .grand b { color: var(--accent); }
.ed-totals .ko { margin: 4px 0 0; text-align: right; font-size: 13px; color: var(--muted); }

.recent-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent-row .tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); flex: none; }
.recent-row .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row .amt, .recent-row .when { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- 본문 가이드 ---------- */
.guide { max-width: 820px; margin: 40px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; }
.guide h1 { font-size: 24px; margin-top: 0; }
.guide h2 { font-size: 20px; margin: 32px 0 12px; letter-spacing: -0.01em; }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 16px; margin: 22px 0 8px; }
.guide p, .guide li, .guide dd { color: #3a3f47; }
.guide-more { margin-bottom: 8px; }
.guide-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 18px; font-weight: 700; padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.guide-more > summary::-webkit-details-marker { display: none; }
.guide-more > summary span { flex: none; font-size: 13px; font-weight: 500; color: var(--accent); }
.guide-more > summary span::after { content: ' ▾'; }
.guide-more[open] > summary span { font-size: 0; }
.guide-more[open] > summary span::before { content: '접기 ▴'; font-size: 13px; }
.guide-more[open] > summary span::after { content: ''; }
.guide-body { padding-top: 8px; }
.guide-body > h2:first-child { margin-top: 16px; }
.g-steps { padding-left: 20px; }
.g-steps li { margin: 6px 0; }
.g-dl dt { font-weight: 700; margin-top: 10px; }
.g-dl dd { margin: 2px 0 0; }
.g-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; display: block; overflow-x: auto; }
.g-table th, .g-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.g-table thead th { background: var(--bg); }
.g-table td { font-variant-numeric: tabular-nums; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq p { margin: 8px 0 0; }

.paper { max-width: 820px; margin: 24px auto 0; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.paper h2 { margin: 0 0 8px; font-size: 17px; }
.paper ul { margin: 0; padding-left: 18px; }
.paper li span { color: var(--muted); font-size: 13px; margin-left: 8px; }
.ad { max-width: 820px; margin: 24px auto 0; min-height: 100px; }


/* ---------- 앱 배너 ---------- */
.btn-brand { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.btn-brand:hover { color: #fff; filter: brightness(1.06); border-color: var(--brand-accent); }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; border-radius: 10px; }
.app-banner { max-width: 820px; margin: 28px auto 0; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 14px; background: linear-gradient(135deg, #1a3153 0%, #22406c 100%); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.app-banner-ico { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.app-banner-text { flex: 1; min-width: 0; }
.app-banner-kicker { display: block; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .6); margin-bottom: 2px; }
.app-points { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: rgba(255, 255, 255, .85); }
.app-points li::before { content: '✓ '; color: #8fb3f0; }
.app-note { margin: 8px 0 0; font-size: 12px; color: rgba(255, 255, 255, .55); }
.app-banner .btn { flex: none; }
.play-badge { flex: none; display: block; line-height: 0; border-radius: 8px; transition: transform .15s; }
.play-badge img { height: 50px; width: auto; }
.play-badge:hover { transform: translateY(-1px); }
.app-banner .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .5); cursor: default; }

/* ---------- 홈 ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; padding: 56px 0 40px; }
.eyebrow b { font-size: 1.08em; }
.eyebrow { display: inline-block; margin: 0 0 16px; padding: 5px 12px; border-radius: 999px; background: #fff1e5; color: #c25e0c; font-size: 13px; font-weight: 700; }
.home-hero h1 { margin: 0 0 16px; font-size: 44px; line-height: 1.25; letter-spacing: -0.035em; color: var(--brand); }
.home-hero h1 span { color: var(--text); }
.home-hero .lead { margin: 0; font-size: 17px; color: var(--muted); max-width: 520px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 24px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.trust li { display: flex; align-items: center; gap: 6px; }
.trust b { color: var(--brand); }
.trust svg { width: 18px; height: 18px; color: var(--brand-accent); }
.home-hero-doc { position: relative; padding: 24px 0 24px 24px; }
.home-hero-doc::before { content: ''; position: absolute; inset: 0 -24px 0 0; border-radius: 24px; background: linear-gradient(150deg, var(--brand) 0%, #2d4a7a 100%); }
.hero-doc-frame { position: relative; height: 470px; overflow: hidden; border-radius: 6px; box-shadow: 0 24px 48px rgba(10, 25, 50, .35); transform: rotate(-1.5deg); background: #fff; }
.hero-doc-frame::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, #fff); }
.hero-doc-frame .sheets { position: absolute; left: 0; top: 0; }
.hero-doc-frame .page { box-shadow: none; }

.stats-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 8px; border-radius: 16px; background: var(--brand); color: #fff; overflow: hidden; }
.stat { padding: 26px 24px; text-align: center; }
.stat + .stat { box-shadow: -1px 0 0 rgba(255, 255, 255, .12); }
.stat strong { display: block; font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat strong small { font-size: 20px; font-weight: 500; margin-left: 2px; color: rgba(255, 255, 255, .7); }
.stat > span { display: block; margin-top: 4px; font-size: 14px; color: rgba(255, 255, 255, .7); }
.stat:first-child strong { color: #ffb36b; }
.home-sec { margin-top: 56px; }
.sec-h { margin: 0 0 18px; font-size: 22px; letter-spacing: -0.02em; }
.doc-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.doc-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.doc-card:hover { border-color: var(--brand); box-shadow: 0 10px 28px rgba(26, 49, 83, .12); transform: translateY(-3px); }
.doc-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #eef2f8; color: var(--brand); margin-bottom: 8px; transition: background .15s, color .15s; }
.doc-card:hover .doc-ico { background: var(--brand); color: #fff; }
.doc-card strong { font-size: 19px; }
.doc-desc { font-size: 14px; color: var(--muted); }
.doc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; flex: 1; align-content: flex-start; }
.doc-tags i { font-style: normal; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: #4a5260; border: 1px solid var(--line); }
.doc-card em { font-style: normal; color: var(--brand); font-weight: 700; font-size: 14px; }
.doc-card em b { display: inline-block; transition: transform .15s; color: var(--brand-accent); }
.doc-card:hover em b { transform: translateX(4px); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 22px 22px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.steps b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-accent); color: #fff; font-size: 14px; margin-bottom: 12px; }
.steps strong { display: block; font-size: 17px; }
.steps p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.feat-grid li { display: flex; gap: 14px; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.f-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #fff1e5; color: #d86f17; flex: none; }
.feat-grid strong { font-size: 15px; }
.feat-grid p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* PDF 캡처용 (화면 밖) */
.capture-stage { position: fixed; left: -12000px; top: 0; width: 794px; }

/* ---------- 반응형 ---------- */
@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .ed-preview { position: static; }
  .home-hero { grid-template-columns: 1fr; gap: 32px; }
  .home-hero-doc { max-width: 560px; }
  .doc-cards { grid-template-columns: repeat(2, 1fr); }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  }
@media (max-width: 720px) {
  main { padding: 0 16px 96px; }
  .site-h-in { flex-wrap: wrap; height: auto; padding: 0 16px; gap: 0 12px; }
  .logo { height: 52px; flex: 1; }
  .site-nav { order: 3; flex: 1 1 100%; height: 42px; margin: 0 -16px; padding: 0 6px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .site-nav a { padding: 0 10px; font-size: 14px; }
  .site-nav a[aria-current='page']::after { left: 10px; right: 10px; }
  .hero h1 { font-size: 22px; }
      .card { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  .items-head { display: none; }
  #items .item { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .item .it-drag { order: 0; }
  .item .it-date { order: 1; flex: 0 0 76px; }
  .item .it-name { order: 2; flex: 1 1 0; }
  .item .it-del { order: 3; }
  .item .it-spec { order: 4; flex: 1 1 100%; margin-left: 26px; }
  .item .it-qty { order: 5; flex: 0 0 72px; margin-left: 26px; }
  .item .it-price { order: 6; flex: 1 1 0; }
  .item .it-amt { order: 7; flex: 1 1 0; align-self: center; }
  .item .it-note { order: 8; flex: 1 1 100%; margin-left: 26px; }
    .guide { padding: 20px 18px; margin-top: 28px; }
  .home-hero { padding: 28px 0 8px; }
  .home-hero h1 { font-size: 30px; }
  .home-hero .lead { font-size: 15px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-doc-frame { height: 330px; }
  .home-hero-doc { padding: 16px 0 16px 16px; }
  .home-hero-doc::before { right: -16px; }
  .home-sec { margin-top: 40px; }
  .stat { padding: 18px 16px; }
  .stat + .stat { box-shadow: 0 -1px 0 rgba(255, 255, 255, .12); }
  .stat strong { font-size: 32px; }
  .doc-cards, .steps, .feat-grid { grid-template-columns: 1fr; }
  .app-banner { flex-wrap: wrap; align-items: flex-start; gap: 14px; padding: 20px; }
  .app-banner-ico { width: 44px; height: 44px; border-radius: 11px; }
  .app-banner-text { flex: 1 1 200px; }
  .app-banner .btn { flex: 1 1 100%; }
  .play-badge { flex: 0 0 100%; padding-left: 58px; }
    .pv-bar { display: none; }
  .m-bar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .m-bar .btn { flex: 1; min-height: 46px; }
  .tip::after { left: auto; right: -8px; transform: none; max-width: 220px; }
}

/* ================= 문서(A4) ================= */
.page { position: relative; width: 794px; height: 1123px; padding: 52px 48px 44px; background: #fff; color: #111; font-family: var(--font); font-size: 12px; line-height: 1.45; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); flex: none; word-break: keep-all; overflow-wrap: anywhere; }
.page-inner { height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.page-no { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 10px; color: #777; }
.page table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.page th, .page td { border: 1px solid #2b2b2b; padding: 4px 6px; vertical-align: middle; }
.page th { background: #f1f3f6; font-weight: 500; text-align: center; white-space: nowrap; }
.d-title { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: 0.35em; padding-left: 0.35em; margin-bottom: 18px; }
.d-title small { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0; padding: 0; color: #444; margin-top: 2px; }
.d-cont { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 10px; }
.d-head { display: flex; gap: 16px; align-items: stretch; margin-bottom: 12px; }
.d-head-left { flex: 0 0 300px; display: flex; flex-direction: column; }
.d-head-right { flex: 1; min-width: 0; }
.d-to { font-size: 16px; margin-bottom: 4px; border-bottom: 1px solid #2b2b2b; padding-bottom: 4px; }
.d-to b { font-size: 18px; margin-right: 4px; }
.d-to-sub { font-size: 11px; color: #444; margin-bottom: 8px; }
.page .d-kv { margin: 6px 0; }
.page .d-kv th { width: 74px; }
.page .d-kv-row th { width: 90px; }
.d-intro { margin: auto 0 0; padding-top: 8px; font-size: 12px; }
.d-center { text-align: center; margin: 12px 0; font-size: 14px; }
.page .d-party th { padding: 4px 3px; }
.page .d-party td { height: 26px; }
.page .d-vert { width: 26px; line-height: 1.25; }
.d-strong { font-weight: 700; letter-spacing: 0.04em; }
.d-sign { position: relative; }
.d-in { position: relative; display: inline-block; margin-left: 8px; color: #888; font-size: 11px; }
.d-stamp { position: absolute; left: 50%; top: 50%; max-width: none; pointer-events: none; mix-blend-mode: multiply; }
.d-metaline { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.d-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.d-sum { display: flex; align-items: center; border: 2px solid #2b2b2b; margin-bottom: 12px; min-height: 42px; }
.d-sum-label { flex: none; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 4px 12px; background: #f1f3f6; border-right: 1px solid #2b2b2b; font-weight: 700; text-align: center; font-size: 13px; }
.d-sum-label small { font-weight: 400; font-size: 10px; }
.d-sum-val { flex: 1; padding: 6px 12px; font-size: 15px; font-weight: 500; }
.d-sum-val b { font-weight: 700; }
.d-sum-vat { flex: none; padding: 0 12px; font-size: 11px; color: #444; }
.d-items thead th { padding: 6px 4px; }
.d-items td { height: 26px; padding: 3px 6px; overflow: hidden; }
.d-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-neg { color: #c62828; }
.d-tail { margin-top: 10px; }
.page .d-totals th { width: 72px; }
.page .d-totals td { font-size: 13px; }
.d-note-small { margin: 6px 0 0; font-size: 10.5px; color: #555; }
.d-remark { border: 1px solid #2b2b2b; margin-top: 10px; }
.d-remark-h { background: #f1f3f6; border-bottom: 1px solid #2b2b2b; padding: 4px 8px; font-weight: 500; }
.d-remark-b { padding: 8px; min-height: 40px; }
.d-signline { margin-top: 18px; text-align: right; font-size: 13px; }
.d-signline span { display: inline-block; width: 140px; border-bottom: 1px solid #2b2b2b; margin: 0 6px; }
