:root {
  --grau: #5E7285;
  --grau-dunkel: #3B4855;
  --text: #2F3A45;
  --muted: #66727E;
  --salbei: #C7D0AA;
  --salbei-tief: #8F9C68;
  --salbei-hell: #EEF1E4;
  --bg: #F6F7F2;
  --surface: #FFFFFF;
  --border: #DCE1D2;
  --radius: 10px;
  --font: 'Montserrat', 'Segoe UI', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /*font-family: var(--font);*/
  font-size: var(--text-base);
  line-height: 1.55;
  /*color: var(--text);*/
  background: var(--bg);
  /*-webkit-font-smoothing: antialiased;*/
}


/* img { max-width: 100%; height: auto; display: block; } */
h1, h2, h3 { color: var(--grau-dunkel); line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--grau); }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { padding: 1.1rem 0; display: flex; align-items: center; }
.logo { width: 260px; }

/* Intro */
.intro { padding: 2.75rem 0 2rem; max-width: 46rem; }
.eyebrow {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--grau); margin-bottom: 0.6rem;
}
.intro h1 { font-size: var(--text-xl); font-weight: 600; margin-bottom: 0.9rem; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 40rem; }

/* Layout */
.layout {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.5rem; align-items: start;
}
.calc { display: grid; gap: 1.25rem; }
.result { position: sticky; top: 1.25rem; display: grid; gap: 1rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}


fieldset.card { margin: 0; min-width: 0; }
legend {
  float: left; width: 100%; padding: 0; margin-bottom: 1.25rem;
  font-size: var(--text-lg); font-weight: 600; color: var(--grau-dunkel);
  display: flex; align-items: center; gap: 0.65rem;
}
legend + * { clear: both; }
.step {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem;
  border-radius: 50%; background: var(--salbei); color: var(--grau-dunkel);
  font-size: var(--text-sm); font-weight: 600; flex: none;
}

.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: var(--text-sm); font-weight: 500; margin-bottom: 0.5rem; color: var(--text); }
.muted { color: var(--muted); font-weight: 400; }
.note { font-size: var(--text-sm); color: var(--muted); margin-top: 0.5rem; }
.note.top { margin: -0.5rem 0 1.25rem; }

/* Segmented control */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 3px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; padding: 0.5rem 1.1rem; border-radius: 6px;
  font-size: var(--text-sm); font-weight: 500; color: var(--muted);
  transition: background 160ms ease, color 160ms ease;
}
.seg span small { font-size: var(--text-xs); font-weight: 400; }
.seg input:checked + span { background: var(--grau); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--grau); outline-offset: 2px; }
.seg label:hover input:not(:checked) + span { color: var(--grau-dunkel); }

/* Money input */
.money {
  display: flex; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease; max-width: 22rem;
}
.money:focus-within { border-color: var(--grau); box-shadow: 0 0 0 3px rgba(94,114,133,0.15); }
.money input {
  flex: 1; min-width: 0; border: 0; outline: 0; padding: 0.7rem 0.85rem;
  font: inherit; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--text); background: transparent;
}
.money .unit { padding: 0 0.85rem; color: var(--muted); font-size: var(--text-sm); white-space: nowrap; }
.money.invalid { border-color: #A3483A; }

/* Stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.stepper button {
  width: 2.75rem; height: 2.75rem; border: 0; background: var(--bg); color: var(--grau-dunkel);
  font: inherit; font-size: 1.2rem; cursor: pointer;
}
.stepper button:hover { background: var(--salbei-hell); }
.stepper input { width: 3.25rem; text-align: center; border: 0; font: inherit; font-size: 1.05rem; outline: 0; }

/* Adder */
.adder { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.adder .money { flex: 1 1 12rem; }
.btn {
  border: 0; border-radius: 8px; background: var(--grau); color: #fff;
  font: inherit; font-size: var(--text-sm); font-weight: 600; padding: 0 1.25rem; min-height: 2.9rem; cursor: pointer;
  transition: background 160ms ease;
}
.btn:hover { background: var(--grau-dunkel); }
.btn:focus-visible, .link:focus-visible, .chip button:focus-visible, .stepper button:focus-visible { outline: 2px solid var(--grau); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: var(--text-sm); color: var(--grau); text-decoration: underline; cursor: pointer; margin-top: 1rem; }

.chips { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem; background: var(--salbei-hell);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.3rem 0.2rem 0.75rem;
  font-size: var(--text-sm); font-variant-numeric: tabular-nums;
}
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: 1rem; line-height: 1; }
.chip button:hover { background: var(--salbei); color: var(--text); }

.hint { margin-top: 0.75rem; font-size: var(--text-sm); }
.hint summary { cursor: pointer; color: var(--grau); font-weight: 500; }
.hint p { margin-top: 0.5rem; color: var(--muted); }

.card-gs { background: var(--salbei-hell); border-color: var(--salbei); font-size: var(--text-sm); }

/* Result */
.result-card { padding: 1.75rem; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.fig-label { display: block; font-size: var(--text-sm); color: var(--muted); }
.fig { display: block; font-size: 1.75rem; font-weight: 600; color: var(--grau-dunkel); font-variant-numeric: tabular-nums; line-height: 1.25; margin: 0.15rem 0; }
.fig-sub { display: block; font-size: var(--text-xs); color: var(--muted); }

.bar { height: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 1.25rem; }
.bar-fill { height: 100%; width: 0; background: var(--grau); border-radius: 999px; transition: width 300ms ease, background 300ms ease; }
.result-card.reached .bar-fill { background: var(--salbei-tief); }

.status { border-radius: 8px; padding: 1rem 1.1rem; background: var(--bg); border-left: 4px solid var(--border); }
.result-card.reached .status { background: var(--salbei-hell); border-left-color: var(--salbei-tief); }
.result-card.open .status { border-left-color: var(--grau); }
.status-title { font-weight: 600; color: var(--grau-dunkel); margin-bottom: 0.25rem; }
.status-text { font-size: var(--text-sm); color: var(--text); }
.status-text strong { font-variant-numeric: tabular-nums; }

.rechenweg { margin-top: 1.25rem; font-size: var(--text-sm); }
.rechenweg summary { cursor: pointer; color: var(--grau); font-weight: 500; }
.rechenweg table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; font-variant-numeric: tabular-nums; }
.rechenweg td { padding: 0.4rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.rechenweg td:last-child { text-align: right; white-space: nowrap; padding-left: 1rem; }
.rechenweg tr.sum td { font-weight: 600; color: var(--grau-dunkel); border-bottom: 0; }

.next h2 { font-size: var(--text-lg); font-weight: 600; margin-bottom: 0.75rem; }
.next ol { margin: 0; padding-left: 1.2rem; font-size: var(--text-sm); display: grid; gap: 0.45rem; }
.cta { background: var(--grau); border-color: var(--grau); color: #fff; font-size: var(--text-sm); }
.cta strong { color: #fff; }

/* Facts */
.facts { padding: 3rem 0 3.5rem; }
.facts h2 { font-size: var(--text-lg); font-weight: 600; margin-bottom: 1.25rem; }
.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.facts-grid > div { border-top: 3px solid var(--salbei); padding-top: 0.9rem; }
.facts h3 { font-size: var(--text-base); font-weight: 600; margin-bottom: 0.4rem; }
.facts p { font-size: var(--text-sm); color: var(--muted); }

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 1.75rem 0 2.25rem; font-size: var(--text-xs); color: var(--muted); }
.site-footer p + p { margin-top: 0.6rem; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .result { position: static; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 2rem); }
  .logo { width: 210px; }
  .intro { padding: 2rem 0 1.5rem; }
  .card { padding: 1.2rem; }
  .result-card { padding: 1.25rem; }
  .fig { font-size: 1.4rem; }
  .facts-grid { grid-template-columns: 1fr; }
  .seg { display: flex; }
  .seg label { flex: 1; text-align: center; }
}
/* Druck-Button */
.btn-print {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; margin-top: 1.25rem; background: var(--surface); color: var(--grau-dunkel);
  border: 1.5px solid var(--grau);
}
.btn-print:hover { background: var(--salbei-hell); }
.btn-print:disabled { opacity: 0.45; cursor: not-allowed; background: var(--surface); }

.print-only { display: none; }

@media print {
  @page { size: A4; margin: 11mm 15mm; }
  html, body { background: #fff; font-size: 10pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block; }
  .print-only[hidden] { display: none; }
  .intro, .calc, .facts, .site-footer, .btn-print, .rechenweg summary { display: none !important; }
  .site-header { border-bottom: 2px solid var(--salbei); }
  .header-inner { padding: 0 0 4mm; }
  .logo { width: 62mm; }
  .wrap { width: 100%; }
  .layout { display: block; }
  .result { position: static; display: block; }
  .card { box-shadow: none !important; break-inside: avoid; margin-bottom: 3mm; padding: 3.5mm 5mm !important; }
  .nw { white-space: nowrap; }
  .print-head { margin: 5mm 0 3mm; }
  .p-angaben td, .rechenweg td { padding: 0.8mm 0 !important; }
  .figures { margin-bottom: 3mm; }
  .bar { height: 7px; margin-bottom: 3mm; }
  .status { padding: 2.5mm 4mm; }
  .eyebrow { margin-bottom: 2mm; }
  .print-head h1 { font-size: 16pt; font-weight: 600; margin-bottom: 1mm; }
  .print-head p { color: var(--muted); font-size: 9pt; margin-bottom: 3mm; }
  .p-angaben, .rechenweg table { width: 100%; border-collapse: collapse; font-size: 9.5pt; font-variant-numeric: tabular-nums; }
  .p-angaben td { padding: 1.2mm 0; border-bottom: 1px solid var(--border); vertical-align: top; }
  .p-angaben td:last-child { text-align: right; padding-left: 4mm; }
  .fig { font-size: 17pt; }
  .rechenweg { margin-top: 3mm; }
  .rechenweg table { margin-top: 0; }
  .next h2 { font-size: 12pt; margin-bottom: 2mm; }
  .next ol { font-size: 9pt; gap: 0.6mm; }
  .cta { background: none !important; border: 0 !important; border-top: 2px solid var(--salbei) !important; border-radius: 0; color: var(--text) !important; font-size: 9pt; padding: 3mm 0 0 !important; margin: 0; }
  .cta strong { color: var(--grau-dunkel) !important; }
  .cta-kontakt { margin-top: 1mm; font-weight: 600; color: var(--grau-dunkel); }
  .p-angaben, .p-angaben tbody { display: block; }
  .p-angaben tbody { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8mm; }
  .p-angaben tr { display: flex; justify-content: space-between; gap: 4mm; border-bottom: 1px solid var(--border); }
  .p-angaben tr.wide { grid-column: 1 / -1; }
  .p-angaben td { border-bottom: 0 !important; }
  .p-angaben td:first-child { white-space: nowrap; }
  .p-angaben { font-size: 9pt; }
  .print-head h1 { font-size: 15pt; }
  .print-note { font-size: 8pt; color: var(--muted); margin-top: 3mm; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
