/* Only the menu controls affect light mode. Its existing palette stays intact. */
.theme-menu-controls { display: flex; justify-content: center; gap: 6px; padding: 10px 16px; }
.bcs-quick-menu { max-height: calc(100dvh - 130px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.bcs-quick-menu > * { flex-shrink: 0; }
.theme-menu-controls button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid transparent; border-radius: 12px; color: #64748b; background: transparent; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.theme-menu-controls button:hover { color: #1c2430; background: #f1ece2; }
.theme-menu-controls button[aria-pressed="true"] { color: #087d83; background: #e0f1ec; border-color: #a6d9d1; }
.theme-menu-controls button:focus-visible { outline: 2px solid #0891b2; outline-offset: 3px; }

/* Buttler AI Studios reference: #05070d canvas, #0d111b panels,
   electric cyan #37f6ff and lavender #b89cff, with warm peach highlights. */
:root[data-theme="dark"] { --bcs-surface: #0d111b; --bcs-raised: #171e2e; --bcs-border: #303b53; --bcs-text: #eef1fb; --bcs-muted: #aab5d0; --bcs-cyan: #37f6ff; --bcs-violet: #b89cff; color: var(--bcs-text); background: #05070d; }
:root[data-theme="dark"] body, :root[data-theme="dark"] .animated-bg { background: #05070d; color: var(--bcs-text); }
:root[data-theme="dark"] .animated-bg { background: radial-gradient(ellipse at 8% 0%, #0b1d27 0, transparent 45%), radial-gradient(ellipse at 95% 90%, #191329 0, transparent 48%), #05070d; background-attachment: fixed; }
:root[data-theme="dark"] .bg-aurora::before { background: radial-gradient(circle, rgb(55 246 255 / 7%), transparent 62%); }
:root[data-theme="dark"] .bg-aurora::after { background: radial-gradient(circle, rgb(184 156 255 / 9%), transparent 64%); }
:root[data-theme="dark"] .glass-panel { background: rgb(13 17 27 / 94%); border-color: var(--bcs-border); box-shadow: 0 12px 32px rgb(0 0 0 / 30%); }
:root[data-theme="dark"] :is(.bg-white, .bg-slate-50, .bg-slate-100) { background-color: var(--bcs-surface); }
:root[data-theme="dark"] :is([class~="bg-white/30"], [class~="bg-white/40"], [class~="bg-white/50"], [class~="bg-white/60"], [class~="bg-white/70"], [class~="bg-white/80"], [class~="bg-white/85"]) { background-color: rgb(23 30 46 / 92%); }
:root[data-theme="dark"] :is([class~="bg-white/10"], [class~="bg-white/20"]) { background-color: rgb(238 241 251 / 9%); }
:root[data-theme="dark"] [class~="bg-[#FFFDF6]"] { background-color: #101622; }
:root[data-theme="dark"] :is(.text-med-dark, .text-slate-800, .text-slate-700, .text-slate-600) { color: var(--bcs-text); }
:root[data-theme="dark"] :is(.text-slate-500, .text-slate-400, .text-slate-300, .infographic-label) { color: var(--bcs-muted); }
:root[data-theme="dark"] .text-med-cyan { color: var(--bcs-cyan); }
:root[data-theme="dark"] .text-med-blue { color: var(--bcs-violet); }
:root[data-theme="dark"] :is(.border-med-dark, .border-white, .border-slate-100, .border-slate-200, .border-slate-300, [class~="border-white/50"], [class~="border-white/80"], [class~="border-med-dark/20"]) { border-color: var(--bcs-border); }
:root[data-theme="dark"] :is(.bg-med-dark, [class~="bg-med-dark/80"]) { background-color: #202a3e; }
:root[data-theme="dark"] .bg-med-cyan { background-color: #106773; }
:root[data-theme="dark"] .from-med-cyan { --tw-gradient-from: #106773 var(--tw-gradient-from-position); --tw-gradient-to: rgb(16 103 115 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
:root[data-theme="dark"] .via-med-blue { --tw-gradient-to: rgb(111 66 183 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), #6f42b7 var(--tw-gradient-via-position), var(--tw-gradient-to); }
:root[data-theme="dark"] .to-med-blue { --tw-gradient-to: #6f42b7 var(--tw-gradient-to-position); }
:root[data-theme="dark"] :is([class~="hover:bg-white"], [class~="hover:bg-white/70"], [class~="hover:bg-slate-50"], [class~="hover:bg-slate-100"], [class~="hover:bg-slate-200"], [class~="hover:bg-black/5"]):hover { background-color: #232d42; }
:root[data-theme="dark"] [class~="hover:text-med-dark"]:hover { color: #fff; }
:root[data-theme="dark"] [class~="hover:text-med-cyan"]:hover { color: var(--bcs-cyan); }
:root[data-theme="dark"] :is([class~="placeholder:text-slate-300"], [class~="placeholder:text-slate-400"])::placeholder { color: #91a1c3; }
:root[data-theme="dark"] :is(input, textarea, select) { color-scheme: dark; accent-color: var(--bcs-violet); }
:root[data-theme="dark"] .card-logo-subtitle { color: #d4d9eb; }
:root[data-theme="dark"] .card-logo-word { background-image: linear-gradient(100deg, #37f6ff 0%, #b89cff 38%, #ffbf7e 72%, #37f6ff 100%); }
:root[data-theme="dark"] .text-gradient { background-image: linear-gradient(to right, #37f6ff, #b89cff, #ffbf7e); }
:root[data-theme="dark"] .card-logo-mark rect { stroke: #b5bedc; }
:root[data-theme="dark"] .welcome-art { background: radial-gradient(ellipse at 15% 10%, rgb(55 246 255 / 12%), transparent 60%), radial-gradient(ellipse at 90% 90%, rgb(184 156 255 / 16%), transparent 65%), #0d111b; }
:root[data-theme="dark"] .welcome-badge { background: #171e2e; color: #c0c7e1; border-color: #303b53; }
:root[data-theme="dark"] .manga-panel { box-shadow: 7px 7px 0 rgb(0 0 0 / 65%); }
:root[data-theme="dark"] .manga-auction { box-shadow: 7px 7px 0 rgb(255 191 126 / 28%); }
:root[data-theme="dark"] .manga-featured { box-shadow: 7px 7px 0 rgb(184 156 255 / 30%); }
:root[data-theme="dark"] .manga-featured-auction { box-shadow: 7px 7px 0 rgb(55 246 255 / 25%); }
:root[data-theme="dark"] .header-rail-progress { background: rgb(212 217 235 / 24%); }
:root[data-theme="dark"] .header-rail-progress > span { background: linear-gradient(90deg, #b89cff, #37f6ff); }
:root[data-theme="dark"] .header-rail-viewport:focus-visible { outline-color: #37f6ff; }
:root[data-theme="dark"] .theme-menu-controls button { color: #b5bedc; }
:root[data-theme="dark"] .theme-menu-controls button:hover { color: #fff; background: #232d42; }
:root[data-theme="dark"] .theme-menu-controls button[aria-pressed="true"] { color: #37f6ff; background: #122f3b; border-color: #30737e; }
:root[data-theme="dark"] .theme-menu-controls button:focus-visible { outline-color: #37f6ff; }

/* Stream chat is lazy-loaded; higher specificity also wins after its CSS arrives. */
:root[data-theme="dark"] .str-chat { --str-chat__background-color: #0d111b; --str-chat__secondary-background-color: #171e2e; --str-chat__primary-color: #106773; --str-chat__text-color: #eef1fb; --str-chat__text-low-emphasis-color: #aab5d0; --str-chat__border-color: #303b53; --str-chat__message-bubble-background-color: #171e2e; }
:root[data-theme="dark"] :is(.str-chat__list, .str-chat__main-panel, .str-chat__message-input, .str-chat__message-composer) { background-color: #0d111b; color: #eef1fb; }
:root[data-theme="dark"] .str-chat__message--other .str-chat__message-bubble { background-color: #171e2e !important; }
:root[data-theme="dark"] .str-chat__message--other :is(.str-chat__message-text, .str-chat__message-text p, .str-chat__message-text-inner) { color: #eef1fb !important; }
:root[data-theme="dark"] .str-chat__message--me .str-chat__message-bubble { background-color: #106773 !important; }
:root[data-theme="dark"] .str-chat__message--system .str-chat__message--system__text { background: #122f3b; color: #b7f6ff; border-color: #30737e; }
:root[data-theme="dark"] .str-chat__message--system .str-chat__message--system__text p { color: #b7f6ff; }

/* The same preference carries into public privacy and terms pages. */
:root[data-theme="dark"] .paper { background: #0d111b; border-color: #303b53; box-shadow: 6px 6px 0 #000; }
:root[data-theme="dark"] :is(.brand, .back) { color: #eef1fb; }
:root[data-theme="dark"] :is(.intro, .eyebrow, .updated, .site-footer) { color: #aab5d0; }
:root[data-theme="dark"] :is(.site-nav a, .paper a, .site-footer a) { color: #b89cff; }
:root[data-theme="dark"] :is(.site-nav a, .paper a, .site-footer a):hover { color: #37f6ff; }
:root[data-theme="dark"] .note { background: #122f3b; border-color: #37f6ff; }
:root[data-theme="dark"] :is(.back, .skip) { background: #171e2e; border-color: #303b53; }
@media (prefers-reduced-motion: reduce) { .theme-menu-controls button { transition: none; } }
