/* Menu du compte + fenêtre Mon profil (22/11) */
html:root body .aa-profil {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 8px 4px;
  margin-top: 6px;
  border-top: 1px solid var(--aa-line);
  cursor: pointer;
  border-radius: 0 0 8px 8px;
  font: inherit;
  color: inherit;
}
html:root body .aa-profil:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; border-radius: 8px; }
html:root body .aa-profil:hover .aa-plus,
html:root body .aa-profil[aria-expanded="true"] .aa-plus { color: var(--text-primary); }
html:root body button.aa-avatar { border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; }
html:root body .aa-avatar.a-photo,
.cm-av.a-photo,
.cp-av.a-photo { background: none !important; overflow: hidden; }
.aa-avatar img,
.cm-av img,
.cp-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.cm-menu {
  position: fixed;
  z-index: 150;
  padding: 6px;
  border-radius: 14px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #ebebed);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .05);
  opacity: 0;
  transform: translateY(4px) scale(.98);
  transform-origin: bottom left;
  transition: opacity .16s ease-out, transform .16s ease-out;
}
.cm-menu.open { opacity: 1; transform: none; }
.cm-tete { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.cm-av {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--text-primary, #18181b); color: var(--bg-surface, #fff);
  font-size: 13px; font-weight: 600;
}
.cm-tete > div { min-width: 0; }
.cm-tete b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-tete span { display: block; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-sep { height: 1px; margin: 4px 2px; background: var(--border-subtle, #ebebed); }
.cm-item {
  all: unset;
  box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 36px; padding: 0 10px;
  border-radius: 8px;
  font-size: 13px; color: var(--text-primary);
  cursor: pointer;
  transition: background .12s ease-out;
}
.cm-item svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--text-muted); }
button.cm-item:hover, button.cm-item:focus-visible { background: var(--bg-surface-raised, rgba(24, 24, 27, .05)); }
button.cm-item:focus-visible { outline: none; }
.cm-theme { cursor: default; }
.cm-theme > span { flex: 1; }
.cm-seg { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--bg-surface-raised, rgba(24, 24, 27, .05)); }
.cm-seg button {
  all: unset; box-sizing: border-box;
  padding: 3px 8px; border-radius: 6px;
  font-size: 11.5px; color: var(--text-muted); cursor: pointer;
  transition: background .12s ease-out, color .12s ease-out;
}
.cm-seg button:hover { color: var(--text-primary); }
.cm-seg button.on { background: var(--bg-surface, #fff); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.cm-seg button:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 1px; }
.cm-sortie { color: var(--danger, #EF4444); }
.cm-sortie svg { color: currentColor; }

.cp-fond {
  position: fixed; inset: 0; z-index: 160;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease-out;
}
.cp-fond.open { opacity: 1; pointer-events: auto; }
.cp-carte {
  width: 420px; max-width: 100%;
  padding: 22px;
  border-radius: 18px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #ebebed);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
  transform: translateY(8px) scale(.98);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.cp-fond.open .cp-carte { transform: none; }
.cp-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cp-tete h3 { margin: 0; font-size: 16px; font-weight: 600; }
.cp-x { all: unset; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: var(--text-muted); }
.cp-x:hover { background: var(--bg-surface-raised); color: var(--text-primary); }
.cp-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.cp-photo { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--border-subtle, #ebebed); }
.cp-av {
  all: unset; box-sizing: border-box; position: relative;
  width: 72px; height: 72px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--text-primary, #18181b); color: var(--bg-surface, #fff);
  font-size: 22px; font-weight: 600; cursor: pointer;
}
.cp-av-voile {
  position: absolute; inset: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); color: #fff;
  opacity: 0; transition: opacity .15s ease-out;
}
.cp-av:hover .cp-av-voile, .cp-av:focus-visible .cp-av-voile { opacity: 1; }
.cp-av-voile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.cp-photo-txt { min-width: 0; }
.cp-photo-txt b { display: block; font-size: 13.5px; font-weight: 600; }
.cp-photo-txt > span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cp-photo-act { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cp-lien { all: unset; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--danger, #EF4444); }
.cp-lien:hover { text-decoration: underline; text-underline-offset: 3px; }
.cp-label { display: block; margin: 14px 0 6px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary, #52525b); }
.cp-carte .cal-f-input { width: 100%; box-sizing: border-box; }
.cp-note { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }
.cp-pied { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (max-width: 520px) {
  .cp-fond { place-items: end center; padding: 0; }
  .cp-carte { width: 100%; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .cp-pied .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-menu, .cp-fond, .cp-carte { transition: none; }
}
.cm-tete .cm-av { color: var(--bg-surface, #fff); font-size: 13px; overflow: hidden; }
.cm-tete > div > span { color: var(--text-muted); }
.cm-tete .cm-av { display: grid; place-items: center; }
