/* Reparaturschellen-Konfigurator – Kröner-Stil (Roboto lokal, primary #3f5aa2). Mobil zuerst, keine externen Ressourcen. */
@font-face { font-family: "Roboto"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-style: normal; font-display: swap; src: url("/static/fonts/roboto-700.woff2") format("woff2"); }

:root {
  --pri: #3f5aa2; --pri-50: #e8ebf6; --pri-100: #d3dbee; --pri-600: #31467d; --pri-700: #223159;
  --gelb: #f7e750; --gelb-2: #f4db15;
  --text: #1d2433; --text-2: #4a5468; --rand: #8a94ab; --flaeche: #ffffff; --grund: #f4f6fb;
  --gruen: #1b7a3a; --gruen-bg: #e3f4e8; --gelb-text: #7a5600; --gelb-bg: #fdf3c7; --rot: #a8231b; --rot-bg: #fbe4e2;
  --r: 8px;
  --gold: 1.618;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.45 Roboto, system-ui, "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--grund); overflow-x: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p { margin: 0 0 .5rem; }
a { color: var(--pri-600); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: var(--pri-700); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--pri); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopf: eine Zeile */
#kopf { display: flex; align-items: center; gap: .6rem; padding: .35rem 16px; background: var(--flaeche); border-bottom: 3px solid var(--pri); position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; }
#kopf .logo { height: 28px; width: auto; flex: none; }
#kopf h1 { font-size: 1rem; font-weight: 700; color: var(--pri-700); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { flex: none; background: var(--pri-50); color: var(--pri-700); border: 1px solid var(--pri-100); border-radius: 999px; padding: .15rem .7rem; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.live.laedt { opacity: .6; }
.live.keine { background: var(--gelb-bg); color: var(--gelb-text); border-color: #e6cf6a; }
.flaggenwahl { display: flex; gap: .25rem; flex: none; }
.flaggenwahl button { background: none; border: 2px solid transparent; border-radius: 4px; padding: 3px; cursor: pointer; line-height: 0; min-width: 32px; min-height: 28px; }
.flaggenwahl button[aria-pressed="true"] { border-color: var(--pri); background: var(--pri-50); }
.flagge { border: 1px solid #ccd; border-radius: 2px; display: block; }
@media (max-width: 480px) { #kopf { flex-wrap: wrap; } .flaggenwahl { flex: 1 1 100%; flex-wrap: wrap; justify-content: center; } }   /* Reflow 320 px: Flaggen in eigene Zeile */
.einbettung #kopf .logo, .einbettung #kopf h1 { display: none; }
.einbettung #kopf { position: static; justify-content: space-between; border-bottom-width: 2px; }

main { padding: .75rem 16px 1.5rem; max-width: 1320px; margin: 0 auto; }
.raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.vorschau { display: none; }
@media (min-width: 1100px) {
  .raster { grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr); gap: 1.618rem; align-items: start; }
  .vorschau { display: block; position: sticky; top: 64px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r); padding: 1rem; text-align: center; }
  .vorschau h2 { text-align: left; margin-bottom: .6rem; color: var(--pri-700); }
  .vorschauBild { display: block; margin: 0 auto .5rem; border-radius: 6px; }
  .vorschauTyp { font-size: 1.25rem; font-weight: 700; color: var(--pri-700); }
}

/* Stepper */
.stepper { display: flex; flex-direction: column; gap: .5rem; }
.schritt { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r); }
.schritt.aktiv { border: 2px solid var(--pri); box-shadow: 0 2px 10px rgba(63, 90, 162, .15); }
.schrittInhalt { padding: .7rem .75rem .75rem; }
.schrittFrage { font-size: 1.15rem; font-weight: 700; color: var(--pri-700); margin: 0 0 .6rem; }
.schrittFrage:focus { outline: none; }
.schrittFrage:focus-visible { outline: 3px solid var(--pri); outline-offset: 2px; }
.schrittFelder { display: flex; flex-direction: column; gap: .8rem; }
.schrittFehler { color: var(--rot); font-weight: 500; margin: .5rem 0 0; }
/* Kopf des Assistenten: eine Zeile (Zurück, Schritt n von m · Abschnitt, Ihre Angaben), darunter ein dünner Balken */
.fortschritt { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--r); padding: .35rem .6rem .45rem; }
.fortschrittZeile { display: flex; align-items: center; gap: .5rem; }
.fortschrittText { margin: 0; flex: 1 1 auto; min-width: 0; text-align: center; font-size: .95rem; overflow-wrap: anywhere; }
.fortschrittNr { font-weight: 700; color: var(--pri-700); }
.fortschrittAbschnitt { color: var(--text-2); }
.fortschrittBalken { display: block; width: 100%; height: 6px; margin-top: .3rem; border: 0; border-radius: 3px; background: var(--pri-100); overflow: hidden; appearance: none; }
.fortschrittBalken::-webkit-progress-bar { background: var(--pri-100); }
.fortschrittBalken::-webkit-progress-value { background: var(--pri); }
.fortschrittBalken::-moz-progress-bar { background: var(--pri); }
/* Zielgröße mindestens 44 x 44 px (WCAG 2.5.5) für Zurück und „Ihre Angaben“ */
.fortschritt .knopf.klein { min-height: 44px; min-width: 44px; padding: .15rem .6rem; white-space: nowrap; }
.zurueck, .angabenKnopf { flex: none; }
.angabenPanel { margin-top: .5rem; padding-top: .4rem; border-top: 1px solid var(--pri-100); }
.angabenTitel { font-size: .95rem; margin-bottom: .3rem; color: var(--pri-700); }
.angabenListe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; font-size: .92rem; }
.angabenListe li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .35rem; }
.angabenListe .linkknopf { min-height: 44px; min-width: 44px; padding: .2rem .5rem; }
.angabenName { color: var(--text-2); }
.angabenWert { font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 480px) { .fortschritt { padding-inline: .4rem; } .fortschrittZeile { gap: .3rem; } .fortschrittText { font-size: .88rem; } }
/* Ergebnis und Anfrage wiederholen die Empfehlung selbst: rechte Spalte „Beste Wahl bisher“ ausblenden, Platz für die Tabelle */
body[data-schritt="ergebnis"] .vorschau, body[data-schritt="anfrage"] .vorschau { display: none; }
body[data-schritt="ergebnis"] .raster, body[data-schritt="anfrage"] .raster { grid-template-columns: minmax(0, 1fr); }
.schrittNav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }

/* Felder */
.feld { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.feld.schmal { max-width: 240px; }
label, legend { font-weight: 500; font-size: .92rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .3rem; }
input[type="number"], input[type="text"], input[type="email"], input[type="tel"], input[type="search"], select, textarea {
  font: inherit; color: inherit; background: #fff; border: 1px solid #8a94ab; border-radius: 6px; padding: .5rem .6rem; min-height: 44px; width: 100%; min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
input[aria-invalid="true"] { border-color: var(--rot); background: var(--rot-bg); }
.eingabezeile { display: flex; align-items: center; gap: .4rem; }
.einheit { color: var(--text-2); white-space: nowrap; }
.hilfe { color: var(--text-2); font-size: .85rem; margin: 0; }
.hilfebox { border: 1px solid var(--pri-100); background: var(--pri-50); border-radius: 6px; padding: .4rem .7rem; }
.hilfebox summary { cursor: pointer; font-weight: 500; color: var(--pri-700); }
summary { padding-block: .3rem; }                       /* Zielgröße >= 24 px (WCAG 2.5.8) */
#fuss a, dd a { display: inline-block; padding-block: .3rem; }
.hinweisbox { background: var(--gelb-bg); border-left: 4px solid var(--gelb-2); padding: .5rem .75rem; border-radius: 4px; margin: 0 0 .6rem; }
.zeile { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; align-items: flex-start; }
.unterfelder { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; margin-top: .6rem; padding: .6rem; border-left: 3px solid var(--pri-100); }
.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; font-size: .95rem; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.block { display: flex; flex-direction: column; }
.honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Kacheln mit grünem Haken */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.kachelgruppe.klein .kacheln { grid-template-columns: repeat(auto-fill, minmax(112px, max-content)); }
.kachel { position: relative; display: flex; align-items: center; border: 1px solid var(--rand); border-radius: 8px; background: #fff; cursor: pointer; min-height: 48px; font-weight: 400; }
.kachel input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.kachelInhalt { display: flex; flex-direction: column; padding: .5rem 2rem .5rem .7rem; gap: .1rem; }
.kachelTitel { font-weight: 500; }
.kachelUnter { font-size: .82rem; color: var(--text-2); }
.haken { position: absolute; right: 8px; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: var(--gruen); display: none; }
.kachel:has(input:checked) { border: 2px solid var(--pri); background: var(--pri-50); }
.kachel:has(input:checked) .haken { display: block; }
.kachel:has(input:focus-visible) { outline: 3px solid var(--pri); outline-offset: 2px; }
.kachelgruppe > .hilfe { margin-bottom: .4rem; }

/* Knöpfe */
.knopf { font: inherit; font-weight: 500; background: var(--pri); color: #fff; border: 2px solid var(--pri); border-radius: 6px; padding: .55rem 1.1rem; min-height: 44px; cursor: pointer; }
.knopf:hover:not(:disabled) { background: var(--pri-600); border-color: var(--pri-600); }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf.sekundaer { background: #fff; color: var(--pri-700); }
.knopf.sekundaer:hover:not(:disabled) { background: var(--pri-50); color: var(--pri-700); }
.knopf.klein { padding: .25rem .7rem; min-height: 36px; font-size: .9rem; }
.linkknopf { background: none; border: 0; color: var(--pri-600); text-decoration: underline; font: inherit; cursor: pointer; padding: .2rem; min-height: 32px; }

/* Ergebnis */
.ergebnis { display: flex; flex-direction: column; gap: .8rem; }
.empfehlung { border: 2px solid var(--pri); border-radius: var(--r); padding: .8rem; background: var(--flaeche); }
.empfehlungInnen { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; align-items: start; }
@media (min-width: 640px) { .empfehlungInnen { grid-template-columns: minmax(0, 1fr) minmax(0, 1.618fr); } }
.produktbild { border-radius: 6px; border: 1px solid var(--rand); background: #fff; display: block; }
.empfehlungKopf { font-size: 1.15rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.werte { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .15rem .8rem; margin: .4rem 0; font-size: .95rem; }
.werte dt { color: var(--text-2); }
.werte dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.begruendung { margin: .5rem 0 .8rem; padding-left: 1.2rem; font-size: .93rem; }
.begruendung li { margin-bottom: .2rem; }
.ampel { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .05rem .6rem; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.ampel .punkt { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.ampel-gruen { background: var(--gruen-bg); color: var(--gruen); }
.ampel-gelb { background: var(--gelb-bg); color: var(--gelb-text); }
.ampel-rot { background: var(--rot-bg); color: var(--rot); }
.ampel-keine { background: var(--grund); color: var(--text-2); }
.sonder { border: 1px solid var(--rand); border-left: 4px solid var(--gelb-2); border-radius: var(--r); padding: .5rem .8rem; background: var(--flaeche); }
.sonder summary { font-weight: 700; cursor: pointer; color: var(--pri-700); }
.sonderZeile { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .5rem; }
.sonderZeile p { margin: 0; flex: 1 1 260px; }
.weitere h3 { color: var(--pri-700); }
.auswahlzeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; margin-bottom: .6rem; padding: .5rem .7rem; background: var(--pri-50); border-radius: 6px; overflow-wrap: anywhere; }
.auswahlzeile p { margin: 0; }
.anfrageform { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; }
@media (min-width: 640px) { .anfrageform { grid-template-columns: repeat(2, minmax(0, 1fr)); } .anfrageform > .feld:last-of-type, .anfrageform > .check, .anfrageform > .schrittFehler, .anfrageform > .knopf { grid-column: 1 / -1; } .anfrageform > .knopf { justify-self: start; } }
.danke { border: 2px solid var(--gruen); background: var(--gruen-bg); border-radius: var(--r); padding: .8rem; }
.danke h3 { color: var(--gruen); }

/* Tabelle: Rahmen scrollt, Kopf sticky */
.tabelle { margin-top: .4rem; }
.tabellenrahmen { overflow: auto; max-height: 70vh; border: 1px solid var(--rand); border-radius: 6px; background: #fff; max-width: 100%; }
.tabellenrahmen table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
.tabellenrahmen thead th { position: sticky; top: 0; z-index: 2; background: var(--pri-50); color: var(--pri-700); text-align: left; padding: .35rem .3rem; border-bottom: 2px solid var(--pri-100); font-weight: 700; vertical-align: bottom; }
.tabellenrahmen td { padding: .3rem .35rem; border-bottom: 1px solid #e3e7f1; vertical-align: middle; }
.tabellenrahmen tr.gewaehlt td { background: var(--pri-50); }
.tabellenrahmen td:first-child, .tabellenrahmen th:first-child { padding-left: .4rem; }
.filterKnopf, .detailsKnopf { background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: .85rem; color: var(--pri-700); min-width: 28px; min-height: 28px; }
.filterKnopf:hover, .detailsKnopf:hover { background: #fff; border-color: var(--rand); }
.filterKnopf.an { background: var(--gelb); }
.detailzeile td { background: var(--grund); }
.detailbox { padding: .3rem .4rem; }
.filterinfo { font-size: .85rem; color: var(--text-2); margin: .3rem 0 0; }
.popover { position: fixed; left: var(--pop-links, 8px); top: var(--pop-oben, 80px); width: min(260px, calc(100vw - 16px)); background: #fff; border: 1px solid var(--rand); border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); padding: .5rem; z-index: 60; display: flex; flex-direction: column; gap: .3rem; }
.popoverListe { max-height: 180px; overflow: auto; border: 1px solid #e3e7f1; border-radius: 4px; padding: .2rem .3rem; }
.popoverZeile { display: flex; align-items: center; gap: .3rem; font-weight: 400; padding: .15rem 0; }
.popoverZeile input { width: 18px; height: 18px; min-height: 0; }
.popoverFuss { display: flex; gap: .4rem; }
.popover input[type="search"] { min-height: 36px; padding: .25rem .5rem; }

#fuss { max-width: 1320px; margin: 0 auto; padding: .5rem 16px 1.5rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--text-2); font-size: .85rem; }

@media (max-width: 480px) {
  #kopf { gap: .4rem; padding: .3rem 10px; }
  #kopf .logo { height: 22px; }
  #kopf h1 { display: none; }
  .live { font-size: .8rem; padding: .1rem .5rem; }
  .flaggenwahl button { min-width: 28px; padding: 2px; }
  main { padding: .5rem 10px 1rem; }
  .kacheln { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  /* Tabelle am Handy: Kopf bleibt sticky, Rahmen scrollt */
  .tabellenrahmen { max-height: 60vh; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { #kopf, .schrittNav, .vorschau { display: none; } .tabellenrahmen { max-height: none; overflow: visible; } }

/* Skizze Anbohrsattel (SVG, Farben nur über Klassen, keine style-Attribute) */
.skizzeBox { margin: .6rem 0; }
.skizze { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; }
.sk-rohr { fill: var(--pri-50); stroke: var(--pri-700); stroke-width: 2; }
.sk-sattel { fill: none; stroke: var(--pri); stroke-width: 8; }
.sk-bolzen { fill: var(--pri-700); }
.sk-abgang { fill: var(--pri-100); stroke: var(--pri-700); stroke-width: 2; }
.sk-gewinde { stroke: var(--pri-700); stroke-width: 1.5; }
.sk-mass { stroke: var(--text-2); stroke-width: 1.5; fill: none; }
.sk-text { fill: var(--text); font: 500 12px Roboto, system-ui, "Segoe UI", Arial, sans-serif; }
.sk-fett { font-weight: 700; font-size: 15px; }
.sk-klein { font-size: 11px; fill: var(--text-2); }
.sk-skala { fill: var(--pri-100); stroke: var(--pri-700); stroke-width: 1; }
.sk-marker { fill: var(--text); }
.sk-marker.sk-gruen { fill: var(--gruen); }
.sk-marker.sk-gelb { fill: var(--gelb-text); }
.sk-marker.sk-rot { fill: var(--rot); }
