/* Profile: a header, a tab bar, and one panel at a time.
   Card and grid rules come from /app/home.css; the variables they read are
   declared here so the profile does not depend on the shell's stylesheet. */
:root {
  --app-bg: #ffffff;
  --app-fg: #0f0f10;
  --app-dim: #606069;
  --app-line: rgba(0, 0, 0, .12);
  --app-hover: rgba(0, 0, 0, .06);
  --app-tile: #e8e8ec;
  --app-accent: #22d37a;
  --pf-radius: 14px;
}

/* home.css sets .video-grid { display: grid }, which outranks the browser's own
   [hidden] rule — an emptied grid would stay on screen. Same guard game.css
   uses, scoped to this page. */
.pf-body [hidden] { display: none !important; }

.pf-body {
  margin: 0;
  background: var(--app-bg);
  color: var(--app-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---- nav ------------------------------------------------------------------ */
.pf-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding: 0 20px;
  background: var(--app-bg);
  border-bottom: 1px solid var(--app-line);
}
.pf-nav__brand img { height: 32px; width: auto; display: block; }
.pf-nav__links { display: flex; align-items: center; gap: 6px; }
.pf-nav__link {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.pf-nav__link:hover { background: var(--app-hover); }
.pf-nav__link--accent { background: var(--app-accent); color: #06210f; }

/* ---- gates ---------------------------------------------------------------- */
.pf-gate { display: grid; place-items: center; padding: 90px 20px; }
.pf-gate__card {
  max-width: 460px;
  text-align: center;
  border: 1px solid var(--app-line);
  border-radius: var(--pf-radius);
  padding: 32px 28px;
}
.pf-gate__card h1 { margin: 0 0 10px; font-size: 22px; }
.pf-gate__card p { margin: 0 0 20px; color: var(--app-dim); font-size: 14.5px; line-height: 1.5; }

/* ---- header --------------------------------------------------------------- */
.pf { max-width: 1400px; margin: 0 auto; padding: 0 20px 64px; }

/* 4:1 is the ratio the upload hint promises, so the box holds exactly that and
   nothing else constrains it. A max-height here would be worse than useless:
   with aspect-ratio set, a bounded height derives the WIDTH from it, so the
   banner stops spanning its column on a wide screen and overflows a narrow one. */
.pf-banner {
  position: relative;
  aspect-ratio: 4 / 1;
  margin-top: 18px;
  border-radius: var(--pf-radius);
  background-color: var(--app-tile);
  background-size: cover;
  background-position: center;
}
.pf-banner.is-empty {
  background-image: linear-gradient(120deg, #d8f5e6 0%, #dbe7ff 55%, #f3e2ff 100%);
}

/* The door into this channel's world. Bottom-LEFT on purpose: .pf-image-btn
   ("Change banner") owns the bottom-right corner for the owner. */
.pf-world-btn {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(12, 16, 24, .72);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background .15s ease, transform .15s ease;
}
.pf-world-btn:hover { background: rgba(12, 16, 24, .88); transform: translateY(-1px); }
.pf-world-btn__note { font-weight: 500; font-size: 12px; opacity: .78; }
.pf-world-btn.is-disabled {
  background: rgba(12, 16, 24, .45);
  pointer-events: none;
  cursor: default;
}
@media (max-width: 640px) {
  .pf-world-btn { left: 8px; bottom: 8px; padding: 7px 12px; font-size: 13px; }
}

.pf-identity {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 4px 22px;
}
/* ---- owner editing -------------------------------------------------------- */
.pf-image-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .74);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.pf-image-btn:hover { background: rgba(0, 0, 0, .88); }
.pf-image-btn--photo {
  right: auto;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  padding: 5px 10px;
  font-size: 11.5px;
  white-space: nowrap;
}

/* The overlap with the banner belongs to the wrapper now, so the "Change
   picture" button rides up with the circle instead of being clipped. */
.pf-avatar-wrap { position: relative; flex: 0 0 auto; margin-top: -46px; }

.pf-link-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--app-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.pf-link-btn:hover { color: var(--app-fg); }

.pf-bio-form { margin-top: 12px; max-width: 560px; }
.pf-bio-form__label { display: block; font-size: 12.5px; font-weight: 700; color: var(--app-dim); margin-bottom: 5px; }
.pf-bio-form__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}
.pf-bio-form__input:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 1px; }
.pf-bio-form__row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.pf-bio-form__row .pf-hint { margin-right: auto; }

.pf-hint { font-size: 12.5px; color: var(--app-dim); line-height: 1.5; }
.pf-hint--block { margin-top: 10px; max-width: 62ch; }

.pf-status { margin-top: 9px; font-size: 13.5px; font-weight: 600; color: var(--app-dim); }
.pf-status.is-ok { color: #128a4d; }
.pf-status.is-error { color: #c62828; }

.pf-avatar {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--app-bg);
  background: var(--app-tile);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 38px;
  font-weight: 800;
  color: var(--app-dim);
}
/* A character head is art on transparency and must not be cropped; an uploaded
   photo is a photograph and must fill the circle. */
.pf-avatar img { width: 100%; height: 100%; object-fit: contain; }
.pf-avatar.is-photo img { object-fit: cover; }

.pf-identity__text { flex: 1 1 auto; min-width: 0; }
.pf-name { margin: 0; font-size: 27px; line-height: 1.2; }
.pf-handle { margin-top: 3px; color: var(--app-dim); font-size: 14px; }
.pf-rank {
  display: inline-block;
  margin-top: 9px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--app-hover);
  font-size: 12.5px;
  font-weight: 700;
}
.pf-bio { margin: 11px 0 0; font-size: 14.5px; line-height: 1.5; max-width: 70ch; }
.pf-counts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 13.5px; color: var(--app-dim); }
.pf-counts strong { color: var(--app-fg); }

.pf-identity__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pf-btn {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: var(--app-bg);
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.pf-btn:hover { background: var(--app-hover); }
.pf-btn--accent { background: var(--app-accent); border-color: transparent; color: #06210f; }
.pf-btn--quiet { color: var(--app-dim); }

/* ---- tabs ----------------------------------------------------------------- */
.pf-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--app-line);
}
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tab {
  flex: 0 0 auto;
  position: relative;
  padding: 13px 15px;
  border: 0;
  background: none;
  color: var(--app-dim);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.pf-tab:hover,
.pf-tab.is-active { color: var(--app-fg); }
.pf-tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--app-fg);
}
.pf-tab:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -4px; border-radius: 8px; }

/* The private sub-row under Manage. Pills rather than underlines, so the two
   rows read as different kinds of thing: the bar is the channel, the row is
   its back office. */
.pf-subtabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--app-line);
}
.pf-subtabs::-webkit-scrollbar { display: none; }
.pf-subtab {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--app-dim);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.pf-subtab:hover { color: var(--app-fg); }
.pf-subtab.is-active { color: var(--app-fg); background: var(--app-hover); font-weight: 600; }
.pf-subtab:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -2px; }
.pf-subtabs__hint {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 14px;
  color: var(--app-dim);
  font-size: 12px;
  white-space: nowrap;
}

.pf-panel { padding-top: 26px; }
.pf-section-title { margin: 0 0 14px; font-size: 16px; }
.pf-panel > div + .pf-section-title { margin-top: 32px; }
.pf-empty { margin: 8px 0 0; color: var(--app-dim); font-size: 14.5px; line-height: 1.55; max-width: 62ch; }

/* The closet bridge injects its own styles; this only reserves the space so the
   panel does not jump when it finishes loading. */
#expTshirtTubeSectionBody { min-height: 180px; }

/* ---- scheduled videos (owner only) ---------------------------------------- */
.pf-scheduled { margin-bottom: 30px; }
.pf-sched-list { display: grid; gap: 10px; margin-top: 14px; }
.pf-sched {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb title actions"
    "thumb when  actions"
    "form  form  form"
    "note  note  note";
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
}
.pf-sched__thumb {
  grid-area: thumb;
  align-self: start;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--app-tile);
}
.pf-sched__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-sched__title { grid-area: title; align-self: end; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.pf-sched__when { grid-area: when; align-self: start; font-size: 12.5px; color: var(--app-dim); }
.pf-sched__actions { grid-area: actions; display: flex; gap: 8px; flex-wrap: wrap; }
.pf-sched__form { grid-area: form; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pf-sched__input {
  padding: 8px 10px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  background: var(--app-bg);
  color: inherit;
  font: inherit;
  font-size: 14px;
}
/* [hidden] is display:none in the UA sheet, and the two rules above would
   otherwise beat it — the form and the message must actually disappear. */
.pf-sched__form[hidden], .pf-sched__notice[hidden] { display: none; }
.pf-sched__notice {
  grid-area: note;
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--app-dim);
  line-height: 1.5;
}
.pf-sched__notice.is-error { color: #c62828; }
@media (max-width: 560px) {
  .pf-sched {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "thumb title"
      "thumb when"
      "actions actions"
      "form form"
      "note note";
  }
  .pf-sched__actions { margin-top: 8px; }
}

/* ---- past broadcasts ------------------------------------------------------ */
.pf-past-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
a.pf-past-card { cursor: pointer; }
.pf-past-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-tile);
}
.pf-past-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.pf-past-card:hover .pf-past-card__thumb { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.pf-past-card__badge {
  position: absolute;
  left: 7px;
  bottom: 7px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.pf-past-card__title {
  margin-top: 7px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pf-past-card__meta { margin-top: 2px; font-size: 13px; color: var(--app-dim); }

/* ---- owner card menu ------------------------------------------------------ */
.pf-owned { position: relative; display: flex; flex-direction: column; }
.pf-menu { position: absolute; top: 8px; right: 8px; z-index: 3; }
.pf-menu__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 17, 20, .78);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease;
}
.pf-owned:hover .pf-menu__btn,
.pf-menu__btn:focus-visible,
.pf-owned.is-menu-open .pf-menu__btn { opacity: 1; }
.pf-menu__btn:hover { background: rgba(17, 17, 20, .95); }
/* Touch has no hover, so the control has to be permanently visible there. */
@media (hover: none) {
  .pf-menu__btn { opacity: 1; }
}

.pf-menu__list {
  position: absolute;
  top: 34px;
  right: 0;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: var(--app-bg);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}
.pf-menu__item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.pf-menu__item:hover,
.pf-menu__item:focus-visible { background: var(--app-hover); }
.pf-menu__item--danger { color: #c62828; }
.pf-menu__item--danger:hover,
.pf-menu__item--danger:focus-visible { background: rgba(198, 40, 40, .1); }

/* ---- stats ---------------------------------------------------------------- */
.pf-job {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--app-fg);
  color: var(--app-bg);
  font-size: 13px;
  font-weight: 800;
}
.pf-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 26px;
  max-width: 900px;
  margin-bottom: 30px;
}
.pf-exp { max-width: 520px; margin-bottom: 26px; }
.pf-bars .pf-exp { max-width: none; margin-bottom: 0; }
/* How the bar LOOKS — casing, stripes, the HP and MP hues, the big header
   variant — now lives in /shared/exp-bar.css, because the watch page draws the
   same bar for a video and could not reach these rules. What stays here is
   where the bar SITS on this page. */
.pf-level { max-width: 520px; margin: 4px 0 14px; }

.pf-stat--points { border-color: var(--app-accent); border-style: solid; }
.pf-stat--points .pf-stat__value { color: #128a4d; }

.pf-skill-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.pf-skill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  padding: 11px 14px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
}
.pf-skill__name { font-size: 14px; font-weight: 700; }
.pf-skill__tier { grid-column: 1; font-size: 12px; color: var(--app-dim); }
.pf-skill__level { grid-column: 2; grid-row: 1 / span 2; font-size: 15px; font-weight: 800; }
.pf-skill--job { border-left: 3px solid var(--app-accent); }

/* ---- analytics ------------------------------------------------------------ */
.pf-aformats { display: flex; gap: 8px; margin-bottom: 20px; }
.pf-chip {
  padding: 8px 15px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: var(--app-bg);
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.pf-chip:hover { background: var(--app-hover); }
.pf-chip.is-active { background: var(--app-fg); border-color: transparent; color: var(--app-bg); }

.pf-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
@media (max-width: 1000px) { .pf-analytics { grid-template-columns: 1fr; } }

.pf-arow {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--app-line);
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pf-arow:hover { background: var(--app-hover); }
.pf-arow.is-selected { background: var(--app-hover); box-shadow: inset 3px 0 0 var(--app-accent); }
.pf-arow--head {
  cursor: default;
  font-size: 12px;
  font-weight: 700;
  color: var(--app-dim);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pf-arow--head:hover { background: none; }
.pf-arow__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--app-tile);
}
.pf-arow__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-arow__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pf-arow__age { font-size: 12.5px; color: var(--app-dim); white-space: nowrap; }
.pf-arow__cells { display: grid; grid-auto-flow: column; grid-auto-columns: 68px; gap: 6px; text-align: right; }
.pf-arow__cell { font-size: 13px; font-variant-numeric: tabular-nums; }
.pf-arow--head .pf-arow__cell { font-size: 11px; }
@media (max-width: 560px) {
  .pf-arow { grid-template-columns: 72px minmax(0, 1fr); }
  .pf-arow__age { display: none; }
  .pf-arow__cells { grid-column: 1 / -1; justify-content: start; text-align: left; }
}

.pf-analytics__detail {
  position: sticky;
  top: 78px;
  padding: 18px 20px;
  border: 1px solid var(--app-line);
  border-radius: var(--pf-radius);
}
@media (max-width: 1000px) { .pf-analytics__detail { position: static; } }
.pf-analytics__detail .pf-section-title { margin-bottom: 4px; }

.pf-notice {
  margin: 14px 0 20px;
  padding: 11px 13px;
  border-left: 3px solid var(--app-accent);
  border-radius: 0 8px 8px 0;
  background: var(--app-hover);
  font-size: 13px;
  line-height: 1.55;
  color: var(--app-dim);
}
.pf-ametrics { margin-bottom: 22px; }
.pf-ametrics:last-child { margin-bottom: 0; }
.pf-stat__help { margin-top: 4px; font-size: 11.5px; line-height: 1.4; color: var(--app-dim); font-weight: 500; }
/* Monetization figures are owned by the ads page; the profile only reports them. */
.pf-stat--money { border-style: dashed; }

.pf-item-group { margin-bottom: 26px; }
.pf-item-group__title { margin: 0 0 12px; font-size: 14px; color: var(--app-dim); }
.pf-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.pf-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
}
.pf-stat__label { font-size: 12.5px; color: var(--app-dim); font-weight: 600; }
.pf-stat__value { font-size: 21px; font-weight: 800; }
/* Only the owner is ever shown these — users/{uid} is self-read. */
.pf-stat--private { border-style: dashed; }

/* ---- items ---------------------------------------------------------------- */
.pf-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.pf-item,
.pf-slot {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
}
.pf-item__art,
.pf-slot__art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--app-tile);
  overflow: hidden;
}
/* Explicit width/height, not max-*: a lazy image whose intrinsic size is not
   known yet lays out as 0×0, and a 0×0 lazy image never enters the viewport, so
   the browser never starts the load and the icon never appears. Sizing the box
   up front breaks that deadlock; object-fit keeps the art undistorted. */
.pf-item__art img,
.pf-slot__art img { width: 82%; height: 82%; object-fit: contain; }
.pf-item__count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.pf-item__name { margin-top: 8px; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.pf-item__meta { font-size: 12.5px; color: var(--app-dim); text-transform: capitalize; }
.pf-item--rare .pf-item__art { box-shadow: inset 0 0 0 2px #6aa6ff; }
.pf-item--epic .pf-item__art { box-shadow: inset 0 0 0 2px #b678ff; }
.pf-item--legendary .pf-item__art { box-shadow: inset 0 0 0 2px #ffb020; }

/* ---- the fit -------------------------------------------------------------- */
.pf-fit { display: flex; flex-wrap: wrap; gap: 34px; align-items: flex-start; }
/* 280 × 430 is the shell renderCharacter() builds. The .char-builder-preview
   class on this element is what puts the renderer in full-size preview mode
   rather than the half-scale in-world sprite; it writes its own layer styles
   inline, so none of game.css is needed here. */
.pf-fit__stage {
  position: relative;
  flex: 0 0 auto;
  width: 280px;
  height: 430px;
  border-radius: var(--pf-radius);
  background: linear-gradient(180deg, #f4f8ff 0%, #e9f0ff 100%);
  overflow: hidden;
}
/* The render root. Its transform is written by fitFigureToStage() once the
   layer images have loaded and their real extent can be measured. */
.pf-fit__figure { position: absolute; inset: 0; }
.pf-slot-grid {
  flex: 1 1 320px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.pf-slot--empty { border-style: dashed; }
.pf-slot__label { margin-top: 8px; font-size: 12.5px; color: var(--app-dim); font-weight: 600; }
.pf-slot__name { font-size: 13.5px; font-weight: 700; line-height: 1.3; }

/* ---- edit details dialog -------------------------------------------------- */
/* Built entirely by profile-edit.js, so every class here is created in JS. */
.pf-edit {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--app-line);
  border-radius: var(--pf-radius);
  background: var(--app-bg);
  color: var(--app-fg);
  overflow: hidden;
}
.pf-edit::backdrop { background: rgba(0, 0, 0, .5); }
.pf-edit__inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}
.pf-edit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}
.pf-edit__title { margin: 0; font-size: 19px; font-weight: 800; }
.pf-edit__close {
  border: 0;
  background: none;
  color: var(--app-dim);
  font: inherit;
  font-size: 17px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.pf-edit__close:hover { background: var(--app-hover); }
.pf-edit__sub {
  margin: 4px 20px 0;
  font-size: 13px;
  color: var(--app-dim);
  overflow-wrap: anywhere;
}
/* The one scrolling region, so the heading and the buttons stay put. */
.pf-edit__body { padding: 16px 20px; overflow-y: auto; display: grid; gap: 16px; }
.pf-edit__field { display: grid; gap: 6px; }
.pf-edit__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pf-edit__label { font-size: 13.5px; font-weight: 700; }
.pf-edit__count { font-size: 12px; color: var(--app-dim); font-variant-numeric: tabular-nums; }
.pf-edit__count.is-over { color: #c62828; font-weight: 700; }
.pf-edit__input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  background: var(--app-bg);
  color: inherit;
  font: inherit;
  font-size: 14px;
}
.pf-edit__input--area { resize: vertical; min-height: 96px; line-height: 1.45; }
.pf-edit__field.is-invalid .pf-edit__input { border-color: #c62828; }
.pf-edit__hint { margin: 0; font-size: 12.5px; color: var(--app-dim); }
.pf-edit__error { margin: 0; font-size: 12.5px; color: #c62828; font-weight: 600; }
.pf-edit__error[hidden] { display: none; }
.pf-edit__radios { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pf-edit__radio { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; }

.pf-edit__thumbs { display: grid; gap: 8px; }
.pf-edit__thumbgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.pf-edit__thumbgrid:empty { display: none; }
.pf-edit__thumb {
  position: relative;
  padding: 0;
  border: 2px solid var(--app-line);
  border-radius: 10px;
  background: var(--app-tile);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}
.pf-edit__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-edit__thumb.is-selected { border-color: var(--app-accent); }
.pf-edit__thumblabel {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(17, 17, 20, .78);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
.pf-edit__thumbactions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* The real input is driven by its <label>, which is styled as a button. */
.pf-edit__file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pf-edit__filebtn { cursor: pointer; }

.pf-edit__status {
  margin: 0;
  padding: 0 20px;
  font-size: 13px;
  color: var(--app-dim);
  overflow-wrap: anywhere;
}
.pf-edit__status.is-error { color: #c62828; font-weight: 600; }
.pf-edit__status.is-ok { color: #1b7f4b; font-weight: 600; }
.pf-edit__status[hidden] { display: none; }
.pf-edit__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--app-line);
}

/* ---- narrow --------------------------------------------------------------- */
@media (max-width: 720px) {
  .pf { padding: 0 14px 48px; }
  /* Deliberately no height or max-height on .pf-banner — see the note there. */
  .pf-identity { flex-wrap: wrap; gap: 14px; }
  .pf-avatar-wrap { margin-top: -38px; }
  .pf-avatar { width: 76px; height: 76px; font-size: 30px; }
  .pf-identity__text { flex-basis: 100%; order: 3; }
  .pf-name { font-size: 22px; }
  .pf-fit { gap: 22px; justify-content: center; }
}

/* ---- Plugs ---------------------------------------------------------------
   A Plug is one NEW EXP Tube member who joined through this person's share
   link. It sits in the counts row every profile already has rather than in a
   panel of its own — it is a social stat, the same kind of thing as videos and
   streams, and it should read like one. */
.pf-counts__plugs { display: inline-flex; align-items: center; gap: 6px; }
.pf-plug {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--app-accent, #22d37a);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* "Plugged into EXP Tube by @kenyon." Absent entirely for anybody who arrived
   on their own, which is every account older than this feature. */
.pf-origin {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--app-dim, #606069);
}
.pf-origin__who,
.pf-origin__video {
  color: var(--app-fg, #0f0f10);
  font-weight: 700;
  text-decoration: none;
}
.pf-origin__who:hover,
.pf-origin__video:hover { text-decoration: underline; }
.pf-origin__video { font-weight: 600; }
