:root {
  --bg: #f2f4f7; --card: #fff; --line: #d9e0e7; --line2: #edf0f4; --text: #16202a; --muted: #62707e;
  --brand: #1a55c2; --brand-d: #154398; --brand-l: #e9f0fb;   /* 기본 색 = 업체 화면(ui2.css)과 같은 파랑 (2026-11-16 까지는 청록 #0b5d7a) */
  --sale: #1558b0; --sale-l: #e8f0fb; --purchase: #b4540a; --purchase-l: #fbf0e4;
  --in: #177245; --in-l: #e5f4ec; --out: #a13a3a; --out-l: #f9e9e9; --danger: #c0392b;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 2px 8px rgba(16, 32, 48, .05);
}
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.5;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.3; }
h3 { margin: 0 0 10px; font-size: 16px; }
h3 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; margin: 6px 0; }
.neg { color: var(--danger); }
.accent { color: var(--brand-d); }
.hide { display: none; }
.boot { padding: 60px 20px; text-align: center; color: var(--muted); }

/* ---------- 입력 · 버튼 ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=password], input[type=date], select, textarea {
  height: 38px; width: 100%; min-width: 0; padding: 0 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, tr:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
input.picker.picked { border-color: var(--brand); background: var(--brand-l); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--text);
}
.btn:hover { background: #f5f8fa; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.accent { background: var(--brand-l); border-color: #9fcbd9; color: var(--brand-d); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(16, 32, 48, .06); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.big { height: 46px; padding: 0 22px; font-size: 16px; }
.btn.left { margin-right: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { background: rgba(16, 32, 48, .08); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.end { justify-content: flex-end; margin-top: 12px; }
.chip { height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--brand-l); border-color: #9fcbd9; }
.inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; white-space: nowrap; }
.inline input[type=date] { width: 150px; }

.seg { display: inline-flex; background: #e3e8ed; border-radius: 9px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 7px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.seg.tabs button { height: 36px; padding: 0 16px; font-size: 15px; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #e9edf1; color: #465360; margin-right: 5px; }
.tag.sale { background: var(--sale-l); color: var(--sale); }
.tag.purchase { background: var(--purchase-l); color: var(--purchase); }
.tag.in { background: var(--in-l); color: var(--in); }
.tag.out { background: var(--out-l); color: var(--out); }
.tag.warn { background: #fff1d6; color: #9a5b00; }   /* 지난 거래 오류 추적의 "경고" */

/* ---------- 틀 ---------- */
.shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg, #0e2a3a); color: #cfdbe3; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; padding: 4px 8px 12px; font-weight: 700; font-size: 16px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 2px; object-fit: contain; flex: none; }
.nav a { display: block; padding: 9px 12px; border-radius: 8px; color: #d5e0e7; text-decoration: none; font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, .09); }
.nav a.on { background: #fff; color: var(--side-on, #0e2a3a); }
.nav-group { font-size: 12px; color: #86a0b0; padding: 14px 12px 4px; }
/* 메뉴 옆 숫자 (미완료 전표 수) */
.nav-badge { float: right; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e5484d; color: #fff; font-size: 12.5px; font-weight: 700; line-height: 22px; text-align: center; }
.nav-badge[hidden] { display: none; }
.nav-badge.soft { background: #f5a623; color: #2b1d00; }   /* 청구대기 건수: 급한 새 주문(빨강)과 가름 */
.side-note { margin-top: auto; padding: 10px 12px; background: rgba(255, 255, 255, .08); border-radius: 8px; font-size: 13px; font-weight: 600; color: #ffd98a; }
.side-note small { display: block; font-weight: 400; color: #b9c8d2; }
.scrim { display: none; }
.content { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 18px 24px 2px; }
.page-title { font-size: 22px; margin: 0; }
.page-title.sale { color: var(--sale); }
.page-title.purchase { color: var(--purchase); }
.menu-btn { display: none; font-size: 20px; color: var(--text); }
#main { padding: 10px 24px 70px; max-width: 1340px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.toolbar input[type=search] { flex: 1 1 220px; max-width: 340px; }
.range { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.range-inputs { display: inline-flex; gap: 4px; align-items: center; }
.range-inputs input[type=date] { width: 142px; }
.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); background: #f6f8fa; padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f1f7fa; }
.tbl tr.sel td { background: var(--brand-l); }
.tbl tr.carry td { color: var(--muted); background: #fafbfc; }
.tbl tfoot td { font-weight: 700; background: #f6f8fa; border-top: 1px solid var(--line); border-bottom: 0; }
.tbl td.empty { text-align: center; color: var(--muted); padding: 30px 12px; white-space: normal; }

/* 체크 칸과 일괄 작업 막대 (체크하면 표 위에 나타나 화면을 내려도 따라옴) */
.tbl th.pick, .tbl td.pick { width: 42px; padding: 0 4px 0 12px; cursor: pointer; }
.tbl .pick input { display: block; margin: 0; cursor: pointer; }
.tbl tr.picked td, .tbl tbody tr.picked:hover td { background: #cfe6f5; }
.tbl tr.click.picked:hover td { background: #dcecf2; }
.bulk-bar { position: sticky; top: 8px; z-index: 15; margin: 8px 0; min-height: 48px; }
.bulk-bar.idle { position: static; }
.bulk-bar[hidden], .bulk-bar [hidden] { display: none; }
.bulk-panel { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-height: 48px; padding: 8px 8px 8px 14px; background: #0e2a3a; color: #fff; border-radius: 10px; box-shadow: 0 6px 18px rgba(14, 42, 58, .28); }
.bulk-bar.idle .bulk-panel { background: transparent; color: var(--muted); box-shadow: none; padding-left: 2px; font-size: 13px; }
.bulk-bar.idle .bulk-count { display: none; }
.bulk-count { white-space: nowrap; margin-right: 4px; font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.bulk-bar .btn { height: 32px; padding: 0 12px; font-size: 14px; border-color: #fff; }
.bulk-bar .btn.ghost { background: transparent; border-color: transparent; color: #cfdbe3; }
.bulk-bar .btn.ghost:hover { background: rgba(255, 255, 255, .14); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.solid:hover { background: #a93226; }

/* 데이터 초기화 */
.reset-list { display: grid; gap: 8px; margin: 10px 0; }
.reset-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.reset-row.on { border-color: var(--danger); background: #fdf3f2; }
.reset-row > input { flex: none; margin-top: 3px; }
.reset-row > span { display: grid; gap: 3px; min-width: 0; }
.reset-row small { color: var(--muted); font-size: 13px; }
.reset-row small.warn-text { color: var(--purchase); }
.reset-sub { white-space: normal; margin-top: 4px; font-size: 13px; }
.reset-sample { border-color: #f0d58a; background: #fffaf0; }
.reset-sample p { margin: 4px 0 8px; }
/* 창 안의 글·칸을 일정한 간격으로 쌓음 */
.stack { display: grid; gap: 10px; }
.stack p { margin: 0; }
.stack ul { margin: 0; padding-left: 20px; }
.stack li { margin: 4px 0; }

/* ---------- 폼 · 창 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.span2 { grid-column: 1 / -1; }
.field.check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; min-height: 38px; align-self: end; }
.field.check > span { font-size: 14px; color: var(--text); }
details.more { margin-top: 14px; border-top: 1px solid var(--line2); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--brand-d); margin-bottom: 10px; }

.modal-back { position: fixed; inset: 0; background: rgba(15, 25, 35, .45); display: grid; place-items: center; z-index: 60; padding: 14px; }
.modal { background: #fff; border-radius: 14px; width: min(580px, 100%); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(1040px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line2); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-body h3 { margin-top: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.confirm-msg { white-space: pre-line; margin: 0; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1d2b36; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: 92vw; }
.toast.err { background: #b3261e; }
.toast.note { background: #7a4a00; white-space: pre-line; line-height: 1.5; cursor: pointer; pointer-events: auto; }
.bar { height: 10px; background: #e3e8ed; border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

.suggest { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .2); overflow: auto; max-width: calc(100vw - 8px); }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer; }
.opt.on { background: var(--brand-l); }
.opt-main b { font-weight: 600; display: block; }
.opt-main small { color: var(--muted); }
.opt-right { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt.create b { color: var(--brand); }

.steps { padding-left: 22px; margin: 0 0 12px; }
.steps li { margin: 8px 0; }
.warn { background: #fff7e0; border: 1px solid #f0d58a; border-radius: 8px; padding: 10px 12px; }
/* 불러오기: 기존 프로그램 잔액과 맞았다는 표시, 이름·단위 정리 내용 */
.ok-note { background: #e9f6ee; border: 1px solid #a9d8ba; border-radius: 8px; padding: 10px 12px; }
.tidy-note details { margin: 4px 0 12px; }
.tidy-note summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.tidy-note .table-wrap { max-height: 260px; overflow: auto; margin-top: 6px; }
/* 불러오기: 엑셀 등에서 읽은 표마다 종류와 칸의 뜻을 고르는 화면 */
.any-sum .stats { gap: 14px 26px; margin: 4px 0 6px; }
.any-sum .stat span { color: var(--muted); font-size: 13px; }
.any-sum .stat b { font-size: 18px; }
.any-card { padding: 12px 14px; margin: 10px 0; }
.any-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.any-head b { overflow-wrap: anywhere; }
.any-head select { margin-left: auto; width: auto; max-width: 100%; }
.any-card .toolbar select { width: auto; }
.any-map { margin-top: 8px; max-width: 100%; overflow-x: auto; }
.any-map th { padding: 6px 8px; }
.any-map select { min-width: 112px; height: 34px; }
.any-map select.on { border-color: #1c6dd0; font-weight: 600; color: #124b94; }
.any-map .any-titles th { background: #fff; color: var(--text); }
.any-map td { white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 13px; padding: 5px 8px; }
.any-card .toolbar input[type=text] { width: 160px; }
.tbl td.wrap { white-space: normal; min-width: 260px; }
.tbl td select { min-width: 150px; }

/* ---------- 전체 메뉴 · 추가 조회 ---------- */
.crumb { margin: 2px 0 0; font-size: 13px; }
.crumb a { text-decoration: none; }
.empty-note { text-align: center; color: var(--muted); padding: 34px 12px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.menu-group { margin-bottom: 18px; }
.menu-group h3 { margin: 0 0 8px; font-size: 15px; color: var(--brand-d); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.menu-item { display: block; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; }
.menu-item:hover { border-color: #9fcbd9; background: var(--brand-l); }
.menu-item.main { font-weight: 700; }
.menu-none ul { margin: 0; padding-left: 20px; }
.menu-none li { margin: 6px 0; font-size: 14px; }
.tool-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 12px; }
.tool-list .card { margin: 0; }
.tool-list .span-all { grid-column: 1 / -1; }
.card.narrow { max-width: 620px; }
.paste-area { font-family: Consolas, monospace; font-size: 13px; margin: 8px 0; white-space: pre; }
.close-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.close-grid h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.close-grid .field { margin-top: 8px; }
.pnl { max-width: 560px; }
.pnl .head td { font-weight: 700; }
.pnl .sub td { font-weight: 700; background: #f6f8fa; }
.pnl .total td { font-weight: 800; font-size: 16px; background: var(--brand-l); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 84px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; display: flex; flex-direction: column; gap: 1px; text-decoration: none; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; overflow: hidden; }
.cal-cell.off { background: transparent; border: 0; }
.cal-cell.today { border: 2px solid var(--brand); }
a.cal-cell:hover { background: var(--brand-l); }
.cal-day { font-weight: 700; font-size: 13px; }
.sun { color: var(--danger); }
.cal-cell .sale { color: var(--sale); font-weight: 600; }
.cal-cell .purchase { color: var(--purchase); }
.cal-cell .in { color: var(--in); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.month-nav select { width: auto; }
.price-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.price-grid .card { margin: 0; }
.price-area { font-family: Consolas, "Malgun Gothic", monospace; font-size: 14px; line-height: 1.45; min-height: 300px; white-space: pre; overflow: auto; }
.copy-area { width: 100%; margin-top: 10px; white-space: pre-wrap; font-family: "Malgun Gothic", sans-serif; font-size: 15px; line-height: 1.55; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sec-title { margin: 18px 0 4px; }
.price-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 0; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 0; z-index: 5; }
.price-sum .btn { margin-left: auto; }
/* 단가표 넣기 (2026-11-19): 옛 품목 잇기 알림 줄 · 처음 보는 줄의 "같은 품목이 있나요?" 고르기 */
.tie-bar { margin: 6px 0; padding: 8px 12px; border: 1px solid #c7d7f2; border-left: 4px solid #1f4e9c; background: #f4f7fd; border-radius: 6px; font-size: 13.5px; }
.tie-bar:empty { display: none; }
.tie-bar b { color: #1f4e9c; }
.tie-bar .btn { margin-left: 8px; }
select.near-pick { max-width: 280px; border-color: #d92d20; background: #fff1f0; font-weight: 600; }
.price-sum b { font-size: 17px; }
.warn-text { color: var(--purchase); }
.tbl tr.off td { opacity: .45; }
.skipped { font-size: 13px; display: grid; gap: 2px; }
.stamp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stamp-row img { height: 56px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* ---------- 로그인 ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth { width: min(400px, 100%); display: grid; gap: 12px; padding: 26px; margin: 0; }
.auth h1 { margin: 0; font-size: 21px; }
.auth input { height: 46px; font-size: 16px; }
.auth-msg { color: var(--danger); margin: 0; font-weight: 600; }
.auth-msg:empty { display: none; }

/* ---------- 홈 ---------- */
.big-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.big-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 18px; border-radius: 12px; border: 0; color: #fff; cursor: pointer; text-align: left; box-shadow: var(--shadow); }
.big-btn:hover { filter: brightness(1.08); }
.big-btn b { font-size: 18px; }
.big-btn small { opacity: .88; font-size: 13px; }
.big-btn.sale { background: var(--sale); }
.big-btn.purchase { background: var(--purchase); }
.big-btn.in { background: var(--in); }
.big-btn.out { background: #55626d; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
a.stat.card { margin: 0; padding: 12px 14px; }
a.stat.card:hover { border-color: #9fcbd9; }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-size: 19px; font-variant-numeric: tabular-nums; }
.stat.sale b, b.sale { color: var(--sale); }
.stat.purchase b, b.purchase { color: var(--purchase); }
.stat.in b { color: var(--in); }
.stat.strong { border-width: 2px; }

/* ---------- 매출관리: 요약 숫자 · 그래프 ---------- */
.k-sale { --c: #2a78d6; }
.k-purchase { --c: #eb6834; }
.stats-grid.kpi .stat.card { margin: 0; padding: 12px 14px; }
.stats-grid.kpi { grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); }
.stats-grid.kpi .stat b { font-size: 20px; font-variant-numeric: normal; white-space: nowrap; }
.stats-grid.kpi .stat small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stats-grid.kpi .stat small.up { color: #006300; }
.stats-grid.kpi .stat small.down { color: #b3261e; }
.chart-card h3 { margin: 0 0 4px; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.chart-card h3 small { font-weight: 400; font-size: 12px; color: var(--muted); }
.chart-empty { color: var(--muted); text-align: center; padding: 34px 0; margin: 0; }
.chart { --gutter: 52px; margin-top: 8px; }
.chart-plot { position: relative; height: 210px; margin-top: 24px; }
.chart-grid, .chart-cols { position: absolute; left: var(--gutter); right: 0; top: 0; bottom: 0; }
.chart-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line2); }
.chart-tick.base { border-top-color: #b9c3cd; }
.chart-tick span { position: absolute; right: 100%; top: -8px; margin-right: 8px; font-size: 11px; line-height: 16px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-cols { display: flex; align-items: stretch; }
.chart-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; outline: 0; border-radius: 4px 4px 0 0; }
.chart-col.click { cursor: pointer; }
.chart-col.on, .chart-col:focus-visible { background: rgba(16, 32, 48, .06); }
.chart-bar { display: block; width: 100%; max-width: 24px; background: var(--c); border-radius: 4px 4px 0 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.chart-col.on .chart-bar, .chart-col:focus-visible .chart-bar { filter: brightness(1.15); }
.chart-val { position: absolute; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; pointer-events: none; }
.chart-val.l { left: 0; transform: none; }
.chart-val.r { left: auto; right: 0; transform: none; }
.chart-x { display: flex; margin-left: var(--gutter); padding-top: 6px; height: 24px; }
.chart-xl { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; }
.chart-xl span { flex: none; white-space: nowrap; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-xl.skip span { visibility: hidden; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: #16202a; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 14px rgba(16, 32, 48, .25); min-width: 130px; }
.chart-tip[hidden] { display: none; }
.chart-tip-title { display: block; color: #c9d3dc; margin-bottom: 4px; }
.chart-tip div { display: flex; justify-content: space-between; gap: 14px; line-height: 1.5; }
.chart-tip div span { color: #c9d3dc; order: 1; }
.chart-tip div b { order: 2; font-weight: 500; font-variant-numeric: tabular-nums; }
.chart-tip div.main b { font-weight: 700; font-size: 14px; }
.hbars { display: grid; gap: 2px; margin-top: 6px; }
.hbar-row { display: grid; grid-template-columns: 22px minmax(90px, 210px) 1fr auto 50px; gap: 10px; align-items: center; width: 100%; padding: 6px; border: 0; border-radius: 6px; background: transparent; font: inherit; color: inherit; text-align: left; }
button.hbar-row { cursor: pointer; }
button.hbar-row:hover, button.hbar-row:focus-visible { background: #f1f7fa; }
.hbar-rank { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-name small { color: var(--muted); margin-left: 6px; }
.hbar-track { height: 12px; }
.hbar-track i { display: block; height: 100%; min-width: 2px; background: var(--c); border-radius: 0 4px 4px 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hbar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-pct { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.hbar-rest { color: var(--muted); font-size: 13px; margin: 8px 6px 0; }
.stats-grid.kpi .stat b { overflow: hidden; text-overflow: ellipsis; }
.hbars.compact .hbar-row { grid-template-columns: 18px minmax(0, 1fr) auto 42px; grid-template-areas: "rank name name name" ". track val pct"; row-gap: 3px; column-gap: 8px; }
.hbars.compact .hbar-rank { grid-area: rank; }
.hbars.compact .hbar-name { grid-area: name; }
.hbars.compact .hbar-val { grid-area: val; }
.hbars.compact .hbar-pct { grid-area: pct; }
.hbars.compact .hbar-track { grid-area: track; height: 8px; }
.more-link { font-size: 13px; color: var(--brand); text-decoration: none; white-space: nowrap; }
.more-link:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .stats-grid.kpi { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats-grid.kpi .stat.card { padding: 10px; }
  .stats-grid.kpi .stat b { font-size: 15px; }
  .chart { --gutter: 42px; }
  .chart-plot { height: 180px; }
  .hbar-row { grid-template-columns: 18px minmax(0, 1fr) auto 46px; grid-template-areas: "rank name val pct" ". track track track"; row-gap: 3px; }
  .hbar-rank { grid-area: rank; }
  .hbar-name { grid-area: name; }
  .hbar-val { grid-area: val; }
  .hbar-pct { grid-area: pct; }
  .hbar-track { grid-area: track; height: 8px; }
}

/* ---------- 시세 변동: 선 그래프 ---------- */
.linechart { margin-top: 8px; }
.linechart svg { display: block; overflow: visible; }
.lc-grid { stroke: var(--line2); stroke-width: 1; }
.lc-tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.lc-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-area { fill: var(--c); opacity: .1; }
.lc-dot { fill: var(--c); stroke: #fff; stroke-width: 2; }
.lc-end { font-size: 12px; font-weight: 600; fill: var(--text); }
.lc-cross { stroke: #9aa7b3; stroke-width: 1; }
.lc-hit { cursor: crosshair; }
.spark { display: block; margin-left: auto; }
.spark polyline { fill: none; stroke: #8a97a3; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--c); }
.trend-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 10px; }
.trend-head h2 { margin: 0; font-size: 19px; }
.trend-head small { color: var(--muted); font-size: 13px; }
.rise, .stats-grid.kpi .stat small.rise { color: #b3261e; }
.fall, .stats-grid.kpi .stat small.fall { color: #177245; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 시세표 이미지 ---------- */
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 14px; align-items: start; }
.sheet-grid .card { margin: 0; }
.sheet-preview { margin-top: 10px; }
.sheet-img { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.sheet-img.wide { max-width: 760px; }
.sheet-shot-head { max-width: 760px; margin: 14px auto 8px; }
.sheet-shot-head b { margin-right: auto; font-size: 16px; }
@media (min-width: 901px) { .sheet-grid.post-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.post-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); }
.post-plan > b { margin-right: 4px; }
.post-plan-end { margin-left: auto; display: inline-flex; gap: 6px; }
.trend-pick { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.trend-pick-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trend-pick-row span { color: var(--muted, #667); flex: 1; min-width: 0; }
.post-grid .chips { margin: 8px 0; }
.post-grid .post-area { min-height: 320px; margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-opt textarea { min-height: 76px; }
.sheet-opt .groups-area { min-height: 132px; font-size: 13px; line-height: 1.5; }
.sheet-opt .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
@media (max-width: 900px) {
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 설정: 전표기계 바로 가기 안내 ---------- */
.steps { margin: 8px 0; padding-left: 22px; }
.steps li { margin: 8px 0; line-height: 1.55; }
.cmd-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; margin-top: 8px; }
.cmd-box .muted { grid-column: 1 / -1; margin: 0; }
.cmd-box code { display: block; padding: 8px 10px; background: #f3f6f9; border: 1px solid var(--line); border-radius: 8px; font-family: Consolas, monospace; font-size: 12.5px; overflow-x: auto; white-space: nowrap; }

/* ---------- 로고 ---------- */
.auth-logo { display: block; width: 150px; height: auto; margin: 0 auto 6px; }
/* 로고가 따로 없는 업체: 기본 로고 아래에 상호 */
.auth-shop { margin: -4px 0 0; text-align: center; font-size: 20px; font-weight: 800; }
/* 마스터페이지 (샘플 전산 관리) */
.ms { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.ms-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.ms-head h1 { margin: 0; font-size: 26px; }
.ms-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ms-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.ms-tile span { display: block; font-size: 13px; color: var(--muted); }
.ms-tile b { font-size: 24px; }
.ms-list { padding: 0; overflow-x: auto; }
.ms-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); white-space: normal; }
.ms-sub.soon { color: #a12a1e; font-weight: 700; }
.ms-acts { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
.ms-until { display: grid; gap: 8px; }
.ms-until input[type=date] { width: 180px; }
.ms-logo { width: 72px; }
@media (max-width: 640px) { .ms-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 사용 기한(체험 기간)이 있는 업체 */
.trial-note { margin: 0; padding: 6px 10px; text-align: center; font-size: 13.5px; font-weight: 700; color: #8a5a00; background: #fff7e0; border: 1px solid #f0d58a; border-radius: 8px; }
.trial-note.soon { color: #a12a1e; background: #fff1f0; border-color: #f3b5ad; }
.sv-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sv-brand img { width: 42px; height: 42px; flex: none; }
.sv-brand b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onboard h2 { margin: 0 0 6px; font-size: 17px; }
.onboard ol { margin: 0; padding-left: 20px; }
.onboard li { margin: 6px 0; }

/* ---------- 전표 입력 ---------- */
/* 왼쪽 입력 칸은 적어도 760px(창이 좁으면 남는 만큼), 그 뒤로는 창이 넓어지는 대로 왼쪽 1.6 : 오른쪽(메모) 1 로 함께 넓어짐 */
.entry { display: grid; grid-template-columns: minmax(min(760px, 100% - 344px), 1.6fr) minmax(330px, 1fr); gap: 14px; align-items: start; }
.entry.sale .entry-main { border-top: 4px solid var(--sale); }
.entry.purchase .entry-main { border-top: 4px solid var(--purchase); }
.entry-side { padding: 14px; }
.entry-side-col { min-width: 0; }
/* 거래처 메모 (성향·특이사항): 적는 대로 자동 저장 */
.entry-memo { padding: 14px; }
.memo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.memo-head h3 { margin: 0 0 4px; }
.memo-status { color: var(--muted); font-size: 12.5px; min-height: 18px; white-space: nowrap; }
.memo-name { display: block; min-height: 22px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 화면이 좁아 아래로 내려갔을 때의 높이: 창 높이를 따라감 (넓은 화면에서는 아래 "창 크기에 맞춤" 규칙이 칸을 가득 채움) */
.memo-area { display: block; height: clamp(170px, 38vh, 460px); min-height: 124px; line-height: 1.55; background: #fffdf3; border-color: #e6d9a8; }
.memo-area:disabled { background: #f6f8fa; border-color: var(--line); }
.memo-area::placeholder { color: #98a3ad; }
.entry-memo .muted { margin: 8px 0 0; font-size: 12.5px; }
/* 화면이 좁아 메모 칸이 아래로 내려갔을 때만 보이는 한 줄 */
.memo-peek { display: none; width: 100%; margin: 0 0 8px; padding: 7px 10px; border: 1px solid #e6d9a8; border-radius: 8px; background: #fffdf3; text-align: left; font-size: 13.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-peek.empty { color: var(--muted); border-style: dashed; background: transparent; }
.memo-peek:disabled { cursor: default; }
.client-memo { white-space: pre-wrap; }
/* 지난 주문 안내 줄: 내용이 있든 없든 한 줄 높이를 차지하고 줄이 바뀌지 않아서, 불러오는 순간 아래 표가 밀리지 않음 */
.last-msg { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; height: 32px; min-width: 0; margin-bottom: 4px; font-size: 13.5px; }
.last-msg b { color: var(--brand-d); }
.last-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last-none { color: var(--muted); }
.last-note { flex: none; color: #8a5a00; background: #fff4d6; border-radius: 6px; padding: 1px 8px; white-space: nowrap; cursor: help; }
.last-msg .btn { flex: none; }
.last-auto { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--muted); font-size: 13px; cursor: pointer; }
.last-auto input { width: 16px; height: 16px; flex: none; }
.line input.was { background: #fff4d6; }
.entry-side .table-wrap { border: 0; }
.entry-side .tbl th, .entry-side .tbl td { padding: 8px 6px; }
/* 넓은 화면(두 칸): 오른쪽 칸을 창 크기에 맞춤. 창 너비·높이를 바꾸면 메모 칸이 함께 커지고 작아진다.
   다른 화면은 내용 폭을 1340px 에서 멈추지만, 입력 화면은 창 끝까지 쓴다.
   오른쪽 칸 높이 = 창 높이 − 위쪽 제목 줄(59px) − 아래 여백(24px) − 여유 3px. 제목 줄 높이를 바꾸면 이 숫자도 고칠 것 */
@media (min-width: 1181px) {
  #main:has(.entry) { max-width: none; padding-bottom: 24px; }
  .entry-side-col { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; height: calc(100vh - 86px); min-height: 430px; }
  .entry-side-col > .card { margin-bottom: 0; }
  .entry-memo { flex: 1 1 0; min-height: 230px; display: flex; flex-direction: column; }
  .memo-area { flex: 1 1 0; height: auto; min-height: 0; resize: none; font-size: 16px; }
  /* 최근 전표 창(메모 위): 내용만큼, 많아도 칸의 70%까지만 쓰고(나머지는 메모 칸) 넘치면 전표 목록만 그 안에서 굴림 */
  .entry-side { flex: 0 1 auto; max-height: 70%; min-height: 0; display: flex; flex-direction: column; }
  .recent-side > * { flex: none; }
  .recent-side > .recent-list { flex: 0 1 auto; }
  .recent-side .recent-pend .table-wrap { overflow: visible; }
  .entry-side > div { display: flex; flex-direction: column; min-height: 0; }
  .entry-side .table-wrap { overflow: auto; min-height: 0; }
  .entry-side .tbl thead th { position: sticky; top: 0; z-index: 1; }
}
.entry-head { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 8px; }
.entry-head .field { flex: 0 0 auto; }
.entry-head .field.grow { flex: 1 1 170px; }
.entry-head select { width: auto; min-width: 130px; }
.entry-head input[type=date] { width: 142px; }
.date-nav { display: flex; gap: 2px; align-items: center; }
.client-info { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); min-height: 20px; margin-bottom: 8px; align-items: center; }
/* 거래처 가산액 단추 "시세 +1,000원" (정하지 않았으면 흐리게 "가산액 정하기") · 같은 날 전표 알림 (2026-11-17) */
.same-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; padding: 7px 10px; border: 1px solid #f0c36d; background: #fff7e0; border-radius: 8px; font-size: 13px; color: #6b4a00; }
.same-note[hidden] { display: none; }
.same-note small { color: #8a6a1c; }
.mk-head p { margin: 0 0 6px; }
.tag .chip.small { margin-left: 6px; padding: 0 6px; font-size: 12px; }
.editing { background: #fff7e0; border: 1px solid #f0d58a; border-radius: 8px; padding: 6px 8px 6px 12px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }

.lines { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 6px 0 12px; background: #fff; }
/* 맨 앞 32px 는 줄 번호 칸 (아래 "줄 번호"). 칸 너비를 마우스로 바꾼 표도 번호 칸 뒤에 기억한 너비 (ui2.css cols-on) */
.line { display: grid; grid-template-columns: 32px minmax(150px, 2.4fr) 1fr .7fr .9fr 1fr 1.2fr 1.2fr 34px; border-bottom: 1px solid var(--line2); }
.lines.dated .line { grid-template-columns: 32px 140px minmax(140px, 2.2fr) 1fr .7fr .9fr 1fr 1.2fr 1.2fr 34px; }
/* 발주서를 완료할 때: 맨 앞에 거래처가 주문한 수량·남긴 말 */
.lines.ordered .line { grid-template-columns: 32px minmax(104px, 1.5fr) minmax(130px, 2fr) 1fr .7fr .9fr 1fr 1.2fr 1.1fr 34px; }
/* 수량 하나인 표 (매출·매입 입력, 발주서 완료, 청구대기): 품명 · 규격 · 수량(kg당 품목은 총 kg) · 마릿수(실제로 보낸 수. 비면 어림이 흐리게) · 단가(끝에 원/kg) · 금액 · 비고.
   금액 = 수량 × 단가 (2026-11-17 대표 "중량을 삭제하고 수량 하나로"). 품명을 적은 줄의 수량 칸이 노랗다 (screens-trade.js lineGrid) */
.lines.weight .line { grid-template-columns: 32px minmax(112px, 2.1fr) minmax(70px, 1fr) minmax(84px, 1fr) minmax(90px, .85fr) minmax(128px, 1.6fr) minmax(80px, 1.15fr) minmax(52px, .8fr) 34px; }
/* 발주서 완료: 맨 앞 "주문" 칸에는 주문한 수량(바뀌지 않음) */
.lines.ordered.weight .line { grid-template-columns: 32px minmax(84px, 1.1fr) minmax(108px, 1.75fr) minmax(76px, 1fr) minmax(84px, .95fr) minmax(76px, .7fr) minmax(138px, 1.5fr) minmax(80px, 1.15fr) minmax(56px, .7fr) 34px; }
/* 줄 번호 (2026-11-18 대표 "매출/매입 입력할 때 품목의 갯수가 표시되어야 함. 1,2,3,4,5 번호 매김"): 품명을 적은 줄만 위에서부터 1, 2, 3 …
   (빈 줄은 번호 없음 · 세지 않음 → 마지막 번호 = 품목 줄 수). 클래식 화면은 classic.css 의 비즈테크식 번호가 이것을 덮는다 */
.lines .line::before { content: ''; display: grid; place-items: center; background: #f6f8fa; border-right: 1px solid var(--line2); color: #2b3a4e; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lines > .line.head::before { content: '번호'; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.lines-body { counter-reset: ln; }
.lines-body > .line:has(> .l-name:not(:placeholder-shown)) { counter-increment: ln; }
.lines-body > .line:has(> .l-name:not(:placeholder-shown))::before { content: counter(ln); }
/* 마릿수 칸: 실제로 보낸 마릿수를 적는다 (금액과 상관없음). 비어 있으면 규격으로 어림한 "약 20~25"가 흐린 글씨(placeholder)로 보일 뿐 저장되지 않는다.
   마리당 · 낱개 줄은 수량이 곧 개수라 잠근다 (2026-11-17 대표 "약 10마리지만 9 · 11마리일 수 있다. 수정할 수 있게") */
.lines.weight .ub-cnt > input::placeholder { color: #98a3b3; font-weight: 500; font-size: 12.5px; }
.lines.weight .ub-cnt > input.lock { background: #f6f8fa; cursor: default; }
/* 마릿수 칸은 "약 10" · "약 20~25" 가 잘리지 않게 칸을 넓히고 안쪽 여백을 줄인다 (2026-11-17 대표: 좁아서 "약 10"이 "약 1"로 보여 9마리까지만 되는 줄 알았음) */
.lines.weight .ubox.ub-cnt > input { padding-left: 3px; padding-right: 16px; }
.lines.weight .ub-cnt > .usfx { right: 4px; }
/* 수량 칸 안 오른쪽의 단위 글자("13.5 kg", "20 미")와, 단가 칸 끝의 기준 고르기("원/kg"). 칸 사이의 선은 감싼 쪽이 긋는다 */
.lines.weight .ubox, .lines.weight .pbox { position: relative; display: flex; min-width: 0; border-right: 1px solid var(--line2); }
.lines.weight .ubox > input, .lines.weight .pbox > input { flex: 1 1 auto; min-width: 0; width: 100%; border-right: 0; }
.lines.weight .ubox > input { padding-right: 26px; }
.lines.weight .usfx { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.lines.weight input:placeholder-shown + .usfx { opacity: .5; }
.lines.weight .pbox > select { flex: none; width: 58px; height: 38px; border: 0; border-left: 1px dashed var(--line2); border-radius: 0; background: #f3f5f8; color: #2b3a4e; font-size: 12px; font-weight: 600; padding: 0 0 0 5px; cursor: pointer; }
.lines.weight .pbox > select:focus { outline: 2px solid var(--brand); outline-offset: -2px; }
/* 노란 칸 = 단가에 곱하는 칸(수량 칸). 수량(총 kg)을 아직 안 적은 kg당 줄은 노란 칸에 빨간 테두리 */
.line input.mul { background: #fff0a0; font-weight: 700; color: #3d2f00; }
.line input.mul:focus { background: #ffe97a; }
.line input.mul.need { background: #fff0a0; box-shadow: inset 0 0 0 2px #e5534b; }
/* kg당 줄인데 수량이 아직 비어 있음: 재서 넣어야 금액이 나온다 */
.line input.need { background: #fff1f0; }
.line input.need::placeholder { color: #c0392b; }
/* 품명 · 규격 칸: 장부의 품목과 이어진 줄은 초록 + 품명 칸 끝에 ✓ = 성공적으로 이어짐 (2026-11-16 대표). 이어지지 않은 줄은 흰색 그대로.
   칸에 들어가 있어도(포커스) 초록을 유지해 지금 상태가 늘 보인다 (screens-trade.js lineGrid 의 link) */
.line input.paired, .line input.paired:focus { background-color: #dcf3e4; color: #0f3d22; }
/* 품목에 없는 줄 (저장 · 발행이 막힌 줄) */
.line input.l-name.noitem, .line input.l-name.noitem:focus { background-color: #ffe3e0; color: #8f1d17; box-shadow: inset 0 0 0 2px #d92d20; }
.line input.l-name.paired { padding-right: 28px; font-weight: 600; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%2316a34a'/%3E%3Cpath d='M4.6 8.2l2.2 2.2 4.6-4.7' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; background-size: 16px 16px; }
/* 줄 아래의 알림: 등급 안내(한 마리 평균이 다른 등급일 때)와, 발주서 완료 화면의 주문과 달라진 내용 */
.l-diff .l-hint:not(:empty) { display: block; color: #9a3412; }
.l-diff .l-hint:not(:empty) + .l-note:not(:empty) { display: block; margin-top: 3px; }
.l-diff .chip { margin-left: 6px; }
/* 총 무게로 주문받은 마리당 품목: "주문 2kg → 규격으로 어림해 7미를 넣었습니다" (수량을 고쳐 적으면 사라짐) */
.l-diff .l-est:not(:empty) { display: block; color: var(--brand-d); }
.l-diff .l-est:not(:empty) + .l-hint:not(:empty) { margin-top: 3px; }
/* 주문 칸: 수량과 남긴 말이 길면 두 줄까지 보여 줌 (전체는 마우스를 올리면 보임) */
.l-ord { display: flex; align-items: center; height: 38px; padding: 0 8px; font-size: 12.5px; line-height: 1.25; font-weight: 700; color: #8a5a00; background: #fffaf0; border-right: 1px solid var(--line2); overflow: hidden; word-break: keep-all; }
/* 발주서 완료 화면: 주문과 달라진 줄 아래의 한 줄 설명("주문 6.8kg × 1 → 지금 6.9kg × 1 · 주문대로면 얼마 → 얼마"), 표 아래의 금액 차이 */
.l-diff { grid-column: 1 / -1; padding: 4px 10px 6px; font-size: 13px; font-weight: 600; color: #8a5a00; background: #fffaf0; border-top: 1px dashed #f0d58a; }
.l-diff[hidden], .order-diff[hidden] { display: none; }
/* 발주서 완료: 거래처가 그 줄에 적은 비고 ("피 빼서" · "필렛 작업"). 예전에는 맨 앞 주문 칸에 수량과 함께 적어 좁은 창에서 잘렸다
   (2026-11-23 대표: "작업자가 비고를 못 찾는다") → 줄 아래 한 줄 가득, 길면 줄을 바꿔 끝까지 보인다 */
.l-ask { grid-column: 1 / -1; padding: 5px 10px 6px 40px; font-size: 13.5px; font-weight: 700; line-height: 1.45; color: #3d2f00; background: #fff4cc; border-top: 1px dashed #e8c766; white-space: pre-wrap; overflow-wrap: anywhere; }
.l-ask > b { display: inline-block; margin-right: 8px; padding: 0 6px; font-size: 12px; line-height: 19px; color: #fff; background: #b45309; border-radius: 4px; vertical-align: 1px; }
.order-diff { display: grid; gap: 4px; margin: 0 0 12px; padding: 8px 12px; background: #fffaf0; border: 1px solid #f0d58a; border-radius: 8px; font-size: 14px; }
.order-diff small { color: var(--muted); }
.gap { color: #b45309; }
tr.ck-changed td { background: #fffaf0; }
tr.ck-dropped td { color: var(--muted); }
.editing.order { align-items: flex-start; font-weight: 400; }
.editing.order b { font-weight: 700; }
/* 청구대기로 둔 발주서를 청구하는 중: 미완료(노랑)보다 진한 주황 테두리 */
.editing.order.wait { background: #fff1e0; border-color: #f5a623; box-shadow: inset 4px 0 0 #f5a623; }
.btn.wait-btn { border-color: #f5a623; color: #8a4b00; }
.order-how { font-size: 13px; color: var(--muted); margin-top: 2px; }
.order-req { margin-top: 4px; font-weight: 700; color: #8a5a00; }
.tbl tr.pend td { background: #fffaf0; }
.tbl td.wrap-s { white-space: normal; max-width: 280px; }
input.picker[readonly] { cursor: default; }
.share-row { display: grid; gap: 4px; margin-bottom: 18px; }
.share-row small { color: var(--muted); }
.share-row .share-url { margin: 2px 0 6px; }
/* 홈: 미완료 전표가 있을 때 알려 주는 줄 */
.order-alert { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; text-decoration: none; color: inherit; background: #fff8e6; border-color: #f0d58a; }
.order-alert b { color: #8a5a00; font-size: 17px; }
.order-alert span { color: var(--muted); }
.lines-body .line:last-child { border-bottom: 0; }
.line.head { background: #f6f8fa; font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.line.head span { padding: 7px 8px; white-space: nowrap; overflow: hidden; }
.line input { border: 0; border-right: 1px solid var(--line2); border-radius: 0; height: 38px; background: transparent; }
.line input:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: #fff; }
.line .del { height: 38px; width: 34px; border-radius: 0; color: #a3aeb8; }

.entry-foot { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.pay-box { background: #f6f8fa; border-radius: 10px; padding: 12px; }
.pay-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.pay-title small { color: var(--muted); margin-right: auto; }
.pay-fields { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.sum-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; }
.sum-box div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.sum-box span { color: var(--muted); }
.sum-box .total { font-size: 19px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 6px; }
.sum-box .count b { font-size: 16px; }   /* 품목 수 (품목 표 맨 앞 번호의 마지막 값) */
.sum-box .total span { color: var(--text); font-weight: 600; }
.sum-box .after b { color: var(--brand-d); font-size: 17px; }
/* 할인을 넣으면: 합계(작게) → 할인(빨강) → 할인 후 합계(크게, 점선 아래) */
.sum-box .total.gross { font-size: 16px; border-bottom: 0; padding-bottom: 2px; margin-bottom: 0; }
.sum-box .dc b { color: #b42318; }
.sum-box .total.net b { color: var(--brand-d); }

/* 매출 · 매입 입력 오른쪽 "최근 전표" 창 (screens-trade.js drawSide): 고른 거래처의 최근 전표 · 미완료 전표, 줄을 누르면 품목이 펼쳐짐 */
.recent-side > h3 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.recent-side .recent-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-d); font-size: 13px; font-weight: 700; }
.recent-hint { margin: 2px 0 8px; font-size: 13px; }
.recent-pend { margin-bottom: 10px; }
.recent-pend h4 { margin: 0 0 4px; font-size: 13px; color: #8a5a00; }
.recent-pend h4 small { font-weight: 400; color: var(--muted); }
.recent-side .tbl td, .recent-side .tbl th { padding: 5px 6px; font-size: 13px; line-height: 1.35; }
.recent-side .rc-when { white-space: nowrap; }
.recent-side .rc-when .tag { margin: 0 0 0 4px; padding: 0 5px; font-size: 11px; }
.recent-side .rc-what .tag { padding: 0 5px; font-size: 11px; }
.recent-side .rc-dc { display: block; font-size: 11.5px; color: #b42318; white-space: nowrap; }
.recent-side tr.recent-row.open td { background: #edf3fb; font-weight: 600; }
.recent-side tr.recent-detail td { padding: 4px 6px 10px 12px; background: #f8fafc; }
.recent-lines { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.recent-lines td { padding: 3px 4px; border-bottom: 1px dotted #dfe5ec; }
.recent-lines td.r { white-space: nowrap; }
.recent-lines .rl-spec { color: #1f5fbf; }
.recent-lines .rl-memo { color: var(--muted); }
.recent-act { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.recent-more { width: 100%; margin-top: 6px; }
.sum-inline { display: flex; gap: 16px; justify-content: flex-end; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.pay-info { background: var(--brand-l); border-radius: 8px; padding: 8px 12px; }
.pay-info:empty { display: none; }

/* ---------- 거래처 내역 · 링크 ---------- */
.client-head { display: grid; gap: 12px; }
.client-name h2 { display: inline; margin: 0 8px 0 0; font-size: 20px; vertical-align: middle; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.share-box p { margin: 0 0 12px; }
.share-url { font-family: Consolas, monospace; font-size: 13px; margin-bottom: 10px; }
.share-danger { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line2); display: grid; gap: 8px; }
.share-danger small { color: var(--muted); }

/* ---------- 거래처가 보는 화면 (큰 글씨) ---------- */
/* touch-action: 단추를 빠르게 두 번 눌러도 화면이 확대되지 않게 (두 손가락으로 벌리는 확대는 그대로 됨) */
.sv { max-width: 640px; margin: 0 auto; padding: 16px 14px 60px; font-size: 18px; touch-action: manipulation; }
body:has(.sv) .modal-back { touch-action: manipulation; }
.sv-shop { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sv-shop b { font-size: 20px; }
.sv-shop .btn { height: 44px; font-size: 16px; }
.sv h1 { font-size: 24px; margin: 14px 0; }
.sv-balance { background: var(--brand); color: #fff; border-radius: 16px; padding: 18px 20px; margin-bottom: 10px; }
.sv-balance.pay { background: #3d5563; }
.sv-balance span { opacity: .92; }
.sv-balance > b { display: block; font-size: 36px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.sv-bank b { display: block; font-size: 17px; }
.sv-balance small { opacity: .85; font-size: 15px; }
.sv-bank { margin-top: 12px; background: rgba(255, 255, 255, .15); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; }
.sv-bank button { height: 38px; padding: 0 12px; border-radius: 8px; border: 0; background: #fff; color: var(--brand-d); font-weight: 700; cursor: pointer; flex: none; }
.sv-month { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; gap: 8px; }
.sv-month b { font-size: 21px; white-space: nowrap; }
.sv-month button { height: 48px; padding: 0 14px; font-size: 17px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; white-space: nowrap; }
.sv-month button:disabled { opacity: .35; cursor: default; }
/* 거래내역을 엑셀로 받기 (보고 있는 달 / 전체) */
.sv-files { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.sv-files .btn { height: 42px; padding: 0 16px; font-size: 16px; font-weight: 700; border-radius: 12px; text-decoration: none; display: inline-flex; align-items: center; }
.sv-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.sv-sum div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.sv-sum span { display: block; font-size: 15px; color: var(--muted); }
.sv-sum b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sv-day { font-weight: 700; margin: 18px 0 6px; font-size: 17px; color: #33424f; }
.sv-doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin-bottom: 8px; }
.sv-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.sv-line small { display: block; color: var(--muted); font-size: 15px; }
.sv-line > b { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.sv-total { display: flex; justify-content: space-between; padding-top: 8px; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.sv-pay { background: var(--in-l); border: 1px solid #bfe3cf; color: #0f5a36; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; }
.sv-pay small { display: block; font-weight: 400; font-size: 15px; }
.sv-pay > b { white-space: nowrap; font-size: 19px; font-variant-numeric: tabular-nums; }
.sv-carry { color: var(--muted); font-size: 16px; display: flex; justify-content: space-between; padding: 8px 2px; }
.sv-carry b { color: var(--text); font-variant-numeric: tabular-nums; }
.sv-empty { text-align: center; color: var(--muted); padding: 30px 0; }
.sv-foot { margin-top: 34px; text-align: center; color: var(--muted); font-size: 14px; }
/* 거래처 안내장 (guide.js): 링크 화면의 사용 안내 · 업체 화면의 안내장 보기 */
.sv-guide { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--brand); border-radius: 14px; padding: 10px 8px 10px 16px; margin: 0 0 14px; }
.sv-guide > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sv-guide b { font-size: 17px; color: var(--brand-d); }
.sv-guide span { font-size: 15px; color: var(--muted); line-height: 1.4; }
.sv-guide .btn { flex: none; height: 44px; padding: 0 18px; font-size: 16px; }
.sv-guide-top { margin: -6px 0 8px; }
.sv-guide-top .sv-guide-link { margin: 0; }
.sv-guide-link { border: 0; background: none; padding: 6px 4px; margin-bottom: 6px; font: inherit; font-size: 16px; font-weight: 700; color: var(--brand-d); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.modal.guide-modal { width: min(520px, 100%); }
.guide-modal .modal-body { padding: 10px; background: #e8edf4; }
.guide-list { display: grid; gap: 10px; }
.guide-list img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 10px; background: #dbe3ee; }
.share-guide { display: grid; gap: 8px; margin: 4px 0 6px; padding: 12px; border: 1px solid var(--line2); border-radius: 12px; background: #f6f8fc; }
.share-guide small { color: var(--muted); }
/* 거래처 화면의 사용 안내를 늘 크게 보일지 (발주 목록 › 주문 링크, 2026-11-21) */
.share-guide-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: #fff; border: 1px solid var(--line2); border-radius: 8px; cursor: pointer; }
.share-guide-opt input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.share-guide-opt b { display: block; font-size: 14.5px; }
.share-guide-opt small { display: block; margin-top: 2px; }
.guide-thumbs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; padding: 0; border: 0; background: none; cursor: zoom-in; }
.guide-thumbs img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 4px; background: #dbe3ee; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.sv-error { text-align: center; padding: 70px 20px; }
.sv h2 { font-size: 20px; margin: 22px 0 10px; }
.sv h2 small { font-size: 15px; font-weight: 400; color: var(--muted); }
/* 주문하기 / 거래내역 전환 단추 */
.sv-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #e3e8ed; border-radius: 14px; padding: 5px; margin-bottom: 14px; }
.sv-tabs button { height: 52px; border: 0; border-radius: 10px; background: transparent; font-size: 19px; font-weight: 700; color: var(--muted); cursor: pointer; }
.sv-tabs button.on { background: #fff; color: var(--brand-d); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); }

/* ---------- 거래처가 쓰는 주문서 (발주서) ---------- */
/* 거래처 주문서: 줄마다 품명 · 규격 · 수량(과 그 단위) · 비고. 중량 칸은 없다(무게는 주문한 뒤에 업체가 잰다). 품명 칸을 누르면 품목 목록이 나옴 */
.od-help { color: var(--muted); font-size: 16px; margin: 0 0 12px; }
.od-quick:not(:empty) { margin-bottom: 4px; }
.od-quick .btn { height: 48px; font-size: 17px; width: 100%; }
/* 지난 주문을 자동으로 불러왔다는 안내 + 비우기, 자동 불러오기 켜고 끄기 */
.od-loaded { display: flex; gap: 10px; align-items: center; background: var(--brand-l); border: 1px solid #9fcbd9; border-radius: 12px; padding: 10px 12px; font-size: 16px; }
.od-loaded span { flex: 1; min-width: 0; }
.od-quick .od-loaded .btn { width: auto; flex: none; height: 44px; padding: 0 16px; }
.od-auto { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 15px; color: var(--muted); min-height: 32px; cursor: pointer; }
.od-auto input { width: 20px; height: 20px; flex: none; }
.os-label { font-size: 17px; margin: 18px 0 8px; }
.os { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
/* 규격 칸을 넓게 (품명 칸에서 조금 떼어): 긴 규격("중(500알24-26미) 원포20kg")도 두 줄에 들어가게 (2026-11-22) */
.os-row { display: grid; grid-template-columns: 30px minmax(0, 2fr) minmax(0, 1.45fr) minmax(0, .8fr) minmax(96px, .8fr) minmax(0, 1.2fr) 40px; align-items: center; border-bottom: 1px solid var(--line2); }
/* 규격 · 수량 · 단위 칸의 이름표: 넓은 화면에서는 표 머리가 있으므로 숨기고 칸만 표에 놓는다 */
.os-f { display: contents; }
.os-f > span { display: none; }
.os-body .os-row:last-child { border-bottom: 0; }
.os-head { background: #f6f8fa; font-size: 15px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.os-head span { padding: 9px 8px; }
.os-no { text-align: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.os-row input { height: 50px; min-width: 0; padding: 0 8px; border: 0; border-right: 1px solid var(--line2); border-radius: 0; background: transparent; font-size: 17px; }
.os-row input:focus, .os-row select:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: #fff; }
/* 수량을 세는 단위: 고르는 칸 (미 · kg). 낱개 · 상자로 파는 품목은 하나뿐이라 고를 것이 없다 */
.os-row select { height: 50px; min-width: 0; width: 100%; padding: 0 2px 0 6px; border: 0; border-right: 1px solid var(--line2); border-radius: 0; background: transparent; font-size: 17px; color: var(--text); cursor: pointer; }
/* 단위 칸 (2026-11-16): 크기 등급이 있는 활어는 "미 · kg" 단추 (마릿수로 주문 / 총 중량으로 주문), 그 밖에는 위의 고르는 칸 */
.os-unit { display: flex; align-self: stretch; min-width: 0; }
.os-unit > select { flex: 1; align-self: center; }
.os-seg { display: none; flex: 1; min-width: 0; align-items: center; padding: 0 6px; border-right: 1px solid var(--line2); }
.os-unit.ways > select { display: none; }
.os-unit.ways > .os-seg { display: flex; }
.os-seg button { flex: 1; min-width: 0; height: 38px; padding: 0 2px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 16px; font-weight: 700; cursor: pointer; }
.os-seg button:first-child { border-radius: 8px 0 0 8px; }
.os-seg button:last-child { border-left: 0; border-radius: 0 8px 8px 0; }
.os-seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.os-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; position: relative; }
.os-row .os-name { font-weight: 700; }
.os-row .os-qty { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.os-row .os-qty::placeholder { font-weight: 400; }
/* 목록에서 고른 품목의 규격: 그 품목의 크기 등급이라 고칠 수 없다 */
.os-row .os-spec.lock { color: var(--brand); font-weight: 700; cursor: default; }
.os-row .os-spec.lock:focus { outline: 0; background: transparent; }
/* 목록에서 고른 품목의 규격: 입력칸(한 줄) 대신 글자 칸으로 다 보이게 — 길면 두 줄 (2026-11-22 대표: "20kg원포 이런 게 짤리잖아. 두 줄로 넣든 해서 다 보이게") */
.os-f > .os-spec-t { display: flex; align-items: center; min-width: 0; min-height: 50px; padding: 3px 6px; border-right: 1px solid var(--line2); color: var(--brand); font-size: 13.5px; font-weight: 700; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
.os-f > .os-spec-t[hidden] { display: none; }
/* 고른 품목의 품명도 자르지 않는다 (길면 두 줄): 품명 칸 자리에 글자 칸, 누르면 고르기 창 (share-order.js nameT) */
.os-namebox { display: contents; }
.os-name-t { display: flex; align-items: center; min-width: 0; min-height: 50px; padding: 3px 8px; border-right: 1px solid var(--line2); font-size: 16px; font-weight: 700; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; cursor: pointer; }
.os-name-t[hidden] { display: none; }
.os-name-t:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.os-row.os-idle .os-name-t { color: var(--muted); font-weight: 400; }
.os-row select.one { appearance: none; -webkit-appearance: none; cursor: default; }
/* 지난 주문에서 불러온 줄 가운데 수량을 비운 줄(이번에는 보내지 않는 줄): 흐리게. 수량 칸만 또렷하게 두어 "여기에 적으면 주문"이 보이게 함 */
.os-row.os-idle .os-name, .os-row.os-idle .os-spec, .os-row.os-idle .os-unit select { color: var(--muted); font-weight: 400; }
.os-row.os-idle .os-seg { opacity: .55; }
.os-row.os-idle .os-qty { background: #fffbe8; }
.os-row.os-idle .os-qty::placeholder { color: #8a6d1f; font-weight: 400; }
/* 총 무게로 적은 줄 아래: 규격으로 어림한 마릿수 "2kg 이면 약 7미" (2026-11-16. 수량 · 단위 칸 아래에 오른쪽 맞춤) */
.os-about { grid-column: 3 / 6; padding: 0 10px 8px; text-align: right; font-size: 14px; font-weight: 700; color: var(--brand); }
/* 지난 주문의 단위가 지금 품목에 없어 수량을 비운 줄: "지난번 1ea로 주문하셨습니다 …" (줄 너비로, 노란 수량 칸과 같은 빛) */
.os-about.was { grid-column: 2 / -1; text-align: left; color: #8a6d1f; }
.os-del { width: 40px; height: 50px; border: 0; background: transparent; color: #a3aeb8; font-size: 16px; cursor: pointer; }
.os-add { width: 100%; height: 46px; margin-top: 8px; font-size: 16px; border-style: dashed; }
.os-send { width: 100%; height: 58px; margin-top: 6px; font-size: 20px; }
.sv textarea { font-size: 17px; }
.sv .auth-msg { min-height: 26px; margin: 10px 0 0; font-size: 17px; font-weight: 700; }
/* 품명 칸의 목록: 손가락으로 누르기 쉽게 크게 */
body:has(.sv) .suggest .opt { padding: 12px 14px; font-size: 17px; }
body:has(.sv) .suggest .opt-right { font-size: 13px; }
/* 좁은 화면(휴대폰): 한 줄을 세 단으로. 품명 / 규격 · 수량 · 단위 (칸 위에 이름표) / 비고 */
@media (max-width: 600px) {
  .os-head { display: none; }
  .os-row { grid-template-columns: 22px repeat(6, minmax(0, 1fr)) 36px; grid-template-areas: "no name name name name name name del" ". spec spec spec qty qty unit unit" ". memo memo memo memo memo memo memo"; gap: 5px; padding: 9px 8px 9px 4px; align-items: end; }
  .os-row .os-spec, .os-row .os-unit select, .os-row .os-qty, .os-row .os-memo { padding: 0 7px; }
  .os-seg { padding: 0; border-right: 0; }
  .os-seg button { height: 48px; font-size: 17px; }
  .os-row .os-memo::placeholder { font-size: 15px; }
  .os-no { grid-area: no; align-self: center; }
  .os-row .os-name { grid-area: name; }
  .os-row .os-memo { grid-area: memo; }
  .os-about { grid-column: 2 / -1; padding: 0 3px; }
  .os-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .os-f > span { display: block; padding-left: 3px; font-size: 13px; line-height: 1.2; color: var(--muted); }
  .os-f input { width: 100%; }
  .os-f > .os-spec-t { min-height: 48px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 15px; color: var(--brand); }
  .os-row .os-name-t { grid-area: name; min-height: 48px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 17px; }
  .os-f-spec { grid-area: spec; }
  .os-f-unit { grid-area: unit; }
  .os-f-qty { grid-area: qty; }
  .os-del { grid-area: del; height: 48px; }
  .os-row input, .os-row select { height: 48px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
}
/* 주문 확인 창: 주문한 것(규격 · 수량)과 실제(수량 · 업체가 잰 총 중량)를 줄마다 나란히, 아래에 금액 차이 */
.ck-from { display: block; margin: -2px 0 4px; color: #b45309; font-size: 14px; }
/* 규격 통일 창 (품목 화면): 품명 · 지금 규격 → 바뀔 규격 */
.sf-count { margin: 8px 0; }
.sf-title { margin: 18px 0 2px; font-size: 16px; }
.sf-list { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.sf-row { display: grid; grid-template-columns: 26px minmax(0, 2.2fr) minmax(0, 1.2fr) 20px minmax(0, 1.2fr) 86px; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 14px; }
.sf-row:last-child { border-bottom: 0; }
.sf-row.sf-head { position: sticky; top: 0; z-index: 1; background: #f6f8fa; font-weight: 600; font-size: 13px; color: var(--muted); }
.sf-row input { width: 18px; height: 18px; }
.sf-row .sf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-row .sf-from, .sf-row .sf-arrow { color: var(--muted); }
.sf-row .sf-arrow { text-align: center; }
.sf-row small { color: var(--muted); font-size: 12px; text-align: right; }
/* 품목 정리 창: 지금 품목 (전표 몇 건) → 바뀔 이름 */
.sf-list.tidy .sf-row { grid-template-columns: 26px minmax(0, 2fr) 76px 20px minmax(0, 2fr) 40px; }
/* 기준대로 정리 · 확인이 필요한 것: 이름 아래에 까닭을 한두 줄로 */
.sf-row .sf-cell2 { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sf-row .sf-cell2 small { text-align: left; white-space: normal; line-height: 1.35; }
.sf-row select { width: 100%; min-width: 0; }
/* 분류 넣기: 이름으로만 짐작한 줄 · 지우자고 한 줄은 노랗게 (확인해 주세요) */
.sf-row.guess { background: #fff8e1; }
.cat-drop { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.cat-drop select { max-width: 120px; }
/* 분류 규칙 창의 줄: 말 → 품명 · 기억한 날 · 지우기 */
.rule-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 20px minmax(0, 1.4fr) 48px auto; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line2); font-size: 14px; }
.rule-row:last-child { border-bottom: 0; }
.rule-row .sf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-row .sf-arrow { color: var(--muted); text-align: center; }
.rule-add .btn { align-self: flex-start; }
/* 품목 화면의 묶음 보기 (시세표 모양): 분류 띠 아래에 품목 칸들이 빈 곳 없이 놓인다. 칸의 자리는 프로그램이 계산해서 놓는다 (screens-itemcards.js 의 layoutBoard) */
.ic-cats { display: flex; margin: 4px 0 10px; }
.ic-cats .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.bd-zoom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.bd-zoom input { width: 130px; }
.bd-tip { font-size: 13px; }
.bd-sec { margin-bottom: 16px; border-radius: 8px; }
.bd-bar { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px; background: var(--brand-d); color: #fff; border-radius: 6px; cursor: grab; user-select: none; -webkit-user-select: none; }
.bd-sec.none .bd-bar { background: #6b7785; cursor: default; }
.bd-name { font-size: 16px; white-space: nowrap; }
@media (max-width: 700px) { .bd-bar { flex-wrap: wrap; } .bd-hint, .bd-tip { display: none; } }
.bd-bar small { opacity: .75; }
.bd-offs { font-size: 12px; padding: 1px 6px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.bd-hint { font-size: 12px; opacity: .85; }
.bd-grow { flex: 1; }
.btn.bd-sbtn { height: 26px; padding: 0 8px; background: transparent; border-color: rgba(255, 255, 255, .4); color: #fff; font-size: 12px; }
.btn.bd-sbtn:hover { background: rgba(255, 255, 255, .16); }
.bd-pickbox { display: inline-flex; align-items: center; cursor: pointer; }
.bd-pickbox input { width: 16px; height: 16px; margin: 0; }
.bd-grip { display: none; cursor: grab; touch-action: none; font-size: 16px; line-height: 1; padding: 2px 4px; opacity: .6; }
@media (pointer: coarse) { .bd-grip { display: inline-block; } }
.bd-grid { position: relative; margin-top: 8px; min-height: 8px; }
.bd-empty { margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; text-align: center; }
.bd-block { position: absolute; left: 0; top: 0; box-sizing: border-box; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
/* 묶음 상자 (굴 · 대합 · 홍합 · 조개 …): 이름줄 + 그 안의 품목 칸들. 칸의 너비는 바깥과 같다 (상자 안 여백 없음) */
.bd-fam { position: absolute; left: 0; top: 0; box-sizing: border-box; }
.bd.ready .bd-fam { transition: transform .16s ease; }
.bd-famhd { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 8px; border-left: 3px solid var(--brand); background: #eef3f8; border-radius: 4px; font-size: 13px; color: var(--muted); user-select: none; -webkit-user-select: none; }
.bd-famhd b { color: var(--brand-d); font-weight: 700; }
.bd-famhd .bd-grip { cursor: grab; opacity: .55; }
.bdp .bd-famhd { border-left-color: #8aa4bd; }
.bd-fam > .bd-grid { margin-top: 6px; }
.bd-fam.dragging { opacity: .35; }
.bd-fam.drop-before { box-shadow: 0 -4px 0 0 var(--brand); }
.bd-fam.drop-after { box-shadow: 0 4px 0 0 var(--brand); }
.bd-fam.drop-in { outline: 2px dashed var(--brand); outline-offset: 3px; border-radius: 6px; }
.bd-block[data-fam].drop-before { box-shadow: 0 -4px 0 0 var(--brand); }
body.bd-dragging .bd-fam { transition: none; }
.bd.ready .bd-block { transition: transform .16s ease; }
.bd-block.off { opacity: .6; }
.bd-block.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.bd-block.dragging, .bd-sec.dragging { opacity: .35; }
.bd-block.drop-before { box-shadow: 0 -4px 0 0 var(--brand); }
.bd-block.drop-after { box-shadow: 0 4px 0 0 var(--brand); }
.bd-sec.drop-before { box-shadow: 0 -5px 0 0 var(--brand); }
.bd-sec.drop-after { box-shadow: 0 5px 0 0 var(--brand); }
.bd-sec.drop-in .bd-grid { outline: 2px dashed var(--brand); outline-offset: 3px; border-radius: 6px; }
.bd-head { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 8px; background: var(--brand-l); cursor: grab; user-select: none; -webkit-user-select: none; }
.bd-title { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 품목 화면의 이름줄: 이름을 자르지 않는다. 자리가 모자라면 원산지 · 단가가 아랫줄로 내려가고, 그래도 길면 이름이 낱말 단위로 줄을 바꾼다 */
.bd-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; cursor: pointer; }
.bd-main .bd-title { flex: 0 1 auto; min-width: 0; padding: 4px 0; line-height: 1.25; white-space: normal; overflow: visible; word-break: keep-all; overflow-wrap: anywhere; }
.bd-main .ip-org { flex: 0 0 auto; max-width: 100%; }
.bd-main .bd-meta { flex: 1 1 0; min-width: 2.8em; }   /* kg당 · 마리당이 "k"로 잘리지 않게: 자리가 모자라면 아랫줄로 */
.bd-main .bd-cell { margin-left: auto; }
.bd-meta { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-main:hover .bd-title { color: var(--brand-d); text-decoration: underline; text-underline-offset: 3px; }
.bd-check { opacity: .35; }
.bd-block:hover .bd-check, .bd-check:checked { opacity: 1; }
.bd-cols { display: grid; grid-template-columns: repeat(var(--s, 1), minmax(0, 1fr)); column-gap: 14px; padding: 0 8px; border-bottom: 1px solid var(--line2); background: #fafbfc; }
/* 넓힌 칸의 줄은 세로 차례: 왼쪽 열을 위에서 아래로 다 채운 뒤 오른쪽 열 (2026-11-22 대표: "원산지 양쪽 묶어서 고정했으면 세로로 순서대로". 격자는 가로로 채우므로 itemboard.js foldOrder 가 놓는 차례를 바꾼다) */
.bd-body { display: grid; grid-template-columns: repeat(var(--s, 1), minmax(0, 1fr)); align-content: start; column-gap: 14px; padding: 0 8px; }
/* 칸 놓기가 규격 줄의 글자 너비를 잴 때 잠깐 (itemboard.js layoutGrid) */
.bd-body.bd-measure { grid-template-columns: max-content !important; justify-content: start; }
/* 규격 줄을 여러 열로 접었을 때 열 사이의 옅은 세로줄 (규격과 값이 어느 열의 것인지 헷갈리지 않게: 2026-11-22 대표 "반 접어서 2열로") */
.bd-row { position: relative; }
.bd-row.bd-cl::after { content: ''; position: absolute; top: 4px; bottom: 4px; right: -8px; border-right: 1px solid #d5dee8; pointer-events: none; }
/* 접은 열마다 맨 아래 줄은 밑줄 없이 (foldOrder) */
.bd-row.bd-end { border-bottom: 0; }
.bdr-specs > .bd-row.bd-cl::after { right: -10px; }
.bd-row { display: grid; grid-template-columns: minmax(2.6em, 1fr) auto; column-gap: 6px; align-items: center; min-height: 26px; border-bottom: 1px solid var(--line2); font-size: 14px; break-inside: avoid; }
/* 원산지 열이 있는 표: 규격 이름은 4.5글자보다 좁아지지 않는다 (폰에서 "디 · 소 · 4"처럼 한 글자로 잘리던 것). 그래도 좁은 칸은 표 대신 쌓는다 (itemboard.js rowsOf) */
.bd-row.c2 { grid-template-columns: minmax(4.5em, 1fr) repeat(2, minmax(58px, 68px)); }
.bd-row.c3 { grid-template-columns: minmax(4.5em, 1fr) repeat(3, minmax(56px, 64px)); }
.bd-row.hd > span:first-child { white-space: nowrap; }
.bd-row.hd { min-height: 22px; border-bottom: 0; font-size: 12px; color: var(--muted); }
.bd-body > :last-child { border-bottom: 0; }
/* 규격 이름은 자르지 않고 줄을 바꾼다 (2026-11-21 대표 폰: 잘린 글자). 낱말은 쪼개지 않되, 띄어쓰기 없이 긴 것만 어디서든 */
.bd-lb { overflow: hidden; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.3; padding: 2px 0; color: var(--brand-d); font-weight: 700; }
/* 품목 칸도 검색 목록(.lv)과 같은 모양: 품명은 진하게, 원산지는 색 표, 규격은 파랗게, 줄에 올리면 옅게 칠함 */
.bd-head .ip-org { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bd-row:not(.hd):hover { background: #eef3fc; }
.bd-col .ip-org { max-width: 100%; vertical-align: middle; }
/* 원산지 덩어리 (원산지가 여럿인데 표가 아닌 품목. 품목 화면 · 고르기 창 · 거래처 주문 창이 같은 모양): 덩어리를 왼쪽부터 나란히, 덩어리 사이는 세로줄 (itemboard.js orgsBody · setOrgs).
   덩어리 안의 규격은 세로 차례이고 열 수(2열까지)는 칸 놓기가 정한다 */
.bd-body.bdr-orgs { display: flex; flex-wrap: wrap; align-items: stretch; column-gap: 0; }
.bdr-org { flex: 0 0 auto; min-width: 0; padding: 0 16px 2px; }
.bdr-org:first-child { padding-left: 0; }
.bdr-org + .bdr-org { border-left: 2px solid #c9d6e8; }
.bdr-specs { display: grid; grid-auto-flow: row; column-gap: 18px; }
.bdr-org > .bd-sub { padding-top: 6px; }
.bdr-specs > .bd-row:last-child { border-bottom: 0; }
/* 단가가 붙은 줄(품목 화면 · 매출 고르기): 덩어리가 칸 너비를 똑같이 나눠 쓰고 값은 덩어리의 오른쪽 끝에 줄 맞게. 덩어리 사이는 좁게 */
.bdr-orgs.fill .bdr-org { flex: 1 1 0; padding: 0 8px 2px; }
.bdr-orgs.fill .bdr-org:first-child { padding-left: 0; }
.bdr-orgs.fill .bdr-org:last-child { padding-right: 0; }
/* 나란히가 안 들어가는 칸(휴대폰에 원산지 셋 이상 · 좁게 정한 칸): 원산지를 위아래로 쌓고 가로줄로 가른다. 규격 열은 칸 너비를 나눠 쓴다 (세로 차례) */
.bdr-orgs.stack .bdr-org { flex: 1 1 100%; padding: 0 0 2px; border-left: 0; }
.bdr-orgs.stack .bdr-org + .bdr-org { margin-top: 6px; border-top: 2px solid #c9d6e8; }
.bd-cell { border: 0; border-radius: 4px; background: none; padding: 2px 2px; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; cursor: pointer; color: inherit; }
button.bd-cell:hover, .bd-col:hover { background: var(--brand-l); }
.bd-cell.none { color: var(--muted); font-weight: 400; }
.bd-cell.off { text-decoration: line-through; opacity: .5; }
.log-text { max-height: 240px; overflow: auto; margin: 8px 0 0; padding: 8px 10px; border-radius: 6px; background: #f7f9fb; font: inherit; font-size: 12px; white-space: pre-wrap; }   /* 삭제내역: 지운 단가표 글 */
.bd-cell.fixed { color: var(--muted); font-weight: 600; font-style: italic; }   /* 단가표에 없는 물건의 고정 단가 (구조 33) */
.bd-cell.noorder { box-shadow: inset 0 -2px 0 #e7b9b9; }   /* 거래처 주문서에 안 보이는 규격 */
/* 품절 (2026-11-21): 분류 맨 아래 "품절" 상자. 칸은 흐리게, 이름 옆에 품절 표 */
.bd-sold .bd-famhd { border-left-color: #b8c0c8; background: #f1f3f5; }
.bd-sold .bd-famhd b { color: #8a5a5a; }
/* 지난 값: 가장 최근 단가표에는 없던 품목의 예전 값 (날짜를 작게 붙이고 흐리게) */
.bd-cell.old { color: #8a93a0; font-weight: 500; }
.bd-cell.old { background: radial-gradient(circle at 4px 50%, #e89b1c 2.5px, transparent 3.2px); padding-left: 9px; }   /* 주황 점 (칸 너비는 그대로) */
.bd-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #e89b1c; vertical-align: 1px; }
.bd-stale { margin: 0 0 8px; padding: 7px 10px; border: 1px solid #f0d49a; border-radius: 8px; background: #fff8e8; color: #7a5200; font-size: 13px; }
.bd-stale .bd-dot { margin-right: 6px; }
/* 숨긴 품목 없애기 창: 숨긴 품목 → 없애는 방법 */
.sf-list.hid-list { max-height: 56vh; }
.sf-list.hid-list .sf-row { grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1.1fr); }
.sf-list.hid-list select { width: 100%; min-width: 0; height: 34px; }
.hid-arrow { color: var(--muted); text-align: center; }
@media (max-width: 640px) { .sf-list.hid-list .sf-row { grid-template-columns: 1fr; } .hid-arrow { display: none; } }
.bd-hid .bd-famhd b { color: #6b7280; }
.bd-block.hiddenout:hover, .bd-block.hiddenout.sel { opacity: 1; }
.bd-block.hiddenout .bd-title::after { content: "숨김"; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: #e5e7eb; color: #4b5563; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.bd-block.soldout { opacity: .62; }
.bd-block.soldout:hover, .bd-block.soldout.sel { opacity: 1; }
.bd-block.soldout .bd-title::after { content: "품절"; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: #f6e3e3; color: #a14848; font-size: 11px; font-weight: 700; vertical-align: 1px; }
/* 단가표 자리 칩 (screens-prices.js, 2026-11-21): 1번 · 2번 … 누르면 고르고, 고른 것을 한 번 더 누르면 이름 고치기 */
.book-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 8px; }
.book-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; text-align: left; }
.book-chip:hover { background: var(--brand-l); }
.book-chip b { font-weight: 700; white-space: nowrap; }
.book-chip small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.book-chip small.warn { color: #b45309; font-weight: 700; }   /* 오늘 값이 일부만 들어감 */
.book-chip .bc-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e3e8ed; color: var(--muted); font-size: 12px; font-weight: 800; }
.book-chip.on { border-color: var(--brand); background: var(--brand-l); box-shadow: 0 0 0 1px var(--brand) inset; }
.book-chip.on .bc-no { background: var(--brand); color: #fff; }
.book-chip.rival .bc-no { background: var(--purchase-l); color: var(--purchase); }
.book-chip.rival.on .bc-no { background: var(--purchase); color: #fff; }
.book-chip .bc-edit { color: var(--brand); font-size: 13px; }
.book-chip.add, .book-chip.hid { padding: 4px 12px; color: var(--brand); border-style: dashed; font-weight: 600; }
.book-chip.hid { color: var(--muted); }
.bd-cell.wide { grid-column: 2 / -1; }
.bd-head .bd-cell { font-size: 14px; }
.bd-delta { margin-left: 4px; font-size: 11px; font-weight: 700; }
/* 단가표가 적은 기준이 품목 단위와 다를 때 값 옆에 (국산 낙지 10,500/미) */
.bd-basis { margin-left: 1px; font-size: 11px; font-weight: 500; color: var(--muted); }
.bd-delta.up { color: #c62828; }
.bd-delta.down { color: #1565c0; }
.bd-col { border: 0; border-radius: 4px; background: none; padding: 1px 2px; font: inherit; font-weight: 600; text-align: right; cursor: pointer; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-sub { grid-column: 1 / -1; padding: 3px 0 1px; border-bottom: 1px solid var(--line2); }
.bd-sub .bd-col { font-size: 12px; color: var(--brand-d); text-align: left; padding-left: 0; }
.bd-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: ew-resize; touch-action: none; }
.bd-block:hover .bd-resize, .bd-block.resizing .bd-resize { background: linear-gradient(to right, transparent 5px, var(--brand) 5px); opacity: .55; }
.bd-block.resizing { box-shadow: 0 0 0 2px var(--brand); z-index: 2; }
body.bd-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.bd-dragging .bd-block { transition: none; }
.bd-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; padding: 6px 12px; border-radius: 6px; background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); white-space: nowrap; }
.bd-selbox { position: sticky; bottom: 10px; z-index: 20; }
.bd-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 12px; background: #fff; border: 2px solid var(--brand); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.bd-pick { max-height: 52vh; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }
.bd-pick-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 5px 10px; border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 14px; }
.bd-pick-row.head { position: sticky; top: 0; z-index: 1; background: #f6f8fa; }
.bd-pick-row small { color: var(--muted); }
.bd-pick-row input { width: 18px; height: 18px; }
.bd-choose { display: flex; flex-wrap: wrap; gap: 8px; }
/* 원산지가 여럿인 칸의 고르기 창: 원산지마다 ▲▼ (원산지 차례) + 그 원산지 고치기 (2026-11-23) */
.bd-choose-row { display: flex; align-items: center; gap: 4px; flex: 1 1 100%; }
.bd-choose-row > .btn:last-child { flex: 1 1 auto; justify-content: flex-start; }
.bd-choose-row > .bd-updown { flex: none; width: 34px; min-width: 0; padding: 0; }
.bd-choose-tip { flex: 1 1 100%; margin: 2px 0 0; font-size: 12.5px; }
/* 품목 칸 안 차례 바꾸기 (2026-11-23 대표 "자유도를 좀 줘라"): 규격 줄 이름 · 원산지 이름을 끌면 차례가 바뀐다. 끄는 것은 흐리게, 놓일 자리는 파란 줄 */
.bd-row[data-ids] > .bd-lb, .bd-lb[data-col] { cursor: grab; }
@media (hover: none) { .bd-row[data-ids] > .bd-lb, .bd-lb[data-col] { cursor: auto; } }
.bd-row.dragging, .bd-col.dragging, .bd-lb.dragging { opacity: .35; }
.bd-row.sq-t, [data-col].sq-t { box-shadow: inset 0 3px 0 var(--brand); }
.bd-row.sq-b, [data-col].sq-b { box-shadow: inset 0 -3px 0 var(--brand); }
[data-col].sq-l { box-shadow: inset 3px 0 0 var(--brand); }
[data-col].sq-r { box-shadow: inset -3px 0 0 var(--brand); }
/* 품목 묶음 고치기 창: 이름 · 분류 · 단위, 그 아래 규격 · 단가를 줄 단위로 */
.grp-top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grp-top .span2 { grid-column: 1 / -1; }
.grp-rows { border: 1px solid var(--line); border-radius: 8px; max-height: 44vh; overflow: auto; margin: 8px 0; }
.grp-row { display: grid; grid-template-columns: 58px minmax(0, 1.2fr) 92px minmax(0, 1fr) 64px 56px; gap: 6px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--line2); }
/* 줄 차례 ▲▼ (2026-11-23: 도다리 소 · 중 · 대) */
.grp-ud { display: flex; gap: 2px; }
.grp-ud .btn { flex: 1 1 0; min-width: 0; height: 32px; padding: 0; font-size: 12px; }
/* 다른 규격 줄에 합칠 줄 (저장할 때 한 품목으로) */
.grp-row.into { background: #fff7e6; }
.grp-into { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-into s { color: var(--muted); }
.btn-col { display: grid; gap: 6px; }
.grp-row:last-child { border-bottom: 0; }
.grp-row.grp-head { position: sticky; top: 0; background: #f6f8fa; font-size: 13px; font-weight: 600; color: var(--muted); }
.grp-row input.num { text-align: right; }
.grp-farm { width: 100%; min-width: 0; height: 36px; padding: 0 4px; font-size: 14px; }
/* 규격 칸 아래: 그 줄 품목의 이름 · 단위가 칸 이름 · 단위와 다를 때 (방어(국산) · 미 단가) */
.grp-spec { display: grid; gap: 2px; min-width: 0; }
.grp-spec small { font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
/* 분류 관리 창: 순서 · 이름 · 보일 곳 세 칸 · 품목 수 · 없애기 */
.cat-list { border: 1px solid var(--line); border-radius: 8px; max-height: 50vh; overflow: auto; margin-bottom: 10px; }
.cat-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 76px 76px 96px 56px 70px; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line2); font-size: 14px; }
.cat-row:last-child { border-bottom: 0; }
.cat-row.cat-head { position: sticky; top: 0; z-index: 1; background: #f6f8fa; font-weight: 600; font-size: 13px; color: var(--muted); }
.cat-row > input[type=checkbox] { width: 20px; height: 20px; justify-self: center; }
.cat-row.cat-head span:nth-child(n+3) { text-align: center; }
.cat-row .cat-move { display: flex; gap: 2px; }
@media (max-width: 600px) {
  .sf-list.tidy .sf-row { grid-template-columns: 26px minmax(0, 1fr) 14px minmax(0, 1fr); }
  .sf-list.tidy .sf-row .sf-from { display: none; }
  .cat-row { grid-template-columns: 62px minmax(0, 1fr) 40px 40px 40px; font-size: 13px; }
  .cat-row > :nth-child(n+6) { display: none; }
  .cat-row.cat-head span:nth-child(5) { overflow: hidden; white-space: nowrap; }
}
@media (max-width: 600px) {
  .sf-row { grid-template-columns: 26px minmax(0, 1.6fr) minmax(0, 1fr) 14px minmax(0, 1fr); }
  .sf-row small, .sf-row.sf-head span:last-child { display: none; }
}
.ck { font-size: 17px; }
.ck-top { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.ck-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.ck-item.changed { border-color: #e7c36a; border-left: 6px solid #d9a400; background: #fffaf0; }
.ck-item.dropped { border-style: dashed; color: var(--muted); }
.ck-item.added { border-left: 6px solid #9fc0e8; }
.ck-name { display: block; font-size: 18px; margin-bottom: 4px; }
.ck-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; padding: 2px 0; align-items: baseline; }
.ck-row > span { color: var(--muted); font-size: 15px; }
.ck-row > div { font-variant-numeric: tabular-nums; }
.ck-row em { font-style: normal; color: var(--muted); }
.ck-row small { display: block; color: var(--muted); font-size: 14px; }
.ck-diff { color: #b45309; font-weight: 700; margin-left: 8px; white-space: nowrap; }
.ck-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.modal-foot .ck-sum { flex: 1 1 100%; }
.ck-sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 2px 0; font-size: 17px; }
.ck-sum-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ck-sum-row.diff { font-size: 20px; font-weight: 700; color: #b45309; }
.ck-sum-row.diff.none { color: var(--text); }   /* 변동 없음 */
.ck-sum ~ .btn.big { flex: 1 1 100%; height: 52px; font-size: 18px; }
/* 보낸 주문 카드 */
.od-flash { background: var(--in-l); border: 1px solid #bfe3cf; color: #0f5a36; border-radius: 12px; padding: 14px 16px; font-weight: 700; margin-bottom: 12px; }
.od-card { background: #fff; border: 1px solid var(--line); border-left: 6px solid #d9a400; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.od-card.done { border-left-color: var(--in); }
.od-card.cancel { border-left-color: #a3aeb8; color: var(--muted); }
.od-card.wait { border-left-color: #f5a623; }
.od-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 6px; }
.od-chip { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #fff4d6; color: #8a5a00; white-space: nowrap; }
.od-chip.done { background: var(--in-l); color: var(--in); }
.od-chip.cancel { background: #e9edf1; color: #465360; }
.od-chip.wait { background: #ffe1b8; color: #7a3d00; }   /* 청구대기중: 업체가 받았고 실중량 · 작업비 확인 뒤 청구 */
.od-card-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line2); }
.od-card-line small { display: block; color: var(--muted); font-size: 15px; }
.od-card-line > b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.od-card-memo { margin: 8px 0 0; }
.od-card-note { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.od-card-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.od-card-btns .btn { height: 44px; font-size: 16px; }
.od-old { margin-top: 26px; }
.od-old summary { font-size: 17px; font-weight: 700; padding: 10px 0; cursor: pointer; }
.od-pending { margin-bottom: 8px; }
.od-days { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.od-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 14px; color: var(--muted); }
.od-day b { font-size: 18px; color: var(--text); }
.od-day.on { border-color: var(--brand); background: var(--brand-l); }
.od-day.other input { height: 34px; padding: 0 4px; font-size: 14px; }
.sv-error h1 { font-size: 22px; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1180px) {
  .entry { grid-template-columns: minmax(0, 1fr); }
  .memo-peek { display: block; }
  .price-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  input[type=text], input[type=search], input[type=tel], input[type=email], input[type=password], input[type=date], select, textarea { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; z-index: 50; width: 244px; transform: translateX(-100%); transition: transform .2s; }
  .menu-open .side { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .42); z-index: 49; }
  .menu-btn { display: inline-grid; }
  .topbar { position: sticky; top: 0; background: var(--bg); z-index: 20; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .page-title { font-size: 19px; }
  /* 좁은 화면: 체크하면 막대가 화면 아래에 떠서, 표가 밀리지 않고 엄지로 누르기 쉬움 */
  .bulk-bar { position: static; min-height: 56px; }
  .bulk-bar.idle .bulk-panel { min-height: 56px; }
  .bulk-bar:not(.idle) .bulk-panel { position: fixed; left: 8px; right: 8px; bottom: 10px; z-index: 40; padding: 10px 10px 10px 14px; }
  .bulk-bar:not(.idle) .bulk-count, .bulk-bar:not(.idle) .bulk-sum { order: 1; }
  .bulk-bar:not(.idle) .bulk-panel > .btn.ghost { order: 2; margin-left: auto; }
  .bulk-bar:not(.idle) .bulk-actions { order: 3; flex-basis: 100%; }
  body:has(.bulk-bar:not(.idle):not([hidden])) #main { padding-bottom: 150px; }
  body:has(.bulk-bar:not(.idle):not([hidden])) #toasts { bottom: 128px; }
  #main { padding: 10px 12px 70px; }
  .last-auto { flex-basis: 100%; }
  .entry-foot { grid-template-columns: minmax(0, 1fr); }
  .big-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  /* 지난 주문 안내: 휴대폰에서는 두 줄 높이를 늘 잡아 둠 (윗줄 안내, 아랫줄 단추) */
  .last-msg { height: 60px; flex-wrap: wrap; align-content: center; gap: 4px 10px; }
  .last-text { flex-basis: 100%; }
  .line.head { display: none; }
  .line, .lines.dated .line, .lines.ordered .line { grid-template-columns: repeat(6, 1fr) 34px; gap: 4px; padding: 8px 6px; }
  /* 줄 번호: 휴대폰에서는 칸 배치를 그대로 두고 줄 왼쪽 위에 작게 */
  .lines-body > .line { position: relative; padding-left: 28px; }
  .lines .line::before { position: absolute; left: 2px; top: 8px; width: 24px; height: 38px; background: none; border: 0; }
  .line input { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
  /* 한 줄을 3단으로: 품명 / 수량·단가·금액 / 규격·단위·비고 */
  .line .l-name { grid-area: 1 / 1 / 2 / 7; }
  .line .del { grid-area: 1 / 7 / 2 / 8; }
  .line .l-qty { grid-area: 2 / 1 / 3 / 3; }
  .line .l-price { grid-area: 2 / 3 / 3 / 5; }
  .line .l-amount { grid-area: 2 / 5 / 3 / 8; }
  .line .l-spec { grid-area: 3 / 1 / 4 / 3; }
  .line .l-unit { grid-area: 3 / 3 / 4 / 5; }
  .line .l-memo { grid-area: 3 / 5 / 4 / 8; }
  .lines.dated .line .l-date { grid-area: 4 / 1 / 5 / 5; }
  .lines.ordered .line .l-ord { grid-area: 4 / 1 / 5 / 8; height: auto; line-height: 1.4; padding: 0 2px; border: 0; background: none; white-space: normal; }
  .lines.ordered .line .l-ord:not(:empty)::before { content: '주문'; margin-right: 6px; font-weight: 400; color: var(--muted); }
  /* 수량 하나인 표: 품명 / 수량 · 마릿수(어림) · 단가(원/kg) / 금액 · 규격 · 비고 / (주문) */
  .lines.weight .line, .lines.ordered.weight .line { grid-template-columns: repeat(12, 1fr) 34px; }
  .lines.weight .line .l-name { grid-area: 1 / 1 / 2 / 13; }
  .lines.weight .line .del { grid-area: 1 / 13 / 2 / 14; }
  .lines.weight .line .ub-qty { grid-area: 2 / 1 / 3 / 5; }
  .lines.weight .line .ub-cnt { grid-area: 2 / 5 / 3 / 8; }
  .lines.weight .line .pbox { grid-area: 2 / 8 / 3 / 14; }
  .lines.weight .ubox, .lines.weight .pbox { border-right: 0; }
  .lines.weight .ubox > input { border-right: 1px solid var(--line); }
  .lines.weight .pbox > input { border-right: 1px solid var(--line); border-radius: 6px 0 0 6px; }
  .lines.weight .pbox > select { height: auto; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; }
  .lines.weight .line .l-amount { grid-area: 3 / 1 / 4 / 6; }
  .lines.weight .line .l-spec { grid-area: 3 / 6 / 4 / 10; }   /* 규격 4칸 · 비고 3칸 + ✕ 칸 너비 ("5kg 이상"이 잘리던 것) */
  .lines.weight .line .l-memo { grid-area: 3 / 10 / 4 / 14; }
  .lines.weight.ordered .line .l-ord { grid-area: 4 / 1 / 5 / 14; }
  .pay-fields { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-back { padding: 6px; }
  .modal-body { padding: 14px; }
  .range-inputs input[type=date] { width: 136px; }
}
/* 품목 표가 좁아 한 줄 칸이 다 안 들어갈 때: 창 너비가 아니라 품목 표 자신의 너비로 보고, 휴대폰과 같은 세 단(품명 / 수량 · 마릿수 · 단가 / 금액 · 규격 · 비고 / 주문)으로 놓는다.
   2026-11-23 대표: "발주목록에서 창 크기를 늘리고 줄일 때 특정 크기에서 비고가 없어져서 작업자가 비고를 못 찾는다" —
   한 줄 칸을 다 놓는 데 드는 가장 좁은 너비(수량 하나인 표 682px · 발주서 완료 768px)보다 표가 좁으면 넘친 오른쪽(비고 · ✕)이 잘려 안 보였다
   (1366 노트북은 오른쪽 칸이 옆에 있어 표가 727px → 발주서 완료의 비고 · ✕ 가 43px 잘림. 1024 창도 같음). 넉넉하면 원래 한 줄 그대로 */
.lines.weight { container: lines / inline-size; }
@container lines (max-width: 690px) {
  .lines.weight > .line.head { display: none; }
  .lines.weight .lines-body > .line, .lines.weight.cols-on .lines-body > .line { position: relative; grid-template-columns: repeat(12, minmax(0, 1fr)) 34px; gap: 4px; padding: 8px 6px 8px 28px; }
  .lines.weight .lines-body > .line::before { position: absolute; left: 2px; top: 8px; width: 24px; height: 38px; background: none; border: 0; }
  .lines.weight .line input { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
  .lines.weight .line .l-name { grid-area: 1 / 1 / 2 / 13; }
  .lines.weight .line .del { grid-area: 1 / 13 / 2 / 14; }
  .lines.weight .line .ub-qty { grid-area: 2 / 1 / 3 / 5; }
  .lines.weight .line .ub-cnt { grid-area: 2 / 5 / 3 / 8; }
  .lines.weight .line .pbox { grid-area: 2 / 8 / 3 / 14; }
  .lines.weight .line .ubox, .lines.weight .line .pbox { border-right: 0; }
  .lines.weight .line .ubox > input { border-right: 1px solid var(--line); }
  .lines.weight .line .pbox > input { border-right: 1px solid var(--line); border-radius: 6px 0 0 6px; }
  .lines.weight .line .pbox > select { height: auto; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; }
  .lines.weight .line .l-amount { grid-area: 3 / 1 / 4 / 6; }
  .lines.weight .line .l-spec { grid-area: 3 / 6 / 4 / 10; }   /* 규격 4칸 · 비고 3칸 + ✕ 칸 너비 ("5kg 이상"이 잘리던 것) */
  .lines.weight .line .l-memo { grid-area: 3 / 10 / 4 / 14; }
  .lines.weight.ordered .line .l-ord { grid-area: 4 / 1 / 5 / 14; height: auto; line-height: 1.4; padding: 0 2px; border: 0; background: none; white-space: normal; }
  .lines.weight.ordered .line .l-ord:not(:empty)::before { content: '주문'; margin-right: 6px; font-weight: 400; color: var(--muted); }
  .lines.weight .line .l-ask { padding-left: 8px; border-radius: 6px; }
}
/* 발주서 완료는 맨 앞 "주문" 칸만큼 넓어야 한 줄에 들어간다: 위와 같은 세 단을 더 넓은 표에서부터 */
@container lines (max-width: 776px) {
  .lines.ordered.weight > .line.head { display: none; }
  .lines.ordered.weight .lines-body > .line, .lines.ordered.weight.cols-on .lines-body > .line { position: relative; grid-template-columns: repeat(12, minmax(0, 1fr)) 34px; gap: 4px; padding: 8px 6px 8px 28px; }
  .lines.ordered.weight .lines-body > .line::before { position: absolute; left: 2px; top: 8px; width: 24px; height: 38px; background: none; border: 0; }
  .lines.ordered.weight .line input { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
  .lines.ordered.weight .line .l-name { grid-area: 1 / 1 / 2 / 13; }
  .lines.ordered.weight .line .del { grid-area: 1 / 13 / 2 / 14; }
  .lines.ordered.weight .line .ub-qty { grid-area: 2 / 1 / 3 / 5; }
  .lines.ordered.weight .line .ub-cnt { grid-area: 2 / 5 / 3 / 8; }
  .lines.ordered.weight .line .pbox { grid-area: 2 / 8 / 3 / 14; }
  .lines.ordered.weight .line .ubox, .lines.ordered.weight .line .pbox { border-right: 0; }
  .lines.ordered.weight .line .ubox > input { border-right: 1px solid var(--line); }
  .lines.ordered.weight .line .pbox > input { border-right: 1px solid var(--line); border-radius: 6px 0 0 6px; }
  .lines.ordered.weight .line .pbox > select { height: auto; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; }
  .lines.ordered.weight .line .l-amount { grid-area: 3 / 1 / 4 / 6; }
  .lines.ordered.weight .line .l-spec { grid-area: 3 / 6 / 4 / 10; }   /* 규격 4칸 · 비고 3칸 + ✕ 칸 너비 ("5kg 이상"이 잘리던 것) */
  .lines.ordered.weight .line .l-memo { grid-area: 3 / 10 / 4 / 14; }
  .lines.ordered.weight .line .l-ord { grid-area: 4 / 1 / 5 / 14; height: auto; line-height: 1.4; padding: 0 2px; border: 0; background: none; white-space: normal; }
  .lines.ordered.weight .line .l-ord:not(:empty)::before { content: '주문'; margin-right: 6px; font-weight: 400; color: var(--muted); }
  .lines.ordered.weight .line .l-ask { padding-left: 8px; border-radius: 6px; }
}

/* ---------- 메인화면의 창 (화면 꾸미기) ---------- */
/* 메인화면은 24칸 격자 위에 창들을 차례대로 놓는다. 창마다 차지하는 칸 수(--w)가 넓이. 업체가 꾸미지 않았으면 기본 배치 */
.big-row.any { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.big-btn.link { background: var(--brand); }
.home-memo { width: 100%; min-height: 120px; resize: vertical; }
/* 꾸미는 중: 창마다 손잡이 줄(끌어서 옮기기 · 앞뒤 · 넓이 · 숨기기), 안의 내용은 눌리지 않게 */
.hw-empty { display: flex; flex-direction: column; gap: 2px; color: var(--muted); border-style: dashed; }
/* 중간 크기 화면: 넓은 창은 한 줄을 다 쓰고 좁은 창만 반씩. 휴대폰: 모두 한 줄씩 (예전 메인화면과 같은 기준 너비) */
@media (max-width: 720px) {
  .big-row.any { grid-template-columns: repeat(2, 1fr); }
  /* 휴대폰에서는 창이 모두 한 줄씩이라 넓이를 바꿔도 달라지지 않으므로 넓이 단추를 감춘다 */
}
/* 고르는 창 (창 추가 · 단추 고르기 · 숫자 고르기 · 메뉴에 넣을 기능 고르기) */
.pk h3 { margin: 14px 0 6px; }
.pk h3:first-child { margin-top: 0; }
.pk h4 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.pk-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line2); border-radius: 8px; margin-bottom: 4px; }
.pk-row > b { flex: 1; min-width: 0; }
.pk-row.wide > div { flex: 1; min-width: 0; }
.pk-row.wide small { display: block; color: var(--muted); font-size: 13px; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-pool { max-height: 44vh; overflow: auto; margin-top: 8px; }
.pk input[type=search] { width: 100%; }
/* 화면 꾸미기 화면: 왼쪽 메뉴 꾸미기 · 색 */
/* 메뉴를 오른쪽에 두기 (넓은 화면에서만. 좁은 화면은 ☰ 로 여는 서랍 그대로) */
@media (min-width: 901px) {
  .shell.side-right { grid-template-columns: minmax(0, 1fr) 212px; }
  .shell.side-right .side { order: 2; }
}

/* ---------- 인쇄 ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  html { font-size: 12px; }
  body { background: #fff; }
  .no-print, .side, .scrim, #toasts, .toolbar, .seg, .modal-back, .btn-row, .big-row, .menu-btn, .suggest { display: none !important; }
  .shell { display: block; }
  .topbar { position: static; padding: 0 0 8px; border: 0; }
  #main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .table-wrap { border: 0; overflow: visible; }
  .tbl td, .tbl th { padding: 4px 6px; border-bottom: 1px solid #999; white-space: normal; }
  body.print-doc #app { display: none; }
  body.print-doc #print-root { display: block; }
  /* 거래처 화면의 명세서·정산서 그림을 인쇄할 때: 보여 주던 창은 숨기고 그림만 */
  .st-back { display: none !important; }
  body.st-open { overflow: visible; }
  /* 여러 장이면 장마다 새 쪽 */
  .st-print { display: block; width: 100%; max-width: 72mm; height: auto; margin: 0 auto; }   /* 전표기계 종이에는 폭에 꽉 차게, A4 에는 전표기계 거래명세표와 같은 폭(72mm)으로 */
  .st-print + .st-print { page-break-before: always; }
}

/* 거래처 화면: 명세서 · 정산서 그림을 보여 주는 창 (화면 전체) */
body.st-open { overflow: hidden; }
.st-back { position: fixed; inset: 0; z-index: 60; background: #e9eef2; display: flex; flex-direction: column; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); font-size: 18px; }
.st-close { height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.st-body { flex: 1 1 auto; overflow: auto; padding: 14px 10px; -webkit-overflow-scrolling: touch; }
.st-img { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 14px; background: #fff; border-radius: 10px; box-shadow: 0 2px 14px rgba(16, 32, 48, .16); -webkit-touch-callout: default; user-select: auto; }
.st-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); text-align: center; }
.st-foot .btn-row { justify-content: center; }
.st-foot small { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.st-out { display: block; margin: 8px auto 0; padding: 8px 12px; border: 0; background: none; color: #0d4fb0; font-size: 15px; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* 거래내역의 전표마다 붙는 "명세서" 단추, 달마다의 "정산서" 단추 */
.sv-stmt { height: 38px; padding: 0 14px; border: 1px solid #9fc0e8; border-radius: 10px; background: #eef5fd; color: #0d4fb0; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sv-total .sv-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; margin-left: 10px; align-self: center; }
/* 달 아래 줄: 왼쪽에 정산서, 오른쪽에 엑셀 받기 */
.sv-files > .sv-stmt { height: 42px; margin-right: auto; font-size: 16px; border-radius: 12px; }

/* 인쇄 양식 (거래명세서 · 견적서 · 계산서) */
.pd { color: #000; font-size: 10.5pt; line-height: 1.35; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pd-title { position: relative; text-align: center; margin-bottom: 10px; }
.pd-title h1 { font-size: 21pt; margin: 0; letter-spacing: 3px; display: inline-block; border-bottom: 3px double currentColor; padding: 0 14px 2px; }
.pd-title span { position: absolute; right: 0; bottom: 4px; font-size: 9pt; }
.pd-logo { position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 11mm; width: auto; }
.pd-top { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; margin-bottom: 8px; }
.pd-to { border: 1px solid #000; padding: 8px 10px; }
.pd-to p { margin: 2px 0; }
.pd-to .pd-client { font-size: 14pt; margin: 6px 0; }
.pd-to .pd-sum { margin-top: 8px; font-size: 11.5pt; }
.pd table { border-collapse: collapse; width: 100%; }
.pd th, .pd td { border: 1px solid #000; padding: 3px 6px; font-weight: 400; text-align: left; color: #000; }
.pd th { background: #efefef; white-space: nowrap; font-weight: 600; text-align: center; }
.pd .r { text-align: right; font-variant-numeric: tabular-nums; }
.pd .c { text-align: center; }
.pd .pd-strong { font-weight: 700; }
.pd th.pd-vert { writing-mode: vertical-rl; letter-spacing: 6px; width: 24px; padding: 2px; }
.pd-lines td { height: 23px; }
.pd-items th:nth-child(1) { width: 34px; }
.pd-items th:nth-child(2) { width: 30%; }
.pd-foot { margin-top: 6px; }
.pd-foot th { width: 14%; }
.pd-bottom { display: flex; justify-content: space-between; margin-top: 10px; gap: 20px; }
.pd-bottom p { margin: 2px 0; }
.pd-sign span { display: inline-block; width: 130px; text-align: right; }
.pd-pair { display: grid; grid-template-columns: 1fr 1fr; }
.pd-tax table { margin-top: -1px; }
.pd-tax.red { color: #c00000; }
.pd-tax.red th, .pd-tax.red td { border-color: #c00000; }
.pd-tax.red th { background: #fdeeee; color: #c00000; }
.pd-tax.blue { color: #0033a0; }
.pd-tax.blue th, .pd-tax.blue td { border-color: #0033a0; }
.pd-tax.blue th { background: #eaf0fb; color: #0033a0; }
.pd-cut { border-top: 1px dashed #888; margin: 8mm 0; }
.pd-break { break-after: page; page-break-after: always; height: 0; }
.pd td.pd-stamp-cell { position: relative; }
.pd-stamp { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); height: 15mm; max-width: 20mm; object-fit: contain; }

/* 거래명세표: 상호 · 거래처 · 합계 · 잔액은 크게 (기존 프로그램의 전표처럼) */
/* 품목 표: 한 품목이 두 줄 (번호 · 이름 / 비고 · 수량 · 단가 · 금액). 칸은 셋: [비고 … 수량] [단가] [금액] */
/* 첫 칸 안: 왼쪽 글(비고)은 남는 폭을 쓰고, 오른쪽 양(수량 · 중량)은 줄이 바뀌지 않게 오른쪽 끝에 붙는다 */
/* 명세표를 뽑기 전에 화면에서 보는 창: 전표기계 종이(80mm) 모양 그대로 */
.slip-view { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 8px; background: #e3e8ec; border-radius: 12px; }
.slip-paper { flex: none; max-width: 100%; box-sizing: border-box; padding: 2mm 4mm; background: #fff; box-shadow: 0 2px 10px rgba(16, 32, 48, .2); }
.slip-note { margin: 10px 0 0; }
.slip-direct { margin-top: 8px; white-space: normal; }

/* 바코드 라벨 */
@page labels { margin: 8mm; }
.bc-sheet { page: labels; display: grid; gap: 2mm; color: #000; }
.bc-label { border: 1px dotted #999; padding: 1.5mm 2mm; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5mm; overflow: hidden; break-inside: avoid; font-family: "Malgun Gothic", "맑은 고딕", sans-serif; }
.bc-name { font-size: 9pt; font-weight: 700; text-align: center; line-height: 1.15; max-height: 2.4em; overflow: hidden; }
.bc-svg { width: 92%; flex: 1 1 auto; min-height: 8mm; }
.bc-text { font-size: 7.5pt; letter-spacing: 1px; font-family: Consolas, monospace; }
.bc-price { font-size: 10pt; font-weight: 700; }

/* 거래처 주문서의 품목 고르는 창 (share-order.js pickItem): 갈래(활어 · 패류 …) › 분류 띠 › 품목 칸 › 규격 단추. 단가는 없다 */
.os-row .os-name[readonly] { cursor: pointer; }
.pk-list { min-height: 40vh; max-height: 62vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 600px) { .pk-list { max-height: 58vh; } }

.raw-state { font-weight: 700; }
.raw-state.ok { color: #0a7d3c; }
.raw-state.no { color: #b3261e; }
.logo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.logo-row img { height: 56px; max-width: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 4px; }
.pd-foot-text { white-space: pre-line; }
/* 전표기계 종이: 직접 그린 그림(rawprint.js)을 미리 보기 창에 보여 주고, 브라우저 인쇄로 뽑을 때는 그 그림을 그대로 싣는다 */
.slip-paper canvas { display: block; width: 384px; max-width: 100%; height: auto; }
/* 글자로 된 인쇄용 명세표 (rawprint.js slipHtml). 폭 64mm 를 종이 가운데에: 찍히는 폭이 64mm 인 전표기계와 72mm 인 전표기계 어느 쪽에서도 잘리지 않는다.
   종이가 더 좁으면(58mm) 그만큼 줄인다 (zoom 을 모르는 브라우저에서는 줄이지 않고 그대로) */
.slip-html { position: relative; margin: 2mm auto 0; color: #000; zoom: min(1, tan(atan2(100vw - 10mm, 64mm))); }
.slip-html + .slip-html, .slip-html + .pd-break + .slip-html { break-before: page; }
.slip-html span { position: absolute; white-space: pre; line-height: 1; }
.slip-html i { position: absolute; left: 0; right: 0; box-sizing: border-box; }
.slip-html img { position: absolute; }
.sd-wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.sd-wrap .slip-view { flex: 1 1 320px; max-height: 68vh; overflow-y: auto; }
.sd-panel { flex: 1 1 340px; max-height: 68vh; overflow-y: auto; padding-right: 4px; }
.sd-panel h4 { margin: 12px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sd-panel h4:first-child { margin-top: 0; }
.sd-row { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
.sd-row > span:first-child { flex: 1; min-width: 0; }
.sd-row select { width: auto; min-width: 120px; }
.sd-step { display: inline-flex; align-items: center; gap: 4px; }
.sd-step .btn { min-width: 32px; padding: 0; font-size: 16px; }
.sd-num { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.sd-foot { width: 100%; box-sizing: border-box; text-align: center; }

/* ---------- 발주 목록: 거래처 발주(매출 색) · 매입처 발주(매입 색) ---------- */
.po-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.po-side { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 14px; border: 1px solid var(--line); border-top: 4px solid var(--sale); background: #fff; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); opacity: .72; }
.po-side.p { border-top-color: var(--purchase); }
.po-side b { font-size: 16px; display: flex; align-items: center; gap: 7px; color: var(--sale); }
.po-side.p b { color: var(--purchase); }
.po-side b i { font-style: normal; font-size: 12px; color: #fff; background: var(--sale); border-radius: 999px; padding: 1px 8px; }
.po-side.p b i { background: var(--purchase); }
.po-side small { color: var(--muted); font-size: 12.5px; }
.po-side.on { opacity: 1; background: var(--sale-l); border-color: var(--sale); }
.po-side.p.on { background: var(--purchase-l); border-color: var(--purchase); }
.po-pane { border-left: 4px solid var(--sale); padding-left: 10px; }
.po-pane.p { border-left-color: var(--purchase); }
.btn.po-add, .btn.po-add:hover { background: var(--purchase); border-color: var(--purchase); color: #fff; }
/* 매입처 발주서 쓰기: 매출 입력 칸처럼 줄 단위 */
.po-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
.po-grid { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.po-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.1fr) 74px minmax(60px, .8fr) minmax(0, 1.3fr) 36px; align-items: center; border-bottom: 1px solid var(--line2); }
.po-row-head { background: var(--purchase-l); font-size: 13px; font-weight: 700; color: var(--purchase); }
.po-row-head span { padding: 6px 8px; }
.po-rows .po-row:last-child { border-bottom: 0; }
.po-row input, .po-row select { height: 38px; min-width: 0; width: 100%; padding: 0 8px; border: 0; border-right: 1px solid var(--line2); border-radius: 0; background: transparent; font-size: 15px; color: var(--text); }
.po-row input:focus, .po-row select:focus { outline: 2px solid var(--purchase); outline-offset: -2px; background: #fff; }
.po-row input.num { text-align: right; font-variant-numeric: tabular-nums; }
.po-name { position: relative; min-width: 0; }
.po-name input { font-weight: 700; }
.po-new { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--purchase); background: var(--purchase-l); border-radius: 5px; padding: 1px 5px; pointer-events: none; }
.po-new:empty { display: none; }
.po-del { height: 38px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.po-del:hover { color: var(--out); }
@media (max-width: 560px) {
  .po-head { grid-template-columns: 1fr; }
  .po-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 62px 58px 34px; }
  .po-row > :nth-child(5) { display: none; }
}
/* ---------- 매입처 링크: 받은 발주서 확인 · 확정 ---------- */
.sv-tabs.n3 { grid-template-columns: repeat(3, 1fr); }
.sv-tabs.n3 button { font-size: 16px; }
.sv-tabs button i { font-style: normal; font-size: 13px; background: var(--purchase); color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.sv-hint { color: var(--muted); font-size: 15px; margin: 0 0 10px; }
.pc-card { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--purchase); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.pc-line { padding: 12px 0; border-bottom: 1px solid var(--line2); }
.pc-line.drop .pc-line-head { opacity: .5; text-decoration: line-through; }
.pc-line-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pc-line-head b { font-size: 19px; }
.pc-line-head span { color: var(--purchase); font-weight: 700; white-space: nowrap; }
.pc-line small { display: block; color: var(--muted); font-size: 15px; }
.pc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; margin-top: 8px; align-items: end; }
.pc-f { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--muted); font-weight: 600; min-width: 0; }
.pc-f > div { display: flex; align-items: center; border: 1px solid #b9c3cc; border-radius: 8px; background: #fff; overflow: hidden; }
.pc-f > div:focus-within { border-color: var(--purchase); box-shadow: 0 0 0 2px var(--purchase-l); }
.pc-f input { flex: 1; min-width: 0; width: 100%; height: 46px; border: 0; padding: 0 6px; font-size: 18px; text-align: right; font-weight: 700; background: transparent; outline: 0; }
.pc-f em, .pc-f select { font-style: normal; padding: 0 8px 0 2px; color: var(--muted); font-size: 14px; border: 0; background: transparent; white-space: nowrap; height: 46px; line-height: 46px; }
.pc-f.need > div { border-color: var(--purchase); background: #fffaf4; }
/* 보낼 수량(잰 총 kg) 옆의 마릿수 어림 "약 10미" (2026-11-17 수량 하나) */
.pc-f .pc-cnt { display: inline-block; vertical-align: 1px; margin: 0; }
.pc-f .pc-cnt:not(:empty) { margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: #eef2f6; color: #3d4f66; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pc-amt { text-align: right; font-weight: 700; font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; height: 46px; line-height: 46px; }
.pc-line-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.pc-state { font-style: normal; color: var(--out); font-weight: 700; font-size: 15px; }
.pc-drop { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f8; font-size: 14px; font-weight: 700; color: var(--out); cursor: pointer; }
/* 품목 바꿔 보내기 (share-po.js): 찾기 칸 + 실시간 목록(.lv), 바꾼 줄은 "바꿔 보냄" 표와 원래 발주받은 품목 */
.pc-lbtns { display: flex; gap: 6px; margin-left: auto; }
.pc-drop.pc-swap { color: var(--purchase); }
.pc-swapped { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--purchase-l); color: var(--purchase); font-size: 13px; font-style: normal; font-weight: 700; vertical-align: middle; }
.pc-line small.pc-was { color: var(--muted); font-size: 14px; text-decoration: line-through; }
.pc-findbox { display: flex; gap: 6px; margin: 8px 0 4px; }
.pc-findbox[hidden] { display: none; }
.pc-find { flex: 1; min-width: 0; height: 44px; padding: 0 10px; border: 2px solid var(--purchase); border-radius: 8px; font-size: 17px; }
.pc-findx { flex: 0 0 auto; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f8; font-size: 14px; font-weight: 700; cursor: pointer; }
.po-swapped { color: var(--purchase); }
/* 등급 안내 (share-po.js): 매출 · 매입 입력의 줄 아래 안내(.l-diff .l-hint)와 같은 색 · 모양 */
.pc-hint { margin-top: 8px; padding: 6px 10px 8px; border-top: 1px dashed #f0d58a; border-radius: 0 0 6px 6px; background: #fffaf0; color: #9a3412; font-size: 15px; font-weight: 600; line-height: 1.5; }
.pc-hint[hidden] { display: none; }
.pc-hint.bad { border-top-style: solid; }
.pc-hint .chip { margin-left: 6px; height: 32px; font-weight: 700; color: var(--purchase); border-color: var(--purchase); }
.pc-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; font-size: 18px; }
.pc-total b { font-size: 24px; color: var(--purchase); font-variant-numeric: tabular-nums; }
.pc-note { width: 100%; height: 46px; font-size: 16px; margin: 8px 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
.pc-btns { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.pc-btns .btn { height: 54px; font-size: 18px; }
.pc-btns .btn.primary { background: var(--purchase); border-color: var(--purchase); color: #fff; }
.pc-f[hidden], .pc-fields[hidden] { display: none; }
.pc-f select { flex: 0 0 auto; width: auto; min-width: 0; padding-left: 0; font-weight: 600; cursor: pointer; }

/* ---------- 입금 확인 (거래처 링크) ---------- */
.pn-box { margin-bottom: 12px; }
.pn-btn { width: 100%; height: 54px; border: 0; border-radius: 12px; background: var(--in); color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.pn-btn.pay { background: var(--purchase); }
.pn-list { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.pn-list > small { color: var(--muted); font-size: 14px; }
.pn-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line2); }
.pn-row > div { flex: 1; min-width: 0; }
.pn-row b { font-variant-numeric: tabular-nums; }
.pn-row small { display: block; color: var(--muted); font-size: 14px; }
.pn-x { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--out); font-weight: 700; cursor: pointer; }
.pn-form input, .pn-form select { height: 50px; font-size: 18px; }
.pn-form input[inputmode="numeric"] { text-align: right; font-weight: 700; font-size: 22px; }
/* 입금 확인 (업체 화면: 미수금 · 입출금 맨 위) */
.pnl { margin-bottom: 12px; border-left: 4px solid var(--in); }
.pnl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 0; border-top: 1px solid var(--line2); }
.pnl-row.open { background: #fff8e6; margin: 0 -8px; padding: 8px; border-radius: 6px; }
.pnl-name { border: 0; background: transparent; font-weight: 700; font-size: 15px; color: var(--text); cursor: pointer; padding: 0; }
.pnl-name:hover { text-decoration: underline; }
.pnl-amt { font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; }
.pnl-row .btn-row { margin-left: auto; }
.pnl-wrap { width: 100%; align-self: stretch; grid-column: 1 / -1; }
.pnl-wrap:empty { display: none; }
.pnl { display: block; width: 100%; max-width: none; box-sizing: border-box; }
/* 입금 알림 고치기 · 지우기 창 (2026-11-21): 이어진 입금 내역 한 줄, 함께 지울지 묻는 체크 칸 */
.pnl-linked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; background: var(--line2, #f2f4f7); border-radius: 6px; font-size: 13.5px; }
.pnl-check { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid #f1a9a0; background: #fff8f7; border-radius: 6px; cursor: pointer; }
.pnl-check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.pnl-check b { display: block; font-size: 14px; }
.pnl-check small { display: block; color: #6b4b45; margin-top: 2px; }
/* 같은 돈이 두 번 들어가는 것 막기 (2026-11-19): 입금 확인 창 · 입금 받기 창 · 매출 입력의 받은 돈 · 미수금 목록의 알림 줄 */
.pnl-same, .pay-near { margin: 0; padding: 8px 10px; border: 1px solid #f1a9a0; border-left: 4px solid #d92d20; background: #fff1f0; border-radius: 6px; font-size: 13.5px; color: #7a271a; line-height: 1.5; }
.pnl-same b, .pay-near b { display: block; color: #b42318; }
.pnl-same small, .pay-near small { display: block; color: #912018; }
.pay-near[hidden] { display: none; }
.pay-near.note { border-color: #a6d9b4; border-left-color: #2f9e5b; background: #effaf2; color: #1c5a35; }
.pay-near.note b { color: #1c7c44; }
.pnl-neg { color: #b42318; font-weight: 600; }
.neg-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid #f1a9a0; border-left: 4px solid #d92d20; background: #fff1f0; border-radius: 6px; font-size: 13.5px; color: #7a271a; }
.neg-note b { color: #b42318; }
/* 매출 · 매입 입력 오른쪽 "최근 전표" 창에 섞여 나오는, 전표 없이 따로 넣은 입금(지급) 줄 */
tr.recent-pay > td { background: #f1faf4; }
/* 돈 주고받기: 거래처 줄을 누르면 그 아래에 펼쳐지는 "아직 안 받은 전표" (screens-trade.js 의 openRow) */
tr.settle-on > td { background: #eef4ff; font-weight: 600; }
tr.settle-row > td { padding: 0 0 10px; background: #f6f9ff; border-left: 4px solid #2f6fed; }
.settle-box { padding: 10px 14px 4px; }
.settle-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; font-size: 14px; }
.settle-head b { font-size: 15px; }
.settle-btns { margin-left: auto; display: flex; gap: 6px; }
.settle-box table { background: #fff; }
.settle-pays { margin: 8px 0 0; font-size: 13px; }
.neg-note .chip { border: 1px solid #f1a9a0; background: #fff; color: #7a271a; border-radius: 6px; padding: 3px 9px; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.neg-note .chip:hover { background: #ffe4e1; }
.neg-note small { flex-basis: 100%; color: #912018; }
.sum-box .near b, .sum-box .near span { color: #b42318; }
.sum-box .near-ok b, .sum-box .near-ok span { color: #1c7c44; }
.pay-near + .pay-near { margin-top: 6px; }
/* 수량 · 단가를 다 적어 두고 완료하지 않은 주문 수: 메뉴의 미완료 숫자 뒤에 "· 완료 전 N" (좁게 접은 메뉴에서는 숫자만) */
.nav-badge[data-ready]:not([data-ready=""])::after { content: " · 완료 전 " attr(data-ready); }
.erp .rail .nav-badge[data-ready]::after { content: none; }
.ready-note { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #f1a9a0; border-left: 4px solid #d92d20; background: #fff1f0; border-radius: 6px; font-size: 13.5px; color: #7a271a; }
.ready-note b { color: #b42318; }
.stock-since { margin: 0 0 8px; font-size: 13px; color: var(--muted, #667085); }

/* ---------- 품목 고르기 창 (dialogs.js itemPickDialog): 매출 · 매입 입력의 품명 칸을 누르면 ----------
   위에서 아래로 채우고 옆 칸으로 넘어가는 촘촘한 목록. 넘치면 옆으로 넘긴다 (마우스 바퀴) */
.modal.ip-modal { width: min(1500px, 100%); }
.modal.ip-modal .modal-body { display: flex; flex-direction: column; overflow: hidden; padding: 10px 12px; }
.ip { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.ip-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ip-q { flex: 1; min-width: 0; height: 38px; font-size: 16px; }
.ip-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ip-count:empty { display: none; }
.ip-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.ip-tabs:empty { display: none; }
.ip-tab { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: inherit; font-size: 14.5px; font-weight: 700; color: var(--text); cursor: pointer; }
.ip-tab small { margin-left: 5px; color: var(--muted); font-weight: 400; font-size: 11px; }
.ip-tab:hover { background: var(--brand-l); }
.ip-tab.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.ip-tab.on small { color: #d5e8ee; }
.ip-list { flex: 1 1 auto; height: calc(100vh - 236px); height: calc(100dvh - 236px); min-height: 180px; max-height: 760px; column-width: 262px; column-gap: 0; column-fill: auto; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); background: #fff; }
.ip-it { display: flex; align-items: baseline; gap: 6px; width: 100%; box-sizing: border-box; height: 26px; line-height: 25px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); border-radius: 0; background: #fff; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; white-space: nowrap; overflow: hidden; cursor: pointer; break-inside: avoid; }
.ip-it b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ip-it small { flex: 0 0 auto; color: var(--brand-d); font-size: 12px; }
.ip-it span { flex: 0 0 auto; margin-left: auto; padding-left: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ip-it:hover { background: #f1f6f9; }
.ip-it.on { background: var(--brand-l); box-shadow: inset 0 0 0 2px var(--brand); }
.ip-it.cur b { color: var(--brand-d); text-decoration: underline; }
.ip-cat { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 10px; background: var(--brand-d); color: #fff; font-size: 16px; font-weight: 800; letter-spacing: .03em; break-inside: avoid; break-after: avoid; }
.ip-cat small { font-size: 12px; font-weight: 400; opacity: .8; letter-spacing: 0; }
/* 같은 품명 묶음: 품명(굵게) 아래에 원산지별 한 줄, 규격은 단추로 나란히 */
.ip-or { display: flex; align-items: flex-start; gap: 6px; padding: 2px 6px 3px 8px; break-inside: avoid; }
.ip-org { flex: 0 0 auto; box-sizing: border-box; max-width: 110px; padding: 0 5px; border-radius: 3px; background: #dff0ec; color: #0b5f52; font-size: 11.5px; font-weight: 700; font-style: normal; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-org.imp { background: #fde9d6; color: #9a4700; }
/* 원산지 나라별 색 (itemlive.js orgTone): 국산 초록(위) · 일본 · 중국 · 러시아 · 노르웨이 · 그 밖의 수입 주황 */
.ip-org.jp { background: #fde2e6; color: #a3243b; }
.ip-org.cn { background: #fdefc6; color: #865100; }
.ip-org.ru { background: #dfe9fb; color: #1f4f9c; }
.ip-org.no { background: #ebe4fb; color: #5b3aa6; }
.ip-org.etc { background: #edf0f3; color: #4a5866; }

.ip-or .ip-org { width: 80px; margin-top: 3px; text-align: center; }
.ip-chips { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.ip-ch { height: 24px; padding: 0 7px; border: 1px solid #c5d3dd; border-radius: 4px; background: #fff; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.ip-ch:hover { background: var(--brand-l); border-color: var(--brand); }
.ip-ch.cur { box-shadow: inset 0 0 0 1px var(--brand); border-color: var(--brand); }
.ip-ch.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ip-empty { column-span: all; margin: 0; padding: 40px 12px; text-align: center; color: var(--muted); }
.ip-help { align-self: center; font-size: 12.5px; }
.modal.ip-modal.win-tall .ip-list, .modal.ip-modal.win-max .ip-list { height: 0; max-height: none; }
/* 맨 위에 따로 모은 묶음 (자주 주문하는 품목) · 표시해 둔 줄 */
.ip-cat.fav { background: #b45309; }
.ip-cat.plain { background: #5b6b7a; }
.ip-it.usual, .ip-ch.usual { background: #fff4d1; border-color: #e2b93b; box-shadow: none; }
.ip-it.usual b::before, .ip-ch.usual::before { content: "★ "; color: #c98a00; font-size: 11px; }
/* 목록과 왼쪽 폴더 칸 */
.ip-main { display: flex; gap: 8px; flex: 1 1 auto; min-height: 180px; height: calc(100vh - 236px); height: calc(100dvh - 236px); max-height: 760px; }
.ip-main .ip-list { flex: 1 1 0; min-width: 0; height: auto; min-height: 0; max-height: none; }
.modal.ip-modal.win-tall .ip-main, .modal.ip-modal.win-max .ip-main { height: 0; max-height: none; }
.ip-side { flex: 0 0 200px; display: flex; flex-direction: column; gap: 1px; padding: 4px; border: 1px solid var(--line); background: #f7f9fb; overflow-y: auto; }
.ip-f { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; height: 32px; padding: 0 4px 0 8px; border: 1px solid transparent; border-radius: 4px; font-size: 14px; cursor: pointer; user-select: none; }
.ip-f i { flex: 0 0 18px; font-style: normal; text-align: center; }
.ip-f b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ip-f small { color: var(--muted); font-size: 12px; }
.ip-f:hover { background: #eaf0f5; }
.ip-f.on { background: var(--brand-l); border-color: #9fcbd9; }
.ip-f.on b { color: var(--brand-d); font-weight: 800; }
.ip-f.drop { background: #fff1b8; border-color: #d9a400; }
.ip-f.add { color: var(--brand-d); margin-top: 4px; border-style: dashed; border-color: var(--line); }
.ip-fx { display: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.ip-f:hover .ip-fx { display: block; }
.ip-f:hover small { display: none; }
.ip-fx:hover { background: #d7e0e8; color: var(--text); }
.ip-fname { flex: 1 1 auto; min-width: 0; height: 24px; padding: 0 4px; font: inherit; font-size: 14px; }
.ip-fhelp { margin: 8px 4px 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.ip-list [draggable=true] { -webkit-user-drag: element; }
@media (max-width: 640px) {
  .ip-main { flex-direction: column; height: calc(100dvh - 260px); }
  .ip-side { flex: 0 0 auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .ip-f { flex: 0 0 auto; }
  .ip-f.add, .ip-fhelp { display: none; }
  .ip-list { columns: auto; overflow-x: hidden; overflow-y: auto; height: calc(100dvh - 260px); }
  .ip-it { height: 38px; line-height: 37px; font-size: 15px; }
  .ip-ch { height: 36px; padding: 0 11px; font-size: 15px; }
  .ip-chips { gap: 5px; }
  .ip-help { display: none; }
}

/* ---------- 품목 고르기: 표처럼 정리한 모양 (pickwin.js grouped) ----------
   대분류 머리줄은 늘 왼쪽 끝에서 가로로 길게(내려도 위에 붙어 있음), 그 아래 품명 | 원산지 | 규격 단추. 위아래로 넘긴다 */
.ip-list.rowsy { columns: auto; overflow-x: hidden; overflow-y: auto; }
.ip-list.rowsy .ip-cat { position: sticky; top: 0; z-index: 2; height: 36px; font-size: 16.5px; }
.ip-sec { margin-bottom: 10px; }
.ip-sec:last-child { margin-bottom: 0; }
.ip-cols { column-width: 400px; column-gap: 0; column-rule: 1px solid var(--line); }
.ip-p { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: start; padding: 3px 0; border-bottom: 1px solid var(--line2); break-inside: avoid; }
.ip-pn { padding: 6px 6px 0 10px; font-size: 14.5px; font-weight: 800; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.ip-po { min-width: 0; }
.ip-list.rowsy .ip-or { padding: 2px 6px 2px 0; }
.ip-list.rowsy .ip-ch { min-width: 56px; text-align: center; }
.ip-org.none { display: block; visibility: hidden; }
/* ---------- 거래처 고르기: 탐색기처럼 선택 (pickwin.js EX) ---------- */
.ip-list.ex { user-select: none; -webkit-user-select: none; }
.ip-list.ex .ip-it { cursor: default; }
.ip-list.ex .ip-it b { cursor: grab; }
.ip-list.ex .ip-it.on { background: #fff; box-shadow: inset 0 0 0 1px #9fb6c6; }
.ip-list.ex .ip-it.sel { background: #cfe6f5; box-shadow: inset 0 0 0 1px #5aa0cf; }
.ip-list.ex .ip-it.sel.on { box-shadow: inset 0 0 0 2px var(--brand); }
.ip-band { position: fixed; z-index: 80; border: 1px solid #2f7fc1; background: rgba(47, 127, 193, .18); pointer-events: none; }
.ip-dragtag { position: fixed; left: -999px; top: -999px; padding: 4px 10px; border-radius: 4px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ip-menu { position: fixed; z-index: 90; min-width: 190px; max-height: calc(100vh - 8px); overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .22); }
.ip-menu:focus { outline: none; }
.ip-menu button:focus-visible { outline: none; background: var(--brand-l); }
.ip-menu button.bold > span { font-weight: 700; }
.ip-menu button.danger:not(:disabled) { color: #c62828; }
.ip-menu button.danger:hover:not(:disabled) { background: #fdecea; }
.ip-mhead { margin: 0 0 4px; padding: 5px 10px 7px; border-bottom: 1px solid var(--line2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
/* 윈도우처럼 고르기 (ui.js winSelect): 끄는 동안 글자가 긁히지 않게 · 고른 줄은 거래처 고르기 창과 같은 파랑 */
body.ws-drag, body.ws-drag * { -webkit-user-select: none !important; user-select: none !important; }
.ws-root:focus { outline: none; }
.ws-sum { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 6px 6px 6px 14px; border-radius: 6px; background: #0e2a3a; color: #fff; font-size: 13px; box-shadow: 0 6px 18px rgba(14, 42, 58, .28); white-space: nowrap; overflow: hidden; }
.ws-sum span { color: #cfe6f5; overflow: hidden; text-overflow: ellipsis; }
.ws-sum small { color: #9fb6c6; font-size: 11.5px; }
.ws-sum-x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 4px; background: transparent; color: #cfdbe3; font-size: 13px; cursor: pointer; }
.ws-sum-x:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.bulk-sum { color: #cfe6f5; font-size: 13px; }
.bulk-sum:empty { display: none; }
.bulk-bar.idle .bulk-sum { display: none; }
@media (max-width: 760px) { .ws-sum small { display: none; } .ws-sum { left: 8px; right: 8px; bottom: 10px; } }
.ip-menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; height: 30px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; white-space: nowrap; cursor: pointer; }
.ip-menu button:hover:not(:disabled) { background: var(--brand-l); }
.ip-menu button:disabled { color: #a9b3bd; cursor: default; }
.ip-menu small { color: var(--muted); font-size: 11.5px; }
.ip-menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--line2); }
@media (max-width: 640px) {
  .ip-p { grid-template-columns: 84px minmax(0, 1fr); }
  .ip-pn { font-size: 15px; }
}

/* ---------- 품목 고르기 창: 품목 메뉴의 묶음 보기와 같은 모양 (screens-itemcards.js itemBoardPick). 고치는 것은 없고 단가를 누르면 고른다 ---------- */
.bdp-list { flex: 1 1 0; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 2px 6px 6px 2px; }
.bdp .bd-sec { margin-bottom: 12px; }
.bdp .bd-bar { position: sticky; top: 0; z-index: 3; cursor: default; }
.bdp .bd-head { cursor: default; }
.bdp .bd-head.pick, .bdp .bd-row.pick { cursor: pointer; }
.bdp .bd-head.pick:hover, .bdp .bd-row.pick:hover { background: #dde8fa; }
.bdp .bd-cell { min-width: 44px; cursor: pointer; }
.bdp .bd-cell:hover { background: var(--brand); color: #fff; }
.bdp .bd-cell.on { background: var(--brand); color: #fff; box-shadow: 0 0 0 2px #a9c4ef; }
/* 거래처 주문 창(단가 없는 줄 모양): 규격 줄 자체가 고르는 단추. ↑ ↓ 로 옮긴 줄 · 누를 줄 */
.bdp .bd-row.on, .bdp .bd-head.pick.on { background: var(--brand); color: #fff; }
.bdp .bd-row.on .bd-lb, .bdp .bd-head.pick.on .bd-title, .bdp .bd-head.pick.on .bd-meta { color: #fff; }
.bdp .bd-cell.cur { text-decoration: underline; }
.bdp .bd-cell.none { font-size: 12px; }
.bdp span.bd-col { cursor: default; }
/* 거래처 링크의 품목 고르기: 자주 주문하는 품목은 맨 위 묶음 + 노란 표시. 손가락으로 쓰는 기기는 줄을 크게 */
.bdp .bd-sec.fav .bd-bar { background: #b45309; }
.bdp .bd-row.usual, .bdp .bd-block.one.usual .bd-head { background: #fff4d1; }
.bdp .bd-cell.usual { border-color: #e2b93b; background: #ffe9a3; color: #6b4a00; }
.bdp .bd-row.usual .bd-lb::before, .bdp .bd-block.one.usual .bd-title::before { content: "★ "; color: #c98a00; font-size: 11px; }
/* 거래처 주문 창: 줄 끝의 ☆ / ★ 로 "자주 주문하는 품목"을 넣고 뺀다 (itemboard.js star · toggleFav). 이름 앞의 ★ 표시는 단추가 대신한다 */
.bdp .bd-fav { justify-self: end; width: 30px; height: 26px; margin: -3px -6px -3px 4px; padding: 0; border: 0; border-radius: 4px; background: none; color: #b5c0cc; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.bdp .bd-fav:hover { color: #d99a00; background: rgba(0, 0, 0, .05); }
.bdp .bd-fav.on { color: #e0a100; }
.bdp.touch .bd-fav { width: 36px; height: 30px; font-size: 19px; }
.bdp .bd-row.on .bd-fav, .bdp .bd-head.pick.on .bd-fav { color: rgba(255, 255, 255, .75); }
.bdp .bd-row.on .bd-fav.on, .bdp .bd-head.pick.on .bd-fav.on { color: #ffe08a; }
.bdp.favs .bd-row.usual .bd-lb::before, .bdp.favs .bd-block.one.usual .bd-title::before { content: none; }
.bd-favhint { margin: 0 0 10px; padding: 7px 12px; border-radius: 6px; background: #fff8e1; color: #7a5a00; font-size: 13.5px; }
/* 휴대폰 · 좁은 창의 고르기 창 (품목 고르기 · 거래처 고르기 · 거래처 링크의 품목 고르기: itemboard.js boardPick · pickwin.js) — 화면 가득, 위는 찾기 한 줄 + 분류 한 줄만.
   2026-11-22 대표 (폴드 폰 사진: 자판이 올라오면 제목 · 찾기 · 분류 두 줄 · 분류 띠 아래로 품목이 몇 줄밖에 안 보임): "상단에 고정된 메뉴나 분류도 많아서 보기가 엄청 불편해. 품목을 볼 공간이 너무 부족해"
   → 제목 줄은 없애고 ✕ 는 찾기 칸 옆으로, 분류 단추는 한 줄로 옆으로 밀어 보기, 분류 띠 · 아래 단추 줄은 얇게 (아래 "닫기"는 ✕ 가 대신). 목록을 밀면 자판이 내려간다 (ui.js) */
.ip-x { display: none; }
@media (max-width: 900px) {
  /* 칸 줄은 화면 너비 그대로 (안의 판이 넓게 놓여 있어도 창이 화면 밖으로 넓어지지 않게: 폰을 접고 펴도 판을 다시 놓는다) */
  .modal-back.ip-back { padding: 0; place-items: stretch; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
  .ip-back .modal.ip-modal { width: auto; min-width: 0; height: auto; min-height: 0; max-height: none; border-radius: 0; box-shadow: none; }
  .ip-back .modal.ip-modal .modal-head { display: none; }
  .ip-back .modal.ip-modal .modal-body { flex: 1 1 auto; min-height: 0; padding: 6px 8px 0; }
  .ip-back .ip-top { gap: 4px; margin-bottom: 6px; }
  .ip-back .ip-q { height: 40px; }
  .ip-back .ip-x { display: inline-grid; width: 40px; height: 40px; font-size: 17px; color: var(--text); }
  .ip-back .ip-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; margin: 0 -8px 6px; padding: 0 8px; }
  .ip-back .ip-tabs::-webkit-scrollbar { display: none; }
  .ip-back .ip-tab { flex: none; height: 34px; padding: 0 11px; }
  .ip-back .ip-main { flex: 1 1 auto; height: 0; min-height: 0; max-height: none; }
  .ip-back .bdp-list, .ip-back .ip-list { overscroll-behavior: contain; }   /* 목록 끝에서 더 밀어도 뒤의 화면은 그대로 */
  .ip-back .bdp .bd-bar { min-height: 30px; padding-top: 2px; padding-bottom: 2px; }
  .ip-back .modal.ip-modal .modal-foot { gap: 6px; padding: 6px 8px; }
  .ip-back .modal.ip-modal .modal-foot .btn { height: 36px; }
  .ip-back .ip-close, .ip-back .ip-help { display: none; }
}
/* 손가락으로 쓰는 기기(휴대폰 · 폴드): 글자 · 모양은 품목 화면 그대로, 줄만 조금 높게 (규격 줄을 눌러 고르기 쉽게) */
.bdp.touch .bd-row { min-height: 34px; }
.bdp.touch .bd-head { min-height: 34px; }
.bdp.touch .bd-cell { min-width: 58px; min-height: 32px; font-size: 15px; }
/* 단가를 보이지 않는 품목 고르기(거래처 링크): "선택" 칸 없이 규격이 곧 단추 */
.bdp.noprice button.bd-head { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.bdp.noprice button.bd-head:hover, .bdp.noprice button.bd-head.on { background: var(--brand); color: #fff; }
.bdp.noprice button.bd-head:hover .bd-meta, .bdp.noprice button.bd-head.on .bd-meta { color: #d5e8ee; }
.bdp.noprice button.bd-head.usual { background: #ffe9a3; }
.bdp.noprice button.bd-head.usual .bd-title::before { content: "★ "; color: #c98a00; font-size: 11px; }
.bdp-specs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px 7px; }
.bdp-spec { height: 28px; min-width: 54px; padding: 0 8px; border: 1px solid #c5d3dd; border-radius: 4px; background: #fff; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
/* 고르기 창의 글자는 자르지 않는다: 품명 · 원산지 · 규격이 길면 줄을 바꿔 다 보이게 (2026-11-22 대표: "규격 내용이 길면 짤리는 것도 진짜 별로다. 두 줄로 넣든 해서 다 보이게") */
.bdp .bd-head { flex-wrap: wrap; row-gap: 2px; }
.bdp .bd-head .bd-title { white-space: normal; overflow: visible; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.25; }
.bdp .bd-head .ip-org { flex: none; overflow: visible; }
.bdp .bd-cell.bd-spec { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.25; }
.bdp-spec { height: auto; min-height: 28px; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.2; }
.bdp-spec:hover, .bdp-spec.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bdp-spec.usual { background: #ffe9a3; border-color: #e2b93b; }
.bdp-spec.usual::before { content: "★ "; color: #c98a00; font-size: 11px; }
.bdp-spec.usual:hover, .bdp-spec.usual.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bdp-spec.cur { box-shadow: inset 0 0 0 1px var(--brand); border-color: var(--brand); }
.bdp.touch .bdp-specs { gap: 6px; padding: 8px; }
.bdp.touch .bdp-spec { height: auto; min-height: 40px; min-width: 64px; padding: 0 12px; font-size: 16px; }
/* 규격이 하나뿐인 품목(단가 없는 고르기 창): 칸 전체가 단추 한 개. 품명 · 규격 · 원산지가 두 줄 안에 */
.bdp.noprice button.bd-head.bdp-one { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-height: 0; padding: 6px 8px; white-space: normal; background: #fff; }
.bdp.noprice button.bd-head.bdp-one .bd-title { flex: 0 1 auto; min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.bdp-sp { flex: 0 0 auto; color: var(--brand-d); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.bdp.noprice button.bd-head.bdp-one .bd-meta { flex: 1 1 100%; margin: 0; font-size: 11.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bdp.noprice button.bd-head.bdp-one:hover .bdp-sp, .bdp.noprice button.bd-head.bdp-one.on .bdp-sp { color: #fff; }
.bdp.noprice button.bd-head.bdp-one.usual { background: #ffe9a3; }
.bdp.noprice button.bd-head.bdp-one:hover, .bdp.noprice button.bd-head.bdp-one.on { background: var(--brand); }
.bdp.touch.noprice button.bd-head.bdp-one { min-height: 52px; padding: 8px 10px; align-content: center; }
.bdp.touch.noprice button.bd-head.bdp-one .bd-title { font-size: 16px; }
.bdp.touch .bdp-sp { font-size: 15px; }
.bdp.touch .bdp-spec { min-width: 58px; padding: 0 9px; }
.bdp.noprice button.bd-head.bdp-one:hover .bd-title, .bdp.noprice button.bd-head.bdp-one.on .bd-title { color: #fff; }
/* 단가 없는 고르기 창: 품목 칸을 촘촘하게 */
.bdp.noprice .bd-sec { margin-bottom: 8px; }
.bdp.noprice .bd-head { min-height: 26px; }
.bdp.noprice .bdp-specs { padding: 5px 6px 6px; }
.bdp.noprice .bd-sub { padding-top: 2px; }
.bdp.noprice:not(.touch) button.bd-head.bdp-one { padding: 4px 8px; }
.bdp.noprice:not(.touch) .bdp-spec { height: auto; min-height: 26px; min-width: 48px; padding: 0 7px; }
/* 단가가 없는 칸: 글자 없이. 한 품목뿐인 줄은 줄 전체가 단추(빈칸), 원산지가 옆으로 나뉜 줄은 동그라미를 누른다 */
.bdp .bd-cell.blank { min-width: 0; padding: 0; }
.bdp .bd-cell.dot { font-size: 0; }
.bdp .bd-cell.dot::before { content: ""; display: inline-block; width: 11px; height: 11px; border: 2px solid #7fa9bd; border-radius: 50%; vertical-align: middle; }
.bdp .bd-cell.dot:hover::before, .bdp .bd-cell.dot.on::before { border-color: #fff; background: #fff; }
.bdp .bd-cell.dot.cur::before { background: var(--brand); border-color: var(--brand); }
/* 거래처 주문 창의 표 (품목 화면과 같은 표: 2026-11-22 대표 "구조 자체를 바꾸지 마"): 단가 자리에 그 원산지의 규격 — 누르면 고름, 없는 원산지는 회색 "-".
   규격이 단가보다 길어 원산지 칸을 조금 넓게 (줄마다 같은 너비: 열 이름 띠와 줄이 맞게). 긴 규격은 칸 안에서 줄을 바꿈 */
.bdp .bd-cell.bd-spec { color: var(--brand-d); font-weight: 700; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.25; text-align: right; }
.bdp .bd-cell.bd-spec:hover, .bdp .bd-cell.bd-spec.on { background: var(--brand); color: #fff; }
.bdp .bd-cell.bd-spec.usual { border-color: #e2b93b; background: #ffe9a3; color: #6b4a00; }
.bdp .bd-pc { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 0; }
.bdp .bd-pc .bd-fav { flex: none; margin: -3px -6px -3px 0; }
/* 거래처 창의 표에는 왼쪽 "규격" 열이 없다: 원산지 칸만 같은 너비로, 칸 안은 규격이 왼쪽 · ☆ 가 오른쪽 (품목 화면의 줄처럼) */
.bdp .bd-row.bd-nolb.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.bdp .bd-row.bd-nolb.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 14px; }
.bdp .bd-row.bd-nolb > .bd-pc { justify-content: space-between; }
.bdp .bd-row.bd-nolb .bd-cell.bd-spec, .bdp .bd-row.bd-nolb > .bd-cell.none, .bdp .bd-row.bd-nolb .bd-col { text-align: left; }
.bdp .bd-row.bd-nolb > .bd-cell.none { justify-self: start; padding-left: 4px; }
/* 자판으로 옮겨 간 자리가 빈칸이면 그 줄 전체를 표시 */
.bdp .bd-row.pick:has(.bd-cell.blank.on), .bdp .bd-head.pick:has(.bd-cell.blank.on) { background: var(--brand); color: #fff; }
.bdp .bd-row.pick:has(.bd-cell.blank.on) .bd-lb, .bdp .bd-head.pick:has(.bd-cell.blank.on) .bd-title, .bdp .bd-head.pick:has(.bd-cell.blank.on) .bd-meta { color: #fff; }
/* 거래처 발주: 규격이 하나뿐인 품목도 다른 품목의 이름줄과 같은 색 바탕으로 (흰 바탕이면 빠진 것처럼 보인다) */
.bdp.noprice button.bd-head.bdp-one { background: var(--brand-l); }
.bdp.noprice .bd-block.one { border-color: #b9d6e2; }
.bdp.noprice button.bd-head.bdp-one.usual { background: #ffe9a3; }
.bdp.noprice button.bd-head.bdp-one:hover, .bdp.noprice button.bd-head.bdp-one.on { background: var(--brand); }
/* 매입 고르기: 아직 품목에 없는 규격 (다른 원산지에는 있는 것). 누르면 등록하고 고른다 */
.bdp-spec.ghost { border-style: dashed; border-color: #b7c4cf; background: #f8fafb; color: #7b8894; font-weight: 500; }
.bdp-spec.ghost:hover { background: var(--brand); border-color: var(--brand); border-style: solid; color: #fff; }
/* 규격 단추 모양의 품목 칸: 원산지마다 한 덩어리, 덩어리끼리 옆으로 */
.bdp .bd-body.bdp-orgs { display: flex; flex-wrap: wrap; align-items: flex-start; columns: auto; column-count: auto; }
.bdp-org { flex: 1 1 150px; min-width: 0; }
.bdp-org + .bdp-org { border-left: 1px solid var(--line2); }
.bdp-org .bd-sub { padding-left: 8px; }

/* ---------- AI 주문하기 (거래처 주문서) ---------- */
/* 눈에 띄되 과하지 않게: 색이 천천히 흐르고, 가끔 빛이 한 번 지나간다. 움직임을 줄이도록 해 둔 기기에서는 멈춘다 */
.ai-btn { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 14px 18px; border: 0; border-radius: 14px; color: #fff; text-align: left; cursor: pointer; overflow: hidden;
  background: linear-gradient(110deg, #1a55c2, #2563c9, #6d4fd0, #3b7be0, #1a55c2); background-size: 200% 100%; animation: ai-flow 10s linear infinite; box-shadow: 0 4px 14px rgba(37, 99, 201, .26); transition: transform .12s, box-shadow .12s; }
.ai-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, .26) 50%, transparent 58%); transform: translateX(-100%); animation: ai-shine 5s ease-in-out infinite; pointer-events: none; }
.ai-btn:hover { box-shadow: 0 6px 18px rgba(37, 99, 201, .36); }
.ai-btn:active { transform: scale(.985); }
.ai-btn:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.ai-spark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .18); font-size: 22px; animation: ai-twinkle 2.6s ease-in-out infinite; }
.ai-btn-text { display: grid; gap: 2px; min-width: 0; }
.ai-btn-text b { font-size: 19px; }
.ai-btn-text small { font-size: 14px; opacity: .92; }
@keyframes ai-flow { to { background-position: 200% 0; } }
@keyframes ai-shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes ai-twinkle { 0%, 100% { transform: scale(.9); opacity: .8; } 50% { transform: scale(1.08); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-btn, .ai-btn::after, .ai-spark { animation: none; } }
.ai { display: grid; gap: 10px; }
.ai-text { width: 100%; min-height: 150px; font-size: 17px; line-height: 1.5; resize: vertical; }
.ai-view { display: grid; gap: 4px; max-height: 38vh; overflow: auto; }
.ai-empty { margin: 0; color: var(--muted); font-size: 15px; }
.ai-count { margin: 0 0 2px; font-weight: 700; color: var(--brand-d); }
.ai-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; }
.ai-line > b { flex: none; font-variant-numeric: tabular-nums; }
.ai-line small { display: block; color: var(--muted); font-size: 13px; }
.ai-line.check { background: #fff8db; border-color: #ecd98a; }
.ai-line .ai-why { color: #8a6100; }
.ai-req { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
/* 거래처 "AI 주문하기": AI 가 읽는 동안 (몇 초 걸린다) · 읽은 뒤 글을 고쳤을 때 · AI 가 응답하지 않았을 때 */
.ai-busy { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: var(--brand-d); font-size: 16px; font-weight: 600; }
.ai-busy[hidden] { display: none; }
.ai-spin { flex: none; width: 20px; height: 20px; border: 3px solid var(--brand-l); border-top-color: var(--brand); border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-stale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 4px; padding: 7px 10px; border-radius: 8px; background: var(--brand-l); font-size: 14px; }
.ai-stale .btn { min-height: 0; padding: 4px 12px; font-size: 14px; }
/* 주문 사진: 넣기 단추 · 미리 보기(✕ 로 빼기) · 창에 끌어다 놓을 때 */
.ai-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 44px; }
.ai-photo-btn { display: inline-flex; align-items: center; gap: 6px; }
.ai-photo-btn span { font-size: 18px; line-height: 1; }
.ai-shot:empty { display: none; }
.ai-thumb { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.ai-thumb img { display: block; max-width: 120px; max-height: 64px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.ai-thumb.done img { opacity: .7; }
.ai-thumb small { color: var(--muted); font-size: 13px; }
.ai-thumb-x { position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--text); color: #fff; font-size: 12px; cursor: pointer; }
.ai.drop .ai-text { outline: 3px dashed var(--brand); outline-offset: 2px; }
/* 🎤 말로 주문: 녹음 중에는 빨간 단추(깜빡이는 점 · 걸린 시간) + 소리 크기 막대 */
.ai-mic-btn { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ai-mic-btn span { font-size: 18px; line-height: 1; }
.ai-mic-btn.rec, .ai-mic-btn.rec:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.ai-mic-btn .ai-rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: ai-rec 1s ease-in-out infinite; }
@keyframes ai-rec { 50% { opacity: .25; } }
.ai-listen { display: grid; gap: 8px; margin: 4px 0; }
.ai-listen p { margin: 0; font-size: 15px; }
.ai-listen small { color: var(--muted); font-size: 13px; }
.ai-level { height: 10px; border-radius: 5px; background: var(--brand-l); overflow: hidden; }
.ai-level i { display: block; height: 100%; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .08s linear; }
@media (prefers-reduced-motion: reduce) { .ai-mic-btn .ai-rec-dot { animation: none; } .ai-level i { transition: none; } }
.od-ai-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--brand-l); font-size: 15px; }
.od-ai-note p { margin: 0; }

/* 요청사항은 적은 줄 그대로 (AI 주문하기가 품목별로 한 줄씩 정리해 넣는다) */
.order-req { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, .7); font-weight: 400; color: #5c3d00; }
.order-req b { display: block; font-size: 13px; color: #8a5a00; }
.order-req div, .ai-req div, .od-card-memo span { white-space: pre-line; }
.od-card-memo b { display: block; font-size: 13px; }
.ai-req b { display: block; font-size: 13px; }
/* 고객 주문 원문 (매출 입력의 오른쪽 칸, 거래처 메모 위) */
.order-src { flex: none; border: 2px solid #e0b400; background: #fffdf2; }
.order-src h3 { margin: 0 0 6px; font-size: 15px; color: #8a5a00; }
.order-src pre { margin: 0; max-height: 44vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 17px; line-height: 1.65; color: var(--text); }

/* 매출 · 매입 입력의 "AI 입력" 단추: 거래처 주문서의 것과 같은 색 흐름, 크기만 작게 */
.ai-btn.small { flex: none; width: auto; height: 42px; margin: 0 0 0 auto; padding: 0 12px 0 6px; gap: 6px; border-radius: 8px; box-shadow: 0 2px 8px rgba(37, 99, 201, .24); }
.ai-btn.small .ai-spark { width: 22px; height: 22px; font-size: 13px; }
.entry-head .field.grow { flex-basis: 140px; }
.ai-btn.small b { font-size: 15px; white-space: nowrap; }
.order-src[hidden] { display: none; }
.order-src .order-src-req { margin-top: 10px; padding-top: 8px; border-top: 1px solid #ecd98a; }

/* ---------- 품명 칸의 실시간 검색 결과 (dialogs.js itemLive): 치는 대로 품명 칸 바로 오른쪽에. ↑ ↓ · Enter. 오른쪽 아래 모서리로 크기 ---------- */
/* 단가 칸 옆 안내판 (quotepop.js, 2026-11-21): 단가표 자리마다의 값. 눌러지지 않아 아래 칸을 가리지 않는다 */
.qpop { position: fixed; z-index: 65; pointer-events: none; min-width: 200px; max-width: 300px; padding: 6px 10px 7px; border: 1px solid #a3b6d4; border-radius: 8px; background: #fff; box-shadow: 0 8px 26px rgba(0, 0, 0, .18); font-size: 13.5px; line-height: 1.35; }
.qpop-hd { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line2); color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qpop-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; padding: 1px 0; white-space: nowrap; }
.qpop-note { min-width: 0; white-space: normal; }
/* 품목에서 합친 규격: 자리 이름 아래에 단가표의 kg 줄마다 한 줄 (2026-11-25) */
.qpop-bk { margin-top: 2px; font-weight: 700; }
.qpop-ln { padding-left: 10px; }
.qpop-ln .qpop-nm { color: var(--muted); }
.qpop-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qpop-pr { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.qpop-pr small { margin-left: 1px; font-weight: 600; color: var(--purchase); }
.qpop-row.out .qpop-pr { font-weight: 600; color: var(--muted); }
.qpop-row.old .qpop-nm, .qpop-row.old .qpop-pr { opacity: .62; }
.qpop-d, .qpop-note { color: var(--muted); font-size: 11.5px; }
.qpop-tag { margin-left: 4px; padding: 0 4px; border-radius: 3px; background: var(--purchase-l); color: var(--purchase); font-size: 11px; font-style: normal; }
.qpop-up, .qpop-down { font-size: 11px; font-style: normal; }
.qpop-up { color: var(--out); }
.qpop-down { color: var(--in); }
.qpop-sep { margin: 4px 0 3px; border-top: 1px dashed var(--line); }
.qpop-sub .qpop-nm { color: var(--muted); }
.qpop-none { color: var(--muted); font-size: 12.5px; }
.lv { position: fixed; z-index: 70; display: flex; flex-direction: column; box-sizing: border-box; min-width: 300px; padding-bottom: 12px; border: 1px solid #a3b6d4; border-radius: 6px; background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .22); overflow: hidden; }
.lv-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 14px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 55%, #9fb6c6 55% 62%, transparent 62% 72%, #9fb6c6 72% 79%, transparent 79%); }
.lv-top { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; background: var(--brand-d); color: #fff; font-size: 14px; }
.lv-top b { font-size: 15px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-top small { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; opacity: .8; white-space: nowrap; }
.lv-more { flex: 0 0 auto; align-self: center; height: 22px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 4px; background: transparent; color: #fff; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.lv-more:hover { background: rgba(255, 255, 255, .16); }
.lv-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.lv-g { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; background: var(--brand-l); border-top: 1px solid #d3e0f5; font-size: 14px; }
.lv-g b, .lv-n b { font-weight: 800; color: var(--text); }
.lv-g small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.lv-r { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 22px; border-bottom: 1px solid var(--line2); font-size: 14.5px; cursor: pointer; white-space: nowrap; }
.lv-r.solo { padding-left: 10px; border-top: 1px solid #d3e0f5; }
.lv-n { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.lv-sp { font-weight: 700; color: var(--brand-d); overflow: hidden; text-overflow: ellipsis; }
.lv-u { margin-left: auto; color: var(--muted); font-size: 12px; }
.lv-aka { margin-left: 8px; color: #8a6a1c; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }   /* 옛 이름으로 찾아진 품목 (같은 물건 잇기) */
.lv-r.on .lv-aka { color: #ffe9b0; }
.lv-pr { flex: 0 0 76px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lv-r:hover { background: #eef3fc; }
.lv-r.on { background: var(--brand); color: #fff; }
.lv-r.on .lv-sp, .lv-r.on .lv-u, .lv-r.on b { color: #fff; }
.lv-empty { margin: 0; padding: 26px 14px; text-align: center; color: var(--muted); font-size: 14px; }
/* 둘러보기(칸이 빈 채로 열 때, 거래처 주문): 분류마다 머리줄. 내려도 위에 붙어 있다 */
.lv-sec { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; background: #3b5670; color: #fff; font-size: 13px; font-weight: 700; }
.lv-sec small { margin-left: auto; font-weight: 400; opacity: .75; }
.lv-sp.usual::before { content: "★ "; color: #c98a00; font-size: 11px; }
.lv-r.on .lv-sp.usual::before { color: #ffe08a; }
@media print { .lv { display: none !important; } }

/* 새벽 작업 인쇄 (screens-dawn.js): 운행표 · 구매표는 아래 .dw-run (A4 가로), 상자에 넣을 거래처 칸은 .dw-cells (A4 세로) */
.dw-cells { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 268mm; }
.dw-cell { display: flex; flex-direction: column; min-width: 0; padding: 5mm; overflow: hidden; border: 1px dashed #666; }
.dw-ct { display: flex; justify-content: space-between; gap: 6px; font-size: 10pt; }
.dw-cname { margin: 2mm 0 3mm; padding-bottom: 1.5mm; border-bottom: 2px solid #000; font-size: 17pt; font-weight: 800; line-height: 1.2; }
.dw-cell ul { flex: 1 1 auto; margin: 0; padding: 0; list-style: none; }
.dw-cell li { display: flex; align-items: baseline; gap: 2mm; padding: 1.1mm 0; border-bottom: 1px solid #bbb; font-size: 11.5pt; }
.dw-cell li i { font-size: 13pt; font-style: normal; }
.dw-cell li span { flex: 1 1 auto; min-width: 0; }
.dw-cell li b { font-size: 12.5pt; white-space: nowrap; }
.dw-cell li.late span::after { content: " (추가)"; font-weight: 700; }
.dw-cell.dense li { padding: .4mm 0; font-size: 9.5pt; }
.dw-cell.dense li b { font-size: 10pt; }
.dw-cmemo { margin: 2mm 0 0; font-size: 10pt; }
.dw-cf { margin-top: 2mm; font-size: 9.5pt; text-align: right; }
/* 운행표 (screens-dawn.js runPage): 차마다 A4 가로 한 장. 들를 곳이 가로로 한 칸씩, 품목은 그 칸 밑에 세로로 (대표 2026-11-16).
   용지(A4 가로 · 여백 8mm)는 인쇄할 때 printNode 가 정하고, 글자 크기(--fs) · 한 띠의 칸 수는 fitRun 이 재어서 한 장에 맞춘다 */
/* 글꼴은 화면 · 종이 모두 맑은 고딕으로 못 박는다: 화면 글꼴(Pretendard)은 화면에만 쓰여서, 화면에서 잰 높이와 종이의 높이가 달라 한 장을 넘겼다 */
.dw-run { width: 261mm; margin: 0 auto; font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; font-size: var(--fs, 10pt); line-height: 1.22; }
.dw-run + .dw-run { break-before: page; page-break-before: always; }
.dw-rh { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5mm 4mm; margin-bottom: 2mm; padding-bottom: 1.2mm; border-bottom: 2px solid #000; font-size: 10.5pt; line-height: 1.3; }
.dw-rh h1 { margin: 0; font-size: 16pt; letter-spacing: 3px; }
.dw-rcar { padding: 0 2.5mm; border: 2px solid #000; font-size: 15pt; }
.dw-rme { margin-left: auto; }
.dw-rmemo { margin: 0 0 2mm; padding: 1mm 3mm; border: 1px solid #000; font-size: 10.5pt; }
.dw-rg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2mm; align-items: stretch; }
.dw-rc { display: flex; flex-direction: column; min-width: 0; border: 1.4px solid #000; break-inside: avoid; page-break-inside: avoid; }
.dw-rch { display: flex; align-items: center; gap: .35em; padding: .22em .35em; border-bottom: 1.4px solid #000; font-size: 1.06em; line-height: 1.2; }
.dw-rch i { flex: none; min-width: 1.5em; padding: 0 .2em; border-radius: 3px; background: #000; color: #fff; font-style: normal; font-weight: 800; text-align: center; }
.dw-rch b { flex: 1 1 auto; min-width: 0; font-weight: 800; word-break: keep-all; overflow-wrap: anywhere; }
.dw-rch small { flex: none; padding: 0 .3em; border: 1px solid #000; border-radius: 3px; font-size: .72em; font-weight: 700; }
/* 매입(받으러 가는 곳)과 배송(거래처)은 흑백 종이에서도 한눈에 (대표 2026-11-16 "흑백으로 뽑으니 색 말고 다른 효과로 확실히"):
   매입 = 검은 머리줄에 흰 글씨 + 두 줄 테두리, 배송 = 흰 머리줄 + 한 줄 테두리. 머리 맨 오른쪽 글자도 "매입" / "배송" */
.dw-rc.sup { border: 3.5px double #000; }
.dw-rc.sup .dw-rch { border-bottom: 0; background: #000; color: #fff; }
.dw-rc.sup .dw-rch i { background: #fff; color: #000; }
.dw-rc.sup .dw-rch small { border-color: #fff; background: #fff; color: #000; font-weight: 800; }
.dw-leg { display: inline-flex; align-items: center; gap: 1.2mm; font-size: 9.5pt; white-space: nowrap; }
.dw-leg em { padding: 0 1.6mm; border: 1px solid #000; border-radius: 3px; font-style: normal; font-weight: 800; }
.dw-leg em.sup { margin-right: .3mm; border: 3px double #000; background: #000; color: #fff; }
.dw-leg em.cust { margin-left: 2mm; background: #fff; }
.dw-rc ul { margin: 0; padding: .1em .35em .15em; list-style: none; }
/* 두 칸 이상 넓힌 곳의 품목: 세로 차례 (왼쪽 열을 위에서 아래로 다 채운 뒤 오른쪽 열 — 2026-11-22 대표 "반 접었으면 세로로 순서대로. 다시 수정하자 전부").
   열마다 줄 수(--rows)와 마지막 열(lc) · 열의 맨 아래 줄(be)은 screens-dawn.js fitRun 이 정한다. 칸 사이 점선은 줄마다 오른쪽 테두리로 (인쇄에도 나옴) */
.dw-rc.two ul { display: grid; grid-template-columns: repeat(var(--span, 2), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), auto); grid-auto-flow: column; column-gap: .9em; }
.dw-rc.two li { position: relative; }
.dw-rc.two li::after { content: ''; position: absolute; top: 0; bottom: -1px; right: -.45em; border-right: 1px dotted #888; }
.dw-rc.two li.lc::after { content: none; }
.dw-rc.two li.be { border-bottom: 0; }
.dw-rc li { display: flex; align-items: baseline; gap: .3em; padding: .14em 0; border-bottom: 1px dotted #999; break-inside: avoid; page-break-inside: avoid; }
.dw-rc li:last-child { border-bottom: 0; }
.dw-rc li .bx { flex: none; font-size: 1.12em; line-height: 1; }
.dw-rc li .nm { flex: 1 1 auto; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.dw-rc li .nm small { font-size: .84em; }
.dw-rc li .nm .lm { font-size: .8em; }
.dw-rc li .nm em { margin-right: .25em; padding: 0 .15em; border: 1px solid #000; font-size: .78em; font-style: normal; font-weight: 800; }
.dw-rc li b { flex: none; font-weight: 800; white-space: nowrap; }
.dw-rcm { margin: auto 0 0; padding: .2em .4em; border-top: 1px solid #000; font-size: .86em; overflow-wrap: anywhere; }
/* 한 장에 맞추려고 재 볼 때 (화면 밖, 운행표 쓸 자리 넓이 그대로) */
.dw-measure { position: fixed; top: 0; left: -2000px; z-index: -1; width: 281mm; visibility: hidden; pointer-events: none; }
/* 구매표 (screens-dawn.js buyPage): 매입처마다 흰 머리줄 칸, 받으러 가는 차 한 줄. 사는 곳 미정 · 품목에 안 이어진 줄은 점선 칸 (확인할 것) */
.dw-rc.chk { border-style: dashed; }
.dw-rsub { margin: 0; padding: .12em .4em; border-bottom: 1px solid #000; font-size: .8em; }
/* 품목별 매입 · 매출의 단위별 총량 칸 (screens-view.js qtyPanel): kg · ea · box … 단위마다 매입 · 매출 숫자를 크게 + 나란한 막대.
   화면과 인쇄 둘 다 쓰므로 여기(app.css)에 둔다. 색은 ui2.css 의 그래프 색, 없으면(인쇄) 같은 값 */
.qty-panel .card-head h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.qty-panel .card-head h3 small { font-size: 12px; }
.qty-panel .qp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }   /* 단위가 하나뿐이면(품목 하나) 그 칸이 줄을 꽉 채움 */
.qp-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 12px 12px; border: 1px solid var(--line2, #e2e7ed); border-radius: 4px; background: var(--card, #fff); }
.qp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.qp-head b { font-size: 15px; font-weight: 800; color: var(--brand, #1a55c2); }
.qp-head small { color: var(--muted, #627182); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qp-row { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "k n" "bar bar"; align-items: baseline; gap: 3px 10px; }
.qp-k { grid-area: k; display: inline-flex; align-items: center; color: var(--text-2, #3a4756); font-size: 13px; white-space: nowrap; }
.qp-k .cx-key { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; }
.qp-row.purchase .cx-key, .qp-row.purchase .qp-bar i { background: var(--cx-purchase, #eb6834); }
.qp-row.sale .cx-key, .qp-row.sale .qp-bar i { background: var(--cx-sale, #2a78d6); }
.qp-row > b { grid-area: n; justify-self: end; overflow: hidden; font-size: 22px; font-weight: 800; letter-spacing: -.015em; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.qp-row > b small { margin-left: 3px; font-size: 13px; font-weight: 600; color: var(--text-2, #3a4756); }
.qp-bar { grid-area: bar; display: block; height: 8px; border-radius: 4px; background: var(--surface-3, #e8ecf1); overflow: hidden; }
.qp-bar i { display: block; height: 100%; border-radius: 4px; }
.qp-note { margin: 8px 0 0; font-size: 12.5px; }
/* 품목별 표 바닥줄의 단위별 합계: 단위마다 한 줄 (오른쪽 맞춤) */
.q-lines { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.35; }
/* 머리줄 오른쪽의 색 풀이 (매입 · 매출). 인쇄에서도 네모가 보이게 */
.qty-panel .card-head .cx-key { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 8px; border-radius: 3px; vertical-align: -1px; }
.qty-panel .cx-key.k-purchase { background: var(--cx-purchase, #eb6834); }
.qty-panel .cx-key.k-sale { background: var(--cx-sale, #2a78d6); }
@media print {
  .qty-panel { break-inside: avoid; margin-bottom: 10px; }
  .qty-panel .qp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .qp-card { padding: 6px 8px; border-color: #999; }
  .qp-row > b { font-size: 16px; }
  .qty-panel .cx-key, .qp-bar, .qp-bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* 거래처 가산액 화면: 좁은 화면(접는 폰을 편 넓이 · 좁은 창)에서는 "센 줄" · "마지막 매출" 칸을 접어 표가 화면 넓이 안에 들어오게 (상자 안 가로 스크롤 없이) */
@media (max-width: 1100px) {
  .mk-screen table th:nth-child(6), .mk-screen table td:nth-child(6), .mk-screen table th:nth-child(7), .mk-screen table td:nth-child(7) { display: none; }
  .mk-screen table td { white-space: normal; }
  .mk-screen .tag { white-space: normal; }
}
/* 목록 먼저 (2026-11-17 대표 "어떤 메뉴든 리스트업 자료가 제일 중요, 시각적 자료는 서브"): 표 위의 한 줄 요약, 표 아래의 "요약 · 그래프" 제목 */
.list-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 2px 0 8px; font-size: 14px; }
.list-sum .tag { font-size: 13px; }
.sub-head { margin: 22px 0 8px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 14px; font-weight: 600; color: var(--muted); }

/* 저장한 전표의 날짜 잠금 (2026-11-19): "날짜 옮기기"를 눌렀을 때만 전표의 날짜가 바뀐다 */
.date-move { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 8px; }
.date-move b { font-weight: 600; } .date-move b.warn { color: #fff; background: #c0392b; padding: 2px 8px; border-radius: 3px; }
input[type=date].moving { outline: 2px solid #c0392b; background: #fff1ef; }

/* 매입가 이하 발행 막기 (2026-11-19) */
.cost-list { margin: 10px 0; border: 1px solid #e6b8b2; border-radius: 4px; background: #fff6f5; }
.cost-row { padding: 8px 12px; border-bottom: 1px solid #f1d5d1; font-size: 14px; } .cost-row:last-child { border-bottom: 0; }
.cost-row .neg { color: #c0392b; } .cost-row strong { font-variant-numeric: tabular-nums; }
.cost-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* 읽어서 채운 전표의 확인 창 (2026-11-19) */
.aiv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.aiv-src { position: sticky; top: 0; max-height: 72vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: #f6f8fa; padding: 8px; }
.aiv-src img { display: block; width: 100%; height: auto; margin-bottom: 8px; border: 1px solid var(--line); background: #fff; }
.aiv-src pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 14px; }
.aiv-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.aiv-row input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.aiv-row:has(input:checked) { background: #eef8f1; border-color: #9bd0b0; }
.aiv-row.warn { border-color: #e6b8b2; background: #fff6f5; } .aiv-row.warn:has(input:checked) { background: #fff6f5; }
.aiv-main { min-width: 0; } .aiv-num { font-variant-numeric: tabular-nums; }
.aiv-warn { display: block; font-style: normal; font-size: 13px; font-weight: 700; color: #b23a2e; }
.aiv-total { margin: 10px 0; font-size: 15px; }
.aiv-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } .aiv-left { margin-right: auto; font-weight: 700; color: #b23a2e; }
@media (max-width: 760px) { .aiv { grid-template-columns: minmax(0, 1fr); } .aiv-src { position: static; max-height: 40vh; } }

/* 당일입력: 주문에 없는 품목 넣기 (2026-11-19) */
.dy-free { display: block; width: calc(100% - 20px); margin: 10px; padding: 9px 12px; border: 1px dashed #9aa7b4; border-radius: 4px; background: #fff; font: inherit; font-weight: 700; text-align: left; color: var(--brand); cursor: pointer; }
.dy-free:hover { background: var(--brand-l); border-color: var(--brand); } .dy-free small { display: block; font-weight: 400; color: var(--muted); }

/* "고칠 것" 띠 (2026-11-20, dayfix.js): 고칠 때까지 남는 목록 — 매입가 이하 · 0원 · 청구예정 · 겹친 주문 */
.dayfix { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #f1a9a0; border-left: 4px solid #d92d20; background: #fff8f7; border-radius: 6px; font-size: 13.5px; }
.dayfix[hidden] { display: none; }
.dayfix h3 { margin: 0 0 4px; font-size: 15px; color: #b42318; }
.dayfix-n { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: #d92d20; color: #fff; font-size: 13px; text-align: center; }
.dayfix h4 { margin: 10px 0 2px; font-size: 13.5px; color: #7a271a; } .dayfix h4 small { color: #b42318; }
.dayfix-hint { margin: 0 0 4px; font-size: 12.5px; color: #8a5a52; }
.dayfix-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #f6d9d5; }
.dayfix-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; } .dayfix-tail { font-size: 12.5px; color: #6b4a45; } .dayfix-tail .neg { color: #c0392b; }
.dayfix-row .btn { flex: none; white-space: nowrap; }

/* 품목 합치기 창 · 아래 막대 (2026-11-20) */
.bd-selsep { width: 1px; align-self: stretch; margin: 0 4px; background: var(--line); }
.mg-list { max-height: 34vh; }
.mg-row.on { background: var(--brand-l); }
.mg-row small { margin-left: 4px; }
.mg-keep { font-style: normal; font-size: 12px; font-weight: 700; color: var(--brand-d); }
.mg-note { margin: 10px 0; padding: 8px 12px; border-radius: 6px; background: #f6f8fa; font-size: 14px; line-height: 1.5; }
/* 품목 합치기: 규격이 다른 것을 남는 쪽의 어느 규격과 한 품목으로 할지 */
.mg-map { display: grid; gap: 6px; margin: 0 0 10px; font-size: 14px; }
.mg-map:empty { display: none; }
.mg-maprow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: center; }
.mg-maprow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-find { max-height: 30vh; }
button.mg-add { width: 100%; border: 0; border-bottom: 1px solid var(--line2); background: none; font: inherit; text-align: left; }
button.mg-add:hover { background: var(--brand-l); }

/* 마이너스 처리 (2026-11-22, screens-trade.js minusOpen · passOn): 마이너스 줄(값만 깎기 · 물건 빼기)은 빨간 줄, 고르는 창 · 거래처로 넘기는 창 */
.lines .line.minus { background: #fff6f5; box-shadow: inset 4px 0 0 #e5534b; }
.lines .line.minus .l-price, .lines .line.minus .l-amount, .lines .line.minus .l-qty { color: #b42318 !important; font-weight: 700; }
.mn { display: grid; gap: 12px; width: min(600px, 100%); }
.mn-lead { margin: 0; }
.mn-sec { display: grid; gap: 6px; min-width: 0; }
.mn-k { font-size: 13px; font-weight: 700; color: var(--muted); }
.mn-lines { display: grid; gap: 4px; max-height: 34vh; overflow-y: auto; }
.mn-line { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.mn-line.on { border-color: var(--brand); background: var(--brand-l); }
.mn-line small { color: var(--muted); font-variant-numeric: tabular-nums; }
.mn .seg { flex-wrap: wrap; overflow: visible; }
.mn-amtrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mn input.mn-amt { width: 170px; flex: none; height: 42px; font-size: 18px; font-weight: 700; }
.mn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-memo { height: 38px; width: 100%; }
.mn-preview { padding: 9px 12px; border-radius: 8px; background: #fff6f5; border: 1px solid #f1c4bd; color: #7a271a; font-size: 14px; line-height: 1.5; }
.pn { display: grid; gap: 10px; width: min(640px, 100%); }
.pn p { margin: 0; }
.pn-row { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pn-row.had { background: #fafafa; }
.pn-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; cursor: pointer; }
.pn-who small { color: var(--muted); font-variant-numeric: tabular-nums; }
.pn-how { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pn input.pn-amt { width: 120px; flex: none; height: 36px; font-weight: 700; }
.pn-memo { height: 36px; width: 100%; }
.pn-sum { color: #b42318; font-variant-numeric: tabular-nums; }
.pn-had { color: #9a3412; }
.sv-line.minus > b { color: #b42318; }
.sv-line .sv-why { color: #9a3412; }
.ck-item.added.minus { border-left-color: #e5534b; background: #fff6f5; }

/* 지난 거래 오류 추적: 예외 거래처 띠 · 매입가 줄의 상세 내역 (2026-11-25) */
.sameok { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sameok .picker { width: 180px; }
.sameok small { flex: 1 1 260px; }
.sameok-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 14px; background: var(--brand-l); font-size: 13px; font-weight: 600; }
.sameok-chip .icon-btn { width: 22px; height: 22px; font-size: 11px; }
.costd-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.costd-k { flex: 0 0 110px; color: var(--muted); font-size: 13px; }
.costd-v { flex: 1 1 auto; min-width: 0; line-height: 1.6; }
.costd-mate + .costd-mate { margin-top: 6px; }
.costd-calc { color: var(--muted); font-size: 13px; }
.costd-sum .costd-v { font-size: 15px; }
.costd-how { margin: 10px 0 0; font-size: 12.5px; }
@media (max-width: 560px) { .costd-row { flex-direction: column; gap: 2px; } .costd-k { flex: none; } }

/* 샘플 주문창의 알림 (share.js. 2026-11-26) */
.sv-demo { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e6c65c; border-radius: 10px; background: #fff8dc; color: #4a3b00; font-size: 15px; line-height: 1.55; }
.sv-demo b { display: block; margin-bottom: 2px; font-size: 16px; }
.sv-demo-say { margin: 0; white-space: pre-line; font-size: 16px; line-height: 1.6; }
