/*
 * Community forum — navy glass / champagne editorial layer.
 * This file only restyles the existing component and its teleported dialogs.
 * Data, public identities, administrative controls and navigation stay in JS.
 */
body .community-forum-root,
body .community-forum-overlay {
    --forum-text: var(--community-text, #ecf3fb);
    --forum-muted: var(--community-muted, #acbfd2);
    --forum-line: var(--community-line, rgba(166, 198, 226, .18));
    --forum-panel: var(--community-panel, #111f30);
    --forum-gold: var(--community-gold, #e7c57d);
    --forum-green: var(--community-blue, #9bc8ed);
    color: var(--forum-text);
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: rgba(231, 197, 125, .16);
    color-scheme: dark;
}

body .community-forum-root {
    margin: 26px 0 44px;
    padding: 30px 32px 24px;
    border: 1px solid var(--forum-line);
    border-radius: var(--community-radius, 18px);
    background:
        radial-gradient(ellipse at 100% 0, rgba(74, 120, 163, .1), transparent 44%),
        linear-gradient(150deg, rgba(20, 35, 53, .97), rgba(12, 23, 38, .98));
    box-shadow: 0 18px 50px rgba(0, 0, 0, .2), inset 0 1px rgba(227, 239, 250, .035);
    min-width: 0;
    isolation: isolate;
    scrollbar-color: #5a728b transparent;
    scrollbar-width: thin;
}

body .community-forum-root button,
body .community-forum-overlay button {
    min-height: 44px;
    touch-action: manipulation;
    transition: background-color .18s var(--community-ease, ease),
                border-color .18s var(--community-ease, ease),
                color .18s var(--community-ease, ease),
                box-shadow .18s var(--community-ease, ease),
                transform .18s var(--community-ease, ease);
}

body .community-forum-root :is(button, input, select, textarea, a):focus-visible,
body .community-forum-overlay :is(button, input, select, textarea, a):focus-visible {
    outline: 2px solid var(--community-gold-bright, #ffe2a1) !important;
    outline-offset: 3px;
}

body .community-forum-root :is(input:not([type=file]), select, textarea):focus,
body .community-forum-overlay textarea:focus {
    border-color: #c9b47d;
    box-shadow: 0 0 0 3px rgba(231, 197, 125, .1);
}

body .community-forum-root a,
body .community-forum-overlay a {
    color: var(--community-blue, #9bc8ed);
    text-decoration-color: rgba(155, 200, 237, .5);
    text-underline-offset: 4px;
}

body .community-forum-root a:hover,
body .community-forum-overlay a:hover {
    color: #d2e9fc;
    text-decoration-color: currentColor;
}

/* Header: existing app typography, with a quiet editorial hierarchy. */
body .community-forum-root .forum-header {
    align-items: center;
    gap: 24px;
    padding-bottom: 26px;
    border-bottom-color: var(--forum-line);
}

body .community-forum-root .forum-header > div:first-child {
    min-width: 0;
}

body .community-forum-root .forum-eyebrow {
    margin-bottom: 7px;
    color: #a8c1d8;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 2.6px;
    line-height: 1.6;
}

body .community-forum-root .forum-header h2 {
    color: var(--forum-gold);
    font-size: 28px;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: 1px;
}

body .community-forum-root .forum-header p {
    margin-top: 7px;
    color: var(--forum-muted);
    font-size: 13px;
    line-height: 1.8;
}

body .community-forum-root .forum-header-actions {
    gap: 10px;
}

body .community-forum-root .forum-button,
body .community-forum-overlay .forum-button {
    min-height: 44px;
    padding: 10px 17px;
    border-color: var(--community-line-strong, rgba(166, 198, 226, .32));
    border-radius: 10px;
    background: #1a2d43;
    color: #e4eef8;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    box-shadow: inset 0 1px rgba(236, 243, 251, .025);
}

body .community-forum-root .forum-button-quiet {
    background: rgba(21, 39, 58, .7);
    border-color: var(--forum-line);
    color: #c6d8e9;
}

body .community-forum-root .forum-button:hover:not(:disabled),
body .community-forum-overlay .forum-button:hover:not(:disabled) {
    background: #253d56;
    border-color: #6f92af;
    color: #f4f8fc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12), inset 0 1px rgba(236, 243, 251, .035);
}

body .community-forum-root .forum-button-primary,
body .community-forum-overlay .forum-button-primary {
    border-color: #e4c27b;
    background: linear-gradient(135deg, #efd496, #d7b364);
    color: #252014;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(189, 145, 65, .1), inset 0 1px rgba(255, 245, 217, .24);
}

body .community-forum-root .forum-button-primary:hover:not(:disabled),
body .community-forum-overlay .forum-button-primary:hover:not(:disabled) {
    border-color: #ffe2a1;
    background: linear-gradient(135deg, #ffe3a6, #e6c27a);
    color: #252014;
    box-shadow: 0 5px 18px rgba(189, 145, 65, .16);
}

body .community-forum-root .forum-button:active:not(:disabled),
body .community-forum-overlay .forum-button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: none;
}

body .community-forum-root .forum-button[aria-pressed=true],
body .community-forum-root .forum-header-actions .forum-button[aria-pressed=true] {
    border-color: rgba(231, 197, 125, .52);
    color: #f2d79e;
    background: #353225;
}

body .community-forum-root .forum-text-button {
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #b8d7ef;
    font-size: 13px;
}

body .community-forum-root .forum-text-button:hover:not(:disabled) {
    color: #e3f1fc;
    background: rgba(134, 181, 219, .09);
}

body .community-forum-root .forum-text-button:active:not(:disabled) {
    background: rgba(134, 181, 219, .16);
}

body .community-forum-root .forum-danger {
    color: #f2b8b5;
}

body .community-forum-root .forum-danger:hover:not(:disabled) {
    color: #ffd6d2;
    background: rgba(184, 92, 96, .14);
}

body .community-forum-root .forum-count {
    min-width: 22px;
    min-height: 22px;
    background: #e7c57d;
    color: #252014;
    font-size: 11px;
}

/* Navigation and discovery share one compact, predictable control rhythm. */
body .community-forum-root .forum-tabs {
    width: max-content;
    max-width: 100%;
    gap: 4px;
    margin: 24px 0 18px;
    padding: 5px;
    border: 1px solid var(--forum-line);
    border-radius: 12px;
    background: rgba(8, 20, 34, .55);
    scrollbar-color: #59718a transparent;
    scrollbar-width: thin;
    scroll-padding-inline: 5px;
}

body .community-forum-root .forum-tabs > button {
    min-height: 44px;
    padding: 9px 18px;
    border-radius: 8px;
    color: #b1c4d6;
    font-size: 14px;
    font-weight: 550;
}

body .community-forum-root .forum-tabs > button:hover {
    background: rgba(131, 175, 211, .1);
    color: #ecf3fb;
}

body .community-forum-root .forum-tabs > button.is-current {
    border-color: rgba(231, 197, 125, .38);
    background: linear-gradient(135deg, rgba(115, 91, 47, .32), rgba(76, 66, 44, .32));
    color: #f0d596;
    box-shadow: inset 0 1px rgba(255, 231, 184, .045);
}

body .community-forum-root .forum-toolbar {
    align-items: stretch;
    gap: 10px;
    padding-bottom: 20px;
}

body .community-forum-root :is(input:not([type=file]), textarea, select),
body .community-forum-overlay textarea {
    border-color: var(--community-line-strong, rgba(166, 198, 226, .32));
    border-radius: 10px;
    background: #0d1a2b;
    color: var(--forum-text);
    font-size: 16px;
    line-height: 1.7;
    caret-color: #f0d596;
    transition: border-color .18s var(--community-ease, ease), box-shadow .18s var(--community-ease, ease);
}

body .community-forum-root :is(input:not([type=file]), select) {
    min-height: 46px;
    padding: 10px 13px;
}

body .community-forum-root input::placeholder,
body .community-forum-root textarea::placeholder,
body .community-forum-overlay textarea::placeholder {
    color: #9fb4c8;
    opacity: 1;
}

body .community-forum-root select option {
    background: #111f30;
    color: #ecf3fb;
}

body .community-forum-root .forum-search {
    align-items: stretch;
    flex: 1 1 280px;
    max-width: none;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--community-line-strong, rgba(166, 198, 226, .32));
    border-radius: 12px;
    background: #0d1a2b;
}

body .community-forum-root .forum-search:focus-within {
    border-color: #b5a675;
    box-shadow: 0 0 0 3px rgba(231, 197, 125, .07);
}

body .community-forum-root .forum-search input {
    min-height: 44px;
    padding: 8px 10px;
    border-color: transparent;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    box-shadow: none;
}

body .community-forum-root .forum-search .forum-button {
    flex: none;
    min-width: 65px;
    padding: 8px 14px;
    border-radius: 8px;
    border-color: rgba(166, 198, 226, .2);
    background: #1b3047;
    color: #cde2f4;
}

body .community-forum-root .forum-search .forum-button:hover:not(:disabled) {
    background: #29455f;
    border-color: #6f92af;
}

body .community-forum-root .forum-sort {
    display: flex;
    flex: 0 0 auto;
}

body .community-forum-root .forum-sort select {
    width: 100%;
    min-width: 128px;
    min-height: 52px;
    font-size: 13px;
    color: #c5d8e9;
}

body .community-forum-root .forum-filters {
    flex: 0 0 auto;
    align-items: stretch;
    gap: 3px;
    margin-left: auto;
    padding: 3px;
    border-color: var(--forum-line);
    border-radius: 12px;
    background: rgba(8, 20, 34, .55);
}

body .community-forum-root .forum-filters button {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #acbfd2;
    font-size: 12px;
    font-weight: 500;
}

body .community-forum-root .forum-filters button:hover {
    color: #e3eef8;
    background: rgba(132, 177, 214, .08);
}

body .community-forum-root .forum-filters button[aria-pressed=true] {
    border-color: rgba(166, 198, 226, .2);
    background: #23394e;
    color: #e6f0fa;
}

body .community-forum-root .forum-list-heading {
    flex-wrap: wrap;
    min-height: 54px;
    padding: 0 0 9px 2px;
    border-bottom-color: var(--forum-line);
    color: #c7d8e7;
    font-size: 13px;
}

body .community-forum-root .forum-list-heading > span {
    flex: 1 1 140px;
    min-width: 0;
    overflow-wrap: anywhere;
}

body .community-forum-root .forum-list-heading > div {
    flex-wrap: wrap;
    min-width: 0;
}

body .community-forum-root .forum-list-heading small,
body .community-forum-root .forum-pagination,
body .community-forum-root .forum-end {
    color: #a2b8cc;
}

/* Topic rows: title first, supporting context second, activity at the edge. */
body .community-forum-root .forum-topic-row {
    grid-template-columns: 42px minmax(0, 1fr) 58px;
    align-items: start;
    gap: 17px;
    padding: 24px 12px;
    border-bottom-color: rgba(166, 198, 226, .14);
    border-radius: 2px;
    transition: background-color .18s var(--community-ease, ease), box-shadow .18s var(--community-ease, ease);
}

body .community-forum-root .forum-topic-row:hover,
body .community-forum-root .forum-topic-row:focus-within {
    background: rgba(120, 171, 213, .045);
}

body .community-forum-root .forum-topic-row.is-pinned {
    background: linear-gradient(100deg, rgba(231, 197, 125, .055), rgba(231, 197, 125, .012) 72%, transparent);
    box-shadow: inset 2px 0 rgba(231, 197, 125, .5);
}

body .community-forum-root .forum-topic-row.is-pinned:hover,
body .community-forum-root .forum-topic-row.is-pinned:focus-within {
    background: linear-gradient(100deg, rgba(231, 197, 125, .085), rgba(231, 197, 125, .025) 72%, transparent);
}

body .community-forum-root .forum-avatar {
    width: 42px;
    height: 42px;
    border-color: rgba(155, 200, 237, .3);
    border-radius: 13px;
    background: linear-gradient(145deg, #263f58, #182e45);
    color: #c4e0f6;
    font-size: 16px;
    font-weight: 600;
    box-shadow: inset 0 1px rgba(220, 238, 252, .05);
}

body .community-forum-root .forum-topic-open {
    gap: 8px;
    align-items: flex-start;
    padding: 0;
    border-radius: 5px;
}

body .community-forum-root .forum-topic-title {
    gap: 7px;
    row-gap: 6px;
}

body .community-forum-root .forum-topic-title > strong {
    color: var(--forum-text);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.65;
    transition: color .18s var(--community-ease, ease);
}

body .community-forum-root .forum-topic-open:hover .forum-topic-title > strong,
body .community-forum-root .forum-topic-open:focus-visible .forum-topic-title > strong {
    color: #f6dca1;
}

body .community-forum-root .forum-badge {
    min-height: 22px;
    padding: 0 7px;
    border-color: rgba(166, 198, 226, .28);
    background: #1b2e43;
    color: #bdd1e4;
    font-size: 11px;
    font-weight: 550;
    line-height: 1.8;
}

body .community-forum-root .forum-badge-gold {
    border-color: rgba(231, 197, 125, .4);
    background: rgba(108, 84, 41, .24);
    color: #f0d49a;
}

body .community-forum-root .forum-topic-excerpt {
    color: #b0c1d2;
    font-size: 14px;
    line-height: 1.85;
    white-space: normal;
}

body .community-forum-root .forum-topic-meta {
    column-gap: 14px;
    row-gap: 5px;
    color: #a0b5ca;
    font-size: 12px;
    line-height: 1.7;
}

body .community-forum-root .forum-topic-meta > span:first-child {
    color: #aecde5;
    font-weight: 500;
}

body .community-forum-root .forum-topic-stats {
    justify-content: center;
    align-self: center;
    min-width: 0;
    width: 58px;
    min-height: 62px;
    padding: 8px 5px;
    border: 1px solid rgba(166, 198, 226, .13);
    border-radius: 12px;
    background: rgba(26, 44, 65, .52);
    color: #a6bcd0;
}

body .community-forum-root .forum-topic-stats strong {
    color: #dbe8f5;
    font-size: 19px;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
}

body .community-forum-root .forum-topic-stats > span {
    margin-top: 2px;
    font-size: 11px;
}

body .community-forum-root .forum-pagination {
    min-height: 64px;
    padding-top: 20px;
    font-size: 12px;
}

/* Readable system feedback. Generic notices are neutral, not success-colored. */
body .community-forum-root .forum-notice {
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin-top: 20px;
    padding: 7px 8px 7px 16px;
    border-color: rgba(155, 200, 237, .34);
    background: #1c344b;
    color: #e2edf8;
    border-radius: 12px;
}

body .community-forum-root .forum-notice > button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    color: #c6ddf0;
}

body .community-forum-root .forum-notice > button:hover {
    background: rgba(155, 200, 237, .12);
}

body .community-forum-root .forum-inline-note,
body .community-forum-root .forum-publish-note {
    border-color: rgba(231, 197, 125, .35);
    background: rgba(109, 85, 42, .16);
    color: #e1cfaa;
    border-radius: 10px;
    line-height: 1.9;
}

body .community-forum-root .forum-error {
    padding: 14px 16px;
    border-color: rgba(237, 160, 153, .4);
    border-radius: 11px;
    background: #3a2830;
    color: #f4cecb;
}

body .community-forum-root .forum-loading {
    min-height: 210px;
    color: #b8ccde;
    gap: 12px;
}

body .community-forum-root .forum-loader {
    width: 18px;
    height: 18px;
    border-color: rgba(155, 200, 237, .22);
    border-top-color: #c3e1f7;
}

body .community-forum-root .forum-empty {
    min-height: 305px;
    gap: 11px;
    padding: 42px 24px;
    background: radial-gradient(ellipse at center, rgba(89, 136, 178, .045), transparent 65%);
}

body .community-forum-root .forum-empty-mark {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
    border-color: rgba(155, 200, 237, .25);
    border-radius: 18px;
    background: linear-gradient(145deg, #233c55, #172d43);
    color: #c4dff4;
    font-size: 13px;
    font-weight: 550;
    box-shadow: inset 0 1px rgba(224, 240, 252, .04);
}

body .community-forum-root .forum-empty h3 {
    color: #e7f0f9;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.7;
}

body .community-forum-root .forum-empty p {
    max-width: 440px;
    margin-bottom: 9px;
    color: var(--forum-muted);
    font-size: 14px;
    line-height: 1.9;
}

/* Editors and article reading keep the same field and spacing system. */
body .community-forum-root .forum-subheading {
    min-height: 70px;
    padding: 13px 0;
    border-bottom-color: var(--forum-line);
    color: #d9e5f0;
}

body .community-forum-root .forum-subheading small {
    color: #a7bdd0;
}

body .community-forum-root .forum-editor {
    max-width: 850px;
    margin-top: 26px;
    padding: 24px 26px;
    border: 1px solid var(--forum-line);
    border-radius: 15px;
    background: rgba(10, 23, 39, .42);
}

body .community-forum-root .forum-editor > label,
body .community-forum-root .forum-reply-editor > label {
    margin-top: 22px;
    margin-bottom: 10px;
    color: #dfeaf5;
    font-size: 14px;
    font-weight: 550;
}

body .community-forum-root .forum-editor > label:first-child,
body .community-forum-root .forum-reply-editor > label:first-child {
    margin-top: 0;
}

body .community-forum-root .forum-editor label > span,
body .community-forum-root .forum-reply-editor label > span,
body .community-forum-root .forum-editor-tools > span {
    color: #a6bcd0;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

body .community-forum-root .forum-editor > input {
    min-height: 52px;
    font-size: 17px;
}

body .community-forum-root .forum-editor textarea,
body .community-forum-root .forum-reply-editor textarea {
    padding: 14px 16px;
    font-size: 16px;
    line-height: 2;
    scrollbar-color: #5a728b transparent;
    scrollbar-width: thin;
}

body .community-forum-root .forum-editor-tools {
    gap: 12px;
    margin-top: 15px;
}

body .community-forum-root .forum-editor-footer {
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top-color: var(--forum-line);
}

body .community-forum-root .forum-editor-footer > .forum-button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
}

body .community-forum-root .forum-upload {
    padding: 7px 7px 9px;
    border-color: var(--community-line-strong, rgba(166, 198, 226, .32));
    border-radius: 12px;
    background: #172b41;
}

body .community-forum-root .forum-upload > img {
    background: #0c1828;
    border-radius: 7px;
}

body .community-forum-root .forum-upload > button:not(.forum-upload-retry) {
    top: 4px;
    right: 4px;
    border-color: #6584a0;
    border-radius: 8px;
    background: rgba(13, 28, 45, .96);
    color: #eef5fb;
}

body .community-forum-root .forum-upload > small {
    color: #b7d5eb;
}

body .community-forum-root .forum-upload > small.is-error {
    color: #f5bfba;
}

body .community-forum-root .forum-upload-retry {
    min-height: 44px;
    padding: 9px 6px;
    color: #c2def3;
    border-radius: 7px;
}

body .community-forum-root .forum-detail {
    max-width: 960px;
    margin-inline: auto;
    padding-top: 30px;
}

body .community-forum-root .forum-detail-badges {
    gap: 9px;
    margin-bottom: 15px;
}

body .community-forum-root .forum-category {
    color: #aacde8;
    font-size: 12px;
    font-weight: 550;
}

body .community-forum-root .forum-detail-title {
    margin-bottom: 23px;
    color: #f0f5fb;
    font-size: 28px;
    font-weight: 650;
    line-height: 1.65;
    text-wrap: pretty;
}

body .community-forum-root .forum-detail-author {
    margin-bottom: 30px;
}

body .community-forum-root .forum-detail-author > div,
body .community-forum-root .forum-detail-author strong,
body .community-forum-root .forum-detail-author time,
body .community-forum-root .forum-reply-content > header > strong {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

body .community-forum-root .forum-detail-author strong,
body .community-forum-root .forum-reply-content > header > strong {
    color: #bed8ed;
    font-weight: 550;
}

body .community-forum-root .forum-detail-author time,
body .community-forum-root .forum-reply-content time {
    color: #a5bacf;
    font-size: 12px;
}

body .community-forum-root .forum-author-role {
    border-color: rgba(231, 197, 125, .4);
    color: #ebd29d;
    background: rgba(111, 86, 39, .2);
    font-size: 11px;
}

body .community-forum-root .forum-prose {
    color: #dbe6f1;
    font-size: 16px;
    line-height: 2;
}

body .community-forum-root .forum-media-open {
    border-color: rgba(166, 198, 226, .28);
    border-radius: 12px;
    background: #0b1726;
}

body .community-forum-root .forum-media-open:hover {
    border-color: #aac8e0;
    box-shadow: 0 0 0 2px rgba(155, 200, 237, .08);
}

body .community-forum-root .forum-media-error,
body .community-forum-overlay .forum-preview-error {
    border-color: var(--community-line-strong, rgba(166, 198, 226, .32));
    border-radius: 12px;
    background: #172b40;
    color: #d6e5f2;
}

body .community-forum-overlay .forum-preview-error p {
    color: #b1c6da;
}

body .community-forum-root .forum-detail-actions {
    gap: 12px;
    margin-top: 30px;
    padding-bottom: 20px;
}

body .community-forum-root .forum-admin-bar {
    gap: 8px 14px;
    padding: 10px 14px;
    border-color: rgba(231, 197, 125, .28);
    border-radius: 11px;
    background: rgba(100, 79, 40, .13);
    color: #dac69d;
}

body .community-forum-root .forum-replies {
    max-width: 960px;
    margin: 28px auto 0;
    padding-top: 26px;
    border-top-color: rgba(166, 198, 226, .24);
}

body .community-forum-root .forum-replies-heading h3 {
    color: #e3edf7;
    font-size: 19px;
    font-weight: 600;
}

body .community-forum-root .forum-replies-heading h3 > span,
body .community-forum-root .forum-replies-heading > span,
body .community-forum-root .forum-reply-empty {
    color: #a7bfd2;
}

body .community-forum-root .forum-reply {
    gap: 15px;
    padding: 25px 0 18px;
    border-bottom-color: rgba(166, 198, 226, .14);
}

body .community-forum-root .forum-reply > .forum-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 15px;
}

body .community-forum-root .forum-reply-content > header {
    gap: 9px;
    margin-bottom: 11px;
}

body .community-forum-root .forum-reply-content > footer {
    gap: 6px;
    margin-top: 10px;
}

body .community-forum-root .forum-reply-editor {
    padding: 22px;
    margin-top: 25px;
    border: 1px solid var(--forum-line);
    border-radius: 14px;
    background: rgba(10, 23, 39, .42);
}

body .community-forum-root .forum-reply-editor .forum-editor-footer {
    margin-top: 14px;
    padding-top: 0;
    border: 0;
}

/* All existing moderation actions remain visible and independently operable. */
body .community-forum-root .forum-management-bar {
    margin-top: 22px;
    padding: 17px 19px;
    border-color: rgba(231, 197, 125, .32);
    border-radius: 13px;
    background: linear-gradient(100deg, rgba(108, 83, 39, .18), rgba(108, 83, 39, .045));
}

body .community-forum-root .forum-management-bar strong {
    color: #edcf91;
    font-size: 15px;
    font-weight: 600;
}

body .community-forum-root .forum-management-bar p {
    color: #b4c8da;
}

body .community-forum-root .forum-row-management {
    gap: 8px;
    padding-top: 3px;
}

body .community-forum-root .forum-row-management .forum-text-button {
    min-height: 44px;
    padding: 9px 13px;
    border-color: rgba(166, 198, 226, .26);
    border-radius: 8px;
    background: #192e43;
    color: #c5dcef;
    font-size: 12px;
}

body .community-forum-root .forum-row-management .forum-text-button:hover:not(:disabled) {
    border-color: #789ab6;
    background: #29445d;
    color: #edf5fc;
}

body .community-forum-root .forum-row-management .forum-danger {
    border-color: rgba(238, 168, 164, .34);
    background: #382a33;
    color: #f1bfbb;
}

body .community-forum-root .forum-row-management .forum-danger:hover:not(:disabled) {
    border-color: #c68e91;
    background: #50313c;
    color: #ffd4cf;
}

body .community-forum-root .forum-notification {
    gap: 15px;
    padding: 22px 12px;
    border-bottom-color: var(--forum-line);
    color: #d5e3ef;
    border-radius: 2px;
}

body .community-forum-root .forum-notification:hover,
body .community-forum-root .forum-notification:focus-visible {
    background: rgba(130, 179, 217, .055);
}

body .community-forum-root .forum-notification.is-unread {
    background: rgba(231, 197, 125, .025);
}

body .community-forum-root .forum-notification strong {
    color: #e5eef8;
    font-weight: 550;
}

body .community-forum-root .forum-notification > span:nth-child(2) > span,
body .community-forum-root .forum-notification time,
body .community-forum-root .forum-notification > small {
    color: #a9bfd3;
}

body .community-forum-root .forum-notification.is-unread .forum-notification-dot {
    background: #e7c57d;
    box-shadow: 0 0 0 4px rgba(231, 197, 125, .08);
}

body .community-forum-root .forum-notification.is-unread > small {
    color: #edcf91;
}

body .community-forum-root .forum-notification[aria-disabled=true] {
    opacity: .65;
    cursor: default;
}

body .community-forum-root .forum-report-row {
    padding: 25px 4px;
    border-bottom-color: var(--forum-line);
}

body .community-forum-root .forum-report-row > header > strong {
    color: #e1edf8;
}

body .community-forum-root .forum-report-row p {
    color: #c8d8e7;
    line-height: 1.9;
}

body .community-forum-root .forum-report-row .forum-report-excerpt {
    border-left-color: #83abc9;
    border-radius: 0 8px 8px 0;
    background: rgba(118, 167, 204, .07);
    color: #b8cddd;
}

body .community-forum-root .forum-report-row > small {
    color: #a3bbd0;
}

body .community-forum-root .forum-report-row > footer {
    gap: 8px;
    flex-wrap: wrap;
}

body .community-forum-root .forum-footnote {
    margin-top: 27px;
    padding-top: 20px;
    border-top-color: rgba(166, 198, 226, .12);
    color: #9ab0c5;
    font-size: 11px;
    line-height: 1.9;
}

/* Teleported dialogs are scoped separately so the application stays untouched. */
body .community-forum-overlay {
    padding: 24px;
    background: rgba(4, 11, 21, .84);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overscroll-behavior: contain;
}

body .community-forum-overlay .forum-dialog {
    width: 540px;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    padding: 25px 26px;
    border-color: rgba(166, 198, 226, .34);
    border-radius: 18px;
    background: linear-gradient(145deg, #182b40, #101e30);
    box-shadow: 0 25px 90px rgba(0, 0, 0, .5), inset 0 1px rgba(236, 243, 251, .04);
    scrollbar-color: #5a728b transparent;
    scrollbar-width: thin;
}

body .community-forum-overlay .forum-dialog > header {
    gap: 12px;
    margin-bottom: 17px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--forum-line);
}

body .community-forum-overlay .forum-dialog h3 {
    color: #f0d596;
    font-size: 20px;
    font-weight: 600;
}

body .community-forum-overlay .forum-dialog > header > button {
    flex: none;
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    border-radius: 9px;
    color: #bcd5e9;
}

body .community-forum-overlay .forum-dialog > header > button:hover {
    background: rgba(134, 182, 219, .1);
    color: #f0f6fc;
}

body .community-forum-overlay .forum-dialog p {
    color: #b4c9dc;
    line-height: 1.9;
}

body .community-forum-overlay .forum-dialog label {
    color: #dce8f3;
    font-size: 14px;
    line-height: 1.8;
}

body .community-forum-overlay textarea {
    padding: 13px 14px;
    font-size: 16px;
    line-height: 1.9;
}

body .community-forum-overlay .forum-dialog small {
    color: #a9bfd3;
    line-height: 1.8;
}

body .community-forum-overlay .forum-dialog footer {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 23px;
}

body .community-forum-overlay .forum-dialog footer > .forum-button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
}

body .community-forum-overlay.forum-image-overlay {
    gap: 18px;
    background: rgba(4, 10, 19, .96);
}

body .community-forum-overlay .forum-image-toolbar {
    min-width: 0;
    gap: 16px;
    color: #c4d9eb;
}

body .community-forum-overlay .forum-image-toolbar > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 5px;
    font-size: 14px;
}

body .community-forum-overlay .forum-image-toolbar > button {
    min-height: 44px;
    padding: 9px 16px;
    border-color: rgba(166, 198, 226, .36);
    border-radius: 10px;
    background: #1c3249;
    color: #dfedf8;
}

body .community-forum-overlay .forum-image-toolbar > button:hover {
    background: #2a4660;
    border-color: #83aac8;
}

body .community-forum-overlay.forum-image-overlay > img {
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
    border-radius: 10px;
}

/* Tablet: controls reflow deliberately rather than squeezing the search. */
@media (max-width: 1100px) {
    body .community-forum-root .forum-toolbar {
        gap: 10px;
    }

    body .community-forum-root .forum-search {
        flex-basis: calc(100% - 150px);
    }

    body .community-forum-root .forum-filters {
        flex-basis: auto;
        max-width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 900px) {
    body .community-forum-root {
        padding: 25px 24px 22px;
    }

    body .community-forum-root .forum-header {
        gap: 20px;
    }

    body .community-forum-root .forum-header-actions {
        gap: 8px;
    }

    body .community-forum-root .forum-header-actions .forum-button {
        padding-inline: 13px;
    }

    body .community-forum-root .forum-filters {
        width: auto;
        max-width: 100%;
    }

    body .community-forum-root .forum-topic-row {
        gap: 14px;
        padding-inline: 8px;
    }
}

/* Mobile: no app-wide layout rules; the existing bottom navigation is retained. */
@media (max-width: 600px) {
    body .community-forum-root {
        margin-top: 20px;
        padding: 22px 16px 19px;
        border-radius: 16px;
    }

    body .community-forum-root .forum-header {
        align-items: stretch;
        flex-direction: column;
        gap: 20px;
        padding-bottom: 22px;
    }

    body .community-forum-root .forum-eyebrow {
        font-size: 10px;
    }

    body .community-forum-root .forum-header h2 {
        font-size: 26px;
    }

    body .community-forum-root .forum-header p {
        margin-top: 6px;
        font-size: 13px;
    }

    body .community-forum-root .forum-header-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        width: 100%;
        gap: 8px;
    }

    body .community-forum-root .forum-header-actions .forum-button {
        min-width: 0;
        margin-left: 0;
        padding: 10px 7px;
        font-size: 13px;
        gap: 5px;
        white-space: normal;
    }

    body .community-forum-root .forum-button,
    body .community-forum-overlay .forum-button {
        min-height: 44px;
        padding: 10px 13px;
        font-size: 13px;
    }

    body .community-forum-root .forum-tabs {
        width: 100%;
        gap: 3px;
        margin: 19px 0 15px;
        padding: 5px;
        border-radius: 11px;
    }

    body .community-forum-root .forum-tabs > button {
        flex: 1 0 auto;
        padding: 9px 12px;
        font-size: 13px;
    }

    body .community-forum-root .forum-toolbar {
        gap: 10px;
        padding-bottom: 15px;
    }

    body .community-forum-root .forum-search {
        flex: 1 1 100%;
        padding: 3px;
    }

    body .community-forum-root .forum-search input {
        font-size: 16px;
        padding-left: 9px;
    }

    body .community-forum-root .forum-search .forum-button {
        min-width: 59px;
        padding-inline: 11px;
    }

    body .community-forum-root .forum-sort {
        flex: 1 1 112px;
    }

    body .community-forum-root .forum-sort select {
        min-width: 0;
        min-height: 52px;
        padding: 11px 9px;
        font-size: 16px;
    }

    body .community-forum-root .forum-filters {
        flex: 1 1 190px;
        justify-content: space-between;
        max-width: 100%;
        margin: 0;
    }

    body .community-forum-root .forum-filters button {
        flex: 1;
        min-height: 44px;
        padding: 9px 9px;
        font-size: 12px;
    }

    body .community-forum-root .forum-list-heading {
        min-height: 54px;
        gap: 8px;
        padding-bottom: 8px;
        font-size: 12px;
    }

    body .community-forum-root .forum-list-heading > div {
        gap: 0;
    }

    body .community-forum-root .forum-topic-row {
        grid-template-columns: 34px minmax(0, 1fr) 42px;
        gap: 10px;
        padding: 21px 4px;
    }

    body .community-forum-root .forum-avatar {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        font-size: 14px;
    }

    body .community-forum-root .forum-topic-open {
        gap: 8px;
    }

    body .community-forum-root .forum-topic-title > strong {
        font-size: 16px;
        line-height: 1.7;
    }

    body .community-forum-root .forum-badge {
        min-height: 21px;
        padding-inline: 5px;
        font-size: 11px;
    }

    body .community-forum-root .forum-topic-excerpt {
        font-size: 13px;
        line-height: 1.85;
    }

    body .community-forum-root .forum-topic-meta {
        column-gap: 10px;
        row-gap: 4px;
        font-size: 12px;
    }

    body .community-forum-root .forum-topic-stats {
        align-self: start;
        width: 42px;
        min-height: 55px;
        padding: 7px 3px;
        border-radius: 10px;
    }

    body .community-forum-root .forum-topic-stats strong {
        font-size: 17px;
    }

    body .community-forum-root .forum-topic-stats > span {
        font-size: 11px;
    }

    body .community-forum-root .forum-pagination {
        gap: 10px;
        padding-top: 18px;
    }

    body .community-forum-root .forum-empty {
        min-height: 280px;
        padding: 34px 10px;
    }

    body .community-forum-root .forum-empty h3 {
        font-size: 17px;
    }

    body .community-forum-root .forum-empty p {
        font-size: 13px;
    }

    body .community-forum-root .forum-subheading {
        gap: 6px;
        min-height: 68px;
        padding-block: 11px;
        font-size: 13px;
    }

    body .community-forum-root .forum-subheading small {
        flex-basis: 100%;
        padding-left: 10px;
        font-size: 12px;
    }

    body .community-forum-root .forum-editor {
        margin-top: 20px;
        padding: 18px 14px;
        border-radius: 12px;
    }

    body .community-forum-root .forum-editor > input,
    body .community-forum-root .forum-editor > select {
        width: 100%;
        min-width: 0;
        font-size: 16px;
    }

    body .community-forum-root .forum-editor > textarea {
        min-height: 240px;
    }

    body .community-forum-root .forum-editor textarea,
    body .community-forum-root .forum-reply-editor textarea {
        padding: 12px;
        font-size: 16px;
        line-height: 1.95;
    }

    body .community-forum-root .forum-editor-tools {
        gap: 10px;
    }

    body .community-forum-root .forum-editor-tools > span {
        flex-basis: 100%;
        line-height: 1.9;
    }

    body .community-forum-root .forum-editor-footer {
        gap: 8px;
        margin-top: 20px;
        padding-top: 18px;
    }

    body .community-forum-root .forum-detail {
        padding-top: 24px;
    }

    body .community-forum-root .forum-detail-title {
        margin-bottom: 21px;
        font-size: 23px;
        line-height: 1.7;
    }

    body .community-forum-root .forum-detail-author {
        gap: 10px;
        margin-bottom: 25px;
    }

    body .community-forum-root .forum-detail-author > div {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    body .community-forum-root .forum-detail-actions {
        gap: 5px;
        margin-top: 25px;
    }

    body .community-forum-root .forum-prose {
        font-size: 16px;
        line-height: 1.95;
    }

    body .community-forum-root .forum-replies {
        padding-top: 23px;
    }

    body .community-forum-root .forum-replies-heading {
        gap: 10px;
        flex-wrap: wrap;
    }

    body .community-forum-root .forum-replies-heading h3 {
        font-size: 18px;
    }

    body .community-forum-root .forum-reply {
        gap: 10px;
        padding-top: 22px;
    }

    body .community-forum-root .forum-reply > .forum-avatar {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 13px;
    }

    body .community-forum-root .forum-reply-content time {
        flex-basis: 100%;
        margin-left: 0;
    }

    body .community-forum-root .forum-reply-content > footer {
        gap: 2px;
        flex-wrap: wrap;
    }

    body .community-forum-root .forum-reply-editor {
        margin-top: 22px;
        padding: 17px 13px;
        border-radius: 12px;
    }

    body .community-forum-root .forum-management-bar {
        gap: 14px;
        padding: 15px;
    }

    body .community-forum-root .forum-management-tools {
        gap: 8px;
    }

    body .community-forum-root .forum-row-management {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding-top: 5px;
    }

    body .community-forum-root .forum-notification {
        gap: 10px;
        padding: 21px 3px;
    }

    body .community-forum-root .forum-notification strong {
        font-size: 15px;
    }

    body .community-forum-root .forum-notification > small {
        white-space: nowrap;
    }

    body .community-forum-root .forum-report-row > header {
        gap: 10px;
        flex-wrap: wrap;
    }

    body .community-forum-root .forum-footnote {
        margin-top: 23px;
        font-size: 11px;
    }

    body .community-forum-overlay {
        padding: 14px;
    }

    body .community-forum-overlay .forum-dialog {
        max-height: calc(100vh - 28px);
        max-height: calc(100dvh - 28px);
        padding: 20px;
        border-radius: 16px;
    }

    body .community-forum-overlay .forum-dialog h3 {
        font-size: 19px;
    }

    body .community-forum-overlay .forum-dialog footer > .forum-button {
        flex: 1;
    }

    body .community-forum-overlay .forum-image-toolbar {
        gap: 13px;
    }
}

@media (max-width: 380px) {
    body .community-forum-root {
        padding: 20px 12px 17px;
        border-radius: 14px;
    }

    body .community-forum-root .forum-header-actions {
        gap: 6px;
    }

    body .community-forum-root .forum-header-actions .forum-button {
        padding-inline: 5px;
        font-size: 12px;
    }

    body .community-forum-root .forum-tabs > button {
        padding-inline: 11px;
    }

    body .community-forum-root .forum-sort,
    body .community-forum-root .forum-filters {
        flex-basis: 100%;
    }

    body .community-forum-root .forum-topic-row {
        grid-template-columns: 28px minmax(0, 1fr) 38px;
        gap: 8px;
        padding-inline: 3px;
    }

    body .community-forum-root .forum-topic-row > .forum-avatar {
        width: 28px;
        height: 28px;
        border-radius: 9px;
        font-size: 13px;
    }

    body .community-forum-root .forum-topic-title > strong {
        font-size: 16px;
    }

    body .community-forum-root .forum-topic-stats {
        width: 38px;
    }

    body .community-forum-root .forum-topic-meta {
        column-gap: 8px;
    }

    body .community-forum-root .forum-editor,
    body .community-forum-root .forum-reply-editor {
        padding-inline: 11px;
    }

    body .community-forum-root .forum-editor-footer > .forum-button {
        min-width: 0;
        flex: 1;
    }

    body .community-forum-root .forum-upload-grid,
    body .community-forum-root .forum-media-grid {
        gap: 7px;
    }

    body .community-forum-root .forum-media-error {
        padding-inline: 6px;
        font-size: 13px;
    }

    body .community-forum-root .forum-media-error .forum-button {
        padding-inline: 7px;
        font-size: 12px;
    }

    body .community-forum-root .forum-reply-content > footer .forum-text-button {
        padding-inline: 8px;
    }

    body .community-forum-overlay .forum-dialog {
        padding: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body .community-forum-root *,
    body .community-forum-overlay * {
        transition: none !important;
        scroll-behavior: auto !important;
    }

    body .community-forum-root .forum-loader {
        animation: none;
        border-color: #92b8d5;
        border-top-color: #e5d09e;
    }

    body .community-forum-root .forum-button:active:not(:disabled),
    body .community-forum-overlay .forum-button:active:not(:disabled) {
        transform: none;
    }
}
