/* Last loaded profile story/highlight cleanup. */
.profile-intro-shell {
  display: contents;
}

body.profile-page .profile-bio-story-stack .story-add-mini,
body.profile-page .profile-bio-story-stack .highlight-add-mini,
body.profile-page .profile-bio-story-stack .story-empty-launch,
body.profile-page .profile-bio-story-stack .highlight-empty-launch {
  display: none !important;
}

body.profile-page .profile-bio-story-stack > .profile-story-surface-highlights,
body.profile-page .profile-bio-story-stack .profile-highlights-rail,
body.profile-page .profile-bio-story-stack .profile-highlights-rail-compact,
body.profile-page .profile-bio-story-stack .profile-highlights-story-line,
body.profile-page .profile-bio-story-stack .profile-story-strip,
body.profile-page .profile-bio-story-stack .profile-highlights-list {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

body.profile-page .profile-bio-story-stack .profile-highlights-rail,
body.profile-page .profile-bio-story-stack .profile-highlights-rail-compact {
  padding: 0 !important;
}

body.profile-page .profile-bio-story-stack .story-circle,
body.profile-page .profile-bio-story-stack .highlight-circle {
  width: auto !important;
  min-width: 86px !important;
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Keep profile story/card layout stable without changing the global topbar. */
@media (min-width: 981px) {
  body.profile-page > .wallpaper-floating-btn,
  body.profile-page > .global-scroll-top-btn,
  body.profile-page > .wallpaper-modal {
    position: fixed !important;
    margin: 0 !important;
  }

  body.profile-page > .wallpaper-modal.hidden {
    display: none !important;
  }

  body.profile-page .layout-grid {
    margin: 0 auto 18px !important;
    padding-top: 0 !important;
  }

  body.profile-page.no-profile-shoutbox .profile-banner-standalone-card,
  body.profile-page.no-profile-shoutbox .profile-banner-card,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child,
  body.profile-page .main-content > .profile-banner-card:first-child {
    grid-row: 1 !important;
  }

  body.profile-page.no-profile-shoutbox .left-sidebar,
  body.profile-page.no-profile-shoutbox .right-sidebar {
    grid-row: 2 / span 100 !important;
  }

  body.profile-page.no-profile-shoutbox .profile-bio-card,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-bio-card,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-bio-card {
    grid-row: 2 !important;
  }

  body.profile-page.no-profile-shoutbox .profile-story-surface-stories,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-story-surface-stories,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-story-surface-stories {
    grid-row: 3 !important;
  }

  body.profile-page.no-profile-shoutbox .profile-story-surface-highlights,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-story-surface-highlights,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-story-surface-highlights {
    grid-row: 4 !important;
  }

  body.profile-page.no-profile-shoutbox .profile-custom-marquee-card,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-custom-marquee-card,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-custom-marquee-card {
    grid-row: 5 !important;
  }

  body.profile-page.no-profile-shoutbox .profile-action-rail-card,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-action-rail-card,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-action-rail-card {
    grid-row: 6 !important;
  }

  body.profile-page.no-profile-shoutbox .profile-tabs-card,
  body.profile-page.no-profile-shoutbox .profile-tabs-toolbar-card,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-tabs-card,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-tabs-toolbar-card,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-tabs-card,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-tabs-toolbar-card {
    grid-row: 7 !important;
  }

  body.profile-page .profile-section-tabs-card,
  body.profile-page.no-profile-shoutbox .profile-section-tabs-card,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-section-tabs-card,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-section-tabs-card {
    grid-column: 2 !important;
    grid-row: 7 !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    position: relative !important;
    z-index: 4 !important;
  }

  body.profile-page .profile-feed-main-toolbar,
  body.profile-page.no-profile-shoutbox .profile-feed-main-toolbar,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-feed-main-toolbar,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-feed-main-toolbar {
    grid-column: 2 !important;
    grid-row: 7 !important;
    width: 100% !important;
    margin: 0 0 14px !important;
    position: relative !important;
    z-index: 3 !important;
  }

  body.profile-page #profile-feed,
  body.profile-page .feed-list#profile-feed,
  body.profile-page .profile-feed-list,
  body.profile-page.no-profile-shoutbox #profile-feed,
  body.profile-page.no-profile-shoutbox .feed-list#profile-feed,
  body.profile-page.no-profile-shoutbox .profile-feed-list,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ #profile-feed,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .feed-list#profile-feed,
  body.profile-page .main-content > .profile-banner-standalone-card:first-child ~ .profile-feed-list,
  body.profile-page .main-content > .profile-banner-card:first-child ~ #profile-feed,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .feed-list#profile-feed,
  body.profile-page .main-content > .profile-banner-card:first-child ~ .profile-feed-list {
    grid-column: 2 !important;
    grid-row: 8 !important;
  }

  body.profile-page .profile-feed-main-toolbar .feed-toolbar-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  body.profile-page .profile-feed-main-toolbar .profile-feed-mode-bar,
  body.profile-page .profile-feed-main-toolbar .profile-feed-sort-tabs {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  body.profile-page .profile-feed-main-toolbar .profile-feed-sort-tabs {
    margin-left: auto !important;
  }

  body.profile-page .profile-feed-main-toolbar .profile-feed-filter-dropdowns {
    display: flex !important;
    align-items: center !important;
    flex: 0 1 500px !important;
    margin-left: auto !important;
    max-width: 500px !important;
    min-width: 0 !important;
  }

  body.profile-page .profile-feed-main-toolbar .profile-feed-filter-dropdowns .feed-filter-select-wrap {
    width: 100% !important;
  }

  body.profile-page .profile-feed-main-toolbar .feed-mode-btn,
  body.profile-page .profile-feed-main-toolbar .feed-sort-tabs button,
  body.profile-page .profile-feed-main-toolbar .composer-launch-btn {
    min-height: 38px !important;
    padding: 8px 11px !important;
    font-size: 13px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  body.profile-page .profile-feed-main-toolbar .composer-launch-btn {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  body.profile-page .profile-feed-main-toolbar .feed-toolbar-row {
    flex-wrap: wrap !important;
  }

  body.profile-page .profile-feed-main-toolbar .profile-feed-sort-tabs {
    margin-left: 0 !important;
  }

  body.profile-page .profile-feed-main-toolbar .profile-feed-filter-dropdowns {
    flex: 1 1 100% !important;
    margin-left: 0 !important;
    max-width: none !important;
  }

  body.profile-page .profile-feed-main-toolbar .composer-launch-btn {
    margin-right: auto !important;
  }
}

@media (min-width: 981px) {
  body.profile-page.profile-intro-combined .profile-intro-shell {
    grid-column: 2 !important;
    display: grid !important;
    gap: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 22px !important;
    background: var(--card, #fff) !important;
    box-shadow: 1px 1px 1px rgb(15 23 42 / 31%) !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox .profile-intro-shell {
    grid-row: 2 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox .profile-intro-shell {
    grid-row: 3 !important;
  }

  body.profile-page.profile-intro-combined .profile-intro-shell > .profile-bio-card,
  body.profile-page.profile-intro-combined .profile-intro-shell > .profile-bio-story-stack,
  body.profile-page.profile-intro-combined .profile-intro-shell .profile-bio-lines-card,
  body.profile-page.profile-intro-combined .profile-intro-shell .profile-story-surface-highlights {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  body.profile-page.profile-intro-combined .profile-intro-shell > .profile-bio-card {
    padding: 18px !important;
  }

  body.profile-page.profile-intro-combined .profile-intro-shell > .profile-bio-story-stack {
    display: grid !important;
    gap: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-intro-shell .profile-bio-lines-card,
  body.profile-page.profile-intro-combined .profile-intro-shell .profile-story-surface-highlights {
    border-top: 1px solid rgba(15, 23, 42, .08) !important;
    padding: 16px 18px !important;
  }

  body.profile-page.profile-intro-combined .profile-intro-shell .profile-story-surface-highlights {
    padding-bottom: 18px !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox.has-profile-marquee .profile-custom-marquee-card {
    grid-row: 3 !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox.has-profile-marquee .profile-action-rail-card,
  body.profile-page.profile-intro-combined.no-profile-shoutbox.no-profile-marquee .profile-custom-marquee-card {
    grid-row: 4 !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox.no-profile-marquee .profile-action-rail-card {
    grid-row: 3 !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox.has-profile-marquee .profile-section-tabs-card,
  body.profile-page.profile-intro-combined.no-profile-shoutbox.has-profile-marquee .profile-feed-main-toolbar {
    grid-row: 5 !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox.no-profile-marquee .profile-section-tabs-card,
  body.profile-page.profile-intro-combined.no-profile-shoutbox.no-profile-marquee .profile-feed-main-toolbar {
    grid-row: 4 !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox.has-profile-marquee #profile-feed,
  body.profile-page.profile-intro-combined.no-profile-shoutbox.has-profile-marquee .feed-list#profile-feed,
  body.profile-page.profile-intro-combined.no-profile-shoutbox.has-profile-marquee .profile-feed-list {
    grid-row: 6 !important;
  }

  body.profile-page.profile-intro-combined.no-profile-shoutbox.no-profile-marquee #profile-feed,
  body.profile-page.profile-intro-combined.no-profile-shoutbox.no-profile-marquee .feed-list#profile-feed,
  body.profile-page.profile-intro-combined.no-profile-shoutbox.no-profile-marquee .profile-feed-list {
    grid-row: 5 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox.has-profile-marquee .profile-custom-marquee-card {
    grid-row: 4 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox.has-profile-marquee .profile-action-rail-card,
  body.profile-page.profile-intro-combined.has-profile-shoutbox.no-profile-marquee .profile-custom-marquee-card {
    grid-row: 5 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox.no-profile-marquee .profile-action-rail-card {
    grid-row: 4 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox.has-profile-marquee .profile-section-tabs-card,
  body.profile-page.profile-intro-combined.has-profile-shoutbox.has-profile-marquee .profile-feed-main-toolbar {
    grid-row: 6 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox.no-profile-marquee .profile-section-tabs-card,
  body.profile-page.profile-intro-combined.has-profile-shoutbox.no-profile-marquee .profile-feed-main-toolbar {
    grid-row: 5 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox.has-profile-marquee #profile-feed,
  body.profile-page.profile-intro-combined.has-profile-shoutbox.has-profile-marquee .feed-list#profile-feed,
  body.profile-page.profile-intro-combined.has-profile-shoutbox.has-profile-marquee .profile-feed-list {
    grid-row: 7 !important;
  }

  body.profile-page.profile-intro-combined.has-profile-shoutbox.no-profile-marquee #profile-feed,
  body.profile-page.profile-intro-combined.has-profile-shoutbox.no-profile-marquee .feed-list#profile-feed,
  body.profile-page.profile-intro-combined.has-profile-shoutbox.no-profile-marquee .profile-feed-list {
    grid-row: 6 !important;
  }
}

/* Compact profile bio table: keep backend-added fields neat without wasting vertical space. */
body.profile-page .profile-bio-lines-card {
  padding: 10px 12px !important;
}

body.profile-page .profile-bio-lines-head {
  margin: 0 0 6px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
  font-size: 13px !important;
  line-height: 1.1 !important;
}

body.profile-page .profile-bio-lines {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)) !important;
  gap: 6px !important;
  align-items: stretch !important;
}

body.profile-page .profile-bio-line,
body.profile-page .profile-bio-line[data-profile-bio-key="about"] {
  grid-column: auto !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  gap: 5px !important;
  align-items: baseline !important;
  min-height: 0 !important;
  padding: 6px 8px !important;
  border-radius: 12px !important;
  background: color-mix(in srgb, var(--card, #fff) 56%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--line, #d9dde3) 48%, transparent) !important;
  box-shadow: none !important;
}

body.profile-page .profile-bio-line::before {
  display: none !important;
}

body.profile-page .profile-bio-line strong {
  font-size: 12px !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

body.profile-page .profile-bio-line strong::after {
  content: ":";
}

body.profile-page .profile-bio-line span {
  font-size: 13px !important;
  line-height: 1.18 !important;
  font-weight: 850 !important;
}

body.profile-page .profile-bio-line.has-bio-image {
  grid-template-columns: max-content minmax(0, 1fr) !important;
  gap: 6px 9px !important;
  align-items: start !important;
  padding: 8px !important;
  border-radius: 16px !important;
  overflow: visible !important;
}

body.profile-page .profile-bio-line.has-bio-image strong,
body.profile-page .profile-bio-line.has-bio-image .profile-bio-value {
  align-self: start !important;
}

body.profile-page .profile-bio-more-btn {
  grid-column: 1 / -1 !important;
  margin-top: 2px !important;
  padding: 6px 10px !important;
}

body.profile-page.profile-intro-combined .profile-intro-shell .profile-bio-lines-card {
  border-top: 0 !important;
  padding: 8px 18px 12px !important;
}

body.profile-page.profile-intro-combined .profile-intro-shell .profile-story-surface-highlights {
  border-top: 0 !important;
}

body.profile-page .profile-bio-inline-about {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 5px !important;
  justify-self: start !important;
  max-width: 100% !important;
  margin: 2px 0 0 !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--line, #d9dde3) 52%, transparent) !important;
  background: color-mix(in srgb, var(--card, #fff) 66%, transparent) !important;
  color: var(--text, #0f172a) !important;
  box-shadow: none !important;
  line-height: 1.18 !important;
}

body.profile-page .profile-bio-identity {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "summary summary"
    "avatar avatar"
    "about about" !important;
  align-items: start !important;
  column-gap: 16px !important;
  row-gap: 8px !important;
}

body.profile-page .profile-bio-avatar-link {
  grid-area: avatar !important;
  justify-self: start !important;
}

body.profile-page .profile-bio-summary {
  grid-area: summary !important;
  align-self: start !important;
  justify-self: start !important;
}

body.profile-page .profile-bio-avatar-about {
  grid-area: about !important;
  justify-self: start !important;
  width: min(100%, 620px) !important;
  margin-top: 0 !important;
}

body.profile-page .profile-bio-inline-about strong {
  flex: 0 0 auto !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

body.profile-page .profile-bio-inline-about span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: var(--text, #0f172a) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  white-space: nowrap !important;
}

body.profile-page .profile-bio-avatar-about span {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  line-height: 1.25 !important;
}

body.profile-page .profile-action-rail-card.profile-action-strip-card {
  display: grid !important;
  gap: 10px !important;
}

body.profile-page .profile-action-rail-head {
  width: min(100%, 760px) !important;
  margin: 0 auto 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

body.profile-page .profile-action-rail-head h2 {
  margin: 0 !important;
  color: var(--text, #0f172a) !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

/* Profile screenshot fixes: keep Top images square and let story tools escape the card. */
body.profile-page .profile-side-image-grid[data-profile-side-images] {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  align-items: start !important;
}

body.profile-page .profile-side-image-grid[data-profile-side-images] .profile-side-image,
body.profile-page .profile-side-image-grid[data-profile-side-images] .profile-side-image:first-child,
body.profile-page .profile-side-image-grid[data-profile-side-images] .profile-side-image:nth-child(1) {
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  min-height: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
  align-self: start !important;
  overflow: hidden !important;
}

body.profile-page .profile-side-image-grid[data-profile-side-images] .profile-side-image img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  display: block !important;
}

body.profile-page .profile-bio-redesign-card,
body.profile-page .profile-bio-card,
body.profile-page .profile-intro-shell,
body.profile-page .profile-bio-story-stack,
body.profile-page .profile-story-surface-row,
body.profile-page .profile-story-surface-main,
body.profile-page .profile-bio-story-stack .profile-highlights-rail,
body.profile-page .profile-bio-story-stack .profile-highlights-head,
body.profile-page .profile-bio-story-stack .profile-highlights-list {
  overflow: visible !important;
}

body.profile-page .profile-bio-story-stack .profile-story-tools-dropdown[open] {
  z-index: 3000 !important;
}

body.profile-page .profile-bio-story-stack .profile-story-tools-menu {
  top: auto !important;
  bottom: calc(100% + 8px) !important;
  z-index: 3001 !important;
}

@media (max-width: 760px) {
  body.profile-page .profile-bio-lines {
    grid-template-columns: 1fr !important;
  }

  body.profile-page .profile-bio-inline-about {
    width: 100% !important;
    border-radius: 14px !important;
  }

  body.profile-page .profile-bio-identity {
    column-gap: 12px !important;
  }
}

/* Mobile profile stack: remove the banner gap and flatten Stories/Highlights. */
@media (max-width: 980px) {
  body.profile-page.profile-intro-combined .main-content {
    gap: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-banner-standalone-card,
  body.profile-page.profile-intro-combined .profile-banner-card {
    margin-bottom: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-banner-standalone-card .profile-banner,
  body.profile-page.profile-intro-combined .profile-banner-card .profile-banner {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-intro-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.profile-page.profile-intro-combined .profile-intro-shell > .profile-bio-card {
    margin: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack {
    gap: 0 !important;
    margin: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack > .profile-bio-lines-card {
    margin: 0 !important;
    border-radius: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack > .profile-story-surface-highlights {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 14px 10px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-rail,
  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-rail-compact {
    position: relative !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-head {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 5 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-head .profile-sidebar-head-actions {
    margin: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-story-line {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-story-strip,
  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-list {
    padding: 0 44px 0 0 !important;
  }
}

/* Profile intro polish: group identity and stats into a deliberate header. */
body.profile-page.profile-intro-combined .profile-intro-shell > .profile-bio-card {
  padding: 18px !important;
}

body.profile-page.profile-intro-combined .profile-bio-topline {
  display: grid !important;
  grid-template-columns: minmax(250px, 1fr) minmax(280px, max-content) !important;
  align-items: center !important;
  gap: 18px !important;
}

body.profile-page.profile-intro-combined .profile-bio-identity {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "avatar summary"
    "avatar about" !important;
  align-items: center !important;
  column-gap: 14px !important;
  row-gap: 8px !important;
  min-width: 0 !important;
}

body.profile-page.profile-intro-combined .profile-bio-avatar-link {
  grid-area: avatar !important;
  justify-self: start !important;
  align-self: center !important;
  width: 84px !important;
  height: 84px !important;
  position: relative !important;
}

body.profile-page.profile-intro-combined .profile-bio-avatar,
body.profile-page.profile-intro-combined .profile-avatar-banner.profile-bio-avatar {
  width: 84px !important;
  height: 84px !important;
  border-radius: 22px !important;
  border: 3px solid #fff !important;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .14) !important;
}

body.profile-page.profile-intro-combined .profile-bio-avatar-btn {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: -10px !important;
  transform: translateX(-50%) !important;
  min-height: 24px !important;
  padding: 5px 9px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .16) !important;
}

body.profile-page.profile-intro-combined .profile-bio-summary {
  grid-area: summary !important;
  align-self: end !important;
  justify-self: stretch !important;
  min-width: 0 !important;
  gap: 3px !important;
}

body.profile-page.profile-intro-combined .profile-bio-summary h2 {
  margin: 0 !important;
  font-size: clamp(20px, 2vw, 25px) !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
}

body.profile-page.profile-intro-combined .profile-bio-summary h2 a {
  color: var(--text, #0f172a) !important;
}

body.profile-page.profile-intro-combined .profile-bio-summary .profile-username {
  color: var(--muted, #64748b) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

body.profile-page.profile-intro-combined .profile-bio-avatar-about {
  grid-area: about !important;
  align-self: start !important;
  justify-self: start !important;
  width: min(100%, 420px) !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 7px 11px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--bg, #f8fafc) 82%, #fff) !important;
  border: 1px solid color-mix(in srgb, var(--line, #d9dde3) 70%, transparent) !important;
  box-shadow: none !important;
}

body.profile-page.profile-intro-combined .profile-bio-avatar-about strong,
body.profile-page.profile-intro-combined .profile-bio-avatar-about span {
  font-size: 12px !important;
  line-height: 1.2 !important;
}

body.profile-page.profile-intro-combined .profile-bio-avatar-about span {
  white-space: normal !important;
}

body.profile-page.profile-intro-combined .profile-bio-stats {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(66px, 1fr)) !important;
  gap: 8px !important;
  width: min(100%, 380px) !important;
  margin: 0 !important;
  justify-self: end !important;
  align-self: center !important;
}

body.profile-page.profile-intro-combined .profile-bio-stats > * {
  appearance: none !important;
  min-width: 0 !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 8px 9px !important;
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  gap: 3px !important;
  border: 1px solid color-mix(in srgb, var(--line, #d9dde3) 76%, transparent) !important;
  border-radius: 14px !important;
  background: color-mix(in srgb, var(--card, #fff) 90%, var(--bg, #f8fafc)) !important;
  color: var(--text, #0f172a) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
  text-align: center !important;
  text-decoration: none !important;
  font: inherit !important;
}

body.profile-page.profile-intro-combined .profile-bio-stats > button {
  cursor: pointer !important;
}

body.profile-page.profile-intro-combined .profile-bio-stats > button:hover {
  transform: translateY(-1px) !important;
  border-color: color-mix(in srgb, var(--accent, #1877f2) 42%, var(--line, #d9dde3)) !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .10) !important;
}

body.profile-page.profile-intro-combined .profile-bio-stats strong {
  display: block !important;
  color: var(--text, #0f172a) !important;
  font-size: 17px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

body.profile-page.profile-intro-combined .profile-bio-stats span {
  display: block !important;
  max-width: 100% !important;
  color: var(--muted, #64748b) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.profile-page.profile-intro-combined .profile-bio-stats .profile-view-chip {
  background: color-mix(in srgb, var(--accent, #1877f2) 10%, var(--card, #fff)) !important;
  border-color: color-mix(in srgb, var(--accent, #1877f2) 28%, var(--line, #d9dde3)) !important;
}

@media (max-width: 1180px) {
  body.profile-page.profile-intro-combined .profile-bio-topline {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-stats {
    width: 100% !important;
    justify-self: stretch !important;
  }
}

@media (max-width: 520px) {
  body.profile-page.profile-intro-combined .profile-intro-shell > .profile-bio-card {
    padding: 14px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-identity {
    grid-template-columns: 74px minmax(0, 1fr) !important;
    column-gap: 12px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-avatar,
  body.profile-page.profile-intro-combined .profile-avatar-banner.profile-bio-avatar {
    width: 74px !important;
    height: 74px !important;
    border-radius: 20px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-avatar-link {
    width: 74px !important;
    height: 74px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-avatar-about {
    width: 100% !important;
    border-radius: 12px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-stats > * {
    min-height: 50px !important;
    padding: 7px 5px !important;
    border-radius: 12px !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-stats strong {
    font-size: 15px !important;
  }

body.profile-page.profile-intro-combined .profile-bio-stats span {
    font-size: 10px !important;
  }
}

/* Final mobile profile polish: white story surface, collapsible Options, compact feed controls. */
body.profile-page .profile-actions-dropdown-card > summary.profile-action-rail-head {
  cursor: pointer !important;
  list-style: none !important;
}

body.profile-page .profile-actions-dropdown-card > summary.profile-action-rail-head::-webkit-details-marker {
  display: none !important;
}

body.profile-page .profile-actions-dropdown-card .profile-action-rail-caret {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--accent, #1877f2) 12%, var(--card, #fff)) !important;
  color: var(--accent, #1877f2) !important;
  font-size: 13px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  transition: transform .16s ease !important;
}

body.profile-page .profile-actions-dropdown-card {
  --profile-actions-base: color-mix(in srgb, var(--card, #fff) 84%, var(--bg, #f8fafc));
  --profile-actions-surface: color-mix(in srgb, var(--accent, #1877f2) 8%, var(--profile-actions-base));
  --profile-actions-summary: color-mix(in srgb, var(--accent, #1877f2) 11%, var(--profile-actions-base));
  --profile-actions-chip-bg: color-mix(in srgb, var(--card, #fff) 74%, var(--bg, #f8fafc));
  --profile-actions-chip-hover: color-mix(in srgb, var(--accent, #1877f2) 13%, var(--profile-actions-chip-bg));
  --profile-actions-border: color-mix(in srgb, var(--line, #d9dde3) 74%, var(--accent, #1877f2) 26%);
  --profile-actions-text: var(--text, #0f172a);
  --profile-actions-muted: var(--muted, #64748b);
}

html[data-theme="dark"] body.profile-page .profile-actions-dropdown-card,
html[data-theme="midnight_slate"] body.profile-page .profile-actions-dropdown-card,
html[data-theme="lavender_night"] body.profile-page .profile-actions-dropdown-card,
html[data-theme="high_contrast"] body.profile-page .profile-actions-dropdown-card {
  --profile-actions-base: color-mix(in srgb, var(--card, #111827) 84%, #000);
  --profile-actions-surface: color-mix(in srgb, var(--accent, #60a5fa) 12%, var(--profile-actions-base));
  --profile-actions-summary: color-mix(in srgb, var(--accent, #60a5fa) 16%, var(--profile-actions-base));
  --profile-actions-chip-bg: color-mix(in srgb, var(--card, #111827) 84%, var(--bg, #020617));
  --profile-actions-chip-hover: color-mix(in srgb, var(--accent, #60a5fa) 18%, var(--profile-actions-chip-bg));
  --profile-actions-border: color-mix(in srgb, var(--line, #334155) 64%, var(--accent, #60a5fa) 36%);
}

body.profile-page .profile-action-rail-card.profile-action-strip-card.profile-actions-dropdown-card {
  border: 1px solid var(--profile-actions-border) !important;
  background: var(--profile-actions-surface) !important;
  color: var(--profile-actions-text) !important;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--text, #0f172a) 14%, transparent) !important;
  backdrop-filter: blur(12px) !important;
}

body.profile-page .profile-actions-dropdown-card > summary.profile-action-rail-head {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--profile-actions-text) !important;
}

body.profile-page .profile-actions-dropdown-card > summary.profile-action-rail-head h2 {
  color: var(--profile-actions-text) !important;
}

body.profile-page .profile-actions-dropdown-card .profile-action-rail {
  color: var(--profile-actions-text) !important;
}

body.profile-page .profile-actions-dropdown-card .profile-action-chip,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.profile-media-action-btn,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.profile-action-chip-link,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.profile-friend-action,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.bookmark-toggle-btn,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.share-toggle-btn,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.share-count-chip,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.profile-view-chip,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.report-action-btn,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.gift-send-open-btn {
  border-color: var(--profile-actions-border) !important;
  background: var(--profile-actions-chip-bg) !important;
  color: var(--profile-actions-text) !important;
  box-shadow: none !important;
}

body.profile-page .profile-actions-dropdown-card .profile-action-chip:hover,
body.profile-page .profile-actions-dropdown-card .profile-action-chip:focus-visible {
  border-color: color-mix(in srgb, var(--accent, #1877f2) 54%, var(--profile-actions-border)) !important;
  background: var(--profile-actions-chip-hover) !important;
  color: var(--profile-actions-text) !important;
}

body.profile-page .profile-actions-dropdown-card .profile-action-chip.follow-btn,
body.profile-page .profile-actions-dropdown-card .profile-action-chip.gift-send-open-btn {
  border-color: var(--accent, #1877f2) !important;
  background: var(--accent, #1877f2) !important;
  color: var(--button-text, #fff) !important;
}

html[data-theme="high_contrast"] body.profile-page .profile-actions-dropdown-card .profile-action-chip.follow-btn,
html[data-theme="high_contrast"] body.profile-page .profile-actions-dropdown-card .profile-action-chip.gift-send-open-btn {
  color: #000 !important;
}

body.profile-page .profile-actions-dropdown-card .profile-action-chip.report-action-btn {
  color: #b91c1c !important;
}

body.profile-page .profile-actions-dropdown-card[open] .profile-action-rail-caret,
body.profile-page .profile-actions-dropdown-card.is-open .profile-action-rail-caret {
  transform: rotate(180deg) !important;
}

@media (min-width: 981px) {
  body.profile-page .profile-actions-dropdown-card:not([open]) > .profile-action-rail {
    display: flex !important;
  }

  body.profile-page .profile-actions-dropdown-card .profile-action-rail-caret {
    display: none !important;
  }
}

@media (max-width: 980px) {
  body.profile-page.profile-intro-combined .profile-bio-story-stack > .profile-story-surface-highlights,
  body.profile-page .profile-bio-story-stack > .profile-story-surface-highlights {
    width: 100% !important;
    margin: 0 !important;
    padding: 14px !important;
    border-top: 1px solid color-mix(in srgb, var(--line, #d9dde3) 68%, transparent) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--line, #d9dde3) 68%, transparent) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    background: color-mix(in srgb, var(--card, #fff) 96%, var(--bg, #f8fafc)) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08) !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-rail,
  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-rail-compact,
  body.profile-page .profile-bio-story-stack .profile-highlights-rail,
  body.profile-page .profile-bio-story-stack .profile-highlights-rail-compact {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-story-line,
  body.profile-page .profile-bio-story-stack .profile-highlights-story-line {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-story-strip,
  body.profile-page.profile-intro-combined .profile-bio-story-stack .profile-highlights-list,
  body.profile-page .profile-bio-story-stack .profile-story-strip,
  body.profile-page .profile-bio-story-stack .profile-highlights-list {
    padding: 0 44px 0 0 !important;
  }

  body.profile-page .profile-action-rail-card.profile-action-strip-card.profile-actions-dropdown-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    background: var(--profile-actions-surface) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08) !important;
    backdrop-filter: none !important;
    overflow: visible !important;
  }

  body.profile-page .profile-actions-dropdown-card > summary.profile-action-rail-head {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 13px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    background: var(--profile-actions-summary) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--profile-actions-border) 78%, transparent) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
  }

  body.profile-page .profile-actions-dropdown-card:not([open]):not(.is-open) > .profile-action-rail {
    display: none !important;
  }

  body.profile-page .profile-actions-dropdown-card[open] > .profile-action-rail,
  body.profile-page .profile-actions-dropdown-card.is-open > .profile-action-rail {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 12px 14px !important;
    justify-content: stretch !important;
  }

  body.profile-page .profile-actions-dropdown-card[open] .profile-action-chip,
  body.profile-page .profile-actions-dropdown-card.is-open .profile-action-chip {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
}

@media (min-width: 981px) {
  body.profile-page .profile-left-sidebar-stack {
    gap: 12px !important;
  }

  body.profile-page .profile-sidebar-avatar-card {
    display: grid !important;
    justify-items: center !important;
    padding: 16px 12px 28px !important;
    overflow: visible !important;
  }

  body.profile-page .profile-sidebar-avatar-link {
    position: relative !important;
    display: inline-flex !important;
    width: 116px !important;
    height: 116px !important;
    border-radius: 28px !important;
    text-decoration: none !important;
  }

  body.profile-page .profile-sidebar-avatar-img,
  body.profile-page .profile-sidebar-avatar-link .profile-sidebar-avatar-img,
  body.profile-page .profile-sidebar-avatar-link img.profile-sidebar-avatar-img {
    width: 116px !important;
    height: 116px !important;
    border-radius: 28px !important;
    object-fit: cover !important;
    border: 3px solid rgba(255, 255, 255, .96) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .18) !important;
    background: var(--card, #fff) !important;
  }

  body.profile-page .profile-sidebar-avatar-btn {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    bottom: -14px !important;
    transform: translateX(-50%) !important;
    min-height: 30px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    z-index: 3 !important;
  }

  body.profile-page .profile-bio-card .profile-bio-avatar-link {
    display: none !important;
  }

  body.profile-page .profile-bio-card .profile-bio-identity {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "summary"
      "about" !important;
  }

  body.profile-page .profile-bio-card .profile-bio-avatar-about {
    width: 100% !important;
  }
}

@media (max-width: 980px) {
  body.profile-page .profile-sidebar-avatar-card {
    display: none !important;
  }
}

/* Keep the Stories/HighLights tools popup above the profile glass cards. */
body.profile-page .profile-bio-story-stack,
body.profile-page .profile-bio-story-stack > .profile-story-surface-highlights,
body.profile-page .profile-bio-story-stack .profile-highlights-rail,
body.profile-page .profile-bio-story-stack .profile-highlights-rail-compact,
body.profile-page .profile-bio-story-stack .profile-highlights-head,
body.profile-page .profile-bio-story-stack .profile-sidebar-head-actions,
body.profile-page .profile-bio-story-stack .profile-story-owner-actions {
  position: relative !important;
  overflow: visible !important;
}

body.profile-page .profile-bio-story-stack {
  z-index: 6 !important;
}

body.profile-page .profile-bio-story-stack:has(.profile-story-tools-dropdown[open]),
body.profile-page .profile-bio-story-stack:has(.profile-story-tools-dropdown.is-open),
body.profile-page .profile-bio-story-stack > .profile-story-surface-highlights:has(.profile-story-tools-dropdown[open]),
body.profile-page .profile-bio-story-stack > .profile-story-surface-highlights:has(.profile-story-tools-dropdown.is-open),
body.profile-page .profile-bio-story-stack .profile-highlights-rail:has(.profile-story-tools-dropdown[open]),
body.profile-page .profile-bio-story-stack .profile-highlights-rail:has(.profile-story-tools-dropdown.is-open),
body.profile-page .profile-bio-story-stack .profile-highlights-head:has(.profile-story-tools-dropdown[open]),
body.profile-page .profile-bio-story-stack .profile-highlights-head:has(.profile-story-tools-dropdown.is-open),
body.profile-page .profile-bio-story-stack .profile-story-owner-actions:has(.profile-story-tools-dropdown[open]),
body.profile-page .profile-bio-story-stack .profile-story-owner-actions:has(.profile-story-tools-dropdown.is-open) {
  z-index: 2147481200 !important;
  isolation: isolate !important;
}

body.profile-page .profile-bio-story-stack .profile-story-tools-dropdown[open],
body.profile-page .profile-bio-story-stack .profile-story-tools-dropdown.is-open {
  z-index: 2147481400 !important;
}

body.profile-page .profile-bio-story-stack .profile-story-tools-dropdown[open] .profile-story-tools-menu,
body.profile-page .profile-bio-story-stack .profile-story-tools-dropdown.is-open .profile-story-tools-menu {
  z-index: 2147481500 !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--card, #fff) !important;
}

/* Keep the profile Options menu control visible on every theme. */
body.profile-page .profile-actions-dropdown-card .profile-action-rail-caret {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 30px !important;
  border-radius: 999px !important;
  background: var(--profile-theme-control-bg, color-mix(in srgb, var(--accent, #1877f2) 14%, var(--card, #fff))) !important;
  color: var(--profile-theme-control-text, var(--accent, #1877f2)) !important;
  border: 1px solid var(--profile-theme-control-border, color-mix(in srgb, var(--accent, #1877f2) 34%, var(--line, #d9dde3))) !important;
  box-shadow: var(--profile-theme-control-shadow, 0 10px 22px color-mix(in srgb, var(--accent, #1877f2) 16%, transparent)) !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: 1px !important;
  line-height: 1 !important;
  transform: none !important;
}

body.profile-page .profile-actions-dropdown-card[open] .profile-action-rail-caret,
body.profile-page .profile-actions-dropdown-card.is-open .profile-action-rail-caret {
  transform: none !important;
  background: var(--profile-theme-primary-bg, var(--accent, #1877f2)) !important;
  color: #fff !important;
}

@media (min-width: 981px) {
  body.profile-page .profile-actions-dropdown-card > summary.profile-action-rail-head {
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 auto 8px !important;
  }

body.profile-page .profile-actions-dropdown-card .profile-action-rail-caret {
    display: inline-flex !important;
  }
}

/* Bio field images: owner clicks the field title to attach a representative picture. */
body.profile-page .profile-bio-line {
  position: relative !important;
}

body.profile-page .profile-bio-line.has-bio-image {
  grid-template-columns: max-content minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 6px 9px !important;
  padding: 8px !important;
  border-radius: 16px !important;
  overflow: visible !important;
}

body.profile-page .profile-bio-line .profile-bio-value {
  min-width: 0 !important;
}

body.profile-page .profile-bio-title-button {
  appearance: none !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: inherit !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  max-width: 100% !important;
  padding: 0 !important;
  font: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  text-align: left !important;
}

body.profile-page .profile-bio-title-button:hover,
body.profile-page .profile-bio-title-button:focus-visible {
  color: var(--accent, #1877f2) !important;
  outline: 0 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

body.profile-page .profile-bio-image-wrap,
body.profile-page .profile-bio-inline-about .profile-bio-image-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  grid-column: 1 / -1 !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  height: clamp(118px, 22vw, 188px) !important;
  margin: 6px 0 0 !important;
  overflow: visible !important;
  border-radius: 16px !important;
  border: 1px solid color-mix(in srgb, var(--accent, #1877f2) 24%, var(--line, #d9dde3)) !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent, #1877f2) 8%, transparent), transparent 58%),
    color-mix(in srgb, var(--card, #fff) 90%, var(--bg, #f0f2f5)) !important;
  box-shadow: 0 14px 32px color-mix(in srgb, var(--text, #0f172a) 13%, transparent) !important;
  padding: 5px !important;
}

body.profile-page .profile-bio-image-wrap[hidden],
body.profile-page .profile-bio-inline-about .profile-bio-image-wrap[hidden] {
  display: none !important;
}

body.profile-page .profile-bio-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card, #fff) 30%, transparent) !important;
}

body.profile-page .profile-bio-image-remove {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, #fff 42%, transparent) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, #020617 76%, transparent) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px color-mix(in srgb, #000 28%, transparent) !important;
  cursor: pointer !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

body.profile-page .profile-bio-image-remove:hover,
body.profile-page .profile-bio-image-remove:focus-visible {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  outline: 0 !important;
}

body.profile-page .profile-bio-inline-about.has-bio-image {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  align-items: start !important;
  border-radius: 18px !important;
  max-width: min(100%, 540px) !important;
  width: 100% !important;
}

body.profile-page .profile-bio-inline-about .profile-bio-image-wrap {
  width: 100% !important;
  min-width: 0 !important;
  height: clamp(120px, 24vw, 210px) !important;
}

body.profile-page .profile-bio-image-status {
  position: fixed !important;
  left: 50% !important;
  bottom: 22px !important;
  transform: translateX(-50%) !important;
  z-index: 2147481000 !important;
  max-width: min(92vw, 420px) !important;
  padding: 10px 14px !important;
  border-radius: 999px !important;
  background: var(--card, #fff) !important;
  color: var(--text, #0f172a) !important;
  border: 1px solid color-mix(in srgb, var(--line, #d9dde3) 72%, transparent) !important;
  box-shadow: 0 16px 36px color-mix(in srgb, var(--text, #0f172a) 18%, transparent) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

body.profile-page .profile-bio-image-status.is-error {
  border-color: color-mix(in srgb, #ef4444 62%, var(--line, #d9dde3)) !important;
  color: #b91c1c !important;
}

@media (max-width: 520px) {
  body.profile-page .profile-bio-line.has-bio-image {
    grid-template-columns: max-content minmax(0, 1fr) !important;
  }

  body.profile-page .profile-bio-image-wrap,
  body.profile-page .profile-bio-inline-about .profile-bio-image-wrap {
    width: 100% !important;
    min-width: 0 !important;
    height: clamp(128px, 42vw, 190px) !important;
    border-radius: 15px !important;
  }

  body.profile-page .profile-bio-image {
    border-radius: 11px !important;
  }
}

/* Final bio image placement: keep stat rows text-only and render pictures below them. */
body.profile-page .profile-bio-line > .profile-bio-image-wrap,
body.profile-page .profile-bio-inline-about > .profile-bio-image-wrap {
  display: none !important;
}

body.profile-page .profile-bio-line.has-bio-image,
body.profile-page .profile-bio-inline-about.has-bio-image {
  grid-template-columns: max-content minmax(0, 1fr) !important;
  align-items: baseline !important;
  gap: 5px !important;
  padding: 6px 8px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

body.profile-page .profile-bio-line.has-bio-image strong,
body.profile-page .profile-bio-line.has-bio-image .profile-bio-value,
body.profile-page .profile-bio-inline-about.has-bio-image strong,
body.profile-page .profile-bio-inline-about.has-bio-image .profile-bio-value {
  align-self: baseline !important;
}

body.profile-page .profile-bio-images-panel {
  grid-column: 1 / -1 !important;
  display: block !important;
  margin-top: 8px !important;
  padding-top: 10px !important;
  border-top: 1px solid color-mix(in srgb, var(--line, #d9dde3) 62%, transparent) !important;
}

body.profile-page .profile-bio-images-panel[hidden] {
  display: none !important;
}

body.profile-page .profile-bio-images-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

body.profile-page .profile-bio-image-card {
  position: relative !important;
  display: block !important;
  min-width: 0 !important;
  aspect-ratio: 16 / 10 !important;
  padding: 4px !important;
  border-radius: 16px !important;
  border: 1px solid color-mix(in srgb, var(--line, #d9dde3) 70%, transparent) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card, #fff) 96%, transparent), color-mix(in srgb, var(--card, #fff) 84%, var(--primary, #2563eb) 16%)) !important;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--text, #0f172a) 10%, transparent) !important;
  overflow: hidden !important;
}

body.profile-page .profile-bio-image-card[hidden] {
  display: none !important;
}

body.profile-page .profile-bio-image-card-head {
  display: none !important;
}

body.profile-page .profile-bio-image-card-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: var(--text, #0f172a) !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
}

body.profile-page .profile-bio-image-card .profile-bio-image-wrap {
  display: contents !important;
}

body.profile-page .profile-bio-image-card .profile-bio-image-open {
  position: absolute !important;
  inset: 4px !important;
  z-index: 2 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: transparent !important;
  cursor: zoom-in !important;
  overflow: hidden !important;
}

body.profile-page .profile-bio-image-card .profile-bio-image-open:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary, #2563eb) 70%, #fff 30%) !important;
  outline-offset: 3px !important;
}

body.profile-page .profile-bio-image-card .profile-bio-image {
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 11px !important;
  object-fit: cover !important;
}

body.profile-page .profile-bio-image-card .profile-bio-image-remove {
  top: 12px !important;
  right: 12px !important;
  z-index: 5 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

html.profile-bio-lightbox-open,
html.profile-bio-lightbox-open body {
  overflow: hidden !important;
}

body.profile-page .profile-bio-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: grid !important;
  place-items: center !important;
  padding: clamp(14px, 3vw, 34px) !important;
  background:
    radial-gradient(circle at 50% 12%, rgba(255,255,255,.18), transparent 34%),
    rgba(3, 7, 18, .82) !important;
  backdrop-filter: blur(10px) saturate(1.05) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.05) !important;
}

body.profile-page .profile-bio-lightbox.hidden,
body.profile-page .profile-bio-lightbox[hidden] {
  display: none !important;
}

body.profile-page .profile-bio-lightbox-backdrop {
  position: absolute !important;
  inset: 0 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: zoom-out !important;
}

body.profile-page .profile-bio-lightbox-shell {
  position: relative !important;
  z-index: 1 !important;
  display: grid !important;
  place-items: center !important;
  width: min(96vw, 1180px) !important;
  max-height: 94dvh !important;
  min-height: 0 !important;
}

body.profile-page .profile-bio-lightbox-image {
  display: block !important;
  max-width: 100% !important;
  max-height: 82dvh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: clamp(14px, 2vw, 24px) !important;
  background: color-mix(in srgb, var(--card, #fff) 90%, #000 10%) !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.46) !important;
}

body.profile-page .profile-bio-lightbox-caption {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  max-width: min(92vw, 720px) !important;
  margin-top: 14px !important;
  padding: 10px 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  color: #fff !important;
  background: rgba(15, 23, 42, .72) !important;
  box-shadow: 0 18px 40px rgba(0,0,0,.25) !important;
}

body.profile-page .profile-bio-lightbox-caption strong {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

body.profile-page .profile-bio-lightbox-caption span {
  color: rgba(255,255,255,.72) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

body.profile-page .profile-bio-lightbox-close,
body.profile-page .profile-bio-lightbox-nav {
  position: absolute !important;
  z-index: 2 !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 44px !important;
  height: 44px !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: rgba(15, 23, 42, .76) !important;
  box-shadow: 0 16px 34px rgba(0,0,0,.28) !important;
  cursor: pointer !important;
}

body.profile-page .profile-bio-lightbox-close {
  top: -8px !important;
  right: -8px !important;
  font-size: 26px !important;
  line-height: 1 !important;
}

body.profile-page .profile-bio-lightbox-nav {
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 34px !important;
  line-height: 1 !important;
}

body.profile-page .profile-bio-lightbox-prev {
  left: -22px !important;
}

body.profile-page .profile-bio-lightbox-next {
  right: -22px !important;
}

body.profile-page .profile-bio-lightbox-nav[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  body.profile-page .profile-bio-lightbox {
    padding: 10px !important;
  }

  body.profile-page .profile-bio-lightbox-shell {
    width: 100% !important;
    max-height: 100dvh !important;
  }

  body.profile-page .profile-bio-lightbox-image {
    max-width: 100% !important;
    max-height: 82dvh !important;
    border-radius: 16px !important;
  }

  body.profile-page .profile-bio-lightbox-close {
    top: 8px !important;
    right: 8px !important;
  }

  body.profile-page .profile-bio-lightbox-prev {
    left: 8px !important;
  }

  body.profile-page .profile-bio-lightbox-next {
    right: 8px !important;
  }

  body.profile-page .profile-bio-lightbox-caption {
    max-width: calc(100vw - 28px) !important;
    border-radius: 16px !important;
  }
}

@media (max-width: 760px) {
  body.profile-page .profile-bio-images-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)) !important;
  }
}
