:root {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #555555;
  --rule: #d8d8d8;
  --accent: #0f2a0f;
}

* { box-sizing: border-box; }

html { background: #f4f4f1; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

.book {
  max-width: 6in;
  margin: 0 auto;
  background: var(--paper);
}

.cover {
  min-height: 9in;
  padding: 0.7in 0.55in;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.cover img {
  width: 100%;
  max-height: 3.35in;
  object-fit: cover;
  filter: grayscale(100%);
  border: 1px solid var(--rule);
}

.kicker,
.part,
.source-label {
  font-family: Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.72rem;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 1.1em 0 0.45em;
}

h1 {
  font-size: 2.15rem;
  font-weight: 700;
}

h2 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.18in;
}

h3 { font-size: 1.05rem; }

p { margin: 0 0 0.95em; }

ul,
ol { margin: 0 0 1em 1.2em; padding: 0; }

li { margin: 0.25em 0; }

.chapter {
  padding: 0.55in;
  break-before: page;
}

.chapter:first-of-type { break-before: auto; }

.chapter-title {
  margin-top: 0.18in;
}

.toc {
  padding: 0.55in;
  border-bottom: 1px solid var(--rule);
}

.toc ol {
  list-style: decimal;
  margin-left: 1.4em;
}

.toc a {
  color: var(--ink);
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.2em auto 1.45em;
  font-size: 0.86rem;
  line-height: 1.35;
  break-inside: avoid;
  border: 1px solid rgba(15, 42, 15, 0.22);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 42, 15, 0.025);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

td,
th {
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0.08in;
  vertical-align: top;
  text-align: left;
}

th {
  background: rgba(15, 42, 15, 0.10);
  font-weight: 700;
}

tbody tr:nth-child(even) td,
tbody tr:nth-child(even) th {
  background: rgba(15, 42, 15, 0.035);
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

.sources {
  padding: 0.55in;
  break-before: page;
}

.sources li {
  margin-bottom: 0.45em;
}

.back-cover {
  min-height: 9in;
  padding: 0.65in 0.55in;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.back-cover img {
  width: 100%;
  max-height: 2.8in;
  object-fit: cover;
  filter: grayscale(100%);
  border: 1px solid var(--rule);
}

@page {
  size: 6in 9in;
  margin: 0.62in 0.52in;
}

@media print {
  html,
  body {
    background: #fff;
  }

  .book {
    max-width: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}

@media screen and (max-width: 760px) {
  table {
    display: block;
    overflow-x: auto;
    min-width: 720px;
  }
}
