:root {
  --grund: #e7ebe7;
  --flaeche: #f5f7f4;
  --tinte: #1c2a2e;
  --leise: #5b6b6e;
  --linie: #c4cdc9;
  --aktion: #2d4fd6;
  --aktion-tinte: #ffffff;
  --rec: #d0342b;
  --bett: #273134;
  --bett-punkt: #3a4548;
  --bett-tinte: #c9d3d0;
  --fehler: #b3261e;
  --radius-gross: 14px;
  --radius-klein: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #121a1d;
    --flaeche: #1a2428;
    --tinte: #e4ebe7;
    --leise: #9aa9a8;
    --linie: #33423f;
    --aktion: #7d98ff;
    --aktion-tinte: #0d1430;
    --bett: #0c1214;
    --bett-punkt: #1f2a2d;
    --fehler: #ff8a80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --grund: #121a1d; --flaeche: #1a2428; --tinte: #e4ebe7; --leise: #9aa9a8;
  --linie: #33423f; --aktion: #7d98ff; --aktion-tinte: #0d1430;
  --bett: #0c1214; --bett-punkt: #1f2a2d; --fehler: #ff8a80; color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: .4rem 0 0; max-width: 62ch; }

.seite {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
}

/* ---------- Bühne: das Druckbett ---------- */

.buehne { position: sticky; top: clamp(1rem, 3vw, 2.5rem); }

.bett {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-gross);
  background-color: var(--bett);
  background-image: radial-gradient(var(--bett-punkt) 1.1px, transparent 1.2px);
  background-size: 14px 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.bild { width: 82%; height: 78%; display: grid; place-items: center; }
.bild svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 14px rgb(0 0 0 / .45)); }
.dreid { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.dreid canvas { width: 100%; height: 100%; display: block; }
.bild[hidden], .dreid[hidden] { display: none; }

.beispiel {
  position: absolute; left: 1rem; right: 1rem; bottom: .7rem; margin: 0;
  color: var(--bett-tinte); font-size: .85rem; opacity: .85;
}

.buehne-leiste {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: .75rem;
}
.masse { margin: 0; color: var(--leise); font-variant-numeric: tabular-nums; }
.ansicht-wahl { display: flex; gap: .25rem; }
.ansicht-wahl button[aria-pressed="true"] { background: var(--tinte); color: var(--grund); border-color: var(--tinte); }

/* ---------- Schritte ---------- */

.kopf { padding-bottom: 1.25rem; }
.kopf p { color: var(--leise); }

.schritt {
  border-top: 1px solid var(--linie);
  padding: 1.4rem 0 1.6rem;
}
.nr {
  display: inline-grid; place-items: center;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 1.5px solid var(--tinte);
  font-size: .9rem; font-variant-numeric: tabular-nums;
}
.hinweis { color: var(--leise); font-size: .95rem; }

.knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

button, .zweit, .haupt {
  font: inherit; cursor: pointer;
  border-radius: 999px;
  border: 1.5px solid var(--tinte);
  background: transparent; color: var(--tinte);
  padding: .7rem 1.2rem;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: .55rem;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.haupt { background: var(--aktion); border-color: var(--aktion); color: var(--aktion-tinte); }
.haupt:hover { filter: brightness(1.08); }
.zweit:hover { background: var(--tinte); color: var(--grund); }
button.klein { padding: .35rem .8rem; font-size: .88rem; }
button.link { display: flex; width: fit-content; border: 0; padding: 0; margin-top: 1rem; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
:focus-visible { outline: 3px solid var(--aktion); outline-offset: 3px; }

.datei input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.datei:focus-within { outline: 3px solid var(--aktion); outline-offset: 3px; }

.rec { width: .7rem; height: .7rem; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 2px rgb(255 255 255 / .7); }
.laeuft { background: var(--rec); border-color: var(--rec); }
.laeuft .rec { background: #fff; border-radius: 2px; }

.pegel { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; font-variant-numeric: tabular-nums; }
.pegel-balken { flex: 1; height: 10px; border-radius: 5px; background: var(--linie); overflow: hidden; }
.pegel-balken div { height: 100%; width: 0; background: linear-gradient(90deg, #2e9e5b 0 70%, #e2a400 70% 90%, var(--rec) 90%); background-size: 100vw 100%; }
.pegel[hidden], .ausschnitt[hidden], .code[hidden] { display: none; }

.ausschnitt { margin-top: 1rem; }
.ausschnitt label { display: block; font-size: .95rem; }
.ausschnitt input { width: 100%; accent-color: var(--aktion); }

.meldung { min-height: 1.5em; font-size: .95rem; }
.meldung.fehler { color: var(--fehler); }

fieldset { border: 0; padding: 0; margin: 1.1rem 0 0; }
legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
.leise { color: var(--leise); font-weight: 400; }

.wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.option {
  position: relative; cursor: pointer;
  border: 1.5px solid var(--linie); border-radius: var(--radius-klein);
  padding: .6rem .7rem; background: var(--flaeche);
  display: flex; flex-direction: column; gap: .15rem;
}
.option input { position: absolute; opacity: 0; }
.option:has(input:checked) { border-color: var(--tinte); box-shadow: inset 0 0 0 1px var(--tinte); }
.option:has(input:focus-visible) { outline: 3px solid var(--aktion); outline-offset: 2px; }
.option-bild { height: 3.2rem; display: grid; place-items: center; }
.option-bild svg { max-width: 100%; max-height: 100%; }
.option-name { font-weight: 600; hyphens: manual; }
.option.leer { cursor: not-allowed; opacity: .5; }
.option.leer .option-name { text-decoration: line-through; }
.option-info { overflow-wrap: anywhere; font-size: .85rem; color: var(--leise); font-variant-numeric: tabular-nums; }

.farben { display: flex; flex-wrap: wrap; gap: .55rem; }
.farbe {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; cursor: pointer;
  background: var(--f); position: relative;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18);
}
.farbe.glanz { background: linear-gradient(135deg, #fff8 0%, transparent 45%), var(--f); }
.farbe input { position: absolute; opacity: 0; }
.farbe:has(input:checked) { outline: 2.5px solid var(--tinte); outline-offset: 3px; }
.farbe:has(input:focus-visible) { outline: 3px solid var(--aktion); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.angebote { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
.angebot {
  position: relative; cursor: pointer;
  border: 1.5px solid var(--linie); border-radius: var(--radius-gross);
  background: var(--flaeche);
  padding: 1rem; display: flex; flex-direction: column; gap: .2rem;
}
.angebot input { position: absolute; opacity: 0; }
.angebot:has(input:checked) { border-color: var(--tinte); box-shadow: inset 0 0 0 1px var(--tinte); }
.angebot:has(input:focus-visible) { outline: 3px solid var(--aktion); outline-offset: 2px; }
.angebot p { color: var(--leise); font-size: .93rem; }
.angebot strong { color: var(--tinte); }
.weiter { margin-top: 1rem; }

.code { margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--radius-klein); background: var(--flaeche); border: 1.5px dashed var(--linie); }
.code p { margin: 0 0 .5rem; }
.code-zeile { display: flex; gap: .6rem; align-items: center; }
.code output { flex: 1; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; }

.fuss { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); color: var(--leise); font-size: .88rem; }
.fuss a { color: inherit; }

@media (max-width: 860px) {
  .seite { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  button, .zweit, .haupt { max-width: 100%; white-space: normal; text-align: center; }
  .buehne { position: static; order: 0; }
  .schritte { order: 1; }
  .bett { aspect-ratio: 16 / 11; }
  .bild { height: 70%; transform: translateY(-6%); }
  .beispiel { font-size: .78rem; }
}
@media (max-width: 520px) {
  .angebote { grid-template-columns: 1fr; }
  .option { padding: .5rem; }
  .option-name { font-size: .92rem; }
  .knoepfe > * { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

textarea {
  width: 100%; margin-top: .5rem; padding: .7rem .8rem;
  font: .92rem/1.4 ui-monospace, Menlo, Consolas, monospace;
  color: var(--tinte); background: var(--flaeche);
  border: 1.5px solid var(--linie); border-radius: var(--radius-klein);
  resize: vertical;
}
.daten { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: .8rem 0 0; }
.daten dt { color: var(--leise); }
.daten dd { margin: 0; font-weight: 600; }
.daten[hidden] { display: none; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Welle einstellen, Text ---------- */
.regler { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem 1rem; align-items: center; margin-top: .8rem; }
.regler input { width: 100%; accent-color: var(--aktion); }
.segment { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--linie); border-radius: 999px; padding: 3px; gap: 3px; background: var(--flaeche); }
.segment label { position: relative; cursor: pointer; }
.segment input { position: absolute; opacity: 0; }
.segment span { display: block; padding: .4rem .9rem; border-radius: 999px; font-weight: 600; font-size: .92rem; }
.segment input:checked + span { background: var(--tinte); color: var(--grund); }
.segment input:focus-visible + span { outline: 3px solid var(--aktion); outline-offset: 2px; }
#textFeld input {
  width: 100%; padding: .65rem .8rem; font: inherit; color: var(--tinte);
  background: var(--flaeche); border: 1.5px solid var(--linie); border-radius: var(--radius-klein);
}
#textFeld input:focus-visible { outline: 3px solid var(--aktion); outline-offset: 2px; }
#textHinweis.fehler { color: var(--fehler); }
fieldset[hidden] { display: none; }
.wahl.produkte { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) {
  .wahl.produkte { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Anleitungsvideo ---------- */
.anleitung {
  max-width: 1240px; margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: clamp(1rem, 3vw, 2.5rem); align-items: center;
}
.anleitung-text p { color: var(--leise); }
.anleitung-video {
  width: 100%; height: auto; max-width: 100%; display: block;
  border-radius: var(--radius-gross); background: var(--bett);
  box-shadow: 0 0 0 1px var(--linie);
}
.anleitung[hidden] { display: none; }
@media (max-width: 860px) {
  .anleitung { grid-template-columns: 1fr; padding: 1rem 1rem 0; }
}

/* ---------- Bestellformular und STL ---------- */
.formular { margin-top: 1rem; padding: 1.1rem; border: 1.5px solid var(--linie); border-radius: var(--radius-gross); background: var(--flaeche); }
.formular[hidden] { display: none; }
.formular h3 { margin-bottom: .6rem; }
.felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .8rem; }
.feld { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .92rem; margin: 0; }
.feld.breit, .breit, .adresse { grid-column: 1 / -1; }
.adresse { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .7rem .8rem; }
.adresse .breit { grid-column: 1 / -1; }
.adresse[hidden] { display: none; }
.feld input, .feld textarea {
  font: inherit; font-weight: 400; color: var(--tinte); background: var(--grund);
  border: 1.5px solid var(--linie); border-radius: var(--radius-klein); padding: .55rem .7rem; width: 100%;
}
.feld textarea { margin-top: 0; resize: vertical; }
.feld input:focus-visible, .feld textarea:focus-visible { outline: 3px solid var(--aktion); outline-offset: 1px; }
.feld input[aria-invalid="true"] { border-color: var(--fehler); }
.lieferart legend { font-weight: 600; margin-bottom: .25rem; }
.zustimmung { display: flex; gap: .55rem; align-items: flex-start; font-size: .88rem; color: var(--leise); font-weight: 400; }
.zustimmung input { margin-top: .2rem; accent-color: var(--aktion); }
.falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.summe { font-weight: 600; margin: .9rem 0 .6rem; }
.ablauf { margin: .4rem 0 0; padding-left: 1.4rem; display: grid; gap: .7rem; }
.ablauf a.haupt { text-decoration: none; }
@media (max-width: 520px) { .felder, .adresse { grid-template-columns: 1fr; } }
a.haupt.gesperrt { opacity: .45; cursor: not-allowed; }
#stlZahlen a.haupt { display: inline-flex; text-decoration: none; }
#stlZahlen a.haupt[hidden], .ablauf[hidden], .feld[hidden], .lieferart[hidden], .hinweis[hidden] { display: none; }
.schritte-stl { margin-bottom: .9rem; }

/* Farben, die gerade nicht vorrätig sind */
.farbe.leer { cursor: not-allowed; opacity: .4; }
.farbe.leer::after {
  content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px;
  background: var(--tinte); box-shadow: 0 0 0 1px var(--grund); transform: translateX(-50%) rotate(45deg); border-radius: 1px;
}
button[hidden], .haupt[hidden], .zweit[hidden], .zustimmung[hidden] { display: none; }

/* Markenname über der Überschrift */
.marke { font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--leise); margin: 0 0 .3rem; }

/* Einfache Textseite (Datenschutz) */
.textseite { max-width: 46rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.textseite h2 { margin-top: 1.6rem; }
.textseite p { margin: .6rem 0; line-height: 1.6; overflow-wrap: anywhere; }

/* ---------- BuntwerkStudio-Kopfzeile (wie buntwerkstudio.github.io, Klangform B7 / Wegform B9) ---------- */
@font-face {
  font-family: "Fredoka";
  src: url("../vendor/fonts/fredoka-600.woff") format("woff");
  font-weight: 600; font-display: swap;
}
.buntwerk-kopf { border-bottom: 1px solid var(--linie); }
.kopfzeile {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1240px; margin: 0 auto; padding: .9rem clamp(1rem, 3vw, 2.5rem);
}
.wortmarke {
  display: inline-flex; align-items: center; gap: .55rem; color: var(--tinte);
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif; font-weight: 600;
  font-size: 1.25rem; text-decoration: none; letter-spacing: .005em;
}
.wortmarke svg { width: 30px; height: 30px; flex: none; }
.wortmarke span b { font-weight: 600; color: var(--leise); }
.menue { display: flex; flex-wrap: wrap; gap: .2rem .3rem; }
.menue a {
  color: var(--tinte); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .45rem .8rem; border-radius: 999px;
}
.menue a:hover { background: var(--flaeche); }
.menue a[aria-current="page"] { background: var(--tinte); color: var(--grund); }
.wortmarke:focus-visible, .menue a:focus-visible { outline: 3px solid var(--aktion); outline-offset: 2px; }
@media (max-width: 640px) {
  .kopfzeile { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .menue { margin-left: -.8rem; }
}

/* Impressum: Quellen der Höhendaten */
.quellenliste { font-size: .88rem; line-height: 1.5; padding-left: 1.2rem; overflow-wrap: anywhere; }
