/* druck.css — Knopf „Bericht drucken / als PDF“ und die Druckfassung jeder Auswertung.
   Die Druckregeln hängen an html.druckt (setzt drucken.js vor dem Druck und nimmt es danach wieder weg),
   damit die Seite schon vor dem Druck auf Papierbreite steht und die Diagramme in dieser Breite neu zeichnet.
   A4 hochkant, 14 mm Rand: nutzbare Breite 182 mm = 688 CSS-Pixel. */

/* ---------- Knopf am Bildschirm ---------- */
.druck-knopf { gap: 8px; max-width: 100%; white-space: normal; text-align: left; line-height: 1.2; }
.druck-knopf svg { flex: none; width: 18px; height: 18px; }
.druck-knopf:focus-visible { outline: 2px solid var(--akzent, #2a78d6); outline-offset: 2px; }
.druck-kopf { display: none; }

/* eigene Seitenart „bericht“: lässt andere Druckarten einer Seite (z. B. „Liste drucken“ quer) unberührt */
@page bericht { size: A4 portrait; margin: 14mm; }

/* ---------- Seite auf Papierbreite ---------- */
html.druckt { color-scheme: light !important; background: #fff !important; overflow: visible !important; }
html.druckt body {
  width: 688px !important; max-width: none !important; margin: 0 auto !important; padding: 0 !important;
  background: #fff !important; overflow: visible !important; page: bericht;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
html.druckt *, html.druckt *::before, html.druckt *::after {
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  transition: none !important; animation-delay: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important;
  box-shadow: none !important; text-shadow: none !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
html.druckt .breite { width: 100% !important; max-width: none !important; margin-inline: 0 !important; }
html.druckt main { padding-inline: 0 !important; }

/* ---------- Was nicht aufs Papier gehört ---------- */
html.druckt .a-kopf,
html.druckt .a-fuss,
html.druckt footer,
html.druckt .ablage,
html.druckt .filter,
html.druckt .wahl,
html.druckt .knopf,
html.druckt .knoepfe,
html.druckt .tabelle-knopf,
html.druckt .tipp,
html.druckt .zeichen-liste,
html.druckt .a-zurueck,
html.druckt .fehler,
html.druckt select,
html.druckt input,
html.druckt textarea,
html.druckt label:has(> input:not([type="file"]), > select, select, input:not([type="file"])),
html.druckt [data-druck-weg],
html.druckt [data-druck-fest] { display: none !important; }

/* ---------- Berichtskopf ---------- */
html.druckt .druck-kopf {
  display: block; margin: 0 0 6mm; padding: 0 0 4mm; border-bottom: 1.5px solid #000;
  color: #000; font-size: 12px; line-height: 1.45; break-inside: avoid;
}
html.druckt .druck-kopf .dk-marke { margin: 0; font-size: 11px; letter-spacing: .02em; color: #444; }
html.druckt .druck-kopf .dk-titel { margin: 2px 0 6px; font-size: 18px; font-weight: 700; color: #000; }
html.druckt .druck-kopf .dk-zeilen { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
html.druckt .druck-kopf dt { font-weight: 650; color: #000; }
html.druckt .druck-kopf dd { margin: 0; color: #222; }

/* ---------- Titel und Abstände ---------- */
html.druckt .a-titel { padding: 0 0 4mm !important; }
html.druckt .a-titel h1, html.druckt main h1 { font-size: 26px !important; max-width: none !important; }
html.druckt .a-titel p { font-size: 13px !important; max-width: none !important; }
html.druckt .abschnitt { margin-top: 7mm !important; }
html.druckt .abschnitt > h2 { font-size: 18px !important; }
html.druckt .abschnitt > p.unter { font-size: 12.5px !important; max-width: none !important; }

/* ---------- Karten, Gitter, Kennzahlen ---------- */
html.druckt .gitter { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; gap: 10px !important; }
html.druckt .karte,
html.druckt .karte.drittel,
html.druckt .karte.zwei-drittel,
html.druckt .karte.voll { grid-column: 1 / -1 !important; }
html.druckt .karte { padding: 12px 14px 10px !important; }
html.druckt .kennzahlen { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
html.druckt .kz { padding: 10px 12px !important; }
html.druckt .kz.gross { grid-column: span 2 !important; }
html.druckt .kz .kz-wert { font-size: 22px !important; }
html.druckt .einsicht { font-size: 12.5px !important; }

/* nicht zerreißen, Überschriften nicht allein am Seitenende */
html.druckt .karte, html.druckt .kz, html.druckt figure, html.druckt .einsicht, html.druckt .legende,
html.druckt .dia, html.druckt svg, html.druckt canvas, html.druckt tr, html.druckt li { break-inside: avoid; }
html.druckt h1, html.druckt h2, html.druckt h3, html.druckt h4, html.druckt .karte-kopf,
html.druckt .abschnitt > p.unter { break-after: avoid; }
html.druckt h2, html.druckt h3, html.druckt .abschnitt > p.unter, html.druckt .karte-kopf { break-inside: avoid; }
html.druckt p { orphans: 3; widows: 3; }

/* Diagramme im Endstand */
html.druckt .dia .wachsen, html.druckt .dia .wachsen.quer { transform: none !important; }
html.druckt .dia .zeichnen { stroke-dashoffset: 0 !important; }
html.druckt .dia .einblenden { opacity: 1 !important; }
html.druckt canvas { max-width: 100%; }

/* ---------- Tabellen auf Seitenbreite ---------- */
html.druckt .tabelle-huelle { max-height: none !important; overflow: visible !important; }
html.druckt [data-lenis-prevent] { max-height: none !important; }
html.druckt table { width: 100% !important; max-width: 100% !important; table-layout: auto; }
html.druckt table.daten { font-size: 10px !important; }
html.druckt table th, html.druckt table td { white-space: normal !important; overflow-wrap: break-word; word-break: normal; hyphens: auto; padding: 3px 5px !important; }
html.druckt table th { position: static !important; background: #eeede8 !important; color: #000 !important; }
html.druckt thead { display: table-header-group; }
html.druckt tr:hover td { background: none !important; }

/* Links als normaler Text */
html.druckt main a { color: inherit !important; text-decoration: none !important; }

/* ---------- Nur auf Papier ---------- */
@media print {
  html.druckt body { width: auto !important; }
}
html.druckt table .status { font-size: inherit !important; }

/* Eingabefelder in Tabellenzeilen (z. B. Mengen einer Stückliste) sind Inhalt: als Text drucken */
html.druckt td input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html.druckt td label:has(input:not([type="checkbox"]):not([type="radio"])) {
  display: inline-block !important; border: 0 !important; background: transparent !important; padding: 0 !important;
  font: inherit !important; color: inherit !important; width: 5em; max-width: 100%; -webkit-appearance: none; appearance: none;
}
html.druckt .f-name { display: none !important; }
