/* Participant care team (v1131) — the Care team card on a participant's Profile and the Manage care team editor.
   portal/js/client-care-team.js. Colours come from the portal tokens so the themes carry through. */

/* ---- Profile card ---------------------------------------------------------------------------------------------- */
.ct-loading { font-size: 13px; color: var(--muted); }
.ct-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 22px; }
.ct-group-h {
  font-size: 10px; font-weight: 700; color: var(--teal-dark, var(--teal));
  text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 6px;
}
.ct-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ct-member {
  padding: 8px 10px; border-radius: var(--radius-sm, 6px);
  background: var(--bg); border-left: 3px solid var(--teal-soft, var(--border));
  min-width: 0; overflow-wrap: anywhere;
}
.ct-role { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.ct-who { font-size: 13px; color: var(--ink); margin-top: 1px; }
.ct-none { color: var(--muted); font-style: italic; }
.ct-reach { font-size: 13px; margin-top: 2px; }
.ct-dot { color: var(--muted); margin: 0 6px; }
.ct-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ct-notes { font-size: 12.5px; color: var(--ink); margin-top: 4px; white-space: pre-wrap; line-height: 1.45; }
.ct-actions { margin-top: 10px; }

/* ---- Editor ---------------------------------------------------------------------------------------------------- */
.ct-modal { max-width: 980px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.ct-modal .modal-header { padding: 18px 22px 12px; }
.ct-modal-body {
  display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 0;
  flex: 1 1 auto; min-height: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.ct-pick, .ct-details { min-height: 0; overflow-y: auto; padding: 14px 18px; max-height: calc(100dvh - 220px); }
.ct-pick { border-right: 1px solid var(--border); background: var(--bg); }
.ct-pane-h { font-size: 12px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.ct-pane-sub { font-weight: 500; color: var(--muted); }
.ct-search {
  width: 100%; padding: 8px 10px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
  font: inherit; font-size: 14px; background: var(--card); color: var(--ink);
}
.ct-search:focus { outline: none; border-color: var(--teal); }
.ct-pick-group { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.ct-pick-group legend {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; padding: 0; margin-bottom: 4px;
}
.ct-pick-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px;
  font-size: 13.5px; color: var(--ink); cursor: pointer; line-height: 1.3;
}
.ct-pick-item:hover { background: var(--teal-soft); }
.ct-pick-item input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--teal); }
.ct-pick-item:has(input:checked) { font-weight: 600; }
.ct-pick-item[hidden], .ct-pick-group[hidden] { display: none; }
.ct-count {
  margin-left: auto; font-size: 11px; font-weight: 700; color: var(--teal-dark, var(--teal));
  background: var(--teal-soft); border-radius: 999px; padding: 1px 7px;
}

.ct-empty { font-size: 13px; color: var(--muted); font-style: italic; padding: 24px 4px; }
.ct-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); padding: 10px 14px 12px; margin-bottom: 10px; }
.ct-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ct-card-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ct-card-tools { display: flex; gap: 12px; flex: 0 0 auto; }
.ct-link {
  background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--teal); cursor: pointer;
}
.ct-link:hover { text-decoration: underline; }
.ct-link.ct-danger { color: var(--danger); }
.ct-card-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.ct-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ct-f-wide { grid-column: 1 / -1; }
.ct-f > span { font-size: 11px; font-weight: 600; color: var(--muted); }
.ct-f > span em { font-style: normal; color: var(--danger); font-weight: 500; }
.ct-f input, .ct-f textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
  font: inherit; font-size: 14px; background: var(--card); color: var(--ink);
}
.ct-f textarea { resize: vertical; min-height: 54px; line-height: 1.45; }
.ct-f input:focus, .ct-f textarea:focus { outline: none; border-color: var(--teal); }

.ct-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 22px; }
.ct-status { margin-right: auto; font-size: 12.5px; color: var(--muted); }

@media (max-width: 768px) {
  .ct-modal-body { grid-template-columns: 1fr; overflow-y: auto; }
  .ct-modal-body { grid-template-rows: auto auto; align-content: start; }
  .ct-pick, .ct-details { max-height: none; min-height: auto; overflow: visible; }
  .ct-pick { border-right: 0; border-top: 1px solid var(--border); }
  .ct-details { order: -1; }   /* phones: what they have first, the long list of roles under it */
  .ct-card-fields { grid-template-columns: 1fr; }
  .ct-footer { flex-wrap: wrap; }
  .ct-status { flex-basis: 100%; }
}
.ct-reach a { color: var(--teal-dark, var(--teal)); text-decoration: none; font-weight: 500; }
.ct-reach a:hover { text-decoration: underline; }
.ct-empty-note { margin-bottom: 12px; }

/* v1133 shared contacts: type-ahead under the Name box, the "saved contact" note, and the contacts page. */
.ct-f-name { position: relative; }
.ct-suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  max-height: 260px; overflow-y: auto;
}
.ct-suggest[hidden] { display: none; }
.ct-sug-h { padding: 4px 8px 2px; font: 600 11px var(--font-body); color: var(--muted); }
.ct-sug {
  display: block; width: 100%; text-align: left; padding: 7px 8px; border: 0; border-radius: 6px; background: none;
  font: 13px var(--font-body); color: var(--ink); cursor: pointer;
}
.ct-sug b { display: block; font-weight: 600; }
.ct-sug span { display: block; font-size: 12px; color: var(--muted); }
.ct-sug:hover:not([disabled]), .ct-sug.on { background: var(--teal-soft); }
.ct-sug[disabled] { opacity: .55; cursor: default; }
.ct-linked {
  margin-top: 8px; padding: 7px 10px; border-radius: 6px; background: var(--teal-soft);
  font-size: 12.5px; color: var(--ink); line-height: 1.45;
}
.ct-linked[hidden] { display: none; }
.ct-linked b { color: var(--teal-dark); }

.ct-contacts-modal { max-width: 860px; }
.ct-contacts-body { max-height: calc(100dvh - 220px); overflow-y: auto; }
.ct-contacts-intro { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.ct-contacts-body .ct-groups, .ct-contacts-body .ct-group { margin-bottom: 14px; }
.ct-cc-top { display: flex; gap: 12px; align-items: flex-start; }
.ct-cc-main { flex: 1 1 auto; min-width: 0; }
.ct-cc-acts { display: flex; gap: 12px; flex: 0 0 auto; }
.ct-cc-edit { margin-top: 10px; }
.ct-cc-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.ct-cc-merge { margin-top: 10px; display: grid; gap: 8px; }
.ct-cc-merge select { padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; }
@media (max-width: 640px) {
  .ct-cc-top { flex-direction: column; }
}

/* v1134: phone numbers never split across lines; links look the same in the editor, the profile and the contacts page. */
.ct-reach a { text-decoration: none !important; }
.ct-reach a[href^="tel:"] { white-space: nowrap; }
.ct-reach a[href^="mailto:"] { overflow-wrap: anywhere; }
