@page { size: A3 landscape; margin: 10mm; }

* { box-sizing: border-box; }
html { color-scheme: light; background: #e8edf1; color: #17212d; font-family: Arial, Helvetica, sans-serif; }
body { margin: 0; }
.tp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 0 auto; max-width: 1480px; padding: 24px 28px; }
.tp-toolbar a { color: #21693d; text-underline-offset: 3px; }
.tp-toolbar button { border: 1px solid #21693d; border-radius: 8px; padding: 12px 18px; background: #21693d; color: #fff; font: inherit; font-weight: bold; cursor: pointer; }
.tp-toolbar :is(a, button, input):focus-visible { outline: 3px solid #a4640d; outline-offset: 4px; }
.tp-toolbar label { display: inline-flex; align-items: center; gap: 8px; }
.tp-toolbar input { width: 18px; height: 18px; accent-color: #21693d; }
.tp-toolbar p { flex-basis: 100%; margin: 0; color: #435364; font-size: 14px; line-height: 1.55; }
.tp-sheet { max-width: 1480px; padding: 28px; margin: 0 auto 28px; background: #fff; border: 1px solid #ccd5de; border-radius: 8px; }
.tp-page-heading { margin-bottom: 22px; }
.tp-page-heading h1 { margin: 5px 0 8px; font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.tp-page-heading p { margin: 0; font-size: 13px; color: #435364; }
.tp-page-heading .tp-kicker { color: #21693d; font-size: 14px; font-weight: bold; }
.tp-figure { width: 100%; overflow-x: auto; }
.tp-bracket { display: block; width: 100%; min-width: 980px; height: auto; }
.tp-round-title, .tp-score, .tp-winner { font-weight: bold; }
.tp-winner { fill: #21693d; }
.tp-match-title, .tp-status, .tp-average { fill: #435364; }
.tp-admin { fill: #704414; }
.tp-page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; margin-top: 16px; padding-top: 10px; border-top: 1px solid #d9e0e7; color: #435364; font-size: 11px; line-height: 1.4; }
.tp-hide-averages .tp-average { visibility: hidden; }
.tp-empty { min-height: 300px; }
.tp-empty h1 { overflow-wrap: anywhere; }

@media (max-width: 600px) {
    .tp-toolbar { padding: 18px; gap: 16px; }
    .tp-sheet { padding: 18px; border-radius: 0; }
    .tp-page-heading h1 { font-size: 23px; }
}

@media print {
    html, body { background: #fff; margin: 0; padding: 0; }
    .tp-toolbar { display: none !important; }
    main { margin: 0; padding: 0; }
    .tp-sheet { display: flex; flex-direction: column; width: 100%; max-width: none; height: calc(100vh - 22mm); margin: 0; padding: 0; border: 0; border-radius: 0; break-inside: avoid; page-break-inside: avoid; break-after: page; page-break-after: always; }
    .tp-sheet:last-child { break-after: auto; page-break-after: auto; }
    .tp-page-heading { flex: none; margin: 0 0 5mm; }
    .tp-page-heading h1 { margin: 1.5mm 0 2mm; font-size: 20pt; }
    .tp-page-heading p { font-size: 9pt; }
    .tp-page-heading .tp-kicker { font-size: 10pt; }
    .tp-figure { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; min-height: 0; width: 100%; overflow: visible; }
    .tp-bracket { display: block; flex: 1 1 auto; width: 100%; min-width: 0; height: 100%; max-height: 225mm; overflow: visible; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .tp-page-footer { flex: none; margin-top: 3mm; padding-top: 2mm; font-size: 8pt; }
    .tp-empty { display: block; }
}
