/* Shared chrome and native dialogs: one visual language, one theme. */
:root{--ui-ink:#1e293b;--ui-muted:#64748b;--ui-glass:linear-gradient(145deg,#ffffffed,#ffffffb8);--ui-line:#ffffffd9;--ui-solid:#f4f8f6;--ui-accent:#007854;--ui-shadow:0 18px 55px #173e3020;--ui-hover:#ddefe5}
html[data-theme=dark]{color-scheme:dark;--ui-ink:#edf6f0;--ui-muted:#b1c7b9;--ui-glass:linear-gradient(145deg,#203c32f2,#183027ed);--ui-line:#64857566;--ui-solid:#172d24;--ui-accent:#82e0b2;--ui-shadow:0 18px 55px #0006;--ui-hover:#2b4b3c;--ink:#edf6f0;--muted:#b1c7b9;--bg:#14251f;--paper:#14251f;--paper-2:#1b3027;--card:#1b3027;--surface:#1b3027;--line:#365345;--green:#55d5a1;--green-dark:#82e0b2;--brand:#55d5a1;--brand-text:#82e0b2;--teal:#69bfd2;--teal-2:#82e0b2;--tonal:#214132;--gold-soft:#3b3320;--navy:#edf6f0;--blue:#69bfd2;--glass-fill:linear-gradient(145deg,#203c32f2,#183027ed);--glass-edge:inset 0 1px 1px #ffffff16}
body.has-site-shell{padding-top:1px;min-height:100dvh}
html:has(body.has-site-shell){scroll-padding-top:116px}
.site-header,.topbar.site-header{position:sticky;z-index:50;top:16px;display:flex;align-items:center;gap:16px;min-height:76px;height:auto;margin:16px 24px 0;padding:12px 22px;border:1px solid var(--ui-line);border-radius:24px;background:var(--ui-glass);color:var(--ui-ink);box-shadow:inset 0 1px 1px #ffffff55,0 8px 30px #244c3c0a;-webkit-backdrop-filter:blur(28px) saturate(165%);backdrop-filter:blur(28px) saturate(165%);font:500 13px/1.5 Poppins,system-ui,sans-serif}
.shell-icon{display:block;width:21px;height:21px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shell-button,.shell-search,.shell-bottom button,.shell-course-menu button,.shell-tool,.shell-primary{font:inherit;color:var(--ui-ink);cursor:pointer}
.shell-button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;margin:0;padding:0;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-glass);box-shadow:inset 0 1px 1px #ffffff45}
.shell-button:hover,.shell-search:hover{background:var(--ui-hover)}
.shell-brand-link{flex:none;text-decoration:none;color:var(--ui-ink)}
.shell-brand{display:flex;align-items:center;gap:9px;white-space:nowrap;font-size:20px;font-weight:700;letter-spacing:-1.1px}
.shell-brand img{width:32px;height:38px;display:block;object-fit:contain}
.shell-brand em{font-style:normal;color:var(--ui-accent)}
.shell-breadcrumb{color:var(--ui-muted);font-size:11px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shell-search{display:flex;align-items:center;gap:10px;margin-left:auto;min-width:44px;min-height:44px;padding:9px 13px;border:1px solid var(--ui-line);border-radius:14px;background:#ffffff55;color:var(--ui-muted)}
.shell-search span{font-size:11px}
.shell-search kbd{font:10px/1.5 Poppins,system-ui,sans-serif;padding:2px 5px;border:1px solid var(--ui-line);border-radius:5px}
.shell-profile{border-radius:50%;font-size:12px;font-weight:600;color:var(--ui-accent)}
.site-header :focus-visible,.shell-dialog :focus-visible,.shell-bottom :focus-visible{outline:3px solid var(--ui-accent);outline-offset:4px}
body.has-site-shell>.course-masthead,body.has-site-shell>.toolbar{display:none}
body.has-site-shell .workspace-layout{margin-top:32px}
body.has-site-shell{scroll-padding-top:120px}
body.has-site-shell .workspace-sidebar{top:116px;max-height:calc(100dvh - 140px);overflow-y:auto}
.workspace-tutor{font-weight:600!important}
.workspace-nav .workspace-tutor,.workspace-nav [data-shell-tutor]{grid-template-columns:1fr}
.shell-bottom{display:none}
.shell-dialog{position:fixed;inset:0;width:min(560px,calc(100vw - 32px));max-height:min(80dvh,780px);margin:auto;padding:24px;overflow:auto;border:1px solid var(--ui-line);border-radius:26px;background:var(--ui-glass);color:var(--ui-ink);box-shadow:inset 0 1px 1px #ffffff66,var(--ui-shadow);-webkit-backdrop-filter:blur(32px) saturate(180%);backdrop-filter:blur(32px) saturate(180%);font:14px/1.8 Poppins,system-ui,sans-serif}
.shell-dialog::backdrop{background:#112f2938;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.shell-dialog-heading{display:flex;align-items:center;gap:16px;justify-content:space-between;margin-bottom:20px}
.shell-dialog-heading h2{margin:0;font:600 21px/1.4 Poppins,system-ui,sans-serif;color:var(--ui-ink);letter-spacing:-.5px}
.shell-menu{inset:106px auto auto 24px;margin:0;width:min(370px,calc(100vw - 48px))}
.shell-course-menu{display:grid;gap:8px}
.shell-course-menu a,.shell-course-menu button{display:flex;align-items:center;gap:14px;min-height:52px;padding:12px 14px;border:1px solid transparent;border-radius:15px;background:transparent;color:var(--ui-ink);text-decoration:none;text-align:left;font:500 14px/1.5 Poppins,system-ui,sans-serif}
.shell-course-menu [aria-current=page],.shell-course-menu :is(a,button):hover{background:var(--ui-hover);border-color:var(--ui-line);color:var(--ui-accent)}
.shell-tools-grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))}
.shell-tool{display:flex;align-items:center;gap:12px;min-height:60px;margin:0;padding:14px;border:1px solid var(--ui-line);border-radius:16px;background:#ffffff24;color:var(--ui-ink);text-align:left;font:500 13px/1.5 Poppins,system-ui,sans-serif;box-shadow:inset 0 1px 1px #ffffff30}
.shell-tool:hover{background:var(--ui-hover)}
.shell-search-field input,.shell-dialog input{display:block;box-sizing:border-box;width:100%;max-width:100%;min-height:48px;padding:12px 14px;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-solid);color:var(--ui-ink);font:14px/1.5 Poppins,system-ui,sans-serif}
.shell-dialog label{display:grid;gap:8px}
.shell-dialog form{margin:0;padding:0;border:0;background:transparent}
.shell-tool{text-decoration:none}
.shell-search-result{display:flex;align-items:center;gap:12px;padding:14px 8px;border-bottom:1px solid var(--ui-line);color:var(--ui-ink);text-decoration:none;font-size:13px}
.shell-search-result span{flex:1;min-width:0;overflow-wrap:anywhere}
.shell-search-result:hover{color:var(--ui-accent)}
.shell-muted{color:var(--ui-muted);font-size:13px}
.shell-primary{margin-top:18px;padding:12px 24px;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-accent);color:var(--ui-solid);font-weight:600}
/* The 48 existing questions become the same progressive-disclosure pattern as lessons. */
.systems-course details.system-lesson{padding:0;overflow:clip}
.systems-course details.system-lesson::before{display:none}
.system-lesson-summary{display:grid;grid-template-columns:42px minmax(0,1fr) 24px;align-items:center;gap:18px;list-style:none;padding:24px 28px;cursor:pointer;min-width:0}
.system-lesson-summary::-webkit-details-marker{display:none}
.system-lesson-number{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--ui-hover);color:var(--ui-accent);font:600 16px/1.4 Poppins,system-ui,sans-serif}
.system-lesson-kicker{display:block;margin-bottom:6px;color:var(--ui-muted);font:600 10px/1.5 Poppins,system-ui,sans-serif;letter-spacing:1px;text-transform:uppercase}
.systems-course .system-lesson-summary h2{font-size:clamp(1rem,2vw,1.3rem);line-height:1.55;margin:0}
.system-lesson-summary .shell-icon{transition:transform .2s}
.system-lesson[open]>.system-lesson-summary .shell-icon{transform:rotate(180deg)}
.system-lesson-content{padding:4px 28px 28px;border-top:1px solid var(--ui-line);min-width:0}
.systems-course .systems-index{padding:0}
.systems-index-summary{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 28px;list-style:none;cursor:pointer}
.systems-index-summary::-webkit-details-marker{display:none}
.systems-course .systems-index-summary h2{font:600 20px/1.5 Poppins,system-ui,sans-serif;margin:0}
.systems-index-summary span{display:block;margin-top:4px;color:var(--ui-muted);font:12px/1.5 Poppins,system-ui,sans-serif}
.systems-index>nav{padding:0 28px 28px}
.systems-index[open] .systems-index-summary>.shell-icon{transform:rotate(180deg)}
.systems-course .system-lesson-content>*{min-width:0;max-width:100%}
html[data-theme=dark] body{background:radial-gradient(ellipse at 0 0,#244c3e,transparent 50%),#14251f;color:var(--ink)}
html[data-theme=dark]{background:#14251f}
html[data-theme=dark] :is(.sidebar,.mobile-bottom,dialog#modal,.toast){background:var(--ui-glass);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-theme=dark] .sidebar :is(.workspace-pill,.faro-sidebar,.uni-mark){background:var(--ui-solid);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-theme=dark] .sidebar p{color:var(--ui-muted)}
html[data-theme=dark] :is(.shell-search,.panel,.resource-row,.topic-item){background:var(--ui-glass);border-color:var(--ui-line)}
html[data-theme=dark] :is(.search-field,.search-field input,.plan-form input,.plan-form select,.form-field input,.chat-form textarea){background:var(--ui-solid);color:var(--ui-ink);border-color:var(--line)}
html[data-theme=dark] :is(.date-label,.icon-button,.profile,.day b,.btn.secondary,.btn.subtle,.tool-card,.quick-action,.course-visual,.icon-tile,.reader-index a){background:var(--ui-glass);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-theme=dark] .faro-note{background:#3b3320;color:#f2d59a;border-color:#756844}
html[data-theme=dark] .faro-note p{color:#ead9af}
html[data-theme=dark] :is(.chat-message,.search-result:hover,.resource-row:hover){background:var(--tonal);color:var(--ink)}
html[data-theme=dark] .systems-course :is(.cover,.next-session){color:#fff}
html[data-theme=dark] .systems-course :is(.toc,.question,.figure,.formula-grid>div){background:var(--ui-glass);border-color:var(--ui-line);color:var(--ui-ink)}
html[data-theme=dark] .systems-course :is(.definition,.proof,.oral,.example,.note){background:#214132;color:var(--ink);border-color:#476b56}
html[data-theme=dark] .systems-course :is(.theorem,.followups){background:#3b3320;color:var(--ink);border-color:#756844}
html[data-theme=dark] .systems-course .warning{background:#40282b;color:var(--ink)}
html[data-theme=dark] .systems-course tr:nth-child(even) td{background:#20392e}
html[data-theme=dark] .systems-course .figure svg text{fill:var(--ink)}
html[data-theme=dark] .systems-course .figure svg .axis{stroke:var(--muted)}
html[data-theme=dark] .systems-course .figure svg .grid{stroke:var(--line)}
html[data-theme=dark] :is(.training-primary,.training-tab[aria-selected=true],.lab-tab[aria-selected=true],.study-action){color:#14251f}
html[data-theme=dark] .electronics-course .course-button:not(.course-button-secondary){color:#14251f}
html[data-theme=dark] [data-course-page=tutor] :is(form,article,details){background:var(--ui-glass);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-theme=dark] [data-course-page=tutor] :is(select,textarea,.student,.examples button){background:var(--ui-solid);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-theme=dark] [data-course-page=tutor] .ref{color:var(--ui-muted)}
html[data-theme=dark] [data-course-page=tutor] .tag{color:var(--ui-accent)}
[data-course-page=tutor] a{color:var(--ui-accent)}
html[data-theme=dark] [data-course-page=tutor] #reset{background:var(--ui-hover);color:var(--ui-ink)}
html[data-theme=dark] [data-course-page=tutor] .shell-dialog form{background:transparent}
@media(max-width:1100px){.shell-breadcrumb,.shell-search kbd{display:none}.shell-search span{max-width:180px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}
@media(max-width:760px){
 .site-header,.topbar.site-header{top:10px;margin:10px 12px 0;min-height:64px;padding:9px 12px;gap:8px;border-radius:23px}
 .shell-brand{font-size:18px;gap:6px;letter-spacing:-.9px}.shell-brand img{width:27px;height:32px}
 .shell-menu-button{display:none}
 .shell-search{padding:0;width:40px;min-width:40px;min-height:40px;border:0;background:transparent}
 .shell-search span,.shell-search kbd{display:none}
 .shell-button{width:40px;height:40px;border-radius:13px}.shell-profile{border-radius:50%;font-size:11px}
 body.has-site-shell{padding-bottom:110px}
 html:has(body.has-site-shell){scroll-padding-top:100px}
 body.has-site-shell .workspace-layout{margin-top:24px}
 body.has-site-shell .workspace-nav{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px}
 body.has-site-shell .workspace-nav a{flex:0 0 auto;white-space:nowrap;grid-column:auto;padding:10px 14px}
 .shell-bottom{position:fixed;z-index:60;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));display:flex;align-items:stretch;min-height:72px;padding:7px 5px;border:1px solid var(--ui-line);border-radius:26px;background:var(--ui-glass);color:var(--ui-ink);box-shadow:inset 0 1px 1px #ffffff55,0 8px 40px #214c3921;backdrop-filter:blur(28px) saturate(170%);-webkit-backdrop-filter:blur(28px) saturate(170%)}
 .shell-bottom a,.shell-bottom button{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:4px;margin:0;padding:5px 2px;border:1px solid transparent;border-radius:19px;background:transparent;color:var(--ui-muted);text-decoration:none;text-align:center;font:500 9px/1.35 Poppins,system-ui,sans-serif}
 .shell-bottom [aria-current=page],.shell-bottom [aria-expanded=true]{color:var(--ui-accent);background:var(--ui-hover);border-color:var(--ui-line)}
 .shell-bottom .shell-icon{width:20px;height:20px}
 .shell-dialog{padding:20px;max-height:calc(100dvh - 36px);border-radius:23px}
 .system-lesson-summary{grid-template-columns:34px minmax(0,1fr) 18px;gap:12px;padding:20px 16px}
 .system-lesson-number{width:34px;height:36px;font-size:14px}
 .system-lesson-content{padding:4px 18px 22px}
 .systems-index-summary{padding:20px}.systems-index>nav{padding:0 20px 24px}
 .system-lesson-kicker{font-size:9px;letter-spacing:.5px}
}
@media(max-width:380px){.site-header,.topbar.site-header{padding-inline:8px;gap:4px}.shell-brand{font-size:15px;gap:5px}.shell-brand img{width:20px}.shell-button,.shell-search{width:32px;height:38px;min-width:32px}.shell-bottom{left:8px;right:8px}.shell-bottom a,.shell-bottom button{font-size:8px}}
@media(prefers-reduced-motion:reduce){.system-lesson-summary .shell-icon{transition:none}}
@media(prefers-reduced-transparency:reduce){.site-header,.topbar.site-header,.shell-dialog,.shell-bottom{background:var(--ui-solid);backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(forced-colors:active){.site-header,.shell-dialog,.shell-bottom{background:Canvas;color:CanvasText;border-color:CanvasText;box-shadow:none}.shell-brand em{color:LinkText}}
@media print{.site-header,.shell-bottom,.shell-dialog{display:none!important}body.has-site-shell{padding:0}.systems-course details.system-lesson{display:block;overflow:visible;border:0;break-before:page}.system-lesson-content{display:block!important;padding:0;border:0}.system-lesson-summary{padding:0}.system-lesson-summary>.shell-icon{display:none}}

/* Readable text rhythm, independent of the size inherited from parent widgets. */
.has-site-shell :is(h1,h2,h3,h4,h5,h6){line-height:1.4}
.has-site-shell :is(p,li,dd,label){line-height:1.7}
.has-site-shell :is(.eyebrow,.workspace-card-label,.study-label){line-height:1.5}
.has-site-shell :is(.quick-action small,.tool-card p,.course-meta,.task-copy,.resource-copy p,.shell-search-result){line-height:1.6}
.has-site-shell .ring-value{line-height:1.15;gap:4px;text-align:center}
.has-site-shell .ring-value small{display:block;max-width:72px;font-size:9px;line-height:1.4;white-space:normal}
.has-site-shell .progress-ring{flex-shrink:0}
.has-site-shell .study-start-summary{padding:24px;gap:24px;align-items:center}
.has-site-shell .study-start-summary>span:first-child{min-width:0}
.has-site-shell .study-start-summary .study-label{margin:0 0 10px}
.has-site-shell .study-start-summary h2{margin:0;line-height:1.45}
.has-site-shell .disclosure-action{line-height:1.5;flex-shrink:0}
@media(max-width:760px){

 .site-header .shell-search{justify-content:center;gap:0;padding:0;flex-shrink:0;background:var(--ui-glass);border:1px solid var(--ui-line);border-radius:13px}
 .has-site-shell .study-start-summary{padding:22px;flex-wrap:wrap;gap:16px}
 .has-site-shell .study-start-summary>span:first-child{flex:1 1 240px}
 .has-site-shell .study-start-summary .disclosure-action{white-space:normal}
}
@media print{body.has-site-shell::before{display:none}}

/* The same fixed canvas covers html and body: no background seam at the viewport edge. */
html:has(body.has-site-shell){background:radial-gradient(ellipse at 0 0,#c9e9dcb8,transparent 50%),radial-gradient(ellipse at 95% 30%,#d4e9f2a3,transparent 45%),#eef5f1;background-attachment:fixed}
html[data-theme=dark]:has(body.has-site-shell){background:radial-gradient(ellipse at 0 0,#244c3e,transparent 50%),#14251f;background-attachment:fixed}
body.has-site-shell,html[data-theme=dark] body.has-site-shell{background:transparent}
body.has-site-shell::before{content:'';position:fixed;inset:0 0 auto;height:132px;z-index:49;pointer-events:none;background:transparent;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 15%,#000b 40%,#0003 70%,transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 15%,#000b 40%,#0003 70%,transparent 100%)}
.shell-native-controls[hidden]{display:none!important}
/* Initial course HTML already has its final chrome; controllers only bind behavior. */
html:not([data-workspace]) body[data-site-course] [data-workspace]:not([data-workspace=home]){display:none}
/* Every lesson and exercise gets the same spacing and disclosure rhythm as Systems. */
.has-site-shell :is(.foundation-stack,.study-list){display:grid;gap:16px;border-top:0}
.has-site-shell :is(.study-card,.foundation-card){margin-block:16px;border:1px solid var(--ui-line);border-radius:21px;background:var(--ui-glass);box-shadow:inset 0 1px 1px #ffffff22;overflow:clip}
.has-site-shell :is(.study-list,.foundation-stack)>:is(.study-card,.foundation-card){margin:0}
.has-site-shell :is(.study-card,.foundation-card)>summary{display:grid;grid-template-columns:42px minmax(0,1fr) 24px;gap:18px;align-items:center;min-height:0;padding:24px 28px;list-style:none}
.has-site-shell :is(.study-card,.foundation-card)>summary::-webkit-details-marker{display:none}
.has-site-shell :is(.study-card,.foundation-card) :is(.number,.foundation-number){display:grid;place-items:center;width:42px;height:42px;padding:0;border-radius:13px;background:var(--ui-hover);color:var(--ui-accent);font:600 14px/1.4 Poppins,system-ui,sans-serif}
.has-site-shell .summary-copy{display:grid;gap:6px;min-width:0}
.has-site-shell .summary-copy .eyebrow{font:600 10px/1.5 Poppins,system-ui,sans-serif;letter-spacing:.7px;color:var(--ui-muted);margin:0}
.has-site-shell .summary-copy .card-title{font:600 clamp(1rem,2vw,1.3rem)/1.55 Poppins,system-ui,sans-serif;letter-spacing:0;overflow-wrap:break-word;margin:0}
.has-site-shell .summary-copy small{font:400 12px/1.6 Poppins,system-ui,sans-serif;color:var(--ui-muted)}
.has-site-shell :is(.card-content,.foundation-content){min-width:0;padding:20px 28px 28px;border-top:1px solid var(--ui-line)}
.has-site-shell :is(.section-heading,.section-head){margin-block:40px 24px}
.has-site-shell :is(.section-heading,.section-head)>:is(p,h2,h3)+:is(p,h2,h3){margin-top:12px}
.has-site-shell :is(.panel,.lab,.card-content,.foundation-content,.system-lesson-content) :is(h2,h3,h4,h5)+:is(p,ul,ol,dl){margin-top:12px}
.has-site-shell :is(.card-content,.foundation-content,.system-lesson-content) p+p{margin-top:12px}
.has-site-shell :is(.workspace-actions,.intro-grid,.formula-sheet,.formula-grid){gap:20px}
.has-site-shell :is(.workspace-action,.next-session,.lab,.panel,.exercise,.training-panel,.foundation-content,.card-content,.study-start-inner){min-width:0;max-width:100%;box-sizing:border-box}
.has-site-shell :is(.workspace-action,.next-session)>:is(p,h2,h3){line-height:1.5}
/* Electronics: formulas stay inside their labels instead of becoming anonymous grid cells. */
.has-site-shell .electronics-labs{display:grid;grid-template-columns:minmax(0,1fr);gap:24px}
.has-site-shell .electronics-labs .lab{padding:28px;border:1px solid var(--ui-line);border-radius:21px;background:var(--ui-glass);overflow:hidden}
.has-site-shell .electronics-lab-body{min-width:0;max-width:100%;margin-top:20px}
.has-site-shell .electronics-labs label{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;align-items:center;min-width:0;max-width:100%;margin:20px 0;font-size:.9rem;line-height:1.6}
.has-site-shell .electronics-labs .lab-control-label{min-width:0}
.has-site-shell .electronics-labs output{font:500 .85rem/1.5 Poppins,system-ui,sans-serif;color:var(--ui-accent);white-space:nowrap}
.has-site-shell .electronics-labs input[type=range]{grid-column:1/-1;min-width:0;width:100%;max-width:100%;margin:4px 0;height:24px}
.has-site-shell .electronics-labs svg{display:block;max-width:100%;width:100%;height:auto;aspect-ratio:520/270;margin:20px 0 0;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-solid)}
.has-site-shell .electronics-labs .lab-output{margin:20px 0;padding:16px;font-weight:500;line-height:1.7;overflow-wrap:anywhere;min-width:0}
.has-site-shell .electronics-labs mjx-container{max-width:100%}
.has-site-shell .electronics-labs mjx-container[display=true]{overflow-x:auto;overflow-y:hidden}
.has-site-shell .electronics-labs blockquote{margin:20px 0 0;padding:16px;border-left:3px solid var(--ui-accent);line-height:1.7}
@media(max-width:760px){
 body.has-site-shell::before{height:110px}
 .has-site-shell :is(.study-card,.foundation-card)>summary{grid-template-columns:38px minmax(0,1fr) 18px;gap:12px;padding:20px 16px}
 .has-site-shell :is(.study-card,.foundation-card) :is(.number,.foundation-number){width:38px;height:38px;font-size:12px}
 .has-site-shell .summary-copy .eyebrow{font-size:9px;letter-spacing:.5px}
 .has-site-shell .summary-copy .card-title{font-size:1rem;line-height:1.55}
 .has-site-shell :is(.card-content,.foundation-content){padding:18px}
 .has-site-shell :is(.section-heading,.section-head){margin-block:32px 20px}
 .has-site-shell .electronics-labs .lab{padding:20px}
 .has-site-shell .electronics-labs label{grid-template-columns:minmax(0,1fr) auto;font-size:.85rem}
 .has-site-shell .workspace-sidebar{max-height:none;overflow:visible}
}
@media print{body.has-site-shell::before{display:none}}

.has-site-shell small{line-height:1.5}
.has-site-shell .ring-value small{line-height:1.4}

/* Override the old mobile edge-to-edge answer rule, including exercise solutions. */
.has-site-shell .workspace-content :is(.study-card,.foundation-card) :is(.card-content,.foundation-content){padding:20px 28px 28px}
.has-site-shell :is(.card-actions,.exercise-actions,.oral-actions){flex-wrap:wrap;gap:10px}
.has-site-shell .card-actions :is(button,label){max-width:100%;line-height:1.5;white-space:normal}
.has-site-shell :is(.card-content,.foundation-content) :is(img,svg,video){max-width:100%;height:auto}
@media(max-width:760px){.has-site-shell .workspace-content :is(.study-card,.foundation-card) :is(.card-content,.foundation-content){padding:18px}}

.has-site-shell :is(.card-content,.foundation-content,.system-lesson-content,.lab-readout,.lab-output){overflow-wrap:break-word}
.has-site-shell :is(.card-content,.foundation-content,.lab-readout,.lab-output) mjx-container:not([display=true]){display:inline-block;max-width:100%;vertical-align:middle;overflow-x:auto;overflow-y:hidden;padding-block:2px}
.has-site-shell .section-heading :is(.kicker,.eyebrow){font-size:11px;line-height:1.5;letter-spacing:1px}
.has-site-shell .section-heading>p:not(.kicker):not(.eyebrow){font-size:14px;line-height:1.75}

/* Readable practice note, with explicit foregrounds for every text element. */
html[data-theme=dark] .callout{background:#203b30;border-color:#476b56;color:#edf6f0}
html[data-theme=dark] .callout strong{color:#edf6f0}
html[data-theme=dark] .callout p{color:#c0d6c8}
html[data-theme=dark] .callout>.icon{color:#82e0b2;flex-shrink:0}
/* Both exam modes share the same inset workspace and text rhythm. */
.has-site-shell :is(#training-panel-oral,#training-panel-exam) .training-workbench{box-sizing:border-box;min-width:0;padding:24px;margin-top:24px}
.has-site-shell :is(#training-panel-oral,#training-panel-exam) .oral-head{gap:20px;min-width:0}
.has-site-shell .oral-head>div{min-width:0}
.has-site-shell .oral-head .training-label{font-size:11px;line-height:1.5;margin:0 0 12px}
.has-site-shell .oral-head h3{font-size:clamp(18px,2.2vw,24px);line-height:1.45;margin:0}
.has-site-shell .oral-head .training-muted{margin:12px 0 0;line-height:1.7}
.has-site-shell .oral-timer{font-size:13px;line-height:1.5;align-self:start;white-space:nowrap}
.has-site-shell .training-workbench .training-field{margin-top:24px;gap:10px;font-size:13px;font-weight:500}
.has-site-shell .training-workbench textarea{box-sizing:border-box;min-width:0;max-width:100%;font:400 14px/1.65 Poppins,system-ui,sans-serif;padding:14px;min-height:220px}
.has-site-shell .training-workbench .training-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}
.has-site-shell .training-workbench .training-actions button{min-height:44px;max-width:100%;white-space:normal;line-height:1.5;padding:12px 16px}
.has-site-shell .training-workbench .exam-list{margin:24px 0;padding-left:24px}
.has-site-shell .training-workbench .exam-list li{margin:14px 0}
@media(max-width:760px){
 body.has-site-shell .workspace-sidebar{margin:0 0 26px;padding:4px 10px;box-sizing:border-box;width:100%;max-width:100%}
 .has-site-shell :is(#training-panel-oral,#training-panel-exam){padding:18px 14px}
 .has-site-shell :is(#training-panel-oral,#training-panel-exam) .training-workbench{padding:18px;margin-top:20px}
 .has-site-shell .training-workbench .oral-head{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
 .has-site-shell .training-workbench .training-actions button{flex:1 1 200px}
}
.has-site-shell .training-workbench textarea::placeholder{color:var(--ui-muted);opacity:1}

/* Faro composer and suggestions retain readable contrast on dark glass. */
html[data-theme=dark] .chat-questions button{background:#244437;color:#e5f4eb;border:1px solid #648575;font-size:12px;line-height:1.5;min-height:40px;padding:8px 12px}
html[data-theme=dark] .chat-questions button:hover{background:#315b48;color:#fff}
html[data-theme=dark] .chat-form{border-color:#476b56}
html[data-theme=dark] .chat-form input{background:#172d24;color:#edf6f0;border:1px solid #648575;caret-color:#82e0b2;font-size:14px;line-height:1.5;min-height:44px}
html[data-theme=dark] .chat-form input::placeholder{color:#b9cec1;opacity:1}
html[data-theme=dark] .chat-form button{background:#82e0b2;color:#14251f;min-width:44px;min-height:44px}
html[data-theme=dark] .chat-footnote{color:#b9cec1;font-size:11px;line-height:1.6}
@media(max-width:760px){html[data-theme=dark] .chat-form input{font-size:16px}}
/* Course menu and calendar */
.shell-study-menu-button { display: none; }
.study-route-links { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 18px; }
#theory-selection { margin-block: 20px; }
#theory-selection h2 { margin-block: 16px 10px; }
#mappa .chapter-map { margin-block: 16px; }
#mappa .chapter-link { display: grid; gap: 6px; }
#training-back { margin-block: 0 16px; }
#study-date-warning { padding: 14px; background: var(--ui-hover); color: var(--ui-ink); border-color: var(--ui-line); }
.calendar-panel { padding: clamp(12px, 3vw, 28px); }
.calendar-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 14px; }
.calendar-toolbar h2, .calendar-toolbar h3 { margin: 0; }
.calendar-toolbar label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.calendar-toolbar input { max-width: 100%; color: var(--ui-ink); background: var(--ui-solid); border: 1px solid var(--ui-line); border-radius: 8px; padding: 6px; }
#calendar-import { max-width: 220px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; text-align: center; }
.calendar-day { display: grid; align-content: start; gap: 4px; min-height: 52px; padding: 6px 2px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-solid); color: var(--ui-ink); font: inherit; }
.calendar-day[aria-pressed=true] { background: var(--ui-hover); border-color: var(--ui-accent); }
.calendar-day[aria-current=date] { font-weight: 700; }
.calendar-other-month { color: var(--ui-muted); }
.calendar-day small { color: var(--ui-accent); }
.calendar-agenda { display: grid; gap: 8px; padding: 0; list-style: none; margin-block: 12px; }
.calendar-agenda li, .saved-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--ui-line); padding: 10px 0; }
.calendar-agenda li > div, .saved-plan > div { flex: 1 1 140px; overflow-wrap: anywhere; }
.calendar-agenda small, .saved-plan small { display: block; color: var(--ui-muted); }
.week-panel > .btn { margin-block: 10px 20px; }
.calendar-check { display: flex; align-items: center; gap: 8px; }
html[data-theme=dark] .calendar-panel :is(input,button:not(.btn)), html[data-theme=dark] #calendar-event-form textarea { color: var(--ui-ink); }
html[data-theme=dark] #calendar-event-form textarea { background: var(--ui-solid); border-color: var(--ui-line); }
@media(max-width:760px) {
  body[data-site-course="teoria-dei-segnali"] .workspace-sidebar,
  body[data-site-course="elettronica-1"] .workspace-sidebar { display: none; }
  .site-header .shell-study-menu-button { display: inline-flex; }
  #course-study-menu .workspace-nav { display: grid; gap: 7px; overflow: visible; padding: 0; }
  #course-study-menu .workspace-nav a { white-space: normal; }
  #course-study-menu .workspace-nav a span { display: none; }
  body:has(.shell-study-menu-button) .site-header { gap: 5px; padding-inline: 8px; }
  body:has(.shell-study-menu-button) .shell-brand { font-size: clamp(13px,4vw,17px); gap: 4px; }
  body:has(.shell-study-menu-button) .shell-brand img { width: 21px; }
  body:has(.shell-study-menu-button) .site-header :is(.shell-button,.shell-search) { width: 34px; min-width: 34px; }
  .calendar-event-label { display: none; }
}

[data-theory-category] :is(#risposte,#dimostrazioni,#percorso-accompagnato) > .section-heading, [data-theory-category] .chapter-block > .chapter-heading { display: none; }
/* Shared course navigation and study actions */
.has-site-shell .study-route-links .course-button,
.has-site-shell #mappa > p .course-button {
  background: var(--ui-hover);
  color: var(--ui-accent);
  border: 1px solid var(--ui-line);
}
.has-site-shell .study-route-links .course-button:hover,
.has-site-shell #mappa > p .course-button:hover {
  background: var(--ui-accent);
  color: var(--ui-solid);
}
.electronics-paper { padding: 16px; }
.electronics-paper summary { cursor: pointer; font-weight: 650; }
.electronics-paper article { margin-top: 18px; }
.electronics-paper img { display: block; max-width: 100%; height: auto; }
.electronics-course[data-site-course] .workspace-nav a[data-workspace-link] { grid-template-columns: 1fr; }
html[data-workspace=tutor] .electronics-course :is(.training-tabs,.training-stats,.training-section > .section-heading) { display: none; }
.signals-tutor-layout > main.workspace-content { padding: 0; }
.systems-course .systems-index ol.chapter-map { padding: 0; list-style: none; }
.systems-course .systems-index ol.chapter-map li { margin: 0; }
.systems-course .systems-index > summary { display: none; }
.systems-course .systems-back { margin: 0 0 16px; }
.systems-course .study-start { margin-top: 20px; padding: 16px; }
.systems-course #systems-plan { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.systems-course #systems-plan label { display: grid; gap: 5px; }
.systems-course :is(#systems-plan,#tutor-ia) :is(input,select,textarea) {
  color: var(--ui-ink); background: var(--ui-solid); border: 1px solid var(--ui-line); border-radius: 8px; padding: 10px; font: inherit;
}
.systems-course #tutor-ia { border: 1px solid var(--ui-line); border-radius: 18px; background: var(--ui-glass); }
.systems-course #systems-plan-calendar li { margin-block: 10px; }
.plan-output .roadmap { padding-inline-start: 18px; }
.plan-output .roadmap li::before { inset-inline-start: -13px; top: 12px; bottom: -12px; }
.plan-output .roadmap li:last-child::before { display: none; }
@media (max-width: 760px) {
  body:has(.shell-study-menu-button) .workspace-sidebar { display: none; }
  .signals-tutor-layout > main.workspace-content { width: 100%; }
}
@media print {
  .systems-course :is(.workspace-sidebar,.workspace-heading,.systems-back,#workspace-home,#allenamento-menu,#tutor-ia) { display:none!important; }
}
.has-site-shell :is(.training-tab[aria-selected=true],.lab-tab[aria-selected=true],.training-primary,.study-action) {
  background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-solid);
}
.has-site-shell :is(.training-primary,.study-action):hover {
  background: var(--ui-hover); color: var(--ui-accent);
}
.workspace-nav a[aria-current=page] { background: var(--ui-hover); color: var(--ui-accent); }
.systems-course .chapter-map { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr)); gap: 12px; }
.systems-course .chapter-link { display: block; padding: 12px; border: 1px solid var(--ui-line); border-radius: 12px; }
.systems-course #tutor-ia :is(select,textarea) { width: 100%; }

/* Course indexes, oral explanations and navigation contrast */
.has-site-shell [data-workspace=training] .study-route-links .course-button,
.has-site-shell :is(.training-primary,.training-secondary,.training-tab,.lab-tab,.training-outline) {
  background:#195b46; border-color:#397960; color:#fff;
}
.has-site-shell [data-workspace=training] .study-route-links .course-button:hover,
.has-site-shell :is(.training-primary,.training-secondary,.training-tab,.lab-tab,.training-outline):hover {
  background:#22694f; border-color:#60ad8c; color:#fff;
}
.has-site-shell :is(.training-tab,.lab-tab)[aria-selected=true] {
  background:#0b4936; border-color:#83c8a6; color:#fff; box-shadow:inset 0 -3px #83c8a6;
}
#lezioni .electronics-theory-index > h2 { margin:0 0 .65rem; }
.electronics-theory-index .chapter-map { list-style:none; padding:0; margin:0 0 1.65rem; }
.electronics-theory-index .chapter-link,
.systems-course .systems-index .chapter-link {
  display:grid; align-content:center; align-items:center; gap:.3rem;
  min-height:68px; padding:.85rem 1rem; border:1px solid var(--ui-line); border-radius:16px;
  background:var(--ui-glass); color:var(--ui-ink); text-decoration:none; line-height:1.5; overflow-wrap:anywhere;
}
.electronics-theory-index .chapter-link small { color:var(--ui-muted); font-size:.82em; }
.electronics-theory-index .chapter-link:hover,
.systems-course .systems-index .chapter-link:hover { background:var(--ui-hover); color:var(--ui-ink); }
.index-back { display:inline-flex; margin-bottom:1rem; }
.systems-course { --ink:var(--ui-ink); --muted:var(--ui-muted); --blue:var(--ui-accent); --teal:var(--ui-accent); }
.systems-course .systems-index .chapter-map { columns:auto; grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr)); }
.systems-course .systems-index .chapter-link { grid-template-columns:2.25rem minmax(0,1fr); gap:.75rem; height:100%; }
.systems-course .oral-number { display:grid; place-items:center; min-height:2.25rem; border-radius:.7rem; background:var(--ui-hover); color:var(--ui-accent); font-weight:600; }
.systems-course .system-lesson { background:var(--ui-glass); color:var(--ui-ink); border-color:var(--ui-line); }
.systems-course .system-lesson-summary { padding:clamp(1rem,3vw,1.75rem); background:var(--ui-hover); }
.systems-course .system-lesson-content { padding:clamp(1rem,3vw,1.75rem); line-height:1.75; }
.systems-course .system-lesson-content :is(.definition,.proof,.oral,.example,.note,.followups,.theorem) {
  border-color:var(--ui-accent); color:var(--ui-ink); background:var(--ui-hover);
}
.sidebar .nav-item { color:var(--ui-ink); font-size:.9rem; font-weight:500; line-height:1.5; }
.sidebar .nav-item:is(:hover,.active) { color:var(--ui-accent); background:var(--ui-hover); }
.sidebar .nav-label { color:var(--ui-muted); font-size:.72rem; }
.sidebar :is(.workspace-pill,.sidebar-foot,.faro-sidebar p,.faro-sidebar button) { font-size:.8rem; line-height:1.55; }
.sidebar .faro-sidebar button { background:var(--ui-solid); border-color:var(--ui-line); color:var(--ui-ink); }

/* Keep the Signals tutor aligned with the course workspace. */
body[data-course-page=tutor] .workspace-sidebar { padding:16px; }
body[data-course-page=tutor] .workspace-nav a { color:var(--ui-muted); }
body[data-course-page=tutor] .workspace-nav a[aria-current=page] { color:var(--ui-accent); }
body[data-course-page=tutor] .workspace-nav-note { color:var(--ui-muted); }
body[data-course-page=tutor] .signals-tutor-layout > main.workspace-content { width:100%; max-width:none; margin:0; min-width:0; }

.systems-course #workspace-home .next-session {
  background:radial-gradient(ellipse at 90% 0,#78b6a633,transparent 60%),linear-gradient(125deg,#084d40,#0d584a);
  color:#e0eee5; border-color:#80ab98;
}
.systems-course #workspace-home .next-session h2 { color:#fff; }
.systems-course #tutor-ia #tutor-study-link { color:var(--ui-accent); text-underline-offset:.18em; }
.systems-course #tutor-ia :is(#tutor-draw,#tutor-microphone) {
  min-height:44px; padding:.55rem 1rem; border:1px solid #397960; border-radius:13px;
  background:#195b46; color:#fff; box-shadow:none; font:600 .86rem/1.4 Poppins,system-ui,sans-serif;
}
.systems-course #tutor-ia :is(#tutor-draw,#tutor-microphone):hover:not(:disabled),
.systems-course #tutor-ia #tutor-microphone[aria-pressed=true] { background:#22694f; border-color:#83c8a6; }
.systems-course #tutor-ia .training-controls { display:flex; flex-wrap:wrap; gap:10px; }
.systems-course #tutor-ia textarea::placeholder { color:var(--ui-muted); opacity:1; }
html body.electronics-course.has-site-shell #allenamento-menu .study-route-links a.course-button {
  color:#fff; background:#195b46; border-color:#397960;
}
html body.electronics-course.has-site-shell #allenamento-menu .study-route-links a.course-button:hover {
  color:#fff; background:#22694f; border-color:#60ad8c;
}

body[data-site-course="teoria-dei-sistemi"] .workspace-nav a[aria-current=page] {
  color:var(--ui-accent);
}

.deadline-warning { flex-basis:100%; grid-column:1/-1; margin:0; font-size:.88rem; line-height:1.55; color:#754000; }
html[data-theme=dark] .deadline-warning { color:#ffd18c; }
.deadline-warning:empty { position:absolute; width:1px; height:1px; overflow:hidden; }
