/* Native forum controls share the site's palette, including interactive states. */
.forum-space .forum-message-content :is(.forum-spoiler,.spoiler){border:1px solid var(--line)!important;border-radius:9px!important;background:var(--surface-hi)!important;box-shadow:none;overflow:hidden;margin:16px 0!important;padding:0!important}
.forum-space .forum-message-content .forum-spoiler>.spoiler-title{min-height:42px;padding:11px 14px!important;font:500 12px/1.6 Community,Arial,sans-serif!important;color:var(--secondary)!important;background:transparent!important;border:0!important;gap:11px}
.forum-space .forum-message-content .forum-spoiler>.spoiler-title:hover{background:var(--accent-wash)!important;color:var(--text)!important}
.forum-space .forum-message-content .forum-spoiler>.spoiler-title:before{width:7px;height:7px;border-color:var(--accent);transition:transform .16s ease}
.forum-space .forum-message-content .forum-spoiler>.spoiler-title:focus-visible{outline:2px solid var(--violet)!important;outline-offset:-3px}
.forum-space .forum-message-content .forum-spoiler>.spoiler-title :is(.title-text,.forum-spoiler-label,span){font:inherit!important;color:inherit!important;background:transparent!important;-webkit-text-fill-color:currentColor!important}
.forum-space .forum-message-content .forum-spoiler>.spoiler-content{padding:15px 16px!important;border-top:1px solid var(--line)!important;background:var(--surface)!important;color:var(--secondary)!important}
.forum-space .forum-message-content .spoiler-content>:last-child{margin-bottom:0}
.forum-space .forum-message-content blockquote{background:var(--surface-hi);border-left-color:var(--violet);color:var(--secondary)}
.forum-space .forum-message-content :is(pre,code){color:var(--secondary)}
.forum-space .forum-message-content pre{background:var(--surface-hi);border-color:var(--line)}
.forum-space .forum-message-content :is(td,th){border-color:var(--line)}
.forum-space .forum-message-content th{background:var(--surface-hi);color:var(--text)}
.forum-space .forum-message-content hr{border:0;border-top:1px solid var(--line);margin:22px 0}
.forum-space .forum-message-content .forum-video{background:var(--bg);border-radius:9px}

/* Editor toolbar, menus and status. */
.forum-space .forum-editor-shell :is(.fe-button,.fe-select){background:var(--surface-hi);border:1px solid var(--line);color:var(--secondary);border-radius:6px}
.forum-space .forum-editor-shell :is(.fe-button,.fe-select):hover,
.forum-space .forum-editor-shell .fe-button[aria-pressed=true]{background:var(--accent-wash);border-color:var(--accent-edge);color:var(--accent)}
.forum-space .forum-editor-shell :is(.fe-button,.fe-select):focus-visible{outline:2px solid var(--violet);outline-offset:2px}
.forum-space .fe-style-row>i{background:var(--line)}
.forum-space .fe-status{background:var(--surface);border-color:var(--line);color:var(--muted);border-radius:0 0 9px 9px}
.forum-space .fe-status.is-over-limit{color:#e06c7d}
.forum-space .forum-editor-shell .tox-tinymce{background:var(--surface)!important}
.forum-space .fe-popover{background:var(--surface-hi);border-color:var(--line);border-radius:9px;box-shadow:0 12px 35px #0006}
.forum-space .fe-popover-title{color:var(--muted);text-transform:none;letter-spacing:0}
.forum-space .fe-popover button{color:var(--secondary);font-size:12px}
.forum-space .fe-popover button:is(:hover,:focus-visible){background:var(--accent-wash);color:var(--accent)}
.forum-space .site-editor-loading{background:var(--surface-hi);color:var(--muted);font-size:12px}

/* Every dialog is mounted outside the message, so it has its own palette scope. */
.forum-editor-modal{color-scheme:dark}
.forum-editor-modal :is(.fe-field,.fe-custom-color,.forum-field){color:var(--secondary);font-size:11px}
.forum-editor-modal .forum-icon-button{background:var(--surface-hi);color:var(--muted);border-color:var(--line)}
.forum-editor-modal .forum-icon-button:hover{color:var(--accent);background:var(--accent-wash);border-color:var(--accent-edge)}
.forum-editor-modal :is(input:not([type=color]):not([type=file]),textarea,select){background:var(--surface-hi);border-color:var(--line);color:var(--text);font-size:12px;border-radius:8px}
.forum-editor-modal :is(input,textarea,select):is(:focus,:focus-visible){outline:2px solid var(--violet);outline-offset:2px;border-color:var(--accent-edge);box-shadow:none}
.forum-editor-modal :is(input,textarea)::placeholder{color:var(--muted)}
.forum-editor-modal .forum-secondary{background:var(--surface-hi);border-color:var(--line);color:var(--secondary)}
.forum-editor-modal .forum-secondary:hover{background:var(--accent-wash);border-color:var(--accent-edge);color:var(--accent)}
.forum-editor-modal .fe-error{background:#e06c7d0d;border-color:#e06c7d40;color:#dfa5af!important}
.forum-editor-modal .fe-modal-tabs{border-color:var(--line);gap:6px}
.forum-editor-modal .fe-modal-tabs button{background:var(--surface-hi);border-color:var(--line);color:var(--muted);border-radius:7px;font-size:11px}
.forum-editor-modal .fe-modal-tabs button[aria-selected=true]{background:var(--accent-wash);border-color:var(--accent-edge);color:var(--accent)}
.forum-editor-modal .fe-file-drop{background:var(--surface-hi);border-color:var(--line);color:var(--text);border-radius:9px}
.forum-editor-modal .fe-file-drop:hover{background:var(--accent-wash);border-color:var(--accent-edge)}
.forum-editor-modal .fe-file-drop>iconify-icon{color:var(--accent)}
.forum-editor-modal .fe-file-drop span{color:var(--muted)}
.forum-editor-modal :is(.fe-file-preview,.fe-upload-progress){color:var(--muted)}
.forum-editor-modal .fe-upload-progress progress,
.forum-editor-modal .fe-upload-progress progress::-webkit-progress-bar{background:var(--surface-hi)}
.forum-editor-modal .fe-upload-progress progress::-webkit-progress-value{background:var(--violet)}
.forum-editor-modal .fe-upload-progress progress::-moz-progress-bar{background:var(--violet)}
.forum-editor-modal :is(.fe-palette-section h3,.fe-palette-heading h3){color:var(--secondary);font-size:12px}
.forum-editor-modal .fe-palette-heading>span{color:var(--muted)}
.forum-editor-modal :is(.fe-color-grid button,.fe-saved-color){background:var(--surface-hi);border-color:var(--line);color:var(--secondary);border-radius:7px}
.forum-editor-modal .fe-color-grid button:hover{background:var(--accent-wash);border-color:var(--accent-edge)}
.forum-editor-modal .fe-saved-color>button{color:var(--secondary)}
.forum-editor-modal .fe-saved-color>button:hover{background:var(--accent-wash)}
.forum-editor-modal .fe-saved-color>.fe-remove-color{color:var(--muted)}
.forum-editor-modal .fe-remove-color:hover{color:#e06c7d!important}
.forum-editor-modal :is(.fe-emoji-grid button,.fe-sticker-grid button,.fe-sticker-packs button):hover{background:var(--accent-wash);border-color:var(--accent-edge)}
.forum-editor-modal .forum-poll-config{background:transparent;border-color:var(--line)}
.forum-editor-modal .forum-poll-config label,
.forum-editor-modal .forum-field>span{color:var(--secondary);font-size:11px}
.forum-editor-modal .forum-poll-edit-option button{background:var(--surface-hi);border-color:var(--line);color:var(--muted)}
.forum-editor-modal .forum-poll-edit-option button:hover{color:#e06c7d;border-color:#e06c7d40}
.forum-editor-modal input[type=checkbox]{background:var(--surface-hi);border-color:var(--accent-edge);accent-color:var(--violet)}
.forum-editor-modal input[type=checkbox]:checked{background:var(--violet);border-color:var(--violet)}

/* Polls, uploads, comments and reactions use the same surfaces and states. */
.forum-space .forum-poll :is(header,footer,p){color:var(--muted);font-size:11px}
.forum-space .forum-poll header span:first-child{color:var(--accent)}
.forum-space .forum-poll-option{border-radius:8px;min-height:46px;font-size:12px}
.forum-space .forum-poll-option:hover{border-color:var(--accent-edge)}
.forum-space .forum-poll .forum-poll-bar{background:var(--accent-wash)}
.forum-space .forum-poll :is(input[type=text],input:not([type])),
.forum-space .forum-poll-editor input:not([type]){background:var(--surface-hi);border-color:var(--line);color:var(--text)}
.forum-space .forum-poll-config{background:transparent}
.forum-space .forum-poll-config label{color:var(--secondary);font-size:11px}
.forum-space .forum-poll-edit-option button{color:var(--muted)}
.forum-space .forum-poll-edit-option button:hover{color:#e06c7d;background:#e06c7d0d}
.forum-space .forum-compose-form>header span,
.forum-space .forum-compose-form>footer>span,
.forum-space .forum-upload-bar>span{color:var(--muted)}
.forum-space .forum-compose-form>footer{border-color:var(--line)}
.forum-space .forum-poll-switch{color:var(--secondary);font-size:12px}
.forum-space .forum-toggle-track:after{background:var(--muted)}
.forum-space input:checked+.forum-toggle-track:after{background:var(--text)}
.forum-space .player-account__info small{color:var(--muted)}
.forum-space .forum-empty iconify-icon{color:var(--accent)}
.forum-space .forum-attachment{background:var(--surface-hi);border-color:var(--line);border-radius:8px}
.forum-space .forum-attachment>span{background:var(--surface);color:var(--secondary)}
.forum-space .forum-attachment button{background:var(--surface);color:var(--text)}
.forum-space .forum-attachment button:hover{color:#e06c7d}
.forum-space .forum-comments-heading [data-comment-total]{border-color:var(--line)}
.forum-space .forum-comments-heading .forum-icon-button{background:var(--surface-hi);border-color:var(--line);color:var(--muted)}
.forum-space .forum-comment-meta .forum-icon-button{color:var(--muted)}
.forum-space .forum-comment-meta .forum-icon-button:hover{color:#e06c7d;background:#e06c7d0d}
.forum-space .forum-comment-form textarea::placeholder{color:var(--muted)}
.forum-space .forum-comment-pages{color:var(--muted)}
.forum-space .forum-comment-pages button:hover{background:var(--accent-wash);border-color:var(--accent-edge);color:var(--accent)}
.forum-space .forum-message-footer [data-comment-count]{background:var(--surface-hi);color:var(--muted)}
.forum-space .forum-comment.is-new>p{animation:none}
.forum-space .site-reactions button:is(:hover,:focus-visible){background:var(--accent-wash);border-color:var(--accent-edge);color:var(--accent)}
.forum-space .site-reactions button:focus-visible{outline-color:var(--violet)}
.forum-space .site-reactions .gcms_reaction_tip{background:var(--surface-hi);border-color:var(--line);color:var(--secondary);border-radius:8px}
.forum-space .site-reactions .gcms_reaction_tip_title{color:var(--text)}
.forum-space .site-reactions :is(.gcms_reaction_tip_empty,.gcms_reaction_tip_more){color:var(--muted);font-size:10px}
.site-reaction-dialog .site-reaction-search{background:var(--surface-hi);border-color:var(--line);color:var(--muted);border-radius:8px}
.site-reaction-dialog .site-reaction-search input{background:transparent;border:0;color:var(--text)}
.site-reaction-dialog .site-reaction-search input::placeholder{color:var(--muted)}
.site-reaction-dialog :is(nav button,[data-reaction-close]){color:var(--muted)}
.site-reaction-dialog button:hover{background:var(--accent-wash);border-color:var(--accent-edge);color:var(--accent)}
.site-reaction-dialog :is(button,input):focus-visible{outline-color:var(--violet)}

/* Native rules used !important for pagination and focus; match that priority. */
.forum-space .forum-thread-pagination .pagination{padding:0!important;border:0;background:none;border-radius:0;gap:6px}
.forum-space .forum-thread-pagination .pagination :is(a,span){background:var(--surface)!important;border:1px solid var(--line)!important;border-radius:7px!important;color:var(--secondary)!important;font:500 11px/1 Community,Arial,sans-serif!important;width:auto;min-width:34px;height:34px;padding:7px 10px}
.forum-space .forum-thread-pagination .pagination .active :is(a,span){background:var(--violet)!important;border-color:var(--violet)!important;color:#fff!important}
.forum-space .forum-thread-pagination .pagination a[href]:hover{background:var(--accent-wash)!important;border-color:var(--accent-edge)!important;color:var(--accent)!important}
.forum-space .forum-thread-pagination .pagination .sr-only{position:absolute;width:1px;height:1px;min-width:0;padding:0;border:0!important}
.forum-space .forum-board :focus-visible,
.forum-space .forum-composer :focus-visible{outline-color:var(--violet)!important}
.forum-thread-top-pagination{margin:0 0 20px;flex-wrap:wrap}
.forum-thread-top-pagination>span{margin-right:auto}
@media(max-width:760px){.forum-thread-top-pagination{flex-direction:row;align-items:center;gap:10px}.forum-thread-top-pagination>span{margin-right:0}.forum-space .forum-message-content .forum-spoiler>.spoiler-title{font-size:11px!important}.forum-space .forum-message-content .forum-spoiler>.spoiler-content{padding:13px!important}.forum-editor-modal .fe-file-drop strong{font-size:12px}}
@media(prefers-reduced-motion:reduce){.forum-space .forum-spoiler>.spoiler-title:before{transition:none}}
