/* H2 Produktfinder 3.3 – mobil zuerst (360 px), ohne Framework und ohne externe Abhängigkeiten */
:root {
  --primaer: #008080;
  --primaer-dunkel: #006666;
  --primaer-hell: #e3f1f1;
  --akzent: #f5b800;
  --hintergrund: #f5f8f8;
  --karte: #ffffff;
  --text: #1a2e2e;
  --text-leise: #4a6363;
  --rand: #d5e3e3;
  --warnung: #8a5a00;
  --warnung-hell: #fff4d6;
  --fehler: #9b2c2c;
  --ok: #1d6b3a;
  --radius: 14px;
  --schatten: 0 2px 10px rgba(0, 50, 50, .08);
  --kopf: 64px;
  --leiste: 72px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primaer: #5cc2c2;
    --primaer-dunkel: #7fd3d3;
    --primaer-hell: #173a3d;
    --hintergrund: #0f1f22;
    --karte: #182c30;
    --text: #eef4f4;
    --text-leise: #b5c8c9;
    --rand: #33505a;
    --warnung: #ffd27a;
    --warnung-hell: #3a3010;
    --fehler: #ff9d9d;
    --ok: #8fd6a8;
    --schatten: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf) + 12px); }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  background: var(--hintergrund);
  color: var(--text);
  padding-bottom: calc(var(--leiste) + env(safe-area-inset-bottom));
}
button, input, summary { font: inherit; color: inherit; }
button, summary, label.karte { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
small { font-size: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; padding: 10px 14px; background: var(--akzent); color: #1a1a1a; z-index: 200; border-radius: 8px; }
.skip-link:focus { top: 8px; }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 50; background: #008080; color: #fff; box-shadow: var(--schatten); }
.kopf-innen { max-width: 1200px; height: var(--kopf); margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marke { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; }
.marke img { height: 40px; width: auto; display: block; }
.kopf-knopf { min-height: 48px; padding: 0 14px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; background: transparent; color: #fff; font-size: 16px; }

/* Rahmen */
.rahmen { max-width: 1200px; margin: 0 auto; padding: 12px 16px 24px; }
.spalten { display: block; }
.verlauf { outline: none; }
.vorschau { display: none; }

/* Fortschritt und Abschnitte des Verlaufs */
.balken { position: sticky; top: var(--kopf); z-index: 40; height: 6px; border-radius: 3px; background: var(--rand); overflow: hidden; }
.balken span { display: block; height: 100%; background: var(--primaer); transition: width .3s; }
.abschnitt { margin: 0 0 8px; padding: 0 0 8px; }
.abschnitt + .abschnitt { border-top: 1px solid var(--rand); padding-top: 20px; }
.abschnitt-kopf { margin: 22px 0 14px; }
.abschnitt-nr { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primaer-dunkel); }
.abschnitt-kopf h2 { margin: 2px 0 0; font-size: 22px; outline: none; }
.abschnitt-kopf .unterzeile { margin: 4px 0 0; }
.ueberspringen { width: 100%; margin-top: 4px; }
.ausblick { margin: 6px 0 0; color: var(--text-leise); font-size: 16px; }
.ergebnis { display: block; margin-top: 24px; padding-top: 8px; border-top: 2px solid var(--rand); }

/* Frage */
.frage { margin: 0 0 22px; }
.frage fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.frage legend { padding: 0; margin-bottom: 12px; width: 100%; }
.frage h3 { font-size: 21px; font-weight: 700; outline: none; margin: 0; }
/* Beantwortete Fragen bleiben lesbar, treten aber zurück */
.frage.beantwortet { opacity: .72; }
.frage.beantwortet:focus-within, .frage.beantwortet:hover { opacity: 1; }
/* Beantwortet heißt kompakt, nicht verborgen: jede Antwort bleibt mit einem Tipp änderbar */
.frage.beantwortet .karte { min-height: 48px; padding: 8px 12px; }
.frage.beantwortet .karte .skizze { display: none; }
.frage.beantwortet .karte:not(.aktiv) small { display: none; }
.frage.beantwortet .hilfe { display: none; }
.frage.beantwortet h3 { font-size: 17px; color: var(--text-leise); }
.unterzeile { margin: -4px 0 12px; color: var(--text-leise); font-size: 16px; }
.hilfe { margin: 0 0 14px; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--karte); }
.hilfe summary { min-height: 48px; display: flex; align-items: center; padding: 0 14px; color: var(--primaer-dunkel); font-weight: 600; list-style: none; }
.hilfe summary::-webkit-details-marker { display: none; }
.hilfe summary::before { content: "ⓘ"; margin-right: 8px; font-size: 20px; }
.hilfe-inhalt { padding: 0 14px 14px; }
.hilfe-inhalt p { margin: 8px 0 0; }
/* Antwortmöglichkeiten stehen immer als volle Zeilen untereinander, nie nebeneinander:
   eine Spalte liest sich auf jedem Bildschirm gleich und lässt Platz für große Bilder. */
.karten { display: grid; grid-template-columns: 1fr; gap: 10px; }
.karte {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 14px;
  border: 2px solid var(--rand);
  border-radius: var(--radius);
  background: var(--karte);
  box-shadow: var(--schatten);
  transition: border-color .15s, background .15s;
}
.karte input { position: absolute; opacity: 0; pointer-events: none; }
/* „Keine Auswahl“ ist ein Knopf und keine Option – er soll trotzdem wie eine Karte aussehen */
button.karte { width: 100%; text-align: left; font: inherit; color: inherit; }
.karte:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 2px; }
.karte.aktiv { border-color: var(--primaer); background: var(--primaer-hell); }
.karte.gesperrt { opacity: .55; cursor: not-allowed; }
.karte-text { flex: 1; display: flex; flex-direction: column; }
.karte-text strong { font-size: 18px; font-weight: 600; }
.karte-text small { color: var(--text-leise); font-size: 16px; }
.karte-text .grund { color: var(--fehler); }
.karte input[type="checkbox"] + .karte-text::before { content: ""; }
.zahl { min-width: 36px; padding: 2px 8px; border-radius: 999px; background: var(--hintergrund); color: var(--text-leise); font-size: 16px; text-align: center; }
.karte-unbekannt { border-style: dashed; box-shadow: none; }
.skizze { flex: none; width: 112px; height: 84px; color: var(--primaer-dunkel); display: flex; align-items: center; justify-content: center; }
.skizze svg { width: 100%; height: 100%; }
.skizze.gross { width: 100%; max-width: 420px; height: auto; aspect-ratio: 4 / 3; margin: 0 auto; }
.frage-zeichen { font-size: 34px; font-weight: 700; }
.haupt, .neben { min-height: 52px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 17px; }
.haupt { border: 0; background: var(--primaer); color: #fff; }
@media (prefers-color-scheme: dark) { .haupt { color: #0f1f22; } }
.haupt:disabled { opacity: .5; cursor: not-allowed; }
.neben { border: 2px solid var(--primaer); background: transparent; color: var(--primaer-dunkel); }
.mass-feld { display: flex; align-items: center; gap: 10px; max-width: 260px; }
.mass-feld input { width: 100%; min-height: 60px; padding: 0 14px; border: 2px solid var(--rand); border-radius: var(--radius); background: var(--karte); font-size: 26px; }
.mass-feld input:focus { border-color: var(--primaer); outline: none; }
.mass-feld span:last-child { font-size: 20px; color: var(--text-leise); }

/* Angaben */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 6px 14px; border: 1px solid var(--rand); border-radius: 999px; background: var(--karte); font-size: 16px; text-align: left; }

/* Schnellwahl: die Abkürzung am Anfang des Verlaufs */
.schnellwahl {
  margin: 14px 0 6px; padding: 14px;
  border: 2px dashed var(--rand); border-radius: var(--radius); background: var(--karte);
}
.schnell-text { margin: 0 0 10px; color: var(--text-leise); font-size: 16px; }
.schnell-erledigt { margin: -4px 0 10px; color: var(--ok); font-size: 16px; font-weight: 600; }
.schnell-knoepfe { display: grid; gap: 10px; }
.schnell-knopf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; padding: 10px 18px; border-radius: var(--radius); text-align: center; }
.schnell-knopf small { font-size: 14px; font-weight: 400; opacity: .85; }
.leiste-schnell { padding: 0 14px; font-size: 16px; }

/* Leiste unten */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--leiste); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--karte); border-top: 1px solid var(--rand); box-shadow: 0 -2px 12px rgba(0, 50, 50, .08);
}
.leiste .haupt, .leiste .neben { min-height: 48px; }
.leiste-zahl { font-size: 16px; }
.leiste-zahl b { font-size: 22px; color: var(--primaer-dunkel); }

/* Ergebnis */
.ergebnis-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ergebnis-kopf .neben { min-height: 48px; font-size: 16px; }
.ergebnis-titel { font-size: 24px; margin: 10px 0 14px; outline: none; }
.hinweis-box { padding: 12px 14px; border-radius: var(--radius); background: var(--warnung-hell); color: var(--warnung); }
.loesung { margin: 14px 0; padding: 18px 16px; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--karte); box-shadow: var(--schatten); }
.loesung.empfohlen { border: 2px solid var(--primaer); }
.rang { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primaer-dunkel); }
.code { font-size: 30px; margin: 2px 0; }
.titel { margin: 0; font-weight: 600; }
.zweck { margin: 4px 0 0; color: var(--text-leise); }
.status { display: inline-block; margin: 10px 0 0; padding: 4px 12px; border-radius: 999px; font-size: 16px; font-weight: 600; }
.status-passt { background: #e1f3e7; color: var(--ok); }
.status-pruefen { background: var(--warnung-hell); color: var(--warnung); }
@media (prefers-color-scheme: dark) { .status-passt { background: #16352a; } }
.loesung h3 { margin: 16px 0 6px; font-size: 16px; }
.loesung ul { margin: 0; padding-left: 20px; }
.loesung li { margin: 3px 0; }
.pruefliste { list-style: none; padding-left: 0 !important; }
.pruefliste li { position: relative; padding-left: 30px; }
.pruefliste li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border: 2px solid var(--primaer); border-radius: 4px; }
.abweichung { margin: 10px 0 0; color: var(--warnung); font-size: 16px; }
.einbau { margin: 10px 0 0; }
.loesung details { margin-top: 12px; }
.loesung summary, .liste summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; color: var(--primaer-dunkel); }
.quelle { margin: 14px 0 0; font-size: 16px; color: var(--text-leise); }
.liste { margin: 14px 0; padding: 4px 16px 12px; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--karte); }
.liste ol, .liste ul { padding-left: 20px; margin: 4px 0 0; }
.liste li { margin: 6px 0; }
.ausgeschlossen .art { display: inline-block; margin-right: 4px; padding: 0 8px; border-radius: 6px; background: var(--hintergrund); font-size: 16px; font-weight: 700; }
.notizen { margin: 14px 0; padding: 14px 16px; border-radius: var(--radius); background: var(--primaer-hell); }
.notizen h2 { font-size: 17px; }
.notizen p { margin: 6px 0 0; }
.schluss { margin: 24px 0 0; color: var(--text-leise); font-size: 16px; }
.ausgeblendet { color: var(--text-leise); font-size: 16px; }
.link { min-height: 48px; padding: 0 4px; border: 0; background: none; color: var(--primaer-dunkel); font-weight: 600; text-decoration: underline; }

/* Vorschau (nur breite Bildschirme) */
.vorschau h2 { font-size: 20px; }
.vorschau-liste { list-style: none; margin: 12px 0; padding: 0; }
.vorschau-liste li { padding: 10px 0; border-top: 1px solid var(--rand); display: flex; flex-direction: column; }
.vorschau-liste strong { font-size: 18px; }
.vorschau-liste span { color: var(--text-leise); font-size: 16px; }
.vorschau-aus, .vorschau-leer { color: var(--text-leise); }

/* Fuß */
.fuss { max-width: 1200px; margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--text-leise); font-size: 16px; }

@media (min-width: 600px) {
  .rahmen { padding: 20px 24px 32px; }
  /* Mehr Platz heißt größeres Bild, nicht zwei Spalten */
  .skizze { width: 150px; height: 112px; }
  .karte { min-height: 92px; }
  .schnell-knoepfe { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .frage h3 { font-size: 24px; }
  .frage.beantwortet h3 { font-size: 17px; }
  .loesung { padding: 22px 24px; }
}

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .leiste { display: none; }
  .spalten { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
  .vorschau { display: block; position: sticky; top: calc(var(--kopf) + 20px); padding: 20px; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--karte); box-shadow: var(--schatten); }
  .karte:hover { border-color: var(--primaer); }
}

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

@media print {
  .kopf, .leiste, .vorschau, .balken, .ueberspringen, .abschnitt .frage { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
  .loesung details { display: block; }
}

/* Ergebnis: Abgleich der Angaben und Eigenschaften der Lösung */
.warum-rudi { margin: .6rem 0 0; font-size: .95rem; color: var(--text-leise); }
.abgleich, .eigenschaften { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .45rem; }
.abgleich li { display: flex; gap: .55rem; align-items: start; }
.abgleich .zeichen {
    flex: 0 0 1.55rem; height: 1.55rem; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: .95rem; background: var(--rand); color: var(--text);
}
.abgleich li.urteil-ja .zeichen { background: var(--primaer-hell); color: var(--ok); }
.abgleich li.urteil-nein .zeichen { background: var(--warnung-hell); color: var(--fehler); }
.abgleich-text { flex: 1; }
.abgleich small, .eigenschaften small { display: block; color: var(--text-leise); }
.eigenschaften li { padding-left: .9rem; position: relative; }
.eigenschaften li::before { content: "·"; position: absolute; left: 0; font-weight: 700; }
.eigenschaften small { display: inline; }

/* Warum steht diese Lösung vorn */
.warum-zuerst { margin: .8rem 0 0; padding: .7rem .9rem; border-left: 3px solid var(--primaer); background: var(--primaer-hell); border-radius: 0 var(--radius) var(--radius) 0; }
.warum-zuerst h3 { margin: 0 0 .3rem; font-size: 1rem; }
.warum-zuerst p { margin: .2rem 0; font-size: .95rem; }
.weg-liste { margin: .4rem 0 .6rem; padding-left: 1.3rem; display: grid; gap: .5rem; }
.weg-liste li { line-height: 1.45; }

/* Varianten ohne eigenes Datenblatt: woher ihre Maße stammen */
.herkunft {
  margin: .8rem 0 0;
  padding: .7rem .9rem;
  border-left: 3px solid var(--rand);
  background: var(--hintergrund);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}
.herkunft.achtung { border-left-color: var(--warnung); background: var(--warnung-hell); }
.herkunft small { color: var(--text-leise); }

/* Hinweistabelle der Katalogseite */
table.hinweise { width: 100%; border-collapse: collapse; font-size: .92rem; margin: .4rem 0 0; }
table.hinweise th,
table.hinweise td { text-align: left; vertical-align: top; padding: .35rem .5rem; border-bottom: 1px solid var(--rand); }
table.hinweise th { color: var(--text-leise); font-weight: 600; }
table.hinweise th:first-child,
table.hinweise td:first-child { width: 4.5rem; white-space: nowrap; }
.klein { font-size: .85rem; color: var(--text-leise); margin: .4rem 0 0; }

@media (max-width: 520px) {
  table.hinweise, table.hinweise tbody, table.hinweise tr, table.hinweise td { display: block; }
  table.hinweise thead { display: none; }
  table.hinweise tr { padding: .4rem 0; border-bottom: 1px solid var(--rand); }
  table.hinweise td { border: 0; padding: .1rem 0; }
  table.hinweise td:first-child { width: auto; font-weight: 600; }
}
