/* PeakFour | Universe dark surface parity.
   Source selectors: dictionary (dictionary.css, dictionary-engagement.css,
   dark-elevation.css, ui-integrity.css); shared panels from the existing
   source feature modules.  No lesson data, status or engine changes.

   The page is one universe canvas. Layout frames are transparent, semantic
   panels are a luminous glass tint, their nested cards are lighter and
   quieter. Do not repaint media, semantic answers, tooltips or dialogs. */
:root[data-pf-theme="dark"] {
  --pf-u-dark-glass: rgba(150,177,255,.135);
  --pf-u-dark-inset: rgba(168,196,255,.075);
  --pf-u-dark-field: rgba(166,194,255,.145);
  --pf-u-dark-border: rgba(180,211,255,.20);
  --pf-u-dark-shadow: 0 8px 28px rgba(3,9,27,.085), inset 0 1px 0 rgba(235,245,255,.065);
}
/* Legacy module rules painted navy across entire screens, hiding the shared
   ambient-background.css scene behind the contents. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main > :is(
  #page-discover,#page-lessons,#page-chunking,#page-dictation,#page-vocabulary,
  #page-grammar,#page-profile,#page-shadowing,#page-alphabet,#page-listening,
  #page-pronunciation,#page-numbers,#page-counting,#page-recall,#page-guess,
  #page-cloze,#page-sentence-writing,#page-word-guess,#page-listening-cloze,
  #page-writing,#page-visual-guess,#page-cms
),
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary.pf-dictionary-v3,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-discover .pf-hub-top,#page-discover .pf-d-workspace,
  #page-discover .pf-d-dashboard,#page-discover .pf47-dashboard,
  #page-lessons .pf69-layout,#page-lessons .pf69-content,
  #page-chunking .pf100-layout,#page-chunking .pf-ls-workspace-grid,
  #page-chunking .pf-ls-practice-column,#page-chunking .pf-i-chunk-browser,
  #page-dictation .dictation-layout,#page-dictation .dictation-workspace,
  #page-dictation .dictation-main,#page-vocabulary .pf-d3-columns,
  #page-vocabulary .pf-d3-workspace,#page-profile .pf85-profile-shell,
  #page-profile .pf-profile-dashboard,#page-shadowing .pfs-layout,
  #page-shadowing .pfs-content,#page-grammar .pf-grammar-layout,
  #page-numbers .numbers-layout,#page-listening .contrast-layout
) {
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
/* Dictionary: the dark full-width header in the screenshot comes from
   ui-integrity.css dark #1E293B !important; light has no corresponding paint. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d3-header {
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  border-color:transparent!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
/* Search needs a single legible input frame; it should not be black. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d3-search-frame.pf-uiverse-search,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d3-header-actions select {
  background:var(--pf-u-dark-field)!important;
  background-image:none!important;
  color:#f3f7ff!important;
  border-color:var(--pf-u-dark-border)!important;
  box-shadow:none!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d3-search-frame :is(input,.pf-uiverse-search-icon),
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-uiverse-search-host {
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
/* Large panel glass. Explicit source-known selectors, never blind global div
   selectors (which would harm media, keyboard focus and answer states). */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-discover .pf-hub-welcome,#page-discover .pf-hub-skills,
  #page-discover .pf-d-intro,#page-discover .pf-d-path,
  #page-discover .pf-d-related,#page-discover .pf-i-journey,
  #page-discover .pf41-panel,#page-discover .pf47-panel,
  #page-discover .pf41-feature,#page-discover .pf47-summary,
  #page-discover .pf-d-card,#page-discover .pf17-skill-card,
  #page-lessons .pf-lesson-directory-head,#page-lessons .pf-directory-section,
  #page-lessons .pf-directory-card,#page-lessons .pf-academic-card,
  #page-lessons .pf-hub-welcome,#page-lessons .pf-hub-skills,
  #page-chunking .pf100-topics-panel,#page-chunking .pf100-lessons-panel,
  #page-chunking .pf-ls-heading,#page-chunking .pf-ls-context-panel,
  #page-chunking .pf-chunk-session-content,#page-chunking .pf-ls-catalog-hero,
  #page-chunking .pf-ls-catalog-summary,#page-chunking .pf-ch94-chapter,
  #page-dictation .dictation-catalog,#page-dictation .dictation-stage,
  #page-dictation .dictation-dialogue,#page-dictation .dictation-scene,
  #page-dictation .dictation-speaking,#page-dictation .dictation-writing,
  #page-dictation .dictation-audio-card,#page-dictation .pf20-workspace-panel,
  #page-dictation .pf24-topic-chooser,#page-dictation .pf24-lesson-list,
  #page-vocabulary .pf-d9-quiz,#page-vocabulary .pf-d9-daily,
  #page-vocabulary .pf-d9-summary,#page-vocabulary .pf-d3-side-card,
  #page-vocabulary .pf-d3-info-card,#page-vocabulary .pf-d3-results-panel,
  #page-vocabulary .pf-d3-no-results,#page-vocabulary .vocab-detail-shell,
  #page-vocabulary .vocab-list-shell,#page-vocabulary .pf-d4-search-panel,
  #page-vocabulary .pf-d4-results-announcement,#page-vocabulary .pf-d4-loading-state,
  #page-grammar .pf-grammar-hero,#page-grammar .pf-grammar-card,
  #page-grammar .pf-grammar-detail,#page-grammar .pf-grammar-concept,
  #page-grammar .pf-grammar-practice,#page-grammar .pf-grammar-quiz,
  #page-profile .pf-profile-hero,#page-profile .pf-profile-panel,
  #page-profile .pf-profile-identity,#page-profile .pf-profile-settings,
  #page-profile .pf-profile-overview article,#page-profile .pf85-widget,
  #page-profile .pf85-attendance,#page-profile .pf85-profile-nav,
  #page-shadowing .pfs-primary,#page-shadowing .pfs-library,
  #page-shadowing .pfs-player-panel,#page-shadowing .pf56-transcript-panel,
  #page-shadowing .pf56-dictation-panel,
  #page-listening .pf-sw-heading,#page-listening .contrast-card,
  #page-listening .contrast-sound-card,#page-listening .listening-config,
  #page-listening .phoneme-study,#page-listening .phoneme-learning-card,
  #page-pronunciation .sentence-card,#page-pronunciation .record-panel,
  #page-pronunciation .practice-panel,#page-pronunciation .steps-panel,
  #page-numbers .numbers-catalog,#page-numbers .numbers-stage,
  #page-numbers .numbers-exercise,#page-counting .counting-panel,
  #page-counting .counting-card,#page-alphabet .pf-alpha-section,
  #page-alphabet .pf-alpha-card,#page-alphabet .pf-alpha-practice,
  #page-recall .pf106-practice,#page-guess .pf53-guess-library,
  #page-cloze .pf36-card,#page-cms .pfc-panel,#page-cms .pfc-card
) {
  background:var(--pf-u-dark-glass)!important;
  background-image:none!important;
  border-color:var(--pf-u-dark-border)!important;
  box-shadow:var(--pf-u-dark-shadow)!important;
  -webkit-backdrop-filter:blur(8px) saturate(1.15)!important;
  backdrop-filter:blur(8px) saturate(1.15)!important;
}
/* Secondary containers: no stacked dark slabs. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-discover .pf-d-topic,#page-discover .pf47-task,
  #page-discover .pf17-profile-link,#page-lessons .pf-academic-card-footer,
  #page-chunking .pf100-topic-card:not(.is-selected),
  #page-chunking .pf100-lesson-card,#page-chunking .pf-ls-context-section,
  #page-chunking .pf-chunk-mainphrase,#page-chunking .pf-chunk-slot,
  #page-chunking .pf-chunk-card,#page-chunking .pf-chunk-phase-card,
  #page-chunking .pf-chunk-meaning-card,
  #page-dictation .dictation-lesson-card,#page-dictation .dictation-dialogue-card,
  #page-dictation .dictation-history-item,#page-dictation .dictation-metrics > div,
  #page-vocabulary .pf-d3-aux-filters,
  #page-vocabulary .vocab-sense,#page-vocabulary .vocab-context-card,
  #page-vocabulary .vocab-example,#page-vocabulary .pf-d3-results-item,
  #page-vocabulary .pf-d9-quiz-card,#page-vocabulary .pf-d9-summary-card,
  #page-grammar .pf-grammar-subtopic,#page-grammar .pf-grammar-example,
  #page-profile .pf-test-stage,#page-profile .pf-test-passage,
  #page-shadowing .pfs-clip-card,#page-shadowing .pfs-cue:not(.is-speaking),
  #page-listening .phoneme-study-detail,#page-listening .phoneme-study-example,
  #page-numbers .numbers-hint,#page-recall .pf106-topic-card,
  #page-guess .pf53-guess-tile
) {
  background:var(--pf-u-dark-inset)!important;
  background-image:none!important;
  border-color:var(--pf-u-dark-border)!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
/* Dictionary secondary buttons are currently near-black pills; light theme
   has pale pills. Preserve selected and correct/incorrect feedback colors. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d9-search-filters button:not([aria-pressed="true"]),
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d9-quiz-options button:not(.is-correct):not(.is-incorrect):not(.is-selected):not([aria-pressed="true"]),
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d9-recent-tags button {
  background:var(--pf-u-dark-field)!important;
  color:#f0f5ff!important;
  border-color:var(--pf-u-dark-border)!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary :is(.pf-d9-quiz,.pf-d9-summary,.pf-d3-header) :is(h2,h3,strong) {color:#f8fbff!important;}
/* Preserve readable card color and visible focus while avoiding hard black
   on dark controls. Do not touch quiz result or state-specific background. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d9-quiz-options button:not(.is-correct):not(.is-incorrect):focus-visible {
  outline:2px solid #99c9ff!important;
  outline-offset:2px!important;
}
/* Full-width dark gradient hero blocks should show the Universe too, without
   modifying promotional images or their overlaid text. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-lessons .pf69-hero,#page-discover .pf-d-featured,
  #page-discover .pf17-hero,#page-profile .pf-profile-insights
) {
  background:linear-gradient(120deg,rgba(75,128,225,.16),rgba(154,104,225,.085))!important;
  border-color:var(--pf-u-dark-border)!important;
  box-shadow:var(--pf-u-dark-shadow)!important;
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-pf-theme="dark"] {
    --pf-u-dark-glass:rgba(25,37,70,.88);
    --pf-u-dark-inset:rgba(25,37,70,.82);
    --pf-u-dark-field:rgba(38,51,90,.95);
  }
}
@media print {
  :root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
    #page-vocabulary .pf-d9-quiz,#page-chunking .pf100-topics-panel,
    #page-dictation .dictation-stage,#page-profile .pf-profile-panel
  ) {background:#fff!important;color:#111827!important;}
}
