/* SportCV final phone profile cascade — v754. Loaded after legacy media assets. */
@media (max-width: 700px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  .scv-page-content,
  .scv-profile-main-column,
  .scv-profile-main-column > .left-col,
  .scv-profile-tab-panel,
  .scv-profile-tab-panel > .card,
  .scv-extended-profile-panel,
  .scv-extended-profile-panel > .card {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Compact, predictable media tiles. */
  #photoCard .photo-gallery,
  #videoCard .photo-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  #photoCard .photo-item,
  #videoCard .video-shell {
    display: grid !important;
    min-width: 0 !important;
    align-content: start !important;
    grid-template-rows: auto auto !important;
    overflow: hidden !important;
    border-radius: 11px !important;
  }

  #photoCard .photo-item-media {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 4 / 3 !important;
    overflow: hidden !important;
    background: #edf3f9 !important;
  }

  #videoCard .video-frame,
  #videoFrame {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    background: #0b1f36 !important;
  }

  #photoCard .photo-item-media img,
  #videoCard .video-frame img,
  #videoFrame img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
  }

  #photoCard img.scv-media-load-failed,
  #videoCard img.scv-media-load-failed {
    display: none !important;
  }

  #photoCard .scv-media-failed::after,
  #videoCard .scv-media-failed::after {
    position: absolute !important;
    z-index: 1 !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    padding: 10px !important;
    background: #edf3f9 !important;
    color: #708297 !important;
    content: "Preview unavailable" !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-align: center !important;
  }

  #photoCard .photo-name-badge {
    z-index: 2 !important;
    top: 7px !important;
    right: 7px !important;
    left: 7px !important;
    max-width: none !important;
    padding: 4px 7px !important;
    font-size: 9px !important;
  }

  #photoCard .photo-comment-preview,
  #videoCard .video-meta {
    min-height: 0 !important;
    align-content: start !important;
    gap: 2px !important;
    padding: 7px 8px 8px !important;
  }

  #photoCard .photo-comment-preview-date,
  #videoCard .video-meta-caption {
    font-size: 9px !important;
    line-height: 1.25 !important;
  }

  #photoCard .photo-comment-preview-text,
  #videoCard .video-meta-title {
    display: -webkit-box !important;
    overflow: hidden !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  #videoCard .video-play {
    width: 38px !important;
    height: 38px !important;
    font-size: 13px !important;
  }

  #photoCard .media-show-all-btn,
  #videoCard .media-show-all-btn {
    min-height: 36px !important;
    padding: 7px 11px !important;
    font-size: 10px !important;
  }

  /* Keep owner actions inside the header and reduce summary whitespace. */
  body.owner-mode .scv-extended-profile-panel > .card > .card-body {
    padding: 0 !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-extended-section-head {
    display: flex !important;
    height: 40px !important;
    min-height: 40px !important;
    align-items: center !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 4px 7px 4px 13px !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-extended-section-head > div {
    min-width: 0 !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-extended-section-head h2.card-title {
    overflow: hidden !important;
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-section-edit {
    display: inline-grid !important;
    width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    flex: 0 0 30px !important;
    place-items: center !important;
    margin: 0 !important;
  }

  body.owner-mode .scv-extended-profile-panel [data-scv-extended-content] {
    padding: 8px 13px 11px !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-section-view {
    gap: 5px !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-entry {
    gap: 4px !important;
    padding-bottom: 7px !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-entry + .scv-owner-summary-entry {
    padding-top: 7px !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-entry-head,
  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-entry-head-no-title {
    min-height: 20px !important;
    align-items: center !important;
    align-self: stretch !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    margin: 0 !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-entry-head:not(.scv-owner-summary-entry-head-no-title) {
    justify-content: space-between !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-visibility {
    min-height: 20px !important;
    padding: 2px 7px !important;
    font-size: 8.5px !important;
    line-height: 1 !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-detail-value,
  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-text,
  body:not(.owner-mode) .scv-extended-profile-panel,
  #aboutCard .about-text {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  /* The footer background must cover the viewport even if legacy content overflows. */
  .scv-global-footer.scv-footer-compact-v4 {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-right: calc(50% - 50vw) !important;
    margin-left: calc(50% - 50vw) !important;
    box-sizing: border-box !important;
  }
}

/* Responsive media viewer and compact title/caption editors. */
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-media-footer, .media-viewer-photo-meta),
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer-main {
  overflow: hidden !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-media-note, .media-viewer-photo-comment-display, .media-viewer-media-caption) {
  display: -webkit-box !important;
  max-height: 2.7em !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-note.is-empty {
  display: none !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-surface {
  grid-area: 2 / 1 / 3 / -1 !important;
  position: relative !important;
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  container-type: size;
  background: #000 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-surface > :is(.media-viewer-video-thumb, .media-viewer-video, .media-viewer-native-video) {
  grid-area: auto !important;
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  overflow: hidden !important;
  background: #000 !important;
}
@supports (width: 1cqw) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-surface.scv-video-landscape > :is(.media-viewer-video-thumb, .media-viewer-video, .media-viewer-native-video) {
    width: min(100cqw, 177.778cqh) !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-surface.scv-video-portrait > :is(.media-viewer-video-thumb, .media-viewer-video, .media-viewer-native-video) {
    width: min(100cqw, 56.25cqh) !important;
    height: auto !important;
    aspect-ratio: 9 / 16 !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-surface.scv-video-square > :is(.media-viewer-video-thumb, .media-viewer-video, .media-viewer-native-video) {
    width: min(100cqw, 100cqh) !important;
    height: auto !important;
    aspect-ratio: 1 !important;
  }
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-surface .media-viewer-video-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage:has(.is-editing) {
  grid-template-rows: minmax(0, 1fr) !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage:has(.is-editing) .media-viewer-photo-strip {
  display: none !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
  top: auto !important;
  left: 50% !important;
  right: auto !important;
  bottom: 12px !important;
  width: min(640px, calc(100% - 24px)) !important;
  height: min(260px, calc(100% - 68px)) !important;
  max-height: calc(100% - 68px) !important;
  padding: 14px !important;
  transform: translateX(-50%) !important;
  overflow: hidden !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-shell {
  grid-template-rows: 60px minmax(36px, 1fr) auto 44px !important;
  gap: 8px !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-actions {
  grid-row: 4 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-edit-error {
  grid-row: 3 !important;
  min-height: 0 !important;
  padding: 7px 10px !important;
  border: 1px solid rgba(255, 155, 155, .55) !important;
  border-radius: 9px !important;
  background: rgba(119, 18, 31, .38) !important;
  color: #ffd9dd !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-edit-error[hidden] {
  display: none !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing :is(input, textarea) {
  border-radius: 10px !important;
}

@media (max-width: 700px) {
  #mediaViewerBackdrop.scv-stable-media {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  #mediaViewerBackdrop.scv-stable-media .media-viewer:has(.media-viewer-story-card) {
    width: 100% !important;
    max-width: none !important;
    height: var(--scv-media-frame-height, 100%) !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  body #mediaViewerBackdrop.scv-stable-media .media-viewer.is-story-media-viewer:has(.media-viewer-story-card) {
    border-radius: 0 !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage {
    grid-template-rows: minmax(0, 1fr) 64px !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage:not(:has(.media-viewer-photo-strip)),
  #mediaViewerBackdrop.scv-stable-media.scv-stable-video #mediaViewerStage {
    grid-template-rows: minmax(0, 1fr) !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card {
    grid-template-rows: 52px minmax(0, 1fr) 72px !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-title {
    padding: 6px 64px 6px 76px !important;
    font-size: 16px !important;
    overflow: hidden !important;
  }
  #mediaViewerBackdrop.scv-stable-media .media-viewer:has(.media-viewer-story-card) .media-viewer-close {
    top: 4px !important;
    right: 6px !important;
    width: 44px !important;
    height: 44px !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-photo-counter, .media-viewer-story-counter) {
    top: 12px !important;
    left: 10px !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-media-footer, .media-viewer-photo-meta) {
    padding: 6px 12px !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-strip {
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px)) !important;
    scrollbar-width: none;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-strip::-webkit-scrollbar {
    display: none;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
    top: auto !important;
    bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 20px) !important;
    height: min(352px, calc(100% - 60px)) !important;
    max-height: calc(100% - 60px) !important;
    padding: 12px !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card:has(.is-editing) > :is(img, .media-viewer-media-surface, .media-viewer-video-thumb, .media-viewer-video, .media-viewer-native-video) {
    visibility: visible !important;
  }
}

@media (min-width: 701px) and (max-width: 1100px) and (orientation: portrait) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
    width: min(680px, calc(100% - 32px)) !important;
    height: min(300px, calc(100% - 80px)) !important;
  }
}

@media (min-width: 701px) and (max-width: 1100px) and (orientation: landscape) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
    top: 50% !important;
    left: auto !important;
    right: 12px !important;
    bottom: auto !important;
    width: min(38%, 430px) !important;
    height: min(360px, calc(100% - 80px)) !important;
    max-height: calc(100% - 80px) !important;
    transform: translateY(-50%) !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card:has(.is-editing) > img,
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card:has(.is-editing) > .media-viewer-media-surface {
    width: 60% !important;
    justify-self: start !important;
  }
}

@media (min-width: 701px) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage {
    grid-template-rows: minmax(0, 1fr) 64px !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage:not(:has(.media-viewer-photo-strip)),
  #mediaViewerBackdrop.scv-stable-media.scv-stable-video #mediaViewerStage {
    grid-template-rows: minmax(0, 1fr) !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card {
    grid-template-rows: 52px minmax(0, 1fr) 52px !important;
  }
}

/* Owner section-header normalization moved to sportcv-owner-section-header-v787.css (v809). */

/* v793 — equal-sized labels and values throughout owner information sections. */
body.owner-mode .scv-extended-profile-panel .scv-owner-detail-label,
body.owner-mode :is(:is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard, #profileSportStatsBlock) .profile-performance-label,
body.owner-mode .scv-unified-detail-label {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

body.owner-mode .scv-extended-profile-panel .scv-owner-detail-value,
body.owner-mode :is(:is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard, #profileSportStatsBlock) .profile-performance-value,
body.owner-mode .scv-unified-detail-value {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

body.owner-mode :is(:is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard) .profile-performance-note,
body.owner-mode .scv-extended-profile-panel .scv-owner-summary-text,
body.owner-mode #aboutCard .about-text {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}

body.owner-mode .scv-performance-skills .scv-tab-subheading {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 17px !important;
  line-height: 1.2 !important;
}

@media (max-width: 700px) {
  body.owner-mode .scv-extended-profile-panel .scv-owner-detail-label,
  body.owner-mode .scv-extended-profile-panel .scv-owner-detail-value,
  body.owner-mode :is(:is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard, #profileSportStatsBlock) :is(.profile-performance-label, .profile-performance-value),
  body.owner-mode :is(.scv-unified-detail-label, .scv-unified-detail-value) {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }

  body.owner-mode #photoCard .photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 339px) {
  #photoCard .photo-gallery,
  #videoCard .photo-gallery {
    grid-template-columns: 1fr !important;
  }
}

/* v754 — final navigation, action, wrapping, and extended-card width guards. */
@media (max-width: 700px) {
  .scv-profile-section-nav {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    overscroll-behavior-inline: none !important;
    scrollbar-width: none !important;
  }

  .scv-profile-section-nav::-webkit-scrollbar {
    display: none !important;
  }

  .scv-profile-section-nav button,
  .scv-profile-section-nav [data-scv-profile-tab="media"],
  .scv-profile-section-nav .scv-profile-more-button {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 0 !important;
    padding: 2px 2px !important;
    font-size: clamp(9px, 2.55vw, 10.75px) !important;
    letter-spacing: -.015em !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  .scv-profile-section-nav[data-scv-visible-count="4"] button,
  .scv-profile-section-nav[data-scv-visible-count="3"] button,
  .scv-profile-section-nav[data-scv-visible-count="2"] button,
  .scv-profile-section-nav[data-scv-visible-count="1"] button {
    font-size: clamp(10.5px, 2.9vw, 12px) !important;
    letter-spacing: 0 !important;
  }

  body.owner-mode .scv-extended-profile-panel,
  body.owner-mode .scv-extended-profile-panel > .card,
  body.owner-mode .scv-extended-profile-panel > .card > .card-body,
  body.owner-mode .scv-extended-profile-panel [data-scv-extended-content],
  body.owner-mode .scv-extended-profile-panel .scv-owner-section-view,
  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-entry,
  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-entry-head,
  body.owner-mode .scv-extended-profile-panel .scv-owner-summary-grid {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-extended-section-head {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-section-edit:not([hidden]) {
    display: inline-grid !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-visibility {
    max-width: 116px !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-detail-value,
  .scv-unified-detail-value,
  #aboutCard .about-text {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }

  body.owner-mode .scv-extended-profile-panel .scv-owner-detail-label.scv-long-detail-label,
  .scv-unified-detail-label.scv-long-detail-label {
    grid-column: 1 / -1 !important;
    padding: 6px 0 1px !important;
  }

body.owner-mode .scv-extended-profile-panel .scv-owner-detail-value.scv-long-detail-value,
  .scv-unified-detail-value.scv-long-detail-value {
    grid-column: 1 / -1 !important;
    border-left: 0 !important;
    padding: 0 0 6px !important;
  }

}

/* v796 — full-width, level owner label/value rows with alternating backgrounds. */
body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
  #sportDetailsCard .profile-performance-grid,
  #profileSportStatsBlock .profile-performance-grid,
  .scv-extended-profile-panel .scv-owner-summary-grid,
  .scv-unified-history-grid
) {
  align-items: stretch !important;
  row-gap: 0 !important;
}

body.owner-mode .scv-extended-profile-panel .scv-owner-summary-grid {
  width: 100% !important;
  max-width: 100% !important;
  padding-right: 0 !important;
}

body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-label,
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-value,
  #sportDetailsCard .profile-performance-label,
  #sportDetailsCard .profile-performance-value,
  #profileSportStatsBlock .profile-performance-label,
  #profileSportStatsBlock .profile-performance-value,
  .scv-extended-profile-panel .scv-owner-detail-label,
  .scv-extended-profile-panel .scv-owner-detail-value,
  .scv-unified-detail-label,
  .scv-unified-detail-value
) {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: baseline !important;
  margin: 0 !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  line-height: 1.3 !important;
}

body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-label,
  #sportDetailsCard .profile-performance-label,
  #profileSportStatsBlock .profile-performance-label,
  .scv-extended-profile-panel .scv-owner-detail-label,
  .scv-unified-detail-label
) {
  padding-left: 10px !important;
}

body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-value,
  #sportDetailsCard .profile-performance-value,
  #profileSportStatsBlock .profile-performance-value,
  .scv-extended-profile-panel .scv-owner-detail-value,
  .scv-unified-detail-value
) {
  padding-right: 10px !important;
}

body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard),
  #sportDetailsCard,
  #profileSportStatsBlock
) .profile-performance-item:nth-child(odd) > :is(.profile-performance-label, .profile-performance-value),
body.owner-mode .scv-extended-profile-panel .scv-owner-detail:nth-child(odd) > :is(.scv-owner-detail-label, .scv-owner-detail-value),
body.owner-mode .scv-unified-detail:nth-child(odd) > :is(.scv-unified-detail-label, .scv-unified-detail-value) {
  background-color: #fff !important;
}

body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard),
  #sportDetailsCard,
  #profileSportStatsBlock
) .profile-performance-item:nth-child(even) > :is(.profile-performance-label, .profile-performance-value),
body.owner-mode .scv-extended-profile-panel .scv-owner-detail:nth-child(even) > :is(.scv-owner-detail-label, .scv-owner-detail-value),
body.owner-mode .scv-unified-detail:nth-child(even) > :is(.scv-unified-detail-label, .scv-unified-detail-value) {
  background-color: #f4f8fd !important;
}

body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-value,
  #sportDetailsCard .profile-performance-value,
  #profileSportStatsBlock .profile-performance-value,
  .scv-extended-profile-panel .scv-owner-detail-value,
  .scv-unified-detail-value
) {
  border-left-color: #dbe5f0 !important;
}

/* v797 — public profiles share the owner visual system without owner controls. */
body.public-profile-page :is(
  #aboutCard,
  :is(#performanceStatsCard, #selfRatedSkillsCard),
  #sportDetailsCard,
  #developmentTimelineCard,
  #achievementsCard
) {
  overflow: hidden !important;
}

body.public-profile-page :is(
  #aboutCard,
  :is(#performanceStatsCard, #selfRatedSkillsCard),
  #sportDetailsCard,
  #developmentTimelineCard,
  #achievementsCard
) > .card-body {
  padding: 0 18px 18px !important;
}

body.public-profile-page :is(
  #aboutCard,
  :is(#performanceStatsCard, #selfRatedSkillsCard),
  #sportDetailsCard,
  #developmentTimelineCard,
  #achievementsCard
) .card-title {
  box-sizing: border-box !important;
  display: flex !important;
  width: calc(100% + 36px) !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 44px !important;
  min-height: 44px !important;
  align-items: center !important;
  margin: 0 -18px 16px !important;
  border: 0 !important;
  border-left: 4px solid #1476ef !important;
  border-bottom: 1px solid #c8daf0 !important;
  border-radius: 0 !important;
  padding: 0 16px !important;
  background: #dfeeff !important;
  color: #062751 !important;
  font-size: 17px !important;
  font-weight: 790 !important;
  line-height: 1.2 !important;
  letter-spacing: -.025em !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

body.public-profile-page :is(
  #aboutCard,
  :is(#performanceStatsCard, #selfRatedSkillsCard),
  #sportDetailsCard,
  #developmentTimelineCard,
  #achievementsCard
) .card-title::before {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  content: none !important;
}

body.public-profile-page .scv-extended-profile-panel > .card {
  overflow: hidden !important;
}

body.public-profile-page .scv-extended-profile-panel > .card > .card-body {
  padding: 0 !important;
}

body.public-profile-page .scv-extended-profile-panel .scv-extended-section-head {
  box-sizing: border-box !important;
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  align-items: center !important;
  margin: 0 !important;
  border-left: 4px solid #1476ef !important;
  border-bottom: 1px solid #c8daf0 !important;
  border-radius: 0 !important;
  padding: 0 16px !important;
  background: #dfeeff !important;
}

body.public-profile-page .scv-extended-profile-panel .scv-extended-section-head h2.card-title {
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #062751 !important;
  font-size: 17px !important;
  font-weight: 790 !important;
  line-height: 1.2 !important;
  letter-spacing: -.025em !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

body.public-profile-page .scv-extended-profile-panel .scv-extended-section-description {
  display: none !important;
}

body.public-profile-page .scv-extended-profile-panel [data-scv-extended-content] {
  padding: 16px 18px 18px !important;
}

body.public-profile-page :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
  #sportDetailsCard .profile-performance-grid,
  #profileSportStatsBlock .profile-performance-grid,
  .scv-unified-history-grid,
  .scv-extended-profile-panel .scv-public-summary-grid
) {
  width: 100% !important;
  max-width: 100% !important;
  align-items: stretch !important;
  row-gap: 0 !important;
  padding-right: 0 !important;
}

body.public-profile-page :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-label,
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-value,
  #sportDetailsCard .profile-performance-label,
  #sportDetailsCard .profile-performance-value,
  #profileSportStatsBlock .profile-performance-label,
  #profileSportStatsBlock .profile-performance-value,
  .scv-unified-detail-label,
  .scv-unified-detail-value,
  .scv-extended-profile-panel .scv-public-detail-label,
  .scv-extended-profile-panel .scv-public-detail-value
) {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: baseline !important;
  margin: 0 !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  line-height: 1.3 !important;
}

body.public-profile-page :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-label,
  #sportDetailsCard .profile-performance-label,
  #profileSportStatsBlock .profile-performance-label,
  .scv-unified-detail-label,
  .scv-extended-profile-panel .scv-public-detail-label
) {
  padding-left: 10px !important;
  font-weight: 700 !important;
}

body.public-profile-page :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-value,
  #sportDetailsCard .profile-performance-value,
  #profileSportStatsBlock .profile-performance-value,
  .scv-unified-detail-value,
  .scv-extended-profile-panel .scv-public-detail-value
) {
  padding-right: 10px !important;
  font-weight: 500 !important;
  border-left-color: #dbe5f0 !important;
}

body.public-profile-page .profile-performance-item:nth-child(odd) > :is(.profile-performance-label, .profile-performance-value),
body.public-profile-page .scv-unified-detail:nth-child(odd) > :is(.scv-unified-detail-label, .scv-unified-detail-value),
body.public-profile-page .scv-extended-profile-panel .scv-public-detail:nth-child(odd) > :is(.scv-public-detail-label, .scv-public-detail-value) {
  background-color: #fff !important;
}

body.public-profile-page .profile-performance-item:nth-child(even) > :is(.profile-performance-label, .profile-performance-value),
body.public-profile-page .scv-unified-detail:nth-child(even) > :is(.scv-unified-detail-label, .scv-unified-detail-value),
body.public-profile-page .scv-extended-profile-panel .scv-public-detail:nth-child(even) > :is(.scv-public-detail-label, .scv-public-detail-value) {
  background-color: #f4f8fd !important;
}

body.public-profile-page :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-note,
  #sportDetailsCard .profile-performance-note
) {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}

/* About is profile content, not a smaller helper note. */
body.public-profile-page #aboutCard .about-text {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #34485e !important;
  line-height: 1.45 !important;
}

/* Preserve user paragraph breaks and keep phone text left-aligned. */
body.public-profile-page #aboutCard .about-text,
body.owner-mode #aboutCard .about-text {
  white-space: pre-line !important;
  text-align: left !important;
  text-align-last: left !important;
}

/* Justify wider paragraphs without stretching their final lines. */
@media (min-width: 761px) {
  body.public-profile-page #aboutCard .about-text,
  body.owner-mode #aboutCard .about-text {
    text-align: justify !important;
    text-justify: inter-word;
  }
}

/* Consistent, readable summary text without changing desktop or icon sizes. */
@media (max-width: 760px) {
  body:is(.owner-mode, .public-profile-page) .hero .meta-grid .meta-label,
  body:is(.owner-mode, .public-profile-page) .hero .meta-grid #metaClubItem .meta-label {
    font-size: 12px !important;
  }

  body:is(.owner-mode, .public-profile-page) .hero .meta-grid .meta-value,
  body:is(.owner-mode, .public-profile-page) .hero .meta-grid .meta-value .flag-inline {
    font-size: 15px !important;
  }
}

/* The plot keeps its compact size while captions use readable on-screen pixels. */
body:is(.owner-mode, .public-profile-page) .scv-performance-skills {
  --scv-radar-font-size: 14px;
}

body:is(.owner-mode, .public-profile-page) .scv-performance-skills .skills-grid {
  justify-items: center !important;
}

body:is(.owner-mode, .public-profile-page) .scv-performance-skills .skills-radar-block {
  width: 100% !important;
  justify-self: center !important;
  place-items: center !important;
  margin: 0 auto !important;
}

body:is(.owner-mode, .public-profile-page) .scv-performance-skills .radar-wrap {
  width: 100% !important;
  max-width: 100% !important;
  place-items: center !important;
  aspect-ratio: auto !important;
}

body:is(.owner-mode, .public-profile-page) .scv-performance-skills #radarSvg {
  width: min(100%, var(--scv-radar-width, 100%)) !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body:is(.owner-mode, .public-profile-page) :is(#performanceStatsCard, #selfRatedSkillsCard) #radarSvg .radar-label,
body:is(.owner-mode, .public-profile-page) :is(#performanceStatsCard, #selfRatedSkillsCard) #radarSvg .radar-label-score {
  font-family: inherit !important;
  font-size: var(--scv-radar-font-size) !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  fill: #34485e !important;
  opacity: 1 !important;
}

body:is(.owner-mode, .public-profile-page) :is(#performanceStatsCard, #selfRatedSkillsCard) #radarSvg .radar-label-score {
  font-weight: 700 !important;
  fill: #1476ef !important;
}

@media (max-width: 700px) {
  body:is(.owner-mode, .public-profile-page) .scv-performance-skills {
    --scv-radar-font-size: 12px;
  }
}

/* A full-height section accent, independent of header and content sizing. */
body:is(.owner-mode, .public-profile-page) :is(
  #aboutCard, :is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard,
  #developmentTimelineCard, #achievementsCard,
  #photoCard, #videoCard, #coachReferenceCard,
  .scv-extended-profile-panel > .card
) {
  position: relative !important;
}

body:is(.owner-mode, .public-profile-page) :is(
  #aboutCard, :is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard,
  #developmentTimelineCard, #achievementsCard,
  #photoCard, #videoCard, #coachReferenceCard,
  .scv-extended-profile-panel > .card
)::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 3;
  box-sizing: border-box !important;
  border: 0 !important;
  border-left: 3px solid #1476ef !important;
  border-radius: inherit !important;
  pointer-events: none !important;
}

/* Retain the old accents' layout space so headings and controls do not move. */
body:is(.owner-mode, .public-profile-page) :is(
  #aboutCard, :is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard,
  #developmentTimelineCard, #achievementsCard,
  #photoCard, #videoCard, #coachReferenceCard,
  .scv-extended-profile-panel > .card
) :is(.card-title, .scv-owner-core-head, .scv-owner-media-heading, .scv-extended-section-head) {
  border-left-color: transparent !important;
}

body:is(.owner-mode, .public-profile-page) :is(
  #aboutCard, :is(#performanceStatsCard, #selfRatedSkillsCard), #sportDetailsCard,
  #developmentTimelineCard, #achievementsCard,
  #photoCard, #videoCard, #coachReferenceCard,
  .scv-extended-profile-panel > .card
) :is(.card-title, .scv-owner-core-head, .scv-owner-media-heading, .scv-extended-section-head)::before {
  visibility: hidden !important;
}

/* Keep each achievement and its details together as one outlined group. */
body:is(.owner-mode, .public-profile-page) #achievementsCard #awards {
  gap: 12px !important;
}

body:is(.owner-mode, .public-profile-page) #achievementsCard #awards > .award-item {
  box-sizing: border-box !important;
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 8px !important;
  border: 1px solid #cbdff3 !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
}

/* Align stacked achievement details without changing other long-text sections. */
@media (max-width: 700px) {
  body:is(.owner-mode, .public-profile-page) #achievementsCard #awards .scv-unified-detail-label.scv-long-detail-label {
    padding: 5px 10px 2px !important;
  }

  body:is(.owner-mode, .public-profile-page) #achievementsCard #awards .scv-unified-detail-value.scv-long-detail-value {
    padding: 0 10px 5px !important;
  }
}

body.public-profile-page .scv-performance-skills .scv-tab-subheading {
  font-size: 17px !important;
  line-height: 1.2 !important;
}

/* v798: consistent responsive label/value columns and single section accent */
body.public-profile-page .scv-extended-profile-panel .scv-extended-section-head::before,
body.public-profile-page .scv-extended-profile-panel .scv-extended-section-head h2.card-title::before {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.owner-mode :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
  #sportDetailsCard .profile-performance-grid,
  #profileSportStatsBlock .profile-performance-grid,
  .scv-extended-profile-panel .scv-owner-summary-grid,
  .scv-unified-history-grid
),
body.public-profile-page :is(
  :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
  #sportDetailsCard .profile-performance-grid,
  #profileSportStatsBlock .profile-performance-grid,
  .scv-extended-profile-panel .scv-public-summary-grid,
  .scv-unified-history-grid
) {
  grid-template-columns: 210px minmax(0, 1fr) !important;
}

@media (min-width: 701px) and (max-width: 1366px) and (pointer: coarse),
       (min-width: 701px) and (max-width: 1366px) and (hover: none) {
  body.owner-mode :is(
    :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
    #sportDetailsCard .profile-performance-grid,
    #profileSportStatsBlock .profile-performance-grid,
    .scv-extended-profile-panel .scv-owner-summary-grid,
    .scv-unified-history-grid
  ),
  body.public-profile-page :is(
    :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
    #sportDetailsCard .profile-performance-grid,
    #profileSportStatsBlock .profile-performance-grid,
    .scv-extended-profile-panel .scv-public-summary-grid,
    .scv-unified-history-grid
  ) {
    grid-template-columns: 180px minmax(0, 1fr) !important;
  }
}

@media (min-width: 340px) and (max-width: 700px) {
  body.owner-mode :is(
    :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
    #sportDetailsCard .profile-performance-grid,
    #profileSportStatsBlock .profile-performance-grid,
    .scv-extended-profile-panel .scv-owner-summary-grid,
    .scv-unified-history-grid
  ),
  body.public-profile-page :is(
    :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
    #sportDetailsCard .profile-performance-grid,
    #profileSportStatsBlock .profile-performance-grid,
    .scv-extended-profile-panel .scv-public-summary-grid,
    .scv-unified-history-grid
  ) {
    grid-template-columns: minmax(140px, 42%) minmax(0, 1fr) !important;
  }

  body.owner-mode .scv-owner-summary-link,
  body.public-profile-page .scv-public-summary-link {
    margin-left: max(152px, calc(42% + 12px)) !important;
  }
}

@media (max-width: 339px) {
  body.owner-mode :is(
    :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
    #sportDetailsCard .profile-performance-grid,
    #profileSportStatsBlock .profile-performance-grid,
    .scv-extended-profile-panel .scv-owner-summary-grid,
    .scv-unified-history-grid
  ),
  body.public-profile-page :is(
    :is(#performanceStatsCard, #selfRatedSkillsCard) .profile-performance-grid,
    #sportDetailsCard .profile-performance-grid,
    #profileSportStatsBlock .profile-performance-grid,
    .scv-extended-profile-panel .scv-public-summary-grid,
    .scv-unified-history-grid
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.owner-mode .scv-owner-summary-link,
  body.public-profile-page .scv-public-summary-link {
    margin-left: 0 !important;
  }
}

/* Profile polish: quiet mobile identity and consistent media controls. */
@media (max-width: 700px) {
  body:is(.owner-mode, .public-profile-page) .hero #heroRole .hero-sport-text {
    font-weight: 500 !important;
  }
  body:is(.owner-mode, .public-profile-page) .hero #heroRole .hero-role-line {
    font-weight: 400 !important;
  }
  body:is(.owner-mode, .public-profile-page) .hero :is(#subtitleCountry, #subtitleCountry > span, #heroNationalityBadge, #heroNationalityBadge .hero-nationality-value, #heroNationalityBadge .flag-inline > span) {
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #53667c !important;
  }
  body:is(.owner-mode, .public-profile-page) .hero .scv-share-profile-primary {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    align-self: end !important;
    padding: 0 6px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
  }
  body.owner-mode .hero .scv-owner-profile-visibility-badge,
  body.public-profile-page .hero .scv-parent-managed-badge {
    min-height: 30px !important;
    height: auto !important;
    padding: 5px 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    border-color: rgba(83, 102, 124, .16) !important;
    background: #f3f8f6 !important;
  }
  body.public-profile-page .hero .scv-profile-safety-slot:has(.scv-parent-managed-badge) {
    align-self: end !important;
    display: flex !important;
    align-items: flex-end !important;
  }
  body.public-profile-page .hero .scv-parent-managed-badge {
    width: fit-content !important;
    max-width: 100% !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 4px 6px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #edf5f0 !important;
  }
  body.public-profile-page .hero .scv-parent-managed-badge .scv-profile-safety-copy strong {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #38634c !important;
  }
  body:is(.owner-mode, .public-profile-page) .hero .portrait-stack:has(.scv-owner-profile-visibility-slot, .scv-parent-managed-badge) > .scv-share-profile-primary {
    grid-column: 5 !important;
  }
  body:is(.owner-mode, .public-profile-page) .hero :is(.scv-owner-profile-visibility-slot, .scv-profile-safety-slot:has(.scv-parent-managed-badge)) {
    grid-column: 3 !important;
    align-self: end !important;
  }
}

#mediaViewerBackdrop .media-viewer-photo-nav,
#mediaViewerBackdrop .media-viewer-photo-nav:is(:hover, :active, :focus) {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6) !important;
  font-size: 30px !important;
  line-height: 1 !important;
  opacity: 1 !important;
}
#mediaViewerBackdrop .media-viewer-photo-nav:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
}
#mediaViewerBackdrop .media-viewer-photo-nav::before,
#mediaViewerBackdrop .media-viewer-photo-nav::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
#mediaViewerBackdrop .media-viewer:has(.media-viewer-story-card),
#mediaViewerBackdrop .media-viewer:has(.media-viewer-story-card) .media-viewer-stage,
#mediaViewerBackdrop .media-viewer-photo-strip {
  background: #071833 !important;
}
#mediaViewerBackdrop .media-viewer-photo-strip {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 8px !important;
  margin: 0 !important;
  overflow-x: auto !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
#mediaViewerBackdrop .media-viewer-photo-thumb {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  flex: 0 0 60px !important;
  padding: 0 !important;
  border: 2px solid transparent !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
}
#mediaViewerBackdrop .media-viewer-photo-thumb:first-child { margin-left: auto !important; }
#mediaViewerBackdrop .media-viewer-photo-thumb:last-child { margin-right: auto !important; }
#mediaViewerBackdrop .media-viewer-photo-thumb.is-active { border-color: #1476ef !important; }
#mediaViewerBackdrop .media-viewer-photo-thumb img {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 8px !important;
  object-fit: cover !important;
}
#mediaViewerBackdrop .scv-generic-media-caption { display: none !important; }

@media (max-width: 700px) {
  #mediaViewerBackdrop {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #mediaViewerBackdrop .media-viewer:has(.media-viewer-story-card) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-height: calc(100dvh - 16px) !important;
    overflow-y: auto !important;
  }
  #mediaViewerBackdrop .media-viewer:has(.media-viewer-story-card) .media-viewer-stage {
    padding: 0 !important;
  }
  #mediaViewerBackdrop #mediaViewerStage .media-viewer-story-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    gap: 0 !important;
    border-radius: 20px 20px 0 0 !important;
  }
  #mediaViewerBackdrop #mediaViewerStage .media-viewer-story-title {
    position: relative !important;
    inset: auto !important;
    grid-area: 1 / 1 !important;
    width: 100% !important;
    min-height: 56px !important;
    padding: 18px 64px 14px !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    white-space: normal !important;
  }
  #mediaViewerBackdrop #mediaViewerStage .media-viewer-story-card > img,
  #mediaViewerBackdrop #mediaViewerStage .media-viewer-story-card :is(.media-viewer-video-thumb, .media-viewer-native-video, .media-viewer-video) {
    position: relative !important;
    inset: auto !important;
    grid-area: 2 / 1 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 60dvh !important;
    min-height: 0 !important;
    object-fit: contain !important;
    border-radius: 0 !important;
  }
  #mediaViewerBackdrop #mediaViewerStage .media-viewer-story-video-card :is(.media-viewer-video-thumb, .media-viewer-native-video, .media-viewer-video) {
    height: min(56.25vw, 60dvh) !important;
    aspect-ratio: 16 / 9 !important;
  }
  #mediaViewerBackdrop #mediaViewerStage .media-viewer-video-thumb img { object-fit: contain !important; }
  #mediaViewerBackdrop #mediaViewerStage { width: 100% !important; max-width: 100% !important; }
  #mediaViewerBackdrop #mediaViewerStage .media-viewer-story-video-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #mediaViewerBackdrop .media-viewer-media-footer .media-viewer-media-edit-btn {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    transform: none !important;
  }
  #mediaViewerBackdrop .media-viewer-story-card .media-viewer-photo-nav {
    position: relative !important;
    grid-area: 2 / 1 !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    align-self: center !important;
    z-index: 20 !important;
  }
  #mediaViewerBackdrop .media-viewer-photo-nav.prev { justify-self: start !important; left: 4px !important; }
  #mediaViewerBackdrop .media-viewer-photo-nav.next { justify-self: end !important; right: 4px !important; }
  #mediaViewerBackdrop .media-viewer-story-gradient { display: none !important; }
  #mediaViewerBackdrop .media-viewer-story-card :is(.media-viewer-media-footer, .media-viewer-photo-meta) {
    grid-area: 3 / 1 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    min-height: 0 !important;
    gap: 6px !important;
  }
  #mediaViewerBackdrop .media-viewer-story-card :is(.media-viewer-media-note, .media-viewer-photo-comment-display) {
    max-height: none !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
  }
  #mediaViewerBackdrop .media-viewer-photo-thumb {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    flex-basis: 48px !important;
  }
}

/* Stable media frames: every control is included in the viewport budget. */
#mediaViewerBackdrop.scv-stable-media {
  top: var(--scv-viewport-top, 0px) !important;
  left: var(--scv-viewport-left, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--scv-viewport-width, 100vw) !important;
  height: var(--scv-viewport-height, 100dvh) !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
#mediaViewerBackdrop.scv-stable-media .media-viewer:has(.media-viewer-story-card) {
  height: var(--scv-media-frame-height) !important;
  max-height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #071833 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) 64px !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #071833 !important;
}
#mediaViewerBackdrop.scv-stable-media.scv-stable-video #mediaViewerStage {
  grid-template-rows: minmax(0, 1fr) !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 52px minmax(0, 1fr) 64px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-gradient { display: none !important; }
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-title {
  grid-area: 1 / 1 / 2 / -1 !important;
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 8px 72px 8px 88px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  overflow-y: auto !important;
  pointer-events: auto !important;
  text-align: center !important;
}
#mediaViewerBackdrop.scv-stable-media .media-viewer:has(.media-viewer-story-card) .media-viewer-close {
  width: 44px !important;
  height: 44px !important;
  top: 6px !important;
  right: 10px !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-photo-counter, .media-viewer-story-counter) {
  position: absolute !important;
  top: 14px !important;
  left: 12px !important;
  bottom: auto !important;
  right: auto !important;
  height: 28px !important;
  min-height: 0 !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  box-sizing: border-box !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card > img,
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card > :is(.media-viewer-video-thumb, .media-viewer-video, .media-viewer-native-video) {
  grid-area: 2 / 1 / 3 / -1 !important;
  display: block !important;
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  transform: none !important;
  border-radius: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-video-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-media-footer, .media-viewer-photo-meta) {
  grid-area: 3 / 1 / 4 / -1 !important;
  position: relative !important;
  inset: auto !important;
  align-self: stretch !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  padding: 8px 16px !important;
  margin: 0 !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer-main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-media-note, .media-viewer-photo-comment-display) {
  display: -webkit-box !important;
  max-height: 2.7em !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .scv-generic-media-caption { display: none !important; }
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage :is(.media-viewer-media-edit-btn, .media-viewer-photo-edit-btn) {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  transform: none !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-nav {
  position: relative !important;
  grid-area: 2 / 1 !important;
  align-self: center !important;
  top: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: none !important;
  text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, .85) !important;
  z-index: 20 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-nav.prev { justify-self: start !important; left: 8px !important; }
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-nav.next { justify-self: end !important; right: 8px !important; }
#mediaViewerBackdrop.scv-stable-video #mediaViewerStage .media-viewer-story-card {
  grid-template-columns: minmax(0, 1fr) 48px 48px 64px !important;
}
#mediaViewerBackdrop.scv-stable-video #mediaViewerStage .media-viewer-photo-nav.prev { grid-area: 3 / 2 !important; left: 0 !important; }
#mediaViewerBackdrop.scv-stable-video #mediaViewerStage .media-viewer-photo-nav.next { grid-area: 3 / 3 !important; right: 0 !important; }
#mediaViewerBackdrop.scv-stable-video #mediaViewerStage .media-viewer-media-footer-main { margin-right: 104px !important; }
#mediaViewerBackdrop.scv-stable-video #mediaViewerStage .media-viewer-media-footer:not(:has(.media-viewer-media-edit-btn)) .media-viewer-media-footer-main { margin-right: 148px !important; }
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-strip {
  grid-row: 2 !important;
  align-self: stretch !important;
  align-items: center !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 6px 8px !important;
  scrollbar-width: thin;
  scrollbar-color: #53667c #071833;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-thumb {
  border-color: rgba(255, 255, 255, .16) !important;
  box-shadow: none !important;
  background: transparent !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-photo-thumb.is-active { border-color: #1476ef !important; }
@media (max-width: 700px) {
  #mediaViewerBackdrop.scv-stable-media {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  #mediaViewerBackdrop.scv-stable-media .media-viewer:has(.media-viewer-story-card) {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage { grid-template-rows: minmax(0, 1fr) 64px !important; }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card { grid-template-rows: 52px minmax(0, 1fr) 72px !important; }
  #mediaViewerBackdrop.scv-stable-media.scv-stable-video #mediaViewerStage { grid-template-rows: minmax(0, 1fr) !important; }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-title { font-size: 16px !important; }
}

/* Larger desktop media area; editors are panels, not compressed footer rows. */
@media (min-width: 1101px) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card {
    grid-template-rows: 52px minmax(0, 1fr) 52px !important;
  }
  #mediaViewerBackdrop.scv-stable-media .media-viewer:has(.media-viewer-story-card) {
    width: min(160dvh, calc(100vw - 64px), 1520px) !important;
    max-width: min(160dvh, calc(100vw - 64px), 1520px) !important;
  }
  #mediaViewerBackdrop.scv-stable-media:not(.scv-stable-video) #mediaViewerStage .media-viewer-story-card {
    grid-template-rows: 52px minmax(0, 1fr) 52px !important;
  }
  #mediaViewerBackdrop.scv-stable-media:not(.scv-stable-video) #mediaViewerStage .media-viewer-media-footer:not(.is-editing) {
    padding: 2px 16px !important;
  }
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
  position: absolute !important;
  grid-area: auto !important;
  top: auto !important;
  left: 50% !important;
  right: auto !important;
  bottom: 8px !important;
  transform: translateX(-50%) !important;
  width: min(640px, calc(100% - 24px)) !important;
  height: min(260px, calc(100% - 68px)) !important;
  max-height: calc(100% - 68px) !important;
  min-height: 0 !important;
  padding: 14px !important;
  margin: 0 !important;
  display: block !important;
  overflow: hidden !important;
  z-index: 50 !important;
  background: #0c213d !important;
  border: 1px solid #53667c !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 30px #0006 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 60px minmax(36px, 1fr) auto 44px !important;
  gap: 8px !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-edit-field {
  display: grid !important;
  grid-column: 1 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  min-height: 0 !important;
  gap: 4px !important;
  padding: 0 !important;
  margin: 0 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-shell > .media-viewer-edit-field:first-child {
  grid-row: 1 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-shell > .media-viewer-edit-field:nth-child(2) {
  grid-row: 2 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-shell > .media-viewer-edit-error {
  grid-column: 1 !important;
  grid-row: 3 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing :is(.media-viewer-note-edit-head, .media-viewer-edit-label) {
  position: static !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing :is(input, textarea) {
  position: static !important;
  grid-column: 1 !important;
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
  resize: none !important;
  overflow: auto !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing input { height: 40px !important; }
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-actions {
  position: static !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-column: 1 !important;
  grid-row: 4 !important;
  gap: 8px !important;
  width: 100% !important;
  height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .is-editing .media-viewer-note-edit-actions button {
  position: static !important;
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 8px 12px !important;
  margin: 0 !important;
}
#mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card:has(.is-editing) .media-viewer-photo-nav { visibility: hidden !important; }
@media (max-width: 700px) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage:has(.is-editing) { grid-template-rows: minmax(0, 1fr) !important; }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage:has(.is-editing) .media-viewer-photo-strip { display: none !important; }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card:has(.is-editing) > :is(img, .media-viewer-media-surface, .media-viewer-video-thumb, .media-viewer-video, .media-viewer-native-video) { visibility: visible !important; }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
    top: auto !important;
    bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 20px) !important;
    height: min(352px, calc(100% - 60px)) !important;
    max-height: calc(100% - 60px) !important;
    padding: 12px !important;
  }
}

@media (min-width: 701px) and (max-width: 1100px) and (orientation: portrait) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
    width: min(680px, calc(100% - 32px)) !important;
    height: min(300px, calc(100% - 80px)) !important;
  }
}

@media (min-width: 701px) and (max-width: 1100px) and (orientation: landscape) {
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-media-footer.is-editing {
    top: 50% !important;
    left: auto !important;
    right: 12px !important;
    bottom: auto !important;
    width: min(38%, 430px) !important;
    height: min(360px, calc(100% - 80px)) !important;
    max-height: calc(100% - 80px) !important;
    transform: translateY(-50%) !important;
  }
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card:has(.is-editing) > img,
  #mediaViewerBackdrop.scv-stable-media #mediaViewerStage .media-viewer-story-card:has(.is-editing) > .media-viewer-media-surface {
    width: 60% !important;
    justify-self: start !important;
  }
}

/* Public and owner mobile tabs retain readable text and label-based widths. */
@media (max-width: 760px) {
  body .scv-profile-section-nav-shell {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body .scv-profile-section-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body .scv-profile-section-nav[data-scv-profile-section-nav] > button {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 0 auto !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 13px !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  body .scv-profile-section-nav[data-scv-nav-measuring="true"] > button {
    flex: 0 0 auto !important;
  }

  body .scv-profile-section-nav > [data-scv-profile-overflow="true"] {
    display: none !important;
  }

  body .scv-profile-section-nav[data-scv-nav-tight="true"] > button {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  body .scv-profile-more-menu > button {
    font-size: 13px !important;
  }
}
