/* People card: one scrolling body, fixed header and non-overlapping action footer.
   Scoped to recruiting/onboarding/offboarding task drawers only. */
.task-modal:has(.task-drawer) .task-drawer {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.task-modal:has(.task-drawer) .task-drawer .drawer-head,
.task-modal:has(.task-drawer) .task-drawer .drawer-title {
  flex: 0 0 auto;
}
.task-modal:has(.task-drawer) .task-drawer .drawer-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.task-modal:has(.task-drawer) .task-drawer .drawer-main,
.task-modal:has(.task-drawer) .task-drawer .drawer-side {
  min-width: 0;
  box-sizing: border-box;
  padding-bottom: 44px;
}
.task-modal:has(.task-drawer) .task-drawer .drawer-footer {
  position: relative;
  bottom: auto;
  flex: 0 0 auto;
  margin: 0;
  z-index: 2;
  box-shadow: none;
}

/* Historical and new CRM notes displayed above Activity. */
.task-drawer .crm-notes-section { padding-top: 18px; }
.task-drawer .crm-notes-form { margin: 0 0 16px; }
.task-drawer .crm-notes-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 78px;
  max-height: 220px;
  display: block;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  outline: none;
  background: var(--bg-inset);
  color: var(--text-primary);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.5;
}
.task-drawer .crm-notes-form textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.task-drawer .crm-notes-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.task-drawer .crm-notes-actions small {
  font-size: 10.5px;
  color: var(--text-tertiary);
}
.task-drawer .crm-notes-actions .access-primary {
  min-height: 31px;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}
.task-drawer .crm-notes-actions .access-primary:disabled { opacity: .55; cursor:wait; }
.task-drawer #crmNotesError,
.task-drawer .crm-notes-warning {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--danger-text);
}
.task-drawer .crm-notes-timeline { display: grid; gap: 8px; }
.task-drawer .crm-note-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-surface);
}
.task-drawer .crm-note-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.task-drawer .crm-note-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 700;
}
.task-drawer .crm-note-author { flex: 1; min-width: 0; }
.task-drawer .crm-note-author strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 650;
}
.task-drawer .crm-note-author time {
  display: block;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 10.5px;
}
.task-drawer .crm-note-source {
  color: var(--text-tertiary);
  font-size: 9.5px;
  white-space: nowrap;
}
.task-drawer .crm-note-text {
  margin: 9px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.52;
}
.task-drawer .crm-notes-toggle {
  display: block;
  margin: 9px 0 0;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-raised);
  color: var(--accent-text);
  text-align: center;
  font-size: 11px;
  cursor: pointer;
}
.task-drawer .crm-notes-toggle[hidden] { display:none; }
.task-drawer .crm-notes-toggle:hover { border-color: var(--border-strong); }

@media (max-width: 760px) {
  .task-modal:has(.task-drawer) .task-drawer { width: min(100vw, 100%); }
  .task-modal:has(.task-drawer) .task-drawer .drawer-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-modal:has(.task-drawer) .task-drawer .drawer-main {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .task-modal:has(.task-drawer) .task-drawer .drawer-main,
  .task-modal:has(.task-drawer) .task-drawer .drawer-side {
    padding-left: 16px;
    padding-right: 16px;
  }
}
