/* Adapted from CRM-For-Crist relationship-flow-ui.js @ 76d746d3. */

dialog.rf-dialog {
  box-sizing: border-box;
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px);
  max-width: none;
  padding: 0;
  border: 1px solid #d5e2dc;
  border-radius: 14px;
  background: #fff;
  color: #193c32;
  font:
    15px/1.5 system-ui,
    sans-serif;
  overflow: auto;
}
dialog.rf-dialog::backdrop {
  background: #15362e88;
}
.rf-dialog * {
  box-sizing: border-box;
}
.rf-head,
.rf-body {
  padding: 20px 24px;
}
.rf-head {
  display: block;
  max-width: none;
  margin: 0;
  border-bottom: 1px solid #dce6e0;
}
.rf-head h2 {
  margin: 0;
  font-size: 22px;
}
.rf-sub {
  margin: 5px 0;
  color: #526c61;
  font-size: 13px;
}
.rf-dialog h3 {
  font-size: 17px;
  margin: 8px 0 12px;
}
.rf-dialog p {
  overflow-wrap: anywhere;
}
.rf-dialog button {
  font: inherit;
  min-height: 42px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #b7cec1;
  border-radius: 7px;
  color: #193c32;
  white-space: normal;
}
.rf-dialog button:not(:disabled) {
  cursor: pointer;
}
.rf-dialog button:disabled {
  opacity: 0.5;
  cursor: default;
}
.rf-dialog .rf-primary {
  background: #236b59;
  color: white;
  border-color: #236b59;
}
.rf-dialog input[type="checkbox"],
.rf-dialog input[type="radio"] {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  accent-color: #236b59;
}
.rf-dialog input[type="search"],
.rf-dialog textarea {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #aac1b5;
  border-radius: 7px;
  font: inherit;
}
.rf-dialog textarea {
  min-height: 86px;
}
.rf-dialog label {
  display: block;
}
.rf-choice {
  display: flex !important;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 12px 0;
  border-bottom: 1px solid #e1e8e4;
}
.rf-choice > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.rf-choice small {
  display: block;
  color: #526c61;
}
.rf-family-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.rf-family-grid > .rf-family {
  margin: 0;
}
.rf-family,
.rf-field {
  border: 1px solid #d9e5de;
  border-radius: 9px;
  padding: 14px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.rf-field legend {
  padding: 0 5px;
  font-weight: 600;
}
.rf-field .rf-choice:last-child {
  border: 0;
}
.rf-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  background: #fff;
  border-top: 1px solid #dce6e0;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
}
.rf-actions .rf-cancel {
  margin-right: auto;
}
.rf-error {
  color: #9c2c32;
  padding: 0 24px;
  white-space: pre-wrap;
}
.rf-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.rf-from {
  background: #fff6e6;
}
.rf-to {
  background: #edf7f1;
}
.rf-arrow {
  font-size: 28px;
  text-align: center;
  color: #236b59;
}
.rf-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.rf-members {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.rf-members li {
  padding: 5px 0;
  overflow-wrap: anywhere;
}
.rf-after {
  border: 2px solid #236b59;
  border-radius: 9px;
  padding: 14px;
}
.rf-after .rf-members {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 12px;
}
.rf-member {
  border-bottom: 1px solid #dce6e0;
  padding: 10px 0 !important;
}
.rf-member small {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.rf-final-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rf-final-fields > div {
  padding: 10px;
  border: 1px solid #dce6e0;
  border-radius: 7px;
  overflow-wrap: anywhere;
}
.rf-final-fields p {
  margin: 5px 0;
}
.rf-note {
  white-space: pre-wrap;
}
.rf-incoming {
  color: #855216;
}
.rf-records {
  margin: 10px 0;
  padding: 0;
  list-style: none;
}
.rf-records small {
  display: block;
}
.rf-records li {
  padding: 7px 0;
  border-bottom: 1px solid #e3eae6;
}
.rf-dialog details {
  margin: 14px 0;
}
.rf-dialog summary {
  min-height: 42px;
  padding: 8px 0;
  cursor: pointer;
}
.rf-policy {
  padding: 10px 0;
  border-bottom: 1px solid #e1e8e4;
}
.rf-policy p {
  margin: 4px 0;
}
.rf-check {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 14px 0;
}
.rf-step {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #526c61;
  font-size: 13px;
  margin-top: 12px;
}
.rf-step strong {
  color: #236b59;
}
.rf-dialog [hidden] {
  display: none !important;
}
@media (max-width: 520px) {
  .rf-head,
  .rf-body {
    padding: 16px;
  }
  .rf-actions {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .rf-actions .rf-primary {
    flex: 1;
    min-width: 55%;
  }
  .rf-flow {
    grid-template-columns: minmax(0, 1fr);
  }
  .rf-arrow:not(.rf-down) {
    transform: rotate(90deg);
    line-height: 1;
  }
  .rf-after .rf-members,
  .rf-final-fields,
  .rf-family-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .rf-step {
    font-size: 12px;
  }
  .rf-dialog input[type="search"],
  .rf-dialog textarea {
    font-size: 16px;
  }
  .rf-dialog button {
    min-height: 44px;
  }
  .rf-field {
    padding: 10px;
  }
}

.rf-dialog select {
  padding: 10px;
  width: 100%;
  font: inherit;
}
.rf-discard {
  padding: 16px;
  background: #fff6e6;
}

.family-extra-contacts {
  margin-top: 20px;
  border-top: 1px solid #dce6e0;
  padding-top: 14px;
}
.family-extra-contacts h4 {
  margin: 0 0 10px;
  color: #526c61;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.family-contact {
  padding: 12px 0;
  border-bottom: 1px solid #e3eae6;
  overflow-wrap: anywhere;
}
.family-contact:last-child {
  border-bottom: 0;
}
.family-contact-heading {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.family-contact p {
  margin: 5px 0;
  font-size: 13px;
}
.family-contact-note {
  white-space: pre-wrap;
}
.family-contact-fields {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #dce6e0;
  border-radius: 9px;
}
.family-contact-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
@media (max-width: 520px) {
  .family-contact-inputs {
    grid-template-columns: minmax(0, 1fr);
  }
}
