.social-page { display: grid; gap: 20px; width: 100%; box-sizing: border-box; max-width: 960px; margin: 0 auto; padding: 12px 0 40px; }
.social-hero, .social-person { display: flex; align-items: center; gap: 20px; padding: 24px; border: 1px solid #ffffff18; border-radius: 18px; background: #ffffff05; }
.social-person-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.social-person-copy h2, .social-person-copy p { margin: 0 0 8px; }
.social-person-copy a { color: inherit; font-size: 18px; font-weight: 700; }
.social-avatar { position: relative; flex: 0 0 64px; width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #373249; color: #e2d6ff; font-size: 22px; font-weight: 700; }
.social-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.social-hero .social-avatar { flex-basis: 96px; width: 96px; height: 96px; font-size: 30px; }
.social-bio { white-space: pre-wrap; }
.social-tabs, .social-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.social-tabs .active { background: #6845ab; color: white; border-color: #9771df; }
.social-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.social-stats > div { padding: 24px; display: grid; gap: 8px; }
.social-stats strong { font-size: 32px; }
.social-watch { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 18px; }
.social-watch strong { flex: 1; min-width: 120px; }
.social-empty { padding: 36px 20px; border: 1px dashed #ffffff25; border-radius: 16px; text-align: center; color: #bdb8c9; }
.social-search { display: flex; align-items: end; gap: 12px; }
.social-search label { flex: 1; }
.social-editor { padding: 24px; display: grid; gap: 18px; }
.social-editor label, .social-search label { display: grid; gap: 8px; }
.social-editor input, .social-editor textarea, .social-search input { box-sizing: border-box; width: 100%; min-width: 0; background: #191720; color: #f1eef7; border: 1px solid #ffffff30; border-radius: 10px; padding: 12px; font: inherit; }
.social-editor textarea { min-height: 100px; resize: vertical; }
.social-error { color: #ffb7bd; }
.friend-badge { display: inline-block; border-radius: 16px; padding: 2px 7px; background: #6845ab; color: white; font-size: 12px; }
.friend-badge[hidden] { display: none; }
.friend-request-alert { position: relative; display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255,148,31,.4); border-radius: 50%; background: rgba(255,148,31,.1); color: var(--accent); cursor: pointer; }
.friend-request-alert[hidden] { display: none; }
.friend-request-alert .nav-icon, .friend-request-alert .svg-icon { width: 20px; height: 20px; }
.friend-request-alert:hover { background: rgba(255,148,31,.2); }
.friend-request-alert:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.friend-request-count { position: absolute; right: -5px; top: -5px; min-width: 17px; height: 17px; padding: 0 3px; display: grid; place-items: center; box-sizing: border-box; border-radius: 10px; background: var(--accent); color: #171009; font-size: 10px; font-weight: 800; border: 2px solid var(--bg); }
.social-page button:focus-visible, .social-page a:focus-visible { outline: 2px solid #bd9afa; outline-offset: 3px; }
.social-profile-page { max-width: none; gap: 20px; padding-top: 0; min-width: 0; }
.social-profile-page .social-editor { width: min(100%, 720px); justify-self: center; box-sizing: border-box; }
.social-back { justify-self: start; display: inline-flex; align-items: center; gap: 9px; background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; cursor: pointer; }
.social-back .svg-icon { width: 18px; height: 18px; }
.social-profile-hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 0 0 8px; min-width: 0; }
.social-profile-identity { display: flex; align-items: center; gap: 30px; flex: 1; min-width: 0; }
.social-profile-identity .social-avatar { flex: 0 0 144px; width: 144px; height: 144px; font-size: 50px; background: linear-gradient(135deg, #cba587, #e1c2a8); color: #302319; border: 2px solid #efdbca; }
.social-profile-identity h1 { margin: 0 0 8px; font-size: clamp(28px, 2.5vw, 42px); line-height: 1.15; letter-spacing: -.025em; }
.social-profile-identity .social-bio { margin-top: 9px; line-height: 1.5; }
.social-handle { color: var(--muted); font-size: 14px; }
.social-edit-button { background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; margin-top: 4px; cursor: pointer; font: inherit; font-size: 13px; }
.social-profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: 0 1 650px; border: 1px solid var(--line); border-radius: 12px; padding: 26px 8px; background: linear-gradient(120deg, #ffffff02, #ffffff00); }
.social-profile-metric { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 12px; }
.social-profile-metric + .social-profile-metric { border-left: 1px solid #ffffff07; }
.social-profile-metric > .svg-icon { width: 32px; height: 32px; color: var(--accent); flex-shrink: 0; }
.social-profile-metric > div { display: grid; gap: 7px; white-space: nowrap; }
.social-profile-metric strong { font-size: 23px; line-height: 1.1; }
.social-profile-metric small { font-size: 11px; font-weight: 400; color: var(--muted); }
.social-profile-metric div > span { font-size: 14px; color: var(--muted); }
.social-media-section { border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; background: #ffffff01; }
.social-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.social-section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.015em; }
.social-see-all { padding: 3px 0; background: transparent; border: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; }
.social-see-all[hidden] { display: none; }
.social-media-section > .social-see-all { display: block; margin: 20px auto 0; }
.social-media-section > .social-see-all[hidden] { display: none; }
.social-poster-rail { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 18px; }
.social-media-card { min-width: 0; }
.social-poster { position: relative; display: block; width: 100%; padding: 0; aspect-ratio: 2 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--muted); }
button.social-poster { cursor: pointer; transition: border-color .15s, transform .15s; }
button.social-poster:hover { border-color: var(--accent); transform: translateY(-3px); }
.social-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.social-poster-placeholder { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; box-sizing: border-box; background: radial-gradient(ellipse at top, #453526, var(--panel) 75%); }
.social-poster-placeholder .svg-icon { width: 36px; height: 36px; opacity: .55; }
.social-poster-placeholder > span:last-child { font-size: 13px; line-height: 1.4; }
.social-media-card h3 { margin: 9px 0 0; font-size: 14px; line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.social-activity-meta { display: flex; align-items: start; gap: 8px; margin-top: 8px; color: #a9bed0; font-size: 12px; line-height: 1.6; }
.social-activity-meta > .svg-icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.social-activity-meta > div { display: grid; gap: 2px; }
.social-media-section .social-empty { margin: 0; }
@media (max-width: 1200px) {
  .social-profile-hero { gap: 24px; flex-wrap: wrap; }
  .social-profile-stats { flex: 1 1 100%; }
  .social-poster-rail:not(.expanded) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(135px, 16%); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .social-media-card { scroll-snap-align: start; }
  .social-poster-rail.expanded { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
}
@media (max-width: 600px) {
  .social-page { gap: 16px; }
  .social-hero, .social-person { padding: 18px; gap: 14px; flex-wrap: wrap; }
  .social-hero > .social-actions, .social-person > .social-actions { flex-basis: 100%; }
  .social-hero .social-avatar { flex-basis: 64px; width: 64px; height: 64px; }
  .social-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .social-tabs button { width: 100%; }
  .social-search { align-items: stretch; flex-direction: column; }
  .social-stats > div { padding: 18px; }
  .social-profile-hero { gap: 20px; }
  .social-profile-identity { gap: 18px; }
  .social-profile-identity .social-avatar { flex-basis: 86px; width: 86px; height: 86px; font-size: 32px; }
  .social-profile-identity h1 { font-size: 27px; }
  .social-profile-identity .social-bio { font-size: 14px; }
  .social-profile-stats { grid-template-columns: 1fr 1fr; gap: 20px 0; padding: 20px 8px; }
  .social-profile-metric { justify-content: start; padding-left: 16px; gap: 12px; }
  .social-profile-metric > .svg-icon { width: 26px; height: 26px; }
  .social-profile-metric:nth-child(3) { border-left: none; }
  .social-profile-metric strong { font-size: 21px; }
  .social-profile-metric div > span { font-size: 12px; }
  .social-media-section { padding: 14px; }
  .social-section-heading h2 { font-size: 19px; }
  .social-poster-rail { gap: 14px; }
}

/* Profile editor: native dialog keeps the profile visible behind the backdrop. */
.social-edit-dialog { width: min(920px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px); box-sizing: border-box; padding: 0; border: 1px solid #44505f; border-radius: 20px; color: var(--text); background: linear-gradient(145deg, #11161c, #0c1014); box-shadow: 0 24px 80px #0008; overflow: auto; }
.social-edit-dialog::backdrop { background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
.social-edit-dialog[open] { animation: dialog-shell-in 190ms var(--premium-ease) both; }
body:has(.social-edit-dialog[open]) { overflow: hidden; }
.social-edit-dialog .social-editor { padding: 32px 36px 28px; gap: 24px; margin: 0; }
.social-editor-header { position: relative; padding-right: 48px; }
.social-editor-header h2 { font-size: 32px; margin: 0 0 10px; letter-spacing: -.02em; }
.social-editor-header p { line-height: 1.5; margin: 0; }
.social-editor-close { position: absolute; right: -10px; top: -8px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #252b33; color: var(--text); cursor: pointer; }
.social-editor-body { display: grid; grid-template-columns: 185px minmax(0,1fr); gap: 32px; }
.social-editor-avatar { padding: 24px 24px 0 0; border-right: 1px solid var(--line); text-align: center; }
.social-editor-avatar .social-profile-identity { justify-content: center; }
.social-editor-avatar .social-avatar { width: 152px; height: 152px; flex-basis: 152px; }
.social-avatar-choose { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 0 4px; width: 100%; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.social-editor-avatar p { white-space: pre-line; font-size: 13px; line-height: 1.7; }
.social-avatar-remove { border: 0; background: none; color: var(--muted); padding: 5px; cursor: pointer; }
.social-avatar-remove[hidden] { display: none; }
.social-editor-fields { display: grid; gap: 20px; min-width: 0; }
.social-editor-field { display: grid; gap: 8px; }
.social-editor-field label { font-weight: 600; }
.social-editor-field p { margin: 0; font-size: 12px; }
.social-edit-dialog input, .social-edit-dialog textarea { background: #191d25; border-color: #414953; padding: 12px 14px; }
.social-edit-dialog textarea { min-height: 100px; }
.social-bio-count { justify-self: end; color: var(--muted); font-size: 12px; }
.social-preview-heading { margin: 0 0 -12px; font-size: 16px; }
.social-editor-preview { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #ffffff02; }
.social-editor-preview .social-profile-identity { gap: 20px; }
.social-editor-preview .social-avatar { width: 86px; height: 86px; flex-basis: 86px; font-size: 30px; }
.social-editor-preview h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.15; }
.social-editor-preview .meta { font-size: 12px; }
.social-editor-preview .social-bio { font-size: 14px; }
.social-editor-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--line); padding-top: 22px; }
.social-editor-footer .button { min-height: 48px; width: 100%; justify-content: center; }
.social-editor-footer .social-editor-cancel { background: #262c35; color: var(--text); border: 1px solid #414953; }
.social-editor .social-error:empty { display: none; }
.social-edit-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
 .social-edit-dialog { max-height: calc(100dvh - 24px); width: calc(100vw - 24px); border-radius: 16px; }
 .social-edit-dialog .social-editor { padding: 22px 18px; gap: 22px; }
 .social-editor-header h2 { font-size: 26px; }
 .social-editor-header p { font-size: 13px; }
 .social-editor-body { grid-template-columns: minmax(0,1fr); gap: 22px; }
 .social-editor-avatar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 16px; }
 .social-editor-avatar .social-avatar { width: 96px; height: 96px; flex-basis: 96px; font-size: 36px; }
 .social-editor-avatar p { margin: 6px 0; }
 .social-editor-preview { padding: 14px; }
 .social-editor-preview .social-profile-identity { gap: 12px; }
 .social-editor-preview .social-avatar { width: 64px; height: 64px; flex-basis: 64px; font-size: 24px; }
 .social-editor-footer { gap: 10px; }
}

.social-friends-page { max-width: none; padding-top: 0; gap: 24px; }
.friends-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.friends-tabs { display: flex; align-self: stretch; gap: 22px; }
.friends-tab { display: flex; align-items: center; gap: 10px; position: relative; padding: 16px 8px; background: none; border: 0; color: var(--muted); font: inherit; white-space: nowrap; cursor: pointer; }
.friends-tab .svg-icon { width: 21px; height: 21px; }
.friends-tab.active { color: var(--text); font-weight: 700; }
.friends-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--accent); border-radius: 3px; }
.friends-tab-count { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; box-sizing: border-box; border-radius: 12px; background: #272d34; font-size: 13px; }
.active .friends-tab-count { background: var(--accent); color: #15100a; }
.friends-tools { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.friends-search { display: flex; gap: 8px; align-items: center; background: #ffffff02; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; max-width: 560px; min-width: 0; }
.friends-search input { width: 100%; min-width: 0; background: none; border: 0; padding: 13px 0; color: var(--text); font: inherit; }
.friends-search-submit { display: grid; place-items: center; background: none; padding: 0; border: 0; color: var(--muted); cursor: pointer; }
.friends-tools .friends-search { max-width: 230px; }
.friends-tools select { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--shell); color: var(--text); font: inherit; }
.friends-layout-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--shell); color: var(--muted); cursor: pointer; }
.friends-layout-button.active { background: #ff941f18; border-color: #ff941f55; color: var(--accent); }
.friends-welcome { display: flex; align-items: center; flex-direction: column; padding: 36px 24px; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(ellipse at center, #22282d44, transparent 68%); text-align: center; }
.friends-welcome img { width: 230px; height: 230px; object-fit: contain; }
.friends-welcome h2 { font-size: clamp(24px, 2.5vw, 36px); margin: 18px 0 8px; }
.friends-welcome p { color: var(--muted); font-size: 17px; line-height: 1.5; margin: 0 0 20px; }
.friends-welcome .button { display: flex; gap: 10px; align-items: center; padding: 14px 28px; }
.friends-benefits { padding: 24px; border: 1px solid var(--line); border-radius: 14px; }
.friends-benefits h2 { margin: 0 0 24px; font-size: 20px; }
.friends-benefit-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; }
.friends-benefit { display: flex; gap: 18px; align-items: center; }
.friends-benefit > .svg-icon { flex-shrink: 0; width: 32px; height: 32px; color: var(--accent); }
.friends-benefit p { margin: 7px 0 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.friends-request-tabs { display: flex; gap: 10px; }
.friends-request-tabs .active { box-shadow: 0 0 0 2px var(--accent); }
.friends-results, .friends-request-results { display: grid; gap: 12px; }
.friend-card { display: grid; grid-template-columns: minmax(180px,1.3fr) minmax(210px,1.5fr) minmax(120px,.7fr) minmax(120px,.7fr) 30px; align-items: center; gap: 22px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff02; }
.friend-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.friend-identity > div:last-child { min-width: 0; }
.friend-identity a { color: var(--text); text-decoration: none; font-weight: 750; font-size: 20px; overflow-wrap: anywhere; }
.friend-identity a:hover { color: var(--accent); }
.friend-identity p { margin: 6px 0 0; overflow-wrap: anywhere; }
.friend-identity .social-avatar { width: 72px; height: 72px; flex-basis: 72px; }
.friend-activity { display: flex; gap: 14px; align-items: center; min-width: 0; }
.friend-activity > div:last-child { display: grid; gap: 4px; min-width: 0; }
.friend-activity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.friend-activity .meta { font-size: 13px; }
.friend-watch-poster { position: relative; display: grid; place-items: center; width: 52px; height: 78px; flex-shrink: 0; border-radius: 7px; overflow: hidden; background: var(--panel); color: var(--muted); }
.friend-watch-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.friend-stat { display: flex; gap: 12px; align-items: center; }
.friend-stat > .svg-icon { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.friend-stat > div { display: grid; gap: 4px; }
.friend-stat span { color: var(--muted); font-size: 13px; }
.friend-menu { position: relative; }
.friend-menu summary { list-style: none; cursor: pointer; color: var(--accent); }
.friend-menu summary::-webkit-details-marker { display: none; }
.friend-menu .social-actions { position: absolute; z-index: 4; right: 0; top: 28px; background: var(--panel); padding: 10px; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #0008; }
.friends-results.grid { grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); }
.friends-results.grid .friend-card { grid-template-columns: 1fr 1fr 24px; }
.friends-results.grid .friend-identity, .friends-results.grid .friend-activity { grid-column: 1 / -1; }
@media (max-width: 1150px) {
 .friends-toolbar { flex-wrap: wrap; }
 .friends-tools { flex: 1 1 100%; }
 .friends-tools .friends-search { flex: 1; max-width: none; }
 .friend-card { grid-template-columns: 1fr 1fr 24px; }
 .friend-identity { grid-column: 1 / 3; }
 .friend-activity { grid-column: 1 / -1; }
 .friend-menu { grid-column: 3; grid-row: 1; }
 .friends-benefit-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
 .friends-tabs { width: 100%; gap: 8px; justify-content: space-between; }
 .friends-tab { font-size: 13px; gap: 6px; padding: 14px 2px; }
 .friends-tab .svg-icon { width: 17px; height: 17px; }
 .friends-tab-count { min-width: 22px; height: 22px; font-size: 11px; }
 .friends-tools { flex-wrap: wrap; }
 .friends-tools .friends-search { flex-basis: 100%; }
 .friends-tools select { flex: 1; }
 .friends-welcome { padding: 24px 16px; }
 .friends-welcome img { width: 180px; height: 180px; }
 .friends-welcome p { font-size: 14px; }
 .friends-benefit-grid { grid-template-columns: 1fr; }
 .friends-benefits { padding: 20px; }
 .friend-card { padding: 16px; gap: 16px; }
 .friends-results.grid { grid-template-columns: minmax(0,1fr); }
 .friend-identity a { font-size: 18px; }
}
