/* Social surfaces follow the dark fabrication palette. Layout, images and unread colors stay intact. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.address-book,.ab-sheet) {
 --ab-soft:var(--forge-soft);--ab-line:var(--forge-line);--ab-color:var(--forge-accent);--ab-tint:rgba(148,217,255,.09);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.announcement-list,.announcement-detail) {
 --announcement-line:var(--forge-line);--announcement-soft:var(--forge-soft);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .post-detail {
 --post-line:var(--forge-line);--post-soft:var(--forge-soft);--post-accent:var(--forge-accent);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .community-profile {
 --profile-line:var(--forge-line);--profile-soft:var(--forge-soft);--profile-accent:var(--forge-accent);--profile-fade-rgb:10,21,33;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-management {
 --cm-soft:var(--forge-soft);--cm-line:var(--forge-line);
}

/* Keep the square and all social lists flat and separated by quiet rules. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.square-stream,.square-announcements,.message-hub,.community-post,.conversation-row,.conversation-row.pinned,.ab-person-row,.ab-group-main,.announcement-row,.community-profile-strategy-row) {
 background:transparent;box-shadow:none;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.community-post,.conversation-row,.ab-person-row,.ab-group-row,.announcement-row,.community-comment,.post-detail-comment,.community-profile-strategy-row,.compose-page-head,.compose-bottom) {
 border-color:var(--forge-line);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.community-likes-inline,.community-comments-inline) {
 background:rgba(28,47,65,.64);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.community-likes-inline,.community-more-comments,.community-featured,.community-post footer button.liked,.community-post footer .community-pin-action) {
 color:var(--forge-accent);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .community-comments-inline p {
 color:var(--forge-muted);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .community-pin-label {
 color:var(--forge-accent);background:rgba(148,217,255,.1);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.community-post-open,.community-content,.post-detail-body,.announcement-article-body) {
 color:var(--forge-ink);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .community-fab {
 color:#0a2334;background:linear-gradient(145deg,#b6eaff,#76c5ee);border-color:rgba(214,243,255,.62);
 box-shadow:inset 0 1px 0 rgba(255,255,255,.6),0 9px 28px rgba(0,13,28,.36),0 0 20px rgba(109,196,244,.08)!important;
}

/* Existing menus and controls get a restrained glass surface, without affecting their placement. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(#community-feed-menu,.chat-message-action-menu) {
 color:var(--forge-ink);background:var(--forge-panel);border-color:var(--forge-line-strong);box-shadow:var(--forge-shadow);
 backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-message-menu-backdrop {
 background:rgba(3,14,25,.2);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .ab-tabs {
 background:rgba(16,32,47,.76);border-color:var(--forge-line);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .ab-tabs button.active {
 color:var(--forge-ink);background:linear-gradient(145deg,rgba(110,183,226,.18),rgba(77,140,182,.1));border-color:var(--forge-line-strong);
 box-shadow:inset 0 1px 0 rgba(216,241,255,.1),0 3px 9px rgba(0,12,24,.12)!important;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.ab-create-banner,.ab-result-card,.community-profile-account,.social-request) {
 background:var(--forge-panel);border-color:var(--forge-line);box-shadow:var(--forge-shadow);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.ab-search,.ab-lookup-control,.ab-find-switch button,.ab-invite-button,.ab-create-icon,.ab-status-pill,.announcement-clean,.announcement-row-icon,.cm-rows,.cm-permission-list,.community-profile-strategy-choices,.community-profile-sharing-accounts) {
 background:var(--forge-soft);border-color:var(--forge-line);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.ab-find-switch button.active,.post-detail-featured,.post-detail-article>footer button.liked,.community-profile-snapshot.is-current,.announcement-row.is-unread .announcement-row-icon) {
 color:var(--forge-accent);background:rgba(148,217,255,.1);border-color:var(--forge-line-strong);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.ab-primary:not(.ab-danger),.ab-lookup-control button,.cm-primary:not(.cm-danger),.community-profile-follow:not(.is-following),.community-profile-sharing-actions [type="submit"],#community-profile-wallpaper-save,#post-detail-comment-form button[type="submit"]) {
 background:linear-gradient(145deg,#b6eaff,#76c5ee);border-color:rgba(205,238,255,.35);color:#0a2334;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.ab-picker-row input:checked~.ab-checkbox,.cm-permission-list input:checked+i,.cm-invite-person input:checked+i,.community-profile-strategy-choices input:checked~.community-profile-choice-check) {
 background:var(--forge-accent);border-color:var(--forge-accent);color:#0a2334;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .community-profile-sharing-accounts input:checked~.community-profile-sharing-check svg {
 color:#0a2334;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .cm-switch.on {
 background:var(--forge-accent);border-color:rgba(205,238,255,.45);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .cm-switch.on>i {
 background:#123047;
}

/* A blue night messenger. The fixed doodle wallpaper and bubble geometry are unchanged. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page {
 --chat-bg:#0c1b29;--chat-in:#1a3043;--chat-out:#24485f;--chat-bar:rgba(13,28,43,.93);
 color:var(--forge-ink);background:var(--chat-bg);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page>.chat-page-scroll {
 background:transparent;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page :is(.chat-page-header,.chat-page-footer,.chat-page-notice) {
 background:var(--chat-bar);border-color:var(--forge-line);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-message-content p {
 color:var(--forge-ink);background:var(--chat-in);
 box-shadow:inset 0 1px 0 rgba(217,239,255,.07),inset 0 0 0 1px rgba(172,208,231,.09),0 3px 8px rgba(0,10,22,.13);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-message.out .chat-message-content p {
 background:linear-gradient(145deg,#294f67,var(--chat-out));color:#effaff;
 box-shadow:inset 0 1px 0 rgba(220,245,255,.12),inset 0 0 0 1px rgba(162,218,249,.19),0 3px 9px rgba(0,12,26,.14);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-message.in .chat-message-content p::before {
 background:var(--chat-in);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-message.out .chat-message-content p::after {
 background:var(--chat-out);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page .chat-input-row input {
 background:rgba(27,47,65,.82);border-color:var(--forge-line);color:var(--forge-ink);
 box-shadow:inset 0 1px 2px rgba(0,10,23,.13);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page .chat-input-row input:focus {
 border-color:rgba(148,217,255,.54);box-shadow:0 0 0 2px rgba(148,217,255,.07);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page .chat-input-row .chat-send {
 color:#0a2334;background:linear-gradient(145deg,#b6eaff,#76c5ee);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page-header #live-chat-more {
 color:var(--forge-ink);background:var(--forge-soft);border-color:var(--forge-line);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page :is(.chat-timestamp,.chat-system-notice>span,.chat-retracted span) {
 color:var(--forge-muted);background:rgba(27,46,64,.72);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page-footer #live-chat-muted {
 color:var(--forge-muted);border-color:var(--forge-line);background:transparent;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) #live-chat-messages .message-menu-selected .chat-message-content>p {
 box-shadow:0 0 0 2px var(--forge-accent),0 4px 16px rgba(0,12,26,.25);
}

/* Fade into the same deep-blue page without tinting, filtering or blurring the actual cover photo. */
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.community-profile,.community-profile-hero,.community-profile-content) {
 background:#0a1521;
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .community-profile:not(.has-wallpaper) .community-profile-nav>button {
 color:var(--forge-ink);background:rgba(23,43,61,.4);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .community-profile-tabs>button[aria-selected="true"] {
 color:var(--forge-accent);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.community-profile-manage,.community-profile-follow.is-following,.community-profile-settings-row>svg:first-child,.community-profile-wallpaper-pickers>button,.community-profile-sharing-actions button:not([type="submit"])) {
 color:var(--forge-ink);background:var(--forge-soft);border-color:var(--forge-line);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) #community-profile-wallpaper-remove {
 background:transparent;border-color:transparent;color:var(--forge-muted);
}
:root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.community-profile-strategy-icon:not(.is-cfd),.chat-forward-avatar,.cm-avatar,.community-avatar,.post-detail-avatar) {
 color:var(--forge-accent);background:rgba(111,182,224,.1);border-color:var(--forge-line);
}

@media(hover:hover) and (pointer:fine) {
 :root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.conversation-row,.ab-person-row,.ab-group-main,.announcement-row,.community-profile-strategy-row):hover {
  background:rgba(139,203,242,.055);
 }
 :root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(.chat-message-action-menu .chat-message-action,.chat-forward-target):not(:disabled):hover {
  background:rgba(148,217,255,.1);color:var(--forge-accent);
 }
}
@media(prefers-reduced-transparency:reduce) {
 :root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) :is(#community-feed-menu,.chat-message-action-menu) {
  background:#14283a;backdrop-filter:none;-webkit-backdrop-filter:none;
 }
 :root[data-theme="dark"]:not(.auth-pending) body.ui-polished:not(.admin-body) .chat-page :is(.chat-page-header,.chat-page-footer,.chat-page-notice) {
  background:#101f2d;backdrop-filter:none;-webkit-backdrop-filter:none;
 }
}
