/* NOUN TMA Quiz 3.11.1 — final button/control foreground authority.
 * Purpose: prevent Theme 17 or browser -webkit-text-fill rules from repainting
 * Quiz controls after the Quiz has chosen a contrast-safe foreground.
 */

/* --------------------------------------------------------------------------
   Public /tma-practice/ — Theme 17 has a deliberately broad !important link
   contrast layer. These selectors are intentionally more specific and own the
   foreground/text-fill for Quiz CTA links and their descendants.
   -------------------------------------------------------------------------- */
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary,
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary :is(span,b,strong,em,small,svg,path),
body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a,
body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a :is(span,b,strong,em,small,svg,path){
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  opacity:1!important;
}
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary,
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary :is(span,b,strong,em,small,svg,path),
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a,
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a :is(span,b,strong,em,small,svg,path){
  color:#062116!important;
  -webkit-text-fill-color:#062116!important;
}
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-secondary,
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-secondary :is(span,b,strong,em,small,svg,path){
  color:var(--text)!important;
  -webkit-text-fill-color:var(--text)!important;
  opacity:1!important;
}
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-secondary:hover,
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-secondary:focus-visible{
  color:var(--green)!important;
  -webkit-text-fill-color:var(--green)!important;
}
body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.v-slate > a,
body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.v-slate > a :is(span,b,strong,em,small,svg,path),
body.ns17:not(.nsc5-document) .ntq-v32lp .ntq-v32lp-preview-result a,
body.ns17:not(.nsc5-document) .ntq-v32lp .ntq-v32lp-preview-result a :is(span,b,strong,em,small){
  color:var(--green)!important;
  -webkit-text-fill-color:var(--green)!important;
  opacity:1!important;
}

/* Every public Quiz control follows its computed colour for WebKit text fill.
   This stops an old theme text-fill value surviving after the colour changed. */
body.ns17:not(.nsc5-document) .ntq-v32lp :is(button,a),
body.ns17:not(.nsc5-document) .ntq-v32lp :is(button,a) :is(span,b,strong,em,small){
  -webkit-text-fill-color:currentColor!important;
}
/* Reassert filled CTAs after the general currentColor bridge. */
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary,
body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a{
  color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;
}
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary,
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a{
  color:#062116!important;-webkit-text-fill-color:#062116!important;
}

/* --------------------------------------------------------------------------
   Signed-in standalone Quiz — final text-fill bridge for every interactive
   control. It does not choose colours; it makes WebKit render the colour that
   each component already owns.
   -------------------------------------------------------------------------- */
body.ntq-immersive-body :is(.ntq-app,.ntq-portal-bar) :is(button,a),
body.ntq-immersive-body :is(.ntq-app,.ntq-portal-bar) :is(button,a) :is(span,b,strong,em,small){
  -webkit-text-fill-color:currentColor!important;
}

/* Core primary/secondary actions. Explicit body scoping keeps these stronger
   than host-theme link rules when a control happens to be an <a>. */
body.ntq-immersive-body .ntq-app :is(.Z3-primary,.Z-btn,.Z-weekly-btn,.Z-plan-btn,.Z-chal-btn,.Z-res-chal-btn,.Z-exam-submit),
body.ntq-immersive-body .ntq-app :is(.Z3-primary,.Z-btn,.Z-weekly-btn,.Z-plan-btn,.Z-chal-btn,.Z-res-chal-btn,.Z-exam-submit) :is(span,b,strong,em,small,svg,path){
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  opacity:1;
}
html[data-theme="dark"] body.ntq-immersive-body .ntq-app :is(.Z3-primary,.Z-btn,.Z-weekly-btn,.Z-plan-btn,.Z-chal-btn,.Z-res-chal-btn,.Z-exam-submit),
html[data-theme="dark"] body.ntq-immersive-body .ntq-app :is(.Z3-primary,.Z-btn,.Z-weekly-btn,.Z-plan-btn,.Z-chal-btn,.Z-res-chal-btn,.Z-exam-submit) :is(span,b,strong,em,small,svg,path){
  color:#062116!important;
  -webkit-text-fill-color:#062116!important;
}
body.ntq-immersive-body .ntq-app .Z3-secondary,
body.ntq-immersive-body .ntq-app .Z3-secondary :is(span,b,strong,em,small,svg,path){
  color:var(--fg)!important;
  -webkit-text-fill-color:var(--fg)!important;
}
body.ntq-immersive-body .ntq-app .Z3-secondary:hover,
body.ntq-immersive-body .ntq-app .Z3-secondary:focus-visible{
  color:var(--ac)!important;
  -webkit-text-fill-color:var(--ac)!important;
}

/* Student identity bar actions. */
body.ntq-immersive-body .ntq-portal-bar .ntq-pb-link,
body.ntq-immersive-body .ntq-portal-bar .ntq-pb-link :is(span,b,strong,em,small,svg,path){
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
html[data-theme="dark"] body.ntq-immersive-body .ntq-portal-bar .ntq-pb-link,
html[data-theme="dark"] body.ntq-immersive-body .ntq-portal-bar .ntq-pb-link :is(span,b,strong,em,small,svg,path){
  color:#062116!important;
  -webkit-text-fill-color:#062116!important;
}

/* Filled social actions always retain inverse text regardless of theme. */
body.ntq-immersive-body .ntq-app :is(.Z-grp-btn.wa,.Z-grp-btn.tg),
body.ntq-immersive-body .ntq-app :is(.Z-grp-btn.wa,.Z-grp-btn.tg) :is(span,b,strong,em,small,svg,path){
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}

/* Selected/active controls using the accent surface need dark ink in Dark
   Mode because the Dark accent is intentionally bright green. */
html[data-theme="dark"] body.ntq-immersive-body .ntq-app :is(.Z-lvl.on,.Z-sem.on,.Z34-confidence button.active,.Z39-reflect-options button.active,.Z-exg.current),
html[data-theme="dark"] body.ntq-immersive-body .ntq-app :is(.Z-lvl.on,.Z-sem.on,.Z34-confidence button.active,.Z39-reflect-options button.active,.Z-exg.current) :is(span,b,strong,em,small){
  color:#062116!important;
  -webkit-text-fill-color:#062116!important;
}
html[data-theme="dark"] body.ntq-immersive-body .ntq-app :is(.Z-exo.selected .Z-exo-l,.Z-o.ok .Z-ol){
  color:#062116!important;
  -webkit-text-fill-color:#062116!important;
}
/* Dark-mode red answer markers also need dark ink for AA-sized text. */
html[data-theme="dark"] body.ntq-immersive-body .ntq-app .Z-o.no .Z-ol{
  color:#1b0a0a!important;
  -webkit-text-fill-color:#1b0a0a!important;
}

/* Disabled controls stay readable while remaining visibly unavailable. */
body.ntq-immersive-body .ntq-app :is(button,a)[aria-disabled="true"],
body.ntq-immersive-body .ntq-app button:disabled{
  -webkit-text-fill-color:currentColor!important;
}

/* Keyboard/forced-colour fallbacks. */
@media(forced-colors:active){
  body.ntq-immersive-body .ntq-app :is(button,a),
  body.ns17:not(.nsc5-document) .ntq-v32lp :is(button,a){
    forced-color-adjust:auto;
    -webkit-text-fill-color:currentColor!important;
  }
}

/* Final descendant reassertion for inverse filled public CTAs. Kept last so a
   host rule aimed at nested spans/strong text cannot split the label colour. */
body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary :is(span,b,strong,em,small,svg,path),
body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a :is(span,b,strong,em,small,svg,path){
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v32lp a.ntq-v32lp-primary :is(span,b,strong,em,small,svg,path),
html[data-theme="dark"] body.ns17:not(.nsc5-document) .ntq-v33lp-plan-card.featured > a :is(span,b,strong,em,small,svg,path){
  color:#062116!important;
  -webkit-text-fill-color:#062116!important;
}

/* Additional retained/legacy interactive surfaces that can still be reached
   through history, challenge or review flows. */
body.ntq-immersive-body .ntq-app :is(.Z-rsh.wa,.Z-rsh.tw,.Z-res-grp-link.wa,.Z-res-grp-link.tg,.Z-res-sh.wa,.Z-res-sh.tw),
body.ntq-immersive-body .ntq-app :is(.Z-rsh.wa,.Z-rsh.tw,.Z-res-grp-link.wa,.Z-res-grp-link.tg,.Z-res-sh.wa,.Z-res-sh.tw) :is(span,b,strong,em,small,svg,path){
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
html[data-theme="dark"] body.ntq-immersive-body .ntq-app :is(.Z-prog:hover .Z-prog-n,.Z33-choice-card.active em,.Z-res-link:hover,.Z-rrv-o.correct .Z-rrv-ol){
  color:#062116!important;
  -webkit-text-fill-color:#062116!important;
}
html[data-theme="dark"] body.ntq-immersive-body .ntq-app .Z-rrv-o.wrong .Z-rrv-ol{
  color:#1b0a0a!important;
  -webkit-text-fill-color:#1b0a0a!important;
}
