.personal-profile-nav {
  display: flex;
  align-items: center;
}

.personal-profile-nav[hidden] {
  display: none !important;
}

.admin-shell .admin-header .personal-profile-link {
  color: var(--md-text-secondary, #526079);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.admin-shell .admin-header .personal-profile-link:hover,
.admin-shell .admin-header .personal-profile-link:focus {
  color: var(--tblr-primary, #5b3df5);
  text-decoration: none;
}

.personal-profile-modal .modal-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
}

.personal-profile-modal .modal-content {
  max-height: calc(100dvh - 32px);
}

.personal-profile-modal .modal-body {
  min-height: 430px;
  padding: 26px 30px 28px;
}

.personal-profile-loading,
.personal-profile-error {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--md-text-secondary, #667085);
}

.personal-profile-error {
  color: #b42318;
}

.personal-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 32px;
  align-items: start;
}

.personal-profile-editor {
  min-width: 0;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.personal-profile-photo-column {
  min-width: 0;
  align-self: start;
}

.personal-profile-photo {
  width: 176px;
  aspect-ratio: 608 / 687;
  border: 1px solid var(--md-border-default, #d7dce5);
  border-radius: 6px;
  background: #f3f5f8;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 38px;
  font-weight: 700;
}

.personal-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.personal-profile-photo-actions {
  margin-top: 12px;
}

.personal-profile-photo-actions .btn {
  width: 100%;
  justify-content: center;
}

.personal-profile-card-preview {
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid var(--md-border-subtle, #eaecf0);
}

.personal-profile-preview-title {
  margin-bottom: 12px;
  color: var(--md-text-secondary, #667085);
  font-size: 14px;
  font-weight: 600;
}

.personal-profile-card-preview .vcard-preview-panel {
  min-height: 0;
  justify-content: flex-start;
}

.personal-profile-work-card {
  width: 210px;
}

.personal-profile-summary {
  min-width: 0;
}

.personal-profile-name {
  margin: 0 0 3px;
  color: var(--md-text-primary, #172033);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.personal-profile-number {
  color: var(--md-text-secondary, #667085);
  font-size: 14px;
}

.personal-profile-accent {
  width: 92px;
  height: 4px;
  margin-top: 14px;
  background: var(--tblr-primary, #5b3df5);
}

.personal-profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 26px;
  margin: 20px 0 0;
  border-top: 1px solid var(--md-border-subtle, #eaecf0);
}

.personal-profile-detail {
  min-width: 0;
  padding: 14px 0 13px;
  border-bottom: 1px solid var(--md-border-subtle, #eaecf0);
}

.personal-profile-detail dt,
.personal-profile-detail dd {
  margin: 0;
}

.personal-profile-detail dt {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--md-text-secondary, #667085);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.personal-profile-detail dt i {
  color: var(--tblr-primary, #5b3df5);
  font-size: 16px;
}

.personal-profile-detail dd {
  margin-top: 6px;
  color: var(--md-text-primary, #172033);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.personal-profile-crop-view {
  display: grid;
  grid-template-columns: 304px minmax(180px, 1fr);
  gap: 28px;
  align-items: center;
  justify-content: center;
}

.personal-profile-crop-preview {
  position: relative;
  width: 304px;
  height: 343.5px;
  max-width: 100%;
  aspect-ratio: 608 / 687;
  border: 2px solid rgba(var(--tblr-primary-rgb, 91, 61, 245), 0.55);
  border-radius: 8px;
  background: #f3f5f8;
  overflow: hidden;
  touch-action: none;
}

.personal-profile-crop-preview img {
  position: absolute;
  inset: 0 auto auto 0;
  max-width: none;
  transform-origin: top left;
  user-select: none;
  cursor: grab;
}

.personal-profile-crop-preview.is-dragging img {
  cursor: grabbing;
}

.personal-profile-crop-controls input[type="range"] {
  width: 100%;
}

.personal-profile-crop-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
}

@media (max-width: 900px) {
  .personal-profile-modal .modal-dialog {
    width: min(720px, calc(100vw - 32px));
  }

  .personal-profile-layout {
    grid-template-columns: 1fr;
  }

  .personal-profile-card-preview {
    display: grid;
    grid-template-columns: 1fr 210px;
    align-items: start;
    gap: 20px;
    padding: 24px 0 0;
    border-top: 1px solid var(--md-border-subtle, #eaecf0);
    border-left: 0;
  }

  .personal-profile-preview-title {
    margin: 0;
  }
}

@media (max-width: 700px) {
  .personal-profile-modal .modal-body {
    min-height: 0;
    padding: 20px;
  }

  .personal-profile-editor,
  .personal-profile-crop-view {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .personal-profile-photo {
    width: min(176px, 54vw);
    margin-inline: auto;
  }

  .personal-profile-photo-actions {
    width: min(176px, 54vw);
    margin-inline: auto;
    margin-top: 12px;
  }

  .personal-profile-card-preview {
    display: block;
  }

  .personal-profile-card-preview .vcard-preview-panel {
    justify-content: center;
  }

  .personal-profile-preview-title {
    margin-bottom: 12px;
    text-align: center;
  }

  .personal-profile-crop-preview {
    width: min(304px, calc(100vw - 72px));
    height: auto;
    margin-inline: auto;
  }

  .personal-profile-summary {
    text-align: center;
  }

  .personal-profile-accent {
    margin-inline: auto;
  }

  .personal-profile-detail {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .admin-shell .admin-header .personal-profile-link {
    font-size: 13px;
    padding-inline: 6px !important;
  }

  .personal-profile-details {
    grid-template-columns: 1fr;
  }
}
