.avatar-head { display:block; object-fit:contain; width:100%; height:100%; }
.avatar-person-icon { display:grid; place-items:center; padding:0; border:0; background:var(--selection); border-radius:50%; flex:0 0 auto; width:44px; height:44px; overflow:hidden; }
.avatar-person-icon.large { width:60px; height:60px; }
[data-avatar-state="default"] { filter:grayscale(1); }
.avatar-person-icon:has(> [data-avatar-state="default"]),
.avatar-preview:has(> [data-avatar-state="default"]),
.avatar-spatial[data-avatar-state="default"] { background:#e6eaee; }
.avatar-spatial[data-avatar-state="default"] { border-radius:50%; }
.avatar-person-icon:has(> [data-avatar-look="feminine"]),
.avatar-preview:has(> [data-avatar-look="feminine"]),
.avatar-spatial[data-avatar-look="feminine"] { background:#f8e4ed; }
.avatar-person-icon:has(> [data-avatar-look="masculine"]),
.avatar-preview:has(> [data-avatar-look="masculine"]),
.avatar-spatial[data-avatar-look="masculine"] { background:#e4eefb; }
.avatar-spatial[data-avatar-look="feminine"], .avatar-spatial[data-avatar-look="masculine"] { border-radius:50%; }
.avatar-portrait { display:grid; justify-items:center; gap:4px; }
.avatar-portrait-default { display:flex; align-items:center; justify-content:center; gap:8px; }
.avatar-portrait-default .avatar-head { width:52px; height:52px; }
.avatar-portrait-stage { display:grid; justify-items:center; width:min(100%,220px); position:relative; }
.avatar-reset-icon { position:absolute; top:2px; right:2px; display:grid; place-items:center; width:44px; height:44px; padding:0; color:var(--muted); background:var(--surface); border:1px solid var(--line); border-radius:50%; }
.avatar-reset-icon .ui-icon { width:17px; height:17px; }
.avatar-portrait-button { background:transparent; border:0; border-radius:16px; }
.avatar-body { display:block; width:min(100%, 150px); height:178px; object-fit:contain; margin:auto; }
.avatar-editor-wrap { display:grid; gap:14px; container:avatar-editor / inline-size; }
.avatar-editor-top { display:grid; grid-template-columns:minmax(116px, .66fr) minmax(0, 1fr); gap:10px; align-items:start; }
.avatar-visual { min-width:0; display:grid; justify-items:center; gap:4px; }
.avatar-preview { display:grid; place-items:center; position:relative; background:var(--selection); border-radius:20px; width:100%; height:154px; }
.avatar-editor-image { width:min(100%,152px); height:150px; object-fit:contain; }
.avatar-preview-tabs { display:grid; grid-template-columns:1fr 1fr; width:100%; gap:3px; }
.avatar-preview-tabs button { padding-inline:3px; min-height:44px; font-size:.77rem; }
.avatar-preview-tabs button[aria-pressed=true] { background:var(--selection); outline:1px solid var(--brand); }
.avatar-controls, .avatar-field { display:grid; gap:7px; min-width:0; }
.avatar-controls, .avatar-hair-details { display:grid; gap:8px; }
.avatar-controls .avatar-options button { padding-inline:7px; font-size:.78rem; }
.avatar-quick-fields { display:grid; gap:10px; }
.avatar-options { display:flex; gap:5px; flex-wrap:wrap; }
.avatar-options-segmented { display:grid; grid-template-columns:repeat(var(--avatar-option-count),minmax(0,1fr)); }
.avatar-options-segmented button { min-width:0; padding-inline:3px; }
.avatar-controls .avatar-options-segmented button { padding-inline:1px; font-size:.70rem; white-space:nowrap; overflow-wrap:normal; }
.avatar-options button, .avatar-buttons button { min-height:44px; border-radius:15px; overflow-wrap:anywhere; }
.avatar-options button[aria-pressed=true] { outline:2px solid var(--brand); outline-offset:-2px; font-weight:700; }
.avatar-options .avatar-swatch { width:44px; min-width:44px; border-radius:50%; background:var(--avatar-swatch); box-shadow:inset 0 0 0 2px var(--surface); }
.avatar-preset-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.avatar-preset-grid button { display:grid; justify-items:center; align-content:start; gap:2px; min-width:0; min-height:82px; padding:4px 2px; border-radius:14px; font-size:.72rem; line-height:1.15; }
.avatar-preset-grid button[aria-pressed=true] { background:var(--selection); outline:2px solid var(--brand); outline-offset:-2px; }
.avatar-preset-grid .avatar-head { width:56px; max-width:100%; height:56px; }
.avatar-face-details { display:grid; grid-template-columns:76px minmax(0,1fr); gap:10px; align-items:start; }
.avatar-face-controls { display:grid; gap:8px; min-width:0; }
.avatar-detail-image { width:76px; height:76px; object-fit:contain; background:var(--selection); border-radius:14px; }
.avatar-slider { display:grid; grid-template-columns:1fr auto; align-items:center; gap:4px; }
.avatar-slider input { grid-column:1/-1; width:100%; min-width:0; }
.avatar-details[open] { display:grid; gap:12px; }
.avatar-details > summary { cursor:pointer; min-height:40px; align-content:center; }
.avatar-buttons { position:sticky; bottom:0; display:grid; grid-template-columns:minmax(88px,1fr) 2fr; gap:6px; padding:8px 0 4px; background:var(--surface); z-index:2; }
.avatar-spatial { width:clamp(34px, 6vw, 42px); height:clamp(34px, 6vw, 42px); display:inline-block; object-fit:contain; }
.avatar-name-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.avatar-name-choices button { min-height:52px; }
.avatar-name-choices .avatar-head { width:64px; height:64px; margin:auto; }
@media (max-width:430px) {
 .avatar-person-icon.large { width:52px; height:52px; }
 .avatar-editor-top { grid-template-columns:minmax(100px,.57fr) minmax(0,1fr); gap:8px; }
 .avatar-body { height:145px; }
}
.quick-student-head > .avatar-person-icon { grid-area:avatar; }
:root[data-density="compact"] .quick-roster-quick > .quick-student:has(.avatar-person-icon) {
  grid-template-columns:56px minmax(0,1fr) 44px;
  grid-template-areas:"avatar name note" "avatar ratings ratings";
  gap:4px 8px;
}
.quick-student:has(.avatar-person-icon) .quick-name { overflow-wrap:normal; }
:root[data-density="compact"] .quick-roster-quick .quick-student:has(.avatar-person-icon) .quick-name { min-height:30px; }
.quick-student:has(.quick-observation-actions):has(.avatar-person-icon) {
  grid-template-columns:56px minmax(0,1fr) 96px 44px;
}
.quick-student:has(.point-row-actions):has(.avatar-person-icon) {
  grid-template-columns:56px minmax(0,1fr) minmax(52px,auto) 44px;
}
.avatar-buttons button { padding-inline:5px; overflow-wrap:normal; hyphens:auto; }
@media (max-width:430px) { .avatar-person-icon.large { width:56px;height:56px; } }
@media (max-width:360px) {
  :root[data-density="compact"] .quick-roster-quick > .quick-student:has(.avatar-person-icon) {
    grid-template-columns:48px minmax(0,1fr) 44px; gap:4px 5px;
  }
  .avatar-person-icon.large {width:48px;height:48px;}
}
@container avatar-editor (min-width:530px) {
 .avatar-preset-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
 .avatar-preset-grid .avatar-head { width:66px; height:66px; }
}
@container avatar-editor (min-width:600px) {
 .avatar-quick-fields { grid-template-columns:minmax(290px,1fr) 1fr; }
}
@container quick-ratings (min-width:490px) {
  :root[data-density="compact"] .quick-roster-quick > .quick-student:has(.avatar-person-icon) {
    grid-template-columns:60px minmax(0,1fr) max-content 44px;
    grid-template-areas:"avatar name ratings note";
  }
}

.avatar-outfit-options { display:grid; grid-template-columns:94px minmax(0,1fr); gap:12px; align-items:start; }
.avatar-outfit-image { width:94px; height:128px; object-fit:contain; background:var(--selection); border-radius:14px; }
.avatar-details { border-block-start:1px solid var(--line); }
.avatar-details > summary { font-weight:680; min-height:44px; }
.avatar-preset-grid button { hyphens:auto; overflow-wrap:anywhere; }
@container avatar-editor (max-width:350px) {
 .avatar-outfit-options { grid-template-columns:76px minmax(0,1fr); gap:7px; }
 .avatar-outfit-image { width:76px; height:106px; }
}

/* The portrait itself sets the first column width in all attendance modes. */
.attendance-roster .attendance-identity {
  grid-template-columns: auto minmax(0, 1fr);
}
.attendance-roster .attendance-identity > :is(.student-avatar, .avatar-person-icon) {
  display: grid;
  grid-column: 1;
}
.attendance-roster .attendance-identity > :is(.attendance-name-info, .attendance-name-copy) {
  grid-column: 2;
  min-width: 0;
}
.attendance-roster .attendance-name-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-items: start;
}
.attendance-roster .attendance-info-symbol {
  position: relative;
  display: inline-flex;
}
.attendance-roster .attendance-name-info.has-information::after { content: none; }
.attendance-roster .attendance-name-info.has-information .attendance-info-symbol::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: var(--brand);
  inset-inline-end: -3px;
  inset-block-start: -3px;
}
.attendance-roster .attendance-identity :is(strong, small),
.quick-student:has(.avatar-person-icon) .quick-name {
  white-space: normal;
  overflow-wrap: anywhere;
}
.attendance-roster .attendance-primary[data-recorded="false"] {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}
@media (max-width: 450px) {
  .attendance-roster .attendance-row {
    grid-template-columns: minmax(0, 1fr) clamp(80px,21vw,105px) 44px;
  }
  .attendance-roster .attendance-name-info:not(.has-information) .attendance-info-symbol { display: none; }
  .attendance-roster .attendance-primary { width: 100%; min-width: 0; }
  .attendance-roster .attendance-identity > .avatar-person-icon.large { width: 48px; height: 48px; }
}
