body {
  color: #252525;
  font-size: 16px;
  line-height: 1.68;
}

.book .book-summary {
  background: #f7f8fa;
}

.book .book-body .page-wrapper .page-inner {
  max-width: 940px;
}

h1,
h2,
h3 {
  color: #17365d;
  line-height: 1.25;
}

h2 {
  border-bottom: 1px solid #dbe3eb;
  padding-bottom: 0.2em;
}

p,
li {
  max-width: 78ch;
}

table {
  border-collapse: collapse;
  margin: 1.2rem 0;
  width: 100%;
}

th {
  background: #edf3f8;
  color: #17365d;
  text-align: left;
}

th,
td {
  border: 1px solid #d6dee6;
  padding: 0.55rem 0.65rem;
  vertical-align: top;
}

/* Remove GitBook's default border so custom callouts render consistently. */
.book .note,
.book .exercise,
.book .definition,
.book .quality,
.book .common-error,
.book .warning,
.book .video {
  border-left: 4px solid !important;
  padding: 0.8rem 1rem !important;
}

.book .chapter-learning,
.book .key-terms {
  border-left: 4px solid !important;
  padding: 0.9rem 1.1rem !important;
}

.book .glossary-list {
  border-left: 4px solid !important;
  padding: 0.9rem 1.1rem !important;
}

.book .download-box {
  border-left: 4px solid !important;
  padding: 0.9rem 1.1rem !important;
}

.note,
.exercise,
.definition,
.quality,
.common-error,
.warning,
.video {
  border-left: 4px solid;
  border-radius: 8px;
  margin: 1.25rem 0;
  padding: 0.8rem 1rem;
}

.chapter-learning,
.key-terms {
  border-left: 4px solid;
  border-radius: 8px;
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
}

.glossary-list {
  background: #f5f8fb;
  border-left: 4px solid;
  border-color: #587a95 !important;
  border-radius: 8px;
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
}

.download-box {
  background: #e8f5e9;
  border-left: 4px solid;
  border-color: #2e7d32 !important;
  border-radius: 8px;
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
}

.download-box a {
  font-weight: 700;
}

.chapter-learning {
  background: #eef4f8;
  border-color: #587a95 !important;
}

.key-terms {
  background: #e3f2fd;
  border-color: #1e88e5 !important;
}

.chapter-learning > p:first-child,
.key-terms > p:first-child {
  color: #17365d;
  font-size: 1.08rem;
  margin-top: 0;
}

.chapter-learning > :last-child,
.key-terms > :last-child {
  margin-bottom: 0;
}

.definition {
  background: #e3f2fd;
  border-color: #1e88e5 !important;
}

.definition > p:first-child {
  margin-top: 0;
}

.definition > p:last-child {
  margin-bottom: 0;
}

.book .worked-example {
  background: #fff8ed;
  border: 1px solid #efc17c !important;
  border-left: 4px solid #b45309 !important;
  border-radius: 8px;
  overflow: hidden;
  padding: 0 1rem 1rem !important;
}

.worked-example {
  background: #fff8ed;
  border: 1px solid #efc17c;
  border-left: 4px solid #b45309;
  border-radius: 8px;
  margin: 1.25rem 0;
  overflow: hidden;
  padding: 0 1rem 1rem;
}

.worked-example > p:first-child {
  background: #b45309;
  color: #ffffff;
  font-size: 1.05rem;
  margin: 0 -1rem 1rem;
  padding: 0.7rem 1rem;
}

.worked-example > p:first-child strong {
  color: inherit;
}

.worked-example > :last-child {
  margin-bottom: 0;
}

.exercise {
  background: #f5f5f5;
  border-color: #616161 !important;
}

.note {
  background: #e9f5f2;
  border-color: #26766a !important;
}

.quality {
  background: #e8f5e9;
  border-color: #43a047 !important;
}

.common-error,
.warning {
  background: #fff0ed;
  border-color: #c54b32 !important;
}

.video {
  background: #f3e5f5;
  border-color: #8e24aa !important;
}

details.answer-dropdown,
details.solution-dropdown {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #c9d4df;
  border-radius: 6px;
  margin: 0.75rem 0;
  padding: 0.65rem 0.85rem;
}

details.answer-dropdown summary,
details.solution-dropdown summary {
  color: #2c6e9f;
  cursor: pointer;
  font-weight: 700;
}

details.answer-dropdown[open] summary,
details.solution-dropdown[open] summary {
  margin-bottom: 0.6rem;
}

code {
  white-space: pre-wrap;
}

#book-search {
  background: #f7f8fa;
  border-bottom: 1px solid #d9dee5;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

#book-search input {
  box-sizing: border-box;
  font-size: 1rem;
  max-width: 940px;
  padding: 0.6rem 0.75rem;
  width: 100%;
}

#search-results {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  display: none;
  max-height: 45vh;
  max-width: 940px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}

#search-results a {
  display: block;
  padding: 0.35rem 0;
}
