.songbook-actions {
  margin: 1.5rem 0 2rem;
  text-align: center;
}

.songbook-actions-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.songbook-print-root {
  width: 100%;
}

.songbook-actions-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.songbook-actions-label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5b5b5b;
}

.songbook-key-select {
  border: 1px solid #d6d6d6;
  background: #fbfbfb;
  color: #333;
  padding: 0.3rem 2rem 0.3rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
  cursor: pointer;
  appearance: none;
}

.songbook-key-select:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.songbook-notation-wrapper {
  margin-top: 0.4rem;
}

.songbook-notation-block {
  margin-bottom: 0;
}

.songbook-notation-wrapper.has-labels .songbook-notation-block {
  margin-bottom: 0.9rem;
}

.songbook-notation-label {
  margin: 0 0 0.35rem;
  font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b6b6b;
}

.songbook-actions-note {
  margin-top: 0.5rem;
  color: #555;
  font-size: 0.95rem;
}

.songbook-cover {
  margin: 1.5rem 0 2.5rem;
  padding: 3rem 2.5rem 3.5rem;
  text-align: center;
  border: 2px solid #222;
  background: linear-gradient(135deg, #f8f3ec 0%, #ffffff 55%, #f2f6f8 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.songbook-cover .cover-image {
  width: 180px;
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
}

.songbook-cover .cover-title {
  font-family: "Libre Baskerville", "Noto Sans SC", "Noto Sans TC", serif;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.songbook-cover .cover-subtitle {
  font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #4a4a4a;
  margin-bottom: 1.5rem;
}

.songbook-cover .cover-blurb {
  font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
  max-width: 640px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
}

.songbook-cover .cover-meta {
  margin-top: 1.6rem;
  font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a6a6a;
}

.songbook-cover .cover-meta-secondary {
  font-family: "Montserrat", "Noto Sans SC", "Noto Sans TC", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5c5c5c;
}

.songbook-cover .cover-meta-primary {
  display: block;
  margin-top: 2.2rem;
  font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #444;
}

.songbook-toc {
  margin: 1.5rem 0 2rem;
}

.songbook-toc h1 {
  font-family: "Libre Baskerville", "Noto Sans SC", "Noto Sans TC", serif;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.songbook-toc h2 {
  font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.2rem 0 0.6rem;
  color: #444;
}

.songbook-toc p {
  margin: 0 0 1.2rem;
  color: #666;
  font-size: 0.95rem;
}

.songbook-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 2.2rem;
}

.songbook-toc li {
  margin: 0.35rem 0;
}

.songbook-toc a {
  color: #111;
  text-decoration: none;
  display: block;
}

.songbook-toc a::after {
  content: leader('.') target-counter(attr(href), page);
  float: right;
  color: #555;
}

.songbook-meta {
  margin: 1rem 0 1.4rem;
  padding: 1rem 1.2rem;
  background: #faf7f2;
  border: 1px solid #e6e1d8;
}

.songbook-meta.has-image {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.songbook-meta.no-image {
  display: block;
}

.songbook-meta p {
  margin: 0;
}

.songbook-meta-img {
  width: 120px;
  height: auto;
  border: 1px solid #d9d3c9;
  display: block;
}

.songbook-meta-info {
  min-width: 0;
}

.songbook-meta-info ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  row-gap: 0.35rem;
}

.songbook-meta-info li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.songbook-meta-info li strong {
  min-width: 90px;
  font-weight: 600;
}

.song-section {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e0e0e0;
}

.song-section > h1 {
  text-align: center;
}

.song-section .abcjs-container,
.song-section .abcjs-svg,
.song-section svg {
  max-width: 100%;
}

.song-section .abcjs-svg,
.song-section svg {
  width: 100%;
  height: auto;
}

.song-meta {
  color: #555;
  margin-bottom: 1rem;
}

@media print {
  @page {
    margin: 18mm 16mm 20mm;
    @top-left {
      content: "Shawn's Lead Sheet Songbook";
      font-family: "Libre Baskerville", "Noto Sans SC", "Noto Sans TC", serif;
      font-size: 10pt;
      color: #333;
    }
    @bottom-left {
      content: "©️ 2026 Pengxiang Wang. All rights reserved.";
      font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
      font-size: 9pt;
      color: #666;
    }
    @bottom-right {
      content: counter(page) " / " counter(pages);
      font-family: "Poppins", "Noto Sans SC", "Noto Sans TC", sans-serif;
      font-size: 10pt;
      color: #555;
    }
  }

  body {
    font-size: 11pt;
  }

  .songbook-print-root {
    max-width: 170mm;
    margin: 0 auto;
  }

  .navbar,
  .sidebar,
  .page-navigation,
  .page-footer,
  .quarto-title-banner,
  .quarto-title-block,
  .quarto-title,
  .sidebar-navigation,
  .nav-footer,
  footer,
  .songbook-actions,
  .abcjs-inline-audio,
  #global-controls,
  button {
    display: none !important;
  }

  #TOC,
  .songbook-toc {
    break-after: page;
    page-break-after: always;
  }

  .songbook-cover {
    break-after: page;
    page-break-after: always;
    box-shadow: none;
  }

  .songbook-meta {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .song-section {
    break-before: page;
    page-break-before: always;
    border-top: none;
    padding-top: 0;
    break-inside: auto;
  }

  .song-section:first-of-type {
    break-before: auto;
    page-break-before: auto;
  }

  .song-section svg,
  .song-section .abcjs-container,
  .song-section .abcjs-svg {
    break-inside: auto;
    page-break-inside: auto;
    max-width: 100% !important;
    overflow: visible;
  }

  .song-section .abcjs-svg,
  .song-section svg {
    width: 100% !important;
    height: auto !important;
  }

  .abctext {
    display: none !important;
  }

  a[href]:after {
    content: "";
  }
}
