.profile-overlay {
  padding: 18px;
}

.profile-card {
  --profile-avatar-edit-color: #4e8dff;
  position: relative;
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 28px 26px 30px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 34px;
  background: rgba(17, 14, 18, .70);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(22px) saturate(1.15);
}

.profile-overlay--avatar-picker-open .profile-card {
  overflow: hidden;
}

html[data-theme="light"] .profile-card {
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 24px 72px rgba(58, 38, 78, .18), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.profile-close-button {
  position: absolute;
  top: 13px;
  right: 15px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 22px;
  line-height: 1;
}

.profile-close-button[hidden] {
  display: none !important;
}

.profile-title {
  margin: 0 0 28px;
  color: var(--text);
  font-size: 21px;
  line-height: 1;
  font-weight: 1000;
  text-align: center;
  letter-spacing: -.035em;
}

.profile-avatar-button {
  position: relative;
  width: 118px;
  height: 118px;
  display: block;
  margin: 0 auto 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.profile-avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  border: 4px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

.profile-avatar-edit-icon {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  background: var(--profile-avatar-edit-color);
  font-size: 15px;
  font-weight: 950;
}

.profile-display-name {
  max-width: 100%;
  margin: 0 auto 34px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 1000;
  letter-spacing: -.045em;
  text-align: center;
  overflow-wrap: anywhere;
}

.profile-section-title {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.1;
  font-weight: 1000;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.profile-field {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0 0 20px;
}

.profile-field[hidden] {
  display: none;
}

.profile-field__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: rgb(0 170 164);
  box-shadow: none;
  font-size: 0;
  overflow: hidden;
}

.profile-field__icon::before {
  content: "";
  width: var(--profile-field-icon-size, 20px);
  height: var(--profile-field-icon-size, 20px);
  display: block;
  background: currentColor;
  -webkit-mask-image: var(--profile-field-icon-url);
  mask-image: var(--profile-field-icon-url);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.profile-field__icon--profile {
  --profile-field-icon-url: url("/assets/icons/profile.svg");
  --profile-field-icon-size: 18px;
}

.profile-field__icon--secret {
  --profile-field-icon-url: url("/assets/icons/padlock.svg");
  --profile-field-icon-size: 19px;
}

.profile-field__content {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.profile-field__label {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  font-weight: 1000;
  letter-spacing: .02em;
  text-transform: none;
}

.profile-field__input-wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 17px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .36);
}

html[data-theme="light"] .profile-field__input-wrap {
  background: rgba(23, 17, 33, .07);
}

.profile-field__input-wrap input {
  width: 100%;
  min-width: 0;
  color: #fff;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 780;
}

html[data-theme="light"] .profile-field__input-wrap input {
  color: var(--text);
}

.profile-field__input-wrap input::placeholder {
  color: rgba(255, 255, 255, .60);
}

html[data-theme="light"] .profile-field__input-wrap input::placeholder {
  color: rgba(44, 38, 56, .48);
}

.profile-error {
  min-height: 20px;
  margin: 0 0 10px;
  color: #ffcf70;
  font-size: 13px;
  text-align: center;
}

.profile-save-button,
.profile-secondary-button,
.profile-danger-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
  border-radius: 999px;
  font-weight: 950;
}

.profile-save-button {
  width: max-content;
  min-width: 142px;
  margin: 18px auto 0;
  color: #fff;
  border: 0;
  background: linear-gradient(90deg, #4e8dff, #862aff);
}

.profile-secondary-button {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.profile-danger-button {
  color: #fff;
  border: 0;
  background: linear-gradient(90deg, #ef4444, #ec4899);
}

.profile-delete-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.profile-delete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
