/* 전환수집 채널 매핑(스토어 × 매체) — 2026-09-20 #165. 공통 표·칩·버튼을 그대로 쓰고 그리드 간격만 정한다. */
/* 같은 화면의 [기본 설정]·[광고 등록 랜딩 확인]과 **같은 카드 규격**이다 — 이것만 카드가 아니어서
   글과 표의 왼쪽 기준선이 어긋나 보였다(2026-09-21 지적 "문장의 정렬도 이상하고"). */
.cm-section { margin: 0 0 20px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card, #fff); }
/* 머리줄 둘 — 위는 제목·스위치·상태(무엇을 보는 화면인지), 아래는 조작(일괄·추천·비교·저장).
   한 줄에 몰아넣으니 좁은 화면에서 제목과 버튼이 섞여 읽히지 않았다. */
.cm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
/* 제목과 상태 칩은 **같은 24px 줄**에 세로 가운데로 선다(2026-09-30 지시 "미정 1칸 마크 정렬") — 제목에 광고주명 <small>이
   붙어 baseline 정렬이던 때 칩이 제목보다 떠 보였다. 제목 글자 높이(line-height)와 칩 높이를 같은 값으로 맞춘다. */
.cm-head h3 { margin: 0; font-size: 16px; line-height: 24px; height: 24px; color: var(--c-primary, var(--text)); display: inline-flex; align-items: center; }
/* 상태 칩 — 제목 바로 옆, 제목 줄(24px)과 같은 높이로 가운데. 공통 .chip은 theme.css가 카드색·굵은 글씨로 덮어
   «사용 안 함»이 빛바랜 상자로 보였다(2026-09-22 지적). 색은 앱 상태색 그대로: 회색(사용 안 함)·주황(미매핑)·초록(모두 매핑됨). */
.cm-state { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 9px; border-radius: 12px; box-sizing: border-box;
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; margin: 0; align-self: center; }
.cm-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.cm-state.off { background: #f1f3f6; color: #6b7280; border: 1px solid #e3e7ed; }
.cm-state.warn { background: #fff4e5; color: #b06a00; }
.cm-state.ok { background: #e8f7ee; color: #1E7A46; }
/* «원천 미확정 N개»는 누르는 칩이다(캠페인 표를 그 캠페인만으로 거른다, 2026-10-02) — 공통 button 규칙(테두리·패딩·굵기)을 지우고
   위 칩 규격 그대로 둔다. 눌린 상태는 진한 주황 바탕 + 흰 글씨. */
button.cm-state { border: 1px solid transparent; font-family: inherit; cursor: pointer; }
button.cm-state.warn:hover { border-color: #f0c88a; }
button.cm-state.warn[aria-pressed="true"] { background: #b06a00; color: #fff; border-color: #b06a00; }
button.cm-state:focus-visible { outline: 2px solid var(--c-primary, #1a56db); outline-offset: 2px; }
.cm-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.cm-head #cm-save { margin-left: 4px; }
.cm-closed { margin-top: 12px; border: 1px dashed var(--border); border-radius: 10px; padding: 16px 18px;
  background: #fafbfc; color: var(--muted); font-size: 13px; line-height: 1.6; }
.cm-closed b { color: var(--text); }
.cml-bulk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
/* 저장이 왜 잠겼는지 — 툴팁만 두면 호버해야 안다(2026-09-21 오스카 조건). 막힌 사람이 이유를 못 찾는 것이
   바로 직전 사고의 모양이었다(«이 계정 역할에는 허용되지 않은 작업입니다»만 보이던 화면). */
.cm-blocked { font-size: 12px; color: #b06a00; background: #fff4e5; border-radius: 6px; padding: 5px 9px; }
.cm-blocked b { color: #8a5200; }

/* 대표 URL 링크 · 근거 없음 글자 — 캠페인 표의 미정 줄이 쓴다(스토어 × 매체 표는 2026-09-30 지시로 화면에서 뺐다). */
.cml-url { font-size: 11px; font-weight: 400; color: #1a56db; text-decoration: none; overflow-wrap: anywhere; word-break: break-all; }
.cml-url:hover { text-decoration: underline; }
.cml-none { font-size: 12px; color: var(--muted); }
/* 마케팅 링크 줄(#897) 경고 칩 — «NT 미수집»(스토어 유입 수집이 없는 광고주) · «규칙과 다름»(저장값이 스마트스토어가 아닌 칸) */
.cm-nt-miss { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: #fff4e5; color: #b06a00; font-size: 12px; font-weight: 600; white-space: nowrap; }
/* 잠긴 원천 셀렉트(#897) — 고를 수 없음이 보이게: 회색 배경 · 화살표 없음 · 자물쇠(다른 비활성 부품의 회색 톤과 같다 — .cm-state.off) */
.cm-nt-lock { position: relative; display: inline-block; vertical-align: middle; }
.cm-nt-lock select[data-cm-ntfixed] { appearance: none; -webkit-appearance: none; background: #f1f3f6; background-image: none; color: #6b7280;
  border: 1px solid #e3e7ed; padding-right: 30px; cursor: not-allowed; opacity: 1; }
.cm-nt-lock::after { content: ""; position: absolute; right: 10px; top: 50%; width: 12px; height: 12px; margin-top: -6px; pointer-events: none; opacity: .6;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7280'%3E%3Cpath d='M8 1a3.5 3.5 0 0 0-3.5 3.5V7H4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1h-.5V4.5A3.5 3.5 0 0 0 8 1zm2 6H6V4.5a2 2 0 1 1 4 0V7z'/%3E%3C/svg%3E"); }
.cm-banner { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--warn, #d08700); background: var(--surface-2, #fff8e6);
  border-radius: 4px; }
.cm-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.cm-table th, .cm-table td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.cm-table thead th { text-align: center; white-space: nowrap; }
.cm-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* `.cm-fmt`는 이 화면이 아니라 **app.js의 매체 관리 모달**(광고 형태 줄)이 쓴다 — 이름만 같다.
   매핑 격자를 목록으로 바꾸며 지웠다가 되살렸다(2026-09-21 오스카 게이트). 옮길 때 그쪽 클래스명을 함께 고칠 것. */
.cm-fmt { color: var(--text); }
.cm-history { margin-top: 12px; }
.cm-history summary { cursor: pointer; }
.cm-fixed { display: inline-flex; align-items: center; gap: 6px; }
/* 리포트·실시간 표에 붙는 것 (확정 모드에서만 나온다) — 행 옆 원천 배지와 목록 상단 안내 줄 */
.cm-badge { margin-left: 6px; }
tr.cm-note td { background: var(--surface-2, #fff8e6); font-size: 12px; font-weight: 400; white-space: normal; }
tr.cm-note .chip { margin-right: 4px; }
/* 좁은 화면 — 4칸을 한 줄에 넣지 못하므로 스토어 이름 아래로 차례로 접는다(가로 스크롤을 만들지 않는다). */
@media (max-width: 820px) {
  .cm-head #cm-save { margin-left: 0; }
  .cm-table { min-width: 640px; }
  .cm-tools { margin-left: 0; width: 100%; }
}

/* #353 원천이 갈린 조합의 캠페인 귀속 판정 — 경고 바로 아래, 경고와 같은 폭. 긴 캠페인명·후보 스토어는 줄바꿈한다. */
.cm-attr { margin: -2px 0 10px; padding: 8px 10px; border: 1px solid var(--line, #e3e7ed); border-radius: 6px; font-size: 12.5px;
  line-height: 1.6; overflow-wrap: anywhere; }
.cm-attr p { margin: 0 0 4px; }
.cm-attr ul { margin: 4px 0; padding-left: 18px; }
.cm-attr li { margin: 2px 0; }
.cm-attr details { margin: 2px 0 4px; }
.cm-attr summary { cursor: pointer; color: var(--accent, #2b59c3); }
.cm-attr-man b { color: #b06a00; }

/* #353 3단계 캠페인 귀속 기준 스위치 — 상태 문구는 왼쪽, 조작은 오른쪽(공통 규칙). 좁은 화면에서는 두 줄로 내려간다. */
.cm-attr-sw { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--line, #e3e7ed); border-radius: 6px; font-size: 12.5px;
  line-height: 1.6; overflow-wrap: anywhere; }
.cm-attr-sw-l { flex: 1 1 260px; min-width: 0; }
.cm-attr-sw-st { margin-left: 6px; color: var(--muted, #667085); }
.cm-attr-sw-st b { color: var(--text, #1f2937); }
.cm-attr-sw-c { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.cm-attr-date { display: inline-flex; align-items: center; gap: 4px; }
.cm-attr-date input { height: 30px; }

/* #570 캠페인별 전환 원천 한눈에 보기 — 최근 30일 광고비·전환이 있는 캠페인 전부. 행 = 캠페인, 원천 칸만 조작.
   필터 한 줄(매체·보기·검색) → 표. 표는 세로로만 스크롤(가로는 좁은 화면에서 카드형으로 접는다). */
.cmc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 8px; font-size: 13px; }
.cmc-bar select, .cmc-bar input { height: 32px; }
.cmc-bar input[type=search] { flex: 1 1 180px; min-width: 0; }
/* 검색칸 오른쪽 빠른 보기 칩(2026-10-02) — 입력칸과 같은 32px 줄. 눌리면 주 색 바탕. */
.cmc-chip { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px; background: #fff; color: var(--c-text-sub, #5a5a5a); border: 1px solid var(--border); }
.cmc-chip b { font-weight: 700; color: #b06a00; }
.cmc-chip:hover { border-color: var(--c-primary, #1a56db); }
.cmc-chip[aria-pressed="true"] { background: var(--c-primary, #1a56db); border-color: var(--c-primary, #1a56db); color: #fff; }
.cmc-chip[aria-pressed="true"] b { color: #fff; }
.cmc-sum { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.cmc-sum b { color: var(--text); }
.cmc-sum .warn { color: #b06a00; }
.cmc-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.cmc { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmc th { position: sticky; top: 0; background: #f7f8fa; color: var(--muted); font-weight: 600; font-size: 12px; text-align: left;
  padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
/* 공통 표 규칙(td 가운데 정렬·줄바꿈 없음)을 덮는다 — 긴 캠페인명·스토어 후보가 칸을 뚫고 나갔다(375px 미리보기) */
.cmc td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.cmc td small { white-space: normal; overflow-wrap: anywhere; }
.cmc tr:last-child td { border-bottom: 0; }
.cmc td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmc td small { display: block; color: var(--muted); font-size: 11px; }
.cmc tr.man td:first-child { box-shadow: inset 3px 0 0 #e8a33d; }     /* 사람이 정할 캠페인 */
.cmc tr.set td:first-child { box-shadow: inset 3px 0 0 #2b59c3; }     /* 직접 지정한 캠페인 */
.cmc select { max-width: 100%; min-width: 150px; }
/* 1280(사이드바 포함)에서 매체명이 글자마다 줄바꿈되고(«Goo/gle/Ads») 긴 원천 옵션이 표 폭을 가져갔다(2026-09-30 미리보기) —
   매체 칸은 줄바꿈하지 않고, 원천 select는 280px까지만 넓힌다(옵션 전체 글자는 펼치면 보인다). 좁은 화면은 아래에서 100%. */
.cmc td[data-l="매체"] { white-space: nowrap; }
.cmc td[data-l="전환 원천"] select { max-width: 280px; }
.cmc-k { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11.5px; white-space: nowrap; background: #f1f3f6; color: #4b5563; }
.cmc-k.man { background: #fff4e5; color: #b06a00; }
.cmc-k.set { background: #e8effc; color: #1f4aa8; }
.cmc-k.auto { background: #e8f7ee; color: #1E7A46; }
.cmc-more { margin-top: 6px; font-size: 12px; color: var(--muted); }
@media (max-width: 820px) {
  .cmc-wrap { max-height: none; border: 0; }
  .cmc thead { display: none; }
  .cmc, .cmc tbody, .cmc tr, .cmc td { display: block; width: 100%; box-sizing: border-box; }
  .cmc tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; padding: 6px 0; }
  .cmc td { border: 0; padding: 3px 10px; }
  .cmc td.num { text-align: left; }
  .cmc td[data-l]::before { content: attr(data-l) ' '; color: var(--muted); font-size: 11px; }
  .cmc select, .cmc td[data-l="전환 원천"] select { width: 100%; max-width: 100%; }
}

/* 미정 줄 — 원천이 빈 스토어 × 매체 칸, 캠페인 표 맨 위(2026-09-30 지시 "미정 1칸을 리스트에서 가장 상단으로").
   주황 왼쪽 줄 + 옅은 바탕으로 캠페인 줄과 가른다. 고른 뒤(저장 전)는 바탕만 옅게 남긴다. */
.cmc tr.pend td { background: #fffaf2; }
/* 랜딩 스토어 2곳 이상 캠페인 — 행을 누르면 스토어별 줄이 펼쳐진다(2026-10-02). */
.cmc tr.cmc-openable { cursor: pointer; }
.cmc tr.cmc-openable:hover td { background: #fafbfc; }
.cmc tr.cmc-openable.open td { background: #f6f8fc; }
.cmc-open { display: inline-block; margin-top: 4px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--border); background: #fff; color: var(--c-primary, #1a56db); }
.cmc tr.cmc-sub td { background: #f6f8fc; border-bottom-style: dashed; }
.cmc tr.cmc-sub td:first-child { box-shadow: inset 3px 0 0 #e8a33d; }
.cmc-sub-mk { color: var(--muted); margin-right: 2px; }
.cmc td.cmc-sub-note { font-size: 12px; color: var(--muted); white-space: normal; }
@media (max-width: 820px) { .cmc tr.cmc-sub { margin-top: -6px; border-style: dashed; } .cmc tr.cmc-sub td[data-l="매체"] { display: none; } }
.cmc tr.pend td:first-child { box-shadow: inset 3px 0 0 #e8a33d; }
.cmc tr.pend.done td { background: #fbfcfe; }
.cmc tr.pend td small { display: block; }
.cmc tr.pend .cmc-k { margin-right: 4px; }
.cmc-src { display: flex; flex-wrap: wrap; gap: 6px; }
.cmc-src select { flex: 1 1 150px; }
.cmc-h { margin: 14px 0 4px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.cmc-h small { font-weight: 400; }
/* 전날 대비 «신규»/«변경» (app/conv_map_daily) — 캠페인명 옆 작은 표. 색은 상태색(초록=신규 · 파랑=변경). */
.cmc-mark { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; line-height: 16px;
  vertical-align: 1px; white-space: nowrap; }
.cmc-mark.new { background: #e8f7ee; color: #1E7A46; }
.cmc-mark.chg { background: #e8effc; color: #1f4aa8; }
.cmc-marks { white-space: nowrap; }
@media (max-width: 820px) {
  .cmc tr.pend td.pend-ev { display: block; }
  .cmc-src select { flex-basis: 100%; }
}
