:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #20242c; background: #f7f7fa; }
* { box-sizing: border-box; }
body { margin: 0; }
.topbar { position: sticky; top: 0; z-index: 10; height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 24px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.brand { color: #29245c; font-size: 1.1rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.topbar input, .topbar select { padding: 10px 14px; border: 1px solid #d5d7df; border-radius: 8px; background: #fff; font: inherit; }
.topbar select { min-width: min(320px, 30vw); }
.topbar input { margin-left: auto; width: min(360px, 35vw); }
.menu { display: none; border: 0; background: none; font-size: 1.4rem; }
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto; padding: 18px; background: #fff; border-right: 1px solid #e5e7eb; }
.sidebar details { margin-bottom: 14px; }
.sidebar summary { cursor: pointer; color: #29245c; font-weight: 800; line-height: 1.35; }
.topic h3 { margin: 16px 0 6px; color: #626575; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.topic a { display: block; margin: 2px 0; padding: 8px 10px; border-radius: 7px; color: #444855; font-size: .9rem; line-height: 1.35; text-decoration: none; }
.topic a:hover, .topic a.active { color: #29245c; background: #eeecff; }
.main { min-width: 0; padding: 48px clamp(24px, 6vw, 88px) 80px; }
.note { max-width: 850px; margin: auto; }
.breadcrumbs { color: #777b88; font-size: .85rem; }
.note-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.note h1 { margin: 12px 0; color: #29245c; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; }
.download { flex: 0 0 auto; margin-top: 12px; padding: 10px 14px; border: 0; border-radius: 8px; color: #fff; background: #574bd6; font: 700 .9rem Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.download:hover { background: #4137ad; }
.download:focus-visible { outline: 3px solid #b9b3ff; outline-offset: 2px; }
.description { color: #626575; font-size: 1.05rem; line-height: 1.6; }
.content { margin-top: 40px; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; line-height: 1.7; }
.content h2, .content h3, .content h4 { color: #29245c; font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.25; }
.content h2 { margin-top: 48px; font-size: 1.75rem; }
.content h3 { margin-top: 34px; font-size: 1.35rem; }
.content li { margin: 7px 0; }
.content a { color: #574bd6; }
.content table { display: block; width: 100%; margin: 24px 0; overflow-x: auto; border-collapse: collapse; }
.content th, .content td { min-width: 140px; padding: 12px; border: 1px solid #cfd2da; text-align: left; vertical-align: top; }
.content th { background: #eeecff; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.content figure { margin: 28px auto; text-align: center; }
.content figure img { max-width: 100%; height: auto; }
.content figcaption { color: #6f7380; font-size: .9rem; }
.equation { max-width: 100%; font-size: 1.05em; }
.callout { margin: 26px 0; padding: 18px 22px; border-left: 5px solid #6a5ae0; border-radius: 8px; background: #f0efff; }
.callout.exam-tip::before, .callout.worked-example::before { display: block; margin-bottom: 8px; font: 800 .8rem Inter, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.callout.exam-tip::before { content: "Exam tip"; }
.callout.worked-example { border-color: #15906d; background: #ecfaf5; }
.callout.worked-example::before { content: "Worked example"; color: #087353; }
.working { margin: 10px 0; padding-left: 16px; border-left: 3px solid #b9bdc8; }
.finalAnswer, .emphasis.finalAnswer { font-weight: 700; background: #fff3b5; }
.credits { margin-top: 56px; padding-top: 20px; color: #737784; border-top: 1px solid #dddfe6; }
.loading, .empty { color: #737784; }
@media (max-width: 800px) {
  .menu { display: block; }
  .topbar { gap: 12px; padding: 0 14px; }
  .brand { font-size: .95rem; }
  .topbar select { min-width: 0; max-width: 34vw; }
  .layout { display: block; }
  .sidebar { position: fixed; inset: 64px auto 0 0; z-index: 9; width: min(88vw, 340px); height: auto; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 8px 0 24px #0002; }
  .sidebar.open { transform: none; }
  .main { padding: 30px 20px 64px; }
  .note-heading { display: block; }
  .download { margin: 4px 0 12px; }
}
@media print {
  .topbar, .sidebar, .download { display: none; }
  .layout { display: block; }
  .main { padding: 0; }
  .note { max-width: none; }
  .content table { display: table; overflow: visible; }
}
