@font-face { font-family: BookSerif; src: url("fonts/Serif-Regular.otf"); font-weight: 400; font-display: swap; }
@font-face { font-family: BookSerif; src: url("fonts/Serif-Bold.otf"); font-weight: 700; font-display: swap; }
@font-face { font-family: BookSans; src: url("fonts/Sans-Regular.otf"); font-weight: 400; font-display: swap; }
@font-face { font-family: BookSans; src: url("fonts/Sans-Bold.otf"); font-weight: 700; font-display: swap; }
@font-face { font-family: BookFallback; src: url("fonts/Fallback-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: BookFallback; src: url("fonts/Fallback-Bold.ttf"); font-weight: 700; font-display: swap; }
@font-face { font-family: GradMath; src: url("fonts/Math.otf"); font-weight: 400; font-display: swap; }
/* Styles shared by the printed book and continuous reading. */
:root {
  --paper: #faf7f0;
  --ink: #222420;
  --muted: #56606b;
  --blue: #2b4c7e;
  --line: #cdd4db;
  --wash: #edf0f2;
}
.book { color: var(--ink); font-family: BookSerif, BookFallback, serif; }
.book h1, .book h2, .book h3, .book h4 {
  font-family: BookSans, BookFallback, sans-serif;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.book h2 { color: var(--blue); margin: 1.42em 0 .5em; font-size: 1.36em; }
.book h3 { margin: 1.2em 0 .4em; font-size: 1.13em; }
.book h4 { margin: 1.1em 0 .4em; font-size: 1em; }
.book p { margin: 0 0 .65em; overflow-wrap: anywhere; }
.book ul, .book ol { margin: .4em 0 .9em; padding-left: 1.7em; }
.book li { margin: .23em 0; overflow-wrap: anywhere; }
.book li p:last-child { margin-bottom: 0; }
.book a { color: var(--blue); text-underline-offset: .18em; }
.book hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.book blockquote {
  border-left: 2px solid #a4b2c3;
  color: #3a485b;
  margin: .85em 0;
  padding: .12em 0 .12em 1em;
}
.book blockquote > :last-child, .book aside > :last-child { margin-bottom: 0; }
.book .chapter-lead, .book .book-callout {
  border-left: 3px solid var(--blue);
  padding: .7em .9em;
  background: var(--wash);
  margin: .75em 0 1.3em;
}
.book .book-callout { border-left-width: 2px; background: #f0ede5; }
.book .practice > h2, .book .quick-card > h3 {
  color: var(--blue);
  border-top: 1px solid var(--line);
  padding-top: .6em;
}
.book .practice, .book .quick-card { margin-block: 1.45em; }
.book .formula { font-family: GradMath, BookSerif, BookFallback, serif; white-space: nowrap; word-break: normal; }
.book .math-display { text-align: center; margin-block: .65em; }
.book .math-variable { font-style: italic; }
.book .math-text, .book .math-script { font-style: normal; }
.book .math-op { margin-inline: .16em; }
.book .formula sub, .book .formula sup { font-size: .7em; line-height: 0; }
.book .math-fraction {
  display: inline-block;
  text-align: center;
  margin-inline: .12em;
  vertical-align: -.66em;
  line-height: 1.12;
  font-size: .82em;
}
.book .math-fraction > span { display: block; padding-inline: .18em; }
.book .math-fraction > span:first-child { border-bottom: .06em solid; }
.book table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: .85em 0 1.1em; font-size: .9em; line-height: 1.56; }
.book th, .book td {
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: .4em .46em;
  text-align: start;
  overflow-wrap: anywhere;
}
.book th { color: var(--blue); background: var(--wash); font-family: BookSans, BookFallback, sans-serif; font-weight: 700; }
.book pre {
  margin: .72em 0 .95em;
  border: 1px solid var(--line);
  background: #f1ede5;
  padding: .72em .8em;
  font-size: .875em;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.book code {
  font-family: ui-monospace, Menlo, BookSans, BookFallback, monospace;
  font-size: .91em;
  overflow-wrap: anywhere;
}
.book :not(pre) > code { background: #ece9e1; border-radius: .17em; }
.book pre code { font-size: 1em; }
.book li.task { list-style: none; }
.book .task-box {
  display: inline-block;
  margin-left: -1.22em;
  margin-right: .37em;
  width: .73em;
  height: .73em;
  line-height: .78em;
  border: 1px solid var(--blue);
  border-radius: .08em;
  font-size: .88em;
  color: var(--blue);
  text-align: center;
  vertical-align: .03em;
}
html { color-scheme: light; background: #e9e7e0; }
body { margin: 0; color: var(--ink); font: 15px/1.55 BookSans, system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, .download {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 11px;
  color: var(--blue);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, .download:hover { background: #e9edf0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button:disabled { opacity: .42; cursor: default; }
.toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 65px;
  gap: 12px;
  padding: 8px clamp(12px, 3.2vw, 50px);
  border-bottom: 1px solid #cdd4db;
  background: var(--paper);
}
.wordmark { color: var(--blue); font: 700 clamp(16px, 2.25vw, 24px) BookSerif, serif; text-decoration: none; white-space: nowrap; }
.toolbar-items, .mode-switch { display: flex; align-items: center; gap: 5px; }
.mode-switch { border: 1px solid #d6dce2; border-radius: 7px; background: #efece5; gap: 0; }
.mode-switch button { min-height: 34px; border-radius: 5px; min-width: 48px; }
.mode-switch button[aria-pressed="true"] { background: var(--blue); color: white; }
.download { border-color: #a9b6c5; }
#page-stage {
  --zoom: 1;
  min-height: calc(100dvh - 127px);
  max-height: calc(100dvh - 127px);
  padding: 14px 12px 12px;
  overflow: auto;
  overscroll-behavior: contain;
}
#spread { display: flex; gap: 4px; margin-inline: auto; width: max-content; }
.book-page {
  --page-size: min(45vw, calc((100dvh - 158px) * 170 / 240), 650px);
  display: block;
  width: calc(var(--page-size) * var(--zoom));
  height: auto;
  flex: none;
  background: var(--paper);
  box-shadow: 0 3px 11px rgb(39 44 53 / 14%);
}
#page-controls {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 62px;
  align-items: center;
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
#page-controls button { font-size: 20px; min-width: 42px; }
#page-form, .zoom-group { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
#page-input {
  width: 58px;
  height: 36px;
  padding: 4px 5px;
  text-align: center;
  color: var(--ink);
  border: 1px solid #bdc7d2;
  border-radius: 5px;
  background: #fffdf8;
}
.zoom-group { margin-left: 11px; border-left: 1px solid var(--line); padding-left: 8px; }
#zoom-level { min-width: 42px; text-align: center; }
.reading-flow { background: var(--paper); }
#flow-view { width: min(100%, 810px); padding: 4rem clamp(22px, 6vw, 60px); margin: auto; font-size: 1.04rem; line-height: 1.88; }
#flow-view section[id] { scroll-margin-top: 84px; }
#flow-view .chapter { margin-top: 4em; }
#flow-view .chapter h1, #flow-view .divider h1 { font-size: clamp(1.55rem, 4.5vw, 2.35rem); }
#flow-view .cover { min-height: 58vh; padding: 3rem 0 4rem; }
#flow-view .cover h1 { margin: .1rem 0 1rem; font-size: clamp(2.6rem, 10vw, 5.1rem); }
#flow-view .cover-subtitle { font-size: clamp(1.14rem, 4.3vw, 1.7rem); color: var(--blue); }
#flow-view .cover-deck, #flow-view .cover-author { color: var(--muted); }
#flow-view .cover-rule { width: 68px; border-top: 3px solid var(--blue); margin: 16px 0; }
#flow-view .contents ul { list-style: none; padding: 0; }
#flow-view .toc-volume { margin-top: 1em; font-weight: bold; }
#flow-view .divider { border-top: 1px solid var(--line); padding: 1.3em 0; margin-top: 4em; }
#flow-view .divider-number { color: var(--blue); }
dialog {
  width: min(92vw, 640px);
  max-height: 82dvh;
  padding: 0 21px 18px;
  border: 1px solid #a9b6c5;
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 34px rgb(22 31 45 / 22%);
}
dialog::backdrop { background: rgb(23 37 53 / 41%); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; text-align: left; border-bottom: 1px solid var(--line); gap: 20px; }
.dialog-heading h2 { font: 700 1.4rem BookSerif, serif; }
.dialog-heading button { font-size: 23px; }
#contents-panel ol { list-style: none; padding: 0; margin: 12px 0 0; }
#contents-panel li button {
  width: 100%;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  text-align: left;
  white-space: normal;
  gap: 1.1em;
}
#contents-panel li button span:last-child { font-variant-numeric: tabular-nums; flex: none; }
#contents-panel li.nav-volume button { font-weight: bold; border-top: 1px solid var(--line); margin-top: 7px; }
#contents-panel li.nav-chapter button span:first-child { text-indent: 0; }
#about-panel a { color: var(--blue); }
.screen-reader { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; white-space: nowrap; border: 0; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 720px) {
  body { font-size: 13px; }
  .toolbar { min-height: 57px; gap: 5px; padding-inline: 8px; }
  .toolbar-items { gap: 1px; }
  button, .download { padding-inline: 6px; min-height: 36px; }
  .mode-switch button { min-width: 37px; min-height: 33px; }
  .book-page { --page-size: calc(100vw - 16px); }
  #page-stage { min-height: calc(100dvh - 112px); max-height: calc(100dvh - 112px); padding: 8px; }
  #page-controls { min-height: 55px; gap: 5px; }
  #page-controls button { min-width: 37px; }
  #flow-view { padding: 2.5rem 18px; font-size: 1rem; }
  #flow-view table { font-size: .82em; }
}
