  .score-sheet {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 30px;
  }

  .score-sheet th,
  .score-sheet td {
    border: 1px solid #000;
    padding: 4px;
    text-align: center;
    font-size: 11px;
    line-height: 1;
  }

  .highlight {
    background: yellow;
    font-weight: bold;
  }

  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }

  .header .title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    width: 100%;
  }

  .info {
    margin: 5px 0;
  }

  .team-table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }

  .team-table-header .title {
    text-align: center;
    width: 100%;
  }

  .team-wrapper {
    margin-top: 30px;
    margin-bottom: 10px;
  }

  .team-table-print-sec {
    max-width: 1260px;
    margin: 40px auto;
    page-break-after: always;
  }

  .team-table-print-sec {
    page-break-after: always;
    page-break-inside: avoid;
    /* prevents splitting inside */
    break-inside: avoid;
  }

  /* Prevent any inner tables from splitting */
  .team-table-print-sec table {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Only add a break if NOT the last match */
  .team-table-print-sec:not(:last-child) {
    page-break-after: always;
  }
  .team-table-info {
    display: flex;
    flex-wrap: wrap;
  }

  .team-table-info .info-inner-item {
    width: 50%;
  }

  .team-table-info .info-inner-item span.fill-blank {
    width: 50%;
    display: inline-block;
    border-bottom: 1px solid #000;
    margin-left: 10px;
  }

  .team-wrapper table.score-sheet {
    margin-top: 20px;
  }

  .team-table-info .info-inner-item strong.text-center {
    text-align: center;
    display: block;
  }

  .score-sheet th:first-child,
  .score-sheet td:first-child,
  .score-sheet th:nth-child(3),
  .score-sheet td:nth-child(3) {
    width: 20%;
  }

  .score-sheet th:nth-child(5),
  .score-sheet td:nth-child(5) {
    width: 10%;
  }

  .score-sheet th:nth-child(2),
  .score-sheet td:nth-child(2),
  .score-sheet td:nth-child(4),
  .score-sheet th:nth-child(4) {
    width: 5%;
  }

  .score-sheet td.gray-bg {
    background: #d3d3d3;
  }

  @media print {
    .team-table-print-sec {
      margin: 0px;
      width: 100%;
      max-width: 100%;
    }

    .team-table-header .title h2 {
      margin: 0;
    }

    .print-btn {
      display: none;
    }

    header {
      display: none !important;
    }

    footer {
      display: none;
    }

    body {
      margin: 0;
    }

    .softball_wrap h2 {
      display: none;
    }

    .team-wrapper {
      margin-top: 20px;
      margin-bottom: 5px;
    }

    .team-table-print-sec {
      margin: 10px auto;
      page-break-after: always;
    }

    .team-wrapper table.score-sheet {
      margin-top: 20px;
    }

    .softball_wrap {
      display: none;
    }

    .score-sheet {
      margin-bottom: 10px;
    }

    .team-table-header .title p {
      margin-bottom: 5px;
    }

    .score-sheet th:first-child,
    .score-sheet td:first-child,
    .score-sheet th:nth-child(3),
    .score-sheet td:nth-child(3) {
      width: 15%;
    }

    .score-sheet th:nth-child(5),
    .score-sheet td:nth-child(5) {
      width: 12%;
    }

    .score-sheet th:nth-child(2),
    .score-sheet td:nth-child(2),
    .score-sheet td:nth-child(4),
    .score-sheet th:nth-child(4) {
      width: auto;
    }

    .team-table-info .info-inner-item {
      font-size: 12px;
    }
    @page {
      size: 8.5in 11in;
      margin: 0.5in;
    }

/* Each match stays together */
  .team-table-print-sec {
    page-break-inside: avoid;
    break-inside: avoid;
    margin: 0 auto 0.2in !important;
    width: 7.5in;
  }

  /* Insert breaks only between matches, never after last */
  .team-table-print-sec:not(:last-of-type) {
    page-break-after: always;
  }

  /* Absolutely forbid break after the very last match */
  .team-table-print-sec:last-of-type {
    page-break-after: auto !important;
  }
  }