/* ================================
   Root & Tokens
=================================== */ :root {
  --vt-dur: 220ms;
  --vt-ease: cubic-bezier(.2, .7, .2, 1);
  --c-surface: #fff;
  --c-text: #2c3340;
  --c-overlay: rgba(44, 51, 64, 0.72);
  --c-border: rgba(44, 51, 64, 0.10);
  --c-border-strong: rgba(44, 51, 64, 0.16);
  --c-shadow-1: rgba(44, 51, 64, 0.28);
  --c-brand: #2c3340;
  --c-brand-weak: #c4b5a0;
  --c-action: #5c9120;
  --skeleton-bg: #e9e2d6;
  --skeleton-hi: #faf8f4;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --vt-dur: 1ms;
  }
  .hidden-stage, .show-stage {
    transition: none !important;
  }
}

html.profileNoScroll, .profileNoScroll {
  overflow: hidden;
  width: 100%;
}
.profileCoverZoom, .profilePicZoom, .profileCoverZoomControls, .profilePicZoomControls, .profileCoverActionButtons, .profilePicActionButtons, .profileCoverInput, .profilePicInput {
  display: none;
}
.vt-fade {
  opacity: 0;
  transition: opacity var(--vt-dur) var(--vt-ease);
}
.vt-fade.vt-in {
  opacity: 1;
}
.vt-skel {
  position: relative;
  overflow: hidden;
  background: var(--skeleton-bg);
  border-radius: 10px;
}
.vt-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, var(--skeleton-hi) 50%, transparent 100%);
  animation: vt-shimmer 1.1s infinite;
}
@keyframes vt-shimmer {
  100% {
    transform: translateX(100%);
  }
}
.vt-skel.cover {
  height: 220px;
}
.vt-skel.pic {
  width: 140px;
  height: 140px;
  border-radius: 50%;
}
.vt-skel.line {
  height: 18px;
  border-radius: 6px;
}
.vt-skel.line.lg {
  height: 26px;
}
.hidden-stage {
  opacity: 0;
  pointer-events: none;
}
.show-stage {
  opacity: 1;
  pointer-events: auto;
}
.hidden-stage, .show-stage {
  transition: opacity var(--vt-dur) var(--vt-ease);
}

.profileViewport, .profileLightboxModal, #profileCover, #profilePic {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
}
 ::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: var(--vt-dur);
  animation-timing-function: var(--vt-ease);
}
#profileCover, #profilePic {
  view-transition-name: none;
}
#profileDetailsDisplayName {
  view-transition-name: profile-name;
  /* One line at line-height 1.4 — 1.96em was ~2 lines and added gap above connections */
  min-height: 1.4em;
}
#profileContent {
  view-transition-name: profile-content;
  background-color: transparent;
}
::view-transition-group(profile-avatar), ::view-transition-image-pair(profile-avatar), ::view-transition-old(profile-avatar), ::view-transition-new(profile-avatar) {
  border-radius: 50%;
  overflow: hidden;
  background: var(--c-surface);
  border: 2px solid rgba(74, 139, 181, 0.45);
}

.profileCoverContainer img, .profilePicContainer img {
  will-change: opacity, transform;
}


.profilePicControlsGroup,
.profileCoverControlsGroup {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.profilePicControlsGroup .profilePicEditButton,
.profileCoverControlsGroup .profileCoverEditButton {
  pointer-events: auto;
}
.profilePicEditButton, .profileCoverEditButton {
  position: absolute;
  right: 5px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  background-color: rgba(0, 30, 42, 0.85);
  z-index: 50;
  will-change: opacity, transform;
  transform: translateZ(0);
}
.profilePicEditButton:hover, .profileCoverEditButton:hover {
  background-color: #003447;
}

.profileLightboxOverlay {
  position: fixed;
  inset: 0;
  display: none;
  padding: 24px;
  box-sizing: border-box;
  background: var(--c-overlay);
  
  z-index: 10100;
  animation: profileFadeIn .16s ease-out;
}
@keyframes profileFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.profileLightboxModal {
  position: relative;
  margin: 0 auto;
  max-width: min(1100px, 96vw);
  height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--c-text);
  background: var(--c-surface);
  border-radius: 14px;
  box-shadow: 0 20px 60px var(--c-shadow-1);
}
.profileLightboxHeader {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 48px;
  border-bottom: 1px solid var(--c-border);
}
.profileLightboxTitle {
  font-size: 18px;
  font-weight: 700;
}
.profileLightboxClose {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--c-border-strong);
  border-radius: 9px;
  background: var(--c-surface);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .08s ease, box-shadow .2s ease;
}
.profileLightboxClose:hover {
  background: #f8fafc;
}
.profileLightboxClose:active {
  transform: translateY(1px);
}
.profileLightboxContent {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.profileLightboxFooter {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}

.profileCanvasWrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  background: #0b1220;
  overflow: hidden;
  contain: layout paint size;
}
.profileCanvasBg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at top left, rgba(255, 255, 255, .06), transparent 60%), radial-gradient(ellipse at bottom right, rgba(255, 255, 255, .045), transparent 60%);
}
.profileViewport {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  box-shadow: 0 0 0 20000px rgba(0, 0, 0, 0.35);
  background:
    linear-gradient(0deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)), repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .06) 0 15deg, transparent 15deg 30deg);
}
.profileViewport.profileDragging {
  cursor: grabbing;
}
.profileViewportImage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  max-width: none;
  user-select: none;
  pointer-events: none;
  will-change: transform;
  transform: translate(-50%, -50%) scale(1);
}

.profileModePic .profileViewport {
  height: 100%;
  width: auto;
  max-height: 100%;
}

.profileSidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.profileZoomRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  margin: 2px auto 0;
  padding: 10px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .65));
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(2, 6, 23, .08);
}
.profileZoomBtn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(2, 6, 23, .06), 0 8px 24px rgba(2, 6, 23, .08);
  transition: background .2s ease, transform .08s ease, box-shadow .2s ease;
}
.profileZoomBtn:hover {
  background: #f8fafc;
}
.profileZoomBtn:active {
  transform: translateY(1px);
}
.profileZoomSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(2, 6, 23, .16);
  border-radius: 999px;
  outline: none;
}
.profileZoomSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-action);
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, .45);
  cursor: grab;
}
.profileZoomSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-action);
  border: 0;
  cursor: grab;
}
.profileHint {
  margin-top: 14px;
  font-size: 12px;
  color: #475569;
}

.profileBtn {
  min-width: 110px;
  height: 40px;
  padding: 0 16px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, filter .2s ease, box-shadow .2s ease;
}
.profileBtnPrimary {
  color: #fff;
  background: #1f485a;
  border-color: rgba(14, 165, 233, .3);
  box-shadow: 0 10px 30px rgba(14, 165, 233, .30);
}
.profileBtnPrimary:hover {
  filter: brightness(1.04);
  background: #001e2a;
}
.profileBtnPrimary:active {
  transform: translateY(1px);
}
.profileBtnPrimary[aria-busy="true"] {
  opacity: .7;
  pointer-events: none;
}
.profileBtnGhost {
  color: var(--c-text);
  background: var(--c-surface);
  border-color: var(--c-border-strong);
  box-shadow: 0 8px 24px rgba(2, 6, 23, .08);
}
.profileBtnGhost:hover {
  background: #f8fafc;
}
.profileBtnGhost:active {
  transform: translateY(1px);
}


#profilePic:not([src]), #profilePic[src=""], #profileCover:not([src]), #profileCover[src=""] {
  opacity: 0;
  transition: none;
}

#profilePic[src]:not([src=""]), #profileCover[src]:not([src=""]) {
  opacity: 0;
  transition: none;
}

.profilePicContainerLoaded #profilePic, .profileCoverContainerLoaded #profileCover {
  opacity: 1 !important;
  transition: none !important;
}
#profilePic[data-img-nofx], #profileCover[data-img-nofx] {
  transition: none !important;
}
#profilePic[data-img-nofx]:not([src]), #profileCover[data-img-nofx]:not([src]) {
  opacity: 0;
}

.profilePicWrapper, .profilePicContainer {
  position: relative;
  width: 160px;
  height: 160px;
  aspect-ratio: 1 / 1;
  touch-action: none;
}
.profilePicWrapper {
  margin: -110px 0 0;
  flex-shrink: 0;
  align-self: flex-start;
  z-index: 10;
  min-height: 160px;
  min-width: 160px;
}
.profilePicContainer {
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  border-radius: 50%;
  border: 2px solid rgba(74, 139, 181, 0.45);
  background-color: #f8fafc;
  transform: translateZ(0);
  opacity: 1;
  visibility: visible;
}
.profilePicContainer > #profilePic,
.profilePicContainer > .imgLayer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}
.profilePicContainer > .imgLayer {
  background-color: #f8fafc;
}
.profilePicContainer.profilePicUsesDefault > #profilePic,
.profilePicContainer.profilePicUsesDefault > .imgLayer {
  object-fit: contain;
  background-color: #fff;
}
.profilePic {
  transition: transform .2s ease;
}

.profileCoverWrapper, .profileCoverContainer {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 1;
  touch-action: none;
}
.profileCoverContainer {
  z-index: 1;
  position: relative;
  contain: paint;
  view-transition-name: profile-cover;
  will-change: opacity, transform;
  transform: translateZ(0);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
  background-color: #f8fafc;
}
.profileCoverContainer.profileCoverContainerLoaded {
  opacity: 1;
  visibility: visible;
}
.profileCoverContainer > #profileCover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.imgLayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--vt-dur) var(--vt-ease);
  z-index: 2;
  background: transparent;
  will-change: opacity;
  transform: translateZ(0);
}

.profilePicContainer .imgLayer,
.profileCoverContainer .imgLayer {
  transition: opacity var(--vt-dur) var(--vt-ease);
}

/* Profile pic/cover loading shimmer (switch + first paint) */
.profilePicContainer.profileMediaLoading,
.profileCoverContainer.profileMediaLoading {
  position: relative;
}
.profileCoverContainer.profileMediaLoading:not(.profileCoverContainerLoaded) {
  opacity: 1;
  visibility: visible;
}
.profilePicContainer.profileMediaLoading::before,
.profileCoverContainer.profileMediaLoading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    var(--skeleton-bg) 0%,
    #f1f5f9 45%,
    var(--skeleton-bg) 100%
  );
  opacity: 1;
  transition: opacity 0.28s var(--vt-ease);
}
.profilePicContainer.profileMediaLoading::after,
.profileCoverContainer.profileMediaLoading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 40%,
    var(--skeleton-hi) 50%,
    rgba(255, 255, 255, 0.2) 60%,
    transparent 100%
  );
  animation: profile-media-shimmer 1.2s ease-in-out infinite;
}
@keyframes profile-media-shimmer {
  100% {
    transform: translateX(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .profilePicContainer.profileMediaLoading::after,
  .profileCoverContainer.profileMediaLoading::after {
    animation: none;
    transform: none;
    opacity: 0.45;
  }
}
html.vt-active #profileDetailsDisplayName,
html.vt-active #profileDetailsConnections,
html.vt-active #profileDetailsMembership {
  transition: opacity var(--vt-dur) var(--vt-ease);
  will-change: opacity;
}
.imgLayer.show {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .profilePicContainer .imgLayer,
  .profileCoverContainer .imgLayer {
    transition-duration: 0.01ms;
  }
}

/* Keep pic/cover containers stable during switch (no hide/reflow). */
html.vt-active .profilePicContainer,
html.vt-active .profileCoverContainer {
  opacity: 1 !important;
  visibility: visible !important;
  transition: none !important;
}
/* Keep base cover visible during switch; do not apply to .imgLayer (crossfade overlay). */
html.vt-active .profileCoverContainer > #profileCover {
  opacity: 1 !important;
  transition: none !important;
}
/* Hide stale profile pic while the next one loads so the previous person does not linger. */
html.vt-active .profilePicContainer.profileMediaLoading > #profilePic,
.profilePicContainer.profileMediaLoading > #profilePic {
  opacity: 0 !important;
  transition: none !important;
}
html.vt-active .profilePicContainer:not(.profileMediaLoading) > #profilePic {
  opacity: 1 !important;
  transition: none !important;
}

@supports not (aspect-ratio: 4 / 1) {
  .profileCoverContainer {
    height: 0;
    padding-top: 25%;
  }
  .profileCoverContainer > #profileCover {
    position: absolute;
    inset: 0;
  }
}

.profileTopPageWrapper, .profileTopInfoCover, .profileTopContainer {
  max-width: 100vw;
  overflow-x: hidden;
}
.profileTopContainer {
  position: relative;
  width: 100%;
  margin-top: 0;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease;
}
.profileTopContainer.visible {
  visibility: visible;
  opacity: 1;
}
#profileTopContainer.vt-pulse {
  animation: vtFadePulse .18s ease;
}
@keyframes vtFadePulse {
  from {
    opacity: .96;
  }
  to {
    opacity: 1;
  }
}
.profileTopInfo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding: 8px 50px;
  min-height: 100px;
  background: var(--c-surface);
  border-bottom: 2px solid var(--c-brand-weak);
}
.profileTopInfoLeft {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  align-self: flex-start;
}
.profileTopInfoMetaLeft,
.profileTopInfoMetaRight {
  --profile-meta-stack-gap: 4px;
}
.profileTopInfoMetaLeft {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--profile-meta-stack-gap);
  min-width: 0;
  margin-top: 20px;
  align-self: flex-start;
}
.profileTopInfoMetaLeft input[type="hidden"] {
  display: none;
}
.profileTopInfoMetaRight {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  gap: var(--profile-meta-stack-gap);
  margin-top: 20px;
  margin-left: auto;
  text-align: right;
  align-self: flex-start;
}
#profileDetailsConnections,
#profileDetailsMembership {
  min-height: 1.4em;
}

.profileName, .profileConnections, .profileMembershipTitle, .profileMembership {
  margin: 0;
  font-weight: 600;
  color: var(--c-brand);
  letter-spacing: .25px;
  line-height: 1.4;
}
.profileName, .profileConnections {
  text-align: left;
}
.profileMembershipTitle, .profileMembership {
  text-align: right;
}
.profileName {
  font-size: 1.4rem;
  font-weight: 700;
}
.profileConnections,
.profileMembershipTitle,
.profileMembership {
  font-size: 1rem;
}
.profileMembershipTitle {
  text-transform: capitalize;
  letter-spacing: 1px;
}

#otherProfileTabs.profileBubbleTabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px clamp(10px, 2vw, 18px) 16px;
}
.profileBubbleTabs {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  justify-content: center;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  backdrop-filter: blur(12px) saturate(1.05);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 6px 22px rgba(74, 139, 181, 0.06);
  box-sizing: border-box;
}
.profileBubbleTabs.hidden {
  display: none;
}
body.viewing-own-profile #otherProfileTabs,
body.profile-sidebar-pending-for-other #otherProfileTabs {
  display: none !important;
}
.profileOtherButton {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  padding: 9px 18px;
  border: 1px solid rgba(74, 139, 181, 0.12);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  color: #2f3a48;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.08s ease, border-color 0.2s ease, background 0.2s ease;
}
.profileOtherButton:hover {
  border-color: rgba(92, 145, 32, 0.35);
  box-shadow: 0 2px 10px rgba(74, 139, 181, 0.08);
}
.profileOtherButton:active {
  transform: translateY(1px);
}
.profileOtherButton.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, #5ba31f 0%, #498619 42%, #2d6b0e 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 14px rgba(92, 145, 32, 0.22);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .profileBubbleTabs {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255, 252, 249, 0.96);
  }
}

#profile.is-other .memoriesHeader h1,
#profile.is-other .memoriesSidebar {
  display: none !important;
}

@media (max-width: 991px) {
  .profileModePic .profileViewport {
    width: 100%;
    height: auto;
  }
  .profilePicWrapper, .profilePicContainer {
    width: 90px;
    height: 90px;
  }
  .profilePicWrapper {
    min-height: 90px;
    min-width: 90px;
    /* Desktop -110px is for 160px avatar; less overlap on tablet/phone */
    margin-top: -32px !important;
  }
  .profilePicEditButton {
    right: -5px !important;
    bottom: 0 !important;
    top: auto !important;
  }
  .profileTopInfo {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 20px;
    min-height: 70px;
  }
  .profileTopInfoLeft {
    display: flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
  }
  .profilePicWrapper {
    align-self: flex-start;
  }
  .profileTopInfoMetaLeft {
    margin-top: 6px;
    gap: 2px;
    justify-content: center;
  }
  .profileTopInfoMetaRight {
    margin-top: 6px;
    align-items: flex-end;
    text-align: right;
  }
  .profileName {
    font-size: 1.2rem;
  }
  .profileConnections {
    font-size: 0.95rem;
  }
  .profileMembershipTitle, .profileMembership {
    display: none;
  }
}

/* Mobile only: cover edit control on bottom-right of cover image */
@media (max-width: 767px) {
  #profileCoverContainer {
    position: relative !important;
  }
  #profileCoverContainer .profileCoverControlsGroup {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: 0 !important;
    overflow: visible !important;
    pointer-events: none;
    z-index: 12 !important;
  }
  #profileCoverContainer .profileCoverControlsGroup .profileCoverEditButton {
    position: absolute !important;
    right: 8px !important;
    bottom: 6px !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    transform: none !important;
    pointer-events: auto;
  }
}