/* Forum 60.0.52, scoped theme token overrides. No global :root mutation. */
.rs-forum[data-rs-theme="light"] {
  --rs-bg-page:#F5F7FA; --rs-text:#202A39; --rs-action:#087F52; --rs-action-hover:#086D48; --rs-success:#087F52; --rs-danger:#9C2734; --rs-card-bg:#FFFFFF; --rs-card-bg-hover:#EDF1F6;
  --rs-card-border:#D8E0E9; --rs-card-border-hover:#9BAEC2;
  --rs-surface-1:#FFFFFF; --rs-surface-2:#EDF1F6; --rs-surface-3:#E4EBF3;
  --rs-text-primary:#202A39; --rs-text-secondary:#526176; --rs-text-muted:#526176;
  --rs-border-subtle:#D8E0E9; --rs-border-default:#C7D2DF; --rs-border-strong:#93A6BA;
  --rs-border-focus:#2468B2; --rs-link:#245D9E; --rs-info:#245D9E;
  --rs-glow-focus:0 0 0 3px rgba(36,104,178,.22);
  --forum-bg:#F5F7FA; --forum-hover:#EDF1F6; --rs-input-bg:#FFFFFF; --rs-surface:#FFFFFF; --rs-surface-raised:#EDF1F6;
  --rs-border:#D8E0E9; --rs-color-success:#087F52;
  --forum-panel:var(--rs-card-bg); --forum-panel-hover:var(--rs-card-bg-hover);
  --forum-border:var(--rs-card-border); --forum-text:var(--rs-text-primary);
  --forum-secondary:var(--rs-text-secondary); --forum-muted:var(--rs-text-muted);
  background:var(--rs-bg-page); color:var(--rs-text-primary);
}
/* The global page remains dark. A light canvas belongs exclusively to the forum root. */
/* Single accessible compact theme switch, 84 x 44 px, both themes. */
.rs-forum__theme-bar {display:flex;justify-content:flex-end;align-items:center;margin:0 0 10px;}
.rs-forum__theme-toggle {display:block;position:relative;width:84px;height:44px;padding:0;border:0;border-radius:24px;background:transparent;color:inherit;cursor:pointer;flex:none;-webkit-tap-highlight-color:transparent;}
.rs-forum__theme-track {position:absolute;inset:1px;display:block;border-radius:24px;background:var(--rs-surface-2,#252a34);border:1px solid var(--rs-border-default,#424b5b);color:var(--rs-text-secondary,#aeb8c7);transition:background-color .18s,border-color .18s;}
.rs-forum__theme-sun,.rs-forum__theme-moon {position:absolute;top:10px;width:20px;height:20px;z-index:2;pointer-events:none;}
.rs-forum__theme-sun {left:10px;}
.rs-forum__theme-moon {right:10px;}
.rs-forum__theme-thumb {position:absolute;top:3px;left:3px;width:34px;height:34px;border-radius:50%;background:var(--rs-surface-1,#1c202a);border:1px solid var(--rs-border-strong,#647085);box-shadow:0 1px 3px rgba(0,0,0,.13);transition:transform .2s ease;pointer-events:none;}
.rs-forum[data-rs-theme="dark"] .rs-forum__theme-thumb {transform:translateX(40px);}
.rs-forum[data-rs-theme="light"] .rs-forum__theme-sun,.rs-forum[data-rs-theme="dark"] .rs-forum__theme-moon {color:var(--rs-text-primary);}
.rs-forum__theme-toggle:focus-visible {outline:3px solid var(--rs-border-focus,#2468B2);outline-offset:3px;}
@media (prefers-color-scheme:dark) {.rs-forum[data-rs-theme="auto"] .rs-forum__theme-thumb {transform:translateX(40px);}}
@media (prefers-reduced-motion:reduce) {.rs-forum__theme-thumb,.rs-forum__theme-track {transition:none;}}
.rs-forum[data-rs-theme="light"] a:not([class]) {color:var(--rs-link);}
.rs-forum[data-rs-theme="light"] .rs-forum__message a {color:var(--rs-link);}
.rs-forum[data-rs-theme="light"] .rs-forum__activity-unread {color:#fff;}
.rs-forum[data-rs-theme="light"] .rs-forum__link-dialog-error,
.rs-forum[data-rs-theme="light"] .rs-forum__removed-notice strong,
.rs-forum[data-rs-theme="light"] .rs-forum__thread-removed-title,
.rs-forum[data-rs-theme="light"] .rs-forum__topic-state--removed {color:#9C2734;}
.rs-forum[data-rs-theme="light"] .rs-forum__thread-removed {background:#FFF1F1;border-color:#D8A0A5;}
.rs-forum[data-rs-theme="light"] .rs-forum__editor-tool,
.rs-forum[data-rs-theme="light"] input,
.rs-forum[data-rs-theme="light"] textarea,
.rs-forum[data-rs-theme="light"] select {color:var(--rs-text-primary);}


/* Forum-only semantic exceptions: moderation and unread states are contextual,
   not new site-wide component tokens. See docs/FORUM_THEME_CSS_AUDIT.md. */
.rs-forum[data-rs-theme="light"] {
  --forum-danger-text:#9C2734;
  --forum-danger-border:#C4777E;
  --forum-danger-bg:#FFF1F1;
  --forum-unread-text:#08663E;
  --forum-unread-border:#168451;
  --forum-unread-bg:#E0F3E9;
}
.rs-forum[data-rs-theme="light"] .rs-forum__thread-unread,
.rs-forum[data-rs-theme="light"] .rs-forum__unread-count {color:var(--forum-unread-text);border-color:var(--forum-unread-text)}
.rs-forum[data-rs-theme="light"] .rs-forum__thread-unread:hover {background:var(--rs-surface-2)}
.rs-forum[data-rs-theme="light"] .rs-forum__post--removed,
.rs-forum[data-rs-theme="light"] .rs-forum__topic--removed {background:var(--forum-danger-bg);border-color:var(--forum-danger-border)}
.rs-forum[data-rs-theme="light"] .rs-forum__removed-notice,
.rs-forum[data-rs-theme="light"] .rs-forum__thread-removed,
.rs-forum[data-rs-theme="light"] .rs-forum__thread-permanent .rs-forum__confirmation-error {background:var(--forum-danger-bg);border-color:var(--forum-danger-border)}
.rs-forum[data-rs-theme="light"] .rs-forum__thread-permanent .rs-forum__confirmation-error,
.rs-forum[data-rs-theme="light"] .rs-forum__thread-removed-title,
.rs-forum[data-rs-theme="light"] .rs-forum__removed-notice strong {color:var(--forum-danger-text)}
.rs-forum[data-rs-theme="light"] .rs-forum__native-editor,
.rs-forum[data-rs-theme="light"] .rs-forum__visual-input,
.rs-forum[data-rs-theme="light"] .rs-forum__link-dialog-input,
.rs-forum[data-rs-theme="light"] .rs-forum__topic-subject,
.rs-forum[data-rs-theme="light"] .rs-forum__library-query,
.rs-forum[data-rs-theme="light"] .rs-forum__remove-form textarea,
.rs-forum[data-rs-theme="light"] .rs-forum__sort select {background:var(--rs-surface-1);color:var(--rs-text-primary);border-color:var(--rs-border-default)}
.rs-forum[data-rs-theme="light"] .rs-forum__category-description {background:var(--rs-surface-2);border-color:var(--rs-border-subtle)}
.rs-forum[data-rs-theme="light"] .rs-forum__editor-tool:hover,
.rs-forum[data-rs-theme="light"] .rs-forum__link-dialog-actions button:hover {background:var(--rs-surface-2)}
.rs-forum[data-rs-theme="light"] :is(input,textarea,select):not(.rs-forum__editor-body textarea):focus-visible {outline:3px solid var(--rs-border-focus);outline-offset:2px}
@media (prefers-reduced-motion:reduce) {
 .rs-forum[data-rs-theme] .rs-forum__theme-button {transition:none}
}

/* Before deferred JS starts, OS-light visitors receive the correct scoped palette. */
@media (prefers-color-scheme: light) {
.rs-forum[data-rs-theme="auto"] {
  --rs-bg-page:#F5F7FA; --rs-text:#202A39; --rs-action:#087F52; --rs-action-hover:#086D48; --rs-success:#087F52; --rs-danger:#9C2734; --rs-card-bg:#FFFFFF; --rs-card-bg-hover:#EDF1F6;
  --rs-card-border:#D8E0E9; --rs-card-border-hover:#9BAEC2;
  --rs-surface-1:#FFFFFF; --rs-surface-2:#EDF1F6; --rs-surface-3:#E4EBF3;
  --rs-text-primary:#202A39; --rs-text-secondary:#526176; --rs-text-muted:#526176;
  --rs-border-subtle:#D8E0E9; --rs-border-default:#C7D2DF; --rs-border-strong:#93A6BA;
  --rs-border-focus:#2468B2; --rs-link:#245D9E; --rs-info:#245D9E;
  --rs-glow-focus:0 0 0 3px rgba(36,104,178,.22);
  --forum-bg:#F5F7FA; --forum-hover:#EDF1F6; --rs-input-bg:#FFFFFF; --rs-surface:#FFFFFF; --rs-surface-raised:#EDF1F6;
  --rs-border:#D8E0E9; --rs-color-success:#087F52;
  --forum-panel:var(--rs-card-bg); --forum-panel-hover:var(--rs-card-bg-hover);
  --forum-border:var(--rs-card-border); --forum-text:var(--rs-text-primary);
  --forum-secondary:var(--rs-text-secondary); --forum-muted:var(--rs-text-muted);
  background:var(--rs-bg-page); color:var(--rs-text-primary);
}
.rs-forum[data-rs-theme="auto"] a:not([class]) {color:var(--rs-link);}
.rs-forum[data-rs-theme="auto"] .rs-forum__message a {color:var(--rs-link);}
.rs-forum[data-rs-theme="auto"] .rs-forum__activity-unread {color:#fff;}
.rs-forum[data-rs-theme="auto"] .rs-forum__link-dialog-error,
.rs-forum[data-rs-theme="auto"] .rs-forum__removed-notice strong,
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-removed-title,
.rs-forum[data-rs-theme="auto"] .rs-forum__topic-state--removed {color:#9C2734;}
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-removed {background:#FFF1F1;border-color:#D8A0A5;}
.rs-forum[data-rs-theme="auto"] .rs-forum__editor-tool,
.rs-forum[data-rs-theme="auto"] input,
.rs-forum[data-rs-theme="auto"] textarea,
.rs-forum[data-rs-theme="auto"] select {color:var(--rs-text-primary);}
.rs-forum[data-rs-theme="auto"] {
  --forum-danger-text:#9C2734;
  --forum-danger-border:#C4777E;
  --forum-danger-bg:#FFF1F1;
  --forum-unread-text:#08663E;
  --forum-unread-border:#168451;
  --forum-unread-bg:#E0F3E9;
}
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-unread,
.rs-forum[data-rs-theme="auto"] .rs-forum__unread-count {color:var(--forum-unread-text);border-color:var(--forum-unread-text)}
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-unread:hover {background:var(--rs-surface-2)}
.rs-forum[data-rs-theme="auto"] .rs-forum__post--removed,
.rs-forum[data-rs-theme="auto"] .rs-forum__topic--removed {background:var(--forum-danger-bg);border-color:var(--forum-danger-border)}
.rs-forum[data-rs-theme="auto"] .rs-forum__removed-notice,
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-removed,
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-permanent .rs-forum__confirmation-error {background:var(--forum-danger-bg);border-color:var(--forum-danger-border)}
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-permanent .rs-forum__confirmation-error,
.rs-forum[data-rs-theme="auto"] .rs-forum__thread-removed-title,
.rs-forum[data-rs-theme="auto"] .rs-forum__removed-notice strong {color:var(--forum-danger-text)}
.rs-forum[data-rs-theme="auto"] .rs-forum__native-editor,
.rs-forum[data-rs-theme="auto"] .rs-forum__visual-input,
.rs-forum[data-rs-theme="auto"] .rs-forum__link-dialog-input,
.rs-forum[data-rs-theme="auto"] .rs-forum__topic-subject,
.rs-forum[data-rs-theme="auto"] .rs-forum__library-query,
.rs-forum[data-rs-theme="auto"] .rs-forum__remove-form textarea,
.rs-forum[data-rs-theme="auto"] .rs-forum__sort select {background:var(--rs-surface-1);color:var(--rs-text-primary);border-color:var(--rs-border-default)}
.rs-forum[data-rs-theme="auto"] .rs-forum__category-description {background:var(--rs-surface-2);border-color:var(--rs-border-subtle)}
.rs-forum[data-rs-theme="auto"] .rs-forum__editor-tool:hover,
.rs-forum[data-rs-theme="auto"] .rs-forum__link-dialog-actions button:hover {background:var(--rs-surface-2)}
.rs-forum[data-rs-theme="auto"] :is(input,textarea,select):not(.rs-forum__editor-body textarea):focus-visible {outline:3px solid var(--rs-border-focus);outline-offset:2px}
}

/* Forum-only integration with the legacy page canvas.
   :has() matches only pages containing an explicitly light Forum v2 root.
   Keep the rest of the legacy site unchanged. */
/* Forum-only legacy shell text and links. The global body and anchor rules
   remain untouched. Keep Forum v2's own component/link styles authoritative. */
body:has(.rs-forum[data-rs-theme="light"]) > main#legacy {
  background: #F5F7FA;
  --bg: #F5F7FA;
  --text: #202A39;
  color: var(--rs-text-primary, #202A39);
  --rs-text-primary: #202A39;
  --rs-text-secondary: #526176;
  --rs-link: #245D9E;
}
body:has(.rs-forum[data-rs-theme="light"]) > main#legacy :where(a, .fake-link):not(.rs-forum :is(a, .fake-link)) {
  color: #000000;
}

/* Forum 60.0.53: legacy shell links must not override component states. */
body:has(.rs-forum[data-rs-theme="light"]) > main#legacy
  .rs-forum .rs-pagination__item[aria-current="page"] {
  color:var(--forum-pagination-current-text,#fff);
}
