/* 員工頭像：有照片時蓋掉姓名首字的底色與邊框；沒照片維持原本樣式。 */
.avatar.has-photo,html[data-ui] .avatar.has-photo,html[data-ui] .user-menu .avatar.has-photo,html[data-ui] .sidebar .avatar.has-photo{padding:0;overflow:hidden;border:0;background:var(--surface-alt,#eaf0f8)}
.avatar.has-photo img,.af-avatar.has-photo img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%;pointer-events:none;user-select:none}
.af-avatar.has-photo{overflow:hidden;padding:0;background:var(--surface-alt,#eaf0f8)}

.profile-banner .avatar-edit{position:relative;flex:none;width:72px;height:72px;padding:0;border:0;border-radius:50%;background:none;color:inherit;cursor:pointer;display:inline-grid;place-items:center}
.profile-banner .avatar-edit .avatar.large{width:72px;height:72px;font-size:1.75rem}
.avatar-edit-badge{position:absolute;right:-2px;bottom:-2px;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:var(--blue,#2346a0);color:#fff;border:2px solid var(--surface,#fff);box-shadow:0 1px 3px #0003}
.avatar-edit-badge svg{width:13px;height:13px}
.avatar-edit:focus-visible{outline:3px solid var(--blue,#2346a0);outline-offset:3px}
@media (hover:hover){.avatar-edit:hover .avatar{filter:brightness(.92)}.avatar-edit:hover .avatar-edit-badge{transform:scale(1.1)}}
.avatar-edit-badge{transition:transform .15s ease}

.avatar-dialog{width:min(26rem,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);overflow:auto;border:1px solid var(--line);border-radius:1rem;padding:1.25rem;color:var(--ink);background:var(--surface,#fff)}
.avatar-dialog::backdrop{background:#0007}
.avatar-dialog h2{margin:0 0 .25rem;font-size:1.125rem}
.avatar-dialog .help{margin:.25rem 0 .75rem}
.avatar-editor{display:grid;gap:.75rem;justify-items:center}
.avatar-stage{position:relative;width:240px;height:240px;max-width:100%;overflow:hidden;border-radius:12px;background:var(--surface-alt,#eef1f5);touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
.avatar-stage[hidden],.avatar-empty[hidden],.avatar-controls[hidden],.avatar-preview[hidden]{display:none}
.avatar-stage.is-dragging{cursor:grabbing}
.avatar-stage img{position:absolute;left:0;top:0;max-width:none;user-select:none;-webkit-user-drag:none;will-change:transform}
.avatar-ring{position:absolute;inset:0;pointer-events:none;border-radius:50%;box-shadow:0 0 0 999px #0008;outline:2px solid #fff}
.avatar-stage:focus-visible{outline:3px solid var(--blue,#2346a0);outline-offset:2px}
.avatar-empty{display:grid;justify-items:center;align-content:center;gap:.5rem;width:240px;max-width:100%;height:240px;border:2px dashed var(--line);border-radius:12px;text-align:center}
.avatar-empty p{margin:0}
.avatar-controls{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;justify-content:center;width:100%}
.avatar-controls input[type=range]{flex:1 1 8rem;min-width:7rem}
.avatar-preview{display:flex;align-items:center;gap:.75rem}
.avatar-preview canvas{width:72px;height:72px;border-radius:50%;border:1px solid var(--line);background:var(--surface-alt,#eef1f5)}
.avatar-status{min-height:1.25rem;margin:.5rem 0 0;font-size:.875rem;text-align:center}
.avatar-status.is-error{color:var(--danger,#b3261e)}
.avatar-status.is-ok{color:var(--green,#187756)}
.avatar-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-top:.75rem}
.avatar-actions .avatar-spacer{flex:1 1 auto}
.avatar-dialog[aria-busy=true] .avatar-actions .button,.avatar-dialog[aria-busy=true] .avatar-controls .button{pointer-events:none;opacity:.6}
@media (max-width:480px){.avatar-dialog{padding:1rem}.avatar-actions .button{flex:1 1 auto}.avatar-actions .avatar-spacer{display:none}}
@media (prefers-reduced-motion:reduce){.avatar-edit-badge{transition:none}}

.avatar-presets{margin-top:1rem;border-top:1px solid var(--line);padding-top:.75rem}
.avatar-presets h3{margin:0 0 .5rem;font-size:.9375rem}
.avatar-preset-tabs{display:flex;gap:.5rem;margin-bottom:.5rem}
html[data-ui] .avatar-preset-tabs .button.is-on{background:var(--blue,#2346a0);color:#fff;border-color:transparent}
.avatar-preset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(56px,1fr));gap:.5rem;max-height:12.5rem;overflow:auto;padding:2px}
.avatar-preset{padding:0;border:2px solid transparent;border-radius:50%;background:none;cursor:pointer;line-height:0;aspect-ratio:1}
.avatar-preset[hidden]{display:none}
.avatar-preset img{width:100%;height:100%;border-radius:50%;display:block}
.avatar-preset.is-picked{border-color:var(--blue,#2346a0)}
.avatar-preset:focus-visible{outline:3px solid var(--blue,#2346a0);outline-offset:2px}
@media (hover:hover){.avatar-preset{transition:transform .12s ease}.avatar-preset:hover{transform:scale(1.1)}}
@media (prefers-reduced-motion:reduce){.avatar-preset{transition:none}}
