/* 견적한장 앱(/app) — 휴대폰 우선. 하단 탭 · 카드 · 행 · 바텀시트 · 작성 화면. 토큰은 base.css. */
html, body { height: 100%; }
.app-body { overflow: hidden; overscroll-behavior: none; background: var(--bg); }
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto; background: var(--bg); position: relative; }
#view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-behavior: auto; }
.page { min-height: 100%; padding-bottom: 28px; animation: pageIn .22s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.noscript { padding: 24px; text-align: center; }
.boot-err { padding: 80px 24px; text-align: center; display: grid; gap: 16px; justify-items: center; }

@media (min-width: 700px) {
  .app-body { background: #E7EBF3; }
  #app { box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(15, 27, 51, .12); }
}

/* 상단 */
.sticky-head { position: sticky; top: 0; z-index: 10; background: #fff;
  border-bottom: 1px solid var(--line-2); padding-top: var(--safe-t); }
.topbar { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 0 8px 0 8px; }
.topbar-title { flex: 1; min-width: 0; padding-left: 8px; }
.topbar-title h1 { font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; line-height: 1.3; }
.topbar.home .topbar-title { padding-left: 12px; }
.topbar.home h1 { font-size: 21px; }
.topbar-right { display: flex; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:active { background: var(--line-2); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn[disabled] { opacity: .3; }
.search-row { position: relative; padding: 4px 16px 10px; }
.search-row svg { position: absolute; left: 30px; top: 18px; color: var(--ink-4); pointer-events: none; }
.search-input { padding-left: 42px; background: var(--bg); border-color: transparent; }
.search-input:focus { background: #fff; }

/* 하단 탭 */
#tabs { flex: none; display: flex; align-items: stretch; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); height: calc(62px + var(--safe-b)); position: relative; z-index: 15; }
.no-tabs #tabs { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-4); font-size: 11.5px; font-weight: 700; position: relative; }
.tab.on { color: var(--brand); }
.tab.on .tab-ic::after { content: ""; position: absolute; top: -9px; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.tab-ic { position: relative; display: grid; place-items: center; }
.tab.fab .tab-ic { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #4F6EFF, #2447DB); color: #fff; margin-top: -26px; box-shadow: 0 10px 22px rgba(49, 87, 245, .42); border: 4px solid #fff; transition: transform .1s; }
.tab.fab:active .tab-ic { transform: scale(.94); }
.tab.fab .tab-ic::after { display: none; }

/* 카드·행 */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin: 12px 16px; padding: 16px; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.card-title h3 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.card-title small { font-size: 12.5px; color: var(--ink-3); }
.list-card { padding: 0; overflow: hidden; }
.list-card.inner { margin: 12px -16px -16px; border-radius: 0 0 16px 16px; box-shadow: none; border-top: 1px solid var(--line-2); }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 66px; border-bottom: 1px solid var(--line-2); cursor: pointer; background: #fff; }
.row:last-child { border-bottom: 0; }
.row:active { background: #F8FAFD; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-title b { font-size: 16.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.row-note { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: #B76A00; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-note svg { flex: none; }
.row-sub { margin-top: 2px; font-size: 13.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { text-align: right; flex: none; }
.row-side b { display: block; font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.row-side small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.row-side .ok, small.ok, b.ok { color: var(--ok); }
.row-side .warn, small.warn, b.warn { color: #C27400; }
.doc-row.paid .row-title b { color: var(--ink-3); }
/* 문서 목록 — '선택' 모드(여러 장을 골라 한 번에 지운다) */
.top-act { padding: 10px 12px; font-size: 15.5px; border-radius: 10px; }
.top-act[disabled] { opacity: .4; }
.sel-check { display: none; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink-4); place-items: center; color: transparent; }
.docs-list.selecting .sel-check { display: grid; }
.docs-list.selecting { padding-bottom: 96px; }      /* 아래 삭제 막대에 마지막 줄이 가리지 않게 */
.doc-row.picked { background: #F6F8FF; }      /* '견적' 배지(--brand-50)와 같은 색이면 배지가 묻힌다 */
.doc-row.picked .sel-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.mark { display: inline-grid; place-items: center; flex: none; }
.mark.sent { color: var(--ink-4); }
.mark.view { color: var(--brand); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 16px 22px 0; font-size: 13px; color: var(--ink-3); }
.group-head b { color: var(--ink); font-size: 14.5px; font-weight: 800; }
.group-head + .card { margin-top: 8px; }
.list-empty { padding: 22px 16px; text-align: center; color: var(--ink-3); font-size: 14.5px; }
.chips { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip.ghost { background: transparent; border-color: transparent; color: var(--ink-3); padding: 0 6px; }
.chip.ghost.on { color: var(--brand); }
.grow { flex: 1; }
.link-btn { color: var(--brand); font-weight: 700; font-size: 14px; padding: 6px 0; }
.strip { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); margin: 12px 16px; padding: 14px 16px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); text-align: left; font-weight: 700; }
.strip span { flex: 1; }
.strip small { color: var(--ink-3); font-weight: 600; }
.strip.static { cursor: default; }
.strip.warn-strip { background: var(--bad-bg); color: var(--bad); box-shadow: none; flex-wrap: wrap; }
.strip.warn-strip small { color: var(--bad); width: 100%; padding-left: 28px; font-weight: 500; margin-top: -6px; }
.strip-wrap .strip { margin-bottom: 0; }

/* 현황 */
.daybar { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.date-pick { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; font-size: 17px; cursor: pointer; }
.date-pick.static { cursor: default; }
.date-pick b { font-weight: 800; letter-spacing: -.01em; }
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.date-pick .today-btn { position: relative; z-index: 2; border: 0; cursor: pointer; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 2px 12px 10px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 8px; border-radius: 14px; color: var(--ink-3); }
.wd small { font-size: 11.5px; font-weight: 700; }
.wd b { font-size: 16.5px; font-weight: 800; color: var(--ink); }
.wd.on { background: var(--ink); color: #fff; }
.wd.on b { color: #fff; }
.wd.today:not(.on) b { color: var(--brand); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.dot.ok { background: var(--ok); }
.dot.warn { background: #F5A623; }

.summary { position: relative; overflow: hidden; margin: 14px 16px 12px; padding: 20px 18px 16px; border-radius: 24px; color: #fff; background: linear-gradient(150deg, #1B2C5C 0%, #0F1B33 62%); box-shadow: 0 16px 32px rgba(15, 27, 51, .28); }
.summary::after { content: ""; position: absolute; right: -70px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(closest-side, rgba(79, 110, 255, .5), rgba(79, 110, 255, 0)); pointer-events: none; }
.summary > * { position: relative; z-index: 1; }
.summary-top { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .72); }
.pill-light { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 12.5px; font-weight: 700; }
.summary-amount { margin-top: 6px; font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -.035em; }
.summary-amount em { font-style: normal; font-size: 21px; margin-left: 2px; color: rgba(255, 255, 255, .78); font-weight: 700; }
.summary-bar { height: 8px; margin: 16px 0 14px; border-radius: 4px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.summary-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #34D399, #12A66A); transition: width .35s ease; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-stats.two { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.stat small { display: block; font-size: 12px; color: rgba(255, 255, 255, .62); font-weight: 600; }
.stat b { display: block; margin-top: 1px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.stat.warn b { color: #FFC857; }
.stat.ok b { color: #6EE7B7; }
.summary-recv { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding: 12px 0 0; border-top: 1px solid rgba(255, 255, 255, .14); color: #fff; text-align: left; font-size: 14px; }
.summary-recv span { color: rgba(255, 255, 255, .72); font-weight: 600; }
.summary-recv b { color: #FFC857; font-weight: 800; }
.summary-recv small { flex: 1; color: rgba(255, 255, 255, .6); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-top: 12px; }
.tile { padding: 12px 12px 11px; border-radius: 14px; background: var(--bg); min-width: 0; }
.tile-name { display: block; font-size: 13px; color: var(--ink-3); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile b { display: block; margin-top: 2px; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.tile b em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.tile small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.tile.zero b { color: var(--ink-4); }
.tile.low { background: var(--bad-bg); }
.tile.low small { color: var(--bad); }
.setup h3 { font-size: 18px; font-weight: 800; }
.setup > p { margin: 4px 0 8px; color: var(--ink-3); font-size: 14.5px; }
.step { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border-top: 1px solid var(--line-2); text-align: left; }
.step i { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 14px; }
.step.done i { background: var(--ok-bg); color: var(--ok); }
.step div { flex: 1; }
.step b { display: block; font-size: 15.5px; }
.step small { color: var(--ink-3); font-size: 13px; }
.step svg { color: var(--ink-4); }

.check { flex: none; width: 44px; height: 44px; margin: -8px -6px -8px -12px; display: grid; place-items: center; }
.check span { width: 27px; height: 27px; border-radius: 50%; border: 2px solid #CBD3E1; display: grid; place-items: center; color: #fff; transition: all .15s; }
.check span svg { opacity: 0; transform: scale(.6); transition: all .15s; }
.check.on span { background: var(--ok); border-color: var(--ok); }
.check.on span svg { opacity: 1; transform: none; }

/* 상태 */
.empty { text-align: center; padding: 30px 12px 22px; }
.empty-ic { width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.empty h3 { font-size: 17.5px; font-weight: 800; }
.empty p { margin-top: 6px; color: var(--ink-3); font-size: 14.5px; line-height: 1.55; }
.empty-act { margin-top: 18px; display: flex; justify-content: center; }
.skeleton-list { padding-top: 4px; }
.skeleton { height: 70px; margin: 12px 16px; border-radius: 16px; background: linear-gradient(90deg, #EAEEF5 25%, #F6F8FC 37%, #EAEEF5 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 바텀시트 */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 27, 51, .46); animation: fade .18s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: #fff; border-radius: 24px 24px 0 0; animation: sheetUp .24s cubic-bezier(.2, .85, .25, 1); padding-bottom: var(--safe-b); box-shadow: var(--shadow-lg); }
.sheet.tall { height: 90vh; height: 90dvh; }
.grab { width: 42px; height: 4px; border-radius: 2px; background: #D5DCE8; margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 2px 22px; flex: none; }
.sheet-head h2 { font-size: 18.5px; font-weight: 800; letter-spacing: -.02em; }
.sheet-body { padding: 10px 20px 18px; overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.sheet-foot { flex: none; display: flex; gap: 10px; padding: 12px 20px 14px; border-top: 1px solid var(--line-2); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.icon-only { flex: none; }
.sheet-msg { color: var(--ink-2); line-height: 1.65; padding: 6px 0 10px; font-size: 15.5px; word-break: keep-all; overflow-wrap: anywhere; }
.overlay.out { animation: fadeOut .2s ease-in forwards; }
.overlay.out .sheet { animation: sheetDown .2s ease-in forwards; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes sheetDown { to { transform: translateY(60px); opacity: 0; } }
.actions-list .action-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 2px; font-size: 16.5px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--line-2); }
.actions-list .action-item:last-child { border-bottom: 0; }
.actions-list .action-item svg { color: var(--ink-3); }
.actions-list .action-item.danger, .actions-list .action-item.danger svg { color: var(--bad); }

#toasts { position: fixed; left: 0; right: 0; top: calc(62px + var(--safe-t)); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: rgba(15, 27, 51, .95); color: #fff; font-size: 14.5px; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow-lg); animation: toastIn .22s ease-out; }
.toast.err { background: #C93A3F; }
.toast.ok { background: #0E8F5B; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }

/* 공용 입력 */
.btn-danger-solid { background: var(--bad); color: #fff; }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn.icon-only { width: 52px; padding: 0; flex: none; }
.btn.grow { flex: 1; }
.seg { display: flex; padding: 4px; border-radius: 14px; background: #E8ECF4; gap: 2px; }
.seg button { flex: 1; min-height: 40px; padding: 0 8px; border-radius: 10px; font-weight: 700; font-size: 14.5px; color: var(--ink-3); white-space: nowrap; transition: all .15s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15, 27, 51, .14); }
.seg-lg button { min-height: 46px; font-size: 16px; }
.switch { position: relative; flex: none; width: 52px; height: 32px; border-radius: 16px; background: #CFD7E5; transition: background .2s; }
.switch i { position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .28); transition: transform .2s; }
.switch.on { background: var(--brand); }
.switch.on i { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; margin: 4px 0 14px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.switch-row b { display: block; font-size: 15.5px; }
.switch-row small { display: block; color: var(--ink-3); font-size: 13px; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-weight: 800; }
.hint { font-size: 13px; line-height: 1.55; color: var(--ink-3); margin: 0 0 12px; }

/* 작성 */
.builder { padding-bottom: 8px; }
.b-kind { padding: 14px 16px 0; }
.b-head { padding: 0; margin-top: 12px; overflow: hidden; }
.b-date { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.b-date span { font-size: 13px; color: var(--ink-3); font-weight: 600; width: 40px; }
.b-date b { flex: 1; font-size: 16px; font-weight: 700; }
.b-date svg { color: var(--ink-4); }
.b-date input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.b-cust { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; min-height: 72px; }
.b-cust .ph { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--brand); font-weight: 700; font-size: 16.5px; }
.b-cust.empty { background: var(--brand-50); }
.b-cust-info { flex: 1; min-width: 0; }
.b-cust-info b { display: block; font-size: 17.5px; font-weight: 800; letter-spacing: -.01em; }
.b-cust-info small { display: block; color: var(--ink-3); font-size: 13.5px; }
.b-cust .link { color: var(--brand); font-weight: 700; font-size: 14px; }
.repeat { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 12px 16px 0; padding: 13px 14px; border-radius: 14px; background: var(--brand-50); color: var(--brand-700); text-align: left; }
.repeat div { flex: 1; min-width: 0; }
.repeat b { display: block; font-size: 15px; }
.repeat small { display: block; color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-items-card { padding: 16px 0 0; overflow: hidden; }
.b-items-card .card-title { padding: 0 16px 8px; }
.b-search { position: relative; padding: 0 16px 10px; }
.b-search svg { position: absolute; left: 30px; top: 15px; color: var(--ink-4); }
.b-search .input { padding-left: 40px; background: var(--bg); border-color: transparent; }
.b-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px 13px 16px; border-top: 1px solid var(--line-2); transition: background .15s; }
.b-item.on { background: #F5F7FF; }
.b-item.hide { display: none; }
.b-item-info { flex: 1; min-width: 0; }
.b-item-info b { display: block; font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-price { display: block; padding: 2px 0; font-size: 13.5px; color: var(--ink-3); text-align: left; font-variant-numeric: tabular-nums; }
.b-price em { font-style: normal; color: var(--brand); font-weight: 600; }
.b-stock { display: block; font-size: 12.5px; color: var(--ink-4); font-weight: 600; min-height: 0; }
.b-stock:empty { display: none; }
.b-stock.low { color: var(--bad); }
.b-item-ctl { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.stepper { display: flex; align-items: center; gap: 4px; }
.step-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #EBEFF6; color: var(--ink-2); transition: transform .08s, background .15s; }
.step-btn:active { transform: scale(.9); }
.step-btn.plus { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(49, 87, 245, .3); }
.step-btn:disabled { opacity: .35; pointer-events: none; }
.qty-input { width: 52px; height: 42px; padding: 0; text-align: center; border: 0; border-radius: 10px; background: transparent; font-size: 20px; font-weight: 800; outline: none; -webkit-appearance: none; appearance: none; }
.qty-input:focus { background: #fff; box-shadow: 0 0 0 2px var(--brand); }
.b-item:not(.on) .qty-input { color: var(--ink-4); }
.b-amount { min-height: 16px; font-size: 13px; font-weight: 800; color: var(--brand-600); }
.b-del { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink-4); }
.b-del + * { }
.b-add-custom { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 15px; border-top: 1px solid var(--line-2); color: var(--brand); font-weight: 700; font-size: 15px; }
.b-noitems { padding: 18px 16px; text-align: center; color: var(--ink-3); font-size: 14.5px; display: grid; gap: 12px; justify-items: center; }
.b-extra-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; text-align: left; font-weight: 800; font-size: 16px; }
.b-extra-head small { flex: 1; text-align: right; color: var(--ink-3); font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-extra-head svg { color: var(--ink-4); transition: transform .2s; }
.b-extra-body { display: none; margin-top: 16px; }
.b-extra.open .b-extra-body { display: block; }
.b-extra.open .b-extra-head svg { transform: rotate(180deg); }
.b-note { padding: 10px 12px; }
.b-note label { position: relative; display: block; }
.b-note svg { position: absolute; left: 14px; top: 15px; color: var(--ink-4); }
.b-note .input { padding-left: 42px; background: var(--bg); border-color: transparent; }
.b-note .input:focus { background: #fff; }
.note-card { display: flex; gap: 12px; align-items: flex-start; background: #FFF8EA; box-shadow: none; border: 1px solid #FFE6B3; }
.note-card svg { color: #B76A00; flex: none; margin-top: 2px; }
.note-card small { display: block; font-size: 12px; font-weight: 700; color: #B76A00; }
.note-card p { font-size: 15px; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.b-spacer { height: 150px; }
.b-bar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px calc(12px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(15, 27, 51, .06); }
.b-bar-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-direction: row-reverse; }
.b-bar-sum b { font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.b-bar-sum small { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-bar-btns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.doc-bar { flex-direction: row; align-items: center; gap: 10px; }
.doc-bar .btn { min-height: 52px; }

/* 문서 상세 */
.btn.del-doc { display: flex; width: calc(100% - 32px); margin: 20px 16px 0; }      /* 문서 화면·수정 화면 맨 아래의 '이 문서 삭제' */
.doc-page { padding-bottom: 110px; }
.doc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 16px 0; }
.doc-chips .badge { height: 26px; padding: 0 10px; font-size: 12.5px; }
.paper-card { position: relative; overflow: hidden; }
.paper-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #4F6EFF, #2447DB); }
.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pp-head b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.pp-head b small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.pp-head span { font-size: 13.5px; color: var(--ink-3); }
.pp-total { margin: 14px 0 6px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(160deg, #F3F6FF, #E8EDFF); }
.pp-total small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.pp-total b { font-size: 32px; line-height: 1.2; font-weight: 800; letter-spacing: -.035em; }
.pp-total em { font-style: normal; font-size: 19px; font-weight: 700; margin-left: 2px; }
.pp-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.pp-lines li:last-child { border-bottom: 0; }
.pp-lines b { font-weight: 600; font-size: 15.5px; }
.pp-lines small { display: block; color: var(--ink-4); font-size: 12.5px; }
.pp-lines .qt { color: var(--ink-3); font-size: 14.5px; white-space: nowrap; }
.pp-lines .am { min-width: 84px; text-align: right; font-weight: 800; }
.pp-sums { margin-top: 4px; padding-top: 10px; border-top: 1.5px solid var(--ink); }
.pp-sums div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14.5px; color: var(--ink-2); }
.pp-sums .minus dd { color: var(--bad); }
.pp-memo { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: 14.5px; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.link-top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.link-url { margin: 10px 0 12px; padding: 11px 12px; border-radius: 10px; background: var(--bg); font-size: 13.5px; color: var(--ink-2); word-break: break-all; }
.link-btns { display: flex; gap: 8px; }
.link-btns .btn { flex: 1; }
.sends li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.sends li:last-child { border-bottom: 0; }
.sends .ch { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.sends .ch.copy, .sends .ch.share { background: var(--line-2); color: var(--ink-3); }
.sends li div { flex: 1; min-width: 0; }
.sends li b { display: block; font-size: 14.5px; }
.sends li small { color: var(--ink-3); font-size: 12.5px; }
.sends time { font-size: 12.5px; color: var(--ink-3); flex: none; }
.send-label { font-size: 13px; color: var(--ink-3); font-weight: 700; }
/* 보내기 시트 — 템플릿 칩 + 말풍선처럼 보이는 문구(고쳐 쓸 수 있다) */
.tpl-chips { display: flex; gap: 8px; overflow-x: auto; margin: 2px -20px 12px; padding: 2px 20px; scrollbar-width: none; }
.tpl-chips::-webkit-scrollbar { display: none; }
.msg-edit { display: block; width: 100%; margin: 8px 0 0; padding: 14px 16px; border: 1.5px solid transparent; border-radius: 20px 20px 20px 6px; background: #EDF0F6; color: var(--ink);
  font: inherit; font-size: 15px; line-height: 1.65; resize: none; outline: none; word-break: keep-all; overflow-wrap: anywhere; }
.msg-edit:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(49, 87, 245, .14); }
.send-hint { margin-top: 10px; font-size: 13px; color: var(--ink-3); text-align: center; line-height: 1.5; }
.send-hint.left { text-align: left; color: #B76A00; margin: 8px 2px 0; }
.send-hint:empty { display: none; }
.sheet-foot .btn.wide { flex: 2; }
.sheet-body > .link-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
/* 문구 템플릿 */
.tpl-intro b { display: block; font-size: 16px; font-weight: 800; }
.tpl-intro p { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.tpl-card { padding: 14px 16px 12px; }
.tpl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tpl-head b { font-size: 16.5px; font-weight: 800; margin-right: 2px; }
.tpl-text { margin: 10px 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); font: inherit; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; color: var(--ink-2); max-height: 9.5em; overflow: hidden; }
.tpl-act { display: flex; justify-content: flex-end; gap: 8px; }
.add-tpl { margin: 12px 16px 0; width: calc(100% - 32px); }
.tpl-mini { margin-bottom: 14px; }
.tpl-mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.tpl-mini-row:last-child { border-bottom: 0; }
.tpl-mini-row b { font-size: 15px; }
.tpl-area { min-height: 150px; font-size: 15px; line-height: 1.6; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 8px; }
.chip.var { min-height: 32px; padding: 0 12px; font-size: 13.5px; background: var(--brand-50); border-color: transparent; color: var(--brand-600); }
.tpl-warn { margin: 0 2px 6px; font-size: 13px; color: #B76A00; line-height: 1.5; }
.tpl-warn:empty { display: none; }
.prev-label { margin-top: 10px; }
.msg-preview { margin: 8px 0 4px; padding: 14px 16px; border-radius: 20px 20px 20px 6px; background: #EDF0F6; font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; min-height: 3em; }
.preview-src { display: block; margin: 0 2px 8px; font-size: 12.5px; color: var(--ink-4); }
.send-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--ink-4); font-size: 13px; }
.send-or::before, .send-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 거래처 */
.cust-row .row-title .badge { flex: none; }
.cust-head { display: flex; align-items: center; gap: 14px; }
.cust-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.cust-head p { margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.info-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.info-row:last-child { border-bottom: 0; }
.info-row svg { color: var(--ink-4); margin-top: 2px; flex: none; }
.info-row small { width: 46px; flex: none; color: var(--ink-3); font-size: 13.5px; padding-top: 2px; }
.info-val { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; word-break: break-word; }
.info-val.pre { white-space: pre-line; display: block; }
.info-val a { color: var(--ink); font-weight: 700; }
.mini { padding: 5px 11px; border-radius: 8px; background: var(--bg); color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.info-card { padding-top: 6px; padding-bottom: 6px; }
.bal-card.due { border: 1.5px solid #FFE1AA; background: linear-gradient(#FFFBF3, #fff 70%); }
.bal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bal-top small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.bal-top b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.03em; }
.act-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 16px; }
.price-det { margin: 6px 0 14px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 14px; }
.price-det summary { display: flex; align-items: center; justify-content: space-between; min-height: 50px; font-weight: 700; cursor: pointer; list-style: none; }
.price-det summary::-webkit-details-marker { display: none; }
.price-det[open] summary svg { transform: rotate(180deg); }
.price-box { padding-bottom: 10px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.price-row span { min-width: 0; }
.price-row span b { display: block; font-size: 15px; }
.price-row small { color: var(--ink-3); font-size: 12.5px; }
.price-row .input { width: 124px; text-align: right; }
.pick-search { position: relative; margin-bottom: 6px; }
.pick-search svg { position: absolute; left: 14px; top: 15px; color: var(--ink-4); }
.pick-search .input { padding-left: 42px; }
.pick-row, .pick-new { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 2px; text-align: left; border-bottom: 1px solid var(--line-2); }
.pick-row div { flex: 1; min-width: 0; }
.pick-row b { display: block; font-size: 16px; }
.pick-row small { color: var(--ink-3); font-size: 13px; }
.pick-new { color: var(--brand); font-weight: 800; font-size: 15.5px; }

/* 품목 */
.stock-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: 12px; font-weight: 700; flex: none; }
.stock-chip.low { background: var(--bad-bg); color: var(--bad); }
.stock-box .row2 { margin-bottom: 16px; }
.stock-now { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; background: var(--bg); }
.stock-now small { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.stock-now b { font-size: 24px; font-weight: 800; }
.moves h4 { margin: 14px 0 4px; font-size: 13px; color: var(--ink-3); font-weight: 700; }
.moves li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.moves li small { flex: 1; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moves .neg { color: var(--bad); }
.moves .pos { color: var(--ok); }
.reorder { display: flex; gap: 2px; }
.hidden-box { margin: 8px 16px; }
.hidden-box .card { margin: 8px 0; }

/* 설정·정산 */
.set-card h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 12px; }
.set-card .btn-block + .btn-block, .set-card .btn-block + a.btn-block { margin-top: 10px; }
.set-card .field:last-of-type { margin-bottom: 16px; }
.acc-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.acc-row b { display: block; font-size: 16px; }
.acc-row small { color: var(--ink-3); }
.set-foot { text-align: center; color: var(--ink-4); font-size: 12.5px; padding: 18px 0 30px; }
.stats-page .summary { margin-top: 12px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 112px; margin-top: 14px; }
.bars i { flex: 1; min-height: 4px; border-radius: 3px 3px 0 0; background: var(--line); }
.bars i.on { background: var(--brand); }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--ink-4); }
.rank li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.rank li:last-child { border-bottom: 0; }
.rank li > i { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--ink-3); }
.rank li:nth-child(-n+3) > i { background: var(--brand-50); color: var(--brand); }
.rank li div { flex: 1; min-width: 0; }
.rank li b { font-size: 15px; }
.rank li div b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank li small { color: var(--ink-3); font-size: 12.5px; }
.stats-page > .btn { margin: 4px 16px 0; width: calc(100% - 32px); }

@media (max-width: 360px) {
  .summary-amount { font-size: 33px; }
  .b-item-info b { font-size: 15.5px; }
  .step-btn { width: 38px; height: 38px; }
  .qty-input { width: 44px; }
}
