/* eRechio – Rechnungsansicht /anzeigen/ (ergänzt kit.css und marke.css) */
.an-rechnung { border: 1px solid var(--linie); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2rem); margin: 1.5rem 0; background: var(--grund); max-width: none; }
.an-rechnung h2 { margin-top: .25rem; }
.an-rechnung h3 { margin-top: 1.75rem; }
.an-rechnung .bt { font-family: var(--schrift-mono); font-size: .875rem; font-weight: 400; color: var(--text-leise); white-space: nowrap; }
.an-felder { border-collapse: collapse; width: 100%; }
.an-felder th, .an-felder td { text-align: left; vertical-align: top; padding: .35rem .75rem .35rem 0; border-bottom: 1px solid var(--linie); }
.an-felder th[scope="row"] { font-weight: 600; width: 45%; }
.an-felder td { overflow-wrap: anywhere; }
.an-felder .r, .an-pos .r { text-align: right; }
.an-parteien, .an-unten { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2.5rem; }
.an-parteien > div, .an-unten > div { min-width: 0; }
.an-partei p { margin: .25rem 0; }
.an-name { font-weight: 700; }
.an-tabelle { overflow-x: auto; max-width: 100%; }
.an-pos { border-collapse: collapse; width: 100%; min-width: 34rem; }
.an-pos th, .an-pos td { padding: .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; text-align: left; }
.an-pos thead th { font-size: .875rem; color: var(--text-leise); border-bottom: 2px solid var(--linie); }
.an-summen th[scope="row"] { width: auto; font-weight: 400; }
.an-zahlbetrag th, .an-zahlbetrag td { font-weight: 700; font-size: 1.1rem; border-bottom: 2px solid var(--text); }
.an-notiz { white-space: pre-line; background: var(--flaeche); padding: .75rem 1rem; border-radius: var(--radius-klein); }
.an-anhaenge li { margin: .4rem 0; }
.an-anhaenge .btn { padding: .25rem .75rem; font-size: .875rem; }
.an-technik { margin-top: 1.5rem; overflow-wrap: anywhere; }
.status.fehler { color: var(--fehler); }
.status.ok { color: var(--erfolg); }
@media (max-width: 700px) { .an-parteien, .an-unten { grid-template-columns: 1fr; } .an-felder th[scope="row"] { width: 50%; } }
@media print {
  .an-nicht-drucken { display: none !important; }
  .an-rechnung { border: 0; padding: 0; margin: 0; }
  .an-anhaenge .btn { display: none; }
}
/* Unterpositionen (XRechnung-Erweiterung): eingerückt, leiser, Beträge nur zur Aufschlüsselung */
.an-pos tr.an-unter td { font-size: .9rem; color: var(--text-leise); border-bottom-style: dashed; }
.an-pos tr.an-t1 td:nth-child(2) { padding-left: 1.25rem; }
.an-pos tr.an-t2 td:nth-child(2) { padding-left: 2.25rem; }
.an-pos tr.an-t3 td:nth-child(2) { padding-left: 3.25rem; }
.an-pos td:first-child { white-space: nowrap; }
/* Beträge brechen nie in der Zahl um; auf schmalen Bildschirmen darf nur die Währung unter den Betrag rutschen (Millionenbeträge).
   Wörter in Betragstabellen brechen nur, wenn sie allein nicht passen (break-word statt anywhere, sonst schrumpft die Spalte auf einen Buchstaben). */
.an-felder td.nw { overflow-wrap: normal; }
.an-unten td, .an-nachlaesse td { overflow-wrap: break-word; }
@media (max-width: 30rem) { .an-felder td.nw { white-space: normal; } }
/* Positionen auf dem Handy (C9, 20.11.2026): unter 640 px je Position eine Karte (Nr. und Bezeichnung oben, darunter Menge, Einzelpreis, USt und Betrag mit Beschriftung).
   Unterpositionen sind eingerückt mit Linie links. Im Druck bleibt es die normale Tabelle mit allen Spalten. */
@media screen and (max-width: 640px) {
  .an-tabelle:has(.an-pos) { overflow: visible; }
  .an-pos { min-width: 0; display: block; }
  .an-pos thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .an-pos tbody { display: block; }
  .an-pos tr { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .75rem; padding: .75rem .75rem; margin: 0 0 .6rem; border: 1px solid var(--linie); border-radius: var(--radius-klein); }
  .an-pos tr.an-unter { border-style: dashed; border-left: 4px solid var(--linie); }
  .an-pos tr.an-t1 { margin-left: .9rem; }
  .an-pos tr.an-t2 { margin-left: 1.8rem; }
  .an-pos tr.an-t3 { margin-left: 2.7rem; }
  .an-pos td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; }
  .an-pos td.r { text-align: left; }
  .an-pos td[data-label]::before { content: attr(data-label); display: block; font-size: .875rem; color: var(--text-leise); font-weight: 400; }
  .an-pos td.an-c-nr { grid-column: 1 / -1; font-size: .875rem; color: var(--text-leise); }
  .an-pos td.an-c-nr::before { content: "Pos. "; display: inline; }
  html[lang="en"] .an-pos td.an-c-nr::before { content: "Line "; }
  .an-pos td.an-c-name { grid-column: 1 / -1; overflow-wrap: anywhere; }
  .an-pos tr.an-t1 td:nth-child(2), .an-pos tr.an-t2 td:nth-child(2), .an-pos tr.an-t3 td:nth-child(2) { padding-left: 0; }
  .an-pos td.an-c-betrag { font-weight: 700; }
  .an-pos td.nw { white-space: normal; }
  .an-pos td.r.nw { overflow-wrap: break-word; }
}
@media print {
  .an-tabelle { overflow: visible; }
  .an-pos { min-width: 0; }
}
