/* ============================================================
   meinprozentrechner.de — Komponenten
   Farben ausschließlich über Token aus tokens.css.
   Keine Schatten. Radius überall 4px. Linien statt Ebenen.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--f-cond);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.005em;
  /* Prozentvergleichsrechner darf das Layout nicht sprengen */
  overflow-wrap: break-word;
  hyphens: auto;
}

p { margin: 0; }

a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* --- Sichtbarer Fokus, überall, ohne Ausnahme --- */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.nur-screenreader {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.sprungmarke {
  position: absolute; left: var(--s4); top: var(--s2);
  transform: translateY(-200%);
  background: var(--brand); color: var(--brand-ink);
  padding: var(--s3) var(--s4); border-radius: var(--radius);
  z-index: 20; font-family: var(--f-cond); font-weight: 600;
}
.sprungmarke:focus { transform: translateY(0); }

.bund {
  width: 100%;
  max-width: var(--bund);
  margin-inline: auto;
  padding-inline: var(--s4);
}
@media (min-width: 700px) { .bund { padding-inline: var(--s5); } }

/* ============================================================
   Kopfzeile
   ============================================================ */
.kopf {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.kopf__innen {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 60px;
}
.marke {
  display: flex; align-items: center; gap: var(--s2);
  font-family: var(--f-cond); font-weight: 700; font-size: 18px;
  color: var(--ink); text-decoration: none;
  margin-right: auto;
  padding: var(--s2) 0;
}
.marke__zeichen { width: 28px; height: 28px; flex: none; }
.marke__wort { letter-spacing: -0.01em; }
.marke__wort span { color: var(--ink-3); font-weight: 600; }

.navi { display: none; }
@media (min-width: 940px) { .navi { display: flex; align-items: center; gap: var(--s1); } }

.navi a, .navi summary, .knopf-schlicht {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s3);
  font-family: var(--f-cond); font-weight: 600; font-size: 16px;
  color: var(--ink-2); text-decoration: none;
  border-radius: var(--radius);
  background: none; border: 0; cursor: pointer;
}
.navi a:hover, .navi summary:hover, .knopf-schlicht:hover { color: var(--ink); background: var(--paper); }

.menue { position: relative; }
.menue > summary { list-style: none; }
.menue > summary::-webkit-details-marker { display: none; }
.menue > summary::after {
  content: ''; width: 7px; height: 7px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.menue[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.menue[open] > summary { color: var(--ink); background: var(--paper); }

.mega {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 15;
  width: min(660px, calc(100vw - 48px));
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s4);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--s5);
}
.mega a {
  display: block; min-height: 0; padding: var(--s2) var(--s2);
  font-family: var(--f-sans); font-weight: 400; font-size: 16px;
  color: var(--ink-2);
}
.mega a b { display: block; font-family: var(--f-cond); font-weight: 600; color: var(--ink); font-size: 16px; }
.mega a span { font-size: 14px; color: var(--ink-3); }
.mega a:hover { background: var(--brand-soft); }

.kopf-werkzeuge { display: flex; align-items: center; gap: var(--s1); margin-left: var(--s2); }
.knopf-schlicht { min-width: var(--tap); justify-content: center; }
.knopf-schlicht svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 939px) { .knopf-schlicht .knopf__text { display: none; } }
@media (min-width: 940px) { #suche .knopf__text { display: none; } }

.mobilmenue { margin-left: auto; }
@media (min-width: 940px) { .mobilmenue { display: none; } }
.mobilmenue > summary {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap);
  border-radius: var(--radius); cursor: pointer; list-style: none; color: var(--ink-2);
}
.mobilmenue > summary::-webkit-details-marker { display: none; }
.mobilmenue > summary svg { width: 22px; height: 22px; }
.mobilmenue__inhalt {
  position: absolute; left: 0; right: 0; z-index: 15;
  background: var(--card); border-bottom: 1px solid var(--rule);
  padding: var(--s3) var(--s4) var(--s5);
}
.mobilmenue__inhalt a {
  display: block; min-height: var(--tap); line-height: var(--tap);
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-cond); font-weight: 600; color: var(--ink); text-decoration: none;
}

/* ============================================================
   Rechner — das Kernstück, ohne Vorschaltung über der Falz
   ============================================================ */
.rechnerzone { padding-block: var(--s4) var(--s6); }
@media (min-width: 700px) { .rechnerzone { padding-block: var(--s5) var(--s7); } }

.rechnerkarte {
  max-width: 780px; margin-inline: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

/* Reiterleiste: waagerecht scrollbar, damit sichtbar bleibt, dass es sechs gibt */
.reiter {
  display: flex; gap: 0;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  border-bottom: 1px solid var(--rule);
  scrollbar-width: none;
}
.reiter::-webkit-scrollbar { display: none; }
.reiter button {
  flex: none; scroll-snap-align: start;
  min-height: var(--tap); padding: 0 var(--s4);
  background: none; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--f-cond); font-weight: 600; font-size: 16px;
  color: var(--ink-3); cursor: pointer; white-space: nowrap;
}
.reiter button:hover { color: var(--ink); }
.reiter button[aria-selected='true'] {
  color: var(--ink); border-bottom-color: var(--brand); background: var(--brand-soft);
}

.rechner { padding: var(--s5) var(--s4) var(--s4); }
@media (min-width: 700px) { .rechner { padding: var(--s6) var(--s6) var(--s5); } }

/* Der Satz mit Lücken statt eines Formulars mit Feldpaaren */
.satz {
  font-size: 20px; line-height: 2.2; color: var(--ink);
  margin-bottom: var(--s5);
  max-width: 34ch;
}
@media (min-width: 700px) { .satz { font-size: 23px; line-height: 2.3; max-width: none; } }

.satz input[type='text'] {
  display: inline-block;
  min-width: 4.5em; width: auto;
  height: var(--field-h);
  padding: 0 var(--s3);
  font: 400 16px/1 var(--f-mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  vertical-align: middle;
}
.satz input[type='text']:hover { border-color: var(--ink-2); }
.satz input[type='text']:focus { background: var(--card); border-color: var(--brand); }
.satz input[aria-invalid='true'] { border-color: var(--negative); }
.satz input::placeholder { color: var(--ink-3); }

/* Auf-/Abschlag: zwei Schalter statt eines Auswahlmenüs */
.schalter { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; vertical-align: middle; }
.schalter input { position: absolute; opacity: 0; pointer-events: none; }
.schalter label {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--field-h); min-width: 88px; padding: 0 var(--s3);
  font: 600 16px/1 var(--f-cond); color: var(--ink-2);
  background: var(--card); cursor: pointer;
}
.schalter label + input + label { border-left: 1px solid var(--rule-strong); }
.schalter input:checked + label { background: var(--brand); color: var(--brand-ink); }
.schalter input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: -3px; }

/* --- Ergebnis: Zahl, Satz, Rechenweg, Formel --- */
output { display: block; }

.ergebnis {
  background: var(--brand-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s4);
}
@media (min-width: 700px) { .ergebnis { padding: var(--s5); } }

.ergebnis__zahl {
  display: flex; align-items: center; gap: var(--s2);
  font: 400 clamp(2.25rem, 8vw, 3.25rem)/1.05 var(--f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: var(--s3);
  overflow-wrap: anywhere;
}
.ergebnis[data-ton='positiv'] .ergebnis__zahl { color: var(--positive); }
.ergebnis[data-ton='negativ'] .ergebnis__zahl { color: var(--negative); }
.pfeil { width: 0.7em; height: 0.7em; flex: none; }

.ergebnis__satz {
  font-size: 17px; font-weight: 500; color: var(--ink);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
  max-width: 60ch;
}

.rechenweg {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3);
  margin: var(--s3) 0 0; font-size: 14px;
}
.rechenweg dt { color: var(--ink-3); font-family: var(--f-cond); font-weight: 600; }
.rechenweg dd {
  margin: 0; font-family: var(--f-mono); color: var(--ink-2);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .rechenweg { grid-template-columns: 1fr; gap: 0; }
  .rechenweg dd { margin-bottom: var(--s2); }
}

/* Fehler und Warnungen erscheinen im selben output, werden also vorgelesen */
.meldung {
  display: flex; gap: var(--s3); align-items: flex-start;
  background: var(--alert-soft);
  border: 1px solid var(--negative);
  border-radius: var(--radius);
  padding: var(--s4);
  color: var(--negative);
  font-weight: 500;
}
.meldung__icon { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.meldung p { color: var(--ink); font-weight: 400; }

/* --- Aktionen unter dem Ergebnis --- */
.aktionen {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  margin-top: var(--s4); align-items: center;
}
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s4);
  font: 600 16px/1 var(--f-cond);
  border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--card); color: var(--ink);
  cursor: pointer;
}
.knopf:hover { border-color: var(--ink-2); background: var(--paper); }
.knopf svg { width: 18px; height: 18px; }
.knopf--haupt { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.knopf--haupt:hover { background: var(--brand); border-color: var(--brand); filter: brightness(1.12); }

@media (max-width: 560px) {
  .aktionen .knopf { padding: 0 var(--s3); font-size: 15px; flex: 1 1 auto; }
  .aktionen .knopf--haupt { flex-basis: 100%; }
}

.hinweis {
  font-size: 15px; color: var(--positive); font-weight: 500;
  margin-left: var(--s1);
}

/* ============================================================
   Fließtext-Abschnitte
   ============================================================ */
.abschnitt { padding-block: var(--s6); border-top: 1px solid var(--rule); }
.abschnitt:first-of-type { border-top: 0; }
@media (min-width: 700px) { .abschnitt { padding-block: var(--s7); } }

.abschnitt > * + * { margin-top: var(--s4); }
.abschnitt h2 { font-size: clamp(1.4rem, 3.4vw, 1.85rem); scroll-margin-top: var(--s5); }
.abschnitt h3 { font-size: 1.125rem; }
.abschnitt p { max-width: 68ch; color: var(--ink-2); }
.abschnitt p strong { color: var(--ink); font-weight: 500; }

.titelzone { padding-block: 0 var(--s6); }
.titelzone h1 {
  font-size: clamp(2.1rem, 6.5vw, 3rem); font-weight: 700;
  letter-spacing: -0.02em;
}
.titelzone p { max-width: 62ch; margin-top: var(--s3); color: var(--ink-2); }

/* Schnellrechnungen */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.chip {
  min-height: var(--tap); padding: 0 var(--s4);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  font: 400 15px/1 var(--f-mono); font-variant-numeric: tabular-nums;
  cursor: pointer; display: inline-flex; align-items: center;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* Kachelraster der Fachrechner */
.kacheln { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 620px) { .kacheln { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .kacheln { grid-template-columns: repeat(3, 1fr); } }
.kachel {
  display: block; padding: var(--s4);
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--card); text-decoration: none; color: var(--ink);
}
.kachel:hover { border-color: var(--brand); }
.kachel b { display: block; font: 600 17px/1.2 var(--f-cond); margin-bottom: var(--s1); }
.kachel span { font-size: 15px; color: var(--ink-3); }

/* Inhaltsverzeichnis */
.inhalt { counter-reset: pos; list-style: none; padding: 0; margin: 0; column-gap: var(--s6); }
@media (min-width: 700px) { .inhalt { columns: 2; } }
.inhalt li { counter-increment: pos; break-inside: avoid; border-bottom: 1px solid var(--rule); }
.inhalt a {
  display: flex; gap: var(--s3); align-items: baseline;
  min-height: var(--tap); padding-block: var(--s2);
  text-decoration: none; color: var(--ink);
}
.inhalt a::before {
  content: counter(pos, decimal-leading-zero);
  font: 400 14px/1 var(--f-mono); color: var(--ink-3); flex: none; width: 2em;
}
.inhalt a:hover { color: var(--brand); }

/* Formelblock */
.formel {
  font: 400 16px/1.6 var(--f-mono);
  background: var(--brand-soft); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s4); overflow-x: auto; max-width: 640px;
  font-variant-numeric: tabular-nums;
}
.formel b { display: block; font: 600 14px/1.4 var(--f-cond); color: var(--ink-3); margin-bottom: var(--s2); }

/* Beispieltabelle */
.tabellenrahmen { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
caption { text-align: left; padding: var(--s3) var(--s4); color: var(--ink-3); font-size: 15px; }
th, td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); }
th { font: 600 15px/1.3 var(--f-cond); color: var(--ink-2); }
td { color: var(--ink-2); }
td.zahl, th.zahl { font-family: var(--f-mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); white-space: nowrap; }
td.weg, th.weg { font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
th.zahl, th.weg { font-family: var(--f-cond); }
table th[scope='row'] { font-family: var(--f-sans); font-weight: 400; color: var(--ink); width: 34%; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* Dreieck Grundwert / Prozentsatz / Prozentwert */
.dreieck { width: 100%; max-width: 420px; height: auto; }
.dreieck text { font-family: var(--f-cond); font-weight: 600; font-size: 15px; fill: var(--ink); }
.dreieck .gross { font-family: var(--f-mono); font-weight: 400; font-size: 22px; fill: var(--ink); }
.dreieck .op { font-family: var(--f-sans); font-weight: 400; font-size: 13px; fill: var(--ink-3); }
.dreieck line, .dreieck path { stroke: var(--rule-strong); stroke-width: 1.5; fill: none; }

/* Häufige Fragen — sichtbar, nicht eingeklappt */
.fragen { display: grid; gap: var(--s5); }
@media (min-width: 860px) { .fragen { grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s6); } }
.frage h3 { margin-bottom: var(--s2); }
.frage p { font-size: 16px; }

.zweispalt { display: grid; gap: var(--s5); }
@media (min-width: 860px) { .zweispalt { grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: start; } }

.pruefdatum { font-size: 15px; color: var(--ink-3); }

/* Fußzeile */
.fuss { border-top: 1px solid var(--rule); background: var(--card); padding-block: var(--s6); margin-top: var(--s6); }
.fuss__raster { display: grid; gap: var(--s5); grid-template-columns: 1fr; }
@media (min-width: 700px) { .fuss__raster { grid-template-columns: 2fr 1fr 1fr; gap: var(--s6); } }
.fuss h2 { font-size: 15px; color: var(--ink-3); margin-bottom: var(--s2); }
.fuss ul { list-style: none; margin: 0; padding: 0; }
.fuss li a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink-2); text-decoration: none; font-size: 16px; }
.fuss li a:hover { color: var(--brand); text-decoration: underline; }
.fuss__klein { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-3); }

/* Ohne JavaScript */
.ohne-js { margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--rule-strong); border-radius: var(--radius); font-size: 15px; color: var(--ink-2); }

/* Bewegung nur, wenn erwünscht */
@media (prefers-reduced-motion: no-preference) {
  .kachel, .chip, .knopf, .reiter button { transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease; }
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Brotkrumen auf den Fachseiten */
.brotkrumen { font-size: 15px; color: var(--ink-3); margin-bottom: var(--s3); }
.brotkrumen a { color: var(--ink-2); text-decoration: none; }
.brotkrumen a:hover { color: var(--brand); text-decoration: underline; }
.brotkrumen span[aria-hidden] { padding-inline: var(--s1); }

/* Abstände innerhalb der zweispaltigen Blöcke */
.zweispalt > div > * + * { margin-top: var(--s3); }
.zweispalt > div > p + h3 { margin-top: var(--s5); }
.zweispalt > div > h3 + p { margin-top: var(--s2); }

/* --- WordPress-Anpassung -------------------------------------------------
   Der Theme-Kopf ist höher als im statischen Entwurf. Auf schmalen Displays
   wird deshalb oben etwas Luft weggenommen, damit der komplette Rechner
   einschliesslich Knopfreihe ohne Scrollen sichtbar bleibt.              */
@media (max-width: 480px) {
  .rechnerzone { padding-top: var(--s2, 8px); }
  .rechner { padding: var(--s4, 16px) var(--s4, 16px) var(--s3, 12px); }
  .aktionen { gap: var(--s2, 8px); }
}
/* Kadence setzt auf Formularen eigene Abstände — die hier gewinnen. */
.rechnerkarte form.rechner { margin: 0; }
.rechnerkarte .satz { margin-top: 0; }

/* ==========================================================================
   WordPress-Integration
   Kadence bringt eigene Farben und Abstände mit. Die Regeln hier sorgen dafür,
   dass Inhalt aus dem Plugin lesbar bleibt und der Rechner als Hero wirkt.
   ========================================================================== */

/* --- Tabellen: Kadence rendert sie fast unsichtbar ---------------------- */
.entry-content table,
.wp-block-table table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.entry-content table th,
.wp-block-table table th {
  background: var(--panel-2, #EAEEEB);
  color: var(--ink, #121A17);
  font-family: var(--f-cond, "Fira Sans Condensed"), sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--rule-strong, #7E8C85);
}
.entry-content table td,
.wp-block-table table td {
  color: var(--ink, #121A17);          /* war das helle --ink-2 auf Weiss */
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule, #DCE3DF);
}
.entry-content table tr:last-child td { border-bottom: 0; }
.wp-block-table { overflow-x: auto; }

/* --- Fliesstext: nie heller als --ink-2 auf hellem Grund ---------------- */
.entry-content p,
.entry-content li { color: var(--ink, #121A17); }
.entry-content .einleitung { font-size: 1.125em; color: var(--ink-2, #41504A); }

/* --- Formelzeilen als eigenes Element kenntlich ------------------------- */
.entry-content .formelzeile {
  font-family: var(--f-mono, "Fira Mono"), ui-monospace, monospace;
  background: var(--panel-2, #EAEEEB);
  border-left: 3px solid var(--brand, #0E6B4E);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.7;
  overflow-x: auto;
}

/* --- Rechner als Hero: mittig, begrenzte Breite, Luft darum ------------- */
.entry-content .rechnerkarte {
  max-width: 760px;
  margin-inline: auto;
  margin-block: 0 var(--s6, 32px);
}
.rechnerzone { display: flow-root; }

/* --- Rechnerliste als Karten statt Aufzählung --------------------------- */
.entry-content ul.rechnerliste {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s5, 24px);
  display: grid;
  gap: var(--s3, 12px);
}
@media (min-width: 640px) { .entry-content ul.rechnerliste { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .entry-content ul.rechnerliste { grid-template-columns: 1fr 1fr 1fr; } }
.entry-content ul.rechnerliste li {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--rule, #DCE3DF);
  border-radius: 4px;
  background: var(--card, #fff);
  font-size: 15px;
  color: var(--ink-2, #41504A);
}
.entry-content ul.rechnerliste li a { text-decoration: none; }
.entry-content ul.rechnerliste li a strong { display: block; margin-bottom: 2px; }
.entry-content ul.rechnerliste li:hover { border-color: var(--brand, #0E6B4E); }

/* --- Inhaltsverzeichnis in zwei Spalten --------------------------------- */
@media (min-width: 700px) {
  .entry-content ul.inhalt { columns: 2; column-gap: var(--s6, 32px); }
  .entry-content ul.inhalt li { break-inside: avoid; }
}

/* --- Hero-Band: der Rechner bekommt eine eigene, volle Breite ------------ */
.entry-content .rechner-hero {
  /* aus der Inhaltsspalte ausbrechen, ohne den Seitenrand zu sprengen */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: calc(-1 * var(--s5, 24px));
  margin-bottom: var(--s7, 48px);
  padding: var(--s6, 32px) var(--s4, 16px) var(--s7, 48px);
  background: var(--brand-soft, #E2F0EA);
  border-bottom: 1px solid var(--rule, #DCE3DF);
}
.entry-content .rechner-hero__innen {
  max-width: 780px;
  margin-inline: auto;
}
.entry-content .rechner-hero .rechnerkarte {
  max-width: none;
  margin: 0;
  background: var(--card, #fff);
  border: 1px solid var(--rule, #DCE3DF);
  border-radius: 4px;
}
@media (max-width: 600px) {
  .entry-content .rechner-hero { padding: var(--s3, 12px) var(--s2, 8px) var(--s5, 24px); margin-top: 0; }
}

/* ==========================================================================
   Gestaltungssystem — übernommen aus dem Musterentwurf
   Farben, Radien, Schatten, Zustände. Die Schriften bleiben die selbst
   gehosteten Fira-Schnitte: Bricolage/Inter kämen von Google und würden das
   in der Datenschutzerklärung zugesagte „keine externen Schriften" brechen.
   ========================================================================== */
:root {
  --bg:          #F4F7F5;
  --surface:     #FFFFFF;
  --tint:        #E7EFEA;
  --ink:         #2E3532;
  --ink-soft:    #5B6663;
  --line:        #DCE4DF;
  --accent:      #2C6248;   /* 7,19:1 auf Weiss, in beiden Richtungen sicher */
  --accent-deep: #204736;
  --accent-soft: #E7EFEA;
  --result-bg:   #E4EEE8;
  --result-ink:  #204736;
  --radius-lg:   14px;
  --radius-md:   10px;
  --radius-sm:   7px;
  --schatten:    0 18px 44px -28px rgba(32,71,54,.28);
  --shell:       1060px;
}
:root[data-theme='dunkel'] {
  --bg:#0F1512; --surface:#161E1A; --tint:#152C24; --ink:#E6ECE8; --ink-soft:#AFBCB6;
  --line:#2A3631; --accent:#5FC79B; --accent-deep:#8ADCB8; --accent-soft:#152C24;
  --result-bg:#152C24; --result-ink:#B9E8D2;
}

/* --- Inhalt wieder in einen Container ----------------------------------- */
.entry-content-wrap { padding: 0 !important; }
.entry-content {
  max-width: var(--shell);
  /* Kadence setzt margin-left:0 auf den Inhaltsbereich; ohne !important
     klebte der Container links am Rand statt mittig zu stehen. Davon hängt
     auch das Hero-Band ab: sein calc(50% - 50vw) trifft den Fensterrand nur,
     wenn der Elternblock tatsächlich zentriert ist. */
  margin-left: auto !important;
  margin-right: auto !important;
  padding-inline: 24px;
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
}
@media (max-width: 600px) { .entry-content { padding-inline: 18px; } }
.entry-content > p,
.entry-content > ul:not(.rechnerliste):not(.inhalt),
.entry-content > ol { max-width: 68ch; }
.entry-content > h2, .entry-content > h3 { max-width: none; }

/* --- Abschnittsrhythmus wie im Muster ----------------------------------- */
.entry-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 3.25rem;
  margin-bottom: .75rem;
  color: var(--ink);
}
.entry-content h3 { font-size: 1.15rem; margin-top: 2rem; margin-bottom: .4rem; color: var(--ink); }
.entry-content p { color: var(--ink-soft); }
.entry-content p strong, .entry-content li strong { color: var(--ink); }
.entry-content .einleitung { font-size: 1.075rem; color: var(--ink-soft); }

/* --- Hero-Band: Fläche randlos, Inhalt darin im Container --------------- */
.entry-content .rechner-hero {
  position: static; transform: none; width: auto; max-width: none;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  margin-top: 0;
  margin-bottom: 3.5rem;
  padding: 56px 24px 64px;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}
.entry-content .rechner-hero__innen { max-width: 620px; margin-inline: auto; }
@media (max-width: 600px) { .entry-content .rechner-hero { padding: 28px 16px 34px; } }

/* --- Rechnerkarte ------------------------------------------------------- */
.entry-content .rechnerkarte {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--schatten);
  overflow: hidden;
  max-width: none;
  margin: 0;
}

/* --- Reiterleiste ------------------------------------------------------- */
.rechnerkarte .reiter {
  display: flex;
  background: #FAFBFE;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
:root[data-theme='dunkel'] .rechnerkarte .reiter { background: #121A16; }
.rechnerkarte .reiter button {
  flex: 1 1 auto;
  padding: 15px 8px;
  background: none;
  border: 0;
  border-bottom: 2.5px solid transparent;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.rechnerkarte .reiter button:hover { color: var(--ink); }
.rechnerkarte .reiter button[aria-selected='true'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--surface);
}

/* --- Eingabefelder ------------------------------------------------------ */
.rechner { padding: 32px 34px 34px; }
@media (max-width: 520px) { .rechner { padding: 24px 18px 26px; } }
.rechner .satz {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-size: 1.05rem; font-weight: 500; color: var(--ink-soft);
  line-height: 1.9;
}
.rechner .satz input[type="text"] {
  font-variant-numeric: tabular-nums;
  font-size: 1.2rem; font-weight: 600; color: var(--ink);
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #FAFBFE;
  transition: border-color .15s, background .15s;
  min-width: 110px;
}
:root[data-theme='dunkel'] .rechner .satz input[type="text"] { background: #121A16; }
.rechner .satz input[type="text"]:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.rechner .satz input[type="text"]:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 1px; }
.rechner .radiogruppe { display: flex; gap: 16px; flex-wrap: wrap; font-size: .95rem; }

/* --- Ergebnisfläche ----------------------------------------------------- */
.rechner output { display: block; margin-top: 28px; }
.rechner .ergebnis {
  background: var(--result-bg);
  border-radius: var(--radius-md);
  padding: 22px 26px;
}
.rechner .ergebnis__zahl {
  font-family: var(--f-cond, "Fira Sans Condensed"), sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700; line-height: 1.2;
  color: var(--result-ink);
  margin: 0 0 .25rem;
  word-break: break-word;
}
.rechner .ergebnis__satz { font-size: .95rem; font-weight: 600; color: var(--result-ink); margin: 0 0 .5rem; }
.rechner .rechenweg { margin: 12px 0 0; font-size: .855rem; color: var(--result-ink); }
.rechner .rechenweg dt {
  font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  opacity: .72; margin-top: 10px;
}
.rechner .rechenweg dd {
  font-family: var(--f-mono, "Fira Mono"), ui-monospace, monospace;
  margin: 2px 0 0; opacity: .9; letter-spacing: -.01em;
}
.rechner .meldung {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--alert-soft, #FBEAE7);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: var(--negative, #A8201A);
  font-size: .95rem;
}
.rechner .meldung__icon { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* --- Schaltflächen ------------------------------------------------------ */
.rechner .aktionen { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rechner .knopf {
  font-size: .875rem; font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.rechner .knopf:hover { border-color: var(--accent); color: var(--accent); }
.rechner .knopf--haupt { background: var(--accent); border-color: var(--accent); color: #fff; }
.rechner .knopf--haupt:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.rechner .hinweis { font-size: .82rem; color: var(--ink-soft); margin: 0; }

/* --- Fokus einheitlich -------------------------------------------------- */
.entry-content a:focus-visible,
.rechner button:focus-visible,
.rechner input:focus-visible,
.rechnerkarte .reiter button:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Rechnerkacheln ----------------------------------------------------- */
.entry-content ul.rechnerliste {
  list-style: none; padding: 0; margin: 0 0 2rem;
  display: grid; gap: 18px; max-width: none;
}
@media (min-width: 560px) { .entry-content ul.rechnerliste { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .entry-content ul.rechnerliste { grid-template-columns: repeat(3, 1fr); } }
.entry-content ul.rechnerliste li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 24px 22px;
  font-size: .875rem;
  color: var(--ink-soft);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.entry-content ul.rechnerliste li:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--schatten);
}
.entry-content ul.rechnerliste li a { text-decoration: none; color: var(--ink); }
.entry-content ul.rechnerliste li a strong {
  display: block; margin-bottom: 6px;
  font-family: var(--f-cond, "Fira Sans Condensed"), sans-serif;
  font-size: 1.02rem; font-weight: 700;
}

/* --- Formelzeile als Karte --------------------------------------------- */
.entry-content .formelzeile {
  background: var(--accent-soft);
  border: 0; border-left: 0;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  font-family: var(--f-mono, "Fira Mono"), ui-monospace, monospace;
  font-size: .925rem;
  line-height: 1.9;
  color: var(--accent-deep);
  max-width: none;
  overflow-x: auto;
}

/* --- Tabellen ----------------------------------------------------------- */
.entry-content .wp-block-table { max-width: none; margin-bottom: 2rem; }
.entry-content table {
  border-collapse: separate; border-spacing: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-size: .925rem;
}
.entry-content table th {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--f-cond, "Fira Sans Condensed"), sans-serif;
  font-weight: 700; font-size: .8rem;
  letter-spacing: .05em; text-transform: uppercase;
  text-align: left; padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.entry-content table td {
  padding: 12px 18px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.entry-content table tr:last-child td { border-bottom: 0; }
.entry-content table tbody tr { transition: background .12s; }
.entry-content table tbody tr:hover { background: var(--bg); }
.entry-content table td:last-child {
  font-family: var(--f-mono, "Fira Mono"), monospace;
  font-weight: 500; color: var(--accent-deep);
  white-space: nowrap;
}

/* --- FAQ als Akkordeon -------------------------------------------------- */
.entry-content details.faq-eintrag {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 0 22px;
  margin-bottom: 12px;
  max-width: none;
  transition: border-color .15s;
}
.entry-content details.faq-eintrag:hover { border-color: var(--accent); }
.entry-content details.faq-eintrag summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 0;
  font-family: var(--f-cond, "Fira Sans Condensed"), sans-serif;
  font-weight: 700; font-size: 1.02rem; color: var(--ink);
}
.entry-content details.faq-eintrag summary::-webkit-details-marker { display: none; }
.entry-content details.faq-eintrag summary::after {
  content: "+"; flex: none;
  font-size: 1.45rem; line-height: 1; color: var(--accent); font-weight: 400;
}
.entry-content details.faq-eintrag[open] summary::after { content: "\2013"; }
.entry-content details.faq-eintrag summary:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.entry-content details.faq-eintrag > p {
  color: var(--ink-soft); font-size: .95rem;
  padding-bottom: 18px; margin: 0; max-width: none;
}

/* --- Navigation --------------------------------------------------------- */
.main-navigation .primary-menu-container > ul > li > a,
.header-navigation .header-menu-container > ul > li > a,
.header-navigation > ul > li > a { font-size: 16px !important; font-weight: 600; }
.main-navigation .sub-menu a,
.header-navigation .sub-menu a,
.header-navigation ul ul li a,
.main-navigation ul ul li a,
.mobile-navigation ul li a {
  font-size: 15px !important; font-weight: 500; line-height: 1.45;
  padding-top: 9px; padding-bottom: 9px;
}
.main-navigation .sub-menu { min-width: 262px; border-radius: var(--radius-md); overflow: hidden; }
.drawer-inner { background-color: var(--accent-deep) !important; }
.drawer-inner a, .mobile-navigation a { color: #FFFFFF !important; }

/* --- Links -------------------------------------------------------------- */
.entry-content a { color: var(--accent); text-underline-offset: 2px; }
.entry-content a:hover { color: var(--accent-deep); }
.site-footer .widget a { color: var(--ink); text-decoration: none; }
.site-footer .widget a:hover { color: var(--accent); }

/* --- Letzte drei Kontraststellen ---------------------------------------
   Skip-Link und die Copyright-Links der Fusszeile liefen noch auf Kadence'
   altem #248763 (4,22:1). Die Rechenweg-Beschriftungen standen mit dem alten
   --ink-3 auf der Ergebnisfläche (4,43:1) — knapp darunter, aber darunter. */
.skip-link,
.site-footer .footer-html a,
.site-bottom-footer-wrap a { color: var(--accent-deep) !important; }
.skip-link:focus, .site-footer .footer-html a:hover { color: var(--accent) !important; }

.rechner .rechenweg dt { color: var(--result-ink); opacity: .8; }

/* --- Aktiver Navigationspunkt ------------------------------------------
   Kadence hebt die aktuelle Seite mit dem alten #248763 hervor; darauf lief
   dunkelgrüner Text mit 2,34:1. Jetzt: dunkler Grund, weisser Text. */
.header-navigation .current-menu-item > a,
.header-navigation .current_page_item > a,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.header-navigation li.current-menu-ancestor > a {
  background-color: var(--accent-deep) !important;
  color: #FFFFFF !important;
  border-radius: var(--radius-sm);
}

/* --- Radien endgültig nach Muster --------------------------------------
   Eine frühere Regel setzte pauschal 4 px auf Karten; das Muster verlangt
   14 px auf der Rechnerkarte, 10 px auf Karten und 7 px auf Bedienelementen. */
.entry-content .rechnerkarte { border-radius: var(--radius-lg) !important; }
.entry-content .rechner .ergebnis,
.entry-content ul.rechnerliste li,
.entry-content details.faq-eintrag,
.entry-content .formelzeile,
.entry-content table { border-radius: var(--radius-md) !important; }
.entry-content .rechner .knopf,
.entry-content .rechner .satz input[type="text"] { border-radius: var(--radius-sm) !important; }

/* Aktiver Navigationspunkt: auch Kindelemente einfärben */
.header-navigation .current-menu-item > a,
.header-navigation .current-menu-item > a *,
.header-navigation .current_page_item > a,
.header-navigation .current_page_item > a *,
.header-navigation li.current-menu-ancestor > a,
.header-navigation li.current-menu-ancestor > a *,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-item > a * { color: #FFFFFF !important; }

/* --- Fussnavigation ------------------------------------------------------
   Kadence rendert sie als Pille in palette1 mit dunkelgrüner Schrift —
   gemessene 2,34:1. Dunkler Grund, weisse Schrift. */
.footer-navigation a,
.footer-navigation .menu-item > a {
  background-color: var(--accent-deep) !important;
  color: #FFFFFF !important;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  text-decoration: none;
}
.footer-navigation a:hover { background-color: var(--accent) !important; color: #FFFFFF !important; }
