/* ------------------------------------------------------------------ */
/* SheetNhac Pro v2.0 — Print stylesheet                               */
/* Bố cục A4/Letter, nền trắng, chữ đen, hợp âm xanh đậm #1a365d.      */
/* ------------------------------------------------------------------ */
@media print {
  @page {
    size: A4;
    margin: 14mm 13mm;
  }

  :root,
  .dark {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --surface-3: #f4f4f4;
    --text: #000000;
    --muted: #333333;
    --muted-2: #555555;
    --border: #d0d0d0;
    --border-strong: #999999;
    --brand: #1a365d;
    --brand-soft: #ffffff;
    --chord: #1a365d;
    --accent: #1a365d;
    --danger: #000000;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }

  html,
  body {
    background: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    font-size: 11pt !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
  }

  /* Ẩn toàn bộ UI chrome */
  .no-print,
  .app-header,
  .app-nav,
  .app-footer,
  .toast-host,
  .modal-backdrop,
  .viewer-toolbar,
  .viewer-tabs,
  .download-bar,
  .catalog-sidebar,
  .search-bar,
  .filter-bar,
  .editor-toolbar,
  .editor-pane-left,
  .editor-actions,
  .setlist-actions,
  .song-card-actions,
  .pwa-banner,
  button,
  nav {
    display: none !important;
  }

  /* Chỉ in vùng dành cho giấy */
  .screen-only,
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  /* Vùng in được hiển thị đầy đủ */
  .print-area,
  .print-area * {
    visibility: visible !important;
  }

  .app-shell,
  .app-main,
  .page-wrap,
  .viewer-shell,
  .viewer-body,
  .print-area {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
    position: static !important;
  }

  .chord-sheet {
    --sheet-font-size: 11.5pt !important;
    color: #000000 !important;
    font-size: 11.5pt !important;
    line-height: 1.5 !important;
    overflow: visible !important;
  }

  .sheet-head {
    border-bottom: 1.5pt solid #000000 !important;
    padding-bottom: 6pt !important;
    margin-bottom: 12pt !important;
  }
  .sheet-title {
    font-size: 20pt !important;
    color: #000000 !important;
    margin-bottom: 4pt !important;
  }
  .sheet-subtitle {
    color: #333333 !important;
  }

  .meta-pill {
    background: transparent !important;
    border: 0.6pt solid #cccccc !important;
    color: #333333 !important;
    height: auto !important;
    padding: 1pt 5pt !important;
    font-size: 8.5pt !important;
  }
  .meta-pill.is-key {
    border-color: #1a365d !important;
    color: #1a365d !important;
  }
  .meta-pill strong {
    color: #000000 !important;
  }

  .section {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin-bottom: 10pt !important;
  }
  .section.chorus {
    border-left: 2.5pt solid #1a365d !important;
    padding-left: 8pt !important;
    margin-left: -8pt !important;
  }
  .section-head {
    color: #1a365d !important;
    font-size: 8.5pt !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 2pt !important;
  }
  .section-head::after {
    background: #cccccc !important;
  }
  .section.tab {
    background: #ffffff !important;
    border: 0.6pt solid #cccccc !important;
  }

  .pair .chord {
    color: #1a365d !important;
    font-weight: 700 !important;
    font-size: 9pt !important;
    line-height: 1.15 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .pair .lyric {
    color: #000000 !important;
    font-size: 11pt !important;
    display: inline;
    white-space: pre-wrap !important;
  }
  .pair {
    display: inline-block !important;
    padding-right: 0.1em !important;
  }
  .pair .lyric:empty {
    display: block !important;
    min-height: 0.6em !important;
  }

  .comment-line {
    color: #333333 !important;
    font-style: italic !important;
  }
  .tab-block {
    color: #000000 !important;
    font-size: 8pt !important;
    white-space: pre !important;
    overflow: visible !important;
  }

  /* In 2 cột trên giấy A4 nếu bật chế độ sân khấu */
  .sheet-cols.is-two {
    column-count: 2 !important;
    column-gap: 12mm !important;
  }

  /* Mỗi bài trong setlist in trên trang riêng */
  .print-song-page {
    break-after: page !important;
    page-break-after: always !important;
    padding: 0 !important;
    margin: 0 0 8mm !important;
  }
  .print-song-page:last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
  .print-song-page .sheet-title {
    font-size: 17pt !important;
  }

  /* Link và chú thích không in gạch chân */
  a[href]::after {
    content: none !important;
  }

  .print-footer {
    display: block !important;
    margin-top: 10pt;
    padding-top: 4pt;
    border-top: 0.5pt solid #cccccc;
    color: #666666;
    font-size: 8pt;
    text-align: center;
  }
}

/* Trên màn hình, phần footer in ẩn đi */
.print-footer {
  display: none;
}
