/* ---------- face match: cluster review ----------
   Trusted+/admin tool for turning unlabeled faces into named people. Split
   out of the old /people page (which mixed this with roster browsing); the
   named-so-far strip and its person chips were dropped in that split --
   roster.html's grid is the "browse everyone" surface now, and role/status
   editing lives in the profile modal instead of an inline quick-toggle. */
.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: var(--title-font); 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; }

/* While the cluster data is still loading, hold back the whole cluster surface so
   the header renders first (no empty-region flash above it). */
#facematchView.clusters-pending .cluster-controls,
#facematchView.clusters-pending #reclusterNote,
#facematchView.clusters-pending #clusterMetaRow,
#facematchView.clusters-pending #clusterGrid,
#facematchView.clusters-pending #clustersEmpty { 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; }
/* on-demand cluster starter (prod): sits where the grid would be, matching the
   cluster surface's 26px gutter and its top nudge away from the teams section. */
.cluster-start { padding: 4px 26px 8px; margin-top: 26px; }
.cluster-start-sub { margin: 0 0 12px; color: var(--muted); font-size: 13px;
  max-width: 52ch; }
/* 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: var(--radius-pill);
  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;
  text-transform: var(--btn-tt); letter-spacing: var(--btn-ls);
  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: var(--title-font); 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: var(--radius-pill); 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: var(--radius-pill); 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: var(--radius-pill); 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: var(--radius-pill); 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: var(--title-font); font-size: 28px; color: var(--muted); }

/* ---------- person modal: the design's two-column portrait layout ----------
   A 400px portrait panel beside a scrolling detail column, per the design.
   The card is a GRID, and the portrait is a real grid child rather than a
   float inside .modal-body -- edit mode then only has to drop the portrait
   column (see .modal-person.is-editing below) to hand its two-column form the
   full width, without .pf-scroll or the sticky save bar changing at all. */
/* overflow:hidden overrides .modal-card's `auto` on purpose: with the body
   scrolling, a scrollable card too would give two nested scrollbars and let the
   portrait slide out of view. */
.modal-person { max-width: min(1000px, 100%); display: grid;
  grid-template-columns: 400px minmax(0, 1fr); align-items: stretch;
  overflow: hidden; max-height: 88vh; }
/* The card itself no longer scrolls -- the detail column does, so the portrait
   stays put instead of sliding away with the text. */
.modal-person > .modal-body { overflow: auto; max-height: 88vh;
  padding: 26px 28px; }
.profile-portrait { position: relative; overflow: hidden; min-height: 580px;
  background: var(--surface-2); display: flex; flex-direction: column;
  justify-content: space-between; padding: 18px; }
.profile-portrait-img { position: absolute; inset: 0; }
.profile-portrait-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-portrait-img .avatar-initials { position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: 72px; }
/* Both overlays sit above the photo and get their own scrim, so light and dark
   photos alike keep the text legible. */
.profile-portrait-pill, .profile-portrait-foot { position: relative; z-index: 1; }
.profile-portrait-pill { align-self: flex-start; display: inline-flex;
  align-items: center; gap: 7px; padding: 6px 11px;
  border-radius: var(--radius-pill); background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: #fff; font-family: var(--mono-font); font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase; backdrop-filter: blur(4px); }
.profile-portrait-pill.hidden { display: none; }
.profile-portrait-pill::before { content: ""; width: 5px; height: 5px; flex: none;
  border-radius: 99px; background: var(--lavender); }
.profile-portrait-foot { display: flex; flex-direction: column; gap: 6px; }
.profile-portrait-count { font-family: var(--mono-font); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: #fff;
  text-shadow: 0 1px 6px color-mix(in srgb, var(--ink) 90%, transparent); }
/* Edit mode wants the whole card: the portrait column collapses and the body
   spans both tracks. */
.modal-person.is-editing { grid-template-columns: minmax(0, 1fr); }
.modal-person.is-editing .profile-portrait { display: none; }

.profile-name { font-family: var(--title-font); font-size: 26px; margin: 0 0 3px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.modal-person .profile-name { font-size: 40px; letter-spacing: -0.04em; line-height: 1; }
/* Epithet as the coral eyebrow above the name, per the design. */
.profile-eyebrow { font-family: var(--mono-font); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--coral);
  margin-bottom: 8px; }
.profile-eyebrow.hidden { display: none; }
.modal-person .profile-sub { font-size: 19px; margin-top: 7px; }

/* Recent shots -- the design's closing 4-up strip. */
.profile-shots-block { display: grid; gap: 8px; margin-top: 20px; }
.profile-shots-block.hidden { display: none; }
.profile-shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.profile-shot { height: 76px; padding: 0; border: 0; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); cursor: pointer;
  outline: 1px solid transparent; transition: outline-color 0.12s; }
.profile-shot:hover { outline-color: var(--coral); }
.profile-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 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: var(--mono-font); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase; line-height: 1;
  padding: 4px 8px; border-radius: var(--radius-pill); 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: var(--radius-pill); 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: var(--radius-pill); 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; }
/* 152px, not the shared 130px: "Main roster · Wrestler" and a written-out
   birthday both wrap to two lines at 130, which left the tiles ragged. */
.modal-person .profile-stats { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
.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); }
/* Mono/tracked keys over plain values, matching the design's Debut/Birthday/
   Trainer/Finisher grid and the photo modal's .detail-k -- one label idiom
   across every info surface. */
.stat-k { color: var(--muted); font-family: var(--mono-font); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.14em; }
.stat-v { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }

/* The design renders tag teams and socials as CHIP rows under a mono eyebrow,
   not as another key/value line. renderProfileView still emits .fact-row for
   them, so these style the links inside those rows into chips rather than
   requiring a JS rewrite -- the row's own key column stays as the eyebrow. */
.modal-person .fact-v a.team-link,
.modal-person .fact-v a.persona-link,
.modal-person .fact-v .social-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; margin: 0 6px 6px 0;
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px;
}
.modal-person .fact-v a.team-link:hover,
.modal-person .fact-v a.persona-link:hover,
.modal-person .fact-v .social-link:hover { border-color: var(--coral); color: var(--coral); }
.modal-person .fact-v a.team-inactive { color: var(--muted); opacity: 0.75; }
/* the chip margin replaces the inline spacing the flat links used */
.modal-person .fact-v .social-link { margin-right: 6px; }
.modal-person .fact-row { align-items: flex-start; padding: 11px 0; }
/* Chips carry their own bottom margin so a wrapped row spaces evenly; the
   row's own padding absorbs the last line's. */
.modal-person .fact-v { display: flex; flex-wrap: wrap; align-items: center; }

/* 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; }
/* Mono eyebrow, matching .stat-k and the photo modal's .detail-k. Narrower
   than the shared 120px because the chip rows beside it want the width. */
.modal-person .fact-k { flex: 0 0 96px; font-family: var(--mono-font);
  font-size: 9px; letter-spacing: 0.14em; font-weight: 400; padding-top: 9px; }
.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 card: stack + status chips ----------
   Per the design, a tag team has no portrait -- the overlapped member avatars
   ARE the identity, so they lead the header where a person's photo would. */
.team-stack { display: flex; align-items: center; flex: 0 0 auto; }
.team-stack.hidden { display: none; }
/* Square (var(--radius), like every other image block here) rather than
   circular: these read as photo tiles, matching the roster cards and the
   "Together, recently" strip, instead of as avatar bubbles. */
.team-stack-av {
  width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); border: 3px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  margin-right: -18px;   /* the overlap */
}
/* Stack front-to-back: the first avatar sits on top of the next, so the
   overlap reads as a deck rather than a chain. */
.team-stack-av:nth-child(1) { z-index: 4; }
.team-stack-av:nth-child(2) { z-index: 3; }
.team-stack-av:nth-child(3) { z-index: 2; }
.team-stack-av:nth-child(4) { z-index: 1; margin-right: 0; }
.team-stack-av:last-child { margin-right: 0; }
.team-stack-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-stack-av .avatar-initials { font-size: 22px; }
/* ---------- team card: banded layout ----------
   The design builds the team card as four full-width BANDS split by rules
   (header / members / facts / recent shots) rather than one padded column, so
   .modal-body's padding moves onto each band and the rules reach both edges.
   Wider than the person modal too -- the member grid and the 5-up shot strip
   both need the room. */
/* max-width, not just width: .modal-profile's shared max-width:560px (also
   used by the person modal) was silently capping this at 560px regardless of
   the width:820px below -- max-width always wins over width in box sizing,
   independent of source order/specificity. Pre-existing since the team card
   was built; only surfaced now while widening the edit panel below and
   noticing the "view" width didn't match either. */
.modal-team { width: min(820px, 100%); max-width: 820px; }
/* Edit mode wants even more room than the 820px view width: the member
   picker and two-column identity fields felt cramped at 820 (a width sized
   for the band-based read-only content, not a form). Same idea as
   .modal-person.is-editing widening for its own editor, just without a
   portrait column to drop since the team card never had one. */
.modal-team.is-editing { width: min(960px, 100%); max-width: 960px; }
/* View mode zeroes .modal-body's padding -- it's built as full-bleed BANDS
   (each .team-band re-applies its own padding below) so the dividing rules
   reach both edges. #teamCardEdit is not a band -- it's the same
   .pf-scroll + sticky-action shape the person profile editor uses (see
   #profileEdit/.pf-scroll/.pf-actions-sticky) -- so it needs its own padding
   back, or its fields run edge-to-edge against the modal walls. */
.modal-team .modal-body { padding: 0; }
#teamCardEdit { display: flex; flex-direction: column; min-height: 0;
  max-height: 74vh; padding: 26px 30px; }
.team-band { padding: 22px 30px; border-bottom: 1px solid var(--border); }
.team-band.hidden { display: none; }
.team-band:last-child { border-bottom: 0; }
/* padding-right keeps the Edit/Flag button clear of the absolutely-positioned
   modal close (×), which sits at the card's top-right and would otherwise
   overlap it -- the two were literally on top of each other (-11px gap). */
.team-band-head { display: flex; align-items: flex-start; gap: 22px;
  padding: 28px 30px 24px; padding-right: 74px; }
/* Eyebrow and status chip share the top line, per the design. They are set at
   different sizes (10px vs 9px), so align on the BASELINE -- centering boxes of
   unequal height left the two labels visibly off by ~5px. */
.team-eyebrow-row { display: flex; align-items: baseline; gap: 12px; }
.team-status { display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--mono-font); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); }
.team-status.hidden { display: none; }
/* The dot has no text, so it has no baseline of its own to align on -- nudge it
   up to sit optically centred against the cap height of the label beside it. */
.team-status::before { content: ""; width: 5px; height: 5px; flex: none;
  border-radius: 99px; background: currentColor; align-self: center;
  position: relative; top: 1px; }
.team-status.is-on { color: var(--mint); }

.modal-team .profile-head-text { flex: 1 1 auto; min-width: 0; }
.modal-team .profile-name { font-size: 34px; letter-spacing: -0.03em;
  line-height: 1; margin: 8px 0 0; }
.modal-team .profile-sub { font-size: 15px; color: var(--muted); margin-top: 6px; }

/* Member rows: two-up on desktop, per the design's 1fr 1fr band. */
.team-members { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.team-members.hidden { display: none; }
.team-member { display: flex; align-items: center; gap: 13px; text-align: left;
  padding: 12px 14px; 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; }
.team-member:hover { border-color: var(--coral); }
/* Square, matching .team-stack-av above. */
.team-member-avatar { flex: 0 0 auto; width: 46px; height: 46px;
  border-radius: var(--radius);
  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: 18px; }
/* Name over epithet. min-width:0 on both so a long name ellipses inside the
   row instead of forcing the grid column wider. */
.team-member-text { flex: 1 1 auto; min-width: 0; display: flex;
  flex-direction: column; gap: 3px; }
.team-member-name { min-width: 0; font-weight: 500; font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member-epithet { min-width: 0; font-family: var(--mono-font); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member-chev { flex: 0 0 auto; display: flex; align-items: center;
  color: var(--muted); }
.team-member-chev .chev { width: 14px; height: 14px; }
.team-member:hover .team-member-chev { color: var(--coral); }

/* Fact strip + the primary action on one line. */
.team-band-facts { display: flex; align-items: center; gap: 34px; }
.team-band-spacer { flex: 1 1 auto; }
.team-stats { display: flex; align-items: center; gap: 34px; }
.team-stat { display: flex; flex-direction: column; gap: 3px; }
.team-stat-k { font-family: var(--mono-font); font-size: 9px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.team-stat-v { font-size: 15px; }

.team-shots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px;
  margin-top: 9px; }
.team-shot { height: 96px; padding: 0; border: 0; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); cursor: pointer;
  transition: outline-color 0.12s; outline: 1px solid transparent; }
.team-shot:hover { outline-color: var(--coral); }
.team-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.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; }
/* Pinned footer, per the design: "See photos" is the thing people came for, so
   it takes the width and stays reachable on a long profile instead of sitting
   below the fold under the facts. Opaque background -- content scrolls under.
   Scoped to .modal-person so the team card (which shares .profile-actions but
   is short) keeps its in-flow row. */
.modal-person #profileView .profile-actions {
  position: sticky; bottom: 0; z-index: 2;
  margin-top: 20px; padding: 14px 0 4px;
  background: var(--surface); border-top: 1px solid var(--border);
}
.modal-person #profileView .profile-actions #profilePhotosBtn { flex: 1; justify-content: center; }

/* 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: var(--title-font); font-size: 14px; color: var(--lavender);
  margin: 16px 0 2px; }
.pf-scroll .pf-group-label:first-child { margin-top: 4px; }
/* Small live preview beside the photo-pick controls -- edit mode hides the
   portrait panel entirely (.modal-person.is-editing .profile-portrait), so
   without this a "Force fresh auto-pick" click had no visible result until
   Save+Close returned to view mode. Square + modest size: this is a status
   indicator for the buttons beside it, not a second portrait. */
.pf-photo-row { display: flex; gap: 12px; align-items: flex-start; }
.pf-photo-preview { flex: 0 0 auto; width: 72px; height: 72px; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.pf-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.pf-photo-preview-ph { display: flex; align-items: center; justify-content: center; }
.pf-photo-info { flex: 1; min-width: 0; }
/* 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: var(--radius-pill);
  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 (list + editor) MOVED to features/roster.css -- it lives on
   the roster page's Tag teams tab now, not this page. */

/* ---------- profile / team modals at phone width ----------
   Neither had any responsive CSS: they relied on .modal-card shrinking inside
   .modal's 24px padding, which leaves ~272px for a layout drawn at 560px. */
@media (max-width: 480px) {
  #profileModal, #teamCardModal { padding: 12px; }
  .modal-profile { max-width: none; }
  /* Header wraps: at 390px the name and the Edit/Flag button were overlapping
     (the head is one flex row, and neither the text nor the button could give). */
  .profile-head { flex-wrap: wrap; gap: 12px; padding-right: 34px; }
  /* The team head still wraps its text below the avatar stack. The PERSON head
     no longer has an avatar in the row (it moved to the portrait banner), so
     order:3 stranded Edit on a line of its own ABOVE the name -- there put the
     name first and let the button sit beside it. */
  .modal-team .profile-head-text { flex: 1 1 100%; order: 3; }
  .modal-person .profile-head { flex-wrap: nowrap; align-items: flex-start; }
  .modal-person .profile-head-text { flex: 1 1 auto; order: 0; }
  /* The two-column split collapses: the portrait becomes a wide banner above
     the details rather than a 400px column that would leave ~0 for the text. */
  .modal-person { grid-template-columns: minmax(0, 1fr); max-width: none; }
  .modal-person > .modal-body { overflow: visible; max-height: none;
    padding: 18px 16px; }
  .profile-portrait { min-height: 0; height: 210px; padding: 12px; }
  /* The × now rides ON the portrait banner, so it needs its own chip to stay
     legible over a bright photo. */
  .modal-person .modal-close { background: color-mix(in srgb, var(--ink) 62%, transparent);
    color: #fff; border-radius: var(--radius-pill); width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; top: 12px; right: 12px; backdrop-filter: blur(4px); }
  .modal-person .profile-name { font-size: 28px; }
  .modal-person .profile-sub { font-size: 15px; }
  /* Portrait + scrolling body would be two nested scrollers on a phone; the
     card takes the scroll back so the whole thing moves as one. */
  .modal-person.modal-card { max-height: 88vh; overflow: auto; }
  .profile-shots { grid-template-columns: repeat(4, 1fr); }
  .profile-shot { height: 64px; }
  .modal-team { max-width: none; }
  .modal-team .profile-name { font-size: 26px; }
  .team-stack-av { width: 52px; height: 52px; margin-right: -14px; }
  /* Bands lose the wide desktop gutter but keep their dividing rules. */
  .team-band { padding: 16px 16px; }
  .team-band-head { padding: 18px 16px 16px; }
  /* The head is .profile-head-based above, so the wrap rules there apply; the
     stack has to opt out of the 100% basis those give .profile-head-text. */
  .team-band-head { flex-wrap: wrap; gap: 12px; padding-right: 34px; }
  /* Facts stack above a full-width action: at 390px the strip + button on one
     row squeezed "Photos together" onto three lines. */
  .team-band-facts { flex-wrap: wrap; gap: 16px; }
  .team-stats { gap: 22px; }
  .team-band-spacer { display: none; }
  .team-band-facts .btn-accent { flex: 1 1 100%; justify-content: center; }
  /* 3-up, per the design's mobile team modal. */
  .team-shots { grid-template-columns: repeat(3, 1fr); }
  .team-shot { height: 74px; }
  /* Stat/fact columns collapse -- the shared .fact-k is a hard 120px key
     column, which leaves almost nothing for the value at this width. */
  .modal-person .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-person .fact-row { flex-direction: column; gap: 6px; }
  .modal-person .fact-k { flex: 0 0 auto; padding-top: 0; }
  /* Edit mode's two-column form is unreadable at ~270px. */
  .profile-form { grid-template-columns: 1fr; }
  /* Member rows go full width: the 150px auto-fill minimum left a half-width
     card whose name truncated after ~9 characters. */
  .team-members { grid-template-columns: 1fr; }
}
