/* Shared operation roles v1.4.0. Both themes use these exact selectors.
 * Palette authoring: assets/theme/palettes.json. Fixed category/teaching colors
 * remain in their own systems. No theme-name conditions are allowed here. */
html[data-psylearn-theme] body.learn-home-page .mobile-profile-avatar {
    background: var(--pl-action-fill);
    color: var(--pl-on-action);
}
html[data-psylearn-theme] body.recitation-workspace-page .chapter-meta-item i {
    color: var(--pl-icon);
}
html[data-psylearn-theme] body.recitation-workspace-page .question-round-entry {
    color: var(--pl-text-accent);
    background: var(--pl-selected-bg);
}
html[data-psylearn-theme] body.recitation-workspace-page .question-item:is(:hover, :focus-visible) .question-round-entry {
    color: var(--pl-text-accent);
    background: var(--pl-accent-tint);
}
html[data-psylearn-theme] body.qb-page {
    --qb-accent: var(--pl-action);
    --qb-accent-dark: var(--pl-action-hover);
    --qb-soft: var(--pl-selected-bg);
    --qd-pink: var(--pl-action);
    --qd-pink-soft: var(--pl-selected-bg);
}
html[data-psylearn-theme] body.recitation-workspace-page .subject-sidebar-back:is(:hover, :focus-visible) {
    color: var(--pl-text-muted);
    background: var(--pl-bg-soft);
}
html[data-psylearn-theme] body.recitation-point-page {
    --brand-pink: var(--pl-action);
    --brand-pink-2: var(--pl-action-lift);
    --recitation-accent-soft: var(--pl-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(--pl-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(--pl-action-hover); }
html[data-psylearn-theme] :is(body.recitation-settings-page, body.recitation-point-page) .back-nav {
    color: var(--pl-text-muted);
}
html[data-psylearn-theme] :is(body.recitation-settings-page, body.recitation-point-page) .back-nav:hover {
    background: var(--pl-bg-soft);
    box-shadow: var(--pl-shadow-subtle);
}
html[data-psylearn-theme] body.recitation-point-page :is(.question-badge, .round-pill.active) {
    color: var(--pl-on-action);
    background: var(--pl-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(--pl-icon);
}
html[data-psylearn-theme] body.recitation-point-page .subject-chapter-badge .badge-subject {
    color: var(--pl-text-accent);
}
html[data-psylearn-theme] body.recitation-settings-page .toast:not(.show) {
    visibility: hidden;
    pointer-events: none;
}
/* These catalog labels/numbers are emphasis, not the subject's brand identity.
 * Category colors stay on the course icon tiles. Completed/migrated/planned
 * status selectors are deliberately absent. */
html[data-psylearn-theme] body.learn-course-catalog-page .hero-badge,
html[data-psylearn-theme] body.learn-course-catalog-page .hero-stat-available,
html[data-psylearn-theme] body.learn-course-catalog-page .tag-core {
    color: var(--pl-emphasis);
    background: var(--pl-emphasis-soft);
}
html[data-psylearn-theme] body.learn-course-catalog-page .hero-stat i,
html[data-psylearn-theme] body.learn-course-catalog-page .hero-stat .stat-value {
    color: var(--pl-emphasis);
}
html[data-psylearn-theme] body.learn-course-catalog-page .chapter-num {
    color: var(--pl-emphasis);
    background: linear-gradient(135deg, var(--pl-emphasis-soft), var(--pl-emphasis-tint));
}
html[data-psylearn-theme] body.learn-course-catalog-page .part-tab.active {
    color: var(--pl-on-action);
    background: var(--pl-emphasis-fill);
}
html[data-psylearn-theme] body.learn-course-catalog-page .chapter-card.expanded {
    box-shadow: 0 4px 20px var(--pl-overlay-120);
}
html[data-psylearn-theme] body.learn-course-catalog-page .status-available {
    color: var(--pl-on-action);
    background: var(--pl-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(--pl-ambient-start) 0%, var(--pl-ambient-mid) 40%, var(--pl-ambient-end) 100%);
}

/* Catalog navigation must inherit the theme even in WebView 71, which ignores :where(). */
html[data-psylearn-theme] body.learn-course-catalog-page .back-nav {
    color: var(--pl-text-muted);
}
