:root {
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --bg: #f4f5f7;
  --card: #ffffff;
  --primary: #1f3a8a;
  --primary-ink: #ffffff;
  --accent: #eef2ff;
  --danger: #dc2626;
  --warn-bg: #fff7ed;
  --warn-ink: #9a3412;
  --ok: #15803d;
  --radius: 12px;
  --font: 'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--primary); }
h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
h3 { margin: 0 0 10px; font-size: 17px; font-weight: 800; }

.topbar { background: var(--ink); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; gap: 12px; }
.brand { font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.brand span { font-weight: 400; opacity: .7; margin-left: 4px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }

.wrap { max-width: 1600px; margin: 20px auto 40px; padding: 0 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(17,24,39,.06), 0 1px 12px rgba(17,24,39,.04); }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.wide-ish { max-width: 680px; }
.card.narrow-left { max-width: 560px; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.req { color: var(--danger); }

label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); }
label > input, label > select, label > textarea { display: block; margin-top: 5px; }
label .muted { font-weight: 400; }
label > input ~ .muted, label > textarea ~ .muted, label > .row ~ .muted { display: block; margin-top: 4px; }
input, select, textarea { font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c7d2fe; border-color: #818cf8; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
label.check { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 14px; color: var(--ink); }
label.check input { margin-top: 3px; }

.btn { font: inherit; font-size: 14px; font-weight: 700; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: #1e3a8a; filter: brightness(1.1); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 180px; }
.grid2 { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
#settingsForm.grid2 { grid-template-columns: 1fr 1fr; }

details.sub { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.sub summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 10px; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.tabs button { font: inherit; font-weight: 700; font-size: 15px; background: none; border: 0; padding: 10px 16px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--primary); }

.table-scroll { overflow-x: auto; margin-top: 10px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { background: #f9fafb; text-align: left; font-weight: 700; color: var(--ink-2); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.picked td { background: #f5f7ff; }
table.list td.row { display: table-cell; white-space: nowrap; }
table.list td.row > * { margin: 2px 4px 2px 0; }
table.list .num, .num { text-align: right; white-space: nowrap; }
table.kv { border-collapse: collapse; width: 100%; font-size: 14px; margin-bottom: 12px; }
table.kv th { text-align: left; width: 130px; color: var(--muted); font-weight: 700; padding: 7px 10px 7px 0; vertical-align: top; }
table.kv td { padding: 7px 0; border-bottom: 1px solid var(--line); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--primary); white-space: nowrap; }
.pill.s-신규 { background: #e0f2fe; color: #0369a1; }
.pill.s-처리중 { background: #fef3c7; color: #92400e; }
.pill.s-완료 { background: #dcfce7; color: var(--ok); }
.pill.s-취소, .pill.s-STOP, .pill.s-수정폐기 { background: #fee2e2; color: var(--danger); }
.pill.s-ACTIVE, .pill.s-확정, .pill.s-유효 { background: #dcfce7; color: var(--ok); }
.pill.s-PENDING { background: #fef3c7; color: #92400e; }
.pill.s-REJECTED { background: #f3f4f6; color: var(--muted); }
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 2px; }
.signup-cta { margin-top: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.linkbtn { font: inherit; font-weight: 800; color: var(--primary); background: none; border: 0; cursor: pointer; padding: 0 2px; text-decoration: underline; }
.grid2.even { grid-template-columns: 1fr 1fr; }
.row.nowrap { flex-wrap: nowrap; margin-top: 5px; }
.row.nowrap input { margin-top: 0; }
.pending-card { border: 2px solid #fde68a; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.field-label .muted { font-weight: 400; }
.addr { display: flex; flex-direction: column; gap: 6px; }
.addr .row.nowrap { margin-top: 0; }
.addr [data-role="zip"] { width: 120px; flex: none; background: #f9fafb; }
.addr input[readonly] { background: #f9fafb; cursor: default; }
.addr-box { max-width: 520px; }
.addr-embed { height: 480px; }
.hint-ok { color: var(--ok) !important; font-weight: 700 !important; }
.hint-bad { color: var(--danger) !important; font-weight: 700 !important; }
.pw-match { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; }
.pw-match.ok { color: var(--ok); }
.pw-match.bad { color: var(--danger); }
.pill.s-미발행 { background: #f3f4f6; color: var(--muted); }
.pill.edited { background: #fef9c3; color: #854d0e; }

/* ───────── 발주 화면(상품 카드 · 장바구니) ───────── */
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.shop-tools { display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chip span { color: var(--muted); font-weight: 400; margin-left: 2px; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.on span { color: #c7d2fe; }
.cat { margin-bottom: 18px; }
.cat-title { font-size: 16px; margin: 6px 2px 10px; padding-left: 10px; border-left: 4px solid var(--primary); }
.plist-head, .prow { display: grid; grid-template-columns: 150px 170px minmax(140px, 1fr) 64px 120px 150px 100px; gap: 14px; align-items: center; }
.plist-head { padding: 0 16px 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.plist-head .num { text-align: right; }
.plist-head .c { text-align: center; }
.pgroup { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.pgroup-name { font-size: 19px; font-weight: 800; padding: 10px 16px; background: #eef2f7; border-bottom: 1px solid var(--line-2); }
.pgroup-name span { font-size: 14px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: 2px; }
.prow { padding: 10px 16px; border-top: 1px solid var(--line); }
.pgroup-name + .prow { border-top: 0; }
.prow.incart { background: #eef2ff; }
.pimg { width: 150px; height: 150px; border-radius: 10px; border: 1px solid var(--line); background: #f8f9fb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pimg[data-zoom] { cursor: zoom-in; }
.pimg img { width: 100%; height: 100%; object-fit: contain; }
.noimg { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #b6bcc6; font-size: 12px; }
.noimg svg { width: 34px; height: 34px; }
.pbrand { font-size: 17px; font-weight: 800; }
.pspec2 { font-size: 18px; }
.punit { font-size: 16px; color: var(--ink-2); }
.pprice2 { text-align: right; font-size: 15px; white-space: nowrap; }
.pprice2 b { font-size: 21px; }
.pstep { display: flex; justify-content: center; }
.stepper.big button { width: 40px; font-size: 20px; }
.stepper.big input { width: 58px; font-size: 18px; padding: 9px 2px; }
.padd { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.padd .btn { font-size: 16px; padding: 11px 8px; }
.pincart { min-height: 18px; color: var(--primary); font-size: 13px; font-weight: 800; text-align: center; }
#hoverPreview { position: fixed; z-index: 90; width: 440px; height: 440px; padding: 12px; background: #fff; border-radius: 16px; box-shadow: 0 16px 50px rgba(17,24,39,.28); border: 1px solid var(--line-2); pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
#hoverPreview img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
#hoverPreview div { font-size: 16px; font-weight: 800; text-align: center; }
.img-box { max-width: 760px; }
.img-body { padding: 16px; display: flex; justify-content: center; background: #fff; border-radius: 0 0 14px 14px; }
.img-body img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.stepper { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: #fff; }
.stepper button { font: inherit; width: 30px; border: 0; background: #f3f4f6; cursor: pointer; font-size: 16px; color: var(--ink); }
.stepper button:hover { background: #e5e7eb; }
.stepper input { width: 46px; border: 0; border-radius: 0; text-align: center; padding: 6px 2px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper.sm button { width: 26px; font-size: 14px; }
.stepper.sm input { width: 40px; padding: 4px 2px; font-size: 14px; }

.cart { position: sticky; top: 12px; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(17,24,39,.06), 0 1px 12px rgba(17,24,39,.04); max-height: calc(100vh - 24px); overflow-y: auto; }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart-head h3 { margin: 0; }
.cart-close, .cart-fab { display: none; }
.cart-items .muted.sm { font-size: 14px; }
.cart-items { margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.cart-empty { padding: 18px 0; text-align: center; }
.citem { display: grid; grid-template-columns: 60px minmax(0, 1fr) 24px; gap: 10px; align-items: start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cimg { width: 60px; height: 60px; border-radius: 8px; background: #f8f9fb; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cimg img { width: 100%; height: 100%; object-fit: contain; }
.cimg .noimg span, .athumb .noimg span { display: none; }
.cimg .noimg svg, .athumb .noimg svg { width: 24px; height: 24px; }
.cname { font-weight: 800; font-size: 16px; line-height: 1.35; }
.crow { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 8px; }
.cremove { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.cremove:hover { color: var(--danger); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 2px solid var(--ink); font-weight: 700; }
.cart-total b { font-size: 23px; }
.cart-form { display: flex; flex-direction: column; gap: 10px; }

.athumb { width: 48px; height: 48px; border-radius: 8px; background: #f8f9fb; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.athumb img { width: 100%; height: 100%; object-fit: contain; }
table.list tr.off td { opacity: .5; }
ul.help { margin: 6px 0 12px; padding-left: 18px; }
.sync-list { max-height: 220px; overflow-y: auto; margin: 4px 0 12px; padding-left: 18px; font-size: 13px; }
.modal-body h4 { margin: 14px 0 4px; }
.edit-banner { background: #fef9c3; border: 1px solid #fde68a; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.order-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.order-card .head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.order-card .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.order-card .lines { margin-top: 8px; display: none; }
.order-card.open .lines { display: block; }

.diff { background: #fef9c3; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

.stamp-preview { width: 110px; height: 110px; border: 1px dashed var(--line-2); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fafafa; }
.stamp-preview img { max-width: 100%; max-height: 100%; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 40px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.foot a { color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: flex; align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 30px 12px; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 980px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; border-radius: 14px 14px 0 0; z-index: 1; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 16px 20px 22px; }

.busy { position: fixed; inset: 0; background: rgba(255,255,255,.6); display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; z-index: 100; font-weight: 700; color: var(--ink-2); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line-2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 110; font-size: 14px; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.2); white-space: pre-line; }
.toast.error { background: var(--danger); }

/* ───────── 거래명세서 ───────── */
.doc-overlay { position: fixed; inset: 0; background: #e5e7eb; z-index: 80; overflow: auto; }
.doc-toolbar { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line-2); padding: 12px 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.doc-guide { font-size: 13px; color: var(--ink-2); max-width: 760px; }
.doc-guide ol { margin: 4px 0 4px 18px; padding: 0; }
.doc-stage { padding: 24px 12px 60px; overflow-x: auto; }

.a4 { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto 18px; padding: 16mm 15mm 14mm; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; font-family: 'Nanum Gothic', sans-serif; color: #111; font-size: 10.5pt; overflow: hidden; }
.doc .wm { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%) rotate(-28deg); font-size: 88pt; font-weight: 800; color: rgba(17,24,39,.06); white-space: nowrap; pointer-events: none; user-select: none; z-index: 0; }
.doc .wm.red { color: rgba(220,38,38,.10); }
.doc > *:not(.wm) { position: relative; z-index: 1; }
.doc-mark { border: 2px solid #dc2626; color: #dc2626; font-weight: 800; text-align: center; padding: 6px; margin-bottom: 10px; font-size: 11.5pt; }
.doc-head { display: flex; justify-content: space-between; gap: 8mm; align-items: flex-start; }
.doc-left { flex: 1; padding-top: 2mm; }
.doc-title { font-size: 32pt; font-weight: 800; margin: 0 0 7mm; letter-spacing: 1px; line-height: 1.1; }
.doc-title small { display: block; font-size: 13pt; font-weight: 700; letter-spacing: 0; color: #9a3412; margin-top: 2mm; }
.doc-to { font-size: 15pt; font-weight: 800; margin-bottom: 7mm; }
.doc-to span { border-bottom: 2px solid #111; padding: 0 1mm 1mm; letter-spacing: 1px; }
.doc-date, .doc-lead { font-size: 12.5pt; font-weight: 800; line-height: 1.6; }
table.doc-supplier { width: 98mm; border-collapse: collapse; border-top: 1.6pt solid #111; border-bottom: 1.6pt solid #111; font-size: 10.5pt; }
table.doc-supplier th { width: 26mm; text-align: center; font-weight: 800; padding: 2.6mm 1mm; border-bottom: .6pt solid #111; border-right: .6pt solid #111; }
table.doc-supplier td { padding: 2.6mm 3mm; border-bottom: .6pt solid #111; position: relative; }
table.doc-supplier tr:last-child th, table.doc-supplier tr:last-child td { border-bottom: 0; }
.sup-wrap { position: relative; flex: none; }
.doc-stamp { position: absolute; z-index: 3; right: calc(7mm - var(--sw) / 2); top: calc(6mm - var(--sw) / 2); opacity: .92; mix-blend-mode: multiply; pointer-events: none; }
.seal-mark { float: right; margin-right: 3mm; color: #555; }
.doc-notice { margin-top: 7mm; border: 1pt solid #fdba74; background: #fff7ed; color: #9a3412; padding: 3mm 4mm; font-size: 9.5pt; font-weight: 700; line-height: 1.55; }
table.doc-summary { width: 100%; border-collapse: collapse; margin-top: 8mm; border-top: 1.6pt solid #111; border-bottom: 1.6pt solid #111; }
table.doc-summary col.s-th { width: 27mm; }
table.doc-summary th {  background: #e9e9ea; font-weight: 800; padding: 2.6mm; border-bottom: .6pt solid #9ca3af; border-right: .6pt solid #9ca3af; }
table.doc-summary td { padding: 2.6mm 3.5mm; border-bottom: .6pt solid #9ca3af; border-right: .6pt solid #9ca3af; }
table.doc-summary td:last-child { border-right: 0; }
table.doc-summary tr:last-child th, table.doc-summary tr:last-child td { border-bottom: 0; }
.doc-sec { font-size: 12.5pt; font-weight: 800; margin: 9mm 0 3mm; }
table.doc-items { width: 100%; border-collapse: collapse; border-top: 1.6pt solid #111; border-bottom: 1.6pt solid #111; font-size: 10pt; }
table.doc-items th { background: #e9e9ea; font-weight: 800; padding: 2.2mm 1.5mm; border-bottom: .8pt solid #111; border-right: .6pt solid #9ca3af; font-size: 11pt; }
table.doc-items td { padding: 2.2mm 1.8mm; border-bottom: .6pt solid #9ca3af; border-right: .6pt solid #9ca3af; text-align: center; height: 8.8mm; }
table.doc-items th:last-child, table.doc-items td:last-child { border-right: 0; }
table.doc-items td.n { text-align: right; padding-right: 2.5mm; }
table.doc-items tr.sum td { font-weight: 800; border-bottom: 0; border-top: .8pt solid #111; }
table.doc-items tr { break-inside: avoid; }
table.doc-items col.c-no { width: 9mm; } table.doc-items col.c-qty { width: 15mm; } table.doc-items col.c-price { width: 21mm; }
table.doc-items col.c-amt { width: 24mm; } table.doc-items col.c-note { width: 18mm; }
.doc-notes { margin: 6mm 0 0; padding-left: 5mm; font-weight: 800; font-size: 10.5pt; line-height: 1.75; }
.doc-rule { border-top: .8pt solid #111; margin-top: 5mm; }
.doc-foot { margin-top: auto; padding-top: 12mm; text-align: center; font-size: 15pt; font-weight: 800; color: #4b5563; letter-spacing: 2px; }

@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  body.printing #app, body.printing .modal, body.printing .busy, body.printing .toast, body.printing .doc-toolbar { display: none !important; }
  body.printing .doc-overlay { position: static; background: none; overflow: visible; }
  body.printing .doc-stage { padding: 0; overflow: visible; }
  body.printing .a4 { width: auto; min-height: 0; margin: 0; padding: 12mm 15mm 8mm; box-shadow: none; overflow: visible; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  body.printing .doc .wm { position: fixed; }
  body.printing .doc-foot { padding-top: 4mm; break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 900px) {
  .shop { grid-template-columns: 1fr; }
  .cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60; max-height: 88vh; border-radius: 16px 16px 0 0; transform: translateY(105%); transition: transform .22s ease; box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
  body.cart-open .cart { transform: none; }
  .cart-close { display: inline-block; }
  .cart-fab { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 55; font: inherit; font-size: 15px; font-weight: 700; color: #fff; background: var(--ink); border: 0; border-radius: 12px; padding: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; }
  body.cart-open .cart-fab { display: none; }
  .toast { bottom: 84px; }
  #viewClient [data-panel="order"] { padding-bottom: 70px; }
}

@media (max-width: 760px) {
  .plist-head { display: none; }
  .prow { grid-template-columns: 104px minmax(0, 1fr) auto; grid-template-areas: "img brand brand" "img spec unit" "img price price" "step step add"; gap: 4px 10px; padding: 10px 12px; }
  .prow .pimg { grid-area: img; width: 104px; height: 104px; }
  .prow .pbrand { grid-area: brand; font-size: 16px; }
  .prow .pspec2 { grid-area: spec; font-size: 16px; }
  .prow .punit { grid-area: unit; }
  .prow .pprice2 { grid-area: price; text-align: left; }
  .prow .pstep { grid-area: step; justify-content: flex-start; margin-top: 6px; }
  .prow .padd { grid-area: add; margin-top: 6px; }
  .prow .padd .btn { padding: 11px 18px; }
  .pgroup-name { font-size: 18px; padding: 9px 12px; }
  .grid2, .grid3, #settingsForm.grid2, .grid2.even { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .hide-sm { display: none; }
  .topbar { padding: 10px 12px; }
  .brand { font-size: 15px; }
  .brand span { display: none; }
  .wrap { margin-top: 12px; padding: 0 10px; }
  .card { padding: 14px; }
  .doc-stage { padding: 10px 0 40px; }
}

/* ───────── 약관 문서 ───────── */
.legal { max-width: 860px; margin: 24px auto 60px; background: #fff; border-radius: var(--radius); padding: 28px 32px; box-shadow: 0 1px 12px rgba(17,24,39,.05); line-height: 1.75; }
.legal h1 { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.legal h2 { font-size: 17px; margin: 26px 0 8px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.legal th, .legal td { border: 1px solid var(--line-2); padding: 7px 9px; text-align: left; vertical-align: top; }
.legal th { background: #f9fafb; }
.legal ol, .legal ul { padding-left: 22px; }
@media (max-width: 760px) { .legal { padding: 18px; margin: 10px; } }
