/* 한 표를 유지한 채 소계 오른쪽의 열만 교체한다. 13종 모두 오른쪽 절반 안에서 폭을 나눈다. */
table.bs-table { table-layout: fixed; min-width: 0; }
.bs-col-group { width: 8%; }
.bs-col-name { width: 18%; }
.bs-col-price { width: 8%; }
.bs-col-qty { width: 5%; }
.bs-col-total { width: 11%; }
.bs-col-right { width: calc(50% / var(--bs-cols)); }
table.bs-table[data-bs-face="0"] col:nth-child(6) { width: 15%; }
table.bs-table[data-bs-face="0"] col:nth-child(7) { width: 17%; }
table.bs-table[data-bs-face="0"] col:nth-child(8) { width: 13%; }
table.bs-table[data-bs-face="0"] col:nth-child(9) { width: 5%; }
table.bs-table tbody td { height: 42px; }
table.bs-table td[data-bs-right], table.bs-table th[data-bs-right] { padding: 4px; }
table.bs-table .bv-name-row { min-width: 0; }
table.bs-table .bv-name-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.bs-table textarea.bv-inline { max-height: 30px; overflow-y: auto; }
table.bs-table .bs-cell { text-align: center; }
.bs-cell > input[type="text"], .bs-cell > select, .bs-place > input, .bs-place > select {
  width: 100%; min-width: 0; max-width: 100%; height: 30px; padding: 3px;
  border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box;
  background: var(--card-bg); color: var(--text-primary); font: inherit;
}
.bs-cell input:focus, .bs-cell select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.bs-cell input[type="checkbox"], .bs-doc-head input[type="checkbox"], .bs-doc-menu input[type="checkbox"] {
  width: min(14px, 100%); max-width: 100%; height: 14px; min-width: 0; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--accent);
}
table.bs-table[data-bs-face="3"] td.bs-cell { padding-inline: 1px; }
.bs-check-hit { display: flex; align-items: center; justify-content: center; min-width: 0; width: 100%; min-height: 30px; cursor: pointer; }
.bs-doc-head input[type="checkbox"] { flex: 0 1 14px; }
.bs-place { display: flex; min-width: 0; }
.bs-place > input { flex: 1; border-radius: 4px 0 0 4px; }
.bs-place > select { flex: 0 0 20px; padding: 0; border-left: 0; border-radius: 0 4px 4px 0; }
.bs-add, .bs-count, .bs-dates, .bs-random, .bs-delete, .bs-modal-head > button {
  border: 1px solid var(--border); border-radius: 4px; background: var(--card-bg);
  color: var(--text-primary); font: inherit; padding: 3px 5px; cursor: pointer;
}
.bs-add, .bs-dates { max-width: 100%; white-space: nowrap; }
.bs-add { font-size: .75rem; }
.bs-attach-tools { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bs-attach-tools > .bs-add { flex: 0 1 auto; min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.bs-deck { display: flex; align-items: center; justify-content: flex-start; flex: 1 1 0;
  min-width: 0; height: 30px; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--text-secondary); }
.bs-deck:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bs-thumb-strip { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.bs-thumb { position: relative; flex: 0 0 28px; width: 28px; height: 28px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 4px; background: var(--card-bg); z-index: calc(4 - var(--i)); }
.bs-thumb + .bs-thumb { margin-left: -20px; }
.bs-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 3px; }
.bs-deck-count { flex: 0 0 auto; padding-left: 3px; font-size: .65rem; white-space: nowrap; }
.bs-random { display: block; margin: 3px auto 0; padding: 2px 4px; font-size: .7rem; white-space: nowrap; }
.bs-delete { color: var(--danger-text); }
.bs-muted { color: var(--text-secondary); font-size: .78rem; }
.bs-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.bs-face-label { font-size: .8rem; color: var(--text-secondary); }
.bs-save-status { font-size: .75rem; color: var(--text-secondary); }
.bs-doc-picker { position: relative; }
.bs-doc-picker > summary { cursor: pointer; padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; font-size: .8rem; background: var(--card-bg); }
.bs-doc-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 100;
  width: max-content; max-width: calc(100vw - 32px); max-height: 50vh; overflow-y: auto;
  display: grid; gap: 2px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--card-bg); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.bs-doc-menu label { display: flex; align-items: center; gap: 8px; padding: 5px; cursor: pointer; font-size: .8rem; }
.bs-doc-menu label:hover { background: var(--surface-muted); }
table.bs-table th.bs-doc-head { padding: 4px 1px; vertical-align: bottom; }
.bs-doc-head > span { display: block; font-size: .7rem; line-height: 1.3; overflow-wrap: anywhere; margin-bottom: 4px; }
.bs-doc-head > label { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 4px; cursor: pointer; min-width: 0; }
.bs-doc-head small { font-size: .6rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-output { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 12px 0; }
.bs-output > label { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.bs-output select { max-width: 220px; background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; padding: 5px; }
.bs-turning [data-bs-right] { visibility: hidden; }
.bs-scene { position: absolute; perspective: 1600px; z-index: 90; pointer-events: none; }
.bs-prism { width: 100%; height: 100%; transform-style: preserve-3d; }
.bs-prism-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; background: var(--card-bg); }
.bs-prism-front { transform: translateZ(var(--bs-depth)); }
.bs-prism-next { transform: rotateY(90deg) translateZ(var(--bs-depth)); }
.bs-dialog { width: min(700px, calc(100vw - 24px)); max-width: calc(100vw - 24px); display: flex; flex-direction: column; }
.bs-dialog-wide { width: min(1180px, calc(100vw - 24px)); }
.bs-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.bs-modal-head h3 { margin: 0; font-size: 1rem; }
.bs-modal-head > button { font-size: 1.2rem; }
.bs-modal-body { padding: 16px 0; overflow: auto; min-height: 0; max-height: 72vh; }
.bs-modal-body section { margin-bottom: 16px; }
.bs-modal-body h4 { margin: 0 0 8px; font-size: .9rem; }
.bs-date-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.bs-date-fields label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.bs-date-fields input, .bs-note-label textarea { background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border); border-radius: 4px; padding: 6px; font: inherit; }
.bs-date-fields input.bs-manual-date { border-color: var(--accent); }
.bs-note-label { display: grid; gap: 6px; font-size: .85rem; }
.bs-attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-attachment { display: flex; align-items: center; gap: 6px; max-width: 100%; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 4px; padding: 5px; }
.bs-attachment img { width: 40px; height: 40px; object-fit: cover; display: block; }
.bs-attachment a { color: var(--text-primary); font-size: .8rem; overflow-wrap: anywhere; }
.bs-original-download { color: var(--text-secondary); font-size: .75rem; font-weight: 400; margin-left: 6px; }
.bs-misc-bundle { border: 1px solid var(--border); border-radius: 4px; padding: 8px; margin-bottom: 8px; }
.bs-misc-bundle > label { font-size: .85rem; margin-right: 8px; }
.bs-misc-bundle .bs-attachment-list { margin-top: 8px; }
.bs-frame { width: 100%; height: 68vh; border: 0; background: var(--card-bg); }
.bs-blank-links { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-finding { font-size: .85rem; margin: 6px 0; }
.bs-error { color: var(--danger-text); }
