/* Community visual layer. Layout modes, message order and application behavior stay in the original modules. */
body .community-root,
body .community-root .community-panel,
body > .community-avatar-menu,
body > .community-image-menu,
body > .community-lightbox {
    --community-bg: #0c1523;
    --community-surface: #111f30;
    --community-panel: #111f30;
    --community-raised: #1a2a3e;
    --community-line: rgba(166,198,226,.18);
    --community-line-strong: rgba(166,198,226,.32);
    --community-text: #ecf3fb;
    --community-muted: #acbfd2;
    --community-gold: #e7c57d;
    --community-gold-bright: #ffe2a1;
    --community-blue: #9bc8ed;
    --community-radius: 18px;
    --community-ease: cubic-bezier(.2,.7,.2,1);
    font-family: 'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif;
    color: var(--community-text);
    font-size: 16px;
    line-height: 1.7;
    color-scheme: dark;
    -webkit-tap-highlight-color: rgba(231,197,125,.16);
}

/* No height/width/scroll transitions: history anchors remain stable. */
body .community-root button,
body > .community-avatar-menu button,
body > .community-image-menu :is(button,a),
body > .community-lightbox :is(button,a) {
    transition: color .16s var(--community-ease),background-color .16s var(--community-ease),border-color .16s var(--community-ease),box-shadow .16s var(--community-ease),transform .16s var(--community-ease),opacity .16s var(--community-ease);
}
body .community-root .community-panel button { min-height: 44px; }
body .community-root :is(button,a,input,textarea,select,[tabindex]):focus-visible,
body > .community-avatar-menu :focus-visible,
body > .community-image-menu :focus-visible,
body > .community-lightbox :focus-visible {
    outline: 2px solid var(--community-gold-bright);
    outline-offset: 3px;
}
body .community-root button:disabled { opacity: .46; transform: none; box-shadow: none; }
body .community-root :is(.community-timeline,.community-subpage,.community-compose,.community-mention-options,.community-upload-list) {
    scrollbar-width: thin;
    scrollbar-color: rgba(155,200,237,.32) transparent;
}
body .community-root ::selection { background: rgba(155,200,237,.28); color: #fff; }

/* The launcher belongs to the existing blue/gold workspace, rather than a separate green product. */
body .community-root .community-toggle {
    background: linear-gradient(145deg,rgba(31,48,68,.96),rgba(16,30,47,.96))!important;
    border-color: rgba(231,197,125,.5)!important;
    color: #f5dfaf!important;
    border-radius: 14px!important;
    box-shadow: 0 8px 26px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.05)!important;
    font-weight: 600!important;
    backdrop-filter: blur(20px) saturate(120%);
}
body .community-root .community-toggle:is(:hover,.community-toggle-active) {
    background: linear-gradient(145deg,#2e3e52,#192a3e)!important;
    border-color: var(--community-gold)!important;
    color: var(--community-gold-bright)!important;
}
body .community-root .community-toggle:active { transform: translateY(1px); }
body .community-root .community-toggle-dot { background: var(--community-blue); box-shadow: 0 0 0 4px rgba(155,200,237,.09); }
body .community-root .community-toggle-dot.community-offline { background: #a3aebc; box-shadow: none; }
body .community-root .community-toggle-mentioned { border-color: var(--community-gold-bright)!important; }
body .community-root .community-toggle-at { color: #ffe2a1; background: rgba(231,197,125,.15); }
/* Retain the original unread pulse; only the reduced-motion block suppresses it. */
body .community-root .community-unread,
body .community-root .community-direct-badge {
    color: #231d11;
    background: #e7c57d;
    border-color: #ffe2a1;
    font-variant-numeric: tabular-nums;
}

/* Preserve the original normal/wide/full positioning and sizing. */
body .community-root .community-panel {
    background: linear-gradient(145deg,rgba(20,34,52,.98),rgba(12,21,35,.98) 72%);
    border: 1px solid var(--community-line-strong);
    border-top-color: rgba(231,197,125,.38);
    border-radius: 22px;
    box-shadow: -12px 24px 80px rgba(1,7,15,.56),0 2px 12px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.035);
    backdrop-filter: blur(24px) saturate(115%);
}
body .community-root .community-panel.community-layout-full { border-radius: 18px; }
body .community-root .community-header {
    min-height: 78px;
    padding: 13px 15px 11px 22px;
    gap: 2px;
    background: linear-gradient(110deg,rgba(231,197,125,.055),transparent 56%);
    border-bottom: 0;
}
body .community-root .community-heading h2 {
    margin: 0 0 5px;
    color: #f4f7fc;
    font-size: 21px;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: .3px;
}
body .community-root .community-heading p { color: var(--community-muted); font-size: 12px; line-height: 1.5; }
body .community-root .community-connection { color: var(--community-blue); }
body .community-root .community-connection-off { color: var(--community-gold); }
body .community-root .community-icon-button {
    width: 44px;
    height: 44px;
    padding: 11px;
    color: #adc0d3;
    border-radius: 12px;
}
body .community-root .community-header > .community-icon-button:first-child { margin-left: 0; }
body .community-root .community-header > .community-header-close { order: 3; }
body .community-root .community-icon-button:hover { color: var(--community-gold-bright); background: rgba(231,197,125,.09); }
body .community-root :is(.community-icon-button,.community-tool):active { transform: translateY(1px); background: rgba(155,200,237,.16); }
body .community-root .community-header svg { width: 20px; height: 20px; stroke-width: 1.65; }
body .community-root .community-reading-tools {
    gap: 5px;
    min-height: 48px;
    padding: 2px 20px 3px;
    border: 0;
    background: transparent;
    color: #8fa7be;
}
body .community-root .community-reading-tools > span { color: #91a7bd; font-size: 12px; }
body .community-root .community-reading-tools button {
    min-height: 44px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(155,200,237,.045);
    color: #b9cde0;
    font-size: 12px;
}
body .community-root .community-reading-tools button:hover { background: rgba(155,200,237,.1); border-color: var(--community-line); color: #e9f3ff; }
body .community-root .community-reading-tools button[aria-pressed=true] { background: rgba(231,197,125,.1); border-color: rgba(231,197,125,.28); color: var(--community-gold-bright); }
body .community-root .community-room-note,
body .community-root .community-room-note.community-direct-note {
    display: block;
    margin: 0;
    padding: 2px 22px 13px;
    color: #a7bbce;
    background: transparent;
    border-bottom: 1px solid var(--community-line);
    font-size: 12px;
    line-height: 1.65;
}
body .community-root .community-lock-icon { color: var(--community-gold); font-size: 14px; }

/* Readable conversation rhythm, blue self messages, restrained identity colors. */
body .community-root .community-timeline { min-height: 56px; padding: 0 20px 10px; }
body .community-root .community-history { margin-top: 8px; color: #96b9d7; font-size: 12px; border-radius: 10px; }
body .community-root .community-history:hover { background: rgba(155,200,237,.07); color: #d8eaff; }
body .community-root .community-date { margin: 20px 0; font-size: 12px; color: #9fb3c8; }
body .community-root .community-date span { padding: 4px 12px; border: 1px solid rgba(166,198,226,.1); border-radius: 20px; background: rgba(155,200,237,.055); }
body .community-root .community-message { gap: 11px; margin-bottom: 19px; }
body .community-root .community-avatar,
body .community-root .community-message-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 14px;
    background: hsl(var(--community-avatar-hue) 18% 24%);
    border: 1px solid hsl(var(--community-avatar-hue) 24% 41%);
    color: hsl(var(--community-avatar-hue) 36% 88%);
    box-shadow: 0 3px 10px rgba(0,0,0,.16);
    font-size: 17px;
}
body .community-root .community-message-avatar:hover { box-shadow: 0 0 0 3px rgba(231,197,125,.12); border-color: var(--community-gold); }
body .community-root .community-message-content { max-width: calc(100% - 55px); }
body .community-root .community-message-meta { align-items: center; gap: 8px; margin-bottom: 7px; color: #bfd0e1; font-size: 12px; line-height: 1.5; }
body .community-root .community-message-meta > span { font-weight: 500; }
body .community-root .community-message-meta time { color: #8fa6bd; font-size: 12px; }
body .community-root .community-bubble {
    padding: 11px 15px;
    background: linear-gradient(145deg,#1c2e43,#19293c);
    border-color: rgba(166,198,226,.2);
    border-radius: 5px 16px 16px 16px;
    color: #edf3fb;
    font-size: 16px;
    line-height: 1.8;
    box-shadow: 0 3px 10px rgba(0,0,0,.1);
}
body .community-root .community-message-mine .community-bubble {
    background: linear-gradient(145deg,#294a6b,#213c59);
    border-color: rgba(155,200,237,.35);
    color: #f1f7ff;
    border-radius: 16px 5px 16px 16px;
}
body .community-root .community-message-mentioned .community-bubble { border-color: rgba(231,197,125,.64); box-shadow: 0 0 0 1px rgba(231,197,125,.1); }
body .community-root .community-message-sticker .community-bubble { border: 0; padding: 0; background: transparent; box-shadow: none; }
body .community-root .community-message-actions { gap: 0 12px; margin-top: 2px; color: #94abc1; }
body .community-root .community-message-actions button { min-height: 44px; padding: 8px 0; color: #9eb5ca; border-radius: 6px; font-size: 12px; }
body .community-root .community-message-actions button:hover { background: rgba(155,200,237,.05); color: var(--community-gold-bright); }
body .community-root .community-send-status { color: #a7bfd4; font-size: 12px; }
body .community-root .community-send-error,
body .community-root .community-ai-error { color: #ffc0b1!important; }
body .community-root .community-recalled { color: #8da4ba; font-size: 13px; }
body .community-root .community-message-at { color: #b9dafa; font-size: 14px; }
body .community-root .community-message-at.community-at-me { color: var(--community-gold-bright); }
body .community-root .community-mention-for-you { border-color: rgba(231,197,125,.4); color: var(--community-gold-bright); background: rgba(231,197,125,.065); }
body .community-root .community-text-link { color: #b7dcff; text-decoration-color: rgba(155,200,237,.6); text-underline-offset: 4px; }
body .community-root .community-text-link:hover { color: #edf7ff; text-decoration-color: var(--community-gold); }
body .community-root .community-message-image { background: #0b1522; border-color: var(--community-line); border-radius: 12px; }
body .community-root .community-image-more { color: #e5effc; background: rgba(13,25,42,.94); border-color: var(--community-line-strong); }
body .community-root .community-image-fallback,
body .community-root .community-invalid-image { color: #cbbd9b; }
body .community-root .community-video-item { border-color: var(--community-line-strong); background: #0b1422; border-radius: 12px; }
body .community-root .community-video-footer { background: #142337; border-top: 1px solid var(--community-line); }
body .community-root .community-video-footer > span { color: var(--community-muted); font-size: 12px; }
body .community-root .community-video-footer :is(a,button) { display: inline-flex; align-items: center; min-height: 44px; color: var(--community-blue); }
body .community-root .community-video-error,
body .community-root .community-private-media-error { background: #30281f; border-color: rgba(231,197,125,.32); color: #f0d7a6; }
body .community-root .community-private-media-error button { min-height: 44px; color: #ffe2a1; border-color: rgba(231,197,125,.4); }

/* Quotes and continuity retain their original data/scroll semantics. */
body .community-root .community-quote { padding: 9px 12px; border-left-color: #92b9dc; background: rgba(6,16,29,.3); color: #c5d7e9; border-radius: 4px 9px 9px 4px; }
body .community-root .community-quote strong { color: #d4e4f3; }
body .community-root .community-quote:hover:not(:disabled) { background: rgba(6,16,29,.5); }
body .community-root .community-reply-preview { padding: 9px 11px; border-left-color: var(--community-gold); background: #1a2a3e; border-radius: 5px 11px 11px 5px; color: #c2d3e4; }
body .community-root .community-reply-preview strong { color: #f0d69e; }
body .community-root .community-reply-preview small { font-size: 13px; }
body .community-root .community-reply-preview button { min-width: 44px; min-height: 44px; background: rgba(155,200,237,.06); color: #b4c9dd; }
body .community-root .community-context-target { border-color: rgba(231,197,125,.62)!important; background: #243042!important; box-shadow: 0 0 0 2px rgba(231,197,125,.08); }
body .community-root .community-context-target:focus,
body .community-root .community-resume-target { outline-color: var(--community-gold); }
body .community-root .community-context-link { min-height: 44px; color: var(--community-blue); }
body .community-root .community-bottom-hint button { background: #223b53; border-color: rgba(155,200,237,.46); color: #e3f1ff; box-shadow: 0 6px 20px rgba(0,0,0,.35); font-size: 13px; }
body .community-root .community-bottom-hint button:hover { background: #2c4c6b; border-color: var(--community-blue); }

/* All supplementary composer panels are in flow, never clipped absolute popovers. */
body .community-root .community-compose,
body .community-root .community-compose.community-compose-ai {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(62%,480px);
    padding: 10px 18px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-bottom: 64px;
    background: #101e30;
    border-top: 1px solid var(--community-line-strong);
}
body .community-root .community-compose > * { flex-shrink: 0; }
body .community-root .community-compose-toolbar { gap: 3px; flex-wrap: wrap; margin-bottom: 7px; min-height: 44px; }
body .community-root .community-compose-toolbar .community-tool {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #b1c6db;
}
body .community-root .community-tool svg { width: 20px; height: 20px; stroke-width: 1.7; }
body .community-root .community-tool:hover,
body .community-root .community-tool-active { background: rgba(155,200,237,.09); border-color: var(--community-line); color: #e7f3ff; }
body .community-root .community-compose-toolbar .community-ai-tool { width: 49px; min-width: 49px; padding: 7px 5px; font-size: 13px; color: #efd69c; background: rgba(231,197,125,.065); border-color: rgba(231,197,125,.24); }
body .community-root .community-ai-tool:hover:not(:disabled) { background: rgba(231,197,125,.13); border-color: rgba(231,197,125,.55); color: #ffe2a1; }
body .community-root .community-compose-toolbar .community-ai-options-toggle { width: 44px; min-width: 44px; padding: 7px; font-size: 20px; }
body .community-root .community-ai-options-toggle[aria-expanded=true] { color: var(--community-gold-bright); background: rgba(231,197,125,.11); border-color: rgba(231,197,125,.35); }
body .community-root .community-compose-hint { flex: 1 1 90px; min-width: 0; max-width: none; margin-left: auto; color: #8fa6bd; font-size: 11px; line-height: 1.5; white-space: normal; }
body .community-root .community-composer {
    min-height: 70px;
    max-height: 130px;
    padding: 12px 14px!important;
    border: 1px solid rgba(166,198,226,.27)!important;
    border-radius: 13px!important;
    background: #0b1625!important;
    color: #f0f5fc!important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.1)!important;
    font-size: 16px;
    line-height: 1.7;
}
body .community-root .community-composer::placeholder { color: #94aac0; }
body .community-root .community-composer:focus { border-color: rgba(231,197,125,.7)!important; outline: 2px solid rgba(231,197,125,.13); outline-offset: 2px; }
body .community-root .community-compose-footer,
body .community-root .community-compose-ai > .community-compose-footer {
    position: sticky;
    bottom: -1px;
    z-index: 5;
    min-height: 55px;
    padding: 10px 0 1px;
    background: #101e30;
}
body .community-root .community-compose-footer > span { color: #96adc3; font-size: 12px; }
body .community-root .community-compose-footer .community-text-limit { color: #f0cd88; }
body .community-root .community-send {
    min-width: 104px;
    min-height: 44px;
    padding: 0 18px;
    background: linear-gradient(135deg,#f1d798,#d8b66d);
    border: 1px solid #f6d999;
    border-radius: 12px;
    color: #292211;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,255,255,.2);
}
body .community-root .community-send:not(:disabled):hover { background: #ffe2a1; border-color: #ffe8b8; color: #241d0d; box-shadow: 0 4px 15px rgba(231,197,125,.14); transform: translateY(-1px); }
body .community-root .community-send:not(:disabled):active { transform: translateY(1px); box-shadow: none; }
body .community-root .community-send:disabled { opacity: .48; }
body .community-root :is(.community-emoji-panel,.community-sticker-panel,.community-mention-picker) {
    position: static;
    inset: auto;
    flex: none;
    max-height: min(310px,36vh);
    overflow-y: auto;
    margin: 1px 0 10px;
    padding: 13px;
    background: #17283e;
    border: 1px solid var(--community-line-strong);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
    scrollbar-color: rgba(155,200,237,.32) transparent;
}
body .community-root .community-emoji-categories { border-color: var(--community-line); gap: 4px; padding-bottom: 9px; margin-bottom: 9px; }
body .community-root .community-emoji-categories button > span { color: #b2c8dd; font-size: 12px; }
body .community-root .community-emoji-categories .community-category-selected { background: rgba(231,197,125,.1); box-shadow: inset 0 0 0 1px rgba(231,197,125,.38); }
body .community-root .community-emoji-categories .community-category-selected > span { color: var(--community-gold-bright); }
body .community-root .community-emoji-panel button:hover { background: rgba(155,200,237,.1); }
body .community-root .community-sticker-heading strong,
body .community-root .community-mention-heading strong { color: var(--community-text); font-size: 15px; }
body .community-root .community-sticker-heading button { color: var(--community-gold-bright); font-size: 13px; }
body .community-root .community-sticker-item > button:first-child { background: #0f1e30; border: 1px solid var(--community-line); }
body .community-root .community-sticker-item > button:first-child:hover { background: #263c55; border-color: rgba(231,197,125,.4); }
body .community-root .community-sticker-remove { width: 44px; height: 44px; min-height: 44px; top: -12px; right: -5px; background: #273e57; border-color: var(--community-line-strong); }
body .community-root .community-mention-option { border: 1px solid transparent; }
body .community-root .community-mention-option:hover { background: rgba(155,200,237,.08); border-color: var(--community-line); }
body .community-root .community-mention-option > small { color: var(--community-gold-bright); }
body .community-root .community-mention-note { border-color: var(--community-line); color: #a5bdd3; }
body .community-root .community-mention-everyone > span:first-child { background: rgba(231,197,125,.13); color: var(--community-gold-bright); }
body .community-root .community-selected-at { min-height: 44px; border-color: rgba(155,200,237,.3); background: #203951; color: #d3e7fb; }
body .community-root .community-selected-at button { width: 44px; height: 44px; color: #bdd6ef; }
body .community-root .community-selected-at button:hover { background: rgba(155,200,237,.1); }

/* AI is an ordinary mention: its existing compact menu stays compact and in flow. */
body .community-root .community-ai-badge { min-height: 20px; padding: 1px 6px; border-color: rgba(231,197,125,.44); background: rgba(231,197,125,.1); color: #f4dca7; font-size: 11px; border-radius: 5px; }
body .community-root .community-avatar-ai { color: #d7eafd; background: #243f58; border-color: rgba(155,200,237,.56); font-size: 15px; }
body .community-root .community-message-ai .community-bubble { background: linear-gradient(145deg,#1d3247,#1a2a3d); border-color: rgba(155,200,237,.38); }
body .community-root .community-ai-request { color: #b6ccdf; font-size: 12px; }
body .community-root .community-ai-request small { color: #e9ca9a; }
body .community-root .community-ai-request button,
body .community-root .community-ai-options-group button,
body .community-root .community-ai-compose-status button { min-height: 44px; border-color: var(--community-line-strong); background: #22384f; color: #d7e9fb; border-radius: 9px; }
body .community-root .community-ai-options-menu { position: static; margin-bottom: 8px; padding: 8px 11px; border-color: rgba(231,197,125,.25); background: #17263a; border-radius: 11px; color: #c3d5e7; }
body .community-root .community-ai-options-state small,
body .community-root .community-ai-options-scope { color: #a4bcd1; }
body .community-root .community-ai-options-group input,
body .community-root .community-consent input { accent-color: var(--community-gold); }
body .community-root .community-ai-compose-status { color: #b5cadd; }
body .community-root .community-ai-disclosure { border-left-color: var(--community-gold); background: #172a3c; color: #d4e1ef; }
body .community-root .community-ai-disclosure small { color: #afc5da; }

/* Notifications never disappear at compact heights. */
body .community-root .community-toast { padding: 10px 20px; background: #1b344a; border-color: rgba(155,200,237,.4); color: #dbeeff; }
body .community-root .community-alert { padding: 10px 20px; background: #402a2d; border-color: rgba(241,157,142,.42); color: #ffcfbf; }
body .community-root .community-muted-notice { background: #30281e; border-color: rgba(231,197,125,.38); color: #f4d6a2; }
body .community-root .community-drop-zone { border-color: var(--community-gold); background: rgba(20,37,56,.97); color: #f8e1b0; }
body .community-root .community-drop-zone p { color: #c0d4e7; }
body .community-root .community-upload-item { background: #192b41; border-color: var(--community-line-strong); }
body .community-root .community-upload-info { color: #aac1d7; }
body .community-root .community-upload-info > span:first-child { color: #e5effa; }
body .community-root .community-upload-info progress { accent-color: var(--community-blue); }
body .community-root .community-upload-info button { min-height: 44px; color: var(--community-blue); }
body .community-root .community-upload-info .community-upload-done { color: #acd4f3; }
body .community-root .community-upload-remove { color: #b8cde1; }

/* Every existing subpage shares the same fields, cards and hierarchy. */
body .community-root .community-subpage { padding: 24px 22px; }
body .community-root .community-page-intro { margin-bottom: 21px; }
body .community-root .community-page-intro h3 { margin-bottom: 8px; color: #edf4fc; font-size: 20px; line-height: 1.45; font-weight: 600; }
body .community-root .community-page-intro p { color: #a9bfd4; font-size: 14px; line-height: 1.8; }
body .community-root .community-settings-card { padding: 20px; margin-bottom: 16px; background: linear-gradient(140deg,rgba(28,46,67,.78),rgba(21,36,54,.72)); border-color: var(--community-line); border-radius: 16px; }
body .community-root .community-settings-card h3 { margin-top: 0; color: #eaf3fc; font-size: 16px; font-weight: 600; line-height: 1.5; }
body .community-root .community-setting-title > span { color: #9fb7cd; font-size: 12px; }
body .community-root .community-settings-card p { color: #aec3d7; font-size: 14px; line-height: 1.8; }
body .community-root .community-ai-settings { border-color: rgba(231,197,125,.28); }
body .community-root .community-ai-settings > p,
body .community-root .community-ai-settings-grid label { color: #c1d2e3; }
body .community-root .community-ai-settings-grid { gap: 17px 14px; }
body .community-root .community-ai-settings-grid small,
body .community-root .community-ai-configured,
body .community-root .community-share-days small,
body .community-root .community-settings-foot { color: #9eb6cd; font-size: 12px; line-height: 1.75; }
body .community-root :is(.community-name-edit input,.community-search-form input,.community-mention-filter,.community-ai-settings-grid input,.community-share-days select,.community-shared-filters select,.community-comfort-label select,.community-comfort-label textarea,.community-mute-controls select) {
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--community-line-strong);
    border-radius: 11px;
    background: #0c192a;
    color: #eaf3fd;
    font-size: 16px;
    line-height: 1.6;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.12);
}
body .community-root :is(input,textarea)::placeholder { color: #91a8bf; opacity: 1; }
body .community-root select option { background: #111f30; color: #ecf3fb; }
body .community-root :is(.community-name-edit button,.community-search-form button) { min-height: 46px; padding: 9px 16px; border-color: rgba(231,197,125,.58); background: #e7c57d; color: #2a2210; font-size: 14px; font-weight: 600; }
body .community-root :is(.community-name-edit button,.community-search-form button):hover { background: #ffe2a1; color: #211b0d; }
body .community-root :is(.community-load-more,.community-comfort-actions button,.community-avatar-controls button,.community-member-actions button,[data-community=member-unblock]) {
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--community-line-strong);
    border-radius: 11px;
    background: #20354c;
    color: #d0e5f8;
    font-size: 14px;
}
body .community-root :is(.community-load-more,.community-comfort-actions button,.community-avatar-controls button,.community-member-actions button,[data-community=member-unblock]):hover { background: #2b435e; border-color: rgba(155,200,237,.46); color: #ecf5ff; }
body .community-root .community-comfort-actions button[aria-pressed=true] { border-color: rgba(231,197,125,.52); background: rgba(231,197,125,.12); color: var(--community-gold-bright); }
body .community-root .community-comfort-label { color: #d8e5f2; }
body .community-root .community-consent { color: #c2d3e4; }
body .community-root .community-consent input { margin-top: 4px; }
body .community-root .community-member { grid-template-columns: 44px minmax(0,1fr); column-gap: 12px; padding: 19px 0; border-color: var(--community-line); }
body .community-root .community-member strong { color: #e6f0fa; }
body .community-root .community-member small { color: #9eb6cd; font-size: 12px; }
body .community-root .community-refresh { color: var(--community-blue); font-size: 13px; }
body .community-root :is(.community-self-label,.community-role-label) { color: #e5cea0; border-color: rgba(231,197,125,.32); background: rgba(231,197,125,.04); font-size: 11px; }
body .community-root .community-member-info > .community-member-muted { color: #f0c994; }
body .community-root .community-member-actions button[data-community=mute-toggle] { background: #30291f; color: #f2d4a0; border-color: rgba(231,197,125,.36); }
body .community-root .community-member > .community-mute-controls { background: #2b261f; border-color: rgba(231,197,125,.3); }
body .community-root .community-mute-controls label { color: #f2d9b2; }
body .community-root .community-mute-controls button { background: #57472e; border-color: rgba(231,197,125,.48); color: #ffe4b4; }
body .community-root .community-mute-controls > small { color: #c8b89c; }
body .community-root .community-avatar-large { width: 80px; height: 80px; flex-basis: 80px; border-radius: 24px; font-size: 30px; }
body .community-root .community-my-profile > strong { color: #edf4fc; font-size: 21px; }
body .community-root .community-my-profile > span:last-child { color: #a4bcd1; font-size: 13px; }
body .community-root .community-avatar-paste { background: rgba(155,200,237,.045); border-color: rgba(155,200,237,.32); color: #d5e9fb; }
body .community-root .community-avatar-paste small { color: #a5bed4; }
body .community-root .community-avatar-paste:not(:disabled):hover,
body .community-root .community-avatar-paste:focus { background: rgba(155,200,237,.09); border-color: var(--community-blue); }
body .community-root .community-sharing-heading h3 { color: #ebf4fd; }
body .community-root .community-sharing-note { border-color: var(--community-line); }
body .community-root .community-sharing-note > strong { color: var(--community-gold-bright); }
body .community-root .community-sharing-note :is(p,b) { color: #b9ccdf; }
body .community-root .community-sharing-note b { color: #dfebf6; }
body .community-root .community-switch > span { background: #2e4155; border-color: #5c738b; }
body .community-root .community-switch input:checked + span { background: #d6b66f; border-color: #f0d394; }
body .community-root .community-switch input:checked + span::after { background: #fff5da; }
body .community-root .community-switch input:focus-visible + span { outline-color: var(--community-gold-bright); }
body .community-root .community-search-result { padding: 16px; margin-bottom: 13px; background: #17283c; border-color: var(--community-line); border-radius: 14px; }
body .community-root .community-search-result .community-message-meta > strong { color: #e7f0fa; }
body .community-root .community-search-result .community-message-meta > time { color: #94adc4; }
body .community-root .community-search-result > .community-message-text { color: #e2edf9; }
body .community-root .community-search-summary { color: #a8bfd4; font-size: 13px; }
body .community-root .community-search-images button { background: #0b1625; border: 1px solid var(--community-line); }
body .community-root .community-report-excerpt { background: #122135; border-color: var(--community-line-strong); border-left-color: var(--community-gold); color: #d3e1ef; }
body .community-root .community-direct-thread { padding: 16px 8px; border-color: var(--community-line); border-radius: 12px; }
body .community-root .community-direct-thread:hover { background: rgba(155,200,237,.06); border-radius: 12px; }
body .community-root .community-direct-thread-content strong { color: #e6f0fb; }
body .community-root .community-direct-thread-content time { color: #94acc4; font-size: 12px; }
body .community-root .community-direct-thread-content > small { color: #aec3d8; font-size: 14px; }
body .community-root .community-direct-thread-content > em { color: #d9bc83; }
body .community-root .community-shared-notice { background: #1a2d40; border-color: rgba(155,200,237,.28); color: #bad6ed; }
body .community-root .community-shared-filters label { color: #a9c0d6; }
body .community-root .community-record-table { background: #142438; border-color: var(--community-line-strong); border-radius: 13px; }
body .community-root .community-record-head { background: #22364d; color: #b9cfe2; font-size: 12px; }
body .community-root .community-record-row { border-color: var(--community-line); color: #b6cce1; }
body .community-root .community-record-row:nth-child(odd) { background: rgba(155,200,237,.035); }
body .community-root .community-record-row strong { color: #e7f1fb; }
body .community-root .community-record-burst > span:last-child { color: #ffb4a5; }
body .community-root .community-record-burst > strong { color: #ffd3ac; }
body .community-root .community-record-count { color: #95adc5; font-size: 12px; }
body .community-root .community-loading { color: #afc7dd; }
body .community-root .community-empty { color: #acc3d8; }
body .community-root .community-empty strong { color: #eaf2fc; font-size: 18px; font-weight: 600; }
body .community-root .community-empty p { color: #9eb7cf; font-size: 14px; }
body .community-root .community-empty-symbol { background: rgba(155,200,237,.075); border: 1px solid var(--community-line); color: var(--community-blue); }
body .community-root .community-empty > .community-spinner { color: var(--community-gold); }

/* The only portal exceptions: existing chat-only surfaces teleported directly to body. */
body > .community-avatar-menu,
body > .community-image-menu {
    background: rgba(20,35,54,.98);
    border: 1px solid rgba(166,198,226,.34);
    border-top-color: rgba(231,197,125,.4);
    border-radius: 15px;
    box-shadow: 0 16px 44px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.035);
    backdrop-filter: blur(20px);
}
body > .community-avatar-menu .community-avatar-menu-title { color: #e3edf8; border-color: var(--community-line); font-size: 13px; padding: 7px 10px 11px; }
body > .community-avatar-menu button { border-radius: 11px; color: #e2edf8; }
body > .community-avatar-menu button strong { font-size: 14px; }
body > .community-avatar-menu button small { color: #a8bfd5; font-size: 12px; }
body > .community-avatar-menu .community-avatar-action-icon { color: #e9ca88; }
body > .community-avatar-menu button:hover:not(:disabled),
body > .community-avatar-menu button:focus-visible,
body > .community-image-menu :is(button,a):hover { background: rgba(155,200,237,.1); }
body > .community-avatar-menu:focus-visible { outline: 2px solid var(--community-gold-bright); outline-offset: 3px; }
body > .community-image-menu .community-image-menu-title { color: #9fb8ce; font-size: 12px; }
body > .community-image-menu :is(button,a) { color: #dbe9f7; font-size: 14px; min-height: 46px; }
body > .community-image-menu button:first-of-type { color: var(--community-gold-bright); }
body > .community-lightbox { background: rgba(4,10,18,.95); backdrop-filter: blur(20px); }
body > .community-lightbox .community-lightbox-toolbar { background: rgba(17,31,48,.94); border-color: var(--community-line); }
body > .community-lightbox .community-lightbox-toolbar > span { color: #e4effb; font-size: 15px; }
body > .community-lightbox .community-lightbox-toolbar :is(button,a) { background: #20354d; color: #d9e9f9; border-color: var(--community-line-strong); font-size: 13px; }
body > .community-lightbox .community-lightbox-toolbar :is(button,a):hover { background: #30465e; border-color: var(--community-gold); color: var(--community-gold-bright); }
body > .community-lightbox .community-lightbox-scroll > img { border-radius: 10px; box-shadow: 0 12px 60px rgba(0,0,0,.45); }

/* Phone and compact-window refinements keep every action available. */
@media (max-width:700px) {
    body .community-root .community-panel { border-radius: 18px; }
    body .community-root .community-panel.community-layout-full { border-radius: 0; }
    body .community-root .community-header { flex-wrap: nowrap; min-height: 76px; padding: 11px 8px 9px 14px; gap: 0; }
    body .community-root .community-header .community-heading { flex: 1 1 0; min-width: 0; }
    body .community-root .community-heading h2 { font-size: 19px; margin-bottom: 4px; }
    body .community-root .community-header .community-heading p { display: block; font-size: 11px; }
    body .community-root .community-header .community-icon-button { width: 44px; min-width: 44px; height: 44px; padding: 12px; }
    body .community-root .community-header svg { width: 19px; height: 19px; }
    body .community-root .community-reading-tools { padding: 1px 12px 3px; gap: 4px; max-height: 100px; overflow-y: auto; }
    body .community-root .community-reading-tools > span { flex: 1 1 auto; margin-right: auto; font-size: 11px; }
    body .community-root .community-reading-tools button { min-height: 44px; font-size: 12px; padding: 5px 8px; }
    body .community-root .community-room-note,
    body .community-root .community-room-note.community-direct-note { display: block; padding: 1px 14px 10px; font-size: 12px; }
    body .community-root .community-timeline { padding: 0 13px 8px; }
    body .community-root .community-message { gap: 9px; margin-bottom: 16px; }
    body .community-root .community-message-content { max-width: calc(100% - 53px); }
    body .community-root .community-bubble { padding: 10px 12px; line-height: 1.75; }
    body .community-root .community-message-meta { gap: 6px; font-size: 12px; }
    body .community-root .community-message-meta > span { max-width: 145px; }
    body .community-root .community-compose,
    body .community-root .community-compose.community-compose-ai { padding: 8px 12px calc(10px + env(safe-area-inset-bottom,0px)); max-height: min(62%,450px); }
    body .community-root .community-compose-toolbar { flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
    body .community-root .community-compose-hint { display: none; }
    body .community-root .community-composer { min-height: 66px; padding: 10px 12px!important; }
    body .community-root .community-compose-footer,
    body .community-root .community-compose-ai > .community-compose-footer { padding-top: 8px; min-height: 53px; }
    body .community-root .community-subpage { padding: 21px 16px; }
    body .community-root .community-settings-card { padding: 17px; border-radius: 14px; }
    body .community-root .community-member { grid-template-columns: 44px minmax(0,1fr); }
    body .community-root .community-avatar-large { width: 76px; height: 76px; flex-basis: 76px; }
    body .community-root .community-search-result { padding: 14px; }
    body .community-root .community-direct-thread { padding: 14px 3px; }
    body .community-root .community-emoji-categories { grid-template-columns: repeat(3,minmax(0,1fr)); }
    body .community-root .community-mention-options { max-height: 170px; }
    body > .community-lightbox .community-lightbox-toolbar { padding: 12px; gap: 8px; }
}
@media (max-width:360px) {
    body .community-root .community-header { flex-wrap: wrap; padding: 11px 12px 8px; }
    body .community-root .community-header .community-heading { flex: 1 0 100%; margin-bottom: 6px; }
    body .community-root .community-heading h2 { font-size: 19px; }
    body .community-root .community-header .community-heading p { font-size: 12px; }
    body .community-root .community-header > .community-icon-button { margin-right: 3px; }
    body .community-root .community-header .community-width-toggle { margin-left: auto; margin-right: 0; }
    body .community-root .community-timeline { padding-right: 10px; padding-left: 10px; }
    body .community-root .community-message { gap: 8px; }
    body .community-root .community-message-content { max-width: calc(100% - 52px); }
    body .community-root .community-message-meta > span { max-width: 114px; }
    body .community-root .community-compose,
    body .community-root .community-compose.community-compose-ai { padding-right: 10px; padding-left: 10px; }
    body .community-root .community-compose-toolbar { gap: 2px; }
    body .community-root .community-subpage { padding-right: 12px; padding-left: 12px; }
    body .community-root .community-settings-card { padding: 14px; }
    body .community-root .community-ai-settings-grid { grid-template-columns: minmax(0,1fr); }
    body .community-root .community-name-edit { gap: 7px; }
    body .community-root .community-search-form button { padding-right: 12px; padding-left: 12px; }
    body .community-root .community-emoji-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
    body .community-root .community-sticker-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body > .community-lightbox .community-lightbox-toolbar :is(button,a) { flex: 1 1 auto; padding: 9px 10px; }
}
@media (max-height:700px) {
    body .community-root .community-header { min-height: 68px; padding-top: 9px; padding-bottom: 8px; }
    body .community-root .community-timeline { min-height: 28px; }
    body .community-root .community-reading-tools { min-height: 44px; max-height: 94px; overflow-y: auto; }
    body .community-root .community-room-note,
    body .community-root .community-room-note.community-direct-note { display: block; padding-bottom: 8px; }
    body .community-root .community-compose,
    body .community-root .community-compose.community-compose-ai { max-height: min(62%,390px); padding-top: 6px; padding-bottom: 7px; }
    body .community-root .community-compose-toolbar { margin-bottom: 5px; }
    body .community-root .community-composer { min-height: 56px; max-height: 88px; }
    body .community-root .community-compose > .community-upload-list { max-height: 92px; }
    body .community-root .community-compose > .community-reply-preview { max-height: 82px; overflow-y: auto; }
    body .community-root .community-compose > .community-selected-mentions { max-height: 58px; overflow-y: auto; }
    body .community-root .community-compose > .community-ai-disclosure { max-height: 100px; overflow-y: auto; }
    body .community-root .community-panel > :is(.community-toast,.community-alert) { flex-shrink: 1; max-height: 64px; overflow-y: auto; }
    body .community-root :is(.community-emoji-panel,.community-sticker-panel,.community-mention-picker) { max-height: min(240px,34vh); }
}
@media (max-height:540px) {
    body .community-root .community-header .community-heading p { display: block; }
    body .community-root .community-timeline { min-height: 0; }
    body .community-root .community-composer { min-height: 52px; max-height: 80px; }
    body .community-root .community-compose-footer,
    body .community-root .community-compose-ai > .community-compose-footer { min-height: 51px; padding-top: 6px; }
}
@media (prefers-reduced-motion:reduce) {
    body .community-root *,
    body > .community-avatar-menu *,
    body > .community-image-menu *,
    body > .community-lightbox * { transition: none!important; scroll-behavior: auto!important; }
    body .community-root .community-toggle-unread > svg { animation: none!important; }
    body .community-root .community-slide-enter-active,
    body .community-root .community-slide-leave-active { transition: none!important; }
    body .community-root .community-spinner { animation-duration: 2s; }
}

/* Add columns as chat grows; sticker thumbnails keep their normal size. */
body .community-root .community-sticker-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px,112px));
    justify-content: start;
}
body .community-root .community-sticker-item > button:first-child {
    min-height: 0;
    max-width: 112px;
    max-height: 112px;
}
body .community-root .community-sticker-item img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 88px;
    object-fit: contain;
}

/* Keep everyday profile controls first and secondary settings out of the way. */
body .community-root .community-profile-settings { padding: 16px; }
body .community-root .community-profile-settings > :is(.community-settings-card,.community-profile-more) {
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
}
body .community-root .community-profile-settings .community-settings-card { padding: 16px; margin-bottom: 14px; }
body .community-root .community-profile-settings .community-setting-title h3 { margin: 0; }
body .community-root .community-profile-settings .community-my-profile {
    display: grid;
    grid-template-columns: 56px minmax(0,1fr);
    align-items: center;
    justify-items: start;
    gap: 2px 12px;
    padding: 0;
    margin: 14px 0;
}
body .community-root .community-profile-settings .community-avatar-large {
    grid-row: span 2;
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    margin: 0;
    border-radius: 18px;
    font-size: 22px;
}
body .community-root .community-profile-settings .community-my-profile > strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    line-height: 1.4;
}
body .community-root .community-profile-settings .community-my-profile > span:last-child { font-size: 12px; line-height: 1.5; }
body .community-root .community-profile-settings .community-avatar-controls { gap: 8px; }
body .community-root .community-profile-settings .community-avatar-controls button { font-size: 14px; }
body .community-root .community-profile-settings .community-avatar-paste {
    width: auto;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
    gap: 8px;
}
body .community-root .community-profile-settings .community-avatar-paste > svg { width: 18px; height: 18px; }
body .community-root .community-nickname-form { border-top: 1px solid var(--community-line); margin-top: 14px; padding-top: 14px; }
body .community-root .community-nickname-form > label { display: block; margin-bottom: 8px; color: var(--community-text); font-size: 14px; font-weight: 600; }
body .community-root .community-nickname-form > small { display: block; margin-top: 8px; color: var(--community-muted); font-size: 12px; line-height: 1.6; }
body .community-root .community-profile-sharing .community-sharing-heading h3 { margin-bottom: 4px; }
body .community-root .community-profile-sharing .community-sharing-heading p { margin: 0; font-size: 12px; line-height: 1.6; }
body .community-root .community-profile-sharing .community-sharing-note { margin-top: 12px; padding-top: 10px; }
body .community-root .community-profile-sharing .community-sharing-note > strong { font-size: 13px; }
body .community-root .community-profile-sharing .community-sharing-note p { margin: 6px 0 0; font-size: 12px; line-height: 1.7; }
body .community-root .community-profile-more { border: 1px solid var(--community-line); border-radius: 14px; background: rgba(255,255,255,.025); }
body .community-root .community-profile-more > summary { min-height: 48px; padding: 12px 14px; cursor: pointer; color: var(--community-text); }
body .community-root .community-profile-more > summary strong { font-size: 14px; font-weight: 600; }
body .community-root .community-profile-more > summary span { margin-left: 12px; color: var(--community-muted); font-size: 12px; }
body .community-root .community-profile-more[open] > summary { border-bottom: 1px solid var(--community-line); }
body .community-root .community-profile-more-content { padding: 14px; }
body .community-root .community-profile-more-content > :last-child { margin-bottom: 0; }
@media(max-width:480px) {
    body .community-root .community-profile-settings { padding: 12px; }
    body .community-root .community-profile-settings .community-settings-card { padding: 14px; }
    body .community-root .community-profile-more-content { padding: 10px; }
}
