/* Reading and teaching notes share one renderer in the learner and studio preview. */
.reading-tools{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:0 0 18px;margin-bottom:24px;font-size:12px;color:var(--muted)}
.reading-tools>span{margin-right:auto;font-weight:600}
.reading-size{display:flex;gap:3px;padding:3px;border:1px solid var(--line);border-radius:9px}
.reading-size button{width:36px;height:34px;border:0;border-radius:6px;background:transparent;color:var(--ink);font-size:14px}
.reading-size button[aria-pressed=true]{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent-line)}
.reading-size .large{font-size:20px}
.reading-tools select{border:1px solid #89968e;background:var(--surface);color:var(--ink);font-size:13px;border-radius:8px;min-height:42px;padding:8px 10px;max-width:180px}
.lesson-notes{--reading-font:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;--reading-size:18px;font-family:var(--reading-font);font-size:var(--reading-size);line-height:1.8;letter-spacing:.005em;max-width:70ch;margin:30px auto;overflow-wrap:anywhere;color:var(--ink)}
.reading-large .lesson-notes{--reading-size:21px}
.reading-serif .lesson-notes{--reading-font:Georgia,'Times New Roman',serif;letter-spacing:0}
.lesson-notes p{font-size:inherit;line-height:1.8;white-space:pre-line;margin:0 0 1.15em}
.lesson-notes strong{font-weight:650}
.reading-serif .lesson-notes strong{font-weight:700}
.lesson-notes mark{color:var(--ink);background:var(--highlight);padding:.04em .18em;border-radius:3px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.lesson-notes h2,.lesson-notes h3{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;letter-spacing:-.025em;text-wrap:pretty}
.lesson-notes .note-heading{font-size:1.3em;font-weight:650;line-height:1.35;margin:1.7em 0 .7em;color:var(--primary)}
.lesson-notes .lesson-intro:has(+*){border-left:3px solid var(--primary-line);padding:3px 0 1px 20px;margin-bottom:28px}
.lesson-notes .note-list{padding:0;margin:20px 0 30px;list-style:none;counter-reset:note-step;display:grid;gap:18px}
.note-list li{counter-increment:note-step;display:flex;align-items:baseline;gap:16px}
.note-list li:before{content:'';width:6px;height:6px;background:var(--accent);border-radius:50%;flex-shrink:0;margin:12px 5px 0}
.note-list.numbered li:before{content:counter(note-step,decimal-leading-zero);width:29px;height:29px;display:flex;align-items:center;justify-content:center;align-self:flex-start;background:var(--accent-soft);color:var(--accent);font:600 11px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;border:1px solid var(--line);border-radius:8px;margin:3px 0 0}
.note-list li>div{min-width:0;white-space:pre-line}
.note-callout{display:flex;gap:16px;border:1px solid var(--line);border-left:3px solid var(--accent);background:var(--accent-soft);padding:22px 24px;border-radius:4px 16px 16px 4px;margin:28px 0}
.note-callout>div:last-child{min-width:0}
.note-callout-icon{color:var(--accent);display:grid;place-items:center;align-self:flex-start;width:34px;height:34px;border-radius:10px;background:#ffffffb3;flex-shrink:0}
.note-callout h3{font-family:var(--hand);font-size:1.65em;font-weight:700;letter-spacing:0;line-height:1.15;margin:0 0 10px}
.note-callout p{font-size:.94em;line-height:1.75}
.note-callout p:last-child{margin-bottom:0}
.note-callout.note-important{background:var(--primary-soft);border-color:var(--primary-line);border-left-color:var(--primary)}
.note-important .note-callout-icon{color:var(--primary)}
.note-callout.note-warning{background:var(--warning-soft);border-color:var(--warning-line);border-left-color:var(--warning)}
.note-warning .note-callout-icon{color:var(--warning)}
.note-callout.note-note{background:var(--blue-soft);border-color:#c3dcf2;border-left-color:var(--blue)}
.note-note .note-callout-icon{color:var(--blue)}
.note-figure{margin:32px 0;padding:28px;border:1px solid var(--line);background:radial-gradient(#bdd8d5 .8px,transparent .8px) 0 0/16px 16px,#f3f9f7;border-radius:14px}
.note-kicker{font:600 10px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;letter-spacing:.13em;text-transform:uppercase;color:var(--muted)}
.note-figure h3{font-size:1.05em;font-weight:600;line-height:1.4;margin:8px 0 24px}
.note-diagram{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:24px;list-style:none;margin:0;padding:0}
.note-diagram li{position:relative;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:0 3px 0 #d6e5e3;padding:18px 15px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
.diagram-number{display:grid;place-items:center;width:32px;height:32px;border:1px solid var(--accent-line);color:var(--accent);border-radius:50%;font-size:11px;font-weight:600;margin-bottom:16px;background:var(--accent-soft)}
.note-diagram strong{display:block;font-size:.88em;line-height:1.45;margin-bottom:8px}
.note-diagram p{font-size:.8em;color:var(--muted);line-height:1.65;margin:0}
.note-diagram li>svg{position:absolute;right:-23px;top:28px;width:21px;height:21px;color:var(--accent)}
.note-diagram.comparison .diagram-number{border:0;border-radius:6px;width:24px;height:24px;background:var(--surface-soft);color:var(--muted);margin-bottom:10px}
.note-figure .note-caption{font-size:.8em;color:var(--muted);line-height:1.65;margin:20px 0 0}
.note-details{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 0;margin:28px 0;font-size:.9em}
.note-details summary{cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:inherit;font-weight:600;line-height:1.6}
.note-details[open] summary{margin-bottom:16px}
.note-details>div>p:last-child{margin-bottom:0}
.note-term{display:inline;border:0;border-bottom:1px dotted var(--accent);border-radius:2px;padding:0 .04em;background:transparent;color:var(--accent);font:inherit;line-height:inherit;text-align:inherit;cursor:help}
.note-term>span{display:inline-flex;align-items:center;justify-content:center;width:12px;height:12px;font:600 9px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;border:1px solid currentColor;border-radius:50%;margin-left:4px;vertical-align:super}
.note-term:hover,.note-term[aria-expanded=true]{background:var(--accent-soft);border-bottom-style:solid}
.note-tooltip{position:fixed;z-index:100;width:320px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;padding:18px 20px;border:1px solid #4c5e62;border-radius:12px;background:var(--hero);color:var(--on-hero);box-shadow:0 12px 36px #242a312e;font:14px/1.65 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;white-space:normal;overflow-wrap:anywhere}
.note-tooltip[hidden]{display:none}
.note-tooltip strong{display:block;font-size:13px;margin-bottom:8px}
.note-tooltip span{display:block;color:var(--hero-muted)}
.lesson-stage .answer-form{max-width:70ch;margin:30px auto 0;border-top:1px solid var(--line);padding-top:8px}
.lesson-stage .answer-option{font-size:16px;line-height:1.7}
.lesson-stage .feedback p{font-size:16px;line-height:1.75}
.preview-content .lesson-notes{margin:24px auto;font-size:var(--reading-size)}
.preview-content .note-details{padding:16px 0}
.preview-content .note-details summary{font-size:inherit}

/* Authoring controls use ordinary labelled fields, with the same learner preview. */
.content-formatting{display:flex;gap:7px;flex-wrap:wrap;margin:0}
.content-formatting .btn{min-height:36px;padding:7px 10px}
.content-formatting mark{background:var(--highlight);color:var(--ink);padding:0 3px}
.notes-editor{border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:28px 0;padding:26px 0}
.notes-editor-heading h2{font-size:20px;margin:0 0 10px}
.notes-editor-heading p{font-size:13px;line-height:1.7;color:var(--muted);margin-bottom:20px}
.note-editors{display:grid;gap:16px}
.note-editor-block{border:1px solid var(--line);padding:20px;background:var(--paper);border-radius:12px;min-width:0}
.note-editor-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:20px}
.note-editor-bar h3{font-size:14px;display:flex;align-items:center;gap:9px}
.note-editor-bar h3 span{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums;letter-spacing:.05em}
.note-editor-bar>div{display:flex;gap:5px}
.note-editor-bar .icon-button{background:var(--surface);font-size:18px}
.note-editor-block .form-field:last-child{margin-bottom:0}
.note-editor-block textarea{min-height:100px}
.note-add{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0}
.note-add select{border:1px solid #89968e;border-radius:8px;padding:9px 12px;font-size:13px;min-height:40px;max-width:100%;background:var(--surface);color:var(--ink)}
.note-glossary-editor{border-top:1px solid var(--line);padding-top:20px}
.note-glossary-editor summary{font-size:14px;font-weight:600;cursor:pointer;padding:5px 0}
.note-glossary-editor .form-field{margin-top:20px}
.note-glossary-editor textarea{font-size:14px;min-height:120px}
summary:focus-visible{outline:3px solid var(--focus);outline-offset:4px;border-radius:3px}
@media(max-width:1150px){.note-diagram.flow{grid-template-columns:1fr}.note-diagram.flow li>svg{right:auto;left:24px;top:auto;bottom:-23px;transform:rotate(90deg)}}
@media(max-width:650px){
 .lesson-notes{--reading-size:17px;margin:26px auto;line-height:1.8}
 .reading-large .lesson-notes{--reading-size:20px}
 .reading-tools{gap:8px;padding-bottom:15px;margin-bottom:20px}
 .reading-tools>span{width:100%}
 .reading-tools select{font-size:16px;max-width:calc(100% - 90px)}
 .note-callout{gap:12px;padding:18px 16px;margin:24px 0}
 .note-callout-icon svg{width:18px;height:18px}
 .note-figure{padding:20px 16px;margin:26px 0}
 .note-diagram{grid-template-columns:1fr}
 .note-list li{gap:12px}
 .note-editor-block{padding:16px}
 .note-editor-bar>div{margin-left:auto}
 .content-formatting .btn{font-size:11px;padding:7px 8px}
 .note-glossary-editor textarea,.note-add select{font-size:16px}
}
@media(prefers-reduced-motion:reduce){.note-term,.reading-size button{transition:none}}

.lesson-stage .motion-step strong{font-size:16px}
.lesson-stage .motion-step p{font-size:15px;line-height:1.7}
.reading-large .answer-option,.reading-large .feedback p{font-size:18px}
.reading-serif .answer-option,.reading-serif .feedback p{font-family:Georgia,'Times New Roman',serif}
.reading-large .motion-step p{font-size:17px}

/* Keep flow arrows truthful when the reading column is narrow or the diagram is long. */
.lesson-notes{container-type:inline-size}
.note-diagram.flow:has(>li:nth-child(4)){grid-template-columns:1fr}
.note-diagram.flow:has(>li:nth-child(4)) li>svg{right:auto;left:24px;top:auto;bottom:-23px;transform:rotate(90deg)}
@container(max-width:600px){.note-diagram.flow{grid-template-columns:1fr}.note-diagram.flow li>svg{right:auto;left:24px;top:auto;bottom:-23px;transform:rotate(90deg)}}

/* Color adds landmarks to the learning flow; icons and labels retain the meaning. */
.note-diagram li:nth-child(3n+2) .diagram-number{background:var(--coral-soft);color:var(--coral);border-color:#efc0ac}
.note-diagram li:nth-child(3n) .diagram-number{background:var(--primary-soft);color:var(--primary);border-color:var(--primary-line)}
.note-details{padding:17px 20px;border:1px solid var(--primary-line);border-radius:12px;background:#f5faf9}
.note-details summary{color:var(--primary)}
.note-details[open]>div{animation:note-reveal .22s ease both}
@keyframes note-reveal{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.note-details[open]>div{animation:none}}
