/* YUMOLD ERP — PC(사이드 메뉴) / 휴대폰(밀어서 여는 메뉴), A4 인쇄 양식 */
/* 🎨 디자인 1단계 (11-28 대표님 시안 "이대로"): 회사 남색 #0B2D4F · 바탕 #F4F6F9 · 주의·선택 #E8912D(--accent, 글자에는 진한 --amber) · 완료 #1E6B3C. 색은 상태에만 */
:root {
  --brand: #0B2D4F; --brand2: #0B2D4F; --brand-hover: #0B2D4F; --accent: #E8912D; --bg: #E6EBF1; --card: #fff; --line: #E6EBF1; --text: #0B2D4F; --muted: #5f6a7a; /* V2.4.1: 대비 4.5:1 이상 (예전 #6b7686 = 배경 위 4.2) */
  --line2: #eef0f3; --label: #0B2D4F; --thbg: #f7f8fa; --grpbg: #E6EBF1; --hover: #f4f7fb;
  --sans: "IBM Plex Sans KR", "IBM Plex Sans", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Noto Sans KR", "Noto Sans Thai", sans-serif; /* 🎨 1단계: 한국어 = Plex Sans KR, 베트남어 성조 = Plex Sans, 태국어 = Plex Sans Thai (글꼴 파일은 NAS web/fonts) */
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --green: #1E6B3C; --amber: #9A4B07; --red: #c0392b; --blue: #0B2D4F; --radius: 3px; --tap: 44px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--brand2); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
textarea { min-height: 70px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #f4f5f7; color: #555; }
input:focus, select:focus, textarea:focus { outline: 2px solid #E8912D; border-color: var(--brand2); }
/* 안전 다지기 11-27: 키보드(Tab)로 옮길 때 지금 어디인지 보이게 — 버튼·링크·메뉴·표 줄. 마우스로 누를 때는 안 보임 */
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--brand2); outline-offset: 2px; border-radius: 3px; }
html[data-theme="dark"] button:focus-visible, html[data-theme="dark"] a:focus-visible, html[data-theme="dark"] summary:focus-visible, html[data-theme="dark"] [tabindex]:focus-visible { outline-color: #8ab8ff; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.mono-ish { font-family: ui-monospace, Consolas, "Malgun Gothic", monospace; font-size: 13.5px; }
.pre { white-space: pre-wrap; }
.warn { color: var(--amber); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 8px 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); cursor: pointer; white-space: nowrap; color: var(--text); }
.btn:hover { background: #E6EBF1; }
.btn.primary { background: var(--brand2); border-color: var(--brand2); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--red); border-color: #f0c4bf; }
.btn.small { min-height: 36px; padding: 5px 10px; font-size: 13.5px; }
.btn.icon { min-width: 36px; padding: 5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent; font-size: 20px; cursor: pointer; border-radius: 3px; }
.link { border: 0; background: none; color: var(--brand2); cursor: pointer; padding: 6px 0; text-align: left; min-height: 36px; }

/* 틀 */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 12px; background: var(--brand); color: #fff; }
.topbar .icon-btn { color: #fff; }
.brand { color: #fff; font-size: 18px; letter-spacing: .3px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ent-chip { background: rgba(255,255,255,.18); padding: 3px 9px; border-radius: 3px; font-size: 13px; }
.lang-select { width: auto; min-height: 36px; padding: 4px 6px; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.lang-select option { color: #000; }
.user-chip { color: #fff; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; padding: 8px 0; }
.body { display: flex; flex: 1; }
.nav { width: var(--nav-w, 220px); flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 10px 8px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 12px; border-radius: 3px; color: var(--text); }
.nav-item:hover { background: #E6EBF1; }
.nav-item.active { background: #E6EBF1; color: var(--brand); font-weight: 600; }
.nav-icon { width: 22px; text-align: center; }
/* ⭐ 즐겨찾기 · 폭 조절 (2026-11-01) */
.nav-row { display: flex; align-items: center; position: relative; }
.nav-row .nav-item { flex: 1; min-width: 0; }
.nav-row .nav-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-star { flex: none; width: 30px; height: 30px; border: 0; background: none; color: #b0b7c3; font-size: 16px; cursor: pointer; border-radius: 3px; opacity: 0; padding: 0; }
.nav-row:hover .nav-star, .nav-star:focus-visible, .nav-star.on { opacity: 1; }
.nav-star.on { color: #9A4B07; }
.nav-row:not(.fav) .nav-star.on { opacity: .55; }
.nav-row:hover .nav-star.on { opacity: 1; }
.nav-grip { flex: none; width: 18px; text-align: center; color: #9aa3b0; cursor: grab; touch-action: none; user-select: none; font-size: 14px; }
.nav-row.dragging { opacity: .6; background: #E6EBF1; border-radius: 3px; }
.nav-favs { border-bottom: 1px solid var(--line); margin-bottom: 6px; padding-bottom: 6px; }
.nav-fav-head { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 10px; }
.nav-fav-hint { padding: 2px 10px 8px; font-size: 12px; }
.nav-resize { flex: none; width: 6px; margin-left: -3px; cursor: col-resize; position: sticky; top: 56px; height: calc(100vh - 56px); z-index: 5; touch-action: none; }
.nav-resize:hover, body.nav-resizing .nav-resize { background: #C9D2DE; }
body.nav-resizing { cursor: col-resize; user-select: none; }
@media (hover: none) { .nav-star { opacity: .5; } .nav-star.on { opacity: 1; } }
.main { flex: 1; min-width: 0; padding: 18px 24px 90px; max-width: 1600px; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; } /* 설계 50: PC 에서도 ☰ (펼침→아이콘만→닫힘) */
.scrim { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .nav { position: fixed; left: 0; top: 56px; bottom: 0; z-index: 40; height: auto; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); width: 250px; }
  body.menu-open .nav { transform: none; }
  .nav-resize { display: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.3); z-index: 35; }
  .main { padding: 14px 12px 90px; }
  .user-chip { display: none; }
  .brand { font-size: 16px; }
}

/* 카드 · 목록 */
.stack > * + * { margin-top: 14px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.page-title { font-size: 22px; }
.title-sub { font-size: 16px; font-weight: 400; }
.back { display: inline-block; padding: 6px 0; min-height: 36px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 16px; }
.card-title { font-size: 16px; margin-bottom: 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; cursor: pointer; color: var(--text); min-height: 60px; }
.row-card:hover { border-color: #C9D2DE; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 3px; }
.empty.err { color: var(--red); }
.loading { padding: 30px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 12.5px; background: #E6EBF1; color: var(--label); white-space: nowrap; }
.badge.green { background: #DDEFE3; color: var(--green); }
.badge.amber { background: #FBEBDC; color: var(--amber); }
.badge.red { background: #fde4e1; color: var(--red); }
.badge.blue { background: #E6EBF1; color: var(--blue); }
.badge.gray { background: #E6EBF1; color: #5d6775; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); cursor: pointer; font-size: 13.5px; color: var(--text); display: inline-flex; align-items: center; }
.chip.active { background: var(--brand2); color: #fff; border-color: var(--brand2); }
.chip.small { min-height: 30px; padding: 2px 10px; font-size: 12.5px; }
code.chip { font-family: ui-monospace, Consolas, monospace; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters > * { flex: 1 1 160px; }
.filters .check { flex: 0 0 auto; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions.wrap { flex-wrap: wrap; margin-top: 12px; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 10px 0; background: var(--bg 30%); z-index: 5; }
.alert { padding: 10px 14px; border-radius: 3px; border: 1px solid; }
.alert.info { background: var(--grpbg); border-color: #C9D2DE; }
.alert.warn { background: #FBEBDC; border-color: #F6C89A; margin-top: 8px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* 폼 */
.form > * + * { margin-top: 10px; }
.field { display: block; }
.field + .field { margin-top: 10px; }
.field-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; color: var(--label); }
.field-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.field-err { color: var(--red); font-size: 13px; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid2 .field + .field { margin-top: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 .field + .field { margin-top: 0; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; min-height: var(--tap); cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; }
.check.disabled { color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.checklist { padding: 12px 14px; border-radius: 3px; }
.checklist.warn { background: #FBEBDC; border: 1px solid #F6C89A; }
.checklist.ok { background: #DDEFE3; border: 1px solid #8FC9A3; color: var(--green); }
.checklist ul { margin: 6px 0 0; padding-left: 20px; }

/* 탭 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; }
.tab { min-height: var(--tap); padding: 8px 14px; border: 0; background: none; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; color: var(--muted); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand2); font-weight: 600; }
.tab-body { margin-top: 14px; }

/* 대화상자 */
.modal-back { position: fixed; inset: 0; background: rgba(15,25,40,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal { background: var(--card); border-radius: 3px; width: 100%; max-width: 520px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 14px 16px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) { .modal-back { align-items: flex-end; padding: 0; } .modal { border-radius: 3px 3px 0 0; max-height: 92vh; } }
#toasts { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; width: max-content; max-width: 92vw; } /* 위쪽: 휴대폰 아래쪽 확인 버튼을 가리지 않게 */
.toast { background: #0B2D4F; color: #fff; padding: 10px 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); transition: opacity .4s; }
.toast.err { background: var(--red); }
.toast.hide { opacity: 0; }
.busy-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: #E8912D; z-index: 300; transition: width .3s; }
body.busy .busy-bar { width: 70%; transition: width 3s; }

/* 로그인 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--brand); }
.login-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 3px; padding: 22px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.login-brand { font-size: 24px; text-align: center; margin-bottom: 12px; color: var(--brand); }
.login-card .tabs { margin-bottom: 14px; }
.login-card .tab { flex: 1; }
.login-lang { margin-top: 14px; }

/* 홈 */
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); min-height: 52px; }
.todo-item.warn { border-color: #F6C89A; background: #fffaf0; }
.todo-icon { font-size: 18px; }
.chev { margin-left: auto; color: var(--muted); font-size: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); }
.stat-num { font-size: 24px; font-weight: 700; }

/* 계약 상세 */
.head-card .head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.head-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 12px 0 0; font-size: 14px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .info { grid-template-columns: 1fr; } .info dt { margin-top: 6px; } }
details.more { position: relative; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 210px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.more-menu .btn { justify-content: flex-start; border-color: transparent; }
@media (max-width: 640px) { .more-menu { left: 0; right: auto; } }
.clause { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; }
.clause.off { opacity: .6; }
.clause.is-changed { border-left: 4px solid #E8912D; }
.clause-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.clause-title { font-weight: 600; }
.clause-no { color: var(--brand2); }
.clause-no.off { color: var(--muted); }
.clause-badges { display: flex; gap: 4px; }
.clause-body { margin-top: 8px; }
.clause-body p { margin: 0 0 4px; }
.clause-lang + .clause-lang { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.clause-ltitle { font-weight: 600; font-size: 14px; }
.lang-tag { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: #7a8796; border-radius: 3px; padding: 0 6px; margin-bottom: 4px; }
.clause-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef0f3; }
.ph { background: #E6EBF1; color: var(--brand); border-radius: 3px; padding: 0 4px; font-weight: 600; }
.ph.missing { background: #fde4e1; color: var(--red); }
.ph.block { display: inline-block; padding: 4px 8px; }
.fold { margin-top: 8px; }
.fold > summary { cursor: pointer; color: var(--brand2); min-height: 36px; display: flex; align-items: center; gap: 6px; }
.fold .count { background: #E6EBF1; border-radius: 3px; padding: 0 8px; font-size: 12px; color: #444; }
.diff { white-space: pre-wrap; font-size: 14px; background: #fafbfc; border: 1px solid #eef0f3; border-radius: 3px; padding: 8px; margin-top: 4px; }
ins { background: #DDEFE3; color: #0f5a26; text-decoration: none; }
del { background: #fde4e1; color: #8c2318; }
.removed { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.lang-block { border: 1px solid #eef0f3; border-radius: 3px; padding: 10px; }
.lang-block + .lang-block { margin-top: 10px; }
.party-label { font-weight: 700; margin-bottom: 6px; }
.party-pick { display: flex; flex-direction: column; gap: 6px; }
.item-row, .pay-row { border: 1px solid #eef0f3; border-radius: 3px; padding: 10px; margin-bottom: 8px; }
.item-nums { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; align-items: end; }
.item-nums .field + .field { margin-top: 0; }
@media (max-width: 640px) { .item-nums { grid-template-columns: 1fr 1fr; } }
.totals { font-weight: 600; margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid #C9D2DE; padding: 4px 0 12px 14px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: var(--brand2); }
.tl-reason { font-size: 14px; background: #FBEBDC; border-radius: 3px; padding: 4px 8px; margin-top: 4px; display: inline-block; }
.tl-change { margin-top: 6px; }
.files, .comments { list-style: none; margin: 0 0 10px; padding: 0; }
.files li, .comments li { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.files li.voided { opacity: .55; text-decoration: line-through; }
.comment-box { display: flex; gap: 8px; align-items: flex-end; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td { border-bottom: 1px solid var(--line2); padding: 6px; }

/* 법인 */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.asset { border: 1px solid var(--line); border-radius: 3px; padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.asset-name { font-weight: 600; }
.asset-img { width: 100%; height: 90px; display: flex; align-items: center; justify-content: center; background: var(--thbg); border-radius: 3px; color: var(--muted); font-size: 13px; }
.asset-img img { max-width: 100%; max-height: 86px; }

/* 거래처 일괄 */
.bulk-row { display: grid; grid-template-columns: 1fr 220px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.bulk-name { font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .bulk-row { grid-template-columns: 1fr; } }
.field-table { display: flex; flex-direction: column; gap: 6px; }
.ft-row { display: grid; grid-template-columns: 1.2fr .8fr .8fr 1fr 1fr 1fr auto; gap: 6px; }
@media (max-width: 860px) { .ft-row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line2); } }

/* 인쇄 화면 (A4) */
.print-wrap { min-height: 100vh; background: #e9ecf1; padding-bottom: 40px; }
.print-bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.print-bar select { width: auto; }
.print-doc { font-weight: 600; }
.print-tip { text-align: center; margin: 8px; }
.a4 { width: 210mm; min-height: 297mm; margin: 12px auto; background: #fff; padding: 18mm 18mm; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); font: 10.5pt/1.45 "Times New Roman", "Malgun Gothic", serif; color: #000; }
@media (max-width: 860px) { .a4 { width: auto; min-height: 0; margin: 8px; padding: 14px; } }
.a4 .dp { margin: 0; }
.a4 .dp.changed { background: #fff3cd; }
.a4 .watermark { font-family: system-ui, sans-serif; letter-spacing: 2px; }
.a4 mark.missing { background: #fde4e1; color: var(--red); }
.dtable { width: 100%; border-collapse: collapse; margin: 4pt 0 8pt; table-layout: fixed; }
.dtable td { border: 1px solid #888; padding: 3pt 5pt; vertical-align: top; overflow-wrap: anywhere; }
.dtable.noborder td { border: 0; }
.dtable td .dp { margin-bottom: 0 !important; }
.dimg { display: inline-block; }
@media print {
  @page { size: A4; margin: 16mm; }
  body { background: #fff; }
  .no-print, .print-bar, .print-tip, #toasts, .busy-bar { display: none !important; }
  .print-wrap { background: #fff; padding: 0; }
  .a4 { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .a4 .dp.changed { background: none; }
  .a4 mark.missing { background: none; color: #000; }
  .dtable tr { break-inside: avoid; }
}

/* ===== 1단계: 발주 · 제품 · 재고 · 일정 · 규격서 ===== */
.row-card.static { cursor: default; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty { font-weight: 700; font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qty.neg { color: var(--red); }
.check-card { cursor: pointer; }
.check-card input { width: 22px; height: 22px; min-height: 0; flex: none; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.issues { margin: 6px 0 0; padding-left: 18px; }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line-row { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; }
.line-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line-head .btn { margin-left: auto; }
.line-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.line-fields .field + .field { margin-top: 0; }
@media (max-width: 640px) { .line-fields { grid-template-columns: 1fr 1fr; } }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); cursor: pointer; font-size: 14px; color: var(--text); }
.seg-btn.on { background: var(--brand2); border-color: var(--brand2); color: #fff; font-weight: 600; }
.seg-btn:disabled { opacity: .7; cursor: default; }
.seg-btn.on:disabled { opacity: 1; }
.dims { display: flex; align-items: center; gap: 6px; }
.dims input { min-width: 0; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.spec-grid .field + .field { margin-top: 0; }
@media (max-width: 760px) { .spec-grid { grid-template-columns: 1fr; } }
.gate-row { display: grid; grid-template-columns: 70px 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stages li { border: 1px solid var(--line); border-radius: 3px; padding: 8px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.stages li.done { background: #DDEFE3; border-color: #8FC9A3; }
.stage-name { font-weight: 600; font-size: 14px; }
@media (max-width: 640px) { .stages { grid-template-columns: 1fr 1fr; } }
.table-wrap { overflow-x: auto; }
.tbl th { text-align: left; font-size: 13px; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl.board td.num { text-align: center; color: #b8c0cc; }
.tbl.board td.num.has { font-weight: 700; color: var(--text); }
.tbl.board td a { display: inline-block; min-width: 36px; min-height: 36px; line-height: 36px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 4px; }
.lg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.lg i.late-i { background: repeating-linear-gradient(45deg, #c0392b, #c0392b 3px, #f6c2bc 3px, #f6c2bc 6px); }
.sch-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ev { display: block; font-size: 12.5px; padding: 3px 6px; margin: 3px 0; background: #f6f8fb; border-left: 4px solid #999; border-radius: 3px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 26px; }
.day .day-head, .week-day .day-head { font-weight: 700; margin-bottom: 4px; }
.day.today, .week-day.today, .cal-cell.today { border-color: var(--brand2); box-shadow: inset 0 0 0 1px var(--brand2); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 12.5px; color: var(--muted); }
.cal-cell { min-height: 92px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 4px; overflow: hidden; }
.cal-cell.other { opacity: .5; }
.cal-day { font-size: 12px; color: var(--muted); }
.cal-cell .ev { font-size: 11px; padding: 2px 4px; min-height: 0; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 6px; min-height: 140px; }
@media (max-width: 760px) { .week { grid-template-columns: 1fr; } .week-day { min-height: 0; } .cal-cell { min-height: 64px; } .cal-cell .ev { font-size: 10px; } }
.gantt { background: var(--card); border: 1px solid var(--line); border-radius: 3px; overflow-x: auto; }
.g-head, .g-row { display: grid; grid-template-columns: 180px minmax(480px, 1fr); align-items: center; border-bottom: 1px solid var(--line2); min-height: 40px; color: var(--text); }
.g-label { padding: 4px 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { position: relative; height: 30px; }
.g-tick { position: absolute; top: 6px; font-size: 11px; color: var(--muted); border-left: 1px solid #E6EBF1; padding-left: 3px; height: 24px; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand2); }
.g-bar { position: absolute; top: 8px; height: 14px; border-radius: 3px; background: #C9D2DE; }
.g-bar.s-received { background: #8FC9A3; }
.g-bar.s-shipped { background: #E8912D; }
.g-bar.s-draft, .g-bar.s-hub_review, .g-bar.s-hq_review { background: #c9ced6; }
.g-bar.late { background: repeating-linear-gradient(45deg, #c0392b, #c0392b 4px, #f6c2bc 4px, #f6c2bc 8px); }
.g-due { position: absolute; top: 4px; width: 3px; height: 22px; background: #c0392b; border-radius: 2px; }
.spec-print .dtable td.lbl { width: 42%; background: #f4f6f9; font-size: 9pt; }
.spec-print .dtable td.sec { background: #dfe7f2; font-weight: 700; }
.spec-print .opt { margin-right: 10px; white-space: nowrap; color: #999; }
.spec-print .opt.on { color: #000; font-weight: 700; }
.spec-print .sign td { height: 34px; text-align: center; white-space: pre-line; }

/* 자금 */
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.num, .price, .qty { font-family: var(--mono); } /* 🎨 1단계: 숫자는 고정폭 */
.tbl .in, .qty.in { color: var(--green, #1E6B3C); }
.tbl .out, .qty.out { color: var(--red, #c62828); }
.tbl td.warn, .small.warn { color: var(--red, #c62828); }
.tbl tr.total td, .tbl tr.total th { border-top: 2px solid var(--line); font-weight: 700; }
.tbl tr.sub td, .tbl tr.sub th { background: var(--thbg); font-weight: 600; }
.tbl tr.grp th { background: var(--grpbg); color: var(--text); }
.tbl.cash input { width: 130px; min-height: 36px; text-align: right; }
.tbl.monthly th:first-child { position: sticky; left: 0; background: var(--card); }
.close-state { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.row-card.voided { opacity: .55; }
.row-card.voided .qty { text-decoration: line-through; }
.actions.wrap { flex-wrap: wrap; }
@media print { .no-print, .tabs, .topbar, .nav { display: none !important; } }
.bal-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bal-card { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; display: grid; gap: 8px; }
.bal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.bal-cell { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.bal-cell.in b { color: var(--green, #1E6B3C); } .bal-cell.out b { color: var(--red, #c62828); }
.bal-cell.closing b { font-size: 17px; }
.bal-total { grid-column: 1 / -1; display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; background: var(--thbg); border-radius: 3px; }
.tbl th.cur { color: var(--brand2); }
.tbl tr.grp td { background: var(--grpbg); }

/* 자금일보 경고 띠 (모든 화면 위) */
.alert-bar:empty { display: none; }
.alert-bar { display: grid; gap: 6px; margin-bottom: 12px; }
.alert-line { display: block; padding: 10px 14px; min-height: 40px; border-radius: 3px; font-weight: 600; text-decoration: none; border: 1px solid; }
.alert-line.late { background: #fdecec; border-color: #f3b4b4; color: #9b1c1c; }
.alert-line.soon { background: #FBEBDC; border-color: #F6C89A; color: #7a4b00; }
.alert-line.more { background: var(--thbg); border-color: var(--line); color: var(--text); font-weight: 400; }
.duty-line { margin-top: 0; }
/* 자금일보 달력 */
.cash-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cash-cal .cal-wd { text-align: center; font-size: 12px; color: var(--muted); }
.cal-cell { min-height: 48px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; cursor: pointer; font: inherit; }
.cal-cell.blank { border: 0; background: transparent; cursor: default; }
.cal-cell .cal-d { font-size: 13px; }
.cal-cell .cal-i { font-size: 12px; line-height: 1; min-height: 12px; }
.cal-cell.st-off { background: #f3f4f6; color: #9aa3ae; }
.cal-cell.st-missing, .cal-cell.st-overdue { background: #fdecec; }
.cal-cell.st-approved { background: #DDEFE3; }
.cal-cell.nochg { background: #f1f2f4; color: #6b7280; } /* ☑ 변동 없음 (설계 55 4-3) */
.cal-cell.sel { outline: 2px solid var(--brand2); }
.cal-cell.today .cal-d { font-weight: 700; color: var(--brand2); }
.deadline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.sub-title { font-size: 15px; margin: 12px 0 4px; }
/* 월별 보고 큰 분류 */
.tbl th.indent { padding-left: 18px; font-weight: 400; }
.tbl tr.gsub td, .tbl tr.gsub th { font-weight: 600; background: var(--thbg); }
/* 설정: 분류 편집 */
.cat-edit { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.cat-group { border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; display: grid; gap: 6px; }
.cat-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-row input[type=text] { flex: 1 1 140px; min-height: 36px; }
.cat-row.hidden-cat input[type=text] { opacity: .5; text-decoration: line-through; }
.cal-cell.st-before { background: var(--thbg); color: #b8c0cc; }
.deadline-grid { align-items: end; }
.deadline-grid .field { margin: 0; }
.stale-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; background: var(--brand2, #0B2D4F); color: #fff; border: 0; border-radius: 3px; padding: 12px 18px; min-height: 44px; font: inherit; font-weight: 600; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); cursor: pointer; }

/* 3단계: 견적·수주 판매 줄, 합계, 결제 조건, 미수금, 양식 편집 */
.line-fields.sales { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; align-items: end; }
.line-fields.sales .field + .field { margin-top: 0; }
.disc-in { display: flex; gap: 4px; }
.disc-in input { flex: 1 1 60px; min-width: 0; }
.disc-in select { flex: 0 0 64px; }
.line-total .line-amt { display: block; min-height: 40px; line-height: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.free-name { flex: 1 1 200px; min-height: 36px; }
.line-note { width: 100%; margin-top: 6px; min-height: 36px; }
.price-hist { margin-top: 4px; }
.sales-totals { margin-top: 12px; margin-left: auto; max-width: 420px; display: grid; gap: 4px; }
.tot-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.tot-row input { width: 140px; min-height: 36px; text-align: right; }
.tot-row.b { font-weight: 600; }
.tot-row.total { font-weight: 700; font-size: 17px; border-top: 2px solid var(--line); padding-top: 6px; }
.tot-row.warn { color: var(--red, #c62828); }
.payterms { display: grid; gap: 6px; }
.pt-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pt-row > input[type=text] { flex: 1 1 140px; min-height: 36px; }
.pt-pct input { width: 64px; min-height: 36px; }
.pt-row select { min-height: 36px; }
.pt-days input { width: 64px; min-height: 36px; margin: 0 4px; }
.aging { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.age { font-size: 12px; padding: 2px 8px; border-radius: 3px; background: #E6EBF1; }
.age-d30 { background: #FBEBDC; } .age-d60 { background: #F6C89A; } .age-d90, .age-d90p { background: #fdd; color: #9b1c1c; }
.row-card.done { opacity: .7; }
.lab4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.lab4 input { min-height: 36px; }
.tpl-field { border: 1px solid var(--line); border-radius: 3px; padding: 8px; display: grid; gap: 6px; }
.tpl-field-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.tpl-field-head select { min-height: 36px; width: auto; }
.bizdoc .dtable td { font-size: 9.5pt; }
.qty-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.qty-row.alloc { grid-template-columns: 1fr 120px auto; }
.qty-row input { min-height: 40px; width: 100%; }
.a4.bizdoc.fit { width: 210mm; min-height: 0; padding: 14mm; margin: 8px; }
@media print { .a4.bizdoc { zoom: 1 !important; width: auto !important; } }
#toasts, .toast { pointer-events: none; } /* 알림이 버튼을 가려도 아래 버튼이 눌린다 */

.photo-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.photo-list .chip { min-height: 36px; }

.dup-group { display: grid; gap: 6px; padding: 10px; }
.dup-row { align-items: flex-start; min-height: 44px; }
.page-head .actions { flex-wrap: wrap; justify-content: flex-end; }

/* ===== 견적서 전용 틀 (Odoo 모양, modules/sales/quotedoc.js) =====
   화면 폭 = 인쇄 내용 폭(210 - 12×2 mm)이어야 아래 고정 계산이 맞다 */
.a4.qd, .a4.qd.fit { width: 210mm; min-height: 297mm; padding: 10mm 12mm 8mm; font: 9.5pt/1.4 Arial, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; position: relative; display: flex; flex-direction: column; }
.qd { page: quote; }
.qd-probe { position: absolute; visibility: hidden; width: 1px; height: 100mm; left: 0; top: 0; }
.qd-frame { width: 100%; border-collapse: collapse; }
.qd-frame > thead > tr > td, .qd-frame > tbody > tr > td { padding: 0; vertical-align: top; }
.qd-head { padding-bottom: 4mm; }
.qd-logo-img { height: 18mm; width: auto; max-width: 80mm; display: block; margin-bottom: 2mm; }
.qd-coname { font-size: 14pt; }
.qd-addr { font-size: 8.5pt; color: #333; }
.qd-cust { margin-left: 40%; font-size: 9.5pt; padding: 2mm 0 4mm; } /* 넓게: 주소가 한 줄로 */
.qd-draft { color: #c0392b; font-weight: 700; text-align: right; }
.qd-title { color: #0B2D4F; font-size: 18pt; font-weight: 700; margin: 0 0 1mm; }
.qd-title2 { color: #0B2D4F; font-size: 10pt; margin-bottom: 1mm; }
.qd-info { display: flex; flex-wrap: wrap; gap: 2mm 14mm; margin: 4mm 0 6mm; }
.qd-info > div { display: flex; flex-direction: column; min-width: 30mm; }
.qd-info b { font-size: 9pt; }
.qd-items { width: 100%; border-collapse: collapse; table-layout: fixed; }
.qd-items th { font-size: 8.5pt; text-transform: uppercase; padding: 2mm 1.5mm; border-top: 1.5pt solid #000; border-bottom: 1.5pt solid #000; }
.qd-items td { padding: 2mm 1.5mm; border-bottom: 0.5pt solid #ddd; vertical-align: top; overflow-wrap: anywhere; }
.qd-items tr { break-inside: avoid; }
.qd-tbl-title { margin: 5mm 0 1.2mm; font-weight: 700; font-size: 9.5pt; color: #0B2D4F; break-after: avoid; }
.qd-tbl-title + .qd-items { margin-top: 0; }
.qd-items + .qd-items, .qd-items + .qd-tbl-title { margin-top: 4mm; }
.qd-sub { font-size: 8.5pt; color: #555; }
.qd-small { font-size: 8.5pt; color: #333; margin-top: 4mm; }
.qd-small p { margin: 0 0 2mm; }
.qd-bottom { break-inside: avoid; padding-top: 3mm; }
.qd-totals { margin-left: auto; width: 46%; border-collapse: collapse; }
.qd-totals td { padding: 1.5mm 1.5mm; border-top: 0.5pt solid #ccc; text-align: right; }
.qd-totals td:first-child { text-align: left; font-weight: 700; }
.qd-totals tr.qd-total td { color: #0B2D4F; font-weight: 700; font-size: 11pt; border-top: 1pt solid #000; }
.qd-words { text-align: right; font-size: 8.5pt; color: #333; margin-top: 1mm; }
.qd-sign { width: 60mm; text-align: center; margin-top: 2mm; }
.qd-stampbox { position: relative; height: 28mm; }
.qd-stampbox.qd-nostamp { height: 6mm; }
.qd-stamp { position: absolute; left: 50%; top: 0; transform: translateX(-50%); height: 28mm; width: auto; opacity: .92; }
.qd-signature { position: absolute; left: 50%; top: 4mm; transform: translateX(-45%); height: 20mm; width: auto; max-width: 55mm; }
.qd-signer { font-size: 9.5pt; margin-top: 1mm; }
.qd-blue { color: #0B2D4F; }
.qd-foot-screen { margin-top: auto; padding-top: 3mm; border-top: 0.5pt solid #ccc; display: grid; gap: 1mm; font-size: 8pt; color: #444; }
.qd-foot-row { display: flex; gap: 10mm; }
/* 📄 A4 한 장 맞춤 (V2.5.2, quotedoc.js fitOnePage): 조금 넘칠 때만 단계로 줄임 — c1 여백 · c2 머리 부분+글자 9pt · c3 글자 8.5pt (가장 작은 글자 8pt) */
.qd.qd-c1 .qd-items td, .qd.qd-c2 .qd-items td { padding: 1.2mm 1.5mm; }
.qd.qd-c1 .qd-items th, .qd.qd-c2 .qd-items th, .qd.qd-c3 .qd-items th { padding: 1.4mm 1.5mm; }
.qd.qd-c1 .qd-info, .qd.qd-c2 .qd-info, .qd.qd-c3 .qd-info { margin: 2.5mm 0 3mm; gap: 1.5mm 14mm; }
.qd.qd-c1 .qd-cust, .qd.qd-c2 .qd-cust, .qd.qd-c3 .qd-cust { padding: 1mm 0 2mm; }
.qd.qd-c1 .qd-head, .qd.qd-c2 .qd-head, .qd.qd-c3 .qd-head { padding-bottom: 2mm; }
.qd.qd-c1 .qd-small, .qd.qd-c2 .qd-small, .qd.qd-c3 .qd-small { margin-top: 2.5mm; }
.qd.qd-c1 .qd-bottom, .qd.qd-c2 .qd-bottom, .qd.qd-c3 .qd-bottom { padding-top: 2mm; }
.a4.qd.qd-c2 { font-size: 9pt; line-height: 1.32; }
.qd.qd-c2 .qd-logo-img, .qd.qd-c3 .qd-logo-img { height: 15mm; margin-bottom: 1mm; }
.qd.qd-c2 .qd-title, .qd.qd-c3 .qd-title { font-size: 16pt; }
.qd.qd-c2 .qd-sub, .qd.qd-c3 .qd-sub, .qd.qd-c2 .qd-small, .qd.qd-c3 .qd-small, .qd.qd-c2 .qd-addr, .qd.qd-c3 .qd-addr { font-size: 8pt; }
.qd.qd-c2 .qd-totals td, .qd.qd-c3 .qd-totals td { padding: 1mm 1.5mm; }
.a4.qd.qd-c3 { font-size: 8.5pt; line-height: 1.25; }
.qd.qd-c3 .qd-items td { padding: 0.8mm 1.5mm; }
.qd.qd-c3 .qd-items th, .qd.qd-c3 .qd-info b, .qd.qd-c3 .qd-words { font-size: 8pt; }
.qd.qd-c3 .qd-signer { font-size: 8.5pt; }
.qd.qd-c3 .qd-stampbox:not(.qd-nostamp) { height: 24mm; }
.qd.qd-c3 .qd-stamp { height: 24mm; }
.qd.qd-c3 .qd-signature { height: 17mm; }
@media print {
  .a4.qd, .a4.qd.fit { min-height: 0; padding: 0; display: block; }
  .qd-foot-screen { display: none; }
}
@media print { html, body, .print-wrap { background: #fff !important; } .print-wrap { padding: 0; min-height: 0; } }

.ep-badge { font-weight: 700; font-size: 11.5px; padding: 1px 7px; vertical-align: 1px; }
.ep-check { min-height: 44px; }

/* 연락처 (views/contacts.js) */
.contacts-box { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; display: grid; gap: 8px; }
.contacts-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.contact-list { display: grid; gap: 6px; }
.contact-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.contact-card .contact-row { border: 0; padding: 0; }
.contact-main { flex: 1 1 200px; min-width: 0; cursor: default; }
.contact-main[role=button] { cursor: pointer; }
.contact-role { display: inline-block; margin-left: 6px; font-size: 12px; padding: 1px 8px; border-radius: 3px; background: #E6EBF1; color: var(--label); }
.contact-memo { color: #555; white-space: pre-line; margin-top: 2px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-links .btn { min-height: 40px; overflow-wrap: anywhere; }

.tax-dup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; padding: 8px 10px; border-radius: 3px; background: #fde4e1; color: var(--red); font-size: 13.5px; }

/* ===== 제품 코드 체계: 누르기 탐색·새 제품 단계·일괄 미리보기 (2026-10-27) ===== */
.browser { display: grid; gap: 8px; }
.browser .chips { display: grid; gap: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-label { font-size: 12px; color: var(--muted); min-width: 64px; }
.chip.on { background: var(--brand2); color: #fff; border-color: var(--brand2); }
.chip.new { border-style: dashed; }
.chip-n { margin-left: 6px; font-size: 11px; opacity: .65; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.tile { min-height: 56px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); display: grid; gap: 2px; padding: 8px; text-align: left; cursor: pointer; }
.tile span { font-size: 12px; color: var(--muted); }
.tile.on { border-color: var(--brand2); box-shadow: 0 0 0 2px var(--brand2) inset; }
.wizard .wz-step { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.wz-title { font-weight: 700; }
.wz-newbox { display: inline-flex; gap: 4px; align-items: center; }
.wz-new { width: 110px; min-height: 36px; }
.wz-code { padding: 10px 12px; border-radius: 3px; background: #E6EBF1; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.wz-code b { font-size: 18px; }
.wz-code.dup { background: #fde4e1; color: var(--red); }
.import-lines { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 3px; font-size: 13px; }
.imp-line { padding: 5px 10px; border-bottom: 1px solid #E6EBF1; }
.imp-line.st-error { background: #fde4e1; }
.imp-line.st-warn { background: #FBEBDC; }
.imp-line.st-skip { color: var(--muted); }
.up { color: var(--red); } .down { color: #1E6B3C; }
.sub-group { display: grid; gap: 6px; padding: 10px; }
.sub-row { display: grid; grid-template-columns: 90px 1.4fr 1fr 60px 1.4fr 1fr auto auto; gap: 6px; align-items: center; }
.sub-row.off { opacity: .55; }
.sub-row input { min-height: 36px; }
@media (max-width: 860px) { .sub-row { grid-template-columns: 1fr 1fr; } }

/* ===== 2~4단계: 이익률 표시 · 입고 원가 · 손익 ===== */
.profit-badge { font-size: 12.5px; margin-top: 4px; padding: 3px 8px; border-radius: 3px; display: inline-block; }
.profit-badge:empty { display: none; }
.pb-green { background: #DDEFE3; color: #1E6B3C; }
.pb-yellow { background: #FBEBDC; color: #8a5a00; }
.pb-red { background: #fde4e1; color: var(--red); }
.profit-total { margin-top: 10px; padding: 10px 12px; border-radius: 3px; background: #E6EBF1; display: grid; gap: 4px; }
.profit-total:empty { display: none; }
.profit-total.pb-green { background: #DDEFE3; } .profit-total.pb-yellow { background: #FBEBDC; } .profit-total.pb-red { background: #fde4e1; }
.inbound { display: grid; gap: 6px; padding: 12px; }
.cost-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tbl.pnl td:last-child { text-align: right; white-space: nowrap; }
.tbl.pnl tr.b td { font-weight: 700; border-top: 1px solid var(--line); }
.tbl.pnl tr.total td { font-size: 1.05em; }
.stat.pb-green, .stat.pb-yellow, .stat.pb-red { border-color: transparent; }

/* ===== 일정: 어두운 바탕 월 달력 (modules/calendar) ===== */
.cal-dark { background: #0B2D4F; color: #ece6f3; border-radius: 3px; padding: 14px 6px 10px; margin: 0 -4px; }
.cal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 10px 10px; gap: 8px; }
.cal-month { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.cal-lunar-title { font-size: 14px; font-weight: 700; opacity: .9; margin-top: 2px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-arrow { background: none; border: 0; color: #ece6f3; font-size: 22px; width: 40px; height: 40px; cursor: pointer; }
.cal-add { background: #C9D2DE; color: #0B2D4F; border: 0; border-radius: 3px; width: 56px; height: 40px; font-size: 22px; cursor: pointer; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 10px; align-items: center; }
.cal-chip { background: transparent; color: #cfc4dc; border: 1px solid #6c5a80; border-radius: 3px; padding: 4px 10px; min-height: 32px; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.cal-chip.on { background: #6c5a80; color: #fff; }
.cal-ent { background: #0B2D4F; color: #fff; border: 1px solid #6c5a80; border-radius: 3px; min-height: 32px; width: auto; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 15px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid #5a4a6a; }
.cal-dow .red, .cal-date.red .cal-dnum { color: #ff9a9a; }
.cal-dow .blue, .cal-date.blue .cal-dnum { color: #9ec0ff; }
.cal-week { position: relative; min-height: 140px; border-bottom: 1px solid #5a4a6a; }
.cal-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.kc-cell { border-right: 1px solid #5a4a6a; cursor: pointer; }
.kc-cell:last-child { border-right: 0; }
.kc-cell.out { background: rgba(0, 0, 0, .12); }
.cal-layer { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 26px repeat(5, 21px) 16px; row-gap: 3px; padding: 4px 0 6px; pointer-events: none; }
.cal-layer > * { pointer-events: auto; }
.cal-date { text-align: center; font-size: 12.5px; color: #cfc4dc; cursor: pointer; white-space: nowrap; overflow: hidden; }
.cal-date.out { opacity: .45; }
.cal-dnum { display: inline-block; min-width: 22px; line-height: 22px; border-radius: 3px; }
.cal-date.today .cal-dnum { background: #C9D2DE; color: #0B2D4F; font-weight: 800; }
.cal-lunar { margin-left: 2px; opacity: .8; font-size: 11.5px; }
.cal-bar { margin: 0 2px; border: 1.5px solid; border-radius: 3px; color: #fff; font-size: 12px; line-height: 17px; padding: 0 5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; min-height: 0; }
.cal-bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar.outline { color: #e8ddff; }
.cal-more { background: none; border: 0; color: #cfc4dc; font-size: 14px; letter-spacing: 2px; text-align: left; padding: 0 6px; cursor: pointer; line-height: 12px; }
@media (min-width: 900px) { .cal-week { min-height: 170px; } .cal-bar { font-size: 13px; } .cal-dark { margin: 0; } }
.cal-day-item { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-left: 6px solid; border-radius: 3px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.cal-cat.on { color: #fff; }
.holi-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 6px; align-items: center; }
.holi-row input { min-height: 40px; }
.pre { white-space: pre-wrap; }

/* 금형·제품 정보 (견적·규격 결정서) */
.mold-card { display: grid; gap: 8px; padding: 12px; }
.mold-head { display: flex; justify-content: space-between; align-items: center; }
.mold-choice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mold-other { width: 140px; min-height: 36px; }
.mold-ton { display: flex; gap: 6px; align-items: center; } .mold-ton input { width: 110px; }
.mold-choice input[type=number] { width: 90px; min-height: 36px; }
.mold-shot { padding: 6px 10px; border-radius: 3px; background: #E6EBF1; }
.line-mold { margin-top: 4px; }
.qd-molds { font-size: 8.5pt; color: #333; border-top: 0.5pt solid #ccc; padding: 2mm 0; margin-bottom: 2mm; }
.qd-molds div { margin-bottom: 1mm; }
/* 일정 오른쪽 주간·일간 칸 (넓은 화면만, calendar.js SIDE_MQ 와 같은 폭) */
.cal-side { display: none; }
.cal-date.sel .cal-dnum { outline: 2px solid #C9D2DE; outline-offset: 1px; }
@media (min-width: 1280px) {
  .main:has(.cal-page) { max-width: 1680px; }
  .cal-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 30%); gap: 14px; align-items: start; }
  .cal-side { display: flex; flex-direction: column; background: #0B2D4F; color: #ece6f3; border-radius: 3px; padding: 12px 12px 14px; position: sticky; top: 8px; max-height: calc(100vh - 90px); }
}
.cal-sd-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cal-sd-tabs { display: flex; gap: 6px; }
.cal-arrow.small { font-size: 20px; width: 40px; height: 40px; }
.cal-sd-range { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 2px 10px; border-bottom: 1px solid #5a4a6a; font-size: 15px; font-weight: 700; }
.cal-sd-body { overflow-y: auto; padding-top: 6px; min-height: 0; }
.cal-sd-day { padding: 6px 2px 8px; border-bottom: 1px solid #0B2D4F; }
.cal-sd-day.sel { background: rgba(143, 179, 247, .08); border-radius: 3px; }
.cal-sd-head { background: none; border: 0; color: inherit; padding: 2px 4px; cursor: pointer; font: inherit; text-align: left; min-height: 32px; }
.cal-sd-label { font-size: 14px; color: #ece6f3; }
.cal-sd-label.red b { color: #ff9a9a; }
.cal-sd-label.blue b { color: #9ec0ff; }
.cal-sd-today { margin-left: 6px; background: #C9D2DE; color: #0B2D4F; border-radius: 3px; padding: 0 7px; font-size: 11.5px; font-weight: 700; }
.cal-sd-list, .cal-sd-allday { display: grid; gap: 4px; padding: 2px 0 0 4px; }
.cal-sd-allday { padding: 0 0 8px; }
.cal-sd-item { display: flex; gap: 6px; align-items: baseline; width: 100%; text-align: left; background: rgba(255, 255, 255, .06); color: #fff; border: 0; border-left: 5px solid; border-radius: 3px; padding: 6px 8px; min-height: 34px; font-size: 13px; cursor: pointer; }
.cal-sd-item.outline { background: transparent; color: #e8ddff; outline: 1px dashed #6c5a80; }
.cal-sd-time { font-weight: 700; color: #cfe0ff; white-space: nowrap; }
.cal-sd-who { color: #cfc4dc; font-size: 12px; }
.cal-sd-empty { color: #8f81a0; padding: 2px 8px; font-size: 13px; }
.cal-tt { position: relative; margin-top: 4px; }
.cal-tt-hour { position: absolute; left: 0; right: 0; height: 44px; border-top: 1px solid #0B2D4F; cursor: pointer; }
.cal-tt-hour span { font-size: 11.5px; color: #a799b8; padding-left: 2px; }
.cal-tt-ev { position: absolute; border: 1.5px solid; border-radius: 3px; color: #fff; font-size: 12.5px; line-height: 16px; padding: 2px 6px; text-align: left; overflow: hidden; cursor: pointer; min-height: 0; }
.cal-tt-ev.outline { color: #e8ddff; }
.cal-tt-now { position: absolute; left: 40px; right: 0; border-top: 2px solid #ff7a7a; pointer-events: none; }

/* 맨 위 통합 검색 */
.top-search input { width: 220px; min-height: 34px; padding: 4px 10px; border-radius: 3px; border: 0; font-size: 14px; }
@media (max-width: 860px) { .top-search input { width: 120px; } }
@media (max-width: 480px) { .top-search { display: none; } }
/* 건별 진행 현황 */
.deal-bar { display: flex; gap: 2px; flex-wrap: wrap; min-width: 220px; }
.deal-st { font-size: 10.5px; padding: 1px 4px; border-radius: 3px; background: #E6EBF1; color: #8a94a3; white-space: nowrap; }
.deal-st.st-done { background: #DDEFE3; color: #1e7a3c; }
.deal-st.st-part { background: #FBEBDC; color: #8a6100; }
.deal-st.st-late { background: #fde0e0; color: #b42318; font-weight: 700; }
.deal-st.st-na { background: transparent; color: #c5cbd3; text-decoration: line-through; }
.legend .deal-st { display: inline-block; width: 14px; height: 10px; padding: 0; margin-right: 4px; vertical-align: -1px; }
.tbl.deals td { vertical-align: top; font-size: 13px; }
.tbl.deals tr.late td { background: #fff7f7; }
.tbl.deals tr.done td { opacity: .6; }
.tbl.deals .chip { margin: 1px 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1; min-width: 200px; }
/* 발주 관리표 */
.sch-table th.sortable { cursor: pointer; white-space: nowrap; user-select: none; }
.sch-table th.on { color: var(--brand2); }
.sch-table td { font-size: 12.5px; white-space: nowrap; }
.sch-table td.nowrap { white-space: nowrap; }
.sch-table tr.late td { background: #fff7f7; }
.sch-layer { grid-template-rows: 26px repeat(6, 21px) 16px; }
.main:has(.sch-page) { max-width: 1680px; }
.filters .btn { flex: none; width: auto; }
.tbl.deals .chip { white-space: nowrap; border-radius: 3px; padding: 2px 6px; min-height: 0; display: inline-block; }
.tbl.deals td { white-space: normal; }
.tbl.deals td .small { display: block; max-width: 220px; }
.tbl.deals td:first-child { min-width: 230px; }
.main:has(.tbl.deals) { max-width: 1680px; }
.filters select { flex: none; width: auto; min-width: 140px; }
/* 규격 결정서 HRS 인쇄 (대표님 양식 모양) */
.a4.hs { padding: 8mm 8mm; font: 8pt/1.3 Arial, "Microsoft YaHei", "Malgun Gothic", sans-serif; color: #000; page: hs; }
/* 규격 결정서 HRS 인쇄 (2026-10-29 v1.1): 고른 값만, 묶음 표 2단, A4 1쪽 (spec-hrs-print.js fitA4) */
.hs .hs-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hs .hs-t td { border: 0.6pt solid #000; padding: 0.9mm 1.2mm; vertical-align: middle; overflow-wrap: anywhere; }
.hs .hs-head { border: 1.4pt solid #000; margin-bottom: 2.5mm; }
.hs .hs-title { text-align: center; }
.hs .hs-tt { font-size: 14pt; text-decoration: underline; margin: 1mm 0; }
.hs .hs-signbox { width: 62mm; padding: 0 !important; }
.hs .hs-sign td { text-align: center; height: 8mm; }
.hs .hs-l { background: #e6e6e6; width: 44%; }
.hs .hs-l.sm, .hs .sm { font-size: 6.8pt; }
.hs .hs-v { text-align: left; }
.hs .hs-v.on { background: #E8912D; font-weight: 700; }
.hs .hs-c { text-align: center; }
.hs .hs-sec { background: #C9D2DE; font-weight: 700; padding: 1mm 1.2mm; border: 0.6pt solid #000; }
.hs .hs-cols { column-count: 2; column-gap: 3mm; }
.hs .hs-blk { break-inside: avoid; page-break-inside: avoid; margin: 0 0 2.2mm; width: 100%; display: table; }
.hs .hs-viewblk { display: block; border: 0.6pt solid #000; }
.hs .hs-viewblk .hs-sec { border: 0; border-bottom: 0.6pt solid #000; }
.hs .hs-view { padding: 1mm 3mm; }
.hs .hs-view svg { max-height: 62mm; width: 100%; }
.hs .hs-note { min-height: 10mm; vertical-align: top; text-align: left; }
@media print { .a4.hs { padding: 8mm 8mm !important; } }
@page hs { size: A4; margin: 0; }

/* 메뉴 그룹 (접고 펼침) */
.nav-group { margin-top: 6px; }
.nav-group-head { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0; padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; cursor: pointer; min-height: 30px; }
.nav-group-head::after { content: '▾'; font-size: 11px; }
.nav-group-head[aria-expanded="false"]::after { content: '▸'; }
.nav-group-body.closed { display: none; }

/* 외부 발주 결제 단계 */
.pay-step { display: grid; grid-template-columns: 2fr 70px 1.4fr 1fr auto; gap: 6px; align-items: center; }
@media (max-width: 640px) { .pay-step { grid-template-columns: 1fr 70px; } }

/* ===== PC 넓은 화면 배치 (2026-10-28, 설계 14 · 수정 23번). 폭 1280 이상만, 휴대폰은 그대로 ===== */
@media (min-width: 1280px) {
  .main { max-width: 1680px; }
  /* 입력 칸: 한 줄에 3~4칸 (창 안은 그대로 2칸) */
  .main .grid2 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .main .grid3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .modal .grid2 { grid-template-columns: 1fr 1fr; }
  /* 목록: 카드를 나란히 2~3칸, 조금 촘촘하게 */
  .main .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 8px; }
  .main .list .row-card { padding: 9px 12px; min-height: 52px; }
  /* 품목 줄: 칸을 한 줄로 */
  .main .line-fields { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  /* 홈: 두 칸 */
  .home-page { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 14px; }
  .home-page > .page-title, .home-page > .alert { grid-column: 1 / -1; }
  /* 설정: 왼쪽 묶음 목록 */
  .settings-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
  .settings-toc { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 2px; }
  .settings-toc a { padding: 6px 10px; border-radius: 3px; color: var(--text); text-decoration: none; font-size: 14px; }
  .settings-toc a:hover { background: #E6EBF1; }
}
@media (max-width: 1279px) { .settings-toc { display: none; } }
@media (min-width: 1280px) {
  /* 혼자 한 줄인 칸이 화면 끝까지 늘어나지 않게 */
  .main section.card > .field, .main .form > .field { max-width: 760px; }
  .main input[type=date] { max-width: 260px; }
}
.em-tbl input[type=checkbox] { width: 18px; height: 18px; min-height: 0; }
.em-tbl td.center, .em-tbl th { text-align: center; }

/* 2026-10-29 관리자 작업 날짜 · 관리자 도구 · 견적 리비전 비교 */
.wd-chip { cursor: pointer; border: 1px solid transparent; min-height: 36px; min-width: 44px; }
.wd-chip.on { background: #c62828; color: #fff; font-weight: 700; }
.admin-tools { margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.cmp-tbl td { padding: 4px 6px; vertical-align: top; }
.cmp-tbl tr.add td { background: #DDEFE3; }
.cmp-tbl tr.del td { background: #ffebee; text-decoration: line-through; color: #8a1c1c; }
.cmp-tbl tr.chg td { background: #FBEBDC; }

/* 2026-10-29 DB 관리 */
.db-rec th { color: var(--muted, #666); font-weight: 600; }
.db-rec input[type=text], .db-rec input[type=number], .db-rec textarea { width: 100%; }
.db-rec input[type=checkbox] { width: 22px; height: 22px; margin: 4px 0; justify-self: start; }
.db-rec td { text-align: left; }
.cf-tbl tr.cf-yellow td { background: #FBEBDC; }
.cf-tbl tr.cf-red td { background: #fde4e1; }
.num.pos { color: #1E6B3C; }
.num.neg { color: var(--red); }
.alert.danger { background: #fde4e1; border-color: #f3b4ac; color: var(--red); }
.mr-bar { height: 8px; border-radius: 3px; background: var(--brand2); min-width: 2px; }

/* ===== 화면 표 틀 (설계 17 A-2/A-3, 2026-10-29): 목록 표 dataTable · 입력 표 formTable ===== */
.tbl.dt th.dt-sort { cursor: pointer; user-select: none; }
.tbl.dt th.dt-sort:hover { color: var(--text); }
.tbl.dt th[data-dir="asc"]::after { content: ' ▲'; font-size: 10px; }
.tbl.dt th[data-dir="desc"]::after { content: ' ▼'; font-size: 10px; }
.tbl.dt th { background: var(--thbg); position: sticky; top: 0; z-index: 1; }
.tbl.dt td { padding: 8px 6px; vertical-align: middle; }
.tbl.dt tr.clickable { cursor: pointer; }
.tbl.dt tr.clickable:hover td { background: var(--hover); }
.tbl.dt td.dt-main { font-weight: 600; }
.dt-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 3px; }
.ftable { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) minmax(120px, 190px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--card); }
.ftable.single { grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); }
.ftable .ft-sec { grid-column: 1 / -1; padding: 8px 12px; font-weight: 700; background: var(--grpbg); border-top: 1px solid var(--line); }
.ftable .ft-sec:first-child { border-top: 0; }
.ftable .ft-sec-note { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
.ftable .ft-l { padding: 8px 10px; font-size: 13.5px; font-weight: 600; color: var(--label); background: var(--thbg); border-top: 1px solid var(--line2); display: flex; align-items: center; }
.ftable .ft-v { padding: 6px 10px; border-top: 1px solid var(--line2); min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.ftable .ft-v.wide { grid-column: span 3; }
.ftable.single .ft-v.wide { grid-column: span 1; }
.ftable .ft-v input, .ftable .ft-v select, .ftable .ft-v textarea { min-height: 38px; }
.ftable .ft-v .seg-btn { min-height: 36px; padding: 4px 10px; }
.ftable .ft-text { white-space: pre-wrap; }
.ftable .ft-v.changed { background: #FBEBDC; }
@media (max-width: 860px) {
  .main { padding: 14px 12px 90px; }
  /* 목록 표 → 카드 */
  .dt-wrap { background: transparent; border: 0; overflow: visible; }
  .tbl.dt thead { display: none; }
  .tbl.dt, .tbl.dt tbody, .tbl.dt tr, .tbl.dt td { display: block; width: 100%; }
  .tbl.dt tr { background: var(--card); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 8px; padding: 8px 12px; }
  .tbl.dt td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: right; min-height: 0; }
  .tbl.dt td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  .tbl.dt td.dt-main { display: block; text-align: left; font-size: 16px; padding-bottom: 4px; }
  .tbl.dt td.dt-main::before { content: none; }
  .tbl.dt td.dt-blank, .tbl.dt td.dt-pc { display: none; }
  .tbl.dt td.num { text-align: right; }
  /* 입력 표 → 한 줄에 한 항목 */
  .ftable, .ftable.single { grid-template-columns: minmax(0, 1fr); }
  .ftable .ft-l { background: transparent; border-top: 1px solid var(--line2); padding: 10px 12px 2px; font-size: 13px; }
  .ftable .ft-v { border-top: 0; padding: 2px 12px 10px; }
  .ftable .ft-v.wide { grid-column: auto; }
  .ftable .ft-v .seg-btn { min-height: var(--tap); }
  .sticky-actions { position: sticky; bottom: 0; }
}

/* ===== 어둡게 (설계 17 A-4). 종이(견적서·인쇄 미리보기 .a4)는 항상 밝게 ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --brand: #0B2D4F; --brand2: #6E9BC8; --brand-hover: #84ABD2; --accent: #F0A24A; --bg: #10151d; --card: #18202b; --line: #2c3746; --line2: #232c39; --text: #e2e7ee; --muted: #93a0b2; --label: #b9c3d0;
  --thbg: #1d2632; --grpbg: #1c2a3d; --hover: #212c3a; --green: #5FBF86; --amber: #F0A24A; --red: #ff6b5e; --blue: #6E9BC8;
}
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #121922; border-color: var(--line); }
html[data-theme="dark"] input:disabled, html[data-theme="dark"] textarea:disabled, html[data-theme="dark"] select:disabled { background: #161d27; color: var(--muted); }
html[data-theme="dark"] .alert { background: #1d2632; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .alert.warn { background: #33280f; border-color: #6b5320; }
html[data-theme="dark"] .alert.danger, html[data-theme="dark"] .alert-line.late { background: #3a1c1a; border-color: #7a3530; color: #ffb4ab; }
html[data-theme="dark"] .alert-line.soon { background: #33280f; color: #ffd27a; }
html[data-theme="dark"] .alert.info { background: #172a40; border-color: #2c4a70; }
html[data-theme="dark"] .badge { background: #263142; color: var(--text); }
html[data-theme="dark"] .badge.red { background: #4a1f1c; color: #ffb4ab; }
html[data-theme="dark"] .badge.green { background: #183a24; color: #8be0a4; }
html[data-theme="dark"] .badge.amber { background: #3d2f12; color: #ffd27a; }
html[data-theme="dark"] .badge.blue { background: #1a3150; color: #9cc6ff; }
html[data-theme="dark"] .badge.gray { background: #2a3340; color: #b9c3d0; }
html[data-theme="dark"] .ftable .ft-v.changed, html[data-theme="dark"] .cmp-tbl tr.chg td { background: #3a3215; }
html[data-theme="dark"] .cf-tbl tr.cf-yellow td { background: #33280f; }
html[data-theme="dark"] .cf-tbl tr.cf-red td, html[data-theme="dark"] .tbl.deals tr.late td { background: #3a1c1a; }
html[data-theme="dark"] .toast { background: #e2e7ee; color: #10151d; }
html[data-theme="dark"] .pb-green, html[data-theme="dark"] .profit-total.pb-green { background: #183a24; color: #8be0a4; }
html[data-theme="dark"] .pb-yellow, html[data-theme="dark"] .profit-total.pb-yellow { background: #33280f; color: #ffd27a; }
html[data-theme="dark"] .pb-red, html[data-theme="dark"] .profit-total.pb-red { background: #3a1c1a; color: #ffb4ab; }
html[data-theme="dark"] .nav-item:hover { background: #1c2735; }
html[data-theme="dark"] .nav-item.active { background: #1f3550; color: #cfe2ff; }
html[data-theme="dark"] .profit-total { background: #1d2632; }
html[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .login-wrap { background: #0b1626; }
html[data-theme="dark"] .empty { background: var(--card); }
html[data-theme="dark"] img.logo-img, html[data-theme="dark"] .asset-img img { background: #fff; border-radius: 3px; }
/* 종이 미리보기는 밝은 색 그대로 */
.a4, .print-wrap .a4, .qd-sheet { --card: #fff; --bg: #fff; --text: #1d2430; --muted: #6b7686; --line: #dfe3ea; --line2: #eef0f3; --label: #3a4554; --thbg: #f7f8fa; --grpbg: #eef5fd; color: #1d2430; color-scheme: light; }
html[data-theme="dark"] .print-wrap { background: #2a313b; }
html[data-theme="dark"] .print-wrap .a4 input, html[data-theme="dark"] .print-wrap .a4 textarea { background: #fff; color: #1d2430; }
@media print {
  html[data-theme="dark"] { --bg: #fff; --card: #fff; --text: #000; --muted: #555; --line: #ccc; --line2: #ddd; --label: #333; --thbg: #f4f4f4; --grpbg: #eef5fd; color-scheme: light; }
  html[data-theme="dark"] body { background: #fff !important; color: #000; }
}
.theme-btn { font-size: 18px; min-width: 40px; }
@media (max-width: 640px) { .theme-btn { display: none; } } /* 폰: 내 정보에서 고름 (머리줄이 좁음) */
.ftable .ft-l.wide { grid-column: 1; }
.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.seg-other { max-width: 420px; }
.tbl.in-tbl td { padding: 4px; }
.tbl.in-tbl input { min-height: 36px; }
.mv-pick { color: var(--text); }
.mv-pick .mv-svg { max-width: 420px; }
.mv-pick .mv-hit:hover { fill: rgba(59, 127, 208, .12); }
@media (max-width: 860px) { .mv-pick .mv-svg { max-width: 100%; } .tbl.in-tbl { min-width: 520px; } }


/* 출장 (설계 18) */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.photo-big { width: 100%; border-radius: 3px; border: 1px solid var(--line); background: #fff; }
.day-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 6px; align-items: start; }
@media (max-width: 640px) { .day-row { grid-template-columns: 1fr auto; } .day-row textarea { grid-column: 1 / -1; } }
.chip-x { border: 0; background: transparent; cursor: pointer; margin-left: 4px; color: var(--muted); min-height: 0; padding: 0 2px; }
.trip-print .tp-title { text-align: center; font-size: 18pt; margin: 0 0 4mm; }
.trip-print h3 { font-size: 11.5pt; margin: 5mm 0 2mm; }
.trip-print .tp-box { border: 1px solid #ccc; padding: 2mm 3mm; min-height: 14mm; }
.trip-print .tp-sign td { height: 16mm; text-align: center; width: 33%; }
.trip-print .tp-break { break-before: page; }
.trip-print .tp-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.trip-print .tp-photos figure { margin: 0; break-inside: avoid; }
.trip-print .tp-photos img { width: 100%; max-height: 110mm; object-fit: contain; border: 1px solid #ddd; }
.trip-print .tp-photos figcaption { font-size: 8.5pt; color: #555; }


/* 알림 🔔 (설계 17-B) */
.bell-btn { position: relative; font-size: 18px; min-width: 40px; }
.bell-btn .bell-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 3px; background: #E8912D; color: #000; font-size: 11px; font-weight: 700; line-height: 18px; display: none; }
.bell-btn.has .bell-n { display: block; }
.bell-btn.urgent .bell-n { background: #ff3b30; color: #fff; animation: bellpulse 1.4s infinite; }
@keyframes bellpulse { 50% { transform: scale(1.18); } }
.ntf-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.ntf-list > .ntf-item { flex-shrink: 0; } /* 폰: 줄어들어 글자가 다음 칸과 겹치던 것 (11-22) */
.ntf-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); cursor: pointer; color: var(--text); min-height: var(--tap); }
.ntf-item.urgent { border-color: var(--red); border-left-width: 5px; }
.ntf-item.seen { opacity: .6; }
.ntf-item .ntf-ic { font-size: 18px; }
.ntf-item:hover { background: var(--hover); }

.brand, .ent-chip { white-space: nowrap; }
@media (max-width: 520px) { .topbar .lang-select { display: none; } .topbar { gap: 4px; } .brand { font-size: 15px; } } /* 폰: 언어는 내 정보에서 */

/* 도면 (설계 17-D) */
.drw-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.drw-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drw-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 3px; background: #fff; object-fit: contain; }
@media (max-width: 860px) { .drw-cmp { grid-template-columns: 1fr; } .drw-frame { height: 50vh; } }
.drw-links { display: flex; flex-wrap: wrap; gap: 6px; }
.drw-links:empty { display: none; }
.tbl.dt tr.late td { background: #fff7f7; }


/* 입력 칸 표 모양 (설계 17 A-2): PC 에서 카드 안 2열 입력(.grid2)은 "항목 | 값" 표로. 창(modal)·폰은 예전처럼 */
@media (min-width: 861px) {
  .main .card > .grid2, .main section > .grid2 { gap: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--card); }
  .main .card > .grid2 > .field, .main section > .grid2 > .field { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); align-items: stretch; margin: 0; border-top: 1px solid var(--line2); }
  .main .card > .grid2 > .field:nth-child(-n+2), .main section > .grid2 > .field:nth-child(-n+2) { border-top: 0; }
  .main .card > .grid2 > .field:nth-child(odd), .main section > .grid2 > .field:nth-child(odd) { border-right: 1px solid var(--line2); }
  .main .card > .grid2 > .field > .field-label, .main section > .grid2 > .field > .field-label { margin: 0; padding: 8px 10px; background: var(--thbg); display: flex; align-items: center; font-size: 13px; }
  .main .card > .grid2 > .field > :not(.field-label):not(.field-hint), .main section > .grid2 > .field > :not(.field-label):not(.field-hint) { margin: 5px 8px; width: auto; min-width: 0; align-self: center; }
  .main .card > .grid2 > .field > .field-hint, .main section > .grid2 > .field > .field-hint { grid-column: 2; margin: -2px 8px 6px; }
}
.drw-branch { color: var(--amber); }
/* 넓은 화면의 카드 2열 배치(.main .list grid) 안에 표가 들어가면 반쪽이 됨 → 표는 한 줄 전체 */
.main .list > .dt-wrap, .main .list > .empty { grid-column: 1 / -1; }
.dt-wrap { width: 100%; }
/* 설정 화면: 카드 안 칸을 "항목 | 값" 표 줄로 (PC) */
@media (min-width: 861px) {
  .settings-page .card > .field, .settings-page .card > .stack > .field { display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); align-items: center; gap: 0; margin: 0; border: 1px solid var(--line2); border-top: 0; }
  .settings-page .card > .field:first-of-type, .settings-page .card > .stack > .field:first-of-type { border-top: 1px solid var(--line2); border-radius: 3px 3px 0 0; }
  .settings-page .card > .field > .field-label, .settings-page .card > .stack > .field > .field-label { margin: 0; padding: 9px 12px; background: var(--thbg); height: 100%; display: flex; align-items: center; }
  .settings-page .card > .field > :not(.field-label):not(.field-hint), .settings-page .card > .stack > .field > :not(.field-label):not(.field-hint) { margin: 5px 10px; width: auto; max-width: 520px; }
  .settings-page .card > .field > .field-hint, .settings-page .card > .stack > .field > .field-hint { grid-column: 2; margin: -2px 10px 8px; }
  .settings-page .preset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
}
/* 결제 조건 목록: 한 줄 표 행 */
.settings-page .pay-row { display: grid; grid-template-columns: 110px minmax(160px, 1fr) auto auto auto auto; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 3px; background: var(--card); }
.settings-page .pay-row > * { margin: 0; }
.settings-page .pay-row input[type=number] { width: 80px; }
@media (max-width: 860px) { .settings-page .pay-row { grid-template-columns: 1fr 1fr; } }

/* 거래처 검색 칸 (core/partnerpick.js, 2026-10-29 v1.1) */
.ppick { position: relative; }
.ppick-row { display: flex; gap: 6px; align-items: center; }
.ppick-row .ppick-in { flex: 1; min-width: 0; }
.ppick-menu { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 40; max-height: 300px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.ppick-item { display: block; width: 100%; text-align: left; min-height: var(--tap); padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line2); background: transparent; color: var(--text); cursor: pointer; }
.ppick-item:hover, .ppick-item:focus, .ppick-item.on { background: var(--hover); outline: none; }
.ppick-item .ep-badge { margin-left: 6px; }
.ppick-none { padding: 10px 12px; }

/* 출하 서류 (shipdocs.js, 2026-10-29 v1.1) — 종이는 항상 밝게 */
.a4.sdoc { padding: 12mm 12mm; font: 8.6pt/1.35 Arial, "Microsoft YaHei", "Malgun Gothic", sans-serif; color: #000; page: sdoc; }
.sdoc .sd-head { text-align: center; margin-bottom: 4mm; }
.sdoc .sd-title { font-size: 17pt; font-weight: 700; letter-spacing: 1px; }
.sdoc .sd-zh { font-size: 12pt; font-weight: 400; }
.sdoc .sd-no { font-size: 10pt; margin-top: 1mm; }
.sdoc .sd-tag { font-size: 8.5pt; font-weight: 700; color: #0B2D4F; margin-top: 1mm; }
.sdoc .sd-t { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 3mm; }
.sdoc .sd-t > tr > td, .sdoc .sd-t > tr > th, .sdoc .sd-t td, .sdoc .sd-t th { border: 0.6pt solid #000; padding: 1.2mm 1.5mm; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.sdoc .sd-t th { background: #E6EBF1; font-weight: 700; }
.sdoc .sd-t > tr > th { width: 32%; }
.sdoc .sd-parties > tr > td { width: 50%; }
.sdoc .sd-party + .sd-party { margin-top: 2mm; }
.sdoc .sd-k { font-weight: 700; font-size: 7.6pt; color: #333; }
.sdoc .sd-kv { width: 100%; border-collapse: collapse; }
.sdoc .sd-kv th, .sdoc .sd-kv td { border: 0 !important; border-bottom: 0.4pt solid #bbb !important; padding: 0.8mm 1mm !important; background: none !important; font-size: 8pt; }
.sdoc .sd-kv th { width: 40%; font-weight: 700; }
.sdoc .sd-items td.num, .sdoc .sd-items th { text-align: right; }
.sdoc .sd-items th:nth-child(-n+3) { text-align: left; }
.sdoc .sd-items tfoot td { background: #E6EBF1; }
.sdoc .sd-words { font-weight: 700; font-style: italic; margin: 1mm 0 3mm; }
.sdoc .sd-box { border: 0.6pt solid #000; padding: 1.5mm 2mm; margin-bottom: 3mm; }
.sdoc .sd-sign { margin: 8mm 0 0 55%; text-align: center; }
.sdoc .sd-line { border-top: 0.6pt solid #000; margin-top: 16mm; padding-top: 1mm; font-size: 7.6pt; }
/* 설계 56 (11-18): 선적 줄 · 포장 크기 · 조건 칸 · 직인 */
.sdoc .sd-t.sd-ship > tr > th, .sdoc .sd-t.sd-ship > tr > td { width: auto; text-align: center; font-size: 8pt; }
.sdoc .sd-t.sd-sizes > tr > th { width: 30%; }
.sdoc .sd-cond { border-collapse: collapse; margin: 2mm 0 0; font-size: 8.4pt; }
.sdoc .sd-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; break-inside: avoid; }
.sdoc .sd-foot .sd-sign { margin: 2mm 0 0; flex: 0 0 42%; }
.sdoc .sd-foot .sd-line { margin-top: 12mm; }
.sdoc .sd-cond th { text-align: left; padding: 0.4mm 3mm 0.4mm 0; white-space: nowrap; }
.sdoc .sd-cond td { padding: 0.4mm 0; }
.sdoc .sd-stamp { display: block; width: 26mm; height: 26mm; object-fit: contain; margin: 1mm auto -14mm; position: relative; }
.inc-hint { flex-basis: 100%; }
.sd-port input { width: 100%; }
@media print { .a4.sdoc { padding: 10mm 10mm !important; } }
@page sdoc { size: A4; margin: 0; }
/* HOME 종합 현황 (2026-10-30) */
.sum-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.sum-tile { text-decoration: none; color: inherit; display: block; }
.sum-tile.warn { border-color: var(--amber); }
.sum-tile .stat-num:empty { display: none; }
/* 업무 연락 (2026-10-30) */
.thread-msgs .msg { max-width: 760px; }
.thread-msgs .msg.mine { margin-left: auto; border-color: var(--brand2); }
.row-card.unread { border-left: 4px solid var(--red); }
.chip.doc-link { text-decoration: none; }
.chip-x { border: 0; background: transparent; margin-left: 4px; cursor: pointer; min-height: 24px; color: var(--muted); }
/* 고객 포털 (2026-10-30): 큰 버튼, 휴대폰 우선 */
.portal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.portal-head select { width: auto; min-height: 36px; color: #0B2D4F; background: #fff; }
.portal-brand b { font-size: 18px; letter-spacing: 1px; }
.portal-tools { display: flex; gap: 6px; align-items: center; }
.portal-main { max-width: 1100px; margin: 0 auto; padding: 12px 12px 90px; }
.portal-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.portal-kind { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); font-size: 15px; cursor: pointer; min-height: 96px; color: var(--text); }
.portal-icon { font-size: 24px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.portal-card { border: 1px solid var(--line); border-radius: 3px; background: var(--card); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.portal-card.need { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.portal-card-head { display: flex; gap: 10px; align-items: center; }
.portal-qty { display: flex; align-items: center; justify-content: center; gap: 16px; }
.portal-pm { min-width: 64px; min-height: 56px; font-size: 26px; }
.portal-num { text-align: center; font-size: 30px; font-weight: 700; min-width: 70px; }
.portal-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.portal-min { width: 80px; min-height: 40px; }
.portal-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.portal-step { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 12px 6px; min-height: 64px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); font-size: 17px; cursor: pointer; color: var(--text); }
.portal-cart { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); z-index: 20; }
/* @dark-auto */
html[data-theme="dark"] .btn:hover { background: #182332; }
html[data-theme="dark"] .btn.danger { border-color: #44252b; }
html[data-theme="dark"] .lang-select option { color: #999999; }
html[data-theme="dark"] .row-card:hover { border-color: #182c47; }
html[data-theme="dark"] .checklist.warn { background: #2f2e2b; border-color: #65532b; }
html[data-theme="dark"] .checklist.ok { background: #182c2e; border-color: #184033; }
html[data-theme="dark"] .todo-item.warn { background: #26292b; border-color: #65532b; }
html[data-theme="dark"] .ph { background: #18293f; }
html[data-theme="dark"] .ph.missing { background: #31232b; }
html[data-theme="dark"] .fold .count { background: #182331; color: #b4b4b4; }
html[data-theme="dark"] .diff { background: #18212d; border-color: #182230; }
html[data-theme="dark"] ins { background: #183731; color: #9fbda8; }
html[data-theme="dark"] del { background: #31232b; color: #d1a7a3; }
html[data-theme="dark"] .lang-block { border-color: #182230; }
html[data-theme="dark"] .item-row, html[data-theme="dark"] .pay-row { border-color: #182230; }
html[data-theme="dark"] .tl-reason { background: #2f302b; }
html[data-theme="dark"] .stages li.done { background: #182c2e; border-color: #184033; }
html[data-theme="dark"] .ev { background: #182230; }
html[data-theme="dark"] .age { background: #182433; }
html[data-theme="dark"] .age-d30 { background: #3d382b; }
html[data-theme="dark"] .age-d60 { background: #4f3b2b; }
html[data-theme="dark"] .age-d90, html[data-theme="dark"] .age-d90p { background: #37202b; color: #d7a4a4; }
html[data-theme="dark"] .contact-role { background: #182433; }
html[data-theme="dark"] .contact-memo { color: #bbbbbb; }
html[data-theme="dark"] .tax-dup { background: #31232b; }
html[data-theme="dark"] .wz-code { background: #18253a; }
html[data-theme="dark"] .wz-code.dup { background: #31232b; }
html[data-theme="dark"] .imp-line.st-error { background: #31232b; }
html[data-theme="dark"] .imp-line.st-warn { background: #3d3b2b; }
html[data-theme="dark"] .down { color: #a3ccaf; }
html[data-theme="dark"] .mold-shot { background: #18253a; }
html[data-theme="dark"] .deal-st { background: #182331; }
html[data-theme="dark"] .deal-st.st-done { background: #183631; color: #a5cab1; }
html[data-theme="dark"] .deal-st.st-part { background: #46412b; color: #d0c099; }
html[data-theme="dark"] .deal-st.st-late { background: #32202b; color: #e1a7a3; }
html[data-theme="dark"] .sch-table tr.late td { background: #1f202b; }
html[data-theme="dark"] .settings-toc a:hover { background: #182433; }
html[data-theme="dark"] .cmp-tbl tr.add td { background: #182c2c; }
html[data-theme="dark"] .cmp-tbl tr.del td { background: #2a202e; color: #d0a4a4; }
html[data-theme="dark"] .num.pos { color: #a3ccaf; }
html[data-theme="dark"] .bell-btn .bell-n { color: #999999; }
html[data-theme="dark"] .tbl.dt tr.late td { background: #1f202b; }

/* 🔐 보안 금고 (2026-10-31) */
.vault-lock { max-width: 420px; margin: 24px auto; text-align: center; }
.vault-lock .field { text-align: left; }
.vault-lock-icon { font-size: 28px; }
.vault-card { text-align: left; width: 100%; }
.vault-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.vault-secret { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vault-val { word-break: break-all; font-size: 15px; }
.vault-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.vault-code { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line, #e5e7eb); border-radius: 3px; }
.vault-code input[type=checkbox] { width: 22px; height: 22px; }
.vault-code.used .vault-val { text-decoration: line-through; opacity: .5; }
.vault-rec { font-size: 22px; font-weight: 700; letter-spacing: 2px; text-align: center; padding: 16px; border: 2px dashed currentColor; border-radius: 3px; word-break: break-all; }
.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline input { flex: 1; }
.btn.link { background: none; border: none; text-decoration: underline; }

/* ✉️ ERP 메일 (2026-10-31) */
.mail-top { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-box-sel { min-width: 220px; flex: 1 1 220px; }
.mail-top input[type=search] { flex: 2 1 200px; }
.mail-folders { overflow-x: auto; flex-wrap: nowrap; }
.mail-row { display: block; }
.mail-row.unread .mail-subj, .mail-row.unread .mail-who { font-weight: 700; }
.mail-row-top { display: flex; justify-content: space-between; gap: 8px; }
.mail-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { white-space: nowrap; }
.mail-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-msg summary { cursor: pointer; list-style: none; }
.mail-msg summary::-webkit-details-marker { display: none; }
.mail-msg.mine { border-left: 3px solid var(--blue, #0B2D4F); }
.mail-msg-head { padding: 4px 0; }
.mail-addrs { margin: 4px 0 8px; word-break: break-all; }
.mail-frame { width: 100%; min-height: 160px; border: 1px solid var(--line, #e5e7eb); border-radius: 3px; background: #fff; }
.mail-text { white-space: pre-wrap; word-break: break-word; }
.mail-actions { position: sticky; bottom: 0; background: var(--bg, #f5f6f8); padding: 8px 0; }
.mail-editor { min-height: 220px; max-height: 50vh; overflow: auto; border: 1px solid var(--line, #d0d5dd); border-radius: 3px; padding: 10px; background: #fff; color: #222; font-size: 15px; line-height: 1.5; }
.mail-editor:focus { outline: 2px solid var(--blue, #0B2D4F); }
.mail-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.rcp { position: relative; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 1px solid var(--line, #d0d5dd); border-radius: 3px; padding: 4px 6px; background: var(--card, #fff); }
.rcp-chips { display: contents; }
.rcp-in { flex: 1 1 140px; border: none !important; outline: none; min-height: 34px; background: transparent; }
.rcp-sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--card, #fff); border: 1px solid var(--line, #d0d5dd); border-radius: 3px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.rcp-sug:empty { display: none; }
.rcp-opt { display: block; width: 100%; text-align: left; padding: 10px; border: none; background: none; border-bottom: 1px solid var(--line, #eee); min-height: 44px; }
.mail-addr .mono { word-break: break-all; }

/* ✉️ 메일 2 (2026-10-31): 왼쪽 메일함 · 나란히/아래 보기 · 목록 모양 · 글자 크기 · 문서 작성 도구 · 전체 화면 · 계정 단계 */
.mail-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: start; }
.mail-page.lay-split .mail-grid { grid-template-columns: 210px minmax(320px, 2fr) minmax(0, 3fr); }
.mail-page.lay-bottom .mail-grid { grid-template-columns: 210px minmax(0, 1fr); }
.mail-page.lay-bottom .mail-reader { grid-column: 2; }
.mail-page.lay-bottom .mail-list { max-height: 42vh; overflow: auto; }
.mail-page.lay-split .mail-list { max-height: calc(100vh - 260px); overflow: auto; }
.mail-page.lay-split .mail-reader { position: sticky; top: 8px; max-height: calc(100vh - 100px); overflow: auto; }
.mail-reader-empty { padding: 40px; text-align: center; border: 1px dashed var(--line, #d0d5dd); border-radius: 3px; }
.mail-side { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 2px; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 3px; padding: 8px; max-height: calc(100vh - 100px); overflow: auto; }
.ms-h { font-size: 12px; color: var(--muted, #667085); margin: 10px 4px 4px; display: flex; align-items: center; gap: 6px; }
.ms-h:first-child { margin-top: 2px; }
.ms-mini { border: none; background: none; cursor: pointer; padding: 2px 4px; font-size: 13px; }
.ms-item { display: flex; align-items: center; gap: 6px; padding: 8px 8px; border-radius: 3px; text-decoration: none; color: inherit; min-height: 36px; }
.ms-item.sub { padding-left: 14px; } .ms-item.kid { padding-left: 30px; }
.ms-item.on { background: color-mix(in srgb, var(--blue, #0B2D4F) 14%, transparent); font-weight: 700; }
.ms-item.drop { outline: 2px dashed var(--blue, #0B2D4F); }
.ms-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ms-n { background: var(--blue, #0B2D4F); color: #fff; border-radius: 3px; padding: 0 7px; font-size: 12px; }
.ms-add { border: none; background: none; text-align: left; padding: 8px; color: var(--blue, #0B2D4F); cursor: pointer; min-height: 36px; }
.fd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mail-side-btn { display: none; }
.mail-listhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mail-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-quick { margin: 6px 0; } .chip.qf { cursor: pointer; } .chip.qf.on { background: var(--blue, #0B2D4F); color: #fff; }
.mail-bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: color-mix(in srgb, var(--blue, #0B2D4F) 10%, var(--card, #fff)); border-radius: 3px; margin-bottom: 6px; position: sticky; top: 0; z-index: 2; }
.mail-row { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.mail-row.on { outline: 2px solid var(--blue, #0B2D4F); }
.mail-chk { width: 20px; height: 20px; margin-top: 2px; flex: none; display: none; }
.mail-list.selecting .mail-chk, .mail-row:hover .mail-chk { display: block; }
.mail-row.d-compact { padding-top: 6px; padding-bottom: 6px; }
.mail-row.d-compact .mail-row-top { display: none; }
.mail-row.d-compact .mail-subj::before { content: attr(data-who); }
.mail-snip.wrap3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.font-large .mail-row, .font-large .mail-msg, .font-large .mail-text { font-size: 17px; }
.chip.risk-block { border-color: #d93025; color: #d93025; } .chip.risk-warn { border-color: #E8912D; }
@media (max-width: 899px) {
  .mail-grid, .mail-page.lay-split .mail-grid, .mail-page.lay-bottom .mail-grid { grid-template-columns: minmax(0, 1fr); }
  .mail-side { display: none; position: static; max-height: none; }
  .mail-side.open { display: flex; }
  .mail-side-btn { display: inline-flex; }
  .mail-page.lay-bottom .mail-reader { grid-column: 1; }
  .mail-chk { display: block; }
  .mail-list:not(.selecting) .mail-chk { display: none; }
}
/* 쓰기: 도구 줄 · 전체 화면 */
.mail-tb { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--line, #d0d5dd); border-radius: 3px 3px 0 0; background: var(--bg, #f5f6f8); }
.mail-tb + .mail-editor { border-top-left-radius: 0; border-top-right-radius: 0; }
.tb-btn { min-width: 34px; height: 34px; border: 1px solid transparent; border-radius: 3px; background: none; cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; color: inherit; }
.tb-btn:hover { border-color: var(--line, #d0d5dd); background: var(--card, #fff); }
.tb-sel { height: 34px; max-width: 120px; font-size: 13px; }
.tb-colorwrap { position: relative; } .tb-color { width: 22px; height: 22px; padding: 0; border: none; background: none; }
.tb-more { display: contents; } .tb-more.hide { display: none; }
.mail-editor table { border-collapse: collapse; } .mail-editor td, .mail-editor th { border: 1px solid #999; padding: 4px 8px; }
.mail-editor img { max-width: 100%; height: auto; }
.mail-full-btn { margin-left: auto; margin-right: 4px; }
.modal.mail-compose-modal.full { width: 100vw !important; max-width: 100vw !important; height: 100vh; max-height: 100vh; border-radius: 0; margin: 0; display: flex; flex-direction: column; }
.modal.mail-compose-modal.full .modal-body { flex: 1; overflow: auto; }
.modal.mail-compose-modal.full .mail-editor { min-height: 45vh; max-height: none; }
.modal-back:has(.mail-compose-modal.full) { padding: 0; align-items: stretch; }
/* 계정 단계 */
.wz-steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 8px; flex-wrap: wrap; }
.wz-steps li { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted, #667085); }
.wz-steps li + li::before { content: '—'; margin: 0 2px; color: var(--line, #d0d5dd); }
.wz-n { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid currentColor; font-weight: 700; font-size: 12px; }
.wz-steps li.on { color: var(--blue, #0B2D4F); font-weight: 700; } .wz-steps li.done { color: #188038; }
@media (max-width: 600px) { .wz-l { display: none; } .wz-steps li.on .wz-l { display: inline; } }
.wz-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.wz-prov { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border: 2px solid var(--line, #d0d5dd); border-radius: 3px; background: var(--card, #fff); cursor: pointer; min-height: 120px; color: inherit; }
.wz-prov.on, .wz-prov:hover { border-color: var(--blue, #0B2D4F); }
.wz-logo { width: 44px; height: 44px; border-radius: 3px; color: #fff; font: 700 24px/44px sans-serif; text-align: center; }
.wz-howto li { margin: 6px 0; line-height: 1.5; }
.wz-ready { padding: 10px; border: 1px dashed var(--line, #d0d5dd); border-radius: 3px; }
.wz-nav { justify-content: space-between; }
.mail-bulk[hidden] { display: none; }
.mail-row .row-main { min-width: 0; flex: 1; }
.mail-list { overflow-x: hidden; }
.mail-col { min-width: 0; }
.mail-page .mail-list { overflow-x: hidden; } .mail-page.lay-split .mail-list, .mail-page.lay-bottom .mail-list { overflow-y: auto; overflow-x: hidden; }
.mail-row { box-sizing: border-box; max-width: 100%; }
.mail-page .mail-list { display: flex; flex-direction: column; gap: 6px; }

/* 사람 배정 판 (2026-10-31): 왼쪽 법인별 사람 · 오른쪽 칸 · 끌어다 놓기 / 눌러서 고르기 */
.pb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pb-tip { grid-column: 1 / -1; margin: 0; }
.pb-left, .pb-zone { border: 1px solid var(--line, #d0d5dd); border-radius: 3px; padding: 8px; background: var(--card, #fff); min-height: 80px; }
.pb-right { display: flex; flex-direction: column; gap: 10px; }
.pb-zone.over, .pb-left.over { outline: 2px dashed var(--blue, #0B2D4F); background: color-mix(in srgb, var(--blue, #0B2D4F) 6%, var(--card, #fff)); }
.pb-head { font-weight: 700; margin-bottom: 6px; }
.pb-search { width: 100%; margin-bottom: 6px; }
.pb-ent { margin: 4px 0; } .pb-ent.empty { opacity: .6; }
.pb-ent-h { border: none; background: none; font-weight: 600; padding: 6px 2px; cursor: pointer; color: inherit; width: 100%; text-align: left; min-height: 34px; }
.pb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; }
.pb-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 3px; background: var(--bg, #f1f3f4); border: 1px solid var(--line, #d0d5dd); cursor: grab; user-select: none; min-height: 34px; }
.pb-chip.head { border-color: #E8912D; }
.pb-zone .pb-chip { background: color-mix(in srgb, var(--blue, #0B2D4F) 12%, var(--card, #fff)); }
.pb-menu { display: inline-flex; gap: 4px; flex-wrap: wrap; padding: 4px; border: 1px solid var(--line, #d0d5dd); border-radius: 3px; background: var(--card, #fff); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
@media (max-width: 640px) { .pb { grid-template-columns: minmax(0, 1fr); } }

/* 메일 번역 (크롬 내장) */
.mail-tr { border-left: 3px solid var(--blue, #0B2D4F); background: color-mix(in srgb, var(--blue, #0B2D4F) 6%, var(--card, #fff)); padding: 8px 10px; border-radius: 3px; }
.mail-tr .pre { white-space: pre-wrap; word-break: break-word; }

.mail-ai { border-left: 3px solid #0B2D4F; background: color-mix(in srgb, #0B2D4F 6%, var(--card, #fff)); padding: 8px 12px; border-radius: 3px; }
.mail-ai ul { margin: 4px 0 8px 18px; padding: 0; } .mail-ai-reply { white-space: pre-wrap; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 3px; padding: 8px; margin: 4px 0; }

/* 🗺 고객사 지도·위치 (2026-10-31) */
.geo-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 12px; align-items: start; }
.geo-map { height: calc(100vh - 260px); min-height: 360px; border-radius: 3px; border: 1px solid var(--line, #e5e7eb); z-index: 0; }
.geo-list { max-height: calc(100vh - 420px); overflow: auto; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 899px) { .geo-grid { grid-template-columns: minmax(0, 1fr); } .geo-map { height: 50vh; min-height: 300px; } .geo-list { max-height: none; } }
.geo-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line, #eee); }
.geo-grid > * { min-width: 0; } .geo-list { overflow-x: hidden; } .geo-list .row-card { max-width: 100%; }

/* 👥 HR (2026-10-31) */
.hr-today { text-align: center; }
.hr-date { color: var(--muted, #667085); }
.hr-status { font-size: 28px; font-weight: 800; margin: 6px 0; }
.hr-stamps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; text-align: left; }
.hr-stamps > div { border: 1px solid var(--line, #e5e7eb); border-radius: 3px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.hr-big { justify-content: center; }
.hr-btn { min-height: 56px; font-size: 18px; padding: 0 28px; }
.hr-sched td input[type=time] { min-width: 100px; }

.hr-ts td, .hr-ts th { padding: 4px 6px; text-align: center; font-size: 12px; white-space: nowrap; }
.hr-ts td:first-child { text-align: left; position: sticky; left: 0; background: var(--card, #fff); }
.ts-X { background: color-mix(in srgb, #1E6B3C 12%, transparent); } .ts-H { background: color-mix(in srgb, #0B2D4F 14%, transparent); } .ts-S { background: color-mix(in srgb, #0B2D4F 14%, transparent); }
.ts-P { background: color-mix(in srgb, #E8912D 18%, transparent); } .ts-K { background: color-mix(in srgb, #d93025 14%, transparent); } .ts-L { color: #d93025; } .ts-\? { color: #d93025; font-weight: 700; }
html[data-theme="dark"] .nav-row.dragging { background: #1f3550; }
html[data-theme="dark"] .nav-resize:hover, html[data-theme="dark"] body.nav-resizing .nav-resize { background: #2c4466; }
/* 인사 → 직원 표: 넓은 화면에서 너무 퍼지지 않게, 관리 칸은 버튼 폭만 (2026-11-01) */
.dt-wrap:has(> .tbl.hr-people) { max-width: 1280px; }
.tbl.hr-people td:last-child, .tbl.hr-people th:last-child { width: 1%; white-space: nowrap; }
.tbl.hr-people .actions.nowrap { flex-wrap: nowrap; }
/* 폰 메뉴 맨 아래 내 정보·로그아웃 (PC 는 머리줄 이름표) */
.nav-me { display: none; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.nav-logout { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: #c5221f; }
@media (max-width: 860px) { .nav-me { display: block; } }
/* 🏢 지사 위치 (2026-11-01) */
.geo-map.br-map { height: 360px; min-height: 0; }
.br-row.flash { outline: 3px solid #0B2D4F; }
.loc-picker .row-inline input { min-width: 0; }
.hr-ips { display: flex; flex-wrap: wrap; gap: 6px; }
.br-row { flex-wrap: wrap; }
.br-row .row-main { flex: 1 1 220px; min-width: 0; }
/* 업무 연락: 관리자 삭제 (2026-11-01) */
.msg-head { display: flex; align-items: center; gap: 6px; }
.msg-head .msg-del { margin-left: auto; width: 32px; height: 32px; font-size: 15px; }
.msg.msg-deleted { opacity: .7; border-style: dashed; }
/* 폰: 머리줄 👤 (내 정보·로그아웃) + 메뉴 맨 아래가 브라우저 막대에 가리지 않게 (2026-11-01) */
.me-btn { display: none; }
@media (max-width: 860px) {
  .me-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 18px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.92); }
  .nav { height: calc(100dvh - 56px); bottom: auto; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}
/* 폰 머리줄: 오른쪽(🔔·👤)은 항상 보이게, 모자라면 왼쪽 로고 글자가 줄어듦 (2026-11-01 — 관리자 칩 때문에 360px 폰에서 👤 가 밖으로 밀림) */
@media (max-width: 860px) {
  .topbar .brand { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .top-right { flex: none; gap: 6px; }
  .topbar .icon-btn { width: 38px; min-width: 38px; height: 38px; padding: 0; }
  .topbar .me-btn { width: 36px; min-width: 36px; height: 36px; }
  .topbar .ent-chip { padding: 3px 8px; font-size: 13px; }
}
@media (max-width: 400px) { .topbar .brand { font-size: 13px; } .topbar { padding: 0 8px; } }
/* 견적·수주 고객 칸: 한 줄 전체 (2026-11-01) */
.grid2 > .field.cust-wide { grid-column: 1 / -1; }
@media (min-width: 861px) { .main .card > .grid2 > .field.cust-wide, .main section > .grid2 > .field.cust-wide { grid-template-columns: minmax(110px, 19%) minmax(0, 1fr); border-right: 0; } }
.cust-wide .ppick-in { font-size: 16px; font-weight: 600; }
/* 고객 고르기 목록이 표 상자(overflow: hidden)에 잘려 1줄만 보이던 것 (2026-11-01) */
.main .card > .grid2:has(.ppick), .main section > .grid2:has(.ppick) { overflow: visible; }
.ppick-menu { max-height: min(420px, 60vh); }
/* 📖 사용 설명서 · 🛠 개발 과정 (2026-11-01) */
.help-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.help-toc-box { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 8px; }
.help-toc-box summary { font-weight: 700; cursor: pointer; padding: 4px 6px; }
.help-toc { display: flex; flex-direction: column; }
.help-toc a { padding: 5px 8px; border-radius: 3px; color: var(--text); text-decoration: none; font-size: 14px; }
.help-toc a.help-toc-1 { font-weight: 700; margin-top: 8px; }
.help-toc a.help-toc-2 { padding-left: 18px; }
.help-toc a:hover, .help-toc a.on { background: var(--hover); }
.md-body { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 18px 22px; line-height: 1.7; min-width: 0; }
.md-body h1 { font-size: 24px; margin: 28px 0 10px; padding-top: 12px; border-top: 2px solid var(--line); }
.md-body h1:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.md-body h2 { font-size: 20px; margin: 26px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.md-body h3 { font-size: 16px; margin: 18px 0 6px; scroll-margin-top: 70px; }
.md-body h1, .md-body h4 { scroll-margin-top: 70px; }
.md-body ul, .md-body ol { padding-left: 22px; margin: 6px 0; }
.md-body code { background: var(--thbg); padding: 1px 5px; border-radius: 3px; font-size: .92em; }
.md-body .md-code { background: var(--thbg); padding: 10px 12px; border-radius: 3px; overflow: auto; font-size: 13px; }
.md-body .md-mermaid { background: var(--thbg); padding: 10px 12px; border-radius: 3px; overflow: auto; font-size: 12px; color: var(--muted, inherit); white-space: pre; }
.md-body .md-diagram { overflow-x: auto; padding: 8px 0; margin: 8px 0; text-align: center; }
.md-body .md-diagram svg { max-width: 100%; height: auto; }
.md-body blockquote { margin: 8px 0; padding: 6px 12px; border-left: 4px solid #E8912D; background: var(--thbg); border-radius: 3px; }
.md-body .md-tbl { margin: 8px 0; }
.md-body .md-cont { padding-left: 22px; }
.md-body .flash { background: #F6C89A; transition: background .3s; }
.help-mark { background: #E8912D; color: #000; padding: 0 1px; border-radius: 2px; }
.help-btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 860px) { .help-grid { grid-template-columns: minmax(0, 1fr); } .help-toc-box { position: static; max-height: 50vh; } .md-body { padding: 12px 14px; } .topbar .help-btn { display: none; } }
html[data-theme="dark"] .md-body .flash { background: #4a3d10; }
/* 고객 칸이 있는 표: 항목 이름 칸 너비를 모두 같게 (넓은 화면에서 고객·통화 줄이 어긋나던 것, 2026-11-01) */
@media (min-width: 861px) {
  .main .card > .grid2:has(.cust-wide) > .field, .main section > .grid2:has(.cust-wide) > .field { grid-template-columns: 140px minmax(0, 1fr); }
}
/* 숫자 칸: ▲▼ 숨김 (1씩 바뀌어 금액 입력에 방해, 2026-11-01) · 금액 칸 오른쪽 정렬 */
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.money-in { text-align: right; font-variant-numeric: tabular-nums; }

/* ----- v1.1.1 안정화 ----- */
/* 접힌 입력 묶음(금형·제품 정보 등): 카드 모양, 제목 누르면 펼침 */
.section-fold { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 10px 16px; margin-top: 0; }
.section-fold > summary { font-weight: 600; font-size: 1.05em; color: inherit; }
.section-fold[open] > summary { margin-bottom: 8px; }
/* ⋯ 더보기 버튼 묶음 */
.more-acts { margin-top: 0; display: inline-block; }
.more-acts > summary { list-style: none; }
.more-acts > summary::-webkit-details-marker { display: none; }
.more-acts[open] > .actions { margin-top: 8px; }
/* 폰: 공급 방법 표가 화면 밖으로 나가지 않게 (옆으로 밀어서 보기) */
@media (max-width: 860px) { table.supply-plan { display: block; overflow-x: auto; max-width: 100%; } }
/* 표로 바꾼 목록: 정정된 입출금·다 받은 돈은 흐리게 */
.tbl.dt tbody tr.voided td, .tbl.dt tbody tr.done td { opacity: .55; }

/* 이관 금형 엑셀 미리보기: 잘못된 줄 (2026-11-02) */
.tbl.dt tr.row-bad td { background: #fdecec; }
html[data-theme="dark"] .tbl.dt tr.row-bad td { background: #3a1d1d; }
@media (min-width: 861px) { .tbl.dt.tr-list td { white-space: nowrap; } .tbl.dt.tr-list .tr-memo { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; } }
/* 인쇄(PDF): ERP 화면(#app) 말고 다른 것은 찍지 않음 (2026-11-04) — 크롬 확장 프로그램(삼성 패스 등)이 페이지 끝에 넣는 칸 때문에 견적서 뒤에 빈 쪽이 생겼음 */
@media print { html > :not(head):not(body), body > :not(#app) { display: none !important; } }

/* 📎 첨부 올리기 (2026-11-04): 끌어다 놓기 칸 · 진행 줄 */
.up-drop { border: 2px dashed var(--line); border-radius: 3px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; min-height: 44px; }
.up-drop.on { border-color: var(--brand2, #0B2D4F); background: rgba(31,95,168,.06); color: inherit; }
.up-list { display: grid; gap: 4px; }
.up-row { display: grid; grid-template-columns: minmax(0,1fr) 120px 60px; gap: 8px; align-items: center; font-size: 13px; }
.up-row .up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row progress { width: 100%; }
.up-row.up-bad .up-name, .up-row.up-bad span { color: var(--red, #c62828); }
ul.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* ✉️ 메일 쓰기 창 여러 개 (2026-11-04): PC 는 오른쪽 아래 떠 있는 창 — 뒤 화면(메일 목록·읽기)을 그대로 누르고 볼 수 있음 */
.modal-back.cmp-float { background: transparent; pointer-events: none; align-items: flex-end; justify-content: flex-end; padding: 0 var(--cmp-off, 16px) 0 0; }
html[data-theme="dark"] .modal-back.cmp-float { background: transparent; }
.modal-back.cmp-float > .modal { pointer-events: auto; width: 540px; max-width: calc(100vw - 32px); height: 80vh; max-height: 80vh; border-radius: 3px 3px 0 0; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); border: 1px solid var(--line); }
.modal-back.cmp-float > .modal .modal-body { flex: 1; overflow: auto; }
.mail-min-btn { font-weight: 700; }
.cmp-dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 99; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 6px 8px; max-width: calc(100vw - 16px); }
.cmp-dock .cmp-chip { background: var(--brand2, #0B2D4F); color: #fff; border: 0; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 40px; }
/* 메일 목록 줄 앞 받은 날짜·시간 · 자동 분류 규칙 줄 */
.mail-when { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; white-space: nowrap; margin-right: 8px; flex: none; }
.mail-row-top { display: flex; align-items: baseline; }
.mail-row-top .mail-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-row { align-items: center; }
.rule-row.off { opacity: .55; }

/* 📎 메일 쓰기 창 끌어다 놓기 · 대용량 첨부 안내 (2026-11-04) */
.modal.mail-compose-modal.drop-on { outline: 3px dashed var(--brand2, #0B2D4F); outline-offset: -6px; }
.modal.mail-compose-modal.drop-on .modal-body::after { content: attr(data-drop); }
.mail-big-note { color: var(--brand2, #0B2D4F); }
.modal-head .mail-min-btn { margin-left: auto; }
.modal-head .mail-min-btn + .mail-full-btn { margin-left: 0; }
.chip.att-up { opacity: .75; } .chip.att-err { border-color: var(--red, #c62828); color: var(--red, #c62828); }

/* 👤 관리자 전환 탭 띠 (2026-11-04) */
.imp-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; background: #c62828; color: #fff; padding: 8px 12px; border-radius: 3px; margin-bottom: 10px; font-weight: 600; }
.imp-bar .btn { background: #fff; color: #c62828; border: 0; }

/* 🌏 해외 지사 발주: 지사별 현황 카드 (2026-11-04) */
.po-ent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.po-ent { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; display: grid; gap: 4px; cursor: pointer; min-height: 44px; font: inherit; color: inherit; }
.po-ent.on { border-color: var(--brand2, #0B2D4F); box-shadow: 0 0 0 2px rgba(31,95,168,.2); }
.po-ent b { font-size: 16px; }
.po-ent-n .warn { font-weight: 700; }

/* 📐 고객사 표준 도면 (2026-11-04) */
.std-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.std-card { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; color: inherit; text-decoration: none; min-height: 44px; }
.std-card:hover { border-color: var(--brand2, #0B2D4F); }
.std-chip { display: inline-flex; margin: 4px 0; }

/* 고객 화면 (2026-11-04): 폰에서 옆으로 넘치지 않게 */
.portal-main { min-width: 0; max-width: 100%; overflow-x: hidden; }
.portal .page-head { flex-wrap: wrap; gap: 8px; }
.portal .page-head .actions { flex-wrap: wrap; }

/* ===== ✉️ 메일 Outlook 처럼 (2026-11-04, 설계 25 1단계) ===== */
/* 메일 화면: ERP 왼쪽 메뉴 접기 (☰ 로 열기) */
@media (min-width: 861px) {
  body.mail-wide .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  body.mail-wide .nav { position: fixed; left: 0; top: 56px; bottom: 0; z-index: 40; height: auto; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); width: 250px; }
  body.mail-wide.menu-open .nav { transform: none; }
  body.mail-wide .nav-resize { display: none; }
  body.mail-wide.menu-open .scrim { display: block; position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.3); z-index: 35; }
  body.mail-wide .main { max-width: none; padding: 10px 14px 16px; }
}
/* 위 명령 줄 */
.mail-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 10px; position: sticky; top: 56px; z-index: 6; }
.mc-btn { display: inline-flex; align-items: center; gap: 5px; border-color: transparent; background: transparent; min-height: 36px; padding: 4px 9px; }
.mc-btn:hover:not([disabled]) { background: var(--thbg, #E6EBF1); }
.mc-btn.primary { background: var(--brand2, #0B2D4F); color: #fff; }
.mc-btn.danger { color: var(--red, #c62828); }
.mc-btn[disabled] { opacity: .38; cursor: default; }
.mc-ic { font-size: 15px; line-height: 1; }
.mc-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 6px; }
.mc-n { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--brand2, #0B2D4F); }
@media (max-width: 1400px) { .mail-cmd:not(.mail-tcmd) .mc-btn:not(.primary) .mc-l { display: none; } }
.mail-tcmd { position: static; margin: 0; }
.mail-tcmd.emb .mc-btn:not(.primary) .mc-l { display: none; }
@media (max-width: 860px) { .mail-cmd .mc-btn:not(.primary) .mc-l { display: none; } .mail-cmd { top: 56px; } }
/* 칸 폭 끌기 */
.mail-page .mail-grid { gap: 0; }
.mail-page.lay-split .mail-grid { grid-template-columns: var(--ms-w, 210px) 8px var(--ml-w, 360px) 8px minmax(0, 1fr); }
.mail-page.lay-bottom .mail-grid, .mail-page.lay-list .mail-grid { grid-template-columns: var(--ms-w, 210px) 8px minmax(0, 1fr); }
.mail-page.lay-bottom .mail-reader { grid-column: 3; margin-top: 10px; }
.mail-split { cursor: col-resize; align-self: stretch; min-height: 200px; border-radius: 3px; touch-action: none; }
.mail-split:hover { background: #C9D2DE; }
.mail-page.lay-split .mail-list { max-height: calc(100vh - 230px); }
.mail-page.lay-split .mail-reader { max-height: calc(100vh - 130px); top: 110px; }
@media (max-width: 860px) {
  .mail-page .mail-grid, .mail-page.lay-split .mail-grid, .mail-page.lay-bottom .mail-grid, .mail-page.lay-list .mail-grid { grid-template-columns: minmax(0, 1fr); }
  .mail-split { display: none; }
  .mail-page.lay-bottom .mail-reader { grid-column: 1; }
}
/* 목록: Outlook 줄 */
.mail-list.ol { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 0; }
.mail-grp { position: sticky; top: 0; z-index: 2; background: var(--thbg, #E6EBF1); font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 12px; border-bottom: 1px solid var(--line); }
.mail-row { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 7px 12px 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 3px solid transparent; background: var(--card); transition: transform .05s; user-select: none; }
.mail-row:hover { background: #f5f8fc; }
.mail-row.on { background: #E6EBF1; border-left-color: var(--brand2, #0B2D4F); }
.mail-row.sel { background: #E6EBF1; }
.mail-row.unread { border-left-color: var(--brand2, #0B2D4F); }
.mail-row.unread .mail-who, .mail-row.unread .mail-subj { font-weight: 700; }
.mail-row .mail-chk { margin-top: 3px; opacity: 0; flex: none; }
.mail-row:hover .mail-chk, .mail-list.selecting .mail-chk, .mail-row.sel .mail-chk { opacity: 1; }
.mail-row-main { flex: 1; min-width: 0; }
.mail-row .mail-row-top { display: flex; align-items: baseline; gap: 8px; }
.mail-row .mail-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mail-flags { flex: none; font-size: 12px; }
.mail-subj { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-snip { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-snip.wrap3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.mail-row.d-compact .mail-row-top { display: flex; }
.mail-quick-act { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 2px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.mail-row:hover .mail-quick-act { display: flex; }
.mq { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 3px; cursor: pointer; font-size: 14px; }
.mq:hover { background: var(--thbg, #E6EBF1); }
@media (hover: none) { .mail-row:hover .mail-quick-act { display: none; } .mail-row .mail-chk { opacity: 0; } .mail-list.selecting .mail-chk { opacity: 1; } }
.mail-row.swipe-l { background: #fdecec; box-shadow: inset -60px 0 0 #e57373; }
.mail-row.swipe-r { background: #E6EBF1; box-shadow: inset 60px 0 0 #C9D2DE; }
.mail-more { text-align: center; padding: 10px; }
/* 필터 ▾ */
.mail-listhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mail-listhead .mail-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-filter { position: relative; }
.mail-filter > summary { list-style: none; cursor: pointer; }
.mail-filter > summary::-webkit-details-marker { display: none; }
.mail-filter > summary.on { border-color: var(--brand2, #0B2D4F); color: var(--brand2, #0B2D4F); }
.mail-filter-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 10px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); display: grid; gap: 6px; min-width: 260px; }
html[data-theme="dark"] .mail-row.on { background: #1d3557; }
html[data-theme="dark"] .mail-row.sel { background: #22406a; }
html[data-theme="dark"] .mail-row:hover { background: #1b2433; }
html[data-theme="dark"] .mail-row.swipe-l { background: #3a1d1d; }
html[data-theme="dark"] .mail-row.swipe-r { background: #1d2a3a; }
.mail-list:not(.selecting) .mail-row.on.sel:not(:hover) .mail-chk { opacity: 0; }

/* ✉️ 메일 2단계: 분류·플래그·고르기 메뉴·중요/기타 (2026-11-04) */
.pop-menu { position: fixed; z-index: 300; background: var(--card); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); padding: 4px; min-width: 220px; display: grid; }
.pop-item { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 3px; cursor: pointer; font: inherit; color: inherit; min-height: 36px; }
.pop-item:hover, .pop-item.on { background: var(--thbg, #E6EBF1); }
.pop-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.cat-chip { display: inline-block; color: #fff; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 3px; margin-right: 4px; line-height: 17px; vertical-align: 1px; }
.mail-flag { color: #c62828; font-size: 12px; } .mail-flag.late { font-weight: 700; }
.mail-focus { margin-top: 2px; } .mail-focus .tab { display: inline-flex; gap: 6px; align-items: center; }

/* ✉️ 메일 3단계: 보내기 취소 띠 · 자동 저장 표시 (2026-11-04) */
.mail-undo { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 400; background: #0B2D4F; color: #fff; padding: 10px 14px; border-radius: 3px; display: flex; gap: 12px; align-items: center; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.mail-undo .btn { background: #fff; color: #0B2D4F; border: 0; }
.mail-autosave { margin-left: 8px; font-weight: 400; }

/* ✉️ 메일 4단계: 고급 검색·연락처 카드·중요 (2026-11-04) */
.mail-top { display: flex; gap: 6px; align-items: center; } .mail-top input[type=search] { flex: 1; min-width: 0; }
.mail-adv-on { margin: 2px 0; }
.mail-imp { color: #d32f2f; font-weight: 700; }
.mail-imp-btn.on { background: #fdecea; color: #c62828; border-color: #ef9a9a; }
.mail-who-btn { background: none; border: 0; padding: 0; color: var(--link, #0B2D4F); cursor: pointer; font: inherit; text-align: left; }
.contact-card { width: 320px; max-width: calc(100vw - 16px); padding: 10px; gap: 6px; }
.contact-card .cc-head { display: flex; gap: 10px; align-items: center; }
.contact-card .cc-av { width: 40px; height: 40px; border-radius: 50%; background: #0B2D4F; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.contact-card .cc-msg { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-ics .actions { margin-top: 6px; }
html[data-theme="dark"] .mail-imp-btn.on { background: #4a1f1f; color: #ffb4ab; border-color: #8c3b3b; }
.mail-ics { display: block; }

/* 표 칸 폭 끌기 (2026-11-05) — PC 만 (폰은 카드) */
.tbl.dt th { position: relative; }
.tbl.dt th .dt-grip { position: absolute; top: 0; right: -3px; width: 8px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.tbl.dt th .dt-grip:hover, .tbl.dt th .dt-grip:active { background: rgba(26,115,232,.35); }
.tbl.dt[style*="fixed"] td { overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
@media (max-width: 860px) { .tbl.dt th .dt-grip { display: none; } }
/* 입출금 (2026-11-05): 내용 칸 줄임 · 수정 가능 띠 */
.cash-memo { display: inline-block; max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--muted, #667); }
.cash-edit-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cash-elog { font-size: 12px; } .cash-elog li { margin: 2px 0; }

/* 메일: 전체 선택 · 검색 버튼 (2026-11-05) */
.mail-selall { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mail-selmore { display: block; margin: 2px 0; }
.mail-search-btn { white-space: nowrap; }

/* 지출 요청서 서명 칸 (2026-11-05) — 종이(.a4)는 항상 밝게 */
.qd .qd-signs { width: 100%; border-collapse: collapse; margin-top: 4mm; table-layout: fixed; }
.qd .qd-signs th { background: #E6EBF1; color: #0B2D4F; font-size: 8.5pt; padding: 1.2mm; border: 1px solid #C9D2DE; }
.qd .qd-signs td { height: 24mm; border: 1px solid #C9D2DE; text-align: center; vertical-align: bottom; padding: 1mm; }
.qd .qd-signimg { max-height: 14mm; max-width: 90%; display: block; margin: 0 auto; }
.qd .qd-signname { font-size: 9pt; font-weight: 600; }
.qd .qd-signat { font-size: 7pt; color: #555; }
/* 서명 그리기 */
.signpad { border: 1px dashed var(--line); border-radius: 3px; background: #fff; touch-action: none; width: 100%; max-width: 520px; height: 180px; display: block; cursor: crosshair; }
.sign-preview { max-height: 70px; background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 4px; }
.pd-day.has-doc { opacity: .75; }

/* 자금 입력 창 크게 (2026-11-05) */
.cash-form input:not([type=checkbox]):not([type=radio]), .cash-form select, .cash-form textarea { font-size: 16px; min-height: 44px; }
.cash-form textarea { min-height: 72px; }
.cash-form .ftable .ft-v { min-width: 0; }
.cash-form .ftable .ft-v > input:not([type=checkbox]), .cash-form .ftable .ft-v > select, .cash-form .ftable .ft-v > textarea { width: 100%; }
.money-in { text-align: right; font-size: 18px !important; font-variant-numeric: tabular-nums; font-weight: 600; width: 100%; }
.money-row { display: flex; gap: 8px; align-items: center; } .money-row .money-in { flex: 1; min-width: 0; } .money-row .cur-sel { width: 96px; flex: none; } .cur-lbl { font-weight: 600; color: var(--muted, #667); min-width: 40px; }
.date-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .date-row input { flex: 1; min-width: 150px; }
.cf-recent:empty { display: none; } .cf-recent { margin-top: 6px; } .cf-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.cash-form .ppick-in { font-size: 16px; min-height: 44px; }

/* 🏭 고객 재고 (2026-11-05) */
.cs-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cs-card { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 10px; text-align: left; cursor: default; font: inherit; color: inherit; }
button.cs-card[onclick], .cs-card.on { cursor: pointer; } .cs-card.on { outline: 2px solid #0B2D4F; } .cs-card.warn .cs-v { color: #c62828; }
.cs-v { font-size: 22px; font-weight: 700; } .cs-l { font-size: 12px; color: var(--muted, #667); }
.cs-filters .cs-q { flex: 1; min-width: 200px; font-size: 16px; min-height: 42px; }
.cs-chips .cs-sel { min-height: 34px; }
.cs-stats { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.cs-bars { display: flex; gap: 10px; align-items: flex-end; min-height: 100px; margin-top: 6px; }
.cs-bar { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 36px; }
.cs-bar-v { width: 22px; background: #0B2D4F; border-radius: 3px 3px 0 0; min-height: 2px; }
@media (max-width: 640px) { .cs-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cs-stats { grid-template-columns: 1fr; } }

/* 🎓 고객 재고 연습 화면 (2026-11-05) */
.cs-demo-banner { position: sticky; top: 0; z-index: 5; }
.cs-demo { border-left: 4px dashed #E8912D; padding-left: 10px; }
/* 포털 머리줄: 폰에서 버튼이 넘치지 않게 (비밀번호 바꾸기 추가, 2026-11-05) */
.portal-head { flex-wrap: wrap; } .portal-tools { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 520px) { .portal-tools .btn { padding: 6px 10px; } .portal-tools select { max-width: 120px; } }

/* 메뉴 옮길 때: 위 얇은 진행 막대 · 오래 걸리면 지금 화면 살짝 흐리게 (2026-11-05) */
#route-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: #0B2D4F; z-index: 1000; opacity: 0; transition: width .4s ease, opacity .2s; pointer-events: none; }
#route-progress.on { width: 70%; opacity: 1; transition: width 8s cubic-bezier(.1,.7,.2,1), opacity .1s; }
#main > .view.view-wait { opacity: .55; transition: opacity .2s; pointer-events: none; }

/* 메일: 상위 메일함 접기 (2026-11-05) */
.mail-side .ms-tw { border: 0; background: none; cursor: pointer; padding: 0 4px 0 0; font-size: 12px; color: var(--muted, #667); width: 18px; flex: none; }
.mail-side .ms-tw-sp { display: inline-block; width: 18px; flex: none; }
.mail-side .ms-n.sum { background: #9aa0a6; }
.mail-side .ms-item[hidden] { display: none !important; }
#main > .view.view-old { pointer-events: none; }

/* 🕐 머리줄 지사별 시간 (2026-11-05) — 폰은 머리줄 아래 한 줄(옆으로 밀기) */
.topbar .world-clocks { display: flex; gap: 10px; align-items: center; margin-left: 14px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; white-space: nowrap; font-size: 13px; }
.topbar .world-clocks::-webkit-scrollbar { display: none; }
.wclock { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 3px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.65); }
.wclock.work { background: rgba(76,175,80,.28); color: #fff; }
.wclock.mine { outline: 1px solid rgba(255,255,255,.55); font-weight: 700; }
.wclock .wc-n { font-size: 11px; opacity: .85; } .wclock .wc-t { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .topbar { flex-wrap: wrap; } .topbar .world-clocks { order: 10; flex-basis: 100%; margin: 4px 0 0; font-size: 12px; } }

/* 칩 칸 (자동 분류 규칙, 2026-11-05) */
.chipin { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; background: var(--card); min-height: 40px; cursor: text; }
.chipin .chipin-in { flex: 1; min-width: 160px; border: 0 !important; outline: none; box-shadow: none !important; padding: 4px; min-height: 30px; background: transparent; }
.chipin-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; font-size: 13px; }
/* 관리 창 목록: 카드 → 촘촘한 줄 (모든 창 안 목록, 2026-11-05) */
.modal .list { gap: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.modal .list > .row-card { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 7px 10px; gap: 8px; box-shadow: none; margin: 0; min-height: 40px; }
.modal .list > .row-card:last-child { border-bottom: 0; }
.modal .list > .row-card .row-title { font-size: 14px; } .modal .list > .row-card .row-sub { font-size: 12px; margin-top: 1px; }
.modal .list > .row-card .actions { flex-wrap: nowrap; gap: 4px; } .modal .list > .row-card .btn.small { padding: 4px 8px; min-height: 30px; }
.modal .card.stack-xs { padding: 8px 10px; }
@media (max-width: 640px) { .modal .list > .row-card { padding: 9px 10px; min-height: 44px; } }
/* 폰: 지사 시간 줄을 머리줄 안 두 번째 줄로 (내용을 덮지 않게, 2026-11-05) */
@media (max-width: 860px) {
  .topbar:has(.world-clocks) { height: auto; min-height: 56px; padding-top: 6px; padding-bottom: 5px; row-gap: 3px; }
  .topbar .world-clocks { height: 24px; }
  body:has(.topbar .world-clocks) .nav { top: 86px; }
}

/* 📊 자금 현황 (2026-11-05) */
.cs2-bal { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.cs2-now { font-size: 20px; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.cs-sum .cs-card { cursor: pointer; }

/* 📶 올리기 진행 (2026-11-05) */
.up-bar { height: 8px; border-radius: 3px; background: var(--line, #ddd); overflow: hidden; margin: 4px 0; }
.up-bar > i { display: block; height: 100%; background: var(--accent, #0B2D4F); transition: width .25s; }
.up-bar.saving > i { width: 100% !important; background: repeating-linear-gradient(45deg, #1E6B3C 0 10px, #1E6B3C 10px 20px); background-size: 28px 28px; animation: upStripe 1s linear infinite; }
.up-bar.retry > i { background: #E8912D; }
@keyframes upStripe { from { background-position: 0 0; } to { background-position: 28px 0; } }
.att-prog { flex: 1 1 260px; max-width: 420px; border: 1px solid var(--line, #ddd); border-radius: 3px; padding: 6px 8px; background: var(--card, #fff); }
.att-prog-top { display: flex; align-items: center; gap: 4px; } .att-prog-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.att-prog.att-err { border-color: var(--red, #c62828); } .att-prog.att-err .att-prog-txt, .att-err-txt { color: var(--red, #c62828); }
.att-all { position: sticky; top: 0; z-index: 2; background: var(--card, #fff); border: 1px solid var(--accent, #0B2D4F); border-radius: 3px; padding: 6px 10px; }
.up-dock { position: fixed; right: 12px; bottom: 12px; z-index: 3000; width: min(360px, calc(100vw - 24px)); display: grid; gap: 6px; }
.up-dock { pointer-events: none; } .up-dock .chip-x { pointer-events: auto; } /* 진행 창이 창 아래 버튼을 가리지 않게 — 누름은 지나감 (2026-11-09) */
.up-dock-it { background: var(--card, #fff); border: 1px solid var(--line, #ddd); border-radius: 3px; padding: 8px 10px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.up-dock-it.att-err { border-color: var(--red, #c62828); } .up-dock-it.att-err .att-prog-txt { color: var(--red, #c62828); }

/* 🪟 떠 있는 창 (2026-11-06, modal float) — 뒤 화면 누르기·옮기기·크기 */
.modal-back.m-float { background: transparent; pointer-events: none; display: block; padding: 0; }
html[data-theme="dark"] .modal-back.m-float { background: transparent; }
.modal-back.m-float > .modal { pointer-events: auto; position: fixed; max-width: none; max-height: none; min-width: 320px; min-height: 180px; resize: both; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.modal-back.m-float > .modal .modal-body { flex: 1; overflow: auto; min-height: 0; }
.modal-back.m-float > .modal .modal-head { cursor: move; user-select: none; gap: 2px; }
.modal-back.m-float > .modal .modal-head h3 { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-back.m-float:not(.m-top) > .modal { box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); outline: 2px dashed rgba(21,101,192,.35); }
.modal-back.m-float > .modal.m-max { left: 8px !important; top: 8px !important; width: calc(100vw - 16px) !important; height: calc(100vh - 16px) !important; resize: none; }
#mwin-dock { position: fixed; left: 12px; bottom: 8px; z-index: 2500; display: flex; gap: 6px; flex-wrap: wrap; }
.mwin-chip { background: var(--card, #fff); border: 1px solid var(--line, #ccc); border-radius: 3px; padding: 6px 10px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); cursor: pointer; font-size: 13px; }
/* 💰 입출금 표 (2026-11-06): 분류 왼쪽 · 거래처 오른쪽 · 긴 이름 한 줄 */
.cash-cat { white-space: nowrap; } .cash-cat-n { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.cat-dot.green { background: #1E6B3C; } .cat-dot.orange { background: #E8912D; } .cat-dot.gray { background: #9e9e9e; }
.tbl.dt td.cash-who-td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-who.unlinked { color: var(--muted); font-style: italic; }
.cash-sl.part { opacity: .6; }
.sl-chip { display: inline-flex; align-items: baseline; gap: 2px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 3px; padding: 3px 8px; margin: 2px 4px 2px 0; background: var(--card); }
.sl-chip.text { border-style: dashed; } .sl-chip.auto { opacity: .8; }
.sl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .sl-part input { width: 140px; }
.sl-res { max-height: 260px; overflow: auto; }
.cash-sl-box { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
@media (max-width: 860px) {
  .tbl.dt tr:has(> td.dt-main:not(:first-child)) { display: flex; flex-direction: column; }
  .tbl.dt tr:has(> td.dt-main:not(:first-child)) > td.dt-main { order: -1; }
  .tbl.dt td.cash-who-td { max-width: none; white-space: normal; }
}
/* 🏷 거래처 고르기 창 (2026-11-06) */
.pc-box { min-height: 0; }
.pc-bar { display: flex; gap: 8px; } .pc-search { flex: 1; font-size: 18px; padding: 10px 12px; min-height: 46px; }
.pc-list { max-height: calc(100vh - 340px); overflow: auto; }
.m-float .pc-list { max-height: none; }
.pc-list tr.pc-sim td { background: rgba(46,125,50,.07); }
.pc-head b { font-size: 16px; }
/* 🔀 받는 업체 줄 (2026-11-06) */
.pl-box { display: grid; gap: 8px; }
.pl-rows { display: grid; gap: 8px; }
.pl-row { display: grid; grid-template-columns: 24px minmax(220px, 2fr) minmax(130px, 1fr) minmax(150px, 1fr) minmax(140px, 1.2fr) 28px; gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: 3px; padding: 8px; background: var(--card); }
.pl-no { font-weight: 700; color: var(--muted); padding-top: 10px; text-align: center; }
.pl-who { display: grid; gap: 4px; } .pl-f { display: grid; gap: 2px; } .pl-f input, .pl-f select { width: 100%; }
.pl-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-total b { font-size: 16px; }
.pl-view td { padding: 4px 8px; }
@media (max-width: 860px) { .pl-row { grid-template-columns: 24px 1fr 28px; } .pl-row > .pl-f { grid-column: 2; } .pl-row > .chip-x { grid-row: 1; grid-column: 3; } }
/* 📅 월별 손익 1년 표 (2026-11-06) */
.pnl-year-wrap { overflow: auto; }
.tbl.pnl-year { min-width: 1100px; font-variant-numeric: tabular-nums; }
.tbl.pnl-year th.pnl-rowh { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--card); z-index: 1; }
.tbl.pnl-year td { white-space: nowrap; }
.tbl.pnl-year td.pnl-cell { cursor: pointer; } .tbl.pnl-year td.pnl-cell:hover { background: rgba(21,101,192,.08); text-decoration: underline; }
.tbl.pnl-year td.pnl-future { background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.03) 6px 12px); }
.tbl.pnl-year td.pnl-tot { font-weight: 700; background: rgba(0,0,0,.03); }
.tbl.pnl-year tr.b th, .tbl.pnl-year tr.b td { font-weight: 700; }
.tbl.pnl-year tr.total th, .tbl.pnl-year tr.total td { border-top: 2px solid var(--text); }
/* 💰 자금 위치 (2026-11-06) */
.pos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pos-card { border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; background: var(--card); display: grid; gap: 4px; }
.pos-card .pos-v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pos-card.main { border-color: #0B2D4F; background: rgba(21,101,192,.06); } .pos-card.main .pos-v { font-size: 24px; color: #0B2D4F; }
.pos-card.in .pos-v { color: #1E6B3C; } .pos-card.out .pos-v { color: #c62828; }
.pos-card.free.good { border-color: #1E6B3C; } .pos-card.free.warn { border-color: #E8912D; background: rgba(239,108,0,.06); } .pos-card.free.bad { border-color: #c62828; background: rgba(198,40,40,.07); } .pos-card.free.bad .pos-v { color: #c62828; }
.pos-tbl tr.pos-pend td { color: var(--muted); font-style: italic; } .pos-tbl tr.pos-over td:first-child { color: #c62828; }
.pos-home { display: grid; gap: 6px; margin-bottom: 10px; }
.pos-home-row { display: grid; grid-template-columns: 90px repeat(5, minmax(0, 1fr)); gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; background: var(--card); color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
.pos-home-row span { display: grid; } .pos-home-row small { color: var(--muted); font-size: 11px; }
.pos-home-row.bad { border-color: #c62828; }
@media (max-width: 860px) { .pos-home-row { grid-template-columns: 1fr 1fr; } .pos-home-row b { grid-column: 1 / -1; } }
/* 2026-11-06: 견적 줄 ▲▼ · 지출 요청서 작성 중 목록 */
.line-head .line-move { display: inline-flex; gap: 4px; margin-left: auto; } .line-head .line-move + .btn { margin-left: 4px; }
.line-head .line-move .btn[disabled] { opacity: .3; }
.pd-drafts { max-height: 360px; overflow: auto; }
.line-head .line-move .btn { margin-left: 0; }
/* 📦 과거 거래 입력 (2026-11-06) */
.pw-step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; }
.pw-step .pw-step-l, .pw-step > label.check { min-width: 170px; }
.pw-step input[type=date] { width: 200px; }
.pw-tbl input { min-width: 70px; }
.pw-tx { max-height: 260px; overflow: auto; }
.pw-run { position: sticky; bottom: 0; background: var(--bg, #E6EBF1); padding: 8px 0; z-index: 2; }
.pw-tx tr.clickable { cursor: pointer; } .pw-tx tr.pw-on td { background: rgba(21,101,192,.08); } .pw-tx-sum { font-weight: 600; }
.pw-tx input[type=checkbox] { width: 18px; height: 18px; min-height: 0; }
/* 📦 포함 줄 (2026-11-06) */
.incl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; } .incl-row select { max-width: 260px; }
.profit-badge.pb-incl { background: rgba(21,101,192,.08); color: var(--text); }

/* ===== 판매 품목 표 (PC, linetable.js — 2026-11-07) ===== */
.lt-bar { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-bottom: 6px; flex-wrap: wrap; }
.lt-view { display: inline-flex; gap: 4px; margin-right: auto; }
.lt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.lt-table { table-layout: fixed; border-collapse: collapse; min-width: 100%; font-size: 13px; }
.lt-table th { position: relative; background: var(--thbg); text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.lt-table th.num, .lt-table td.num { text-align: right; }
.lt-table td { padding: 2px 4px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: middle; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lt-table td > input, .lt-table td > select, .lt-table td .disc-in input { width: 100%; min-width: 0; height: 30px; padding: 3px 6px; border: 1px solid transparent; border-radius: 3px; background: transparent; font-size: 13px; box-sizing: border-box; }
.lt-table td.num > input, .lt-table td .disc-in input { text-align: right; }
.lt-table.editable td > input:hover, .lt-table.editable td > select:hover, .lt-table.editable td .disc-in input:hover { border-color: var(--line); }
.lt-table td > input:focus, .lt-table td > select:focus, .lt-table td .disc-in input:focus { border-color: #0B2D4F; outline: none; background: var(--card); }
.lt-table td .disc-in { display: flex; gap: 2px; }
.lt-table td .disc-in select { width: 52px; flex: none; height: 30px; font-size: 12px; padding: 0 2px; }
.lt-table td[data-col="no"] { text-align: center; color: var(--muted, #888); }
.lt-table td[data-col="net"], .lt-table td[data-col="amt"] { padding-right: 8px; }
.lt-table td[data-col="profit"] .profit-badge { margin: 0; padding: 2px 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-table td[data-col="del"] { text-align: center; }
.lt-del { padding: 0 6px; min-height: 26px; }
.lt-drag { cursor: grab; display: block; text-align: center; color: var(--muted, #888); font-size: 15px; touch-action: none; user-select: none; }
.lt-drag:active { cursor: grabbing; }
.lt-table tr.dragging td { opacity: .45; }
.lt-table tr.drop-before td { box-shadow: inset 0 3px 0 #0B2D4F; }
.lt-table tr.drop-after td { box-shadow: inset 0 -3px 0 #0B2D4F; }
.lt-table tr.lt-bad td { background: rgba(211, 47, 47, .10); }
.lt-table tr.lt-extra td { white-space: normal; padding: 2px 8px 6px 64px; font-size: 12px; background: transparent; }
.lt-table tr.lt-extra .incl-row, .lt-table tr.lt-extra .price-hist, .lt-table tr.lt-extra .sup-miss { margin: 2px 0 0; }
.lt-table tr.lt-new td { background: transparent; }
.lt-table tr.lt-new td[data-col="no"] { font-weight: 700; }
.lt-table tr.lt-new .lt-code { border-color: var(--line); }
.lt-pname { display: block; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.lt-rz { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.lt-rz:hover, .lt-table.resizing .lt-rz:active { background: rgba(25, 118, 210, .35); }
.lt-table.resizing { cursor: col-resize; user-select: none; }
.lt-sug { position: fixed; z-index: 2000; max-height: 340px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); font-size: 13px; }
.lt-sug-item { padding: 6px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-sug-item.on, .lt-sug-item:hover { background: rgba(25, 118, 210, .14); }
.lt-sug-none { padding: 8px 10px; }
.sales-lines.lt-mode { display: block; }
.lt-table input.money-in, .lt-table td .disc-in input.money-in { font-size: 13px !important; font-weight: 500; }
.lt-table td[data-col="amt"] .line-amt { font-size: 13px; }

/* ===== 📦 과거 거래 모드 진행 띠 (modules/past/flow.js — 2026-11-07) ===== */
.pf-bar { border: 2px solid #E8912D; background: rgba(239, 108, 0, .07); border-radius: 3px; padding: 8px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.pf-bar.nodate { border-color: #d32f2f; }
.pf-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.pf-who { font-weight: 600; }
.pf-date { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.pf-date input { height: 30px; padding: 2px 6px; }
.pf-acts { display: inline-flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.pf-steps { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; }
.pf-step { padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line); background: var(--card); color: inherit; text-decoration: none; white-space: nowrap; }
.pf-step.done { color: var(--muted); }
.pf-step.now { border-color: #E8912D; background: #E8912D; color: #fff; font-weight: 700; }
.pf-arrow { color: var(--muted); }
.pf-hint { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pf-mini { white-space: nowrap; }
.pf-now-act { display: inline-flex; gap: 4px; margin: 0 2px; }
.pf-now-act .btn, .pf-acts2 .btn { min-height: 28px; padding: 2px 10px; }
.pf-acts2 { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ===== 📅 날짜 칸 크게 (2026-11-07 대표님: 달력 입력이 힘듦) — 칸 아무 곳이나 누르면 달력 (app.js showPicker) ===== */
input[type="date"] { min-height: 42px; font-size: 16px; padding: 6px 10px; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { width: 22px; height: 22px; cursor: pointer; opacity: .8; }
.pf-date { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; flex-wrap: wrap; }
.pf-date input[type="date"] { height: 40px; min-height: 40px; font-size: 16px; font-weight: 700; padding: 4px 8px; }
.pf-dbtn { min-width: 38px; min-height: 36px; padding: 2px 8px; font-weight: 700; }
/* 코드 검색 최근 사용 (linetable) */
.lt-sug-head { padding: 4px 10px; font-size: 12px; border-bottom: 1px solid var(--line); }
.lt-sug-item.rec { background: rgba(239, 108, 0, .06); }
.lt-sug-item.rec.on, .lt-sug-item.rec:hover { background: rgba(25, 118, 210, .14); }
.lt-rec-note { font-size: 12px; color: #9A4B07; }
/* 🕘 최근 사용 줄 (견적 품목 위 · 제품 고르기 창) */
.rec-row { margin: 0 0 8px; align-items: center; }
.rec-chip { border-color: #E8912D; }
.rec-note { font-size: 12px; color: #9A4B07; font-weight: 400; margin-left: 6px; }
.pf-hq { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.pf-hq .pf-hq-in { width: 170px; height: 34px; font-weight: 700; }
/* 결정서 지사 동의 상자 (11-07) */
.consent-box { border: 2px solid #c62828; background: rgba(198, 40, 40, .05); display: flex; flex-direction: column; gap: 6px; }
.consent-tbl { width: auto; min-width: 360px; font-size: 13px; }
.consent-tbl td, .consent-tbl th { padding: 4px 10px; }
.tbl.deals td.deal-next { white-space: nowrap; font-size: 13px; }
.tbl.deals .deal-mine { font-weight: 700; color: #9A4B07; }

/* 인사·총무 탭 줄 이름 (2026-11-08) */
.seg .seg-label { align-self: center; font-size: .8rem; color: var(--muted, #6b7280); padding: 0 6px 0 2px; white-space: nowrap; }
.seg-ga { margin-top: -4px; }

/* 메뉴별 권한 표 (2026-11-08) */
.perm-menu td .pm-cell { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 6px; border-radius: 3px; }
.perm-menu td .pm-cell.on { background: var(--thbg, #E6EBF1); font-weight: 600; }
.perm-menu tr.pm-group th { text-align: left; padding-top: 10px; }

/* 과거 거래 모드 30분 넘게 작업 없음 (설계 29 A12) */
.pf-bar.pf-stale { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220, 38, 38, .25); }
.pf-stale-row { padding: 4px 0 6px; font-weight: 600; color: #b91c1c; }
html[data-theme="dark"] .pf-stale-row { color: #fca5a5; }

/* 일 목록 (자금 정리·서비스 찾기 등, 설계 27 11-09): PC = 표처럼 한 줄 (이름 | 내용 | 버튼), 전화기 = 카드 그대로 */
@media (min-width: 861px) {
  .list.work-rows { gap: 0; border: 1px solid var(--line, #e5e7eb); border-radius: 3px; overflow: hidden; background: var(--card, #fff); }
  .list.work-rows > .row-card { display: grid; grid-template-columns: minmax(200px, 1.1fr) 2fr auto; align-items: center; column-gap: 14px; row-gap: 2px; margin: 0; border: 0; border-bottom: 1px solid var(--line, #e5e7eb); border-radius: 0; box-shadow: none; padding: 7px 10px; text-align: left; width: 100%; }
  .list.work-rows > .row-card:last-child { border-bottom: 0; }
  .list.work-rows > .row-card:nth-child(even) { background: var(--thbg, #f8fafc); }
  .list.work-rows > .row-card > .row-main { display: contents; }
  .list.work-rows > .row-card > .row-main > .row-title { grid-column: 1; }
  .list.work-rows > .row-card > .row-main > .row-sub { grid-column: 2; }
  .list.work-rows > .row-card > .row-main > :nth-child(n+3) { grid-column: 1 / 3; }
  .list.work-rows > .row-card > .actions, .list.work-rows > .row-card > .btn, .list.work-rows > .row-card > a.btn { grid-column: 3; grid-row: 1 / span 3; justify-self: end; }
}

/* 설정: 넓은 PC 는 한 번에 한 묶음 (설계 14, 11-09) */
@media (min-width: 1280px) { .settings-page .set-hide { display: none; } .settings-toc a.on { font-weight: 700; background: var(--thbg, #E6EBF1); border-radius: 3px; } }

/* 따라오는 작은 합계 (설계 14, 11-09): 넓은 PC 에서 품목 표 아래쪽에 붙어 따라옴 */
.tot-mini { display: none; }
@media (min-width: 1280px) {
  .sales-ed { position: relative; }
  .tot-mini { display: flex; gap: 16px; align-items: center; position: sticky; bottom: 10px; margin: 8px 0 0 auto; width: fit-content; padding: 8px 14px; border-radius: 3px; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); font-size: 14px; z-index: 6; }
  .tot-mini .tm-total b { font-size: 16px; }
}

/* HOME 넓은 PC (설계 14, 11-09): 할 일을 두세 칸으로 — 한 화면에 더 많이 */
@media (min-width: 1280px) {
  .home-page .todo { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 6px 12px; }
  .home-page .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* 결정서 오픈 시스템: 밸브용 칸·묶음·스페어 숨김 (11-09) */
.spec-open .valve-only { display: none !important; }

/* 📐 도면 목록 왼쪽 법인 칸 (2026-11-09) */
.drw-layout { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); gap: 14px; align-items: start; }
.drw-side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 8px; }
.drw-side-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: var(--tap, 44px); }
.drw-side-btn:hover { background: var(--hover); }
.drw-side-btn.on { border-color: var(--brand); background: var(--thbg); font-weight: 600; }
.drw-side-n small { color: var(--muted); font-weight: 400; }
.drw-ck { width: 34px; }
.drw-share-btn { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .drw-layout { grid-template-columns: 1fr; }
  .drw-side { flex-direction: row; flex-wrap: wrap; position: static; }
  .drw-side-btn { flex: 0 0 auto; }
  .drw-bulk { display: none; } /* 폰은 체크 칸 없음 — 한 개씩 공유 칸 버튼 */
}

/* ===== 설계 14 마무리 (2026-11-09): 오른쪽 고정 칸 · 목록+상세 · 숫자 띠 · 칸 폭 · HOME 3단 — 폭 1280 이상만 ===== */
.tp-side, .ls-side { display: none; }
.stat-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-item { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); color: var(--text); text-decoration: none; font-size: 13.5px; }
.ss-item .ss-label { color: var(--muted); }
.ss-item .ss-val { font-size: 15px; }
.ss-item .ss-sub { color: var(--muted); font-size: 12.5px; }
.ss-item.warn .ss-val { color: var(--red); }
.ss-item.good .ss-val { color: var(--green); }
a.ss-item:hover { background: var(--hover); }
@media (min-width: 1280px) {
  /* ① 오른쪽 고정 칸 */
  .tp.on { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 380px); gap: 16px; align-items: start; }
  .tp.on > .tp-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 10px; padding-bottom: 6px; align-self: flex-start; } /* 설계 50: 따라오는 고정 — 칸 안 스크롤 없음, 길면 core/navmode.js 가 top 조절 */
  .tp-side > * { margin: 0 !important; }
  .tp-side > section, .tp-side > .sales-totals, .tp-side > .profit-total, .tp-side > .sticky-actions { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 12px; }
  .tp-side .actions { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .tp-side .actions > .btn, .tp-side .actions > a.btn { width: 100%; justify-content: center; text-align: center; }
  .tp-side .sticky-actions { position: static; justify-content: stretch; }
  .tp-side .sticky-actions > .btn { flex: 1; }
  .tp-side .head-card > .back, .tp-side .head-card > .head-row { display: none; }
  .tp-side dl.info { grid-template-columns: minmax(80px, 40%) minmax(0, 1fr); }
  .tp.on .tot-mini { display: none; }
  .tp-title .tp-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .tp-title .back { display: inline-block; margin-bottom: 4px; }
  /* ④⑤ 목록 + 오른쪽 상세 */
  .ls { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 26vw, 420px); gap: 16px; align-items: start; }
  .ls > .ls-side { display: block; position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 14px; }
  .ls .ls-empty { padding: 30px 6px; text-align: center; }
  .tbl.dt tbody tr.sel td { background: var(--thbg); box-shadow: inset 0 1px 0 var(--brand), inset 0 -1px 0 var(--brand); }
  .ls-side h2 { font-size: 17px; margin: 0 0 6px; }
  .ls-side .ls-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
  /* ② 짧은 칸은 좁게 */
  .main .ft-v > input[type=date], .main .field > input[type=date], .main .ft-v > input[type=month], .main .field > input[type=month] { max-width: 190px; }
  .main .ft-v > input[type=time], .main .field > input[type=time] { max-width: 140px; }
  .main .ft-v > input[type=number], .main .field > input[type=number] { max-width: 180px; }
  .main .ft-v > select, .main .field > select { max-width: 380px; }
  /* ③ HOME 3단 */
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .home-grid > * { margin: 0; min-width: 0; }
  /* ④ 제품: 왼쪽 분류 나무 */
  .prd-3 { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
  .prd-tree { display: flex !important; flex-direction: column; gap: 2px; position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 8px; }
  .prd-3 .lv-group, .prd-3 .lv-sub { display: none; }
  /* ⑥ 월별 손익: 제품별 | 서비스·올해 나란히 */
  .pnl-pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .pnl-pair > * { margin: 0; min-width: 0; }
}
/* ② 3쌍 표: 아주 넓은 화면에서 항목|값 3쌍 (오른쪽 칸 안·창 안은 그대로) */
@media (min-width: 1700px) {
  .main .ftable:not(.single) { grid-template-columns: repeat(3, minmax(110px, 170px) minmax(0, 1fr)); }
  .main .ftable:not(.single) .ft-v.wide { grid-column: 2 / -1; }
  .modal .ftable:not(.single), .tp-side .ftable:not(.single), .ls-side .ftable:not(.single) { grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) minmax(120px, 190px) minmax(0, 1fr); }
  .modal .ftable:not(.single) .ft-v.wide, .tp-side .ftable:not(.single) .ft-v.wide, .ls-side .ftable:not(.single) .ft-v.wide { grid-column: span 3; }
}
.prd-tree { display: none; }
.prd-tree .pt-g, .prd-tree .pt-s { display: flex; justify-content: space-between; gap: 6px; width: 100%; padding: 6px 8px; border: 0; border-radius: 3px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.prd-tree .pt-g { font-weight: 600; }
.prd-tree .pt-s { padding-left: 20px; font-size: 13.5px; }
.prd-tree .pt-g:hover, .prd-tree .pt-s:hover { background: var(--hover); }
.prd-tree .on { background: var(--thbg); color: var(--brand); }
.prd-tree .pt-n { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.week-list { display: flex; flex-direction: column; gap: 4px; }
.wk-day { font-weight: 700; font-size: 13px; color: var(--label); margin-top: 6px; }
.wk-day.wd-today { color: var(--brand); }
.week-ev { display: flex; gap: 8px; padding: 5px 8px; border-radius: 3px; background: var(--grpbg); color: var(--text); text-decoration: none; font-size: 13.5px; }
.week-ev .we-time { color: var(--muted); min-width: 42px; font-variant-numeric: tabular-nums; }
.num-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.num-board .nb { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); color: var(--text); text-decoration: none; }
.num-board .nb .nb-l { font-size: 12.5px; color: var(--muted); }
.num-board .nb .nb-v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.num-board .nb .nb-s { font-size: 12px; color: var(--muted); }
.num-board .nb.warn .nb-v { color: var(--red); }
a.nb:hover { background: var(--hover); }
@media (min-width: 1280px) {
  /* HOME 3단이 있으면 종합 현황·3단 모두 한 줄 전체 (예전 2칸 배치 대신) */
  .home-page:has(> .home-grid) > * { grid-column: 1 / -1; }
  .home-grid .todo { grid-template-columns: minmax(0, 1fr); }
  .home-grid .week-ev span:last-child { min-width: 0; overflow-wrap: anywhere; }
}

/* ===== 💬 메신저 (2026-11-09, modules/chat) — 폰: 방 전체 화면 / PC 1000px+: 왼쪽 목록 + 오른쪽 대화 ===== */
body.chat-wide .main { max-width: none; }
.chat-btn { position: relative; font-size: 18px; min-width: 40px; text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.chat-btn .bell-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #34c759; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; display: none; }
.chat-btn.has .bell-n { display: block; }
.chat-page { display: block; }
.chat-page.chat-two { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 12px; height: calc(100vh - 56px - 32px); min-height: 480px; }
.chat-list-pane { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.chat-two .chat-list-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; overflow: hidden; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-rooms { display: flex; flex-direction: column; overflow-y: auto; min-height: 0; flex: 1; }
.chat-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line2); color: inherit; min-height: 60px; border-radius: 8px; }
.chat-row:hover { background: var(--hover); }
.chat-row.on { background: var(--grpbg); }
.chat-row-main { flex: 1; min-width: 0; }
.chat-row-top { display: flex; align-items: baseline; gap: 2px; }
.chat-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-at { margin-left: auto; padding-left: 8px; white-space: nowrap; }
.chat-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.unread .chat-row-sub { color: var(--text); font-weight: 600; }
.chat-unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ff3b30; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.chat-av { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #dbe7f6; color: var(--brand); font-weight: 700; font-size: 18px; }
.chat-av.k-entity { background: #e7f3e9; } .chat-av.k-doc { background: #fff3d6; } .chat-av.k-legacy { background: #eee; }
.chat-found { display: flex; flex-direction: column; gap: 2px; }
.chat-found-row { display: block; padding: 6px 8px; border-radius: 6px; color: inherit; border-left: 3px solid var(--brand2); background: var(--thbg); }
.chat-room-pane { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-room-pane.chat-empty { align-items: center; justify-content: center; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.chat-head-main { flex: 1; min-width: 0; }
.chat-head-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { font-size: 26px; text-decoration: none; color: inherit; }
.chat-two .chat-back { display: none; }
.chat-lang { white-space: nowrap; }
.chat-msgs-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 10px 12px 16px; background: #eef2f7; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chat-day { align-self: center; padding: 2px 10px; border-radius: 10px; background: rgba(0,0,0,.06); margin: 6px 0; }
.chat-more { align-self: center; }
.chat-msg { position: relative; display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.chat-msg.mine { align-items: flex-end; }
.chat-msg.flash .chat-bub { outline: 3px solid #f5a623; }
.chat-who { margin: 0 0 2px 4px; }
.chat-line { display: flex; align-items: flex-end; gap: 6px; max-width: min(88%, 640px); }
.chat-msg.mine .chat-line { flex-direction: row-reverse; }
.chat-bub { background: #fff; border-radius: 4px 14px 14px 14px; padding: 8px 11px; box-shadow: 0 1px 1px rgba(0,0,0,.06); min-width: 0; overflow-wrap: anywhere; }
.chat-msg.mine .chat-bub { background: #ffe97a; border-radius: 14px 4px 14px 14px; }
.chat-msg.del .chat-bub { background: transparent; box-shadow: none; border: 1px dashed var(--line); }
.chat-text { white-space: pre-wrap; }
.chat-tr { margin-top: 4px; padding-top: 3px; border-top: 1px solid rgba(0,0,0,.07); }
.linkish { background: none; border: 0; padding: 6px 4px; color: var(--brand2); cursor: pointer; min-height: 36px; }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-size: 11px; }
.chat-msg:not(.mine) .chat-meta { align-items: flex-start; }
.chat-nread { color: #e0a100; font-weight: 700; }
.chat-quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--brand2); background: rgba(0,0,0,.05); padding: 3px 8px; margin-bottom: 4px; border-radius: 4px; cursor: pointer; color: inherit; }
.chat-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chat-imgbtn { border: 0; padding: 0; background: none; cursor: zoom-in; }
.chat-img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; background: #ddd; min-width: 60px; min-height: 60px; object-fit: cover; }
.chat-reacts { display: flex; gap: 4px; margin: 2px 4px 0; flex-wrap: wrap; }
.chat-react { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 0 8px; min-height: 28px; font-size: 13px; cursor: pointer; }
.chat-react.on { border-color: var(--brand2); background: var(--grpbg); }
.chat-more-btn { position: absolute; top: 0; right: -4px; opacity: 0; border: 0; background: var(--card); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.chat-msg:not(.mine) .chat-more-btn { right: auto; left: min(88%, 640px); }
.chat-msg:hover .chat-more-btn, .chat-more-btn:focus { opacity: 1; }
@media (hover: none) { .chat-more-btn { display: none; } }
.chat-newpill { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); border: 0; border-radius: 16px; padding: 6px 14px; background: var(--brand2); color: #fff; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); cursor: pointer; }
.chat-compose { border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--card); display: flex; flex-direction: column; gap: 4px; }
.chat-compose.ro { padding: 12px; text-align: center; }
.chat-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-input { min-height: 44px; max-height: 140px; resize: none; padding: 10px 12px; border-radius: 22px; line-height: 1.4; }
.chat-send { min-width: 48px; border-radius: 22px; font-size: 18px; }
.chat-plus { flex: 0 0 auto; width: 44px; height: 44px; font-size: 20px; }
.chat-replybar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-left: 3px solid var(--brand2); background: var(--thbg); border-radius: 4px; }
.chat-emoji-row { display: flex; gap: 6px; justify-content: space-between; }
.chat-emoji { font-size: 24px; min-width: 48px; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.chat-menu .btn { width: 100%; justify-content: flex-start; }
.chat-pp { margin-bottom: 8px; }
.chat-gloss input { min-height: 36px; padding: 4px 8px; }
@media (max-width: 999px) {
  body.chat-open .topbar, body.chat-open .nav, body.chat-open .alert-bar, body.chat-open .imp-bar { display: none !important; }
  body.chat-open .main { padding: 0 !important; }
  body.chat-open .chat-page { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); z-index: 45; background: var(--card); display: flex; flex-direction: column; } /* V2.6.2: 키보드가 올라오면 보이는 곳(visualViewport)만큼 → 입력 칸이 키보드 바로 위 */
  body.chat-open .mbar { display: none !important; } /* V2.6.2: 대화 방에서는 아래 탭 줄 숨김 (카카오톡처럼, 위 ‹ 로 돌아감) */
  body.chat-open .chat-room-pane { flex: 1; border: 0; border-radius: 0; height: 100%; }
  body.chat-open .chat-msgs { padding: 8px 8px 12px; }
}
html[data-theme="dark"] .chat-msgs { background: #10161f; }
html[data-theme="dark"] .chat-bub { background: #232b36; color: #e6e9ee; }
html[data-theme="dark"] .chat-msg.mine .chat-bub { background: #5a4d12; color: #fff6c8; }
html[data-theme="dark"] .chat-av { background: #22324a; color: #cfe0f7; }
html[data-theme="dark"] .chat-av.k-entity { background: #1f3326; }
html[data-theme="dark"] .chat-av.k-doc { background: #3a3220; }
html[data-theme="dark"] .chat-av.k-legacy { background: #2a2a2a; }
html[data-theme="dark"] .chat-day { background: rgba(255,255,255,.08); }

.chat-pushbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: #fff7e0; }
.chat-pushbar.on { background: transparent; padding: 0 2px; justify-content: flex-start; }
html[data-theme="dark"] .chat-pushbar { background: #3a3220; }
html[data-theme="dark"] .chat-pushbar.on { background: transparent; }

/* 💬 PC 대화: 화면 안에 꼭 맞게 (11-09) — chat.js fitToScreen 이 body.chat-fit */
@media (min-width: 1000px) { body.chat-fit .main { padding-bottom: 8px; } }

/* ===== 숫자 칸·날짜 칸 비율 (2026-11-09 대표님) — 숫자 칸은 줄 폭을 고르게 채움(빈 자리 없음), 큰 금액은 fitnum.js 가 글자 줄임 · 날짜 칸은 고정 폭 ===== */
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { min-width: 0; text-align: center; }
.stat > .small, .stat > button, .stat > .muted { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.stat-num, .nb-v, .ss-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
.nb { min-width: 0; }
@media (min-width: 1280px) { .home-page .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 640px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.filters > input[type=date], .filters > input[type=month], .filters > label:has(> input[type=date]), .filters > label:has(> input[type=month]) { flex: 0 0 auto; }
.filters input[type=date], .filters input[type=month] { width: 170px; max-width: 100%; }
.filters > label:has(> input[type=date]), .filters > label:has(> input[type=month]) { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.filters > input[type=search] { flex: 2 1 220px; }
@media (max-width: 640px) { .filters > label:has(> input[type=date]), .filters > label:has(> input[type=month]) { flex: 1 1 100%; } .filters > label:has(> input[type=date]) input, .filters > label:has(> input[type=month]) input { flex: 1; width: auto; } }

/* ===== HOME 할 일 묶음 · 💱 환차손익 (2026-11-09) ===== */
.todo-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; align-items: start; }
.home-grid .todo-groups { grid-template-columns: minmax(0, 1fr); }
.todo-grp { border: 1px solid var(--line); border-radius: 3px; background: var(--card); padding: 0 10px 8px; }
.todo-grp > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 2px; font-weight: 700; cursor: pointer; list-style: none; min-height: 44px; }
.todo-grp > summary::-webkit-details-marker { display: none; }
.todo-grp.has-warn { border-color: #F6C89A; }
.todo-compact { gap: 4px; }
.todo-compact .todo-item { min-height: 44px; padding: 6px 10px; gap: 8px; }
.todo-compact .todo-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-compact .todo-icon { font-size: 15px; }
.todo-compact > li.todo-more { display: none; }
.todo-compact.all > li.todo-more { display: list-item; }
.todo-morebtn { margin: 6px 4px 0; }
.home-page .todo-groups .todo { display: flex; }
.fx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.fx-total { display: flex; flex-direction: column; }
.fx-total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.fx-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.fx-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.fx-wrap { position: relative; }
.fx-chart { width: 100%; height: 210px; display: block; }
.fx-chart .fx-zero { stroke: #c9c8c4; stroke-width: 1; }
.fx-chart .fx-hit { fill: transparent; }
.fx-chart .fx-col:hover .fx-hit, .fx-chart .fx-col:focus .fx-hit { fill: rgba(127, 127, 127, 0.08); }
.fx-gain { fill: #0B2D4F; background: #0B2D4F; }
.fx-loss { fill: #e34948; background: #e34948; }
.fx-chart .fx-lbl { font-size: 12px; fill: var(--text); font-weight: 600; }
.fx-chart .fx-month { font-size: 11.5px; fill: var(--muted); }
.fx-tip { position: absolute; top: 4px; min-width: 150px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); font-size: 13px; pointer-events: none; }
.fx-up { color: #0B2D4F; }
.fx-down { color: #e34948; }
.fx-tbl td.fx-up, .fx-tbl td.fx-down { font-weight: 600; }
html[data-theme="dark"] .fx-gain, html[data-theme="dark"] .fx-up { fill: #3987e5; color: #3987e5; background: #3987e5; }
html[data-theme="dark"] .fx-loss, html[data-theme="dark"] .fx-down { fill: #e66767; color: #e66767; background: #e66767; }
html[data-theme="dark"] .fx-chart .fx-zero { stroke: #383835; }
html[data-theme="dark"] .todo-grp.has-warn { border-color: #65532b; }

/* 📋 오늘의 업무 보고 (V2.1.1 AI 비서) — 색은 변수만 (어둡게도 자동) */
.daily-card { border-left: 4px solid var(--brand); }
.daily-card .dr-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.daily-card .dr-head h2 { margin: 0; font-size: 1.1rem; }
.daily-card .dr-date { font-weight: 400; color: var(--muted); font-size: .95rem; }
.daily-card .dr-status { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0; }
.dr-summary { margin: 8px 0; font-size: 1rem; }
.dr-top3 { background: var(--thbg); border-radius: 3px; padding: 8px 12px; margin: 8px 0; }
.dr-top3 ol { margin: 4px 0 0 1.2em; padding: 0; }
.dr-body { display: grid; gap: 10px; }
.dr-part-h { font-weight: 600; margin-bottom: 4px; }
.dr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dr-list > li { padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; line-height: 1.45; }
.dr-order .dr-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; min-height: var(--tap, 44px); }
.dr-order input[type=checkbox] { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.dr-order.done > .dr-check > span { text-decoration: line-through; color: var(--muted); }
.dr-order.late { border-color: var(--amber); }
.dr-doc { margin-left: 2px; }
.dr-people { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.dr-people .check { min-height: 36px; }
.dr-tos { display: flex; flex-wrap: wrap; gap: 4px; }
.dr-mini { margin: 0; padding-left: 1.2em; }
@media (min-width: 1100px) { .dr-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dr-body > .dr-summary, .dr-body > .dr-top3 { grid-column: 1 / -1; } }
.daily-card .dr-head .actions { margin-bottom: 4px; }
.daily-card .dr-keylink { display: inline-flex; align-items: center; min-height: 40px; }
.dr-how > summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; }
/* 🗒 비서 창 · 내 할 일 (V2.1.1 2단계) */
.dr-assist .dr-say-in { width: 100%; font-size: 1rem; }
.dr-rows { display: grid; gap: 6px; }
.dr-row { display: grid; grid-template-columns: 150px 110px minmax(0, 1fr) 170px 44px; gap: 6px; align-items: center; }
.dr-row input { min-height: 40px; }
.dr-todo .dr-todo-act { margin: 4px 0 0 32px; }
.dr-todo-date { margin-bottom: 2px; }
@media (max-width: 860px) {
  .dr-row { grid-template-columns: 1fr 1fr 44px; border: 1px solid var(--line); border-radius: 3px; padding: 6px; }
  .dr-row .dr-row-text, .dr-row .dr-row-doc { grid-column: 1 / 3; }
  .dr-row .dr-row-x { grid-column: 3; grid-row: 1; }
}
@media (max-width: 860px) { .topbar .ai-btn { display: none; } } /* 폰: 머리줄이 넘쳐서 🤖 는 메뉴 아래(.nav-ai)·HOME 카드 버튼으로 */
.nav-me button.nav-item { background: none; border: 0; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
/* ❓ 사용법 묻기 (V2.1.1 3단계) */
.dr-tabs { margin-bottom: 4px; }
.dr-how-in { width: 100%; font-size: 1rem; }
.dr-answer { margin: 4px 0; line-height: 1.5; }
.dr-steps { margin: 4px 0 4px 1.3em; padding: 0; display: grid; gap: 6px; }
.dr-steps li { line-height: 1.5; }
.dr-steps .dr-go { margin-left: 8px; }
.dr-src a { margin: 0 2px; }
.dr-pre { white-space: pre-wrap; background: var(--thbg); padding: 8px; border-radius: 3px; }
.warn-btn { border-color: var(--amber); }
/* 🛠 말로 서비스 서류 (V2.1.1 4단계) */
.ai-fill, .ppick.ai-fill .ppick-in { background: #FBEBDC !important; }
html[data-theme="dark"] .ai-fill, html[data-theme="dark"] .ppick.ai-fill .ppick-in { background: #4a4220 !important; }
.dr-svc-in { width: 100%; font-size: 1rem; }
.dr-target { display: grid; gap: 6px; }
.dr-part-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 90px; gap: 6px; align-items: center; }
@media (max-width: 860px) { .dr-part-row { grid-template-columns: 1fr 90px; } .dr-part-row > div:first-child { grid-column: 1 / -1; } }
.svc-amtreq .actions { margin-top: 6px; }
/* 📌 정리된 지시 (11-10) */
.dr-order-sum .dr-sum { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.dr-order-sum .dr-items { display: grid; gap: 2px; margin: 6px 0 0 4px; }
.dr-item.done > span { text-decoration: line-through; color: var(--muted); }
.dr-order-in { width: 100%; }
.dr-sum-row { grid-template-columns: minmax(0, 1fr) 150px 110px 44px; }
@media (max-width: 860px) { .dr-sum-row { grid-template-columns: 1fr 1fr 44px; } .dr-sum-row .dr-row-text { grid-column: 1 / -1; } }
/* 🧑‍💼 AI 팀 (V2.1.1 5단계) */
.at-online { padding: 8px 12px; border-radius: 3px; background: var(--thbg); }
.at-online.on { border-left: 4px solid var(--green); }
.at-online.off { border-left: 4px solid var(--muted); }
.at-chat { display: grid; gap: 10px; }
.at-msg { max-width: 85%; padding: 10px 12px; border-radius: 3px; border: 1px solid var(--line); }
.at-msg.me { justify-self: end; background: var(--thbg); }
.at-msg.ai { justify-self: start; }
.at-msg.err { border-color: var(--red); }
.at-text { white-space: pre-wrap; line-height: 1.5; word-break: break-word; }
.at-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.at-files.col { flex-direction: column; align-items: flex-start; }
.at-file { min-height: 36px; }
.at-in { width: 100%; font-size: 1rem; }
.at-pre { white-space: pre-wrap; background: var(--thbg); padding: 8px; border-radius: 3px; font-size: .85rem; }
@media (max-width: 860px) { .at-msg { max-width: 100%; } }
.dr-docs { display: flex; flex-wrap: wrap; gap: 6px; }
.dr-docs .chip { min-height: 36px; display: inline-flex; align-items: center; }
/* 🧾 본사 인보이스 나누기 (11-10) */
.lg-guide summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; }
.lg-split-row td { background: var(--thbg); }
.lsp-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 120px 44px; gap: 6px; align-items: center; }
.lsp-tbl td.num, .lsp-tbl th { white-space: nowrap; }
.lsp-sum td { font-weight: 600; border-top: 2px solid var(--line); }
@media (max-width: 860px) { .lsp-row { grid-template-columns: 1fr 1fr 44px; } .lsp-row .lsp-row-sel { grid-column: 1 / -1; } .lsp-prev { overflow-x: auto; } }
/* 고객 PO 번호 규칙 (11-11) */
.po-rule .actions input { flex: 1; min-width: 0; }
.po-rule-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 3px; }
.po-rule-row input[type=date] { width: auto; }
.po-rule-hint { display: block; line-height: 1.5; }

/* 메일 미리보기 (11-11): 본문 상자 최소 높이 · 크게 보기 */
.mail-frame { min-height: 120px; }
.mail-page.lay-split .mail-reader .mail-frame { min-height: 240px; }

/* 📈 공급가·표준가 변경 (11-11) */
.pc-pct.up { color: #c5221f; font-weight: 700; } .pc-pct.down { color: #188038; font-weight: 700; }
html[data-theme="dark"] .pc-pct.up { color: #f28b82; } html[data-theme="dark"] .pc-pct.down { color: #81c995; }
.pc-imp { display: inline-flex; flex-wrap: wrap; gap: 4px; }
/* 나누기 11-11: 재고·무상 칸, 출금 여러 개, 붙여넣기 */
.lsp-bucket td { color: var(--muted); font-style: italic; }
.lsp-tx .chip { white-space: nowrap; }
.lsp-paste { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.lsp-repl ul { margin: 4px 0 0 18px; }

/* 🌐 고객 포털 2 · 게시판 · 고객용 메모 (11-11) */
.p4-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.p4-tile { text-align: center; cursor: pointer; border: 1px solid var(--line); padding: 14px 8px; }
.p4-tile.warn { border-color: #E8912D; }
.p4-tile-ic { font-size: 18px; } .p4-tile-n { font-size: 26px; font-weight: 800; }
.p4-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.p4-step { flex: 1 1 90px; text-align: center; padding: 8px 4px; border-radius: 3px; background: var(--thbg, #E6EBF1); opacity: .55; }
.p4-step.done { background: #DDEFE3; opacity: 1; } .p4-step.part { background: #FBEBDC; opacity: 1; }
html[data-theme="dark"] .p4-step.done { background: #1e3a2a; } html[data-theme="dark"] .p4-step.part { background: #3a3320; }
.p4-step-ic { font-size: 20px; }
.p4-memo { border-left: 4px solid #0B2D4F; }
.p4-qside { max-width: 794px; margin: 0 auto 10px; }
.pb-post { padding: 8px 10px; border-radius: 3px; margin: 4px 0; }
.pb-post.cust { background: #f1f3f4; } .pb-post.us { background: #E6EBF1; }
html[data-theme="dark"] .pb-post.cust { background: #2a2d31; } html[data-theme="dark"] .pb-post.us { background: #1f2c44; }
.pb-post.child { margin-left: 28px; } .pb-post.off { opacity: .6; }
.pb-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .pb-del { margin-left: auto; }
.pb-text { width: 100%; }
.cm-box { border: 2px solid #0B2D4F; } .cm-text { width: 100%; }
@media print { .portal-head, .portal-tabs, .portal-cart, .imp-bar { display: none !important; } }

/* 🗺 업무 지도 (11-12, PC) */
.fm-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.fm-grid { display: grid; gap: 14px 34px; padding: 14px 18px; position: relative; z-index: 1; min-width: 1100px; }
.fm-lane { align-self: stretch; display: flex; align-items: center; font-weight: 700; font-size: 13px; color: var(--muted); border-right: 2px solid var(--line); padding-right: 8px; position: relative; z-index: 2; }
.fm-band { background: transparent; border-radius: 3px; z-index: 0; margin: -6px -10px; }
.fm-band.alt { background: color-mix(in srgb, var(--thbg, #E6EBF1) 55%, transparent); }
.fm-node { position: relative; z-index: 2; align-self: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 3px; padding: 8px 10px 8px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.fm-node:hover { border-color: var(--blue, #0B2D4F); }
.fm-title { font-weight: 800; text-decoration: none; color: inherit; display: block; padding-right: 18px; }
.fm-desc { margin-top: 2px; line-height: 1.35; }
.fm-help { position: absolute; top: 6px; right: 6px; text-decoration: none; font-size: 13px; }
.fm-nums { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fm-num { font-size: 12px; padding: 1px 7px; border-radius: 3px; background: var(--thbg, #E6EBF1); color: var(--muted); }
.fm-num.on { background: #E6EBF1; color: #0B2D4F; } .fm-num.on.warn { background: #FBEBDC; color: #9A4B07; }
html[data-theme="dark"] .fm-num.on { background: #1f2c44; color: #8ab4f8; } html[data-theme="dark"] .fm-num.on.warn { background: #3a3320; color: #fdd663; }
.fm-svg { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; color: #9aa0a6; overflow: visible; }
.fm-edge { fill: none; stroke: currentColor; stroke-width: 1.6; }
.fm-edge.done { stroke: #1E6B3C; color: #188038; stroke-width: 2.4; }
.fm-elabel { font-size: 11px; fill: var(--muted, #667085); paint-order: stroke; stroke: var(--card, #fff); stroke-width: 3px; }
.fm-node.st-done { border-color: #1E6B3C; background: #DDEFE3; } .fm-node.st-part { border-color: #E8912D; background: #FBEBDC; }
.fm-node.st-late { border-color: #d93025; background: #fce8e6; } .fm-node.st-todo, .fm-node.st-na { opacity: .55; }
html[data-theme="dark"] .fm-node.st-done { background: #1e3a2a; } html[data-theme="dark"] .fm-node.st-part { background: #3a3320; } html[data-theme="dark"] .fm-node.st-late { background: #3c1f1f; }
.fm-node.cur { opacity: 1; animation: fmPulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(26,115,232,.35); }
@keyframes fmPulse { 50% { box-shadow: 0 0 0 7px rgba(26,115,232,.12); } }
.fm-deal { min-width: 240px; }
.fm-grid { gap: 16px 58px; }
.fm-dealbar { display: block; }
.fm-elabel { font-size: 10.5px; }
.fm-svg { z-index: 0; }
.fm-grid { z-index: 1; }
.fm-band.alt { background: color-mix(in srgb, var(--thbg, #E6EBF1) 35%, transparent); }

/* 📥 앱으로 설치 (11-12) */
.login-wrap { flex-direction: column; }
.login-install { margin-top: 12px; font-size: 14px; }
.inst-card { max-width: 520px; }
.inst-head { display: flex; align-items: center; gap: 12px; } .inst-head h1 { margin: 0; font-size: 22px; } .inst-head .inst-lang { margin-left: auto; width: auto; }
.inst-logo { width: 56px; height: 56px; border-radius: 3px; }
.inst-btn { width: 100%; font-size: 18px; padding: 14px; }
.inst-steps { list-style: none; padding: 0; display: grid; gap: 8px; }
.inst-step { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 3px; }
.inst-n { width: 26px; height: 26px; border-radius: 50%; background: var(--blue, #0B2D4F); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.inst-ic { margin-left: auto; font-size: 20px; }
.inst-qrbox svg { width: 220px; height: 220px; }
@media print { .inst-card > *:not(.inst-qr), .inst-qr summary, .inst-qr .actions { display: none !important; } .inst-qr { display: block; } .inst-qrbox svg { width: 90mm; height: 90mm; } }
.login-install { color: #fff; } .inst-wrap .inst-card a { color: inherit; }

/* 🖨 서비스 리포트 (설계 37, 11-12): 견적서 qd 틀 + 가는 검정 선만, 색은 로고·제목만
   11-12 글자 배치: 머리글 두 줄(.sr-lab 영어 굵게 + 고른 언어 작게) · 제목 오른쪽 번호·날짜 · 쪽 사이에서 줄·사진 한 줄·노트·서명 안 잘림 */
.sr-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; padding-bottom: 2mm; margin-bottom: 3mm; border-bottom: 0.75pt solid #0B2D4F; break-inside: avoid; }
.sr .sr-title { font-size: 16pt; margin: 0; line-height: 1.15; }
.sr-top .qd-title2 { margin: 0.5mm 0 0; }
.sr-meta { border-collapse: collapse; font-size: 9pt; flex: 0 0 auto; }
.sr-meta th { text-align: left; padding: 0.6mm 3mm 0.6mm 0; vertical-align: top; font-weight: 400; }
.sr-meta td { padding: 0.6mm 0; vertical-align: top; white-space: nowrap; font-weight: 700; }
.sr-lab { display: block; line-height: 1.2; }
.sr-lab b { display: block; font-size: 8.5pt; font-weight: 700; }
.sr-lab small { display: block; font-size: 7pt; color: #555; font-weight: 400; }
.sr-h small { font-size: 8pt; color: #555; font-weight: 400; }
.sr-fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8mm; }
.sr-f { display: flex; align-items: flex-start; gap: 3mm; padding: 1.3mm 0; border-bottom: 0.4pt solid #000; font-size: 9pt; break-inside: avoid; }
.sr-f.sr-wide { grid-column: 1 / -1; }
.sr-f > .sr-lab { flex: 0 0 27mm; }
.sr-v { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 0.2mm; }
.sr-h { font-size: 10pt; font-weight: 700; margin: 5mm 0 1.5mm; break-after: avoid; }
.sr-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9pt; }
.sr-tbl th { text-align: left; font-weight: 700; padding: 1.2mm 1mm; border-top: 0.75pt solid #000; border-bottom: 0.5pt solid #000; vertical-align: bottom; }
.sr-tbl th.r .sr-lab { text-align: right; }
.sr-tbl td { padding: 1.2mm 1mm; border-bottom: 0.25pt solid #000; vertical-align: top; overflow-wrap: anywhere; }
.sr-tbl .r { text-align: right; white-space: nowrap; }
.sr-tbl tr { break-inside: avoid; }
.sr-fee { width: 100%; border-collapse: collapse; margin-top: 4mm; font-size: 9pt; break-inside: avoid; }
.sr-fee td { padding: 1.2mm 1mm; border-bottom: 0.25pt solid #000; vertical-align: middle; }
.sr-fee td.sr-fk { width: 34mm; }
.sr-fee .r { text-align: right; width: 42mm; white-space: nowrap; }
.sr-fee tr.sr-total td { border-top: 0.75pt solid #000; border-bottom: 0.75pt solid #000; font-weight: 700; font-size: 10pt; }
.sr-prow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; margin-bottom: 3mm; break-inside: avoid; page-break-inside: avoid; }
.sr-prow figure { margin: 0; break-inside: avoid; }
.sr-img { width: 100%; height: 44mm; object-fit: cover; display: block; border: 0.25pt solid #000; }
.sr-prow figcaption { font-size: 8.5pt; margin-top: 1mm; }
.sr-note { font-size: 9pt; margin-bottom: 2.5mm; break-inside: avoid; }
.sr-note > div { margin-top: 0.5mm; }
.sr-signs { width: 100%; border-collapse: collapse; margin-top: 8mm; break-inside: avoid; page-break-inside: avoid; table-layout: fixed; }
.sr-signs td { width: 50%; text-align: center; padding: 0 6mm; vertical-align: bottom; }
.sr-signs .sr-lab b, .sr-signs .sr-lab small { text-align: center; }
.sr-signbox { height: 22mm; position: relative; }
.sr-stamp { height: 22mm; width: auto; opacity: .92; }
.sr-signname { border-top: 0.5pt solid #000; padding-top: 1mm; font-size: 9pt; min-height: 4mm; }
.sr-signt { margin-top: 0.5mm; }
.sr-doc { display: flex; flex-direction: column; min-height: 100%; }
.sr-embed { break-before: page; margin-top: 10mm; padding-top: 6mm; border-top: 1px dashed #bbb; }
@media print { .sr-embed { margin-top: 0; padding-top: 0; border-top: 0; } }
.a4.sr > .sr-doc { flex: 1; }
/* 📷 서비스 사진 칸 */
.btn.tiny { padding: 2px 8px; font-size: 12px; min-height: 0; line-height: 1.6; }
.svp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.svp-item { border: 1px solid var(--line); border-radius: 3px; padding: 6px; position: relative; background: var(--card); }
.svp-no { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.6); color: #fff; border-radius: 3px; font-size: 12px; padding: 0 7px; z-index: 1; }
.svp-thumb { position: relative; height: 140px; border-radius: 3px; overflow: hidden; background: #111; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.svp-thumb img, .svp-thumb video { width: 100%; height: 100%; object-fit: cover; }
.svp-play { position: absolute; font-size: 34px; color: #fff; text-shadow: 0 1px 6px #000; }
.svp-doc { font-size: 28px; }
.svp-meta { display: grid; gap: 4px; margin-top: 6px; }
.svp-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.svp-cap { width: 100%; }
.svp-tag { width: auto; }
.svp-view img, .svp-view video { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }
.svx-box { display: grid; gap: 6px; }
.svx-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.svx-desc { flex: 1 1 160px; }
.svx-amt { width: 130px; }
.svr-tbl input { width: 100%; min-width: 0; }
.svr-tbl .svr-km, .svr-tbl .svr-h { width: 70px; }
.svr-tbl .svr-work { min-width: 180px; }
.row-inline { display: flex; gap: 6px; align-items: center; }
.row-inline > input { flex: 1; }
.p4-gallery { display: grid; gap: 8px; }
.p4-ph { margin: 0; cursor: zoom-in; }
.p4-vid { margin: 0; }
.p4-vid video { width: 100%; max-height: 60vh; background: #000; border-radius: 3px; }
.p4-photos img, .p4-big img { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* 👥 조직·업무 (설계 38) */
.org-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 10px; }
.org-team { border: 1px solid var(--line); border-radius: 3px; padding: 8px; display: grid; gap: 6px; background: var(--card); }
.org-team.on { border-color: #0B2D4F; box-shadow: 0 0 0 2px rgba(31,111,235,.18); }
.org-tname { font-weight: 700; }
.org-head-box { display: inline-block; border: 1px solid var(--line); border-radius: 3px; padding: 6px 14px; margin-bottom: 10px; }
.org-tbl td.c, .org-tbl th.c { text-align: center; width: 70px; }
.org-tbl tr.org-g th { background: var(--thbg); text-align: left; }
.org-tbl tr.org-off td { opacity: .45; }
.org-tbl tr.org-exc td { background: #FBEBDC; }
html[data-theme="dark"] .org-tbl tr.org-exc td { background: #4a3f12; }
/* ⠿ 표 줄 끌어 옮기기 (11-12) */
.tbl.dt td.dt-drag, .tbl.dt th:first-child .dt-drag-h { width: 22px; color: var(--muted, #888); cursor: grab; text-align: center; user-select: none; }
.tbl.dt tr.dt-draggable.dt-dragging { opacity: .45; }
.tbl.dt tr.dt-over td { box-shadow: inset 0 2px 0 var(--brand2, #0B2D4F); }
/* 🖨 모든 서류 A4 쪽 나눔 (11-12 대표님): 넘치면 줄·서명·사진은 중간에서 안 잘리고 통째로 다음 장, 표 머리글은 다음 장에 다시. 꼬리말 = core/printfoot.js */
@media print {
  .a4 thead { display: table-header-group; }
  .a4 tr, .a4 figure, .a4 img, .a4 .sign, .a4 .signs, .a4 .sig, .a4 [class*="sign"], .a4 .avoid-break { break-inside: avoid; page-break-inside: avoid; }
  .a4 h1, .a4 h2, .a4 h3 { break-after: avoid; }
}

/* 🪪 명함 (V2.1.3, 설계 44) — 색은 변수만 (어두운 화면 자동) */
.bc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bc-subchips .chip { min-height: 30px; font-size: 12.5px; }
.bc-thumb { display: inline-flex; width: 64px; height: 38px; align-items: center; justify-content: center; border-radius: 3px; overflow: hidden; background: var(--thbg); font-size: 20px; }
.bc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bc-thumb-td { width: 72px; }
.bc-more { margin-top: 8px; width: 100%; }
/* 명함 고르기 한 줄 + 🏢 회사별 (11-21) */
.bc-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bc-sel { flex: 1 1 120px; min-width: 0; max-width: 220px; min-height: 36px; }
.bc-sel:empty { display: none; }
.bc-views { display: flex; gap: 4px; margin-left: auto; }
.bc-co { border: 1px solid var(--line); border-radius: 3px; background: var(--card); margin-bottom: 6px; }
.bc-co > summary { display: flex; align-items: center; gap: 4px; padding: 10px 12px; cursor: pointer; list-style: none; min-height: 44px; }
.bc-co > summary::-webkit-details-marker { display: none; }
.bc-co-name { font-weight: 600; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-co-n { margin-left: auto; flex: none; font-size: 12.5px; padding: 2px 8px; border-radius: 3px; background: var(--thbg); }
.bc-co-un .bc-co-name { font-weight: 500; }
.bc-co-list { border-top: 1px solid var(--line); }
.bc-co-p { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: inherit; text-decoration: none; min-height: 44px; }
.bc-co-p + .bc-co-p { border-top: 1px solid var(--line); }
.bc-co-pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .bc-sel { max-width: none; flex-basis: 40%; } .bc-views { width: 100%; margin-left: 0; } .bc-views .bc-view { flex: 1; } }
.bc-lock { font-size: 12px; }
.bc-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bc-shot { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--line); border-radius: 3px; padding: 8px; }
.bc-shot-prev { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; background: var(--thbg); border-radius: 3px; overflow: hidden; font-size: 24px; }
.bc-shot-prev img { width: 100%; height: 100%; object-fit: contain; }
.bc-shot-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.bc-shot-btns .btn { position: relative; overflow: hidden; min-height: 40px; }
.bc-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.bc-read { min-height: 44px; }
.bc-dlg-photo { max-width: 420px; margin: 0 auto 8px; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.bc-dlg-photo img { width: 100%; display: block; }
.bc-cands { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.bc-dup { padding: 6px 0; border-top: 1px solid var(--line); }
.bc-dup-btns { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.bc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.bc-photo img { width: 100%; border-radius: 3px; border: 1px solid var(--line); display: block; }
.bc-photo .btn.tiny { margin-left: 6px; padding: 0 6px; min-height: 24px; }
.bc-links { display: flex; flex-wrap: wrap; gap: 4px; }
.bc-jobs { display: flex; flex-direction: column; gap: 6px; }
.bc-job { padding: 6px 8px; border-left: 3px solid var(--line); }
.bc-job.now { border-left-color: var(--green); }
.bc-job .badge { margin-left: 6px; }
.bc-fixjob { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; padding: 4px 0; }
.bc-pbox { margin-top: 10px; }
.bc-plist { display: flex; flex-direction: column; gap: 2px; }
.bc-prow { display: block; padding: 6px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; min-height: 36px; }
.bc-former summary { cursor: pointer; padding: 6px 0; color: var(--muted); }
tr.bc-private td { opacity: .85; }
@media (max-width: 860px) {
  .bc-shots { grid-template-columns: 1fr; }
  .bc-fixjob { grid-template-columns: 1fr 1fr; }
  .bc-thumb { width: 96px; height: 58px; }
}
/* 설계 46: 받을 돈 일정·납기 일정 표 — 폰에서 화면 폭을 넘지 않게 가로 스크롤 (11-14) */
@media (max-width: 860px) { table.ar-sched, table.sch-tbl, .arc-row .row-inline { display: block; overflow-x: auto; max-width: 100%; } }
/* 👔 법인장 ⇄ 💼 영업 모드 버튼 (설계 48, 11-14) */
.mode-chip { border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; border-radius: 3px; padding: 4px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mode-chip.sales { background: #E8912D; color: #3a2400; border-color: #E8912D; font-weight: 600; }

/* 🔰 초보 안내 (설계 47, 11-14) */
.gd-box { margin-top: 8px; padding: 10px 12px; border-radius: 3px; background: #FBEBDC; border: 1px solid #F6C89A; font-size: 14px; line-height: 1.6; }
.gd-title { font-weight: 700; margin-bottom: 4px; }
details.gd-box > summary.gd-title { cursor: pointer; list-style: none; margin-bottom: 0; }
details.gd-box > summary.gd-title::-webkit-details-marker { display: none; }
details.gd-box > summary.gd-title::before { content: '▾ '; }
details.gd-box:not([open]) > summary.gd-title::before { content: '▸ '; }
details.gd-box[open] > summary.gd-title { margin-bottom: 4px; }
details.gd-box:not([open]) { padding-top: 6px; padding-bottom: 6px; }
.gd-row b { color: #7a5200; }
html[data-theme="dark"] .gd-box { background: #3a3320; border-color: #6b5a2a; }
html[data-theme="dark"] .gd-row b { color: #f1d38a; }
.nx-card.dim { opacity: .7; }
.nx-card .gd-box { margin-top: 6px; }

/* 설계 50: 왼쪽 메뉴 닫기·아이콘만 · ⭐ 내 메뉴 · 묶음 접기 · 맨 위로 (11-14, PC) */
.nav-sec-head { display: flex; align-items: center; gap: 4px; margin: 6px 0 2px; }
.nav-sec-btn { flex: 1; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 6px 8px; font-weight: 700; font-size: 13px; color: var(--muted, #667); cursor: pointer; border-radius: 3px; }
.nav-sec-btn:hover { background: var(--thbg); }
.nav-sec.closed .nav-sec-body { display: none; }
.nav-sec.closed .nav-sec-car { transform: rotate(-90deg); }
.nav-sec-car { transition: transform .15s; }
.nav-fold-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 7px 10px; cursor: pointer; border-radius: 3px; text-align: left; font: inherit; }
.nav-fold-head:hover { background: var(--thbg); }
.nav-fold-body { padding-left: 14px; }
.nav-fold-body.closed { display: none; }
.mymenu-ed .mm-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.mymenu-ed .mm-row.in { padding-left: 22px; }
.mymenu-ed .mm-row.folder { background: var(--thbg); padding: 6px; border-radius: 3px; }
.mymenu-ed .mm-name { flex: 1; }
.mymenu-ed .mm-fname { flex: 1; font-weight: 600; }
.to-top { position: fixed; right: 22px; bottom: 96px; z-index: 35; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); cursor: pointer; font-size: 16px; }
@media (min-width: 861px) {
  body.nav-icons .nav { width: 60px !important; padding: 10px 4px; overflow-x: hidden; }
  body.nav-icons .nav .nav-item > span:not(.nav-icon), body.nav-icons .nav .nav-star, body.nav-icons .nav .nav-grip, body.nav-icons .nav .nav-group-head, body.nav-icons .nav .nav-sec-head, body.nav-icons .nav .nav-fav-hint, body.nav-icons .nav .nav-fold-head > span:not(.nav-icon), body.nav-icons .nav-resize { display: none !important; }
  body.nav-icons .nav .nav-group-body.closed, body.nav-icons .nav .nav-sec.closed .nav-sec-body { display: block; }
  body.nav-icons .nav .nav-item { justify-content: center; padding: 8px 0; }
  body.nav-icons .nav .nav-fold-body { padding-left: 0; }
  body.nav-hidden .nav, body.nav-hidden .nav-resize { display: none; }
  body.nav-hidden.nav-peek .nav { display: block; position: fixed; left: 0; top: 56px; bottom: 0; z-index: 45; height: auto; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
}

/* 🏠 새 HOME (설계 51, 11-14, PC) */
.hd-hello { display: flex; align-items: baseline; gap: 12px; }
.hd-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hd-kpi { display: block; padding: 12px 14px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.hd-kpi:hover { box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.hd-kpi-n { font-size: 24px; font-weight: 700; line-height: 1.2; }
.hd-kpi-l { font-size: 13px; color: var(--muted, #667); }
.hd-kpi.tone-red { border-left: 5px solid #e06666; }
.hd-kpi.tone-red .hd-kpi-n { color: #c0392b; }
.hd-kpi.tone-amber { border-left: 5px solid #E8912D; }
.hd-kpi.tone-gray { border-left: 5px solid #b7b7b7; }
.hd-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .hd-cols { grid-template-columns: 1fr; } }
.hd-head { display: flex; justify-content: space-between; align-items: center; }
.hd-list { display: flex; flex-direction: column; }
.hd-row, .hd-ev { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.hd-row:hover, .hd-ev:hover { background: var(--thbg); }
.hd-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-ev-d { width: 52px; font-size: 13px; color: var(--muted, #667); }
.hd-ev.today .hd-ev-d { color: #c0392b; font-weight: 700; }
.hd-week .btn { margin-top: 8px; margin-right: 6px; }
html[data-theme="dark"] .hd-kpi.tone-red .hd-kpi-n { color: #ff8a80; }
@media (max-width: 860px) { .to-top { display: none !important; } } /* 설계 50: 폰은 아래 저장 버튼을 가리지 않게 숨김 */
/* 📁 영업 프로젝트 일정 막대 (설계 42, 11-14) */
.pj-tl { position: relative; height: 46px; margin: 10px 8px 14px; }
.pj-tl-line { position: absolute; left: 0; right: 0; top: 22px; height: 3px; background: var(--line); border-radius: 2px; }
.pj-tl-today { position: absolute; top: 6px; bottom: 6px; width: 2px; background: #e06666; }
.pj-tl-dot { position: absolute; top: 10px; transform: translateX(-50%); font-size: 18px; cursor: default; }
.pj-tl-dot.est { opacity: .55; }
.pj-ev tr.late td { color: #c0392b; }

/* ✉️ 쪽지 (설계 49, 2026-11-14): 오른쪽 아래 떠 있는 버튼 + 오른쪽에 붙는 창(본문을 밀어서, 폭 조절) */
:root { --memo-w: 380px; }
.memo-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--brand2); color: #fff; font-size: 24px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); cursor: pointer; }
.memo-fab:hover { filter: brightness(1.1); }
.memo-fab-n { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #d93025; color: #fff; font-size: 12px; line-height: 20px; font-weight: 700; }
body.memo-open .memo-fab { right: calc(var(--memo-w) + 18px); }
.memo-dock { position: fixed; top: 0; right: 0; bottom: 0; width: var(--memo-w); z-index: 55; background: var(--card); border-left: 1px solid var(--line); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); display: flex; flex-direction: column; color: var(--text); }
.memo-dock[hidden] { display: none; }
body.memo-open .layout { margin-right: var(--memo-w); }
.memo-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.memo-grip:hover { background: rgba(29,95,168,.2); }
.memo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.memo-head-act { display: flex; gap: 6px; align-items: center; }
.memo-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.memo-tab { border: 0; background: none; color: var(--muted); padding: 5px 8px; border-radius: 3px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.memo-tab.on { background: var(--brand2); color: #fff; }
.memo-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 3px; background: #d93025; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.memo-body { flex: 1; overflow-y: auto; padding: 8px 10px 80px; }
.memo-q { width: 100%; margin-bottom: 8px; }
.memo-list { display: flex; flex-direction: column; gap: 6px; }
.memo-row { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 3px; padding: 8px 10px; cursor: pointer; position: relative; }
.memo-row:hover { border-color: var(--brand2); }
.memo-row.unread { border-left: 4px solid var(--brand2); }
.memo-row.unread .memo-row-sub b { font-weight: 800; }
.memo-row-top { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.memo-row .chip-row { margin-top: 4px; }
.memo-card { border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; }
.memo-card.urgent { border-left: 4px solid #d93025; }
.memo-detail { display: flex; flex-direction: column; gap: 8px; min-height: 100%; }
.memo-detail-head { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.memo-subj { font-weight: 700; font-size: 15px; }
.memo-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.memo-b { align-self: flex-start; max-width: 92%; background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 6px 10px; }
.memo-b.mine { align-self: flex-end; background: rgba(29,95,168,.08); }
.memo-txt { white-space: pre-wrap; word-break: break-word; }
.memo-react { display: flex; gap: 4px; opacity: .55; font-size: 13px; }
.memo-b:hover .memo-react { opacity: 1; }
.memo-composer { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 6px; }
.memo-ta { width: 100%; resize: vertical; }
.memo-tools { display: flex; align-items: center; gap: 4px; }
.memo-emoji { display: flex; flex-wrap: wrap; gap: 4px; font-size: 18px; }
.memo-pop-wrap { position: fixed; right: 18px; bottom: 80px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: 300px; }
body.memo-open .memo-pop-wrap { right: calc(var(--memo-w) + 18px); }
.memo-pop { background: var(--card); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--brand2); border-radius: 3px; padding: 8px 10px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); display: flex; flex-direction: column; gap: 4px; }
.memo-pop-head { display: flex; justify-content: space-between; align-items: center; }
.memo-plist { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px; margin-top: 4px; display: flex; flex-direction: column; }
.memo-p, .memo-pall { padding: 2px 0; cursor: pointer; }
.memo-kind { display: flex; gap: 4px; }
.memo-compose .row-inline { display: flex; gap: 6px; }
@media (min-width: 861px) { .topbar .chat-btn { display: none; } } /* PC: 💬 대화는 쪽지 창 안에서 */
@media (max-width: 860px) {
  .memo-dock { width: 100%; z-index: 90; }
  body.memo-open .layout { margin-right: 0; }
  .memo-fab { width: 46px; height: 46px; font-size: 20px; bottom: 76px; right: 12px; }
  body.memo-open .memo-fab { display: none; }
  .memo-pop-wrap { right: 12px; left: 12px; width: auto; bottom: 130px; }
  /* V2.6.1 폰: 누르기 쉬운 크기 · 쪽지 답장 칸은 화면 아래 고정 · PC 안내 숨김 */
  .memo-tab, .memo-sub .seg-btn, .memo-dock .actions .btn { min-height: 44px; font-size: 15px; padding: 6px 12px; }
  .memo-body { padding-bottom: 8px; }
  .memo-detail { min-height: 100%; }
  .memo-msgs { max-height: none; flex: 1; }
  .memo-detail > .memo-composer { position: sticky; bottom: 0; background: var(--card); padding-bottom: calc(8px + env(safe-area-inset-bottom)); margin-top: auto; }
  .memo-detail .memo-ta { font-size: 16px; }
  .memo-at-hint, .memo-tools > .small.muted { display: none; }
  .memo-tools { justify-content: space-between; }
  .memo-tools .icon-btn { min-width: 44px; min-height: 44px; font-size: 20px; }
  .memo-tools .memo-send { min-height: 44px; margin-left: auto; }
}
@media print { .memo-fab, .memo-dock, .memo-pop-wrap { display: none !important; } body.memo-open .layout { margin-right: 0; } }
body.memo-open .to-top { right: calc(var(--memo-w) + 22px); }
.memo-emoji[hidden] { display: none; }
.memo-p, .memo-pall { display: flex; align-items: center; gap: 6px; }
.memo-plist input[type=checkbox], .memo-pall input[type=checkbox] { width: auto; height: auto; margin: 0; flex: none; }
.memo-compose .row-inline select { flex: 0 0 220px; width: 220px; }
.memo-compose .row-inline input { flex: 1; min-width: 0; }
.memo-react button, .memo-emoji button { border: 0; background: none; padding: 2px 3px; min-height: 0; min-width: 0; width: auto; box-shadow: none; font-size: inherit; }
.memo-tools .icon-btn { border: 0; background: none; }
.memo-detail-head > .btn:first-child { align-self: flex-start; }
.memo-dock .chip .linklike { border: 0; background: none; padding: 0 2px; min-height: 0; width: auto; color: inherit; }
.memo-compose input[type=checkbox] { width: auto; height: auto; flex: none; margin: 0 4px 0 0; vertical-align: middle; }
.memo-compose .chip .linklike { border: 0; background: none; padding: 0 2px; min-height: 0; width: auto; color: inherit; }

/* 🔰 초보 모드 3차 (설계 47 C·D): 버튼 옆 ❔ · 처음 화면 따라하기 */
.bt-q { border: 0; background: #F6C89A; color: #7a5a00; border-radius: 50%; width: 22px; height: 22px; min-height: 0; padding: 0; font-size: 12px; line-height: 22px; margin-left: 2px; cursor: help; vertical-align: middle; flex: none; }
.bt-tip { position: absolute; z-index: 120; max-width: 300px; background: #FBEBDC; color: #3a3320; border: 1px solid #F6C89A; border-radius: 3px; padding: 8px 10px; font-size: 13px; line-height: 1.5; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.tour-pop { position: fixed; z-index: 130; width: 320px; background: #FBEBDC; color: #3a3320; border: 2px solid #E8912D; border-radius: 3px; padding: 10px 12px; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); display: flex; flex-direction: column; gap: 6px; }
.tour-txt { font-size: 14px; line-height: 1.55; }
.tour-on { outline: 3px solid #E8912D !important; outline-offset: 3px; border-radius: 3px; position: relative; z-index: 2; }
html[data-theme="dark"] .bt-tip, html[data-theme="dark"] .tour-pop { background: #3a3320; color: #f3e7c0; border-color: #6b5a2a; }
html[data-theme="dark"] .bt-q { background: #4a3f20; color: #f3e7c0; }
@media (max-width: 860px) { .memo-fab, .memo-pop-wrap { display: none !important; } } /* 폰은 나중 (대표님 11-14: PC 먼저) — 아래 저장 버튼을 가리지 않게, 쪽지는 메뉴 📨 쪽지로 */
/* ✉️ 버튼이 아래 고정 저장 줄(.sticky-actions)을 가리지 않게 — 그 화면에서는 위로 */
body:has(.main .sticky-actions) .memo-fab { bottom: 92px; }
body:has(.main .sticky-actions) .memo-pop-wrap { bottom: 154px; }
body:has(.main .sticky-actions) .to-top { bottom: 156px; }
/* ✉️ 쪽지 3·4차: 재고 카드 · 3줄 요약 · 사진 표시 */
.memo-stock-wrap { display: inline-flex; flex-direction: column; gap: 4px; }
.memo-stock { border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; background: var(--card); }
.memo-sumbox { border: 1px dashed var(--brand2); border-radius: 3px; padding: 6px 10px; margin-top: 4px; }
.memo-sumbox ul { margin: 4px 0 0 18px; padding: 0; }
.pm-wrap { max-height: 70vh; overflow: auto; text-align: center; }
.pm-canvas { max-width: 100%; max-height: 66vh; touch-action: none; cursor: crosshair; border: 1px solid var(--line); }
.mon-cb { color: #9A4B07; margin-left: 1px; } .mon-cb-note { color: #8a5a00; }
.ent-switch { cursor: pointer; border: 0; font: inherit; } /* 🌏 허브 사장 작업 법인 */
/* 💳 견적 결제 조건 (11-16): 고르기 칸 + 문구 미리보기 + 단계 고치기 */
/* 📋 이 고객의 지난 견적 (V2.5.1) */
.grid2 > .qt-past { grid-column: 1 / -1; }
.qt-past { border: 1px solid var(--line); border-left: 3px solid var(--brand, #0B2D4F); border-radius: 3px; padding: 8px 12px; background: var(--thbg, #f7f8fa); }
.qt-past[hidden] { display: none; }
.qt-past-h { font-weight: 600; margin-bottom: 4px; }
.qt-past-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); }
.qt-past-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-past-amt { font-variant-numeric: tabular-nums; }
.qt-past-help { margin: 4px 0 0; }
@media (max-width: 860px) { .qt-past-row { grid-template-columns: auto auto minmax(0, 1fr); } .qt-past-row .qt-past-go { grid-column: 1 / -1; } }
.pay-box .pay-sel { max-width: 460px; }
.pay-preview { background: var(--thbg, #f7f8fa); border: 1px dashed var(--line); border-radius: 3px; padding: 6px 10px; }
.pay-fold > summary { cursor: pointer; color: var(--brand2); font-size: 13px; padding: 2px 0; }
/* 11-16 대표님: 머리줄 오른쪽(내 정보)이 잘림 → 시계 줄이 먼저 줄어들고, 오른쪽 버튼·이름표는 그대로 */
.top-right { flex: 0 0 auto; }
.top-right > * { flex-shrink: 0; }
.top-right .user-chip { min-width: 2.5em; }
.top-search input { width: clamp(130px, 13vw, 220px); }
.ent-switch { max-width: 96px; }
@media (max-width: 1500px) and (min-width: 861px) { .topbar .lang-select { display: none; } } /* 좁은 PC: 언어는 👤 내 정보에서 */
/* 11-16 다크 모드: 회사 남색(--brand) 글자는 어두운 배경에 묻힘 → 밝은 파랑 */
html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .prd-tree .on,
html[data-theme="dark"] .wk-day.wd-today,
html[data-theme="dark"] .login-brand { color: #8fbfff; }
html[data-theme="dark"] .ph { background: #1f3550; color: #cfe2ff; }
.topbar .world-clocks { flex: 1 1 0; }
/* PC 도 이름 글자 대신 👤 동그라미 (이름이 길거나 버튼이 많으면 잘리던 것) — 이름은 마우스를 올리면 */
.topbar .user-chip { display: none; }
.topbar .me-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 18px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.92); flex-shrink: 0; }
.ent-switch { width: 92px; flex: 0 0 92px; }
/* 📌 견적 제목 줄 (11-16) */
.sec-row { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border-bottom: 2px solid var(--line); background: var(--thbg, #f7f8fa); }
.sec-row .sec-in { flex: 1; font-weight: 700; font-style: italic; min-width: 0; }
.sec-row .sec-txt { font-style: italic; }
.sec-row .sec-act { display: flex; gap: 4px; }
tr.lt-sec > td { padding: 0 !important; }
.lt-adds { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.qt-sec-t { color: var(--brand2); font-style: italic; }
.qd-sec td { padding-top: 8px !important; border-bottom: 0 !important; }
.sec-row .sec-in { max-width: 760px; }
.grp-edit .sub-row input.mono { width: 110px; }
/* 🔀 발주 경로 색 (설계 55 4-4 D21): 본사 제작 = 주황 · 한국 재고 = 파랑 · 베트남 재고 = 초록 */
.po-route-sel.route-hq { border-color: #E8912D; background: #F6C89A; color: #9A4B07; }
.po-route-sel.route-kr { border-color: #0B2D4F; background: #E6EBF1; color: #0B2D4F; }
.po-route-sel.route-hub { border-color: #1E6B3C; background: #DDEFE3; color: #14532d; }

/* 🏦 과거 은행 돈 분류표 (11-19 대표님 "보기 좋게·입력하기 좋게, 글자가 너무 작아") */
.pcl { font-size: 16px; }
.pcl-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.pcl-tolabel { font-size: 16px; font-weight: 600; }
.pcl-to { font-size: 16px; padding: 6px 8px; }
.pcl-sub { color: var(--label); font-size: 15px; }
.pcl-todo { font-size: 16px; }
.pcl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pcl-tile { border-radius: 3px; padding: 14px 16px; border: 1px solid var(--line); background: var(--card); }
.pcl-tile-l { font-size: 15px; font-weight: 600; color: var(--label); }
.pcl-tile-v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pcl-t-in { border-left: 6px solid var(--green); } .pcl-t-cogs { border-left: 6px solid var(--amber); }
.pcl-t-opex { border-left: 6px solid var(--blue); } .pcl-t-net { border-left: 6px solid var(--brand); } .pcl-t-bad { border-left: 6px solid var(--red); }
.pcl-t-bad .pcl-tile-v { color: var(--red); }
.pcl-hint { font-size: 15px; color: var(--label); margin: 0; }
.pcl-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.pcl-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
.pcl-table th, .pcl-table td { padding: 9px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.pcl-table thead th { position: sticky; top: 0; z-index: 2; background: var(--thbg); font-size: 15px; color: var(--label); border-bottom: 2px solid var(--line); }
.pcl-table .num { text-align: right; min-width: 84px; }
.pcl-table .pcl-name { position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; min-width: 230px; max-width: 320px; white-space: normal; font-weight: 500; }
.pcl-table thead .pcl-name { z-index: 3; background: var(--thbg); }
.pcl-table .pcl-tot { font-weight: 700; }
.pcl-table td:last-child { font-weight: 700; background: color-mix(in srgb, var(--thbg) 60%, transparent); }
.pcl-row:hover td, .pcl-row:hover th { background: var(--hover); }
.pcl-row th.pcl-name { padding-left: 26px; }
.pcl-head th, .pcl-head td { font-weight: 700; font-size: 16px; }
.pcl-head.pcl-b-in th, .pcl-head.pcl-b-in td { background: #DDEFE3; } .pcl-head.pcl-b-in2 th, .pcl-head.pcl-b-in2 td { background: #E6EBF1; }
.pcl-head.pcl-b-cogs th, .pcl-head.pcl-b-cogs td { background: #FBEBDC; } .pcl-head.pcl-b-opex th, .pcl-head.pcl-b-opex td { background: #E6EBF1; }
.pcl-head.pcl-b-out2 th, .pcl-head.pcl-b-out2 td { background: #E6EBF1; }
.pcl-net th, .pcl-net td { font-weight: 800; font-size: 17px; border-top: 2px solid var(--brand); background: var(--grpbg); }
.pcl-table .neg { color: var(--red); }
.pcl-table .zero { color: var(--line); }
.pcl-todo-row th.pcl-name { color: var(--amber); }
.pcl-cell { background: none; border: 0; padding: 2px 4px; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; border-radius: 3px; }
.pcl-cell:hover { background: var(--grpbg); text-decoration: underline; }
.pcl-help summary { cursor: pointer; font-size: 15px; color: var(--label); }
.pcl-help p { font-size: 15px; line-height: 1.6; }
/* 줄 카드 (입력) */
.pcl-lines { font-size: 16px; }
.pcl-count { font-size: 15px; font-weight: 600; color: var(--label); }
.pcl-warn { color: var(--amber); font-size: 15px; } 
.pcl-card { border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 3px; padding: 12px 14px; display: grid; gap: 6px; background: var(--card); }
.pcl-card.in { border-left-color: var(--green); } .pcl-card.out { border-left-color: var(--amber); }
.pcl-card.done { background: color-mix(in srgb, var(--green) 7%, var(--card)); }
.pcl-card-top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
.pcl-date { font-size: 15px; color: var(--label); }
.pcl-amt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pcl-who { font-size: 17px; font-weight: 600; }
.pcl-memo { font-size: 15px; color: var(--text); word-break: break-word; }
.pcl-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; color: var(--label); }
.pcl-doc { font-size: 13px; }
.pcl-note { font-size: 15px; color: var(--label); }
.pcl-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.pcl-sug { display: inline-flex; flex-direction: column; align-items: flex-start; min-height: 48px; padding: 6px 14px; font-size: 16px; text-align: left; }
.pcl-sug-name { font-weight: 700; }
.pcl-sug-why { font-size: 13px; opacity: .85; font-weight: 400; }
.pcl-other { font-size: 16px; min-height: 44px; padding: 6px 8px; max-width: 100%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pcl-head th, :root:not([data-theme="light"]) .pcl-head td { background: var(--grpbg) !important; } }
:root[data-theme="dark"] .pcl-head th, :root[data-theme="dark"] .pcl-head td { background: var(--grpbg) !important; }

/* 📊 거래 진행 띠 고정 + 서류 버튼 (11-19 대표님: 스크롤해도 고정, 저장·발행 버튼 띠 안으로) */
@media (min-width: 861px) { .df-bar.df-stick { position: sticky; top: 56px; z-index: 25; background: linear-gradient(rgba(239, 108, 0, .07), rgba(239, 108, 0, .07)), var(--bg); box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); } }
.df-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border-top: 1px dashed rgba(239, 108, 0, .45); padding-top: 6px; }
.df-acts-label { font-weight: 700; font-size: 14px; }
.df-acts-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.df-acts-btns > .btn, .df-acts-btns > a.btn, .df-acts-btns > button { flex: 0 0 auto; }
.df-moved:empty { display: none !important; }
.mm-gd-box { display: grid; gap: 6px; padding: 10px 12px; margin-bottom: 10px; }

/* 좌측 메뉴 가독성 (11-19 대표님): 아이콘은 묶음 머리에만 · 묶음 머리 크게 · Alt 단축키 표시 */
body:not(.nav-icons) .nav .nav-row .nav-icon { display: none; }
body:not(.nav-icons) .nav .nav-row .nav-item { padding-left: 14px; font-size: 15px; }
body:not(.nav-icons) .nav .nav-group-body .nav-item { padding-left: 22px; }
.nav-group-head { font-size: 14px !important; font-weight: 800 !important; color: var(--text) !important; padding: 12px 10px 6px !important; letter-spacing: .01em; }
.nav-group-name { display: inline-flex; gap: 6px; align-items: center; }
.nav-label { flex: 1; min-width: 0; }
.nav-kbd { font: 600 10.5px/1 ui-monospace, Consolas, monospace; color: var(--label); background: var(--thbg); border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px; opacity: .75; white-space: nowrap; }
.nav-item.active .nav-kbd { opacity: 1; }
body.nav-icons .nav-kbd { display: none; }
@media (max-width: 860px) { .nav-kbd { display: none; } }
.kb-table { border-collapse: collapse; font-size: 15px; } .kb-table td { padding: 6px 12px; border-bottom: 1px solid var(--line2); }
.kb-table kbd { font: 600 13px ui-monospace, Consolas, monospace; background: var(--thbg); border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; }

/* 견적서 (11-19 대표님): 오른쪽 칸 없음 · 이익률 위에 고정 · 합계 입력 맨 아래 */
@media (min-width: 861px) { .profit-sticky { position: sticky; top: 56px; z-index: 20; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); } }
.df-profit .profit-sticky { position: static; box-shadow: none; margin: 0; }
.df-profit { border-top: 1px dashed rgba(239, 108, 0, .45); padding-top: 6px; }
.df-profit .profit-total { padding: 6px 10px; }
.sales-totals-bottom { max-width: 560px; margin-left: auto; font-size: 16px; }

/* 📎 고객 PO 자료 (11-19) */
.cpo-list { display: grid; gap: 6px; margin-top: 8px; }
.cpo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.cpo-name { font-weight: 600; }
.cpo-upbtn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cpo-upbtn input[type=file] { display: none; }

/* 견적 이익률 한 줄 (11-19 대표님: 띠가 두꺼움) */
.profit-sticky { padding: 4px 10px !important; }
.pf-line { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; font-size: 15px; }
.pf-info { cursor: help; color: var(--label); }
.pf-warn { color: var(--amber); font-weight: 600; }
.df-acts-btns > .btn, .df-acts-btns > a.btn, .df-acts-btns > button { min-height: 34px; padding: 4px 12px; font-size: 14px; } /* 띠 얇게 (11-19) */
.df-bar.df-stick { gap: 4px; padding-top: 6px; padding-bottom: 6px; }

/* 🤖 AI 비서 대화방 (11-19) */
.ai-room { display: flex; flex-direction: column; min-height: 0; }
.ai-log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.ai-msg { display: flex; } .ai-msg.me { justify-content: flex-end; }
.ai-bub { max-width: min(720px, 92%); padding: 10px 12px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); font-size: 15px; white-space: pre-wrap; }
.ai-msg.me .ai-bub { background: var(--grpbg); }
.ai-card { display: grid; gap: 8px; white-space: normal; }
.ai-intents { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ai-answer { white-space: pre-wrap; line-height: 1.55; }
.ai-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.ai-input-row .ai-in { flex: 1; font-size: 15px; }
.chat-av.k-ai { background: var(--grpbg); }

/* 11-19 묶음 4·6·7 */
.po-no-show[hidden], .po-in-row[hidden], .memo-sugg[hidden], .memo-at[hidden] { display: none !important; }
.po-no-text { font-size: 1.1em; padding: 4px 10px; border: 1px solid var(--line, #d0d7de); border-radius: 3px; background: var(--card, #fff); }
.cm-fold > summary { cursor: pointer; list-style: revert; }
.cm-fold .cm-prev { margin-left: 6px; }
.memo-at { border: 1px solid var(--line, #d0d7de); border-radius: 3px; max-height: 220px; overflow: auto; background: var(--card, #fff); }
.memo-at-item, .memo-sugg .memo-p { display: block; width: 100%; text-align: left; padding: 6px 8px; border: 0; background: none; cursor: pointer; }
.memo-at-item:hover, .memo-sugg .memo-p:hover { background: var(--hover, #E6EBF1); }
.memo-sugg { border: 1px solid var(--line, #d0d7de); border-radius: 3px; max-height: 240px; overflow: auto; }
.pr-catcount { margin: 4px 0; }
.po-rule-row .po-rule-hint { flex-basis: 100%; }
.po-no-text { white-space: nowrap; }
/* 📎 견적 자료 (설계 62, 11-20) */
.cpo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cpo-group { display: grid; gap: 6px; }
.cpo-ghead { font-weight: 600; color: var(--muted, #667); margin-top: 4px; }
.cpo-over { outline: 2px dashed var(--accent, #0B2D4F); outline-offset: 4px; }
/* 💰 손익 요약 (법인장 HOME, 11-20) */
.ps-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ps-head .card-title { margin: 0; }
.ps-tabs { display: inline-flex; gap: 4px; }
.ps-nav { display: inline-flex; align-items: center; gap: 6px; }
.ps-period { min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.ps-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 10px; }
@media (max-width: 1100px) { .ps-body { grid-template-columns: minmax(0, 1fr); } }
.ps-tbl td { padding: 6px 8px; vertical-align: top; }
.ps-no { width: 26px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ps-amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.ps-amt.neg { color: var(--red); }
.ps-side { white-space: nowrap; color: var(--muted); }
.ps-row.sub td { border-top: 2px solid var(--line2, var(--line)); }
.ps-row.key td { background: var(--grpbg, var(--thbg)); font-weight: 700; }
.ps-delta.good { color: var(--green); }
.ps-delta.bad { color: var(--red); }
.ps-chartwrap { overflow-x: auto; }
.ps-chart { width: 100%; height: auto; min-width: 320px; display: block; }
.ps-grid { stroke: var(--line); stroke-width: 1; }
.ps-zero { stroke: var(--muted); stroke-width: 1; }
.ps-ax { fill: var(--muted); font-size: 10px; }
.ps-bar.ps-revenue, .ps-key.ps-revenue { fill: var(--blue); background: var(--blue); }
.ps-bar.ps-cogs, .ps-key.ps-cogs { fill: var(--muted); background: var(--muted); opacity: .55; }
.ps-bar.ps-net, .ps-key.ps-net { fill: var(--green); background: var(--green); }
.ps-bar.ps-net.neg { fill: var(--red); }
.ps-line { fill: none; stroke: var(--amber); stroke-width: 2; }
.ps-dot { fill: var(--amber); }
.ps-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); margin-top: 4px; }
.ps-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.ps-key.ps-linekey { background: var(--amber); height: 3px; vertical-align: 3px; }
/* 📎 견적 자료 접기·펴기 (11-20) */
.cpo-fold > summary.cpo-sum { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; }
.cpo-fold > summary.cpo-sum::-webkit-details-marker { display: none; }
.cpo-fold > summary.cpo-sum::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.cpo-fold[open] > summary.cpo-sum::before { transform: rotate(90deg); }
.cpo-fold[open] > summary.cpo-sum { margin-bottom: 8px; }
.cpo-count:empty { display: none; }
.cpo-count { font-size: 12px; font-weight: 600; background: var(--thbg); border-radius: 3px; padding: 1px 8px; color: var(--muted); }
/* 📱 폰 v1 (설계 63 4장, 11-21): 아래 탭 5개 · 고객 탭 · 더보기 · 견적 보기 — PC(>860px)에서는 아래 탭·폰 전용 요소가 안 보임 */
.mbar, .pc-only-bar, .ph-only { display: none; }
@media (max-width: 860px) {
  .mbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--card); border-top: 1px solid var(--line); height: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .mbar-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; color: var(--muted); text-decoration: none; min-height: 44px; }
  .mbar-tab i { font-style: normal; font-size: 20px; line-height: 1.1; }
  .mbar-tab.on { color: var(--brand); font-weight: 700; }
  .mbar-tab.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .mbar-dot { position: absolute; top: 5px; right: 20%; background: var(--red); color: #fff; font-style: normal; font-size: 10px; border-radius: 9px; padding: 0 5px; line-height: 15px; min-width: 15px; text-align: center; }
  body:not(.pcview) .main { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  body:not(.pcview) .nav-row.ph-hide { display: none; }
  .pc-only-bar:not([hidden]) { display: block; margin: 0 0 10px; padding: 10px 12px; border-radius: 3px; background: var(--thbg); border: 1px solid var(--line); font-size: 14px; }
  .ph-only { display: inline-flex; }
  .share-btn.pulse { box-shadow: 0 0 0 3px var(--brand); }
}
/* 👥 고객 */
.ppl-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--thbg); border-radius: 3px; padding: 3px; }
.ppl-segbtn { text-align: center; padding: 9px 0; border-radius: 3px; font-size: 15px; color: var(--muted); text-decoration: none; min-height: 40px; }
.ppl-segbtn.on { background: var(--card); color: var(--brand); font-weight: 700; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.ppl-search { width: 100%; min-height: 44px; font-size: 16px; }
.ppl-list, .qm-list { display: grid; gap: 10px; }
.ppl-card { border: 1px solid var(--line); border-radius: 3px; padding: 12px; display: grid; gap: 8px; background: var(--card); }
.ppl-who { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ppl-name b { display: block; font-size: 16px; }
.ppl-name small { color: var(--muted); font-size: 13px; }
.ppl-star { background: none; border: 0; font-size: 22px; color: var(--muted); min-width: 44px; min-height: 44px; cursor: pointer; }
.ppl-star.on { color: var(--amber); }
.ppl-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ppl-act { min-height: 48px; border-radius: 3px; background: var(--thbg); color: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; text-decoration: none; }
.ppl-act i { font-style: normal; font-size: 18px; line-height: 1.1; }
.ppl-act.off { opacity: .35; }
.ppl-sec { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.ppl-favrow { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.ppl-favp { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 58px; flex: none; text-decoration: none; color: var(--muted); font-size: 12px; }
.ppl-favp small { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-av { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.ppl-quotes { justify-self: start; }
/* ☰ 더보기 */
.more-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-tile { aspect-ratio: 1; max-width: 100%; border: 1px solid var(--line); border-radius: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 14px; text-align: center; text-decoration: none; color: inherit; background: var(--card); }
.more-tile i { font-style: normal; font-size: 26px; }
.more-foot { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.more-foot > a, .more-foot > button, .more-langrow { min-height: 44px; display: flex; align-items: center; gap: 6px; font-size: 16px; text-align: left; }
.more-foot .linklike { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.more-foot .linklike.danger { color: var(--red); }
/* 💬 폰 견적 */
.qm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qm-card { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 3px; padding: 12px; text-decoration: none; color: inherit; background: var(--card); }
.qm-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qm-amt { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qm-amt.big { font-size: 22px; }
.qm-head { border-radius: 3px; padding: 12px; background: var(--thbg); display: grid; gap: 4px; }
.qm-cust { font-size: 16px; font-weight: 600; }
.qm-lines { display: grid; gap: 6px; }
.qm-line { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 3px; padding: 10px; }
.qm-lname { display: grid; min-width: 0; }
.qm-lname b { overflow-wrap: anywhere; }
.qm-lamt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.qm-tot { display: grid; gap: 4px; }
.qm-kv { display: flex; justify-content: space-between; gap: 10px; }
.qm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qm-btns .btn { min-height: 48px; justify-content: center; }
/* ✅ 승인 모음 · 🛠 서비스 현장 (폰 v1 2·3단계, 11-21) */
.fld-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fld-act { min-height: 48px; justify-content: center; text-align: center; }
.fld-act.off { opacity: .4; }
.fld-file { display: none; }
.fld-sign { width: 100%; max-width: 100%; height: auto; aspect-ratio: 600 / 260; background: #fff; border: 1px dashed var(--line); border-radius: 3px; touch-action: none; }
.appr-list .memo-card { padding: 12px; }
.appr-list .memo-card .btn { min-height: 44px; }

/* 🧭 전체 진행판 (설계 64, 11-23) */
.pg-head { align-items: center; }
.pg-head .page-title { margin-right: 6px; flex: 0 0 auto; width: auto; }
.pg-head .check { display: inline-flex; align-items: center; gap: 6px; width: auto; }
.pg-head .check input { width: auto; min-height: 0; }
.pg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pg-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; min-height: var(--tap); border: 1px solid var(--line); border-radius: 3px; background: var(--card); cursor: pointer; text-align: left; color: var(--text); }
.pg-kpi b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pg-kpi span { font-size: 13px; color: var(--muted); }
.pg-kpi.red b { color: var(--red); }
.pg-kpi.on, .pg-st.on { border-color: var(--brand2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand2) 30%, transparent); }
.pg-lanes { padding: 0; }
.pg-lane { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line2); }
.pg-lane:first-child { border-top: 0; }
.pg-lane-k { flex: 0 0 150px; display: flex; flex-direction: column; gap: 2px; }
.pg-late-t { color: var(--red); font-weight: 600; }
.pg-deal-link { font-size: 12px; }
.pg-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pg-st { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 3px 10px; border: 1px solid transparent; border-radius: 3px; background: var(--hover); color: var(--text); cursor: pointer; font-size: 13px; }
.pg-st b { font-variant-numeric: tabular-nums; }
.pg-st.zero, .pg-st.done { color: var(--muted); cursor: default; }
.pg-st.zero b { font-weight: 400; }
.pg-late { font-style: normal; font-size: 11px; color: #fff; background: var(--red); border-radius: 3px; padding: 0 5px; }
.pg-arr { color: var(--muted); }
.pg-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.pg-grp { margin-right: 2px; }
.pg-tbar { align-items: center; justify-content: space-between; }
.pg-table tr.pg-row { cursor: pointer; }
.pg-table tr.pg-row:hover td { background: var(--hover); }
.pg-table tr.late td { background: color-mix(in srgb, var(--red) 7%, var(--card)); }
.pg-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-me { color: var(--brand2); font-weight: 700; }
.pg-red { color: var(--red); font-weight: 600; }
.pg-card.late { border-left: 4px solid var(--red); }
.pg-cards, .pg-phone-note { display: none; }
.pg-grp { white-space: nowrap; flex: none; }
@media (max-width: 860px) {
  body:not(.pcview) .pg-tablebox { display: none; }
  body:not(.pcview) .pg-cards { display: flex; }
  body:not(.pcview) .pg-phone-note { display: block; }
  .pg-lane, .pg-stages { min-width: 0; max-width: 100%; }
  .pg-kpis { gap: 6px; }
  .pg-kpi { align-items: center; padding: 8px 4px; text-align: center; }
  .pg-kpi b { font-size: 20px; }
  .pg-kpi span { font-size: 11px; }
  .pg-lanes { padding: 0; background: transparent; border: 0; box-shadow: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pg-lane { flex-direction: column; align-items: stretch; gap: 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
  .pg-lane-k { flex: none; flex-direction: row; justify-content: space-between; }
  .pg-stages { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .pg-st { flex: none; flex-direction: column; gap: 0; border-radius: 3px; min-width: 56px; padding: 4px 8px; font-size: 12px; }
  .pg-arr, .pg-deal-link { display: none; }
}
.chat-msg.sending .chat-bub { opacity: .6; } /* ⏳ 보내는 중 (11-23) */
/* V2.3.0 (11-26): 자금일보 통장 실제 잔액 필수 · 은행 카드 자금일보 차이 */
.bank-actual.invalid { border-color: var(--red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 25%, transparent); }
.bk-card.bk-daydiff { border-color: var(--red); }
/* V2.4.0: 은행 내역 — 계좌 카드 아래 버튼 줄 */
.bk-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bk-top .tx-add { align-items: center; }
.tx-out-hint { flex-basis: 100%; }
/* V2.4.0 (11-26): 법인장 HOME 손익 요약 접기 */
.ps-fold > summary { cursor: pointer; font-weight: 600; }
.ps-fold > .ps-card { margin-top: 8px; border: 0; padding: 0; box-shadow: none; }

/* V2.4.1 (11-26 🟡14): 한 줄(같은 묶음)에 파란 꽉 찬 버튼은 첫 번째 하나만 — 두 번째부터는 파란 테두리 버튼 (가장 중요한 일이 한눈에) */
.actions .btn.primary ~ .btn.primary, .modal-foot .btn.primary ~ .btn.primary, .tx-add .btn.primary ~ .btn.primary { background: var(--card); color: var(--brand2); border-color: var(--brand2); }
.actions .btn.primary ~ .btn.primary:hover, .modal-foot .btn.primary ~ .btn.primary:hover { background: color-mix(in srgb, var(--brand2) 8%, var(--card)); }
/* V2.4.1 🎨 선 그림 아이콘 */
.ico { display: inline-block; vertical-align: -3px; flex: none; }
.nav-group-name .ico { margin-right: 2px; color: var(--brand2); }
html[data-theme="dark"] .nav-group-name .ico { color: #8fb8ea; }

/* 머리줄 버전 표시 (11-27 대표님 요청) — 상표 옆 작은 글씨. 좁은 폰에서는 숨김 */
.brand-ver { margin-left: 8px; padding: 2px 7px; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; font-size: 12px; font-weight: 600; letter-spacing: 0; color: #dbe7f5; vertical-align: middle; }
@media (max-width: 520px) { .brand-ver { display: none; } }

/* ---------- V2.5.0: 홈 큰 금액 줄여 보기 (누르면 전체 숫자) ---------- */
.msum { cursor: pointer; border-bottom: 1px dotted currentColor; white-space: nowrap; }
.msum:hover { background: var(--hover, rgba(29,95,168,.08)); border-radius: 3px; }
.msum.open { border-bottom-style: solid; }
.msum-plain { white-space: nowrap; }
/* ---------- V2.5.0: 홈 칸 배치 바꾸기 ---------- */
.hd-layout-bar { margin-left: auto; display: flex; gap: 6px; }
.hd-blk { min-width: 0; }
.hd-left, .hd-right { min-width: 0; }
.hd-editing .hd-blk { position: relative; outline: 2px dashed var(--brand2); outline-offset: 3px; border-radius: 3px; cursor: grab; }
.hd-editing .hd-blk.hd-drag { opacity: .45; }
.hd-editing .hd-blk.hd-over { outline-style: solid; background: rgba(29,95,168,.06); }
.hd-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.hd-tools .btn { min-width: 34px; padding: 2px 8px; }
.hd-grip { color: var(--muted); font-size: 18px; padding: 0 4px; }
.hd-editing .hd-left:empty, .hd-editing .hd-right:empty { min-height: 60px; border: 2px dashed var(--line); border-radius: 3px; }
@media (max-width: 860px) { .hd-layout-bar, .hd-layout-help { display: none !important; } }
html[data-theme="dark"] .hd-editing .hd-blk { outline-color: #8ab8ff; }
/* 한쪽 칸만 쓰면(평소 화면) 그 칸이 한 줄 전체를 씀 — 빈 칸이 자리를 차지하지 않게 */
.hd-page:not(.hd-editing) .hd-cols:has(> .hd-left:empty), .hd-page:not(.hd-editing) .hd-cols:has(> .hd-right:empty) { grid-template-columns: 1fr; }
.hd-page:not(.hd-editing) .hd-left:empty, .hd-page:not(.hd-editing) .hd-right:empty { display: none; }

/* 🇰🇷 본사 미지급금 (V2.5.3) — 줄 돈 한 화면 */
.ap-hq { display: block; width: 100%; text-align: left; border: 1px solid var(--line, #C9D2DE); border-left: 4px solid var(--brand2, #0B2D4F); border-radius: 3px; background: var(--card, #fff); padding: 10px 14px; cursor: pointer; font: inherit; color: inherit; }
.ap-hq.on { outline: 2px solid var(--brand2, #0B2D4F); }
.ap-hq-main { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ap-hq-title { font-weight: 600; }
.ap-hq-num { font-size: 1.25em; }
.ap-hq-sub { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.ap-hq-late { color: var(--red, #c00); font-weight: 600; }
.ap-hq-rule { margin-top: 4px; }
.hq-due-edit { padding: 0 4px; }

/* 🧹 견적 입력 화면 정리 (V2.5.4) */
.qt-tip { display: inline-block; color: var(--brand2, #0B2D4F); cursor: help; font-size: .95em; }
.qt-more { border-top: 1px dashed var(--line, #C9D2DE); padding-top: 4px; }
.qt-more[open] > summary { margin-bottom: 6px; }
.qt-date-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.qt-date-row > .field { flex: 0 1 auto; }

/* 쪽지 창 탭 4개 (V2.6.0): 탭 안 걸러 보기 · 대화 탭 안 사람 */
.memo-sub { margin: 0 0 8px; gap: 4px; }
.memo-sub .seg-btn { min-height: 30px; padding: 2px 10px; font-size: 13px; }
.memo-ppl-box { margin: 6px 0 10px; padding: 8px; border: 1px solid var(--line); border-radius: 3px; }
.memo-todo-view > * + * { margin-top: 8px; }
.memo-toreq { margin-left: 8px; }

/* 🌐 설명서 자동 번역 띠 (V2.5.7) */
.help-tr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 3px; background: var(--card); border: 1px solid var(--line); }

/* 🎨 디자인 2단계 (11-28): PC = 촘촘한 표 · 머리 칸 회색 바탕 · 버튼·입력 높이 36px (폰은 44px 그대로) */
@media (min-width: 861px) {
  :root { --tap: 36px; }
  .tbl th { background: #E6EBF1; color: var(--label); font-weight: 600; padding: 5px 6px; border-bottom: 1px solid #C9D2DE; }
  .tbl td { padding: 5px 6px; }
  html[data-theme="dark"] .tbl th { background: var(--thbg); border-bottom-color: var(--line); }
}

/* 🎨 디자인 4단계 (11-29): 윗줄 버튼 = 단색 선 그림(글자 색을 따름) · 큰 장식 아이콘 줄임 */
.icon-btn .ico { vertical-align: middle; }
.topbar .me-btn { color: var(--brand); }
.hd-kpi.tone-gray .hd-kpi-n { color: var(--muted); }

/* 🤖 AI 연결 한 화면 (11-30): 용도별 표 + ERP 관리 AI 설정 */
.aic-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aic-total { color: var(--text); font-weight: 600; }
.aic-at { white-space: nowrap; }
.aic-tbl td { vertical-align: middle; }
.aic-tbl tr.aic-new > td { background: #FBEBDC; }
.aic-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 3px; background: #E8912D; color: #000; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.aic-btns { white-space: nowrap; text-align: right; } .aic-btns .btn + .btn { margin-left: 4px; }
.aic-edit > td { background: var(--thbg, #E6EBF1); }
.aic-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 4px; }
.aic-form label:not(.check) { display: flex; flex-direction: column; gap: 2px; } .aic-form .aic-key input { min-width: 240px; }
.aic-admin { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; }
.aic-admin h3 { margin: 0 0 6px; font-size: 15px; }
.aic-alert ul { margin: 4px 0 6px 18px; padding: 0; } .aic-alert .btn { margin-top: 6px; } /* 💸 AI 잔액 부족 (11-30) */
.aic-line { display: flex; gap: 12px; align-items: center; padding: 5px 0; flex-wrap: wrap; }
.aic-lab { width: 130px; color: var(--muted); font-size: 13px; flex: none; }
.aic-val { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.aic-ents { display: flex; gap: 14px; } .aic-limit { width: 90px; }
.aic-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
html[data-theme="dark"] .aic-tbl tr.aic-new > td { background: #3a3320; }
/* 🔑 AI 키 목록·업무별 연결 (11-30) */
.aic-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 4px; }
.aic-h h3, h3.aic-h { margin: 10px 0 4px; font-size: 15px; }
.aic-tasks td { vertical-align: top; }
.aic-ksel { max-width: 260px; display: block; margin-bottom: 4px; }
.aic-model { width: 200px; font-size: 12px; }
.aic-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aic-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-av.k-ai { background: #FBEBDC; }
/* 📚 자료실 카드 묶음 · 미리보기 (11-30) */
.lib-groups { display: flex; flex-direction: column; gap: 14px; }
.lib-group { padding: 14px 16px; }
.lib-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.lib-group-head h2 { font-size: 16px; margin: 0; }
.lib-more { margin-left: auto; }
.lib-grid td, .lib-grid th { vertical-align: middle; }
.lib-lang { font-weight: 700; white-space: nowrap; width: 80px; }
.lib-cell { white-space: nowrap; }
.lib-cell .btn { margin: 2px 4px 2px 0; }
.lib-img { display: inline-flex; gap: 2px; margin-right: 8px; }
.lib-langs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: var(--card, #fff); border-radius: 18px; padding: 6px 14px; min-height: 36px; min-width: 44px; font-size: 12.5px; cursor: pointer; color: inherit; }
.chip-btn.on { background: #FBEBDC; border-color: #E8731A; color: #8a3d00; font-weight: 600; }
.lib-pv { display: flex; flex-direction: column; gap: 8px; }
.lib-pv-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib-pv-head b { flex: 1; min-width: 200px; }
.lib-pv-body { background: #525659; border-radius: 4px; min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.lib-pv-frame { width: 100%; height: 70vh; border: 0; background: #525659; }
.lib-pv-img { max-width: 100%; max-height: 70vh; background: #fff; }
.lib-pv-sw { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lib-pv.phone .lib-pv-frame { height: 72vh; }
@media (max-width: 860px) { /* 📚 폰: 언어 줄 → 칸(가로·세로)을 아래로 쌓음 */
  .lib-grid thead { display: none; }
  .lib-grid tr { display: block; border-top: 1px solid var(--line); padding: 6px 0; }
  .lib-grid td { display: block; border: 0; padding: 3px 4px; }
  .lib-grid .lib-cell { white-space: normal; }
  .lib-grid .lib-cell[data-lay]:not([data-lay=""])::before { content: attr(data-lay); display: inline-block; min-width: 44px; color: var(--muted); font-size: 12.5px; }
}
/* 💬 YM 톡 번역 둘 다 보기 (11-30) */
.tr-sub { border-top: 1px dashed rgba(0,0,0,.18); margin-top: 5px; padding-top: 4px; color: var(--muted, #6b7685); font-size: 12px; line-height: 1.4; white-space: pre-wrap; }
.tr-sub i { font-style: normal; font-size: 10.5px; background: rgba(0,0,0,.06); border-radius: 4px; padding: 0 4px; margin-right: 2px; }
.chat-msg.mine .tr-sub { border-top-color: rgba(0,0,0,.2); }
.tr-pick .tr-opt { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; width: 100%; }
.memo-trview { margin-top: 4px; }
/* 📝 Claude 제안 카드 (관리 AI 2단계, 11-30) */
.ai-prop { margin-top: 8px; padding: 8px 10px; border: 1px solid #E8731A; background: #FFF6EE; border-radius: 8px; }
.ai-prop .actions { display: flex; gap: 6px; margin-top: 6px; }
.ai-prop.done { border-color: var(--line); background: transparent; color: var(--muted); }
/* 🗑 YM 톡 목록 줄 메뉴 (11-30) */
.chat-row { position: relative; }
.chat-row-more { position: absolute; right: 6px; bottom: 6px; border: 0; background: transparent; color: var(--muted); font-size: 18px; min-width: 36px; min-height: 36px; border-radius: 8px; cursor: pointer; opacity: .55; }
.chat-row:hover .chat-row-more, .chat-row-more:focus { opacity: 1; background: rgba(0,0,0,.05); }
.chat-pin { position: absolute; left: 4px; top: 4px; font-size: 11px; }
.chat-row.pinned { background: rgba(232,115,26,.05); }
.chat-row-menu .btn { width: 100%; text-align: left; }
/* @ 멘션 · 내 별명 (11-30) */
.chat-compose { position: relative; }
.mention-pop { position: absolute; left: 8px; right: 8px; bottom: 100%; margin-bottom: 6px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: 4px; z-index: 20; max-height: 280px; overflow: auto; }
.mention-opt { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; min-height: 40px; border-radius: 8px; cursor: pointer; color: inherit; font: inherit; }
.mention-opt:hover, .mention-opt:focus { background: #FBEBDC; }
.chat-mention { color: #1a56b0; font-weight: 700; }
.chat-mentioned { box-shadow: inset 3px 0 0 #E8731A; padding-left: 6px; }
.chat-orig-name { font-weight: 400; }
.memo-composer { position: relative; }
/* ⌨ 11-30 대표님 "PC 에서 YM 톡 입력 창은 항상 아래에 고정": 오른쪽 YM 톡 창 대화 = 말 목록만 스크롤, 입력 칸은 창 맨 아래 (폰과 같게) */
.memo-body:has(> .memo-detail) { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 8px; }
.memo-body > .memo-detail { flex: 1; min-height: 0; height: 100%; }
.memo-detail .memo-msgs { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
.memo-detail > .memo-composer { position: sticky; bottom: 0; background: var(--card); margin-top: auto; flex: none; }
/* YM 톡 큰 화면에서는 오른쪽 아래 ✉️ 둥근 단추가 [보내기]를 가리지 않게 숨김 (YM 톡 안이므로) */
body.chat-wide .memo-fab { display: none; }
/* 🧭 총무·영업 첫 화면 (11-30) — 시간대 칸 + 번호 카드(누르면 그 화면) · 색 = 누가 */
.rh-legend { color: var(--muted); }
.rh-lanes { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.rh-lane { position: relative; flex: 1 1 0; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 12px; }
.rh-when { font-size: 15px; margin: 0 0 8px; }
.rh-steps { display: flex; flex-direction: column; gap: 8px; }
.rh-step { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border-radius: 10px; border: 1px solid; text-decoration: none; color: inherit; min-height: 56px; transition: transform .08s, box-shadow .08s; }
.rh-step:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.rh-step .rh-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; }
.rh-step .rh-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rh-step .rh-body .small { color: var(--muted); }
.rh-step .rh-go { color: var(--muted); font-size: 18px; align-self: center; }
.rh-step.who-ops { background: #EEF4FC; border-color: #2B6CB0; }
.rh-step.who-ops .rh-n { background: #2B6CB0; }
.rh-step.who-sales { background: #FDF1E7; border-color: #E8731A; }
.rh-step.who-sales .rh-n { background: #E8731A; }
.rh-step.who-ok { background: #EAF6EE; border-color: #2F855A; }
.rh-step.who-ok .rh-n { background: #2F855A; }
.rh-arrow { position: absolute; right: -13px; top: 50%; transform: translateY(-50%); z-index: 1; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) {
  .rh-lanes { flex-direction: column; overflow: visible; }
  .rh-lane { min-width: 0; }
  .rh-arrow { position: static; transform: none; text-align: center; margin-top: 6px; }
}
:root[data-theme="dark"] .rh-step.who-ops { background: rgba(43,108,176,.18); } :root[data-theme="dark"] .rh-step.who-sales { background: rgba(232,115,26,.16); } :root[data-theme="dark"] .rh-step.who-ok { background: rgba(47,133,90,.18); }
/* 👣 설치 다음 순서 (11-30) */
.inst-next { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--bg, #F5F7FA); }
@media print { .inst-next { break-inside: avoid; } .inst-qr { display: block; } .inst-qr > * { display: block !important; } }
/* 숨김이 display:flex 에 덮이던 빈 답장 줄 (11-30 "톡 왼쪽 위 커서") */
.chat-replybar[hidden], .chat-upbar[hidden] { display: none; }
/* PC 오른쪽 YM 톡 창 줄 ⋯ 메뉴 (11-30) */
.memo-row { position: relative; }
.memo-row-more { position: absolute; right: 6px; bottom: 4px; min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 6px; }
.memo-row-more:hover { background: var(--thbg); }
/* 🌐 말 밑 K·V·T·C (설계 66, 12-01) — 다 된 말은 작고 흐리게, 문제 있으면 그 단추만 눈에 띔 (색 + 기호) */
.chat-trwrap { margin: 2px 0 4px; }
.chat-msg.mine .chat-trwrap { text-align: right; }
.chat-trrow { display: inline-flex; flex-wrap: wrap; gap: 4px; opacity: .55; }
.chat-trrow.bad, .chat-trrow:hover { opacity: 1; }
.chat-trchip { font-size: 11px; line-height: 1; min-width: 36px; min-height: 26px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--thbg); color: var(--muted); cursor: pointer; }
.chat-trchip.st-src { background: transparent; border-color: transparent; font-weight: 700; text-decoration: underline; color: var(--text, #222); }
.chat-trchip.st-pend { border-style: dashed; background: transparent; }
.chat-trchip.st-fail, .chat-trchip.st-miss { border: 1.5px solid #C0392B; color: #C0392B; background: transparent; font-weight: 700; }
.chat-trchip.on { outline: 2px solid var(--brand2); }
.chat-trpanel { margin-top: 4px; text-align: left; }
.chat-trcard { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card, #fff); display: grid; gap: 6px; max-width: 520px; }
.chat-msg.mine .chat-trcard { margin-left: auto; }
.chat-trtbl td.chat-trtxt { white-space: pre-wrap; min-width: 240px; }
.chat-trtbl tr.on td { background: var(--thbg); }

/* 💲 가격표 양식 (설계 67) — 편집 왼쪽 입력 · 오른쪽 A4 미리보기 · 인쇄는 문서만 */
.ps-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.ps-form { flex: 1 1 380px; max-width: 560px; min-width: 0; }
.ps-prevwrap { flex: 0 1 auto; max-width: 100%; overflow: auto; }
.ps-grid { border-collapse: collapse; width: 100%; }
.ps-grid th, .ps-grid td { border: 1px solid var(--line, #d8dee6); padding: 4px 6px; text-align: left; }
.ps-grid input { width: 100%; min-width: 70px; box-sizing: border-box; }
.ps-grid td.num { text-align: right; }
.ps-chg td { background: #fff7d6; }
.mr-sub th, .mr-sub td { background: #f6f8fb; }
.mr-sub input::placeholder { opacity: .55; }
.ps-basis { margin-top: 2px; }
.ps-basis-sel { font-size: 12px; padding: 1px 4px; }
.ps-doc { width: 210mm; min-height: 297mm; box-sizing: border-box; background: #fff; color: #000; padding: 0 0 12mm; font: 10pt/1.4 Arial, "Malgun Gothic", "Microsoft YaHei", sans-serif; box-shadow: 0 0 0 1px rgba(11, 45, 79, .16); }
.ps-hd { background: #0B2D4F; color: #fff; padding: 8mm 12mm; display: flex; align-items: center; gap: 8mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-logo { height: 14mm; background: #fff; padding: 1.5mm 2.5mm; border-radius: 2px; }
.ps-title { font-size: 18pt; font-weight: 700; letter-spacing: .3px; }
.ps-co { font-size: 9pt; opacity: .85; }
.ps-meta { display: flex; justify-content: space-between; padding: 5mm 12mm 3mm; font-size: 10pt; }
.ps-doc > table, .ps-doc > div > table, .ps-doc .ps-blk { margin: 0 12mm 5mm; width: calc(100% - 24mm); }
.ps-blk table { width: 100%; margin: 0; }
.ps-tbl { border-collapse: collapse; }
.ps-tbl th { background: #0B2D4F; color: #fff; font-weight: 600; padding: 2mm 3mm; text-align: center; font-size: 9pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-tbl td, .ps-tbl tbody th { border: 1px solid #c4cdd8; padding: 2mm 3mm; background: #fff; color: #000; text-align: left; font-size: 10pt; }
.ps-tbl tbody th { background: #eef2f7; }
.ps-tbl td.num { text-align: right; font-weight: 700; }
.ps-blk h4 { margin: 0 0 1.5mm; color: #0B2D4F; font-size: 10pt; }
.ps-disc, .ps-notes { margin: 0 12mm 4mm; font-size: 9.5pt; }
.ps-blk ul { margin: 0; padding-left: 5mm; font-size: 9pt; }
@media print {
  .ps-wrap { display: block; }
  .ps-prevwrap { overflow: visible; }
  .ps-doc { box-shadow: none; width: auto; min-height: 0; margin: 0; }
}
