/* FPT Learning / Glass Studio. Specialized modules own behavior and layout;
   this layer owns brand, typography, surfaces and component rhythm. */
:root,html[data-theme="light"]{
 --ui-bg:#f2f5fb;--ui-surface:#fff;--ui-raised:#edf2f9;
 --ui-text:#172e4e;--ui-muted:#50627b;--ui-border:#d6e0ee;
 --ui-primary:#b94700;--ui-on-primary:#fff;--ui-focus:#2868ad;
 --ui-glass:rgba(255,255,255,.86);--ui-glass-edge:rgba(255,255,255,.95);
 --ui-shadow:0 16px 40px -24px rgba(23,54,97,.28);
 --ui-menu-shadow:0 24px 64px -20px rgba(23,54,97,.28);
 --ui-sidebar:#153766;--ui-sidebar-text:#e5eefb;
 --ui-radius:20px;--ui-ease:cubic-bezier(.23,1,.32,1);
}
html[data-theme="dark"]{
 --ui-bg:#0d1625;--ui-surface:#182638;--ui-raised:#23364e;
 --ui-text:#edf3fc;--ui-muted:#b4c3d7;--ui-border:#3a4c65;
 --ui-primary:#ffb47e;--ui-on-primary:#271b12;--ui-focus:#9bc4ff;
 --ui-glass:rgba(24,38,56,.92);--ui-glass-edge:rgba(125,156,196,.25);
 --ui-shadow:0 16px 40px -24px rgba(0,0,0,.75);
 --ui-menu-shadow:0 24px 64px -16px rgba(0,0,0,.6);
 --ui-sidebar:#10243e;--ui-sidebar-text:#dce8fa;
}
html{scroll-padding-top:112px}
html[data-theme] body{
 font-family:"Be Vietnam Pro",Arial,sans-serif!important;font-size:16px;line-height:1.65;
 font-synthesis:none;color:var(--ui-text)!important;
 background:linear-gradient(125deg,rgba(242,113,36,.055),transparent 38%),linear-gradient(225deg,rgba(0,102,179,.07),transparent 58%),var(--ui-bg)!important;
 -webkit-font-smoothing:antialiased;
}
html[data-theme] :is(button,input,select,textarea){font-family:inherit!important;font-size:14px;line-height:1.55;font-synthesis:none}
:where(button,a,input,select,textarea){touch-action:manipulation;-webkit-tap-highlight-color:transparent}
:where(button,a){transition:background-color 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 160ms ease,transform 140ms var(--ui-ease)}
:where(button,a,input,select,textarea):focus-visible{outline:3px solid var(--ui-focus)!important;outline-offset:3px}
:where(input,textarea){caret-color:var(--ui-primary)}
::selection{background:#bad6fa;color:#102e51}
[hidden]{display:none!important}
html[data-theme] :is(h1,h2,h3,h4){font-family:inherit;line-height:1.4;letter-spacing:-.02em;text-wrap:balance;overflow-wrap:break-word}
html[data-theme] :is(h1,h2,h3,h4,p){overflow:visible}
html[data-theme] :is(.section-heading,.page-title) h2{font-size:clamp(26px,3vw,36px);margin:0 0 12px;line-height:1.4}
html[data-theme] :is(.section-heading,.page-title) p{font-size:15px;line-height:1.8;color:var(--ui-muted)!important;max-width:72ch;margin:0}
html[data-theme] .section-space{padding-block:64px}
html[data-theme] .section-heading{margin-bottom:28px;gap:24px}
html[data-theme] .eyebrow{font-size:11px;line-height:1.6;letter-spacing:.06em;font-weight:600}
html[data-theme] :is(.subject-home,.announcement-wrap,.subject-page-path)>.section-heading .eyebrow{display:none}
/* Glass lives at the navigation layer; reading and editing retain opaque paper. */
html[data-theme] .site-header{
 position:sticky;top:12px;margin:12px auto 0;width:min(1320px,calc(100% - 40px));
 background:var(--ui-glass)!important;border:1px solid var(--ui-glass-edge)!important;
 border-radius:20px;box-shadow:var(--ui-shadow);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);z-index:100;
}
html[data-theme] .site-header .nav-row{width:auto;margin:0;padding:0 22px;min-height:80px;height:auto;gap:20px}
html[data-theme] .topbar{background:transparent!important;color:var(--ui-muted)!important}
html[data-theme] .topbar-inner{height:30px;font-size:11px}
html[data-theme] .topbar-links{color:var(--ui-muted)!important}
html[data-theme] :is(.desktop-nav,.mobile-nav)>button,
html[data-theme] [data-course-menu-toggle]{background:transparent!important;color:var(--ui-text)!important;border:1px solid transparent!important;border-radius:11px;min-height:46px;padding:11px 14px;box-shadow:none!important;font-size:13px;font-weight:600;line-height:1.6}
html[data-theme] :is(.desktop-nav,.mobile-nav)>button:is(:hover,.active),
html[data-theme] [data-course-menu-toggle]:is(:hover,[aria-expanded="true"]){background:var(--ui-raised)!important}
html[data-theme] :is(.course-dropdown,.mobile-course-menu){background:var(--ui-glass)!important;border:1px solid var(--ui-border)!important;border-radius:18px;padding:10px;gap:4px;box-shadow:var(--ui-menu-shadow);width:370px;max-width:calc(100vw - 40px);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);transform-origin:top left}
html[data-theme] :is(#desktopSubjectLinks,#mobileSubjectLinks){display:grid;grid-template-columns:minmax(0,1fr)!important;gap:4px;min-width:0}
html[data-theme] .course-menu-label{color:var(--ui-muted)!important;font-size:10px;line-height:1.8;font-weight:600;letter-spacing:.06em;padding:14px 12px 8px;margin:6px 0 0;border-top:1px solid var(--ui-border)}
.nav-subject-copy{min-width:0}.nav-subject-copy strong{font:inherit}.nav-subject-copy small,.nav-subject-tail{display:none}
html[data-theme] :is(#desktopSubjectLinks,#mobileSubjectLinks) .nav-subject{display:grid;grid-template-columns:44px minmax(0,1fr) 18px;align-items:center;gap:14px;min-height:76px;padding:12px;border:0!important;border-radius:12px;background:transparent!important;color:var(--ui-text)!important;box-shadow:none!important;outline:none;text-decoration:none;transform:none}
html[data-theme] :is(#desktopSubjectLinks,#mobileSubjectLinks) .nav-subject:is(:hover,[aria-current="true"]){background:var(--ui-raised)!important}
html[data-theme] :is(#desktopSubjectLinks,#mobileSubjectLinks) .nav-subject:focus-visible{outline:3px solid var(--ui-focus)!important;outline-offset:-3px}
html[data-theme] :is(#desktopSubjectLinks,#mobileSubjectLinks) .nav-subject-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:var(--subject-bg);color:var(--subject-ink);border:1px solid var(--subject-border)}
:is(#desktopSubjectLinks,#mobileSubjectLinks) .subject-icon{width:23px;height:23px}
html[data-theme] :is(#desktopSubjectLinks,#mobileSubjectLinks) .nav-subject-copy strong{display:block;color:var(--ui-text)!important;font-size:14px;line-height:1.65;font-weight:600;margin:0}
html[data-theme] :is(#desktopSubjectLinks,#mobileSubjectLinks) .nav-subject-copy small{display:block;color:var(--ui-muted)!important;font-size:12px;line-height:1.65;font-weight:400;margin-top:3px}
:is(#desktopSubjectLinks,#mobileSubjectLinks) .nav-subject-tail{display:flex;color:var(--ui-muted)}
.nav-subject-tail svg{width:18px;height:18px}.subject-row-check{display:none}
.nav-subject[aria-current="true"] .subject-row-check{display:block;color:var(--ui-primary)}
.nav-subject[aria-current="true"] .subject-row-arrow{display:none}
html[data-theme] [data-course-all]{min-height:48px;border-radius:11px;padding:12px!important;background:var(--ui-raised)!important;color:var(--ui-text)!important;border:0!important;font-weight:600;line-height:1.6}
html[data-theme] .mobile-nav{background:var(--ui-surface)!important;border:1px solid var(--ui-border);border-radius:16px;padding:12px;box-shadow:var(--ui-shadow)}
#menuBtn svg{width:22px;height:22px}
/* Learning desk: live subject navigation, not a decorative product mockup. */
html[data-theme] .hero-wrap{background:transparent!important;min-height:0;overflow:visible}
html[data-theme] .hero-bg{display:none}
html[data-theme] .hero{min-height:0;padding-block:32px 48px;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:56px;align-items:start}
html[data-theme] .hero-copy{min-width:0;padding-top:8px}
html[data-theme] .hero-brand-label{display:block;color:var(--ui-primary);font-size:13px;line-height:1.7;font-weight:600;margin-bottom:20px}
html[data-theme] .hero-wrap .hero-copy h1{font-size:clamp(36px,4vw,54px)!important;line-height:1.3!important;letter-spacing:-.025em!important;font-weight:700;margin:0 0 24px;max-width:19ch;padding-block:4px;text-wrap:balance;color:var(--ui-text)!important}
html[data-theme] .hero-wrap .hero-copy h1>span{display:block;color:var(--ui-text)!important;margin-top:4px}
html[data-theme] .hero-copy>p{font-size:16px;line-height:1.85!important;max-width:56ch;margin:0 0 28px;color:var(--ui-muted)!important}
html[data-theme] .hero-actions{display:flex;gap:12px;align-items:center;margin:0 0 28px}
html[data-theme] .hero-stats{display:flex;gap:28px;padding:18px 0;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0;max-width:450px;margin:0}
html[data-theme] .hero-stats>div{border:0!important;padding:0;min-width:70px}
html[data-theme] .hero-stats b{font-size:23px;font-weight:700;line-height:1.4;color:var(--ui-text)!important}
html[data-theme] .hero-stats span{font-size:12px;line-height:1.7;color:var(--ui-muted)!important;margin-top:4px}
html[data-theme] .hero-art{min-height:0!important;transform:none!important;display:block;position:relative;min-width:0}
html[data-theme] .learning-desk{padding:24px;background:var(--ui-glass);border:1px solid var(--ui-glass-edge);border-radius:24px;box-shadow:var(--ui-menu-shadow);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);position:relative}
.learning-desk-head{display:flex;align-items:center;gap:14px;margin-bottom:20px}
html[data-theme] .learning-desk h2{font-size:18px;font-weight:600;line-height:1.6;margin:0;color:var(--ui-text)!important}
html[data-theme] .learning-desk p{font-size:13px;line-height:1.7;margin:4px 0 0;color:var(--ui-muted)!important}
.desk-symbol{display:grid;place-items:center;width:46px;height:46px;flex-shrink:0;border-radius:14px;background:var(--ui-raised);color:var(--ui-primary)}.desk-symbol svg{width:26px;height:26px}
#heroSubjectLinks{display:grid;gap:4px}
html[data-theme] #heroSubjectLinks .nav-subject{display:flex;align-items:center;gap:12px;padding:12px 4px;min-height:64px;color:var(--ui-text)!important;background:transparent!important;border:0!important;border-bottom:1px solid var(--ui-border)!important;border-radius:0;box-shadow:none!important;transform:none;text-decoration:none}
html[data-theme] #heroSubjectLinks .nav-subject:last-child{border-bottom:0!important}
#heroSubjectLinks .nav-subject-icon{color:var(--subject-ink);background:var(--subject-bg);border:1px solid var(--subject-border);width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex-shrink:0}
#heroSubjectLinks .subject-icon{width:23px;height:23px}
html[data-theme] #heroSubjectLinks strong{color:var(--ui-text)!important;font-size:14px;line-height:1.65;font-weight:600}
html[data-theme] #heroSubjectLinks small{display:block;font-size:11px;line-height:1.65;margin-top:3px;color:var(--ui-muted)!important}
.learning-desk-foot{display:flex;align-items:center;justify-content:space-between;gap:14px;border-top:1px solid var(--ui-border);margin-top:16px;padding-top:16px}
html[data-theme] .learning-desk-foot>span{font-size:10px;line-height:1.7;color:var(--ui-muted)}
html[data-theme] .learning-desk-foot button{font-size:12px;line-height:1.6;min-height:44px;background:var(--ui-raised);border:1px solid var(--ui-border);border-radius:10px;padding:8px 12px;color:var(--ui-text)}
/* Buttons, chips and discovery. */
html[data-theme] :is(.pill,.btn){min-height:46px;font-weight:600;border-radius:11px;padding:11px 18px;line-height:1.6;white-space:normal}
html[data-theme] .pill.primary{background:var(--ui-primary)!important;color:var(--ui-on-primary)!important;border:1px solid var(--ui-primary)!important;box-shadow:none}
html[data-theme] .pill:is(.white,.outline){background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important}
html[data-theme] :is(.filter,.pill){font-family:inherit}
html[data-theme] .filter{border-radius:10px;min-height:44px;padding:9px 15px;border-color:var(--ui-border);line-height:1.6}
html[data-theme] :is(#homeSubjectQuickNav,#subjectPageLinks){gap:10px;padding-block:4px 12px}
html[data-theme] :is(#homeSubjectQuickNav,#subjectPageLinks) .nav-subject{display:inline-flex;align-items:center;gap:10px;background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important;border-radius:12px;padding:11px 15px;min-height:50px;box-shadow:none!important;flex-shrink:0}
html[data-theme] :is(#homeSubjectQuickNav,#subjectPageLinks) .nav-subject[aria-current="true"]{border-color:var(--subject-ink)!important;background:var(--subject-bg)!important;color:var(--subject-ink)!important}
html[data-theme] :is(#homeSubjectQuickNav,#subjectPageLinks) .subject-icon{color:var(--subject-ink);width:22px;height:22px}
html[data-theme] :is(#homeSubjectQuickNav,#subjectPageLinks) strong{color:inherit!important;font-size:13px;line-height:1.65;font-weight:600}
html[data-theme] :is(.panel,.topic-card,.course-card,.announcement-card,.exam-list-card,.subject-path-card,.subject-surface,.note-card,.question-card,.modal-card){background:var(--ui-surface)!important;color:var(--ui-text);border:1px solid var(--ui-border)!important;border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
html[data-theme] :is(.panel,.course-card,.announcement-card,.subject-surface) :is(h2,h3,h4){color:var(--ui-text)!important;letter-spacing:-.015em;line-height:1.5}
html[data-theme] :is(.course-card,.topic-card,.announcement-card){overflow:hidden;transition:border-color 160ms,box-shadow 160ms}
html[data-theme] :is(.course-card,.announcement-card,.topic-card) p{color:var(--ui-muted)!important;line-height:1.85;font-size:14px}
html[data-theme] :is(.course-body,.announcement-card,.topic-card){padding:24px}
html[data-theme] :is(.course-body,.announcement-card,.topic-card) :is(h3,h4){font-size:18px;line-height:1.6;margin-block:14px 12px;font-weight:600}
html[data-theme] .course-cover{height:auto;min-height:220px;padding:24px;justify-content:flex-start;align-items:flex-start}
html[data-theme] .course-cover>.subject-icon{display:block;width:36px;height:36px;flex:0 0 36px;margin:0 0 16px;color:var(--subject-ink);align-self:flex-start}
html[data-theme] .course-cover b{line-height:1.45;letter-spacing:-.02em}
html[data-theme] .announcement-grid:has(>.announcement-card:only-child){grid-template-columns:minmax(0,1fr)}
html[data-theme] .announcement-card:only-child p{max-width:72ch}
html[data-theme] .announcement-band{background:transparent!important;border-block:1px solid var(--ui-border)}
html[data-theme] .subject-surface{padding:28px;border-top-width:1px!important}
html[data-theme] .subject-panel-intro{border-radius:16px;padding:28px}
html[data-theme] .subject-panel-block{min-width:0}
html[data-theme] .subject-panel-block+.subject-panel-block{margin-top:36px}
html[data-theme] .subject-page-header{padding:32px;border:1px solid var(--ui-border);border-radius:24px;background:var(--ui-glass)!important;box-shadow:var(--ui-shadow);gap:28px;margin-bottom:24px;backdrop-filter:blur(12px)}
.subject-page-emblem{display:grid;place-items:center;width:58px;height:58px;border-radius:17px;background:var(--subject-bg);color:var(--subject-ink);border:1px solid var(--subject-border);margin-bottom:20px}.subject-page-emblem svg{width:32px;height:32px}
html[data-theme] .subject-page-header h1{font-size:clamp(32px,4vw,48px);line-height:1.4;margin:0 0 12px}
html[data-theme] .subject-page-header p{font-size:15px;line-height:1.85;color:var(--ui-muted)!important;max-width:60ch}
html[data-theme] .subject-page-facts{border:0!important;gap:24px;padding:16px 0}
html[data-theme] .subject-page-facts span{font-size:12px;line-height:1.7;color:var(--ui-muted)!important}
html[data-theme] .subject-page-facts strong{font-size:28px;font-weight:600;color:var(--ui-text)!important}
html[data-theme] .subject-path-card{padding:20px;gap:16px;min-height:100px;text-align:left}
html[data-theme] .subject-path-card strong{font-size:14px;line-height:1.75;font-weight:600}
html[data-theme] .subject-path-card small{font-size:12px;line-height:1.7;margin-top:6px;color:var(--ui-muted)!important}
/* Workspace: quiet tools, contained groups and consistent insets. */
html[data-theme] .dash-main{background:transparent!important;min-width:0}
html[data-theme] .dashboard-page{background:transparent!important}
html[data-theme] .dash-side{background:var(--ui-sidebar)!important;padding:24px 18px;color:var(--ui-sidebar-text)}
html[data-theme] .dash-side nav button{border-radius:10px;min-height:46px;padding:12px 14px;margin:3px 0;font-size:13px;line-height:1.7;font-weight:500}
html[data-theme] .dash-side nav button.active{background:#fff!important;color:#153766!important;box-shadow:none;border:0}
html[data-theme] .dash-top{border:1px solid var(--ui-glass-edge)!important;border-radius:18px;background:var(--ui-glass)!important;padding:18px 22px;gap:16px;backdrop-filter:blur(12px);box-shadow:var(--ui-shadow);margin-bottom:24px}
html[data-theme] .dash-top h1{font-size:26px;line-height:1.5;letter-spacing:-.02em;margin:4px 0 0}
html[data-theme] .dash-top small{font-size:12px;line-height:1.7;color:var(--ui-muted)!important}
html[data-theme] :is(.staff-portal,.staff-portal-group,.staff-portal-tools){min-width:0}
html[data-theme] .staff-portal{background:transparent!important;border:0;border-radius:0;padding:0!important}
html[data-theme] .staff-portal-hero{background:var(--ui-glass)!important;border:1px solid var(--ui-glass-edge);border-radius:20px;padding:28px;color:var(--ui-text)!important;box-shadow:var(--ui-shadow)}
html[data-theme] .staff-portal-hero h2{font-size:clamp(22px,2.5vw,30px);line-height:1.5;color:var(--ui-text)!important}
html[data-theme] .staff-portal .staff-portal-hero p{color:var(--ui-muted)!important;font-size:14px;line-height:1.85}
html[data-theme] .staff-portal .staff-portal-hero .eyebrow{display:none}
html[data-theme] .staff-portal .staff-portal-role{color:var(--ui-text)!important;background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;font-size:12px}
html[data-theme] .staff-portal-group{padding:24px!important;border:1px solid var(--ui-border)!important;border-radius:20px;background:var(--ui-surface)!important;margin-top:24px}
html[data-theme] .staff-portal-index{display:none}
html[data-theme] .staff-portal-group h3{font-size:19px;line-height:1.5;margin:0 0 6px}
html[data-theme] .staff-portal-group-head p{font-size:13px;line-height:1.8;color:var(--ui-muted)!important}
html[data-theme] .staff-portal-card{background:transparent!important;border:1px solid var(--ui-border)!important;border-radius:13px;padding:18px!important;color:var(--ui-text)!important;min-height:94px;box-shadow:none!important;transform:none}
html[data-theme] .staff-portal-card strong{color:var(--ui-text)!important;font-size:14px;line-height:1.7;font-weight:600}
html[data-theme] .staff-portal-card small{color:var(--ui-muted)!important;font-size:12px;line-height:1.75;margin-top:5px}
html[data-theme] .staff-portal-search{background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;border-radius:12px;padding:0 14px;min-height:48px;display:flex;align-items:center;gap:10px}
html[data-theme] #staffPortalSearch{background:transparent!important;border:0!important;border-radius:0;padding:10px 0;min-width:0;width:100%;box-shadow:none!important}
html[data-theme] .dash-stats article{background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;border-radius:18px;padding:22px;box-shadow:none}
html[data-theme] .dash-stats b{font-variant-numeric:tabular-nums;line-height:1.4}
/* Tables, forms, editors: reading surfaces remain opaque. */
html[data-theme] .admin-table{background:var(--ui-surface)!important;color:var(--ui-text);font-size:13px;line-height:1.75}
html[data-theme] .admin-table :is(th,td){border-color:var(--ui-border)!important;padding:15px 16px;vertical-align:middle}
html[data-theme] .admin-table th{background:var(--ui-raised)!important;color:var(--ui-muted)!important;font-size:12px;font-weight:600}
html[data-theme] .admin-table tbody tr:hover{background:var(--ui-raised)!important}
html[data-theme] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border);border-radius:11px;min-height:46px;max-width:100%;box-sizing:border-box;box-shadow:none;padding:11px 13px;font-weight:400;line-height:1.65}
html[data-theme] :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:1}
html[data-theme] :is(.search-box,.staff-portal-search) input{border:0!important;background:transparent!important;min-width:0}
html[data-theme] :is(.search-box,.staff-portal-search):focus-within{outline:2px solid var(--ui-focus);outline-offset:2px}
html[data-theme] :is(.workspace-editor,.design-studio) label{font-size:13px;line-height:1.75;font-weight:600}
html[data-theme] :is(.workspace-editor,.design-studio) label :is(small,.field-help){font-size:12px;line-height:1.8;font-weight:400}
html[data-theme] .workspace-editorial{padding:24px;gap:24px}
html[data-theme] :is(.editorial-section,.editor-pane,.editor-settings,.editor-publish,.cms-studio-hero){background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;border-radius:18px;padding:24px;min-width:0}
html[data-theme] :is(.cms-format-toolbar,.lesson-block-toolbar){background:var(--ui-raised)!important;border-color:var(--ui-border)!important;border-radius:12px;gap:8px;padding:10px;flex-wrap:wrap}
html[data-theme] :is(.cms-format-toolbar,.lesson-block-toolbar) button{min-height:42px;border-radius:9px;line-height:1.6;font-size:12px}
html[data-theme] .workspace-editor-head{padding-bottom:22px;border-bottom:1px solid var(--ui-border)}
html[data-theme] :is(.cms-studio-hero,.lesson-editor-hero){background:var(--ui-raised)!important;color:var(--ui-text)!important}
html[data-theme] :is(.cms-studio-hero,.lesson-editor-hero) h2{line-height:1.45;letter-spacing:-.02em}
html[data-theme] :is(.cms-studio-hero,.lesson-editor-hero) p{font-size:14px;line-height:1.85;color:var(--ui-muted)!important}
html[data-theme] :is(.admin-empty,.lesson-block-empty,.cms-block-empty){padding:26px 20px;border:1px dashed var(--ui-border)!important;border-radius:14px;background:var(--ui-bg)!important;color:var(--ui-muted)!important;line-height:1.85;font-size:14px}
html[data-theme] .workspace-editorial .lesson-block-empty{background:var(--ui-bg)!important;color:var(--ui-muted)!important}
html[data-theme] :is(.modal-actions,.workspace-editor-actions){border-color:var(--ui-border)!important;background:var(--ui-surface)!important;gap:12px}
html[data-theme] :is(.calendar-main,.calendar-header,.calendar-board,.note-card){background:var(--ui-surface)!important;border-color:var(--ui-border)!important}
html[data-theme] :is(.note-file-tile,.calendar-event-card){border:1px solid var(--ui-border)!important;border-radius:14px;box-shadow:none;line-height:1.75}
html[data-theme] .calendar-day{border-color:var(--ui-border)!important}
/* Reader, assessment and feedback. */
html[data-theme] :is(.lesson-main,.lesson-sidebar,.lesson-content){background:var(--ui-surface)!important;border-color:var(--ui-border)!important;color:var(--ui-text)}
html[data-theme] .lesson-list button{min-height:68px;padding:14px 18px;border-radius:11px;margin:4px 0;color:var(--ui-text)!important;background:transparent!important;line-height:1.75}
html[data-theme] .lesson-list button:is(:hover,.current){background:var(--ui-raised)!important}
html[data-theme] .lesson-tabs{gap:16px;border-color:var(--ui-border)!important}
html[data-theme] .lesson-tabs button{padding:14px 4px;min-height:48px;color:var(--ui-muted)!important;line-height:1.6}
html[data-theme] .lesson-tabs button.active{color:var(--ui-primary)!important;border-color:var(--ui-primary)!important}
html[data-theme] :is(.cms-prose,.lesson-rich-content,.question-text){line-height:1.9;color:var(--ui-text);overflow-wrap:anywhere}
html[data-theme] .cms-prose :is(h2,h3){line-height:1.5;letter-spacing:-.015em}
html[data-theme] .answers label{border-radius:13px;padding:16px;min-height:56px;line-height:1.85}
html[data-theme] .toast{background:var(--ui-glass)!important;border-radius:16px;box-shadow:var(--ui-menu-shadow);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);font-size:13px;line-height:1.75}
html[data-theme] :is(.assistant-chat,.modal-card){border:1px solid var(--ui-border);border-radius:22px;box-shadow:var(--ui-menu-shadow)}
html[data-theme] .assistant-chat{background:var(--ui-glass)!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
html[data-theme] :is(.assistant-chat,.toast) :is(p,small){line-height:1.8}
html[data-theme] .site-footer{background:var(--ui-sidebar)!important;color:var(--ui-sidebar-text);margin-top:32px}
html[data-theme] .footer-grid :is(a,p){color:var(--ui-sidebar-text)!important;font-size:12px;line-height:1.85}
/* Intentional motion: one public intro, short press/overlay feedback. */
html[data-theme] .page.active{animation:none}
@keyframes desk-arrive{from{opacity:.7;transform:translateY(10px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){
 .learning-desk{animation:desk-arrive 360ms var(--ui-ease) both}
 :is(.pill,.staff-portal-card):active{transform:scale(.98)}
 .course-dropdown:not([hidden]),.mobile-course-menu:not([hidden]){animation:none;transition:opacity 180ms var(--ui-ease),transform 180ms var(--ui-ease)}
 @starting-style{.course-dropdown:not([hidden]){opacity:0;transform:translateY(-4px) scale(.98)}}
}
@media(hover:hover) and (pointer:fine){
 html[data-theme] :is(.course-card,.topic-card,.announcement-card):hover{border-color:var(--ui-focus)!important;box-shadow:var(--ui-menu-shadow);transform:none}
 html[data-theme] .staff-portal-card:hover{border-color:var(--ui-focus)!important;background:var(--ui-raised)!important;transform:none}
 html[data-theme] #heroSubjectLinks .nav-subject:hover .nav-subject-copy strong{color:var(--ui-primary)!important}
}
@media(max-width:1100px){
 html[data-theme] .hero{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;padding-block:28px 40px}
 html[data-theme] .learning-desk{padding:20px}
 html[data-theme] .learning-desk-foot{flex-wrap:wrap}
 html[data-theme] .site-header .nav-row{padding:10px 16px;min-height:72px}
}
@media(max-width:768px){
 html[data-theme] .site-header{width:calc(100% - 24px);top:8px;margin-top:8px;border-radius:17px}
 html[data-theme] .hero{grid-template-columns:minmax(0,1fr);padding-block:24px 32px;gap:32px}
 html[data-theme] .hero-wrap .hero-copy h1{font-size:clamp(32px,6.7vw,46px)!important;max-width:22ch;line-height:1.35!important}
 html[data-theme] .hero-copy>p{font-size:15px}
 html[data-theme] .hero-art{max-width:620px;width:100%;margin-inline:0}
 html[data-theme] .learning-desk{padding:22px}
 html[data-theme] .section-space{padding-block:44px}
 html[data-theme] .staff-portal-group{padding:18px!important}
 html[data-theme] .staff-portal-hero{padding:22px}
 html[data-theme] .dash-top{padding:14px 16px;gap:10px}
 html[data-theme] .dash-top h1{font-size:22px}
 html[data-theme] :is(.panel,.editorial-section){border-radius:16px}
 html[data-theme] .workspace-editorial{padding:14px;gap:18px}
 html[data-theme] :is(.editor-pane,.editor-settings,.editor-publish){min-width:0;width:auto}
 html[data-theme] :is(.course-dropdown,.mobile-course-menu){width:100%;max-width:100%;box-shadow:none;border-radius:14px;backdrop-filter:none;background:var(--ui-surface)!important}
 html[data-theme] .admin-table :is(th,td){padding:12px}
 html[data-theme] .subject-surface{padding:18px}
 html[data-theme] .subject-panel-intro{padding:22px}
 html[data-theme] .subject-page-header{padding:24px;gap:18px}
 html[data-theme] :is(.course-body,.announcement-card,.topic-card){padding:20px}
 html[data-theme] :is(input,select,textarea){font-size:16px}
}
@media(max-width:680px){
 html[data-theme] .hero-art{display:none}
 html[data-theme] .hero-actions{flex-direction:column;align-items:stretch;gap:10px}
 html[data-theme] .hero-stats{justify-content:flex-start;gap:32px}
}
@media(max-width:480px){
 html[data-theme] .site-header .nav-row{gap:10px;padding:8px 12px;min-height:66px}
 html[data-theme] .nav-actions{gap:6px;flex-shrink:0}
 html[data-theme] #accountBtn{width:auto!important;min-width:76px;max-width:none;padding:10px!important;white-space:nowrap;font-size:12px}
 html[data-theme] .brand-copy{display:none}
 html[data-theme] .brand{min-width:0;flex-shrink:1}
 html[data-theme] .hero-wrap .hero-copy h1{font-size:clamp(29px,7.4vw,36px)!important;line-height:1.4!important;letter-spacing:-.02em!important}
 html[data-theme] .hero-brand-label{font-size:12px;margin-bottom:16px}
 html[data-theme] .staff-portal-hero{padding:20px}
 html[data-theme] .subject-page-header{padding:20px}
 html[data-theme] .subject-path-card{padding:18px;gap:12px}
}
@media(prefers-reduced-transparency:reduce){
 html[data-theme] :is(.site-header,.course-dropdown,.learning-desk,.dash-top,.toast,.assistant-chat){background:var(--ui-surface)!important;backdrop-filter:none;-webkit-backdrop-filter:none}
}
@supports not (backdrop-filter:blur(1px)){
 html[data-theme] :is(.site-header,.course-dropdown,.learning-desk,.dash-top,.toast,.assistant-chat){background:var(--ui-surface)!important}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(forced-colors:active){:is(.site-header,.course-dropdown,.learning-desk,.panel,.staff-portal-card){border:1px solid CanvasText!important;backdrop-filter:none}}
@media(max-width:768px){
 html[data-theme] .mobile-nav{padding:8px}
 html[data-theme] .mobile-course-menu{padding:6px}
}
/* Legacy dark theme grouped an element selector into :is(), increasing its
   specificity. Scope the material override to the actual chrome containers. */
html[data-theme] header.site-header,
html[data-theme] .site-header .course-dropdown,
html[data-theme] #assistantChat{background:var(--ui-glass)!important}
html[data-theme] .site-header .nav-row{background:transparent!important}
@media(prefers-reduced-transparency:reduce){
 html[data-theme] header.site-header,
 html[data-theme] .site-header .course-dropdown,
 html[data-theme] #assistantChat{background:var(--ui-surface)!important}
}
@supports not (backdrop-filter:blur(1px)){
 html[data-theme] header.site-header,
 html[data-theme] .site-header .course-dropdown,
 html[data-theme] #assistantChat{background:var(--ui-surface)!important}
}
html[data-theme] .hero-copy .hero-stats{background:transparent!important}
html[data-theme] section.subject-home{background:transparent!important}
@media(max-width:680px){html[data-theme] .course-card .course-cover{min-height:120px;padding:20px}}
/* Secondary journeys use the same material and typographic scale. */
html[data-theme] :is(.login-page,.login-panel){background:transparent!important}
html[data-theme] .login-art{background:var(--ui-sidebar)!important;color:var(--ui-sidebar-text);border-radius:24px;margin:24px}
html[data-theme] .login-art-copy h1{font-size:clamp(30px,3.5vw,46px);line-height:1.4;letter-spacing:-.025em}
html[data-theme] .login-panel :is(h1,h2){font-size:30px;line-height:1.45;letter-spacing:-.02em}
html[data-theme] .login-form{background:var(--ui-glass)!important;border:1px solid var(--ui-glass-edge);border-radius:22px;padding:28px;box-shadow:var(--ui-shadow)}
html[data-theme] :is(.exam-nav,.result-hero,.result-grid article){background:var(--ui-surface)!important;color:var(--ui-text);border:1px solid var(--ui-border)!important;border-radius:18px;box-shadow:var(--ui-shadow)}
html[data-theme] .exam-band{background:var(--ui-sidebar)!important;border-radius:24px;margin:24px auto;width:min(1280px,calc(100% - 32px));overflow:hidden}
html[data-theme] .exam-band h2{line-height:1.45;letter-spacing:-.02em;font-size:clamp(28px,3.5vw,42px)}
html[data-theme] .exam-band p{font-size:15px;line-height:1.85}
html[data-theme] .site-header .mobile-nav{max-height:calc(100dvh - 110px);overflow:auto;overscroll-behavior:contain}
html[data-theme] .site-header .course-dropdown{max-height:calc(100dvh - 150px);overflow:auto;overscroll-behavior:contain}
@media(max-width:768px){
 html[data-theme] .login-art{margin:16px;border-radius:18px}
 html[data-theme] .login-panel{padding:28px 18px}
 html[data-theme] .login-form{padding:20px}
 html[data-theme] .exam-band{border-radius:18px}
}
@media(max-width:1100px){html[data-theme] .site-header .mobile-nav{max-height:calc(100dvh - 150px)}}
html[data-theme] .hero-wrap .hero-art{width:100%;max-width:500px;justify-self:end}
html[data-theme] #heroSubjectLinks small{font-size:12px}
@media(max-width:768px){html[data-theme] .hero-wrap .hero-art{max-width:620px;justify-self:stretch}}
/* Keep the header's backdrop on a sibling paint layer. A filtered ancestor
   otherwise becomes a backdrop root and prevents the flyout blurring the page. */
html[data-theme] header.site-header{background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html[data-theme] header.site-header::before{content:"";position:absolute;inset:0;border-radius:inherit;z-index:-1;pointer-events:none;background:var(--ui-glass);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
html[data-theme] .site-header .course-dropdown{backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
@media(prefers-reduced-transparency:reduce){html[data-theme] header.site-header::before{background:var(--ui-surface);backdrop-filter:none;-webkit-backdrop-filter:none}}
@supports not (backdrop-filter:blur(1px)){html[data-theme] header.site-header::before{background:var(--ui-surface)}}
/* Color v4: warmer FPT orange, clearer blues and more distinct subject accents. */
html[data-theme="light"]{--ui-bg:#f6f9ff;--ui-primary:#bf4a00;--ui-raised:#e8f1ff;--ui-border:#cbdcf1;--ui-text:#12345d;--ui-muted:#435e7c;--ui-glass:rgba(255,255,255,.9)}
html[data-theme="light"] body{background:linear-gradient(135deg,#fff5e8 0%,#f6f9ff 45%,#e8f5ff 100%)!important}
html[data-theme="dark"] body{background:linear-gradient(135deg,#101a2c 0%,#102943 100%)!important}
html[data-theme="light"] .hero-wrap .hero-copy h1>span{color:#bf4a00!important}
html[data-theme="dark"] .hero-wrap .hero-copy h1>span{color:#ffb477!important}
html[data-theme="light"] .tone-peach{--subject-bg:#ffead6;--subject-border:#ffc38c;--subject-ink:#913d08}
html[data-theme="light"] .tone-lavender{--subject-bg:#eae0ff;--subject-border:#c6abfa;--subject-ink:#60349a}
html[data-theme="light"] .tone-mint{--subject-bg:#d9f6e8;--subject-border:#8ad8b7;--subject-ink:#145c42}
html[data-theme="light"] .tone-sky{--subject-bg:#dbeeff;--subject-border:#97c8f7;--subject-ink:#15548b}
html[data-theme="light"] .tone-lemon{--subject-bg:#fff0b8;--subject-border:#ebcb63;--subject-ink:#725000}
html[data-theme] .exam-band{background:linear-gradient(115deg,#11356a,#17559a)!important}
html[data-theme] .exam-band-inner{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:48px;align-items:center;padding-block:48px}
html[data-theme] .exam-band .exam-preview{background:#224f89;border:1px solid #6c9dd1;border-radius:20px;padding:28px;text-align:left;min-width:0;box-shadow:0 16px 36px -20px #06182e}
.exam-preview-icon{display:grid;place-items:center;background:#ffb477;color:#173c69;border-radius:13px;width:48px;height:48px;margin-bottom:18px}
.exam-preview-icon svg{width:27px;height:27px}
html[data-theme] .exam-band .exam-preview h3{color:#fff!important;font-size:24px;line-height:1.5;margin:0 0 10px}
html[data-theme] .exam-band .exam-preview p{color:#e1edff!important;font-size:14px;line-height:1.8;margin:0 0 18px;max-width:44ch}
html[data-theme] .exam-preview ul{display:grid;gap:10px;padding:0;margin:0 0 24px;list-style:none;color:#fff;font-size:13px;line-height:1.7}
.exam-preview li{display:flex;align-items:baseline;gap:10px}.exam-preview li::before{content:"";display:inline-block;width:6px;height:6px;flex-shrink:0;background:#ffb477;border-radius:50%}
html[data-theme] .exam-preview .pill.primary{background:#ffb477!important;color:#183553!important;border-color:#ffb477!important}
.utility-menu{position:relative;flex-shrink:0}
.utility-menu>summary{display:grid;place-items:center;width:44px;height:44px;list-style:none;border:1px solid var(--ui-border);border-radius:11px;cursor:pointer;color:var(--ui-text);background:var(--ui-surface)}
.utility-menu>summary::-webkit-details-marker{display:none}.utility-menu summary svg{width:22px;height:22px}
.utility-menu-panel{position:absolute;right:0;top:calc(100% + 10px);width:210px;padding:8px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-menu-shadow);display:grid;gap:4px}
html[data-theme] .utility-menu-panel button{background:transparent;color:var(--ui-text);padding:12px;text-align:left;border:0;border-radius:9px;min-height:46px;line-height:1.65}
html[data-theme] .utility-menu-panel button:hover{background:var(--ui-raised)}
#publicAnnouncements,#publicSupport{scroll-margin-top:110px}
@media(max-width:768px){html[data-theme] .exam-band-inner{grid-template-columns:minmax(0,1fr);gap:28px;padding-block:32px}html[data-theme] .exam-band .exam-preview{padding:24px}}
html[data-theme] body{background-color:var(--ui-bg)!important}
/* Theme audit: pair surfaces and foregrounds instead of inheriting legacy white fills. */
html[data-theme] .search-box{background:var(--ui-surface)!important;color:var(--ui-muted)!important;border-color:var(--ui-border)!important}
html[data-theme] .search-box input{background:transparent!important;color:var(--ui-text)!important}
html[data-theme] .filter:not([class*="tone-"]){background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme] .filter.active{background:var(--ui-sidebar)!important;color:var(--ui-sidebar-text)!important;border-color:var(--ui-focus)!important}
html[data-theme] .exam-meta span{background:var(--ui-raised)!important;color:var(--ui-text)!important}
html[data-theme] .exam-status.available{background:#e7f5ec;color:#176a3d}
html[data-theme] .exam-status.upcoming{background:#e6f0ff;color:#24558f}
html[data-theme] .exam-status.ended{background:var(--ui-raised);color:var(--ui-muted)}
html[data-theme="dark"] :is(.analytics-block,.cms-intro,.setting-card,.assignment-panel,.editor-paper,.calendar-pager){background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme="dark"] :is(.cms-metrics span,.role-badge,.status-badge,.dash-top .avatar,.calendar-pager button,.setting-card code){background:var(--ui-raised)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme="dark"] :is(.cms-metrics b,.analytics-row,.analytics-row strong,.admin-table .row-title){color:var(--ui-text)!important}
html[data-theme="dark"] .analytics-row{border-color:var(--ui-border)!important}
html[data-theme="dark"] .dashboard-page[data-section="overview"] .quick-grid button{background:var(--ui-raised)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme="dark"] .dash-side nav button.active{background:var(--ui-raised)!important;color:var(--ui-text)!important}
html[data-theme="dark"] :is(.content-state,.exam-status){background:var(--ui-raised)!important;color:var(--ui-muted)!important}
html[data-theme="dark"] :is(.state-published,.state-active,.state-1,.exam-status.available){background:#1c3c30!important;color:#a9e8c3!important}
html[data-theme="dark"] :is(.state-draft,.state-0){background:#493322!important;color:#ffd0a1!important}
html[data-theme="dark"] .exam-status.upcoming{background:#223d60!important;color:#bdd8ff!important}
html[data-theme="dark"] .assignment-list button{background:var(--ui-raised)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme] #assistantLauncher{background:var(--ui-sidebar)!important;color:var(--ui-sidebar-text)!important;border-color:var(--ui-border)!important}
html[data-theme] #assistantLauncher:hover{background:var(--ui-raised)!important;color:var(--ui-text)!important}
html[data-theme="light"] :is(.state-draft,.state-0){color:#92481c}
/* Small glyphs, generous hit areas; primary and navigation labels remain visible. */
html[data-theme] button.compact-action{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;min-height:44px;flex:0 0 44px;padding:10px!important;border-radius:10px;font-size:inherit;line-height:1;touch-action:manipulation;vertical-align:middle;position:relative}
.compact-action .ui-action-icon{display:block;width:20px;height:20px;flex:none;pointer-events:none}
html[data-theme] button.compact-action:focus-visible{outline:3px solid var(--ui-focus)!important;outline-offset:2px}
html[data-theme] button.compact-action:not(:disabled):hover{filter:brightness(.94)}
html[data-theme] :is(.row-actions,.staff-card-actions,.calendar-event-actions,.lesson-block-actions){display:flex;flex-wrap:wrap;align-items:center;gap:6px}
html[data-theme] .row-actions button+button{margin-left:0}
html[data-theme] .admin-table td.row-actions{display:table-cell;white-space:normal;min-width:110px}
html[data-theme] .admin-table td.row-actions button{margin:3px}
html[data-theme] .lesson-block-head{flex-wrap:wrap;gap:10px}
html[data-theme] .lesson-block-actions{margin-left:auto}
.compact-action-tooltip{position:fixed;z-index:500;max-width:min(320px,calc(100vw - 16px));padding:8px 12px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-sidebar);color:var(--ui-sidebar-text);box-shadow:var(--ui-menu-shadow);font-size:12px;line-height:1.6;pointer-events:none;overflow-wrap:anywhere}
.compact-action-tooltip[hidden]{display:none}
html[data-theme] .assistant-chat-head>div{min-width:0;overflow:hidden}
html[data-theme] #assistantThreadTitle{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
@media(max-width:900px){html[data-theme] .admin-table td.row-actions{display:flex;min-width:0;justify-content:flex-end}}
@media(max-width:430px){html[data-theme] .assistant-chat-head{gap:6px;padding:10px}html[data-theme] .assistant-chat-head .assistant-chat-mark{display:none}html[data-theme] .assistant-chat-head h2{font-size:15px}}
@media(max-width:900px){html[data-theme="dark"] .admin-table tr{background:var(--ui-surface)!important;border-color:var(--ui-border)!important}html[data-theme="dark"] .admin-table td::before{color:var(--ui-muted)!important}}
/* Shared palette rules: public rendering and studio iframe use the same tokens. */
html[data-theme] .subject-surface[data-custom-palette]{--subject-ink:var(--design-accent);--subject-bg:var(--design-bg);--subject-border:color-mix(in srgb,var(--design-accent) 40%,var(--ui-border));background:var(--design-bg)!important}
html[data-theme] .subject-surface[data-custom-palette] .subject-panel-intro{background:linear-gradient(115deg,color-mix(in srgb,var(--design-accent) 14%,var(--ui-surface)),color-mix(in srgb,var(--design-bg) 65%,var(--ui-surface)))!important;border-color:var(--subject-border)!important}
html[data-theme] .subject-surface[data-custom-palette] :is(.subject-panel-intro .eyebrow,.subject-panel-intro h3,.subject-panel-block .section-heading h3,.subject-custom-block>h3){color:var(--design-accent)!important}
html[data-theme] .subject-surface[data-custom-palette] .subject-intro-action{background:var(--design-accent)!important;color:var(--design-on-accent)!important;border-color:var(--design-accent)!important}
html[data-theme=dark] .subject-surface[data-custom-palette]{--subject-ink:color-mix(in srgb,var(--design-accent) 55%,#fff);--subject-bg:color-mix(in srgb,var(--design-accent) 16%,var(--ui-surface));background:color-mix(in srgb,var(--design-bg) 6%,var(--ui-surface))!important}
html[data-theme=dark] .subject-surface[data-custom-palette] .subject-panel-intro{background:linear-gradient(115deg,color-mix(in srgb,var(--design-accent) 18%,var(--ui-surface)),var(--ui-surface))!important}
html[data-theme=dark] .subject-surface[data-custom-palette] :is(.subject-panel-intro .eyebrow,.subject-panel-intro h3,.subject-panel-block .section-heading h3,.subject-custom-block>h3){color:var(--subject-ink)!important}
/* Consistent reader insets on every edge, including narrow portrait screens. */
html[data-theme] .lesson-layout{grid-template-columns:minmax(230px,300px) minmax(0,1fr);align-items:start;gap:clamp(20px,3vw,36px)}
html[data-theme] .lesson-main{min-width:0;padding:clamp(20px,3vw,36px);border:1px solid var(--ui-border);border-radius:var(--ui-radius)}
html[data-theme] .lesson-main .lesson-content{background:transparent!important;box-shadow:none;border:0;padding:24px 0 0;min-width:0}
html[data-theme] .lesson-head :is(h1,.lesson-back){overflow-wrap:anywhere}
html[data-theme] .lesson-main :is(.lesson-tabs,.lesson-next-actions){display:flex;flex-wrap:wrap;gap:12px}
html[data-theme] .lesson-main :is(img,video,iframe){max-width:100%}
html[data-theme] .lesson-main .cms-prose pre{max-width:100%;overflow:auto}
@media(max-width:980px){html[data-theme] .lesson-layout{grid-template-columns:minmax(0,1fr)}html[data-theme] .lesson-sidebar{position:static;min-width:0}}
@media(max-width:600px){html[data-theme] .lesson-main{padding:20px 16px}html[data-theme] .lesson-main .pill{max-width:100%}}
/* Preserve the official artwork on a neutral plate in both themes. */
html[data-theme] .fschool-logo{box-sizing:content-box;background:#fff!important;padding:6px 8px!important;border-radius:10px;filter:none!important;opacity:1}
html[data-theme] .footer-brand::before{box-sizing:content-box;background:#fff url("fpt-schools-logo.webp") center / 90% auto no-repeat!important;padding:6px 8px;border-radius:10px;width:90px;height:48px;flex:0 0 90px;filter:none!important}
html[data-theme] .design-preview-head :is(strong,small){color:var(--ui-text)!important}
html[data-theme] .design-studio-actions{background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme] .design-device-toolbar [role=group]{background:var(--ui-raised)!important;border-radius:12px}
/* Shared logo layout. */
.fschool-logo-wrap{position:relative;display:inline-flex;flex:none;align-items:center}
html[data-theme=dark] .fschool-logo-wrap .fschool-logo{background:transparent!important;padding:0!important;border-radius:0}
html[data-theme] .footer-brand::before{display:none}
.page[data-page=lesson][data-lesson-state]:not([data-lesson-state=ready]) .lesson-main>:not(.lesson-load-state){display:none!important}
.page[data-page=lesson][data-lesson-state=loading] .lesson-sidebar{visibility:hidden}
.lesson-load-state{padding:40px 12px;min-height:180px;line-height:1.8;color:var(--ui-muted)}

/* A constrained page shell controls layout, not a second rectangular canvas. */
html[data-theme] section.page.inner-page{background:transparent!important}
html[data-theme] body:has(.subject-page.active){background:var(--ui-bg)!important}
html[data-theme] body:has(.subject-page.active) .site-footer{margin-top:0;border-top:1px solid var(--ui-border)}

/* Reader metadata and progress must use dark tokens, not legacy white fills. */
html[data-theme=dark] .lesson-sidebar .course-level{background:var(--ui-raised)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)}
html[data-theme=dark] .lesson-sidebar .course-learning-guide{background:transparent!important;box-shadow:none}
html[data-theme=dark] .lesson-sidebar .progress{background:#33475f!important}
html[data-theme=dark] .lesson-sidebar .progress i{background:#93bfff!important}
html[data-theme=dark] .lesson-list button i{background:#30445e!important;color:#e8f1ff!important}
html[data-theme=dark] .lesson-list button.current i{background:#93bfff!important;color:#10243e!important}
html[data-theme=dark] .lesson-list button.done i{background:#214e42!important;color:#c0f4d9!important}

/* One primary title, followed immediately by reading content. */
html[data-theme] .lesson-head h1{font-size:clamp(25px,2.4vw,34px);line-height:1.35;margin:12px 0 0;letter-spacing:-.02em}
html[data-theme] .lesson-head{margin-bottom:0;padding-bottom:0}
html[data-theme] .lesson-head>.eyebrow{margin-top:16px}
html[data-theme] .lesson-main .lesson-content{padding-top:16px}
html[data-theme] .lesson-reading-meta{font-size:12px;line-height:1.6;color:var(--ui-muted)!important;margin:0 0 20px;padding:0}
html[data-theme] .lesson-list button.current{min-height:60px}

/* Paired official FPT Education Schools lockups; no recoloring. */
html[data-theme] .fschool-logo-wrap::after{display:none!important}
html[data-theme] .fschool-logo{padding:0!important;background:transparent!important;border-radius:0!important;height:auto;object-fit:contain}
html[data-theme=dark] .fschool-logo{content:url("fpt-schools-white.png")}

@media print{html[data-theme] .fschool-logo{content:normal}}

html[data-theme] .login-box label.login-remember{display:flex;align-items:center;gap:12px;min-height:48px;margin:16px 0 8px;cursor:pointer}
html[data-theme] .login-remember input[type=checkbox]{width:20px;height:20px;min-height:20px;margin:0;padding:0;flex:none;accent-color:var(--ui-accent,#c45100)}
html[data-theme] .login-remember span{font-size:14px;line-height:1.6;color:var(--ui-text)}
html[data-theme] .login-remember small{display:block;font-size:12px;font-weight:400;color:var(--ui-muted)}
html[data-theme] .login-remember input:focus-visible{outline:3px solid var(--ui-accent,#c45100);outline-offset:4px}
