/* =============================================================
   Kaufnebenkostenrechner – ein einziges Stylesheet für alle Seiten
   Aufbau: Token → Reset → Layout → Header → Hero → Formular
           → Ergebnis → Artikel → FAQ → Footer → Toast

   Das Farbschema steuert das Attribut data-theme am <html>-Element:
   beim ersten Besuch setzt es die Systemeinstellung, danach gilt die
   Wahl, die über den Schalter getroffen wurde.
   ============================================================= */

/* ---------- 1. Design-Token (helles Thema) ---------- */
:root {
  /* Farben */
  --ink:          #0b1220;
  --ink-soft:     #364152;
  --ink-mute:     #5b6779;
  --line:         #e4e8f0;
  --line-strong:  #c6cfe0;
  --surface:      #ffffff;
  --surface-sunk: #f6f8fc;
  --canvas:       #fbfcfe;
  --sheen:        rgba(255, 255, 255, .85);

  --accent:       #15803d;
  --accent-hi:    #1eb355;
  --accent-deep:  #0f5c2c;
  --accent-wash:  #e8f8ee;
  /* Text, der auf einer vollflächig eingefärbten Akzentfläche lesbar bleibt.
     Im dunklen Thema ist der Akzent hell, dort entsteht der Kontrast durch
     dunklen Text. */
  --on-accent:    #ffffff;

  --ok:           #0f7a4f;
  --ok-wash:      #e8f6ef;
  --danger:       #c02434;
  --danger-wash:  #fdeef0;
  --warn:         #8a6100;
  --warn-wash:    #fdf3e0;

  /* Form */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* gestufte Schatten */
  --sh-1: 0 1px 2px rgba(11, 18, 32, .05);
  --sh-2: 0 2px 6px rgba(11, 18, 32, .05), 0 10px 24px -12px rgba(11, 18, 32, .12);
  --sh-3: 0 1px 3px rgba(11, 18, 32, .05), 0 12px 28px -10px rgba(11, 18, 32, .14),
          0 40px 80px -32px rgba(17, 36, 92, .22);
  /* Schatten der Hauptkarte: gerade wahrnehmbar, ohne harte Kante */
  --sh-soft: 0 1px 2px rgba(11, 18, 32, .04), 0 6px 18px -10px rgba(11, 18, 32, .1);
  --sh-focus: 0 0 0 3px var(--accent-wash), 0 0 0 4.5px var(--accent);

  /* Rhythmus */
  --gap:    18px;
  --pad-x:  clamp(20px, 5vw, 40px);
  --sec-y:  clamp(64px, 9vw, 108px);

  /* Typografie */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono",
               Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .68, .32, 1);
}

/* ---------- 2. Dunkles Thema ---------- */
:root[data-theme="dark"] {
  --ink:          #eef2f9;
  --ink-soft:     #b3bdcf;
  --ink-mute:     #8e9ab0;
  --line:         #1e2941;
  --line-strong:  #2c3a58;
  --surface:      #101828;
  --surface-sunk: #0c1322;
  --canvas:       #080c15;
  --sheen:        rgba(255, 255, 255, .12);

  --accent:       #4ecf86;
  --accent-hi:    #7fdca4;
  --accent-deep:  #2fb96a;
  --accent-wash:  #0e391e;
  --on-accent:    #0b1220;

  --ok:           #4bd39a;
  --ok-wash:      #10291f;
  --danger:       #ff8a95;
  --danger-wash:  #2a1219;
  --warn:         #ffc65c;
  --warn-wash:    #2c2109;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 2px 6px rgba(0, 0, 0, .35), 0 10px 24px -12px rgba(0, 0, 0, .6);
  --sh-3: 0 1px 3px rgba(0, 0, 0, .4), 0 14px 32px -10px rgba(0, 0, 0, .6),
          0 44px 90px -34px rgba(0, 0, 0, .8);
  --sh-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px -10px rgba(0, 0, 0, .5);
  --sh-focus: 0 0 0 3px rgba(78, 207, 134, .24), 0 0 0 4.5px var(--accent);
}

/* Auf schmalen Bildschirmen schrumpfen die Seitenränder auf ein Minimum: jeder
   gewonnene Pixel geht an den Inhalt. Gilt für die ganze Seite, damit die
   Abschnitte untereinander bündig bleiben. */
@media (max-width: 560px) {
  :root { --pad-x: 10px; }
}

/* ---------- 3. Nötiger Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.16; letter-spacing: -.028em; font-weight: 650; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a  { color: inherit; text-decoration: none; }
svg { display: block; width: 100%; height: 100%; }
[hidden] { display: none !important; }

button, input {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--canvas); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 4. Layout ---------- */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  transition: border-color .2s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.header-right { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }

.brand { display: inline-flex; align-items: center; gap: 11px; }

/* Das Sprite der Wortmarke darf weder Platz brauchen noch erreichbar sein. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Die Marke ist dieselbe Zeichnung wie das App-Symbol: sie reicht bis an den
   Rand, die runde Ecke macht deshalb der Container. */
.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px -3px color-mix(in srgb, var(--accent) 55%, transparent);
}

.brand-name { font-size: 1.03rem; font-weight: 500; letter-spacing: -.02em; }
.brand-name strong { font-weight: 700; }

.site-nav { display: flex; gap: clamp(16px, 3vw, 28px); font-size: .95rem; color: var(--ink-soft); }
.site-nav a { position: relative; padding: 6px 0; transition: color .16s var(--ease); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }
/* Die aktuelle Seite bleibt markiert: der Strich ist bereits gezeichnet. */
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 560; }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* --- Schalter für das Farbschema --- */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease),
              background .16s var(--ease), transform .14s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:active { transform: scale(.94); }

.theme-icon {
  grid-area: 1 / 1;
  width: 20px; height: 20px;
  transition: opacity .2s var(--ease), transform .3s var(--ease);
}
/* Im hellen Thema bietet der Schalter den Mond an, im dunklen die Sonne. */
.theme-icon--sun  { opacity: 0; transform: rotate(-70deg) scale(.6); }
.theme-icon--moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-icon--sun  { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-icon--moon { opacity: 0; transform: rotate(70deg) scale(.6); }

/* Der Teilen-Knopf im Kopf übernimmt die Form des Farbschalters, hat aber nur
   ein Bild statt zweier übereinanderliegender. */
.share-toggle > svg { width: 20px; height: 20px; }

/*
 * Mit dem dritten Knopf wird die Kopfzeile auf schmalen Geräten zu breit. Statt
 * ihn dort wegzulassen – gerade auf dem Telefon ist Teilen am nützlichsten –
 * rücken die Schalter enger zusammen und werden etwas kleiner. Die 40 Pixel
 * Mindestgröße für den Finger bleiben erhalten, es fällt nur der Luftraum weg.
 */
@media (max-width: 420px) {
  .header-inner { gap: 10px; }
  .header-right { gap: 8px; }
  .brand { gap: 8px; }
  .brand-name { font-size: .95rem; }
}

/* --- Menü auf dem Telefon --- */
/* Der Knopf übernimmt die Form des Themenschalters: zwei Bedienelemente
   nebeneinander im Kopf müssen gleich viel Platz einnehmen. */
.menu-toggle {
  display: none;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.menu-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Drei Striche: der mittlere ist das Element, die anderen beiden seine Pseudos. */
.menu-bars,
.menu-bars::before,
.menu-bars::after {
  display: block;
  width: 18px;
  height: 1.9px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .24s var(--ease), opacity .16s var(--ease);
}
.menu-bars { position: relative; }
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; }
.menu-bars::before { transform: translateY(-6px); }
.menu-bars::after  { transform: translateY(6px); }

/* Bei geöffnetem Menü werden die Striche zum Kreuz. */
.nav-open .menu-bars { background: transparent; }
.nav-open .menu-bars::before { transform: rotate(45deg); }
.nav-open .menu-bars::after  { transform: rotate(-45deg); }

/* Die Schwelle liegt bei 900 statt 760: mit dem dritten Kopfknopf passen
   Marke, fünf Verweise und die Schalter auf einem Tablet nicht mehr in
   eine Zeile, und umgebrochene Verweise sehen schlechter aus als das
   Klappmenü, das dort ohnehin gewohnt ist. */
@media (max-width: 900px) {
  .menu-toggle { display: grid; }

  /* Dasselbe <nav> aus dem Kopf, nur als Klapptafel. Geschlossen gilt
     "visibility: hidden", die Links fallen damit auch aus der
     Tabulatorreihenfolge: keine versteckte zweite Kopie zu pflegen. */
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    display: grid;
    gap: 0;
    padding: 6px var(--pad-x) 16px;
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
    box-shadow: var(--sh-2);
    font-size: 1rem;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .2s var(--ease), transform .24s var(--ease),
                visibility .24s;
  }
  .site-header.nav-open .site-nav {
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  .site-nav a { padding: 15px 2px; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current="page"] { color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav { transition: none; }
}

/* ---------- 6. Zentrierter Hero ---------- */
/* Der obere Innenabstand bleibt knapp: bei mittig stehendem Rechner hält er
   die ersten Felder ohne Scrollen im Bild. */
.hero {
  position: relative;
  padding: clamp(28px, 3.6vw, 44px) 0 clamp(40px, 5vw, 60px);
}

.hero-glow {
  position: absolute;
  inset: -240px 0 auto 0;
  height: 640px;
  pointer-events: none;
  background:
    radial-gradient(42% 50% at 50% 30%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%),
    radial-gradient(36% 44% at 78% 6%, color-mix(in srgb, #7c3aed 11%, transparent), transparent 72%);
  filter: blur(6px);
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -.042em;
}

.lede {
  max-width: 58ch;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  text-wrap: balance;
}

/* ---------- 7. Karte des Rechners ---------- */
/* Die Karte liegt auf dem Hintergrund, statt darüber zu schweben: kurzer,
   weicher Schatten, gerade genug, um sie vom Grund zu lösen. */
.calc-card {
  position: relative;
  width: 100%;
  margin-top: clamp(20px, 2.4vw, 26px);
  padding: clamp(22px, 2.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-soft);
  text-align: left;
}
.calc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(170deg, var(--sheen), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/*
 * Umschalter zwischen den beiden Werkzeugen: Reifen vergleichen oder
 * alternative Größen suchen.
 *
 * Er steht oben auf der Karte und nicht im Menü, weil er eine Entscheidung
 * über die laufende Arbeit ist und kein Ziel auf der Website. Es sind zwei
 * echte Links – sie wechseln die Seite – gekleidet wie der Segmentschalter im
 * Formular, damit dieselbe Form dasselbe bedeutet: zwei Möglichkeiten, eine
 * davon aktiv.
 */
.tool-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
}
.tool-switch a {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: .93rem;
  font-weight: 540;
  text-align: center;
  line-height: 1.25;
  transition: color .16s var(--ease), background .16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tool-switch a:hover { color: var(--ink); background: var(--surface); }

/* Das geöffnete Werkzeug ist vollflächig in Akzentfarbe, wie der Schieber des
   Segmentschalters: es liest sich ohne Vergleich der beiden Einträge. */
.tool-switch a[aria-current="page"],
.tool-switch a[aria-current="page"]:hover {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 640;
  box-shadow: 0 1px 2px rgba(11, 18, 32, .18),
              0 6px 14px -6px color-mix(in srgb, var(--accent) 75%, transparent);
}

.calc-head { margin-bottom: 26px; }
.calc-head h2 { font-size: 1.35rem; letter-spacing: -.03em; }
.calc-sub { margin-top: 6px; color: var(--ink-mute); font-size: .9rem; }

/*
 * Ein einziges Zwölf-Spalten-Raster trägt das gesamte Formular. Die
 * Zwischencontainer (.row-2 und #tool-fields) nutzen display:contents, ihre
 * Felder werden dadurch zu Zellen desselben Rasters: die Spalten bleiben über
 * alle Zeilen bündig, statt eigenständige Unterraster zu bilden.
 * Ausgerichtet wird oben, weil alle Bedienelemente 62px hoch sind, während
 * Hinweise und Fehlermeldungen darunter hängen, ohne etwas zu verschieben.
 */
.calc-form {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  align-items: start;
}
.row-2, #tool-fields { display: contents; }

/* Grundeinstellung für schmale Bildschirme: jedes Element füllt eine Zeile. */
.calc-form [data-field],
.manual,
.actions,
.form-status { grid-column: span 12; }

/* Tablet: die Felder stellen sich paarweise nebeneinander. */
@media (min-width: 560px) {
  .calc-form [data-field="alt"],
  .calc-form [data-field="neu"]       { grid-column: span 6; }
  .calc-form [data-field="groesse"]   { grid-column: span 7; }
  .calc-form [data-field="toleranz"]  { grid-column: span 5; }
}

/* Desktop: zwei volle Zeilen mit je drei Feldern, darunter Optionen und
   Knöpfe nebeneinander. Beide Zeilen summieren sich auf 12. */
@media (min-width: 1000px) {
  .calc-form [data-field="alt"],
  .calc-form [data-field="neu"]       { grid-column: span 5; }
  .calc-form [data-field="tacho"]     { grid-column: span 2; }
  .calc-form [data-field="groesse"]   { grid-column: span 7; }
  .calc-form [data-field="toleranz"]  { grid-column: span 5; }

  .calc-form .manual  { grid-column: span 7; align-self: center; }
  .calc-form .actions { grid-column: span 5; justify-content: flex-end; margin-top: 0; }
  .calc-form .actions .btn--primary { flex: 0 1 auto; min-width: 258px; }

  /* Das zweite Werkzeug hat nur ein Eingabefeld: die Knöpfe teilen sich die
     Zeile dort nicht mit den Optionen, sondern nehmen sie ganz ein. */
  .calc-form--einfach .actions {
    grid-column: span 12;
    justify-content: stretch;
    margin-top: 8px;
  }
  .calc-form--einfach .actions .btn--primary { flex: 1 1 auto; }
  .calc-form--einfach .actions .btn--ghost   { flex: 0 0 200px; }
}

/* ---------- 8. Felder und schwebende Beschriftungen ---------- */
.field { position: relative; margin: 0; padding: 0; border: 0; min-width: 0; }

.input {
  width: 100%;
  height: 62px;
  padding: 24px 16px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  -webkit-appearance: none;
          appearance: none;
}
.input::placeholder { color: transparent; }
.input:hover:not(:focus):not(.input--readonly) { border-color: var(--ink-mute); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--sh-focus); }

.input--readonly {
  background: var(--surface-sunk);
  color: var(--ink-soft);
  cursor: default;
}
.input--mono { font-family: var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }

/* Auswahlfeld: dieselbe Hülle wie ein Textfeld. Den systemeigenen Pfeil nimmt
   appearance:none weg, der Ersatz steht am Feldrahmen und ist aus Rändern
   gezeichnet – so folgt er dem Farbschema, was ein eingebettetes Bild nicht
   täte. */
select.input { padding-right: 42px; cursor: pointer; }
.field--select::after {
  content: "";
  position: absolute;
  right: 19px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid var(--ink-mute);
  border-bottom: 2px solid var(--ink-mute);
  border-radius: 1px;
  transform: rotate(45deg);
  pointer-events: none;
}

.field > label {
  position: absolute;
  left: 17px;
  top: 20px;
  color: var(--ink-mute);
  font-size: 1rem;
  pointer-events: none;
  transform-origin: left top;
  transition: transform .17s var(--ease), color .17s var(--ease);
  will-change: transform;
}

/* angehobener Zustand: Feld gefüllt, im Fokus, oder immer "volles" Element */
.input:focus + label,
.input:not(:placeholder-shown) + label,
.field--static > label {
  transform: translateY(-11px) scale(.76);
}
.input:focus + label { color: var(--accent); }
.field--static .input { padding-top: 26px; }

.field-hint, .field-error { font-size: .82rem; line-height: 1.4; }
.field-hint { margin-top: 6px; padding-left: 3px; color: var(--ink-mute); }

.field-error {
  display: none;
  margin-top: 6px;
  padding-left: 3px;
  color: var(--danger);
  font-weight: 520;
}
.field.is-invalid .field-error { display: block; }
.field.is-invalid .input { border-color: var(--danger); }
.field.is-invalid .input:focus {
  box-shadow: 0 0 0 3px var(--danger-wash), 0 0 0 4.5px var(--danger);
}
.field.is-invalid .field-hint { display: none; }

/* ---------- 9. Segmentschalter ---------- */
.field--fieldset { display: flex; flex-direction: column; }

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 62px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
}
.segmented input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}
.segmented > label {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 520;
  cursor: pointer;
  transition: color .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.segmented > label:hover { color: var(--ink); }

/* Der Schieber ist eine vollflächige Akzentfläche: der gewählte Zustand liest
   sich auf einen Blick, ohne die beiden Möglichkeiten zu vergleichen. */
.segmented-thumb {
  position: absolute;
  z-index: 1;
  top: 5px; left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(11, 18, 32, .18),
              0 6px 14px -6px color-mix(in srgb, var(--accent) 75%, transparent);
  opacity: 0;
  transition: transform .26s var(--ease), opacity .18s var(--ease);
}
.segmented input:checked + label { color: var(--on-accent); font-weight: 640; }
.segmented:has(input:checked) .segmented-thumb { opacity: 1; }
/* Der Schieber springt auf die Position der gewählten Möglichkeit. Bei drei
   Möglichkeiten ist er entsprechend schmaler; die Breite steht am Container,
   weil nur er weiß, wie viele es sind. */
.segmented--3 { grid-template-columns: repeat(3, 1fr); }
.segmented--3 .segmented-thumb { width: calc((100% - 10px) / 3); }
.segmented:has(input:nth-of-type(2):checked) .segmented-thumb { transform: translateX(100%); }
.segmented:has(input:nth-of-type(3):checked) .segmented-thumb { transform: translateX(200%); }
.segmented:has(input:focus-visible) {
  border-color: var(--accent);
  box-shadow: var(--sh-focus);
}
.field.is-invalid .segmented { border-color: var(--danger); }

/* ---------- 10. Zusätzliches Eingabefeld ---------- */
.manual { display: grid; gap: 14px; }

/* Das Feld liegt innerhalb von .manual und damit in einem zweiten Raster. Die
   Regel „grid-column: span 12" weiter oben gilt für jedes [data-field] und
   spannte hier zwölf implizite Spalten auf – der Hinweistext darunter bekam
   davon nur eine ab und brach auf 170 Pixel um. Innerhalb von .manual zählt
   nur die eine Spalte, die es dort gibt. */
.manual [data-field] { grid-column: auto; }

/* Die Zusatzangabe ist kurz: ein Feld über die volle Breite würde eine viel
   längere Eingabe suggerieren, als gebraucht wird. */
.manual-field { max-width: 220px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
.check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 21px; height: 21px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--on-accent);
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.check-box svg {
  width: 14px; height: 14px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .16s var(--ease), transform .18s var(--ease);
}
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .check-box { box-shadow: var(--sh-focus); }
.check:hover .check-box { border-color: var(--ink-mute); }

/* ---------- 11. Knöpfe ---------- */
.actions { display: flex; gap: 12px; margin-top: 8px; }

/* Zwei Knöpfe nebeneinander brauchen Platz, den ein 320 Pixel breites Telefon
   nicht hat: dort stehen sie untereinander, darüber teilen sie sich die Zeile
   zu gleichen Teilen. Ohne min-width: 0 würde der lange Beschriftungstext das
   Schrumpfen verhindern und die Seite waagerecht scrollen lassen. */
@media (max-width: 999px) {
  .actions .btn { flex: 1 1 0; min-width: 0; padding: 0 16px; }
}
@media (max-width: 420px) {
  .actions { flex-direction: column; }
  .actions .btn { flex: none; }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 56px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.012em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s var(--ease), box-shadow .18s var(--ease),
              background .18s var(--ease), border-color .18s var(--ease),
              opacity .18s var(--ease);
}
.btn svg { flex: none; width: 19px; height: 19px; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  flex: 1;
  /* Der Verlauf beginnt beim Akzent und endet dunkler. Er darf nicht bei
     --accent-hi anfangen: dort trägt Weiß im hellen Schema nur 2,9:1. */
  background: linear-gradient(178deg, var(--accent), var(--accent) 42%, var(--accent-deep));
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(11, 18, 32, .16),
              0 10px 22px -9px color-mix(in srgb, var(--accent) 78%, transparent);
}
.btn--primary:hover {
  box-shadow: 0 1px 2px rgba(11, 18, 32, .18),
              0 14px 30px -9px color-mix(in srgb, var(--accent) 88%, transparent);
  filter: brightness(1.05);
}
.btn--primary[disabled] {
  cursor: not-allowed;
  opacity: .45;
  box-shadow: none;
  filter: none;
  transform: none;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}
.btn--ghost:hover { border-color: var(--ink-mute); color: var(--ink); }

/* Ladezustand: die Beschriftung macht dem Ladekringel Platz */
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 19px; height: 19px;
  border: 2.2px solid color-mix(in srgb, currentColor 35%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .62s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
  min-height: 1.2em;
  color: var(--danger);
  font-size: .87rem;
  font-weight: 520;
  text-align: center;
}

/* ---------- 12. Ergebniskarte ---------- */
.result {
  margin-top: 26px;
  padding: 30px clamp(18px, 3vw, 28px) 24px;
  border: 1px solid color-mix(in srgb, var(--ok) 26%, var(--line));
  border-radius: var(--r-lg);
  background: var(--ok-wash);
  text-align: center;
  animation: reveal .42s var(--ease) both;
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.result-check { width: 52px; height: 52px; margin: 0 auto 14px; color: var(--ok); }
.rc-circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw .5s var(--ease) .06s forwards; }
.rc-tick   { stroke-dasharray: 40;  stroke-dashoffset: 40;  animation: draw .34s var(--ease) .38s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.result-title {
  color: var(--ok);
  font-size: .8rem;
  font-weight: 680;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.result-code {
  margin: 14px 0 4px;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 5.4vw, 2.2rem);
  font-weight: 620;
  letter-spacing: .06em;
  word-break: break-all;
}
.result-code:focus { outline: none; }

.result-legend { min-height: 2.6em; color: var(--ink-soft); font-size: .89rem; }

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}
.result-actions .btn { flex: 1; max-width: 220px; }
.btn--copy.is-copied { background: var(--ok); filter: none; }

.result-note { margin-top: 18px; color: var(--ink-mute); font-size: .79rem; line-height: 1.5; }

/* Mit dem dritten Knopf („Teilen") wird es nebeneinander früher eng. */
@media (max-width: 560px) {
  .result-actions { flex-direction: column; }
  .result-actions .btn { max-width: none; }
}

/* ---------- 13. So wird gerechnet ---------- */
.howto { padding: 0 0 clamp(56px, 7vw, 88px); }

.howto-title {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  letter-spacing: -.03em;
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.howto-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-soft);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.howto-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.howto-num {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-size: .88rem;
  font-weight: 680;
}

.howto-card h3 { font-size: 1.05rem; letter-spacing: -.024em; }
.howto-card p {
  margin-top: 8px;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: .93rem;
  line-height: 1.65;
}
.howto-card strong { color: var(--ink); font-weight: 620; }

/* Echte Bildschirmaufnahme des Schritts. Unten verankert: die drei Texte sind
   verschieden lang, so bleiben die Bilder trotzdem auf einer Linie. */
.howto-shot {
  display: block;
  width: 100%;
  height: auto;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
/* Die Aufnahmen entstehen im hellen Thema: auf dunklem Grund blendet reines
   Weiß, deshalb sinkt die Helligkeit gerade so weit wie nötig. */
:root[data-theme="dark"] .howto-shot { filter: brightness(.86) contrast(1.02); }

.howto-note {
  margin-top: 20px;
  color: var(--ink-mute);
  font-size: .86rem;
}

/* ---------- 14. Artikel ---------- */
.guide {
  padding: var(--sec-y) 0;
  border-top: 1px solid var(--line);
  background: var(--surface-sunk);
}

/* Ein einziger Container für den Ratgeber: dieselbe Fläche wie die Karte des
   Rechners, damit die Seite aus einem einzigen Material bleibt. */
.guide-card {
  padding: clamp(26px, 4vw, 56px) clamp(20px, 3.4vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-soft);
}

/* Überschriften linksbündig wie der übrige Text. Die Hierarchie entsteht durch
   einen kurzen Strich in Akzentfarbe, nicht durch eine farbige Überschrift: auf
   dieser Website steht der Akzent für Aktionen und Zustände, nicht für Titel. */
.guide h2 {
  position: relative;
  margin-top: clamp(48px, 5.5vw, 68px);
  padding-top: 21px;
  font-size: clamp(1.35rem, 2.7vw, 1.72rem);
  letter-spacing: -.034em;
  scroll-margin-top: 90px;
}
.guide h2::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 34px; height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.guide-card > h2:first-child { margin-top: 0; }

/* Zwischenüberschrift innerhalb eines Abschnitts: ohne den Strich darüber, der
   allein den h2 gehört, und mit kleinerem Abstand, damit sie deutlich
   untergeordnet bleibt. */
.guide-card > h3 {
  margin-top: 34px;
  font-size: clamp(1.08rem, 1.9vw, 1.2rem);
  letter-spacing: -.024em;
}

.guide p { margin-top: 18px; color: var(--ink-soft); line-height: 1.75; }
.guide p strong { color: var(--ink); font-weight: 620; }
.guide em { font-style: normal; color: var(--ink); font-weight: 520; }

/* Deutsche Komposita werden lang: „Verbraucherstreitbeilegungsgesetzes" hat 34
   Zeichen und ragt bei 320 px aus seinem Kasten heraus. Ein einzelnes &shy; je
   Wort hilft nur bis zum nächsten langen Wort, deshalb hier die Trennung für
   den ganzen Fließtext. <html lang="de"> steht, also greift das Wörterbuch;
   overflow-wrap fängt die Browser ab, die keines mitbringen. Überschriften und
   Tabellen bleiben außen vor: dort stören Trennstriche mehr als sie nützen. */
.guide p,
.guide li {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.guide-intro { font-size: 1.06rem; }

/* --- Kartenraster innerhalb des Artikels --- */
.fact-grid, .use-grid, .pitfall-grid {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
/* Die Spaltenzahl ist je Umbruchpunkt festgelegt statt per auto-fit: so bleibt
   sie vorhersehbar und die Karten stehen in sauberen Spalten. */
@media (min-width: 640px) {
  .pitfall-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 760px) {
  .fact-grid, .use-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) {
  .pitfall-grid { grid-template-columns: repeat(3, 1fr); }
}

.fact-card, .use-card, .pitfall-card {
  padding: 21px 22px 23px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.fact-card:hover, .use-card:hover, .pitfall-card:hover { transform: translateY(-2px); }

.fact-card h3, .use-card h3, .pitfall-card h3 {
  font-size: 1.02rem;
  letter-spacing: -.024em;
}
.fact-card p, .use-card p, .pitfall-card p {
  margin-top: 8px;
  font-size: .92rem;
  line-height: 1.62;
}

/* Kernzahlen: derselbe zarte Farbton wie die Ziffern in "So wird gerechnet". */
.fact-card {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  background: var(--accent-wash);
}
.fact-card p { color: var(--ink-soft); }

/* Einsatzgebiete: kräftigerer Akzentton als bei den Kernzahlen, aber ohne
   volle Fläche; die Überschrift in Akzentfarbe hebt den Block bereits genug. */
.use-card {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: linear-gradient(176deg,
              color-mix(in srgb, var(--accent) 13%, var(--surface)),
              var(--accent-wash));
}
.use-card h3 { color: var(--accent-deep); }
/* Auf dunklem Grund fällt der tiefe Akzent auf 3,7:1: dort braucht es die helle Variante. */
:root[data-theme="dark"] .use-card h3 { color: var(--accent-hi); }
.use-card p { color: var(--ink-soft); }

/* Häufige Fehler: neutrale Fläche, das Signal ist allein der Punkt in Akzentfarbe. */
.pitfall-card { background: var(--surface-sunk); }
.pitfall-card h3 { position: relative; padding-left: 18px; }
.pitfall-card h3::before {
  content: "";
  position: absolute;
  left: 1px; top: .52em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.pitfall-card p { color: var(--ink-soft); }

/* Zusammenfassender Kasten, mit einem Akzentbalken am Rand verankert. */
.callout {
  margin-top: 28px;
  padding: 20px 24px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: 5px var(--r-md) var(--r-md) 5px;
  background: var(--accent-wash);
}
.callout h3 {
  color: var(--accent);
  font-size: .76rem;
  font-weight: 680;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.callout p { margin-top: 9px; }

/* --- Abbildungen des Artikels --- */

/* Die Abbildungen sind flache Zeichnungen, keine Fotos: ein dünner Rahmen
   genügt, um sie vom Kartengrund zu lösen, ohne visuell schwer zu werden. */
.guide-figure { margin: 30px 0 0; }
.guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.guide-figure figcaption {
  margin-top: 11px;
  color: var(--ink-mute);
  font-size: .87rem;
  line-height: 1.55;
}
/* Die Abbildungen sind für das helle Thema gezeichnet: auf dunklem Grund
   blendet reines Weiß, deshalb sinkt die Helligkeit gerade so weit wie nötig. */
:root[data-theme="dark"] .guide-figure img { filter: brightness(.88) contrast(1.02); }

/* Breite Abbildungen würden auf Telefonbreite gequetscht unlesbar: besser,
   sie in ihrem Mindestmaß scrollen zu lassen. Es scrollt der Bildcontainer,
   nicht die Seite, und die Bildunterschrift bleibt darunter stehen. */
@media (max-width: 700px) {
  .figure-scroll { overflow-x: auto; border-radius: var(--r-md); }
  .figure-scroll img { min-width: 640px; }
}

/* Die Aufmacher-Abbildung ist bereits dunkel und bringt ihren eigenen Grund
   mit: kein Rahmen, keine Helligkeitskorrektur, und im dunklen Thema bleibt
   sie unverändert. */
.guide-figure--lead { margin-top: 26px; }
.guide-figure--lead img {
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
:root[data-theme="dark"] .guide-figure--lead img { filter: none; }

/* Tabellen scrollen innerhalb ihres eigenen Containers: die Seite selbst darf
   auf schmalen Bildschirmen nie waagerecht scrollen. */
.table-scroll {
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  /* Eingesenkte Fläche: in der weißen Karte würde ein weißer Grund verschwinden. */
  background: var(--surface-sunk);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}
.guide-table caption {
  padding: 14px 18px 0;
  color: var(--ink-mute);
  font-size: .8rem;
  text-align: left;
}
.guide-table th, .guide-table td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.guide-table thead th {
  color: var(--ink-mute);
  font-size: .76rem;
  font-weight: 640;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.guide-table tbody th { color: var(--ink-soft); font-weight: 520; }

/* Die Tabellen im Artikel enthalten kurze Werte und sollen nicht umbrechen.
   Die Cookie-Tabelle enthält ganze Sätze: ohne diese Ausnahme wäre sie doppelt
   so breit wie der Bildschirm und würde selbst am Monitor scrollen. */
.guide-table--wrap th, .guide-table--wrap td { white-space: normal; }
.guide-table--wrap tbody th { white-space: nowrap; }
.guide-table tbody tr:last-child th,
.guide-table tbody tr:last-child td { border-bottom: 0; }
/* Auszeichnung im Fließtext. Eine Adresse mit Parametern ist ein einziges Wort
   ohne Leerzeichen: ohne diese Regel schob sie die Datenschutzseite auf 320
   Pixeln um 80 Pixel über den Rand hinaus. */
.guide code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: .86em;
  font-weight: 600;
  overflow-wrap: anywhere;
}
:root[data-theme="dark"] .guide code { color: var(--accent); }

.guide-table code {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .88em;
  font-weight: 600;
}

/* ---------- 15. FAQ (Abschluss des Artikels) ---------- */
.faq-block {
  margin-top: clamp(52px, 6vw, 72px);
  padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--line);
}
.faq-block h2 { margin-top: 0; }

.faq { margin-top: 28px; display: grid; gap: 10px; }

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.faq-item[open] {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: var(--sh-2);
}

.faq-item summary {
  position: relative;
  padding: 19px 52px 19px 22px;
  font-size: 1.01rem;
  font-weight: 560;
  letter-spacing: -.014em;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after,
.faq-item summary::before {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 13px;
  height: 1.9px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: transform .24s var(--ease), opacity .24s var(--ease);
}
.faq-item summary::before { transform: translateY(-50%) rotate(90deg); }
.faq-item[open] summary::before { transform: translateY(-50%) rotate(0); opacity: 0; }

.faq-item p {
  margin-top: 0;
  padding: 0 22px 21px;
  color: var(--ink-soft);
  font-size: .96rem;
}

/* ---------- 16. Footer ---------- */
.site-footer {
  padding: clamp(46px, 6vw, 68px) 0 34px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  justify-content: space-between;
  align-items: flex-start;
}
.brand--footer { margin-bottom: 14px; }
.footer-note { max-width: 46ch; color: var(--ink-mute); font-size: .88rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 34px 56px; color: var(--ink-soft); font-size: .92rem; }
.footer-col { display: grid; gap: 11px; align-content: start; }
.footer-head {
  margin-bottom: 2px;
  color: var(--ink-mute);
  font-size: .74rem;
  font-weight: 620;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer-nav a:hover { color: var(--accent); }

/* Die Cookie-Einstellungen sind eine Aktion, keine Adresse: es bleibt ein
   <button>, muss in der Liste aber wie die Links daneben aussehen. */
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.linkish:hover { color: var(--accent); }

.copyright {
  max-width: 1200px;
  margin: 34px auto 0;
  padding: 22px var(--pad-x) 0;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: .81rem;
}

/* ---------- 17. Toast ---------- */
/* Über dem Cookie-Band (z-index 70): beide sitzen unten, und eine Meldung,
   die hinter dem Band verschwindet, ist keine Meldung. */
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  font-size: .92rem;
  font-weight: 550;
  box-shadow: var(--sh-3);
  transform: translate(-50%, 18px);
  opacity: 0;
  transition: transform .28s var(--ease), opacity .28s var(--ease);
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- 18. Serviceseiten (Datenschutz, Über uns, Kontakt) ---------- */
/* Sie verwenden das Material des Artikels weiter: dieselbe Karte, dieselben
   Überschriften. Nur die Breite ändert sich, weil hier keine Abbildungen die
   Zeilen unterbrechen. */
.wrap--narrow { max-width: 920px; }

.page { border-top: 0; }

.page-title {
  font-size: clamp(1.75rem, 4.4vw, 2.5rem);
  letter-spacing: -.042em;
  line-height: 1.1;
}
.page-meta { margin-top: 16px; color: var(--ink-mute); font-size: .85rem; }

/* Aufzählungen: die globale Liste hat keine Punkte, hier werden sie gebraucht. */
.page-list { display: grid; gap: 12px; margin-top: 20px; }
.page-list li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.page-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: .72em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.page-list strong { color: var(--ink); font-weight: 620; }

/* Die Kontaktangabe: ein einziger Block, weil es nur eine Adresse wirklich gibt. */
.contact-box {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-sunk);
}
.contact-box .contact-label {
  color: var(--ink-mute);
  font-size: .76rem;
  font-weight: 620;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.contact-box a {
  color: var(--accent);
  font-size: clamp(1.05rem, 3vw, 1.28rem);
  font-weight: 620;
  letter-spacing: -.02em;
  word-break: break-word;
}
.contact-box a:hover { text-decoration: underline; }

/* Der Text der Datenschutzerklärung enthält Links mitten im Absatz: ohne
   Unterstreichung verschwänden sie, denn die Farbe allein genügt nicht. */
.page-card a { color: var(--accent); text-decoration: underline; }

/* ---------- 19. Zustimmungsbanner ---------- */
/* Die vorherige Einwilligung ist Pflicht, das Banner lässt sich also nicht
   weglassen. Klein halten lässt es sich sehr wohl: eine flache Leiste, zwei
   Zeilen Text, kein Schleier über der Seite. Der Rechner bleibt bedienbar,
   auch ohne Antwort. */
.cookie-banner {
  position: fixed;
  z-index: 70;
  left: 0; right: 0;
  bottom: 0;
  padding: 0 12px max(12px, env(safe-area-inset-bottom));
  opacity: 0;
  transform: translateY(16px);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.cookie-banner.is-visible { opacity: 1; transform: none; }

.cookie-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 940px;
  margin-inline: auto;
  padding: 13px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-3);
}

.cookie-text {
  flex: 1 1 320px;
  color: var(--ink-soft);
  font-size: .84rem;
  line-height: 1.5;
}
.cookie-text a { color: var(--accent); text-decoration: underline; white-space: nowrap; }

.cookie-actions { display: flex; flex: 0 0 auto; gap: 8px; }

/* Kleineres Maß für den Knopf: in der Leiste wöge ein 56 Pixel hoher Knopf
   schwerer als der Text, der vor dem Drücken gelesen werden soll. Über den
   44 Pixeln eines Berührungsziels bleibt er trotzdem. */
.btn--sm { min-height: 44px; padding: 0 18px; font-size: .9rem; }

@media (max-width: 560px) {
  .cookie-actions { flex: 1 1 100%; }
  .cookie-actions .btn { flex: 1 1 0; }
}

/* ---------- 20. Ergebnis mit mehreren Werten ---------- */
/* Der Vergleich zweier Reifengrößen liefert nicht einen Wert, sondern ein
   Dutzend, und einer davon kann eine Warnung sein: daher die zweite, rote
   Variante und die zweispaltige Liste, die Form, in der man Messwerte liest. */
.result--warn {
  border-color: color-mix(in srgb, var(--danger) 26%, var(--line));
  background: var(--danger-wash);
}
.result--warn .result-check,
.result--warn .result-title { color: var(--danger); }

/* Das Zeichen im Kreis wechselt mit dem Ergebnis: Haken oder Ausrufezeichen.
   Beide stehen im HTML, sichtbar bleibt eines. */
.rc-bang { display: none; }
.result--warn .rc-tick { display: none; }
.result--warn .rc-bang { display: block; }

.decode {
  display: grid;
  grid-template-columns: max-content 1fr;
  margin: 22px 0 0;
  text-align: left;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
.decode dt,
.decode dd {
  padding: 13px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
.decode dt {
  padding-right: 22px;
  color: var(--ink-mute);
  font-size: .74rem;
  font-weight: 640;
  letter-spacing: .09em;
  text-transform: uppercase;
  line-height: 1.9;
}
.decode dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 580;
  letter-spacing: -.012em;
}

/* Die Erläuterung unter dem Wert: fast immer der Teil, auf den es ankommt,
   sie darf dem Wert aber nicht die Aufmerksamkeit nehmen. */
.decode-alt {
  display: block;
  margin-top: 3px;
  color: var(--ink-mute);
  font-size: .82rem;
  font-weight: 440;
  line-height: 1.55;
  letter-spacing: 0;
}
.decode-mono { font-family: var(--font-mono); letter-spacing: .04em; }
.decode-ok   { color: var(--ok); }
.decode-bad  { color: var(--danger); }
.decode-warn { color: var(--warn); }

@media (max-width: 560px) {
  /* Zwei Spalten ließen dem Wert auf 375 Pixeln einen Streifen von sechs
     Zeichen: unterhalb dieser Schwelle steht die Bezeichnung über dem Wert. */
  .decode { grid-template-columns: 1fr; }
  .decode dt { padding: 14px 0 0; border-bottom: 0; line-height: 1.5; }
  .decode dd { padding-top: 4px; }
}

/* ---------- 21. Ergänzungen der Ergebniskarte ---------- */
/* Der Unterschied zum alten Reifen steht neben dem neuen Wert, nicht darunter:
   gelesen wird das Paar, nicht die einzelne Zahl. */
.decode-delta {
  margin-left: 8px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 560;
  letter-spacing: .03em;
  white-space: nowrap;
}
.decode-delta.decode-warn { color: var(--warn); }

/* Zwischenüberschrift innerhalb der Ergebniskarte, etwa über der Tachotabelle. */
.result-sub {
  margin: 30px 0 0;
  text-align: left;
  font-size: 1.02rem;
  font-weight: 640;
}
.result .table-scroll { background: var(--surface); }
.result .guide-table caption { padding-top: 12px; }

/* Die Tabelle der Alternativen ist die eigentliche Antwort des zweiten
   Werkzeugs: sie darf mehr Höhe bekommen als eine Tabelle im Artikel. */
.result-table { max-height: 62vh; overflow-y: auto; }

/* ---------- 22. Kostenaufstellung in der Ergebniskarte ---------- */
/*
 * Die Antwort dieses Rechners ist keine einzelne Zahl, sondern eine Rechnung
 * mit vier bis sechs Posten und einer Summe. Beträge stehen deshalb rechts und
 * einspaltig untereinander: nur so lassen sich Tausenderstellen vergleichen,
 * ohne jede Zeile einzeln zu lesen.
 */
.decode--kosten dd { font-family: var(--font-mono); text-align: right; letter-spacing: .01em; }
.decode--kosten dt { line-height: 1.6; text-transform: none; font-size: .88rem; letter-spacing: 0; }

/* Der Anteil am Kaufpreis steht als zweite Zeile in derselben Zelle: er erklärt
   den Betrag und darf ihn nicht überstrahlen. */
.decode-quote {
  display: block;
  margin-top: 2px;
  color: var(--ink-mute);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 440;
  letter-spacing: 0;
}

/* Die Summenzeile schließt die Liste ab: kräftiger als die Posten darüber und
   ohne trennende Linie, weil unter ihr nichts mehr folgt. Die Klasse steht an
   dt und dd selbst – ein umschließendes Element würde das Raster der Liste
   zerlegen. */
.decode dt.decode-sum,
.decode dd.decode-sum {
  padding-top: 16px;
  border-bottom: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 700;
}
.decode dt.decode-sum { text-transform: none; letter-spacing: 0; line-height: 1.5; }

@media (max-width: 560px) {
  .decode--kosten dd { text-align: left; }
}

/* Erläuterung unter der Kostenaufstellung, etwa der Hinweis auf die
   Umsatzsteuer der Notargebühren. */
.result-fussnote {
  margin: 16px 0 0;
  color: var(--ink-mute);
  font-size: .8rem;
  line-height: 1.55;
  text-align: left;
}

/* ---------- 23. Kostenbalken und Ländervergleich ---------- */
/*
 * Der Balken beantwortet die Frage, für die eine Zahlenliste zu langsam ist:
 * wovon kommt eigentlich das meiste? Bei einem Kauf mit Makler sind es zwei
 * Blöcke – Steuer und Provision – und die beiden erkennt man hier in einer
 * halben Sekunde statt in vier Zeilen Kopfrechnen.
 *
 * Die Breiten setzt das Skript als Prozentwerte; alles andere steht hier. Der
 * Balken ist aria-hidden, weil direkt darunter dieselben Werte als Liste
 * stehen – vorgelesen wäre er eine zweite, schlechtere Kopie.
 */
.kostenbalken {
  display: flex;
  height: 15px;
  margin: 22px 0 6px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.kostenbalken span {
  display: block;
  min-width: 2px;
  transition: width .32s var(--ease);
}
/* Vier Töne aus einer Familie: der Balken soll die Anteile zeigen, nicht
   vier Themen behaupten, die es nicht gibt. */
.kb-steuer     { background: var(--accent-deep); }
.kb-notar      { background: var(--accent); }
.kb-grundbuch  { background: var(--accent-hi); }
.kb-makler     { background: color-mix(in srgb, var(--accent-hi) 45%, var(--surface)); }

/* Die Legende trägt dieselben Farben als Punkte, damit der Balken ohne
   Beschriftung auskommt und trotzdem lesbar bleibt. */
.kb-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 4px;
  font-size: .78rem;
  color: var(--ink-mute);
}
.kb-legende span { display: inline-flex; align-items: center; gap: 6px; }
.kb-punkt {
  width: 9px; height: 9px;
  flex: none;
  border-radius: 3px;
}

/*
 * Der Ländervergleich steht zugeklappt: Er ist die Antwort auf eine zweite
 * Frage („wäre es woanders billiger?“), und wer sie nicht stellt, soll nicht
 * an ihr vorbeiscrollen müssen.
 */
.vergleich {
  margin-top: 22px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  text-align: left;
}
.vergleich > summary {
  padding: 15px 0 13px;
  color: var(--ink-soft);
  font-size: .92rem;
  font-weight: 560;
  cursor: pointer;
  list-style: none;
  transition: color .16s var(--ease);
}
.vergleich > summary::-webkit-details-marker { display: none; }
.vergleich > summary::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 11px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(-45deg);
  transition: transform .2s var(--ease);
}
.vergleich[open] > summary::before { transform: translateY(-4px) rotate(45deg); }
.vergleich > summary:hover { color: var(--accent); }
.vergleich > summary:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.vergleich .table-scroll { margin-bottom: 6px; }

/* Die Zeile des gewählten Landes ist der Bezugspunkt der ganzen Tabelle und
   muss sich beim Überfliegen sofort finden lassen. */
.vergleich tr.ist-gewaehlt {
  background: var(--accent-wash);
  font-weight: 640;
}
.vergleich tr.ist-gewaehlt th,
.vergleich tr.ist-gewaehlt td { color: var(--ink); }

/* Ein Unterschied ohne Vorzeichen ist eine Falle: teurer und billiger sähen
   gleich aus. */
.v-mehr    { color: var(--danger); white-space: nowrap; }
.v-weniger { color: var(--ok); white-space: nowrap; }
.v-gleich  { color: var(--ink-mute); white-space: nowrap; }
