/* PROSPER profile popout (design/13 section 2, wave 2): one rounded
   Discord-style card — banner, overlapping avatar, badges, competitive
   stats box and a sticky message bar. */
.ppop {
  position: fixed;
  z-index: 200;
  width: 352px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  border: 1px solid rgba(79, 195, 255, 0.35);
  border-radius: 16px;
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
/* design/18: neutralizes the floating-popout geometry for embedded previews. */
.ppop-embed { position: static; width: 100%; max-width: 100%; max-height: none; overflow: visible; z-index: auto; }
.ppop-card { position: relative; background: #0f172a; border-radius: 16px; }
.ppop-loading { padding: 18px; margin: 0; color: #94a3b8; }
.ppop-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  border: 0;
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
}
.ppop-full-btn {
  position: absolute;
  top: 8px;
  right: 46px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  text-decoration: none;
}
.ppop-full-btn:hover, .ppop-close:hover { background: rgba(30, 41, 59, 0.9); }
.ppop-banner-img { display: block; width: 100%; height: 112px; object-fit: cover; border-radius: 16px 16px 0 0; }
.ppop-banner-fallback { height: 112px; border-radius: 16px 16px 0 0; background: linear-gradient(120deg, #0b3d66, #1d4ed8 55%, #4fc3ff); }
.ppop-body { position: relative; }
.ppop-tint { position: absolute; inset: 0; background: rgba(8, 12, 18, 0.38); pointer-events: none; }
.ppop-inner { position: relative; padding: 0 16px 16px; }
.ppop-avatar-wrap { display: inline-block; margin-top: -44px; margin-left: -16px; padding-left: 16px; position: relative; }
.ppop-avatar-img,
.ppop-avatar-symbol,
.ppop-avatar-empty {
  display: inline-block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid #0f172a;
  box-sizing: border-box;
  object-fit: cover;
  text-align: center;
  line-height: 80px;
  font-size: 36px;
  background: #1e293b;
}
.ppop-avatar-wrap .presence-dot { position: absolute; right: 2px; bottom: 4px; width: 20px; height: 20px; border: 3px solid #0f172a; box-sizing: border-box; }
.ppop-name { margin: 8px 0 2px; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.ppop-sub { margin: 0 0 4px; color: #94a3b8; font-size: 13px; overflow-wrap: anywhere; }
/* design/14: live status line + own-profile status picker. */
.ppop-status { margin: 0 0 8px; color: #94a3b8; font-size: 13px; }
.ppop-status-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12px; }
.ppop-status-picker button {
  border: 1px solid rgba(148, 163, 184, 0.35); background: transparent; color: #e2e8f0;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.ppop-status-picker button:hover { border-color: #4fc3ff; }
.ppop-status-picker button[aria-pressed="true"] { border-color: #4fc3ff; background: rgba(79, 195, 255, 0.18); }
.ppop-status-picker button:disabled { opacity: 0.5; cursor: default; }
.ppop-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ppop-badge-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #e2e8f0;
  border: 1px solid rgba(79, 195, 255, 0.4); border-radius: 999px; padding: 2px 8px;
}
.ppop-badge-chip svg { flex: none; }
/* design/22: custom profile role chips + the Manage Roles panel.
   Panel redesign (owner order 2026-11-04): compact Discord/Linear-style
   rows — the whole row is the click target, checkbox sits directly beside
   a small single-line badge, subtle dividers, tight footer actions. */
.ppop-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ppop-role-chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--role-color, #7dd3fc);
  border: 1px solid var(--role-color, #7dd3fc); border-radius: 999px; padding: 2px 8px;
  background: color-mix(in srgb, var(--role-color, #7dd3fc) 14%, transparent);
}
.ppop-role-chip svg { flex: none; }
.ppop-manage-roles {
  border: 1px solid rgba(148, 163, 184, 0.3); background: transparent; color: #e2e8f0;
  border-radius: 7px; padding: 3px 10px; font-size: 12px; cursor: pointer; margin: 0 0 8px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ppop-manage-roles:hover { border-color: #4fc3ff; background: rgba(79, 195, 255, 0.08); }
.ppop-roles-panel {
  margin: 0 0 8px; padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 10px;
  background: rgba(2, 6, 17, 0.35);
}
.ppop-roles-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 0 2px 6px;
}
.ppop-roles-title { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #94a3b8; }
.ppop-roles-count { font-size: 11px; color: #64748b; white-space: nowrap; }
.ppop-roles-list { display: flex; flex-direction: column; max-height: 168px; overflow-y: auto; }
.ppop-role-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 5px 6px; border-radius: 7px; cursor: pointer;
  transition: background 0.12s ease;
}
.ppop-role-row + .ppop-role-row { border-top: 1px solid rgba(148, 163, 184, 0.08); }
.ppop-role-row:hover { background: rgba(79, 195, 255, 0.07); }
.ppop-role-row:has(.ppop-role-check:checked) { background: rgba(79, 195, 255, 0.1); }
.ppop-role-check { width: 14px; height: 14px; margin: 0; flex: none; accent-color: #4fc3ff; cursor: pointer; }
.ppop-roles-panel .ppop-role-chip { font-size: 11.5px; padding: 1px 7px; gap: 4px; min-width: 0; }
.ppop-roles-panel .ppop-role-chip svg { width: 12px; height: 12px; }
.ppop-roles-panel .ppop-role-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppop-roles-actions {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  border-top: 1px solid rgba(148, 163, 184, 0.12); padding-top: 8px; margin-top: 6px;
}
.ppop-roles-actions .ppop-roles-msg { margin: 0 auto 0 2px; }
.ppop-roles-save, .ppop-roles-cancel {
  border-radius: 7px; padding: 4px 12px; font-size: 12px; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ppop-roles-cancel { border: 1px solid rgba(148, 163, 184, 0.25); background: transparent; color: #94a3b8; }
.ppop-roles-cancel:hover { border-color: rgba(148, 163, 184, 0.5); color: #e2e8f0; }
.ppop-roles-save { border: 1px solid rgba(79, 195, 255, 0.55); background: rgba(79, 195, 255, 0.16); color: #e0f2fe; font-weight: 600; }
.ppop-roles-save:hover { background: rgba(79, 195, 255, 0.26); }
.ppop-roles-save:disabled { opacity: 0.5; cursor: default; }
.ppop-roles-msg { margin: 2px 0; color: #cbd5e1; font-size: 12.5px; }
.ppop-mutual { margin: 0 0 8px; color: #cbd5e1; font-size: 13px; }
.ppop-bio { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.ppop-bio-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ppop-bio-clamped.is-expanded { display: block; overflow: visible; -webkit-line-clamp: unset; }
.ppop-bio-toggle { background: none; border: 0; color: #4fc3ff; cursor: pointer; font: inherit; font-size: 13px; padding: 0; margin: 0 0 10px; }
.ppop-games { margin: 0 0 12px; }
.ppop-box-title { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; }
.ppop-games-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ppop-game-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 8px; padding: 4px 8px; font-size: 13px;
}
.ppop-game-icon { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }
.ppop-stats-box {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  background: rgba(2, 6, 16, 0.35);
}
.ppop-stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ppop-stats-col { display: flex; flex-direction: column; gap: 3px; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.ppop-rank-line { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.ppop-rank-gem { flex: none; }
.ppop-guild-thumb { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.ppop-guild-name { font-weight: 600; color: #4fc3ff; text-decoration: none; }
a.ppop-guild-name:hover { text-decoration: underline; }
.ppop-stats-row { margin: 8px 0 0; font-size: 13px; color: #cbd5e1; }
.ppop-msgbar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.ppop-msg-input {
  flex: 1; min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 16, 0.5);
  color: #e2e8f0;
  font: inherit; font-size: 14px;
}
.ppop-msg-input:disabled { opacity: 0.6; }
.ppop-msg-send {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: rgba(79, 195, 255, 0.2); color: #aee6ff;
  cursor: pointer;
}
.ppop-msg-send:hover { background: rgba(79, 195, 255, 0.35); }
.ppop-msg-send:disabled { opacity: 0.5; cursor: default; }
.ppop-msg-status { margin: 6px 0 0; font-size: 13px; color: #94a3b8; }
.ppop-msg-status a { color: #4fc3ff; }
.ppop-full { display: block; text-align: center; text-decoration: none; color: #4fc3ff; font-size: 14px; padding: 4px 0 2px; }
[data-profile-user] { cursor: pointer; }
.chat-author[data-profile-user]:hover,
.msg-author[data-profile-user]:hover,
.chat-online-member:hover { text-decoration: underline; }
