/*
 * OpenYardage: A4-Ausschießvorlage, beidseitig (Migrationsplan Abschnitt 4 A)
 * Gehört zu js/print.js. Einbindung per <link rel="stylesheet" href="css/print.css">.
 * Alle Klassen sind mit .oyp- bzw. .printsheet geprefixt und greifen nicht in
 * bestehende App-Styles ein.
 *
 * Druckmaße konsequent in mm. Bogen immer 210 × 297 mm, die Zellaufteilung
 * hängt am Papierformat (Herleitung siehe js/print.js, Abschnitt 1, 1c und 1d):
 *   A6 KOMPAKT     Raster 2 × 2 zu 105 × 148,5 mm, obere Reihe um 180° gedreht
 *   HEFT A6        gleiches Raster, aber Rückstich: gedreht wird nicht nach
 *                  Viertel, sondern nach Bogenseite. Welche Zelle .flip bekommt,
 *                  entscheidet allein js/print.js über den Wert `rot` der
 *                  Montage; das CSS kennt hier keine eigene Regel.
 *   TOUR 108 × 178 zwei Spalten zu 105 mm, Zeilen 178 mm (Kärtchen) und
 *                  119 mm (Reststreifen), keine Drehung
 * Beim Tour-Format steht die Kärtchenhöhe in der Variablen --oyp-tall, die
 * js/print.js je Bogenseite inline setzt: im Turniermodus 177,8 mm (Grenze
 * 4 1/4 × 7 Zoll), sonst die runden 178 mm. Alles andere rechnet sich daraus.
 *
 * Die Bildschirm-Vorschau zeigt denselben mm-genauen Bogen, nur per
 * transform: scale(var(--oyp-scale)) verkleinert. Was man sieht, kommt so auch
 * aus dem Drucker.
 *
 * Design-Tokens sind lokal wiederholt, damit das Modul ohne die :root-Variablen
 * aus index.html funktioniert.
 */

.oyp-overlay {
  --oyp-scale: .35;
  --oyp-paper: #ece7db;
  --oyp-card: #fffdf7;
  --oyp-ink: #21251f;
  --oyp-ink2: #4a463c;
  --oyp-mut: #6b6252;
  --oyp-faint: #8a8170;
  --oyp-line: #d8d1c0;
  --oyp-line2: #c9c1ad;
  --oyp-line3: #eee8da;
  --oyp-green: #2f6b46;
  --oyp-green-dk: #1d4a2f;
  --oyp-red: #b23a2e;
  --oyp-gold: #a08c4f;
  --oyp-mono: 'Courier New', Courier, monospace;
  --oyp-serif: Georgia, 'Times New Roman', serif;

  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 22, 16, .68);
  display: flex;
  flex-direction: column;
  font-family: var(--oyp-mono);
  color: var(--oyp-ink);
}
.oyp-overlay * { box-sizing: border-box; }

/* ---------- Bedienleiste + Anleitung (nur Bildschirm) ---------- */

.oyp-bar {
  flex: 0 0 auto;
  background: var(--oyp-ink);
  color: #f5f1e6;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 18px;
}
.oyp-brand { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.oyp-brand b { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; }
.oyp-brand span { font-size: 10px; letter-spacing: .1em; color: var(--oyp-faint); }
.oyp-grp, .oyp-nav, .oyp-acts { display: flex; align-items: center; gap: 6px; }
.oyp-lbl { font-size: 9px; letter-spacing: .18em; color: var(--oyp-faint); margin-right: 2px; }
.oyp-pos {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  min-width: 96px; text-align: center; color: #f5f1e6;
}
.oyp-btn {
  font-family: var(--oyp-mono); font-weight: 700; font-size: 11.5px; letter-spacing: .08em;
  background: none; color: #f5f1e6; border: 1.5px solid #f5f1e6; border-radius: 3px;
  padding: 6px 11px; cursor: pointer; line-height: 1; white-space: nowrap;
}
.oyp-btn:hover { background: rgba(245, 241, 230, .16); }
.oyp-btn.solid { background: var(--oyp-green); border-color: var(--oyp-green); }
.oyp-btn.solid:hover { background: var(--oyp-green-dk); border-color: var(--oyp-green-dk); }
.oyp-btn.on, .oyp-btn[aria-pressed="true"] { background: #f5f1e6; color: var(--oyp-ink); }

.oyp-howto {
  flex: 0 0 auto;
  background: #2b2f28; color: #cfc9b8;
  font-size: 10px; letter-spacing: .1em; line-height: 1.7;
  padding: 8px 18px; border-bottom: 1px solid #4a463c;
}

/* Regelhinweis neben der Modus-Umschaltung: eine Zeile mit den gemessenen
   Werten, aufklappbar für die drei Punkte, die beim Turnierdruck zählen. */
.oyp-rulenote {
  margin-top: 6px; padding-top: 6px; border-top: 1px solid #4a463c;
  color: #b9b2a0;
}
.oyp-rulenote > summary {
  cursor: pointer; list-style: none; line-height: 1.7;
  display: flex; align-items: baseline; gap: 6px;
}
.oyp-rulenote > summary::-webkit-details-marker { display: none; }
.oyp-rulenote > summary::before {
  content: '▸'; flex: 0 0 auto; color: #8a8170; font-size: 9px;
}
.oyp-rulenote[open] > summary::before { content: '▾'; }
.oyp-rulenote > summary:hover { color: #f5f1e6; }
/* Turniermodus wird optisch bestätigt, Freizeitmodus bleibt neutral */
.oyp-rulenote.comp > summary { color: #8fbf9f; }
.oyp-rulenote.comp { border-top-color: #3d5a45; }
.oyp-ruledet { padding: 6px 0 2px 16px; display: flex; flex-direction: column; gap: 5px; }
.oyp-rd { color: #9a9384; line-height: 1.75; }
.oyp-rd::before { content: '· '; color: #6b6252; }

/* ---------- Bühne, Bögen, Vorschau-Skalierung ---------- */

.oyp-stage {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.oyp-stage.all {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  align-content: flex-start; gap: 26px;
}

/* Ein Bogen = zwei Druckseiten (vorne + hinten), in der Vorschau nebeneinander */
.oyp-paperwrap { display: none; gap: 20px; flex: 0 0 auto; }
.oyp-paperwrap.on { display: flex; }
.oyp-stage.all .oyp-paperwrap { display: flex; }
.oyp-side { display: flex; flex-direction: column; gap: 6px; }
.oyp-caption {
  font-size: 9.5px; letter-spacing: .14em; color: #cfc9b8; white-space: nowrap;
}

/* Testbogen: nur im Testmodus sichtbar, dafür dann exklusiv */
.oyp-overlay:not(.oyp-testmode) .oyp-testwrap { display: none !important; }
.oyp-overlay.oyp-testmode .oyp-paperwrap:not(.oyp-testwrap) { display: none !important; }
.oyp-overlay.oyp-testmode .oyp-testwrap { display: flex !important; }
/* Das Faltmuster des Hefts besteht aus MEHREREN Bögen, die Bühne muss also
   umbrechen dürfen statt vier Druckseiten in eine Reihe zu quetschen. */
.oyp-overlay.oyp-testmode .oyp-stage {
  flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 26px;
}

.oyp-empty {
  background: var(--oyp-card); border: 1px solid var(--oyp-line2); border-radius: 3px;
  padding: 24px 28px; max-width: 460px; font-size: 12px; line-height: 1.8;
  letter-spacing: .08em; color: var(--oyp-mut); text-align: center;
}

/* Skalierter Ausschnitt: Box in Bildschirmgröße, Bogen darin mm-genau */
.oyp-papercrop {
  width: calc(210mm * var(--oyp-scale));
  height: calc(297mm * var(--oyp-scale));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--oyp-line2);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
}
.oyp-papercrop .oyp-paper {
  transform: scale(var(--oyp-scale));
  transform-origin: top left;
}

/* ---------- Der Bogen selbst: A4 hochkant, Raster 2 × 2 ---------- */

.oyp-paper {
  position: relative;
  width: 210mm;
  height: 297mm;
  background: #fff;
  display: grid;
  grid-template-columns: 105mm 105mm;
  grid-template-rows: 148.5mm 148.5mm;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.oyp-cell {
  position: relative;
  width: 105mm;
  height: 148.5mm;
  padding: 5mm;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--oyp-ink, #21251f);
}
.oyp-cell.tl { grid-area: 1 / 1; }
.oyp-cell.tr { grid-area: 1 / 2; }
.oyp-cell.bl { grid-area: 2 / 1; }
.oyp-cell.br { grid-area: 2 / 2; }

/* PFLICHT: die obere Papierhälfte klappt beim Knick um die waagerechte Achse
   um, ihre beiden Zellen müssen deshalb auf BEIDEN Bogenseiten um 180° gedreht
   gedruckt werden. Welche Bild-Zelle physisch oben landet, entscheidet die
   DUPLEX-Tabelle in js/print.js. Gilt nur für die A6-Falt-Montage; das
   Tour-Format wird nicht geknickt und bekommt deshalb nie .flip.
   Beim HEFT gilt eine andere Regel (js/print.js, Kopfkommentar 1e B): dort
   hängt die Drehung an der Bogenseite, nicht am Viertel. Sie wird ebenfalls in
   js/print.js entschieden und landet über dieselbe Klasse hier. */
.oyp-cell.flip { transform: rotate(180deg); }

.oyp-card { display: flex; flex-direction: column; height: 100%; width: 100%; }

/* ---------- Tour-Format: zwei Kärtchen nebeneinander, kein Knick ---------- */
/* --oyp-tall = Kärtchenhöhe, kommt inline aus js/print.js (177,8 oder 178 mm).
   Welche BILD-Zeile die hohe ist, hängt an der Duplex-Wendung: bei kurzer Kante
   trifft die obere Bildzeile der Rückseite physisch den Streifen, dort liegt die
   hohe Zeile also unten (js/print.js, Abschnitt 2b). */
.oyp-paper.oyp-tour.oyp-talltop {
  grid-template-rows: var(--oyp-tall) calc(297mm - var(--oyp-tall));
}
.oyp-paper.oyp-tour.oyp-tallbot {
  grid-template-rows: calc(297mm - var(--oyp-tall)) var(--oyp-tall);
}
/* Zellhöhe folgt dem PHYSISCHEN Viertel, nicht der Bildposition. Damit kann die
   Höhe nicht mit der Duplex-Tabelle auseinanderlaufen. */
.oyp-paper.oyp-tour .oyp-cell[data-quad^="T"] { height: var(--oyp-tall); }
.oyp-paper.oyp-tour .oyp-cell[data-quad^="B"] { height: calc(297mm - var(--oyp-tall)); }
/* 178 mm statt 148,5 mm: mehr Notizzeilen, das Diagramm bleibt trotzdem größer */
.oyp-paper.oyp-tour .oyp-holecard .oyp-foot { max-height: 46%; }

/* ---------- Knick- und Schnittmarken (dünn, hellgrau, immer gedruckt) ---------- */

.oyp-marks { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.oyp-fold {
  position: absolute; left: 0; top: 148.5mm; width: 210mm;
  border-top: .25mm dashed #c9c1ad;
}
.oyp-cut {
  position: absolute; left: 105mm; top: 0; height: 297mm;
  border-left: .25mm dashed #c9c1ad;
}
.oyp-foldlbl, .oyp-cutlbl {
  position: absolute; font-family: var(--oyp-mono, 'Courier New', monospace);
  font-size: 5.5pt; font-weight: 700; letter-spacing: .14em;
  color: #c9c1ad; background: #fff; padding: 0 1.5mm; white-space: nowrap;
}
.oyp-foldlbl { left: 7mm; top: 148.5mm; transform: translateY(-50%); }
.oyp-cutlbl { left: 105mm; top: 2mm; transform: translateX(-50%); }
.oyp-cutlbl.bot { top: auto; bottom: 2mm; }

/* Lagenmarke des Hefts: nach dem Schnitt sehen alle Streifen gleich aus, und
   die Reihenfolge des Ineinanderlegens entscheidet über die Seitenfolge. Die
   Marke sitzt im 5-mm-Rand der Zelle, also außerhalb des Karteninhalts.
   Welche BILDspalte sie trifft, rechnet js/print.js aus der Duplex-Tabelle aus,
   denn auf der Rückseite kann die physisch linke Spalte im Bild rechts liegen. */
.oyp-lagelbl {
  position: absolute; top: 1.6mm;
  font-family: var(--oyp-mono, 'Courier New', monospace);
  font-size: 5.5pt; font-weight: 700; letter-spacing: .14em;
  color: #a9a08c; background: #fff; padding: 0 1.5mm; white-space: nowrap;
}
/* 6 mm bzw. 118 mm: links im Rand der linken Spalte, rechts weit genug hinter
   der mittigen Schnittmarke bei 105 mm, damit sich beide nie überlagern. */
.oyp-lagelbl.l { left: 6mm; }
.oyp-lagelbl.r { left: 118mm; }

/* Waagerechter Schnitt des Tour-Formats: trennt Kärtchen und Reststreifen.
   Seine Lage ist dieselbe wie die Rasterkante, also --oyp-tall bzw. der Rest. */
.oyp-hcut, .oyp-hcutlbl { position: absolute; }
.oyp-hcut { left: 0; width: 210mm; border-top: .25mm dashed #c9c1ad; }
.oyp-hcutlbl {
  left: 7mm; transform: translateY(-50%);
  font-family: var(--oyp-mono, 'Courier New', monospace);
  font-size: 5.5pt; font-weight: 700; letter-spacing: .14em;
  color: #c9c1ad; background: #fff; padding: 0 1.5mm; white-space: nowrap;
}
.oyp-paper.oyp-talltop .oyp-hcut,
.oyp-paper.oyp-talltop .oyp-hcutlbl { top: var(--oyp-tall); }
.oyp-paper.oyp-tallbot .oyp-hcut,
.oyp-paper.oyp-tallbot .oyp-hcutlbl { top: calc(297mm - var(--oyp-tall)); }

/* ---------- Zellinhalt: Kopf, Diagramm, Notizen, Schlägerzeile ---------- */

.oyp-head {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: baseline; gap: 3mm;
  border-bottom: .5mm solid var(--oyp-ink, #21251f); padding-bottom: 1.2mm;
  font-family: var(--oyp-mono, 'Courier New', monospace);
}
.oyp-head .n { font-size: 11pt; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.oyp-head .f {
  font-size: 6.5pt; letter-spacing: .06em; color: var(--oyp-ink2, #4a463c);
  white-space: nowrap; text-align: right;
}

/* Das SVG kommt aus opts.renderHole/renderGreen und wird hier auf die
   verfügbare Fläche gezwungen (inline height der Callbacks überschreiben) */
.oyp-dia {
  flex: 1 1 auto; min-height: 0; margin-top: 1.5mm;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.oyp-dia svg {
  width: 100% !important; height: 100% !important;
  max-width: 100%; max-height: 100%; display: block;
}
.oyp-nodia {
  font-family: var(--oyp-mono, 'Courier New', monospace);
  font-size: 6.5pt; letter-spacing: .16em; color: #8a8170;
  text-align: center; line-height: 2.2;
  border: .2mm dashed #d8d1c0;
}

/* Grün-Diagramm: feste Kantenlänge in mm statt Flexbox-Rest, sonst wäre der
   gedruckte Maßstab nicht ausrechenbar. Die Werte setzt js/print.js inline aus
   greenScale(); die Fußzeile der Seite nennt das Ergebnis in mm.
   flex: 0 0 auto ist Pflicht, sonst würde der Flex-Container die Box stauchen
   und der ausgewiesene Maßstab stimmte nicht mehr. */
.oyp-greenfix { flex: 0 0 auto; overflow: hidden; }

/* ---------- Notizfläche auf dem Reststreifen (Belegung NUR LÖCHER) ---------- */

.oyp-stripcard .oyp-rules {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 4mm 0 2mm;
}
.oyp-stripcard .oyp-rule { height: 0; border-bottom: .2mm solid var(--oyp-line, #d8d1c0); }

.oyp-foot { flex: 0 0 auto; max-height: 56%; overflow: hidden; }
.oyp-notes {
  border-top: .2mm solid var(--oyp-line, #d8d1c0);
  padding-top: 1.6mm; margin-top: 1.6mm;
  display: flex; flex-direction: column; gap: .8mm;
}
.oyp-nl {
  display: flex; gap: 1.5mm; align-items: baseline;
  font-family: var(--oyp-serif, Georgia, serif); font-size: 7.5pt; line-height: 1.32;
}
.oyp-nl b {
  font-family: var(--oyp-mono, 'Courier New', monospace); font-style: normal;
  font-weight: 700; font-size: 6pt; letter-spacing: .06em;
  color: var(--oyp-green, #2f6b46); width: 17mm; flex: 0 0 17mm; padding-top: .2mm;
}
.oyp-nl span { font-style: italic; color: var(--oyp-ink, #21251f); }
.oyp-nl.gold b { color: var(--oyp-gold, #a08c4f); }
.oyp-nl.cond b { color: var(--oyp-mut, #6b6252); }
/* Rot ausschließlich für die ⚠-Zeile (Design-Token-Regel) */
.oyp-nl.warn b, .oyp-nl.warn span { color: var(--oyp-red, #b23a2e); }
.oyp-nl.warn span { font-weight: 700; }
.oyp-more {
  font-family: var(--oyp-mono, 'Courier New', monospace);
  font-size: 5.5pt; letter-spacing: .12em; color: #8a8170; padding-top: .5mm;
}

.oyp-club {
  display: flex; justify-content: space-between; align-items: baseline; gap: 3mm;
  border-top: .2mm solid var(--oyp-line3, #eee8da);
  margin-top: 1.6mm; padding-top: 1.2mm;
  font-family: var(--oyp-mono, 'Courier New', monospace);
  font-size: 6pt; letter-spacing: .1em; color: var(--oyp-mut, #6b6252);
  white-space: nowrap; overflow: hidden;
}
.oyp-club .rt { overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.oyp-greencard .oyp-club span:first-child { font-weight: 700; }

/* Lizenz-Nennung, nur auf Fläche 1 des ersten Bogens. Bewusst klein und
   umbrechend statt abgeschnitten: eine Rechtsangabe darf nicht halb dastehen. */
.oyp-attrib {
  flex: 0 0 auto;               /* nie stauchen, nie kappen */
  font-family: var(--oyp-mono, 'Courier New', monospace);
  font-size: 5pt; line-height: 1.5; letter-spacing: .04em;
  color: var(--oyp-faint, #8a8170);
  margin-top: 1mm; padding-top: .8mm;
  border-top: .2mm dotted var(--oyp-line3, #eee8da);
  overflow-wrap: anywhere;
}

/* ---------- Deckblatt des Hefts (nur Format HEFT) ---------- */
/* Ein Heft hat eine erste Seite, ein Kartenstapel nicht. Hier steht auch die
   Lizenzzeile, deshalb muss unten Platz für .oyp-attrib bleiben. */

.oyp-covercard {
  justify-content: space-between; text-align: center;
  font-family: var(--oyp-mono, 'Courier New', monospace);
}
.oyp-cvtop {
  flex: 0 0 auto;
  font-size: 7pt; font-weight: 700; letter-spacing: .3em; color: #6b6252;
  border-bottom: .5mm solid #21251f; padding-bottom: 2mm;
}
.oyp-cvmid {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3mm; padding: 4mm 0;
}
.oyp-cvname {
  font-family: var(--oyp-serif, Georgia, serif);
  font-size: 20pt; line-height: 1.2; letter-spacing: .02em; color: #21251f;
  overflow-wrap: anywhere;
}
.oyp-cvsub { font-size: 8pt; letter-spacing: .14em; color: #4a463c; overflow-wrap: anywhere; }
.oyp-cvfoot {
  flex: 0 0 auto;
  border-top: .2mm solid var(--oyp-line, #d8d1c0); padding-top: 2mm;
  display: flex; flex-direction: column; gap: 1mm;
}
.oyp-cvline { font-size: 6.5pt; letter-spacing: .12em; color: #6b6252; }

/* ---------- Unbenutzter Streifen (ungerade Lagenzahl) ---------- */

.oyp-unusedcard {
  align-items: center; justify-content: center; text-align: center; gap: 4mm;
  border: .3mm dashed #c9c1ad;
  font-family: var(--oyp-mono, 'Courier New', monospace);
}
.oyp-untxt { font-size: 9pt; font-weight: 700; letter-spacing: .14em; line-height: 1.8; color: #8a8170; }
.oyp-unsub {
  font-size: 6pt; letter-spacing: .08em; line-height: 1.8; color: #a9a08c; max-width: 72mm;
}

/* ---------- Testbogen- und Faltmuster-Fläche ---------- */

.oyp-testcard {
  align-items: center; justify-content: center; text-align: center; gap: 3mm;
  border: .3mm dashed #c9c1ad;
  font-family: var(--oyp-mono, 'Courier New', monospace);
}
.oyp-tpos { font-size: 11pt; font-weight: 700; letter-spacing: .16em; color: #21251f; }
.oyp-tface { font-size: 34pt; font-weight: 700; letter-spacing: .04em; color: #2f6b46; }
/* Faltmuster: die Seitenzahl ist der ganze Zweck des Blattes, sie muss beim
   Durchblättern aus einem Meter Entfernung lesbar sein. */
.oyp-tbig { font-size: 72pt; line-height: 1; }
.oyp-trole { font-size: 9pt; font-weight: 700; letter-spacing: .12em; color: #4a463c; }
.oyp-thint {
  font-size: 6pt; letter-spacing: .08em; line-height: 1.8; color: #8a8170;
  max-width: 78mm; margin-top: 4mm;
}

@media (max-width: 900px) {
  .oyp-stage { padding: 12px; align-items: flex-start; }
  .oyp-paperwrap, .oyp-stage.all .oyp-paperwrap { flex-wrap: wrap; justify-content: center; }
}

/* ==========================================================================
   DRUCK: nur aktiv, solange js/print.js die Klasse .oyp-printing an <html>
   setzt. Ohne offenes Overlay bleibt das Druck-CSS aus index.html unberührt.
   ========================================================================== */

@media print {
  @page { size: A4 portrait; margin: 0; }

  html.oyp-printing,
  html.oyp-printing body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* 1) Alles unsichtbar … */
  html.oyp-printing body * { visibility: hidden !important; }
  /* 2) … außer den Bögen */
  html.oyp-printing .oyp-overlay,
  html.oyp-printing .oyp-overlay * { visibility: visible !important; }
  /* 3) Hängt das Overlay direkt unter <body> (Normalfall, print.js hängt es
        dafür kurzzeitig um), verschwindet der Rest ganz, sonst blieben leere
        Folgeseiten stehen. */
  html.oyp-hoisted body > *:not(.oyp-overlay) { display: none !important; }
  /* 4) Bildschirm-Chrome nie mitdrucken */
  html.oyp-printing .oyp-bar,
  html.oyp-printing .oyp-howto,
  html.oyp-printing .oyp-caption,
  html.oyp-printing .oyp-empty { display: none !important; }

  html.oyp-printing .oyp-overlay {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  html.oyp-printing .oyp-stage,
  html.oyp-printing .oyp-stage.all {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    gap: 0 !important;
  }
  html.oyp-printing .oyp-paperwrap,
  html.oyp-printing .oyp-paperwrap.on,
  html.oyp-printing .oyp-side {
    display: block !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  /* Vorschau-Rahmen und Skalierung fallen im Druck weg */
  html.oyp-printing .oyp-papercrop {
    width: auto !important; height: auto !important;
    overflow: visible !important; border: 0 !important;
    background: transparent !important; box-shadow: none !important;
  }
  html.oyp-printing .oyp-papercrop .oyp-paper { transform: none !important; }

  /* Testmodus: nur der Testbogen, sonst nur die echten Bögen */
  html.oyp-printing .oyp-overlay:not(.oyp-testmode) .oyp-testwrap { display: none !important; }
  html.oyp-printing .oyp-overlay.oyp-testmode .oyp-paperwrap:not(.oyp-testwrap) { display: none !important; }

  /* Je Bogenseite eine Druckseite */
  html.oyp-printing .oyp-paper {
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    box-shadow: none !important;      /* keine Verläufe/Halbtöne auf S/W-Laser */
    background: #fff !important;
    page-break-inside: avoid; break-inside: avoid;
    page-break-after: always; break-after: page;
  }
  /* Letzte gedruckte Seite ohne Umbruch, sonst ein leeres Blatt am Ende.
     Im Testmodus zählt der LETZTE Testbogen (.oyp-testlast), nicht jeder:
     das Faltmuster des Hefts besteht aus mehreren Bögen, und zwischen ihnen
     muss der Umbruch stehenbleiben. */
  html.oyp-printing .oyp-stage > .oyp-paperwrap:last-child .oyp-side:last-child .oyp-paper,
  html.oyp-printing .oyp-overlay.oyp-testmode .oyp-testwrap.oyp-testlast .oyp-side:last-child .oyp-paper {
    page-break-after: auto; break-after: auto;
  }

  /* Linien im Druck hart, damit auf S/W-Laser nichts absäuft */
  html.oyp-printing .oyp-head { border-bottom-color: #21251f !important; }
  html.oyp-printing .oyp-notes { border-top-color: #21251f !important; }
  html.oyp-printing .oyp-club { border-top-color: #21251f !important; color: #21251f !important; }
  html.oyp-printing .oyp-head .f,
  html.oyp-printing .oyp-nl.cond b { color: #21251f !important; }
  /* Lizenzzeile muss auf S/W-Laser lesbar bleiben */
  html.oyp-printing .oyp-attrib { color: #6b6252 !important; }
  /* ⚠-Zeile bleibt rot (auf S/W zusätzlich fett + Symbol) */
  html.oyp-printing .oyp-nl.warn b,
  html.oyp-printing .oyp-nl.warn span { color: #b23a2e !important; font-weight: 700; }
  /* Notizlinien des Reststreifens sollen beschreibbar, aber sichtbar sein */
  html.oyp-printing .oyp-stripcard .oyp-rule { border-bottom-color: #c9c1ad !important; }
  /* Marken bleiben bewusst hellgrau, damit sie nach dem Schnitt nicht stören */
  html.oyp-printing .oyp-fold { border-top-color: #c9c1ad !important; }
  html.oyp-printing .oyp-cut { border-left-color: #c9c1ad !important; }
  html.oyp-printing .oyp-hcut { border-top-color: #c9c1ad !important; }
  html.oyp-printing .oyp-foldlbl,
  html.oyp-printing .oyp-hcutlbl,
  html.oyp-printing .oyp-cutlbl { color: #c9c1ad !important; background: #fff !important; }
  /* Lagenmarke einen Ton kräftiger als die übrigen Marken: sie wird beim
     Zusammenlegen wirklich gelesen und bleibt danach auf der Seite stehen. */
  html.oyp-printing .oyp-lagelbl { color: #a9a08c !important; background: #fff !important; }
  /* Deckblatt und Hinweisfläche müssen auf S/W-Laser stehen */
  html.oyp-printing .oyp-cvtop { border-bottom-color: #21251f !important; }
  html.oyp-printing .oyp-cvname { color: #21251f !important; }
  html.oyp-printing .oyp-cvline,
  html.oyp-printing .oyp-untxt { color: #4a463c !important; }
}
