/* PeakFour — Dark Universe surface reconciliation (source-backed selectors).
   Loaded last in index.html and templates/index.html. The original modules own
   their content and interaction; this stylesheet only reconciles visual layers.
   Canvas remains continuous. Panels have tinted transparency instead of opaque
   navy; interactive, success/error, selected-state, video, photos are preserved. */
:root[data-pf-theme="dark"] {
  --pf-uall-panel: rgba(138, 174, 250, .115);
  --pf-uall-card: rgba(155, 190, 255, .17);
  --pf-uall-inset: rgba(166, 194, 255, .095);
  --pf-uall-field: rgba(160, 193, 255, .19);
  --pf-uall-hover: rgba(173, 207, 255, .235);
  --pf-uall-border: rgba(193, 218, 255, .235);
  --pf-uall-border-inner: rgba(193, 218, 255, .18);
  --pf-uall-text: #f5f9ff;
  --pf-uall-subtext: #dbe7fc;
}
/* Layout skeletons have no independent navy canvas. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-lessons .pf-directory-groups,#page-lessons .pf-directory-card-grid,
  #page-lessons .pf69-skill-library,#page-lessons .pf69-skill-list,
  #page-lessons .pf-academic-section-grid,#page-lessons .pf69-layout,
  #page-discover .pf47-page,#page-discover .pf41-dashboard,#page-discover .pf47-dashboard,
  #page-chunking .pf100-catalog,#page-chunking .pf100-layout,#page-chunking .pf-i-chunk-browser,
  #page-dictation .dictation-layout,#page-dictation .dictation-workspace,
  #page-shadowing .pfs-layout,#page-shadowing .pfs-content,#page-shadowing .pfs-stage:not(.pf53-in-detail),
  #page-grammar .pf-grammar-layout,#page-profile .pf-profile-dashboard,
  #page-vocabulary .pf-d3-columns,#page-listening .contrast-layout,
  #page-numbers .numbers-layout,#page-counting .pf-counting-layout
) {
  background: transparent!important;
  background-image: none!important;
  box-shadow: none!important;
}
/* Major content regions on every existing studio, including the dynamically
   constructed skill library sections that were missed in the previous pass. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-lessons .pf-directory-group,#page-lessons .pf-academic-explore,
  #page-lessons .pf-lesson-directory-head:not(.pf69-hero),
  #page-lessons .pf-directory-foot,#page-lessons .pf69-catalog-panel,
  #page-discover .pf47-panel,#page-discover .pf41-panel,
  #page-discover .pf-d-card,#page-discover .pf-d-featured,
  #page-chunking .pf-ls-context-panel,#page-chunking .pf-ls-catalog-hero,
  #page-chunking .pf-ls-catalog-summary,#page-chunking .pf100-topics-panel,
  #page-chunking .pf100-lessons-panel,#page-chunking .pf-ch94-chapter,
  #page-chunking .pf-chunk-session-content,#page-chunking .pf-chunk-card,
  #page-dictation .dictation-catalog,#page-dictation .dictation-stage,
  #page-dictation .dictation-scene,#page-dictation .dictation-speaking,
  #page-dictation .dictation-writing,#page-dictation .dictation-dialogue,
  #page-dictation .dictation-audio-card,#page-dictation .pf24-topic-chooser,
  #page-dictation .pf24-lesson-list,#page-dictation .pf20-workspace-panel,
  #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 .pf85-widget,#page-profile .pf85-attendance,
  #page-shadowing .pfs-library,#page-shadowing .pfs-primary,
  #page-shadowing .pfs-player,#page-shadowing .pfs-record,
  #page-shadowing .pfs-transcript-wrap,#page-shadowing .pf62-rail-card,
  #page-shadowing .pf56-transcript-panel,#page-shadowing .pf56-dictation-panel,
  #page-alphabet .pf-alpha-intro,#page-alphabet .pf-alpha-section,
  #page-alphabet .pf-alpha-practice,#page-alphabet .pf-alpha-status,
  #page-listening .contrast-card,#page-listening .phoneme-study,
  #page-listening .contrast-lesson-overview,#page-listening .contrast-footnote,
  #page-pronunciation .panel:not(.error-panel):not(.success-panel),
  #page-pronunciation .practice-panel,#page-pronunciation .pf117-score,
  #page-pronunciation .pf-sw-heading,#page-pronunciation .sentence-card,
  #page-pronunciation .record-panel,#page-pronunciation .steps-panel,
  #page-numbers .numbers-catalog,#page-numbers .numbers-stage,
  #page-numbers .numbers-audio,#page-numbers .numbers-exercise,
  #page-numbers .numbers-practice-summary,
  #page-counting .pf-counting-head,#page-counting .pf-counting-index,
  #page-counting .pf-counting-workspace,#page-counting .pf-counting-panel,
  #page-counting .pf-counting-feature,
  #page-recall .pf106-everyday,#page-recall .pf106-practice,
  #page-guess .pf53-guess-library,#page-guess .pf77-scene-pack,
  #page-cloze .pf36-card,#page-cloze .pf38-standalone,
  #page-cms .pfc-head,#page-cms .pfc-tabs,
  #page-cms .pfc-panel,#page-cms .pfc-card,
  #page-cms .pf57-caption-import,
  #page-vocabulary .pf-d9-quiz,#page-vocabulary .pf-d9-daily,
  #page-vocabulary .pf-d3-results-panel,#page-vocabulary .pf-d3-side-card,
  #page-vocabulary .vocab-detail-shell,#page-vocabulary .vocab-list-shell
) {
  background: var(--pf-uall-panel)!important;
  background-image: none!important;
  border-color: var(--pf-uall-border)!important;
  box-shadow: 0 9px 24px rgba(3,9,30,.085)!important;
  -webkit-backdrop-filter: blur(8px) saturate(1.10)!important;
  backdrop-filter: blur(8px) saturate(1.10)!important;
}
/* Skill library was the source of the user's screenshot. Its groups, cards,
   and shortcuts are designed as separate translucent layers, not dark tiles. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-lessons .pf69-skill-row,
  #page-lessons .pf-academic-card-wrap,
  #page-lessons .pf-directory-card,
  #page-discover .pf47-summary,#page-discover .pf17-skill-card,
  #page-discover .pf47-resume,#page-discover .pf47-task,
  #page-chunking .pf100-topic-card:not(.is-selected),
  #page-chunking .pf100-lesson-card,#page-chunking .pf-chunk-lesson,
  #page-chunking .pf-chunk-phase-card,
  #page-dictation .dictation-lesson-card,#page-dictation .dictation-dialogue-card,
  #page-dictation .dictation-history-item,
  #page-grammar .pf-grammar-subtopic,#page-grammar .pf-grammar-example,
  #page-profile .pf-profile-overview article,#page-profile .pf85-skills-grid article,
  #page-shadowing .pfs-clip-card:not(.is-selected),#page-shadowing .pfs-cue:not(.is-speaking),
  #page-alphabet .pf-alpha-letter-card,
  #page-listening .contrast-sound-card,#page-listening .phoneme-study-card,
  #page-listening .phoneme-study-detail,#page-listening .phoneme-study-example,
  #page-numbers .numbers-stats > div,
  #page-counting .pf-counting-card,
  #page-recall .pf106-topic-card,#page-guess .pf53-guess-tile,
  #page-cloze .pf38-lesson-card,#page-cloze .pf38-topic-card,
  #page-vocabulary .vocab-sense,#page-vocabulary .vocab-context-card,
  #page-vocabulary .pf-d9-quiz-card,#page-vocabulary .pf-d9-summary-card
) {
  background: var(--pf-uall-card)!important;
  background-image: none!important;
  border-color: var(--pf-uall-border-inner)!important;
  box-shadow: 0 5px 16px rgba(5,12,35,.07)!important;
}
/* Hover/focus states remain discernible but do not flicker to opaque navy. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-lessons .pf69-skill-row:hover,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-lessons .pf-academic-card-wrap:hover,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-lessons .pf-academic-card-wrap:focus-within,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-lessons .pf-directory-card:hover {
  background: var(--pf-uall-hover)!important;
  border-color: rgba(202,224,255,.47)!important;
}
/* Sub-cards and horizontal strips avoid adding another opaque layer. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-lessons .pf-academic-card-footer,#page-lessons .pf-directory-meta,
  #page-chunking .pf-ls-context-section,#page-chunking .pf-chunk-mainphrase,
  #page-chunking .pf-chunk-slot,#page-dictation .dictation-metrics > div,
  #page-dictation .dictation-word-detail,#page-dictation .dictation-history-item,
  #page-profile .pf-test-stage,#page-profile .pf-test-passage,
  #page-shadowing .pfs-controls,#page-shadowing .pfs-hidden-hint,
  #page-numbers .numbers-mode,#page-vocabulary .vocab-example,
  #page-vocabulary .pf-d3-aux-filters,
  #page-cms .pfc-check
) {
  background: var(--pf-uall-inset)!important;
  background-image: none!important;
  border-color: var(--pf-uall-border-inner)!important;
  box-shadow: none!important;
}
/* Form surfaces: protect text against ambient gradients, not by painting black. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] .peak-main :is(
  #page-vocabulary .pf-d3-search-frame.pf-uiverse-search,
  #page-lessons .pf-directory-search,
  #page-chunking .pf-i-chunk-search,
  #page-dictation .dictation-writing-input,
  #page-numbers .numbers-writing-input,
  #page-pronunciation textarea,
  #page-shadowing .pfs-search
) {
  background:var(--pf-uall-field)!important;
  background-image:none!important;
  border-color:var(--pf-uall-border)!important;
  color:var(--pf-uall-text)!important;
}
/* The dictionary magnifier is an SVG FILL, not a Lucide stroke; setting
   text color on its wrapper does not change the original #64748b SVG. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-uiverse-search-icon .pf-uiverse-search-svg,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-uiverse-search-icon .pf-uiverse-search-svg path,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-uiverse-search:focus-within .pf-uiverse-search-svg,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d3-search-icon {
  fill:#fff!important;
  color:#fff!important;
  opacity:1!important;
}
/* Source images keep their real artwork. Only Shadowing's empty banner frame
   loses its solid navy paint; the <img> inside is left untouched. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-shadowing .pf62-home-banner {
  background:rgba(134,170,240,.09)!important;
  background-image:none!important;
  border-color:var(--pf-uall-border)!important;
  box-shadow:0 5px 18px rgba(3,9,30,.09)!important;
}
/* Accessible titles after the lighter translucent paint; keep existing
   semantic green/red feedback and selected controls in their own modules. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-lessons :is(.pf-directory-section-head h3,.pf-directory-card-meta strong,.pf69-skill-row strong) {
  color:var(--pf-uall-text)!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-lessons :is(.pf-directory-section-head p,.pf-directory-card-meta > span:not(.pf-academic-skill-badge),.pf69-skill-row small) {
  color:var(--pf-uall-subtext)!important;
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-pf-theme="dark"] {
    --pf-uall-panel:rgba(25,38,72,.90);
    --pf-uall-card:rgba(31,48,87,.89);
    --pf-uall-inset:rgba(37,56,94,.88);
    --pf-uall-field:rgba(41,62,105,.94);
    --pf-uall-hover:rgba(43,64,107,.92);
  }
}
@media print {
  :root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-lessons :is(.pf-directory-group,.pf-academic-card-wrap) {
    background:#fff!important;
    color:#111827!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
}
/* A few legacy screens use ID-specific #practice/#numbers-writing-input
   selectors, which outrank generic class-based rules from earlier releases. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-pronunciation #practice,
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-pronunciation #pf117-score {
  background:var(--pf-uall-panel)!important;
  background-image:none!important;
  border-color:var(--pf-uall-border)!important;
  box-shadow:0 8px 24px rgba(3,9,30,.08)!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-numbers #numbers-writing-input {
  background:var(--pf-uall-field)!important;
  border-color:var(--pf-uall-border)!important;
  color:var(--pf-uall-text)!important;
}
/* Quiet secondary admin actions: no opaque navy blocks. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-cms .pf-cms-outline:not(:disabled) {
  background:var(--pf-uall-field)!important;
  background-image:none!important;
  border-color:var(--pf-uall-border)!important;
  color:var(--pf-uall-text)!important;
}
/* Shadowing's add-clip CTA is a real control: keep its affordance and vivid
   accent, but replace the old nearly-black gradient paint. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-shadowing .pf62-open-add.pf65-pro-action {
  background:linear-gradient(115deg,rgba(74,120,235,.22),rgba(61,190,230,.14))!important;
  border-color:rgba(129,201,255,.42)!important;
  color:#f4fbff!important;
}
/* Neutral profile quiz choices and the legacy dictionary search fallback. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-profile .pf-test-choice:not(.is-correct):not(.is-incorrect):not(.is-selected):not([aria-pressed="true"]):not(:disabled),
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary .pf-d3-search-frame {
  background:var(--pf-uall-field)!important;
  background-image:none!important;
  border-color:var(--pf-uall-border)!important;
  color:var(--pf-uall-text)!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-profile .pf-test-choice:not(.is-correct):not(.is-incorrect):not(.is-selected):not(:disabled):hover {
  background:var(--pf-uall-hover)!important;
  border-color:rgba(202,224,255,.44)!important;
}

/* Dictionary suggestions are a floating legibility surface, not a layout card.
   They must remain opaque over photos, videos and the Universe backdrop.
   This intentionally excludes the popup from shared glass/inset styling. */
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary #pf-d3-suggest.pf-d3-suggest {
  background:#1d3458!important;
  background-image:none!important;
  color:#f7faff!important;
  opacity:1!important;
  border:1px solid #6686ba!important;
  box-shadow:0 18px 42px rgba(3,9,27,.42)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  isolation:isolate;
  z-index:100;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary #pf-d3-suggest .pf-d3-suggest-title {
  color:#b9d7fa!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary #pf-d3-suggest .pf-d3-suggestion {
  background:transparent!important;
  color:#f7faff!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary #pf-d3-suggest .pf-d3-suggestion:is(:hover,:focus,:focus-visible) {
  background:#32517d!important;
  color:#fff!important;
  outline-color:#9fdcff!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary #pf-d3-suggest .pf-d3-suggestion strong {
  color:#fff!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary #pf-d3-suggest .pf-d9-suggestion-meta :is(span,.pf-d9-ipa,.pf-d9-definition) {
  color:#d7e5fb!important;
}
:root[data-pf-theme="dark"] body[data-controller="pf-shell"] #page-vocabulary #pf-d3-suggest .pf-d9-suggestion-meta .pf-d9-pos {
  color:#8bf1d2!important;
}
