/* E-Rechnung erstellen: seiteneigene Gestaltung (calculators.css bleibt unverändert). */
.er-grid{grid-template-columns:1fr}
#formular [hidden]{display:none!important}
#formular .calc-field{margin-bottom:12px}
#formular .calc-input-wrap input:not([type=checkbox]),#formular .calc-input-wrap select{min-height:44px}
.er-link{background:none;border:0;padding:0;color:#1f6f7f;text-decoration:underline;cursor:pointer;font:inherit}
.er-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Kopf: Titel, Datenschutz-Zeile, Abschnittsnavigation */
.er-kopf h2{margin-bottom:6px}
.er-privat{display:flex;gap:8px;align-items:flex-start;margin:0 0 6px;font-size:.86rem;color:#1e5a96}
.er-privat strong{color:#164a7d}
.er-schloss{flex:none;margin-top:2px}
#formular .er-pflicht{margin:0 0 14px}
#beispiel{padding:12px 4px;margin:-12px 0}
.er-schritte{list-style:none;display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin:0 0 18px;padding:0;counter-reset:none}
.er-chip{width:100%;min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px 8px;
  border:1px solid #e2e8f0;border-radius:999px;background:#f8fafc;color:#334155;font:inherit;font-size:.86rem;font-weight:600;cursor:pointer}
.er-chip:hover{border-color:#2d8fa3;color:#1f6f7f}
.er-nr{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;
  background:#e2e8f0;color:#334155;font-size:.82rem;font-weight:700;font-variant-numeric:tabular-nums}
.er-fertig .er-nr{background:#166534;color:#fff;font-size:0}
.er-fertig .er-nr::before{content:"";width:10px;height:6px;border:solid #fff;border-width:0 0 2.5px 2.5px;transform:translateY(-1px) rotate(-45deg)}
.er-chip.er-fertig{background:#f0fdf4;border-color:#bbf7d0;color:#166534}

/* Abschnitte */
.er-schritt{border:1px solid #e2e8f0;border-radius:12px;margin:0 0 12px;scroll-margin-top:90px;background:#fff}
.er-schritt-titel{margin:0;font-size:1rem}
.er-schritt-kopf{width:100%;min-height:52px;display:flex;align-items:center;gap:12px;padding:10px 16px;background:none;border:0;
  font:inherit;font-weight:700;color:#0f1b2d;text-align:left;cursor:pointer;border-radius:12px}
.er-schritt-kopf:hover{background:#f8fafc}
.er-schritt-kopf:focus-visible,.er-chip:focus-visible{outline:2px solid #2d8fa3;outline-offset:2px}
.er-schritt-kopf::after{content:"";flex:none;width:8px;height:8px;border:solid #5b6b7f;border-width:0 2px 2px 0;transform:rotate(45deg);margin:0 4px 4px 0}
.er-schritt-kopf[aria-expanded="false"]::after{transform:rotate(-45deg);margin:0 6px 0 0}
.er-schritt-name{flex:none}
.er-schritt-info{flex:1;min-width:0;font-weight:400;font-size:.86rem;color:#5b6b7f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.er-schritt-kopf[aria-expanded="true"] .er-schritt-info{visibility:hidden}
.er-schritt-status{flex:none;font-size:.8rem;font-weight:600;color:#9a3412;margin-left:auto}
.er-fertig .er-schritt-status{color:#166534}
.er-schritt-inhalt{padding:4px 16px 6px;border-top:1px solid #eef2f6}
.er-schritt-inhalt > :first-child{margin-top:12px}

/* Feldzeilen */
.er-z{display:grid;gap:0 14px;align-items:end}
.er-z2{grid-template-columns:1fr 1fr}
.er-z3{grid-template-columns:repeat(3,1fr)}
.er-adr{grid-template-columns:2fr .8fr 1.5fr 1.4fr}
.er-check{display:flex!important;gap:10px;align-items:center;min-height:44px;font-weight:600;cursor:pointer}
.er-check input{width:20px;height:20px;flex:none;accent-color:#1f6f7f}
.er-merken{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:4px 14px 10px;margin:4px 0 12px}
#formular .er-merken .hint{margin:0}
#merkenLoeschen{margin-left:4px;padding:10px 2px}
.er-weiter-zeile{display:none}
.er-status{margin:6px 0 0}
.er-ok{color:#166534}.er-bad{color:#b91c1c}
textarea{width:100%;box-sizing:border-box;font:inherit}
#formular .calc-input-wrap textarea{min-height:64px}

/* Fehler am Feld */
#formular .er-feld-fehler{border-color:#b91c1c!important;box-shadow:0 0 0 2px rgba(185,28,28,.25);background:#fffafa}
.er-fehler-link{color:#8c3a26;text-align:left}
#fehler ul{margin:6px 0 0;padding-left:18px}
#fehler li{margin:2px 0}

/* Positionen: Tabelle am Desktop */
.er-pos-thead,.er-pos{display:grid;grid-template-columns:2.2rem minmax(10rem,1fr) 5.5rem 8.5rem 8rem 6.4rem 7.2rem 44px;gap:8px;align-items:center}
.er-pos-thead{font-size:.78rem;font-weight:700;color:#5b6b7f;padding:0 0 6px;border-bottom:1px solid #e2e8f0;margin-top:12px}
.er-r{text-align:right}
.er-pos{padding:8px 0;border-bottom:1px solid #eef2f6}
.er-pos .calc-field{margin:0!important;min-width:0}
.er-pos .calc-input-wrap input,.er-pos .calc-input-wrap select{min-width:0}
.er-pos .calc-field label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.er-pos .calc-input-wrap input,.er-pos .calc-input-wrap select{padding:9px 10px}
.er-pos .calc-input-wrap select{padding-right:24px}
.er-pos-nr{font-weight:700;color:#5b6b7f;font-variant-numeric:tabular-nums;text-align:center}
.er-pos-wort,.er-p-summe-lbl{display:none}
.er-p-summe{text-align:right;font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}
.er-weg{width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid transparent;border-radius:10px;color:#b91c1c;cursor:pointer}
.er-weg:hover{border-color:#fecaca;background:#fef2f2}
.er-pos-fuss{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0 10px}
#posNeu{min-height:44px}
.er-pos-total{margin:0;font-size:.92rem;color:#334155}
.er-pos-total strong{font-variant-numeric:tabular-nums}

/* Knopf und Ergebnis direkt darunter */
.er-los{width:100%;margin-top:6px;padding:14px;min-height:48px;font-size:1rem}
#formular .er-leer{margin:8px 0 0;text-align:center}
#ergebnis{margin-top:16px;scroll-margin-top:90px;border:1px solid #cfe0f3;border-radius:12px;padding:16px;background:#f7fbff}
#ergebnis .calc-result-head{margin-bottom:8px}
#ergebnis td{white-space:nowrap;text-align:right}
.calc-table th[scope=row]{text-align:left;font-weight:600;white-space:normal}
.er-erg-grid{display:grid;grid-template-columns:1.4fr 1fr;gap:18px;align-items:start}
.er-dl{display:flex;flex-direction:column;gap:10px}
.er-dl .calc-btn{text-align:center;min-height:48px;font-size:.95rem}
.er-rechenweg{margin-top:12px;font-size:.88rem}
.er-rechenweg summary{cursor:pointer;font-weight:600;color:#1f6f7f;min-height:44px;display:flex;align-items:center}
.er-weg-liste{font-size:.85rem;margin:4px 0 0;padding-left:18px}
.er-recht td,.er-recht th{white-space:normal}

@media(max-width:880px){
  .er-adr{grid-template-columns:7rem 1fr}
  .er-a-str,.er-a-land{grid-column:1 / -1}
  .er-z3{grid-template-columns:1fr 1fr}
  .er-pos-thead{display:none}
  .er-pos{grid-template-columns:1.2fr 1.5fr 1.4fr 1.15fr;grid-template-areas:"nr summe summe weg" "bez bez bez bez" "menge einheit preis satz";
    gap:6px 8px;border:1px solid #e2e8f0;border-radius:10px;padding:6px 10px 10px;margin-bottom:10px}
  .er-pos-nr{grid-area:nr;text-align:left;font-size:.88rem;color:#0f1b2d}
  .er-pos-wort{display:inline}
  .er-p-bez{grid-area:bez}.er-p-menge{grid-area:menge}.er-p-einheit{grid-area:einheit}.er-p-preis{grid-area:preis}.er-p-satz{grid-area:satz}
  .er-p-summe{grid-area:summe;font-size:.88rem;min-width:0}
  .er-p-summe-lbl{display:inline;font-weight:400;color:#5b6b7f}
  .er-weg{grid-area:weg;justify-self:end}
  .er-pos .calc-field label{position:static;width:auto;height:auto;clip:auto;font-size:.74rem;font-weight:600;color:#5b6b7f;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .er-pos .calc-input-wrap input,.er-pos .calc-input-wrap select{padding:9px 7px}
  .er-pos .calc-input-wrap select{padding-right:20px}
  .er-erg-grid{grid-template-columns:1fr}
}
@media(max-width:720px){
  #formular.calc-card{padding:16px 12px}
  .er-chip{flex-direction:column;gap:2px;border-radius:12px;padding:6px 2px;font-size:.7rem;font-weight:600}
  .er-schritte{gap:4px}
  .er-schritt-kopf{padding:10px 12px;gap:10px}
  .er-schritt-inhalt{padding:4px 12px 6px}
  .er-schritt-kopf[aria-expanded="true"] .er-schritt-info{display:none}
  .er-schritt-kopf{flex-wrap:wrap}
  .er-schritt-name{flex:1}
  .er-schritt-info{order:5;flex-basis:100%;padding-left:36px}
  .er-weiter-zeile{display:flex;justify-content:flex-end;margin:4px 0 8px}
  .er-weiter{min-height:44px}
}
@media(max-width:560px){
  .er-pos{grid-template-columns:minmax(0,.8fr) minmax(0,1.35fr) minmax(0,1.15fr) minmax(0,1fr);gap:6px;padding:6px 8px 10px}
  .er-pos-nr{white-space:nowrap}
  .er-pos{align-items:end}
  .er-pos-nr,.er-p-summe,.er-weg{align-self:center}
  .er-pos .calc-field label{white-space:normal;line-height:1.2;overflow:visible}
  .er-p-summe-lbl{display:none}
  .er-pos .calc-input-wrap input{padding:9px 6px}
  .er-pos .calc-input-wrap select{-webkit-appearance:none;appearance:none;padding:9px 18px 9px 6px;
    background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b6b7f' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 6px center}
  .er-schritt-inhalt{padding:4px 10px 6px}
  .er-z2,.er-z3{grid-template-columns:1fr}
  .er-adr{grid-template-columns:6.5rem 1fr}
}
