/* Shared operation roles v1.5.0. Components read the current color scope.
 * Palette authoring: assets/theme/palettes.json. Fixed category/teaching colors
 * remain in their own systems. Platform pages inherit platform roles; subject
 * pages inherit registered subject roles. No theme-name conditions belong here. */
html[data-psylearn-theme] body.learn-home-page .mobile-profile-avatar {
    background: var(--ui-action-fill);
    color: var(--ui-on-action);
}
html[data-psylearn-theme] body.recitation-workspace-page .chapter-meta-item i {
    color: var(--ui-icon);
}
html[data-psylearn-theme] body.recitation-workspace-page .question-round-entry {
    color: var(--ui-text-accent);
    background: var(--ui-selected-bg);
}
html[data-psylearn-theme] body.recitation-workspace-page .question-item:is(:hover, :focus-visible) .question-round-entry {
    color: var(--ui-text-accent);
    background: var(--ui-accent-tint);
}
html[data-psylearn-theme] body.qb-page {
    --qb-accent: var(--ui-action);
    --qb-accent-dark: var(--ui-action-hover);
    --qb-soft: var(--ui-selected-bg);
    --qd-pink: var(--ui-action);
    --qd-pink-soft: var(--ui-selected-bg);
}
html[data-psylearn-theme] body.recitation-workspace-page .subject-sidebar-back:is(:hover, :focus-visible) {
    color: var(--ui-text-muted);
    background: var(--ui-bg-soft);
}
html[data-psylearn-theme] body.recitation-point-page {
    --brand-pink: var(--ui-action);
    --brand-pink-2: var(--ui-action-lift);
    --recitation-accent-soft: var(--ui-selected-bg);
}
html[data-psylearn-theme] body.recitation-settings-page {
    --pl-decoration: var(--pl-category-statistics-ink);
}
html[data-psylearn-theme] :is(
    body.qb-page .qd-primary,
    body.qb-page .qb-btn--primary,
    body.recitation-settings-page .btn-primary,
    body.recitation-settings-page input:checked + .toggle-slider,
    body.recitation-point-page .btn-primary,
    body.recitation-point-page .or-btn-tts,
    body.recitation-point-page .or-btn-rec,
    body.recitation-point-page .or-btn-next,
    body.recitation-point-page .r6-btn-primary
) { background: var(--ui-action-fill); }
html[data-psylearn-theme] :is(
    body.qb-page .qd-primary,
    body.qb-page .qb-btn--primary,
    body.recitation-settings-page .btn-primary,
    body.recitation-point-page .btn-primary,
    body.recitation-point-page .or-btn-tts,
    body.recitation-point-page .or-btn-rec,
    body.recitation-point-page .or-btn-next,
    body.recitation-point-page .r6-btn-primary
):hover:not(:disabled) { background: var(--ui-action-hover); }
html[data-psylearn-theme] :is(body.recitation-settings-page, body.recitation-point-page) .back-nav {
    color: var(--ui-text-muted);
}
html[data-psylearn-theme] :is(body.recitation-settings-page, body.recitation-point-page) .back-nav:hover {
    background: var(--ui-bg-soft);
    box-shadow: var(--ui-shadow-subtle);
}
html[data-psylearn-theme] body.recitation-point-page :is(.question-badge, .round-pill.active) {
    color: var(--ui-on-action);
    background: var(--ui-action-fill);
}
html[data-psylearn-theme] body.recitation-point-page :is(.question-meta-item i, .round-title i, .settings-fab),
html[data-psylearn-theme] body.recitation-settings-page .section-header i {
    color: var(--ui-icon);
}
html[data-psylearn-theme] body.recitation-point-page .subject-chapter-badge .badge-subject {
    color: var(--ui-text-accent);
}
html[data-psylearn-theme] body.recitation-settings-page .toast:not(.show) {
    visibility: hidden;
    pointer-events: none;
}
/* Catalog emphasis belongs to the same subject scope as the lesson UI.
 * Completed/migrated/planned semantic status selectors stay independent. */
html[data-psylearn-theme] body.learn-course-catalog-page :is(.hero-badge, .hero-stat-available, .tag-core) {
    color: var(--ui-emphasis);
    background: var(--ui-emphasis-soft);
}
html[data-psylearn-theme] body.learn-course-catalog-page :is(.hero-stat i, .hero-stat .stat-value) {
    color: var(--ui-emphasis);
}
html[data-psylearn-theme] body.learn-course-catalog-page .chapter-num {
    color: var(--ui-emphasis);
    background: linear-gradient(135deg, var(--ui-emphasis-soft), var(--ui-emphasis-tint));
}
html[data-psylearn-theme] body.learn-course-catalog-page .part-tab.active {
    color: var(--ui-on-action);
    background: var(--ui-emphasis-fill);
}
html[data-psylearn-theme] body.learn-course-catalog-page .chapter-card.expanded {
    box-shadow: 0 4px 20px var(--ui-overlay-120);
}
html[data-psylearn-theme] body.learn-course-catalog-page .status-available {
    color: var(--ui-on-action);
    background: var(--ui-emphasis);
}


/* Catalog ambient wash belongs to the same palette, not a leftover pink frame. */
html[data-psylearn-theme] body.learn-course-catalog-page {
    background: linear-gradient(150deg, var(--ui-ambient-start) 0%, var(--ui-ambient-mid) 40%, var(--ui-ambient-end) 100%);
}
