/* ==========================================================================
   profile-shell.css — the Profile Shell (`pf-*`)
   --------------------------------------------------------------------------
   One shell, two modes: pages/profile.html (owner, `body.pf-owner`) and
   pages/user.html (public visitor) share the exact same markup and styling.

   Authored ONLY in the neutral `--ss-*` token set defined by series-shell.css,
   which MUST be loaded BEFORE this file (same order global-search.css uses).

   Zones:  pf-identity  →  pf-controlzone (sticky)  →  pf-section ledger
   Spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 only.

   Legacy class names (.stats-*, .genre-*, .rep-*, .titles-compact,
   .follow-count, .expired-premium-banner, .pshell-panel, .tabs/.tab) are kept
   as aliases because existing scripts write that markup — the old page-local
   <style> blocks were deleted and their rules re-authored here on `--ss-*`.
   ========================================================================== */

/* ---------- Shell frame ---------- */

.pf-shell {
  max-width: var(--ss-max, 1120px);
  margin: 0 auto;
  padding: 0 16px 48px;
  color: var(--ss-text);
}
.pf-shell *,
.pf-shell *::before,
.pf-shell *::after { box-sizing: border-box; }
.pf-shell a { color: inherit; }

/* Owner-only affordances. Same pattern as `body:not(.gs-staff) [data-staff-only]`. */
body:not(.pf-owner) [data-owner-only] { display: none !important; }

/* Anchor/hash jumps land below the site header + the sticky control zone. */
html { scroll-padding-top: calc(var(--header-height, 64px) + 64px); }

/* ---------- Buttons: one neutral set, no purple, 44px touch target ---------- */

.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--ss-radius, 8px);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--ss-transition, 120ms ease),
              border-color var(--ss-transition, 120ms ease),
              color var(--ss-transition, 120ms ease);
}
.pf-btn i { font-size: 16px; }
.pf-btn:disabled { opacity: .55; cursor: not-allowed; }
.pf-btn-primary { background: var(--ss-primary-bg); color: var(--ss-primary-fg); }
.pf-btn-primary:hover:not(:disabled) { background: var(--ss-primary-bg-hover); }
.pf-btn-secondary {
  background: var(--ss-secondary-bg);
  color: var(--ss-secondary-fg);
  border-color: var(--ss-secondary-border);
}
.pf-btn-secondary:hover:not(:disabled) { background: var(--ss-secondary-bg-hover); }
.pf-btn-ghost { background: transparent; color: var(--ss-ghost-fg); }
.pf-btn-ghost:hover:not(:disabled) { background: var(--ss-ghost-bg-hover); }
.pf-btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.pf-btn:focus-visible { outline: 2px solid var(--ss-border-strong); outline-offset: 2px; }

/* Neutralise legacy buttons that scripts still render inside the shell. */
.pf-shell .btn-primary {
  background: var(--ss-primary-bg) !important;
  color: var(--ss-primary-fg) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* ---------- Zone 1: identity strip ---------- */

.pf-identity {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--ss-border);
}

/* Banner: kept (it is an existing customisation feature) but demoted to a
   slim strip above the identity strip instead of a 200px hero. */
.pf-shell .profile-cover {
  /* Taller, aspect-ratio driven banner so much more of the uploaded image is
     visible on both mobile and desktop, while still staying a clean strip
     above the identity block (clamped so very wide screens don't get a
     giant hero). */
  height: auto;
  aspect-ratio: 3 / 1;
  min-height: 150px;
  max-height: 300px;
  margin: 16px 0 0;
  border-radius: var(--ss-radius, 8px);
  overflow: hidden;
  background: var(--ss-surface-2);
}
.pf-shell .profile-cover:empty { display: none; }
.pf-shell .profile-cover::after { display: none; }
.pf-shell .profile-cover > img.profile-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* On narrow screens a 3:1 strip is only ~110px tall, which hides most of the
   image, so use a taller ratio there instead. */
@media (max-width: 640px) {
  .pf-shell .profile-cover {
    aspect-ratio: 16 / 9;
    min-height: 100px;
    max-height: 150px;
  }
}

.pf-identity__avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ss-surface-2);
  border: 1px solid var(--ss-border);
  margin: 0;
}
.pf-identity__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pf-identity__main { min-width: 0; }

.pf-nameline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pf-name {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ss-text);
  text-align: left;
}
.pf-identity .profile-badges-row,
.pf-identity .profile-extra-titles { justify-content: flex-start; }

.pf-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ss-text-muted);
  font-variant-numeric: tabular-nums;
}
.pf-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.pf-meta__sep { opacity: .5; }
.pf-meta .fa-fire { color: var(--ss-hiatus); }

.pf-bio {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ss-text);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pf-bio:empty { display: none; }

.pf-identityfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.pf-counts {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ss-text-muted);
}
.pf-counts .follow-count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  cursor: pointer;
  border-radius: var(--ss-radius-chip, 6px);
}
.pf-counts .follow-count__value {
  font-weight: 600;
  color: var(--ss-text);
  font-variant-numeric: tabular-nums;
}
.pf-counts .follow-count__label { color: var(--ss-text-muted); }
.pf-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-actions .btn { min-height: 44px; }

/* XP bar inside the identity strip (kept: level progress is a real feature). */
.pf-xp { margin-top: 12px; max-width: 360px; }
.pf-shell .exp-bar { height: 6px; border-radius: 999px; background: var(--ss-surface-2); }
.pf-shell .exp-bar__fill { background: var(--ss-primary-bg); }
.pf-shell .exp-bar__label {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ss-text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .pf-identity { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .pf-identity__avatar { width: 64px; height: 64px; }
  .pf-name { font-size: 19px; }
}

/* ---------- Zone 2: sticky control zone ---------- */

.pf-controlzone {
  position: sticky;
  top: var(--header-height, 64px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  background: var(--ss-bg);
  border-bottom: 1px solid var(--ss-border);
}
.pf-tablist {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--ss-radius, 8px);
  background: var(--ss-surface);
  border: 1px solid var(--ss-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.pf-tablist::-webkit-scrollbar { display: none; }
.pf-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ss-text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--ss-radius-chip, 6px);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ss-transition, 120ms ease), color var(--ss-transition, 120ms ease);
}
.pf-tab:hover { color: var(--ss-text); }
.pf-tab[aria-selected="true"],
.pf-tab.active {
  background: var(--ss-primary-bg);
  color: var(--ss-primary-fg);
}
.pf-tab:focus-visible { outline: 2px solid var(--ss-border-strong); outline-offset: 2px; }

/* ---------- Zone 3: the ledger ---------- */

.pshell-panel { display: none; }
.pshell-panel.active { display: block; }
.pshell-panel.active { scroll-margin-top: calc(var(--header-height, 64px) + 64px); }

.pf-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--ss-border);
}
.pf-section:last-child { border-bottom: 0; }
.pf-sectionhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pf-sectionhead__label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ss-text-muted);
}
.pf-sectionhead__aside {
  font-size: 13px;
  color: var(--ss-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pf-subhead,
.pshell-subhead {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ss-text-muted);
}

/* Stat row — one aligned numeric row, tabular-nums, no per-cell box. */
.pf-statrow,
.pf-shell .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 12px;
  text-align: left;
}
.pf-shell .stats-card { padding: 0; border: 0; background: none; margin: 0; }
.pf-shell .stats-cell { padding: 0; border-radius: 0; background: none; }
.pf-shell .stats-value {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ss-text);
  font-variant-numeric: tabular-nums;
}
.pf-shell .stats-label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ss-text-muted);
  letter-spacing: .02em;
}
@media (max-width: 560px) {
  .pf-statrow,
  .pf-shell .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Genre ledger rows */
.pf-shell .genre-section { margin: 0; padding: 0; border-top: 0; }
.pf-shell .genre-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pf-shell .genre-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ss-text-muted);
}
.pf-shell .genre-hint { font-size: 13px; color: var(--ss-text-muted); }
.pf-shell .genre-bar { display: none; }
.pf-shell .genre-legend { display: flex; flex-direction: column; gap: 12px; }
.pf-shell .genre-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 56px;
  grid-template-areas: "rank name pct" "rank track track";
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  animation: pfRowIn .3s ease forwards;
  animation-delay: calc(var(--gr-i, 0) * 40ms);
}
@keyframes pfRowIn { to { opacity: 1; transform: none; } }
.pf-shell .genre-rank {
  grid-area: rank;
  font-size: 12px;
  font-weight: 600;
  color: var(--ss-text-muted);
  font-variant-numeric: tabular-nums;
}
.pf-shell .genre-name {
  grid-area: name;
  font-size: 14px;
  color: var(--ss-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-shell .genre-pct {
  grid-area: pct;
  justify-self: end;
  font-size: 13px;
  color: var(--ss-text-muted);
  font-variant-numeric: tabular-nums;
}
.pf-shell .genre-track {
  grid-area: track;
  height: 6px;
  border-radius: 999px;
  background: var(--ss-surface-2);
  overflow: hidden;
}
.pf-shell .genre-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ss-primary-bg);
  transition: width .4s ease;
}
.pf-shell .genre-empty { font-size: 14px; color: var(--ss-text-muted); }
.pf-shell .genre-more {
  margin-top: 16px;
  background: transparent;
  border: 1px solid var(--ss-border-strong);
  color: var(--ss-text);
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--ss-radius, 8px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.pf-shell .genre-more:hover { background: var(--ss-ghost-bg-hover); }

/* Karma over time */
.pf-shell .rep-card { margin: 0; padding: 0; border: 0; background: none; }
.pf-shell .rep-head { margin-bottom: 12px; }
.pf-shell .rep-title { display: none; }
.pf-shell .rep-now { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pf-shell .rep-now__value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  color: var(--ss-text);
  font-variant-numeric: tabular-nums;
}
.pf-shell .rep-now__delta { font-size: 13px; color: var(--ss-text-muted); font-variant-numeric: tabular-nums; }
.pf-shell .rep-graph-wrap { position: relative; width: 100%; }
.pf-shell #repGraph { width: 100%; height: 180px; display: block; touch-action: pan-y; }
.pf-shell .rep-ranges { display: flex; gap: 4px; flex-wrap: wrap; }
.pf-shell .rep-range {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ss-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--ss-radius-chip, 6px);
  cursor: pointer;
  transition: color var(--ss-transition, 120ms ease), background-color var(--ss-transition, 120ms ease);
}
.pf-shell .rep-range:hover { color: var(--ss-text); background: var(--ss-ghost-bg-hover); }
.pf-shell .rep-range.active {
  background: var(--ss-surface-2);
  border-color: var(--ss-border);
  color: var(--ss-text);
}
.pf-shell .rep-tooltip {
  position: absolute;
  transform: translate(-50%, -125%);
  background: var(--ss-surface);
  border: 1px solid var(--ss-border);
  padding: 8px;
  border-radius: var(--ss-radius, 8px);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  white-space: nowrap;
  color: var(--ss-text);
  box-shadow: var(--ss-shadow);
}
.pf-shell .rep-tooltip strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-shell .rep-tooltip .rep-tooltip__date { color: var(--ss-text-muted); font-size: 12px; }

/* Titles summary row */
.pf-shell .titles-compact,
.pf-titlesrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius, 8px);
  background: var(--ss-surface);
}
.pf-shell .titles-compact__label { font-weight: 600; font-size: 14px; color: var(--ss-text); }
.pf-shell .titles-compact__state { font-size: 13px; color: var(--ss-text-muted); }
.pf-shell .titles-compact__spacer { flex: 1 1 auto; }
.pf-shell .titles-compact__view {
  background: var(--ss-secondary-bg);
  border: 1px solid var(--ss-secondary-border);
  color: var(--ss-secondary-fg);
  font-family: inherit;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--ss-radius, 8px);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
}
.pf-shell .titles-compact__view:hover { background: var(--ss-secondary-bg-hover); }
.pf-shell .titles-grid { margin-top: 12px; }

/* Options panel (owner power grouped in one place) */
.pf-options {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius, 8px);
  background: var(--ss-surface);
  display: grid;
  gap: 12px;
}
.pf-options[hidden] { display: none; }
.pf-options__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ss-text);
}
.pf-options__label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ss-text-muted); }
.pf-options__value { color: var(--ss-text-muted); font-size: 13px; word-break: break-all; }

/* Owner entry points — neutral, no gradient */
.pf-shell .premium-customize-entry { margin: 0; }
.pf-shell .premium-customize-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--ss-radius, 8px);
  border: 1px solid var(--ss-border);
  background: var(--ss-surface);
  color: var(--ss-text);
  text-decoration: none;
  box-shadow: none;
}
.pf-shell .premium-customize-btn:hover { background: var(--ss-surface-2); transform: none; }
.pf-shell .premium-customize-btn i {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ss-surface-2);
  color: var(--ss-text-muted);
  box-shadow: none;
  font-size: 14px;
}
.pf-shell .premium-customize-btn span { font-weight: 600; font-size: 14px; }
.pf-shell .premium-customize-btn small { margin-left: auto; color: var(--ss-text-muted); font-size: 12px; text-align: right; }
@media (max-width: 560px) {
  .pf-shell .premium-customize-btn small { display: none; }
}

/* Expired premium notice — neutral surface, hue only on the icon */
.pf-shell .expired-premium-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  max-width: none;
  padding: 12px;
  border-radius: var(--ss-radius, 8px);
  border: 1px solid var(--ss-border);
  background: var(--ss-surface);
  box-shadow: none;
}
.pf-shell .expired-premium-banner__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ss-surface-2);
  color: var(--ss-hiatus);
  font-size: 14px;
  flex: 0 0 auto;
}
.pf-shell .expired-premium-banner__body { flex: 1 1 240px; min-width: 0; }
.pf-shell .expired-premium-banner__title { font-weight: 600; font-size: 14px; color: var(--ss-text); margin-bottom: 2px; }
.pf-shell .expired-premium-banner__text { font-size: 13px; color: var(--ss-text-muted); line-height: 1.45; }
.pf-shell .expired-premium-banner__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--ss-radius, 8px);
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  background: var(--ss-primary-bg);
  color: var(--ss-primary-fg);
  box-shadow: none;
  transition: background-color var(--ss-transition, 120ms ease);
}
.pf-shell .expired-premium-banner__btn:hover { background: var(--ss-primary-bg-hover); transform: none; box-shadow: none; }
@media (max-width: 560px) {
  .pf-shell .expired-premium-banner__btn { width: 100%; justify-content: center; }
}

/* ---------- Secondary navigation: one plain text switcher ---------- */

.pf-subtabs,
.pf-shell .tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: none;
  width: auto;
}
.pf-subtabs .pf-subtab,
.pf-shell .tabs .tab,
.pf-shell [data-favtab],
.pf-shell [data-csort] {
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  color: var(--ss-text-muted) !important;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 500 !important;
  min-height: 36px;
  padding: 0 10px !important;
  border-radius: var(--ss-radius-chip, 6px);
  cursor: pointer;
  transition: color var(--ss-transition, 120ms ease), background-color var(--ss-transition, 120ms ease);
}
.pf-subtabs .pf-subtab:hover,
.pf-shell .tabs .tab:hover,
.pf-shell [data-favtab]:hover,
.pf-shell [data-csort]:hover {
  color: var(--ss-text) !important;
  background: var(--ss-ghost-bg-hover) !important;
}
.pf-subtabs .pf-subtab.active,
.pf-shell .tabs .tab.active,
.pf-shell [data-favtab].active,
.pf-shell [data-csort].active {
  color: var(--ss-text) !important;
  background: var(--ss-surface-2) !important;
  box-shadow: none !important;
}
.pf-shell .tabs .tab:focus-visible,
.pf-subtabs .pf-subtab:focus-visible { outline: 2px solid var(--ss-border-strong); outline-offset: 2px; }
.pf-shell .tab-content { display: none; }
.pf-shell .tab-content.active { display: block; }

/* ---------- List heads, skeletons, empty states ---------- */

.pf-listhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ss-text-muted);
}
.pf-listhead__count { font-variant-numeric: tabular-nums; color: var(--ss-text); font-weight: 500; }

.pf-skeleton {
  border-radius: var(--ss-radius, 8px);
  background: var(--ss-surface-2);
  animation: pfPulse 1.4s ease-in-out infinite;
}
.pf-skelrow { height: 64px; margin-bottom: 8px; }
.pf-skelstat { height: 44px; }
@keyframes pfPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.pf-empty {
  padding: 24px 0;
  font-size: 14px;
  color: var(--ss-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .pf-shell .genre-row,
  .pf-skeleton { animation: none; opacity: 1; transform: none; }
}

/* ---------- Wall composer ---------- */
@media (max-width: 640px) {
  .pf-shell .gb-composer,
  .pf-shell .guestbook-composer { width: 100%; }
}

/* ==========================================================================
   Titles modal — moved out of the deleted page-local <style> in profile.html
   and re-authored on the --ss-* token set. The full grid stays in the modal;
   the profile itself only shows the truthful summary row.
   ========================================================================== */

.titles-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.titles-modal__backdrop { position: absolute; inset: 0; background: rgba(4, 6, 12, .72); }
.titles-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ss-bg);
  border: 1px solid var(--ss-border);
  border-radius: var(--ss-radius, 8px);
  max-width: 940px;
  width: 100%;
  max-height: 86vh;
  overflow: hidden;
  box-shadow: var(--ss-shadow);
}
.titles-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--ss-border);
}
.titles-modal__heading { display: flex; flex-direction: column; gap: 4px; }
.titles-modal__heading h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ss-text); }
.titles-modal__heading h3 i { color: var(--ss-text-muted); margin-right: 8px; }
.titles-modal__sub { font-size: 13px; color: var(--ss-text-muted); }
.titles-modal__body { padding: 16px; overflow: auto; }
.titles-modal__close {
  background: transparent;
  border: 1px solid var(--ss-border);
  color: var(--ss-text-muted);
  font-size: 14px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--ss-radius-chip, 6px);
  display: grid;
  place-items: center;
  transition: background-color var(--ss-transition, 120ms ease), color var(--ss-transition, 120ms ease);
}
.titles-modal__close:hover { background: var(--ss-surface-2); color: var(--ss-text); }
.titles-modal__close:focus-visible { outline: 2px solid var(--ss-border-strong); outline-offset: 2px; }

.title-card { position: relative; }
.title-card__reward {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ss-hiatus);
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.35;
}
.title-card__reward i { font-size: 12px; opacity: .9; }
.title-card__admin {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: var(--ss-radius-chip, 6px);
  display: grid;
  place-items: center;
  background: var(--ss-surface-2);
  border: 1px solid var(--ss-border);
  color: var(--ss-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.title-card__admin:hover { color: var(--ss-text); }
.title-card__admin:focus-visible { outline: 2px solid var(--ss-border-strong); outline-offset: 2px; }

/* ==========================================================================
   Legacy overrides — main.css/exp.css still style .profile-* for other pages
   (preview card, settings). Inside the shell we neutralise their centering
   and card chrome so the identity strip stays a single left-aligned block.
   ========================================================================== */

.pf-shell .profile-header { padding: 0; text-align: left; }
.pf-shell .profile-avatar {
  width: 88px;
  height: 88px;
  margin: 0;
  border: 1px solid var(--ss-border);
  box-shadow: none;
}
.pf-shell .profile-header--with-cover .profile-avatar { margin-top: -28px; }
.pf-shell .profile-name { font-size: 22px; margin-bottom: 0; }

/* Badge rows must hug the name, not stretch across the identity column. */
.pf-identity .profile-badges-row,
.pf-identity .profile-extra-titles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
  max-width: 100%;
  flex: 0 1 auto;
  margin: 0;
  text-align: left;
}
.pf-identity .profile-extra-titles { margin-top: 6px; }
.pf-identity .profile-badges-row:empty,
.pf-identity .profile-extra-titles:empty { display: none; }

/* Bio is plain text in the strip — no inner card, no auto centering. */
.pf-shell .profile-bio {
  max-width: 72ch;
  margin: 8px 0 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  color: var(--ss-text);
}

.pf-xp { max-width: 420px; }
@media (max-width: 640px) {
  .pf-shell .profile-avatar,
  .pf-identity__avatar { width: 64px; height: 64px; }
  .pf-xp { max-width: none; }
}
