/* Memoboard – Druckbereich #druck (druck.js setzt ihn; Entwurf entwurf/entwurf-4.html, 4A und 4B).
   Die Hälften sind feste Kästen in Millimetern: A5 doppelt = zwei Hälften 148,5 × 210 mm je A4-quer-Blatt,
   A4 = eine Hälfte 210 × 297 mm je Blatt. Schwarz auf Weiß, keine Hintergründe, keine Bilder.
   Die Seitengröße (@page) setzt druck.js beim Drucken in dieses Stylesheet und nimmt sie danach wieder heraus.
   Die Regeln für Hälften und Notizen gelten auch am Bildschirm: dort misst druck.js die Blöcke unsichtbar. */

@media screen {
  #druck { display: none; }
  /* Beim Setzen: sichtbar für die Messung, aber außerhalb des Fensters und unsichtbar */
  #druck[data-setzen] { display: block; position: fixed; left: -20000px; top: 0; visibility: hidden; pointer-events: none; }
}

#druck { color: #000; background: none; font-family: var(--schrift); line-height: 1.35; }
#druck *, #druck *::before, #druck *::after { box-sizing: border-box; }

.druck-blatt { display: flex; overflow: hidden; }
#druck[data-format=a5] .druck-blatt { width: 297mm; height: 210mm; }
#druck[data-format=a4] .druck-blatt { width: 210mm; height: 297mm; }

/* Eine Hälfte: Kopf, Inhalt (mit Rand für Handnotizen), Fuß; Innenrand 12 mm */
.druck-haelfte { display: flex; flex-direction: column; flex: none; padding: 12mm; overflow: hidden; }
#druck[data-format=a5] .druck-haelfte { width: 148.5mm; height: 210mm; font-size: 9pt; }
#druck[data-format=a4] .druck-haelfte { width: 210mm; height: 297mm; font-size: 10.5pt; }
/* Mittelsteg zum Falten oder Schneiden */
.druck-haelfte + .druck-haelfte { border-left: .2mm dashed #999; }

.druck-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 4mm; flex: none;
  border-bottom: .3mm solid #000; padding-bottom: 1.2mm; margin-bottom: 3mm; }
.druck-kopf b { font-size: 1.55em; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.druck-kopf span { font-size: .85em; color: #333; white-space: nowrap; }
#druck[data-art=einzel] .druck-kopf b { font-size: 1em; }

.druck-koerper { flex: 1 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 20%; }
#druck[data-format=a4] .druck-koerper { grid-template-columns: minmax(0, 1fr) 27%; }
.druck-koerper.ohne-rand { grid-template-columns: minmax(0, 1fr); }
.druck-inhalt { min-width: 0; }
.druck-koerper:not(.ohne-rand) .druck-inhalt { padding-right: 3mm; }
.druck-rand { border-left: .2mm solid #999; padding-left: 2mm; }
.druck-rand i { font-style: normal; font-size: .75em; letter-spacing: .14em; text-transform: uppercase; color: #666; }

.druck-fuss { display: flex; justify-content: space-between; gap: 4mm; flex: none; padding-top: 2mm;
  font-size: .75em; color: #555; }
.druck-fuss span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Spaltenkopf in gesperrten Versalien mit Anzahl */
.druck-spalte { display: flex; justify-content: space-between; gap: 3mm; margin: 2.5mm 0 1mm; padding-bottom: .6mm;
  border-bottom: .2mm solid #999; font-size: .82em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.druck-inhalt > .druck-spalte:first-child { margin-top: 0; }
.druck-spalte span { overflow-wrap: anywhere; min-width: 0; }
.druck-spalte .druck-anzahl { font-weight: 400; letter-spacing: 0; }

/* Notiz: Kästchen, Titel, rechts Frist, Stufe, „2 von 4“; darunter der Text */
.druck-notiz { display: grid; grid-template-columns: .95em minmax(0, 1fr) auto; column-gap: 1.8mm; align-items: start;
  padding: .9mm 0; border-bottom: .15mm dotted #bbb; }
.druck-k { display: inline-block; width: .95em; height: .95em; border: .25mm solid #000; border-radius: .4mm;
  margin-top: .15em; flex: none; position: relative; }
.druck-titel { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.druck-meta { font-size: .82em; color: #333; white-space: nowrap; padding-top: .1em; }
.druck-weiter-titel { font-style: normal; color: #555; overflow-wrap: anywhere; min-width: 0; }

.druck-text { grid-column: 2 / 4; margin-top: .5mm; font-size: .9em; color: #111; overflow-wrap: anywhere; min-width: 0; }
.druck-text p { margin: 0 0 1mm; }
.druck-text p.druck-zeile { margin: 0; }
.druck-text > :last-child { margin-bottom: 0; }
.druck-text h1, .druck-text h2, .druck-text h3, .druck-text h4, .druck-text h5, .druck-text h6 { font-size: 1em; font-weight: 600; margin: 1mm 0 .5mm; }
.druck-text ul, .druck-text ol { margin: 0; padding-left: 1.2em; }
.druck-text ul.haken { list-style: none; padding-left: 0; }
.druck-text li { margin: .3mm 0; }
.druck-text li.aufgabe { display: flex; gap: 1.4mm; align-items: flex-start; }
.druck-text li.aufgabe > .druck-k, .druck-text li.aufgabe > p > .druck-k { width: .8em; height: .8em; margin-top: .25em; }
.druck-text li.aufgabe > p { margin: 0; display: flex; gap: 1.4mm; }
.druck-text li.zu { text-decoration: line-through; color: #555; }
.druck-text li.zu .druck-k::after { content: "✓"; position: absolute; inset: -.25em 0 0 .05em; font-size: .95em; line-height: 1; text-decoration: none; color: #000; }
.druck-kappe { overflow: hidden; }
.druck-gekuerzt { font-style: italic; color: #333; }
.druck-text pre, .druck-text code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; }
.druck-text pre { white-space: pre-wrap; margin: 0 0 1mm; }
.druck-text blockquote { margin: 0 0 1mm; padding-left: 2mm; border-left: .3mm solid #999; }
.druck-text hr { border: 0; border-top: .2mm solid #999; margin: 1mm 0; }
.druck-text table { border-collapse: collapse; margin: 0 0 1mm; }
.druck-text th, .druck-text td { border: .15mm solid #999; padding: .4mm 1mm; text-align: left; }

/* Einzelne Notiz (4B): Titel, Standzeile, voller Text, kein Rand */
.druck-einzel .druck-titel { display: block; font-size: 1.4em; margin: 0 0 .6mm; }
.druck-einzel .druck-link { margin: 0 0 .6mm; font-size: .9em; overflow-wrap: anywhere; }
.druck-stand { margin: 0 0 2mm; font-size: .85em; color: #333; }
.druck-einzel .druck-text { font-size: 1em; }
.druck-einzel.druck-weiter .druck-weiter-titel { margin: 0 0 1mm; font-size: .85em; }

@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
  /* Gedruckt wird nur der Druckbereich: keine Oberfläche, keine offenen Fenster, keine Meldung */
  body > :not(#druck) { display: none !important; }
  #druck { display: block; }
  .druck-blatt { break-after: page; page-break-after: always; }
  .druck-blatt:last-child { break-after: auto; page-break-after: auto; }
}
