/* BauCheck — Gestaltung
 *
 * Leitbild: der Plankopf. Papier, Tusche, Haarlinien, eine Akzentfarbe
 * (Planblau). Keine Verläufe, keine Schatten-Kaskaden, keine Emojis. Die
 * Statusfarben (bestanden, Hinweis, kritisch, manuell) sind die einzigen
 * bunten Flächen — sie tragen Bedeutung.
 *
 * Schriften (SIL Open Font License, selbst gehostet, kein Aufruf an Dritte):
 * Source Serif 4 für Titel und Befunde, IBM Plex Sans für die Oberfläche,
 * IBM Plex Mono für Kennungen (Regel-ID, EGRID, Paragrafen).
 */

@font-face { font-family: "Plex Sans"; src: url("fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("fonts/source-serif-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #f4f2ec;
  --paper-deep: #ebe7dd;
  --surface: #fffefb;
  --ink: #16191d;
  --ink-2: #474d55;
  --ink-3: #767c84;
  --rule: #ddd8cb;
  --rule-2: #c7c0b0;
  --accent: #1e4a6d;
  --accent-ink: #143552;
  --accent-wash: #e5ecf2;
  --ok: #2d6a43;       --ok-wash: #e3eee5;
  --warn: #875800;     --warn-wash: #f5ead2;
  --fail: #a0312a;     --fail-wash: #f4e0dc;
  --manual: #535b64;   --manual-wash: #e7e5df;
  --sans: "Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 3px;
  --measure: 1040px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "tnum" 1;
}
img, svg { display: block; }

/* ── Kopf ─────────────────────────────────────────────────────────────── */

.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.site-header .inner {
  max-width: var(--measure); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: stretch; gap: 8px 28px; flex-wrap: wrap; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand .word { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.brand .tagline { color: var(--ink-3); font-size: 0.82rem; border-left: 1px solid var(--rule); padding-left: 10px; }
.site-nav { display: flex; align-items: stretch; gap: 2px 22px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  display: flex; align-items: center; color: var(--ink-2); text-decoration: none; font-size: 0.9rem;
  border-bottom: 2px solid transparent; padding-top: 2px;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.site-nav .account { display: flex; align-items: center; gap: 12px; padding-left: 18px; border-left: 1px solid var(--rule); margin: 12px 0; }
.site-nav .account .who { color: var(--ink-2); font-size: 0.85rem; border-bottom: none; padding-top: 0; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-nav .account .who:hover { color: var(--ink); text-decoration: underline; }

/* ── Seite ────────────────────────────────────────────────────────────── */

main { max-width: var(--measure); margin: 0 auto; padding: 36px 24px 72px; }
.page-head { margin-bottom: 28px; }
.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 6px;
}
h1, h2, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 40px 0 12px; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
p { margin: 0 0 12px; }
.lede { font-size: 1.02rem; color: var(--ink-2); max-width: 68ch; margin: 0; }
.muted { color: var(--ink-2); font-size: 0.9rem; }
.quiet { color: var(--ink-3); font-size: 0.85rem; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.9rem; }
.facts li b { font-weight: 500; color: var(--ink); }
code, .mono { font-family: var(--mono); font-size: 0.84em; }
code { background: var(--paper-deep); padding: 1px 5px; border-radius: 2px; }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(30, 74, 109, 0.35); }
a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 40px 0 12px; }
.section-head h2 { margin: 0; }
.count { font-family: var(--sans); font-weight: 500; font-size: 0.85rem; color: var(--ink-3); margin-left: 6px; }

/* ── Flächen ──────────────────────────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.card.attention { border-left: 3px solid var(--warn); }
.card-title { font-weight: 600; margin: 0 0 4px; }
.backlinks { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 0.9rem; display: flex; gap: 6px 20px; flex-wrap: wrap; }

/* ── Formulare ────────────────────────────────────────────────────────── */

label { font-size: 0.82rem; font-weight: 500; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--ink);
  min-height: 42px; padding: 8px 11px;
  border: 1px solid var(--rule-2); border-radius: var(--radius); background: #fff;
}
input::placeholder { color: #a39d90; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
input[type="file"] { min-height: 0; padding: 10px; background: var(--paper); border-style: dashed; width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 0.88rem; margin-right: 12px; padding: 7px 12px;
  border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer;
}
/* align-items: end — zweizeilige Beschriftungen verschieben die Felder nicht. */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; align-items: end; }
.grid label { display: block; margin-bottom: 5px; }
.grid input, .grid select { width: 100%; }
.grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hint { color: var(--ink-3); font-size: 0.84rem; margin: 6px 0 0; }

button, .btn {
  font: inherit; font-size: 0.92rem; font-weight: 500; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: #fff; border: 1px solid var(--accent); text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-2); }
button.secondary:hover, .btn.secondary:hover { background: var(--paper); border-color: var(--ink-3); color: var(--ink); }
button.danger { background: transparent; color: var(--fail); border-color: transparent; padding: 0 8px; }
button.danger:hover { background: var(--fail-wash); color: var(--fail); border-color: transparent; }
button.small, .btn.small { min-height: 34px; padding: 0 12px; font-size: 0.85rem; }
button.link { background: none; border: none; color: var(--ink-2); padding: 0; min-height: 0; font-size: 0.9rem; }
button.link:hover { color: var(--ink); background: none; }
form.inline { display: inline; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }

/* Dreiwertige Antworten als Segmentschalter — die Radios bleiben Radios. */
.segmented { display: inline-flex; border: 1px solid var(--rule-2); border-radius: var(--radius); background: #fff; overflow: hidden; flex-shrink: 0; }
.segmented label { position: relative; margin: 0; font-size: 0.88rem; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.segmented label + label { border-left: 1px solid var(--rule-2); }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; }
.segmented span { display: block; padding: 8px 14px; white-space: nowrap; }
.segmented label:hover span { background: var(--paper); color: var(--ink); }
.segmented input:checked + span { background: var(--ink); color: var(--surface); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }

/* ── Tabellen ─────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th {
  text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 12px 10px 0; border-bottom: 1px solid var(--ink);
}
td { text-align: left; padding: 13px 12px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td .sub { display: block; color: var(--ink-3); font-size: 0.8rem; margin-top: 2px; }
tbody tr:hover td { background: #fbfaf6; }
td.actions { white-space: nowrap; text-align: right; }

/* ── Status ───────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 2px; font-family: var(--sans);
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; vertical-align: 1px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.PASS { background: var(--ok-wash); color: var(--ok); }
.pill.WARNING { background: var(--warn-wash); color: var(--warn); }
.pill.FAIL { background: var(--fail-wash); color: var(--fail); }
.pill.MANUAL_REVIEW { background: var(--manual-wash); color: var(--manual); }
.pill.plain::before { display: none; }

/* Kennzahlen wie ein Plankopf: Felder mit Haarlinien. */
.tally { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 16px; }
.tally > div { padding: 16px 20px; border-left: 1px solid var(--rule); }
.tally > div:first-child { border-left: none; }
.tally .n { font-family: var(--serif); font-size: 2rem; line-height: 1; display: block; margin-bottom: 6px; }
.tally.drei { grid-template-columns: repeat(3, 1fr); }
.tally .l { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.tally .FAIL .n { color: var(--fail); }
.tally .WARNING .n { color: var(--warn); }
.tally .MANUAL_REVIEW .n { color: var(--manual); }
.tally .PASS .n { color: var(--ok); }
.tally .zero .n { color: var(--rule-2); }

/* ── Befunde ──────────────────────────────────────────────────────────── */

.finding { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--manual); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px; }
.finding.FAIL { border-left-color: var(--fail); }
.finding.WARNING { border-left-color: var(--warn); }
.finding.MANUAL_REVIEW { border-left-color: var(--manual); }
.finding.PASS { border-left-color: var(--ok); }
.finding .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.finding h3 { font-size: 1.02rem; margin: 0; }
.finding .meta { color: var(--ink-3); font-size: 0.8rem; margin: 0 0 10px; }
.finding .meta .mono { font-size: 0.78rem; }
.finding p { margin-bottom: 8px; }
.finding dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 0.85rem; color: var(--ink-2); margin: 10px 0 0; }
.finding dt { color: var(--ink-3); }
.finding dd { margin: 0; }
.finding .action { background: var(--accent-wash); border-radius: var(--radius); padding: 10px 14px; margin-top: 12px; font-size: 0.92rem; }
.finding .action b { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.finding .sources { font-size: 0.82rem; color: var(--ink-3); margin: 10px 0 0; }

/* ── Meldungen ────────────────────────────────────────────────────────── */

.flash, .error {
  border: 1px solid var(--rule); border-left: 3px solid var(--accent); background: var(--surface);
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 0.92rem;
}
.error { border-left-color: var(--fail); background: #fdf6f4; }
.flash ul, .error ul { margin: 6px 0 0; padding-left: 18px; }
.disclaimer {
  margin-top: 40px; padding: 16px 20px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
  font-size: 0.86rem; color: var(--ink-2); background: transparent;
}
.disclaimer strong { color: var(--ink); }

/* ── Vorabklärung ─────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 0 26px; border-bottom: 1px solid var(--rule); margin: 0 0 26px; flex-wrap: wrap; }
.tabs a, .tabs strong { padding: 0 0 10px; font-size: 0.95rem; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a { color: var(--ink-2); }
.tabs a:hover { color: var(--ink); }
.tabs strong { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
/* Kantonswahl: eine Zeile; wird sie zu breit (Handy), wischt man seitwärts. */
.switch { display: inline-flex; align-items: center; gap: 0; max-width: 100%; border: 1px solid var(--rule-2); border-radius: var(--radius); overflow-x: auto; scrollbar-width: thin; background: #fff; font-size: 0.88rem; }
.switch > span.label { padding: 7px 12px; color: var(--ink-3); border-right: 1px solid var(--rule-2); background: var(--paper); position: sticky; left: 0; }
.switch > * { flex: none; white-space: nowrap; }
.switch a, .switch strong { padding: 7px 14px; text-decoration: none; }
.switch a { color: var(--ink-2); }
.switch a:hover { background: var(--paper); color: var(--ink); }
.switch strong { background: var(--ink); color: var(--surface); font-weight: 500; }
.basis { margin: 14px 0 0; }
/* Sprungziele nach dem Absenden (#ergebnis, #standort): nicht am Rand kleben. */
#ergebnis, #standort { scroll-margin-top: 16px; }

.fragen { width: 100%; border-collapse: collapse; margin-top: 8px; }
.fragen td { padding: 18px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.fragen tr:first-child td { border-top: 1px solid var(--ink); }
.fragen tr:last-child td { border-bottom: none; }
.fragen tbody tr:hover td { background: transparent; }
.fragen .frage { padding-right: 24px; }
.fragen .frage b { display: block; font-weight: 500; color: var(--ink); margin-bottom: 3px; }
.fragen .frage .hilfe { display: block; color: var(--ink-3); font-size: 0.86rem; }
.fragen td.antwort { width: 1%; text-align: right; }
.vorschlag { margin-top: 10px; padding: 8px 12px; background: var(--accent-wash); border-radius: var(--radius); font-size: 0.86rem; color: var(--ink-2); }
.vorschlag b { color: var(--ink); }
.vorschlag.abweichend { background: var(--warn-wash); }
.gruppe { margin-top: 26px; }
.gruppe > h3 { font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
.gruppe > .hint { margin: 0 0 8px; }

.verdict { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.verdict .band { padding: 20px 24px 18px; border-bottom: 1px solid var(--rule); border-top: 4px solid var(--manual); }
.verdict.bewilligungsfrei .band, .verdict.meldeverfahren .band { border-top-color: var(--ok); }
.verdict.bewilligungspflichtig .band { border-top-color: var(--warn); }
.verdict.offen .band { border-top-color: var(--manual); }
.verdict .result { font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; margin: 2px 0 0; }
.verdict .procedure { margin: 8px 0 0; color: var(--ink-2); }
.verdict .procedure b { color: var(--ink); font-weight: 600; }
.verdict .body { padding: 18px 24px 20px; }
.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 0.93rem; }
.reasons li:first-child { padding-top: 0; }
.reasons li:last-child { border-bottom: none; padding-bottom: 0; }
/* Keine Monospace für Paragrafen: «lit. l» darf nicht wie «lit. 1» aussehen. */
.reasons .ref { font-size: 0.8rem; color: var(--ink-3); white-space: nowrap; text-align: right; padding-top: 1px; }
.verdict .foot { padding: 12px 24px; background: var(--paper); border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--ink-2); }
.checklist { margin: 8px 0 0; padding-left: 20px; }
.checklist li { margin-bottom: 4px; }

.questions { counter-reset: q; list-style: none; margin: 0; padding: 0; }
.questions li { counter-increment: q; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.questions li:first-child { padding-top: 0; }
.questions li:last-child { border-bottom: none; padding-bottom: 0; }
.questions li::before {
  content: counter(q); font-family: var(--mono); font-size: 0.8rem; color: var(--accent);
  border: 1px solid var(--rule-2); border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center;
}
.questions li:first-child::before { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Anmeldung ────────────────────────────────────────────────────────── */

.login { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start; padding-top: 24px; }
.login h1 { font-size: 2.4rem; }
.login .points { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.login .points li { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 120px 1fr; gap: 14px; font-size: 0.93rem; }
.login .points b { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.login .card { padding: 28px; }
.login .card h2 { margin: 0 0 18px; font-size: 1.3rem; }

/* ── Fuss ─────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .inner { max-width: var(--measure); margin: 0 auto; padding: 18px 24px 28px; display: flex; gap: 6px 20px; flex-wrap: wrap; color: var(--ink-3); font-size: 0.8rem; }
.site-footer a { color: var(--ink-3); }
.site-footer .ubivo { margin-left: auto; }

/* ── Startseite und Ratgeber ───────────────────────────────────────────── */

.hero h1 { font-size: 2.3rem; max-width: 22ch; }
.kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 0; }
.kachel { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
a.kachel:hover { border-color: var(--ink-3); }
.kachel b { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.kachel span { color: var(--ink-2); font-size: 0.92rem; }
.kachel .eyebrow { margin: 0; }
.kachel .mehr { margin-top: auto; padding-top: 8px; color: var(--accent); font-weight: 500; }
.kachel a { padding: 4px 0; }
.schritte { list-style: none; counter-reset: schritt; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.schritte li { counter-increment: schritt; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--ink); }
.schritte li::before { content: counter(schritt); font-family: var(--mono); color: var(--accent); }
.schritte span { color: var(--ink-2); font-size: 0.92rem; }
.brotkrumen { font-size: 0.82rem; color: var(--ink-3); margin: 0 0 14px; }
.brotkrumen a { color: var(--ink-3); }
.kurz { margin: 0 0 8px; padding: 18px 22px; background: var(--accent-wash); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.kurz .eyebrow { margin: 0 0 6px; }
.kurz ul { margin: 0; padding-left: 18px; }
.kurz li + li { margin-top: 6px; }

/* ── Handy ────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  body { font-size: 15px; }
  .site-header .inner { padding: 10px 16px 0; gap: 4px 16px; position: relative; }
  .brand .tagline { display: none; }
  .site-nav { margin-left: 0; width: 100%; gap: 0 18px; overflow-x: auto; flex-wrap: nowrap; }
  .site-nav a { padding: 10px 0 8px; white-space: nowrap; }
  /* Abmelden oben rechts in der Logozeile, nicht hinter dem Wischbereich. */
  .site-nav .account { position: absolute; top: 12px; right: 16px; margin: 0; padding: 0; border: none; }
  .site-nav .account .who { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; border: none; }
  main { padding: 24px 16px 56px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.15rem; margin-top: 32px; }
  .card { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .tally { grid-template-columns: repeat(2, 1fr); }
  .tally > div:nth-child(3) { border-left: none; }
  .tally > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .tally.drei { grid-template-columns: 1fr; }
  .tally.drei > div { border-left: none; }
  .tally.drei > div + div { border-top: 1px solid var(--rule); }
  .finding { padding: 16px; }
  .finding dl { grid-template-columns: 1fr; }
  .verdict .band, .verdict .body { padding-left: 16px; padding-right: 16px; }
  .reasons li { grid-template-columns: 1fr; }
  .reasons .ref { text-align: left; }
  .fragen, .fragen tbody, .fragen tr, .fragen td { display: block; width: 100%; }
  .fragen tr { border-bottom: 1px solid var(--rule); padding: 14px 0; }
  .fragen tr:first-child { border-top: 1px solid var(--ink); }
  .fragen tr:last-child { border-bottom: none; }
  .fragen td { border: none !important; padding: 0; }
  .fragen .frage { padding-right: 0; }
  .fragen td.antwort { width: 100%; text-align: left; margin-top: 10px; }
  .fragen select { max-width: 100% !important; width: 100%; }
  .login { grid-template-columns: 1fr; gap: 28px; padding-top: 0; }
  .login h1 { font-size: 1.9rem; }
  .login .points li { grid-template-columns: 1fr; gap: 2px; }
  .hero h1 { font-size: 1.8rem; }
  .kacheln, .schritte { grid-template-columns: 1fr; }
}

/* ── Formularabschnitte (Vorabklärungen) ──────────────────────────────── */

fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
fieldset + fieldset { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--rule); }
legend {
  float: left; width: 100%; padding: 0; margin: 0 0 14px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3);
}
legend + * { clear: both; }
legend .n { font-family: var(--mono); font-weight: 400; color: var(--accent); margin-right: 10px; letter-spacing: 0; }
.verdict .eyebrow { margin-bottom: 4px; }

/* ── Preise und Konto ─────────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.plan { padding: 24px 22px 22px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; }
.plan:first-child { border-left: none; }
.plan.featured { box-shadow: inset 0 4px 0 var(--accent); }
.plan .price { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; margin: 4px 0 0; }
.plan .price span { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-3); font-weight: 400; }
.plan .price.second { font-size: 1.35rem; margin-top: 6px; }
.plan .for { color: var(--ink-2); font-size: 0.9rem; margin: 10px 0 14px; }
.plan ul { list-style: none; margin: 0 0 18px; padding: 14px 0 0; border-top: 1px solid var(--rule); font-size: 0.9rem; flex: 1; }
.plan li { padding: 4px 0 4px 18px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 7px; height: 1px; background: var(--ink); }
.plan .cta { display: flex; flex-direction: column; gap: 8px; }
.plan .cta button, .plan .cta .btn, .plan .cta form { width: 100%; }
.plan .hint { margin-top: 8px; }
.facts-list { list-style: none; margin: 0; padding: 0; }
.facts-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 0.92rem; }
.facts-list li:first-child { padding-top: 0; }
.facts-list li:last-child { border-bottom: none; padding-bottom: 0; }
.upsell { display: flex; gap: 12px 18px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; font-size: 0.93rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

/* Rechtliches: lesbare Zeilenlänge, ruhige Abschnitte */
.legal { max-width: 76ch; line-height: 1.6; }
.legal h2 { font-size: 1.08rem; margin: 30px 0 8px; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--ink-2); font-size: 0.95rem; }
.legal b { color: var(--ink); font-weight: 600; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }

@media (max-width: 960px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
  .plan:nth-child(3) { border-left: none; }
  .plan:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .plans { grid-template-columns: 1fr; }
  .plan { border-left: none; }
  .plan + .plan { border-top: 1px solid var(--rule); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}

/* ── Hilfsklassen statt style-Attributen ─────────────────────────────────
   Die CSP erlaubt keine Inline-Styles (style-src 'self'). Diese Klassen
   ersetzen die früheren style="…"-Attribute; !important hält deren Vorrang
   vor den Komponenten-Regeln (auch in Media Queries). */
.u-m0 { margin: 0 !important; }
.u-m6-0 { margin: 6px 0 0 !important; }
.u-m12-0 { margin: 12px 0 0 !important; }
.u-m14-0 { margin: 14px 0 0 !important; }
.u-m16-0 { margin: 16px 0 0 !important; }
.u-m24-0 { margin: 24px 0 0 !important; }
.u-m28-0 { margin: 28px 0 0 !important; }
.u-mb4-only { margin: 0 0 4px !important; }
.u-mb12-only { margin: 0 0 12px !important; }
.u-my-auto { margin: auto 0 !important; }
.u-mt0 { margin-top: 0 !important; }
.u-mt4 { margin-top: 4px !important; }
.u-mt12 { margin-top: 12px !important; }
.u-mt14 { margin-top: 14px !important; }
.u-mt16 { margin-top: 16px !important; }
.u-mt18 { margin-top: 18px !important; }
.u-mt20 { margin-top: 20px !important; }
.u-mt22 { margin-top: 22px !important; }
.u-mt24 { margin-top: 24px !important; }
.u-mb0 { margin-bottom: 0 !important; }
.u-grid-1 { grid-template-columns: 1fr !important; }
.u-nowrap { white-space: nowrap !important; }
.u-wrap-any { overflow-wrap: anywhere !important; }
.u-maxw-320 { max-width: 320px !important; }
.u-minh0 { min-height: 0 !important; }
.adresse-zeile { display: flex !important; gap: 8px !important; flex-wrap: wrap !important; margin-top: 5px !important; }
.adresse-feld { flex: 1 !important; min-width: 220px !important; }
.trenner-oben { margin-top: 18px !important; padding-top: 16px !important; border-top: 1px solid var(--ink) !important; }
.diff-verdict { font-size: 1.2rem !important; margin-bottom: 14px !important; }
.typ-form { display: flex !important; gap: 8px !important; align-items: center !important; }
.typ-wahl { min-width: 170px !important; max-width: 230px !important; }
.liste-eng { margin: 6px 0 0 16px !important; padding: 0 !important; }
.parzellen { margin-top: 10px !important; display: flex !important; gap: 8px 16px !important; flex-wrap: wrap !important; align-items: center !important; }
.parzelle { font-size: 0.9rem !important; color: var(--ink) !important; }
.error-hinweis { border-left-color: var(--warn) !important; background: var(--surface) !important; }
.regel-titel { margin: 0 0 8px !important; font-family: var(--mono) !important; font-size: 1rem !important; letter-spacing: 0 !important; }
