/* V36.16 user-selected color palettes and scalable typography */
.jwq-theme-controls{display:grid;gap:10px;margin:10px 0 18px}.jwq-theme-controls .jwq-palette-setting{display:flex;align-items:center;justify-content:space-between}.jwq-font-panel{padding:15px!important;display:grid;gap:9px}.jwq-font-panel label{display:flex;justify-content:space-between;gap:10px;align-items:center}.jwq-font-panel input[type=range]{display:block;width:100%;accent-color:var(--blue,#4382ba);min-height:27px}.jwq-font-ticks{display:flex;justify-content:space-between;font-size:11px;color:var(--muted,#64748b)}.jwq-font-panel small{font-size:12px;color:var(--muted,#64748b)}.jwq-reset-btn{padding:10px;border-radius:10px;background:var(--soft,#f4f5f7);color:var(--text,#263544);border:1px solid var(--line,#dde2e9);font-weight:600}.jwq-theme-preview{display:flex;align-items:center;gap:12px;min-height:55px;padding:12px;border-radius:12px;background:var(--card,#fff);color:var(--text,#263544);border:1px solid var(--line,#ddd)}.jwq-preview-dot{height:17px;width:17px;border-radius:50%;background:var(--blue,#4382ba)}.jwq-preview-line{margin-left:auto;font-size:14px;color:var(--muted,#667)}
/* Each palette has distinct light/dark tokens. Default JW Quest uses all inherited styling. */
html[data-jwq-palette="sepia"][data-jwq-palette-mode="light"]{--bg:#f4ebdc!important;--card:#fff8ed!important;--text:#493726!important;--muted:#7d6650!important;--blue:#936340!important;--blue2:#ad8055!important;--line:#dfcbb0!important;--soft:#eee0ca!important;--danger:#ac574f!important;--shadow:0 10px 26px rgba(89,57,26,.12)!important;}
html[data-jwq-palette="sepia"][data-jwq-palette-mode="dark"]{--bg:#211914!important;--card:#30251f!important;--text:#f0dcc1!important;--muted:#bca48d!important;--blue:#d4a06d!important;--blue2:#ecc091!important;--line:#513e30!important;--soft:#3b2e25!important;--danger:#ed8d83!important;--shadow:0 12px 30px rgba(0,0,0,.35)!important;}
html[data-jwq-palette="stone"][data-jwq-palette-mode="light"]{--bg:#efeee9!important;--card:#faf9f5!important;--text:#393d3e!important;--muted:#73746e!important;--blue:#697b7b!important;--blue2:#8b9490!important;--line:#d7d4ca!important;--soft:#e7e4dc!important;--danger:#ab625c!important;--shadow:0 10px 26px rgba(60,60,60,.09)!important;}
html[data-jwq-palette="stone"][data-jwq-palette-mode="dark"]{--bg:#202425!important;--card:#2d3131!important;--text:#edede7!important;--muted:#b7b9b0!important;--blue:#b2bcb4!important;--blue2:#cad0c6!important;--line:#424745!important;--soft:#353b39!important;--danger:#ed8d83!important;--shadow:0 12px 30px rgba(0,0,0,.34)!important;}
html[data-jwq-palette="bible-era"][data-jwq-palette-mode="light"]{--bg:#f3e9d3!important;--card:#fcf5e5!important;--text:#4f422d!important;--muted:#82735d!important;--blue:#897445!important;--blue2:#a69158!important;--line:#d9c7a6!important;--soft:#ece1ca!important;--danger:#a76253!important;--shadow:0 10px 26px rgba(96,69,29,.13)!important;}
html[data-jwq-palette="bible-era"][data-jwq-palette-mode="dark"]{--bg:#26221c!important;--card:#373026!important;--text:#f0e4c9!important;--muted:#b9ac93!important;--blue:#c0a36d!important;--blue2:#d7bd86!important;--line:#564937!important;--soft:#40382a!important;--danger:#e68f7d!important;--shadow:0 12px 30px rgba(0,0,0,.38)!important;}
html[data-jwq-palette="emerald"][data-jwq-palette-mode="light"]{--bg:#eef4ed!important;--card:#fafff9!important;--text:#223b34!important;--muted:#5e776c!important;--blue:#237359!important;--blue2:#348b6e!important;--line:#cbded3!important;--soft:#e0eee4!important;--danger:#b15f5a!important;--shadow:0 10px 26px rgba(32,95,67,.1)!important;}
html[data-jwq-palette="emerald"][data-jwq-palette-mode="dark"]{--bg:#101f1b!important;--card:#1a3028!important;--text:#e5f5eb!important;--muted:#a5c3b1!important;--blue:#68be92!important;--blue2:#8bd7ad!important;--line:#315448!important;--soft:#234034!important;--danger:#ec8884!important;--shadow:0 12px 30px rgba(0,0,0,.36)!important;}
html[data-jwq-palette="dark-wood"][data-jwq-palette-mode="light"]{--bg:#efe2d1!important;--card:#fcf2e4!important;--text:#493225!important;--muted:#80644f!important;--blue:#8c603f!important;--blue2:#aa7952!important;--line:#d7bfa5!important;--soft:#e9d8c2!important;--danger:#a9574d!important;--shadow:0 10px 26px rgba(75,44,25,.13)!important;}
html[data-jwq-palette="dark-wood"][data-jwq-palette-mode="dark"]{--bg:#1c1714!important;--card:#30251e!important;--text:#f0dfca!important;--muted:#b7a08b!important;--blue:#d5a073!important;--blue2:#e8bd8f!important;--line:#533f32!important;--soft:#3e3026!important;--danger:#f08d85!important;--shadow:0 12px 30px rgba(0,0,0,.39)!important;}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]){color-scheme:light;}
html[data-jwq-palette-mode="dark"]:not([data-jwq-palette="jwquest"]){color-scheme:dark;}
/* Override old hard-coded appearance colors without changing their JS state or gameplay semantics. */
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) body,html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .app{background:var(--bg)!important;color:var(--text)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.card,.profile,.chapter,.stage .chapter,.result,.learningProfile,.strength,.recommend,.reviewLink,.profileReminderPopover,.rateCta,.jwq-theme-preview,.menuitem,.question-card,.quiz-card,.option,.answer,.stat-card,.panel){background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important;box-shadow:var(--shadow)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.top,.hero,header.header,.nav,.bottom-nav,.bottomnav,.tabbar){background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.language-select,.jwq-reset-btn,.circle,.pstat,.profileBadge,.profileReminderBtn,.rateCtaIcon){background:var(--soft)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.muted,.subtitle,.desc,.description,.jwq-font-ticks,.jwq-font-panel small){color:var(--muted)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.btn-primary,.primary,.btn.primary,.jwq-preview-dot){background:var(--blue)!important;color:var(--card)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(a,.navitem.active,.jwq-brand-quest){color:var(--blue)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .jwq-brand-tagline{color:var(--muted)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .jwq-palette-setting{box-shadow:none!important}
@media(max-width:420px){.jwq-font-panel{padding:12px!important}.jwq-theme-controls .language-select{max-width:54%;min-width:0}}

/* V36.16 — palette-aware foregrounds on primary action surfaces */
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]){--jwq-action-fg:#ffffff;--jwq-action-bg:var(--blue)}
html[data-jwq-palette-mode="dark"]:not([data-jwq-palette="jwquest"]){--jwq-action-fg:#18201d}
html[data-jwq-palette="sepia"][data-jwq-palette-mode="dark"],html[data-jwq-palette="dark-wood"][data-jwq-palette-mode="dark"],html[data-jwq-palette="bible-era"][data-jwq-palette-mode="dark"]{--jwq-action-fg:#241a12}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.reviewcard a#reviewLink,.reviewcard a,.reviewLink,.recommend a,.jwq-v36-tool.daily,.jwq-v36-tool.review){background:var(--jwq-action-bg)!important;color:var(--jwq-action-fg)!important;border-color:var(--line)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.reviewcard a#reviewLink,.reviewcard a,.reviewLink,.recommend a,.jwq-v36-tool.daily,.jwq-v36-tool.review) :is(span,b,h3,p,small,.tool-icon){color:inherit!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) a#reviewLink{color:var(--jwq-action-fg)!important}
/* Daily discovery and daily text align with active theme surfaces. */
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.quote,#dailyTextCard,.game.warm,.event.discovery){background:linear-gradient(135deg,var(--card),var(--soft))!important;border-color:var(--line)!important;color:var(--text)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.quote,#dailyTextCard) :is(p,span){color:var(--text)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.quote,#dailyTextCard) small{color:var(--blue)!important}
/* Keep primary buttons legible in all theme modes. */
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) :is(.btn-primary,.primary,.btn.primary,.signin,.reviewcard a){background:var(--jwq-action-bg)!important;color:var(--jwq-action-fg)!important}

/* V36.18 — Daily Discovery: complete card/button theme isolation */
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .v35-daily{background:linear-gradient(135deg,var(--card),var(--soft))!important;color:var(--text)!important;border:1px solid var(--line)!important;box-shadow:var(--shadow)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .v35-daily :is(h2,p){color:var(--text)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .v35-daily small{color:var(--blue)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .v35-daily .v35-daily-actions a:first-child{background:var(--blue)!important;color:var(--jwq-action-fg)!important;border:1px solid var(--blue)!important}
html[data-jwq-palette]:not([data-jwq-palette="jwquest"]) .v35-daily .v35-daily-actions a+a{background:var(--card)!important;color:var(--text)!important;border:1px solid var(--line)!important}
/* Neutral default palette foreground for action buttons, independent of warm-accent text rules */
html:not([data-jwq-palette]) .v35-daily a:first-child,html[data-jwq-palette="jwquest"] .v35-daily a:first-child{color:#fff!important}
html[data-jwq-palette-mode="dark"][data-jwq-palette="jwquest"] .v35-daily a:first-child{color:#091827!important}
