/* Word Quest hub + story pages (web/templates/word_quest/). Dark surfaces, text ≥ slate-300,
   one accent per level via --accent-rgb. Hiding lives here (never rely on [hidden]). */
.wq [hidden] { display: none !important; }

/* ── hub: how it works ── */
.wq-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.wq-step { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; border-radius: 1rem;
  border: 1px solid rgba(var(--accent-rgb), .25); background: linear-gradient(180deg, rgba(var(--accent-rgb), .09), rgba(255, 255, 255, .015)), #0a1122; }
.wq-step-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.9rem; height: 2.9rem; border-radius: .85rem;
  background: rgba(var(--accent-rgb), .15); color: rgb(var(--accent-rgb)); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .3); }
.wq-step-svg { width: 1.5rem; height: 1.5rem; }
.wq-step-body { display: flex; flex-direction: column; gap: .25rem; }
.wq-step-title { font-weight: 650; color: #f8fafc; }
.wq-step-text { font-size: .9rem; line-height: 1.45; color: #cbd5e1; }

/* ── hub: level jump bar ── */
.wq-levelnav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.wq-levelnav a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 999px; text-decoration: none;
  border: 1px solid rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .08); color: #f1f5f9; font-weight: 600; font-size: .9rem; }
.wq-levelnav a:hover, .wq-levelnav a:focus-visible { border-color: rgba(var(--accent-rgb), .8); outline: none; }
.wq-levelnav small { color: rgb(var(--accent-rgb)); font-weight: 600; font-size: .75rem; }
.wq-levelnav-svg { width: 1.25rem; height: 1.25rem; color: rgb(var(--accent-rgb)); }

/* ── hub: a level and its lists ── */
.wq-level { scroll-margin-top: 5rem; }
.wq-level-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.wq-level-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; border-radius: 1rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .3), rgba(var(--accent-rgb), .08)); color: rgb(var(--accent-rgb));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .4), 0 0 24px -8px rgba(var(--accent-rgb), .7); }
.wq-level-svg { width: 1.75rem; height: 1.75rem; }
.wq .wq-level-h { margin: 0; }
.wq-band { margin-left: .4rem; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 650; vertical-align: middle;
  color: rgb(var(--accent-rgb)); background: rgba(var(--accent-rgb), .12); }
.wq-level-meta { margin: .15rem 0 0; color: #cbd5e1; font-size: .9rem; }
.wq-lists { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.wq-list { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; border-radius: 1rem;
  border: 1px solid rgba(var(--accent-rgb), .22); background: linear-gradient(180deg, rgba(var(--accent-rgb), .07), rgba(255, 255, 255, .01)), #0a1122; }
.wq-list--done { border-color: rgba(var(--accent-rgb), .7); }
.wq-list-top { display: flex; gap: .75rem; align-items: flex-start; }
.wq-list-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: .7rem;
  font-weight: 700; color: rgb(var(--accent-rgb)); background: rgba(var(--accent-rgb), .14); }
.wq-list-names { min-width: 0; }
.wq-list-title { margin: 0; font-size: 1.02rem; font-weight: 650; line-height: 1.3; color: #f8fafc; }
.wq-list-topic { margin: .15rem 0 0; font-size: .82rem; color: #cbd5e1; }
.wq-list-sample { margin: 0; font-size: .88rem; color: #e2e8f0; font-style: italic; }
.wq-bar { height: .35rem; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.wq-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: rgb(var(--accent-rgb)); transition: width .4s; }
.wq-list-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: auto; }
.wq-list-acts .wq-act { justify-content: center; padding: .4rem .3rem; }
.wq-next { display: flex; flex-wrap: wrap; gap: .45rem; }
.wq-act { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border-radius: .7rem; text-decoration: none;
  font-size: .86rem; font-weight: 600; color: #f1f5f9; border: 1px solid rgba(var(--act-rgb), .4); background: rgba(var(--act-rgb), .1); }
.wq-act:hover, .wq-act:focus-visible { border-color: rgba(var(--act-rgb), .9); background: rgba(var(--act-rgb), .2); outline: none; }
.wq-act-svg { width: 1.1rem; height: 1.1rem; color: rgb(var(--act-rgb)); }
.wq-act--learn { --act-rgb: 52, 211, 153; }
.wq-act--story { --act-rgb: 56, 189, 248; }
.wq-act--print { --act-rgb: 251, 146, 60; }
.wq-act--challenge { --act-rgb: 244, 114, 182; }
.wq-note { margin: 1rem 0 0; color: #cbd5e1; font-size: .88rem; }

/* ── story page ── */
.wq-story-page { position: relative; max-width: 46rem; margin: 0 auto; }
.wq-crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .85rem; color: #cbd5e1; margin-bottom: .5rem; }
.wq-crumbs a { color: #6ee7b7; text-decoration: none; }
.wq-crumbs a:hover { text-decoration: underline; }
.wq-story-title { margin: 0 0 1rem; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; color: #f8fafc; line-height: 1.2; }
.wq-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.wq-tab, .wq-listen { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: .8rem; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .92rem; color: #e2e8f0; border: 1px solid rgba(148, 163, 184, .3); background: #0a1122; }
.wq-tab[aria-selected="true"] { color: #f8fafc; border-color: rgba(52, 211, 153, .8); background: rgba(52, 211, 153, .14); }
.wq-tab[data-wq-mode="challenge"][aria-selected="true"] { border-color: rgba(244, 114, 182, .8); background: rgba(244, 114, 182, .14); }
.wq-listen { margin-left: auto; }
.wq-listen[aria-pressed="true"] { border-color: rgba(56, 189, 248, .8); background: rgba(56, 189, 248, .14); }
.wq-tab-svg { width: 1.2rem; height: 1.2rem; }
.wq-hint { margin: 0 0 1rem; color: #cbd5e1; font-size: .9rem; }
.wq-story { padding: 1.25rem 1.4rem; border-radius: 1.1rem; border: 1px solid rgba(148, 163, 184, .18); background: #0a1122;
  font-size: 1.12rem; line-height: 1.85; color: #e2e8f0; }
.wq-story p { margin: 0 0 1rem; padding: .1rem .35rem; margin-left: -.35rem; margin-right: -.35rem; border-radius: .5rem; transition: background .2s; }
.wq-story p:last-child { margin-bottom: 0; }
.wq-story p.wq-reading { background: rgba(56, 189, 248, .1); }
.wq-w { font: inherit; font-weight: 700; color: #6ee7b7; background: none; border: 0; padding: 0; cursor: pointer;
  border-bottom: 2px dotted rgba(110, 231, 183, .55); line-height: inherit; }
.wq-w:hover, .wq-w:focus-visible { color: #a7f3d0; outline: none; border-bottom-style: solid; }
.wq-w.wq-gap { min-width: 4rem; color: #f8fafc; font-weight: 600; border: 0; border-bottom: 2px solid rgba(244, 114, 182, .6);
  background: rgba(244, 114, 182, .08); border-radius: .3rem .3rem 0 0; padding: 0 .2rem; white-space: pre; }
.wq-w.wq-gap--filled { white-space: normal; }
.wq-w.wq-gap--active { background: rgba(244, 114, 182, .25); box-shadow: 0 0 0 2px rgba(244, 114, 182, .6); }
.wq-w.wq-gap--right { color: #86efac; border-bottom-color: #22c55e; background: rgba(34, 197, 94, .14); }
.wq-w.wq-gap--wrong { color: #fca5a5; border-bottom-color: #ef4444; background: rgba(239, 68, 68, .14); text-decoration: line-through; }
.wq-bank { position: sticky; bottom: .75rem; z-index: 5; display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; padding: .8rem;
  border-radius: 1rem; border: 1px solid rgba(244, 114, 182, .35); background: rgba(10, 17, 34, .96); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.wq-chip { font: inherit; font-size: .95rem; font-weight: 600; padding: .35rem .7rem; border-radius: .6rem; cursor: pointer;
  color: #f8fafc; border: 1px solid rgba(244, 114, 182, .45); background: rgba(244, 114, 182, .12); }
.wq-chip:hover, .wq-chip:focus-visible { background: rgba(244, 114, 182, .28); outline: none; }
.wq-check { font: inherit; font-weight: 700; padding: .4rem 1rem; border-radius: .6rem; cursor: pointer; margin-left: auto;
  color: #052e16; background: #34d399; border: 0; }
.wq-result { margin-top: 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem; border-radius: 1rem;
  background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .4); }
.wq-result-score { margin: 0; font-size: 1.15rem; font-weight: 700; color: #f8fafc; }
.wq-result .wq-check { margin-left: 0; }
.wq-pop { position: absolute; z-index: 20; width: min(20rem, 100%); padding: .8rem .95rem; border-radius: .9rem;
  background: #111a33; border: 1px solid rgba(110, 231, 183, .5); box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .8); color: #e2e8f0; }
.wq-pop-head { display: flex; align-items: center; gap: .5rem; }
.wq-pop-head strong { font-size: 1.1rem; color: #f8fafc; }
.wq-pop-head em { color: #6ee7b7; font-size: .85rem; }
.wq-pop-say, .wq-pop-x { background: none; border: 0; color: #cbd5e1; cursor: pointer; padding: .15rem; font-size: 1.3rem; line-height: 1; }
.wq-pop-say { margin-left: auto; color: #7dd3fc; }
.wq-pop p { margin: .4rem 0 0; font-size: .95rem; line-height: 1.45; }
.wq-pop-zh { color: #fde68a; }
.wq-words { margin-top: 2rem; }
.wq-h2 { font-size: 1.2rem; font-weight: 700; color: #f8fafc; margin: 0 0 .75rem; }
.wq-wordlist { display: grid; gap: .5rem; margin: 0; }
.wq-wordlist > div { padding: .55rem .8rem; border-radius: .7rem; background: rgba(255, 255, 255, .03); border: 1px solid rgba(148, 163, 184, .12); }
.wq-wordlist dt { font-weight: 700; color: #f8fafc; }
.wq-wordlist dt em { font-weight: 500; color: #6ee7b7; font-size: .85rem; }
.wq-wordlist dd { margin: .1rem 0 0; color: #cbd5e1; font-size: .93rem; }
.wq-zh { color: #fde68a; margin-left: .3rem; }
.wq-next { margin: 1.5rem 0 0; }
@media (max-width: 640px) {
  .wq-story { padding: 1rem; font-size: 1.05rem; }
  .wq-listen { margin-left: 0; }
}

/* ── light theme ── */
html[data-theme="light"] .wq-step, html[data-theme="light"] .wq-list, html[data-theme="light"] .wq-story,
html[data-theme="light"] .wq-tab, html[data-theme="light"] .wq-listen { background: #fff; }
html[data-theme="light"] .wq-step-title, html[data-theme="light"] .wq-list-title, html[data-theme="light"] .wq-story-title,
html[data-theme="light"] .wq-h2, html[data-theme="light"] .wq-wordlist dt, html[data-theme="light"] .wq-result-score,
html[data-theme="light"] .wq-levelnav a, html[data-theme="light"] .wq-act, html[data-theme="light"] .wq-tab { color: rgb(15 23 42); }
html[data-theme="light"] .wq-step-text, html[data-theme="light"] .wq-list-topic, html[data-theme="light"] .wq-list-sample,
html[data-theme="light"] .wq-level-meta, html[data-theme="light"] .wq-note, html[data-theme="light"] .wq-hint,
html[data-theme="light"] .wq-story, html[data-theme="light"] .wq-wordlist dd, html[data-theme="light"] .wq-crumbs { color: rgb(48 65 85); }
html[data-theme="light"] .wq-w { color: #047857; }
html[data-theme="light"] .wq-w.wq-gap { color: rgb(15 23 42); }
html[data-theme="light"] .wq-bank, html[data-theme="light"] .wq-pop { background: #fff; color: rgb(30 41 59); }
html[data-theme="light"] .wq-pop-head strong, html[data-theme="light"] .wq-chip { color: rgb(15 23 42); }
html[data-theme="light"] .wq-zh, html[data-theme="light"] .wq-pop-zh { color: #b45309; }
html[data-theme="light"] .wq-crumbs a { color: #047857; }

/* ▼▼ LIGHT THEME — GENERATED by scripts/build_light_theme.py from the rules above. Do not edit by hand: run the builder. Hand tuning goes in 36-theme-light.css. ▼▼ */
html[data-theme="light"] .wq-step{background:linear-gradient(180deg, rgba(var(--accent-rgb), .09), rgb(15 23 42/0.015)), rgb(246 248 250)}
html[data-theme="light"] .wq-step-ico{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a);box-shadow:inset 0px 0px 0px 1px color-mix(in srgb,rgba(var(--accent-rgb), .3) 62%,#0f172a)}
html[data-theme="light"] .wq-step-title{color:rgb(38 66 94)}
html[data-theme="light"] .wq-step-text{color:rgb(48 65 85)}
html[data-theme="light"] .wq-levelnav a{color:rgb(38 66 94)}
html[data-theme="light"] .wq-levelnav small{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a)}
html[data-theme="light"] .wq-levelnav-svg{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a)}
html[data-theme="light"] .wq-level-ico{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a);box-shadow:inset 0px 0px 0px 1px color-mix(in srgb,rgba(var(--accent-rgb), .4) 62%,#0f172a),0px 7px 24px -8px rgb(15 23 42/0.12)}
html[data-theme="light"] .wq-band{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a)}
html[data-theme="light"] .wq-level-meta{color:rgb(48 65 85)}
html[data-theme="light"] .wq-list{background:linear-gradient(180deg, rgba(var(--accent-rgb), .07), rgb(15 23 42/0.01)), rgb(246 248 250)}
html[data-theme="light"] .wq-list-n{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a)}
html[data-theme="light"] .wq-list-title{color:rgb(38 66 94)}
html[data-theme="light"] .wq-list-topic{color:rgb(48 65 85)}
html[data-theme="light"] .wq-list-sample{color:rgb(44 63 88)}
html[data-theme="light"] .wq-bar{background-color:rgb(15 23 42/0.07)}
html[data-theme="light"] .wq-act{color:rgb(38 66 94)}
html[data-theme="light"] .wq-act-svg{color:color-mix(in srgb,rgb(var(--act-rgb)) 44%,#0f172a)}
html[data-theme="light"] .wq-note{color:rgb(48 65 85)}
html[data-theme="light"] .wq-crumbs{color:rgb(48 65 85)}
html[data-theme="light"] .wq-crumbs a{color:rgb(16 111 73)}
html[data-theme="light"] .wq-story-title{color:rgb(38 66 94)}
html[data-theme="light"] .wq-tab,html[data-theme="light"] .wq-listen{color:rgb(44 63 88);background-color:rgb(246 248 250)}
html[data-theme="light"] .wq-tab[aria-selected="true"]{color:rgb(38 66 94)}
html[data-theme="light"] .wq-hint{color:rgb(48 65 85)}
html[data-theme="light"] .wq-story{background-color:rgb(246 248 250);color:rgb(44 63 88)}
html[data-theme="light"] .wq-w{color:rgb(16 111 73)}
html[data-theme="light"] .wq-w:hover,html[data-theme="light"] .wq-w:focus-visible{color:rgb(13 112 66)}
html[data-theme="light"] .wq-w.wq-gap{color:rgb(38 66 94)}
html[data-theme="light"] .wq-w.wq-gap--active{box-shadow:0px 0px 0px 2px rgb(180 14 101/0.55)}
html[data-theme="light"] .wq-w.wq-gap--right{color:rgb(12 113 49)}
html[data-theme="light"] .wq-w.wq-gap--wrong{color:rgb(131 1 1)}
html[data-theme="light"] .wq-bank{background-color:rgb(246 248 250/0.96);box-shadow:0px 10px 30px -10px rgb(15 23 42/0.192)}
html[data-theme="light"] .wq-chip{color:rgb(38 66 94)}
html[data-theme="light"] .wq-result-score{color:rgb(38 66 94)}
html[data-theme="light"] .wq-pop{background-color:rgb(242 243 248);box-shadow:0px 14px 40px -12px rgb(15 23 42/0.2);color:rgb(44 63 88)}
html[data-theme="light"] .wq-pop-head strong{color:rgb(38 66 94)}
html[data-theme="light"] .wq-pop-head em{color:rgb(16 111 73)}
html[data-theme="light"] .wq-pop-say,html[data-theme="light"] .wq-pop-x{color:rgb(48 65 85)}
html[data-theme="light"] .wq-pop-say{color:rgb(0 90 133)}
html[data-theme="light"] .wq-pop-zh{color:rgb(117 94 0)}
html[data-theme="light"] .wq-h2{color:rgb(38 66 94)}
html[data-theme="light"] .wq-wordlist > div{background-color:rgb(15 23 42/0.03)}
html[data-theme="light"] .wq-wordlist dt{color:rgb(38 66 94)}
html[data-theme="light"] .wq-wordlist dt em{color:rgb(16 111 73)}
html[data-theme="light"] .wq-wordlist dd{color:rgb(48 65 85)}
html[data-theme="light"] .wq-zh{color:rgb(117 94 0)}
/* ▲▲ LIGHT THEME END ▲▲ */
