/* =========================================================
   Think3DDD – Konfiguratoren (gemeinsamer Look)
   Gilt für alle drei Familien:
     kfg-*  js/konfigurator.js (Zahnrad, Adapter, Drehknopf, …)
     kfe-*  js/konfigurator-ersatzteile2.js (Ergänzungen in konfigurator-ersatzteile2.css)
     kwm-*  js/konfigurator-werbemittel.js (lädt diese Datei per @import)
   Baut auf style.css auf (Markenfarben, .viewer3d-*, .btn-primary).
   ========================================================= */

/* ---------- Gestaltungs-Tokens ---------- */

.konfigurator {
    --k-rand: #dbe3ea;            /* weiche Ränder in Markengrau */
    --k-rand-stark: #b8c6d2;      /* Ränder von Eingabefeldern (≥ 3:1 nicht nötig, Feld hat Hintergrund) */
    --k-feld-bg: #fbfcfd;
    --k-text: #0f172a;
    --k-text-2: #475569;
    --k-radius-feld: 12px;
    --k-radius-karte: 16px;
    --k-schatten: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
    --k-fokus: 0 0 0 3px rgba(15, 118, 153, .28);
    --k-cta: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-teal-text) 100%);
    --k-kopf: 72px;               /* Höhe des Seitenkopfs (sticky, Handy) */
    --k-dauer: .18s;

    /* Symbole (Linien-Icons, als Maske eingefärbt) */
    --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
    --i-warnung: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
    --i-fehler: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E");
    --i-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E");
    --i-drehen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-2.6-6.4L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3C/svg%3E");
    --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E");
    --i-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M8 11h6'/%3E%3C/svg%3E");
    --i-rahmen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8V5a2 2 0 0 1 2-2h3M16 3h3a2 2 0 0 1 2 2v3M21 16v3a2 2 0 0 1-2 2h-3M8 21H5a2 2 0 0 1-2-2v-3'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --i-wenden: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3M12 2v2M12 8v2M12 14v2M12 20v2'/%3E%3C/svg%3E");
    --i-drucker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8' rx='1'/%3E%3C/svg%3E");
    --i-lineal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0zM14.5 12.5l2-2M11.5 9.5l2-2M8.5 6.5l2-2M17.5 15.5l2-2'/%3E%3C/svg%3E");
    --i-liste: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-4 3 3 5-6'/%3E%3C/svg%3E");
    --i-preis: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.6 2.6A2 2 0 0 0 11.2 2H4a2 2 0 0 0-2 2v7.2a2 2 0 0 0 .6 1.4l8.7 8.7a2.4 2.4 0 0 0 3.4 0l6.6-6.6a2.4 2.4 0 0 0 0-3.4z'/%3E%3Ccircle cx='7.5' cy='7.5' r='.5' fill='%23000'/%3E%3C/svg%3E");
    --i-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
    --i-zurueck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 2.6-6.4L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E");
    --i-auge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    --i-auge-zu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.2A10 10 0 0 1 12 4c6.4 0 10 8 10 8a17 17 0 0 1-2.2 3.2M6.6 6.6A17 17 0 0 0 2 12s3.6 8 10 8a9.7 9.7 0 0 0 5.4-1.6M14.1 14.1a3 3 0 1 1-4.2-4.2M2 2l20 20'/%3E%3C/svg%3E");
    --i-hochladen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12'/%3E%3C/svg%3E");
    --i-pfeil-runter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a5d79' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

@media (min-width: 1024px) {
    .konfigurator {
        --k-kopf: 72px;           /* Kopf schrumpft beim Scrollen auf 72 px */
    }
}

/* ---------- Rahmen und Raster ---------- */

/* Eigenständige <section> ohne .container: 16 px Rand auf dem Handy, sonst wie .container */
section.konfigurator {
    width: min(1200px, 100%);
    margin-inline: auto;
    padding-inline: max(16px, 5%);
}

@media (min-width: 1334px) {
    section.konfigurator {
        padding-inline: 0;
    }
}

/* In einem .container eingebettet: Rand kommt vom Container (sonst doppelt) */
.container section.konfigurator,
.container > .konfigurator {
    width: auto;
    padding: 0;
}

.container section.konfigurator + section.konfigurator {
    margin-top: 56px;
}

.konfigurator,
.konfigurator * {
    min-width: 0;
}

.konfigurator [hidden] {
    display: none !important;
}

.kfg-app,
.kwm {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.kwm {
    margin-top: 0;
}

@media (min-width: 900px) {
    .kfg-app,
    .kwm {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        align-items: start;
        gap: 32px;
    }
}

.kfg-spalte-vorschau,
.kfg-ergebnis,
.kwm-vorschau {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.kfg-form,
.kwm-form {
    display: grid;
    gap: 16px;
    min-width: 0;
    counter-reset: k-schritt;
}

/* ---------- Schritte: Fieldsets als Karten mit nummeriertem Kopf ---------- */

.kfg-gruppe,
.kwm-gruppe {
    min-width: 0;
    margin: 0;
    padding: 18px 20px 20px;
    border: 1px solid var(--k-rand);
    border-radius: var(--k-radius-karte);
    background: #fff;
    box-shadow: var(--k-schatten);
}

/* Legend als echte Kopfzeile in der Karte (float-Trick) */
.kfg-gruppe > legend,
.kwm-gruppe > legend {
    float: left;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 6px;
    padding: 0 0 14px;
    border-bottom: 1px solid #edf2f6;
    color: var(--k-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.kfg-gruppe > legend + *,
.kwm-gruppe > legend + * {
    clear: both;
}

.kfg-gruppe > legend::before,
.kwm-gruppe > legend::before {
    counter-increment: k-schritt;
    content: counter(k-schritt);
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--k-cta);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(15, 118, 153, .25);
}

/* ---------- Felder und Beschriftungen ---------- */

.kfg-feld,
.kwm-feld {
    min-width: 0;
    margin-top: 16px;
    border-radius: var(--k-radius-feld);
    transition: background-color var(--k-dauer), box-shadow var(--k-dauer);
}

.kwm-feld {
    display: grid;
    gap: 6px;
}

.kfg-gruppe > .kfg-feld:first-of-type,
.kwm-gruppe > .kwm-feld:first-of-type,
.kwm-gruppe > .kwm-radios:first-of-type,
.kwm-gruppe > .kwm-reihe:first-of-type .kwm-feld {
    margin-top: 6px;
}

/* Gerade bearbeitetes Feld (Hervorhebung in der Vorschau) */
.kfg-feld-aktiv {
    background: var(--brand-tint-teal);
    box-shadow: 0 0 0 8px var(--brand-tint-teal);
}

.kfg-labelzeile {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    margin-bottom: 6px;
}

.kfg-feld > label,
.kfg-labelzeile > label,
.kwm-feld > label,
.kwm-radios-titel,
.kwm-farben-titel {
    color: var(--k-text);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.35;
}

.kfg-feld > label {
    display: block;
    margin-bottom: 6px;
}

/* Kurzzeichen (z. B. „d1“) als kleiner Chip */
.kfg-kurz {
    display: inline-block;
    margin-left: 2px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--brand-tint-blue);
    color: var(--brand-blue-dark);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    vertical-align: 1px;
}

/* „?“-Knopf: 24-px-Kreis, 44-px-Trefferfläche */
button.kfg-info,
.kfg-info-knopf {
    flex: none;
    width: 44px;
    height: 44px;
    margin: -10px -10px -10px -8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand-tint-blue) 0 11px, #b9d6e2 11px 12px, transparent 12.5px);
    color: var(--brand-blue-dark);
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background var(--k-dauer), color var(--k-dauer);
}

button.kfg-info:hover,
.kfg-info-knopf:hover,
button.kfg-info[aria-expanded="true"],
.kfg-info-knopf[aria-expanded="true"] {
    background: radial-gradient(circle, var(--brand-blue) 0 12px, transparent 12.5px);
    color: #fff;
}

.kfg-hilfe,
.kwm-feld > .kwm-hinweis,
.kwm-gruppe > .kwm-hinweis,
.kwm-radios > .kwm-hinweis,
.kfg-notiz {
    margin: 6px 0 0;
    color: var(--k-text-2);
    font-size: .86rem;
    line-height: 1.5;
}

.kfg-materialhinweis {
    min-height: 1.3em;
}

.kfg-notiz {
    padding: 12px 14px;
    border-radius: var(--k-radius-feld);
    background: var(--light);
}

/* ---------- Eingabefelder (Text, Zahl, Telefon, Auswahl, Datei) ---------- */

.konfigurator input[type="text"],
.konfigurator input[type="tel"],
.konfigurator input[type="email"],
.konfigurator input[type="number"],
.konfigurator textarea,
.konfigurator select {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--k-rand-stark);
    border-radius: var(--k-radius-feld);
    background: var(--k-feld-bg);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
    color: #111827;
    font: inherit;
    font-size: 1rem;              /* ≥ 16 px: iOS zoomt nicht hinein */
    line-height: 1.4;
    transition: border-color var(--k-dauer), box-shadow var(--k-dauer), background-color var(--k-dauer);
    scroll-margin: calc(var(--k-kopf) + 24px) 0 120px;
}

.konfigurator textarea {
    min-height: 96px;
    resize: vertical;
}

.konfigurator input[type="text"]:hover,
.konfigurator input[type="tel"]:hover,
.konfigurator input[type="email"]:hover,
.konfigurator input[type="number"]:hover,
.konfigurator textarea:hover,
.konfigurator select:hover {
    border-color: #8fa6b6;
}

.konfigurator input[type="text"]:focus,
.konfigurator input[type="tel"]:focus,
.konfigurator input[type="email"]:focus,
.konfigurator input[type="number"]:focus,
.konfigurator textarea:focus,
.konfigurator select:focus {
    outline: none;
    border-color: var(--brand-blue);
    background: #fff;
    box-shadow: var(--k-fokus);
}

.konfigurator input[aria-invalid="true"] {
    border-color: #b91c1c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .16);
}

.konfigurator input:disabled,
.konfigurator select:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Auswahl mit eigenem Pfeil */
.konfigurator select {
    padding-right: 44px;
    appearance: none;
    -webkit-appearance: none;
    background-image: var(--i-pfeil-runter);
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px 18px;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* Zahlenfelder: keine Browser-Pfeile (Regler, Pfeiltasten und Tippen genügen) */
.konfigurator input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.konfigurator input[type="number"]::-webkit-inner-spin-button,
.konfigurator input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

/* Zahl + Einheit als ein Feld mit integriertem Suffix */
.kfg-eingabe {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kfg-zahl {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: 8.5rem;
    border: 1px solid var(--k-rand-stark);
    border-radius: var(--k-radius-feld);
    background: var(--k-feld-bg);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
    transition: border-color var(--k-dauer), box-shadow var(--k-dauer), background-color var(--k-dauer);
}

.kfg-eingabe:not(:has(input[type="range"])) .kfg-zahl {
    width: min(100%, 12rem);
}

.kfg-zahl:hover {
    border-color: #8fa6b6;
}

.kfg-zahl:focus-within {
    border-color: var(--brand-blue);
    background: #fff;
    box-shadow: var(--k-fokus);
}

.kfg-zahl:has(input[aria-invalid="true"]) {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .16);
}

.konfigurator .kfg-zahl input[type="text"],
.konfigurator .kfg-zahl input[type="number"] {
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    padding: 9px 4px 9px 14px;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.konfigurator .kfg-zahl input:focus {
    box-shadow: none;
}

.kfg-einheit {
    flex: none;
    padding: 0 12px 0 4px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 500;
    pointer-events: none;
}

/* ---------- Schieberegler ---------- */

.konfigurator input[type="range"] {
    --k-spur: #dbe4ea;
    flex: 1 1 auto;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    touch-action: pan-y;          /* senkrecht wischen scrollt die Seite */
}

.konfigurator input[type="range"]:focus {
    outline: none;
}

/* Gefüllte Spur: nutzt --fill (0–100 %), wenn das Skript es setzt; Firefox füllt selbst */
.konfigurator input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background:
        linear-gradient(90deg, var(--brand-blue), var(--brand-teal)) 0 0 / var(--fill, 0%) 100% no-repeat,
        var(--k-spur);
}

.konfigurator input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: var(--k-spur);
}

.konfigurator input[type="range"]::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
}

.konfigurator input[type="range"]::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
    margin-top: -10px;
    border: 3px solid var(--brand-blue);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
    -webkit-appearance: none;
    appearance: none;
    transition: transform var(--k-dauer), box-shadow var(--k-dauer);
}

.konfigurator input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 3px solid var(--brand-blue);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
}

.konfigurator input[type="range"]:hover::-webkit-slider-thumb,
.konfigurator input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(15, 118, 153, .14), 0 2px 6px rgba(15, 23, 42, .22);
}

.konfigurator input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: var(--k-fokus), 0 2px 6px rgba(15, 23, 42, .22);
}

.konfigurator input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: var(--k-fokus);
}

/* ---------- Schalter (Checkboxen als Toggle) ---------- */

.kfg-feld-schalter {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
}

.kfg-feld-schalter > :not(input) {
    grid-column: 2;
}

.kfg-feld-schalter > input {
    grid-row: 1 / span 3;
}

.kfg-feld-schalter .kfg-labelzeile {
    min-height: 32px;
    margin-bottom: 0;
}

.kfg-feld-schalter label,
.kwm-checks label {
    cursor: pointer;
}

.kfg-feld-schalter > input[type="checkbox"],
.kwm-checks input[type="checkbox"],
.kwm-feld input[type="checkbox"] {
    position: relative;
    flex: none;
    width: 46px;
    height: 28px;
    margin: 2px 0 0;
    border: 0;
    border-radius: 999px;
    background: #c3cfd9;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .12);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background-color var(--k-dauer);
}

.kfg-feld-schalter > input[type="checkbox"]::before,
.kwm-checks input[type="checkbox"]::before,
.kwm-feld input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .3);
    transition: transform var(--k-dauer);
}

.kfg-feld-schalter > input[type="checkbox"]:checked,
.kwm-checks input[type="checkbox"]:checked,
.kwm-feld input[type="checkbox"]:checked {
    background: var(--brand-blue);
}

.kfg-feld-schalter > input[type="checkbox"]:checked::before,
.kwm-checks input[type="checkbox"]:checked::before,
.kwm-feld input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

.kfg-feld-schalter > input[type="checkbox"]:disabled,
.kwm-checks input[type="checkbox"]:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Einsatzzweck: Schalter als Liste */
.kfg-einsatzliste {
    display: grid;
    gap: 4px 20px;
    margin-top: 6px;
}

@media (min-width: 560px) {
    .kfg-einsatzliste {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.kfg-einsatzliste .kfg-feld {
    margin-top: 8px;
}

/* ---------- Werbemittel: Segment-Buttons, Optionskarten, Schalterzeilen ---------- */

.kwm-reihe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0 14px;
}

.kwm-checks,
.kwm-radios {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.kwm-radios-titel,
.kwm-telpos-grund {
    width: 100%;
}

.kwm-checks {
    gap: 4px 24px;
}

/* Block statt Flex: Label-Texte mit eingebetteten <span> bleiben ein Fließtext */
.kwm-checks label {
    position: relative;
    display: block;
    min-height: 44px;
    padding: 11px 0 9px 58px;
    color: var(--k-text);
    font-size: .95rem;
    line-height: 1.45;
}

.kwm-checks label > input[type="checkbox"] {
    position: absolute;
    top: 8px;
    left: 0;
    margin: 0;
}

/* Segment-Buttons statt kleiner Radios */
.kwm-radios:not(.kwm-radios-liste) > label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid var(--k-rand-stark);
    border-radius: 999px;
    background: #fff;
    color: var(--k-text);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--k-dauer), border-color var(--k-dauer), color var(--k-dauer), box-shadow var(--k-dauer);
}

.kwm-radios:not(.kwm-radios-liste) > label > input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: inherit;
}

.kwm-radios:not(.kwm-radios-liste) > label:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue-dark);
}

.kwm-radios:not(.kwm-radios-liste) > label:has(input:checked) {
    border-color: var(--brand-blue);
    background: var(--brand-blue);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 118, 153, .25);
}

.kwm-radios > label:has(input:focus-visible) {
    outline: none;
    box-shadow: var(--k-fokus);
}

.kwm-radios > label.kwm-aus,
.kwm-radios > label:has(input:disabled) {
    border-style: dashed;
    background: #f8fafc;
    color: #8a9aab;
    box-shadow: none;
    cursor: not-allowed;
}

/* Optionskarten (Größe mit Rassebeispielen) */
.kwm-radios-liste {
    display: grid;
    gap: 8px;
}

.kwm-radios-liste > label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid var(--k-rand);
    border-radius: var(--k-radius-feld);
    background: #fff;
    color: var(--k-text-2);
    font-size: .92rem;
    line-height: 1.45;
    cursor: pointer;
    transition: background-color var(--k-dauer), border-color var(--k-dauer);
}

.kwm-radios-liste > label:hover {
    border-color: var(--brand-blue);
}

.kwm-radios-liste > label:has(input:checked) {
    border-color: var(--brand-blue);
    background: var(--brand-tint-blue);
    color: var(--k-text);
}

.kwm-radios-liste > label strong,
.kwm-radios-liste > label b {
    color: var(--k-text);
}

/* Runde Radio-Punkte (Optionskarten und übrige Radios) */
.kwm-radios-liste input[type="radio"],
.kfg-feld input[type="radio"] {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    border: 2px solid #8fa6b6;
    border-radius: 50%;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color var(--k-dauer), box-shadow var(--k-dauer);
}

.kwm-radios-liste input[type="radio"]:checked,
.kfg-feld input[type="radio"]:checked {
    border-color: var(--brand-blue);
    box-shadow: inset 0 0 0 4px #fff;
    background: var(--brand-blue);
}

.kwm-radios-liste input[type="radio"]:focus-visible,
.kfg-feld input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 4px #fff, var(--k-fokus);
}

/* Datei-Auswahl als Ablagefläche */
.konfigurator input[type="file"] {
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    padding: 10px;
    border: 1.5px dashed #9fb4c3;
    border-radius: var(--k-radius-feld);
    background: var(--brand-tint-sky);
    color: var(--k-text-2);
    font: inherit;
    font-size: .92rem;
    cursor: pointer;
    transition: border-color var(--k-dauer), background-color var(--k-dauer);
}

.konfigurator input[type="file"]:hover {
    border-color: var(--brand-blue);
}

.konfigurator input[type="file"]:focus-visible {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: var(--k-fokus);
}

.konfigurator input[type="file"]::file-selector-button {
    min-height: 40px;
    margin-right: 12px;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--brand-blue);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Textknopf (z. B. „Beispiel laden“) */
.kwm-link {
    min-height: 44px;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--brand-blue);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.kwm-link:focus-visible {
    border-radius: 6px;
    outline: 3px solid var(--brand-blue);
    outline-offset: 2px;
}

/* Zurücksetzen */
.kfg-zuruecksetzen {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid var(--k-rand-stark);
    border-radius: 999px;
    background: #fff;
    color: var(--k-text);
    font: inherit;
    font-size: .92rem;
    cursor: pointer;
    transition: border-color var(--k-dauer), color var(--k-dauer);
}

.kfg-zuruecksetzen::before {
    content: "";
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--i-zurueck) center / contain no-repeat;
    mask: var(--i-zurueck) center / contain no-repeat;
}

.kfg-zuruecksetzen:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

/* Sichtbarer Fokusring für alle Knöpfe */
.konfigurator button:focus-visible,
.konfigurator a:focus-visible {
    outline: 3px solid var(--brand-blue);
    outline-offset: 2px;
}

/* ---------- Hinweise als farbcodierte Callouts ---------- */

.kfg-hinweise,
.kwm-meldungen ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kfg-hinweis,
.kwm-meldung,
p.kfg-infotext,
.kfg-feld p.kfg-info,
.kfg-empfehlung {
    --c-bg: var(--brand-tint-teal);
    --c-rand: #b4e2df;
    --c-text: #0d4744;
    --c-icon: var(--brand-teal-text);
    --c-i: var(--i-info);
    position: relative;
    margin: 0;
    padding: 10px 14px 10px 42px;
    border: 1px solid var(--c-rand);
    border-radius: var(--k-radius-feld);
    background: var(--c-bg);
    color: var(--c-text);
    font-size: .9rem;
    line-height: 1.5;
}

.kfg-hinweis::before,
.kwm-meldung::before,
p.kfg-infotext::before,
.kfg-feld p.kfg-info::before,
.kfg-empfehlung::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 14px;
    width: 18px;
    height: 18px;
    background: var(--c-icon);
    -webkit-mask: var(--c-i) center / contain no-repeat;
    mask: var(--c-i) center / contain no-repeat;
}

/* Kurzinfos am Feld: etwas kompakter, direkt unter der Beschriftung */
p.kfg-infotext,
.kfg-feld p.kfg-info {
    margin: 2px 0 10px;
    font-size: .87rem;
}

.kfg-ok {
    --c-i: var(--i-ok);
}

.kfg-warnung,
.kwm-warnung,
.kfg-empfehlung-warnung {
    --c-bg: #fffbeb;
    --c-rand: #f6d68a;
    --c-text: #713f12;
    --c-icon: #b45309;
    --c-i: var(--i-warnung);
}

.kfg-fehler,
.kwm-fehler {
    --c-bg: #fef2f2;
    --c-rand: #f8b4b4;
    --c-text: #7f1d1d;
    --c-icon: #b91c1c;
    --c-i: var(--i-fehler);
}

.kfg-empfehlung {
    margin-top: 14px;
}

.kfg-badge {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--k-cta);
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: 1px;
}

/* Feldfehler: rote Zeile mit Symbol */
.kfg-feldfehler {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 6px 0 0;
    color: #b91c1c;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.4;
}

.kfg-feldfehler::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    background: currentColor;
    -webkit-mask: var(--i-fehler) center / contain no-repeat;
    mask: var(--i-fehler) center / contain no-repeat;
}

/* ---------- 3D-Bühne ---------- */

.konfigurator .viewer3d {
    position: relative;
    border-color: var(--k-rand);
    border-radius: 20px;
    background:
        radial-gradient(120% 80% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
        radial-gradient(90% 70% at 85% 100%, rgba(23, 178, 172, .14) 0%, rgba(23, 178, 172, 0) 70%),
        radial-gradient(90% 70% at 10% 90%, rgba(58, 205, 255, .16) 0%, rgba(58, 205, 255, 0) 70%),
        var(--brand-tint-sky);
    box-shadow: var(--k-schatten);
}

/* Feine Verlaufslinie oben an der Bühne */
.konfigurator .viewer3d::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 1;
    height: 4px;
    background: var(--brand-gradient);
    pointer-events: none;
}

.kfg-vorschau .viewer3d-stage,
.kwm-viewer .viewer3d-stage {
    height: clamp(300px, 36vw, 460px);
}

/* Lade-Skeleton, bis die 3D-Ansicht bereit ist */
.konfigurator .viewer3d-loading {
    place-items: end center;
    padding-bottom: 28px;
    color: var(--k-text-2);
    font-size: .9rem;
    background:
        radial-gradient(circle at 50% 45%, rgba(15, 118, 153, .10) 0 18%, transparent 19%),
        linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%) 0 0 / 250% 100%;
    animation: k-schimmer 1.4s linear infinite;
}

.konfigurator .viewer3d-fallback .viewer3d-loading {
    place-items: center;
    background: none;
    animation: none;
}

@keyframes k-schimmer {
    from { background-position: 0 0, 125% 0; }
    to { background-position: 0 0, -125% 0; }
}

/* Maßstab und Markierungstext auf der Bühne */
.kfg-massstab {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 1;
    max-width: calc(100% - 24px);
    margin: 0;
    padding: 4px 12px;
    line-height: 1.4;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    color: #334155;
    font-size: .78rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.kfg-marktext {
    z-index: 1;
    justify-self: center;
    width: fit-content;
    max-width: calc(100% - 24px);
    margin-inline: auto !important;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(8, 115, 110, .92);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .15);
}

/* Werkzeugleiste: runde Icon-Knöpfe mit Tooltip */
.konfigurator .viewer3d-toolbar {
    position: relative;
    z-index: 2;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--k-rand);
    background: #fff;
}

.konfigurator .viewer3d-toolbar button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--k-rand);
    border-radius: 50%;
    background: #fff;
    color: var(--brand-blue-dark);
    font-size: 0;                 /* Text bleibt als zugänglicher Name erhalten */
    line-height: 0;
    transition: background-color var(--k-dauer), border-color var(--k-dauer), color var(--k-dauer), box-shadow var(--k-dauer);
}

.konfigurator .viewer3d-toolbar button::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--k-icon, var(--i-rahmen)) center / contain no-repeat;
    mask: var(--k-icon, var(--i-rahmen)) center / contain no-repeat;
}

.konfigurator .viewer3d-toolbar [data-action="rotate"] { --k-icon: var(--i-drehen); --k-tip: "Automatisch drehen"; }
.konfigurator .viewer3d-toolbar [data-action="zoom-in"] { --k-icon: var(--i-plus); --k-tip: "Vergrößern"; }
.konfigurator .viewer3d-toolbar [data-action="zoom-out"] { --k-icon: var(--i-minus); --k-tip: "Verkleinern"; }
.konfigurator .viewer3d-toolbar [data-action="reset"] { --k-icon: var(--i-rahmen); --k-tip: "Ansicht zurücksetzen"; }
.konfigurator .viewer3d-toolbar [data-action="flip"] { --k-icon: var(--i-wenden); }

.konfigurator .viewer3d-toolbar [data-action="reset"] {
    margin-left: auto;
}

/* Rückseite zeigen: wichtige Funktion → Icon mit Text */
.konfigurator .viewer3d-toolbar [data-action="flip"] {
    display: inline-flex;
    gap: 8px;
    width: auto;
    padding: 0 16px 0 12px;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
}

.konfigurator .viewer3d-toolbar button:hover {
    border-color: var(--brand-blue);
    background: var(--brand-tint-blue);
    color: var(--brand-blue-dark);
}

.konfigurator .viewer3d-toolbar button[aria-pressed="true"] {
    border-color: var(--brand-blue);
    background: var(--brand-blue);
    color: #fff;
}

/* Tooltip (Maus, Tastatur und kurz nach dem Antippen) */
.konfigurator .viewer3d-toolbar button::after {
    content: var(--k-tip, none);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--k-text);
    color: #fff;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 4px);
    pointer-events: none;
    transition: opacity var(--k-dauer), transform var(--k-dauer);
}

.konfigurator .viewer3d-toolbar [data-action="reset"]::after {
    left: auto;
    right: 0;
    transform: translate(0, 4px);
}

.konfigurator .viewer3d-toolbar button:hover::after,
.konfigurator .viewer3d-toolbar button:focus-visible::after,
.konfigurator .viewer3d-toolbar button:active::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.konfigurator .viewer3d-toolbar [data-action="reset"]:hover::after,
.konfigurator .viewer3d-toolbar [data-action="reset"]:focus-visible::after,
.konfigurator .viewer3d-toolbar [data-action="reset"]:active::after {
    transform: none;
}

.konfigurator .viewer3d figcaption {
    display: flow-root;           /* Außenabstand des Hinweises nicht durchreichen (Spalt) */
    padding: 0 16px 14px;
    background: #fff;
    color: var(--k-text-2);
    font-size: .85rem;
    line-height: 1.5;
}

.kwm-masse {
    display: block;
    padding-top: 2px;
    color: var(--k-text);
    font-size: .95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Hinweis zur Vorschau („ohne Gewähr …“) – bleibt auch auf dem Handy sichtbar */
.kfg-vorschau-notiz {
    display: block;
    margin-top: 4px;
    color: var(--k-text-2);
    font-size: .82rem;
}

/* Vorschau ein-/ausklappen: nur auf dem Handy (siehe unten) */
.konfigurator .viewer3d-toolbar .kfg-vorschau-umschalter {
    display: none;
    --k-icon: var(--i-auge-zu);
    --k-tip: "Vorschau ausblenden";
}

.konfigurator .viewer3d-toolbar .kfg-vorschau-umschalter[aria-expanded="false"] {
    --k-icon: var(--i-auge);
    --k-tip: "Vorschau einblenden";
    border-color: var(--brand-blue);
    background: var(--brand-tint-blue);
}

.konfigurator .viewer3d-toolbar .kfg-vorschau-umschalter::after {
    left: auto;
    right: 0;
    transform: translate(0, 4px);
}

.konfigurator .viewer3d-toolbar .kfg-vorschau-umschalter:hover::after,
.konfigurator .viewer3d-toolbar .kfg-vorschau-umschalter:focus-visible::after,
.konfigurator .viewer3d-toolbar .kfg-vorschau-umschalter:active::after {
    transform: none;
}

/* −/+ Stepper in Zahlenfeldern */
.kfg-zahl:has(.kfg-stepper) {
    width: 11.5rem;
}

.kfg-stepper {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--brand-blue-dark);
    font: inherit;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--k-dauer);
}

.kfg-stepper:hover {
    background: var(--brand-tint-blue);
}

.kfg-stepper:disabled {
    color: #a3b1bd;
    background: transparent;
    cursor: not-allowed;
}

/* ---------- Ergebnis-Karten ---------- */

.kfg-block {
    margin: 0;
    padding: 18px 20px;
    border: 1px solid var(--k-rand);
    border-radius: var(--k-radius-karte);
    background: #fff;
    box-shadow: var(--k-schatten);
}

.kfg-titel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    color: var(--k-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.kfg-titel::before {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: var(--brand-teal-text);
    -webkit-mask: var(--k-icon, var(--i-liste)) center / contain no-repeat;
    mask: var(--k-icon, var(--i-liste)) center / contain no-repeat;
}

.kfg-skizzenblock,
figure.kfg-skizze {
    --k-icon: var(--i-lineal);
}

.kfg-preisblock {
    --k-icon: var(--i-preis);
}

.kfg-druckblock,
.kfe-druckblock {
    --k-icon: var(--i-drucker);
}

/* Kennwerte als ruhige Tabelle */
.kfg-kennwerte {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 0;
    font-size: .93rem;
}

.kfg-kennwerte dt,
.kfg-kennwerte dd {
    padding: 9px 0;
    border-top: 1px solid #edf2f6;
}

.kfg-kennwerte dt:first-of-type,
.kfg-kennwerte dd:first-of-type {
    border-top: 0;
    padding-top: 2px;
}

.kfg-kennwerte dt {
    padding-right: 16px;
    color: var(--k-text-2);
}

.kfg-kennwerte dd {
    margin: 0;
    color: var(--k-text);
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.kfg-kennwerte dd.kfg-stuetze-ja {
    color: #b45309;
}

.kfg-block > .kfg-hinweise,
.kfg-block > .kfg-kennwerte + .kfg-hilfe {
    margin-top: 14px;
}

.kfg-preis-inhalt > .kfg-hinweise .kfg-hinweis {
    font-size: .86rem;
}

details.kfg-hilfe {
    margin: 0;
}

details.kfg-hilfe summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--brand-blue);
    font-weight: 600;
    cursor: pointer;
}

details.kfg-hilfe ul {
    margin: 4px 0 0;
    padding-left: 1.2em;
}

/* Preis/Gewicht: hervorgehobene Karte mit Verlaufsrand */
.kfg-preisblock {
    border: 1.5px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, var(--brand-blue), var(--brand-teal) 60%, var(--brand-sky)) border-box;
    box-shadow: 0 10px 30px rgba(15, 118, 153, .10);
}

.kfg-preisblock .kfg-kennwerte dd {
    font-size: 1rem;
}

/* Druck (FDM, Bambu Lab H2D): dezente Info-Karte */
.kfg-druckblock,
.kfe-druckblock {
    border-style: solid;
    border-color: #e3eaf0;
    background: var(--light);
    box-shadow: none;
}

.kfg-druckblock .kfg-kennwerte dt,
.kfg-druckblock .kfg-kennwerte dd,
.kfe-druckblock .kfg-kennwerte dt,
.kfe-druckblock .kfg-kennwerte dd {
    border-top-color: #e3eaf0;
}

.kfg-druck dd {
    white-space: normal;
}

/* Lange Texte (Druckausrichtung): beide Spalten dürfen umbrechen */
.kfg-druckblock .kfg-kennwerte,
.kfe-druckblock .kfg-kennwerte {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
}

.kfg-druck .kfg-hilfe {
    margin-top: 10px;
}

/* Maßskizze */
.kfg-skizze,
.kfg-skizze-bild {
    display: grid;
    place-items: center;
}

.kfg-skizze-svg,
.kfg-skizze-bild svg {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
}

figure.kfg-skizze figcaption {
    margin-top: 10px;
}

/* Skizzen aus js/konfigurator/skizzen.js (ohne eigene Farbattribute) */
.kfg-skizze-svg .sk-teil {
    fill: var(--brand-tint-blue);
    stroke: #475569;
    stroke-width: 1.2;
}

.kfg-skizze-svg .sk-loch {
    fill: #fff;
    stroke: #475569;
    stroke-width: 1.2;
}

.kfg-skizze-svg .sk-hilfslinie {
    fill: none;
    stroke: #94a3b8;
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.kfg-skizze-svg .sk-mass {
    fill: none;
    stroke: #64748b;
    stroke-width: 1;
}

.kfg-skizze-svg .sk-pfeil {
    fill: #64748b;
}

.kfg-skizze-svg .sk-akzent {
    fill: none;
    stroke: var(--brand-teal);
    stroke-width: 2.5;
    stroke-linecap: round;
}

.kfg-skizze-svg .sk-text {
    fill: #334155;
    font-family: "Rubik", Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
}

.kfg-skizze-svg [data-mark] {
    transition: opacity var(--k-dauer);
}

.kfg-skizze.hat-aktiv [data-mark]:not(.aktiv) {
    opacity: .3;
}

.kfg-skizze-svg [data-mark].aktiv .sk-teil {
    fill: #c9f0ee;
    stroke: var(--brand-teal);
    stroke-width: 1.8;
}

.kfg-skizze-svg [data-mark].aktiv .sk-loch,
.kfg-skizze-svg [data-mark].aktiv .sk-hilfslinie,
.kfg-skizze-svg [data-mark].aktiv .sk-mass {
    stroke: var(--brand-teal-text);
    stroke-width: 1.8;
}

.kfg-skizze-svg [data-mark].aktiv .sk-text {
    fill: var(--brand-blue-dark);
    font-weight: 700;
}

/* Platzhalter, bis Gewicht und Druckzeit berechnet sind */
.kfg-preis-wartet {
    position: relative;
    margin: 0;
    padding: 16px 18px 16px 18px;
    border: 1px dashed var(--k-rand-stark);
    border-radius: var(--k-radius-karte);
    background:
        linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .8) 50%, transparent 70%) 0 0 / 250% 100%,
        var(--light);
    animation: k-schimmer-1 1.4s linear infinite;
}

@keyframes k-schimmer-1 {
    from { background-position: 125% 0, 0 0; }
    to { background-position: -125% 0, 0 0; }
}

/* Empfehlung im Ersatzteil-Konfigurator (Text + Übernehmen-Knopf) */
.kfe-empfehlung:not(:empty) {
    --c-bg: var(--brand-tint-teal);
    position: relative;
    margin-top: 14px;
    padding: 10px 14px 10px 42px;
    border: 1px solid #b4e2df;
    border-radius: var(--k-radius-feld);
    background: var(--c-bg);
    color: #0d4744;
    font-size: .9rem;
}

.kfe-empfehlung:not(:empty)::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 14px;
    width: 18px;
    height: 18px;
    background: var(--brand-teal-text);
    -webkit-mask: var(--i-ok) center / contain no-repeat;
    mask: var(--i-ok) center / contain no-repeat;
}

.kfe-empfehlung-knopf {
    margin-top: 10px;
    border-color: var(--brand-blue);
    color: var(--brand-blue-dark);
    font-weight: 600;
}

.kfe-empfehlung-knopf::before {
    -webkit-mask-image: var(--i-ok);
    mask-image: var(--i-ok);
}

/* ---------- Anfrage ---------- */

.kfg-anfrageblock {
    display: flex;
    flex-direction: column;
    border: 0;
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(23, 178, 172, .14), transparent 60%),
        var(--brand-tint-sky);
    box-shadow: none;
}

.kfg-anfragetext { order: 0; }
.kfg-anfrage { order: 1; }
.kfg-anfrageblock::after { order: 2; }
.kfg-zusammenfassung { order: 3; }
.kfg-status { order: 4; }

.kfg-anfragetext {
    margin: 0 0 16px;
    color: #334155;
    font-size: .92rem;
    line-height: 1.55;
}

/* Primär-Button im Markenverlauf */
.konfigurator .kfg-anfrage,
.kwm-anfrage-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    padding: 14px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--k-cta);
    color: #fff;
    font: inherit;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: .01em;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 118, 153, .28);
    cursor: pointer;
    transition: transform var(--k-dauer), box-shadow var(--k-dauer), filter var(--k-dauer);
}

.konfigurator .kfg-anfrage::after,
.kwm-anfrage-btn::after {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--i-pfeil) center / contain no-repeat;
    mask: var(--i-pfeil) center / contain no-repeat;
    transition: transform var(--k-dauer);
}

.konfigurator .kfg-anfrage:hover,
.kwm-anfrage-btn:hover {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 118, 153, .34);
}

.konfigurator .kfg-anfrage:hover::after,
.kwm-anfrage-btn:hover::after {
    transform: translateX(3px);
}

.konfigurator .kfg-anfrage:focus-visible,
.kwm-anfrage-btn:focus-visible {
    outline: 3px solid var(--brand-blue-dark);
    outline-offset: 3px;
}

.konfigurator .kfg-anfrage.kfg-gesperrt,
.konfigurator .kfg-anfrage[aria-disabled="true"],
.kwm-anfrage-btn:disabled,
.kwm-anfrage-btn[aria-disabled="true"] {
    background: #94a3b8;
    box-shadow: none;
    filter: none;
    transform: none;
    cursor: not-allowed;
}

/* Zusicherung unter dem Button: echtes Element .kfg-zusicherung, sonst ::after als Ersatz */
.kfg-zusicherung { order: 2; }

.kfg-anfrageblock:has(.kfg-zusicherung)::after,
.kwm-anfrage:has(.kfg-zusicherung)::after {
    content: none;
}

.kfg-zusicherung,
.kfg-anfrageblock::after,
.kwm-anfrage::after {
    content: "Unverbindlich und kostenlos";
    margin-top: 10px;
    color: var(--brand-teal-text);
    font-size: .86rem;
    font-weight: 600;
    text-align: center;
}

/* Vorbereitet: Kurzinfo „ca. 7 g · ca. 26 min“ in der Anfrage (Markup folgt) */
.kfg-kurzinfo {
    order: 0;
    margin: 0 0 10px;
    color: var(--k-text);
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.kfg-zusammenfassung,
.kfg-status {
    margin: 12px 0 0;
    color: var(--k-text-2);
    font-size: .84rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.kfg-status {
    color: #7f1d1d;
    font-weight: 600;
}

.kfg-status:empty,
.kfg-zusammenfassung:empty {
    display: none;
}

/* ---------- Sonstiges ---------- */

/* Nur für Screenreader */
.kfg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.konfigurator-noscript {
    padding: 16px 18px;
    border: 1px solid var(--k-rand, #dbe3ea);
    border-radius: 16px;
    background: var(--brand-tint-blue);
}

/* =========================================================
   Handy und Tablet (< 900 px): Vorschau oben (sticky),
   Formular darunter, „Druck anfragen“ als Leiste unten
   ========================================================= */

@media (max-width: 899px) {
    /* Spalten auflösen, damit Vorschau und Anfrage im ganzen Konfigurator haften */
    .kfg-spalte-vorschau,
    .kfg-ergebnis,
    .kwm-vorschau {
        display: contents;
    }

    .kfg-app,
    .kwm {
        gap: 16px;
    }

    .konfigurator .kfg-vorschau,
    .konfigurator .kwm-viewer {
        position: sticky;
        top: calc(var(--k-kopf) + 8px);
        z-index: 20;
        order: -1;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
    }

    .kfg-vorschau .viewer3d-stage,
    .kwm-viewer .viewer3d-stage {
        height: clamp(180px, 30vh, 320px);
    }

    /* Bedienhinweise (Maus/Tastatur) brauchen auf dem Handy keinen Platz */
    .kfg-vorschau .viewer3d-hint,
    .kwm-viewer .viewer3d-hint {
        display: none;
    }

    .kwm-viewer figcaption,
    .kfg-vorschau figcaption {
        padding-bottom: 10px;
    }

    .kfg-vorschau .kfg-vorschau-notiz {
        margin-top: 0;
        font-size: .78rem;
        line-height: 1.4;
    }

    .kfg-vorschau figcaption:not(:has(> :not(.viewer3d-hint))) {
        display: none;
    }

    .konfigurator .viewer3d-toolbar {
        padding: 8px 10px;
    }

    .konfigurator .viewer3d-toolbar .kfg-vorschau-umschalter {
        display: inline-grid;
    }

    /* Eingeklappte Vorschau (Klasse setzt das Skript) */
    .kfg-vorschau.ist-eingeklappt .viewer3d-stage,
    .kwm-viewer.ist-eingeklappt .viewer3d-stage {
        height: 96px;
    }

    /* Felder beim Fokussieren nicht hinter Vorschau oder Anfrageleiste verstecken */
    .konfigurator input,
    .konfigurator select,
    .konfigurator textarea {
        scroll-margin: calc(var(--k-kopf) + 30vh + 80px) 0 110px;
    }

    /* Anfrage als haftende Leiste am unteren Rand */
    .kfg-anfrageblock,
    .kwm-anfrage {
        position: sticky;
        bottom: 0;
        z-index: 15;
        margin-inline: -4px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
        border: 1px solid var(--k-rand);
        border-radius: 18px 18px 0 0;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, .12);
        backdrop-filter: blur(8px);
    }

    .kfg-anfrageblock .kfg-anfragetext,
    .kfg-anfrageblock .kfg-zusammenfassung,
    .kwm-anfrage > .kwm-hinweis {
        display: none;
    }

    .konfigurator .kfg-anfrage,
    .kwm-anfrage-btn {
        min-height: 50px;
    }

    .kfg-zusicherung,
    .kfg-anfrageblock::after,
    .kwm-anfrage::after {
        margin-top: 6px;
        font-size: .8rem;
    }

    .kfg-kurzinfo {
        margin-bottom: 8px;
        font-size: .88rem;
    }

    .kfg-anfrageblock .kfg-status {
        margin-top: 6px;
    }

    /* „Nach oben“-Knopf nicht über die Anfrageleiste legen */
    body:has(.kfg-anfrageblock, .kwm-anfrage) .back-to-top {
        bottom: 128px;
    }
}

@media (max-width: 480px) {
    .kfg-gruppe,
    .kwm-gruppe,
    .kfg-block {
        padding: 16px 14px 18px;
    }

    .kfg-gruppe > legend,
    .kwm-gruppe > legend {
        font-size: 1rem;
    }

    .kfg-eingabe {
        gap: 10px;
    }

    .kfg-zahl {
        width: 7.4rem;
    }

    .kfg-kennwerte {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        font-size: .9rem;
    }

    .kwm-radios:not(.kwm-radios-liste) > label {
        flex: 1 1 auto;
        padding-inline: 14px;
    }

    .konfigurator .viewer3d-toolbar {
        gap: 6px;
    }

    /* Wenden-Knopf auf dem Handy als Icon (Zustand über die Füllung sichtbar) */
    .konfigurator .viewer3d-toolbar [data-action="flip"] {
        justify-content: center;
        gap: 0;
        width: 44px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        --k-tip: "Seite wechseln";
    }
}

/* Sehr schmale Geräte: Zahlenfeld unter den Regler */
@media (max-width: 359px) {
    .kfg-eingabe:has(input[type="range"]) {
        flex-wrap: wrap;
    }

    .kfg-eingabe:has(input[type="range"]) .kfg-zahl {
        width: 100%;
    }
}

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
    .konfigurator *,
    .konfigurator *::before,
    .konfigurator *::after {
        transition: none !important;
        animation: none !important;
    }

    .konfigurator .kfg-anfrage:hover,
    .kwm-anfrage-btn:hover {
        transform: none;
    }
}

/* ---------- Druck ---------- */

@media print {
    .kfg-vorschau,
    .kfg-zuruecksetzen,
    .kfg-anfrage,
    .kfg-zusicherung,
    .kfg-anfrageblock::after {
        display: none !important;
    }

    .kfg-spalte-vorschau,
    .kfg-ergebnis {
        display: grid;
    }
}

/* ---------- Konfigurator-Übersicht: Tabs (Basis in style.css) ---------- */

/* Aktiver Tab: Verlauf nur über die dunklen Markenfarben (weißer Text, Kontrast ≥ 4,5:1) */
.konfig-tabliste [role="tab"][aria-selected="true"] {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal-text));
    box-shadow: 0 6px 16px rgba(15, 118, 153, .25);
}

.konfig-tabliste [role="tab"]:focus-visible {
    outline: 3px solid var(--brand-blue-dark);
    outline-offset: 2px;
}

@media (max-width: 700px) {
    /* Wischbare Tabliste: Fokusring nicht abschneiden, sanft einrasten */
    .konfig-tabliste {
        padding-top: 4px;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 16px;
    }

    .konfig-tabliste [role="tab"] {
        scroll-snap-align: start;
    }
}

@media (max-width: 700px) {
    /* Randausgleich exakt wie .container (92 % → Rand = 4/92 der Containerbreite), sonst 1 px Querscrollen */
    .konfig-tabliste {
        margin-inline: -4.347%;
        padding-inline: 4.347%;
        scroll-padding-inline: 16px;
    }
}

@media (min-width: 701px) {
    /* Zehn Tabs möglichst in einer Zeile */
    .konfig-tabliste {
        gap: 6px;
    }

    .konfig-tabliste [role="tab"] {
        padding: 8px 14px;
        font-size: .92rem;
    }
}
