/* ---------- people / cluster review ---------- */
.people-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; padding: 26px 26px 6px; flex-wrap: wrap; }
.people-title { font-family: 'Fredoka', sans-serif; font-size: 30px; margin: 0 0 4px; }
.people-sub { color: var(--muted); font-size: 14px; margin: 0; }
.people-sub b { color: var(--mint); }
.recluster-note { margin: 10px 26px 0; padding: 11px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--mint) 10%, transparent); border: 1px solid color-mix(in srgb, var(--mint) 40%, transparent);
  color: var(--mint); font-size: 13px; display: flex; align-items: center; gap: 10px; }

/* named-so-far quick links */
.named-strip { display: flex; flex-direction: column; gap: 18px; padding: 4px 26px 0; }
.strip-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.strip-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
/* collapsible guest/former groups: hide the chips until the icon is clicked */
.strip-group.collapsed .strip-chips { display: none; }
.strip-status-icon.status-guest, .strip-status-icon.status-former {
  cursor: pointer; font-family: inherit; }
.strip-toggle { background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  font-weight: 600; padding: 5px 2px; align-self: center; }
.strip-toggle:hover { color: var(--text); }
/* left controls column: status icon/toggle on top, sort toggle stacked beneath */
.strip-controls { flex: none; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.strip-head { display: flex; align-items: center; gap: 4px; }
/* subtle, low-prominence sort toggle sitting under the status button */
.strip-sort { background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--muted); opacity: 0.55; padding: 2px 4px; border-radius: 6px;
  margin-left: 2px; display: inline-flex; align-items: center; }
.strip-sort:hover { opacity: 1; color: var(--text); background: var(--surface); }
.sort-svg { width: 16px; height: 16px; display: block; fill: none; }
/* only meaningful while the group is expanded -- hide it for collapsed guest/former */
.strip-group.collapsed .strip-sort { display: none; }
.named-strip .strip-label { font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted); font-weight: 600; margin-right: 2px;
  min-width: 96px; }
/* status group header as a compact icon (hover shows the label) */
.strip-status-icon { flex: none; width: 26px; height: 26px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 15px; line-height: 1;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  cursor: default; margin-right: 4px; }
/* the ★/✦/☆ glyphs don't share a metric baseline; nudge the stars so they center */
.strip-status-icon.status-active,
.strip-status-icon.status-former { padding-bottom: 1px; }
/* status icons: active=mint (on roster), guest=lavender (visiting -- neutral but
   distinct), former=muted hollow star (retired/faded) */
.strip-status-icon.status-active { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 40%, transparent); }
.strip-status-icon.status-guest  { color: var(--lavender); border-color: color-mix(in srgb, var(--lavender) 35%, transparent); }
.strip-status-icon.status-former { color: var(--muted); }
.person-chip { position: relative; display: inline-flex; align-items: stretch; gap: 0;
  font-size: 13px; border-radius: 999px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--coral) 35%, transparent); color: var(--text); font-family: inherit;
  overflow: visible; }
.person-chip:hover { border-color: var(--coral); }
.pc-name { background: none; border: none; color: inherit; font-family: inherit;
  font-size: 13px; padding: 5px 8px 5px 12px; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; border-radius: 999px 0 0 999px; }
.pc-name:hover { color: var(--coral); }
.person-chip .pc-count { color: var(--coral); font-weight: 700; font-size: 12px; }
/* roster-status pill (sits between name and role toggle) — an icon now */
.pc-tag { background: var(--surface-2); border: none; border-left: 1px solid var(--border);
  color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 0 9px; cursor: pointer; }
.pc-tag:hover { background: var(--surface); }
.pc-tag.status-active { color: var(--mint); }
.pc-tag.status-guest  { color: var(--lavender); }   /* guest = visiting (neutral, distinct from former) */
.pc-tag.status-former { color: var(--muted); }
.pc-tag-menu, .pc-role-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 8;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,0.45); display: flex; flex-direction: column; }
.pc-tag-opt, .pc-role-opt { background: none; border: none; color: var(--text); font-family: inherit;
  font-size: 12.5px; padding: 7px 16px; cursor: pointer; text-align: left; white-space: nowrap; }
.pc-tag-opt:hover, .pc-role-opt:hover { background: var(--surface); color: var(--mint); }
.pc-tag-opt.active, .pc-role-opt.active { color: var(--coral); font-weight: 600; }

.pc-role { background: var(--surface-2); border: none; border-left: 1px solid var(--border);
  color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 700; width: 24px;
  cursor: pointer; border-radius: 0 999px 999px 0; }
.pc-role:hover { color: var(--lavender); background: var(--surface); }
/* read-only status/role icons (non-admin chips): same look, no interactivity.
   They're <span>s (not <button>s), so give them the same flex-centering the
   buttons get implicitly -- otherwise the glyphs stick to the top/top-left. */
.pc-readonly { cursor: default; display: inline-flex; align-items: center;
  justify-content: center; }
.pc-tag.pc-readonly:hover, .pc-role.pc-readonly:hover { background: none; }
/* a flagged person's whole chip reads as de-emphasized in the listing */
.person-chip.low-priority { opacity: 0.6; }
.person-chip.low-priority:hover { opacity: 1; }
/* wrestler + ref colors swapped (wrestler now pops butter; ref is muted) */
.pc-role.role-wrestler { color: var(--butter); }
.pc-role.role-referee  { color: var(--muted); }
.pc-role.role-announcer { color: var(--mint); }
.pc-role.role-other    { color: var(--lavender); }

/* While the cluster data is still loading, hold back the whole cluster surface so
   the header + people/teams render first (no empty-region flash above them). */
#people.clusters-pending .cluster-controls,
#people.clusters-pending #reclusterNote,
#people.clusters-pending #clusterMetaRow,
#people.clusters-pending #clusterGrid,
#people.clusters-pending #clustersEmpty { display: none !important; }

/* Same idea for the "tag teams" section: hold it back until loadTeams()
   resolves, so the "tag teams" label + New-team button don't sit over an
   empty list while the roster (now the fast one) has already painted. */
#people.teams-pending .teams-section { display: none !important; }

/* grouping controls */
/* the cluster surface starts here (controls); nudge it down from the teams
   section above so the two areas read as distinct. */
.cluster-controls { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap;
  padding: 16px 26px 4px; margin-top: 26px; }
/* size-lever + stat share one row, baseline-aligned. */
.cluster-meta-row { display: flex; align-items: flex-end; gap: 24px;
  flex-wrap: wrap; }
/* prod-only client-side pile-size lever (display toggled by no-recluster rules) */
.cluster-size-filter { flex-direction: column; gap: 6px; padding: 0 26px 4px;
  max-width: 340px; }
/* faces/groups stat -- shares .cluster-meta-row with the size lever. */
.cluster-faces-stat { margin: 0; padding: 0 26px; color: var(--muted);
  font-size: 13px; white-space: nowrap; }
.cluster-faces-stat b { color: var(--text); }
.control-group { display: flex; flex-direction: column; gap: 8px; min-width: 320px; }
.control-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted); font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.control-hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11.5px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-end { font-size: 11.5px; color: var(--muted); flex: none; }
#tightness { flex: 1; accent-color: var(--coral); cursor: pointer; }
.crowd-toggle { margin: 0 0 4px; font-size: 13px; }
/* segmented off/low/med/high control */
.seg-control { display: inline-flex; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; background: var(--surface); width: fit-content; }
.seg-control button { background: none; border: none; color: var(--muted); font-family: inherit;
  font-size: 12.5px; font-weight: 600; padding: 7px 15px; cursor: pointer;
  border-right: 1px solid var(--border); }
.seg-control button:last-child { border-right: none; }
.seg-control button:hover { color: var(--text); }
.seg-control button.active { background: var(--coral); color: var(--ink); }

.cluster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px; padding: 18px 26px 60px; }
.cluster-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column;
  transition: opacity 0.3s ease, transform 0.3s ease; }
.cluster-card.leaving { opacity: 0; transform: scale(0.96); }
.cluster-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.cluster-count { font-family: 'Fredoka', sans-serif; font-size: 17px; }
.cluster-count b { color: var(--coral); }
.cluster-head-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.cluster-skip { background: none; border: none; color: var(--muted); font-size: 12px;
  cursor: pointer; padding: 2px 4px; }
.cluster-skip:hover { color: var(--coral); }
.cluster-expand { background: none; border: none; color: var(--lavender); font-size: 12px;
  cursor: pointer; padding: 2px 4px; font-family: inherit; white-space: nowrap; }
.cluster-expand:hover { color: var(--mint); }
.cluster-expand:disabled { color: var(--muted); cursor: default; }
.cluster-ignore-all { background: none; border: none; color: var(--coral); font-size: 12px;
  cursor: pointer; padding: 2px 4px; font-family: inherit; white-space: nowrap; }
.cluster-ignore-all:hover { text-decoration: underline; }
.cluster-ignore-all:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.face-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
/* expanded: smaller tiles + scroll so a 40+ cluster stays inside the card */
.face-grid.expanded { grid-template-columns: repeat(5, 1fr); max-height: 340px;
  overflow-y: auto; padding-right: 4px; }
.face-cell { position: relative; border-radius: 10px; overflow: visible;
  transition: opacity 0.2s ease, transform 0.2s ease; }
.face-cell.removing { opacity: 0; transform: scale(0.85); }
.face-cell img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px;
  background: var(--surface-2); display: block; }
.face-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; border: none; cursor: pointer; font-size: 16px; line-height: 1;
  background: rgba(23,18,42,0.72); color: #fff; opacity: 0; transition: opacity 0.12s ease;
  display: flex; align-items: center; justify-content: center; padding: 0; }
.face-cell:hover .face-x { opacity: 1; }
.face-x:hover { background: var(--coral); color: var(--ink); }
/* magnifier: top-LEFT so it doesn't collide with the ✕ */
.face-zoom { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px;
  border-radius: 50%; border: none; cursor: pointer; font-size: 12px; line-height: 1;
  background: rgba(23,18,42,0.72); color: #fff; opacity: 0; transition: opacity 0.12s ease;
  display: flex; align-items: center; justify-content: center; padding: 0; }
.face-cell:hover .face-zoom { opacity: 1; }
.face-zoom:hover { background: var(--lavender); color: var(--ink); }
/* Fixed positioning (coords set by placeMenu in JS) so the menu escapes the
   expanded face-grid's overflow-y scroll clipping -- it was getting cut off at
   the container edge. z-index sits above the sticky bars. */
.face-menu { position: fixed; z-index: 60;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,0.45); display: flex; flex-direction: column; }
.face-choice { background: none; border: none; color: var(--text); font-family: inherit;
  font-size: 12.5px; padding: 8px 14px; cursor: pointer; white-space: nowrap; text-align: left; }
.face-choice:hover { background: var(--surface); color: var(--mint); }
.face-choice.ignore:hover { color: var(--coral); }
.face-choice.name:hover { color: var(--lavender); }

/* inline single-face name picker, anchored over the cell */
.face-namer { position: absolute; top: 0; left: 0; z-index: 10; width: 240px;
  background: var(--surface); border: 1px solid var(--coral); border-radius: 12px;
  padding: 10px; box-shadow: 0 12px 28px rgba(0,0,0,0.5); }
.face-namer .name-wrap { display: flex; gap: 6px; }
.face-namer .name-input { font-size: 13px; padding: 8px 12px; }
.face-namer .name-save { padding: 8px 12px; font-size: 12.5px; }
.face-namer-cancel { background: none; border: none; color: var(--muted);
  font-size: 11.5px; cursor: pointer; margin-top: 6px; padding: 2px; }
.face-namer-cancel:hover { color: var(--coral); }

.name-wrap { position: relative; display: flex; gap: 8px; }
.name-input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 14px; outline: none; }
.name-input:focus { border-color: var(--coral); }
.name-save { flex: 0 0 auto; }
.name-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 240px; overflow: auto; box-shadow: 0 10px 24px rgba(0,0,0,0.4); }
/* fixed variant: positioned via JS from the input's rect so it escapes any
   overflow:auto scroll container (was being clipped inside the profile edit). */
.name-menu-fixed { position: fixed; left: 0; right: auto; top: 0; z-index: 80; }
.name-opt { padding: 9px 14px; font-size: 13.5px; cursor: pointer; display: flex;
  align-items: center; justify-content: space-between; gap: 8px; }
.name-opt:hover, .name-opt.active { background: var(--surface); }
.name-opt .opt-sub { color: var(--muted); font-size: 11.5px; margin-left: auto; }
/* alt-persona flag: distinguishes 'Hyper Misao' (alt) from a plain 'Misao' */
.name-opt .opt-persona { font-size: 10.5px; font-weight: 600; color: var(--lavender);
  background: rgba(184,148,255,0.14); border: 1px solid rgba(184,148,255,0.3);
  border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.name-opt .opt-pending { font-size: 10.5px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.name-opt.create { color: var(--mint); }
.name-opt.create b { color: var(--text); }

/* tag autocomplete: relative wrapper so the .name-menu anchors to the input.
   inline-flex + the input flexing keeps the input's original width in its row. */
.tag-ac-wrap { position: relative; display: inline-flex; flex: 0 1 auto; min-width: 0; }
.tag-ac-wrap > input { width: 100%; }

/* ignored faces review */
.ignored-section { margin: 8px 26px 60px; border-top: 1px solid var(--border); padding-top: 14px; }
.ignored-toggle { background: none; border: none; color: var(--muted); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center;
  gap: 8px; padding: 4px 0; }
.ignored-toggle:hover { color: var(--text); }
.ig-caret { transition: transform 0.15s ease; display: inline-block; }
.ignored-toggle.open .ig-caret { transform: rotate(90deg); }
.ig-count { background: var(--surface-2); color: var(--coral); font-weight: 700;
  border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.ignored-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 12px; }
.ignored-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); max-width: 900px; }
.ignored-grid .face-cell { cursor: pointer; }
.ignored-grid .face-cell::after { content: 'put back'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(23,18,42,0.72); color: var(--mint); font-size: 11px; font-weight: 600;
  opacity: 0; transition: opacity 0.12s ease; border-radius: 10px; }
.ignored-grid .face-cell:hover::after { opacity: 1; }

/* ---------- person profile modal ---------- */
.modal-profile { max-width: 560px; }
/* pad the right so the corner-anchored close button never overlaps the Edit btn */
.modal-profile .modal-body { padding-top: 20px; }
.profile-head { display: flex; align-items: center; gap: 16px; padding-right: 30px; }
.profile-head-text { flex: 1 1 auto; min-width: 0; }
/* circular, face-cropped avatar left of the name */
.profile-avatar { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%;
  overflow: hidden; background: var(--surface-2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; display: block; }
.avatar-initials { font-family: 'Fredoka', sans-serif; font-size: 28px; color: var(--muted); }
.profile-name { font-family: 'Fredoka', sans-serif; font-size: 26px; margin: 0 0 3px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
/* promotion badge(s) to the right of the name -- small text pills (placeholder
   for future per-promotion icons). */
.promo-badges { display: inline-flex; align-items: center; gap: 6px; }
.promo-badge { font-family: system-ui, sans-serif; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase; line-height: 1;
  padding: 4px 8px; border-radius: 999px; color: var(--lavender);
  background: color-mix(in srgb, var(--lavender) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--lavender) 40%, transparent);
  white-space: nowrap; }
.profile-sub { color: var(--muted); font-size: 14px; margin: 0; }
.promo-former { color: var(--muted); }

/* promotions chip editor (profile edit) */
.pf-promos-block { margin-top: 16px; }
.pf-promos-head { display: flex; align-items: center; justify-content: space-between; }
.pf-manage-link { background: none; border: none; color: var(--lavender); cursor: pointer;
  font-size: 12px; text-decoration: underline; padding: 0; }
.pf-manage-link:hover { color: var(--coral); }
.pf-promo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; min-height: 20px; }
.pf-promo-empty { color: var(--muted); font-size: 13px; }
.pf-promo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; }
.pf-promo-chip.former { opacity: 0.72; }
.pf-promo-name { font-weight: 600; }
.pf-promo-status { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--mint); cursor: pointer; }
.pf-promo-chip.former .pf-promo-status { color: var(--muted); }
.pf-promo-remove { background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 2px; }
.pf-promo-remove:hover { color: var(--coral); }
.pf-promo-add { margin-top: 4px; }

/* promotions manager modal */
.promo-manager-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.promo-manager-row { display: flex; align-items: center; gap: 8px; }
.promo-mgr-name { flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: 14px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 10px; }
.promo-mgr-count { flex: 0 0 auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
/* birthday: three compact inputs on one row. flex + min-width:0 so they SHARE the
   row and shrink to fit (width:100% each made them overflow and pushed the year
   input out of the modal -- the "year is inaccessible" bug). */
.pf-bday-row { display: flex; gap: 6px; width: 100%; }
.pf-bday-row input { flex: 1 1 0; min-width: 0; box-sizing: border-box; }   /* even thirds */
/* People modal: short single-value facts as compact tiles (label over value) in
   a responsive grid -- turns the old long uniform label:value list into a
   scannable stat block. Rich/multi-value facts still use .fact-row below. */
.profile-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px; margin: 18px 0 4px; }
.profile-stats:empty { display: none; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.stat-k { color: var(--muted); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 600; }
.stat-v { font-size: 15px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere; }

/* with the stat tiles above, the remaining fact-rows are the rich ones -- give
   them a touch more room and drop the redundant top border (tiles precede them). */
.profile-stats + .profile-facts { border-top: none; margin-top: 10px; }
.profile-facts { margin: 16px 0 6px; border-top: 1px solid var(--border); }
.fact-row { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; }
.fact-k { flex: 0 0 120px; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 600; padding-top: 1px; }
.fact-v { flex: 1; }
.fact-v a { color: var(--lavender); text-decoration: none; }
.fact-v a:hover { color: var(--coral); }
/* social links (Links row): each is an inline row of its platform icon + handle,
   separated by a comfortable gap so X and Instagram read as distinct chips. */
.fact-v .social-link { display: inline-flex; align-items: center; gap: 5px; margin-right: 16px; }
.fact-v .social-link:last-child { margin-right: 0; }
.social-ic { width: 15px; height: 15px; vertical-align: -0.15em; }
/* tag-team names link to the team card */
.team-link { cursor: pointer; }
.fact-v a.team-inactive { color: var(--muted); }
/* team card: member avatar + name rows. Spaced out more than the people modal --
   the members ARE the team, so they get real visual weight (grid of face crops). */
.team-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin: 20px 0 6px; }
.team-members.hidden { display: none; }
.team-member { display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; color: var(--text);
  font: inherit; transition: border-color 0.12s, transform 0.12s; }
.team-member:hover { border-color: var(--coral); transform: translateY(-1px); }
.team-member-avatar { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  overflow: hidden; background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; }
.team-member-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-member-avatar .avatar-initials { font-size: 20px; }
.team-member-name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-bio { font-size: 14px; line-height: 1.55; color: var(--text); margin: 14px 0 4px; }
.profile-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }

/* Edit mode: a scrollable field area with a PINNED Save/Cancel bar at the bottom,
   so Save is always visible and clearly separated from the fields (it used to be
   buried mid-form between the theme song and the persona/merge tools). */
#profileEdit { display: flex; flex-direction: column; min-height: 0; max-height: 74vh; }
.pf-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 6px; }
.pf-actions-sticky { position: sticky; bottom: 0; margin-top: 0;
  padding: 14px 0 4px; background: var(--surface);
  border-top: 1px solid var(--border); justify-content: flex-end; }
.pf-actions-sticky .btn-accent { padding: 10px 22px; }   /* make Save prominent */
/* section headers grouping the fields */
.pf-group-label { font-family: 'Fredoka', sans-serif; font-size: 14px; color: var(--lavender);
  margin: 16px 0 2px; }
.pf-scroll .pf-group-label:first-child { margin-top: 4px; }
/* advanced (persona / merge) collapsed by default */
.pf-advanced { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 6px; }
.pf-advanced > summary { cursor: pointer; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted); font-weight: 600; padding: 8px 0; list-style: none; }
.pf-advanced > summary::-webkit-details-marker { display: none; }
.pf-advanced > summary::before { content: '▸ '; }
.pf-advanced[open] > summary::before { content: '▾ '; }

/* low-priority toggle (Advanced section): an unobtrusive pill that lights up
   lavender when active. Rare-use, so it stays quiet until pressed. */
.profile-priority { margin: 4px 0 14px; }
.pf-priority-toggle { display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  font-family: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; }
.pf-priority-toggle:hover { color: var(--text); border-color: var(--lavender); }
.pf-priority-toggle.active { color: var(--lavender); border-color: var(--lavender);
  background: rgba(180,150,255,0.12); }
.pf-priority-icon { font-size: 15px; line-height: 1; }

.fetch-wrap { position: relative; }
/* opens UPWARD from the button: the fetch button sits low in the profile modal,
   and the modal card scrolls/clips, so a downward menu was hidden below the fold */
.fetch-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 8; min-width: 200px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 -10px 24px rgba(0,0,0,0.45); display: flex; flex-direction: column; }
.fetch-opt { background: none; border: none; color: var(--text); font-family: inherit;
  font-size: 13.5px; padding: 10px 16px; cursor: pointer; text-align: left; white-space: nowrap; }
.fetch-opt:hover { background: var(--surface); color: var(--mint); }
.profile-fetch-status { display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); font-size: 13px; }
.profile-fetch-status .btn-cancel { margin-left: auto; padding: 5px 12px; color: var(--coral);
  border-color: var(--coral); }

.profile-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; }
.profile-form label, .profile-bio-label { display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted);
  font-weight: 600; }
.profile-form input, .profile-bio-label textarea { font-family: inherit; font-size: 14px;
  text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
  outline: none; }
.profile-form input:focus, .profile-bio-label textarea:focus { border-color: var(--coral); }
.profile-bio-label { margin-top: 12px; }
.profile-bio-label textarea { resize: vertical; }

.profile-merge { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- teams manager ---------- */
.teams-section { padding: 10px 26px 0; }
.teams-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.teams-list { display: flex; flex-wrap: wrap; gap: 8px; }
.team-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 13px; cursor: pointer; font-family: inherit; color: var(--text); font-size: 13.5px; text-align: left; }
.team-chip:hover { border-color: var(--lavender); }
/* name + belt (right after the name) + nickname on one line; wraps and lets the
   card grow to fit a champion team rather than clipping the icon. */
.tc-title { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-weight: 600; }
.tc-title .belt-svg { flex: 0 0 auto; }
.tc-members { color: var(--muted); font-size: 11px; }
/* inactive (disbanded) teams: still shown, greyed out */
.team-chip.inactive { opacity: 0.55; }
.tc-inactive-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; }
.team-inactive { color: var(--muted); opacity: 0.75; }
.team-status-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-top: 10px; }
.team-status-lbl select { display: block; margin-top: 5px; font-family: inherit; font-size: 13.5px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 10px; }
.team-editor { margin-top: 12px; padding: 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); max-width: 620px;
  display: flex; flex-direction: column; gap: 8px; }
.team-editor-row { display: flex; gap: 8px; }
.team-editor input { flex: 1; padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 13.5px; outline: none; }
.team-editor input:focus { border-color: var(--coral); }
.team-editor-actions { display: flex; gap: 10px; margin-top: 4px; }
.team-editor-actions .btn-danger { margin: 0; margin-left: auto; }
