/* Piko CRM 1.4 · 身份组, members, transfer and rescue: the 全选 matrix, group and expiry chips, the members bulk
   bar and tabs, the transfer steps, the rescue timeline, the expired page, and the right-click menu. Tokens only. */

/* ---- a tri-state 全选 box: a dash on Ink ------------------------------------------------------------ */
.crm-root .crm-check:indeterminate { border-color: var(--ink); background: linear-gradient(var(--on-ink), var(--on-ink)) center / 10px 2px no-repeat, var(--ink); }
.crm-root .crm-switch:indeterminate { background: color-mix(in srgb, var(--ink) 45%, var(--elevated)); }

/* ---- members: tabs, rows, chips, the bulk bar ----------------------------------------------------- */
.crm-root .crm-members-tabbar { display: flex; margin-top: 4px; }
.crm-root .crm-members-tabs { min-width: 240px; }
.crm-root[data-form="phone"] .crm-members-tabs { flex: 1; min-width: 0; }
.crm-root .crm-member-end { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; min-width: 0; }
.crm-root .crm-group-chip { background: var(--elevated); color: var(--ink); }
.crm-root .crm-group-chip[data-group="owner"], .crm-root .crm-group-chip[data-group="admin"] { background: var(--ink); color: var(--on-ink); }
.crm-root .crm-chip-soon { box-shadow: inset 0 0 0 var(--hair) var(--line); }
.crm-root .crm-chip-late { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.crm-root .crm-member-row[data-expired="true"] .crm-line-title { color: var(--secondary); }
.crm-root .crm-member-select { flex: none; display: grid; place-items: center; width: 32px; margin-right: 4px; }
.crm-root .crm-member-select[data-why]:not([data-why=""]) { opacity: .7; }
.crm-root[data-form="phone"] .crm-member-row { flex-wrap: wrap; row-gap: 6px; }
.crm-root[data-form="phone"] .crm-member-row .crm-line-text { flex: 1 1 0; }
.crm-root[data-form="phone"] .crm-member-row .crm-line-end { max-width: 100%; }
.crm-root .crm-members-bulk { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px;
  padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line), var(--shadow); animation: pk-rise var(--enter) both; }
.crm-root .crm-members-bulk[hidden] { display: none; }
.crm-root .crm-members-bulk-all { display: inline-flex; align-items: center; gap: 10px; min-height: var(--ctl-s); cursor: pointer; }
.crm-root .crm-members-bulk-count { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crm-root .crm-members-bulk-gap { flex: 1; }
.crm-root .crm-members-bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-root[data-form="phone"] .crm-members-bulk-actions { order: 3; width: 100%; }
.crm-root[data-form="phone"] .crm-members-bulk-actions .crm-btn { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.crm-root .crm-members-list[data-selecting="true"] .crm-member-row { padding-left: 8px; }

/* ---- the 身份组 tab -------------------------------------------------------------------------------- */
.crm-root .crm-group-row .crm-sub { white-space: normal; }
.crm-root .crm-group-row .crm-line-value { font-variant-numeric: tabular-nums; }

/* ---- the group editor ------------------------------------------------------------------------------- */
.crm-root:not([data-form="phone"]) .crm-group-sheet-panel { width: min(760px, calc(100% - 32px)); }
.crm-root .crm-group-editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.crm-root .crm-group-summary { margin: -6px 2px 0; font-size: var(--t-sub); font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.crm-root .crm-group-presets { display: flex; flex-direction: column; gap: 6px; }
.crm-root .crm-group-builtin-note { margin: -8px 2px 0; }
.crm-root .crm-group-editor .crm-group { margin: 0; }
.crm-root .crm-group-copy { align-self: flex-start; }
.crm-root .crm-caps-head { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.crm-root .crm-cap-line { cursor: pointer; }

/* the matrix on a desk: name · 查看 新建 编辑 删除 · 范围 */
.crm-root .crm-pm-card { overflow: hidden; }
.crm-root .crm-pm { --pm-name: minmax(150px, 1.3fr); --pm-cell: 64px; --pm-scope: 168px; display: flex; flex-direction: column; min-width: 0; }
.crm-root .crm-pm[data-form="desk"] .crm-pm-head, .crm-root .crm-pm[data-form="desk"] .crm-pm-row {
  display: grid; grid-template-columns: var(--pm-name) repeat(4, var(--pm-cell)) var(--pm-scope); align-items: center; column-gap: 4px; min-height: var(--row-h); padding: 0 12px 0 16px; }
.crm-root .crm-pm[data-form="desk"] .crm-pm-cols, .crm-root .crm-pm[data-form="desk"] .crm-pm-cells { display: contents; }
.crm-root .crm-pm-head { min-height: 48px; font-size: var(--t-sub); color: var(--secondary); box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.crm-root .crm-pm-row { position: relative; }
.crm-root .crm-pm-row + .crm-pm-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: var(--hair); background: var(--line); }
.crm-root .crm-pm-name { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.crm-root .crm-pm-name-text { font-size: var(--t-body); font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.crm-root .crm-pm-all span { font-weight: 600; color: var(--ink); }
.crm-root .crm-pm[data-form="desk"] .crm-pm-col { display: flex; flex-direction: column-reverse; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-weight: 500; }
.crm-root .crm-pm-scope-head { display: flex; justify-content: center; font-weight: 500; }
.crm-root .crm-pm-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; cursor: pointer; }
.crm-root .crm-pm-cell:has(input:disabled) { cursor: default; }
.crm-root .crm-pm-own { font-size: var(--t-cap); color: var(--secondary); line-height: 1.1; }
.crm-root .crm-pm-own[hidden] { display: none; }
.crm-root .crm-pm-scope { justify-self: end; width: 100%; }
.crm-root .crm-pm-scope[hidden] { visibility: hidden; display: flex; }
.crm-root .crm-pm-scope button { min-height: 32px; padding: 0 10px; font-size: var(--t-sub); }
.crm-root .crm-pm-row[data-view="false"] .crm-pm-name-text { color: var(--secondary); }
.crm-root .pk-segment button:disabled { opacity: .45; cursor: default; }

/* the matrix on a phone: one card per module, four switches and the scope */
.crm-root .crm-pm[data-form="phone"] .crm-pm-head { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px 14px; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-col { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 12px; background: var(--elevated); color: var(--ink); cursor: pointer; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-col span { min-width: 0; overflow-wrap: anywhere; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px 14px; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-name { min-height: 36px; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-cells { display: flex; flex-direction: column; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-cell { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding-left: 34px; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-cell-label { flex: 1; font-size: var(--t-body); color: var(--ink); }
.crm-root .crm-pm[data-form="phone"] .crm-pm-own { order: 2; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-cell input { order: 3; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-scope { margin-top: 4px; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-scope[hidden] { display: none; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-scope button { flex: 1; }

/* the group field in the invite sheet */
.crm-root .crm-group-field { min-height: 52px; padding-top: 6px; padding-bottom: 6px; text-align: left; }
.crm-root .crm-group-field-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.crm-root .crm-group-field-text .crm-trigger-text { color: var(--ink); font-weight: 500; }
.crm-root .crm-group-field-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-expiry { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.crm-root .crm-expiry .crm-segment button { min-width: 0; padding: 0 6px; }
.crm-root .crm-expiry-date[hidden] { display: none; }

/* ---- transfer -------------------------------------------------------------------------------------- */
.crm-root .crm-steps { display: flex; align-items: center; gap: 6px; }
.crm-root .crm-step-dot { width: 22px; height: 4px; border-radius: 2px; background: var(--elevated); }
.crm-root .crm-step-dot[data-state="done"], .crm-root .crm-step-dot[data-state="now"] { background: var(--ink); }
.crm-root .crm-steps .crm-sub { margin-left: 6px; }
.crm-root .crm-step-title { margin: 0; font-size: var(--t-body); font-weight: 600; }
.crm-root .crm-transfer-admins { overflow: hidden; }
.crm-root .crm-transfer-admin { width: 100%; text-align: left; transition: background-color var(--hover); }
.crm-root .crm-transfer-admin + .crm-transfer-admin::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: var(--hair); background: var(--line); }
.crm-root .crm-transfer-admin > .crm-icon { width: 22px; height: 22px; }
@media (hover: hover) { .crm-root .crm-transfer-admin:hover { background: var(--wash); } }
.crm-root .crm-radio-ring { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--tertiary); }
.crm-root .crm-transfer-to { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.crm-root .crm-transfer-to > span:not(.crm-badge) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.crm-root .crm-transfer-sent { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--elevated); font-size: var(--t-sub); overflow-wrap: anywhere; }
.crm-root .crm-transfer-sent .crm-icon { flex: none; width: 18px; height: 18px; }
.crm-root .crm-transfer-code-form { display: flex; flex-direction: column; gap: 12px; }
.crm-root .crm-code-input { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; min-height: 52px; }
.crm-root[data-form] .pk-sheet .pk-field.crm-code-input { font-size: 22px; height: 52px; }
.crm-root .crm-transfer-resend-row { display: flex; justify-content: flex-end; margin-top: -6px; }
.crm-root .crm-link-button { min-height: var(--ctl-s); padding: 0 4px; color: var(--ink); font-size: var(--t-sub); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: var(--hair); }
.crm-root .crm-link-button:disabled { color: var(--secondary); text-decoration: none; cursor: default; }
.crm-root .crm-transfer-summary .crm-text { margin: 0; }
.crm-root .crm-transfer-banner { margin-bottom: 4px; }
.crm-root .crm-transfer-mailoff { padding-top: 8px; }

/* ---- rescue ---------------------------------------------------------------------------------------- */
.crm-root .crm-timeline { display: flex; flex-direction: column; margin: 0; padding: 6px 0; list-style: none; }
.crm-root .crm-timeline-step { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; }
.crm-root .crm-timeline-step + .crm-timeline-step::before { content: ""; position: absolute; left: 29px; top: -10px; height: 20px; width: 1.5px; background: var(--line); }
.crm-root .crm-timeline-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--elevated); }
.crm-root .crm-timeline-step[data-state="now"] .crm-timeline-dot { background: var(--ink); color: var(--on-ink); }
.crm-root .crm-timeline-dot .crm-icon { width: 15px; height: 15px; }
.crm-root .crm-timeline-text { padding-top: 4px; font-size: var(--t-sub); line-height: 1.45; overflow-wrap: anywhere; }
.crm-root .crm-banner .crm-btn + .crm-btn { margin-left: 0; }

/* ---- the expired page ------------------------------------------------------------------------------ */
.crm-root .crm-expired { padding-top: 48px; padding-bottom: 20px; max-width: 440px; margin: 0 auto; }
.crm-root .crm-expired .crm-text { margin: 4px 0 0; }

/* ---- right-click menus (crm-context.js) ---------------------------------------------------------- */
.crm-root .crm-menu-item[aria-haspopup="menu"] > .crm-icon:last-child { width: 14px; height: 14px; margin-left: auto; color: var(--secondary); }
.crm-root .crm-menu-item[aria-expanded="true"] { background: var(--wash); }
.crm-root .crm-context-count { padding: 6px 12px 4px; font-size: var(--t-cap); font-weight: 600; color: var(--secondary); }

@media (prefers-reduced-motion: reduce) { .crm-root .crm-members-bulk { animation: none !important; } }
/* the ⋯ beside a product card or row: always there on touch, on hover / focus with a mouse */
.crm-root .crm-pcard-wrap, .crm-root .crm-prodrow-wrap { position: relative; display: flex; min-width: 0; }
.crm-root .crm-pcard-wrap > .crm-pcard, .crm-root .crm-prodrow-wrap > .crm-prodrow { flex: 1; min-width: 0; }
.crm-root .crm-pcard-wrap > .crm-card-more { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; min-width: 0; min-height: 0; border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: 0 0 0 var(--hair) var(--line), var(--shadow); transition: opacity var(--hover); }
.crm-root .crm-prodrow-wrap > .crm-card-more { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: none; }
@media (pointer: fine) {
  .crm-root .crm-pcard-wrap > .crm-card-more { opacity: 0; }
  .crm-root .crm-pcard-wrap:hover > .crm-card-more, .crm-root .crm-pcard-wrap:focus-within > .crm-card-more, .crm-root .crm-card-more[aria-expanded="true"] { opacity: 1; }
}
@media (pointer: coarse) {
  .crm-root .crm-prodrow-wrap > .crm-card-more { display: grid; }
  .crm-root .crm-prodrow-wrap > .crm-prodrow { padding-right: 48px; }
}
/* phone matrix: the words first, the switch at the end of the line */
.crm-root .crm-pm[data-form="phone"] .crm-pm-name, .crm-root .crm-pm[data-form="phone"] .crm-pm-col { justify-content: space-between; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-name > input, .crm-root .crm-pm[data-form="phone"] .crm-pm-col > input { order: 2; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-name-text, .crm-root .crm-pm[data-form="phone"] .crm-pm-all span { font-weight: 600; }
.crm-root .crm-pm[data-form="phone"] .crm-pm-col { padding: 0 6px 0 12px; }
@media (max-width: 359px) { .crm-root .crm-pm[data-form="phone"] .crm-pm-cols { grid-template-columns: 1fr; } }
/* desk: 仅自己的 under the delete box without moving it */
.crm-root .crm-pm[data-form="desk"] .crm-pm-own { position: absolute; top: calc(50% + 13px); left: 0; right: 0; text-align: center; }

/* ---- density (1.4): one toolbar row, one line of numbers, + at the end ------------------------------- */
.crm-root .crm-toolbar { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; min-width: 0; }
.crm-root .crm-toolbar > * { flex: none; }
.crm-root .crm-toolbar-gap { flex: 1 1 0; min-width: 0; }
.crm-root .crm-toolbar .crm-segment button { min-height: 34px; padding: 0 12px; font-size: var(--t-sub); }
.crm-root .crm-icon-switch button { display: grid; place-items: center; min-width: 36px; padding: 0 10px; }
.crm-root .crm-icon-switch .crm-icon { width: 17px; height: 17px; }
.crm-root:not([data-form="desk"]) .crm-icon-switch button { min-height: 40px; min-width: 44px; }
.crm-root:not([data-form="desk"]) .crm-icon-switch .crm-icon { width: 20px; height: 20px; }
.crm-root .crm-task-plus { background: var(--ink); color: var(--on-ink); border-radius: 50%; }
.crm-root .crm-task-plus .crm-icon { color: var(--on-ink); }
@media (hover: hover) { .crm-root .crm-task-plus:hover { background: var(--ink); opacity: .86; } }
.crm-root .crm-task-filter { position: relative; background: var(--elevated); border-radius: 12px; }
.crm-root .crm-count-badge { --badge: 16px; --badge-font: 10px; position: absolute; top: 2px; right: 2px; }
.crm-root .crm-count-badge[hidden] { display: none; }
.crm-root .crm-mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line); overflow: hidden; }
.crm-root .crm-mini-stat { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; min-height: 52px; padding: 7px 12px; }
.crm-root .crm-mini-stat + .crm-mini-stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: var(--hair); background: var(--line); }
.crm-root .crm-mini-stat-value { font-size: var(--t-headline); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-mini-stat-label { font-size: var(--t-cap); color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root[data-form="phone"] .crm-mini-stat { padding: 6px 8px; }
.crm-root .crm-mini-stat[data-tone="late"] .crm-mini-stat-value { color: var(--danger); }

/* the task sheet's 关联 search */
.crm-root .crm-link-field { position: relative; display: flex; flex-direction: column; gap: 6px; }
.crm-root .crm-link-chosen { display: flex; align-items: center; gap: 4px; min-height: var(--ctl); }
.crm-root .crm-link-chosen[hidden], .crm-root .crm-link-search[hidden] { display: none; }
.crm-root .crm-link-results { display: flex; flex-direction: column; padding: 4px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line), var(--shadow); max-height: 260px; overflow-y: auto; }
.crm-root .crm-link-results[hidden] { display: none; }
.crm-root .crm-link-option { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; text-align: left; }
.crm-root .crm-link-option .crm-icon { flex: none; width: 16px; height: 16px; color: var(--secondary); }
.crm-root .crm-link-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .crm-root .crm-link-option:hover { background: var(--wash); } }
.crm-root .crm-link-option:focus-visible { background: var(--wash); outline: none; }
.crm-root .crm-task-add { margin: -6px -8px -6px 0; }
/* a phone's header: actions with an icon show the icon only (round, 44 pt), so the page title keeps its room */
.crm-root[data-form="phone"] .crm-head .crm-head-actions .crm-btn:has(> .crm-icon) { width: 44px; min-width: 44px; padding: 0; border-radius: 50%; }
.crm-root[data-form="phone"] .crm-head .crm-head-actions .crm-btn:has(> .crm-icon) .crm-btn-label { display: none; }
/* member rows on a phone: one line of details, ellipsised */
.crm-root[data-form="phone"] .crm-member-row .crm-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* narrow toolbars: filters, 选择 and the sort share one row; the sort shows its icon only */
@container col (max-width: 640px) {
  .crm-root .crm-prod-chips { flex: 1 1 0; }
  .crm-root .crm-prod-sort { flex: none; }
  .crm-root .crm-prod-sort .crm-trigger-text, .crm-root .crm-pipe-sort .crm-trigger-text { display: none; }
  .crm-root .crm-prod-sort .crm-trigger, .crm-root .crm-pipe-sort .crm-trigger { padding: 0 6px; min-width: 32px; }
  .crm-root .crm-pipe-chips { flex: 1 1 0; }
  .crm-root .crm-pipe-sort { flex: none; }
}
@container col (max-width: 640px) {
  .crm-root .crm-prod-tools .crm-search, .crm-root .crm-pipe-tools .crm-search { min-width: 55%; }
}
.crm-root .crm-expired .crm-text, .crm-root .crm-notice .crm-text { text-wrap: balance; }
.crm-root .crm-prod-sort[hidden], .crm-root .crm-prod-select[hidden] { display: none; }
.crm-root .crm-members-tabbar { align-items: center; gap: 8px; } .crm-root .crm-members-select-slot { display: flex; }
/* narrow: the sort is one icon button (its menu says the current order) */
@container col (max-width: 640px) {
  .crm-root .crm-prod-sort, .crm-root .crm-pipe-sort:not(:empty) { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; }
  .crm-root .crm-prod-sort > .crm-icon, .crm-root .crm-pipe-sort > .crm-icon { width: 18px; height: 18px; color: var(--ink); }
  .crm-root .crm-prod-sort .crm-trigger, .crm-root .crm-pipe-sort .crm-trigger { position: absolute; inset: 0; width: auto; min-width: 0; min-height: 0; padding: 0; border-radius: 12px; background: transparent; }
  .crm-root .crm-prod-sort .crm-trigger .crm-icon, .crm-root .crm-pipe-sort .crm-trigger .crm-icon { display: none; }
}

/* ---- 组织 (1.4): picker, hub, list ------------------------------------------------------------------ */
.crm-root .crm-org-pick { display: flex; flex-direction: column; gap: 6px; }
.crm-root .crm-org-suggest { align-self: flex-start; }
.crm-root .crm-org-suggest[hidden] { display: none; }
.crm-root .crm-org-owner { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.crm-root .crm-org-family { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.crm-root .crm-org-family[hidden] { display: none; }
.crm-root .crm-org-chips { margin-top: -4px; }
.crm-root .crm-org-chip { text-decoration: none; color: var(--ink); }
@media (hover: hover) { .crm-root a.crm-org-chip:hover { background: var(--wash); } }
.crm-root .crm-org-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@container col (max-width: 560px) { .crm-root .crm-org-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .crm-root .crm-org-kpis .crm-mini-stat:nth-child(4)::before { display: none; } }
.crm-root button.crm-org-kpi { text-align: left; }
@media (hover: hover) { .crm-root button.crm-org-kpi:hover { background: var(--wash); } }
.crm-root .crm-org-section-title { display: inline-flex; align-items: center; gap: 8px; }
.crm-root .crm-org-actions { display: flex; align-items: center; gap: 4px; }
.crm-root .crm-org-line .crm-deal-amount { flex: none; font-variant-numeric: tabular-nums; }
.crm-root .crm-org-timeline { display: flex; flex-direction: column; padding: 4px 0; }
.crm-root .crm-org-event { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 16px; text-align: left; width: 100%; }
.crm-root .crm-org-event .crm-timeline-dot { width: 28px; height: 28px; }
.crm-root .crm-org-event-text { flex: 1; min-width: 0; font-size: var(--t-sub); overflow-wrap: anywhere; }
.crm-root .crm-org-event time { flex: none; }
@media (hover: hover) { .crm-root button.crm-org-event:hover { background: var(--wash); } }
.crm-root .crm-org-tools { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.crm-root .crm-org-tools .crm-prod-sort { display: flex; align-items: center; gap: 4px; color: var(--secondary); }
.crm-root .crm-org-tools .crm-trigger { background: none; box-shadow: none; padding-left: 4px; width: auto; }
.crm-root .crm-org-description { margin: 0; }

/* ---- 导入 (1.4): recognition, 自动整理, 导入设置 ------------------------------------------------------ */
.crm-root .crm-import-rec { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--on-ink) 18%, transparent); font-size: var(--t-cap); }
.crm-root .crm-import-guess { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--elevated); color: var(--secondary); font-size: var(--t-cap); font-weight: 500; white-space: nowrap; }
.crm-root .crm-import-guess[hidden] { display: none; }
.crm-root .crm-import-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.crm-root .crm-import-guess[data-level="mid"] .crm-import-dot { background: color-mix(in srgb, var(--ink) 50%, transparent); }
.crm-root .crm-import-guess[data-level="low"] .crm-import-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--secondary); }
.crm-root .crm-import-h4 { margin: 4px 0 6px; font-size: var(--t-sub); font-weight: 600; }
.crm-root .crm-import-tidy-list { display: flex; flex-direction: column; margin: 0; padding: 4px 0; list-style: none; }
.crm-root .crm-import-tidy-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 36px; padding: 4px 14px; font-size: var(--t-sub); }
.crm-root .crm-import-tidy-item > .crm-icon { flex: none; width: 15px; height: 15px; color: var(--secondary); }
.crm-root .crm-import-tidy-item > span { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.crm-root .crm-import-setting { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 36px; }
.crm-root .crm-import-setting .crm-trigger { width: auto; }
.crm-root .crm-import-batch { display: inline-flex; margin-top: 4px; }
.crm-root .crm-prod-chips[hidden] { display: none; }
.crm-root .crm-members-tabs button { white-space: nowrap; }
.crm-root[data-form="phone"] .crm-members-tabs { flex: 0 1 auto; min-width: 176px; }
.crm-root[data-form="phone"] .crm-member-row .crm-line-text { flex: 1 1 128px; } .crm-root[data-form="phone"] .crm-member-row .crm-line-end { margin-left: auto; }

/* ---- H5 deletion and verified export (crm-deletion.js) ------------------------------------------------- */
.crm-root .crm-deleting-banner { box-shadow: 0 0 0 var(--hair) color-mix(in srgb, var(--danger) 40%, var(--line)); }
.crm-root .crm-deleting-banner .crm-banner-icon { color: var(--danger); }
.crm-root .crm-deleting-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.crm-root .crm-deleting-tag { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: var(--t-foot); font-weight: 500;
  background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); white-space: nowrap; }
.crm-root .crm-delete-lead, .crm-root .crm-export-lead { margin: 0; }
.crm-root .crm-export-choices { overflow: hidden; }
.crm-root .crm-export-choice { width: 100%; text-align: left; transition: background-color var(--hover); }
.crm-root .crm-export-choice + .crm-export-choice::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: var(--hair); background: var(--line); }
.crm-root .crm-export-choice > .crm-icon { width: 22px; height: 22px; }
@media (hover: hover) { .crm-root .crm-export-choice:hover { background: var(--wash); } }
.crm-root .crm-verify-off { padding-top: 8px; }

/* ---- M4 error codes: the shared chip (.pk-errcode, core/ui/errornotice.js) inside the CRM's own lines ---------- */
/* The CRM's buttons lose their padding (.pk-root button) and its toast is light: give the shared chip its shape back. */
.crm-root button.pk-errcode { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 8px; background: var(--elevated); color: var(--ink);
  font: 500 var(--t-foot) var(--mono); letter-spacing: .02em; white-space: nowrap; vertical-align: middle; }
.crm-root:not([data-form="desk"]) button.pk-errcode { min-height: 32px; }
.crm-root .pk-toast.pk-toast-witherror { pointer-events: auto; }
.crm-root .pk-toast-witherror .pk-errcode { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 var(--hair) var(--line); }
@media (hover: hover) { .crm-root button.pk-errcode:hover { background: var(--wash); } }
.crm-root .crm-error .pk-errcode, .crm-root .crm-image-failed .pk-errcode { margin-left: 6px; }
.crm-root .crm-failure .pk-errcode { align-self: center; }
.crm-root .pk-error-line.crm-error-line { font-size: var(--t-foot); }
