html[data-theme="dark"] {
    color-scheme: dark;
    --rh-bg: #090d1a;
    --rh-bg-accent: #15142d;
    --rh-surface: #141a2b;
    --rh-surface-elevated: #1b2340;
    --rh-surface-subtle: #101626;
    --rh-text: #f4f5ff;
    --rh-text-muted: #b7bfd8;
    --rh-border: #303953;
    --rh-border-strong: #4a5674;
    --rh-action: #61d6ff;
    --rh-action-hover: #98e7ff;
    --rh-action-soft: #15364c;
    --rh-success: #65e6b1;
    --rh-success-soft: #12382f;
    --rh-warning: #ffd06a;
    --rh-warning-soft: #3b2d16;
    --rh-danger: #ff8fa3;
    --rh-danger-soft: #43202d;
    --rh-focus-ring: #ffd06a;
    --rh-page-bg-top: #11142a;
    --rh-page-bg-bottom: #090d1a;
    --rh-page-glow-blue: rgba(71, 193, 255, 0.18);
    --rh-page-glow-teal: rgba(85, 225, 183, 0.13);
    --rh-navy-950: #f4f5ff;
    --rh-navy-900: #e7eafe;
    --rh-navy-800: #ccd3ed;
    --rh-navy-700: #b7bfd8;
    --rh-slate-400: #9da9c8;
    --rh-primary: #61d6ff;
    --rh-primary-strong: #98e7ff;
    --rh-primary-soft: #15364c;
    --rh-primary-tint: rgba(97, 214, 255, 0.14);
    --rh-orange-ink: #ffd990;
    --rh-error-ink: #ffc0ca;
    --rh-success-ink: #a4f4d1;
    --rh-surface-nav: rgba(14, 19, 36, 0.92);
    --rh-surface-reference: #171a35;
    --rh-surface-reference-hero: #1b2142;
    --rh-surface-reference-search: #12192c;
    --rh-surface-reference-section: #151c31;
    --rh-surface-practice: #141a2b;
    --rh-surface-rule-focus: #211c3d;
    --rh-surface-rule-build: #122d38;
    --rh-accent-violet: #b59cff;
    --rh-accent-coral: #ff9678;
    --rh-accent-amber: #ffd06a;
    --rh-accent-mint: #65e6b1;
    /* Legacy app aliases still used by older practice/reference components. */
    --rh-blue-500: #7fe1ff;
    --rh-blue-600: #61d6ff;
    --rh-blue-700: #b2efff;
    --rh-grammar-red: #ff8fa3;
    --rh-grammar-red-strong: #ffc0ca;
    --rh-grammar-red-tint: #43202d;
    --rh-anchor-navy: #f4f5ff;
    --rh-text-soft: #98a6c7;
    --rh-success-tint: #12382f;
    --rh-error: #ff8fa3;
    --rh-error-tint: #43202d;
    --rh-line-ghost: rgba(151, 164, 199, 0.18);
    --rh-line-strong: rgba(151, 164, 199, 0.32);
    --rh-slate-500: #b7bfd8;
    --rh-slate-300: #7f8cab;
    --rh-line: rgba(151, 164, 199, 0.22);
    --rh-line-soft: rgba(151, 164, 199, 0.14);
    --rh-success-bg: #12382f;
    --rh-success-ink: #a4f4d1;
    --rh-error-bg: #43202d;
    --rh-error-ink: #ffc0ca;
    --rh-shadow-1: 0 1px 1px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(1, 4, 14, 0.3);
    --rh-shadow-2: 0 24px 60px rgba(1, 4, 14, 0.46);
    --noun-masculine-surface: #172b3e;
    --noun-masculine-border: #376b8f;
    --noun-masculine-accent: #8fd4ff;
    --noun-feminine-surface: #35222f;
    --noun-feminine-border: #81506a;
    --noun-feminine-accent: #ffb2ca;
    --noun-neuter-surface: #173029;
    --noun-neuter-border: #3c765d;
    --noun-neuter-accent: #9ce8bd;
    --noun-special-surface: #332b1e;
    --noun-special-border: #806b3d;
    --noun-special-accent: #f2cf7e;
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 7% 4%, rgba(181, 156, 255, 0.18), transparent 25rem),
        radial-gradient(circle at 94% 12%, rgba(97, 214, 255, 0.17), transparent 28rem),
        radial-gradient(circle at 48% 100%, rgba(255, 150, 120, 0.09), transparent 34rem),
        linear-gradient(180deg, #11142a 0%, #0c1120 46%, #090d1a 100%);
    color: var(--rh-text);
}

html[data-theme="dark"] :is(a, button) {
    text-decoration-thickness: 0.09em;
    text-underline-offset: 0.18em;
}

html[data-theme="dark"] :is(
    .rh-panel,
    .rh-hub-section,
    .rh-verb-list-item,
    .rh-detail-card,
    .rh-detail-hero,
    .rh-practice-module-band,
    .rh-practice-foundation-card,
    .rh-practice-study-preview,
    .rh-practice-score-strip,
    .rh-practice-batch-selector,
    .rh-practice-card,
    .rh-practice-batch-card,
    .rh-practice-feedback,
    .rh-practice-complete,
    .rh-practice-review-card,
    .rh-practice-module02-card,
    .rh-ending-table,
    .rh-rule-card,
    .rh-build-formula-card) {
    border-color: var(--rh-border);
    background: linear-gradient(145deg, rgba(27, 35, 64, 0.96), rgba(18, 24, 41, 0.98));
    color: var(--rh-text);
    box-shadow: var(--rh-shadow-1);
}

html[data-theme="dark"] .rh-practice-module-band__title,
html[data-theme="dark"] .rh-practice-verb {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-editorial-label,
html[data-theme="dark"] .rh-practice-state-pill {
    border-color: rgba(97, 214, 255, 0.28);
    background: rgba(21, 54, 76, 0.78);
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-practice-question-card {
    border-color: rgba(97, 214, 255, 0.28);
    background: linear-gradient(145deg, rgba(27, 35, 64, 0.98), rgba(15, 21, 38, 0.99));
    color: var(--rh-text);
    box-shadow: var(--rh-shadow-1);
}

html[data-theme="dark"] .rh-practice-question-title {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-question-title span {
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-home-hero {
    border-color: rgba(97, 214, 255, 0.34);
    background:
        radial-gradient(circle at 86% 14%, rgba(101, 230, 177, 0.16), transparent 13rem),
        linear-gradient(135deg, rgba(31, 42, 79, 0.98), rgba(16, 31, 53, 0.98));
    box-shadow: 0 24px 65px rgba(1, 5, 18, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .rh-home-track-card {
    border-color: rgba(181, 156, 255, 0.34);
    background: linear-gradient(145deg, rgba(42, 35, 78, 0.96), rgba(22, 26, 50, 0.98));
}

html[data-theme="dark"] .rh-home-track-card:nth-child(2) {
    border-color: rgba(101, 230, 177, 0.34);
    background: linear-gradient(145deg, rgba(20, 59, 52, 0.94), rgba(18, 31, 46, 0.98));
}

html[data-theme="dark"] .rh-home-track-card--adjectives {
    border-color: rgba(181, 156, 255, 0.42);
    background: linear-gradient(145deg, rgba(56, 39, 88, 0.96), rgba(23, 27, 50, 0.98));
}

html[data-theme="dark"] .rh-home-track-card h3,
html[data-theme="dark"] .rh-home-track-card strong {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-home-track-card--verbs .rh-home-track-card__kicker {
    color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-home-track-card--nouns .rh-home-track-card__kicker {
    color: var(--rh-accent-mint);
}

html[data-theme="dark"] .rh-home-track-card--adjectives .rh-home-track-card__kicker,
html[data-theme="dark"] .rh-reference-module-card__status,
html[data-theme="dark"] .rh-reference-module-card__action,
html[data-theme="dark"] .rh-hub-card--adjective .rh-hub-card__kicker,
html[data-theme="dark"] .rh-hub-mini-card--adjective {
    color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-curriculum-page--adjectives {
    --rh-curriculum-adjective: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-module03-step-card .rh-module01-step-card__status,
html[data-theme="dark"] .rh-module03-step-card .rh-module01-step-card__focus {
    color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-module01-step-card {
    border-color: rgba(181, 156, 255, 0.28);
    background: linear-gradient(150deg, rgba(34, 31, 65, 0.96), rgba(19, 25, 43, 0.98));
}

html[data-theme="dark"] .rh-module01-step-card--active {
    border-color: rgba(97, 214, 255, 0.58);
    box-shadow: 0 0 0 1px rgba(97, 214, 255, 0.08), var(--rh-shadow-1);
}

html[data-theme="dark"] .rh-module01-step-card strong {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-hub-hero--reference {
    border-color: rgba(181, 156, 255, 0.42);
    background:
        radial-gradient(circle at 88% 18%, rgba(97, 214, 255, 0.14), transparent 14rem),
        linear-gradient(135deg, rgba(43, 34, 82, 0.98), rgba(20, 27, 51, 0.98));
}

html[data-theme="dark"] .rh-hub-hero--quiz {
    border-color: rgba(255, 150, 120, 0.44);
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 208, 106, 0.13), transparent 14rem),
        linear-gradient(135deg, rgba(71, 35, 49, 0.97), rgba(27, 27, 50, 0.98));
}

html[data-theme="dark"] :is(.rh-hub-card, .rh-hub-mini-card, .rh-hub-info-card) {
    border-color: var(--rh-border);
    background: linear-gradient(145deg, rgba(27, 35, 64, 0.95), rgba(18, 24, 41, 0.98));
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-hub-card--reference {
    border-top-color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-hub-card--quiz {
    border-top-color: var(--rh-accent-coral);
}

html[data-theme="dark"] .rh-hub-card strong {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-hub-card__kicker {
    color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-hub-card--quiz .rh-hub-card__kicker {
    color: var(--rh-accent-coral);
}

html[data-theme="dark"] .rh-reference-topic-card {
    border-color: rgba(181, 156, 255, 0.25);
    border-left: 3px solid rgba(181, 156, 255, 0.65);
    background: linear-gradient(145deg, rgba(35, 30, 65, 0.94), rgba(18, 24, 42, 0.98));
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-reference-topic-card--active {
    border-color: rgba(97, 214, 255, 0.46);
    border-left-color: var(--rh-action);
    background: linear-gradient(145deg, rgba(25, 49, 73, 0.96), rgba(22, 25, 49, 0.98));
}

html[data-theme="dark"] .rh-reference-topic-card > strong {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-reference-topic-card > span {
    color: var(--rh-accent-mint);
}

html[data-theme="dark"] .rh-reference-topic-card__mini-table b {
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-reference-topic-card__mini-table span {
    color: #fbf2d8;
}

html[data-theme="dark"] :is(
    .rh-panel__lead,
    .rh-home-hero__lead,
    .rh-home-track-card p,
    .rh-module01-step-card p,
    .rh-hub-card p,
    .rh-hub-info-card p,
    .rh-reference-topic-card p,
    .rh-practice-module-band__subtitle,
    .rh-practice-module-band__summary,
    .rh-practice-foundation-card__copy,
    .rh-practice-card p,
    .rh-practice-batch-card p,
    .rh-detail-card p,
    .rh-detail-hero p) {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] :is(input, textarea, select, .rh-practice-input) {
    border-color: var(--rh-border-strong);
    background: #0e1424;
    color: var(--rh-text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] :is(input, textarea)::placeholder {
    color: #8792b1;
}

html[data-theme="dark"] .rh-button--ghost {
    border-color: #566483;
    background: rgba(18, 24, 43, 0.86);
    color: #edf1ff;
}

html[data-theme="dark"] .rh-button--ghost:hover {
    border-color: var(--rh-action);
    background: var(--rh-action-soft);
    color: #fff;
}

html[data-theme="dark"] .rh-button--dark {
    border-color: transparent;
    background: linear-gradient(135deg, #087ca8, #6656d8);
    color: #fff;
    box-shadow: 0 8px 22px rgba(26, 126, 178, 0.25);
}

html[data-theme="dark"] .rh-button--dark:hover {
    background: linear-gradient(135deg, #0d91bd, #7968ec);
}

html[data-theme="dark"] .rh-chip {
    border-color: rgba(97, 214, 255, 0.25);
    background: rgba(21, 54, 76, 0.72);
    color: #c8efff;
}

html[data-theme="dark"] :is(.rh-bottom-nav, .rh-practice-topbar, .rh-practice-footer) {
    border-color: var(--rh-border);
    background: rgba(12, 17, 32, 0.93);
    color: var(--rh-text);
    box-shadow: 0 -12px 32px rgba(1, 4, 14, 0.24);
    backdrop-filter: blur(18px);
}

html[data-theme="dark"] .rh-bottom-nav__link.active {
    background: linear-gradient(135deg, #087ca8, #6656d8);
    color: #fff;
}

html[data-theme="dark"] :is(.rh-ending-table__row--head, .rh-reference-topic-card__mini-table, .rh-case-reference-table > div) {
    background: rgba(12, 18, 35, 0.72);
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-stat-pill {
    border-color: var(--rh-border);
    background: rgba(16, 22, 38, 0.9);
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-score-strip__item {
    border-color: rgba(97, 214, 255, 0.14);
    background: rgba(12, 18, 34, 0.78);
}

html[data-theme="dark"] .rh-practice-score-strip__item span {
    color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-practice-score-strip__item strong {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-topbar__progress-track {
    background: #0e1424;
}

html[data-theme="dark"] .rh-practice-topbar__progress-track > span {
    background: linear-gradient(90deg, var(--rh-action), var(--rh-accent-mint));
}

html[data-theme="dark"] .rh-practice-batch-selector__option {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-practice-batch-selector__option--active {
    background: linear-gradient(135deg, var(--rh-action), var(--rh-accent-violet));
    color: #0a1020;
}

html[data-theme="dark"] .rh-practice-batch-selector__copy span {
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-practice-batch-selector__copy p {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-practice-batch-selector__options {
    border-color: var(--rh-border);
    background: #0e1424;
}

html[data-theme="dark"] .rh-practice-round-context {
    border-color: rgba(181, 156, 255, 0.3);
    background: linear-gradient(145deg, rgba(31, 29, 61, 0.96), rgba(17, 25, 43, 0.98));
}

html[data-theme="dark"] .rh-practice-round-context__item {
    border-color: rgba(97, 214, 255, 0.13);
    background: rgba(12, 18, 34, 0.76);
}

html[data-theme="dark"] .rh-practice-round-context__item span {
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-practice-round-context__item strong {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-round-context > p {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-practice-batch-panel__header {
    border-color: rgba(255, 150, 120, 0.3);
    background: linear-gradient(145deg, rgba(53, 30, 48, 0.94), rgba(20, 27, 48, 0.98));
}

html[data-theme="dark"] .rh-practice-batch-panel__header h1 {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-batch-panel__header p {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-practice-batch-card__source {
    border-color: rgba(97, 214, 255, 0.18);
    background: #101728;
}

html[data-theme="dark"] .rh-practice-batch-card__source strong {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-batch-card__source span {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-practice-input-shell {
    border-color: var(--rh-border-strong);
    background: #0e1424;
}

/* Complete dark surfaces for legacy practice and reference components. */
html[data-theme="dark"] .rh-practice-topbar__exit {
    border-color: var(--rh-border);
    background: #11182a;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-study-preview__facts > div {
    border: 1px solid rgba(97, 214, 255, 0.14);
    background: #101728;
}

html[data-theme="dark"] .rh-practice-study-preview__facts > div span {
    color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-practice-study-preview__facts > div strong {
    color: var(--rh-text);
}

html[data-theme="dark"] :is(
    .rh-practice-input-help,
    .rh-practice-sentence-card,
    .rh-practice-form-drill-card,
    .rh-practice-form-drill-card--question) {
    border-color: var(--rh-border);
    background: linear-gradient(145deg, rgba(27, 35, 64, 0.96), rgba(16, 23, 40, 0.99));
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-input-help__label {
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-practice-input-help__value,
html[data-theme="dark"] :is(.rh-practice-sentence, .rh-practice-sentence-card__support) {
    color: var(--rh-text);
}

html[data-theme="dark"] :is(
    .rh-practice-sentence-card__lead,
    .rh-practice-sentence-card__translation,
    .rh-practice-form-drill-card__lead,
    .rh-practice-form-drill-card__label,
    .rh-practice-form-drill-card__note) {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-practice-form-drill-card__item {
    border: 1px solid rgba(97, 214, 255, 0.13);
    background: #101728;
}

html[data-theme="dark"] .rh-practice-form-drill-card__item--answer {
    border-color: rgba(101, 230, 177, 0.3);
    background: var(--rh-success-soft);
}

html[data-theme="dark"] :is(
    .rh-practice-form-drill-card__value,
    .rh-practice-form-drill-card__answer) {
    color: var(--rh-text);
}

html[data-theme="dark"] :is(.rh-practice-module-build-cue, .rh-practice-noun-cue, .rh-practice-focus-intro) {
    border-color: rgba(97, 214, 255, 0.28);
    background: linear-gradient(135deg, rgba(21, 54, 76, 0.9), rgba(35, 30, 65, 0.94));
}

html[data-theme="dark"] .rh-practice-noun-cue--feedback {
    border-color: rgba(255, 150, 120, 0.3);
    background: linear-gradient(135deg, rgba(67, 32, 45, 0.92), rgba(31, 28, 61, 0.94));
}

html[data-theme="dark"] :is(.rh-practice-module-build-cue__formula, .rh-practice-noun-cue__formula) {
    background: #101728;
    color: #fbf2d8;
    box-shadow: inset 0 0 0 1px var(--rh-border);
}

html[data-theme="dark"] :is(.rh-practice-module-build-cue__facts span, .rh-practice-noun-cue__facts span) {
    background: rgba(12, 18, 34, 0.76);
    color: var(--rh-text-muted);
}

html[data-theme="dark"] :is(.rh-practice-module-build-cue__copy strong, .rh-practice-noun-cue__copy strong) {
    color: var(--rh-text);
}

html[data-theme="dark"] :is(.rh-practice-module-build-cue__copy p, .rh-practice-noun-cue__copy p) {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-practice-choice {
    border-color: var(--rh-border-strong);
    background: #11182a;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-choice:hover,
html[data-theme="dark"] .rh-practice-choice:focus-visible {
    border-color: var(--rh-action);
    background: var(--rh-action-soft);
    outline-color: rgba(97, 214, 255, 0.2);
}

html[data-theme="dark"] .rh-practice-hint-panel__item {
    border-color: var(--rh-border);
    background: #101728;
}

html[data-theme="dark"] .rh-practice-hint-panel__label {
    color: var(--rh-accent-violet);
}

html[data-theme="dark"] .rh-practice-hint-panel__value {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-practice-next-actions__link {
    border-color: var(--rh-border-strong);
    background: #11182a;
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-practice-next-actions__link:hover,
html[data-theme="dark"] .rh-practice-next-actions__link:focus-visible {
    background: var(--rh-action-soft);
    color: var(--rh-action-hover);
}

html[data-theme="dark"] .rh-reference-filter {
    border-color: var(--rh-border);
    background: #11182a;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-reference-filter strong {
    background: rgba(181, 156, 255, 0.14);
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-reference-filter:hover,
html[data-theme="dark"] .rh-reference-filter:focus-visible {
    border-color: var(--rh-action);
    background: var(--rh-action-soft);
}

html[data-theme="dark"] .rh-reference-filter.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #087ca8, #6656d8);
    color: #fff;
}

html[data-theme="dark"] .rh-tab {
    border-color: var(--rh-border);
    background: #11182a;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-tab--active,
html[data-theme="dark"] .rh-reference-page .rh-tab--active {
    border-color: transparent;
    background: linear-gradient(135deg, #087ca8, #6656d8);
    color: #fff;
}

html[data-theme="dark"] .rh-table-shell {
    border-color: var(--rh-border);
    background: #101728;
}

html[data-theme="dark"] .rh-table tbody tr {
    background: #101728;
}

html[data-theme="dark"] .rh-table tbody tr:nth-child(2n) {
    background: #151e33;
}

html[data-theme="dark"] .rh-table :is(th, td) {
    border-color: var(--rh-border);
}

html[data-theme="dark"] .rh-table tbody td:first-child {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] :is(.rh-table__form-text, .rh-table tbody td:not(:first-child)) {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-table__cell--buildable {
    background: rgba(97, 214, 255, 0.06);
}

html[data-theme="dark"] .rh-theme-toggle {
    border-color: rgba(181, 156, 255, 0.42);
    background: rgba(20, 26, 43, 0.92);
    color: var(--rh-accent-amber);
}

/* Curriculum uses distinct colour families so long lessons remain scannable. */
html[data-theme="dark"] :is(
    .rh-curriculum-progress,
    .rh-curriculum-lesson,
    .rh-curriculum-overview,
    .rh-curriculum-reference-hero,
    .rh-curriculum-launcher,
    .rh-curriculum-empty,
    .rh-curriculum-overview-card,
    .rh-curriculum-reference-card,
    .rh-curriculum-mastery,
    .rh-verified-examples,
    .rh-curriculum-lesson-list) {
    border-color: var(--rh-border);
    background: linear-gradient(145deg, rgba(27, 35, 64, 0.97), rgba(18, 24, 41, 0.99));
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-curriculum-overview {
    border-color: rgba(97, 214, 255, 0.42);
    background:
        radial-gradient(circle at 90% 10%, rgba(101, 230, 177, 0.15), transparent 16rem),
        linear-gradient(140deg, rgba(31, 45, 76, 0.98), rgba(25, 23, 53, 0.98));
}

html[data-theme="dark"] .rh-curriculum-reference-hero {
    border-color: rgba(181, 156, 255, 0.44);
    background: linear-gradient(140deg, rgba(47, 35, 82, 0.97), rgba(22, 28, 53, 0.99));
}

html[data-theme="dark"] .rh-curriculum-launcher {
    border-color: rgba(255, 150, 120, 0.4);
    background: linear-gradient(140deg, rgba(62, 34, 51, 0.96), rgba(23, 29, 51, 0.99));
}

html[data-theme="dark"] :is(.rh-curriculum-view-nav, .rh-lesson-stepper__item, .rh-curriculum-disclosure, .rh-verified-verb-card) {
    border-color: var(--rh-border);
    background: #11182a;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-curriculum-view-nav__link--active {
    background: linear-gradient(135deg, #087ca8, #6656d8);
    color: #fff;
    box-shadow: 0 6px 18px rgba(40, 111, 183, 0.28);
}

html[data-theme="dark"] .rh-curriculum-page--nouns .rh-curriculum-overview {
    border-color: rgba(101, 230, 177, 0.44);
    border-top-color: var(--rh-accent-mint);
    background:
        radial-gradient(circle at 92% 10%, rgba(255, 208, 106, 0.14), transparent 18rem),
        linear-gradient(140deg, rgba(24, 54, 53, 0.98), rgba(25, 23, 53, 0.98));
}

html[data-theme="dark"] .rh-curriculum-page--nouns .rh-curriculum-view-nav__link--active {
    background: linear-gradient(135deg, #157a63, #346f9e);
    box-shadow: 0 6px 18px rgba(31, 142, 114, 0.25);
}

html[data-theme="dark"] .rh-curriculum-page--nouns :is(
    .rh-curriculum-kicker,
    .rh-curriculum-breadcrumbs a,
    .rh-curriculum-table tbody th) {
    color: var(--rh-accent-mint);
}

html[data-theme="dark"] .rh-curriculum-page--nouns .rh-curriculum-callout--notice {
    border-color: rgba(101, 230, 177, 0.36);
    background: linear-gradient(135deg, rgba(24, 65, 58, 0.92), rgba(31, 28, 61, 0.9));
}

html[data-theme="dark"] .rh-mini-check__feedback--neutral {
    border-color: var(--rh-border);
    background: #101728;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-lesson-stepper__item--current {
    border-color: var(--rh-action);
    box-shadow: 0 0 0 2px rgba(97, 214, 255, 0.15);
}

html[data-theme="dark"] .rh-curriculum-section {
    padding: 1rem;
    border-radius: var(--rh-radius-control);
    background: rgba(12, 18, 34, 0.42);
}

html[data-theme="dark"] :is(.rh-worked-example, .rh-curriculum-callout--notice) {
    border-color: rgba(97, 214, 255, 0.4);
    background: linear-gradient(135deg, rgba(21, 54, 76, 0.92), rgba(31, 28, 61, 0.9));
}

html[data-theme="dark"] .rh-curriculum-callout--warning {
    border-color: rgba(255, 208, 106, 0.48);
    background: linear-gradient(135deg, rgba(59, 45, 22, 0.94), rgba(58, 29, 40, 0.86));
}

html[data-theme="dark"] .rh-mini-check {
    border-color: rgba(181, 156, 255, 0.38);
    background: linear-gradient(145deg, rgba(39, 32, 72, 0.94), rgba(17, 24, 43, 0.98));
}

html[data-theme="dark"] .rh-mini-check__option {
    border-color: #465371;
    background: #11182a;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-mini-check__option:hover:not(:disabled) {
    border-color: var(--rh-action);
    background: var(--rh-action-soft);
}

html[data-theme="dark"] .rh-mini-check__option--correct {
    border-color: var(--rh-success);
    background: var(--rh-success-soft);
}

html[data-theme="dark"] .rh-mini-check__option--incorrect {
    border-color: var(--rh-danger);
    background: var(--rh-danger-soft);
}

html[data-theme="dark"] :is(.rh-curriculum-table-wrap, .rh-curriculum-table) {
    border-color: var(--rh-border);
    background: #101728;
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-curriculum-table thead th {
    background: linear-gradient(90deg, rgba(49, 39, 86, 0.96), rgba(20, 51, 69, 0.96));
    color: #e2e6fb;
}

html[data-theme="dark"] .rh-curriculum-table :is(th, td) {
    border-color: var(--rh-border);
}

html[data-theme="dark"] .rh-curriculum-table td {
    color: #fbf2d8;
}

html[data-theme="dark"] .rh-curriculum-overview-card--boundary {
    border-color: rgba(255, 150, 120, 0.34);
    background: linear-gradient(145deg, rgba(57, 30, 43, 0.84), rgba(18, 24, 41, 0.98));
}

html[data-theme="dark"] .rh-curriculum-lesson-list__item a {
    border-color: var(--rh-border);
    background: rgba(15, 22, 39, 0.94);
}

html[data-theme="dark"] .rh-curriculum-next-module {
    border-color: rgba(101, 230, 177, 0.35);
    background: linear-gradient(135deg, rgba(18, 56, 47, 0.86), rgba(26, 27, 55, 0.95));
}

html[data-theme="dark"] .rh-curriculum-batch-card {
    border-color: var(--rh-border-strong);
    background: #11182a;
}

html[data-theme="dark"] .rh-curriculum-batch-card--recommended {
    border-color: var(--rh-accent-coral);
    background: linear-gradient(145deg, rgba(73, 36, 50, 0.92), rgba(32, 31, 66, 0.96));
}

html[data-theme="dark"] .rh-curriculum-lesson-actions {
    border-color: #53607f;
    background: rgba(14, 20, 37, 0.94);
}

/* Theme completion for results, lexical tables, and verified noun surfaces. */
html[data-theme="dark"] :is(
    .rh-practice-batch-card__result,
    .rh-practice-review-card__prompt,
    .rh-practice-review-card__answers > div,
    .rh-practice-review-result,
    .rh-practice-complete-stat,
    .rh-practice-complete-highlights__chip,
    .rh-past-card,
    .rh-reference-page .rh-past-card,
    .rh-reference-page .rh-reference-build__intro,
    .rh-reference-page .rh-reference-build__option,
    .rh-reflexive-morphology,
    .rh-related-verb-family > div,
    .rh-related-verb-card,
    .rh-verb-tense-note,
    .rh-noun-table-wrap,
    .rh-noun-build-example,
    .rh-noun-build-disclosure summary,
    .rh-noun-build-grid article,
    .rh-reference-preview-card,
    .rh-reference-preview-table-wrap,
    .rh-home-track-progress,
    .rh-reference-type-diagnostic,
    .rh-reference-type-diagnostic__cards article,
    .rh-curriculum-type-diagnostic,
    .rh-curriculum-type-diagnostic__grid article) {
    border-color: var(--rh-border);
    background: var(--rh-surface-subtle);
    color: var(--rh-text);
    box-shadow: none;
}

html[data-theme="dark"] .rh-past-card--accent,
html[data-theme="dark"] .rh-reference-page .rh-past-card--accent {
    border-color: rgba(255, 143, 163, 0.38);
    background: linear-gradient(145deg, rgba(67, 32, 45, 0.9), rgba(19, 28, 48, 0.98));
}

html[data-theme="dark"] .rh-practice-batch-card--correct .rh-practice-batch-card__result,
html[data-theme="dark"] .rh-practice-review-result--correct {
    border-color: rgba(101, 230, 177, 0.42);
    background: var(--rh-success-soft);
}

html[data-theme="dark"] .rh-practice-batch-card--incorrect .rh-practice-batch-card__result,
html[data-theme="dark"] .rh-practice-review-result--incorrect {
    border-color: rgba(255, 143, 163, 0.42);
    background: var(--rh-danger-soft);
}

html[data-theme="dark"] :is(
    .rh-practice-batch-card__result strong,
    .rh-practice-review-result strong,
    .rh-practice-complete-stat strong,
    .rh-past-card h3,
    .rh-past-card dd,
    .rh-reference-build__intro h3,
    .rh-reference-build__option strong,
    .rh-noun-card__heading strong,
    .rh-related-verb-family strong,
    .rh-reflexive-morphology > strong) {
    color: var(--rh-text);
}

html[data-theme="dark"] :is(
    .rh-practice-batch-card__result p,
    .rh-practice-batch-card__result span,
    .rh-practice-review-result p,
    .rh-practice-review-result span,
    .rh-practice-complete-stat span,
    .rh-past-card dt,
    .rh-noun-card p,
    .rh-related-verb-family p,
    .rh-related-verb-family small,
    .rh-reflexive-morphology p,
    .rh-verb-tense-note p) {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-reference-page .rh-reference-build__option--active {
    border-color: var(--rh-action);
    background: var(--rh-action-soft);
}

html[data-theme="dark"] .rh-lexical-form-table,
html[data-theme="dark"] .rh-noun-table-wrap {
    border-color: var(--rh-border);
    background: #101728;
}

html[data-theme="dark"] .rh-lexical-form-table__row,
html[data-theme="dark"] .rh-noun-table :is(th, td) {
    border-color: var(--rh-border);
}

html[data-theme="dark"] .rh-lexical-form-table__row--head,
html[data-theme="dark"] .rh-noun-table thead th {
    background: #151e33;
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-lexical-form-table__row > :last-child,
html[data-theme="dark"] .rh-noun-table tbody td {
    color: var(--rh-text);
}

html[data-theme="dark"] .rh-noun-filter-grid select {
    border-color: var(--rh-border-strong);
    background: #0e1424;
    color: var(--rh-text);
}

html[data-theme="dark"] :is(
    .rh-noun-card,
    .rh-noun-detail__hero).rh-noun-gender--masculine,
html[data-theme="dark"] :is(
    .rh-noun-card,
    .rh-noun-detail__hero).rh-noun-gender--feminine,
html[data-theme="dark"] :is(
    .rh-noun-card,
    .rh-noun-detail__hero).rh-noun-gender--neuter,
html[data-theme="dark"] :is(
    .rh-noun-card,
    .rh-noun-detail__hero).rh-noun-gender--special {
    border-color: var(--rh-noun-theme-border);
    background: var(--rh-noun-theme-surface);
    color: var(--rh-text);
    box-shadow: var(--rh-shadow-1);
}

html[data-theme="dark"] :is(
    .rh-noun-card__arrow,
    .rh-noun-card__meta,
    .rh-noun-detail__back,
    .rh-noun-detail__primary-meta) {
    color: var(--rh-noun-theme-accent, var(--rh-action));
}

html[data-theme="dark"] .rh-reference-preview-table-wrap {
    border-color: var(--rh-border);
    background: #101728;
}

html[data-theme="dark"] .rh-reference-preview-table :is(th, td) {
    border-color: var(--rh-border);
}

html[data-theme="dark"] .rh-reference-preview-table thead th {
    background: var(--rh-action-soft);
    color: var(--rh-action);
}

html[data-theme="dark"] .rh-reference-preview-grid--nouns .rh-reference-preview-table thead th {
    background: var(--rh-success-soft);
    color: var(--rh-success);
}

html[data-theme="dark"] :is(
    .rh-build-card__lesson-pill,
    .rh-build-card__lesson-note,
    .rh-build-card__step,
    .rh-build-card__expression) {
    border-color: var(--rh-border);
    background: #101728;
    color: var(--rh-text);
    box-shadow: none;
}

html[data-theme="dark"] :is(
    .rh-build-card__lesson-pill--active,
    .rh-build-card__step--active) {
    border-color: color-mix(in srgb, var(--rh-action) 42%, var(--rh-border));
    background: var(--rh-action-soft);
}

html[data-theme="dark"] .rh-build-card__step--result {
    border-color: color-mix(in srgb, var(--rh-success) 36%, var(--rh-border));
    background: color-mix(in srgb, var(--rh-success-soft) 58%, #101728);
}

html[data-theme="dark"] :is(
    .rh-build-card__lesson-pill-value,
    .rh-build-card__value--selection,
    .rh-build-card__value--surface,
    .rh-build-card__expression-surface) {
    color: var(--rh-text);
}

html[data-theme="dark"] :is(
    .rh-build-card__lesson-pill-label,
    .rh-build-card__label,
    .rh-build-card__detail,
    .rh-build-card__operator) {
    color: var(--rh-text-muted);
}

html[data-theme="dark"] .rh-build-card__value--stem,
html[data-theme="dark"] .rh-build-card__expression-part--stem {
    color: var(--rh-action);
}

html[data-theme="dark"] :is(
    .rh-build-card__value--ending,
    .rh-build-card__value--filter,
    .rh-build-card__expression-part--ending,
    .rh-build-card__expression-part--filter) {
    color: var(--rh-danger);
}

html[data-theme="dark"] .rh-build-card__chip {
    background: var(--rh-action-soft);
    color: var(--rh-action);
}

@media (forced-colors: active) {
    .rh-theme-toggle,
    .rh-curriculum-view-nav__link,
    .rh-mini-check__option,
    .rh-button {
        forced-color-adjust: auto;
    }
}
