/* PeakFour UI V14 — scoped component corrections. No universal recoloring. */

/* Lesson tiles: the interactive action and status share one semantic footer.
   Neither text label is allowed to break between characters. */
#page-lessons .pf-directory-card-grid > .pf-academic-card-wrap {
  box-sizing:border-box;min-width:0;height:auto!important;display:flex!important;
  flex-direction:column!important;align-self:stretch;overflow:hidden;
  container-type:inline-size;
}
#page-lessons .pf-academic-card-wrap[hidden] {display:none!important;}
#page-lessons .pf-academic-card-wrap > .pf-directory-card {
  flex:1 0 auto!important;height:auto!important;min-width:0;min-height:120px!important;
  align-self:stretch;box-sizing:border-box;
}
#page-lessons .pf-academic-card-wrap > .pf-academic-card-footer {
  box-sizing:border-box;position:static!important;display:flex!important;
  flex-direction:row!important;flex-wrap:nowrap;justify-content:space-between;
  align-items:center;gap:6px;width:calc(100% - 24px);min-width:0;
  margin:0 12px!important;padding:10px 0 12px!important;
  min-height:50px;height:auto;transform:none!important;
  border-top:1px solid var(--pf-v13-border);
}
#page-lessons .pf-academic-card-footer > .pf-academic-progress-status {
  display:inline-flex!important;flex-direction:row!important;align-items:center;
  flex:0 0 auto!important;gap:5px;white-space:nowrap!important;
  word-break:normal!important;overflow-wrap:normal!important;
  min-width:max-content!important;max-width:none;font-size:11px;line-height:1.4;
}
#page-lessons .pf-academic-card-footer > .pf-academic-progress-status > span,
#page-lessons .pf-academic-card-footer > .pf-academic-favorite .pf-academic-favorite-label {
  display:inline!important;white-space:nowrap!important;word-break:normal!important;
  overflow-wrap:normal!important;width:auto!important;max-width:none;
}
#page-lessons .pf-academic-card-footer > .pf-academic-favorite {
  box-sizing:border-box;position:static!important;display:inline-flex!important;
  flex-flow:row nowrap!important;flex:0 0 auto!important;
  width:auto!important;min-width:max-content!important;height:33px!important;
  gap:5px;align-items:center;justify-content:center;
  padding:5px 6px!important;margin:0!important;
  font-size:11px!important;line-height:1.2!important;
  white-space:nowrap!important;word-break:normal!important;
  overflow-wrap:normal!important;
}
#page-lessons .pf-academic-card-footer svg {display:block;flex:0 0 auto!important;width:16px;height:16px;}
/* Container queries adapt to *actual card width*, not desktop breakpoint. At
   narrow widths each action takes its own horizontal row, never vertical text. */
@container (max-width:270px) {
  #page-lessons .pf-academic-card-footer {
    flex-wrap:wrap!important;justify-content:flex-start!important;gap:4px!important;
    padding:8px 0 10px!important;
  }
  #page-lessons .pf-academic-card-footer > .pf-academic-progress-status {width:100%;}
  #page-lessons .pf-academic-card-footer > .pf-academic-favorite {margin-left:0!important;}
}
/* Explicit light/dark ink for the Alphabet hero; never rely on inherited heading
   colors from the theme layer. The hero itself changes elevation with the mode. */
:root:not([data-pf-theme="dark"]) #page-alphabet .pf-alpha-intro {
  background:#E8EEFF!important;border-color:#C7D5EF!important;
}
:root:not([data-pf-theme="dark"]) #page-alphabet .pf-alpha-intro h1 {color:#0F172A!important;}
:root:not([data-pf-theme="dark"]) #page-alphabet .pf-alpha-intro p {color:#334155!important;}
:root[data-pf-theme="dark"] #page-alphabet .pf-alpha-intro {
  background:linear-gradient(160deg, rgba(15,23,42,.58), rgba(30,41,59,.76))!important;background-image:radial-gradient(circle at top right, rgba(96,165,250,.09), transparent 40%), linear-gradient(160deg, rgba(15,23,42,.58), rgba(30,41,59,.76))!important;border-color:rgba(148,163,184,.24)!important;backdrop-filter:blur(18px) saturate(1.08)!important;box-shadow:0 18px 40px rgba(2,8,23,.18)!important;
}
:root[data-pf-theme="dark"] #page-alphabet .pf-alpha-intro h1 {color:#F8FAFC!important;}
:root[data-pf-theme="dark"] #page-alphabet .pf-alpha-intro p {color:#CBD5E1!important;}
:root[data-pf-theme="dark"] #page-alphabet .pf-alpha-intro .pf-d-kicker {color:#7DD3FC!important;}
/* Phoneme explorer: retain semantic current/selected state, recolor only normal
   reading and reference surfaces. */
:root[data-pf-theme="dark"] #page-listening :is(
  .phoneme-study,.phoneme-learn-list,.phoneme-sound-item:not(.is-active):not([aria-pressed="true"]),
  .phoneme-study-detail,.phoneme-study-example,.phoneme-study-card,
  .phoneme-heading,.phoneme-reference,.phoneme-list
) {
  background:linear-gradient(160deg, rgba(15,23,42,.55), rgba(30,41,59,.74))!important;background-image:radial-gradient(circle at top right, rgba(96,165,250,.08), transparent 42%), linear-gradient(160deg, rgba(15,23,42,.55), rgba(30,41,59,.74))!important;
  border-color:rgba(148,163,184,.24)!important;color:#CBD5E1!important;backdrop-filter:blur(18px) saturate(1.08)!important;box-shadow:0 18px 40px rgba(2,8,23,.16)!important;
}
:root[data-pf-theme="dark"] #page-listening :is(
  .phoneme-study,.phoneme-study-detail,.phoneme-study-example,.phoneme-heading
) :is(h2,h3,h4,strong){color:#F8FAFC!important;}
:root[data-pf-theme="dark"] #page-listening .phoneme-sound-item:not(.is-active):not([aria-pressed="true"]) :is(strong,small){color:#CBD5E1!important;}
:root[data-pf-theme="dark"] #page-listening .phoneme-sound-item:is(.is-active,[aria-pressed="true"]){
  background-color:#16483E!important;border-color:#10B981!important;color:#D1FAE5!important;
}
/* Chunking chapters and dialogue cards are module-owned interactive elements,
   not generic .bg-white; keep error/success and primary actions untouched. */
:root[data-pf-theme="dark"] #page-chunking :is(
  .pf-chunk-lesson,.pf-i-topic-card,.pf-i-chunk-browser,.pf-chunk-practice-model,
  .pf-chunk-practice-question,.pf-chunk-practice-transcript,.pf95-score-card,
  .pf95-score-transcript,.pf-ls-heading,.pf-chunk-session-content
){
  background:linear-gradient(160deg, rgba(15,23,42,.55), rgba(30,41,59,.74))!important;background-image:radial-gradient(circle at top right, rgba(139,92,246,.09), transparent 42%), linear-gradient(160deg, rgba(15,23,42,.55), rgba(30,41,59,.74))!important;
  border-color:rgba(148,163,184,.24)!important;color:#CBD5E1!important;
  backdrop-filter:blur(18px) saturate(1.08)!important;box-shadow:0 18px 40px rgba(2,8,23,.16)!important;
}
:root[data-pf-theme="dark"] #page-chunking :is(
  .pf-chunk-lesson,.pf-i-topic-card,.pf-i-chunk-browser,.pf95-score-card,.pf-ls-heading
) :is(h2,h3,h4,strong){color:#F8FAFC!important;}
:root[data-pf-theme="dark"] #page-chunking :is(
  .pf-chunk-lesson,.pf-i-topic-card,.pf-i-chunk-browser,.pf95-score-card
) :is(p,small){color:#CBD5E1!important;}
:root[data-pf-theme="dark"] #page-dictation :is(
  .dictation-dialogue,.dictation-dialogue-card,.dictation-lesson-card,
  .dictation-scene,.dictation-audio-card,.dictation-speaking,.dictation-writing
){background:linear-gradient(160deg, rgba(15,23,42,.55), rgba(30,41,59,.74))!important;border-color:rgba(148,163,184,.24)!important;color:#CBD5E1!important;backdrop-filter:blur(18px) saturate(1.08)!important;box-shadow:0 18px 40px rgba(2,8,23,.16)!important;}
@media(prefers-reduced-motion:reduce){
  #page-lessons .pf-academic-card-wrap{transition:none!important;transform:none!important;}
}
