  :root {
    --cbjj-black: #070707;
    --cbjj-ink: #141414;
    --cbjj-blue: #003b73;
    --cbjj-blue-dark: #01264a;
    --cbjj-gold: #c99a2e;
    --cbjj-gold-soft: #f4d27a;
    --cbjj-silver: #c9ced6;
    --cbjj-bronze: #b8793b;
    --cbjj-line: #d9dee7;
    --cbjj-muted: #667085;
    --cbjj-bg: #f3f5f8;
    --cbjj-white: #ffffff;
    --shadow: 0 20px 45px rgba(15, 23, 42, .12);
  }

  * {
    box-sizing: border-box;
  }

  html {
    min-height: 100%;
    background: var(--cbjj-bg);
  }

  body {
    min-height: 100%;
    margin: 0;
    color: var(--cbjj-ink);
    background:
      linear-gradient(135deg, rgba(0, 59, 115, .08), rgba(201, 154, 46, .1) 38%, transparent 38%),
      var(--cbjj-bg);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.45;
  }

  a {
    color: inherit;
  }

  .page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
  }

  .scoreboard {
    overflow: hidden;
    border: 1px solid rgba(7, 7, 7, .08);
    border-radius: 8px;
    background: var(--cbjj-white);
    box-shadow: var(--shadow);
  }

  .event-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 24px;
    color: var(--cbjj-white);
    background:
      linear-gradient(120deg, rgba(0, 59, 115, .92), rgba(1, 38, 74, .98)),
      var(--cbjj-black);
    border-bottom: 5px solid var(--cbjj-gold);
  }

  .brand-block {
    display: grid;
    place-items: center;
    min-width: 210px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    background: rgba(0, 0, 0, .24);
  }

  .brand-block img {
    display: block;
    width: min(289px, 100%);
    height: auto;
  }

  .event-copy {
    min-width: 0;
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--cbjj-gold-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .eyebrow::before {
    content: "";
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: var(--cbjj-gold-soft);
  }

  h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.08;
    letter-spacing: 0;
  }

  h2 {
    margin: 0;
    font-size: 23px;
    line-height: 1.12;
    letter-spacing: 0;
  }

  .event-subtitle {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .print-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 8px;
    background: var(--cbjj-gold);
    color: var(--cbjj-black);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    white-space: nowrap;
  }

  .print-button:hover,
  .print-button:focus {
    background: var(--cbjj-gold-soft);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
    transform: translateY(-1px);
    outline: none;
  }

  .section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--cbjj-line);
    background: #fbfcfe;
  }

  .section-title strong {
    font-size: 18px;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .section-title span {
    color: var(--cbjj-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .medal-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
  }

  .medal-table th,
  .medal-table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--cbjj-line);
    vertical-align: middle;
  }

  .medal-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--cbjj-black);
    color: var(--cbjj-white);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
  }

  .medal-table thead th:first-child,
  .medal-table thead th:nth-child(2) {
    text-align: left;
  }

  .medal-table tbody tr:nth-child(even) {
    background: #f7f9fc;
  }

  .medal-table tbody tr:hover {
    background: #fff8e6;
  }

  .position {
    width: 54px;
    color: var(--cbjj-blue-dark);
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
  }

  .academy {
    min-width: 220px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .medal-count,
  .points {
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
  }

  .medal-count span,
  .points span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
  }

  .gold span {
    background: rgba(201, 154, 46, .16);
    color: #8a620f;
  }

  .silver span {
    background: rgba(121, 133, 151, .16);
    color: #58606d;
  }

  .bronze span {
    background: rgba(184, 121, 59, .16);
    color: #85501f;
  }

  .points span {
    background: var(--cbjj-blue);
    color: var(--cbjj-white);
  }

  .medal-table tbody tr:nth-child(1) .position,
  .medal-table tbody tr:nth-child(2) .position,
  .medal-table tbody tr:nth-child(3) .position {
    color: var(--cbjj-gold);
  }

  .footer-bar {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px 18px;
    color: var(--cbjj-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
  }

  @media (max-width: 820px) {
    .page-shell {
      width: min(100% - 20px, 1180px);
      padding: 10px 0;
    }

    .event-header {
      grid-template-columns: 1fr;
      gap: 16px;
      padding: 20px;
    }

    h1 {
      font-size: 24px;
    }

    h2 {
      font-size: 22px;
    }

    .brand-block {
      min-width: 0;
      justify-items: start;
    }

    .print-button {
      width: 100%;
    }

    .section-title {
      padding: 16px 18px;
    }
  }

  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  @media print {
    html,
    body {
      background: #ffffff;
      color: #000000;
      font-size: 10px;
      line-height: 1.2;
    }

    .page-shell {
      width: 100%;
      padding: 0;
    }

    .scoreboard {
      border: 0;
      border-radius: 0;
      box-shadow: none;
      overflow: visible;
    }

    .event-header {
      display: grid;
      grid-template-columns: 120px 1fr;
      gap: 10px;
      align-items: center;
      padding: 0 0 7px;
      color: #000000;
      background: #ffffff;
      border-bottom: 2px solid #000000;
    }

    .brand-block {
      min-width: 0;
      padding: 5px 7px;
      border-color: #000000;
      background: #000000;
    }

    .brand-block img {
      width: 105px;
    }

    .event-copy {
      min-width: 0;
    }

    .eyebrow,
    .event-subtitle {
      display: none;
    }

    h1,
    h2 {
      font-size: 16px;
      line-height: 1.15;
    }

    .print-button {
      display: none;
    }

    .section-title {
      display: block;
      padding: 7px 0 6px;
      border-bottom: 1px solid #000000;
      background: #ffffff;
    }

    .section-title strong {
      display: block;
      font-size: 12px;
      text-align: center;
    }

    .section-title span,
    .footer-bar {
      display: none;
    }

    .table-wrap {
      overflow: visible;
    }

    .medal-table {
      width: 100%;
      min-width: 0;
      border-collapse: collapse;
      table-layout: auto;
    }

    .medal-table thead th {
      position: static;
      color: #000000;
      background: #e9e9e9;
    }

    .medal-table th,
    .medal-table td {
      padding: 3px 4px;
      border: 1px solid #777777;
      font-size: 9px;
      line-height: 1.15;
    }

    .medal-table th:first-child,
    .medal-table td:first-child {
      width: 36px;
    }

    .medal-table th:nth-child(2),
    .medal-table td:nth-child(2) {
      width: auto;
    }

    .medal-table th:nth-child(3),
    .medal-table td:nth-child(3),
    .medal-table th:nth-child(4),
    .medal-table td:nth-child(4),
    .medal-table th:nth-child(5),
    .medal-table td:nth-child(5) {
      width: 46px;
    }

    .medal-table th:nth-child(6),
    .medal-table td:nth-child(6) {
      width: 52px;
    }

    .medal-table thead {
      display: table-header-group;
    }

    .medal-table tr {
      page-break-inside: avoid;
    }

    .position {
      width: 36px;
      font-size: 9px;
    }
    .academy {
      width: auto;
      min-width: 0;
      font-size: 9px;
      font-weight: 800;
      word-break: normal;
      overflow-wrap: anywhere;
    }

    .medal-count,
    .points {
      width: auto;
      font-size: 9px;
    }

    .medal-count span,
    .points span {
      display: inline;
      min-width: 0;
      height: auto;
      padding: 0;
      border-radius: 0;
      background: transparent;
      color: #000000;
    }
  }
 
 