/* Druckseiten: A4 hochkant. Bildschirmvorschau und @media print. */
@page { size: A4 portrait; margin: 10mm; }

.druckseite { background: #e8ebee; padding: 0.5rem; }
.druckhinweis { max-width: 210mm; margin: 0 auto 1rem; }
.druckhinweis .btn { margin-right: 0.5rem; }

/* Code-Zettel: 2 x 4 pro Seite */
.zettelseite {
  width: 190mm; height: 277mm; margin: 0 auto 1rem; background: #fff;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr);
  page-break-after: always; break-after: page; overflow: hidden;
}
.zettel {
  border: 1px dashed #666; padding: 4mm 5mm; display: flex; flex-direction: column; overflow: hidden;
  font-size: 9.5pt; line-height: 1.3; color: #000; break-inside: avoid;
}
.zettel p { margin: 0 0 1.5mm; }
.z-schule { font-weight: 700; font-size: 10pt; }
.z-titel { font-size: 10pt; }
.z-code { font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace; font-size: 20pt; font-weight: 700; letter-spacing: 0.12em; margin: 2mm 0 !important; }
.z-link { font-size: 9pt; word-break: break-all; font-weight: 700; }
.z-text { font-size: 8.5pt; }

/* Briefe */
.brief { background: #fff; color: #000; font-size: 12pt; line-height: 1.45; }
.brief-kopf { font-weight: 700; font-size: 14pt; border-bottom: 1px solid #000; padding-bottom: 3mm; margin: 0 0 8mm; }
.brief-a4 { width: 190mm; min-height: 277mm; margin: 0 auto 1rem; padding: 5mm 8mm; page-break-after: always; break-after: page; }
.seite-a5 { width: 190mm; height: 277mm; margin: 0 auto 1rem; background: #fff; page-break-after: always; break-after: page; overflow: hidden; }
.brief-a5 { height: 138mm; padding: 4mm 8mm; font-size: 11pt; line-height: 1.35; overflow: hidden; }
.brief-a5 + .brief-a5 { border-top: 1px dashed #666; }
.brief-a5 .brief-kopf { font-size: 12.5pt; margin-bottom: 5mm; }

/* Teilnehmerlisten: je Block eine Seite */
.listenseite { width: 190mm; margin: 0 auto 1rem; padding: 4mm; background: #fff; color: #000; page-break-after: always; break-after: page; }
.listenseite h1 { font-size: 16pt; margin: 0 0 2mm; }
.listenseite h2 { font-size: 13pt; margin: 0 0 4mm; }
.listenseite h3 { font-size: 11.5pt; margin: 5mm 0 1.5mm; break-after: avoid; }
.liste { border-collapse: collapse; width: 100%; font-size: 10.5pt; }
.liste th, .liste td { border: 1px solid #000; padding: 1.3mm 2mm; text-align: left; }
.liste tr { break-inside: avoid; }
.liste .nr { width: 10mm; text-align: right; }
.liste .anwesend { width: 28mm; }

@media print {
  html { font-size: 100%; }
  body, .druckseite { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .zettelseite, .brief-a4, .seite-a5, .listenseite { margin: 0; width: auto; box-shadow: none; }
  .zettelseite { height: 277mm; }
  .seite-a5 { height: 277mm; }
  .zettelseite:last-child, .brief-a4:last-child, .seite-a5:last-child, .listenseite:last-child { page-break-after: auto; break-after: auto; }
  .brief-a4 { min-height: 0; }
  /* Verwaltungsseiten (z. B. Rücklauf): Navigation und Knöpfe weg */
  .kopf, .fuss, .btn, form { display: none !important; }
  .bereich-admin .container { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .karte { border: none; padding: 0; }
}
