:root {
  color-scheme: light;
  --paper: #ffffff;
  --canvas: #f5f8fc;
  --ink: #14345a;
  --blue: #2464a5;
  --teal: #147768;
  --rose: #a13952;
  --line: #ccd9e8;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.65;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { background: var(--blue); color: white; border: 1px solid var(--blue); border-radius: 5px; padding: .5rem 1rem; }
button.secondary { color: var(--ink); background: white; border-color: var(--line); }
button[aria-pressed="true"] { color: var(--teal); border-color: var(--teal); background: #e6f4f0; }
button:disabled { cursor: default; opacity: .65; }
:focus-visible { outline: 3px solid #c37a13; outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 10; background: white; padding: 1rem; }
.skip:focus { top: 0; }
header { background: var(--ink); color: white; padding: 1.2rem max(1.2rem, calc((100vw - 1360px) / 2)); }
header a { color: white; }
header .brand { font-size: 1.15rem; font-weight: 650; text-decoration: none; }
header nav { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: .4rem; font-size: .9rem; }
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1360px; margin: auto; min-height: 80vh; }
aside { padding: 2rem 1.4rem; border-right: 1px solid var(--line); }
aside nav { display: grid; gap: .45rem; position: sticky; top: 1rem; }
aside a { text-decoration: none; padding: .65rem .75rem; border-left: 3px solid transparent; font-size: .94rem; }
aside a[aria-current="page"] { border-color: var(--blue); background: #e5effa; font-weight: 650; }
aside small { display: block; margin-top: .25rem; color: #4d627b; }
main { padding: 2.4rem clamp(1.2rem, 4vw, 4rem) 5rem; min-width: 0; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.18; letter-spacing: -.04em; margin: .3rem 0 1rem; font-weight: 650; }
h2 { font-size: 1.45rem; line-height: 1.35; margin: 2.3rem 0 .8rem; }
h3 { font-size: 1.1rem; line-height: 1.45; }
p, li { max-width: 76ch; }
.intro { font-size: 1.1rem; max-width: 65ch; color: #3c5470; }
.notice { border-left: 4px solid var(--blue); background: #e9f1fa; padding: 1rem 1.25rem; margin: 1.25rem 0; font-size: .95rem; }
.warning { border-color: var(--rose); background: #fff0f3; }
.lecture-list { margin: 1.5rem 0; padding: 0; list-style: none; }
.lecture-list li { max-width: none; display: grid; grid-template-columns: 3.3rem 1fr auto; gap: 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.lecture-list .number { color: var(--blue); font-size: 1.5rem; }
.lecture-list h2 { margin: 0 0 .4rem; font-size: 1.25rem; }
.lecture-list p { margin: .3rem 0; font-size: .95rem; }
.lecture-list .open { white-space: nowrap; }
.meta { font-size: .88rem; color: #4d627b; }
.toolbar { background: white; border: 1px solid var(--line); padding: 1rem; margin: 1.5rem 0; display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.toolbar label { display: grid; font-size: .88rem; gap: .2rem; flex: 1 1 135px; }
input[type="search"], select, textarea { border: 1px solid #849bb6; border-radius: 4px; background: white; color: var(--ink); padding: .5rem; width: 100%; }
.progress { border-bottom: 2px solid var(--line); padding: .5rem 0 1rem; font-size: .95rem; }
progress { accent-color: var(--teal); width: 100%; height: .55rem; display: block; margin-top: .5rem; }
.question { background: var(--paper); padding: 1.7rem; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: 6px; }
.question .qmeta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: #4d627b; }
.challenge { color: #6a3d8a; font-weight: 650; }
.question h3 { font-family: Georgia, "Times New Roman", serif; font-size: 1.22rem; font-weight: 500; max-width: 70ch; margin: .8rem 0 1.1rem; }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
legend.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.option { display: flex; gap: .7rem; align-items: baseline; padding: .65rem .75rem; margin-bottom: .45rem; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.option:has(input:checked) { background: #e9f1fa; border-color: var(--blue); }
.option:has(input:disabled) { cursor: default; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--blue); flex-shrink: 0; }
textarea { min-height: 130px; resize: vertical; display: block; margin: .5rem 0 1rem; line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.feedback { border-top: 1px solid var(--line); margin-top: 1.3rem; padding-top: .8rem; }
.feedback p { margin: .5rem 0; }
.result { font-weight: 650; }
.correct { color: var(--teal); }
.incorrect, .error { color: var(--rose); }
.rubric { display: grid; gap: .5rem; margin: .8rem 0; }
.rubric label { display: flex; align-items: baseline; gap: .6rem; }
.sources { font-size: .85rem; margin: .8rem 0 .2rem; }
.sources a, .citation { display: inline-block; margin-right: .75rem; }
.slide-extracts { border-block: 1px solid var(--line); padding: .75rem 0; overflow-wrap: anywhere; }
.slide-extract { margin: 1.25rem 0; }
.slide-extract figcaption { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .88rem; margin-bottom: .4rem; }
.slide-image-link { display: block; }
.slide-extract img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: white; }
.slide-extract p { font-size: .94rem; }
.slide-clarification { color: #4d627b; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.note-section { border-bottom: 1px solid var(--line); padding-bottom: 1.2rem; }
.note-section p { white-space: pre-line; }
.notes-lecture { margin-bottom: 3rem; }
.notes-lecture > h2 { background: #e5effa; padding: .7rem 1rem; }
details { margin: 1rem 0; }
summary { cursor: pointer; font-weight: 600; }
footer { padding: 1.5rem; font-size: .85rem; text-align: center; color: #4d627b; border-top: 1px solid var(--line); }
.empty { padding: 2rem; border: 1px dashed var(--line); }
.print-only { display: none; }
.cheat-wrap { padding: 2rem 1rem; }
.cheat { background: white; max-width: 210mm; margin: 0 auto 2rem; padding: 13mm; box-shadow: 0 3px 15px #14345a15; font-size: 10.3pt; line-height: 1.35; }
.cheat h1 { font-size: 21pt; }
.cheat h2 { margin: .7rem 0 .25rem; font-size: 12pt; }
.cheat p { margin: .25rem 0 .55rem; overflow-wrap: anywhere; }
.cheat-grid { columns: 2; column-gap: 7mm; }
.cheat section { break-inside: avoid; }
.formula { font-family: "Courier New", monospace; font-size: .92em; overflow-wrap: anywhere; }
.cheat .sources { font-size: 8pt; }
@media (max-width: 800px) {
  .layout { display: block; }
  aside { padding: .8rem 1rem; border-right: none; border-bottom: 1px solid var(--line); }
  aside nav { display: flex; position: static; overflow-x: auto; gap: .3rem; }
  aside a { flex: 0 0 165px; padding: .5rem; font-size: .83rem; }
  aside small { display: none; }
  main { padding-top: 1.5rem; }
  .question { padding: 1.1rem; }
  .lecture-list li { grid-template-columns: 2.5rem 1fr; }
  .lecture-list .open { grid-column: 2; }
  .cheat-grid { columns: 1; }
  .cheat { padding: 1.3rem; }
}
@media print {
  @page { size: A4; margin: 13mm; }
  header, aside, footer, .toolbar, .actions, .no-print, .skip { display: none !important; }
  body, :root { background: white; color: #111; }
  .layout { display: block; }
  main { padding: 0; }
  h1 { font-size: 22pt; }
  h2 { break-after: avoid; }
  .question, .note-section { break-inside: avoid; box-shadow: none; }
  a { color: #183b65; }
  .cheat-wrap { padding: 0; }
  .cheat { width: 100%; max-width: none; min-height: 0; margin: 0; padding: 0; box-shadow: none; font-size: 9.2pt; line-height: 1.28; }
  .cheat + .cheat { break-before: page; }
  .cheat-grid { columns: 2; }
  .print-only { display: block; }
}
