/* Theme surfaces and adjustable, readable typography. */
:root{--surface:#fffefa;--soft:#edf2e8;--field:#fafcf7;--paper:#f8f7f0;--line:#ccd8c6;--ink:#233f36;--muted:#53675a;--green:#245548;--accent:#245548;--leading:1.8}
html[data-accent=blue]{--accent:#285f86}html[data-accent=purple]{--accent:#694c8b}html[data-accent=rose]{--accent:#8a4160}html[data-accent=amber]{--accent:#945034}
html[data-font=system]{--body:'Segoe UI',Arial,sans-serif}html[data-font=serif]{--body:Georgia,serif}html[data-font=verdana]{--body:Verdana,sans-serif}
html[data-spacing=compact]{--leading:1.55}html[data-spacing=spacious]{--leading:2.1}
html[data-background=sage]{--paper:#edf2e7}html[data-background=warm]{--paper:#f5eedf}
html[data-theme=dark]{--paper:#17221e;--surface:#202d27;--soft:#293a30;--field:#1b2922;--line:#506457;--ink:#edf3e9;--muted:#c0ccbd;--green:#a8ccb3;--accent:#a8ccb3;color-scheme:dark}
html[data-theme=dark][data-accent=blue]{--accent:#a3cdee}html[data-theme=dark][data-accent=purple]{--accent:#d5bbf4}html[data-theme=dark][data-accent=rose]{--accent:#f1b5cd}html[data-theme=dark][data-accent=amber]{--accent:#f0bd9f}
html[data-theme=dark][data-oled=true]{--paper:#000;--surface:#0c110f;--soft:#151e19;--field:#070d09}
body{font-size:1.0625rem;line-height:var(--leading);background:var(--paper);color:var(--ink);font-family:var(--body)}button,input,textarea,select{font-family:var(--body)}
.question p,.readingcopy p,.mockreference p,.rules li{font-size:1.0625rem;line-height:var(--leading)}.aboutcopy{line-height:var(--leading)}
.task,.lessoncard,.inventorysheet,.settingssample{background:var(--surface)}.reference,.rules,.stickybank,.media,.note,.submission,.lessonmenu,.teachergrades,.profilehero,.sidebarfoot .profile-trigger{background:var(--soft);border-color:var(--line);color:var(--ink)}
.sidebar,.topbar{background:var(--paper);border-color:var(--line)}.topbar{backdrop-filter:none}.sidebar a,.sidebar button,.topbar button{color:var(--ink)}
button,.button,.stickybank p,.stickybank .dragdefinition,.social,.matchdrop,.dropslot,.badge{background:var(--field);color:var(--ink);border-color:var(--line)}input,textarea,select{background:var(--field);color:var(--ink);border-color:var(--line)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
.stickybank p,.stickybank .dragdefinition,.choices button{font-size:1rem}.refcredit,.responsemeta,.contextphoto figcaption,.inventorytable th,.sheetcredit,.profilefootnote,.social small,.audioplayer strong,.readercontrols button,.script summary,.markingnote,.matchhint,.dropfeedback{font-size:.875rem!important}.inventorytable td,.inventorysheet p,.script p,.levels p{font-size:1rem}.profile-trigger strong{font-size:1rem}.profile-trigger span,.sidebarfoot .utilitynav button,.sidebarfoot>button:last-child,.sidebar nav a{font-size:.875rem}.topbar>span{font-size:.875rem;letter-spacing:.02em}.topbar #saveState{font-size:.875rem}.sidebar .brand small{font-size:.75rem}
.primary,.button.primary,.tabs button.active,.sidebar nav a.active,.settingchoices button[aria-pressed=true],.viewcontrols button[aria-pressed=true]{background:var(--accent);color:var(--paper);border-color:var(--accent)}.lessoncard:hover{border-color:var(--accent)}.teachercredit,.profile-trigger strong,.profilehero h3,.profile-role,.profilecontact h4,.aboutcopy strong,.social strong,.profilehero h3 em{color:var(--ink)}.social small,.socialintro,.profilefootnote,.matchhint,.contextphoto figcaption{color:var(--muted)}
.choices button.selected,.wordtiles button.selected,.stickybank .dragdefinition.selected,.matchdrop.filled{background:var(--soft);color:var(--ink);border:2px solid var(--accent)}.choices button.correct,.matchdrop.correct{background:#d8ebd5;color:#204c21;border-color:#53834a}.choices button.incorrect,.matchdrop.incorrect{background:#f5dcd5;color:#7d3025;border-color:#b65a4a}
html[data-theme=dark] th{background:var(--soft);color:var(--ink)}html[data-theme=dark] .social{background:var(--field)}html[data-theme=dark] .social svg{color:var(--accent)}html[data-theme=dark] .monogram{background:var(--field);color:var(--ink);border-color:var(--line)}
html[data-width=focused] main{max-width:1200px;margin-inline:auto}html[data-width=focused] .readingcopy{max-width:65ch}
.readingsettings{max-width:900px;margin:auto}.settingslead{font-size:1.125rem;max-width:65ch}.settinggroup{border:0;border-bottom:1px solid var(--line);padding:22px 0;margin:0;min-width:0}.settinggroup legend{font-size:1.125rem;font-weight:650;padding-top:20px}.settingchoices{display:flex;gap:10px;flex-wrap:wrap}.settingchoices button{font-size:1rem;min-height:48px;padding:10px 18px}.swatch:before{content:'';display:inline-block;width:14px;height:14px;border-radius:50%;margin-right:9px;background:#245548;border:1px solid currentColor}.swatch.blue:before{background:#285f86}.swatch.purple:before{background:#694c8b}.swatch.rose:before{background:#8a4160}.swatch.amber:before{background:#945034}.settingtoggle{display:flex;gap:12px;align-items:start;margin:14px 0;font-size:1rem}.settingtoggle input{width:22px;height:22px;flex-shrink:0;margin-top:5px;accent-color:var(--accent)}.settingssample{border:1px solid var(--line);border-radius:14px;padding:24px;margin:26px 0}.settingssample p{font-size:1.125rem;line-height:var(--leading)}#displayStatus{font-size:.875rem;color:var(--muted)}
html[data-motion=true],html[data-motion=true] *{scroll-behavior:auto!important;animation:none!important;transition:none!important}a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
@media(max-width:820px){.topbar>span{display:none}.topbar>div{margin-left:auto}.referencegrid .stickybank{position:sticky;top:78px;z-index:4}.hero h1{font-size:clamp(3rem,13vw,5rem)}}
@media(max-width:540px){.stickybank p,.stickybank .dragdefinition,.matchdrop{font-size:1rem}.dropmatchtable td:first-child{font-size:.875rem}.topbar button{font-size:.875rem!important}.hero h1{font-size:3.5rem}.profilehero h3{font-size:2.5rem}.sidebar{width:min(320px,94vw)}.statrow{flex-wrap:wrap}.statrow span{font-size:.875rem} .settingchoices button{flex-grow:1}.dialoghead h2{overflow-wrap:anywhere;font-size:1.9rem} .lessonheader h1{font-size:2.7rem}}

.sidebar{overflow:auto}.sidebar>nav{min-height:70px}.sidebarfoot .profile-trigger span{color:var(--muted)}.response input,.response textarea,.question input,.question textarea,.teachergrades input,.teaching textarea{background:var(--field)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme=dark] .profile-trigger span,html[data-theme=dark] .lessoncard p,html[data-theme=dark] .lessonmenu button,html[data-theme=dark] .lessonheader p,html[data-theme=dark] .lead{color:var(--muted)}
.topbar [aria-label="Display settings"]{font-size:1rem;min-width:44px}
#popup>.dialoghead{position:sticky;top:-28px;z-index:9;background:var(--paper);padding-top:12px}@media(max-width:540px){#popup>.dialoghead{top:-18px}}

/* One continuous sidebar: no separate scrolling lesson box. */
.sidebar{overflow-y:auto;scrollbar-width:none}.sidebar::-webkit-scrollbar{display:none}
.sidebar>nav#lessons{flex:none;overflow:visible;max-height:none;min-height:0;height:auto;padding:0;margin:8px 0 20px;display:flex;flex-direction:column;gap:7px}
.sidebar #lessons a{display:flex;align-items:center;gap:11px;min-height:52px;padding:10px 9px;line-height:1.45;border-radius:12px}
.sidebar #lessons .lesson-name{min-width:0;overflow-wrap:break-word}
.sidebar #lessons .lesson-counter{display:inline-flex;align-items:center;justify-content:center;flex:0 0 55px;min-width:55px;width:auto;min-height:30px;padding:4px 6px;border-radius:8px;background:#dcebe2;color:#224d38;font-size:.8125rem;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap;opacity:1}
.sidebar #lessons a:nth-child(4n+2) .lesson-counter{background:#dfeaf5;color:#285477}.sidebar #lessons a:nth-child(4n+3) .lesson-counter{background:#eee3f5;color:#654279}.sidebar #lessons a:nth-child(4n+4) .lesson-counter{background:#f6e5d7;color:#815039}
html[data-theme=dark] .sidebar #lessons .lesson-counter{background:#294b39;color:#d4ebda}html[data-theme=dark] .sidebar #lessons a:nth-child(4n+2) .lesson-counter{background:#27465f;color:#d0e8fa}html[data-theme=dark] .sidebar #lessons a:nth-child(4n+3) .lesson-counter{background:#4c355c;color:#ecd8f7}html[data-theme=dark] .sidebar #lessons a:nth-child(4n+4) .lesson-counter{background:#583e2b;color:#f8dfc6}
#examOpen{font-weight:750;letter-spacing:.045em}
