.page {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}

.header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  background: var(--panel);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.header h1 {
  color: var(--ink-0);
  font-size: 1.3rem;
  font-weight: 800;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

/* === Bloc profil unifié === */
.content {
  padding: 1.25rem;
  display: grid;
  gap: 1.25rem;
}

/* Avatar */
.avatarSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.avatarBtn {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--teal);
  display: block;
}

.avatarPlaceholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-warm);
  color: var(--muted);
  border: 2px dashed var(--border);
}

.avatarOverlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.avatarBtn:hover .avatarOverlay,
.avatarBtn:focus-visible .avatarOverlay {
  opacity: 1;
}

.avatarHint {
  font-size: 0.72rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.avatarHint:hover {
  color: var(--accent);
}

/* Identity rows */
.identitySection {
  display: grid;
  gap: 0.85rem;
}

.infoRow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}

.infoLabel {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.infoValue {
  font-weight: 600;
  color: var(--ink-0);
}

.pseudoForm {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.pseudoField {
  display: grid;
  gap: 0.35rem;
  flex: 1;
}

.pseudoInput {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-1);
  color: var(--ink-0);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.pseudoInput:focus {
  border-color: var(--accent);
}

.saveBtn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Message feedback */
.message {
  border-radius: var(--radius-input);
  background: #eef3e3;
  padding: 0.6rem 0.85rem;
  color: var(--ink-1);
  font-size: 0.88rem;
}

/* === Modal photo === */
.modalBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(3px);
}

.modal {
  background: var(--panel);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modalHeader h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink-0);
}

.modalClose {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 0.15s;
}

.modalClose:hover {
  color: var(--ink-0);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
}

.tab {
  flex: 1;
  padding: 0.55rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
}

.tab:hover {
  color: var(--ink-1);
}

.tabActive {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Drop zone */
.dropZone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 2rem 1rem;
  display: grid;
  place-items: center;
  gap: 0.4rem;
  cursor: pointer;
  background: var(--bg-1);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  min-height: 160px;
}

.dropZone:hover,
.dropZoneActive {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropIcon {
  width: 40px;
  height: 40px;
  color: var(--muted);
}

.dropZoneActive .dropIcon,
.dropZone:hover .dropIcon {
  color: var(--accent);
}

.dropText {
  font-weight: 700;
  color: var(--ink-1);
  font-size: 0.95rem;
}

.dropSub {
  font-size: 0.78rem;
  color: var(--muted);
}

.hiddenInput {
  display: none;
}

/* Crop */
.cropContainer {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.cropCircle {
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 3px var(--border-light), 0 2px 12px rgba(0, 0, 0, 0.1);
}

.cropCircle:active {
  cursor: grabbing;
}

.cropImg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  display: block;
}

/* Zoom slider */
.zoomRow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1rem;
}

.zoomLabel {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
  user-select: none;
}

.zoomSlider {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
}

.zoomSlider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.zoomSlider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.changeFile {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  text-align: center;
  width: 100%;
}

.changeFile:hover {
  color: var(--accent);
}

/* Current photo in modal */
.currentPhotoSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
}

.currentPhotoCircle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--border-light), 0 2px 12px rgba(0, 0, 0, 0.1);
}

.currentPhotoCircle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.currentPhotoHint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.currentPhotoActions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.deletePhotoBtn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.deletePhotoBtn:hover {
  color: var(--accent);
}

.deletePhotoBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Default avatars grid */
.defaultGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.65rem;
  padding: 0.5rem 0;
}

.defaultItem {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, transform 0.15s;
}

.defaultItem img {
  width: 65%;
  height: 65%;
  object-fit: contain;
}

.defaultItem:hover {
  transform: scale(1.08);
}

.defaultItemActive {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Color picker */
.colorSection {
  display: grid;
  gap: 0.5rem;
}

.colorLabel {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.colorRow {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.colorDot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.colorDot:hover {
  transform: scale(1.12);
}

.colorDotActive {
  border-color: var(--ink-0);
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink-0);
}

.colorCustom {
  background: conic-gradient(
    #f99, #ff9, #9f9, #9ff, #99f, #f9f, #f99
  );
  display: grid;
  place-items: center;
}

.colorCustom svg {
  opacity: 0.6;
}

.nativeColorPicker {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-1);
}

/* Error */
.modalError {
  font-size: 0.82rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--radius-input);
  padding: 0.5rem 0.75rem;
}

/* Actions */
.modalActions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 860px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
}

