/* Klarziffer – Startseite. Farben und Rundungen wie in der App (styles.css): Knöpfe 6 px, Karten 10 px.
   Kontrast geprüft: --muted erreicht auf allen Hintergründen mind. 4,5 : 1 (hell 4,9–5,7, dunkel 5,4–7,2). */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d2330;
  --muted: #5f6778;
  --line: #e2e5ec;
  --accent: #1f6f78;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1f2;
  --side: #17323a;
  --hell: #4fb3bc;
  --warn: #8a4a00;
  --warn-bg: #fff4d6;
  --warn-line: #f0d58a;
  --bad: #b42318;
  --signal: #e0a100;         /* Gelb für den Hinweis „Im Aufbau“ */
  --signal-glow: rgba(224, 161, 0, .2);
  --ring: #c3c9d3;           /* Ringe der Wegegeld-Grafik */
  --zone: #eef1f5;           /* Fläche bis 2 km */
  --zone-aktiv: #bfe0e3;     /* vorgeschlagene Stufe */
  --radius: 10px;            /* Karten */
  --radius-btn: 6px;         /* Knöpfe */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11181d; --panel: #18222a; --ink: #e6ecef; --muted: #9aa6ad; --line: #2a3640;
    --accent: #4fb3bc; --accent-ink: #0d1a1f; --accent-soft: #1b3338; --side: #0c171c;
    --warn: #f3c66b; --warn-bg: #2d2412; --warn-line: #5a4519; --bad: #ff8a80;
    --ring: #4d5d69; --zone: #1f2a33; --zone-aktiv: #245a60;
  }
}
:root[data-theme="dark"] {
  --bg: #11181d; --panel: #18222a; --ink: #e6ecef; --muted: #9aa6ad; --line: #2a3640;
  --accent: #4fb3bc; --accent-ink: #0d1a1f; --accent-soft: #1b3338; --side: #0c171c;
  --warn: #f3c66b; --warn-bg: #2d2412; --warn-line: #5a4519; --bad: #ff8a80;
  --ring: #4d5d69; --zone: #1f2a33; --zone-aktiv: #245a60;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
body.modal-offen { overflow: hidden; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

/* Hinweis „Im Aufbau“ – bleibt beim Scrollen sichtbar */
.aufbau {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 10px 16px; background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid var(--warn-line); font-size: .95rem; text-align: center;
}
.punkt { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px var(--signal-glow); }

.kopf, main, .fuss { max-width: 1100px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.kopf { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 8px; }
.marke { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; }
.marke img { border-radius: 9px; }
a.marke { color: inherit; text-decoration: none; }
.kopf-links { display: flex; align-items: center; gap: 18px; }
.kontakt-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.kontakt-link:hover { color: var(--accent); }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: var(--radius-btn); font-weight: 600;
  text-decoration: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit;
}
.btn.primaer { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primaer:hover { filter: brightness(1.08); }
.btn.klein { padding: 6px 14px; font-size: .92rem; font-weight: 600; }
.btn.klein:hover { border-color: var(--accent); color: var(--accent); }

/* Kopfbereich mit Beispielrechnung */
.held { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding: 40px 0 56px; }
.vorzeile { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .6em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 56ch; }
.stand {
  margin-top: 28px; padding: 20px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--warn-line); border-left: 5px solid var(--signal);
}
.stand h2 { font-size: 1.1rem; margin-bottom: .35em; }
.stand p { color: var(--muted); }

.muster { margin: 0; }
.blatt {
  background: #fff; color: #1d2330; border-radius: 10px; padding: 22px 22px 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 16px 40px rgba(16, 24, 40, .14);
  transform: rotate(1.2deg); font-size: .86rem;
}
.blatt-kopf { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #17323a; padding-bottom: 8px; margin-bottom: 8px; }
.blatt-kopf b { font-size: 1.15rem; }
.blatt-kopf span { color: #6b7385; }
.blatt table { width: 100%; border-collapse: collapse; }
.blatt th { text-align: left; font-weight: 600; color: #6b7385; font-size: .78rem; padding: 4px 4px; border-bottom: 1px solid #e2e5ec; }
.blatt td { padding: 6px 4px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
.blatt td:first-child { font-weight: 700; width: 3em; }
.blatt th:nth-child(n+3), .blatt td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.blatt-summe { display: flex; justify-content: space-between; padding: 10px 4px 0; font-size: 1rem; }
.blatt-fuss { display: flex; gap: 12px; align-items: center; margin-top: 14px; color: #6b7385; font-size: .78rem; line-height: 1.35; }
.qr { flex: none; width: 60px; height: 60px; display: block; outline: 1px solid #e2e5ec; }
.blatt-fuss i { font-style: normal; color: #6b7385; }
.muster figcaption { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }

/* Abschnitte */
.block { padding: 48px 0; border-top: 1px solid var(--line); }
.karten { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.karten article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.karten h3 { color: var(--accent); }
.liste-funktionen { columns: 2; column-gap: 32px; }
.haken.liste-funktionen { margin-top: 16px; }
.liste-funktionen li { break-inside: avoid; font-weight: 500; }
.karten p { margin: 0; color: var(--muted); font-size: .97rem; }

.datenschutz, .fuerwen { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.fuerwen p { color: var(--muted); }
.datenschutz p { color: var(--muted); }
.arzt p { max-width: 70ch; color: var(--muted); font-size: 1.05rem; }
.arzt p:last-child { margin: 0; }
.arzt .vorzeile { color: var(--accent); margin-bottom: .4em; }
.arzt b { color: var(--ink); font-weight: 600; }
.haken { list-style: none; margin: 0; padding: 20px 22px; background: var(--accent-soft); border-radius: var(--radius); }
.haken li { padding: 6px 0 6px 30px; position: relative; font-weight: 600; }
.haken li::before {
  content: ""; position: absolute; left: 4px; top: 13px; width: 12px; height: 7px;
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg);
}

/* Hervorhebung Entfernung/Wegegeld mit Schema */
.entfernung { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.entfernung > div > p { color: var(--muted); }
.entfernung .vorzeile { color: var(--accent); margin-bottom: .4em; }
.entfernung .haken li { font-weight: 500; }
.entfernung-bild { width: 100%; max-width: 460px; height: auto; justify-self: center; }
.entfernung-bild .zone-innen { fill: var(--zone); }
.entfernung-bild .ring-aktiv { fill: var(--zone-aktiv); }
.entfernung-bild .ring circle { fill: none; stroke: var(--ring); stroke-width: 1.5; }
.entfernung-bild .ring circle:nth-child(1), .entfernung-bild .ring circle:nth-child(2) { stroke: var(--accent); stroke-width: 2; }
.entfernung-bild .ring-text text { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.entfernung-bild .ring-text text:nth-child(-n+2) { fill: var(--ink); font-weight: 600; } /* liegen auf der getönten Fläche */
.entfernung-bild .strecke { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 5; }
.entfernung-bild .ort { fill: var(--accent); stroke: var(--panel); stroke-width: 3; }
.entfernung-bild .ort-text { fill: var(--ink); font-size: 12px; font-weight: 600; text-anchor: middle; }
.entfernung-bild .haus { fill: var(--ink); }
.entfernung-bild .blase rect { fill: var(--panel); stroke: var(--line); }
.entfernung-bild .blase text { fill: var(--ink); font-size: 13px; }
.entfernung-bild .blase .fett { font-weight: 700; fill: var(--accent); }

.preis-reihe { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); gap: 16px; margin: 18px 0; }
.preis { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.etikett { position: absolute; top: -11px; right: 16px; background: var(--accent); color: var(--accent-ink); font-size: .78rem; font-weight: 700; letter-spacing: .03em; padding: 2px 10px; border-radius: 999px; }
.nur-unternehmer { margin: 0 0 .4em; }
.preis.hervor { border: 2px solid var(--accent); }
.preis p:last-child { margin: 0; color: var(--muted); font-size: .95rem; }
.betrag { font-size: 1.9rem; font-weight: 700; margin: .1em 0 .3em; }
.betrag span { font-size: 1rem; font-weight: 400; color: var(--muted); }

.fuss {
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}
.fuss nav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.fuss a { color: var(--muted); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link:hover, .fuss a:hover { color: var(--ink); }
.leise { font-size: .85rem; }

/* Fenster für Impressum/Datenschutz/AGB (Aufbau wie in der App) */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(10, 20, 25, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); color: var(--ink); border-radius: var(--radius); padding: 20px 24px 24px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-box .toolbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; }
.modal-box .toolbar h2 { margin: 0; font-size: 1.3rem; }
.modal-box .spacer { flex: 1; }
.modal-box .btn { padding: 8px 14px; }
.legal { font-size: .95rem; line-height: 1.55; }
.legal h3 { margin: 18px 0 4px; font-size: 1rem; }
.legal p { margin: 0 0 8px; }
.lg-draft { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); border-radius: var(--radius-btn); padding: 8px 12px; font-size: .9rem; }
.lg-missing { color: var(--bad); }

/* Eigene Seiten Impressum, Datenschutz, AGB (erzeugt von werkzeuge/rechtstexte.ps1) */
.recht .legal h2 { font-size: 1.1rem; margin: 22px 0 6px; }
.recht .legal p { margin: 0 0 10px; }
.lg-widerspruch { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: var(--radius-btn); padding: 12px 16px; }
.drucken-hinweis { margin-top: 28px; }
.fuss a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: none; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .kopf .kontakt-link, .fuss nav, .drucken-hinweis, .aufbau { display: none; }
  .lg-widerspruch { background: none; border: 1px solid #000; }
  a { color: inherit; }
}

/* Tablet und Handy */
@media (max-width: 1000px) { .karten { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .held { grid-template-columns: 1fr; gap: 36px; padding-top: 24px; }
  .muster { max-width: 460px; width: 100%; margin: 0 auto; }
  .karten { grid-template-columns: repeat(2, 1fr); }
  .datenschutz, .fuerwen, .entfernung { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .kopf, main, .fuss { padding-left: 16px; padding-right: 16px; }
  .aufbau { position: static; font-size: .85rem; justify-content: flex-start; text-align: left; }
  .karten, .preis-reihe { grid-template-columns: 1fr; }
  .liste-funktionen { columns: 1; }
  .kopf-links { gap: 12px; }
  .blatt { transform: none; padding: 16px 14px 14px; font-size: .8rem; }
  .btn.primaer { display: block; text-align: center; }
  .block { padding: 36px 0; }
  .modal { padding: 0; }
  .modal-box { border-radius: 0; min-height: 100%; padding: 16px; }
}

/* Ratgeber-Seiten: eine Überschriften-Ebene (h2), gleichmäßige Abstände statt Trennlinien */
.ratgeber { max-width: 760px; padding-top: 16px; padding-bottom: 48px; }
.ratgeber section { padding: 22px 0 4px; }
.ratgeber section h2 { font-size: 1.3rem; margin-bottom: .6em; }
.ratgeber .lead { margin-bottom: 1.4em; }
.ratgeber .klein { font-size: .88rem; }
/* Tabellen: passen am Desktop in die Textspalte (Text bricht um); auf schmalen Bildschirmen scrollt nur der Tabellenrahmen quer, nie die Seite */
.tabelle { overflow-x: auto; max-width: 100%; margin: 0 0 1em; -webkit-overflow-scrolling: touch; }
.ratgeber table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: .95rem; }
.ratgeber th, .ratgeber td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; hyphens: auto; -webkit-hyphens: auto; }
.ratgeber th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.ratgeber td:first-child { font-weight: 700; }
.ratgeber .r { text-align: right; white-space: nowrap; }
.ratgeber tfoot td { border-bottom: 0; }
.punkte { padding-left: 1.2em; margin: 0 0 1em; }
.punkte li { margin-bottom: .6em; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 1.2em; }
.kasten { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.kasten ul { margin: 0; padding-left: 1.2em; }
.kasten li { margin-bottom: .5em; }
.kasten.gut { border-top: 4px solid var(--accent); }
.kasten.nein { border-top: 4px solid var(--bad); }
.anschrift { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin: 0 0 1em; display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: .92rem; }
.hinweis-klarziffer { background: var(--accent-soft); border-radius: var(--radius); padding: 24px !important; margin: 24px 0; border-top: 0 !important; }
.quellen li { margin-bottom: .4em; }
@media (max-width: 700px) { .zwei { grid-template-columns: 1fr; } }
.weitere { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.weitere ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
@media (max-width: 700px) { .weitere ul { grid-template-columns: 1fr; } }
.ratgeber-liste { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ratgeber-liste a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--ink); font-weight: 600; height: 100%; }
.ratgeber-liste a:hover { border-color: var(--accent); }
.ratgeber-liste span { display: block; color: var(--muted); font-weight: 400; font-size: .9rem; margin-top: 4px; }
.hinweis-recht { color: var(--muted); font-size: .82rem; line-height: 1.5; margin: 32px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.hinweis-recht b { font-weight: 600; }
.kasten-titel { font-weight: 700; margin: 0 0 .5em; }
.ratgeber .hinweis-klarziffer h2 { font-size: 1.1rem; }
.ratgeber .quellen { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.ratgeber .quellen h2, .weitere h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .8em; }
.ratgeber-alle { margin: 16px 0 0; font-weight: 600; }
.ratgeber-alle a::after { content: " →"; }
.ratgeber-gruppe { margin: 28px 0 .2em; }
h2.ratgeber-gruppe { font-size: 1.3rem; }
h3.ratgeber-gruppe { font-size: 1.1rem; }
.ratgeber-gruppe + .muted { margin: 0; }
.weitere-gruppen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.weitere-gruppen ul { display: block; }
.weitere-gruppen li { margin-bottom: 6px; }
.weitere-titel { font-weight: 700; margin: 0 0 .5em; }
@media (max-width: 700px) { .weitere-gruppen { grid-template-columns: 1fr; } }
