body {
  text-align: justify;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}

/* Left-align equations */
.MathJax_Display {
  text-align: left !important;
  margin-left: 0 !important;
}

mjx-container[display="true"] {
  text-align: left !important;
  margin-left: 0 !important;
}

.public-book-header,
.book-welcome,
.citation-widget {
  text-align: left;
}

.book-welcome {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  margin: 0 0 2rem;
  padding: clamp(1rem, 3vw, 2rem) 0 1.5rem;
  border-bottom: 1px solid #d9e0e5;
}

.book-cover-wrap {
  justify-self: center;
  width: min(100%, 280px);
}

.book-cover {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d8dee6;
  box-shadow: 0 14px 34px rgba(30, 41, 59, 0.18);
}

.book-kicker {
  margin: 0 0 0.75rem;
  color: #0f766e;
  font-weight: 700;
  letter-spacing: 0;
}

.book-welcome .title {
  margin: 0;
  color: #1f2937;
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.book-authors {
  margin: 1rem 0 1.25rem;
  color: #374151;
  font-size: 1.08rem;
  line-height: 1.45;
}

.book-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0 0 1.2rem;
}

.book-facts div {
  min-width: 0;
}

.book-facts dt {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.book-facts dd {
  margin: 0.12rem 0 0;
  color: #1f2937;
}

.book-credit {
  margin: 0 0 1.3rem;
  color: #475569;
  line-height: 1.55;
}

.citation-widget {
  margin: 0 0 2.5rem;
  padding: 1.35rem;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  background: #f8fafc;
}

.citation-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.citation-heading h2,
.citation-heading p,
.citation-format h3 {
  margin: 0;
}

.citation-heading h2 {
  font-size: 1.35rem;
  color: #1f2937;
}

.citation-heading p {
  color: #64748b;
}

.citation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.citation-format {
  min-width: 0;
}

.citation-format-wide {
  grid-column: 1 / -1;
}

.citation-format h3 {
  margin-bottom: 0.35rem;
  color: #0f766e;
  font-size: 0.95rem;
}

.citation-format pre {
  margin: 0;
  max-height: 18rem;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid #d7dee7;
  border-radius: 6px;
  background: #fff;
}

.citation-format code {
  color: #1f2937;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .book-welcome,
  .citation-grid {
    grid-template-columns: 1fr;
  }

  .book-cover-wrap {
    width: min(68vw, 260px);
  }

  .book-facts {
    grid-template-columns: 1fr;
  }
}
