/* ===== Outlook 풍 라이트 테마 ===== */
:root {
  --blue: #0078d4;          /* Outlook 액센트 */
  --blue-dark: #106ebe;
  --blue-deep: #005a9e;
  --ribbon: #0f6cbd;
  --bg: #faf9f8;
  --pane: #ffffff;
  --folderbg: #f3f2f1;
  --line: #edebe9;
  --line2: #e1dfdd;
  --text: #201f1e;
  --muted: #605e5c;
  --muted2: #797775;
  --hover: #f3f2f1;
  --sel: #cfe4fa;
  --sel-line: #0078d4;
  --unread: #1b1a19;
  --red: #a4262c;           /* 중요/빨강 */
  --green: #107c10;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 13px; overflow: hidden;
  display: flex; flex-direction: column;
}
button { font-family: inherit; }

/* 리본 */
.ribbon {
  height: 48px; flex-shrink: 0; background: var(--ribbon); color: #fff;
  display: flex; align-items: center; gap: 12px; padding: 0 12px;
}
.ribbon-left { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.logo { color: #ffd86b; font-size: 16px; }
.appname { font-weight: 600; letter-spacing: .3px; }
.appname small { opacity: .8; font-weight: 400; font-size: 10px; }
.ribbon-search { flex: 1; min-width: 0; display: flex; justify-content: center; }
.ribbon-search input {
  width: min(520px, 100%); height: 30px; border: none; border-radius: 4px;
  padding: 0 12px; font-size: 13px; background: #ffffff; color: #201f1e;
}
.ribbon-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rbtn {
  width: 32px; height: 32px; border: none; background: transparent; color: #fff;
  font-size: 16px; border-radius: 4px; cursor: pointer;
}
.rbtn:hover { background: rgba(255,255,255,.18); }
.rbtn-text { height: 32px; border: none; background: rgba(255,255,255,.18); color: #fff; font-size: 13px; border-radius: 4px; cursor: pointer; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.rbtn-text:hover { background: rgba(255,255,255,.30); }
.rbtn-text[data-busy="1"] { opacity: .6; }
.lang-select { height: 28px; border: none; border-radius: 4px; padding: 0 6px; background: #fff; color: #201f1e; }
.mode-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #fff;
  border: 1px solid rgba(255,255,255,.5); padding: 2px 7px; border-radius: 10px;
}
.mode-badge.live { background: #107c10; border-color: #107c10; }

/* 작업영역 3분할 */
.workspace { display: flex; flex: 1; min-height: 0; }
.pane { height: 100%; overflow: auto; background: var(--pane); }
.folders { width: 230px; background: var(--folderbg); border-right: 1px solid var(--line2); flex-shrink: 0; }
.maillist { width: 420px; border-right: 1px solid var(--line2); flex-shrink: 0; }
.reader { flex: 1; min-width: 320px; }
.splitter { width: 5px; cursor: col-resize; background: transparent; flex-shrink: 0; }
.splitter:hover, .splitter.dragging { background: var(--blue); opacity: .4; }

/* 폴더 패널 */
.folder-head { padding: 12px 14px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: flex; justify-content: space-between; align-items: center; }
.folder-head button { border: none; background: transparent; color: var(--blue); cursor: pointer; font-size: 13px; }
.folder-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 14px;
  cursor: pointer; color: var(--text); font-size: 13px; position: relative;
}
.folder-row:hover { background: #eae9e8; }
.folder-row.active { background: var(--sel); font-weight: 600; }
.folder-row.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.folder-ic { width: 16px; text-align: center; color: var(--blue); }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { color: var(--muted); font-size: 12px; }
.folder-row.has-unread .folder-name { font-weight: 700; }
.folder-row.has-unread .folder-count { color: var(--blue); font-weight: 700; }
.folder-actions { display: none; gap: 2px; }
.folder-row:hover .folder-actions { display: flex; }
.folder-actions button { border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 11px; width: 18px; height: 18px; border-radius: 3px; }
.folder-actions button:hover { background: #dcdbda; color: var(--text); }

/* 메일 목록 */
.list-head { padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--pane); z-index: 1; }
.list-head.bulkbar { background: #eff6fc; color: var(--blue-deep); }
.bulk-actions { display: flex; align-items: center; gap: 6px; }
.bulk-actions .btn { padding: 4px 8px; font-size: 12px; }
.bulk-actions .inline { height: 26px; font-size: 12px; }
.mrow { display: flex; align-items: stretch; gap: 6px; padding: 9px 8px 9px 8px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
/* 읽음/안읽음 명확화 (강하게): 읽음=회색 배경+흐림+왼쪽 막대 없음, 안읽음=흰 배경+굵게+파란 막대 */
.mrow.read { background: #edecea; }
.mrow.read .from { color: #8a8886; font-weight: 400; }
.mrow.read .subject { color: #a19f9d; font-weight: 400; }
.mrow.read .preview { color: #b3b0ad; }
.mrow.unread { background: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.mrow.unread .from { font-weight: 700; color: #1b1a19; }
.mrow.unread .subject { font-weight: 700; color: var(--blue-deep); }
.mrow .mcheck { align-self: center; width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.mrow.checked { background: #e5f1fb; }
.udot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: middle; }
.badge { display: inline-block; font-size: 10.5px; line-height: 1.5; padding: 0 7px; border-radius: 3px; margin-right: 6px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.badge-repair { background:#fde7d2; color:#9a4f0a; } .badge-resize { background:#fde0ea; color:#a81b56; }
.badge-stone { background:#d8f1ee; color:#0a6e62; } .badge-engrave { background:#ece1fb; color:#5b2ca6; }
.badge-return { background:#fde3e4; color:#a4262c; } .badge-exchange { background:#fde7d6; color:#9a5a0a; }
.badge-order_made { background:#e2e8fd; color:#26408b; } .badge-delivery { background:#deecfb; color:#0b5394; }
.badge-color { background:#fef3cd; color:#856404; } .badge-complaint { background:#fcd9dc; color:#8a1c22; }
.badge-thanks { background:#dff6dd; color:#0b6a0b; } .badge-order_confirmation { background:#dff6dd; color:#0b6a0b; }
.badge-promo { background:#eceae9; color:#797775; } .badge-other { background:#eceae9; color:#605e5c; }
.badge-notice { background:#e3eef5; color:#4a6572; }
.badge-ai { background:#ede4ff; color:#5b2ca6; }
/* AI 버튼 / 구분선 / AI 분석결과 */
.btn.ai { background:#6b3fd4; color:#fff; border-color:#6b3fd4; }
.btn.ai:hover { background:#5a2fc0; }
.tb-sep { width:1px; align-self:stretch; background:var(--line2); margin:0 2px; }
.ai-result { background:#f6f2ff; border:1px solid #e2d6fb; border-radius:6px; padding:10px 12px; }
.ai-tag { font-size:11px; font-weight:700; color:#5b2ca6; margin-bottom:6px; }
.ai-summary { font-size:14px; font-weight:600; color:#201f1e; margin-bottom:6px; }
.ai-wants { font-size:13px; color:#3b3a39; margin-bottom:4px; }
.ai-points { margin:4px 0 0; padding-left:18px; font-size:13px; color:#3b3a39; }
.selall { display:flex; align-items:center; gap:6px; cursor:pointer; }
.selall input { cursor:pointer; }
/* 진행상태 칩 + 완료 흐림 */
.status-chip { display:inline-block; font-size:10.5px; font-weight:700; padding:0 7px; border-radius:3px; margin-right:6px; vertical-align:middle; }
.s-active { background:#cfe4ff; color:#0a4ea3; }
.s-waiting { background:#ffe0b2; color:#a85a00; }
.s-done { background:#dff6dd; color:#0b6a0b; }
.s-new { background:#fde2e4; color:#b3203a; }
.mrow.is-done .subject, .mrow.is-done .from { color:#a19f9d; }
.btn.on-done { background:#dff6dd; border-color:#7bc97b; color:#0b6a0b; }
.folder-head button { margin-left:4px; }

/* 메일분석 작업창 — 원래 메일창을 가리지 않는 오른쪽 패널(배경 막지 않음 → 복붙 가능) */
/* 분석창 = 자유(플로팅) 창: 화면 위를 자유롭게 옮길 수 있고, 뒤의 원본 메일은 계속 보임 */
.work-ov { position:fixed; top:66px; right:26px; width:min(540px,44vw); z-index:65; pointer-events:none; }
.work-sheet { pointer-events:auto; width:100%; max-height:calc(100vh - 96px); background:#fff; border:1px solid var(--line2); border-radius:10px; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 14px 44px rgba(0,0,0,.30); resize:both; }
.work-head { background:#0f6cbd; color:#fff; padding:10px 16px; display:flex; justify-content:space-between; align-items:center; cursor:move; border-radius:10px 10px 0 0; user-select:none; }
.work-head .btn { background:rgba(255,255,255,.2); border:none; color:#fff; }
.work-head .caution-badge { background:#d13438; color:#fff; font-size:11px; font-weight:700; padding:2px 8px; border-radius:10px; margin-left:8px; }
/* 고객 이력 패널 */
.wk-history .hist-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-bottom:8px; }
.hist-cell { background:var(--bg2,#f3f6fb); border:1px solid var(--line2); border-radius:6px; padding:6px 4px; text-align:center; }
.hist-n { font-size:18px; font-weight:800; color:var(--blue-deep); line-height:1.1; }
.hist-n.warn { color:#d13438; }
.hist-k { font-size:10px; color:var(--muted); margin-top:2px; }
.hist-line { font-size:12px; margin:3px 0; }
.hist-k2 { color:var(--muted); }
.hist-empty { font-size:12px; color:var(--muted); padding:6px 0; }
.hist-flag { display:inline-flex; align-items:center; gap:5px; font-size:12px; margin-top:6px; padding:4px 8px; border:1px solid var(--line2); border-radius:6px; cursor:pointer; }
.hist-flag.on { background:#fde7e9; border-color:#d13438; color:#a4262c; font-weight:700; }
/* 対応完了 후 안내 배너 (메일이 사라져 당황하지 않게) */
.done-note { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; text-align:center; height:100%; }
.done-ico { font-size:40px; }
.done-msg { font-size:16px; font-weight:700; color:var(--blue-deep); }
.done-sub { font-size:13px; color:var(--muted); }
.done-acts { display:flex; gap:8px; margin-top:10px; }
.done-acts .btn { padding:8px 14px; }
/* 채널 칩(라쿠텐 등) */
.chan-chip { font-size:11px; font-weight:700; padding:1px 6px; border-radius:9px; margin-right:5px; white-space:nowrap; }
.chan-rakuten { background:#bf0000; color:#fff; }
.rk-auto { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.rk-auto select.inline { width:auto; padding:5px 8px; }
/* 채널 그룹 헤더(메일/라쿠텐) */
/* 접이식(아코디언) 채널 헤더 */
.channel-head { font-size:12px; font-weight:700; color:var(--text); padding:8px 10px; margin-top:4px; cursor:pointer; border-radius:6px; display:flex; align-items:center; gap:5px; user-select:none; background:#eef2f7; }
.channel-head:hover { background:#e3eaf3; }
.channel-head.open { background:#dbe6f4; }
.channel-head .ch-arrow { font-size:10px; color:var(--muted); width:10px; }
.channel-head .ch-count { margin-left:auto; background:var(--blue); color:#fff; font-size:10px; border-radius:9px; padding:0 6px; font-weight:700; }
.folder-row.sub { padding-left:22px; }
/* 顧客履歴 한 줄 압축 */
.hist-1line { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; font-size:12.5px; margin:2px 0; }
.hist-1line b { color:var(--blue-deep); }
.hist-1line .warn { color:#d13438; font-weight:700; }
.hist-more-btn { font-size:12px; padding:2px 8px; border:1px solid var(--line2); border-radius:5px; background:#fff; cursor:pointer; }
.hist-list { margin-top:6px; border:1px solid var(--line2); border-radius:6px; overflow:hidden; }
.hist-list .hl { display:flex; gap:8px; padding:5px 9px; border-bottom:1px solid var(--line2); font-size:12.5px; }
.hist-list .hl:last-child { border-bottom:none; }
.hist-list .hl .hl-no { color:var(--blue-deep); font-weight:700; white-space:nowrap; }
.work-col { flex:1; overflow-y:auto; padding:14px 18px; }
.wk-hint { font-size:11px; color:var(--muted); margin-bottom:8px; }
.wk-sec { font-size:13px; font-weight:700; color:var(--blue-deep); margin:4px 0 8px; }
.wk-label { display:block; font-size:11px; color:var(--muted); margin:8px 0 3px; }
.work-col input, .work-col textarea { width:100%; border:1px solid var(--line2); border-radius:4px; padding:7px 9px; font-family:inherit; font-size:13px; }
.work-col textarea { resize:vertical; line-height:1.7; }
.work-foot { display:flex; gap:8px; align-items:center; margin-top:10px; position:sticky; bottom:0; background:#fff; padding-top:8px; }
.work-foot .test-result { margin-right:auto; }

/* 카르테 페이지 */
/* 카르테창 = 분석창처럼 자유 플로팅: 배경 안 막고(뒤 메일 보임), 헤더 잡고 드래그 이동 */
.carte-ov { position:fixed; inset:0; background:transparent; z-index:70; padding:18px; pointer-events:none; }
.carte-sheet { pointer-events:auto; max-width:920px; width:min(920px,94vw); margin:0 auto; max-height:calc(100vh - 36px); overflow-y:auto; background:#fff; border:1px solid var(--line2); border-radius:8px; padding:0 0 18px; box-shadow:0 14px 44px rgba(0,0,0,.34); resize:both; }
.carte-stuck { position:sticky; top:0; z-index:6; background:#fff; border-radius:8px 8px 0 0; }
.carte-stuck .carte-top, .carte-stuck .carte-bar { position:static; }
.carte-top { background:#0f6cbd; color:#fff; padding:14px 20px; display:flex; justify-content:space-between; align-items:center; border-radius:8px 8px 0 0; cursor:move; user-select:none; z-index:3; }
.carte-top .ct-info { display:flex; flex-direction:column; gap:3px; min-width:0; }
.carte-top .ct-name { font-size:23px; font-weight:800; line-height:1.15; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.carte-top .ct-name .ct-sama { font-size:15px; font-weight:600; opacity:.9; }
.carte-top .ct-line { display:flex; align-items:baseline; gap:10px; }
.carte-top .cid { font-size:15px; font-weight:700; letter-spacing:.5px; } .carte-top .csub { font-size:11px; opacity:.85; }
.carte-top .ct-right { display:flex; align-items:center; gap:12px; flex-shrink:0; }
.ct-code { cursor:pointer; background:#fff; padding:3px; border-radius:5px; line-height:0; box-shadow:0 1px 3px rgba(0,0,0,.25); }
.ct-code svg { display:block; }
/* 인쇄물 코드(QR+바코드 겸용) */
.pdoc-headleft { display:flex; flex-direction:column; gap:2px; }
.pdoc-cust { font-size:25px; font-weight:800; color:#1a1a1a; }
.pdoc-headright { display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.pdoc-codes { display:flex; align-items:center; gap:8px; }
.pdoc-codes svg { display:block; }
.inv-codes { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin:-4px 0 8px; }
.inv-codes svg { display:block; }
.carte-status { height:32px; border:none; border-radius:5px; padding:0 10px; font-weight:600; }
.carte-bar { display:flex; gap:8px; padding:10px 20px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff; z-index:2; align-items:center; }
.carte-sheet h4 { margin:16px 20px 8px; font-size:13px; color:var(--blue-deep); border-left:3px solid var(--blue); padding-left:8px; }
.cf-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px 14px; padding:0 20px; }
.cf { display:flex; flex-direction:column; gap:3px; margin-bottom:6px; }
.cf.wide { padding:0 20px; }
.cf label { font-size:11px; color:var(--muted); }
.cf input, .cf select, .cf textarea, .cf-grid input, .cf-grid select { border:1px solid var(--line2); border-radius:4px; padding:6px 8px; font-size:13px; font-family:inherit; }
.cf textarea { resize:vertical; }
.carte-hist { margin:6px 20px; padding-left:18px; font-size:13px; line-height:1.7; }
.carte-corr { margin:6px 20px; display:flex; flex-direction:column; gap:8px; }
.corr-item { border:1px solid var(--line2); border-radius:6px; padding:8px 10px; font-size:13px; background:#fafafa; }
.corr-head { display:flex; align-items:center; gap:6px; }
.corr-head .corr-date { margin-left:auto; color:var(--muted); font-size:11px; }
.corr-src { font-size:13px; }
.corr-subject { font-weight:600; margin-top:2px; }
.corr-body { color:#555; margin-top:2px; white-space:pre-line; }
.corr-empty { margin:6px 20px; }
.corr-pick-row:hover { background:var(--hover); }
.carte-list { width:calc(100% - 40px); margin:10px 20px; border-collapse:collapse; font-size:13px; }
.carte-list th, .carte-list td { border-bottom:1px solid var(--line); padding:8px 10px; text-align:left; }
.carte-list tbody tr { cursor:pointer; } .carte-list tbody tr:hover { background:var(--hover); }

/* 제품 스펙(청구서용) 행 */
.spec-row { display:grid; grid-template-columns:20px repeat(8,1fr); gap:4px; padding:0 20px 5px; align-items:center; }
.spec-row .spec-no { color:var(--muted); text-align:center; }
.spec-row input { border:1px solid var(--line2); border-radius:4px; padding:5px 4px; font-size:11.5px; min-width:0; width:100%; box-sizing:border-box; }
.btn.mini { padding:3px 8px; font-size:11px; }
.carte-list .status-chip { font-size:11px; }
.status-chip.s-cancel { background:#eceae9; color:#797775; }

/* 납품명세서(청구서) — A4 인쇄 기준. 손님 이름이 맨 위에 제일 먼저 */
.invoice-sheet { max-width:760px; }
.invoice-body { padding:18px 28px 28px; }
.inv-meta { display:flex; justify-content:space-between; font-size:12px; color:var(--muted); border-bottom:1px solid var(--line); padding-bottom:6px; }
.inv-to { font-size:16px; font-weight:700; margin:14px 0; }
.inv-to-top { font-size:21px; font-weight:800; margin:2px 0 10px; border-bottom:2px solid #333; padding-bottom:8px; }

/* 동시편집 잠금 배너 */
.lock-banner { background:#fff4ce; border:1px solid #ffb900; color:#5c4400; font-size:13px; font-weight:600; padding:7px 12px; display:flex; align-items:center; gap:8px; }

/* 처리확인 - 메일확인(클릭-달력-날짜) */
.mailchk-row { display:flex; flex-wrap:wrap; gap:8px; }
.mailchk { display:flex; align-items:center; gap:6px; border:1px solid var(--line2); border-radius:6px; padding:6px 10px; background:#fafafa; cursor:pointer; }
.mailchk.on { background:#e6f4e6; border-color:#8bc48b; }
.mailchk .mc-label { font-size:13px; font-weight:600; cursor:pointer; user-select:none; }
.mailchk input[type=date] { border:none; background:transparent; font-size:12px; width:118px; cursor:pointer; }

/* 반송 부속품 체크박스 줄 */
.chk-row { display:flex; flex-wrap:wrap; gap:4px 16px; padding:4px 2px; }
.chk-row .chk-item { display:flex; align-items:center; gap:5px; font-size:13px; cursor:pointer; }

/* 스펙 종합입력 */
.spec-bulk textarea { font-size:12.5px; }

/* ===== 注文制作 방 리스트(표) - 옛 E&J Customer Manager 스타일 ===== */
.ot-head { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); background:#faf9f8; flex-wrap:wrap; }
.ot-search { flex:1; min-width:220px; border:1px solid var(--line2); border-radius:6px; padding:7px 10px; font-size:13px; }
.ot-scroll { overflow:auto; flex:1; }
.otable { width:100%; border-collapse:collapse; font-size:13px; }
.otable th { background:#f3f2f1; text-align:left; padding:8px 10px; border-bottom:2px solid var(--line); font-size:12px; color:#555; position:sticky; top:0; z-index:1; }
.otable td { padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.otable tbody tr { cursor:pointer; }
.otable tbody tr:hover { background:var(--hover); }
.ot-img img { width:52px; height:52px; object-fit:cover; border-radius:6px; border:1px solid var(--line2); background:#fff; }
.ot-sub { font-size:11.5px; color:var(--muted); margin-top:2px; }
.ot-caution { font-size:11.5px; color:#a4262c; margin-top:2px; font-weight:600; }
.ot-money { font-weight:700; white-space:nowrap; }
.ot-next { font-size:12px; }
.ot-ops { white-space:nowrap; }
.ot-ops .btn { margin-right:3px; }
.otable td { padding:6px 8px; }
.ot-img img { width:44px; height:44px; }

/* 주문제작 상세: 사진 왼쪽 + 기본정보 오른쪽(빈틈 없이 붙임) */
.om-top2 { display:flex; gap:14px; align-items:flex-start; margin:14px 20px 4px; }
.om-top2 .om-left { width:280px; flex-shrink:0; display:flex; flex-direction:column; gap:8px; }
.om-top2 .om-left .om-img-big { width:280px !important; max-width:280px !important; aspect-ratio:1/1; }
.om-top2 .om-right { flex:1 1 auto; min-width:0; }
.om-top2 .om-right .cf, .om-top2 .om-right .cf.wide { margin:0 0 7px; padding:0; }
.om-infogrid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px 10px; margin:0 0 7px !important; padding:0 !important; }
.om-pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0 0 7px; }
.om-pair .cf { margin:0 !important; }
.om-top2 .cf label { font-size:11px; }
.om-top2 textarea { min-height:38px; }
/* 파란 헤더(고정) 안 — 손님 이름 아래 진행상황(제작 단계) 칩 */
.ct-stageline { margin-top:8px; display:flex; flex-wrap:wrap; gap:4px; }
.ct-stagechip { background:rgba(255,255,255,.16); color:#fff; border:1px solid rgba(255,255,255,.45); border-radius:12px; padding:3px 10px; font-size:11.5px; cursor:pointer; }
.ct-stagechip:hover { background:rgba(255,255,255,.3); }
.ct-stagechip.on { background:#fff; color:#0f6cbd; font-weight:700; border-color:#fff; }
/* 발주처 선택 + 등록관리 */
.vendor-row { display:flex; gap:4px; align-items:center; }
.vendor-row select { flex:1; min-width:0; }
/* 주문제작 방 좌측 카드: 사진 + 이름(크게) + 번호 + 상태 */
.cvcard.cvc-min { align-items:center; gap:10px; padding:8px 10px; }
.cvc-min-name { font-size:15.5px; font-weight:700; line-height:1.25; }
.cvcard.cvc-min .cvc-top b { font-size:11.5px; color:var(--muted); font-weight:600; }
.cvcard.cvc-min .cvc-chips { margin-top:3px; }

/* 공통 원칙: 입력칸은 필요한 만큼만 — 날짜칸은 짧게(전 서식 적용) */
.carte-sheet input[type=date] { max-width:170px; }
.carte-sheet .mailchk input[type=date] { max-width:130px; }

/* 스펙 입력폼(입력→추가→아래 목록에 기록) */
.spec-entry { margin:4px 20px 8px; border:1px solid var(--line2); border-radius:8px; background:#f8fbff; padding:10px; }
.se-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:6px; }
.se-grid input { border:1px solid var(--line2); border-radius:5px; padding:6px 8px; font-size:12px; min-width:0; }
.se-actions { display:flex; align-items:center; gap:10px; margin-top:8px; }
.se-hint { font-size:11px; color:var(--muted); }

/* 고객 메일 이력(주문제작) */
.omh { margin:6px 20px; display:flex; flex-direction:column; gap:6px; max-height:420px; overflow:auto; }
.omh-row { border:1px solid var(--line2); border-radius:6px; padding:7px 10px; font-size:13px; background:#fff; cursor:pointer; }
.omh-row:hover { background:var(--hover); }
.omh-head { display:flex; align-items:center; gap:6px; }
.omh-head .corr-date { margin-left:auto; color:var(--muted); font-size:11px; }
.omh-subj { font-weight:600; margin-top:2px; }
.omh-prev { color:#777; font-size:12px; margin-top:1px; }
.omh-body { white-space:pre-wrap; border-top:1px dashed var(--line2); margin-top:6px; padding-top:6px; color:#333; font-size:12.5px; }

/* 제작발주서 인쇄: 사진 */
.oo-img { text-align:center; margin:8px 0 12px; }
.oo-img img { max-width:70mm; max-height:70mm; border:1px solid #999; }
.inv-table { width:100%; border-collapse:collapse; font-size:13px; }
.inv-table th, .inv-table td { border:1px solid var(--line2); padding:7px 9px; vertical-align:top; }
.inv-table th { background:#f3f2f1; }
.spec-detail { font-size:11px; color:var(--muted); margin-top:3px; }
.inv-total { text-align:right; font-size:16px; font-weight:700; margin:12px 0; }
.inv-line { font-size:12px; color:#3b3a39; margin:6px 0; }
.inv-company { font-size:12px; margin-top:18px; padding-top:10px; border-top:1px solid var(--line); }
.inv-note { font-size:12px; color:var(--muted); margin-top:8px; }

/* 인쇄: 맨 위 카르테/청구서만 보이게 (긴 내용 전부) */
@media print {
  body.printing-carte .ribbon, body.printing-carte .workspace, body.printing-carte .carte-view, body.printing-carte .modal, body.printing-carte #overlay, body.printing-carte .work-ov { display:none !important; }
  body.printing-carte .carte-ov { display:none !important; }
  body.printing-carte .carte-ov:last-of-type { display:block !important; position:static; background:#fff; padding:0; }
  body.printing-carte .carte-sheet { box-shadow:none; max-width:100%; height:auto; }
  body.printing-carte .carte-bar, body.printing-carte .no-print { display:none !important; }
  body.printing-carte textarea { height:auto !important; overflow:visible !important; }
}

/* ===== 카르테 A4 인쇄 서식 (입력칸 대신 깔끔한 라벨:값 표) ===== */
#cartePrintDoc { display:none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body.printing-carte-doc > *:not(#cartePrintDoc) { display:none !important; }
  body.printing-carte-doc #cartePrintDoc { display:block !important; position:static; }
}
.pdoc { font-family:'Noto Sans JP','Noto Sans KR','Yu Gothic',sans-serif; color:#111; font-size:15px; line-height:1.5; }
.pdoc-head { display:flex; justify-content:space-between; align-items:baseline; border-bottom:2px solid #0f6cbd; padding-bottom:6px; }
.pdoc-title { font-size:13px; font-weight:700; letter-spacing:.5px; color:#0f6cbd; }
.pdoc-no { font-size:17px; font-weight:700; color:#0f6cbd; }
.pdoc-sub { display:flex; flex-wrap:wrap; gap:6px 18px; font-size:12.5px; color:#555; margin:5px 0 12px; }
.psec { margin-bottom:12px; break-inside:avoid; }       /* 섹션은 페이지 중간에서 안 잘리게(통째로 이동) */
.psec-flow { break-inside:auto; }                        /* 이력·별지는 길어지면 다음 장으로 흐름 */
.psec-h { background:#eaf2fb; border-left:5px solid #0f6cbd; font-weight:700; font-size:16px; padding:6px 10px; }
/* 고정 표 레이아웃 — 칸이 늘어나지 않고 줄이 깔끔하게 정렬 */
.ptab { width:100%; border-collapse:collapse; table-layout:fixed; }
.ptab td { border:1px solid #8fa3b6; padding:6px 9px; vertical-align:top; font-size:15px; word-break:break-word; height:26px; }
.ptab td.tl { width:17%; background:#f5f8fc; font-weight:700; font-size:13.5px; color:#333; }
.ptab td.tv { width:33%; white-space:pre-wrap; }
.ptab tr { break-inside:avoid; }
.pspec td, .pspec th { font-size:13px; text-align:left; height:auto; }
.pspec th { background:#f5f8fc; font-weight:700; }
.appx-ref { color:#0f6cbd; font-weight:700; font-size:13.5px; }
.appx-item { border:1px solid #8fa3b6; margin-top:8px; break-inside:avoid; }
.appx-h { background:#eaf2fb; font-weight:700; font-size:15px; padding:5px 10px; border-bottom:1px solid #8fa3b6; }
.appx-b { padding:8px 11px; white-space:pre-wrap; font-size:15px; line-height:1.65; }
/* 스펙은 뒷장(다음 페이지)에 인쇄 */
@media print { .spec-newpage { break-before:page; page-break-before:always; } }
/* 주문제작 섹션 */
.om-wrap { display:flex; gap:16px; padding:0 20px; align-items:flex-start; }
.om-left { flex:1; min-width:0; }
.om-right { width:200px; flex-shrink:0; display:flex; flex-direction:column; gap:6px; }
.om-right > label { font-size:12px; color:var(--muted); font-weight:700; }
.om-img { width:200px; height:200px; border:1px dashed var(--line2); border-radius:8px; display:flex; align-items:center; justify-content:center; overflow:hidden; background:#fafbfc; }
.om-img img { width:100%; height:100%; object-fit:cover; }
.om-noimg { color:var(--muted); font-size:12px; }
@media (max-width:760px){ .om-wrap{ flex-direction:column; } .om-right{ width:100%; } .om-img{ width:100%; } }
/* 목록 썸네일(주문제작) */
.thumb { width:46px; height:46px; border-radius:6px; object-fit:cover; flex-shrink:0; background:#eee; border:1px solid var(--line2); }
.carte-list-thumb { width:54px; height:54px; border-radius:6px; object-fit:cover; flex-shrink:0; background:#eee; }
/* 카르테 목록: 처음부터 크게 + 검색/분류 툴바 + 스크롤 본문 */
.carte-sheet.list-sheet { width:min(1080px,96vw); max-width:1080px; height:min(86vh,860px); max-height:86vh; display:flex; flex-direction:column; overflow:hidden; }
.cl-toolbar { display:flex; gap:8px; align-items:center; padding:10px 20px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.cl-toolbar .cl-search { flex:1; min-width:200px; height:32px; padding:0 12px; border:1px solid var(--line2); border-radius:6px; font-size:13px; }
.cl-toolbar .inline { height:32px; border:1px solid var(--line2); border-radius:6px; padding:0 8px; font-size:13px; }
.cl-scroll { flex:1; overflow-y:auto; }
.carte-sheet.list-sheet .carte-list { margin:0; width:100%; }
.carte-sheet.list-sheet .carte-list th { position:sticky; top:0; background:#f3f6fb; z-index:1; }
/* 새 메세지(라쿠텐 손님 새글) 배지 */
.new-badge { display:inline-block; background:#d13438; color:#fff; font-size:10px; font-weight:700; padding:0 6px; border-radius:9px; margin-right:6px; vertical-align:middle; white-space:nowrap; }
/* 라쿠텐 채팅(라인式): 손님=왼쪽 / 당점=오른쪽 */
.reader-body.reader-chat { padding:0; background:#eef1f5; }
.rk-info { font-size:12px; color:var(--muted); padding:8px 14px; border-bottom:1px solid var(--line); background:#fafafa; position:sticky; top:0; z-index:1; }
.rk-chat { display:flex; flex-direction:column; gap:10px; padding:16px 14px; min-height:240px; }
.rk-row { display:flex; flex-direction:column; align-items:flex-start; max-width:80%; }
.rk-row.me { align-self:flex-end; align-items:flex-end; }
.rk-bubble { background:#fff; border:1px solid #e1e4e8; border-radius:14px 14px 14px 4px; padding:8px 12px; font-size:13.5px; line-height:1.65; word-break:break-word; box-shadow:0 1px 1px rgba(0,0,0,.05); }
.rk-bubble.me { background:#d7efc6; border-color:#c4e6ad; border-radius:14px 14px 4px 14px; }
.rk-bubble .bl { min-height:1em; }
.rk-meta { display:flex; align-items:center; gap:6px; margin-top:3px; font-size:10.5px; color:var(--muted); padding:0 4px; }
.rk-row.me .rk-meta { flex-direction:row-reverse; }
.rk-read.read { color:#0b6a0b; font-weight:700; }
.rk-read.unread { color:#a4262c; font-weight:700; }
.rk-cancel { border:1px solid #a9c4e0; background:#fff; color:#0b5394; border-radius:4px; font-size:10.5px; padding:1px 6px; cursor:pointer; }
.rk-cancel:hover { background:#e7f0fa; }
.rk-edited { color:#797775; font-size:10px; margin-left:4px; }
/* 첨부파일: 사진 썸네일 + 파일 다운로드 */
.att-section { padding: 8px 14px; border-bottom: 1px solid var(--line); background: #fbfaf9; }
.att-head { font-size: 12px; font-weight: 700; color: #605e5c; margin-bottom: 6px; }
.att-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att-thumb { display: inline-flex; flex-direction: column; gap: 2px; text-decoration: none; }
.att-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); background: #fff; }
.att-thumb:hover img { outline: 2px solid var(--blue); }
.att-name { font-size: 10px; color: #605e5c; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #0b5394; background: #fff; border: 1px solid var(--line2); border-radius: 8px; padding: 5px 10px; text-decoration: none; }
.att-file:hover { background: #e7f0fa; }
.att-size { color: #797775; font-size: 10.5px; }
.att-danger { color: #a4262c; }
.att-loading { font-size: 12px; color: #797775; }
/* 답변창 첨부 */
.wk-attach { margin: 6px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wk-attlist { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.wk-attchip { font-size: 11px; background: #eceef1; border: 1px solid #dcdfe4; border-radius: 8px; padding: 1px 6px; }
.wk-attchip button { border: none; background: none; color: #a4262c; cursor: pointer; font-size: 11px; }
.rk-empty { color:var(--muted); text-align:center; padding:24px; }
.rk-raw { margin:10px 14px; font-size:11px; color:var(--muted); }
.rk-raw pre { white-space:pre-wrap; background:#fff; border:1px solid var(--line2); border-radius:6px; padding:8px; max-height:240px; overflow:auto; }
/* 토스트 알림(우하단) */
#toastHost { position:fixed; right:18px; bottom:18px; z-index:200; display:flex; flex-direction:column; gap:8px; }
.toast { background:#323130; color:#fff; padding:10px 14px; border-radius:8px; font-size:13px; box-shadow:0 6px 20px rgba(0,0,0,.3); opacity:0; transform:translateY(8px); transition:opacity .25s, transform .25s; max-width:340px; white-space:pre-line; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.new { background:#0f6cbd; }
.toast.warn { background:#8a5a00; }
/* 클릭 타격감: 누르는 순간 살짝 눌리고(스케일) 색이 반짝 — 소리 없이 경쾌하게 */
.mrow, .folder-row, .channel-head, .btn, .rbtn, .rbtn-text, .vtab, .ctx-item, .flagbtn { transition: transform .07s ease, filter .07s ease, background .12s ease; }
.mrow:active { transform: scale(.994); filter: brightness(.955); }
.folder-row:active, .channel-head:active { transform: scale(.985); filter: brightness(.94); }
.btn:active, .rbtn:active, .rbtn-text:active, .vtab:active, .flagbtn:active { transform: scale(.92); filter: brightness(.9); }
.ctx-item:active { transform: scale(.97); filter: brightness(.93); }
.loc-chip:active { transform: scale(.9); }
.loc-chip { display:inline-block; font-size:11px; color:#4b5563; background:#eceef1; border:1px solid #dcdfe4; border-radius:9px; padding:0 7px; margin-right:5px; cursor:pointer; vertical-align:middle; white-space:nowrap; }
.loc-chip:hover { background:#dde1e7; color:#111; }
.appver { font-size:10px; font-weight:700; color:#fff; background:rgba(255,255,255,.18); padding:1px 6px; border-radius:8px; margin-left:6px; vertical-align:middle; }
/* 로그인/셋업 화면 */
#authScreen { position:fixed; inset:0; background:#1b2a4a; display:flex; align-items:center; justify-content:center; z-index:9999; }
.auth-card { background:#fff; border-radius:14px; padding:28px 30px; width:320px; box-shadow:0 20px 60px rgba(0,0,0,.4); }
.auth-logo { font-size:18px; font-weight:700; color:#1b2a4a; margin-bottom:6px; }
.auth-logo small { font-weight:400; opacity:.7; font-size:12px; }
.auth-card h3 { margin:4px 0 14px; font-size:15px; }
.auth-card label { display:block; font-size:12px; color:#555; margin:10px 0 3px; }
.auth-card input { width:100%; box-sizing:border-box; padding:9px 10px; border:1px solid #cfd4da; border-radius:8px; font-size:14px; }
.auth-go { width:100%; margin-top:16px; padding:10px; }
.auth-msg { color:#a4262c; font-size:12px; min-height:16px; margin-top:8px; }
/* 사용자 영역(리본) */
.user-area { display:inline-flex; align-items:center; gap:4px; margin-right:6px; }
.user-chip { color:#fff; font-size:12px; font-weight:600; background:rgba(255,255,255,.16); padding:2px 9px; border-radius:10px; }
/* 계정관리 테이블 */
.acct-table { width:100%; border-collapse:collapse; font-size:13px; margin:8px 0; }
.acct-table th, .acct-table td { text-align:left; padding:6px 8px; border-bottom:1px solid #eee; }
.acct-table .mono, .mono { font-family:ui-monospace,Consolas,monospace; font-size:12px; }
.btn.mini { padding:2px 7px; font-size:11px; }
.btn.mini.danger, .btn.danger { color:#a4262c; }
.acct-new { margin-top:12px; padding-top:12px; border-top:1px solid #eee; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.acct-new input { padding:6px 8px; border:1px solid #cfd4da; border-radius:7px; font-size:13px; }
.acct-new b { width:100%; font-size:13px; }
.lock-warn { background:#fde7e9; color:#a4262c; border:1px solid #f3c0c5; border-radius:8px; padding:7px 10px; font-size:12.5px; margin-bottom:8px; }
/* 자동갱신 토글 ON 표시 */
.rbtn.auto-on { background:rgba(120,230,130,.30); color:#caffcf; }
/* 뷰 탭(메일 방 / 카르테 방) */
.view-tabs { display:flex; gap:4px; align-items:flex-end; flex-shrink:0; padding-left:6px; }
.vtab { height:30px; border:none; background:rgba(255,255,255,.12); color:rgba(255,255,255,.85); font-size:13px; font-weight:700; border-radius:6px 6px 0 0; padding:0 14px; cursor:pointer; white-space:nowrap; }
.vtab:hover { background:rgba(255,255,255,.22); }
.vtab.active { background:var(--pane); color:var(--blue-deep); }
/* 카르테 방: 전체화면 분할 */
.workspace.hidden, .carte-view.hidden { display:none; }
.carte-view { display:flex; flex:1; min-height:0; }
.cv-list { width:310px; flex-shrink:0; border-right:1px solid var(--line2); background:var(--folderbg); display:flex; flex-direction:column; overflow:hidden; }
.cv-list-head { display:flex; gap:6px; align-items:center; padding:8px; border-bottom:1px solid var(--line); }
.cv-list-head input { flex:1; height:30px; border:1px solid var(--line2); border-radius:6px; padding:0 8px; font-size:12px; }
.cv-list-head .btn.mini { padding:4px 8px; }
.cv-list-head2 { display:flex; gap:6px; align-items:center; padding:0 8px 8px; border-bottom:1px solid var(--line); }
.cv-list-head2 .btn.mini { padding:4px 8px; font-size:11.5px; }
.cv-list-head2 .btn.mini.on { background:var(--blue); color:#fff; }
.cv-count { font-size:11px; color:var(--muted); margin-left:auto; }
/* 목록만 보기: 디테일 숨김, 목록 전체폭 */
.carte-view.list-only .cv-detail, .carte-view.list-only .cv-splitter { display:none; }
.carte-view.list-only .cv-list { width:100%; }
.ctxmenu .ctx-head { font-size:11px; color:var(--muted); padding:5px 12px 3px; font-weight:700; }
/* 리본 초기화(개발용) 버튼 */
.rbtn-danger { color:#ffd0d0; }
.rbtn-danger:hover { background:rgba(209,52,56,.5) !important; color:#fff; }
/* 주문제작 폼: 디자인 이미지 맨 위 크게 */
.om-top { display:flex; flex-direction:column; align-items:center; gap:8px; margin:14px 20px 4px; }
.om-img-big { width:100%; max-width:420px; aspect-ratio:4/3; border:2px dashed var(--line2); border-radius:10px; display:flex; align-items:center; justify-content:center; background:#fafafa; overflow:hidden; }
.om-img-big img { width:100%; height:100%; object-fit:contain; }
.om-img-big .om-noimg { color:var(--muted); font-size:13px; }
.om-img-big.drag { border-color:var(--blue); background:#eef4fc; }
.om-imgbtns { display:flex; gap:8px; }
/* 카르테 헤더의 注文制作 라벨(글자만) */
.ct-ordtag { background:rgba(255,255,255,.25); color:#fff; font-size:12px; font-weight:700; padding:3px 9px; border-radius:9px; white-space:nowrap; }
/* 제작 진행상황 버튼 */
.om-stage { margin:10px 20px 2px; }
.om-stage-label { font-size:12px; color:var(--muted); font-weight:700; margin-bottom:5px; }
.om-stage-btns { display:flex; flex-wrap:wrap; gap:5px; }
.om-stagebtn { border:1px solid var(--line2); background:#fff; color:var(--text); border-radius:14px; padding:5px 11px; font-size:12px; cursor:pointer; }
.om-stagebtn:hover { background:var(--hover); }
.om-stagebtn.on { background:var(--blue); color:#fff; border-color:var(--blue); font-weight:700; }
/* 주문제작 카드: 디자인 썸네일 우선(없으면 💍) */
.cvc-thumb-wrap { position:relative; width:46px; height:46px; flex-shrink:0; border-radius:6px; overflow:hidden; background:#f0e9f5; display:flex; align-items:center; justify-content:center; }
.cvc-thumb-wrap .cvc-thumb { width:100%; height:100%; object-fit:cover; position:relative; z-index:1; }
.cvc-thumb-wrap .cvc-thumb.noimg { display:none; }
.cvc-thumb-wrap .cvc-thumb-ph { position:absolute; font-size:22px; z-index:0; }
.cvc-ordbadge { font-size:11px; font-weight:700; background:#f3e2ff; color:#7a2ca6; padding:1px 7px; border-radius:9px; }
/* 주문제작 방: 썸네일 더 크게(디자인 우선 식별) */
.carte-view.room-order .cvc-thumb-wrap { width:76px; height:76px; }
.carte-view.room-order .cvcard { gap:10px; }
.cv-cards { flex:1; overflow-y:auto; }
.cvcard { display:flex; gap:8px; padding:9px 10px; border-bottom:1px solid var(--line); cursor:pointer; position:relative; }
.cvcard:hover { background:var(--hover); }
.cvcard.active { background:#dbe6f4; box-shadow:inset 3px 0 0 var(--blue); }
.cvcard.seen .cvc-name { color:#6a6a6a; }
.cvcard.seen::after { content:'✓'; position:absolute; right:8px; top:8px; color:#7bc97b; font-size:12px; font-weight:700; }
.cvc-thumb { width:46px; height:46px; border-radius:6px; object-fit:cover; flex-shrink:0; background:#eee; }
.cvc-main { flex:1; min-width:0; }
.cvc-top { display:flex; align-items:center; gap:5px; font-size:12px; }
.cvc-name { font-weight:800; font-size:16px; margin:3px 0; color:#1a1a1a; }
.cvc-chips { margin:2px 0; }
.cvc-sub { font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cvc-date { font-size:10px; color:#999; margin-top:3px; }
.cv-splitter { width:5px; cursor:col-resize; background:transparent; flex-shrink:0; }
.cv-splitter:hover, .cv-splitter.dragging { background:var(--blue); opacity:.4; }
.cv-detail { flex:1; min-width:0; overflow-y:auto; background:#eef1f5; padding:14px; }
.cv-empty { display:flex; align-items:center; justify-content:center; height:100%; color:var(--muted); }
/* 인라인 카르테(분할 우측): 플로팅이 아니라 패널을 꽉 채움 */
.cv-detail .carte-sheet.inline { width:100%; max-width:none; margin:0; max-height:none; box-shadow:none; resize:none; border-radius:8px; overflow:visible; }
/* 본문 스크롤해도 손님이름 헤더(carte-top)는 상단 고정 */
.cv-detail .carte-sheet.inline .carte-top { cursor:default; }
.inv-spec { font-size:13px; color:#333; margin:6px 0 10px; padding:6px 10px; background:#f7f7f7; border-radius:5px; }
.mrow:hover { background: var(--hover); }
.mrow.active { background: var(--sel) !important; }
.mrow.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sel-line); }
.mrow.unread::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.mrow.dragging { opacity: .45; }
.mrow-main { flex: 1; min-width: 0; padding-left: 6px; }
.mrow-line1 { display: flex; justify-content: space-between; gap: 8px; }
.mrow .from { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow.unread .from { font-weight: 700; color: var(--unread); }
.mrow .date { font-size: 11px; color: var(--muted2); white-space: nowrap; }
/* 제목이 주인공: 크게, 칩 없이 한 줄 온전히 */
.mrow .subject { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0; }
.mrow.unread .subject { color: var(--blue-deep); font-weight: 700; }
.mrow.important .subject, .mrow.important .from { color: var(--red); }
/* 메타줄: 칩(상태·채널·종류·위치) + 미리보기 텍스트 */
.mrow .preview { font-size: 12px; color: var(--muted2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 0; }
.mrow .preview .pv-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mrow .preview .badge, .mrow .preview .status-chip { font-size: 10px; padding: 0 6px; flex-shrink: 0; }
.mrow .preview .chan-chip { font-size: 10px; padding: 0 6px; flex-shrink: 0; }
.mrow .preview .loc-chip { font-size: 10px; padding: 0 6px; margin-right: 5px; flex-shrink: 0; }
.chan-chip.chan-yahoo { background:#7a0e9c; color:#fff; }
.chan-chip.chan-sent { background:#0b6a0b; color:#fff; }
.chan-chip.chan-draft { background:#6b4e00; color:#fff; }
.mrow .clip { color: var(--muted); margin-left: 4px; }
/* 제목 옆 깃발(중요표시) */
.flagbtn { align-self: center; width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; font-size: 16px; color: #c8c6c4; border-radius: 4px; flex-shrink: 0; }
.flagbtn:hover { background: #eceae9; color: var(--red); }
.flagbtn.on { color: var(--red); }
/* 드롭 대상 강조 */
.folder-row.drop-hover { background: #cfe4fa; outline: 2px dashed var(--blue); outline-offset: -2px; }

/* 오른쪽 클릭 메뉴 */
.ctxmenu { position: fixed; z-index: 80; min-width: 200px; background: #fff; border: 1px solid var(--line2); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.22); padding: 4px; font-size: 13px; }
.ctx-item { padding: 8px 12px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ctx-item:hover { background: var(--hover); }
.ctx-item.ctx-move { padding-left: 22px; }
.ctx-item.ctx-danger:hover { background: #fde7e9; color: var(--red); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 0; }
.ctx-label { padding: 4px 12px; font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .5px; }

/* 본문 */
.reader-empty { color: var(--muted); display: flex; height: 100%; align-items: center; justify-content: center; font-size: 14px; }
.reader-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.reader-subject { font-size: 17px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.reader-subject.important { color: var(--red); }
.reader-meta { color: var(--muted); font-size: 12px; line-height: 1.7; }
.reader-meta b { color: var(--text); font-weight: 600; }
.reader-toolbar { padding: 8px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.reader-body { padding: 18px 20px; white-space: pre-wrap; line-height: 1.85; color: var(--text); }
.attach-warn { margin: 12px 20px 0; padding: 9px 12px; border-radius: 4px; background: #fff4ce; border: 1px solid #f9e9a0; color: #6b5900; font-size: 12px; }

.btn { border: 1px solid var(--line2); background: #fff; color: var(--text); padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--red); border-color: #e6b3b6; }
.btn.on { background: #fde7e9; border-color: var(--red); color: var(--red); }
select.inline { height: 30px; border: 1px solid var(--line2); border-radius: 4px; padding: 0 6px; background: #fff; }

/* CS 분석 패널 */
.analyze-panel { margin: 14px 20px 20px; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.analyze-panel h3 { margin: 0; padding: 10px 14px; font-size: 13px; color: #fff; background: var(--blue); }
.analyze-body { padding: 14px; }
.field-grid { display: grid; grid-template-columns: 110px 1fr; gap: 7px 14px; font-size: 13px; }
.field-grid .k { color: var(--muted); }
.field-grid .v { color: var(--text); }
.source-tag { font-size: 10px; color: var(--blue); border: 1px solid #b3d3f0; background: #eff6fc; padding: 1px 6px; border-radius: 10px; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 4px; background: #f3f2f1; border: 1px solid var(--line2); }
.chip.type { background: #eff6fc; color: var(--blue-deep); border-color: #b3d3f0; }
.chip.action { background: #dff6dd; color: #0b6a0b; border-color: #b7e0b4; }
.flag-line { margin-top: 10px; font-size: 12px; color: var(--muted); }
.flag-line.warn { color: var(--red); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }

/* 모달 (설정) */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal.hidden, .overlay.hidden, .hidden { display: none; }
.modal-card { width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row select { width: 100%; height: 34px; border: 1px solid var(--line2); border-radius: 4px; padding: 0 10px; font-size: 13px; }
.form-row.inline2 { display: flex; gap: 12px; }
.hint { font-size: 11px; color: var(--muted2); margin-top: 4px; }
.test-result { font-size: 12px; margin-right: auto; }
.test-result.ok { color: var(--green); }
.test-result.ng { color: var(--red); }
.seg { display: flex; gap: 0; border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; width: fit-content; }
.seg button { border: none; background: #fff; padding: 7px 16px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--blue); color: #fff; }

/* 전체화면 */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.overlay-inner { width: min(900px, 92vw); max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 8px; }
.overlay-close { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 10px; background: #fff; border-bottom: 1px solid var(--line); }
.loading { color: var(--muted); padding: 16px 20px; }
