/* ══════════════════════════════════════════════════════════
   PROFILE PAGE
   ══════════════════════════════════════════════════════════ */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding-bottom: calc(176px + env(safe-area-inset-bottom, 0px));
}
.profile-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--section-bg);
}
.profile-avatar {
  width: 58px;
  height: 58px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(37,99,235,.45);
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  box-shadow: 0 0 0 0 rgba(37,99,235,.28);
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
  animation: profileAvatarPulse 1.9s ease-in-out infinite;
}
.profile-avatar:active { transform: scale(.96); }
.profile-avatar:focus-visible {
  outline: 3px solid rgba(37,99,235,.22);
  outline-offset: 3px;
}
.profile-avatar.has-image {
  border-color: rgba(5,150,105,.5);
  background: var(--section-bg);
  animation: none;
}
.profile-avatar-image {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.profile-avatar-initial {
  line-height: 1;
}
.profile-avatar-camera {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--section-bg);
  border-radius: var(--r-full);
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: var(--shadow-sm);
}
.profile-avatar-camera svg {
  width: 14px;
  height: 14px;
}
@keyframes profileAvatarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.24); }
  50% { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}
.profile-kicker {
  margin-bottom: 3px;
  color: var(--hint);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}
.profile-head h1 {
  font-size: var(--fs-lg);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-1);
}
.profile-head p {
  color: var(--hint);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.profile-completion {
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(37,99,235,.07), var(--section-bg));
}
.profile-completion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.profile-completion-row strong {
  font-size: var(--fs-sm);
  line-height: var(--lh-tight);
}
.profile-completion-row span {
  color: var(--blue);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}
.profile-completion-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--bg2);
}
.profile-completion-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--sage));
  transition: width .24s var(--ease);
}
.profile-completion p {
  margin-top: var(--sp-3);
  color: var(--hint);
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
}
.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.profile-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.profile-status {
  color: var(--hint);
  font-size: var(--fs-xs);
  text-align: center;
}
.profile-status.success { color: var(--sage); }
.profile-status.error { color: var(--destructive); }
.profile-action-card {
  width: 100%;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--section-bg);
  color: var(--text);
  text-align: left;
}
.profile-action-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
}
.profile-action-card strong {
  display: block;
  font-size: var(--fs-sm);
  line-height: var(--lh-tight);
}
.profile-action-card small {
  display: block;
  margin-top: 3px;
  color: var(--hint);
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
}
.profile-action-arrow {
  color: var(--hint);
  font-size: 22px;
}

body.avatar-picker-active { overflow: hidden; }
.avatar-picker-shell {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: stretch;
}
.avatar-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.28);
  opacity: 0;
  transition: opacity .22s var(--ease);
}
.avatar-picker-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform .24s var(--ease);
}
.avatar-picker-shell.is-open .avatar-picker-backdrop { opacity: 1; }
.avatar-picker-shell.is-open .avatar-picker-panel { transform: translateX(0); }
.avatar-picker-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--bg2);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}
.avatar-picker-header {
  padding-right: 44px;
  padding-top: var(--sp-2);
}
.avatar-picker-header h2 {
  font-size: var(--fs-lg);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-2);
}
.avatar-picker-header p {
  color: var(--hint);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.avatar-picker-grid {
  flex: 1;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: var(--sp-5);
}
.avatar-choice {
  width: 100%;
  aspect-ratio: 1;
  padding: var(--sp-2);
  border: 2px solid var(--border);
  border-radius: 28px;
  background: var(--section-bg);
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.avatar-choice:active { transform: scale(.96); }
.avatar-choice.is-selected {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px var(--sage-soft);
}
.avatar-choice img {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: cover;
}
