/* PX-R1-B · Staging-only Light Mode Foundation · Geometry mirroring PX-R1-A */
/* Gate: html[data-theme="light"][data-pxr1b-light="on"], only home views activated by preview JS. */
/*
 * SCOVER Academic · PX-R1-A Dark Mode Declutter Pilot · 2026-10-11
 * Scope: shared sidebar navigation, Student Home, Tutor Home.
 * CSS-only presentation overlay. No route keys, DOM contracts, state, API, auth,
 * SW, or legacy theme modification. Intentionally inactive in light mode.
 * Rollback: remove the two PX-R1 stylesheet links from index.html.
 */
@layer pxr1-pilot {
  /* Design tokens: deliberately local to this opt-in pilot. */
  html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page {
    --pxr1-line: #29465f;
    --pxr1-line-active: #3984a2;
    --pxr1-nav-text: #d5e5f5;
    --pxr1-nav-muted: #93aac2;
    --pxr1-card-text: #eaf4ff;
    --pxr1-body-text: #b7cadd;
  }
}
/* Don't use @layer for overrides: legacy application rules are unlayered. */

/* A1 — SAME NAVIGATION, CLEARER GROUPING, LESS CHROME. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .academic-nav-group {
  margin-bottom: 10px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .academic-nav-group-title {
  font-size: 10px;
  letter-spacing: .11em;
  color: #9eb9d0;
  padding: 3px 0 5px;
  margin-bottom: 5px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .academic-nav-group > .nav {
  gap: 4px!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered {
  min-height: 41px!important;
  padding: 6px 9px!important;
  font-size: 11.5px!important;
  font-weight: 720!important;
  line-height: 1.32!important;
  gap: 9px!important;
  color: #d2e1ef!important;
  border-color: #1e3a54!important;
  border-radius: 10px!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered.active {
  border-color: #3c789c!important;
  background: linear-gradient(95deg,#163753,#10253a)!important;
  color: #f3faff!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered .sc-nav-icon {
  flex-shrink: 0;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered .sc-nav-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-sidebar-kicker {
  font-size: 10px;
  letter-spacing: .13em;
  color: #9eb9d0;
  margin-bottom: 8px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs {
  gap: 4px!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs button {
  min-height: 43px!important;
  padding: 7px 10px!important;
  gap: 9px!important;
  font-size: 11.5px!important;
  line-height: 1.25!important;
  color: #d2e1ef!important;
  border-color: #1e3a54!important;
  border-radius: 10px!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs button.active {
  background: linear-gradient(95deg,#163753,#10253a)!important;
  border-color: #3c789c!important;
  color: #f3faff!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs button .sc-portal-nav-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
}
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .academic-sidebar #nav button:focus-visible,
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .academic-sidebar .tabs button:focus-visible {
  outline: 2px solid #7de6ff!important;
  outline-offset: 2px;
}

/* A2 — ONLY Student/Tutor portal shells, never Guardian or auth screens. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) {
  gap: 11px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .portal-hero {
  padding: 13px 17px;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) .portal-identity-copy h1 {
  font-size: clamp(21px,2.1vw,26px);
  line-height: 1.2;
  margin: 2px 0 5px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) .portal-identity-copy p {
  font-size: 13px;
  line-height: 1.45;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid {
  gap: 8px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid .metric {
  padding: 9px 10px;
  gap: 8px;
  border-color: #294960;
  border-radius: 11px;
  box-shadow: none;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid .metric small {
  font-size: 10px;
  line-height: 1.35;
  color: #acc0d3;
  letter-spacing: .045em;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid .metric b {
  font-size: 17px;
  line-height: 1.2;
}

/* A3 — Student: bring real learning activity above the marketing/app summary. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home > .student-home-hero { order: 0; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home > .student-home-grid { order: 2; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home > .grammar-app-card { order: 3; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home > .student-home-kpis { order: 4; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home > .card { order: 5; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-welcome,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-next {
  padding: 15px 16px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-welcome h2 {
  font-size: 23px;
  line-height: 1.22;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-welcome p,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-next p {
  font-size: 13px;
  line-height: 1.52;
  color: #b6cbde;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-home-kpi {
  padding: 9px 11px;
  box-shadow: none;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-home-kpi small {
  font-size: 10px;
  line-height: 1.35;
  color: #a9bed3;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .grammar-app-card {
  padding: 14px 16px;
  box-shadow: none;
  background: linear-gradient(130deg,#0c2033,#111c34);
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .grammar-app-card h2 {
  font-size: 19px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .grammar-app-card p {
  font-size: 13px;
  line-height: 1.5;
  color: #b9cede;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .grammar-app-card-meta {
  margin-top: 8px;
}

/* A4 — Tutor: working queues and upcoming sessions take precedence over counters. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home > .home-hero { order: 0; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home > .home-grid { order: 2; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home > .home-kpis { order: 3; }
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-welcome,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .next-session-card {
  padding: 15px 16px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-welcome h2 {
  font-size: 23px;
  line-height: 1.23;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-welcome p,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .next-session-card p {
  font-size: 13px;
  line-height: 1.52;
  color: #b6cbde;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-kpi {
  padding: 9px 11px;
  box-shadow: none;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-kpi small {
  font-size: 10px;
  line-height: 1.35;
  color: #a9bed3;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-grid > .card,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-home-grid > .card {
  padding: 15px;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home :is(h2,h3),
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home :is(h2,h3) {
  letter-spacing: -.012em;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home button:focus-visible,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home button:focus-visible {
  outline: 2px solid #79e4ff;
  outline-offset: 2px;
}

/* A5 — mobile: compact without microscopic labels or undersized touch controls. */
@media(max-width:900px){
  html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .academic-sidebar #nav button,
  html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .academic-sidebar .tabs button {
    min-height: 46px!important;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-home-hero,
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-hero {
    gap: 10px;
  }
}
@media(max-width:620px){
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .portal-hero {
    padding: 12px 13px;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) .portal-identity-copy h1 {
    font-size: 21px;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid .metric {
    padding: 9px;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .grammar-app-card {
    padding: 13px 14px;
  }
  /* In the legacy layout mobile identity is stacked vertically: recover
     space without hiding the tutor/student name or action buttons. */
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) .portal-identity {
    display: grid!important;
    grid-template-columns: 54px minmax(0,1fr)!important;
    gap: 11px!important;
    align-items: center!important;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) .portal-avatar-shell {
    width: 54px!important;
    height: 54px!important;
    border-radius: 16px!important;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) .portal-identity-copy p {
    font-size: 12px;
    line-height: 1.43;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid {
    grid-template-columns: repeat(2,minmax(0,1fr))!important;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid .metric {
    min-width: 0;
    align-content: start;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid .metric b,
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .portal-r3-shell:is(.role-student,.role-tutor) > .metric-grid .metric small {
    overflow-wrap: anywhere;
  }
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-student .student-home .student-home-kpis,
  html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .role-tutor .tutor-home .home-kpis {
    gap: 7px;
  }
}
@media(prefers-reduced-motion:reduce){
  html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .academic-sidebar #nav button,
  html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .academic-sidebar .tabs button {
    transition: none!important;
  }
}

/* PX-R1-B semantic surfaces and contrast overrides */
/* Scoped semantic foundation. Legacy scover-theme.css is intentionally NOT loaded. */
html[data-theme="light"][data-pxr1b-light="on"] {
  color-scheme:light;
  --bg:#f4f7fb;--panel:#ffffff;--panel2:#f1f5fa;--line:#d1dfea;
  --text:#162a40;--muted:#587188;--accent:#087c9f;--accent2:#6d53c6;
  --good:#167348;--warn:#865b12;--bad:#b0324b;
  --scover-shell-bg:#f4f7fb;--scover-shell-panel:#ffffff;
  --scover-shell-panel2:#f1f5fa;--scover-shell-line:#d1dfea;
  --scover-shell-text:#162a40;--scover-shell-muted:#587188;
  --scover-shell-accent:#087c9f;--scover-shell-accent2:#6d53c6;--scover-shell-good:#167348;
  --pxb-page:#f4f7fb;--pxb-surface:#ffffff;--pxb-subtle:#f3f7fb;
  --pxb-border:#d0ddea;--pxb-text:#162a40;--pxb-muted:#526b83;
  --pxb-accent:#087c9f;--pxb-shadow:0 8px 26px rgba(30,55,85,.055);
  --pxr1-line:#cfdeea;--pxr1-line-active:#5e9bb6;
  --pxr1-nav-text:#233f59;--pxr1-nav-muted:#587188;
  --pxr1-card-text:#162a40;--pxr1-body-text:#526b83;
}
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page {
  background:#f4f7fb!important;color:var(--pxb-text)!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .academic-content{
  background:linear-gradient(180deg,#f6f9fc,#eff4f9)!important;
  color:var(--pxb-text)!important;
  scrollbar-color:#b5c8d8 transparent!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page .top.academic-top{
  background:rgba(255,255,255,.95)!important;border-bottom:1px solid #d1dfea!important;
  color:#162a40!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-mobile-title b,
html[data-theme="light"][data-pxr1b-light="on"] .academic-top-left b{color:#162a40!important}
html[data-theme="light"][data-pxr1b-light="on"] .academic-mobile-title span,
html[data-theme="light"][data-pxr1b-light="on"] .academic-top-left span{color:#59728a!important}
html[data-theme="light"][data-pxr1b-light="on"] .academic-mobile-menu,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar-close{
  background:#fff!important;color:#244057!important;border-color:#c8d6e2!important;
}
/* Sidebar is shared, but active only during a home-screen light preview. */
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar{
  background:#fff!important;color:#1e3650!important;
  border-right:1px solid #d4e0ea!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar-scroll{scrollbar-color:#bfd0df transparent!important}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .brand-context b,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .brand-lockup{
  color:#17314b!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .brand-context span,
html[data-theme="light"][data-pxr1b-light="on"] .academic-nav-group-title,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar-kicker{
  color:#516d86!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar #nav button,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .tabs button,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar #nav .nav button.sc-nav-remastered,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .academic-sidebar .academic-role-nav .tabs button{
  background:#f5f8fc!important;color:#29455f!important;border-color:#cfdeea!important;
  box-shadow:none!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar #nav button:hover,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .tabs button:hover{
  background:#ecf5fa!important;color:#163e57!important;border-color:#93b8cb!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar #nav button.active,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .tabs button.active,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .academic-sidebar .academic-role-nav .tabs button.active,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered.active{
  background:linear-gradient(95deg,#e8f5fc,#eff2fe)!important;
  border-color:#84b5d1!important;color:#15334e!important;
  box-shadow:inset 3px 0 0 #087c9f!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar #nav button::before,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .tabs button::before{
  background:#e5eef6!important;color:#275475!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar #nav button.active::before,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .tabs button.active::before{
  background:#d9edf8!important;color:#165273!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .sc-nav-icon,
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar .sc-portal-nav-icon{
  background:#e8f0f8!important;color:#315e7b!important;border-color:#c2d8e7!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar-foot{
  background:#f3f7fb!important;border-color:#cfdeea!important;color:#576f85!important;
}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar-foot b{color:#213c53!important}
/* Global Home-only content surfaces: no modal/runner/form override beyond scope. */
html[data-theme="light"][data-pxr1b-light="on"] #app h1,
html[data-theme="light"][data-pxr1b-light="on"] #app h2,
html[data-theme="light"][data-pxr1b-light="on"] #app h3,
html[data-theme="light"][data-pxr1b-light="on"] #app b,
html[data-theme="light"][data-pxr1b-light="on"] #app strong{color:#172d44}
html[data-theme="light"][data-pxr1b-light="on"] #app small,
html[data-theme="light"][data-pxr1b-light="on"] #app p,
html[data-theme="light"][data-pxr1b-light="on"] #app .muted{color:#536e87}
html[data-theme="light"][data-pxr1b-light="on"] #app .card,
html[data-theme="light"][data-pxr1b-light="on"] #app .metric,
html[data-theme="light"][data-pxr1b-light="on"] #app .info,
html[data-theme="light"][data-pxr1b-light="on"] #app .home-metric,
html[data-theme="light"][data-pxr1b-light="on"] #app .home-kpi,
html[data-theme="light"][data-pxr1b-light="on"] #app .student-home-kpi{
  background:#ffffff!important;border-color:#d0dfea!important;
  color:#172d44!important;box-shadow:var(--pxb-shadow)!important;
}
html[data-theme="light"][data-pxr1b-light="on"] #app button.secondary,
html[data-theme="light"][data-pxr1b-light="on"] #app .secondary{
  background:#f3f8fb!important;border:1px solid #bed0e0!important;
  color:#1b4560!important;
}
html[data-theme="light"][data-pxr1b-light="on"] #app button.secondary:hover{
  background:#e6f2f8!important;border-color:#74a8c1!important;
}
html[data-theme="light"][data-pxr1b-light="on"] #app .badge{
  background:#eef4f9!important;border-color:#c6d7e4!important;
  color:#365b75!important;
}
html[data-theme="light"][data-pxr1b-light="on"] #app .badge.good{
  background:#e9f7ef!important;border-color:#8fbea6!important;color:#186846!important;
}
html[data-theme="light"][data-pxr1b-light="on"] #app .badge.warn{
  background:#fff6e8!important;border-color:#dec49a!important;color:#82551a!important;
}
html[data-theme="light"][data-pxr1b-light="on"] #app .badge.bad{
  background:#fff0f2!important;border-color:#e3abb7!important;color:#933348!important;
}
/* Admin Home: preserve published PX-R1-A geometry, replace only visual tokens. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app > .home-hero{
  background:linear-gradient(135deg,#ffffff,#f1f8fe)!important;
  border-color:#cbdde9!important;color:#172d44!important;box-shadow:var(--pxb-shadow)!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app .home-hero p,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app .home-hero small{color:#546e86!important}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app .home-date{
  background:#f4f8fb!important;border-color:#cbdde9!important;color:#183149!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app .home-module{
  background:#f5f9fc!important;border-color:#cbdde9!important;color:#203e57!important;
  box-shadow:none!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app .home-module:hover{
  background:#eaf5fa!important;border-color:#90b7cc!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app .home-module span.home-arrow{
  color:#0b7294!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] #app .home-health-line .badge{
  color:#225741!important;
}
/* Student + Tutor identity components */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .portal-r3-shell:is(.role-student,.role-tutor) > .portal-hero{
  background:linear-gradient(125deg,#fff,#f3f6ff)!important;
  border-color:#c7dceb!important;color:#17314a!important;box-shadow:var(--pxb-shadow)!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .portal-kicker{
  color:#526f89!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .portal-avatar-shell{
  background:linear-gradient(140deg,#eef5fb,#e8effb)!important;border-color:#c1d8e8!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .portal-avatar-shell .avatar{
  background:linear-gradient(135deg,#e2f1f9,#e8eafa)!important;color:#244e6a!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .portal-role-chip{
  background:#edf5fb!important;border-color:#bfd9e8!important;color:#2b5874!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .portal-identity-copy p{
  color:#4e6c84!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r3-metric{
  background:#fff!important;border-color:#cbdde9!important;color:#172d44!important;
  box-shadow:var(--pxb-shadow)!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .metric-icon{
  background:#ebf4fb!important;color:#255b7b!important;border-color:#c8dfea!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .metric-meta{
  color:#536d86!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r3-metric small{
  color:#486984!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .notification-bell{
  background:#f1f7fc!important;border-color:#bad2e3!important;color:#235678!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .notification-bell .sc-notification-bell-icon{
  color:#215776!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .notification-bell-count{
  background:#8c6528!important;color:#fff!important;
}
/* Workspaces are already correctly ordered by the mirrored PX-R1-A stylesheet. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-welcome,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-next,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .home-welcome,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .next-session-card,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .grammar-app-card{
  background:linear-gradient(135deg,#fff,#f5f9fd)!important;
  border-color:#c6dbe9!important;color:#1b3851!important;
  box-shadow:var(--pxb-shadow)!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-welcome p,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-next p,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .home-welcome p,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .next-session-card p,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .grammar-app-card p{
  color:#536d85!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-home-kpi small,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .home-kpi small{
  color:#56738a!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .grammar-app-card small,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .grammar-app-card .grammar-app-card-meta{
  color:#486b83!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-content-card{
  background:#fff!important;border-color:#ccdfeb!important;color:#172d44!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-content-card :is(h2,h3),
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-content-card b,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-home :is(h2,h3),
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .tutor-home :is(h2,h3){
  color:#1c344c!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-content-card .badge{
  color:#305d78!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-empty,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-empty-state,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-week-strip,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .workspace-session,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .preclass-info{
  background:#f4f8fc!important;border-color:#d0dfeb!important;color:#1d3b55!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-empty-icon{
  background:#e8f3fa!important;color:#205b7a!important;border-color:#bbd8e8!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .home-kpis .home-kpi,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .student-home-kpis .student-home-kpi {
  background:#f8fbfd!important;border-color:#cedfea!important;
}
/* Focus and accessibility. Do not globally repaint every <button> (legacy light failure). */
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page :is(button,a,input,select,textarea):focus-visible{
  outline:2px solid #137fa5!important;outline-offset:2px!important;
}
html[data-theme="light"][data-pxr1b-light="on"] #app a{color:#0b7195!important}
html[data-theme="light"][data-pxr1b-light="on"] .academic-sidebar-backdrop.is-open{
  background:rgba(19,37,56,.42)!important;
}
@media print{
  html[data-theme="light"][data-pxr1b-light="on"] body{background:#fff!important;color:#000!important}
}
/* Contrast remediation after first Chromium visual inspection (PX-R1-B QA-2). */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered.active,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .academic-sidebar .academic-role-nav .tabs button,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .academic-sidebar .academic-role-nav .tabs button.active {
  color:#25455f!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] .academic-sidebar .academic-role-nav .tabs button.active,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="admin"] .academic-sidebar #nav .nav button.sc-nav-remastered.active{
  color:#183c56!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page #session button,
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page #logout{
  color:#183d55!important;background:#f3f8fc!important;border-color:#a7c1d3!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page #session button:hover,
html[data-theme="light"][data-pxr1b-light="on"] body.academic-shell-page #logout:hover{
  background:#e8f4fa!important;border-color:#699ebd!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-empty-state .r4-empty-title,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-empty-state strong{
  color:#24435d!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-empty-state small,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .r4-empty-state p{
  color:#55718b!important;
}
/* Student/Tutor sidebar selector must match the role-scoped PX-R1-A :has() specificity. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs button,
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs button:not(.active){
  background:#f5f8fc!important;color:#23435d!important;border-color:#ccdde8!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs button.active{
  background:linear-gradient(95deg,#e7f4fc,#eff2fe)!important;
  border-color:#7eafcb!important;color:#173a55!important;
}
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"]:has(.portal-r3-shell:is(.role-student,.role-tutor)) .academic-sidebar .academic-role-nav .tabs button:hover{
  background:#e7f3fa!important;color:#153d5a!important;
}
/* Small purple editorial eyebrows were ~2.6:1 against white; use accessible deep violet. */
html[data-theme="light"][data-pxr1b-light="on"] body[data-academic-shell="portal"] #app .role-student .r4-section-eyebrow{
  color:#6547b5!important;
}
