/* ============================================================================
   ATLAS REDESIGN — Clients & Leads (CRM) screen styles  ·  Phase 2
   Branch: atlas-redesign-2026-06-29

   Prefix: .rd-clientcare. Tokens only (--r-*) so Calm (almanac) + Operator
   themes both work automatically. No hardcoded hex. Theme-specific selectors
   (html[data-rtheme="operator"] …) are used only where a token can't express
   the tweak (rare).
   ========================================================================== */

.rd-clientcare {
  font-family: var(--r-font-body);
  color: var(--r-body);
  padding: var(--r-gutter);
  max-width: var(--r-page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- header row ---------------------------------------------------------- */
.rd-cc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rd-cc-head-l {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-cc-eyebrow {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-clay);
}
.rd-cc-h1 {
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h1);
  font-weight: 600;
  line-height: 1.1;
  color: var(--r-ink);
  margin: 0;
}
.rd-cc-head-r {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* segmented filter pill group (All / Buyers / Sellers) */
.rd-cc-filter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-control);
  padding: 3px;
}
.rd-cc-seg-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--r-faint);
  font-family: var(--r-font-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 13px;
  border-radius: calc(var(--r-radius-control) - 3px);
  cursor: pointer;
  transition: color var(--r-dur) var(--r-ease),
              background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-cc-seg-btn:hover { color: var(--r-body); }
.rd-cc-seg-btn.is-active {
  background: var(--r-surface);
  color: var(--r-primary);
  font-weight: 600;
  box-shadow: var(--r-shadow-card);
}
.rd-cc-seg-btn:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-seg-btn:active { transform: scale(.96); }

/* primary "Add contact" button */
.rd-cc-add {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  background: var(--r-primary);
  color: var(--r-primary-ink);
  border: none;
  border-radius: var(--r-radius-control);
  font-family: var(--r-font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
}
.rd-cc-add i { font-size: 15px; }
.rd-cc-add:hover { filter: brightness(1.06); box-shadow: var(--r-shadow-hover); transform: translateY(-1px); }
.rd-cc-add:active { transform: translateY(0); }
.rd-cc-add:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ---- KPI strip (4-up) ---------------------------------------------------- */
.rd-cc-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.rd-cc-kpi {
  background: var(--r-surface);
  border: 1px solid var(--r-hairline-2);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-cc-kpi-label {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-faint);
}
.rd-cc-kpi-value {
  font-family: var(--r-font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--r-ink);
}
.rd-cc-kpi[data-tone="hot"] .rd-cc-kpi-value { color: var(--r-primary-2); }
.rd-cc-kpi[data-tone="due"] .rd-cc-kpi-value { color: var(--r-clay-2); }

/* ---- main grid (contacts | side) ----------------------------------------- */
.rd-cc-grid {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 20px;
  align-items: start;
  min-height: 0;
}

/* ---- All contacts card --------------------------------------------------- */
.rd-cc-contacts {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 14px 16px 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rd-cc-contacts-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
}
.rd-cc-contacts-title {
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h2);
  font-weight: 700;
  color: var(--r-ink);
}
.rd-cc-contacts-note {
  font-size: 12px;
  color: var(--r-muted);
}

/* scrollable list — only this region scrolls, never the outer frame */
.rd-cc-list {
  display: flex;
  flex-direction: column;
  overflow: auto;
  max-height: calc(100vh - 320px);
  margin: 0 -6px;
  padding: 0 2px;
}

/* one contact row — hover/focus carry a gold drill-down accent (inset, so it
   never shifts layout) + a quiet rise-in so a re-filtered list feels alive. */
.rd-cc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border-top: 1px solid var(--r-hairline);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: inset 0 0 0 0 transparent;
  transition: background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
  animation: rd-cc-row-rise .22s var(--r-ease) both;
}
.rd-cc-row:first-child { border-top: none; }
.rd-cc-row:hover,
.rd-cc-row:focus-visible {
  background: var(--r-canvas-raised);
  box-shadow: inset 3px 0 0 0 var(--r-primary);
}
.rd-cc-row:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-row:active { background: var(--r-well); }
@keyframes rd-cc-row-rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-cc-row { animation: none; }
}
html[data-rmotion="reduced"] .rd-cc-row { animation: none !important; }

/* score badge */
.rd-cc-score {
  flex: 0 0 auto;
  min-width: 30px;
  text-align: center;
  font-family: var(--r-font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 8px;
  border-radius: var(--r-radius-pill);
  background: var(--r-well);
  color: var(--r-muted);
}
.rd-cc-score[data-band="high"] { background: var(--r-mint-surface); color: var(--r-mint-ink); }
.rd-cc-score[data-band="mid"]  { background: var(--r-well); color: var(--r-muted); }
.rd-cc-score[data-band="low"]  { background: color-mix(in srgb, var(--r-clay) 16%, transparent); color: var(--r-clay-2); }
.rd-cc-score[data-band="none"] { background: transparent; color: var(--r-faint); }

/* identity block */
.rd-cc-id {
  flex: 2.4 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rd-cc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--r-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-cc-sub {
  font-size: 12px;
  color: var(--r-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* stage pill */
.rd-cc-stage {
  flex: 1.1 1 0;
  min-width: 0;
  align-self: center;
  justify-self: start;
  display: inline-block;
  max-width: max-content;
  font-size: 12px;
  color: var(--r-body);
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-pill);
  padding: 3px 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* last touch */
.rd-cc-touch {
  flex: 2 1 0;
  min-width: 0;
  font-size: 12.5px;
  color: var(--r-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* next-action link */
.rd-cc-next {
  flex: 0 0 84px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--r-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-cc-next i { font-size: 12px; vertical-align: -1px; }

/* assignee avatar */
.rd-cc-av {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--r-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--r-well);
  color: var(--r-muted);
}

/* contacts empty/error state — icon + title + note so a connection outage
   reads differently from an honest "no matches" (never the same gray text). */
.rd-cc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-family: var(--r-font-body);
  font-size: var(--r-fs-body);
  color: var(--r-muted);
  text-align: center;
  padding: 30px 12px;
  border: 1px dashed var(--r-border);
  border-radius: var(--r-radius-control);
  margin: 8px 4px 12px;
}
.rd-cc-empty i { font-size: 24px; color: var(--r-faint); }
.rd-cc-empty-title {
  font-family: var(--r-font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--r-ink);
}
.rd-cc-empty-note {
  font-size: var(--r-fs-meta);
  color: var(--r-muted);
  max-width: 320px;
  line-height: 1.5;
}

/* ---- side column --------------------------------------------------------- */
.rd-cc-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* smart segments card */
.rd-cc-segments {
  background: var(--r-surface);
  border: 1px solid color-mix(in srgb, var(--r-primary) 28%, var(--r-border));
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 18px 20px;
}
.rd-cc-segments-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h2);
  font-weight: 600;
  color: var(--r-ink);
}
.rd-cc-segments-head i { color: var(--r-primary); font-size: 18px; }

.rd-cc-seg-list {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.rd-cc-seg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--r-hairline);
  cursor: pointer;
  transition: background var(--r-dur) var(--r-ease);
}
.rd-cc-seg:hover { background: var(--r-canvas-raised); }
.rd-cc-seg:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-seg:active { background: var(--r-well); }
.rd-cc-seg-label {
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--r-body);
}
.rd-cc-seg-count {
  flex: 0 0 auto;
  font-family: var(--r-font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 9px;
  border-radius: var(--r-radius-pill);
  background: var(--r-mint-surface);
  color: var(--r-mint-ink);
}
.rd-cc-seg-count[data-tone="clay"] {
  background: color-mix(in srgb, var(--r-clay) 16%, transparent);
  color: var(--r-clay-2);
}
.rd-cc-seg-caret {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--r-faint);
  transition: color var(--r-dur) var(--r-ease), transform var(--r-dur) var(--r-ease);
}
.rd-cc-seg:hover .rd-cc-seg-caret,
.rd-cc-seg:focus-visible .rd-cc-seg-caret {
  color: var(--r-primary);
  transform: translateX(2px);
}

/* Atlas auto-score note */
.rd-cc-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  padding: 13px 15px;
}
.rd-cc-note i { color: var(--r-primary); font-size: 16px; flex: 0 0 auto; margin-top: 1px; }
.rd-cc-note p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--r-muted);
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .rd-cc-grid { grid-template-columns: minmax(0, 1fr); } /* bare 1fr's auto min let row min-content push past the viewport */
  .rd-cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-cc-list { max-height: 52vh; }
  .rd-cc-touch { display: none; }
}

/* W-F5S2: header search input (replaces the no-op Add-contact button) */
.rd-cc-search {
  height: 34px; padding: 0 12px; width: 220px;
  border: 1px solid var(--r-border); border-radius: var(--r-radius-control);
  background: var(--r-canvas-raised); color: var(--r-ink);
  font-family: var(--r-font-body); font-size: 13px;
}
.rd-cc-search:focus-visible { outline: var(--r-focus); outline-offset: 1px; }
.rd-cc-search::placeholder { color: var(--r-muted); }

/* ==== Buyer-match (P2-C, 2026-07-02) — in-dashboard listing match panel ======
   Lives inside the contact drill-down slide-over (.rd-rp__section). Tokens only so
   Calm + Operator resolve; labeled fields; ≥44px controls; readable contrast. */
.rd-cc-bm { display: flex; flex-direction: column; gap: 12px; }
.rd-cc-bm-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--r-muted); }
.rd-cc-bm-note strong { color: var(--r-ink); }
.rd-cc-bm-form {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.rd-cc-bm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rd-cc-bm-lab {
  font-family: var(--r-font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--r-muted);
}
.rd-cc-bm-city,
.rd-cc-bm-beds,
.rd-cc-bm-price {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-control);
  background: var(--r-canvas-raised);
  color: var(--r-ink);
  font-family: var(--r-font-body);
  font-size: 14px;
  width: 100%;
}
.rd-cc-bm-city:focus-visible,
.rd-cc-bm-beds:focus-visible,
.rd-cc-bm-price:focus-visible { outline: var(--r-focus); outline-offset: 1px; }
.rd-cc-bm-price::placeholder { color: var(--r-faint); }
.rd-cc-bm-go {
  appearance: none;
  height: 40px;
  padding: 0 18px;
  background: var(--r-primary);
  color: var(--r-primary-ink);
  border: none;
  border-radius: var(--r-radius-control);
  font-family: var(--r-font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--r-dur) var(--r-ease);
}
.rd-cc-bm-go:hover { filter: brightness(1.06); }
.rd-cc-bm-go:disabled { opacity: .55; cursor: default; }
.rd-cc-bm-go:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-bm-results { display: flex; flex-direction: column; gap: 2px; }
.rd-cc-bm-count {
  font-family: var(--r-font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--r-muted);
  padding: 4px 2px 6px;
}
.rd-cc-bm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  min-height: 52px;
  border: 1px solid var(--r-hairline);
  border-radius: var(--r-radius-control);
  background: var(--r-surface);
  cursor: pointer;
  transition: border-color var(--r-dur) var(--r-ease), background var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease), box-shadow var(--r-dur) var(--r-ease);
}
.rd-cc-bm-row:hover {
  border-color: var(--r-primary);
  background: var(--r-canvas-raised);
  transform: translateY(-1px);
  box-shadow: var(--r-shadow-card);
}
.rd-cc-bm-row:focus-visible { outline: var(--r-focus); outline-offset: 1px; }
.rd-cc-bm-row-main { flex: 1 1 auto; min-width: 0; }
.rd-cc-bm-row-addr {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--r-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-cc-bm-row-spec { margin-top: 2px; font-size: 12px; color: var(--r-muted); }
.rd-cc-bm-row-price {
  flex: 0 0 auto;
  font-family: var(--r-font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--r-ink);
}
.rd-cc-bm-empty {
  font-size: 12.5px;
  color: var(--r-muted);
  padding: 12px 2px;
}
@media (max-width: 640px) {
  .rd-cc-bm-form { grid-template-columns: 1fr 1fr; }
  .rd-cc-bm-go { grid-column: 1 / -1; }
}

/* ---- phone (390px QA 2026-07-04): header wraps, search takes the row,
        contact rows swipe inside the card instead of clipping ------------- */
@media (max-width: 760px) {
  .rd-cc-head,
  .rd-cc-head-r { flex-wrap: wrap; }
  .rd-cc-search { flex: 1 1 160px; width: auto; min-width: 0; }
  .rd-cc-main { min-width: 0; }
  .rd-cc-contacts { overflow-x: auto; }
}


/* ============================================================================
   Wave 2 (2026-07-03) — CONTACT RECORD drawer (.rd-cc-drawer*)
   Right slide-over person page. Tokens only; sits BELOW the shared record
   panel (.rd-rp z-index 1200) so the buyer-match listing detail stacks above.
   ========================================================================== */
.rd-cc-row { cursor: pointer; }
.rd-cc-row-caret {
  color: var(--r-muted);
  font-size: 13px;
  opacity: 0;
  transition: opacity .12s ease;
}
.rd-cc-row:hover .rd-cc-row-caret,
.rd-cc-row:focus-visible .rd-cc-row-caret { opacity: .9; }

.rd-cc-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: color-mix(in srgb, var(--r-ink, #14181d) 38%, transparent);
  display: flex;
  justify-content: flex-end;
}
.rd-cc-drawer {
  width: min(440px, 92vw);
  height: 100%;
  background: var(--r-surface);
  border-left: 1px solid var(--r-border);
  box-shadow: -18px 0 48px color-mix(in srgb, var(--r-ink, #14181d) 22%, transparent);
  position: relative;
  animation: rd-cc-drawer-in .18s ease-out;
  display: flex;
  flex-direction: column;
}
@keyframes rd-cc-drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-cc-drawer { animation: none; }
}
.rd-cc-drawer-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--r-border);
  background: var(--r-canvas-raised);
  color: var(--r-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  z-index: 1;
}
.rd-cc-drawer-x:hover { background: var(--r-canvas); }
.rd-cc-drawer-x:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-drawer-body {
  overflow-y: auto;
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* header */
.rd-cc-drawer-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-right: 40px;
}
.rd-cc-drawer-av {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--r-canvas-raised);
  border: 1px solid var(--r-border);
  color: var(--r-body);
  font-family: var(--r-font-mono);
  font-size: 15px;
  letter-spacing: .04em;
}
.rd-cc-drawer-idwrap { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rd-cc-drawer-name {
  font-family: var(--r-font-display, var(--r-font-body));
  font-size: 21px;
  line-height: 1.15;
  color: var(--r-heading, var(--r-body));
  overflow-wrap: anywhere;
}
.rd-cc-drawer-subrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rd-cc-drawer-stage {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--r-border);
  background: var(--r-canvas-raised);
  color: var(--r-body);
  white-space: nowrap;
}
.rd-cc-drawer-src { font-size: 12.5px; color: var(--r-muted); }

/* action row */
.rd-cc-drawer-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.rd-cc-drawer-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--r-border);
  background: var(--r-canvas-raised);
  color: var(--r-body);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--r-dur) var(--r-ease), border-color var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-cc-drawer-act:hover:not(:disabled) {
  background: color-mix(in srgb, var(--r-primary) 10%, var(--r-canvas-raised));
  border-color: color-mix(in srgb, var(--r-primary) 35%, var(--r-border));
}
.rd-cc-drawer-act:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-drawer-act:active:not(:disabled) { transform: scale(.97); }
.rd-cc-drawer-act:disabled { opacity: .45; cursor: not-allowed; }
.rd-cc-drawer-act .ph { font-size: 15px; }

/* cards */
.rd-cc-drawer-card {
  border: 1px solid var(--r-border);
  border-radius: 12px;
  background: var(--r-canvas-raised);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rd-cc-drawer-card-t {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow, 11px);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-muted);
}
.rd-cc-drawer-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}
.rd-cc-drawer-kv span { color: var(--r-muted); }
.rd-cc-drawer-kv strong { color: var(--r-body); font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* copy rows */
.rd-cc-drawer-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  color: var(--r-body);
}
.rd-cc-drawer-copy-v { overflow-wrap: anywhere; }
.rd-cc-drawer-copy-btn {
  position: relative;
  border: 1px solid var(--r-border);
  background: transparent;
  color: var(--r-muted);
  border-radius: 7px;
  width: 30px;
  height: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.rd-cc-drawer-copy-btn:hover { color: var(--r-body); background: var(--r-canvas); }
.rd-cc-drawer-copy-btn:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-drawer-copied {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--r-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  white-space: nowrap;
}
.rd-cc-drawer-copy-btn.is-copied .rd-cc-drawer-copied { opacity: 1; }

/* notes */
.rd-cc-drawer-note {
  border-top: 1px solid var(--r-border);
  padding-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rd-cc-drawer-note:first-of-type { border-top: none; padding-top: 0; }
.rd-cc-drawer-note-when {
  font-family: var(--r-font-mono);
  font-size: 11px;
  color: var(--r-muted);
}
.rd-cc-drawer-note-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--r-body);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* meta + tags */
.rd-cc-drawer-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rd-cc-drawer-tag {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--r-border);
  color: var(--r-muted);
  background: var(--r-canvas);
}

/* states */
.rd-cc-drawer-empty,
.rd-cc-drawer-err {
  font-size: 13px;
  color: var(--r-muted);
  border: 1px dashed var(--r-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.rd-cc-drawer-err {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--r-clay, var(--r-body));
  border-color: color-mix(in srgb, var(--r-clay, var(--r-border)) 35%, var(--r-border));
}
.rd-cc-drawer-err i { font-size: 16px; flex: 0 0 auto; margin-top: 1px; }
.rd-cc-drawer-foot {
  font-size: 11.5px;
  color: var(--r-faint, var(--r-muted));
  padding-top: 2px;
}

/* loading skeleton (a real loading state — never an em-dash spinner) */
.rd-cc-drawer-skel { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.rd-cc-drawer-skel-bar {
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(90deg,
    var(--r-canvas-raised) 25%,
    color-mix(in srgb, var(--r-border) 55%, var(--r-canvas-raised)) 42%,
    var(--r-canvas-raised) 60%);
  background-size: 220% 100%;
  animation: rd-cc-skel 1.1s linear infinite;
}
.rd-cc-drawer-skel-bar.w2 { width: 72%; }
.rd-cc-drawer-skel-bar.w3 { width: 46%; }
@keyframes rd-cc-skel {
  from { background-position: 120% 0; }
  to   { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-cc-drawer-skel-bar { animation: none; }
}

/* ── L3 2026-07-03: row-level call/email actions ─────────────────────────────
   Ghost icon buttons on each contact row; compliance is resolved at click
   time in clientcare.js (rowAct). Muted at rest, primary on hover; ≥44px on
   touch via redesign-parity.css family 3 (buttons inherit the 44px floor). */
.rd-cc-row-acts { display: inline-flex; gap: 4px; flex: none; }
.rd-cc-row-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  color: var(--r-faint); cursor: pointer; font-size: 15px;
  transition: color var(--r-dur) var(--r-ease), background var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-cc-row-act:hover { color: var(--r-primary); background: var(--r-canvas); }
.rd-cc-row-act:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-cc-row-act:active:not([disabled]) { transform: scale(.9); }
.rd-cc-row-act[disabled] { color: var(--r-faint); opacity: .45; cursor: not-allowed; }
.rd-cc-row-act.is-busy { opacity: .55; cursor: progress; }

/* linked-deal row inside the drawer (exact address match) */
.rd-cc-drawer-loop { display: block; text-decoration: none; color: inherit; border-radius: 8px; }
.rd-cc-drawer-loop:hover { background: var(--r-canvas); }
.rd-cc-drawer-loop:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ── N4 (2026-07-03): drawer note composer — the one Lofty write ────────── */
.rd-cc-note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rd-cc-note-input {
  width: 100%;
  resize: vertical;
  min-height: 44px;
  padding: 9px 11px;
  font-family: var(--r-font-body);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--r-ink);
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-control);
}
.rd-cc-note-input:focus-visible { outline: var(--r-focus); outline-offset: 1px; }
.rd-cc-note-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.rd-cc-note-err {
  flex: 1 1 auto;
  font-family: var(--r-font-mono);
  font-size: 12px;
  color: var(--r-alert);
}
.rd-cc-note-save {
  appearance: none;
  border: 1px solid var(--r-border);
  background: var(--r-surface);
  color: var(--r-primary);
  font-family: var(--r-font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-radius-control);
  cursor: pointer;
  transition: color var(--r-dur) var(--r-ease), border-color var(--r-dur) var(--r-ease);
}
.rd-cc-note-save:hover { border-color: var(--r-primary); }
.rd-cc-note-save:disabled { opacity: .55; cursor: default; }
.rd-cc-note-save:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
