/* ============================================================
   Spar-Rechner. Ruhige Flaeche, Haarlinien, Rot ausschliesslich
   fuer den eigenen Balken und die Ersparnis — damit der Blick
   ohne Erklaerung dorthin faellt, wo die Aussage steht.
   ============================================================ */

.sr {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 40px;
}

.sr-step { margin-bottom: 30px; }
.sr-step:last-of-type { margin-bottom: 0; }

.sr-step-label {
  display: block;
  font-size: .74rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}

/* --- Laufzeit-Umschalter --- */
.sr-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.sr-choice {
  flex: 1 1 130px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.sr-choice:hover { border-color: var(--ink-3); }
.sr-choice.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --- Objektpreis-Regler --- */
.sr-slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.sr-amount {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sr-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  outline: none;
}
.sr-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--surface);
  box-shadow: 0 2px 10px rgba(20, 27, 38, .22);
  cursor: grab;
}
.sr-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--surface);
  box-shadow: 0 2px 10px rgba(20, 27, 38, .22);
  cursor: grab;
}
.sr-slider:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.sr-scale {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--ink-3);
  margin-top: 8px;
}

/* --- Balkenvergleich --- */
.sr-block { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.sr-block h3 {
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  margin-bottom: 18px;
}

.sr-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(80px, 2.6fr) auto;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
}
.sr-label { font-size: .95rem; color: var(--ink-2); }
.sr-track { height: 12px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
/* Der Balken wird skaliert, nicht in der Breite animiert: beim Ziehen des
   Reglers feuert die Aenderung bei jedem Input-Event, und ein Layout-Wert
   wuerde dabei die ganze Zeile neu berechnen lassen. transform laeuft im
   Compositor. Die Rundung sitzt an der Spur, damit sie beim Skalieren
   nicht verzerrt. */
.sr-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--ink-3);
  transition: transform .45s cubic-bezier(.22, .61, .36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .sr-bar { transition: none; }
}
.sr-value {
  font-size: .98rem;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sr-row.is-own .sr-label,
.sr-row.is-own .sr-value { color: var(--ink); font-weight: 700; }
.sr-row.is-own .sr-bar { background: var(--red); }

/* --- Ergebnis --- */
.sr-result {
  margin-top: 22px;
  padding: 24px 26px;
  background: var(--paper-2);
  border-radius: var(--r-md);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.sr-result-label { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.sr-result-sub { display: block; font-size: .88rem; font-weight: 400; color: var(--ink-3); margin-top: 4px; }
.sr-result-value {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: var(--tracking-tighter);
  color: var(--red);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sr-note { margin-top: 26px; font-size: .84rem; color: var(--ink-3); line-height: 1.6; }

@media (max-width: 720px) {
  .sr { padding: 26px 20px; border-radius: var(--r-md); }
  .sr-choice { flex-basis: 100%; }
  .sr-amount { font-size: 1.45rem; }
  .sr-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 11px 0; }
  .sr-track { grid-column: 1 / -1; order: 3; }
  .sr-result-value { font-size: 2.1rem; }
}

.sr-hint {
  margin: 14px 0 0;
  font-size: .95rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.sr-hint b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- Maklerprovisions-Rechner (eigene Seite) ----
   Nutzt die Bedienelemente des Spar-Rechners weiter (.sr, .sr-choice,
   .sr-slider, .sr-result); hier steht nur, was dort nicht vorkommt. */
.sr-choice .pr-spanne {
  display: block;
  font-size: .78rem;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 3px;
}
.sr-choice.is-active .pr-spanne { color: rgba(255, 255, 255, .7); }

.pr-zeile {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.pr-zeile:last-of-type { border-bottom: 0; }
/* Auf sehr schmalen Handys (320px) passen Label + Wert nicht nebeneinander — Flex-Kinder
   haben min-width:auto und schoben die Zeile ueber den Viewport (gemessen 24.08.2026 auf
   /kanton/zuerich.html: bodyScrollW 329 bei 320px). Umbruch statt Ueberlauf. */
.pr-zeile { flex-wrap: wrap; }
.pr-zeile .k, .pr-zeile .v { min-width: 0; overflow-wrap: break-word; }
.pr-zeile .k { font-size: .97rem; color: var(--ink-2); }
.pr-zeile .v {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pr-zeile.ist-summe { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 14px; }
.pr-zeile.ist-summe .k { font-weight: 700; color: var(--ink); }
.pr-zeile.ist-summe .v { font-size: 1.7rem; font-weight: 700; letter-spacing: var(--tracking-tight); }

.pr-tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; margin-top: 4px; }
.pr-tabelle th, .pr-tabelle td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}
.pr-tabelle thead th {
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--ink);
}
.pr-tabelle tr.is-aktiv td { background: var(--red-wash); font-weight: 600; color: var(--ink); }
.pr-tabelle tr:last-child td { border-bottom: 0; }

/* ---- Grundstückgewinnsteuer-Rechner ---- */
.g-select {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.g-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.g-befund {
  margin-top: 26px;
  padding: 22px 24px;
  background: var(--paper-2);
  border-radius: var(--r-md);
}
.g-befund .sys {
  font-size: .74rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
}
.g-befund p { margin: 10px 0 0; font-size: 1.02rem; line-height: 1.6; color: var(--ink-2); }
.g-befund p.ist-folge { color: var(--ink); font-weight: 500; }

.g-dauer {
  margin-top: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.g-dauer b { color: var(--ink); }
.g-dauer p { margin: 6px 0 0; font-size: .97rem; line-height: 1.6; color: var(--ink-2); }

.g-summe .v.ist-verlust { color: var(--ok); }

.g-amt {
  margin-top: 22px;
  padding: 18px 22px;
  background: var(--red-wash);
  border-radius: var(--r-sm);
  font-size: .98rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.g-amt b { color: var(--ink); }
