:root {
  color-scheme: light;
  --cloud: #f0f0f3;
  --black: #000000;
  --ink: #1c2024;
  --paper: #ffffff;
  --slate: #60646c;
  --silver: #b0b4ba;
  --link: #0d74ce;
  --line: #e0e1e6;
  --body-font: "Inter", Arial, sans-serif;
  --label-font: "DM Sans", "Inter", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 32px; }
body { margin: 0; background: var(--cloud); color: var(--ink); font: 400 16px/1.6 var(--body-font); }
body, textarea, button { -webkit-text-size-adjust: 100%; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2, h3 { color: var(--black); font-weight: 700; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, textarea:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 5px; }
main:focus { outline: none; }
::selection { background: var(--ink); color: var(--paper); }

/* Shared utility sheet: spacing, type, surfaces and responsive grids. */
.u-shell { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }
.u-measure { max-width: 72ch; }
.u-flex { display: flex; align-items: center; }
.u-between { justify-content: space-between; }
.u-wrap { flex-wrap: wrap; }
.u-block { display: block; }
.u-gap-16 { gap: 16px; }
.u-gap-24 { gap: 24px; }
.u-stack-8 > * + * { margin-top: 8px; }
.u-stack-16 > * + * { margin-top: 16px; }
.u-stack-24 > * + * { margin-top: 24px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-16 { margin-top: 16px; }
.u-mt-24 { margin-top: 24px; }
.u-mt-32 { margin-top: 32px; }
.u-mt-48 { margin-top: 48px; }
.u-mb-16 { margin-bottom: 16px; }
.u-pad-32 { padding: 32px; }
.u-pad-top-24 { padding-top: 24px; }
.u-pad-top-32 { padding-top: 32px; }
.u-pad-bottom-24 { padding-bottom: 24px; }
.u-pad-bottom-32 { padding-bottom: 32px; }
.u-pad-left-24 { padding-left: 24px; }
.u-section-gap { margin-top: 64px; }
.u-rule-top { border-top: 1px solid var(--line); }
.u-border { border: 1px solid var(--line); border-radius: 6px; }
.u-border-left { border-left: 2px solid var(--silver); }
.u-surface { background: var(--paper); }
.u-slate { color: var(--slate); }
.u-label { font: 500 1rem/1.6 var(--label-font); letter-spacing: 0.02em; }
.u-semibold { font-weight: 700; }
.u-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.u-lead { font-size: 20px; line-height: 1.6; max-width: 56ch; }
.u-home-title { font-size: clamp(2.5rem, 4.4vw, 4rem); line-height: 1.08; letter-spacing: -0.045em; max-width: 18ch; }
.u-h1 { font-size: 2.25rem; line-height: 1.2; letter-spacing: -0.035em; max-width: 25ch; }
.u-h2 { font-size: 25px; line-height: 1.3; letter-spacing: -0.025em; }
.u-h3 { font-size: 19px; line-height: 1.4; letter-spacing: -0.015em; }
.u-tap { display: inline-flex; align-items: center; min-height: 48px; min-width: 48px; font-size: 16px; }
.u-list-reset { padding: 0; list-style: none; }
.u-list-pad { padding-left: 24px; }
.u-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(248px, 304px); gap: 40px; align-items: start; margin-top: 32px; }
.u-answer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 48px; align-items: start; }
.u-next-link { padding: 8px 0; font-weight: 700; }
.u-source-link { padding-block: 12px; }
.u-button-primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.u-button-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--slate); }

/* Components carry the notebook prefix. */
.nb-skip { position: absolute; z-index: 20; left: 16px; top: -120px; padding: 12px 24px; background: var(--paper); color: var(--ink); }
.nb-skip:focus { top: 16px; }
.nb-header { min-height: 112px; border-bottom: 1px solid var(--line); }
.nb-wordmark { gap: 12px; color: var(--ink); font: 500 18px/1.3 var(--label-font); text-decoration: none; }
.nb-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--ink); color: var(--paper); font: 700 24px/1 var(--body-font); border-radius: 4px; }
.nb-site-frame { color: var(--slate); }
.nb-link { background: var(--paper); padding-inline: 12px; border-radius: 4px; }
.nb-header-links { flex-shrink: 0; }
.nb-workspace { display: grid; grid-template-columns: 216px minmax(0, 1fr); column-gap: 56px; padding-top: 64px; padding-bottom: 80px; }
.nb-content { grid-column: 2; grid-row: 1; min-width: 0; }
.nb-index { grid-column: 1; grid-row: 1; align-self: start; position: sticky; top: 32px; }
.nb-chapter-link { width: 100%; gap: 12px; padding: 12px 0; color: var(--slate); text-decoration: none; border-bottom: 1px solid var(--line); line-height: 1.5; }
.nb-chapter-link[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nb-chapter-link[aria-current="page"] .nb-chapter-letter { background: var(--ink); color: var(--paper); }
.nb-chapter-letter { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--slate); flex-shrink: 0; font-size: 16px; font-weight: 400; }
.nb-chapter-link:first-child .nb-chapter-letter { min-width: 40px; }
.nb-index-note { font-family: var(--label-font); }
.nb-first-answer .u-h2 { font-size: 24px; }
.nb-question-list { border-top: 1px solid var(--line); }
.nb-question-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; gap: 24px; width: 100%; padding: 24px; color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; }
.nb-question-list > li:nth-child(odd) { background: var(--paper); }
.nb-question-row:hover { background: #e9e9ee; }
.nb-question-letter { align-self: start; color: var(--slate); font-size: 16px; padding-top: 2px; }
.nb-question-text { display: block; font-size: 22px; line-height: 1.4; letter-spacing: -0.02em; }
.nb-question-caption { display: block; color: var(--slate); margin-top: 8px; font-size: 16px; line-height: 1.6; }
.nb-arrow { color: var(--link); font-size: 24px; }
.nb-definition { margin-top: 4px; font-family: var(--label-font); }
.nb-definition dl { margin-top: 16px; font-size: 16px; }
.nb-definition dd { margin-top: 8px; color: var(--slate); line-height: 1.6; }
.nb-source-drawer summary { display: flex; justify-content: space-between; gap: 24px; padding-block: 20px; list-style: none; cursor: pointer; width: 100%; }
.nb-source-drawer summary::-webkit-details-marker { display: none; }
.nb-source-drawer summary::after { content: "+"; font: 400 24px/1 ui-monospace, monospace; }
.nb-source-drawer[open] summary::after { content: "−"; }
.nb-source-content { max-width: 72ch; }
.nb-source-content li { border-top: 1px solid var(--line); }
.nb-source-content .nb-link { width: 100%; }
.nb-budget-lines > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding-block: 16px; border-top: 1px solid var(--line); }
.nb-budget-lines dt { font-weight: 700; }
.nb-prompt { display: flex; width: 100%; text-align: left; justify-content: space-between; gap: 24px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.nb-prompt-number { flex-shrink: 0; }
.nb-prompt-text { flex: 1; min-width: 0; }
.nb-prompt:hover:not(:disabled) { border-color: var(--slate); }
.nb-prompt:disabled, .nb-notes-text:disabled, .nb-button:disabled { color: var(--slate); background: var(--cloud); border-color: var(--silver); }
.nb-notes-text { display: block; width: 100%; min-height: 208px; padding: 16px; border: 1px solid var(--slate); border-radius: 4px; resize: vertical; background: var(--paper); line-height: 1.6; }
.nb-button { padding: 12px 20px; border-radius: 4px; font-weight: 500; }
.nb-note-status { min-height: 26px; }
.nb-footer { color: var(--slate); }
.nb-footer .nb-link { padding-block: 8px; }

@media (max-width: 1100px) {
  .u-shell { width: calc(100% - 64px); }
  .nb-workspace { grid-template-columns: 192px minmax(0, 1fr); gap: 40px; }
  .nb-site-frame { max-width: 25ch; }
  .u-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .u-answer-grid { grid-template-columns: minmax(0, 1fr) 160px; gap: 32px; }
}
@media (max-width: 840px) {
  .nb-header { flex-wrap: wrap; gap: 8px 24px; padding-block: 16px; }
  .nb-site-frame { order: 3; width: 100%; max-width: none; }
  .nb-workspace { display: flex; flex-direction: column; padding-top: 40px; gap: 64px; }
  .nb-index { position: static; order: 2; border-top: 1px solid var(--line); padding-top: 32px; }
  .nb-content { order: 1; }
  .nb-index-note { display: none; }
  .u-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(248px, 304px); gap: 32px; }
  .u-answer-grid { grid-template-columns: minmax(0, 1fr) 176px; gap: 32px; }
}
@media (max-width: 600px) {
  .u-shell { width: calc(100% - 40px); }
  .nb-header { gap: 4px 16px; }
  .nb-wordmark { font-size: 16px; }
  .nb-header-links { gap: 16px; }
  .nb-header-links .nb-link { font-size: 16px; }
  .nb-header-links .nb-link:last-child { display: none; }
  .nb-site-frame { margin-top: 8px; font-size: 16px; }
  .u-home-title { font-size: 2.5rem; line-height: 1.1; max-width: 17ch; }
  .u-h1 { font-size: 2.25rem; }
  .u-h2 { font-size: 24px; }
  .u-lead { font-size: 18px; }
  .u-hero-grid { display: block; }
  .nb-first-answer { margin-top: 32px; }
  .u-pad-32 { padding: 24px; }
  .u-section-gap { margin-top: 48px; }
  .u-answer-grid { display: flex; flex-direction: column; gap: 24px; }
  .nb-definition { width: 100%; background: var(--paper); padding: 16px 20px; border-left-color: var(--link); }
  .nb-definition .nb-label { margin-bottom: 8px; }
  .nb-definition dl { margin-top: 0; }
  .nb-question-row { grid-template-columns: 24px minmax(0, 1fr) 20px; gap: 12px; padding: 24px 16px; }
  .nb-question-text { font-size: 20px; }
  .nb-budget-lines > div { display: block; }
  .nb-budget-lines dd { margin-top: 8px; }
  .nb-note-actions { align-items: stretch; }
  .nb-note-actions .nb-button { width: 100%; justify-content: center; }
  .nb-footer .u-flex { gap: 8px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .nb-header-links, .nb-index, .nb-skip, .nb-note-actions, .nb-note-prompts, .nb-next, .nb-source-drawer, .nb-footer .u-flex { display: none; }
  .u-shell { width: 100%; }
  .nb-workspace { display: block; padding: 24px 0; }
  body { background: white; }
  .u-section-gap { margin-top: 32px; }
  .nb-answer, .nb-notes { break-inside: avoid; }
}
