.theme-toggle{display:flex;align-items:center;justify-content:center;min-height:44px;width:100%;margin:0 0 16px;font-size:13px;background:#eaf0e5;color:#153e37;border:1px solid #c8d3c8}
html[data-theme=dark]{--green:#b7e3c8;--lime:#dceb9f;--bg:#101b19;--muted:#b9cbbf;--line:#3d5148;color-scheme:dark}
html[data-theme=dark] body{background:var(--bg);color:#e1ece5}
html[data-theme=dark] aside,
html[data-theme=dark] .card,
html[data-theme=dark] .game-card,
html[data-theme=dark] .game-arena,
html[data-theme=dark] .options button,
html[data-theme=dark] .testheft-chapters button,
html[data-theme=dark] .testheft-task{background:#192923;color:#e1ece5;border-color:var(--line)}
html[data-theme=dark] button,
html[data-theme=dark] .button,
html[data-theme=dark] nav a.active,
html[data-theme=dark] .game-letter-answer button,
html[data-theme=dark] .sb-used{background:#b7e3c8;color:#10291e}
html[data-theme=dark] .hero,
html[data-theme=dark] .game-welcome{background:#1b3d31;color:#f2f8f4}
html[data-theme=dark] .hero p,
html[data-theme=dark] .game-welcome p{color:#cfdfd4}
html[data-theme=dark] .secondary,
html[data-theme=dark] .theme-toggle,
html[data-theme=dark] .pill,
html[data-theme=dark] .avatar,
html[data-theme=dark] .game-chip,
html[data-theme=dark] .light{background:#304b3b;color:#deedbd;border-color:#57715c}
html[data-theme=dark] .ghost,
html[data-theme=dark] .reader-word,
html[data-theme=dark] .chunk,
html[data-theme=dark] .chunk-choice{background:transparent;color:#c7e9d3;border-color:var(--line)}
html[data-theme=dark] select,
html[data-theme=dark] input,
html[data-theme=dark] textarea,
html[data-theme=dark] .sb-inline select{background:#12211b;color:#e1ece5;border-color:#597063}
html[data-theme=dark] input,
html[data-theme=dark] textarea::placeholder{color:#9caf9f;opacity:1}
html[data-theme=dark] .feedback,
html[data-theme=dark] .game-feedback,
html[data-theme=dark] .game-yay,
html[data-theme=dark] .game-result,
html[data-theme=dark] .continue-learning,
html[data-theme=dark] .relation-context,
html[data-theme=dark] .online-presence,
html[data-theme=dark] .voice-word,
html[data-theme=dark] #voiceStatus,
html[data-theme=dark] .voice-coach details,
html[data-theme=dark] #readingWordBody blockquote,
html[data-theme=dark] .reader-save-word,
html[data-theme=dark] .options button.selected{background:#253c2d;color:#e1ece5}
html[data-theme=dark] .feedback.bad,
html[data-theme=dark] .game-try,
html[data-theme=dark] .game-articles .is-wrong,
html[data-theme=dark] .voice-word.extra,
html[data-theme=dark] .voice-word.different,
html[data-theme=dark] .voice-word.missing{background:#492c27;color:#ffe0d4;border-color:#e8997c}
html[data-theme=dark] .game-letter-answer.is-wrong,
html[data-theme=dark] .game-letter-answer.game-letter-wrong{background:#542724;color:#ffe3dc;border-color:#f17d70}
html[data-theme=dark] .game-flip,
html[data-theme=dark] .game-memory .game-icon,
html[data-theme=dark] .room-invite{background:#362e47;color:#eadcfb;border-color:#79648e;box-shadow:none}
html[data-theme=dark] .game-flip.is-open,
html[data-theme=dark] .game-articles button,
html[data-theme=dark] .game-article .game-icon{background:#443b26;color:#f4e5ba;border-color:#8d7d4e;box-shadow:none}
html[data-theme=dark] .game-flip.is-matched,
html[data-theme=dark] .game-articles .is-correct,
html[data-theme=dark] .room-me{background:#304d32;color:#def0c7;border-color:#86aa68}
html[data-theme=dark] .game-letter-bank button,
html[data-theme=dark] .game-letters .game-icon{background:#4c3329;color:#ffdec9;box-shadow:none}
html[data-theme=dark] .game-letter-answer,
html[data-theme=dark] .room-share,
html[data-theme=dark] .testheft-page-scroll{background:#14231d;color:#e1ece5}
html[data-theme=dark] .game-result-points,
html[data-theme=dark] .game-blank,
html[data-theme=dark] .chapter .number,
html[data-theme=dark] .tag,
html[data-theme=dark] .testheft-answer figcaption{color:#c7dfae}
html[data-theme=dark] .progress,
html[data-theme=dark] .game-progress{background:#35463c}
html[data-theme=dark] .chat-panel,
html[data-theme=dark] .chat-body,
html[data-theme=dark] .chat-message,
html[data-theme=dark] .chat-composer,
html[data-theme=dark] .chat-settings,
html[data-theme=dark] .chat-nickname,
html[data-theme=dark] .tutor-panel,
html[data-theme=dark] .tutor-message,
html[data-theme=dark] .tutor-chat,
html[data-theme=dark] .tutor-card{background:#192923;color:#e1ece5;border-color:var(--line)}
html[data-theme=dark] .testheft-task:hover,
html[data-theme=dark] .testheft-chapters button:hover{background:#2b4234}
html[data-theme=dark] :focus-visible{outline-color:#dceb9f}
html[data-theme=dark] ::selection{background:#526747;color:#fff}
/* Keep QR codes and original document pages readable in their original colours. */
html[data-theme=dark] .room-qr{background:#fff;color:#000}
@media(max-width:620px){.theme-toggle{width:auto;min-width:150px;margin:15px 0 0}}
html[data-theme=dark] .reader-panel,
html[data-theme=dark] .reader-panel-top,
html[data-theme=dark] .review-original,
html[data-theme=dark] .exercise-tile,
html[data-theme=dark] .match-button,
html[data-theme=dark] .intensive-unit,
html[data-theme=dark] .sentence-builder button,
html[data-theme=dark] .lena-stage{background:#192923;color:#e1ece5;border-color:var(--line)}
html[data-theme=dark] .reader-tip,
html[data-theme=dark] .reader-live-box,
html[data-theme=dark] .review-summary,
html[data-theme=dark] .review-preview,
html[data-theme=dark] .profile-avatar-large,
html[data-theme=dark] .profile-crop,
html[data-theme=dark] .sentence-builder,
html[data-theme=dark] .intensive-task-nav button,
html[data-theme=dark] .lena-caption,
html[data-theme=dark] .chat-messages,
html[data-theme=dark] .tutor-messages,
html[data-theme=dark] .chat-tabs button{background:#24392d;color:#e1ece5;border-color:var(--line)}
html[data-theme=dark] .exercise-tile.chosen,
html[data-theme=dark] .match-button.selected,
html[data-theme=dark] .match-button.matched,
html[data-theme=dark] .reader-word:hover,
html[data-theme=dark] .reader-word:focus-visible,
html[data-theme=dark] .reader-word.reader-selected,
html[data-theme=dark] .tutor-user,
html[data-theme=dark] .chat-message.chat-mine{background:#38543b;color:#e8f1d5}
html[data-theme=dark] .intensive-task-nav button.current,
html[data-theme=dark] .chat-tabs [aria-pressed=true]{background:#b7e3c8;color:#10291e}
html[data-theme=dark] .review-summary.has-suggestions,
html[data-theme=dark] .review-original mark,
html[data-theme=dark] .tutor-setup{background:#443b26;color:#f4e5ba}
html[data-theme=dark] .chat-info,
html[data-theme=dark] .chat-message time,
html[data-theme=dark] .chat-actions button,
html[data-theme=dark] .chat-send small,
html[data-theme=dark] #chatStatus,
html[data-theme=dark] .chat-empty,
html[data-theme=dark] .tutor-message strong,
html[data-theme=dark] .tutor-welcome>span{color:#bdd7c1}
html[data-theme=dark] .lena-live{background:#24392def;color:#e1ece5}
html[data-theme=dark] .sb-used{background:#38543b!important;color:#e8f1d5}
html[data-theme=dark] .game-letter-answer.is-invalid{background:#542724;color:#ffe3dc;border-color:#f17d70}
html[data-theme=dark] .game-letter-answer.is-invalid button{background:#a73730;color:#fff}
/* Word lookup controls are inline reading text, not filled action buttons. */
html[data-theme=dark] .clickable-reading button.reader-word{
  display:inline;
  background:transparent;
  color:inherit;
  border:0;
  padding:0;
  margin:0;
  box-shadow:none;
  filter:none;
  text-decoration-color:#688273;
}
html[data-theme=dark] .clickable-reading button.reader-word.reader-selected,
html[data-theme=dark] .clickable-reading button.reader-word:focus-visible{
  background:#38543b;
  color:#e8f1d5;
  text-decoration-color:#aacb99;
}
@media(hover:hover){
  html[data-theme=dark] .clickable-reading button.reader-word:hover{
    background:#304838;
    color:#e8f1d5;
    text-decoration-color:#aacb99;
  }
}
/* Chapter cards need their own surface, rather than the action-button fill. */
html[data-theme=dark] button.card.chapter{background:#192923;color:#e1ece5;border:1px solid #4b6456;box-shadow:none}
html[data-theme=dark] button.card.chapter h3{color:#f1f6f2}
html[data-theme=dark] button.card.chapter .muted{color:#b9cbbf}
html[data-theme=dark] button.card.chapter .number{color:#bbdcb1}
html[data-theme=dark] button.card.chapter .tag{color:#c7dfae}
html[data-theme=dark] button.card.chapter:hover{background:#24392e;border-color:#91b78b;filter:none}
html[data-theme=dark] button.card.chapter:focus-visible{outline:3px solid #dceb9f;outline-offset:3px}

html[data-theme=dark] #lenaVoiceStatus{color:#bdd7c1}
html[data-theme=dark] input[type=range]{accent-color:#b7e3c8}

html[data-theme=dark] .sb-inline select.sb-correct{background:#203e2a;color:#d7f5de;border-color:#6bc985;-webkit-text-fill-color:#d7f5de;opacity:1}
html[data-theme=dark] .sb-inline select.sb-incorrect{background:#502727;color:#ffe0e0;border-color:#ef8686;-webkit-text-fill-color:#ffe0e0;opacity:1}
html[data-theme=dark] .sb-mark-correct{color:#8bdba1}html[data-theme=dark] .sb-mark-incorrect{color:#ffaaaa}
html[data-theme=dark] #sbFeedback [data-sb-correct="true"]{background:#203e2a;color:#d7f5de;border-color:#6bc985}
html[data-theme=dark] #sbFeedback [data-sb-correct="false"]{background:#502727;color:#ffe0e0;border-color:#ef8686}

html[data-theme=dark] .sb-inline select.sb-duplicate{background:#502727;color:#ffe0e0;border-color:#ef8686;-webkit-text-fill-color:#ffe0e0}html[data-theme=dark] .sb-bank .sb-duplicate-bank{background:#502727!important;color:#ffe0e0!important;border-color:#ef8686}

html[data-theme=dark] #sbStatus.sb-duplicate-warning{background:#502727;color:#ffe0e0;border-color:#ef8686}html[data-theme=dark] #sbStatus .sb-gap-jump{background:#ffe0e0;color:#502727}
