:root {
  color-scheme: light;
  --ink: #201f1b;
  --muted: #6d685f;
  --line: #ded9ce;
  --paper: #fbfaf6;
  --wash: #eef3ef;
  --warm: #fff0d8;
  --accent: #d45f2c;
  --accent-dark: #9d3f19;
  --evergreen: #24614f;
  --blue: #315c88;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent-dark);
}

.site-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 40px 24px 64px;
}

.reader {
  max-width: 820px;
}

.kicker,
.meta,
.source-list,
.toc,
.section-list,
.build-note {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  margin: 0 0 16px;
}

h2 {
  border-top: 1px solid var(--line);
  margin-top: 44px;
  padding-top: 24px;
}

pre,
code {
  background: var(--wash);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

code {
  padding: 0.12rem 0.24rem;
}

pre {
  overflow-x: auto;
  padding: 16px;
}

pre code {
  padding: 0;
}

blockquote {
  border-left: 4px solid var(--accent);
  color: #464139;
  margin-left: 0;
  padding-left: 18px;
}

table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--wash);
}

.library-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  padding-bottom: 28px;
}

.hero {
  display: grid;
  gap: 22px;
}

.lede {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  margin: 0;
  max-width: 780px;
}

.hero-panel {
  align-items: center;
  background: var(--warm);
  border: 1px solid #edcf9f;
  border-radius: 8px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 22px;
}

.hero-panel h2 {
  border: 0;
  margin: 0 0 8px;
  padding: 0;
}

.hero-panel p {
  margin: 0;
}

.format-guide {
  background: var(--warm);
  border: 1px solid #edcf9f;
  border-radius: 8px;
  padding: 22px;
}

.format-guide-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  max-width: 820px;
}

.format-guide h2,
.format-guide h3 {
  border: 0;
  margin: 0;
  padding: 0;
}

.format-guide-header p,
.format-card p,
.utility-links {
  margin: 0;
}

.format-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(280px, 1.25fr) repeat(2, minmax(220px, 1fr));
}

.format-card {
  background: var(--paper);
  border: 1px solid #e2cdaa;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.format-card.recommended {
  background: #f2f7f3;
  border-color: #b7d0bf;
}

.format-card h3 {
  font-size: 1.25rem;
}

.format-card p:not(.eyebrow),
.format-guide-header p {
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.utility-links {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  gap: 8px 14px;
  margin-top: 16px;
}

.eyebrow,
.pill {
  color: var(--accent-dark);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.button.large {
  min-height: 52px;
  padding: 12px 18px;
}

.summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 28px 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric strong {
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.8rem;
}

.reader-tools {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 32px 0;
  padding: 18px;
}

.reader-dashboard {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 32px 0;
  padding: 20px;
}

.dashboard-header {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-header h2 {
  border: 0;
  margin: 0 0 6px;
  padding: 0;
}

.dashboard-header p {
  margin: 0;
}

.dashboard-header p:not(.eyebrow) {
  color: var(--muted);
  max-width: 760px;
}

.dashboard-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dashboard-stat {
  background: var(--wash);
  border: 1px solid #d3ded4;
  border-radius: 8px;
  padding: 12px;
}

.dashboard-stat strong,
.dashboard-stat span {
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard-stat strong {
  font-size: 1.25rem;
}

.dashboard-stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

.dashboard-lists {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 18px;
}

.dashboard-lists section {
  min-width: 0;
}

.dashboard-lists h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.dashboard-lists ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard-lists li {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.dashboard-lists a,
.dashboard-lists span {
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard-lists a {
  font-weight: 800;
  text-decoration-thickness: 1px;
}

.dashboard-lists span,
.empty-state {
  color: var(--muted);
  font-size: 0.86rem;
}

.about-edition {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 30px 0;
  padding: 24px 0;
}

.about-edition h2 {
  border: 0;
  margin-top: 0;
  padding-top: 0;
}

.about-edition p {
  max-width: 820px;
}

.living-note {
  align-items: center;
  background: #f2f7f3;
  border: 1px solid #b7d0bf;
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 30px 0;
  padding: 20px;
}

.living-note h2 {
  border: 0;
  margin: 0 0 8px;
  padding: 0;
}

.living-note p {
  margin: 0;
}

.living-note .eyebrow {
  margin-bottom: 6px;
}

.article-brief {
  background: #f2f7f3;
  border-left: 4px solid var(--evergreen);
  margin: 28px 0 34px;
  padding: 18px 20px;
}

.article-brief h2 {
  border: 0;
  font-size: 1.4rem;
  margin: 2px 0 8px;
  padding: 0;
}

.article-brief p {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0 0 12px;
}

.article-brief ol {
  columns: 2 220px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding-left: 22px;
}

.article-brief li {
  break-inside: avoid;
  margin-bottom: 6px;
}

.article-topline {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.article-topline .build-note {
  margin: 0;
}

.bookmark-button[aria-pressed="true"] {
  background: #f2f7f3;
  border-color: #b7d0bf;
  color: var(--evergreen);
}

.reader-tools label {
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  margin-bottom: 8px;
}

.reader-tools input {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

.search-status {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.search-results {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.search-results li {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.search-results a {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
}

.search-results span,
.search-results p {
  color: var(--muted);
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  margin: 4px 0 0;
}

.download-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.primary-downloads {
  grid-template-columns: minmax(260px, 1.3fr) repeat(auto-fit, minmax(210px, 1fr));
}

.download-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  padding: 16px;
  text-decoration: none;
}

.featured-download {
  background: #f2f7f3;
  border-color: #b7d0bf;
}

.download-card:hover,
.button:hover {
  border-color: var(--accent);
}

.download-card strong,
.download-card span {
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.download-card strong {
  margin-bottom: 6px;
}

.download-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.cover {
  min-height: 70vh;
  padding-top: 12vh;
}

.subtitle {
  color: var(--accent-dark);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 0;
}

.download-card .pill {
  color: var(--evergreen);
  margin-bottom: 8px;
}

.section-note {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin-top: -8px;
  max-width: 760px;
}

.section-list,
.toc {
  columns: 2 280px;
  padding-left: 20px;
}

.section-list li,
.toc li {
  break-inside: avoid;
  margin: 0 0 8px;
}

.optional-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 24px;
  padding: 14px 16px;
}

.optional-panel summary {
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
}

.compact-download-grid,
.supporting-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
}

.small-download {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  padding: 12px;
  text-decoration: none;
}

.topic-ebooks {
  background: var(--warm);
  border: 1px solid #edcf9f;
  border-radius: 8px;
  margin: 36px 0;
  padding: 22px;
}

.topic-ebooks h2 {
  border: 0;
  margin-top: 0;
  padding-top: 0;
}

.topic-ebooks .section-note {
  margin-top: 0;
}

.featured-topic-grid .small-download {
  background: var(--paper);
}

.featured-topic-grid .small-download:hover {
  border-color: var(--accent);
}

.small-download strong,
.small-download span {
  display: block;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.small-download span,
.data-list span {
  color: var(--muted);
  font-size: 0.86rem;
}

.supporting-info {
  margin-bottom: 24px;
}

.source-list {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 20px;
}

.warning {
  background: #fff2df;
  border-left: 4px solid var(--accent);
  padding: 10px 14px;
}

.build-details {
  margin-top: 16px;
}

.build-details summary {
  cursor: pointer;
  font-weight: 700;
}

.build-details ul {
  margin-bottom: 0;
}

@media print {
  body {
    background: white;
  }

  .site-shell {
    max-width: none;
    padding: 0;
  }

  a {
    color: inherit;
  }
}

@media (max-width: 720px) {
  .hero-panel,
  .format-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .living-note {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    min-width: 0;
  }

  .article-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}
