.camp-avatar { position:relative; isolation:isolate; width:100%; height:100%; overflow:hidden; border-radius:inherit; display:inline-grid; place-items:center; font:inherit; line-height:1; }
.camp-avatar > span, .avatar-presets button span { font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.camp-avatar-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.camp-avatar-img[hidden] { display:none; }
.avatar-dialog {
  --avatar-paper:#fffefa; --avatar-ink:#233e32; --avatar-muted:#576d60; --avatar-surface:#eff4ed;
  --avatar-line:#cedcd1; --avatar-accent:#286d52; --avatar-selection:#deeee1; --avatar-action:#27674e; --avatar-on-action:#fff;
  color:var(--avatar-ink); background:var(--avatar-paper); border:1px solid var(--avatar-line); border-radius:22px;
  width:min(26rem,calc(100% - 24px)); max-height:calc(100% - 24px); max-height:min(90dvh,calc(100% - 24px));
  box-sizing:border-box; padding:clamp(16px,4vw,26px); margin:auto; box-shadow:0 14px 48px #182d2433; overflow:auto;
}
.avatar-dialog::backdrop { background:#152c2273; }
.avatar-dialog header, .avatar-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.avatar-dialog h2 { margin:0; font-size:1.35rem; line-height:1.35; overflow-wrap:anywhere; }
.avatar-dialog button { min-height:44px; font:inherit; font-weight:600; border-radius:12px; color:var(--avatar-ink); cursor:pointer; }
.avatar-dialog button:disabled { cursor:default; }
.avatar-dialog button:focus-visible { outline:3px solid var(--avatar-accent); outline-offset:2px; }
.avatar-dialog .avatar-close { display:grid; place-items:center; flex:0 0 44px; padding:0; border:0; border-radius:50%; background:var(--avatar-surface); color:var(--avatar-muted); font-size:1.55rem; line-height:1; }
.avatar-preview { margin:15px auto 18px; width:84px; height:84px; border-radius:50%; font-size:3rem; background:var(--avatar-selection); }
.avatar-presets { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; }
.avatar-presets button { display:grid; place-items:center; min-width:0; padding:4px; font-size:1.65rem; line-height:1; background:var(--avatar-surface); border:2px solid transparent; }
.avatar-presets button[aria-pressed="true"] { border-color:var(--avatar-accent); background:var(--avatar-selection); }
.avatar-dialog .avatar-upload { display:block; width:100%; border:1px solid var(--avatar-line); background:var(--avatar-paper); color:var(--avatar-accent); margin:12px 0 0; }
.avatar-message, .avatar-note { color:var(--avatar-muted); font-size:.91rem; line-height:1.5; margin:10px 0 0; overflow-wrap:anywhere; }
.avatar-message:empty, .avatar-note:empty { display:none; }
.avatar-actions { justify-content:flex-end; margin-top:18px; }
.avatar-actions button { padding:8px 16px; }
.avatar-actions .avatar-cancel { border:0; background:transparent; color:var(--avatar-muted); }
.avatar-actions .avatar-save { background:var(--avatar-action); color:var(--avatar-on-action); border:1px solid transparent; }
.avatar-actions .avatar-save:disabled { background:var(--avatar-surface); color:var(--avatar-muted); }
@media (max-width:380px) { .avatar-presets { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (prefers-color-scheme:dark) {
  .avatar-dialog { --avatar-paper:#202d26; --avatar-ink:#e2eee3; --avatar-muted:#c2d1c3; --avatar-surface:#324038; --avatar-line:#4e6253;
    --avatar-accent:#addcbd; --avatar-selection:#3d5544; --avatar-action:#addcbd; --avatar-on-action:#183627; }
}
@media (prefers-reduced-motion:no-preference) {
  .avatar-presets button,.avatar-dialog .avatar-upload,.avatar-actions button { transition:background-color 115ms ease-out,transform 115ms var(--camp-soft-ease,ease-out); }
  .avatar-dialog button:active:not(:disabled) { transform:scale(.98); }
}
@media (forced-colors:active) { .avatar-presets button[aria-pressed="true"] { outline:3px solid Highlight; } }
