.profiles-heading,
.profiles-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.profiles-heading {
  margin: 24px 0 18px;
}
.profiles-heading h1 {
  font-size: 28px;
  margin: 0;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.profile-stats article {
  background: #fff;
  border: 1px solid #d7e0ec;
  border-radius: 6px;
  padding: 18px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-stats strong {
  font-size: 26px;
  color: #172033;
}
.profile-stats span {
  font-size: 14px;
  color: #526273;
}
.profiles-directory {
  background: #fff;
  border-top: 1px solid #d7e0ec;
  padding: 22px 0;
}
.profiles-toolbar {
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.profiles-toolbar h2 {
  font-size: 20px;
  margin-right: auto;
}
.profiles-toolbar label {
  font-size: 13px;
}
.profiles-toolbar input,
.profiles-toolbar select {
  margin: 0;
  min-height: 40px;
}
.profiles-table-scroll {
  overflow: auto;
  max-width: 100%;
}
.profiles-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
.profiles-table th {
  font-size: 12px;
  text-transform: none;
  color: #526273;
  background: #f5f8fa;
  white-space: nowrap;
}
.profiles-table th,
.profiles-table td {
  padding: 16px 10px;
  border-bottom: 1px solid #e3e8ee;
  text-align: left;
  vertical-align: top;
}
.profiles-table td:first-child {
  min-width: 220px;
}
.profiles-table td:nth-child(2) {
  min-width: 150px;
}
.profiles-table td:nth-child(3) {
  min-width: 155px;
}
.profiles-table td:last-child {
  min-width: 100px;
}
.profile-identity {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.profile-identity img,
.profile-initial {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
}
.profile-initial {
  display: grid;
  place-items: center;
  background: #e7f3f1;
  color: #12665d;
  font-weight: bold;
}
.profile-identity strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.profile-identity a {
  display: block;
  font-size: 12px;
  max-width: 185px;
  overflow-wrap: anywhere;
}
.profile-badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 6px;
  background: #f0f3f6;
  color: #425466;
  border-radius: 4px;
  margin: 3px 0;
}
.profile-badge.success {
  background: #e7f5ee;
  color: #176241;
}
.profile-badge.warning {
  background: #fff1db;
  color: #8e5308;
}
.profile-cell-note {
  display: block;
  font-size: 11px;
  color: #526273;
}
.due-diligence summary {
  color: #8e5308;
  cursor: pointer;
}
.due-diligence ul {
  padding-left: 16px;
  margin-top: 8px;
  font-size: 12px;
  max-width: 180px;
}
.profile-edit-button {
  padding: 5px 9px;
  min-height: 32px;
  border-radius: 4px;
}
.profile-menu {
  margin-top: 6px;
}
.profile-menu summary {
  cursor: pointer;
  color: #2457ad;
  padding: 4px 0;
}
.profile-menu > div {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  margin: 5px 0;
  border-left: 2px solid #d7e0ec;
  padding-left: 6px;
}
.profile-menu button {
  background: transparent;
  color: #2457ad;
  border: 0;
  border-radius: 0;
  padding: 5px 3px;
  min-height: 30px;
  text-align: left;
  font-size: 12px;
}
.profile-menu button:hover {
  background: #f0f4f8;
}
.profile-menu .danger-action {
  color: #b42318;
}
.profile-action-notice,
.editor-alert {
  padding: 14px;
  background: #fff4e7;
  color: #743d0b;
  border: 1px solid #f0d1a4;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.midwife-modal {
  width: min(1120px, calc(100% - 32px));
  max-width: 1120px;
  max-height: 92vh;
  border: 1px solid #cdd6df;
  border-radius: 8px;
  padding: 0;
  color: #172033;
  box-shadow: 0 18px 60px #17203340;
}
.midwife-modal::backdrop {
  background: #17203385;
}
.editor-header {
  position: sticky;
  top: 0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #d7e0ec;
  padding: 18px 24px;
  z-index: 2;
}
.editor-header h2 {
  font-size: 22px;
  margin: 0;
}
.editor-header button {
  min-height: 36px;
  padding: 6px 12px;
}
.editor-alert {
  margin: 16px 24px;
}
.editor-account,
.editor-password {
  padding: 20px 24px;
  border-bottom: 1px solid #d7e0ec;
  background: #f9fbfc;
}
.midwife-modal h3 {
  font-size: 18px;
  margin: 0 0 18px;
}
.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.editor-field label {
  font-size: 13px;
  margin-bottom: 6px;
}
.editor-field input,
.editor-field select,
.editor-field textarea {
  min-width: 0;
  width: 100%;
  font-size: 14px;
  padding: 10px;
  margin: 0;
  min-height: 40px;
  border-radius: 4px;
}
.editor-field {
  margin-bottom: 16px;
  min-width: 0;
}
.editor-field textarea {
  height: 90px;
}
.editor-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 24px;
}
.editor-columns > section {
  min-width: 0;
}
.editor-columns > section + section {
  border-left: 1px solid #e3e8ee;
  padding-left: 28px;
}
.character-counter {
  display: block;
  text-align: right;
  font-size: 12px;
  color: #667085;
}
.profile-url {
  overflow-wrap: anywhere;
  margin: 5px 0;
}
.field-error {
  display: block;
  color: #b42318;
  font-size: 12px;
}
.editor-field [aria-invalid="true"] {
  border-color: #b42318;
}
.editor-photo {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin: 12px 0;
}
.editor-photo.hidden {
  display: none;
}
.onboarding-checklist {
  border: 0;
  padding: 0;
  margin: 24px 0;
}
.onboarding-checklist legend {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
}
.onboarding-checklist .checkbox-row {
  font-size: 13px;
  align-items: flex-start;
}
.session-line {
  background: #eef6f5;
  border-left: 3px solid #26877b;
  padding: 12px;
  font-size: 13px;
  color: #175c53;
}
.editor-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid #d7e0ec;
  z-index: 2;
}
.editor-footer button {
  border-radius: 4px;
}
.editor-password input[type="password"] {
  max-width: 420px;
}
.draft-preview {
  padding: 28px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.draft-preview h3 {
  font-size: 24px;
}
.midwife-modal button:focus-visible,
.profile-menu summary:focus-visible,
.due-diligence summary:focus-visible {
  outline: 3px solid #147f78;
  outline-offset: 3px;
}
.editor-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.1fr);
  gap: 24px;
}
.editor-account .editor-field {
  margin-bottom: 0;
}
.editor-account textarea {
  height: 55px;
}
.editor-account .editor-password {
  padding: 0 0 0 20px;
  border: 0;
  border-left: 1px solid #d7e0ec;
}
.editor-password h3 {
  font-size: 16px;
}
.editor-password .checkbox-row {
  font-size: 12px;
}
.editor-password button {
  font-size: 13px;
  padding: 8px 12px;
}
.profile-stats .over-limit strong {
  color: #b42318;
}
@media (max-width: 800px) {
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-account-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor-account .editor-password {
    border-left: 0;
    padding: 12px 0 0;
  }
  .editor-columns {
    gap: 20px;
    padding: 20px;
  }
  .editor-columns > section + section {
    padding-left: 18px;
  }
  .profiles-toolbar {
    align-items: flex-end;
  }
  .profiles-toolbar h2 {
    width: 100%;
  }
}
@media (max-width: 580px) {
  .profiles-heading {
    gap: 10px;
  }
  .profiles-heading h1 {
    font-size: 24px;
  }
  .profiles-heading button {
    padding: 8px 12px;
    font-size: 14px;
  }
  .profile-stats article {
    padding: 12px;
    min-height: 95px;
  }
  .profile-stats strong {
    font-size: 24px;
  }
  .profile-stats span {
    font-size: 12px;
  }
  .profiles-toolbar > div {
    width: 100%;
  }
  .profiles-toolbar input,
  .profiles-toolbar select {
    width: 100%;
  }
  .midwife-modal {
    width: calc(100% - 16px);
    max-height: 96vh;
  }
  .editor-header,
  .editor-account,
  .editor-password {
    padding: 16px;
  }
  .editor-grid,
  .editor-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor-columns {
    padding: 16px;
  }
  .editor-columns > section + section {
    padding: 20px 0 0;
    border-left: 0;
    border-top: 1px solid #d7e0ec;
  }
  .editor-footer {
    padding: 12px 16px;
  }
  .editor-alert {
    margin: 12px 16px;
  }
}
