/* Member-facing presentation. Message data, author alignment and account actions are unchanged. */
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor){border:1px solid #4c6c7d;border-radius:24px;background:linear-gradient(145deg,#1c3044,#121f31 65%);box-shadow:0 28px 90px #0007;color:#edf5fc;padding:24px;scrollbar-width:thin;scrollbar-color:#4e687a #142335}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor)::backdrop{background:#030b16b8;backdrop-filter:blur(4px)}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor)>.member-head{display:flex;align-items:center;gap:14px;padding:0 0 18px;margin:0 0 18px;border-bottom:1px solid #49627466;flex:none}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor)>.member-head h2{margin:0;line-height:1.4;font-size:23px;font-weight:800;letter-spacing:-.04em;word-break:keep-all;overflow-wrap:anywhere}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor)>.member-head .close{position:static;transform:none;flex:none;align-self:center;margin:0 0 0 auto;display:grid;place-items:center;width:40px;height:40px;min-width:40px;min-height:40px;padding:0;border:1px solid #506b80;background:#23394e;border-radius:12px;font-size:26px;line-height:1;color:#d5e5ed}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor) button{border-radius:11px;font-weight:650;transition:background .15s,border-color .15s}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor) button:focus-visible,.profile-page.member-profile button:focus-visible,.profile-page.member-profile select:focus-visible{outline:2px solid #9aebd0;outline-offset:3px}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor) .status:empty{display:none}
.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor) .status:not(:empty){flex:none;min-height:0;font-size:13px;line-height:1.65;padding:10px 13px;background:#19383f;border:1px solid #456b76;border-radius:11px;margin:12px 0 0;overflow-wrap:anywhere}
/* Settings: explicit ON/OFF state remains visible and logout stays last. */
.member-dialog.member-settings{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.member-dialog.member-settings>.member-head,.member-dialog.social-profile>.member-head{position:sticky;top:-24px;z-index:6;padding-top:12px;margin-top:-12px;background:#1a2d40}
.member-dialog.member-settings .notification-row{padding:14px 16px;margin:10px 0;border:1px solid #3b5369;border-radius:15px;gap:16px;background:linear-gradient(110deg,#20394b,#192c40);min-height:66px;box-sizing:border-box}
.member-dialog.member-settings .notification-row strong{font-size:15px;font-weight:650;line-height:1.6;color:#d7e6ef;letter-spacing:-.02em}
.member-dialog.member-settings .notification-row button{width:76px;min-width:76px;min-height:38px;padding:8px 10px;font-size:13px;line-height:1.4;border:1px solid #527083;border-radius:11px;background:#25394d;color:#bdcddd}
.member-dialog.member-settings .notification-row button[aria-pressed=true]{background:linear-gradient(120deg,#2c6659,#235045);border-color:#78d7b6;color:#d9fff0;box-shadow:inset 0 1px 0 #c2ffe017}
.member-dialog.member-settings .notification-row button[aria-pressed=false]{background:#27364a;border-color:#506278;color:#aebfd1;box-shadow:none}
.member-dialog.member-settings .notice-condition{color:#a1b7cb;font-size:12px!important;line-height:1.8;margin:14px 4px;word-break:keep-all}
.member-dialog.member-settings .actions{margin-top:12px;gap:10px}
.member-dialog.member-settings .actions button{min-height:44px;padding:11px 14px;border:1px solid #496a7d;background:#1b3948;color:#c9ece1;font-size:13px}
.member-dialog.member-settings .admin-device-settings{margin:20px 0 0;padding:14px;background:#12283a;border:1px solid #416b6c;border-radius:17px}
.member-dialog.member-settings .admin-device-settings .notification-row{margin:0;border:0;padding:0;min-height:40px;background:none}
.member-dialog.member-settings .settings-logout{margin-top:22px;padding-top:18px;border-color:#3e5268}
.member-dialog.member-settings .settings-logout button{background:#332b3b;border:1px solid #8c6576;color:#edbeca;min-height:44px;font-size:14px}
/* Public profile: keep every metric and the existing friendship action order. */
.member-dialog.social-profile{width:min(600px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.member-dialog.social-profile>div:not(.member-head){min-width:0}
.member-dialog.social-profile .social-author{position:relative;box-sizing:border-box;padding:20px 12px 18px;gap:8px;border:1px solid #3a596b;border-radius:18px;background:radial-gradient(ellipse at top,#34796a30,transparent 75%),#142b3b}
.member-dialog.social-profile .social-author>.profile-avatar{width:112px;height:112px}
.member-dialog.social-profile .social-author>small{font-size:20px;font-weight:750;line-height:1.5;color:#edf9f4;letter-spacing:-.03em;margin:0}
.member-dialog.social-profile .social-author>.profile-title{font-size:12px;line-height:1.7;padding:3px 12px;border-color:#679e8c;background:#234c444d}
.member-dialog.social-profile .social-profile-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0 20px}
.member-dialog.social-profile .social-profile-stats>div{min-width:0;min-height:82px;box-sizing:border-box;padding:13px 8px;gap:8px;border:1px solid #3c5369;border-radius:14px;background:linear-gradient(140deg,#20384b,#182a3d)}
.member-dialog.social-profile .social-profile-stats>div:last-child{grid-column:auto}
.member-dialog.social-profile .social-profile-stats small{font-size:11px;line-height:1.5;color:#a7bfd0;word-break:keep-all}
.member-dialog.social-profile .social-profile-stats strong{font-size:20px;line-height:1.5;color:#e3f5ef;letter-spacing:-.03em}
.member-dialog.social-profile .social-profile-stats>div:nth-child(-n+3){border-color:#4b6e7e;background:linear-gradient(145deg,#244456,#1b3045)}
.member-dialog.social-profile .social-profile-actions{gap:10px;padding-top:18px;border-top:1px solid #3a5267}
.member-dialog.social-profile .social-profile-actions button{min-height:44px;padding:10px 8px;border:1px solid #49677d;background:#20394d;color:#d9e9f3;font-size:13px;line-height:1.55}
.member-dialog.social-profile .social-profile-actions button[data-quick-target]{border-color:#5f9f8a;background:#245147;color:#d4ffeb}
/* The member page preserves photo -> upload/delete -> titles -> borders -> account details. */
body:has(.profile-page.member-profile){background:radial-gradient(ellipse at 10% 0,#21534c28,transparent 60%),#0b1524}
.profile-page.member-profile{width:min(100% - 40px,1080px);box-sizing:border-box;padding:26px;margin:24px auto 32px;border:1px solid #3b596e;border-radius:24px;background:linear-gradient(145deg,#1b3044,#122033 70%);box-shadow:0 12px 35px #030b1526}
.profile-page.member-profile .profile-hero{padding:24px 18px;gap:18px;border:1px solid #416174;border-radius:20px;background:radial-gradient(ellipse at top,#327c6833,transparent 70%),#142a3b}
.profile-page.member-profile .profile-preview{gap:12px}
.profile-page.member-profile .profile-preview .profile-avatar{width:172px;height:172px}
.profile-page.member-profile .profile-photo-actions{gap:10px}
.profile-page.member-profile .profile-photo-actions button{min-height:44px;padding:11px 18px;font-size:14px;background:#234c46;border-color:#5b9683;color:#e3fff3;border-radius:11px}
.profile-page.member-profile .profile-photo-actions button+button{background:#23374b;border-color:#4d657c;color:#c7d8e7}
.profile-page.member-profile .appearance-settings{gap:16px;margin:18px 0 24px}
.profile-page.member-profile .appearance-settings section{display:flex;flex-direction:column;gap:0;padding:20px;border:1px solid #3f5a70;border-radius:18px;background:linear-gradient(125deg,#203a4b,#182a3d)}
.profile-page.member-profile .appearance-settings h3{font-size:17px;line-height:1.5;margin:0 0 14px;color:#e1f4eb;letter-spacing:-.02em}
.profile-page.member-profile .appearance-settings select{box-sizing:border-box;font-size:16px;min-height:46px;border-radius:11px;border-color:#4e6b7e;background:#0e2032;padding:10px 12px}
.profile-page.member-profile .appearance-settings p{color:#9fb8cb;line-height:1.8;font-size:12px;margin:12px 0;min-height:40px}
.profile-page.member-profile .appearance-settings button{margin-top:auto;border-radius:11px;min-height:42px;font-size:14px;background:#264f47;border-color:#66ae93}
.profile-page.member-profile [data-info]{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.profile-page.member-profile [data-info] .profile-row{grid-column:auto;padding:18px;gap:9px;border:1px solid #3b5369;border-radius:15px;background:linear-gradient(135deg,#20374a,#192b40)}
.profile-page.member-profile .profile-label{font-size:12px;color:#a7bfd0;font-weight:600;line-height:1.6}
.profile-page.member-profile .profile-value{font-size:19px;line-height:1.5;color:#e8f6f0;font-weight:750;letter-spacing:-.025em}
.profile-page.member-profile [data-sync-state]{padding:12px 0 0;font-size:12px;color:#9cb5c9;line-height:1.7}
.profile-page.member-profile .actions{gap:12px;border-top:1px solid #385369;padding-top:18px}
.profile-page.member-profile .actions button{background:#213b50;border-color:#4c6b81;border-radius:12px;min-height:46px;font-size:14px;color:#d7e9f3}
/* Chat keeps the shared shell, author stack, own/right and peer/left alignment. */
.member-dialog.member-chat{padding:22px;border-radius:24px;max-height:calc(100dvh - 28px)}
.member-dialog.member-chat>.member-head{margin-bottom:14px;padding-bottom:16px;gap:10px}
.member-dialog.member-chat>.member-head h2{font-size:23px;flex:1;min-width:0}
.member-dialog.member-chat>.member-head .friend-chat-start{position:static;transform:none;width:auto;margin:0;min-height:40px;font-size:12px;padding:8px 12px;border:1px solid #5a897d;border-radius:11px;background:#254b43;color:#d2f5e5;flex:none}
.member-dialog.member-chat .chat-tabs{gap:6px;margin:0 0 14px;padding:5px;border:1px solid #3b5369;border-radius:15px;background:#0e1d2e;flex-shrink:0}
.member-dialog.member-chat .chat-tabs button{min-height:40px;padding:9px 10px;border:1px solid transparent;border-radius:10px;background:transparent;color:#a6bed0;font-size:13px;line-height:1.5;position:relative}
.member-dialog.member-chat .chat-tabs [aria-selected=true]{border-color:#629b87;background:linear-gradient(120deg,#2b5e51,#234d44);color:#d8ffee}
.member-dialog.member-chat .chat-list{padding:14px 10px;gap:12px;border:1px solid #334e63;border-radius:17px;background:linear-gradient(155deg,#0c1c2d,#102236);margin-bottom:14px;scrollbar-width:thin;scrollbar-color:#4a697b transparent}
.member-dialog.member-chat .message{padding:10px 12px;border:1px solid #395369;border-radius:17px;background:linear-gradient(130deg,#213a50,#1c3046);box-shadow:0 3px 8px #030e1818;gap:10px;flex-shrink:0}
.member-dialog.member-chat .message.mine{background:linear-gradient(125deg,#255448,#1c413e);border-color:#427e6d}
.member-dialog.member-chat .chat-message-body>span{font-size:15px;line-height:1.8;color:#eff7fc;text-align:left}
.member-dialog.member-chat .chat-time{font-size:10px;line-height:1.6;color:#95b4c5;margin-top:7px}
.member-dialog.member-chat .chat-author{align-self:center;justify-content:center;gap:2px}
.member-dialog.member-chat .chat-author small{color:#c6ddd9;font-size:11px;line-height:1.5}
.member-dialog.member-chat .chat-author .profile-title{color:#9ae2c6;font-size:10px;line-height:1.4;background:none;border:0;padding:0}
.member-dialog.member-chat .chat-message-heading{position:relative;line-height:1.4}
.member-dialog.member-chat .chat-report,.member-dialog.member-chat .chat-delete{font-size:10px;line-height:1.5;min-height:24px;padding:3px 7px;border-radius:7px;background:#132c3a9c;border:1px solid #517080;color:#afc6d6}
.member-dialog.member-chat .chat-delete{border-color:#996c7c;color:#e2b5c0;background:#492d3b55}
.member-dialog.member-chat .compose{position:relative;flex:none;margin:0;padding:12px 0 0;border-top:1px solid #3a5266;background:transparent;gap:10px;align-items:end}
.member-dialog.member-chat .compose textarea{box-sizing:border-box;background:#0d1f31;border:1px solid #527387;border-radius:13px;min-height:48px;max-height:110px;padding:12px;font-size:16px;line-height:1.5;scroll-margin-bottom:20px}
.member-dialog.member-chat .compose textarea:focus{outline:2px solid #83e4c830;outline-offset:1px;border-color:#83d5ba}
.member-dialog.member-chat .compose button{border:1px solid #6ab297;border-radius:12px;background:linear-gradient(130deg,#2c6758,#245145);color:#e4fff1;font-size:14px;min-height:48px;padding:12px 20px}
.member-dialog.member-chat .compose [data-photo]{padding:0;background:#233e51;border-color:#4e7283;color:#c0dfdb;font-size:24px}
.member-dialog.member-chat .chat-history-button{border:1px solid #436678;border-radius:10px;background:#1a3648;color:#b6d7d7;padding:8px 14px}
.member-dialog.member-chat .social-toolbar{margin:0 0 12px;flex:none}
.member-dialog.member-chat .social-toolbar button{font-size:13px;border:1px solid #496b7e;background:#1b3949;color:#c0dbdf}
.member-dialog.member-chat .social-list{border:1px solid #334e63;border-radius:17px;padding:8px 12px;background:#102135;box-sizing:border-box}
.member-dialog.member-chat .friend-chat-row{border:1px solid #3c586d!important;border-radius:14px!important;padding:16px 12px!important;margin:8px 0;background:linear-gradient(110deg,#20394b,#192d41)!important;gap:14px;box-sizing:border-box}
.member-dialog.member-chat .friend-chat-row:hover{border-color:#6aab97!important;background:#254650!important}
.member-dialog.member-chat .friend-chat-row>div>strong{font-size:16px;color:#e1f3ee;line-height:1.5}
.member-dialog.member-chat .friend-chat-row>div>span{font-size:12px;color:#9fb9cb;line-height:1.6}
.member-dialog.member-chat .friend-chat-meta time{font-size:11px;color:#9fb8ca}
.member-dialog.member-chat.private-chat .message>.chat-read-check{top:4px;right:5px;font-size:11px;color:#b2f3dc}
.member-dialog.member-friends:not(.member-chat) .social-toolbar{gap:6px;padding:5px;background:#0e1d2e;border:1px solid #385469;border-radius:14px}
.member-dialog.member-friends:not(.member-chat) .social-toolbar button{border:1px solid #3e5e73;border-radius:10px;background:#1f394c;color:#c3ddd9;font-size:13px}
.member-dialog.member-friends:not(.member-chat) .social-row{border:1px solid #3b576d;border-radius:15px;padding:14px;margin:10px 0;background:linear-gradient(115deg,#203b4c,#192c40)}
.member-dialog.member-friends:not(.member-chat) .social-row>button:last-child{border:1px solid #528471;background:#254e45;color:#d6f7e8;border-radius:10px;font-size:13px;padding:10px}
.member-dialog.photo-editor{max-height:calc(100dvh - 28px);overflow:auto}
.member-dialog.photo-editor .actions{gap:12px}
.member-dialog.photo-editor .actions button{min-height:44px;background:#254e46;border:1px solid #689f8c;color:#d9f6e9}
@media(max-width:700px){.profile-page.member-profile{width:calc(100% - 24px);padding:16px;margin:14px auto 22px;border-radius:20px}.profile-page.member-profile .profile-hero{padding:18px 12px;gap:14px}.profile-page.member-profile .profile-preview .profile-avatar{width:148px;height:148px}.profile-page.member-profile .profile-photo-actions{display:grid;grid-template-columns:1fr;gap:8px;width:100%;max-width:300px}.profile-page.member-profile .profile-photo-actions button{padding:10px;font-size:13px}.profile-page.member-profile .appearance-settings{grid-template-columns:1fr;gap:12px;margin:14px 0 18px}.profile-page.member-profile .appearance-settings section{padding:16px}.profile-page.member-profile .appearance-settings p{min-height:0;margin:10px 0}.profile-page.member-profile [data-info]{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.profile-page.member-profile [data-info] .profile-row{padding:13px 12px;gap:6px}.profile-page.member-profile [data-info] .profile-row:last-child{grid-column:1/-1}.profile-page.member-profile .profile-label{font-size:11px}.profile-page.member-profile .profile-value{font-size:16px}.profile-page.member-profile .actions{gap:9px}.profile-page.member-profile .actions button{font-size:13px;padding:11px 8px}}
@media(max-width:600px){.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor){width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:16px;border-radius:20px}.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor)>.member-head{gap:10px;margin-bottom:16px;padding-bottom:14px}.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor)>.member-head h2{font-size:21px}.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor)>.member-head .close{width:38px;height:38px;min-width:38px;min-height:38px}.member-dialog.member-settings>.member-head,.member-dialog.social-profile>.member-head{top:-16px;padding-top:10px;margin-top:-10px}.member-dialog.member-settings .notification-row{padding:12px;margin:8px 0;min-height:60px;gap:12px}.member-dialog.member-settings .notification-row strong{font-size:14px}.member-dialog.member-settings .notification-row button{width:68px;min-width:68px;font-size:12px}.member-dialog.member-settings .admin-device-settings{padding:12px;margin-top:16px}.member-dialog.social-profile .social-author{padding:16px 10px;gap:7px}.member-dialog.social-profile .social-author>.profile-avatar{width:96px;height:96px}.member-dialog.social-profile .social-author>small{font-size:18px}.member-dialog.social-profile .social-profile-stats{gap:7px;margin:12px 0 16px}.member-dialog.social-profile .social-profile-stats>div{min-height:76px;padding:10px 5px;gap:6px;border-radius:12px}.member-dialog.social-profile .social-profile-stats small{font-size:10px}.member-dialog.social-profile .social-profile-stats strong{font-size:16px}.member-dialog.social-profile .social-profile-actions{gap:8px;padding-top:14px}.member-dialog.social-profile .social-profile-actions button{font-size:12px;padding:10px 6px}.member-dialog.member-chat{height:90dvh;max-height:calc(100dvh - 20px);padding:14px}.member-dialog.member-chat>.member-head{padding-bottom:12px;margin-bottom:12px;gap:7px}.member-dialog.member-chat>.member-head h2{font-size:clamp(14px,4vw,19px)}.member-dialog.member-chat>.member-head .friend-chat-start{font-size:11px;min-height:38px;padding:7px 9px}.member-dialog.member-chat .chat-tabs{padding:4px;gap:4px;margin-bottom:10px;border-radius:12px}.member-dialog.member-chat .chat-tabs button{font-size:12px;padding:7px 4px;min-height:38px}.member-dialog.member-chat .chat-tabs>button:not([role]){font-size:10px;padding-inline:5px}.member-dialog.member-chat .chat-list{padding:10px 7px;gap:10px;border-radius:14px;margin-bottom:10px}.member-dialog.member-chat .message{padding:9px 8px;gap:7px;border-radius:14px}.member-dialog.member-chat .chat-message-body>span{font-size:14px;line-height:1.75}.member-dialog.member-chat .chat-author small{font-size:10px}.member-dialog.member-chat .chat-author .profile-title{font-size:9px}.member-dialog.member-chat .compose{padding-top:10px;gap:7px}.member-dialog.member-chat .compose textarea{padding:11px 10px;min-height:46px;max-height:90px;font-size:16px;border-radius:11px}.member-dialog.member-chat .compose button{min-height:46px;font-size:13px;padding:11px 14px;border-radius:11px}.member-dialog.member-chat .compose [data-photo]{padding:0}.member-dialog.member-chat .friend-chat-row{grid-template-columns:54px minmax(0,1fr) auto;gap:10px;padding:13px 10px!important}.member-dialog.member-chat .friend-chat-row>.profile-avatar{width:54px;height:54px}.member-dialog.member-chat .social-list{padding:5px 8px}.member-dialog.member-chat .friend-chat-row>div>strong{font-size:15px}.member-dialog.member-chat .friend-chat-meta time{font-size:10px}.member-dialog.member-friends:not(.member-chat) .social-toolbar button{font-size:11px;padding:8px 5px}.member-dialog.member-friends:not(.member-chat) .social-row{grid-template-columns:64px minmax(0,1fr) auto;gap:10px;padding:12px 10px}.member-dialog.member-friends:not(.member-chat) .social-author{width:60px}.member-dialog.member-friends:not(.member-chat) .social-row>button:last-child{font-size:11px;padding:8px}}
@media(max-width:360px){.member-dialog.member-chat>.member-head .friend-chat-start{font-size:10px;padding-inline:6px}.member-dialog.social-profile .social-profile-stats small{font-size:9px}.member-dialog.social-profile .social-profile-stats strong{font-size:15px}}
@media(prefers-reduced-motion:reduce){.member-dialog:is(.member-settings,.social-profile,.member-chat,.member-friends,.photo-editor) button{transition:none}}
/* Reserve the small moderation action row so long message text cannot run underneath it. */
.member-dialog.member-chat .message:has(>.chat-delete) .chat-message-body{padding-top:22px}
.member-dialog.member-chat .chat-message-body>span{word-break:keep-all;overflow-wrap:anywhere}
.member-dialog.member-chat .chat-report{border-color:#547587;color:#b5cddc;background:#1b3344}

@media screen{.social-friend-name{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;min-width:0;overflow-wrap:anywhere}.friend-online{display:inline-flex;align-items:center;gap:5px;font-size:11px;line-height:1.5;color:#9de2b4;white-space:nowrap}.friend-online::before{content:"";width:7px;height:7px;flex:none;border-radius:50%;background:#65d98b;box-shadow:0 0 0 3px #65d98b16}.friend-online[hidden]{display:none!important}}

@media screen{.member-bar button{border:1px solid #527e82;background:linear-gradient(135deg,#294c50,#1d3548);color:#dceff0;border-radius:12px;box-shadow:inset 0 1px 0 #ffffff0c,0 3px 9px #0001;font-weight:700}.member-bar button:hover:not(:disabled){border-color:#8bccb2;background:#305d54}.member-bar button:focus-visible{outline:2px solid #a0dbc3;outline-offset:3px}.member-bar button[data-member-action=admin]{background:linear-gradient(135deg,#355650,#243e4a)}@media(min-width:791px){.member-bar button{box-sizing:border-box;flex:0 0 96px!important;width:96px!important;min-width:96px!important;max-width:96px!important;min-height:44px!important;height:44px!important;padding:9px 8px!important;display:flex;align-items:center;justify-content:center;font-size:13px!important;line-height:1.5}}}
