/* Visitor appearance. Photographic heroes and earned cosmetics retain their own colours. */
html.dark { color-scheme:dark; --yj-ui-surface:#202020; --yj-ui-text:#eee7d9; --yj-ui-muted:#afb2b0; --yj-ui-border:#414748; --yj-ui-hover:#30383b; }
html.light { color-scheme:light; --p-color:#197d96; --yj-ui-surface:#fffdf8; --yj-ui-text:#293b42; --yj-ui-muted:#596d73; --yj-ui-border:#cbd5d5; --yj-ui-hover:#e6eff0; }
.yj-appearance { display:flex;align-items:center;justify-content:flex-end;gap:6px;margin-top:12px;font-size:12px;line-height:1.5; }
.yj-appearance[hidden] { display:none; }
.yj-appearance-label { color:var(--yj-ui-muted);margin-right:4px; }
.yj-appearance button { display:inline-flex;align-items:center;gap:6px;border:1px solid var(--yj-ui-border);border-radius:5px;padding:6px 10px;min-height:34px;background:transparent;color:var(--yj-ui-text);font:inherit;cursor:pointer; }
.yj-appearance button:hover { background:var(--yj-ui-hover); }
.yj-appearance button[aria-pressed=true] { background:#247d9c;border-color:#247d9c;color:#fff9e9; }
.yj-appearance button:focus-visible { outline:2px solid #259bb5;outline-offset:3px; }
@media(max-width:767px) { .yj-appearance { justify-content:center;flex-wrap:wrap; } .yj-appearance button { min-height:40px; } }

/* TinyMCE chrome follows the same choice; iframe content is themed separately. */
html .tox.tox-tinymce { border:1px solid var(--yj-ui-border);border-radius:5px; }
html .tox :is(.tox-menu,.tox-statusbar,.tox-menubar,.tox-toolbar,.tox-toolbar__overflow,.tox-toolbar__primary,.tox-toolbar-overlord,.tox-dialog,.tox-dialog__header,.tox-dialog__footer,.tox-listboxfield .tox-listbox--select,.tox-textarea,.tox-textfield,.tox-toolbar-textfield,.tox-selectfield select,.tox-edit-area__iframe) { background-color:var(--yj-ui-surface)!important;color:var(--yj-ui-text)!important; }
html .tox :is(.tox-collection__item,.tox-dialog__body,.tox-label,.tox-button--naked,.tox-dialog__title,.tox-tbtn,.tox-mbtn,.tox-statusbar a,.tox-statusbar__path-item,.tox-statusbar__wordcount,.tox-dialog__body-nav-item) { color:var(--yj-ui-text)!important; }
html .tox .tox-tbtn svg,html .tox .tox-icon svg { fill:var(--yj-ui-text); }
html .tox :is(.tox-tbtn:hover,.tox-tbtn--enabled,.tox-mbtn:hover,.tox-mbtn--active,.tox-collection__item--active,.tox-collection__item--enabled) { background:var(--yj-ui-hover)!important; }
html .tox :is(.tox-statusbar,.tox-dialog__footer,.tox-menubar+.tox-toolbar,.tox-toolbar__group) { border-color:var(--yj-ui-border)!important; }
html .tox .tox-tbtn--disabled { opacity:.45; }
html .tox.tox-tinymce-aux .tox-toolbar__overflow { background:var(--yj-ui-surface)!important; }

/* Warm paper, sea-blue links and deep harbour text form the light palette. */
html.light body { background:#f5f3ed;color:var(--yj-ui-text); }
html.light :is(h1,h2,h3,h4,h5,h6,.card-title,.forum-link,.widget-header,.widget-header-txt,.welcome-title,.lr-title) { color:#243b44; }
html.light :is(.card,.modal-content,.modal-body,.dropdown-menu,.popover,.popover-body,.swal2-popup,.ui-menu,.load-wrapper) { background:var(--yj-ui-surface);color:var(--yj-ui-text);border-color:var(--yj-ui-border); }
html.light :is(.card-header,.card-footer,.breadcrumb,.pagination .page-link,.input-group-text,.btn-secondary,.btn-light,.modal-footer,.spoiler-text,.spoiler-content) { background:#e9eeeb!important;color:var(--yj-ui-text)!important;border-color:var(--yj-ui-border); }
html.light :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),textarea,select,.form-control,.tokenfield) { background:#fffdf8!important;color:var(--yj-ui-text)!important;border-color:#aabcc0!important; }
html.light input:-webkit-autofill { -webkit-text-fill-color:#293b42!important;-webkit-box-shadow:0 0 0 1000px #fffdf8 inset!important; }
html.light :is(input,textarea)::placeholder { color:#63777c;opacity:1; }
html.light :is(table,.table,pre,.dropdown-item,.popover-body,.swal2-title,.swal2-html-container) { color:var(--yj-ui-text); }
html.light :is(table,td,th,.forum-col,.dropdown-divider,hr,.profile-about-box) { border-color:var(--yj-ui-border); }
html.light :is(.text-muted,.grey-link,.profile-about-title,.profile-about-value) { color:var(--yj-ui-muted)!important; }
html.light :is(.dropdown-item:hover,.dropdown-item:focus,.btn-secondary:hover,.page-link:hover) { background:var(--yj-ui-hover)!important;color:#243b44; }
html.light .page-item.active .page-link,html.light :is(.btn-theme,.btn-primary,.badge-theme,.modal-header) { color:#fff9e9!important; }
html.light :is(.btn-theme,.btn-primary) :is(i,span) { color:inherit; }
html.light .modal-header :is(h1,h2,h3,h4,h5,h6) { color:#fff9e9; }
html.light :is(.f-small,.f-large) { background:#e8eae3;color:var(--yj-ui-text);border-color:var(--yj-ui-border); }
html.light :is(.f-top-copy,.f-top-copy span,.footer-text-header) { color:#243b44; }
html.light :is(.f-bottom-copy,.f-link,.footer-link,.f-icons a) { color:var(--yj-ui-muted)!important; }
html.light .f-small .f-tc .f-link { color:var(--yj-ui-muted); }
html.light :is(.yj-site-header,.yj-mobile-menu,.yj-copy-dialog,.yj-no-script-nav) { background:#f5f3ed;color:var(--yj-ui-text);border-color:var(--yj-ui-border); }
html.light .yj-site-header--home { background:#f5f3edf2; }
html.light :is(.yj-primary-nav a,.yj-primary-nav summary,.yj-mobile-menu li>a,.yj-mobile-menu summary,.yj-no-script-nav a,.yj-copy-dialog h2) { color:#243b44; }
html.light :is(.yj-icon-button,.yj-action-button,.yj-brand) { color:#243b44;border-color:#b9c7c8; }
html.light :is(.yj-nav-group>ul,.yj-account-menu,.yj-copy-notice) { background:var(--yj-ui-surface);color:var(--yj-ui-text);border-color:var(--yj-ui-border); }
html.light .yj-account-menu :is(.dropdown-item,.pms_dropdown>span,.alerts_dropdown>span),html.light .yj-motion-preference { color:var(--yj-ui-text); }
html.light :is(.yj-primary-nav [aria-current=page],.yj-mobile-menu [aria-current=page]) { color:#fff9e9; }
html.light .yj-primary-nav :is(a:hover,summary:hover),html.light .yj-account-menu .dropdown-item:hover { background:var(--yj-ui-hover);color:#126e83; }
html.light :is(.yj-account-group+.yj-account-group,.yj-mobile-discord) { border-color:var(--yj-ui-border); }
html.light .yj-page-banner :is(h1,h2) { color:#fff2d3; }

html.light .yj-forums :is(.subforum-description,.yj-forum-counts,.yj-forum-latest,.widget-card .card-body) { color:var(--yj-ui-muted); }
html.light .yj-forums .yj-forum-counts b { color:var(--yj-ui-text); }
html.light .yj-forums :is(.yj-subforum-heading,.yj-subforum-toggle,.yj-subforums summary,.yj-subforum-tree a) { color:#176f83; }
html.light .yj-forums .yj-subforum-tree { border-color:#94b8c0; }
html.light .yj-forums :is(.card,hr) { border-color:var(--yj-ui-border); }
html.light .yj-forums .yj-section-hero h2 { color:#fff2d3; }
html.light .yj-forums .yj-section-hero p { color:#e1e4de; }

html.light .yj-home { --yj-cream:#243b44;--yj-blue:#14758b;--yj-surface:#fffdf8;--yj-muted:#596d73; }
html.light .yj-home :is(.yj-slide-copy p,.yj-community-intro>p,.yj-community-copy p,.yj-faq-intro p,.yj-faq-answer,.yj-custom p,.yj-archive-copy p,.yj-topic-main>a) { color:var(--yj-ui-text); }
html.light .yj-homepage .yj-topic-panel-heading { background:#e3eeed;border-color:#a6c5ca; }
html.light .yj-home :is(.yj-topics li,.yj-carousel-controls,.yj-community-row+.yj-community-row,.yj-faq details+details,.yj-arrow-controls button) { border-color:var(--yj-ui-border); }
html.light .yj-carousel-progress,html.light .yj-dots button span { background:#c3d2d3; }
html.light .yj-dots button[aria-pressed=true] span { background:#14758b; }

html.light .kb { --kb-cream:#243b44;--kb-blue:#126e83;--kb-button:#197d96;--kb-surface:#fffdf8;--kb-border:#cbd5d5;color:var(--yj-ui-text); }
html.light .kb :is(.kb-muted,.kb-facts dt,blockquote) { color:var(--yj-ui-muted); }
html.light .kb :is(.kb-subnav a,.kb-tabs a,.kb-tabs button,.kb-status) { color:var(--yj-ui-text); }
html.light .kb :is(.kb-button,.kb-category-links a,.kb-prose pre,.kb-diff section) { background:#e6eeed;color:var(--yj-ui-text)!important;border-color:#aabcc0; }
html.light .kb :is(.kb-primary,.kb-tabs .active,.kb-tabs button.active,.kb-pagination a[aria-current=page]) { background:#197d96;color:#fff9e9!important; }
html.light .kb .kb-note { background:#e1eef0; }
html.light .kb .kb-error { background:#fae5de;color:#7b3029; }
html.light .kb :is(.kb-prose code,.kb-diff pre) { color:var(--yj-ui-text); }

/* Community surfaces share one palette across profiles, characters and rewards. */
html.light {
 --cm-text:var(--yj-ui-text);--cm-heading:#243b44;--cm-link:#126e83;--cm-muted:var(--yj-ui-muted);
 --cm-panel:var(--yj-ui-surface);--cm-card:var(--yj-ui-surface);--cm-field:var(--yj-ui-surface);--cm-field-border:#aabcc0;--cm-border:var(--yj-ui-border);
 --cm-note:#e1eef0;--cm-note-border:#93b6bd;--cm-badge-bg:#e1eef0;--cm-badge-border:#94b8c0;--cm-badge-mark:#90601c;
 --cm-accent:#176f83;--cm-title-color:#805717;--cm-recognition-text:#70521d;--cm-recognition-bg:#f6edd6;--cm-recognition-border:#c6af76;
 --cm-placeholder-bg:#e1eef0;--cm-placeholder-text:#176f83;--cm-track:#d2dfe0;--cm-focus:#197d96;
 --cm-tooltip-bg:#fffdf8;--cm-tooltip-text:#293b42;--cm-tooltip-border:#94b8c0;--cm-tooltip-shadow:#18383d29;
}

/* Override the saved legacy cream-only title styles in the light palette. */
html.light :is(.welcome-title,.header-theme,.header-theme .theme-text,.widget-header-txt,.post-card-title .theme-text,.cf-full-post-title.theme-text) { color:#243b44!important; }
html.light .yj-footer-links a { color:#425d66; }
html.light .yj-forums .widget-header .number { color:#425d66; }
html.light .yj-forums .yj-section-hero :is(.header-theme,.theme-text) { color:#fff2d3!important; }

html.light .page-item.active .page-link { background:#197d96!important;color:#fff9e9!important; }

/* Native member details, account navigation and activity use the same light surfaces. */
html.light :is(.user-nav,.profile-header-bottom,.profile-bg-image-change,.profile-about-box) { background:var(--yj-ui-surface);color:var(--yj-ui-text);border-color:var(--yj-ui-border); }
html.light .user-nav { border:1px solid var(--yj-ui-border); }
html.light .user-nav-link { color:var(--yj-ui-text); }
html.light .user-nav-link:is(:hover,.active) { background:var(--yj-ui-hover);color:#126e83; }
html.light :is(.profile-about-box-new .text div,.profile-about-box .about-title,.profile-about-heading) { color:#243b44; }
html.light .profile-about-box-new .icon { color:#197d96; }
.profile-about-heading { font-size:1.2rem;font-weight:500;margin-bottom:.75rem; }
html.light .profile-tabs-new .profile-nav-link { color:var(--yj-ui-muted); }
html.light .profile-tabs-new .profile-nav-link.active { color:#126e83!important;border-bottom-color:#197d96; }
html.light :is(.profile-btn,.profile-btn i,.nav-tabs .nav-link) { color:var(--yj-ui-text)!important; }
html.light .nav-tabs .nav-link.active { background:var(--yj-ui-hover);color:#126e83!important; }
html.light :is(.forum-left-col,.forum-right-top,.post-author-mobile,.signature,.timeline .separator) { border-color:var(--yj-ui-border); }
html.light :is(.timeline .line,.timeline .line:before,.timeline .line:after) { background:var(--yj-ui-border); }
html.light .more-posts { color:#243b44!important; }
html.light .members-card .pagination { background:#e9eeeb; }
html.light .members-card .pagination a { color:#425d66!important; }
html.light :is(.kb-diff section,.kb-comment,.kb-toc,.kb details,.kb-prose td,.kb-prose th) { border-color:var(--yj-ui-border); }
html.light .kb-status { border-color:#a5b9be; }
html.light .kb-diff del { background:#f7ddd5;color:#7d332b; }
html.light .kb-diff ins { background:#d9eddf;color:#25553b; }

html.light input:is([type=checkbox],[type=radio]) { accent-color:#197d96; }

/* Legacy article, authentication and feedback panels are not Bootstrap cards. */
html.light :is(.cf-full-post-body,.post-card-large,.post-card-medium,.post-card-small,.rules-menu,.store-player,.login-menu,.register-menu,.cobalt-update-box) { background:var(--yj-ui-surface);color:var(--yj-ui-text);border-color:var(--yj-ui-border); }
html.light :is(.login-menu .card,.register-menu .card,.oauth-divider .or,span.twitter-typeahead .tt-menu) { background:var(--yj-ui-surface)!important;color:var(--yj-ui-text)!important; }
html.light :is(.latest-news-name,.cobalt-update-box .top-row) { color:#243b44; }
html.light :is(.latest-news-date,.latest-news-readtime,.cf-full-post-info,.post-card-footer,.rules-menu-link span) { color:var(--yj-ui-muted); }
html.light :is(.cf-full-post .readtime,.post-list .readtime) { background:var(--yj-ui-hover);color:var(--yj-ui-muted); }
html.light :is(.tt-suggestion,.oauth-divider .or) { color:var(--yj-ui-text)!important; }
html.light .tt-suggestion:hover,html.light .tt-suggestion.tt-cursor { background:var(--yj-ui-hover)!important; }
html.light .reply-line { background:var(--yj-ui-border); }
html.light .alert { background:#e1eef0!important;color:#245463!important; }
html.light .alert-danger { background:#f8e8e3!important;color:#7d332b!important; }
html.light .alert-success { background:#e5f0e6!important;color:#28573a!important; }
html.light .alert-warning { background:#f8efd8!important;color:#70521d!important; }
html.light .alert .close { color:inherit!important;text-shadow:none; }
html.light .cc-window.cc-floating { background:var(--yj-ui-surface)!important;color:var(--yj-ui-text)!important;box-shadow:0 4px 20px #18383d29; }
html.light .cc-window :is(.cc-link,.cc-highlight .cc-btn:first-child) { color:#126e83!important; }
html.light .cc-window .cc-highlight .cc-btn.cc-allow { color:#fff9e9!important; }
html.light .cc-revoke.cc-bottom.cc-right { background:#e8eae3!important;color:#425d66!important; }

/* Compact branding and a closely grouped community/legal link column. */
.yj-footer { padding:24px 0;border-top:1px solid #ffffff0d; }
.yj-footer .yj-footer-top,.yj-footer .yj-footer-bottom { display:flex;justify-content:space-between;gap:16px 32px; }
.yj-footer .yj-footer-top { align-items:center; }
.yj-footer .yj-footer-brand { display:flex;align-items:center;gap:16px;min-width:0; }
.yj-footer .yj-footer-logo { flex:0 0 52px;display:block; }
.yj-footer .yj-footer-logo img { display:block;width:52px;height:52px;object-fit:contain; }
.yj-footer .yj-footer-bottom { align-items:center;margin-top:0; }
.yj-footer .yj-footer-bottom:has(.f-icons) { margin-top:12px; }
.yj-footer .yj-footer-nav { display:flex;flex-direction:column;align-items:flex-end;gap:6px; }
.yj-footer .f-copyright { min-width:0; }
.yj-footer .f-top-copy,.yj-footer .f-top-copy span { color:var(--yj-ui-text);font-size:14px;font-weight:600;line-height:1.6;margin:0; }
.yj-footer .f-bottom-copy { font-size:13px;line-height:1.6;margin-top:4px; }
.yj-footer .yj-footer-links { justify-content:flex-end;gap:8px 24px;margin:0;flex-shrink:0; }
.yj-footer .yj-footer-links a { font-size:14px;line-height:1.6; }
.yj-footer .yj-footer-legal { display:flex;flex-wrap:wrap;align-items:center;gap:4px 24px;margin-left:auto; }
.yj-footer .yj-footer-legal a { color:var(--yj-ui-muted);font-size:13px;line-height:1.6;font-weight:400;margin:0;padding:4px 0; }
.yj-footer .yj-footer-tools { display:flex;align-items:center;justify-content:flex-start;gap:16px; }
.yj-footer .f-icons { display:flex;align-items:center;gap:8px;margin:0; }
.yj-footer .f-icons a { display:inline-flex;align-items:center;justify-content:center;min-width:28px;min-height:32px; }
.yj-footer .f-icons i { margin:0;padding:0;background:transparent;font-size:14px;color:var(--yj-ui-muted); }
.yj-footer .f-credit-img { height:32px; }
.yj-footer :is(.yj-footer-links,.yj-footer-legal) a:hover { color:var(--cm-link,#2cacca)!important; }
.yj-footer a:focus-visible { outline:2px solid var(--cm-link,#2cacca);outline-offset:4px;border-radius:2px; }
html.light .yj-footer { border-top-color:#243b441a; }
@media(max-width:767px) {
 .yj-footer .yj-footer-top,.yj-footer .yj-footer-bottom { align-items:flex-start;flex-direction:column;gap:12px; }
 .yj-footer .yj-footer-bottom { margin-top:0; }
 .yj-footer .yj-footer-nav { align-items:flex-start;gap:4px; }
 .yj-footer .yj-footer-links { justify-content:flex-start;gap:8px 24px;flex-wrap:wrap; }
 .yj-footer .yj-footer-links a { min-height:32px;display:inline-flex;align-items:center; }
 .yj-footer .yj-footer-tools { margin-left:0;justify-content:flex-start;flex-wrap:wrap;gap:12px; }
 .yj-footer .yj-footer-legal { gap:4px 20px;margin-left:0; }
}

/* Visitor appearance lives below the motion preference in the account menu. */
.yj-account-appearance .yj-appearance { justify-content:flex-start;gap:6px;margin:0;padding:8px 16px;flex-wrap:wrap; }
.yj-account-appearance .yj-appearance-label { flex-basis:100%;margin:0 0 2px; }
.yj-account-appearance .yj-appearance button { min-height:36px; }
@media(max-width:767px) { .yj-account-appearance .yj-appearance button { min-height:40px; } }
