/* Piko CRM. Colours, radii, type and motion come from the tokens in ./core/ui/piko.css
   (Documentation/DESIGN_SYSTEM.md); sizes follow Documentation/CRM_UI_STANDARD_2026-11-20.md.
   Every rule is scoped under .crm-root so nothing leaks into the shared classes (and so it beats
   `.pk-root button { padding: 0 }`). Feature pages keep their own rules in crm-<area>.css.

   Layout attributes on the root (set in crm-shell.js from the root's own size):
     data-form   phone | pad | desk     sizes and touch targets
     data-nav    inline | drawer        sidebar beside the page (≥ 1000, touch: landscape) or over it
     data-split  on | off               list and detail side by side (page ≥ 680) or one at a time
     data-panes  3 | 2 | 1              how many zones are on screen */
.crm-root { --pad: 28px; --measure: 640px; --work: 1024px; --row-h: 56px; --row-r: 12px; --ctl: 44px; --ctl-s: 32px; --gap-zone: 24px; --side-w: 224px;
  --rule: var(--hair) solid var(--line); --wash: color-mix(in srgb, var(--elevated) 55%, transparent); --list-edge: 12px; --list-pad: 12px; --toggle-x: 16px; --cal: 34px; }
.crm-root[data-form="pad"] { --side-w: 260px; --ctl-s: 44px; --cal: 44px; }
.crm-root[data-form="phone"] { --pad: 20px; --ctl-s: 44px; --toggle-x: 20px; --cal: min(44px, calc((100vw - 44px) / 7)); }
.crm-root[data-split="off"] { --list-edge: calc(var(--pad) - 12px); --list-pad: var(--pad); }
.crm-root { background: var(--canvas); }
.crm-root h1, .crm-root h2, .crm-root h3, .crm-root p, .crm-root ul, .crm-root figure { margin: 0; }
.crm-root ul { padding: 0; list-style: none; }
.crm-root .crm-icon { flex: none; }

/* ---- sidebar ----------------------------------------------------------------------------------- */
.crm-root .crm-side { width: var(--side-w); gap: 0; padding: 10px; overscroll-behavior: contain; overflow-y: auto; border-right: var(--rule); background: var(--canvas);
  transition: margin-left var(--nav), transform var(--drawer); }
.crm-root:not([data-form="desk"]) .crm-side { background: var(--surface); padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.crm-root[data-nav="drawer"] .crm-side { position: absolute; inset: 0 auto 0 0; width: var(--drawer-w, 304px); margin-left: 0; transform: translateX(-102%); border-right: 0; z-index: 4; }
.crm-root[data-nav="drawer"][data-drawer="open"] .crm-side { transform: none; box-shadow: var(--shadow-float); }
.crm-root .crm-scrim { display: none; }
.crm-root[data-nav="drawer"] .crm-scrim { display: block; position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none; touch-action: none; background: color-mix(in srgb, var(--canvas) 55%, transparent); transition: opacity var(--drawer); }
.crm-root[data-nav="drawer"][data-drawer="open"] .crm-scrim { opacity: 1; pointer-events: auto; }
.crm-root[data-still="true"] .crm-side, .crm-root[data-still="true"] .crm-scrim { transition: none; }
.crm-root .crm-side-head { margin-bottom: 10px; }
.crm-root .crm-brand { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px; border-radius: 12px; text-align: left;
  transition: background-color var(--hover), transform .28s var(--m-release); }
.crm-root .crm-brand:active { transform: scale(var(--press)); }
@media (hover: hover) { .crm-root .crm-brand:hover { background: var(--wash); } }
.crm-root .crm-brand-mark { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: var(--on-ink); }
.crm-root .crm-brand-mark .crm-icon { width: 18px; height: 18px; }
.crm-root .crm-brand-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.crm-root .crm-brand-name { font-size: var(--t-headline); font-weight: 600; }
.crm-root .crm-brand-role { font-size: var(--t-foot); color: var(--secondary); }
.crm-root .crm-brand > .crm-icon { width: 14px; height: 14px; color: var(--secondary); }
.crm-root:not([data-form="desk"]) .crm-brand { min-height: 56px; padding: 6px 10px; gap: 12px; }
.crm-root:not([data-form="desk"]) .crm-brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.crm-root:not([data-form="desk"]) .crm-brand-mark .crm-icon { width: 22px; height: 22px; }
.crm-root:not([data-form="desk"]) .crm-brand > .crm-icon { width: 18px; height: 18px; }
.crm-root .crm-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.crm-root .crm-nav { position: relative; display: flex; flex-direction: column; gap: 4px; }
.crm-root .crm-nav-plate { position: absolute; left: 0; right: 0; top: 0; border-radius: 12px; background: var(--elevated); pointer-events: none;
  transition: transform var(--layout), height var(--layout); }
.crm-root .crm-nav-plate[data-still="true"], .crm-root[data-still="true"] .crm-nav-plate { transition: none; }
.crm-root .crm-nav .crm-nav-row { position: relative; color: var(--ink); font-size: var(--t-body); min-height: 36px; padding: 0 10px; gap: 10px; border-radius: 12px; }
.crm-root .crm-nav .crm-nav-row.pk-selected, .crm-root .crm-nav .crm-nav-row.pk-selected:hover, .crm-root .crm-nav .crm-nav-row:active { background: none; }
.crm-root .crm-nav .crm-nav-row .crm-icon { width: 19px; height: 19px; margin: 0 1.5px; color: var(--ink); }
.crm-root .crm-nav .crm-nav-row.pk-selected { font-weight: 600; }
.crm-root .crm-nav .crm-nav-gap { margin-top: 10px; }
.crm-root:not([data-form="desk"]) .crm-nav .crm-nav-row { min-height: 46px; padding: 0 14px; gap: 12px; font-size: var(--t-sub); }
.crm-root:not([data-form="desk"]) .crm-nav .crm-nav-row .crm-icon { width: 22px; height: 22px; margin: 0; }
@media (hover: hover) { .crm-root .crm-nav .crm-nav-row:not(.pk-selected):hover { background: var(--wash); } }
.crm-root .crm-count { flex: none; }

/* ---- count badges: one shape for every number bubble (sidebar, bell, 待确认 tab, task filter, the bell's 值守整理 line).
   A circle (min-width = height) that grows into a pill, line-height 1, tabular lining figures. What is centred is the
   digits' ink: the line is trimmed to the cap height (text-box) and the box holds exactly 1cap between equal paddings.
   Plain flex centring centres the font's ascent + descent instead, which put PingFang / SF digits about 1 px low
   (2026-11-28, measured by scratchpad crm-fix/badges.py). text-box-trim does not reach a flex container's anonymous
   text, so the trimmed badge is a block container; a browser without text-box gets flex centring with a measured lift. */
.crm-root :is(.crm-count, .crm-capture-count, .crm-count-badge, .crm-kb-count) { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--badge, 18px); height: var(--badge, 18px); padding: 0 calc(var(--badge, 18px) * .28) 1px; border-radius: 999px; background: var(--ink); color: var(--on-ink);
  font-size: var(--badge-font, 11px); font-weight: 600; line-height: 1; letter-spacing: 0; white-space: nowrap; text-align: center; vertical-align: middle;
  font-variant-numeric: tabular-nums lining-nums; }
@supports (text-box: trim-both cap alphabetic) and (padding: 1cap) {
  .crm-root :is(.crm-count, .crm-capture-count, .crm-count-badge, .crm-kb-count) { display: inline-block; text-box: trim-both cap alphabetic;
    padding: calc((var(--badge, 18px) - 1cap) / 2) calc(var(--badge, 18px) * .28); }
}

/* ---- page frames --------------------------------------------------------------------------------- */
.crm-root .crm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }
.crm-root .crm-view { flex: 1; min-height: 0; display: flex; }
.crm-root .crm-pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; container-type: inline-size; }
.crm-root .crm-banners:not(:empty) { padding: max(10px, env(safe-area-inset-top)) var(--pad) 0; }
.crm-root .crm-banners:not(:empty) + .crm-view .crm-head { padding-top: 0; height: var(--head); }
.crm-root .crm-head { flex: none; position: relative; z-index: 1; height: calc(var(--head) + env(safe-area-inset-top)); display: grid; align-items: center;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, var(--frame, 640px)) minmax(max-content, 1fr);
  padding: env(safe-area-inset-top) max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left)); }
.crm-root .crm-head[data-width="work"] { --frame: var(--work); }
.crm-root .crm-head[data-width="full"] { grid-template-columns: max-content minmax(0, 1fr) max-content; }
/* No rule under the header: the canvas fades out over the first 16 pt of what scrolls beneath. */
.crm-root .crm-head::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none; background: linear-gradient(to bottom, var(--canvas), transparent); }
.crm-root .crm-head-start { display: flex; align-items: center; margin-left: calc(var(--toggle-x) - var(--pad)); }
.crm-root .crm-head-start > :last-child { margin-right: 12px; }
.crm-root .crm-head-end { display: flex; align-items: center; justify-content: flex-end; margin-right: calc(var(--toggle-x) - var(--pad)); }
.crm-root .crm-head-end > :first-child { margin-left: 12px; }
.crm-root .crm-head-mid { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crm-root .crm-head-titles { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.crm-root .crm-title { min-width: 0; font-size: var(--t-title2); font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-head-sub { font-size: var(--t-foot); color: var(--secondary); white-space: nowrap; }
.crm-root .crm-head-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.crm-root .crm-head .crm-btn { min-height: var(--ctl-s); }
.crm-root[data-form="desk"] .crm-head .crm-btn { padding: 0 14px; }
.crm-root[data-form="desk"] .crm-head .pk-iconbtn { width: 32px; height: 32px; border-radius: 8px; }
.crm-root[data-form="desk"] .crm-head .pk-iconbtn .crm-icon { width: 17px; height: 17px; }
.crm-root:not([data-form="desk"]) .crm-head .crm-menu, .crm-root:not([data-form="desk"]) .crm-head .crm-back { background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line); }
.crm-root:not([data-form="desk"]) .crm-head .pk-iconbtn .crm-icon { width: 22px; height: 22px; }
.crm-root .crm-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px max(var(--pad), env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left)); }
.crm-root .crm-col { width: 100%; max-width: var(--measure); margin-inline: auto; container: col / inline-size; }
.crm-root .crm-col[data-width="work"] { max-width: var(--work); }
.crm-root .crm-col[data-width="full"] { max-width: none; }
.crm-root .crm-body { display: flex; flex-direction: column; gap: var(--gap-zone); min-width: 0; }
.crm-root .crm-lead:not(:empty) { margin-bottom: var(--gap-zone); }
.crm-root .crm-slot:empty { display: none; }
@container (max-width: 599px) { .crm-root .crm-head:not([data-width="full"]), .crm-root .crm-scroll { --pad: 20px; } }
.crm-root .crm-page-in { animation: crm-page-in .3s var(--m-smooth) both; }
@keyframes crm-page-in { from { opacity: .92; transform: translateY(8px); } }

/* list ↔ detail */
.crm-root .crm-split { flex-direction: row; position: relative; }
.crm-root .crm-column { flex: none; width: clamp(300px, 30%, 340px); min-height: 0; display: flex; flex-direction: column; border-right: var(--rule); }
.crm-root .crm-column .crm-head { padding-left: max(var(--toggle-x), env(safe-area-inset-left)); padding-right: var(--list-pad); }
.crm-root .crm-column .crm-head-start { margin-left: 0; }
.crm-root .crm-list-tools { flex: none; padding: 2px var(--list-pad) 8px; position: relative; z-index: 1; }
.crm-root .crm-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px;
  padding: 4px var(--list-edge) calc(24px + env(safe-area-inset-bottom)); }
.crm-root .crm-detail { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; container-type: inline-size; background: var(--canvas); }
.crm-root[data-split="on"] .crm-detail .crm-back { display: none; }
.crm-root .crm-detail-blank .crm-body { min-height: 50vh; justify-content: center; }
.crm-root[data-split="off"] .crm-column { width: 100%; border-right: 0; transition: visibility 0s; }
/* One pane: the record pushes in from the right (32 pt, --enter) and fades away (--exit). */
.crm-root[data-split="off"] .crm-detail { position: absolute; inset: 0; z-index: 2; opacity: 0; visibility: hidden; transition: opacity var(--exit), visibility 0s .18s; }
.crm-root[data-split="off"] .crm-split[data-open="true"] .crm-detail { opacity: 1; visibility: visible; transition: opacity var(--enter), visibility 0s; animation: crm-push var(--enter) both; }
@keyframes crm-push { from { transform: translateX(32px); } }
.crm-root[data-split="off"] .crm-split[data-open="true"] .crm-column { visibility: hidden; transition: visibility 0s .32s; }
.crm-root[data-still="true"] .crm-detail, .crm-root[data-still="true"] .crm-column { transition: none !important; animation: none !important; }

/* ---- rows, badges, chips ------------------------------------------------------------------------------ */
.crm-root .crm-row { flex: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--row-h); padding: 8px 12px; border-radius: var(--row-r); text-align: left;
  transition: background-color var(--hover), transform .28s var(--m-release); }
.crm-root button.crm-row:active { transform: scale(var(--press)); transition: transform .1s var(--m-smooth); }
@media (hover: hover) { .crm-root button.crm-row:hover { background: var(--wash); } }
.crm-root .crm-row[aria-current="true"] { background: var(--elevated); box-shadow: inset 0 0 0 1px var(--line); }
.crm-root .crm-row[aria-current="true"] .crm-row-main { font-weight: 600; }
.crm-root .crm-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.crm-root .crm-row-main { font-size: var(--t-body); font-weight: 500; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-sub { font-size: var(--t-foot); color: var(--secondary); line-height: 1.3; min-width: 0; }
/* 20 + 4 + 16 on touch (13 + 4 + 13 on a desk): two lines fill the 56 row exactly. */
.crm-root .crm-row .crm-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: calc(var(--t-foot) + 3px); }
.crm-root .crm-row .crm-sub:empty { display: none; }
.crm-root .crm-badge { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 18%; background: var(--elevated); box-shadow: inset 0 0 0 var(--hair) var(--line);
  color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: .01em; overflow: hidden; }
.crm-root .crm-badge .crm-icon { width: 50%; height: 50%; }
.crm-root .crm-badge-round { border-radius: 50%; }
.crm-root .crm-badge[data-size="28"] { width: 28px; height: 28px; font-size: 11px; }
.crm-root .crm-badge[data-size="36"] { width: 36px; height: 36px; font-size: 13px; }
.crm-root .crm-badge[data-size="44"] { width: 44px; height: 44px; font-size: 16px; }
.crm-root .crm-badge[data-size="60"] { width: 60px; height: 60px; font-size: 22px; }
.crm-root .crm-row[aria-current="true"] .crm-badge, .crm-root .crm-card .crm-badge { background: var(--canvas); }
.crm-root .crm-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.crm-root .crm-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 5px 10px; border-radius: 999px; background: var(--elevated); font-size: var(--t-cap); font-weight: 500; line-height: 1.3; }
.crm-root .crm-chip .crm-icon { width: 12px; height: 12px; }
.crm-root .crm-chip-text { min-width: 0; overflow-wrap: anywhere; }
.crm-root .crm-paused { flex: none; color: var(--secondary); }
.crm-root .crm-more { align-self: center; margin: 10px auto 0; }
.crm-root .crm-list > .crm-empty { margin: auto 0; }

/* ---- buttons, links ------------------------------------------------------------------------------------- */
.crm-root .crm-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl); padding: 0 16px; border-radius: 12px;
  font-size: var(--t-body); font-weight: 500; line-height: 1.2; white-space: nowrap; background: var(--elevated); color: var(--ink);
  transition: transform .28s var(--m-release), opacity var(--hover), background-color var(--hover); }
.crm-root .crm-btn:not(:disabled):active { transform: scale(var(--press)); opacity: .7; transition: transform .1s var(--m-smooth), opacity .1s; }
.crm-root .crm-btn:disabled { opacity: .45; cursor: default; }
.crm-root .crm-btn .crm-icon { width: 16px; height: 16px; }
.crm-root .crm-btn-primary { background: var(--ink); color: var(--on-ink); border-radius: 999px; font-weight: 600; padding: 0 18px; }
.crm-root .crm-btn-quiet { background: none; padding: 0 10px; color: var(--secondary); }
.crm-root .crm-btn-danger { background: none; color: var(--danger); }
.crm-root .crm-btn-danger-soft { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.crm-root .crm-btn-small { min-height: var(--ctl-s); padding: 0 12px; }
.crm-root .crm-btn-primary.crm-btn-small { padding: 0 14px; }
.crm-root .crm-btn-square { width: var(--ctl); min-height: var(--ctl); padding: 0; border-radius: 50%; }
.crm-root .crm-btn-square .crm-icon { width: 20px; height: 20px; }
@media (hover: hover) { .crm-root .crm-btn-primary:not(:disabled):hover { opacity: .86; } .crm-root .crm-btn-quiet:not(:disabled):hover { color: var(--ink); background: var(--wash); }
  .crm-root .crm-btn-secondary:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 9%, var(--elevated)); } }
.crm-root .crm-iconbtn .crm-icon { width: 20px; height: 20px; }
.crm-root[data-form="desk"] .crm-iconbtn .crm-icon { width: 17px; height: 17px; }
.crm-root .pk-destructive, .crm-root .pk-primary.pk-destructive { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.crm-root .crm-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--tertiary); text-underline-offset: 3px; overflow-wrap: anywhere; min-width: 0; }
.crm-root:not([data-form="desk"]) .crm-link:not(.pk-link) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.crm-root .crm-tip { position: absolute; z-index: 40; pointer-events: none; padding: 4px 8px; border-radius: 8px; background: var(--float); color: var(--ink); font-size: 11px; white-space: nowrap;
  box-shadow: 0 0 0 var(--hair) var(--line), 0 2px 8px rgba(0, 0, 0, .12); animation: pk-fade .12s ease-out both; }

/* ---- form controls --------------------------------------------------------------------------------------- */
.crm-root .crm-field, .crm-root[data-form] .pk-sheet .pk-field.crm-field { width: 100%; height: auto; min-height: var(--ctl); padding: 0 14px; border-radius: 12px; font-size: var(--t-body); }
.crm-root .crm-area, .crm-root[data-form] .pk-sheet .pk-field.crm-area { display: block; padding: 12px 14px; line-height: 1.45; resize: none; overflow-y: auto; min-height: var(--ctl); }
.crm-root .crm-field[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--danger); }
.crm-root .crm-form-field { min-width: 0; }
.crm-root .crm-form-field .pk-form-label { font-size: var(--t-foot); font-weight: 500; color: var(--secondary); }
.crm-root .crm-hint { font-size: var(--t-foot); color: var(--secondary); padding: 0 4px; }
.crm-root .crm-error { font-size: var(--t-foot); color: var(--danger); padding: 0 4px; }
.crm-root .crm-text { color: var(--secondary); font-size: var(--t-body); overflow-wrap: anywhere; }
.crm-root .crm-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: var(--ctl); padding: 0 12px 0 14px; border-radius: 12px; background: var(--elevated);
  font-size: var(--t-body); text-align: left; transition: background-color var(--hover), transform .28s var(--m-release);
  box-shadow: inset 0 1px 1px color-mix(in srgb, var(--ink) 2.5%, transparent); }
.crm-root .crm-trigger:disabled { opacity: .45; cursor: default; }
.crm-root .crm-trigger-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-trigger[data-empty="true"] .crm-trigger-text { color: var(--secondary); }
.crm-root .crm-trigger .crm-icon { width: 16px; height: 16px; color: var(--secondary); }
.crm-root .crm-trigger-small { width: auto; flex: none; min-height: var(--ctl-s); padding: 0 8px 0 12px; gap: 4px; }
.crm-root .crm-trigger-small .crm-icon { width: 14px; height: 14px; }
.crm-root .crm-check { width: 22px; height: 22px; border-radius: 5px; }
.crm-root .crm-check:checked { background-size: 15px; }
.crm-root .crm-check:disabled { opacity: .45; cursor: default; }
.crm-root .crm-flag { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-s); font-size: var(--t-sub); cursor: pointer; }
.crm-root .crm-switch:disabled { opacity: .55; }
.crm-root .crm-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 4px; font-size: var(--t-body); cursor: pointer; }
.crm-root .crm-segment { background: var(--elevated); padding: 2px; border-radius: 10px; }
.crm-root .crm-segment button { min-height: 28px; padding: 0 16px; border-radius: 8px; font-size: var(--t-sub); font-weight: 500; }
.crm-root .crm-segment .pk-on { background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line), 0 1px 2px rgba(0, 0, 0, .08); }
.crm-root:not([data-form="desk"]) .crm-segment button { min-height: 32px; min-width: 64px; }
/* Five or more choices share the row instead: no least width, so the bar fits a 320 phone. */
.crm-root .crm-segment:has(> button:nth-child(5)) { max-width: 100%; }
.crm-root .crm-segment:has(> button:nth-child(5)) button { flex: 1 1 auto; min-width: 0; padding: 0 10px; white-space: nowrap; }
/* Filter chip: a capsule that is pressed (Ink) while its filter is on. `.crm-fchips` is a row of them where one is always chosen. */
.crm-root .crm-fchip { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; max-width: 220px; padding: 0 8px 0 12px; border-radius: 999px; background: var(--elevated);
  font-size: var(--t-sub); font-weight: 500; white-space: nowrap; transition: background-color var(--hover), color var(--hover), transform .28s var(--m-release); }
.crm-root:not([data-form="desk"]) .crm-fchip { min-height: 44px; padding: 0 10px 0 14px; }
.crm-root .crm-fchip:active { transform: scale(var(--press)); }
.crm-root .crm-fchip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-fchip .crm-icon { flex: none; width: 13px; height: 13px; color: var(--secondary); }
.crm-root .crm-fchip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.crm-root .crm-fchip[aria-pressed="true"] .crm-icon { color: var(--on-ink); }
.crm-root .crm-fchips .crm-fchip { padding: 0 12px; color: var(--secondary); }
.crm-root[data-form="desk"] .crm-fchips .crm-fchip { min-height: 30px; }
.crm-root:not([data-form="desk"]) .crm-fchips .crm-fchip { padding: 0 14px; }
.crm-root .crm-fchips .crm-fchip[aria-pressed="true"] { color: var(--on-ink); }
@media (hover: hover) { .crm-root .crm-fchip[aria-pressed="false"]:hover { color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .crm-root .crm-fchip { transition: none; } .crm-root .crm-fchip:active { transform: none; } }
.crm-root .crm-segment-wide { display: flex; }
.crm-root .crm-segment-wide button { flex: 1; }
.crm-root .crm-bar { display: flex; justify-content: center; }
.crm-root[data-form="phone"] .crm-bar .crm-segment { display: flex; flex: 1; }
.crm-root[data-form="phone"] .crm-bar .crm-segment button { flex: 1; }
.crm-root .crm-search { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px 0 12px; border-radius: 12px; background: var(--elevated); }
.crm-root .crm-search > .crm-icon { width: 18px; height: 18px; color: var(--secondary); }
.crm-root .crm-search-input { flex: 1; width: 0; min-width: 0; min-height: 36px; font-size: var(--t-body); }
.crm-root .crm-search-clear { width: 28px; height: 28px; color: var(--secondary); }
.crm-root .crm-search-clear .crm-icon { width: 14px; height: 14px; }
.crm-root:not([data-form="desk"]) .crm-search { min-height: 44px; padding: 0 0 0 14px; }
.crm-root:not([data-form="desk"]) .crm-search-input { min-height: 44px; }
.crm-root:not([data-form="desk"]) .crm-search-clear { width: 44px; height: 44px; }
.crm-root:not([data-form="desk"]) .crm-search-clear .crm-icon { width: 16px; height: 16px; }

/* ---- floating: menus, calendar, sheets, toast --------------------------------------------------------------- */
.crm-root .crm-menu-panel { min-width: 200px; max-width: min(340px, calc(100% - 16px)); max-height: min(480px, calc(100% - 16px)); overflow-y: auto; overscroll-behavior: contain; }
.crm-root .crm-menu-wide { min-width: 260px; }
.crm-root .crm-menu-item { min-height: 44px; }
.crm-root[data-form="desk"] .crm-menu-item { min-height: 32px; padding-block: 5px; }
.crm-root .crm-menu-item:disabled { opacity: .45; cursor: default; }
.crm-root .crm-menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.crm-root .crm-menu-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-menu-sub { font-size: var(--t-foot); color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-menu-gap { width: 0; }
.crm-root .crm-menu-rule { height: var(--hair); margin: 5px 10px; background: var(--line); }
.crm-root .crm-menu-heading { padding: 8px 12px 4px; font-size: var(--t-cap); color: var(--secondary); }
.crm-root .crm-menu-item > .crm-icon:last-child:not(:first-child) { width: 14px; height: 14px; }
.crm-root .crm-cal { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.crm-root .crm-cal-quicks { display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(var(--cal) * 7); }
.crm-root .crm-cal-quick { min-height: var(--ctl-s); padding: 0 12px; border-radius: 999px; background: var(--elevated); font-size: var(--t-sub); font-weight: 500; }
.crm-root .crm-cal-clear { background: none; color: var(--secondary); margin-left: auto; }
.crm-root .crm-cal-head { display: flex; align-items: center; justify-content: space-between; }
.crm-root .crm-cal-title { font-size: var(--t-headline); font-weight: 600; font-variant-numeric: tabular-nums; }
.crm-root .crm-cal-grid { display: grid; grid-template-columns: repeat(7, var(--cal)); justify-items: center; }
.crm-root .crm-cal-week { height: 24px; display: grid; place-items: center; font-size: var(--t-cap); color: var(--secondary); }
.crm-root .crm-cal-day { width: var(--cal); height: var(--cal); border-radius: 50%; font-size: var(--t-body); font-variant-numeric: tabular-nums; transition: background-color var(--hover); }
.crm-root .crm-cal-day[data-out="true"] { color: var(--tertiary); }
.crm-root .crm-cal-day[data-today="true"] { box-shadow: inset 0 0 0 1px var(--tertiary); }
.crm-root .crm-cal-day[aria-selected="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; font-weight: 600; }
@media (hover: hover) { .crm-root .crm-cal-day:not([aria-selected="true"]):hover, .crm-root .crm-cal-quick:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); } }
.crm-root .pk-sheet-body { padding: 12px 20px 20px; gap: 14px; }
.crm-root:not([data-form="phone"]) .crm-sheet-panel { width: min(460px, calc(100% - 32px)); }
.crm-root .crm-sheet-head { margin: 0 -8px; }
.crm-root .crm-sheet-head h2 { flex: 1; min-width: 0; text-align: center; font-size: var(--t-headline); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The confirm is the sheet's one primary action: an Ink disc (`.pk-root button { background: none }` would leave the white tick on nothing). */
.crm-root .crm-sheet-head .pk-confirm { background: var(--ink); color: var(--on-ink); transition: opacity var(--hover), transform .28s var(--m-release); }
.crm-root .crm-sheet-head .pk-confirm .crm-icon { color: var(--on-ink); }
.crm-root .crm-sheet-head .pk-confirm:disabled { opacity: .45; }
@media (hover: hover) { .crm-root .crm-sheet-head .pk-confirm:not(:disabled):hover { background: var(--ink); opacity: .86; } }
.crm-root .pk-sheet .pk-primary, .crm-root .pk-sheet .pk-secondary-button { font-size: var(--t-body); }
.crm-root .pk-toast { bottom: calc(12px + env(safe-area-inset-bottom)); max-width: min(480px, calc(100% - 32px)); width: max-content; padding: 12px 16px; border-radius: 16px; white-space: normal; text-align: center;
  background: var(--elevated); color: var(--ink); font-size: var(--t-sub); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 var(--hair) var(--line), 0 4px 14px rgba(0, 0, 0, .10); }

/* ---- sections, cards, lines --------------------------------------------------------------------------------- */
.crm-root .crm-section, .crm-root .crm-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.crm-root .crm-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; padding: 0 4px; }
.crm-root .crm-section-title { font-size: var(--t-headline); font-weight: 500; color: var(--ink); line-height: 1.3; }
.crm-root .crm-label { padding: 0 4px; }
.crm-root .crm-group-foot { padding: 0 4px; font-size: var(--t-foot); color: var(--secondary); }
.crm-root .crm-card { background: var(--surface); border-radius: 20px; box-shadow: 0 0 0 var(--hair) var(--line); min-width: 0; }
.crm-root .crm-card-pad { padding: 16px; }
.crm-root .crm-card > :first-child { border-top-left-radius: 20px; border-top-right-radius: 20px; }
.crm-root .crm-card > :last-child { border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; }
.crm-root .crm-line { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--row-h); padding: 10px 16px; text-align: left; font-size: var(--t-body); font-weight: 400; background: none; border-radius: 0; }
.crm-root .crm-card > .crm-line + .crm-line::before, .crm-root .crm-card > .crm-task + .crm-task::before, .crm-root .crm-card > .crm-note + .crm-note::before, .crm-root .crm-card > .crm-fact + .crm-fact::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: var(--hair); background: var(--line); }
.crm-root .crm-card > .crm-line-led + .crm-line-led::before { left: 64px; }
.crm-root .crm-line-lead { flex: none; display: grid; place-items: center; width: 36px; }
.crm-root .crm-line-lead > .crm-icon { width: 22px; height: 22px; }
.crm-root .crm-line-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.crm-root .crm-line-title { overflow-wrap: anywhere; line-height: 1.3; }
.crm-root .crm-line-led .crm-line-title { font-weight: 500; }
.crm-root .crm-line-end { flex: none; display: flex; align-items: center; gap: 8px; }
.crm-root .crm-line-value, .crm-root .crm-role-text { flex: none; color: var(--secondary); font-size: var(--t-sub); }
.crm-root .crm-row-button { justify-content: flex-start; cursor: pointer; transition: background-color var(--hover); }
.crm-root .crm-row-button > .crm-icon { width: 16px; height: 16px; color: var(--secondary); }
/* A button does not wrap its label; a row button's two lines of text do (a hint must not push a 320 page sideways). */
.crm-root .crm-row-button .crm-line-text { white-space: normal; overflow-wrap: anywhere; }
.crm-root .crm-row-button.pk-danger .crm-line-title { color: var(--danger); }
@media (hover: hover) { .crm-root .crm-row-button:not(:disabled):hover { background: var(--wash); } }
.crm-root .crm-switch-line { cursor: pointer; }
.crm-root .crm-name-row { gap: 10px; padding: 10px 12px; }
.crm-root .crm-name-row .crm-field { flex: 1; min-width: 0; width: auto; }
.crm-root .crm-icon-button { flex: none; width: var(--ctl); height: var(--ctl); display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: var(--on-ink); }
.crm-root .crm-icon-button .crm-icon { width: 22px; height: 22px; }

/* ---- record detail -------------------------------------------------------------------------------------------- */
.crm-root .crm-hero { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 0 4px; }
.crm-root .crm-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.crm-root .crm-hero-name { font-size: var(--t-title2); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.crm-root .crm-lede { color: var(--secondary); font-size: var(--t-sub); overflow-wrap: anywhere; }
.crm-root .crm-fact { position: relative; display: grid; grid-template-columns: minmax(84px, 28%) minmax(0, 1fr); column-gap: 16px; padding: 0 16px; font-size: var(--t-body); }
.crm-root .crm-fact-label { align-self: start; display: flex; align-items: center; min-height: 48px; color: var(--secondary); overflow-wrap: anywhere; }
.crm-root .crm-fact-value { min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.crm-root .crm-fact-value > * { min-height: 48px; display: flex; align-items: center; justify-content: flex-end; text-align: right; gap: 8px; min-width: 0; padding: 2px 0; }
.crm-root .crm-fact-value > * + * { border-top: var(--rule); }
.crm-root .crm-fact-value > .crm-chips { justify-content: flex-end; padding: 10px 0; }
.crm-root .crm-value { min-width: 0; overflow-wrap: anywhere; }
.crm-root .crm-pre { white-space: pre-wrap; }
.crm-root .crm-account-channel { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--secondary); font-size: var(--t-sub); margin-right: auto; }
.crm-root .crm-account-channel .crm-icon { width: 18px; height: 18px; color: var(--ink); }
.crm-root .crm-account .pk-iconbtn { margin-right: -8px; color: var(--secondary); }
.crm-root[data-form="desk"] .crm-account .pk-iconbtn .crm-icon { width: 14px; height: 14px; }
.crm-root .crm-add { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; font-size: var(--t-body); font-weight: 500; color: var(--ink); }
.crm-root .crm-add .crm-icon { width: 16px; height: 16px; }
@container col (max-width: 479px) {
  .crm-root .crm-fact { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .crm-root .crm-fact-label { min-height: 0; font-size: var(--t-foot); }
  .crm-root .crm-fact-value > * { justify-content: flex-start; text-align: left; min-height: 40px; }
  .crm-root .crm-fact-value > .crm-chips { justify-content: flex-start; }
}
.crm-root .crm-compose { display: flex; flex-direction: column; gap: 8px; }
.crm-root .crm-compose-end { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-left: 4px; }
.crm-root .crm-compose-end .crm-btn { margin-left: auto; }
.crm-root .crm-note { position: relative; padding: 14px 8px 4px 16px; }
.crm-root .crm-note-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-body); line-height: 1.5; padding-right: 8px; max-width: 38em; }
.crm-root .crm-note-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--tap); }
.crm-root .crm-note-foot .pk-iconbtn, .crm-root .crm-task > .pk-iconbtn { color: var(--secondary); }
.crm-root .crm-note-tools { display: inline-flex; align-items: center; gap: 4px; flex: none; }
/* 值守可读 (1.6): label then switch, one line; the switch keeps its own size, the label is the secondary sub text. */
.crm-root .crm-watch-flag { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-s); font-size: var(--t-sub); color: var(--secondary); cursor: pointer; white-space: nowrap; }
.crm-root .crm-watch-flag .pk-switch { margin: 0; }
.crm-root .crm-compose-end .crm-watch-flag { color: var(--ink); }
.crm-root .crm-task { position: relative; display: flex; align-items: center; gap: 2px; min-height: var(--row-h); padding: 6px 8px 6px 6px; }
.crm-root .crm-card > .crm-task + .crm-task::before { left: 52px; }
.crm-root .crm-tick { flex: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.crm-root .crm-task-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 4px 0; }
.crm-root .crm-task-title { font-size: var(--t-body); font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.crm-root .crm-task[data-done="true"] .crm-task-title { color: var(--secondary); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--tertiary); }
.crm-root .crm-task-meta { overflow-wrap: anywhere; }
.crm-root .crm-late { color: var(--danger); }
.crm-root .crm-inline { display: inline; color: var(--ink); font-weight: 500; text-align: left; }
.crm-root a.crm-inline { text-decoration: none; }
.crm-root .crm-inline-text { text-decoration: underline; text-decoration-color: var(--tertiary); text-underline-offset: 3px; overflow-wrap: anywhere; }
.crm-root:not([data-form="desk"]) .crm-inline { padding: 14px; margin: -14px; }
.crm-root .crm-compose-box { container: compose / inline-size; }
.crm-root .crm-task-compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(0, max-content) max-content; gap: 8px; align-items: center; }
.crm-root .crm-task-compose .crm-trigger { width: auto; max-width: 180px; }
@container compose (max-width: 559px) {
  .crm-root .crm-task-compose { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) max-content; }
  .crm-root .crm-task-compose .crm-task-new { grid-column: 1 / -1; }
  .crm-root .crm-task-compose .crm-trigger { width: 100%; max-width: none; }
}

/* ---- statistics --------------------------------------------------------------------------------------------- */
.crm-root .crm-stats { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.crm-root .crm-stats[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crm-root .crm-stats[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crm-root .crm-stats[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
@container col (max-width: 559px) { .crm-root .crm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crm-root .crm-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 16px 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line); text-align: left; }
.crm-root .crm-stat-label { font-size: var(--t-cap); color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-stat-value { font-size: var(--t-title3); font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-root .crm-stat-delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--t-cap); color: var(--secondary); }
.crm-root .crm-stat-delta .crm-icon { width: 11px; height: 11px; }
.crm-root .crm-ring-track { stroke: var(--line); }
.crm-root .crm-ring-value { stroke: var(--ink); transition: stroke-dasharray var(--layout); }

/* ---- states: empty, loading, failure, banner ------------------------------------------------------------------- */
.crm-root .crm-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 16px; color: var(--secondary); }
.crm-root .crm-empty-compact { padding: 28px 16px; }
.crm-root .crm-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; color: var(--secondary); }
.crm-root .crm-empty-icon .crm-icon { width: 40px; height: 40px; stroke-width: 1.3; }
.crm-root .crm-empty-title { font-size: var(--t-headline); font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.crm-root .crm-empty-text { font-size: var(--t-sub); max-width: 320px; overflow-wrap: anywhere; }
.crm-root .crm-empty > .crm-btn { margin-top: 10px; }
.crm-root .crm-skeleton { display: flex; flex-direction: column; gap: 2px; animation: crm-pulse 1.4s ease-in-out infinite; }
@keyframes crm-pulse { 50% { opacity: .55; } }
.crm-root .crm-bone-row { display: flex; align-items: center; gap: 12px; min-height: var(--row-h); padding: 8px 12px; }
.crm-root .crm-bone-text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.crm-root .crm-bone { display: block; height: 10px; border-radius: 5px; background: var(--elevated); }
.crm-root .crm-bone-tall { height: 14px; }
.crm-root .crm-bone[data-w="25"] { width: 25%; } .crm-root .crm-bone[data-w="30"] { width: 30%; } .crm-root .crm-bone[data-w="35"] { width: 35%; } .crm-root .crm-bone[data-w="40"] { width: 40%; }
.crm-root .crm-bone[data-w="45"] { width: 45%; } .crm-root .crm-bone[data-w="50"] { width: 50%; } .crm-root .crm-bone[data-w="60"] { width: 60%; } .crm-root .crm-bone[data-w="65"] { width: 65%; } .crm-root .crm-bone[data-w="70"] { width: 70%; }
.crm-root .crm-bone-mark { flex: none; width: 40px; height: 40px; border-radius: 18%; }
.crm-root .crm-bone-hero { width: 60px; height: 60px; }
.crm-root .crm-bone-block { height: 120px; margin-top: 18px; border-radius: 20px; background: var(--elevated); }
.crm-root .crm-skeleton-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@container col (max-width: 559px) { .crm-root .crm-skeleton-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crm-root .crm-bone-tile { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; height: 68px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line); }
.crm-root .crm-banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; min-height: 52px; border-radius: 16px; background: var(--elevated); box-shadow: 0 0 0 var(--hair) var(--line); }
.crm-root .crm-banner-icon .crm-icon { width: 20px; height: 20px; }
.crm-root .crm-banner { flex-wrap: wrap; }
.crm-root .crm-banner-text { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crm-root .crm-banner > .crm-btn { margin-left: auto; }
.crm-root .crm-banner-title { font-size: var(--t-body); font-weight: 500; overflow-wrap: anywhere; }
.crm-root .crm-notice { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 24px 16px 8px; }
.crm-root .crm-notice-title { font-size: var(--t-headline); font-weight: 500; }

/* ---- gates: sign-in, membership, new workspace, invitation --------------------------------------------------------- */
.crm-root .crm-gate { padding: max(24px, env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left)); }
.crm-root .crm-gate-card { width: min(440px, 100%); margin: auto; gap: 12px; }
.crm-root .crm-gate-card > .crm-btn-quiet { align-self: center; }
.crm-root .crm-gate-mark { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--elevated); }
.crm-root .crm-gate-mark .crm-icon { width: 20px; height: 20px; }
.crm-root .crm-gate-card > .crm-gate-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--ink); color: var(--on-ink); margin-bottom: 4px; }
.crm-root .crm-gate-card > .crm-gate-mark .crm-icon { width: 28px; height: 28px; }
.crm-root .crm-lines { line-height: 1.6; }
.crm-root .crm-wrap { overflow-wrap: anywhere; }
.crm-root .crm-gate-points { width: 100%; display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: 0 0 0 var(--hair) var(--line); margin: 4px 0 8px; }
.crm-root .crm-gate-point { position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--row-h); padding: 10px 16px; text-align: left; }
.crm-root .crm-gate-point + .crm-gate-point::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: var(--hair); background: var(--line); }
.crm-root .crm-gate-point > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.crm-root .crm-gate-point-title { font-size: var(--t-body); font-weight: 500; }
.crm-root .crm-gate-actions { gap: 8px; align-items: stretch; }
.crm-root .crm-gate-actions .crm-btn-quiet { align-self: center; }
.crm-root .crm-gate-hint { font-size: var(--t-foot); color: var(--secondary); text-align: center; }
.crm-root .crm-gate-invite { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 12px; text-align: left; }
.crm-root .crm-gate-invite-row { display: flex; gap: 8px; }
.crm-root .crm-gate-invite-row .crm-field { flex: 1; min-width: 0; width: auto; }
.crm-root .crm-gate-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--t-sub); color: var(--secondary); }
.crm-root .crm-gate-note .crm-icon { width: 16px; height: 16px; }
.crm-root .crm-gate-wait { display: grid; place-items: center; min-height: 120px; }
.crm-root .crm-gate-wait .crm-ring { animation: crm-spin 1s linear infinite; }
@keyframes crm-spin { to { transform: rotate(360deg); } }
.crm-root .crm-create-form { text-align: left; }
.crm-root .crm-consent { font-size: var(--t-sub); padding: 0 4px; }
.crm-root .crm-icon-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.crm-root .crm-icon-choice { display: grid; place-items: center; min-height: 44px; border-radius: 12px; background: var(--elevated); color: var(--ink); transition: background-color var(--hover), color var(--hover), transform .28s var(--m-release); }
.crm-root .crm-icon-choice .crm-icon { width: 22px; height: 22px; }
.crm-root .crm-icon-choice[aria-checked="true"] { background: var(--ink); color: var(--on-ink); }
.crm-root .crm-icon-choice:active { transform: scale(.94); }
.crm-root .crm-icon-pop { display: grid; grid-template-columns: repeat(4, 44px); gap: 6px; padding: 8px; min-width: 0; }
.crm-root .crm-member-sheet .crm-gate-points { margin: 0; background: var(--canvas); }

/* ---- onboarding ------------------------------------------------------------------------------------------------- */
.crm-root .crm-onboard { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.crm-root .crm-onboard-head { display: flex; align-items: center; gap: 12px; }
.crm-root .crm-onboard-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.crm-root .crm-onboard-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
@container col (max-width: 559px) { .crm-root .crm-onboard-steps { grid-template-columns: minmax(0, 1fr); } }
.crm-root .crm-onboard-step { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 12px; text-align: left; font-size: var(--t-body); transition: background-color var(--hover); }
@media (hover: hover) { .crm-root .crm-onboard-step:hover { background: var(--wash); } }
.crm-root .crm-onboard-check .crm-icon { width: 20px; height: 20px; }
.crm-root .crm-onboard-label { flex: 1; min-width: 0; }
.crm-root .crm-onboard-step > .crm-icon { width: 14px; height: 14px; color: var(--tertiary); }
.crm-root .crm-onboard-step[data-done="true"] { color: var(--secondary); }
.crm-root .crm-onboard-step[data-done="true"] .crm-onboard-label { text-decoration: line-through; text-decoration-color: var(--tertiary); }
.crm-root .crm-onboard-sample { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 12px 0 0 10px; border-top: var(--rule); }

/* ---- activity log ------------------------------------------------------------------------------------------------- */
.crm-root .crm-log { display: flex; flex-direction: column; }
.crm-root .crm-log-day { margin: 14px 4px 4px; font-size: var(--t-foot); font-weight: 500; color: var(--secondary); }
.crm-root .crm-log-row { display: grid; grid-template-columns: max-content minmax(0, 1fr) minmax(0, max-content); align-items: baseline; gap: 12px; padding: 8px 4px; border-top: var(--rule); font-size: var(--t-body); }
.crm-root .crm-log-time { color: var(--secondary); font-variant-numeric: tabular-nums; font-size: var(--t-sub); }
.crm-root .crm-log-who { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- #icons ---------------------------------------------------------------------------------------------------- */
.crm-root .crm-icon-sheet { flex: 1; overflow-y: auto; padding: 28px var(--pad) 48px; }
.crm-root .crm-icon-sheet .crm-col { display: flex; flex-direction: column; gap: 20px; }
.crm-root .crm-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.crm-root .crm-icon-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 10px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 var(--hair) var(--line); }
.crm-root .crm-icon-tile figcaption { font-size: 11px; color: var(--secondary); overflow-wrap: anywhere; text-align: center; }
.crm-root .crm-icon-sizes { display: flex; flex-direction: column; gap: 14px; }
.crm-root .crm-icon-sizes span { display: flex; align-items: center; gap: 16px; }

/* ---- reduced motion: no movement, a short fade at most ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .crm-root .crm-side, .crm-root .crm-scrim, .crm-root .crm-nav-plate, .crm-root .crm-detail, .crm-root .crm-column, .crm-root .crm-ring-value { transition: none !important; }
  .crm-root .crm-page-in, .crm-root .crm-skeleton, .crm-root .crm-gate-wait .crm-ring, .crm-root .crm-detail { animation: none !important; }
  .crm-root .crm-btn:not(:disabled):active, .crm-root button.crm-row:active, .crm-root .crm-brand:active, .crm-root .crm-icon-choice:active { transform: none; }
}
/* 联系人: the filter the overview linked here with (one dark chip; pressing it clears the filter) */
.crm-root .crm-linked-filter { align-self: flex-start; max-width: 100%; background: var(--ink); color: var(--on-ink); font-size: var(--t-foot); }
.crm-root .crm-linked-filter > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-root .crm-linked-filter .crm-icon { width: 14px; height: 14px; }
.crm-root .crm-linked-filter[hidden] { display: none; }

/* ---- live refresh (1.3): what someone else changed shows itself once; nothing moves with reduced motion ---- */
.crm-root .crm-live-flash { animation: crm-live-flash 1.8s var(--m-smooth) both; }
@keyframes crm-live-flash { 0%, 25% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 30%, transparent), inset 0 0 0 999px color-mix(in srgb, var(--ink) 6%, transparent); } }
.crm-root .crm-live-mark { display: inline-block; margin-left: 6px; font-size: .62em; line-height: 1; vertical-align: .32em; transition: opacity .45s ease-out; animation: crm-live-mark-in .3s var(--m-enter) both; }
.crm-root .crm-live-mark[data-tone="good"] { color: var(--good, #1a7f37); }
.crm-root .crm-live-mark[data-tone="bad"] { color: var(--danger); }
.crm-root .crm-live-mark-out { opacity: 0; }
@keyframes crm-live-mark-in { from { opacity: 0; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .crm-root .crm-live-flash { animation: none; } .crm-root .crm-live-mark { animation: none; } }
