.note-diagram { margin: 1.5rem 0; }
.note-diagram img { display: block; width: 100%; max-width: 44rem; height: auto; }
.note-diagram figcaption { margin-top: .65rem; font-size: .875rem; color: #61666c; line-height: 1.5; }
:root {
  --ink: #202326;
  --muted: #61666c;
  --line: #e5e7ea;
  --soft: #f5f6f8;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.skip {
  position: fixed;
  z-index: 10;
  top: 10px;
  left: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--ink);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.site-header {
  max-width: 1280px;
  margin: auto;
  padding: 14px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; min-height: 44px; font-size: .9375rem; font-weight: 600; }
nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; }
nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .875rem; line-height: 1.4; }
nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px var(--ink); }
nav a:hover { color: var(--ink); }

main { max-width: 960px; margin: 0 auto; padding: 42px 40px 64px; }
main:focus { outline: none; }
.page-heading { display: flex; align-items: center; gap: 20px; }
.revision-sprite { width: 56px; height: 84px; object-fit: contain; flex: 0 0 56px; image-rendering: pixelated; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.beta { margin-left: 8px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; }
h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 1.875rem); line-height: 1.3; font-weight: 500; }
.page-intro { margin: 20px 0 24px; max-width: 40rem; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.guide-levels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.guide-levels a { display: flex; align-items: flex-start; flex-direction: column; gap: 12px; padding: 24px 0; border-top: 1px solid var(--line); }
.guide-levels strong { font-size: 1.25rem; font-weight: 500; color: var(--ink); }
.guide-levels span { font-size: 1rem; line-height: 1.6; }
.guide-breadcrumb { margin: 20px 0; }
.guide-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 20px 0; }
.guide-actions > a { min-height: 48px; display: inline-flex; align-items: center; }
.guide-actions > a:not(.topic-download) { text-decoration: underline; font-size: 1rem; }
.topic-row > a.topic-title { display: flex; align-items: center; min-height: 44px; }
.topic-group > h2 { font-size: 1rem; font-weight: 500; }
.collection-heading { display: flex; align-items: baseline; gap: 16px; margin-bottom: 26px; }
.collection-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 500; line-height: 1.4; }
.collection-heading p { margin: 0; color: var(--muted); font-size: .875rem; }
.tier-collection:not([hidden]) + .tier-collection { margin-top: 48px; }
.topic-group { margin-bottom: 28px; }
.topic-group:last-child { margin-bottom: 0; }
.topic-group h3 { margin: 0 0 8px; font-size: .875rem; font-weight: 600; line-height: 1.5; color: var(--muted); }
.topic-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.topic-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-block: 24px; }
.topic-title { font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.topic-download { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; min-width: 122px; min-height: 48px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: .875rem; line-height: 1.4; }
.topic-download small { color: var(--muted); font-size: .75rem; }
.topic-download:hover { border-color: var(--muted); background: var(--soft); }
.topic-download:active { background: var(--line); }

.area-nav { gap: 4px 24px; margin: 24px 0 28px; border-bottom: 1px solid var(--line); }
.section-title { margin: 0; font-size: 1.25rem; font-weight: 500; }
.notes-overview { margin-bottom: 32px; padding: 20px; border: 1px solid var(--line); border-radius: 6px; }
.notes-overview h2, .notes-overview h3 { margin: 0 0 12px; font-weight: 500; }
.notes-overview p, .note-body p, .note-body li { line-height: 1.7; }
.notes-overview a, .note-body a, .pending-data a { text-decoration: underline; text-underline-offset: 3px; }
.table-scroll { overflow-x: auto; }
.ao-table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .875rem; }
.ao-table th, .ao-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; line-height: 1.5; }
.ao-table th { font-weight: 600; }
.note-body { max-width: 48rem; }
.note-body section { margin: 30px 0; }
.note-body h2 { margin: 0 0 12px; font-size: 1.125rem; font-weight: 500; }
.note-body h3 { margin: 20px 0 8px; font-size: 1rem; font-weight: 600; }
.note-body ul, .note-body ol { padding-left: 24px; }
.note-meta { color: var(--muted); font-size: .875rem; line-height: 1.7; }
.note-body .math-display { overflow-x: auto; padding: 6px 4px; }
.note-body .katex-display { margin: .6em 0; text-align: left; }
.note-body .katex-display > .katex { text-align: left; }
.note-body .worked-example, .note-body .pitfall { padding: 18px 20px; background: var(--soft); border-radius: 6px; }
.note-body .worked-example h3 { margin-top: 0; }
.note-body details { padding: 14px 0; border-bottom: 1px solid var(--line); }
.note-body summary { cursor: pointer; min-height: 44px; line-height: 1.6; padding: 8px 0; }
.pending-data { border: 1px solid var(--line); padding: 24px; border-radius: 6px; line-height: 1.7; }
.pending-data h2 { font-size: 1.125rem; font-weight: 500; }

@media print {
  .site-header, .site-footer, .area-nav, .skip, .note-actions { display: none; }
  main { max-width: none; padding: 0; }
  .note-body section { break-inside: avoid; }
  .note-body details::details-content { display: block; }
}

.site-footer { max-width: 960px; margin: 0 auto; padding: 24px 40px 28px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0 0 8px; max-width: 44rem; font-size: .8125rem; color: var(--muted); line-height: 1.6; }
.site-footer nav { gap: 4px 24px; }

@media (max-width: 720px) {
  .guide-levels { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .site-header { padding: 10px 20px; flex-wrap: wrap; gap: 0 20px; }
  .site-header nav { gap: 4px 16px; }
  main { padding: 28px 20px 44px; }
  .site-footer { padding: 20px; }
}
@media (max-width: 420px) {
  .page-heading { gap: 12px; }
  .revision-sprite { width: 44px; height: 66px; flex-basis: 44px; }
  .topic-row { flex-wrap: wrap; gap: 8px; }
  .topic-title { flex-basis: 100%; }
  .topic-download { min-width: 122px; min-height: 44px; flex-direction: row; gap: 12px; align-items: center; }
  .topic-download small { line-height: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
