/* ==========================================================================
   顧客（CRM）の画面（js/crm.js。見本は docs/crm/preview.html・電話のかけ方は docs/crm/preview-call-in-card.html）
   - 色・文字・線は css/index.css のデザインの土台と同じ値。クラスはすべて cx- で始める（ほかの画面とぶつけない）
   - 情報の密度を高く、表と数字が読みやすい業務用の画面。色は意味のあるところだけ
   ========================================================================== */
.cx {
  --brand: #56693a; --brand-hover: #485830; --brand-50: #f4f5ee; --brand-100: #e8ebdc; --brand-ring: rgba(86, 105, 58, .22);
  --g25: #fcfbf8; --g50: #f7f5f0; --g100: #efece5; --g200: #e4e0d6; --g300: #d1cbbe; --g400: #a39c8e;
  --g500: #736c60; --g600: #555047; --g700: #3d3933; --g800: #2a2723; --g900: #1c1a17;
  --ok: #3a7254; --ok-bg: #ecf3ec; --warn: #94630f; --warn-bg: #fbf4e4; --warn-line: #e4c88a; --ng: #a8392b; --ng-bg: #f9ece8;
  --ink: var(--g900); --ink-2: var(--g700); --muted: var(--g500); --faint: var(--g400); --line: var(--g200); --line-2: var(--g300);
  --brand-25: #f9faf5; --brand-line: #c9d1b0; --ok-hover: #2f5f45; --ok-line: #c4dac9; --ng-line: #e6b5aa; --amber: #b8862e;
  --violet: #7a5468; --violet-bg: #f4edf0; --violet-25: #fbf8f9; --violet-line: #dcc9d2;   /* ほかの人の顧客（さわれない） */
  --note-bg: #fbf6e6; --note-line: #e2d4a4; --note-ink: #6b5321;                           /* 備考・メモ */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
  --gut: 20px;   /* 画面の左右の余白 */
  --shadow-pop: 0 8px 24px rgba(28, 26, 23, .12); --shadow-dlg: 0 20px 60px rgba(28, 26, 23, .28); --veil: rgba(28, 26, 23, .45);
  --mono: 'Noto Sans JP', sans-serif;
  font-size: 13px; line-height: 1.55; color: var(--ink); letter-spacing: .01em;
  display: flex; flex-direction: column; background: var(--g50);
}
.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx button, .cx input, .cx select, .cx textarea { font: inherit; color: inherit; letter-spacing: inherit; }
.cx button { cursor: pointer; }
.cx button:disabled { cursor: not-allowed; opacity: .5; }
.cx a { color: var(--brand); text-decoration: none; cursor: pointer; }
.cx h1, .cx h2, .cx h3, .cx h4 { margin: 0; letter-spacing: 0; }
.cx .num { font-variant-numeric: tabular-nums; font-family: 'Noto Sans JP', sans-serif; }
.cx .muted { color: var(--muted); }
.cx .small { font-size: 12px; }
.cx .late { color: var(--ng); font-weight: 600; }

/* PC：ポータルの内容の枠いっぱいに広げ、画面の中でスクロールする */
@media (min-width: 901px) {
  #page-crm.active { margin: -28px -32px -40px; }
  .cx { height: calc(100vh - var(--header-height) - var(--sys-tabs-height, 42px)); }   /* 上の帯と、上側のタブ（css/sys.css）の分を引く */
}

/* ── 上の帯（画面の切り替え・検索） ── */
.cx-bar { flex: none; display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 calc(var(--gut) - 12px) 0 calc(var(--gut) - 12px); background: #fff; border-bottom: 1px solid var(--line); }
/* 幅がせまいときは、タブを横に送れるようにし、検索欄を縮める（検索欄を画面の外に押し出さない） */
.cx-tabs { display: flex; gap: 2px; height: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cx-tabs::-webkit-scrollbar { display: none; }
.cx-tabs button { flex: none; }
.cx-tabs button { border: 0; background: none; padding: 0 12px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cx-tabs button:hover { color: var(--ink); }
.cx-tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.cx-tabs .cx-count { font-size: 11px; color: var(--faint); font-weight: 500; }
.cx-tabs button.on .cx-count { color: var(--brand); }
.cx-tabs button.sep { margin-left: 13px; position: relative; }
.cx-tabs button.sep::before { content: ''; position: absolute; left: -7px; top: 15px; bottom: 15px; width: 1px; background: var(--line-2); }
.cx-search { margin-left: 12px; margin-right: auto; position: relative; flex: 0 1 340px; min-width: 200px; }   /* 画面の切り替えは上側のタブ（css/sys.css）へ移した */
.cx-search input { width: 100%; height: 32px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 64px 0 30px; background: var(--g25); font-size: 13px; }
.cx-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: #fff; }
.cx-search svg { position: absolute; left: 10px; top: 9px; width: 14px; height: 14px; stroke: var(--faint); fill: none; stroke-width: 2; }
.cx-search .cx-kbd { position: absolute; right: 8px; top: 7px; }
.cx-suggest { position: absolute; top: 36px; right: 0; width: max(100%, 340px); max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); z-index: 60; max-height: 420px; overflow: auto; }
.cx-suggest button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 12px; border-bottom: 1px solid var(--g100); }
.cx-suggest button:hover, .cx-suggest button.on { background: var(--brand-50); }
.cx-suggest b { font-weight: 600; display: block; }
.cx-suggest span { font-size: 12px; color: var(--muted); }
.cx-suggest .cx-empty { padding: 12px; }
.cx-kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 0 5px; background: #fff; line-height: 16px; display: inline-block; white-space: nowrap; }

.cx-view { flex: 1; min-height: 0; overflow: auto; }
.cx-pad { padding: 20px var(--gut) 40px; max-width: 1480px; }
.cx-loading, .cx-empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.cx-error { margin: 16px 24px; padding: 10px 14px; border: 1px solid var(--ng-line); background: var(--ng-bg); color: var(--ng); border-radius: var(--r-md); }

/* ── 部品 ── */
.cx-btn { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.cx-btn:hover:not(:disabled) { background: var(--g50); }
.cx-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.cx-btn.primary:hover:not(:disabled) { background: var(--brand-hover); }
.cx-btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.cx-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.cx-panel-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); min-height: 46px; }
.cx-panel-head { flex-wrap: wrap; }
.cx-panel-head h3 { font-size: 14px; font-weight: 600; white-space: nowrap; }
.cx-panel-head .sub { color: var(--muted); font-size: 12px; }
.cx-panel-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.cx-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-xs); font-size: 12px; font-weight: 500; background: var(--g100); color: var(--ink-2); white-space: nowrap; }
.cx-tag.brand { background: var(--brand-50); color: var(--brand); }
.cx-tag.ok { background: var(--ok-bg); color: var(--ok); }
.cx-tag.warn { background: var(--warn-bg); color: var(--warn); }
.cx-tag.ng { background: var(--ng-bg); color: var(--ng); }
.cx-tag.line { background: #fff; border: 1px solid var(--line-2); }
.cx-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--g400); flex: none; }
.cx-dot.ok { background: var(--ok); } .cx-dot.ng { background: var(--ng); } .cx-dot.brand { background: var(--brand); } .cx-dot.warn { background: var(--amber); }
.cx-h { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cx-h h1 { font-size: 20px; font-weight: 600; }
.cx-h .sub { color: var(--muted); font-size: 13px; padding-bottom: 3px; }
.cx-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cx-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.cx-seg button { border: 0; background: #fff; padding: 4px 11px; font-size: 12px; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.cx-seg button:last-child { border-right: 0; }
.cx-seg button.on { background: var(--g800); color: #fff; }
.cx-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cx-select, .cx-input { height: 30px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; padding: 0 8px; font-size: 13px; }
.cx-select:focus, .cx-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

/* 表 */
.cx-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.cx-grid th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--g25); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.cx-grid td { padding: 8px 12px; border-bottom: 1px solid var(--g100); vertical-align: middle; }
.cx-grid tbody tr:hover { background: var(--g25); }
.cx-grid tbody tr.sel { background: var(--brand-50); }
.cx-grid tbody tr.click { cursor: pointer; }
.cx-grid .r { text-align: right; }
.cx-grid td.name b { font-weight: 600; display: block; }
.cx-grid td.name span { color: var(--muted); font-size: 12px; }
.cx-grid input[type=checkbox] { accent-color: var(--brand); }
.cx-when { font-family: 'Noto Sans JP', sans-serif; font-size: 12px; white-space: nowrap; }

/* ── 今日 ── */
.cx-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cx-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; min-width: 0; }
.cx-kpi.click { cursor: pointer; }
.cx-kpi.click:hover { border-color: var(--g400); }
.cx-kpi label { font-size: 12px; color: var(--muted); display: block; }
.cx-kpi .v { font-size: 24px; font-weight: 600; margin-top: 2px; letter-spacing: -.01em; }
.cx-kpi .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.cx-kpi .d { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cx-kpi.alert .v { color: var(--ng); }
.cx-home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cx-list li { list-style: none; padding: 9px 16px; border-bottom: 1px solid var(--g100); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.cx-list li:last-child { border-bottom: 0; }
.cx-list ul { margin: 0; padding: 0; }
.cx-list b { font-weight: 600; }
.cx-list time { margin-left: auto; color: var(--faint); font-size: 11px; white-space: nowrap; font-family: 'Noto Sans JP', sans-serif; }
.cx-list .cx-dot { margin-top: 6px; }
.cx-scroll { max-height: calc(100vh - 330px); overflow: auto; }

/* ── 今日（js/crm.js の renderToday。見本は docs/crm/preview-call-in-card.html）。クラスは ct- で始める ── */
.ct-hero { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; background: #fff; border: 1px solid var(--brand-line); border-radius: var(--r-md); padding: 16px 20px; }
.ct-hero .n { display: flex; align-items: baseline; gap: 6px; }
.ct-hero .n label { font-size: 13px; color: var(--muted); margin-right: 6px; }
.ct-hero .n b { font-size: 36px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.ct-hero.none .n b { color: var(--faint); }
.ct-hero .d { flex: 1; min-width: 220px; color: var(--ink-2); }
.ct-hero .d b { font-weight: 600; }
.cx .ct-go { height: 44px; padding: 0 28px; font-size: 15px; }
.ct-warn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r-md); padding: 10px 14px; color: var(--warn); }
.ct-warn .cx-btn { margin-left: auto; }
.ct-list { overflow: hidden; }
.ct-sec h4 { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px 8px; font-size: 13px; font-weight: 600; background: var(--g25); border-bottom: 1px solid var(--line); }
.ct-sec + .ct-sec h4 { border-top: 1px solid var(--line); }
.ct-sec h4 b { color: var(--brand); }
.ct-sec h4 i { font-style: normal; font-weight: 400; font-size: 12px; color: var(--faint); }
.ct-grid td.tm { width: 92px; white-space: nowrap; }
.ct-grid td.tm b { font-size: 15px; font-weight: 600; }
.ct-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ct-nums > div { padding: 12px 14px; min-width: 0; }
.ct-nums > div + div { border-left: 1px solid var(--g100); }
.ct-nums label { display: block; font-size: 12px; color: var(--muted); }
.ct-nums b { display: block; font-size: 22px; font-weight: 600; line-height: 1.3; }
.ct-nums span { display: block; font-size: 11px; color: var(--muted); }
.ct-note { padding: 8px 14px 10px; border-top: 1px solid var(--g100); }
.cx .ct-link { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 16px; }
.cx .ct-link:hover { border-color: var(--g400); }
.ct-link b { margin-left: auto; font-weight: 600; }
.ct-link span { color: var(--faint); }
.cx-q-more { padding: 10px 14px; font-size: 12px; color: var(--muted); }
.cx-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cx-progress .bar { flex: 1; height: 4px; background: var(--g100); border-radius: 2px; overflow: hidden; }
.cx-progress .bar i { display: block; height: 100%; background: var(--brand); transition: width .2s; }

/* 上の帯の「電話の続き」（並びの途中で、ほかの画面に移ったとき） */
.cx-resume-box { display: flex; align-items: center; gap: 2px; margin-right: 12px; }
.cx .cx-resume { height: 32px; padding: 0 12px; border: 1px solid var(--brand); background: var(--brand-50); color: var(--brand); border-radius: var(--r-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cx .cx-resume:hover { background: var(--brand-100); }
.cx .cx-resume-x { width: 26px; height: 26px; border: 0; background: none; color: var(--faint); font-size: 16px; line-height: 1; border-radius: var(--r-sm); }
.cx .cx-resume-x:hover { background: var(--g100); color: var(--ng); }

/* 話す順番（顧客カードの「今回の電話」の下） */
.cx-script { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--g25); margin-top: 6px; }
.cx-script summary { padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.cx-script summary::-webkit-details-marker { display: none; }
.cx-script summary::after { content: '開く'; margin-left: auto; font-weight: 400; color: var(--muted); font-size: 11px; }
.cx-script[open] summary::after { content: '閉じる'; }
.cx-script ol { margin: 0; padding: 0 12px 10px 28px; font-size: 12px; color: var(--ink-2); }
.cx-script li { margin-bottom: 6px; }
.cx-script li b { color: var(--ink); }
.cx-note { font-size: 12px; color: var(--muted); background: var(--g50); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin-bottom: 12px; }
.cx-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--g900); color: #fff; padding: 9px 16px; border-radius: var(--r-sm); font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 9000; }
.cx-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.cx-toast.ng { background: var(--ng); }

/* ── 顧客一覧 ── */
.cx-bulk { display: none; align-items: center; gap: 10px; padding: 8px 12px; background: var(--g800); color: #fff; border-radius: var(--r-md) var(--r-md) 0 0; font-size: 13px; flex-wrap: wrap; }
.cx-bulk.on { display: flex; }
.cx-bulk .cx-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.cx-bulk .cx-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
.cx-bulk select { height: 26px; border-radius: var(--r-sm); border: 1px solid rgba(255, 255, 255, .3); background: var(--g700); color: #fff; padding: 0 6px; font-size: 12px; }
.cx-pager { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cx-pager .right { margin-left: auto; display: flex; gap: 6px; }

/* ── 顧客カード ── */
.cx-src { padding: 12px 16px; font-size: 12px; color: var(--ink-2); }
.cx-src p { margin: 0 0 6px; }
.cx-memo { padding: 10px 16px; border-bottom: 1px solid var(--g100); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-memo:last-child { border-bottom: 0; }
.cx-memo label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cx-recent li { cursor: pointer; }
.cx-recent li:hover { background: var(--g25); }

/* ── チーム ── */
.cx-team { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cx-ibar { display: flex; align-items: center; gap: 8px; }
.cx-ibar .b { height: 6px; background: var(--g100); border-radius: 3px; flex: 1; min-width: 60px; overflow: hidden; }
.cx-ibar .b i { display: block; height: 100%; background: var(--brand); }
.cx-funnel { padding: 12px 16px; }
.cx-funnel .st { display: grid; grid-template-columns: 84px minmax(0, 1fr) 56px; gap: 10px; align-items: center; padding: 5px 0; font-size: 12px; }
.cx-funnel .st .b { height: 18px; background: var(--brand-100); border-radius: 3px; min-width: 2px; }
.cx-funnel .st .b.dark { background: var(--brand); }
.cx-funnel .st .n { text-align: right; font-family: 'Noto Sans JP', sans-serif; font-weight: 600; }
.cx-funnel .rate { font-size: 11px; color: var(--muted); padding-left: 94px; margin: -2px 0 2px; }
.cx-chart { padding: 12px 16px 8px; }
.cx-chart svg { width: 100%; height: 180px; display: block; }
.cx-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding: 0 16px 12px; }
.cx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

@media (max-width: 1360px) {
  .cx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cx-search { flex-basis: 260px; }
}

/* スマホ・タブレット：縦に並べ、ページごとスクロールする */
@media (max-width: 900px) {
  .cx { background: transparent; }
  .cx-bar { height: auto; flex-wrap: wrap; padding: 8px 0; gap: 8px; background: transparent; border-bottom: 0; }
  .cx-tabs { order: 2; width: 100%; overflow-x: auto; border-bottom: 1px solid var(--line); height: 40px; }
  .cx-search { flex: 1 1 100%; min-width: 0; order: 1; margin: 0; }
  .cx-search .cx-kbd { display: none; }
  .cx-view { overflow: visible; }
  .cx-pad { padding: 12px 0 24px; }
  .cx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-home, .cx-team { grid-template-columns: minmax(0, 1fr); }
  .cx-scroll { max-height: none; }
  .cx-kbd { display: none; }
}

/* ── 顧客一覧（左にリスト・右に法人一覧。js/crm.js の renderList。見本は docs/crm/preview-card-v3.html）。クラスは cl- で始める ── */
.cl { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: 100%; min-height: 0; }
.cl-side { background: #fff; border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; }
/* いちばん上：その側の全部の件数（顧客一覧＝リスト総数・登録法人データ＝全部の法人）。2026-11-20 に上のタブを分けたので、枠は1つ（.one） */
.cl-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cl-scope.one { grid-template-columns: 1fr; }
/* 登録法人データの左：リストを作って顧客一覧へ移す流れの説明 */
.cl-flow { margin: 10px 2px 0; font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.cl-flow + .cl-make { margin-top: 8px; }
.cx .cl-make.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.cx .cl-make.primary:hover { background: var(--brand); filter: brightness(.94); }
.cx .cl-scope button { border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-md); padding: 8px 10px; text-align: left; min-width: 0; }
.cl-scope button b { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.cl-scope button span { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.cl-scope button small { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; }
.cx .cl-scope button:hover { background: var(--g50); }
.cx .cl-scope button.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-ring); }
.cl-scope button.on b, .cl-scope button.on span { color: var(--brand); }
/* リストを作る（顧客一覧では左のいちばん下。押すと「登録法人データ」のタブへ移る） */
.cx .cl-make { width: 100%; min-height: 34px; margin-top: 16px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.cx .cl-make:hover { background: var(--g50); }
.cl-side h3 { font-size: 12px; color: var(--muted); font-weight: 600; margin: 18px 6px 6px; }
.cl-li { display: block; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: var(--r-md); padding: 8px 10px; margin-bottom: 2px; }
.cl-li:hover { background: var(--g50); }
.cl-li.on { background: var(--brand-50); border-color: var(--brand-100); }
.cl-li .nm { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.cl-li .nm b { color: var(--brand); }
.cl-li .ds { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cl-empty { font-size: 12px; color: var(--faint); padding: 4px 8px; }
.cl-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.cl-head { background: #fff; border-bottom: 1px solid var(--line); padding: 12px var(--gut) 0; }
.cl-search { display: flex; gap: 8px; }
.cl-search .cx-input { flex: 1; height: 34px; }
.cl-tabs, .cx-subtabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; }
.cx-subtabs { margin: -4px 0 16px; border-bottom: 1px solid var(--line); }
.cl-tabs button, .cx-subtabs button { border: 0; background: none; padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.cl-tabs button:hover, .cx-subtabs button:hover { color: var(--ink); }
.cl-tabs button.on, .cx-subtabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.cl-tabs button i { font-style: normal; font-size: 11px; color: var(--faint); margin-left: 4px; }
.cl-tabs button.on i { color: var(--brand); }
.cl-listtab { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 6px 4px 6px 12px; border-bottom: 2px solid var(--brand); color: var(--ink); font-weight: 600; }
.cx .cl-listtab button { border: 0; background: none; font-size: 14px; color: var(--muted); padding: 0 6px; }
.cl-conds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px var(--gut); background: var(--g25); border-bottom: 1px solid var(--line); }
.cl-conds .lbl { font-size: 12px; color: var(--faint); margin-right: 2px; }
.cl-conds .sp, .cl-bar .sp, .cl-dlg-f .sp { flex: 1; }
.cl-chip { display: inline-flex; align-items: center; border: 1px solid var(--brand-100); background: var(--brand-50); color: var(--brand); border-radius: var(--r-pill); font-size: 13px; margin: 0 4px 4px 0; }
.cl-chip.neg { border-color: var(--ng-line); background: var(--ng-bg); color: var(--ng); }
.cl-chip .t { background: none; border: 0; color: inherit; padding: 3px 4px 3px 11px; }
.cl-chip.ro .t { padding-right: 11px; }
.cl-chip .x { background: none; border: 0; color: inherit; padding: 3px 9px 3px 3px; font-size: 13px; opacity: .7; }
.cl-chip .x:hover { opacity: 1; }
.cx .cl-add { border: 1px dashed var(--brand); background: #fff; color: var(--brand); border-radius: var(--r-pill); padding: 3px 13px; font-size: 13px; font-weight: 600; }
.cx .cl-add:hover { background: var(--brand-50); }
.cx .cl-link { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }
.cl-hint { width: 100%; font-size: 12px; color: var(--muted); }
/* 登録法人データ：リスト作りを1つの枠にまとめる（手順 → 条件の決め方 → いまの条件 → 登録）。上のキーワードの欄は枠の中に移した */
.cl[data-side="all"] .cl-search { display: none; }
.cl-conds.mk { display: block; padding: 12px var(--gut); }
.cl-mk { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.cl-mk-h { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cl-mk-h > b { font-size: 15px; font-weight: 700; color: var(--ink); }
.cl-steps { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--faint); }
.cl-steps li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cl-steps li i { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--line-2); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; }
.cl-steps li.on { color: var(--ink); font-weight: 600; }
.cl-steps li.on i { background: var(--brand); }
.cl-steps li.done { color: var(--muted); }
.cl-steps li.done i { background: var(--ok, #287240); }
.cl-mk-how, .cl-mk-now, .cl-mk-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cl-mk .lbl { flex: none; width: 84px; font-size: 12px; color: var(--muted); margin: 0; }
.cl-mk-ai { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.cl-mk-ai:disabled { border-color: var(--line-2); color: var(--faint); font-weight: 400; }
.cl-mk-kw { display: inline-flex; gap: 6px; flex: 1; min-width: 260px; }
.cl-mk-kw .cx-input { flex: 1; min-width: 0; height: 30px; }
.cl-mk-now .cl-chip { margin-bottom: 0; }
.cl-mk .cf { margin-top: 10px; }
.cl-mk-f { padding-top: 10px; border-top: 1px solid var(--line); }
.cl-mk-n { font-size: 13px; color: var(--ink-2); }
/* AI に伝えた言葉（どう探したかの控え） */
.cl-mk-said { align-items: flex-start; }
.cl-mk-said .said, .cl-said { flex: 1; min-width: 0; white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: var(--ink-2); background: var(--g25); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 10px; }
.cl-li .ds.said { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--faint); }
.cl-mk-n b { font-size: 18px; color: var(--ink); margin: 0 2px; }
.cl-mk-f .sp { flex: 1; }
.cf-pick .cx-input::placeholder { color: var(--ink-2); }
/* 項目を選んで絞る窓 */
.cl-pop .cl-dlg-b { min-height: 240px; }
.cl-pop-lead { margin-bottom: 10px; }
.cl-pop #cf-close { display: none; }
.cl-pop .cf { margin-top: 0; }
.cl-pop-n { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; background: var(--g25); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13px; color: var(--ink-2); }
.cl-pop-n b { font-size: 18px; color: var(--ink); margin: 0 2px; }
.cl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px var(--gut); font-size: 13px; color: var(--muted); }
.cl-bar > b { font-size: 16px; color: var(--ink); }
.cl-hid { color: var(--violet); background: var(--violet-bg); padding: 2px 10px; border-radius: var(--r-pill); }
.cl-table { flex: 1; overflow: auto; margin: 0 var(--gut) var(--gut); background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.cl-grid td { vertical-align: top; }
.cl-grid td.name { min-width: 210px; max-width: 300px; }
.cl-grid td.name > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ほかの人が優先の顧客も、ふつうの行として出す（だれでも全部見られる。2026-11-19）。だれが優先かは「営業の優先」の列で見せる */
.cl-eq { display: flex; flex-wrap: wrap; gap: 3px; min-width: 180px; max-width: 300px; }
.cl-eq span { font-size: 11px; padding: 1px 6px; border-radius: var(--r-xs); background: var(--g100); color: var(--ink-2); }
.cl-eq span.hot { background: var(--ng-bg); color: var(--ng); }
.cl-rel { font-size: 12px; white-space: nowrap; }
.cl-rel.lock { color: var(--violet); font-weight: 600; }
.cl-rel.me { color: var(--brand); font-weight: 600; }
.cl-rel.open { color: var(--ok); }
.cl-none { padding: 48px; text-align: center; color: var(--faint); }
/* 重ねる画面（条件・保存） */
.cl-veil { position: fixed; inset: 0; z-index: 1000; background: var(--veil); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; }
.cl-dlg { width: 100%; max-width: 880px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-dlg); font-size: 13px; color: var(--ink); }
.cl-dlg.sm { max-width: 600px; }
.cl-dlg-h { display: flex; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.cl-dlg-h h2 { font-size: 16px; margin: 0; }
.cx .cl-close { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 6px 10px; border-radius: var(--r-sm); }
.cl-close:hover { background: var(--g50); }
.cl-dlg-b { padding: 16px 18px; }
.cl-dlg-f { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-top: 1px solid var(--line); background: var(--g25); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.cl-count { font-size: 13px; color: var(--muted); }
.cl-count b { font-size: 16px; color: var(--ink); }
.cl-cb { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 380px; }
.cl-fields { border-right: 1px solid var(--line); padding: 8px; background: var(--g25); }
.cl-fields h4 { font-size: 11px; color: var(--faint); margin: 10px 6px 4px; }
.cl-fields button { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: var(--r-sm); padding: 7px 10px; }
.cl-fields button:hover { background: var(--g100); }
.cl-fields button.on { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.cl-ed { padding: 14px 18px; max-height: 62vh; overflow-y: auto; }
.cl-ed h3 { font-size: 14px; margin: 0 0 4px; }
.cl-ed .ex { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.cl-pick { margin-top: 40px; text-align: center; }
.cl-grid-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cl-opt { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-size: 13px; }
.cl-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.cl-opt input { accent-color: var(--brand); }
.cl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cl-row.top { align-items: flex-start; }
.cl-row .k { width: 110px; color: var(--muted); font-size: 13px; flex: none; }
.cl-row .k.wide { width: 260px; }
.cl-row .grow { flex: 1; min-width: 0; }
.cl-wide { width: 100%; margin-top: 6px; }
.cl-num { width: 90px; }
.cl-inline { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.cl-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; flex-wrap: wrap; }
.cl-seg label { padding: 5px 12px; cursor: pointer; border-right: 1px solid var(--line-2); }
.cl-seg label:last-child { border-right: 0; }
.cl-seg input { display: none; }
.cl-seg label:has(input:checked) { background: var(--g800); color: #fff; }
.cl-set { columns: 2 480px; column-gap: 16px; }
.cl-set .cx-h { column-span: all; }
.cl-set .cx-panel { margin-bottom: 16px; break-inside: avoid; }
.cl-set-b { padding: 4px 16px 16px; }
.cl-rules { margin: 0; padding-left: 18px; line-height: 1.9; }
@media (max-width: 900px) {
  .cl { grid-template-columns: 1fr; height: auto; }
  .cl-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .cl-main { overflow: visible; }
  .cl-cb { grid-template-columns: 1fr; }
  .cl-fields { border-right: 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px; }
  .cl-fields h4 { width: 100%; }
  .cl-fields button { width: auto; }
}

/* ── 顧客を開いたときの大きな画面（js/crm.js の renderCard。見本は docs/crm/preview-card-v3.html）。クラスは cc- で始める ── */
.cc-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cc-name h1 { font-size: 20px; }
.cc-name .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.cc-tel { font-size: 24px; font-weight: 600; letter-spacing: .02em; }
.cx .cc-dial { height: 36px; padding: 0 18px; font-size: 13px; font-weight: 600; }
.cx .cc-dial.live { background: var(--ng); border-color: var(--ng); }
.cc-timer { font-size: 16px; font-weight: 600; color: var(--ng); }
.cc-card { padding: 12px 16px; margin-bottom: 14px; }
.cc-ch { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cc-ch h3 { font-size: 14px; }
.cc-col { display: grid; gap: 8px; }
.cc-kv { display: flex; flex-direction: column; min-width: 0; }
.cc-kv span { font-size: 11px; color: var(--faint); }
.cc-kv b { font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.cc-kv i { color: var(--faint); font-style: normal; font-weight: 400; }
.cc-kv.soon b, .cc-kv.past b { color: var(--ng); }
.cc-kv.near b { color: var(--warn); }
.cc-person { border-top: 1px solid var(--g100); padding: 7px 0; }
.cc-person:first-of-type { border-top: 0; }
.cc-row0 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cc-edit { background: var(--brand-25); border: 1px solid var(--brand) !important; }
.cc-subform { padding: 10px; border-radius: var(--r-md); margin-top: 8px; }
.cc-fl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; margin-bottom: 6px; }
.cc-fl input, .cc-fl select, .cc-fl textarea { font-size: 13px; color: var(--ink); padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; width: 100%; }
.cc-fl input:disabled, .cc-fl select:disabled, .cc-fl textarea:disabled { background: var(--g50); color: var(--faint); }
.cc-fl.wall { grid-column: 1 / -1; }
.cc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-btns { display: flex; gap: 8px; margin-top: 8px; }
.cc-eq { border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 10px; }
.cc-eq.soon, .cc-eq.past { border-left-color: var(--ng); }
.cc-eq.near { border-left-color: var(--amber); }
.cc-kind { font-size: 12px; font-weight: 600; background: var(--g800); color: #fff; padding: 1px 8px; border-radius: var(--r-xs); }
.cc-eqg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; margin-top: 6px; }
.cc-fsub { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.cc-fsub { grid-column: 1 / -1; margin: 2px 0 0; }
.cc-fgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px; margin-top: 6px; }
.cc-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--brand-50); border-radius: var(--r-md); margin-bottom: 10px; }
.cc-memo { width: 100%; min-height: 140px; resize: vertical; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-md); font-size: 13px; line-height: 1.6; }
.cc-memo:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.cc-warn { font-size: 12px; font-weight: 600; color: var(--ng); background: var(--ng-bg); padding: 1px 9px; border-radius: var(--r-pill); }
.cc-oncall { color: var(--ng); font-weight: 600; font-size: 12px; animation: cc-blink 1.2s infinite; }
@keyframes cc-blink { 50% { opacity: .35; } }
.cc-statusbox { border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 11px; margin-top: 6px; background: var(--g25); display: grid; gap: 6px; }
.cc-statusbox select { font-size: 14px; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: var(--r-md); min-width: 160px; background: #fff; }
.cc-statusbox.stopped { background: var(--ng-bg); border-color: var(--ng-line); }
.cc-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cx .cc-chips button { border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-pill); padding: 2px 10px; font-size: 12px; }
.cx .cc-chips button.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.cc-chips .cx-input { width: 150px; }
.cc-drop { display: block; border: 2px dashed var(--line-2); border-radius: var(--r-md); padding: 12px; text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 6px; }
.cc-drop:hover, .cc-drop.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.cc-file { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--g100); }
.cc-file .fi { font-size: 18px; }
.cc-file .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cc-file select { font-size: 12px; padding: 2px 4px; border: 1px solid var(--line-2); border-radius: var(--r-xs); }
.cx .cc-relc { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 9px; margin-bottom: 4px; }
.cx .cc-relc:hover { border-color: var(--brand); background: var(--brand-50); }
.cc-relc .muted { display: block; }
/* 対応履歴の種類の札（2026-11-20。見本 v5 の形：色つきの札） */
.cc-typ { font-size: 11px; padding: 1px 7px; border-radius: var(--r-xs); background: var(--g500, #7a7771); color: #fff; font-weight: 600; white-space: nowrap; }
.cc-typ.t-テレアポ { background: #56693a; }
.cc-typ.t-対応 { background: #804d2b; }
.cc-typ.t-訪問 { background: #226739; }
.cc-typ.t-見積・受注 { background: #c14482; }
.cc-typ.t-変更 { background: var(--g100); color: var(--muted); font-weight: 400; }

/* 2026-11 配置の作り直し：上に会社の帯、下は3列（これまで／いまの状況／今回の電話）。列ごとにスクロールする */
.cc { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.cc .sp { flex: 1; }
.cc-head { background: #fff; border-bottom: 1px solid var(--line); padding: 6px var(--gut) 7px; }
.cc-title { gap: 14px; }
.cc-nav { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cc-nav > div { display: flex; gap: 3px; }
.cc-nav .cx-btn { padding-left: 8px; padding-right: 8px; }
.cc-name h1 { line-height: 1.25; }
.cc-state { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cc-state > div { display: flex; align-items: baseline; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 12px; white-space: nowrap; }
.cc-state span { font-size: 11px; color: var(--faint); }
.cc-state b { font-size: 14px; white-space: nowrap; }
.cc-state .late { border-color: var(--ng-line); background: var(--ng-bg); }
.cc-state .late b, .cc-state .late span { color: var(--ng); }
.cc-state .mine { border-color: var(--brand-line); background: var(--brand-50); }
.cc-state .lockd { border-color: var(--violet-line); background: var(--violet-bg); }
.cc-state .open { border-color: var(--ok-line); background: var(--ok-bg); }
.cc-brief { display: grid; grid-template-columns: minmax(250px, 2fr) auto minmax(0, 1.3fr) fit-content(200px) auto fit-content(320px) auto; gap: 6px; margin-top: 5px; align-items: center; }
.cc-brief > div { display: flex; align-items: baseline; gap: 6px; background: var(--g25); border: 1px solid var(--g100); border-radius: var(--r-sm); padding: 3px 9px; min-width: 0; }
.cc-brief > .cx-btn { align-self: center; }
/* 担当者ごとの見込み追客・再コール・追客の件数（一覧） */
.cl-people:empty { display: none; }
.cl-people { padding: 8px var(--gut) 0; }
.cl-ppl { width: auto; min-width: 420px; font-size: 13px; }
.cl-ppl th.r, .cl-ppl td.r { text-align: right; }
.cl-ppl td small { color: var(--faint); margin-left: 4px; }
.cl-ppl tr.on td { background: var(--brand-50); }
.cl-pn { border: 0; background: none; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; padding: 2px 8px; border-radius: var(--r-xs); }
.cl-pn:hover { background: var(--g100); }
.cl-pn.on { background: var(--brand-50); color: var(--brand); }
.cc-pplcell { display: flex; align-items: baseline; gap: 6px; text-align: left; background: var(--g25); border: 1px solid var(--g100); border-radius: var(--r-sm); padding: 3px 9px; min-width: 0; cursor: pointer; font: inherit; color: inherit; }
.cc-pplcell:hover, .cc-pplcell.on { border-color: var(--brand); background: var(--brand-50); }
.cc-pplcell .v i { font-style: normal; font-size: 11px; color: var(--warn); margin-left: 2px; }
.cc-pplbox { margin-top: 8px; max-width: 560px; margin-left: auto; }
.cc-pplbox .cc-card { margin-bottom: 0; box-shadow: var(--shadow-pop); }
.cc-brief .k { flex: none; font-size: 11px; color: var(--faint); white-space: nowrap; }
.cc-brief .v { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cc-brief .v small { font-weight: 400; color: var(--faint); font-size: 13px; }
.cc-coform { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-md); }
.cc-fl.w2 { grid-column: span 2; }
.cc-fgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cc-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 25%) minmax(0, 1fr) minmax(340px, 24%); }
.cc-pane { min-height: 0; overflow-y: auto; padding: 12px 14px; }
.cc-pane + .cc-pane { border-left: 1px solid var(--line); }
.cc-colh { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 2px 8px; display: flex; align-items: center; gap: 8px; }
.cc-colh i { font-style: normal; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.cc-pane .cc-card { margin-bottom: 10px; }
.cc-two2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; align-items: start; }
.cc-two2 .cc-memo { min-height: 108px; }

/* これまで：備考と対応履歴 */
.cc-notes { background: var(--note-bg); border-color: var(--note-line); }
.cc-notes textarea { width: 100%; resize: vertical; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r-md); font-size: 13px; line-height: 1.6; background: #fff; }
/* 対応履歴：1件ごとに線で区切る（2026-11-20。見本 v5 の形。左の線と丸はやめた） */
.cc-tl .it { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cc-tl .it:first-child { padding-top: 2px; }
.cc-tl .it:last-child { border-bottom: 0; }
.cc-tl .sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cc-tl .tx.cm { color: var(--muted); font-size: 12px; }
.cc-tl .hd { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cc-tl .hd b { color: var(--ink); font-size: 13px; }
.cc-tl .sub { margin: 2px 0; }
.cc-tl .tx { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cc-tl .it.t-変更 .tx { color: var(--muted); font-size: 12px; }

/* いまの状況：物件は1件1行 */
.cc-eqt { width: 100%; border-collapse: collapse; font-size: 13px; }
.cc-eqt th { text-align: left; font-size: 11px; color: var(--faint); font-weight: 400; padding: 0 8px 4px; white-space: nowrap; }
.cc-eqt td { padding: 6px 8px; border-top: 1px solid var(--g100); vertical-align: top; }
.cc-eqt td.num, .cc-eqt td:first-child { white-space: nowrap; }
.cc-eqt td.r { text-align: right; }
.cc-eqt tr.row { cursor: pointer; }
.cc-eqt tr.row:hover td { background: var(--g25); }
.cc-eqt tr.open td, .cc-eqt tr.detail td { background: var(--brand-25); }
.cc-eqt tr.detail td { border-top: 0; padding-top: 2px; padding-bottom: 10px; }
.cc-eqt .cc-eq { margin: 0; background: #fff; }
.cc-none { color: var(--faint); }
.cc-due { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: var(--r-xs); background: var(--g100); white-space: nowrap; }
.cc-due.soon, .cc-due.past { background: var(--ng-bg); color: var(--ng); font-weight: 600; }
.cc-due.near { background: var(--warn-bg); color: var(--warn); }
.cc-age { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: var(--r-xs); background: var(--g100); }
.cc-age.old { background: var(--warn-bg); color: var(--warn); }
.cc-eqmemo2 { display: inline-block; margin-top: 3px; font-size: 13px; color: var(--note-ink); background: var(--note-bg); border-radius: var(--r-xs); padding: 1px 6px; white-space: pre-wrap; }
.cc-miss { font-size: 12px; color: var(--faint); margin-top: 6px; }
/* 売上から：入れ替え前の物件・当社との取引 */
.cc-eqt tr.was td { color: var(--faint); }
.cc-eqt tr.was td b { font-weight: 500; text-decoration: line-through; text-decoration-color: var(--line-2); }
.cc-eqt tr.was .cc-kind { background: var(--g100); color: var(--ink-2); }
.cc-sale { padding: 8px 2px; border-top: 1px solid var(--g100); font-size: 13px; }
.cc-sale:first-of-type { border-top: 0; }
.cc-sale .l1 { display: flex; align-items: center; gap: 8px; }
.cc-sale .l2 { margin-top: 2px; }
.cc-sale .l3 { margin-top: 2px; }
.cc-eqnew { margin-bottom: 8px; }

/* 今回の電話：いつも見えている */
.cc-pane.call { display: flex; flex-direction: column; background: var(--g25); }
.cc-call { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0 !important; border-color: var(--brand-line); }
.cc-call .cc-fl { margin-bottom: 5px; }
.cc-grow { flex: 1; min-height: 56px; display: flex; flex-direction: column; margin-bottom: 6px; }
.cc-grow textarea { flex: 1; resize: none; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: var(--r-md); font-size: 13px; line-height: 1.6; }
.cc-grow textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.cc-call .cc-statusbox { margin: 0 0 6px; padding: 6px 9px; gap: 4px; background: #fff; }
.cc-call .cc-chips button { padding-left: 8px; padding-right: 8px; }
.cc-call .cc-statusbox.stopped { background: var(--ng-bg); }
.cc-lb { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; }
.cc-lb i { font-style: normal; font-weight: 400; color: var(--faint); }
.cc-row0.nw { flex-wrap: nowrap; }
.cc-call #cc-date { flex: 1; min-width: 0; width: auto; }
.cc-call #cc-time { flex: .8; min-width: 0; width: auto; }
/* 話した相手：押して選ぶ（事務・担当者・代表者） */
.cc-whobox { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.cc-whobox .cc-lb { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cc-call .cc-who { flex: 1; }
.cc-call .cc-who button { flex: 1; padding: 6px 8px; font-size: 13px; font-weight: 600; }
.cx .cc-call .cc-who button.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.cl-inline.nm { margin-top: 0; white-space: nowrap; }
.cc-ng { color: var(--ng); }
.cc-recs { display: grid; grid-template-columns: 1fr 1.25fr; gap: 6px; }
.cc-recs.one { grid-template-columns: 1fr; }
.cc-recs .cx-btn { justify-content: center; height: 36px; font-size: 13px; }
.cc-help { margin-top: 6px; }

/* 幅がせまいとき：左に「これまで」と「いまの状況」を縦に、右に「今回の電話」 */
@media (max-width: 1280px) {
  .cc-cols { grid-template-columns: minmax(0, 1fr) minmax(320px, 34%); grid-template-rows: minmax(0, 40%) minmax(0, 1fr); }
  .cc-pane.past { grid-column: 1; grid-row: 1; border-bottom: 1px solid var(--line); }
  .cc-pane.now { grid-column: 1; grid-row: 2; border-left: 0; }
  .cc-pane.call { grid-column: 2; grid-row: 1 / 3; border-left: 1px solid var(--line); }
  .cc-brief { grid-template-columns: minmax(0, 1.6fr) auto minmax(0, 1fr) fit-content(160px) auto minmax(0, 1fr) auto; gap: 6px; }
  .cc-title { gap: 10px; }
  .cc-name { flex: 1 1 170px; min-width: 0; }
  .cc-name h1 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cc-name .tags { flex-wrap: nowrap; overflow: hidden; }
  .cc-name .tags .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cc-tel { font-size: 20px; }
  .cc-dial { padding-left: 14px; padding-right: 14px; }
  .cc-state { gap: 6px; }
  .cc-state > div { min-width: 0; padding: 3px 9px; }
  .cc-state b { font-size: 14px; }
}
/* スマホ・タブレット：縦に並べ、ページごとスクロールする（今回の電話をいちばん上に） */
@media (max-width: 900px) {
  .cc { height: auto; }
  .cc-head { padding: 8px 0; background: transparent; }
  .cc-state { flex-wrap: wrap; width: 100%; }
  .cc-brief { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-cols { display: flex; flex-direction: column; }
  .cc-pane { overflow: visible; padding: 10px 0; }
  .cc-pane + .cc-pane { border-left: 0; }
  .cc-pane.call { order: -1; background: transparent; }
  .cc-call { min-height: 420px; }
  .cc-two2 { grid-template-columns: minmax(0, 1fr); }
  .cc-eqt th:nth-child(3), .cc-eqt td:nth-child(3), .cc-eqt th:nth-child(5), .cc-eqt td:nth-child(5) { display: none; }
}

/* CRM基本設定：足した物件の種類 */
.cl-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cl-kind { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: 13px; background: #fff; }

/* 顧客カード：これまでの機器（入れ替え前）と入れ替えの周期 */
.cc-past { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.cc-past .cc-pastt { flex-basis: 100%; }
.cc-pastt td { color: var(--ink-2); }
.cc-pastt .cc-kind { background: var(--g100); color: var(--ink-2); }
.cc-pastt td.nw { white-space: nowrap; }

/* 物件を直す枠の外を押したとき、変えていたら保存するか聞く */
.cc-ask { position: fixed; inset: 0; background: var(--veil); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 8500; }
.cc-askbox { background: #fff; border-radius: var(--r-md); padding: 18px 20px; width: 100%; max-width: 420px; box-shadow: var(--shadow-dlg); font-size: 14px; }
.cc-askbox .cc-btns { margin-top: 14px; flex-wrap: wrap; }

/* 物件を直す枠：表を横に押し広げず、見える幅に収める。入力欄は幅に合わせて折り返す */
.cc-eqt .cc-eq[data-eq-form] { width: 0; min-width: 100%; box-sizing: border-box; }
/* 項目は「機器・導入・契約・保守・メモ」のまとまりごとに、4列（せまいときは2列）でそろえる。列の数を幅まかせにしない */
.cc-eq[data-eq-form] .cc-fgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.cc-eq[data-eq-form] .cc-fsub { margin: 10px 0 6px; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.cc-eq[data-eq-form] .cc-fgrid > .cc-fsub:first-child { margin-top: 2px; padding-top: 0; border-top: 0; }
.cc-eq[data-eq-form] .cc-fsub > span { margin-left: 10px; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.cc-eq[data-eq-form] .cc-fl { margin-bottom: 8px; }
.cc-eq[data-eq-form] .cc-fl > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-eq[data-eq-form] .cc-fl input, .cc-eq[data-eq-form] .cc-fl select { height: 32px; box-sizing: border-box; }
.cc-eq[data-eq-form] .cc-fl > .cx-btn { height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-eq[data-eq-form] .cc-btns { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 1500px) {
  .cc-eq[data-eq-form] .cc-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 幅がせまい画面では、直しているあいだ「いまの状況」を縦いっぱいに広げる（閉じると元に戻る） */
.cc-eq[data-eq-form] > .muted.small { white-space: normal; overflow-wrap: anywhere; }

/* 最近開いた顧客：一覧から外すボタン */
.cx-recent-sp { flex: 1; }
.cx-recent-x { border: 0; background: none; color: var(--faint); font-size: 16px; line-height: 1; width: 26px; height: 22px; border-radius: var(--r-sm); cursor: pointer; flex: none; margin: -2px -6px -2px 0; }
.cx-recent-x:hover, .cx-recent-x:focus-visible { background: var(--g100); color: var(--ng); }
.cx-recent-note { padding: 8px 16px; border-top: 1px solid var(--g100); }

/* kintone 同期：顧客が見つからない売上と、結び付ける候補 */
.cx-unm td { vertical-align: top; }
.cx-unm td.name span { display: block; }
.cx-unm-c { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.cx-unm-c .cx-btn { flex: none; }
.cx-unm-c .cx-input { width: 150px; }

/* 行で並べる絞り込み（顧客一覧。見本 docs/crm/filter-demo.html） */
.cl-side h3 small { display: block; font-weight: 400; font-size: 11px; margin-top: 1px; }
.cf { width: 100%; margin-top: 4px; }
.cf-row { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 200px) minmax(0, 1fr); gap: 6px 8px; align-items: center; padding: 7px 8px; margin-bottom: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.cf-row .cx-select { width: 100%; }
.cf-row .cf-x { grid-column: 3; grid-row: 1; justify-self: end; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--line-2); color: #fff; font-weight: 600; line-height: 1; cursor: pointer; }
.cf-row .cf-x:hover { background: var(--ng); }
.cf-val { grid-column: 1 / 4; grid-row: 2; }
.cf-val:empty { display: none; }
.cf-wide { width: 100%; max-width: 460px; }
.cl-row .grow .cf-val { margin-top: 6px; }   /* 機器（同じ1台で絞る）のメーカー・今の業者 */
.cf-inl { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.cf-opts { display: flex; flex-wrap: wrap; gap: 5px; max-height: 132px; overflow: auto; }
.cf-opts label { border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 2px 10px; font-size: 13px; cursor: pointer; background: #fff; user-select: none; }
.cf-opts label.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.cf-opts input { display: none; }
.cf-row.old .cf-old { grid-column: 1 / 3; justify-self: start; text-align: left; border: 1px solid var(--brand-100); background: var(--brand-50); color: var(--brand); border-radius: var(--r-pill); padding: 3px 11px; font-size: 13px; cursor: pointer; }
/* 項目を打ち込んで探す欄と、その下に出る候補 */
.cf-pick { position: relative; }
.cf-pick .cx-input { width: 100%; }
.cf-menu { position: absolute; z-index: 40; top: calc(100% + 2px); left: 0; min-width: 100%; width: max-content; max-width: min(380px, 90vw); max-height: 300px; overflow: auto; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 4px 0; }
.cf-menu[hidden] { display: none; }
.cf-mg { font-size: 11px; font-weight: 600; color: var(--faint); padding: 7px 10px 2px; }
.cf-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 5px 16px; font-size: 13px; cursor: pointer; }
.cf-menu button:hover, .cf-menu button:focus { background: var(--brand-50); outline: none; }
.cf-find { display: block; width: 240px; max-width: 100%; margin-bottom: 6px; }
.cf-opts label[hidden] { display: none; }
.cf-hit { margin-top: 4px; }
.cf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.cf-foot label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.cf-foot input { accent-color: var(--brand); }

/* ── 顧客カード：電話をかける並び（左の細い列）と、結果から記録する「今回の電話」（2026-11-19。見本は docs/crm/preview-call-in-card.html） ── */
.cc-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.cc.has-q { flex-direction: row; position: relative; }
.cc-q { flex: none; width: 216px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cc-q-full { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cc-q-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.cc-q-head .t { display: flex; align-items: center; gap: 6px; }
.cc-q-head .t b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-q-head .cx-progress b { color: var(--ink); font-weight: 600; }
.cc-q-list { flex: 1; min-height: 0; overflow-y: auto; }
.cx .cc-q-i { display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--g100); background: #fff; padding: 7px 10px 7px 9px; position: relative; }
.cx .cc-q-i:hover { background: var(--g25); }
.cx .cc-q-i.on { background: var(--brand-50); }
.cc-q-i.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.cc-q-i .mk { flex: none; width: 22px; text-align: center; font-size: 11px; color: var(--faint); font-family: 'Noto Sans JP', sans-serif; line-height: 20px; }
.cc-q-i .tx { min-width: 0; flex: 1; }
.cc-q-i .tx b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-q-i .tx i { display: block; font-style: normal; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-q-i .tx i.late { color: var(--ng); }
.cc-q-i.done .mk { color: var(--ok); font-size: 13px; font-weight: 600; }
.cc-q-i.done .tx b { color: var(--muted); font-weight: 400; }
.cc-q-i.skip .mk { color: var(--amber); font-weight: 600; }
.cc-q-more { padding: 8px 12px; font-size: 11px; color: var(--muted); }
/* 並びの見出し・かける理由・結果・絞る／探す／並べ替え（2026-11-20） */
.cc-q-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 4px 12px; background: var(--g50); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); }
.cc-q-h b { font-weight: 600; color: var(--ink); }
.cc-q-i .tx i em { font-style: normal; display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: var(--r-xs); background: var(--brand-50); color: var(--brand); font-size: 10.5px; }
.cc-q-i .tx i.ok { color: var(--ok); }
.cc-q-i .tx i.ls { color: var(--faint); }
.cc-q-i .tx i.ls.late { color: var(--warn); }
.cc-q-stat { font-size: 11px; color: var(--muted); }
.cc-q-stat b { color: var(--ink); font-weight: 600; }
.cc-q-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.cx .cc-q-seg button { border: 0; background: #fff; padding: 3px 0; font-size: 12px; color: var(--muted); }
.cx .cc-q-seg button + button { border-left: 1px solid var(--line-2); }
.cx .cc-q-seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
.cc-q-head .cc-q-kw, .cc-q-head .cc-q-sort { width: 100%; height: 26px; font-size: 12px; }
.cc-q-foot { padding: 6px 12px; border-top: 1px solid var(--line); text-align: right; }
/* 畳んだとき・幅がせまいとき：左の列は出さず、上の帯（検索欄の右）に「‹ 前・いまの位置・次 ›」を出す。まん中を押すと、並びが下に開く */
.cx-resume-box .cc-q-mini { display: none; align-items: center; gap: 6px; }
.cx-resume-box.fold .cc-q-mini { display: flex; }
/* 畳んだとき：左に細い帯「▶ 並びを開く」を残す（押すと開く。前は畳むと開き方が分からなかった。2026-11-25） */
.cc-q-open { display: none; }
.cc.q-fold .cc-q { width: 36px; }
.cc.q-fold .cc-q-full { display: none; }
.cx .cc.q-fold .cc-q-open { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 14px 0; border: 0; background: var(--brand-50); color: var(--brand); font-size: 13px; font-weight: 600; cursor: pointer; }
.cx .cc.q-fold .cc-q-open:hover { background: var(--brand); color: #fff; }
.cc-q-open .vt { writing-mode: vertical-rl; letter-spacing: .15em; }
.cc-q-open .num { writing-mode: vertical-rl; font-size: 11px; font-weight: 400; }
.cc.q-fold #cc-q-fold { display: none; }
.cc.q-fold.q-pop .cc-q-full { display: flex; position: absolute; right: var(--gut); top: 4px; width: 280px; max-height: min(70vh, 560px); z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); }
.cx .cc-q-pos { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; font-size: 12px; min-width: 0; }
.cx .cc-q-pos:hover { background: var(--g50); }
.cc-q-pos b { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-q-pos i { font-style: normal; color: var(--muted); }
.cc-q-pos span:last-child { color: var(--faint); }
@media (max-width: 1699px) {   /* 全体のメニュー（左 200）と並び（216）を引くと、見出しの行と3列が入らなくなる幅。いつも上の帯にする */
  .cx-resume-box .cc-q-mini { display: flex; }
  .cc.has-q .cc-q { width: 0; border-right: 0; }
  .cc.has-q:not(.q-pop) .cc-q-full { display: none; }
  .cc.has-q.q-pop .cc-q-full { display: flex; position: absolute; right: var(--gut); top: 4px; width: 280px; max-height: min(70vh, 560px); z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); }
  #cc-q-fold { display: none; }
  .cx .cc.has-q .cc-q-open { display: none; }
}
/* 並びが全部終わったとき */
.cc-qend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px var(--gut); background: var(--ok-bg); border-bottom: 1px solid var(--ok-line); color: var(--ok); }
/* 結果（数字キー 1〜6）。押すと、コール状況と次に電話する日が自動で入る */
.cc-res { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 4px 0 6px; }
.cx .cc-res button { display: flex; align-items: center; gap: 5px; text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-sm); padding: 5px 6px; font-size: 12px; line-height: 1.3; min-width: 0; white-space: nowrap; overflow: hidden; }
.cx .cc-res button:hover { border-color: var(--g400); }
.cx .cc-res button.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand); font-weight: 600; box-shadow: 0 0 0 1px var(--brand) inset; }
.cx .cc-res button.ng.on { border-color: var(--ng); background: var(--ng-bg); color: var(--ng); box-shadow: 0 0 0 1px var(--ng) inset; }
.cc-res .cx-kbd { flex: none; border: 0; padding: 0; background: none; min-width: 8px; color: var(--faint); }
/* せまい列に収めるための詰め方：コール状況は 4列×2行、次回の候補は 5列×1行 */
.cc-pane.call { padding-left: 10px; padding-right: 10px; }
.cc-call.cc-card { padding: 10px 12px; }
.cc-call .cc-statusbox { padding: 6px 8px; }
.cc-call .cc-st { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.cc-call .cc-nd { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cx .cc-call .cc-st button, .cx .cc-call .cc-nd button { padding: 3px 0; text-align: center; white-space: nowrap; overflow: hidden; }
.cx .cc-st button.ng { color: var(--ng); border-color: var(--ng-line); }
.cx .cc-st button.ng.on { background: var(--ng); color: #fff; border-color: var(--ng); }
.cc-need { font-size: 12px; font-weight: 600; color: var(--ng); background: var(--ng-bg); border: 1px solid var(--ng-line); border-radius: var(--r-sm); padding: 4px 9px; margin-bottom: 6px; }
.cc-recs .cx-btn.primary .cx-kbd { background: transparent; color: #e8eee0; border-color: rgba(255, 255, 255, .4); }
.cc-recs:not(.one) { grid-template-columns: auto 1fr; }
.cx .cc-stay { display: block; margin: 2px 0 0 auto; font-size: 12px; }
/* 記録のボタンは、欄が長くて送るときも、いつも下に見えている */
.cc-foot { position: sticky; bottom: -12px; z-index: 2; background: #fff; margin: 0 -12px; padding: 6px 12px 8px; border-top: 1px solid var(--g100); }
.cc-foot .cc-need { margin-bottom: 6px; }
@media (max-width: 900px) {
  .cc.has-q.q-pop .cc-q-full { right: 0; width: min(280px, 100%); }
  .cc-qend { padding-left: 12px; padding-right: 12px; border: 1px solid var(--ok-line); border-radius: var(--r-md); }
  .cx-resume-box { order: 3; margin: 0; }
  .ct-nums b { font-size: 18px; }
}

/* 顧客一覧の左：直すところ（次の日が決まっていない など） */
.cl-li.fix .nm b { color: var(--warn); }

/* ── 対応（かかってきた電話などの受付）：「対応中」のタブ・顧客カードの済んでいない対応・対応を記録する（js/crm.js の「対応」。2026-11-19） ── */
.cs-grid td.cs-body { max-width: 360px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cs-grid td.cs-act { white-space: nowrap; text-align: right; }
.cs-grid td.cs-act .cx-btn { margin-left: 6px; }
.cs-open { margin: 10px var(--gut) 0; display: flex; flex-direction: column; gap: 6px; }
.cs-open .it { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--r-md); padding: 10px 14px; }
.cs-open .b { flex: 1; min-width: 0; }
.cs-open .b b { font-weight: 600; }
.cs-open .tx { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0; }
.cs-co { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 12px; }
.cs-form { display: flex; flex-direction: column; gap: 12px; }
.cs-form .f > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cs-form input.cx-input { width: 100%; }
.cs-form textarea.cx-input { width: 100%; height: auto; padding: 6px 8px; resize: vertical; line-height: 1.55; }
.cs-to { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cx .cs-to button { border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-md); padding: 8px 10px; text-align: left; }
.cs-to button b { display: block; font-weight: 600; }
.cs-to button span { font-size: 11px; color: var(--muted); }
.cx .cs-to button:hover { background: var(--g50); }
.cx .cs-to button.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-ring); }
.cs-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.cs-form .cs-pick input.cx-input { width: auto; }
.cs-hint { margin-top: 4px; }
.cs-form input.cx-input.cs-date { width: auto; }
.cs-trow .cx-input { width: 220px; max-width: 100%; }
/* だれかに頼む（今回の電話・訪問などの下の1行。2026-11-20） */
.cc-todo-ask { margin: 6px 0; }
/* （.cc-askbox は前からある確認の画面の名前なので、ここでは使わない） */
.cc-todo-box { border: 1px solid var(--brand-ring); background: var(--brand-50); border-radius: var(--r-md); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cc-todo-box[hidden] { display: none; }
.cc-todo-box .cx-select, .cc-todo-box > .cx-input { width: 100%; }
.cc-foot .cc-todo-ask { margin: 0 0 6px; }
/* 機器の表：メモは行の下に幅いっぱいで出す。機種の欄は、せまくても縦書きにならない幅を取る（2026-11-20） */
.cc-eqt td:nth-child(2) { min-width: 9em; overflow-wrap: anywhere; }
.cc-eqt tr.memo td { border-top: 0; padding-top: 0; cursor: pointer; white-space: normal; }
.cc-eqt tr.memo .cc-eqmemo2 { display: block; margin-top: 0; overflow-wrap: anywhere; }
/* 幅がせまいときは、月額・設置・リース満了の欄を2段に折り返して、表が枠からはみ出さないようにする。それでも入らなければ横に送れる */
.cc-eqt td.num { white-space: normal; }
.cc-eqt .cc-due { white-space: normal; }
.cc-eqt th, .cc-eqt td { padding-left: 6px; padding-right: 6px; }
.cc-card:has(> .cc-eqt) { overflow-x: auto; }
/* 備考：見出しの行は折り返さない */
.cc-notes .cc-ch { flex-wrap: nowrap; }
.cc-notes .cc-ch .cx-btn, .cc-notes .cc-ch .cl-link { white-space: nowrap; flex: none; }
.cc-sales-more { display: block; margin-top: 8px; }
/* 登録法人データにない相手：同じ相手の候補（2026-11-20） */
.cs-same { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--r-md); padding: 10px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.cs-same b { font-weight: 600; }
.cx .cs-same-it { border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-md); padding: 6px 10px; text-align: left; display: flex; flex-direction: column; }
.cx .cs-same-it:hover { border-color: var(--brand); background: var(--brand-50); }
.cs-same-it span { color: var(--muted); }
.cs .cx-h .right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* 回した To Do のコメント（顧客カードの対応・対応履歴。読むだけ） */
.cs-cm { margin-top: 6px; border-left: 2px solid var(--line-2); padding-left: 10px; display: flex; flex-direction: column; gap: 4px; }
.cs-cm-it > div { white-space: pre-wrap; overflow-wrap: anywhere; }
.cs-cm-it.sys > div { color: var(--muted); }
@media (max-width: 700px) { .cs-to { grid-template-columns: 1fr; } .cs-open .it { flex-wrap: wrap; } }

/* 営業支援（つながり）に貸す「項目を選んで絞る」窓の置き場（js/crm.js の condKit）。色・線の決まりだけを受け継ぎ、場所は取らない */
.cx.cx-lent { display: block; position: fixed; left: 0; top: 0; width: 0; height: 0; background: transparent; }

/* 対応履歴：ピックアップした一行（内容は2行まで）。押すと開いて、内容の全部・コメント・To Do・直す、が出る */
.cc-tl .it { cursor: pointer; }
.cc-tl .it:hover { background: var(--g50, #f9fafb); }
.cc-tl .it:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cc-tl .it .tx.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.cc-who b { font-weight: 600; }
.cc-more { margin-left: auto; font-size: 11px; color: var(--muted); }
.cc-more::before { content: '詳しく見る ▸'; }
.cs-draft { margin-bottom: 10px; }
.cs-trow .cx-input[data-tk] { width: 320px; }

/* 顧客カードの「ついている機器」「物件一覧」のタブ（2026-11-24。見本は docs/crm/preview-sites-tab.html） */
.cc-tabs { display: flex; gap: 4px; margin: -4px 0 10px; border-bottom: 1px solid var(--g100); }
.cc-tab { border: 1px solid var(--g100); border-bottom: 0; background: var(--g50, #f4f5f7); color: var(--sub, #5d6880); padding: 6px 16px; border-radius: 8px 8px 0 0; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.cc-tab small { margin-left: 6px; font-weight: 400; color: var(--faint); }
.cc-tab.on { background: #fff; color: var(--ink, #1c2434); }
.cc-site { display: inline-block; margin-top: 2px; padding: 0 8px; border-radius: 6px; background: var(--g100); color: var(--sub, #5d6880); font-size: 12px; }
.cc-kind.sm { font-size: 11px; padding: 0 8px; }
.cc-crumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px; background: var(--brand-50); border-radius: var(--r-md); }
.cc-crumb b { font-size: 14px; }
.cc-open { color: var(--brand, #2f6bff); font-weight: 700; white-space: nowrap; }
tr[data-site-open] { cursor: pointer; }
tr[data-site-open]:hover td { background: var(--g50, #f7f8fa); }
.cc-siteform { margin-bottom: 10px; }

/* 対応履歴のポップアップ */
.hist-pop .hp-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist-pop .hp-row:last-child { border-bottom: 0; }
.hist-pop .hp-tx { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.hist-pop .hp-cm { padding: 4px 0; white-space: pre-wrap; }
.hist-pop .hp-cm.sys { color: var(--muted); }
/* 記録画面の「＋ 足す」 */
.cx .cc-chips button.cs-addbtn { border-style: dashed; color: var(--brand); background: transparent; }
.cs-add { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cs-add .cx-input { width: 220px; max-width: 100%; }

/* 一時保存（書きかけ）：対応履歴の上に、色を付けて出す。だれが書きかけかが、すぐ分かるように */
.cc-drafts { margin-bottom: 12px; border: 1px solid #f0b429; border-radius: var(--r-sm, 8px); background: #fffaf0; padding: 8px 10px; }
.cc-drafts-h { font-size: 12px; font-weight: 700; color: #92400e; margin-bottom: 2px; }
.cc-drafts .cc-tl .it.draft { border-left: 4px solid #f0b429; padding-left: 10px; background: transparent; }
.cc-drafts .cc-tl .it.draft.mine { border-left-color: #d97706; }
.cc-typ.t-draft { background: #d97706; }
.cc-drafts .cc-tl .it.draft .cc-row0 { margin-top: 4px; }

/* 売上の物件名から物件を作る整理画面（2026-11-24。見本は docs/crm/preview-sites-import.html） */
.cc-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 10px; padding: 10px 12px; background: #fdf3dc; border: 1px solid #f0dca8; border-radius: var(--r-md); }
.cc-banner b { color: #7a5200; }
.cc-tidy-list { border: 1px solid var(--g100); border-radius: var(--r-md); margin: 8px 0; }
.cc-tidy-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 4px 8px; padding: 8px 10px; border-top: 1px solid var(--g100); align-items: start; }
.cc-tidy-row:first-child { border-top: 0; }
.cc-tidy-row.off { opacity: .55; }
.cc-tidy-row.merged { background: var(--g50, #f3f5f9); }
.cc-tidy-on { padding-top: 5px; }
.cc-tidy-main { min-width: 0; }
.cc-tidy-side { grid-column: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-tidy-side select { max-width: 100%; }
.cc-tidy-nm { width: 100%; border: 1px solid var(--g100); border-radius: 6px; padding: 4px 8px; font: inherit; }
.cc-tidy-flag { margin: 2px 0; display: inline-block; padding: 0 8px; border-radius: 6px; background: #fdf3dc; color: #7a5200; font-size: 12px; }
.cc-tidy-link { margin-top: 8px; }

/* 伝票の明細（数量・単価・金額。種類が分からない行も出す。2026-11-24） */
.cc-lines { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0 6px; }
.cc-lines th { text-align: left; font-weight: 400; color: var(--faint); padding: 2px 6px; white-space: nowrap; }
.cc-lines td { padding: 3px 6px; border-top: 1px solid var(--g100); vertical-align: top; }
.cc-lines td.num, .cc-lines th.num { text-align: right; white-space: nowrap; }
.cc-kind-unk { display: inline-block; padding: 0 8px; border-radius: 8px; background: var(--g100); color: var(--sub, #5d6880); font-size: 11px; white-space: nowrap; }

/* 物件・機器の表：件数が増えても伸びない。枠の中だけを自由にスクロールし、見出しは上に残す（2026-11-25） */
.cc-eqscroll { max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.cc-eqscroll .cc-eqt thead th { position: sticky; top: 0; z-index: 1; background: #fff; padding-top: 4px; box-shadow: 0 1px 0 var(--g100); }

/* 備考：「いまの状況」の列の下に固定。そのまま書ける（2026-11-25） */
.cc-notes-fix { position: sticky; bottom: -12px; z-index: 2; margin: 10px 0 -12px; padding-bottom: 10px; box-shadow: 0 -6px 12px -8px rgba(0,0,0,.18); }
.cc-notes-fix .cc-ch { margin-bottom: 6px; gap: 8px; }
.cc-notes-fix textarea { display: block; height: 6.4em; }
.cc-notes-st { white-space: nowrap; }
@media (max-width: 900px) { .cc-notes-fix { position: static; margin: 10px 0; box-shadow: none; } }
.cc-notes-fix .cc-ch h3 { white-space: nowrap; flex: none; }
.cc-notes-fix .cc-notes-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 物件・機器を押したときは、ポップアップで開く。外（暗い所）を押す・「閉じる」・Esc で元の画面に戻る（2026-11-25） */
.cc-modal { position: fixed; inset: 0; z-index: 8000; background: var(--veil); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cc-dialog { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-dlg); width: min(1000px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 14px 22px 22px; }
.cc-dialog .cc-crumb { position: sticky; top: -14px; z-index: 3; margin: -14px -22px 12px; padding: 12px 22px; background: var(--g25); border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cc-dialog .cc-dtitle { font-size: 17px; }
.cc-dialog .cc-eqscroll { max-height: none; overflow: visible; }
.cc-veil { position: fixed; inset: 0; z-index: 8100; background: var(--veil); }
.cx .cc-eq[data-eq-form], .cx .cc-eqt .cc-eq[data-eq-form], .cx .cc-eqdialog {
  position: fixed; z-index: 8200; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(960px, calc(100vw - 32px)); min-width: 0;
  max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; background: #fff; border: 0; border-radius: var(--r-md); box-shadow: var(--shadow-dlg); padding: 16px 22px 20px; margin: 0; }
.cx .cc-eqdialog { width: min(680px, calc(100vw - 32px)); }
.cx .cc-eq[data-eq-form] .cc-fgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .cx .cc-eq[data-eq-form] .cc-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
