/* KreativBüro · E-Rechnung View. Baut auf site.css auf (Papier, Felder, Knöpfe).
   Farben: Limette für „bestanden“ und die Zahlbetrag-Zeile, Rot nur für Fehler (wie im Bild-zu-STL-Generator). */

/* ---------- Eingabe ---------- */
.er-eingabe { padding: clamp(1.25rem, 1rem + 2vw, 2.5rem); margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.er-eingabe[aria-busy="true"] .er-ablage { opacity: .6; cursor: progress; }
.er-ablage { position: relative; display: grid; gap: .35rem; justify-items: center; text-align: center; padding: clamp(1.6rem, 1rem + 3vw, 3rem) 1rem; border-radius: var(--radius); border: 2px dashed #c3ccd5; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.er-ablage:hover, .er-ablage.drueber { border-color: var(--lime-on-paper); background: var(--paper-2); }
.er-ablage input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.er-ablage:focus-within { outline: 2px solid var(--lime); outline-offset: 3px; }
.er-ablage-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--mat); color: var(--lime); margin-bottom: .3rem; }
.er-ablage-ic .icon { width: 26px; height: 26px; }
.er-ablage-text { color: var(--ink); font-size: 1.08rem; }
.er-ablage-text strong { text-decoration: underline; text-decoration-color: var(--lime-on-paper); text-underline-offset: 3px; }
.er-ablage-name { color: var(--ink-muted); overflow-wrap: anywhere; }
.er-eingabe-fuss { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; align-items: center; justify-content: space-between; margin-top: 1rem; }
.er-eingabe-fuss .hint { display: flex; gap: .45rem; align-items: center; margin: 0; font-size: .9rem; color: var(--ink-muted); }
.er-eingabe-fuss .hint .icon { color: var(--lime-on-paper); }
.er-meldung { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius); font-size: .96rem; }
.er-meldung-fehler { background: #fff6f4; box-shadow: inset 0 0 0 1.5px #e3a49b; color: #8f2318; }
.er-meldung-hinweis { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--paper-line); color: var(--ink); }

/* ---------- Ergebnis ---------- */
.er-ergebnis { padding: clamp(1.25rem, 1rem + 2.5vw, 3rem); margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); scroll-margin-top: 90px; }
.er-ergebnis h3 { font-family: var(--f-body); font-weight: 800; font-size: 1.02rem; letter-spacing: 0; margin: 0 0 .8rem; color: var(--ink); }
.er-knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-bottom: 1.5rem; }
.er-klein { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-muted); font-weight: 500; }
.er-leer { color: var(--ink-muted); font-style: italic; margin: 0; }

/* Kopf wie auf einer Rechnung: links Nummer und Parteien, rechts der Betrag */
.er-kopf { display: grid; gap: 1.2rem 2rem; grid-template-columns: minmax(0, 1fr); padding-bottom: 1.5rem; border-bottom: 2px solid var(--ink); margin-bottom: 1.5rem; }
@media (min-width: 760px) { .er-kopf { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.er-art { font-size: .9rem; color: var(--ink-muted); margin: 0 0 .3rem; font-weight: 600; }
.er-kopf h2 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); margin: 0 0 .4rem; overflow-wrap: anywhere; }
.er-kopf-meta { color: var(--ink-muted); margin: 0 0 .7rem; overflow-wrap: anywhere; }
.er-parteien { margin: 0; font-weight: 600; font-size: 1.02rem; }
.er-parteien span[aria-hidden] { color: var(--lime-on-paper); padding: 0 .2rem; }
.er-betrag { display: grid; gap: .15rem; justify-items: start; }
@media (min-width: 760px) { .er-betrag { justify-items: end; text-align: right; } }
.er-betrag > span:first-child { font-size: .9rem; color: var(--ink-muted); font-weight: 600; }
.er-betrag strong { font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.er-betrag .mono { color: var(--ink-muted); }

/* Prüfergebnis */
.er-pruefung { border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 2rem; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--paper-line); }
.er-pruefung.er-fehler { background: #fff6f4; box-shadow: inset 0 0 0 1.5px #e3a49b; }
.er-pruefung.er-ok { box-shadow: inset 0 0 0 1.5px var(--lime-on-paper); }
.er-pruefung-kopf { display: flex; gap: .9rem; align-items: flex-start; }
.er-pruefung-kopf > .icon { width: 2.1rem; height: 2.1rem; padding: .4rem; border-radius: 50%; flex: none; background: var(--mat); color: var(--lime); }
.er-fehler .er-pruefung-kopf > .icon { background: #8f2318; color: #fff; }
.er-hinweis .er-pruefung-kopf > .icon { background: var(--ink); color: #fff; }
.er-pruefung-kopf h3 { font-family: var(--f-display); font-size: 1.3rem; margin: .1rem 0 .25rem; }
.er-fehler .er-pruefung-kopf h3 { color: #8f2318; }
.er-pruefung-kopf p { margin: 0; font-size: .96rem; }
.er-punkte { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .1rem; }
.er-punkte li { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr) auto; gap: .2rem .6rem; align-items: start; padding: .55rem 0; border-top: 1px dashed var(--paper-line); font-size: .95rem; }
.er-punkte li .icon { width: 1.1rem; height: 1.1rem; margin-top: .15rem; }
.er-p-ok .icon { color: var(--lime-on-paper); }
.er-p-fehler .icon { color: #a3261b; stroke-width: 2.4; }
.er-p-fehler > span:nth-child(2) { color: #8f2318; font-weight: 600; }
.er-p-hinweis .icon { color: var(--ink); }
.er-regel { color: var(--ink-muted); font-size: .72rem; white-space: nowrap; padding-top: .2rem; }
@media (max-width: 639px) { .er-punkte li { grid-template-columns: 1.3rem minmax(0, 1fr); } .er-regel { grid-column: 2; padding-top: 0; } }
.er-bestanden { margin-top: .8rem; }
.er-bestanden summary { cursor: pointer; font-weight: 700; font-size: .93rem; color: var(--lime-on-paper); padding: .3rem 0; }
.er-bestanden summary:hover { text-decoration: underline; }
.er-pruefung-fuss { margin: .9rem 0 0; font-size: .82rem; color: var(--ink-muted); }

/* Karten Verkäufer und Käufer, Blöcke */
.er-zwei { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 2rem; }
@media (min-width: 760px) { .er-zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.er-zwei-summen { align-items: start; }
@media (min-width: 980px) { .er-zwei-summen { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); } }
.er-karte { padding: 1.1rem 1.2rem; border: 1px dashed var(--paper-line); border-radius: var(--radius); min-width: 0; }
.er-name { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; margin: 0 0 .15rem; line-height: 1.2; overflow-wrap: anywhere; }
.er-zusatz { margin: 0 0 .3rem; color: var(--ink-muted); }
.er-adresse { margin: .3rem 0 .9rem; line-height: 1.5; }
.er-block { margin-bottom: 2rem; min-width: 0; }
.er-zwei > .er-block { margin-bottom: 0; }

.er-dl { margin: 0; display: grid; gap: .45rem; }
.er-dl > div { display: grid; grid-template-columns: minmax(8.5rem, 38%) minmax(0, 1fr); gap: .8rem; font-size: .94rem; }
.er-dl dt { color: var(--ink-muted); }
.er-dl dd { margin: 0; overflow-wrap: anywhere; }
.er-dl dd.mono { font-size: .86rem; }
.er-dl-raster { gap: .45rem 2.5rem; }
@media (min-width: 760px) { .er-dl-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .er-dl > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* Tabellen */
.er-tabelle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.er-tabelle:focus-visible { outline: 2px solid var(--lime-on-paper); outline-offset: 2px; }
.er-tabelle table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
.er-zwei .er-tabelle table { min-width: 380px; }
.er-tabelle th { text-align: left; font-weight: 700; font-size: .82rem; color: var(--ink-muted); padding: .5rem .6rem; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.er-tabelle td { padding: .65rem .6rem; border-bottom: 1px dashed var(--paper-line); vertical-align: top; }
.er-tabelle th:first-child, .er-tabelle td:first-child { padding-left: 0; }
.er-tabelle th:last-child, .er-tabelle td:last-child { padding-right: 0; }
.er-tabelle .r { text-align: right; white-space: nowrap; }
.er-tabelle td.mono { font-size: .85rem; }
.er-pos-extra { display: block; font-size: .85rem; color: var(--ink-muted); margin-top: .2rem; overflow-wrap: anywhere; }
.er-hinweis-klein { font-size: .82rem; color: var(--ink-muted); margin: .5rem 0 0; }

/* Summen wie auf dem Beleg, Zahlbetrag als Limetten-Zeile */
.er-summen { margin: 0; display: grid; }
.er-summen > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; font-size: .95rem; }
.er-summen dt { color: var(--ink); }
.er-summen dd { margin: 0; }
.er-summen .er-trenn { border-top: 1px solid var(--paper-line); font-weight: 700; }
.er-summen .er-gesamt { margin-top: .4rem; padding: .6rem .8rem; background: var(--lime); color: var(--on-lime); border-radius: 2px; font-weight: 800; font-size: 1.05rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.er-summen .er-gesamt dt { color: var(--on-lime); }

.er-kopieren { font: inherit; font-family: var(--f-body); font-size: .76rem; font-weight: 700; margin-left: .4rem; padding: .1rem .5rem; border: 0; border-radius: 999px; background: var(--paper-2); color: var(--lime-on-paper); box-shadow: inset 0 0 0 1px var(--paper-line); cursor: pointer; vertical-align: 1px; }
.er-kopieren:hover { box-shadow: inset 0 0 0 1px var(--lime-on-paper); }

.er-notizen { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.er-notizen li { padding: .7rem .9rem; background: var(--paper-2); border-radius: 2px; }
.er-notizen p { margin: .1rem 0 0; font-size: .95rem; overflow-wrap: anywhere; }
.er-anhaenge { list-style: none; margin: 0; padding: 0; }
.er-anhaenge li { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .6rem 0; border-top: 1px dashed var(--paper-line); overflow-wrap: anywhere; }

.er-technik { border-top: 1px dashed var(--paper-line); padding-top: 1rem; }
.er-technik summary { cursor: pointer; font-weight: 700; padding: .3rem 0; }
.er-technik[open] summary { margin-bottom: 1rem; }
.er-xml { margin: 1.2rem 0 0; max-height: 420px; overflow: auto; white-space: pre; font-family: var(--f-mono); font-size: .74rem; line-height: 1.5; background: var(--paper-2); padding: 1rem; border-radius: 3px; }

/* Druck: nur die Rechnung */
@media print {
  .page-head, .er-eingabe, .er-knoepfe, .er-technik, .er-kopieren, .er-anhaenge button, .rechner-text, .cta-box, .article-2, .skip { display: none !important; }
  .er-ergebnis { padding: 0; margin: 0; }
  .er-pruefung { break-inside: avoid; }
  .er-tabelle { overflow: visible; }
  .er-tabelle table { min-width: 0; }
  .er-karte, .er-block, .er-tabelle tr { break-inside: avoid; }
}

/* Knöpfe über dem Ergebnis: [hidden] gegen display von .btn durchsetzen, auf dem Handy linksbündig */
.er-knoepfe [hidden] { display: none !important; }
@media (max-width: 639px) { .er-knoepfe { justify-content: flex-start; } }
