/* JW Quest V36.49 — Quests, Meetings, and persistent bottom bar share appearance + avatar palette. */
/* Theme state is explicit: respect the user's preference even when device appearance differs. */
html[data-jwq-effective-theme="light"]:has(.game),html[data-jwq-effective-theme="light"]:has(#articleList){
 color-scheme:light;
 --bg:#f7f9fc!important;
 --card:#fff!important;
 --surface:#fff!important;
 --text:#223449!important;
 --muted:#617287!important;
 --line:#dce4ed!important;
 --border:#dce4ed!important;
 --soft:#f0f4f8!important;
 --blue:var(--jwq-character-accent,#426b92)!important;
 --shadow:0 8px 24px rgba(31,57,89,.075)!important;
}
html[data-jwq-effective-theme="dark"]:has(.game),html[data-jwq-effective-theme="dark"]:has(#articleList){
 color-scheme:dark;
 --bg:#0d1826!important;
 --card:#19283b!important;
 --surface:#19283b!important;
 --text:#eef4fb!important;
 --muted:#afbed0!important;
 --line:#35475d!important;
 --border:#35475d!important;
 --soft:#203248!important;
 --blue:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 70%,white)!important;
 --blue2:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 65%,white)!important;
 --shadow:0 10px 26px rgba(0,0,0,.23)!important;
 --meet-bg:var(--bg)!important;
 --meet-card:var(--card)!important;
 --meet-fg:var(--text)!important;
 --meet-border:var(--line)!important;
 --meet-muted:var(--muted)!important;
 --meet-accent:var(--blue)!important;
}
/* Bottom navigation: no fixed navy / fixed red or teal. Selected character drives every state. */
html[data-jwq-effective-theme] .bottomnav.jwq-unified-bottomnav{
 background:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 10%,#fff)!important;
 color:var(--text)!important;
 border-top:1px solid color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 27%,var(--line))!important;
 box-shadow:0 -5px 22px rgba(36,55,72,.09)!important;
}
html[data-jwq-effective-theme] .bottomnav.jwq-unified-bottomnav .navitem{
 color:var(--muted)!important;
}
html[data-jwq-effective-theme] .bottomnav.jwq-unified-bottomnav .navitem.active{
 color:var(--jwq-character-accent,#426b92)!important;
}
html[data-jwq-effective-theme] .bottomnav.jwq-unified-bottomnav .navitem.active b{
 background:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 14%,transparent)!important;
 border-radius:12px!important;
}
html[data-jwq-effective-theme="dark"] .bottomnav.jwq-unified-bottomnav{
 background:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 12%,#121e2e)!important;
 border-top-color:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 28%,#34465d)!important;
 box-shadow:0 -5px 25px rgba(0,0,0,.26)!important;
}
html[data-jwq-effective-theme="dark"] .bottomnav.jwq-unified-bottomnav .navitem{
 color:#b4c2d2!important;
}
html[data-jwq-effective-theme="dark"] .bottomnav.jwq-unified-bottomnav .navitem.active{
 color:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 75%,white)!important;
}
html[data-jwq-effective-theme="dark"] .bottomnav.jwq-unified-bottomnav .navitem.active b{
 background:color-mix(in srgb,var(--jwq-character-tone,#86a8cc) 18%,transparent)!important;
}
html[data-jwq-effective-theme] .bottomnav.jwq-unified-bottomnav .jwq-nav-new{
 background:var(--jwq-character-accent,#426b92)!important;color:#fff!important;
}
/* Quests: all legacy white/pastel cards inherit a proper dark backplate. */
html[data-jwq-effective-theme="dark"] body:has(.game) :is(.app,.top,.hero){
 background-color:var(--bg)!important;color:var(--text)!important;
}
html[data-jwq-effective-theme="dark"] body:has(.game) :is(.welcome,.quote){
 background:linear-gradient(142deg,color-mix(in srgb,var(--jwq-character-tone) 11%,#19283b),#19283b 87%)!important;
 color:var(--text)!important;border-color:var(--line)!important;
}
html[data-jwq-effective-theme="dark"] body:has(.game) .game{
 background:linear-gradient(158deg,color-mix(in srgb,var(--jwq-character-tone) 12%,#1b2b40),#152335)!important;
 border-color:var(--line)!important;color:var(--text)!important;
 box-shadow:0 7px 22px rgba(0,0,0,.14)!important;
}
html[data-jwq-effective-theme="dark"] body:has(.game) .game.mint{background:linear-gradient(155deg,#1c3536,#172639)!important}
html[data-jwq-effective-theme="dark"] body:has(.game) .game.lav{background:linear-gradient(155deg,#2c2642,#182639)!important}
html[data-jwq-effective-theme="dark"] body:has(.game) .game.warm{background:linear-gradient(155deg,#352e27,#1a2637)!important}
html[data-jwq-effective-theme="dark"] body:has(.game) .game.teal{background:linear-gradient(155deg,#1c3540,#162639)!important}
html[data-jwq-effective-theme="dark"] body:has(.game) :is(.game h4,.welcome h2,.sectionhead h3,.quote p){color:var(--text)!important}
html[data-jwq-effective-theme="dark"] body:has(.game) :is(.game p,.welcome p){color:var(--muted)!important}
html[data-jwq-effective-theme="dark"] body:has(.game) .game .ico{
 background:color-mix(in srgb,var(--jwq-character-tone) 15%,#223750)!important;
 color:var(--text)!important;
}
html[data-jwq-effective-theme="dark"] body:has(.game) :is(.game .action,.quote small,.quote span){color:var(--blue)!important}
html[data-jwq-effective-theme="dark"] body:has(.game) .jwq-reading-feature{
 background:linear-gradient(140deg,color-mix(in srgb,var(--jwq-character-tone) 13%,#18293a),#162536)!important;
 color:var(--text)!important;border-color:var(--line)!important;
}
/* Meetings: neutral dark surfaces, matching typography, soft accent, no glaring light cards. */
html[data-jwq-effective-theme="dark"] body:has(#articleList){background:var(--bg)!important;color:var(--text)!important}
html[data-jwq-effective-theme="dark"] body:has(#articleList) .wrap{background-color:var(--bg)!important;color:var(--text)!important}
html[data-jwq-effective-theme="dark"] body:has(#articleList) :is(.article,.qa,.finish-card,.study-note,.back,.opt){
 background:color-mix(in srgb,var(--jwq-character-tone) 5%,var(--card))!important;
 color:var(--text)!important;
 border-color:var(--line)!important;
 box-shadow:none!important;
}
html[data-jwq-effective-theme="dark"] body:has(#articleList) :is(.article.active,.article:focus-visible){
 border-color:var(--blue)!important;
}
html[data-jwq-effective-theme="dark"] body:has(#articleList) :is(.date,.sub,.hint,.english-study-label){color:var(--muted)!important}
html[data-jwq-effective-theme="dark"] body:has(#articleList) .study-reminder{
 background:color-mix(in srgb,var(--jwq-character-tone) 8%,var(--card))!important;
 color:var(--text)!important;
 border:1px solid var(--line)!important;border-left:3px solid var(--blue)!important;
}
html[data-jwq-effective-theme="dark"] body:has(#articleList) .meeting-question-meta{
 background:color-mix(in srgb,var(--jwq-character-tone) 9%,#1b2c3e)!important;
 color:var(--muted)!important;
 border-color:var(--paragraph-accent)!important;
}
html[data-jwq-effective-theme="dark"] body:has(#articleList) .meeting-question-meta b{color:var(--text)!important}
html[data-jwq-effective-theme="dark"] body:has(#articleList) :is(.tag.nextweek,.qa .answer){
 background:var(--soft)!important;color:var(--text)!important;
}
html[data-jwq-effective-theme="dark"] body:has(#articleList) :is(.page-back,.study-back,.source,.meet-source-arrow){color:var(--blue)!important}
/* Light mode: no legacy hardcoded dark backplates after a user forces light mode. */
html[data-jwq-effective-theme="light"] body:has(#articleList) :is(.article,.qa,.finish-card,.study-note,.opt){
 background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important;
}
html[data-jwq-effective-theme="light"] body:has(.game) .game:not(.blue):not(.mint):not(.lav):not(.warm):not(.teal){background:var(--card)!important}
@media(prefers-reduced-motion:reduce){html[data-jwq-effective-theme] .bottomnav.jwq-unified-bottomnav{scroll-behavior:auto!important}}

/* Correct/incorrect answer feedback remains distinct from dark neutral cards. */
html[data-jwq-effective-theme="dark"] body:has(#articleList) .opt.correct{
 background:color-mix(in srgb,#378560 22%,#172a38)!important;
 border:2px solid #69c99a!important;color:#effaf5!important;
}
html[data-jwq-effective-theme="dark"] body:has(#articleList) .opt.wrong{
 background:color-mix(in srgb,#aa5353 22%,#172a38)!important;
 border:2px solid #e78f8f!important;color:#fff2f2!important;
}
html[data-jwq-effective-theme="light"] body:has(#articleList) .opt.correct{
 background:color-mix(in srgb,#36845b 13%,#fff)!important;border-color:#36845b!important;
}
html[data-jwq-effective-theme="light"] body:has(#articleList) .opt.wrong{
 background:color-mix(in srgb,#b45d5d 12%,#fff)!important;border-color:#b45d5d!important;
}
