/* Shared spacing and controls, loaded after feature-specific styles. */
*{box-sizing:border-box}
.shell{min-width:0}
#app{width:100%;max-width:1500px;margin-inline:auto;padding:clamp(22px,3vw,44px)}
.intro{gap:16px;margin-bottom:28px}
.intro h1{line-height:1.18;letter-spacing:-.025em}
.intro p{line-height:1.7;max-width:74ch}
.card{padding:clamp(20px,2.2vw,32px);margin-bottom:24px;min-width:0}
.section-head{gap:14px;flex-wrap:wrap;margin-bottom:20px}
.section-head h2{margin:0;line-height:1.3}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.primary,.secondary,.danger{min-height:40px;line-height:1.35}
.form-grid{gap:18px;align-items:start}
.field{gap:8px;line-height:1.5}
.field input,.field select{min-height:44px}
.field textarea{line-height:1.7}
.form-grid>.field{margin-bottom:0;min-width:0}
fieldset{min-width:0}
p.notice,p.error-message{line-height:1.7}
.logo{width:42px;height:42px;flex:0 0 42px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:none!important}
.logo img{display:block;width:42px;height:42px;object-fit:contain}
nav a>.icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;line-height:1}
.notification-bell>span:first-child{display:flex;align-items:center}
.panel-drag-handle{cursor:grab;touch-action:none;user-select:none}
.panel-drag-handle:active{cursor:grabbing}
.panel-drag-handle:focus-visible{outline:3px solid var(--green);outline-offset:-3px}
.desmos-panel{resize:both;overflow:auto;min-width:300px;min-height:360px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);width:min(720px,calc(100vw - 32px));height:min(720px,calc(100dvh - 110px));display:flex;flex-direction:column}
.desmos-panel[hidden]{display:none}
.desmos-panel iframe{flex:1;min-height:200px;height:auto;width:100%}
.desmos-bar{flex-shrink:0;gap:12px;align-items:center;padding:10px 4px;border-bottom:1px solid var(--line)}
.desmos-bar strong{line-height:1.4}
.desmos-panel>p{margin-block:10px;font-size:12px}
.desmos-panel>a{display:block;margin-top:10px;font-size:12px;flex-shrink:0}
.name-dialog{max-height:calc(100dvh - 24px);overflow:auto}
.name-dialog h2{padding-block:8px}
.calendar-clock{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;align-items:end;gap:10px;margin:0}
.calendar-clock legend{padding-inline:5px;font-size:13px;font-weight:600}
.calendar-clock label{display:grid;gap:5px;flex:1;font-size:11px;color:var(--muted)}
.calendar-clock select{min-width:0;min-height:44px;width:100%;color:var(--ink);background:var(--paper,#fff);border:1px solid var(--line);border-radius:8px;padding:8px}
.calendar-clock>span{padding-bottom:12px}
.note-drawing{border-top:1px solid var(--line);padding-top:18px;margin-top:20px}
.note-drawing>summary{cursor:pointer;font-weight:600;font-size:14px;padding-block:8px}
.drawing-tools{display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin-block:16px}
.drawing-tools label{display:grid;gap:6px;font-size:12px}
.drawing-tools select{min-height:40px;border:1px solid var(--line);border-radius:8px;padding:8px;background:var(--paper,#fff);color:var(--ink)}
.note-canvas{display:block;width:100%;height:auto;aspect-ratio:1200/650;border:1px solid #d0d9d4;border-radius:12px;background:white;touch-action:none;cursor:crosshair}
.study-audio>.file-picker{display:inline-flex;margin:0 12px 20px 0}
.study-audio>#build-audio{margin-bottom:20px}
.study-audio>.actions{margin-top:18px}
.study-audio>p{max-width:85ch;line-height:1.7}
.quiz-dropzone{line-height:1.6;padding:22px}
@media(max-width:760px){
 #app{padding:22px 16px 100px}
 .card{padding:20px;margin-bottom:18px}
 .intro{margin-bottom:22px}
 .intro h1{font-size:28px}
 .section-head{gap:12px;margin-bottom:16px}
 .actions .primary,.actions .secondary{flex-grow:1}
 .desmos-panel{width:calc(100vw - 16px);min-width:260px;height:calc(100dvh - 110px)}
 .desmos-bar{flex-wrap:wrap}
 .drawing-tools{gap:8px}
 .note-canvas{min-height:240px}
}

.practice-question h3{white-space:pre-line;line-height:1.65}

.group-members{padding:16px;border:1px solid var(--line);border-radius:10px;margin-bottom:18px}.group-members label{display:flex;align-items:center;gap:10px;padding:8px 0;overflow-wrap:anywhere}.group-members input{width:18px;height:18px;flex-shrink:0}.group-members legend{padding-inline:5px;font-size:13px;font-weight:600}

.recording-meter{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:18px 0}.recording-meter strong{font-size:30px;font-variant-numeric:tabular-nums}.recording-meter>[data-record-light]{width:13px;height:13px;border-radius:50%;background:var(--line)}.recording-meter>.is-recording{background:#c83c3c;box-shadow:0 0 0 5px #c83c3c22}.recording-row{display:flex;justify-content:space-between;gap:16px;align-items:center;border-bottom:1px solid var(--line);padding:18px 0}.recording-row strong,.recording-row small{display:block;overflow-wrap:anywhere}.recording-row small{color:var(--muted);margin-top:6px;font-size:11px}.lecture-recorder audio{width:100%;margin:14px 0}.lecture-recorder>p{line-height:1.7}.lecture-recorder [data-record-preview]{margin-top:22px}@media(max-width:760px){.recording-row{align-items:start;flex-direction:column}.recording-row>.actions{width:100%}.recording-meter strong{font-size:26px}}

/* Expanded lesson keeps the same editor and save pipeline; no copied draft. */
.notes-workbench.lesson-expanded{display:block;max-width:1100px;margin-inline:auto}
.notes-workbench.lesson-expanded .notes-library[hidden],#google-notes-host[hidden]{display:none}
.notes-workbench.lesson-expanded .note-editor{width:100%;min-width:0;min-height:75dvh;padding:clamp(20px,4vw,48px)}
.notes-workbench.lesson-expanded #note-body{min-height:55dvh;font-size:17px;line-height:1.85;resize:vertical}
.notes-workbench.lesson-expanded .note-preview{min-height:55dvh;font-size:18px;line-height:1.9;max-width:78ch;margin-inline:auto;overflow-wrap:anywhere}
.notes-workbench.lesson-expanded .note-toolbar{position:sticky;top:8px;z-index:10;background:var(--cream);padding:12px;border:1px solid var(--line);border-radius:12px}
#expand-note-lesson[aria-expanded="true"]{background:var(--green);color:var(--cream)}
@media(max-width:600px){.notes-workbench.lesson-expanded .note-editor{padding:18px}.notes-workbench.lesson-expanded #note-body,.notes-workbench.lesson-expanded .note-preview{font-size:16px}.notes-workbench.lesson-expanded .note-toolbar{position:static}}
.notes-page .field[hidden],.notes-page .note-preview[hidden]{display:none}
#note-explanation-host[hidden],.note-explanation [hidden]{display:none}
.note-explanation{margin-top:24px;border:1px solid var(--line)}
.note-explanation textarea[readonly]{min-height:120px;max-height:250px;resize:vertical;font-size:14px;line-height:1.6}
.note-explanation-preview{max-height:65dvh;overflow:auto;overflow-wrap:anywhere;border:1px solid var(--line);border-radius:12px;padding:22px;margin:18px 0;line-height:1.85;background:var(--cream)}
.local-podcast{margin-bottom:24px}.local-podcast [hidden]{display:none}.local-podcast textarea{width:100%;min-height:130px}.local-podcast audio{display:block;width:100%;margin:18px 0}.local-podcast [data-pod-result]{padding-top:12px;border-top:1px solid var(--line)}
.feature-tabs{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 24px}.feature-tabs [aria-pressed=true]{background:#176452;color:#fff;border-color:#176452}.feature-panel[hidden],.exam-landing .field[hidden],.exam-landing .exam-option[hidden]{display:none!important}
.saved-podcast-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line)}
html[data-theme=dark] .auth-submit,html[data-theme=dark] .mode-tabs button.active{background:#286c56;color:#fff}
html[data-theme=dark] .quiz-dropzone{background:#24352b;color:#dce9df;border-color:#7d9c88}
html[data-theme=dark] .quiz-dropzone .file-picker,html[data-theme=dark] .quiz-dropzone button{background:#286c56;color:#fff}
html[data-theme=dark] .quiz-dropzone small,html[data-theme=dark] .quiz-dropzone p{color:#c6d8cc}
html[data-theme=dark] .auth-note,html[data-theme=dark] .auth-form-side .notice,html[data-theme=dark] .auth-subtitle{color:#c2d1c7}
@media(max-width:600px){.feature-tabs{gap:8px}.feature-tabs button{flex:1 1 40%}.saved-podcast-row{align-items:flex-start;flex-direction:column}}
html[data-theme=dark] .auth-mode{background:#22362a;border-color:var(--line)}
html[data-theme=dark] .auth-mode button{color:#c6d8cc}
html[data-theme=dark] .auth-mode button.active{background:#286c56;color:white}

/* Learning studio: shared spacing, readable text, and keyboard access. */
#app{overflow-wrap:anywhere}
#app .card + .card{margin-top:24px}
#app .actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
#app :is(button,a,input,select,textarea):focus-visible{outline:3px solid var(--accent,#2d8a70);outline-offset:3px}
.language-home,.language-question,.recall-card{max-width:880px;margin-inline:auto}
.language-question h2,.recall-card h2{font-size:clamp(1.5rem,3vw,2.5rem);line-height:1.4}
.language-question progress{width:100%;height:10px;margin-bottom:24px;accent-color:#27816b}
.language-question input{font-size:1.2rem;min-height:52px}
.language-table{width:100%;border-collapse:collapse;margin-top:24px}
.language-table :is(th,td){text-align:start;padding:14px 10px;border-bottom:1px solid var(--line,#ccd7d2)}
.language-table td[dir=rtl]{font-size:1.3rem}
.note-study-tools{margin-block:16px;padding:16px;border:1px solid var(--line,#ccd7d2);border-radius:14px}
.note-study-tools summary,.mistake-item summary{cursor:pointer;font-weight:600;padding-block:8px}
.note-study-tools .actions{margin-block:12px}
.mistake-item{padding:16px 0;border-bottom:1px solid var(--line,#ccd7d2)}
.mistake-item p,.recall-answer{white-space:pre-wrap;line-height:1.8}
.notes-page #note-body{line-height:1.85;tab-size:2;min-height:350px}
@media(max-width:700px){#app .actions>*{max-width:100%}.note-study-tools{padding:12px}.language-table :is(th,td){padding:10px 6px}.notes-page #note-body{min-height:300px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

@media(max-width:700px){.more-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}.more-shortcuts .quick strong{font-size:13px}.more-shortcuts .quick{padding:18px 14px}}
.language-question #language-feedback:not(:empty){border-inline-start:4px solid var(--green);padding:12px 16px;background:var(--paper,#eaf2ed);border-radius:8px;line-height:1.7}

/* Expanded lessons stay readable and keep their contents distinct from app navigation. */
.lesson-copy{max-width:90ch;margin-inline:auto}
.lesson-copy .preserve-lines{line-height:1.9}
.lesson-contents{grid-template-columns:repeat(2,minmax(0,1fr))!important;height:auto;gap:10px}
.lesson-contents a{display:block;text-align:start;line-height:1.65;font-size:13px;padding:10px}
.lesson-copy [data-explore-topic]{text-align:start;white-space:normal;line-height:1.6;margin-block:5px}
@media(max-width:760px){.lesson-contents{grid-template-columns:1fr!important}.lesson-contents a{flex-direction:row;font-size:13px;padding:10px}.lesson-copy .worked-example{padding:16px}}
