.crm-task-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid #d8e3e8;
  border-radius: 16px;
  color: var(--ink, #19364b);
  background: #fff;
  box-shadow: 0 24px 90px #16384d33;
  overflow: auto;
}
.crm-task-dialog::backdrop {
  background: #132d4166;
  backdrop-filter: blur(2px);
}
.crm-task-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid #e1e9ed;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.crm-task-dialog-heading h2 {
  font-size: 24px;
  margin: 0;
  letter-spacing: -0.5px;
}
.crm-task-dialog-heading button {
  font-size: 27px;
  line-height: 1;
  padding: 5px 11px;
  border-color: transparent;
  min-height: 36px;
}
.crm-task-dialog [data-task-dialog-body] {
  padding: 24px 26px;
}
.crm-task-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.crm-task-wide {
  grid-column: 1/-1;
}
.crm-task-form .field {
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.crm-task-form .field input,
.crm-task-form .field select,
.crm-task-form .field textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #cbdbe2;
  border-radius: 7px;
  min-height: 43px;
  color: inherit;
  background: #fff;
}
.crm-task-form textarea {
  resize: vertical;
  min-height: 96px;
}
.crm-task-form .field small {
  font-size: 12px;
  color: #627989;
  line-height: 1.5;
}
.crm-task-form .field > span,
.crm-task-form .field > label {
  font-weight: 650;
  font-size: 14px;
}
.crm-task-form output {
  min-height: 43px;
  display: flex;
  align-items: center;
}
.crm-task-form .field > span > small {
  font-weight: 400;
}
.crm-task-schedule {
  margin: 24px 0 0;
  padding: 18px;
  border: 1px solid #dbe6eb;
  border-radius: 10px;
  min-width: 0;
}
.crm-task-schedule legend {
  font-weight: 700;
  padding: 0 7px;
}
.crm-task-type {
  display: flex;
  gap: 24px;
  margin: 0 0 18px;
}
.crm-task-type label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}
.crm-task-type input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--practice-primary, #087f8c);
}
.crm-task-form [hidden],
.crm-task-dialog [hidden] {
  display: none !important;
}
.crm-task-help {
  font-size: 13px;
  line-height: 1.6;
  color: #5d7586;
  margin: 14px 0 0;
}
.crm-task-preview {
  background: #edf8f8;
  border: 1px solid #d5ecec;
  border-radius: 8px;
  padding: 14px 16px;
  color: #24465a;
  font-size: 13px;
}
.crm-task-preview ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.crm-task-preview li {
  padding-left: 12px;
  position: relative;
}
.crm-task-preview li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--practice-primary, #087f8c);
}
.crm-task-preview p {
  margin: 8px 0 0;
}
.crm-task-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e1e9ed;
  padding-top: 20px;
  margin-top: 24px;
}
.crm-task-error {
  color: #a93535;
  line-height: 1.6;
  font-size: 14px;
}
.crm-task-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.crm-task-detail h3 {
  font-size: 22px;
  margin: 0;
  overflow-wrap: anywhere;
}
.crm-task-metadata {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}
.crm-task-metadata dt {
  font-size: 12px;
  color: #637e8e;
  margin-bottom: 6px;
}
.crm-task-metadata dd {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  overflow-wrap: anywhere;
}
.crm-task-description {
  padding: 20px 0;
  border-top: 1px solid #e1e9ed;
}
.crm-task-description h4 {
  margin: 0 0 10px;
  font-size: 15px;
}
.crm-task-description p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
  margin: 0;
  font-size: 14px;
  color: #476176;
}
.crm-task-detail .task-status {
  white-space: nowrap;
}
.task-status.complete {
  color: #26754f;
}
.task-status.complete:before {
  background: #26754f;
}
.task-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.task-completed-note {
  margin: 0 0 14px;
  color: #627989;
  font-size: 13px;
}
.task-load-more {
  display: block;
  margin: 20px auto 0;
}
.task-table .task-action button[data-view-task] {
  border: 0;
  background: transparent;
  color: #007e8d;
  font-size: inherit;
  font-weight: 600;
  white-space: nowrap;
  padding: 8px 0;
}
.task-table .task-action button[data-view-task]:hover {
  text-decoration: underline;
}
.client-manual-task-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}
.client-manual-task-heading h3 {
  margin: 0;
}
@media (max-width: 600px) {
  .crm-task-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 12px;
  }
  .crm-task-dialog-heading {
    padding: 18px;
  }
  .crm-task-dialog [data-task-dialog-body] {
    padding: 18px;
  }
  .crm-task-field-grid,
  .crm-task-metadata {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .crm-task-wide {
    grid-column: auto;
  }
  .crm-task-schedule {
    padding: 14px;
  }
  .crm-task-detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .crm-task-dialog-actions {
    flex-wrap: wrap;
  }
  .crm-task-dialog-actions button {
    flex: 1;
  }
  .task-heading-actions {
    gap: 8px;
  }
  .task-heading-actions .primary {
    font-size: 13px;
    padding: 9px 12px;
  }
  .crm-task-dialog .field input,
  .crm-task-dialog .field select,
  .crm-task-dialog .field textarea {
    font-size: 16px;
  }
  .crm-task-dialog-heading h2 {
    font-size: 22px;
  }
}

#task-results .empty p {
  margin-left: 0;
  margin-right: 0;
}

.crm-task-dialog-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 2;
  margin: 24px -26px -24px;
  padding: 16px 26px;
  box-shadow: 0 -5px 14px #19364b05;
}
@media (max-width: 600px) {
  .crm-task-dialog-actions {
    margin: 24px -18px -18px;
    padding: 14px 18px;
  }
}
