/* ==========================================================================
   IRCC CONTACT RELATIONSHIPS — CANONICAL
   Relationship summary, feedback, meeting history and follow-up actions.
   ========================================================================== */

/* 01 — BASE & EMPTY STATES */
.contacts-module .ct-rel-side-badge.buy { background: #eaf8f4; color: #14765f; }

.contacts-module .ct-rel-side-badge.sell { background: #edf3ff; color: #4364bf; }

.contacts-module .ct-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #dddff3;
  border-top-color: #6a4df5;
  border-radius: 50%;
  animation: ctRelSpin .8s linear infinite;
}

.contacts-module .ct-rel-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.contacts-module .ct-rel-mini {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f3f4f8;
  color: #697084;
  font-size: var(--ct-overlay-chip-size);
  font-weight: var(--ct-overlay-label-weight);
  white-space: nowrap;
}

.contacts-module .ct-rel-mini svg { width: 10px; height: 10px; }

.contacts-module .ct-rel-mini.follow { background: #f2efff; color: #624ccc; }

.contacts-module .ct-rel-mini.follow.overdue { background: #fff0f2; color: #bd5967; }

.contacts-module .ct-rel-mini.follow.due { background: #fff8df; color: #97731e; }

.contacts-module #ctRelFollowup:disabled { opacity: .42; cursor: not-allowed; }

.contacts-module .ct-rel-panel {
  margin: 0 0 2px;
  padding: 2px 2px 18px;
  border: 0;
  border-bottom: 1px solid #ececf3;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  color: #292e40;
}

.contacts-module .ct-rel-side-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #eef1f6;
  color: #5e667c;
  white-space: nowrap;
  min-height: 25px;
  padding: 0 9px;
  font-size: var(--ct-overlay-chip-size);
  font-weight: var(--ct-overlay-section-title-weight);
}

.contacts-module .ct-rel-side-badge svg { width: 12px; height: 12px; }

.contacts-module .ct-rel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f0edff;
  color: #5f43db;
  font-weight: var(--ct-overlay-label-weight);
  min-width: 26px;
  height: 23px;
  font-size: var(--ct-overlay-meta-size);
}

.contacts-module #ctMeetingForm { padding: 12px; }

.contacts-module .ct-rel-panel svg { display: block; flex: 0 0 auto; }

#ctDrawer #ctRelFollowup {
  display: block;
  width: 100%;
  height: 24px;
  margin-top: 2px;
  padding: 0;
  color: #232839;
  font-size: var(--ct-overlay-body-size);
  font-weight: var(--ct-overlay-label-weight);
  line-height: normal;
}

.contacts-module #ctRelSnapshot.hidden, .contacts-module:has(#ctRelEditor:not(.hidden)) #ctLogMeeting, .contacts-module #ctQuickActions, .contacts-module .ct-rel-panel.hidden { display: none; }

.contacts-module .ct-rel-idle.compact { min-height: 60px; padding: 12px; }

.contacts-module .ct-rel-idle strong { display: block; color: #232839; font-size: var(--ct-overlay-section-title-size); font-weight: var(--ct-overlay-label-weight); }

.contacts-module .ct-rel-idle span {
  display: block;
  margin-top: 4px;
  color: #60687d;
  font-size: var(--ct-overlay-subtitle-size);
  line-height: 1.45;
}

.contacts-module .ct-rel-idle {
  min-height: 66px;
  padding: 11px 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #556076;
  text-align: left;
  border: 1px dashed #dfe1ea;
  background: #fbfbfd;
}

.contacts-module .ct-rel-idle-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 11px;
  background: #f0ebff;
  color: #5f43db;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-idle-icon svg { width: 14px; height: 14px; min-width: 14px; min-height: 14px; }

/* 02 — ACTIONS & PRIVACY */
.contacts-module .ct-rel-add:hover { transform: translateY(-1px); }

.contacts-module .ct-rel-actions .secondary { border: 1px solid #dce1ea; background: #fff; color: #61697c; }

.contacts-module .ct-rel-actions .primary { border: 0; background: linear-gradient(135deg,#6a4df5,#7d63f7); color: #fff; box-shadow: 0 6px 14px rgba(106,77,245,.16); }

.contacts-module .ct-rel-actions .primary:disabled { opacity: .6; cursor: not-allowed; }

.contacts-module .ct-rel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 9px;
}

.contacts-module .ct-rel-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d9e9e4;
  border-radius: 12px;
  background: #f5fbf9;
}

.contacts-module .ct-rel-privacy strong {
  display: block;
  color: #2e4b43;
  font-size: var(--ct-overlay-subtitle-size);
  font-weight: var(--ct-overlay-section-title-weight);
  line-height: 1.35;
}

.contacts-module .ct-rel-privacy span:not(.ct-rel-privacy-icon) {
  display: block;
  margin-top: 2px;
  color: #5e756f;
  font-size: var(--ct-overlay-meta-size);
  font-weight: var(--ct-overlay-helper-weight);
  line-height: 1.45;
}

.contacts-module .ct-rel-icon-button {
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #dfe3ed;
  border-radius: 10px;
  background: #fff;
  color: #71788c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.contacts-module .ct-rel-utility-row .ct-rel-side-badge { margin: 0; }

.contacts-module .ct-rel-utility-row .ct-rel-add { margin-left: auto; }

.contacts-module .ct-rel-utility-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.contacts-module .ct-rel-utility-actions .ct-rel-add { margin-left: 0; }

.contacts-module .ct-rel-email {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #dcd4ff;
  border-radius: 12px;
  background: #fff;
  color: #6249dc;
  cursor: pointer;
  font-size: var(--ct-overlay-body-size);
  font-weight: var(--ct-overlay-label-weight);
  white-space: nowrap;
  transition: .16s ease;
}

.contacts-module .ct-rel-email:hover { border-color: #cfc3ff; background: #f8f5ff; }

.contacts-module .ct-rel-icon-button svg, .contacts-module .ct-rel-email svg { width: 16px; height: 16px; }

.contacts-module .ct-rel-email.hidden { display: none; }

.contacts-module .ct-rel-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: linear-gradient(135deg,#6a4df5,#7d63f7);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: .16s ease;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  font-size: var(--ct-overlay-meta-size);
  font-weight: var(--ct-overlay-section-title-weight);
  box-shadow: 0 6px 14px rgba(106,77,245,.14);
}

.contacts-module .ct-rel-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-weight: var(--ct-overlay-label-weight);
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: var(--ct-overlay-meta-size);
}

.contacts-module .ct-rel-add svg, .contacts-module .ct-rel-actions button svg { width: 14px; height: 14px; display: block; flex: 0 0 auto; }

.contacts-module .ct-rel-privacy-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 9px;
  background: #e5f5ef;
  color: #16745e;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-privacy-icon svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }

/* 03 — RELATIONSHIP SUMMARY */
.contacts-module .ct-rel-stat-icon.purple { background: #f0ebff; color: #5f43db; }

.contacts-module .ct-rel-stat-icon.amber { background: #fff3d8; color: #9a7214; }

.contacts-module .ct-rel-stat-icon.indigo { background: #eef0ff; color: #5b64c7; }

.contacts-module .ct-rel-stat-card>div { min-width: 0; }

.contacts-module .ct-rel-status-value.yes { color: #14765f; }

.contacts-module .ct-rel-status-value.no { color: #bf5b66; }

.contacts-module .ct-rel-status-value.unknown { color: #81879a; }

.contacts-module .ct-rel-stat-icon.blue, .contacts-module .ct-rel-status-icon.sell { background: #edf3ff; color: #4466c1; }

.contacts-module .ct-rel-stat-card strong { font-size: var(--ct-font-xl); }

.contacts-module .ct-rel-stat-card span { font-size: var(--ct-overlay-meta-size); }

.contacts-module .ct-rel-snapshot { margin-top: 10px; }

.contacts-module .ct-rel-snapshot-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }

.contacts-module .ct-rel-stat-card {
  min-width: 0;
  display: flex;
  align-items: center;
  transition: .15s ease;
  min-height: 64px;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: #f8f8fb;
  box-shadow: none;
}

.contacts-module .ct-rel-stat-card:hover { border-color: transparent; box-shadow: none; background: #f5f4fa; }

.contacts-module .ct-rel-stat-card.overdue { border-color: #f0d8de; background: #fff5f6; }

.contacts-module .ct-rel-stat-card.due { border-color: #f0e2aa; background: #fffaf0; }

.contacts-module .ct-rel-stat-card>div>span {
  display: block;
  color: #7a8193;
  font-weight: var(--ct-overlay-label-weight);
  text-transform: uppercase;
  font-size: var(--ct-overlay-chip-size);
  letter-spacing: .035em;
}

.contacts-module .ct-rel-stat-card>div>strong {
  display: block;
  overflow: hidden;
  color: #232839;
  font-weight: var(--ct-overlay-section-title-weight);
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 3px;
  font-size: var(--ct-overlay-body-size);
  line-height: 1.25;
}

.contacts-module .ct-rel-latest-perception {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  background: #faf9ff;
}

.contacts-module .ct-rel-latest-perception>div>span {
  display: block;
  color: #7c6ed2;
  font-weight: var(--ct-overlay-label-weight);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: var(--ct-overlay-chip-size);
}

.contacts-module .ct-rel-latest-perception p {
  margin: 4px 0 0;
  color: #374055;
  font-weight: var(--ct-overlay-helper-weight);
  margin-top: 3px;
  font-size: var(--ct-overlay-subtitle-size);
  line-height: 1.5;
}

.contacts-module .ct-rel-status-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.contacts-module .ct-rel-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e5e9f2;
  background: #fff;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
}

.contacts-module .ct-rel-status-row>div:first-child strong { display: block; color: #31384b; font-weight: var(--ct-overlay-label-weight); font-size: var(--ct-overlay-subtitle-size); }

.contacts-module .ct-rel-latest-perception.compact {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: #f8f8fb;
}

.contacts-module .ct-rel-latest-perception.compact>span {
  color: #7b8294;
  font-size: var(--ct-overlay-chip-size);
  font-weight: var(--ct-overlay-section-title-weight);
  text-transform: uppercase;
  letter-spacing: .045em;
}

.contacts-module .ct-rel-latest-perception.compact>strong {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: var(--ct-overlay-chip-size);
  font-weight: var(--ct-overlay-section-title-weight);
}

.contacts-module .ct-rel-latest-perception.compact>strong svg { width: 12px; height: 12px; }

.contacts-module .ct-rel-stat-icon.green, .contacts-module .ct-rel-status-icon.buy, .contacts-module .ct-rel-latest-perception.compact.positive>strong { background: #eaf8f4; color: #14765f; }

.contacts-module .ct-rel-latest-perception.compact.neutral>strong { background: #fff8df; color: #8a6b18; }

.contacts-module .ct-rel-latest-perception.compact.negative>strong { background: #fff0f2; color: #b9505d; }

.contacts-module .ct-rel-status-panel.hidden { display: none; }

.contacts-module .ct-rel-status-panel {
  border: 1px solid #e2e6f0;
  background: #fbfcff;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
}

.contacts-module .ct-rel-status-head strong { display: block; color: #283043; font-weight: var(--ct-overlay-label-weight); font-size: var(--ct-overlay-body-size); }

.contacts-module .ct-rel-status-head span {
  display: block;
  margin-top: 2px;
  color: #72798d;
  font-weight: var(--ct-overlay-helper-weight);
  font-size: var(--ct-overlay-meta-size);
}

.contacts-module .ct-rel-status-row>div:first-child small {
  display: block;
  margin-top: 3px;
  color: #747b8f;
  font-size: var(--ct-overlay-meta-size);
  line-height: 1.4;
}

.contacts-module .ct-rel-status-icon {
  display: inline-flex;
  place-items: center;
  flex: 0 0 34px;
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-stat-icon {
  display: inline-flex;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-latest-icon {
  display: inline-flex;
  place-items: center;
  background: #f0ebff;
  color: #5f43db;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-status-icon svg, .contacts-module .ct-rel-stat-icon svg, .contacts-module .ct-rel-latest-icon svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }

.contacts-module .ct-rel-latest-perception svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.8; }

/* 04 — MEETING / FEEDBACK EDITOR */
.contacts-module .ct-rel-control-icon.follow { background: #fff3d9; color: #9b7517; }

.contacts-module .ct-rel-control-copy { display: block; min-width: 0; flex: 1; }

.contacts-module .ct-rel-follow-card { transition: .15s ease; }

.contacts-module .ct-rel-follow-card:not(.enabled) { background: #fafafa; color: #9097a7; }

.contacts-module .ct-rel-follow-card.enabled { border-color: #e6d9a8; background: #fffdf6; }

.contacts-module .ct-rel-follow-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  cursor: pointer;
  color: #596176;
  font-size: var(--ct-overlay-subtitle-size);
  font-weight: var(--ct-overlay-label-weight);
}

.contacts-module .ct-rel-follow-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #6a4df5;
  cursor: pointer;
  flex: 0 0 auto;
}

.contacts-module .ct-rel-follow-toggle span { line-height: 1.2; }

.contacts-module .ct-rel-note-field.feedback .ct-rel-note-icon { background: #edf3ff; color: #4466c1; }

.contacts-module .ct-rel-note-field textarea::placeholder { color: #8c93a5; }

.contacts-module .ct-rel-note-field textarea:focus { border-color: #cbbfff; box-shadow: 0 0 0 3px rgba(106,77,245,.08); }

.contacts-module .ct-rel-segmented button:hover { border-color: #d0c8f5; background: #faf9ff; color: #5f43db; }

.contacts-module .ct-rel-segmented button.active { border-color: #ccc3ff; background: #f2eeff; color: #5a3fd3; box-shadow: inset 0 0 0 1px #dfd8ff; }

.contacts-module .ct-rel-editor-title strong { font-size: var(--ct-font-xl); }

.contacts-module .ct-rel-editor {
  overflow: hidden;
  background: #fff;
  padding: 12px;
  margin-top: 12px;
  border: 1px solid #e2e3eb;
  border-radius: 13px;
  box-shadow: none;
}

.contacts-module .ct-rel-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid #e9eaf1;
  background: #fcfcfe;
}

.contacts-module .ct-rel-editor-title { display: flex; align-items: center; min-width: 0; gap: 9px; }

.contacts-module .ct-rel-editor-title>div>span {
  display: block;
  color: #836fe0;
  font-weight: var(--ct-overlay-label-weight);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: var(--ct-overlay-chip-size);
}

.contacts-module .ct-rel-editor-title>div>strong {
  display: block;
  margin-top: 2px;
  color: #232839;
  font-weight: var(--ct-overlay-section-title-weight);
  font-size: var(--ct-overlay-section-title-size);
}

.contacts-module .ct-rel-editor-title>div>small {
  display: block;
  margin-top: 3px;
  color: #6f768a;
  font-weight: var(--ct-overlay-helper-weight);
  font-size: var(--ct-overlay-chip-size);
}

.contacts-module .ct-rel-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.contacts-module .ct-rel-control-card {
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid #e2e6f0;
  background: #fbfcff;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
}

.contacts-module .ct-rel-control-copy>small {
  display: block;
  color: #788093;
  font-weight: var(--ct-overlay-label-weight);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: var(--ct-overlay-chip-size);
}

.contacts-module .ct-rel-control-copy input {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #232839;
  outline: none;
  font-weight: var(--ct-overlay-label-weight);
  height: 24px;
  margin-top: 2px;
  font-size: var(--ct-overlay-body-size);
}

.contacts-module .ct-rel-notes-grid { gap: 8px; display: grid; grid-template-columns: 1fr; margin-top: 8px; }

.contacts-module .ct-rel-note-field {
  padding: 10px;
  border-radius: 11px;
  display: block;
  border: 1px solid #e2e6f0;
  background: #fff;
}

.contacts-module .ct-rel-note-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 7px; }

.contacts-module .ct-rel-note-head strong { font-size: var(--ct-overlay-subtitle-size); display: block; color: #2e3447; font-weight: var(--ct-overlay-label-weight); }

.contacts-module .ct-rel-note-head small {
  font-size: var(--ct-overlay-chip-size);
  display: block;
  margin-top: 2px;
  color: #72798d;
  font-weight: var(--ct-overlay-helper-weight);
  line-height: 1.35;
}

.contacts-module .ct-rel-note-field textarea {
  width: 100%;
  border: 1px solid #dce1eb;
  background: #fff;
  color: #2b3244;
  outline: none;
  resize: vertical;
  font: var(--ct-overlay-body-weight) var(--ct-overlay-body-size)/1.5 var(--ct-font-family);
  padding: 9px 10px;
  border-radius: 9px;
  font-size: var(--ct-overlay-subtitle-size);
  line-height: 1.5;
}

.contacts-module .ct-rel-segmented { display: flex; flex: 0 0 auto; gap: 5px; }

.contacts-module .ct-rel-segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #dce1ea;
  background: #fff;
  color: #646c80;
  cursor: pointer;
  font-weight: var(--ct-overlay-label-weight);
  height: 31px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: var(--ct-overlay-chip-size);
}

.contacts-module .ct-rel-segmented button svg { width: 10px; height: 10px; display: block; flex: 0 0 auto; }

.contacts-module .ct-rel-perception-panel { padding: 10px; border: 1px solid #e2e6f0; border-radius: 11px; background: #fff; }

.contacts-module .ct-rel-perception-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }

.contacts-module .ct-rel-perception-head strong {
  display: block;
  color: #2e3447;
  font-size: var(--ct-overlay-subtitle-size);
  font-weight: var(--ct-overlay-label-weight);
  line-height: 1.25;
}

.contacts-module .ct-rel-perception-head small {
  display: block;
  margin-top: 2px;
  color: #72798d;
  font-size: var(--ct-overlay-chip-size);
  font-weight: var(--ct-overlay-helper-weight);
  line-height: 1.35;
}

.contacts-module .ct-rel-perception-toggle { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }

.contacts-module .ct-rel-perception-toggle button {
  align-items: center;
  min-width: 0;
  height: 36px;
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #dfe3ec;
  border-radius: 9px;
  background: #fff;
  color: #697184;
  cursor: pointer;
  font: 700 10.5px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  transition: border-color .15s ease,background .15s ease,color .15s ease,box-shadow .15s ease;
}

.contacts-module .ct-rel-perception-toggle button:hover { border-color: #cfc8ed; background: #faf9ff; }

.contacts-module .ct-rel-perception-toggle button.positive.active { border-color: #a9dfcd; background: #eaf8f4; color: #14765f; box-shadow: 0 0 0 2px rgba(20,118,95,.06); }

.contacts-module .ct-rel-perception-toggle button.neutral.active { border-color: #e5d59b; background: #fff8df; color: #8a6b18; box-shadow: 0 0 0 2px rgba(138,107,24,.05); }

.contacts-module .ct-rel-perception-toggle button.negative.active { border-color: #edbec4; background: #fff0f2; color: #b9505d; box-shadow: 0 0 0 2px rgba(185,80,93,.05); }

.contacts-module .ct-rel-mode-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #e2e6f0;
  border-radius: 11px;
  background: #fff;
}

.contacts-module .ct-rel-mode-head { display: flex; align-items: center; gap: 8px; min-width: 150px; }

.contacts-module .ct-rel-mode-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef4ff;
  color: #5576dc;
  line-height: 0;
}

.contacts-module .ct-rel-mode-icon svg { width: 15px; height: 15px; }

.contacts-module .ct-rel-mode-head strong {
  display: block;
  color: #2e3447;
  font-size: var(--ct-overlay-subtitle-size);
  font-weight: var(--ct-overlay-label-weight);
  line-height: 1.2;
}

.contacts-module .ct-rel-mode-head small {
  display: block;
  margin-top: 2px;
  color: #72798d;
  font-size: var(--ct-overlay-meta-size);
  font-weight: var(--ct-overlay-helper-weight);
  line-height: 1.25;
}

.contacts-module .ct-rel-mode-toggle { flex: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }

.contacts-module .ct-rel-mode-toggle button {
  min-width: 0;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #dfe3ec;
  border-radius: 9px;
  background: #fff;
  color: #687184;
  cursor: pointer;
  font: 700 10px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  transition: border-color .15s ease,background .15s ease,color .15s ease,box-shadow .15s ease,transform .15s ease;
}

.contacts-module .ct-rel-mode-toggle button:hover { border-color: #cbc4ef; background: #faf9ff; color: #5640c8; }

.contacts-module .ct-rel-mode-toggle button.active { border-color: #bdb1ff; background: #f0ecff; color: #5f43db; box-shadow: 0 0 0 2px rgba(95,67,219,.06); }

.contacts-module .ct-rel-mode-toggle button svg { width: 13px; height: 13px; flex: 0 0 auto; }

.contacts-module .ct-rel-required-mark { color: #6d4df5; font-weight: var(--ct-weight-black); }

.contacts-module .ct-rel-mode-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0 48px;
  color: #c85162;
  font-size: var(--ct-overlay-chip-size);
  line-height: 1.25;
  font-weight: var(--ct-overlay-label-weight);
}

.contacts-module .ct-rel-editor.hidden, .contacts-module .ct-rel-mode-error.hidden { display: none; }

.contacts-module .ct-rel-mode-error svg { width: 13px; height: 13px; flex: 0 0 13px; stroke-width: 1.8; }

.contacts-module .ct-rel-mode-panel.ct-rel-mode-invalid { border-color: #efb6bf; background: #fffafb; box-shadow: 0 0 0 3px rgba(208,77,96,.055); }

.contacts-module .ct-rel-mode-panel.ct-rel-mode-invalid .ct-rel-mode-toggle button { border-color: #e7c8ce; }

#ctDrawer .ct-rel-follow-card .ct-rel-control-copy { position: relative; display: block; min-width: 0; }

#ctDrawer .ct-rel-follow-toggle {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0 28px 0 0;
  line-height: 1.2;
}

#ctDrawer .ct-rel-follow-toggle span {
  display: block;
  margin: 0;
  padding: 0;
  color: #788093;
  font-size: var(--ct-overlay-chip-size);
  font-weight: var(--ct-overlay-label-weight);
  letter-spacing: .06em;
  line-height: normal;
  text-transform: uppercase;
}

#ctDrawer .ct-rel-follow-toggle input[type="checkbox"] {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: none;
}

.contacts-module .ct-rel-editor-icon {
  display: inline-flex;
  place-items: center;
  flex-basis: 36px;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #e2dcff;
  border-radius: 10px;
  background: #f3f0ff;
  color: #6549dc;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-control-icon {
  display: inline-flex;
  place-items: center;
  flex: 0 0 36px;
  background: #f0ebff;
  color: #5f43db;
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-note-icon {
  display: inline-flex;
  place-items: center;
  flex: 0 0 32px;
  background: #f0ebff;
  color: #5f43db;
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-perception-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #f0ebff;
  color: #5f43db;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-editor-icon svg, .contacts-module .ct-rel-control-icon svg, .contacts-module .ct-rel-note-icon svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }

.contacts-module .ct-rel-perception-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  min-width: 16px;
  min-height: 16px;
}

.contacts-module .ct-rel-perception-toggle button svg {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

/* 05 — MEETING HISTORY */
.contacts-module .ct-rel-history-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.contacts-module .ct-rel-history-date { display: flex; align-items: center; gap: 8px; }

.contacts-module .ct-rel-history-actions { display: flex; gap: 4px; }

.contacts-module .ct-rel-history-actions button:hover { background: #f3f1ff; color: #5f43db; }

.contacts-module .ct-rel-history-chip svg { width: 10px; height: 10px; }

.contacts-module .ct-rel-history-chip.follow { background: #f2efff; color: #624ccc; }

.contacts-module .ct-rel-history-actions button:last-child:hover, .contacts-module .ct-rel-history-chip.no, .contacts-module .ct-rel-history-chip.follow.overdue { background: #fff0f2; color: #bf5b66; }

.contacts-module .ct-rel-history-chip.follow.due { background: #fff8df; color: #97731e; }

.contacts-module .ct-rel-history-note-icon.perception { background: #f0ebff; color: #5f43db; }

.contacts-module .ct-rel-history-note-icon.feedback { background: #edf3ff; color: #4466c1; }

.contacts-module .ct-rel-history-by svg { width: 11px; height: 11px; }

.contacts-module .ct-rel-history-empty.compact { min-height: 60px; padding: 12px; }

.contacts-module .ct-rel-history-empty strong { font-size: var(--ct-overlay-section-title-size); }

.contacts-module .ct-rel-history-empty {
  min-height: 66px;
  padding: 11px 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #556076;
  text-align: left;
  border: 1px dashed #dfe1ea;
  background: #fbfbfd;
}

.contacts-module .ct-rel-history-empty span {
  display: block;
  margin-top: 4px;
  color: #60687d;
  font-size: var(--ct-overlay-meta-size);
  line-height: 1.45;
}

.contacts-module .ct-rel-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ececf3;
}

.contacts-module .ct-rel-history-head>div { display: flex; align-items: center; gap: 9px; }

.contacts-module .ct-rel-history-head>div>div>span {
  display: block;
  margin-top: 0;
  color: #8a7cdc;
  font-size: var(--ct-overlay-chip-size);
  font-weight: var(--ct-overlay-label-weight);
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.contacts-module .ct-rel-history-head>div>div>strong {
  display: block;
  margin-top: 1px;
  color: #22283a;
  font-size: var(--ct-overlay-section-title-size);
  line-height: 1.3;
  font-weight: var(--ct-overlay-section-title-weight);
}

.contacts-module .ct-rel-history { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }

.contacts-module .ct-rel-history-card { padding: 10px; border: 1px solid #e7e8ef; border-radius: 11px; background: #fff; }

.contacts-module .ct-rel-history-date>div>span {
  display: block;
  color: #798094;
  font-weight: var(--ct-overlay-label-weight);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: var(--ct-overlay-chip-size);
}

.contacts-module .ct-rel-history-date>div>strong {
  display: block;
  margin-top: 2px;
  color: #293043;
  font-weight: var(--ct-overlay-label-weight);
  font-size: var(--ct-overlay-subtitle-size);
}

.contacts-module .ct-rel-history-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.contacts-module .ct-rel-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: #f3f4f8;
  color: #687184;
  font-weight: var(--ct-overlay-label-weight);
  min-height: 22px;
  padding: 0 7px;
  font-size: var(--ct-overlay-meta-size);
}

.contacts-module .ct-rel-history-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 9px;
  border-radius: 10px;
  background: #fafafd;
}

.contacts-module .ct-rel-history-note>div>span {
  display: block;
  color: #7e8498;
  font-weight: var(--ct-overlay-label-weight);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: var(--ct-overlay-chip-size);
}

.contacts-module .ct-rel-history-note p {
  margin: 4px 0 0;
  color: #3e475b;
  font-weight: var(--ct-overlay-helper-weight);
  margin-top: 3px;
  font-size: var(--ct-overlay-meta-size);
  line-height: 1.5;
}

.contacts-module .ct-rel-history-by {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8d93a5;
  font-weight: var(--ct-overlay-helper-weight);
  margin-top: 7px;
  font-size: var(--ct-overlay-meta-size);
}

.contacts-module .ct-rel-history-icon {
  display: inline-flex;
  place-items: center;
  flex-basis: 36px;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #e2dcff;
  border-radius: 10px;
  background: #f3f0ff;
  color: #6549dc;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-history-date-icon {
  display: inline-flex;
  place-items: center;
  flex: 0 0 32px;
  background: #f1eeff;
  color: #5f43db;
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-history-note-icon {
  display: inline-flex;
  place-items: center;
  flex: 0 0 28px;
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-history-icon svg, .contacts-module .ct-rel-history-date-icon svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; }

.contacts-module .ct-rel-history-note-icon svg { width: 14px; height: 14px; min-width: 14px; min-height: 14px; }

.contacts-module .ct-rel-history-actions button {
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #81889c;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.contacts-module .ct-rel-history-actions svg { width: 14px; height: 14px; }

.contacts-module .ct-rel-history-chip.yes, .contacts-module .ct-rel-history-chip.perception.positive { background: #eaf8f4; color: #14765f; }

.contacts-module .ct-rel-history-chip.perception.neutral { background: #fff8df; color: #8a6b18; }

.contacts-module .ct-rel-history-chip.perception.negative { background: #fff0f2; color: #b9505d; }

.contacts-module .ct-rel-history-note.legacy-perception { border: 1px dashed #e4e0f4; background: #fcfbff; }

.contacts-module .ct-rel-history-chip.mode { background: #edf3ff; color: #4f69bd; }

.contacts-module .ct-rel-history-chip.perception svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.8; }


/* 06 — MOTION */
@keyframes ctRelSpin{to {transform:rotate(360deg)}}

/* 07 — RESPONSIVE PROFILES */
@media (max-width: 980px) {
  .contacts-module .ct-rel-panel { padding: 1px 0 16px; }
  .contacts-module .ct-rel-snapshot-grid, .contacts-module .ct-rel-date-row { grid-template-columns: 1fr; }
  .contacts-module .ct-rel-status-row { align-items: flex-start; flex-direction: column; }
  .contacts-module .ct-rel-add, .contacts-module .ct-rel-segmented { width: 100%; }
  .contacts-module .ct-rel-segmented button { flex: 1; }
  .contacts-module .ct-rel-utility-row { gap: 10px; margin-bottom: 10px; }
  .contacts-module .ct-rel-utility-actions { width: 100%; gap: 7px; }
  .contacts-module .ct-rel-utility-actions .ct-rel-email, .contacts-module .ct-rel-utility-actions .ct-rel-add { flex: 1 1 0; }
}

@media (max-width: 640px) {
  .contacts-module .ct-rel-perception-toggle { grid-template-columns: 1fr; }
  .contacts-module .ct-rel-perception-toggle button { justify-content: flex-start; padding: 0 12px; }
  .contacts-module .ct-rel-mode-panel { align-items: flex-start; flex-direction: column; }
  .contacts-module .ct-rel-mode-head { min-width: 0; }
  .contacts-module .ct-rel-mode-toggle { width: 100%; }
  #ctDrawer #ctRelationshipPanel {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }
  #ctDrawer #ctRelSnapshot { margin: 0; }
  #ctDrawer .ct-rel-stat-card { min-height: 56px; gap: 7px; padding: 8px 9px; border-radius: 11px; }
  #ctDrawer .ct-rel-stat-icon { width: 29px; height: 29px; flex: 0 0 29px; border-radius: 8px; }
  #ctDrawer .ct-rel-stat-icon svg { width: 14px; height: 14px; }
  #ctDrawer .ct-rel-stat-card>div>span { font-size: var(--ct-overlay-chip-size); letter-spacing: .025em; }
  #ctDrawer .ct-rel-stat-card>div>strong { margin-top: 2px; font-size: var(--ct-overlay-subtitle-size); line-height: 1.2; }
  #ctDrawer .ct-rel-latest-perception.compact { min-height: 34px; margin-top: 7px; padding: 6px 8px; }
  #ctDrawer .ct-rel-editor { margin-top: 8px; border-radius: 12px; }
  #ctDrawer .ct-rel-editor-head { min-height: 48px; padding: 8px 9px; }
  #ctDrawer .ct-rel-editor-icon { width: 30px; height: 30px; flex-basis: 30px; }
  #ctDrawer .ct-rel-editor-title { gap: 7px; }
  #ctDrawer .ct-rel-editor-title>div>strong { font-size: var(--ct-overlay-body-size); }
  #ctDrawer .ct-rel-icon-button { width: 30px; height: 30px; }
  #ctDrawer #ctMeetingForm { padding: 9px; }
  #ctDrawer #ctRelSnapshot .ct-rel-snapshot-grid, #ctDrawer .ct-rel-date-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  #ctDrawer .ct-rel-mode-panel { display: block; margin-top: 7px; padding: 8px; border-radius: 10px; }
  #ctDrawer .ct-rel-mode-head { min-width: 0; margin-bottom: 7px; }
  #ctDrawer .ct-rel-mode-toggle { width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  #ctDrawer .ct-rel-mode-toggle button { height: 32px; padding: 0 5px; font-size: var(--ct-overlay-meta-size); }
  #ctDrawer .ct-rel-mode-error { margin: 5px 0 0; font-size: var(--ct-overlay-chip-size); }
  #ctDrawer .ct-rel-notes-grid { gap: 7px; margin-top: 7px; }
  #ctDrawer .ct-rel-note-head { gap: 6px; margin-bottom: 6px; }
  #ctDrawer .ct-rel-note-field textarea { min-height: 72px; padding: 8px; font-size: var(--ct-overlay-subtitle-size); line-height: 1.4; }
  #ctDrawer .ct-rel-note-field, #ctDrawer .ct-rel-perception-panel { padding: 8px; border-radius: 10px; }
  #ctDrawer .ct-rel-perception-head { gap: 6px; margin-bottom: 7px; }
  #ctDrawer .ct-rel-mode-head strong, #ctDrawer .ct-rel-note-head strong, #ctDrawer .ct-rel-perception-head strong { font-size: var(--ct-overlay-meta-size); }
  #ctDrawer .ct-rel-perception-toggle { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  #ctDrawer .ct-rel-perception-toggle button { height: 32px; justify-content: center; padding: 0 5px; font-size: var(--ct-overlay-meta-size); }
  #ctDrawer .ct-rel-status-panel { margin-top: 7px; padding: 8px; border-radius: 10px; }
  #ctDrawer .ct-rel-status-head { margin-bottom: 6px; }
  #ctDrawer .ct-rel-status-head span { font-size: var(--ct-overlay-chip-size); }
  #ctDrawer .ct-rel-status-row { gap: 7px; padding: 7px; }
  #ctDrawer .ct-rel-editor-title>div>small, #ctDrawer .ct-rel-mode-head small, #ctDrawer .ct-rel-note-head small, #ctDrawer .ct-rel-perception-head small, #ctDrawer .ct-rel-status-row>div:first-child small { display: none; }
  #ctDrawer .ct-rel-segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
  #ctDrawer .ct-rel-segmented button { height: 30px; padding: 0 4px; font-size: var(--ct-overlay-chip-size); }
  #ctDrawer .ct-rel-actions { margin-top: 7px; }
  #ctDrawer .ct-rel-actions button { height: 35px; font-size: var(--ct-overlay-meta-size); }
  #ctDrawer .ct-rel-history-head { margin: 0; padding: 2px 0 8px; border-top: 0; }
  #ctDrawer .ct-rel-history-head>div { gap: 8px; }
  #ctDrawer .ct-rel-history-icon { width: 31px; height: 31px; flex-basis: 31px; }
  #ctDrawer .ct-rel-history-head>div>div>strong { font-size: var(--ct-overlay-section-title-size); }
  #ctDrawer .ct-rel-count { min-width: 24px; height: 22px; padding: 0 6px; font-size: var(--ct-overlay-chip-size); }
  #ctDrawer .ct-rel-history { gap: 7px; margin-top: 0; }
  #ctDrawer .ct-rel-history-empty, #ctDrawer .ct-rel-history-empty.compact {
    min-height: 54px;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 11px;
    font-size: var(--ct-overlay-meta-size);
    text-align: left;
  }
  #ctDrawer .ct-rel-history-empty svg { width: 17px; height: 17px; flex: 0 0 17px; }
  #ctDrawer .ct-rel-history-empty span { margin: 0; font-size: var(--ct-overlay-meta-size); line-height: 1.3; }
  #ctDrawer .ct-rel-history-card { padding: 9px; border-radius: 11px; }
  #ctDrawer .ct-rel-mode-icon, #ctDrawer .ct-rel-note-icon, #ctDrawer .ct-rel-perception-icon, #ctDrawer .ct-rel-history-date-icon { width: 27px; height: 27px; flex-basis: 27px; }
  #ctDrawer .ct-rel-editor-title>div>span, #ctDrawer .ct-rel-history-head>div>div>span, #ctDrawer .ct-rel-history-date>div>span { font-size: var(--ct-overlay-chip-size); }
  #ctDrawer .ct-rel-history-date>div>strong { font-size: var(--ct-overlay-meta-size); }
  #ctDrawer .ct-rel-history-chips { gap: 4px; margin-top: 6px; }
  #ctDrawer .ct-rel-history-chip { min-height: 21px; padding: 0 6px; font-size: var(--ct-overlay-chip-size); }
  #ctDrawer .ct-rel-history-note { gap: 6px; margin-top: 6px; padding: 7px; }
  #ctDrawer .ct-rel-history-note p { font-size: var(--ct-overlay-meta-size); line-height: 1.4; }
  #ctDrawer .ct-rel-control-card { gap: 6px; padding: 6px 8px; border-radius: 10px; }
  #ctDrawer .ct-rel-control-icon { width: 24px; height: 24px; flex-basis: 24px; border-radius: 8px; }
  #ctDrawer .ct-rel-control-icon svg { width: 13px; height: 13px; }
  #ctDrawer .ct-rel-control-copy>small { font-size: var(--ct-overlay-chip-size); line-height: 1.1; }
  #ctDrawer .ct-rel-control-copy input { height: 18px; margin-top: 2px; font-size: var(--ct-overlay-meta-size); line-height: 1.1; }
  #ctDrawer .ct-rel-follow-card .ct-rel-control-copy {
    position: relative;
    display: block;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
  }
  #ctDrawer .ct-rel-follow-toggle {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0 22px 0 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    line-height: 1;
  }
  #ctDrawer .ct-rel-follow-toggle span {
    display: block;
    margin: 0;
    padding: 0;
    color: #788093;
    font-size: var(--ct-overlay-chip-size);
    font-weight: var(--ct-overlay-label-weight);
    letter-spacing: .06em;
    line-height: 1.1;
    text-transform: uppercase;
  }
  #ctDrawer .ct-rel-follow-toggle input[type="checkbox"] {
    position: absolute;
    top: -4px;
    right: 0;
    width: 15px;
    height: 15px;
    margin: 0;
    padding: 0;
    order: 2;
    flex: 0 0 15px;
  }
  #ctDrawer #ctRelFollowup {
    display: block;
    width: 100%;
    height: 18px;
    margin-top: 2px;
    padding: 0;
    font-size: var(--ct-overlay-meta-size);
    line-height: 1.1;
  }
}

/* 08 — ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
  .contacts-module .ct-rel-panel *, .contacts-module .ct-rel-editor * {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
