/* =====================================================================
   Druck / PDF: feste A4-Seiten, jede mit eigenem Layout
   ===================================================================== */
#druck { display: none; }

@page { size: A4 portrait; margin: 0; }

.pg { width: 210mm; height: 297mm; box-sizing: border-box; padding: 12mm 14mm 10mm; display: grid; grid-template-rows: auto 1fr auto; gap: 6mm;
  background: #FFFFFF; color: #0F172A; font: 9.5pt/1.45 'Plus Jakarta Sans', system-ui, sans-serif; overflow: hidden;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; break-after: page; page-break-after: always; }
.pg:last-child { break-after: auto; page-break-after: auto; }
.pg * { box-sizing: border-box; }

/* Kopf- und Fußzeile */
.pg-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 10mm; padding-bottom: 3mm; border-bottom: 0.6mm solid #0F172A; white-space: nowrap; }
.pg-brand { display: flex; align-items: center; gap: 2mm; font-weight: 700; font-size: 10pt; }
.pg-brand svg { width: 6.5mm; height: 6.5mm; display: block; flex: none; }
.pg-brand i { width: 6mm; height: 6mm; border-radius: 1.4mm; background: #0F172A; color: #FFFFFF; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 8.5pt; }
.pg-title { font-weight: 700; font-size: 10.5pt; }
.pg-num { justify-self: end; color: #475569; font-size: 8.5pt; }
.pg-foot { border-top: 0.3mm solid #CBD5E1; padding-top: 2.5mm; color: #475569; font-size: 7.5pt; height: 7mm; white-space: nowrap; overflow: hidden; }
.pg-body { display: flex; flex-direction: column; gap: 5mm; min-height: 0; overflow: hidden; }
.d-wrap { flex: none; }
/* Messmodus: Seiten werden unsichtbar außerhalb des Bildschirms aufgebaut und vermessen */
#druck.messen { display: block !important; position: absolute; left: -10000px; top: 0; }

/* Grundelemente */
.d-intro h1 { font-size: 20pt; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 1.5mm; }
.d-intro p, .d-lead { color: #475569; margin: 0; font-size: 10pt; }
.d-block { break-inside: avoid; page-break-inside: avoid; }
.d-block h2 { font-size: 11.5pt; margin: 0 0 2.5mm; display: flex; align-items: baseline; gap: 3mm; }
.d-block h2 small { color: #475569; font-weight: 500; font-size: 9pt; }
.d-note { color: #475569; font-size: 8.5pt; margin: 0; }

/* Angaben */
.d-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 6mm; margin: 0; background: #F4F6F9; border-radius: 2.5mm; padding: 4mm 5mm; }
.d-facts div { display: grid; grid-template-columns: 38mm 1fr; gap: 2mm; }
.d-facts dt { color: #475569; }
.d-facts dd { margin: 0; font-weight: 600; }

/* Diagramm */
.d-chartblock { border: 0.3mm solid #E2E8F0; border-radius: 2.5mm; padding: 4mm 5mm; }
.d-takeaway { font-weight: 600; font-size: 10.5pt; margin: 0 0 3mm; }
.d-chart { width: 100%; height: auto; display: block; }
.d-legend { list-style: none; display: flex; gap: 6mm; padding: 0; margin: 2mm 0 3mm; color: #475569; font-size: 8.5pt; }
.d-legend li { display: flex; align-items: center; gap: 1.5mm; }
.d-legend i { width: 3mm; height: 3mm; border-radius: 0.8mm; display: inline-block; }
.d-mini { width: 100%; border-collapse: collapse; font-size: 8.5pt; font-variant-numeric: tabular-nums; }
.d-mini th, .d-mini td { padding: 1.4mm 2mm; border-bottom: 0.2mm solid #E2E8F0; text-align: right; }
.d-mini th:first-child { text-align: left; }
.d-mini thead th { color: #475569; font-weight: 600; }

/* Steuer-Kacheln */
.d-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2.5mm; }
.d-tiles div { background: #F4F6F9; border-radius: 2mm; padding: 3mm 3.5mm; }
.d-tiles span { display: block; color: #475569; font-size: 8pt; }
.d-tiles b { font-size: 11.5pt; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Wertetabelle */
.d-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.d-table th, .d-table td { padding: 2.2mm 3mm; border-bottom: 0.2mm solid #E2E8F0; }
.d-table thead th { text-align: right; color: #475569; font-weight: 600; font-size: 8.5pt; }
.d-table tbody th { text-align: left; font-weight: 500; color: #334155; }
.d-table td { text-align: right; font-weight: 600; }
.d-table tr.sub th { padding-left: 7mm; font-size: 8.5pt; }
.d-table tr.sub td { font-weight: 500; color: #475569; font-size: 8.5pt; }
.d-table tr.total th, .d-table tr.total td { border-bottom: 0; border-top: 0.5mm solid #0F172A; font-size: 11pt; font-weight: 800; color: #0F172A; }

/* Formeln & Fakten */
.d-formulas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
.d-formulas div { background: #F4F6F9; border-radius: 2.5mm; padding: 3.5mm 4mm; display: grid; gap: 1mm; align-content: start; }
.d-formulas span { color: #475569; font-weight: 600; font-size: 8.5pt; }
.d-formulas b { font-size: 15pt; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.d-formulas b.t { font-size: 11pt; }
.d-formulas p { margin: 0; color: #475569; font-size: 8pt; }
.d-factline { margin: 0; font-size: 8.5pt; color: #475569; }
.d-factline b { color: #0F172A; }
.d-cutnote { display: flex; align-items: center; gap: 2mm; margin: 0 0 2mm; font-size: 8pt; color: #475569; }
.d-cutnote i { width: 3mm; height: 3mm; background: #FBE3D9; box-shadow: inset 0.8mm 0 0 #D95926; display: inline-block; }

/* Jahrestabelle: feste Zeilenhöhe, damit die Aufteilung auf Seiten verlässlich passt */
.d-years { width: 100%; border-collapse: collapse; font-size: 8pt; font-variant-numeric: tabular-nums; }
.d-years th, .d-years td { height: 5.6mm; padding: 0 2mm; text-align: right; border-bottom: 0.2mm solid #E2E8F0; white-space: nowrap; }
.d-years thead th { background: #0F172A; color: #FFFFFF; font-weight: 600; height: 6mm; border-bottom: 0; }
.d-years thead tr.grp th { text-align: center; font-weight: 700; border-bottom: 0.2mm solid #334155; }
.d-years thead tr.grp th:first-child { text-align: left; }
.d-years tbody th { text-align: left; font-weight: 700; }
.d-years .edge { border-right: 0.3mm solid #CBD5E1; }
.d-years thead .edge { border-right-color: #334155; }
.d-years tr.cut td, .d-years tr.cut th { background: #FBE3D9; }
.d-years tr.cut th { box-shadow: inset 0.8mm 0 0 #D95926; }

/* ------------------------------------------------ Druck */
@media print {
  html, body { background: #FFFFFF !important; margin: 0; }
  body > *:not(#druck) { display: none !important; }
  #druck { display: block !important; }
}

/* ------------------------------------------------ Vorschau im Browser (#druckvorschau) */
body.druckvorschau { background: #CBD5E1; }
body.druckvorschau > *:not(#druck) { display: none !important; }
body.druckvorschau #druck { display: grid; justify-content: center; gap: 10mm; padding: 10mm 0; }
body.druckvorschau .pg { box-shadow: 0 4px 24px rgba(15, 23, 42, .25); }

/* Zusatzinhalte */
.d-block h2 small { font-weight: 500; }

/* Rentenkarten links, Säulendiagramm rechts */
.d-rente-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 4mm; align-items: stretch; }
.d-saeulen-box { margin: 0; display: grid; align-content: start; gap: 1.5mm; border: 0.3mm solid #E2E8F0; border-radius: 2.5mm; padding: 3mm; }
.d-saeulen-box figcaption { font-size: 8.5pt; font-weight: 600; color: #475569; }
.d-saeulen-box .d-saeulen { width: 100%; height: auto; }
.d-saeulen-box .d-legend { font-size: 7.5pt; gap: 1mm 3mm; }

/* =====================================================================
   Erste Seite (neu): Antwort zuerst, helle Karten, Angaben + Annahmen kompakt
   ===================================================================== */
.d-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; padding-bottom: 1mm; }
.d-intro .d-meta { text-align: right; font-size: 8.5pt; color: #475569; line-height: 1.5; white-space: nowrap; }

.d-fazit { margin: 0 0 3.5mm; padding: 3mm 4mm; background: #F1F5F9; border-left: 1.2mm solid #0F172A; border-radius: 0 2mm 2mm 0; font-weight: 700; font-size: 11pt; line-height: 1.35; }

.d-karten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3mm; }
.d-karten-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-karte { border: 0.3mm solid #E2E8F0; border-top: 1.2mm solid #3987E5; border-radius: 2mm; padding: 3.5mm 4mm 3mm; display: flex; flex-direction: column; min-width: 0; }
.d-karte.d-beste { border-top-color: #199E70; background: #F4FBF8; }
.d-karte-name { font-weight: 700; font-size: 9pt; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-karte > b { font-size: 21pt; line-height: 1.1; letter-spacing: -.02em; margin-top: 1.5mm; font-variant-numeric: tabular-nums; }
.d-karte-sub { font-size: 7.5pt; color: #64748B; }
.d-karte-aus { font-size: 8pt; font-weight: 600; color: #334155; margin: 1mm 0 2.5mm; }
.d-beste-tag { margin: 2.5mm -4mm -3mm; padding: 1.3mm 4mm; background: #199E70; color: #FFFFFF; font-size: 7.5pt; font-weight: 700; border-radius: 0 0 1.6mm 1.6mm; }
.d-karte dl { margin: auto 0 0; border-top: 0.2mm solid #E2E8F0; padding-top: 2mm; display: grid; gap: 1mm; font-size: 8pt; }
.d-karte dl div { display: flex; justify-content: space-between; gap: 2mm; }
.d-karte dt { color: #64748B; white-space: nowrap; }
.d-karte dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.d-grundlagen { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 8mm; border-top: 0.3mm solid #E2E8F0; padding-top: 4mm; }
.d-grundlagen h2 { font-size: 10.5pt; }
.d-list { margin: 0; display: grid; gap: 1.2mm; font-size: 8.5pt; }
.d-list div { display: grid; grid-template-columns: 46mm 1fr; gap: 2mm; }
.d-list dt { color: #64748B; }
.d-list dd { margin: 0; font-weight: 600; }
.d-annahmen { width: 100%; border-collapse: collapse; font-size: 8.5pt; font-variant-numeric: tabular-nums; }
.d-annahmen th, .d-annahmen td { padding: 1.2mm 0; border-bottom: 0.2mm solid #E2E8F0; text-align: left; }
.d-annahmen thead th { color: #64748B; font-weight: 600; font-size: 8pt; }
.d-annahmen tbody th { font-weight: 600; }
.d-annahmen td:nth-child(2), .d-annahmen th:nth-child(2) { text-align: right; padding-right: 5mm; }
.d-option { margin: 2mm 0 0; font-size: 8pt; color: #334155; }
