.profile-modal {
  width: min(720px, 100%);
  padding: 0;
  overflow: hidden;
}

.profile-modal > h2 {
  margin: 0;
  padding: 24px 26px 18px;
}

.profile-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 26px 14px;
  border-bottom: 1px solid var(--line);
}

.profile-tab {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 800;
}

.profile-tab:hover {
  background: var(--soft);
  color: var(--ink);
}

.profile-tab.active {
  background: color-mix(in srgb, var(--violet) 13%, var(--paper));
  color: var(--violet);
}

.profile-tab-panel {
  min-height: 340px;
  padding: 22px 26px 8px;
}

.profile-tab-panel > p {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.profile-tab-panel .avatar-upload {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.profile-tab-panel .avatar-upload .avatar {
  overflow: hidden;
}

.profile-tab-panel .avatar-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-tab-panel .avatar-upload p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 10px;
}

.profile-tab-panel .theme-options {
  margin-top: 8px;
}

.profile-tab-panel .theme-choice {
  background: var(--paper);
  color: var(--ink);
}

.profile-tab-panel .theme-choice.active {
  background: color-mix(in srgb, var(--violet) 10%, var(--paper));
}

.profile-section-heading {
  margin: 4px 0 10px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-modal .modal-actions {
  margin: 0;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--soft) 60%, var(--paper));
}

@media (max-width: 680px) {
  .profile-modal {
    max-height: calc(100vh - 24px);
  }

  .profile-modal > h2 {
    padding: 20px 18px 14px;
  }

  .profile-tabs {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    overflow-x: auto;
    padding: 0 18px 12px;
  }

  .profile-tab-panel {
    min-height: 0;
    padding: 18px 18px 6px;
  }

  .profile-modal .modal-actions {
    position: sticky;
    bottom: 0;
    padding: 14px 18px 18px;
  }
}
