/* Ersparnisrechner. Tabelle aus Grid statt <table>, weil je Zeile ein
   Eingabefeld und zwei Textabsaetze stehen — in einer echten Tabelle
   braeche das auf dem Handy. role="table" liefert die Semantik nach. */

/* ------------------------------------------------------------ Kopfwerte */

.er-kopfwerte {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--linie);
}

.er-feld > label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.er-eingabe {
  display: flex;
  align-items: center;
  gap: 7px;
}

.er-eingabe input,
.er-eingabe select {
  font: inherit;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 7px 10px;
  width: 110px;
  border: 1px solid var(--linie);
  border-radius: 8px;
  background: var(--karte);
  color: var(--tinte);
}
.er-eingabe select { width: auto; text-align: left; }

.er-eingabe input:focus-visible,
.er-eingabe select:focus-visible {
  outline: 2px solid var(--wein);
  outline-offset: 1px;
}

.er-einheit {
  font-size: 12.5px;
  color: var(--matt2);
  white-space: nowrap;
}

.er-hilfe {
  font-size: 12px;
  color: var(--matt2);
  line-height: 1.5;
  margin: 6px 0 0;
}

/* -------------------------------------------------------------- Tabelle */

.er-tabelle { margin-top: 14px; }

.er-zeile {
  display: grid;
  grid-template-columns: 1fr 190px 130px;
  gap: 14px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--linie-fein);
}

.er-kopf {
  padding: 0 0 8px;
  font-size: 11.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--matt2);
  border-bottom: 1px solid var(--linie);
}

.er-rechts { text-align: right; }

.er-posten b {
  display: block;
  font-size: 14.5px;
  margin-bottom: 3px;
}
.er-text {
  display: block;
  font-size: 13px;
  color: var(--matt);
  line-height: 1.55;
}
/* Warum VINORUM den Posten ersetzt — leiser als der Posten selbst, weil es
   die Behauptung ist und nicht die Rechnung. */
.er-warum {
  display: block;
  font-size: 12.5px;
  color: var(--wein);
  line-height: 1.5;
  margin-top: 4px;
}

.er-betrag {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-weight: 600;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 2px;
}

/* Ein auf null gesetzter Posten bleibt stehen und wird gedaempft: Der Leser
   soll sehen, dass er ihn selbst ausgeschaltet hat. */
.er-zeile-aus .er-posten b,
.er-zeile-aus .er-text,
.er-zeile-aus .er-warum { opacity: .5; }
.er-zeile-aus .er-betrag { color: var(--matt2); font-weight: 500; }

/* --------------------------------------------------------- Fuss und Summe */

.er-fuss-knoepfe {
  display: flex;
  align-items: center;
  gap: 14px 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.er-jahre {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--matt);
}
.er-jahre input {
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 64px;
  padding: 6px 9px;
  border: 1px solid var(--linie);
  border-radius: 8px;
  background: var(--karte);
  color: var(--tinte);
}
.er-jahre input:focus-visible { outline: 2px solid var(--wein); outline-offset: 1px; }

.er-summe {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--linie);
}
.er-summe-zeile {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  font-size: 14px;
}
.er-summe-zeile b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.er-abzug { color: var(--matt); }

.er-netto {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--linie);
  font-size: 16px;
}
.er-netto b {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-weight: 600;
  font-size: 27px;
  color: var(--wein);
}
/* Ein negatives Ergebnis wird nicht rot angeschrien — es wird ruhig
   dargestellt und im Text erklaert. */
.er-netto-minus b { color: var(--tinte); }

.er-erklaerung {
  font-size: 13.5px;
  color: var(--matt);
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: 78ch;
}
.er-cta {
  margin: 14px 0 8px;
  text-align: center;
}
.er-cta-btn {
  display: inline-block;
  background: #232323;
  color: #fff;
  border-radius: 9px;
  padding: 12px 22px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
}
.er-fussnote {
  font-size: 12.5px;
  color: var(--matt2);
  line-height: 1.55;
  margin: 10px 0 0;
  max-width: 82ch;
}

@media (max-width: 900px) {
  .er-kopfwerte { grid-template-columns: 1fr; gap: 14px; }
  .er-zeile { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .er-kopf  { display: none; }
  .er-posten { grid-column: 1 / -1; }
  .er-annahme { justify-self: start; }
  .er-betrag { justify-self: end; align-self: center; padding-top: 0; }
}
