/**
 * Star Kreditrechner – Custom Stylesheet v2.2.0
 *
 * Kein Tailwind CDN mehr. Alle benötigten Utility-Klassen sind hier definiert.
 * Google Fonts (Poppins) + Font Awesome werden via wp_enqueue_style geladen.
 * Assets werden nur auf Seiten geladen, die den [star_kreditrechner] Shortcode verwenden.
 */

/* ── Tailwind-Ersatz: Utility-Klassen (kc-Namespace) ─────────────────────── */

/* Layout */
.kc-container       { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem; }
.kc-flex-grow       { flex-grow: 1; }
.kc-flex-col        { display: flex; flex-direction: column; }
.kc-justify-between { justify-content: space-between; }
.kc-row-between     { display: flex; justify-content: space-between; align-items: center; }
.kc-mb-2            { margin-bottom: 0.5rem; }
.kc-mb-4            { margin-bottom: 1rem; }
.kc-mb-6            { margin-bottom: 1.5rem; }
.kc-ml-2            { margin-left: 0.5rem; }
.kc-p-6             { padding: 1.5rem; }
.kc-w-full          { width: 100%; }
.kc-text-center     { text-align: center; }
.kc-text-xs         { font-size: 0.75rem; }
.kc-font-medium     { font-weight: 500; }

/* Colors */
.kc-white           { background-color: #ffffff; }
.kc-white-text      { color: #ffffff; }
.kc-gray-800        { color: #1f2937; }
.kc-blue-500        { color: #3b82f6; }
.kc-green           { color: #22c55e; }
.kc-yellow          { color: #eab308; }
.kc-red             { color: #ef4444; }

/* Shapes */
.kc-rounded-xl      { border-radius: 0.75rem; }
.kc-shadow          { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }

/* Typography */
.kc-h2 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

/* Range labels (min/max) */
.kc-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 1rem;       /* Genug Abstand damit Thumb nicht überlappt */
    padding: 0 2px;
    letter-spacing: 0.01em;
}

/* Label */
.kc-label {
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}
.kc-label--flex { display: flex; align-items: center; }

/* Amount badge (Kreditbetrag-Wert) */
.kc-amount-badge {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
}

/* Value badge (Laufzeit / Zinssatz) */
.kc-value-badge {
    color: #2563eb;
    font-weight: 600;
    font-size: 1rem;
}

/* Result card typography */
.kc-result-label    { font-size: 0.875rem; opacity: 0.8; margin: 0; color: #ffffff; }
.kc-result-main     { font-size: 1.875rem; font-weight: 700; margin: 0; line-height: 1.2; color: #ffffff; }
.kc-result-secondary{ font-size: 1.5rem; font-weight: 600; margin: 0; color: #ffffff; }
.kc-result-small    { font-size: 1.25rem; margin: 0; color: #ffffff; }

/* Gauge footer */
.kc-gauge-footer       { text-align: center; margin-top: 1rem; border-top: 1px solid #e5e7eb; padding-top: 1rem; }
.kc-gauge-footer-label { font-size: 0.875rem; color: #4b5563; margin: 0 0 0.25rem; }
.kc-gauge-footer-value { font-size: 1.125rem; font-weight: 600; color: #2563eb; margin: 0; }

/* Amort card header */
.kc-amort-card   { margin-top: 1.5rem; position: relative; }
.kc-amort-header { display: flex; align-items: center; margin-bottom: 0.5rem; }

/* Info-Button Zeile: klar getrennt, kein Overlap mit den Raten */
.kc-amort-info-btn-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}


/* Karten-Liste: immer sichtbar (Desktop + Mobile) */
#kcMobileAmortizationList {
    display: block;
}
.kc-amort-more {
    padding: 0.75rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Show-all Button: ein Button, immer sichtbar */
.kc-show-all-btn--desktop { display: none !important; }
.kc-show-all-btn--mobile  { display: inline-block; }

/* Modal rows (Info-Modal Zinssatz) */
.kc-modal-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.kc-modal-row:last-child { margin-bottom: 0; }
.kc-modal-icon { font-size: 1.25rem; flex-shrink: 0; }

/* ── Base ──────────────────────────────────────────────────────────────── */

.star-kreditrechner-wrapper {
    font-family: 'Poppins', sans-serif;
    background-color: transparent;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: clip;   /* Verhindert horizontale Scrollbar durch Tooltip-Überlauf */
}

.star-kreditrechner-wrapper * {
    box-sizing: border-box;
}

/* ── Range Slider – modern mit Farbfüll-Effekt ──────────────────────────── */

.kc-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    /* Dynamischer Füll-Effekt: blau links vom Thumb, grau rechts */
    background: linear-gradient(
        to right,
        #3b82f6 var(--slider-fill, 20%),
        #e2e8f0 var(--slider-fill, 20%)
    );
    outline: none;
    width: 100%;
    display: block;
    margin-top: 0.75rem;    /* Abstand zwischen Badge-Zeile und Regler */
    cursor: pointer;
    transition: background 0.1s ease;
}

.kc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.kc-slider::-webkit-slider-thumb:hover {
    background: #eff6ff;
    border-color: #2563eb;
    transform: scale(1.12);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.kc-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
    transition: all 0.15s ease;
}

.kc-slider::-moz-range-thumb:hover {
    background: #eff6ff;
    border-color: #2563eb;
    transform: scale(1.12);
}

.kc-slider::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
}

.kc-slider::-moz-range-progress {
    background: #3b82f6;
    border-radius: 999px;
    height: 6px;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

.kc-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.kc-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 10px 25px -5px rgba(59, 130, 246, 0.1),
        0 8px 10px -6px rgba(59, 130, 246, 0.1);
}

.kc-result-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ── Calculating overlay ────────────────────────────────────────────────── */

.kc-calculating-overlay {
    opacity: 0.6;
    pointer-events: none;
    filter: blur(2px);
    transition: all 0.2s ease;
}

/* ── Equal-height grid ──────────────────────────────────────────────────── */

.kc-equal-height-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .kc-equal-height-container {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 1fr;
    }
}

/* ── Gauge SVG (Zinstacho) – SVG-basiertes Redesign ─────────────────────── */

.kc-gauge {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    padding: 8px 0;
}

.kc-gauge-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;    /* Schatten-Filter darf rausragen */
}

/* Zeiger: CSS-Transition via SVG transform-box */
#kcGaugeNeedle {
    transform-box: view-box;        /* Koordinatensystem = SVG-Viewport         */
    transform-origin: 110px 108px;  /* Pivot = Zentrum des Halbkreises          */
    transition: transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Zinswert-Text: weiche Farbüberblendung */
#kcGaugeValue {
    transition: fill 0.45s ease;
}

/* ── Zinstacho: Footer direkt unter dem Tacho (kein riesiger Leerraum) ──── */
/* Gauge-Wrapper soll NICHT flex-wachsen → Footer sitzt nah am Tacho         */
.kc-equal-height-container > *:nth-child(3) .kc-flex-grow {
    flex-grow: 0;
}
/* Footer: kompakter Abstand nach oben, zentriert */
.kc-gauge-footer {
    margin-top: 0.75rem;
    text-align: center;
}

/* ── Tooltip ────────────────────────────────────────────────────────────── */





/* ── Info button (blinking) ─────────────────────────────────────────────── */

/* ── Zinstacho Header: Titel + Button linksbündig nebeneinander ── */
.kc-tacho-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

/* ── Zinstacho Info-Button: moderner Pill-Stil (wie kc-amort-info-btn-th) ── */
.kc-info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    height: auto;
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    background: #dbeafe;
    border: 1.5px solid #3b82f6;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.18s ease;
    animation: none;
    line-height: 1;
    position: relative;
    top: -1px;  /* optische Ausrichtung mit Titel-Baseline */
}

.kc-info-button:hover {
    background: #bfdbfe;
    border-color: #1d4ed8;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}

.kc-info-button:active {
    transform: scale(0.97);
}

.kc-info-button i,
.kc-info-button .fas {
    display: inline;
    font-size: 0.66rem;
    line-height: 1;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */

.kc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding-top: 900px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .kc-modal {
        padding-top: 0;
    }
}

.kc-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 80%;
    max-width: 500px;
    position: relative;
}

.kc-close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.kc-close-modal:hover {
    color: #000;
    text-decoration: none;
}

.kc-modal-title {
    padding-right: 20px;
    margin-bottom: 15px;
    font-size: 1.125rem;
    font-weight: 600;
}

.kc-modal-paragraph {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.kc-modal-paragraph:last-child {
    margin-bottom: 0;
}

/* ── CTA Button „Unverbindliche Offerte" ────────────────────────────────── */

.calculate-btn-credit-offer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 22px;
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease,
                transform 0.18s ease, box-shadow 0.22s ease;
    margin-top: 1rem;
    position: relative;
}

/* Double-chevron icon via pseudo-element (replaces calculator icon) */
.calculate-btn-credit-offer .fa-calculator {
    display: none;
}

.calculate-btn-credit-offer::after {
    content: '\00BB\00BB'; /* »» */
    margin-left: 10px;
    font-size: 1rem;
    opacity: 0.9;
    transition: transform 0.2s ease;
    font-style: normal;
}

/* Hover state */
.calculate-btn-credit-offer:hover {
    background: #ffffff;
    color: #1d4ed8;
    border-color: #ffffff;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.calculate-btn-credit-offer:hover::after {
    transform: translateX(4px);
}

/* Fix: Button-Text immer lesbar – auch nach Klick (:visited/:focus/:active) */
.calculate-btn-credit-offer:visited {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.85);
    background: transparent;
    text-decoration: none !important;
}
.calculate-btn-credit-offer:visited::after {
    color: #ffffff;
}
.calculate-btn-credit-offer:focus {
    color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
    text-decoration: none !important;
}
.calculate-btn-credit-offer:active {
    color: #ffffff;
    transform: translateY(0);
    text-decoration: none !important;
}







/* =====================================================================
   TOOLTIP 1 – Jahreszins Inline Info
   Desktop : CSS :hover + JS centers within card
   Mobile  : JS .kc-active class → fixed, centered, NO backdrop
   ===================================================================== */
/* =====================================================================
   JAHRESZINS INFO – Desktop Popup Card + Mobile Bottom Sheet
   ===================================================================== */

/* ── Wrapper: position:relative für Popup-Positionierung ──────────── */
.kc-jz-info-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

/* ── Trigger Button ─────────────────────────────────────── */
.kc-jz-info-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s ease;
    animation: kc-blink 1.8s ease-in-out infinite;
}
.kc-jz-info-btn:hover,
.kc-jz-info-wrap.kc-jz-open .kc-jz-info-btn {
    color: #2563eb;
    transform: scale(1.15);
    animation: none;
}

/* ── DESKTOP: Popup Card ────────────────────────────────── */
.kc-jz-popup {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 300px;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35), 0 8px 20px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0s linear 0.22s, transform 0.22s ease;
    z-index: 9999;
    box-sizing: border-box;
}
/* Pfeil nach unten (zeigt auf Button) */
.kc-jz-popup-arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border: 8px solid transparent;
    border-top-color: #1e293b;
}
.kc-jz-popup-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    padding-bottom: 10px;
    margin: 0 0 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    text-align: center;
}
.kc-jz-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kc-jz-popup-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.79rem;
    line-height: 1.55;
    color: #cbd5e1;
}
.kc-jz-popup-list li > span:first-child {
    flex-shrink: 0;
    font-size: 0.9rem;
    margin-top: 1px;
}
/* Sichtbar: hover ODER .kc-jz-open */
.kc-jz-info-wrap:hover .kc-jz-popup,
.kc-jz-info-wrap.kc-jz-open .kc-jz-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    transition: opacity 0.22s ease, visibility 0s linear 0s, transform 0.22s ease;
}

/* ── MOBILE: Bottom Sheet + Overlay ─────────────────────────── */
@media (max-width: 767px) {
    /* Popup auf Mobile verstecken */
    .kc-jz-popup { display: none !important; }
    .kc-jz-info-wrap:hover .kc-jz-popup { display: none !important; }

    /* Dunkler Hintergrund-Overlay */
    .kc-jz-sheet-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 999998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    }
    .kc-jz-sheet-overlay.kc-jz-sheet-open {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease;
    }

    /* Bottom Sheet */
    .kc-jz-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999999;
        background: #1e293b;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        overflow: hidden;
    }
    .kc-jz-sheet.kc-jz-sheet-open {
        transform: translateY(0);
    }

    /* Handle-Streifen oben */
    .kc-jz-sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.25);
        border-radius: 2px;
        margin: 12px auto 0;
    }

    /* Scrollbarer Innenbereich */
    .kc-jz-sheet-inner {
        padding: 16px 20px 40px;
        max-height: 65vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Header: Titel + X-Button */
    .kc-jz-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        margin-bottom: 14px;
    }
    .kc-jz-sheet-title {
        font-size: 0.92rem;
        font-weight: 700;
        color: #f8fafc;
    }
    .kc-jz-sheet-close {
        background: rgba(255,255,255,0.1);
        border: none;
        color: #94a3b8;
        font-size: 0.85rem;
        cursor: pointer;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s, color 0.2s;
    }
    .kc-jz-sheet-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

    /* Infozeilen */
    .kc-jz-sheet-rows { display: flex; flex-direction: column; gap: 10px; }
    .kc-jz-sheet-row {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        background: rgba(255,255,255,0.07);
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 0.82rem;
        line-height: 1.55;
        color: #cbd5e1;
    }
    .kc-jz-row-icon {
        flex-shrink: 0;
        font-size: 1rem;
        margin-top: 1px;
    }
}

/* =====================================================================
   MODAL – Zinstacho Info (Tooltip 2)

   ===================================================================== */
.kc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background-color: rgba(0,0,0,0.52);
    overflow-y: auto;
    padding: 24px 20px;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .kc-modal {
        align-items: center;
        justify-content: center;
    }
}
@media (max-width: 767px) {
    .kc-modal { padding: 12px; }
}

.kc-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    box-sizing: border-box;
    flex-shrink: 0;
    margin: auto;
}
@media (max-width: 767px) {
    .kc-modal-content {
        max-width: 100%;
        border-radius: 16px;
        padding: 22px 18px;
        margin-top: 8px;
    }
}
.kc-close-modal {
    position: absolute;
    top: 14px; right: 16px;
    color: #94a3b8;
    font-size: 26px; font-weight: bold;
    background: none; border: none;
    cursor: pointer; padding: 2px 6px; line-height: 1;
    transition: color 0.15s;
}
.kc-close-modal:hover { color: #1e293b; }
.kc-modal-title {
    font-size: 1.15rem; font-weight: 700;
    margin-bottom: 20px; padding-right: 32px;
    line-height: 1.4; color: #1e293b;
}
.kc-modal-paragraph {
    font-size: 0.93rem; line-height: 1.65;
    margin-bottom: 0; color: #374151;
}
.kc-modal-paragraph:last-child { margin-bottom: 0; }
@media (max-width: 767px) {
    .kc-modal-title { font-size: 1.05rem; }
    .kc-modal-paragraph { font-size: 0.875rem; }
}

/* =====================================================================
   CTA BUTTON – Unverbindliche Offerte
   ===================================================================== */
.calculate-btn-credit-offer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 22px;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-decoration: none !important;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.22s, color 0.22s, border-color 0.22s,
                transform 0.18s, box-shadow 0.22s;
}
.calculate-btn-credit-offer .fa-calculator { display: none; }
.calculate-btn-credit-offer::after {
    content: '\BB\BB';
    margin-left: 10px;
    font-size: 1rem;
    transition: transform 0.2s;
}
.calculate-btn-credit-offer:hover,
.calculate-btn-credit-offer:focus {
    background: #fff;
    color: #1d4ed8;
    border-color: #fff;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    outline: none;
}
.calculate-btn-credit-offer:hover::after { transform: translateX(4px); }
.calculate-btn-credit-offer:visited,
.calculate-btn-credit-offer:active {
    color: #fff !important;
    border-color: rgba(255,255,255,0.85) !important;
    background: transparent !important;
    text-decoration: none !important;
}

/* =====================================================================
   MOBILE LAYOUT: Zinstacho zuerst + kompakter Tacho
   ===================================================================== */
@media (max-width: 1023px) {
    /* Zinstacho zuerst anzeigen auf Mobile */
    .kc-equal-height-container > *:nth-child(3) {
        order: -1 !important;
        padding: 16px 16px 8px 16px !important;
    }
    /* SVG-Gauge skaliert automatisch – nur max-width anpassen */
    .kc-gauge {
        max-width: 200px;
    }
    .kc-equal-height-container > *:nth-child(3) .border-t {
        margin-top: 4px !important;
        padding-top: 5px !important;
    }
}

/* =====================================================================
   ALLE ANZEIGEN BUTTON – Desktop + Mobile, zentriert unter Raten
   ===================================================================== */
.kc-amort-header-btn    { display: none !important; }
.kc-mobile-show-all-wrap { display: none !important; }

.kc-show-all-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 6px;
}
.kc-show-all-btn {
    color: #1d4ed8;
    border: 1.5px solid #93c5fd;
    background: #fff;
    padding: 9px 32px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
}
.kc-show-all-btn:hover,
.kc-show-all-btn:focus,
.kc-show-all-btn:active {
    color: #1d4ed8 !important;
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    opacity: 1 !important;
    outline: none !important;
}

/* Tooltip 1: nur Titel + erster Punkt sichtbar */
.kc-tooltip .kc-tooltip-text .kc-tt-row ~ .kc-tt-row {
    display: none !important;
}




/* =====================================================================
   SECTION: position:relative → Modal kann absolute positioniert werden
   ===================================================================== */
.kc-section {
    position: relative;
}

/* =====================================================================
   SLIDER – Abstands- & Alignment-Korrekturen
   ===================================================================== */

/* Label/Badge-Zeile: mehr Abstand zum darunter liegenden Regler */
.kc-card .kc-row-between {
    margin-bottom: 0.875rem;
}

/* h2 Abstand – gleiches Niveau wie Kreditangebot (1rem) für korrektes Alignment */
.kc-card .kc-h2 {
    margin-bottom: 1rem;
}

/* 🟢 GRÜN: "Kredit"-Label auf gleiche Höhe wie "Monatliche Rate" –
   padding-top entfernt, kein extra Schub mehr nach unten */
.kc-equal-height-container > *:nth-child(1) .kc-mb-6:first-of-type {
    padding-top: 0;
}

/* 🟣 LILA: Doppelter Abstand nur zwischen "Kredit" Label/Badge-Zeile
   und dem Slider drunter (1. Karte, 1. Gruppe) */
.kc-equal-height-container > *:nth-child(1) .kc-mb-6:first-of-type .kc-row-between {
    margin-bottom: 1.75rem;
}

/* 🟡 ZINSTEILFARBE: Alle drei Slider-Labels in Gold/Amber */
label[for="kcLoanAmount"],
label[for="kcLoanTerm"],
label[for="kcInterestRate"] {
    color: #f59e0b !important;
    font-weight: 600;
}

/* Section-Wrapper Abstände – mehr Luft zwischen den Slider-Gruppen */
.kc-card .kc-mb-6 {
    margin-bottom: 1.875rem;
}
.kc-card .kc-mb-6:last-of-type {
    margin-bottom: 0.25rem;
}

/* =====================================================================
   DESKTOP: "Monatliche Rate" auf gleiche Höhe wie "Kredit" Label
   → Inhalt der blauen Karte nach unten schieben
   ===================================================================== */
@media (min-width: 1024px) {
    #kcResultCard .kc-flex-grow > div:first-child {
        margin-top: 0.875rem;
    }
    /* Nur 1. Block (Monatliche Rate) mehr Abstand nach unten:
       +8px schiebt kumulativ alle Folge-Blöcke in Alignment:
       Gesamtkosten → Laufzeit,  Gesamtzinsen → Jahreszins */
    #kcResultCard .kc-flex-grow > div:first-child > .kc-mb-2:first-child {
        margin-bottom: 1rem;
    }
}

/* Mobile: Thumb größer, genug vertikaler Touch-Bereich */
@media (max-width: 767px) {
    .kc-slider {
        margin-top: 0.75rem;
        height: 6px;
    }
    .kc-slider::-webkit-slider-thumb {
        width: 26px !important;
        height: 26px !important;
    }
    .kc-slider::-moz-range-thumb {
        width: 26px !important;
        height: 26px !important;
    }
    .kc-card .kc-mb-6 {
        margin-bottom: 1.25rem;
    }
    .kc-equal-height-container > *:nth-child(1),
    .kc-equal-height-container > *:nth-child(2) {
        padding: 16px !important;
    }
    .kc-equal-height-container {
        gap: 0.6rem !important;
    }
}

/* =====================================================================
   MODAL – Zinstacho Info
   FIX 1: Desktop = position:absolute in Section (Backdrop nur oben)
   FIX 2: Mobile  = position:fixed, Fade-Animation beim Schliessen
   ===================================================================== */

/* ── Animationen: Content-Box & Backdrop getrennt ── */
@keyframes kcFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes kcContentOut {
    /* Nur Content-Box: Scale + Fade */
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.94); }
}
@keyframes kcBackdropOut {
    /* Nur Backdrop: KEIN Scale, nur Fade (mit 80ms Verzögerung via JS) */
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Desktop Modal: ganzes Element faded ein */
.kc-modal--desktop-open:not(.kc-modal--closing) {
    animation: kcFadeIn 0.22s ease forwards;
}

/* Mobile: NUR Content-Box faded ein (Backdrop sofort ohne Animation) */
@media (max-width: 767px) {
    .kc-modal[style*="flex"]:not(.kc-modal--closing) {
        animation: none !important;
    }
    .kc-modal[style*="flex"] .kc-modal-content:not(.kc-content--closing) {
        animation: kcFadeIn 0.12s ease 0s both;
    }
}

/* Schliessen: Backdrop (über .kc-modal--closing) – nur Opacity */
.kc-modal--closing {
    animation: kcBackdropOut 0.2s ease forwards !important;
    pointer-events: none !important;
}

/* Schliessen: Content-Box (über .kc-content--closing) – Scale + Fade */
.kc-modal-content.kc-content--closing {
    animation: kcContentOut 0.25s ease forwards !important;
    pointer-events: none !important;
}

/* DESKTOP: Modal absolut in der Section – mit schönem Radius + Schatten */
@media (min-width: 768px) {
    .kc-modal--desktop-open {
        position: absolute !important;
        left:   0    !important;
        right:  0    !important;
        top:    0    !important;
        bottom: auto !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        padding-top: 80px !important;
        padding-bottom: 20px !important;
        overflow: hidden !important;
        border-radius: 20px !important;
        box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.45),
            0 0 0 1px rgba(255, 255, 255, 0.07) !important;
    }
} /* closes @media (min-width: 768px) */

/* MOBILE: Modal – Backdrop sofort, Content mit Abstand nach oben */
@media (max-width: 767px) {
    .kc-modal[style*="flex"] {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 40px 12px 12px 12px !important;
    }
    .kc-modal-content {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        max-height: calc(100dvh - 68px);
        width: 100% !important;
    }
}

/* #kcAmortInfoModal: transparent, schwebt als Box über der Karte */
#kcAmortInfoModal {
    position: absolute !important;
    background: transparent !important;
    border-radius: 16px !important;
    /* pointer-events bleibt auto: Klick auf Backdrop schliesst Modal */
}

/* DESKTOP: Modal zentriert in der Karte */
@media (min-width: 768px) {
    #kcAmortInfoModal[style*="flex"] {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 24px !important;
        overflow: visible !important;
        box-shadow: none !important;
    }
    #kcAmortInfoModal .kc-modal-content {
        max-height: none;
        overflow-y: visible;
        width: min(520px, 92%);
        box-shadow:
            0 50px 120px rgba(0, 0, 0, 0.35),
            0 20px 48px  rgba(0, 0, 0, 0.20),
            0 6px  16px  rgba(0, 0, 0, 0.12),
            0 0 0  1px   rgba(0, 0, 0, 0.07) !important;
    }
}

/* MOBILE */
@media (max-width: 767px) {
    #kcAmortInfoModal[style*="flex"] {
        background: transparent !important;
        padding: 16px !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: visible !important;
        box-shadow: none !important;
    }
    #kcAmortInfoModal .kc-modal-content {
        max-height: none !important;
        overflow-y: visible !important;
        width: 100% !important;
        box-shadow:
            0 20px 50px rgba(0, 0, 0, 0.20),
            0 6px  16px rgba(0, 0, 0, 0.10),
            0 0 0  1px  rgba(0, 0, 0, 0.05) !important;
    }
}



/* =====================================================================
   MOBILE: Kreditangebot Abstand zu Kreditdetails
   ===================================================================== */
@media (max-width: 767px) {
    .kc-equal-height-container > *:nth-child(2) {
        margin-top: 10px !important;
    }
}

/* =====================================================================
   MOBILE: Anklickbare Raten im Rückzahlungsplan
   ===================================================================== */
@media (max-width: 767px) {

    /* Container */
    #kcMobileAmortizationList {
        border-radius: 14px;
        overflow: hidden;
        border: 1px solid #e5e7eb;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    /* Raten-Zeile */
    .kc-amort-row {
        background: #fff;
        border-bottom: 1px solid #f1f5f9;
        cursor: pointer;
        transition: background 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .kc-amort-row:last-child { border-bottom: none; }
    .kc-amort-row:active { background: #f8fafc; }

    /* Hauptzeile */
    .kc-amort-row-main {
        display: flex;
        align-items: center;
        padding: 13px 14px;
        gap: 10px;
    }

    .kc-amort-month {
        font-size: 0.82rem;
        font-weight: 700;
        color: #f59e0b !important;   /* Orange-Gelb wie Zinsteil */
        min-width: 52px;
    }

    .kc-amort-right {
        flex: 1;
        text-align: right;
    }

    .kc-amort-payment {
        font-size: 0.97rem;
        font-weight: 700;
        color: #1e293b;
    }

    .kc-amort-balance {
        font-size: 0.72rem;
        color: #94a3b8;
        margin-top: 2px;
    }

    /* Chevron-Pfeil */
    .kc-amort-chevron {
        font-size: 1.3rem;
        line-height: 1;
        color: #93c5fd;            /* Accent-Blau (heller) vor dem Öffnen */
        transition: transform 0.22s ease, color 0.15s ease;
        margin-left: 2px;
        user-select: none;
    }
    .kc-amort-row--open .kc-amort-chevron {
        transform: rotate(90deg);
        color: #3b82f6;
    }

    /* Detail-Bereich: max-height Animation */
    .kc-amort-detail {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    }

    /* Detail-Inhalt */
    .kc-detail-inner {
        padding: 10px 14px 14px 14px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        border-top: 1px solid #e2e8f0;
    }

    .kc-detail-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .kc-detail-label {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.76rem;
        font-weight: 600;
        color: #64748b;
        min-width: 68px;
        white-space: nowrap;
    }

    /* Farbige Punkte */
    .kc-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
        flex-shrink: 0;
    }
    .kc-dot--blue { background: #3b82f6; }
    .kc-dot--gold { background: #f59e0b; }

    .kc-detail-right { flex: 1; }

    /* Fortschrittsbalken */
    .kc-detail-bar {
        height: 5px;
        background: #e2e8f0;
        border-radius: 3px;
        overflow: hidden;
        margin-bottom: 5px;
    }

    .kc-detail-fill {
        height: 100%;
        border-radius: 3px;
        transition: width 0.45s ease;
    }
    .kc-detail-fill--blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
    .kc-detail-fill--gold { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

    .kc-detail-amount {
        font-size: 0.82rem;
        font-weight: 700;
        color: #1e293b;
    }
    .kc-detail-pct {
        font-weight: 400;
        color: #94a3b8;
        font-size: 0.74rem;
    }

    /* ── Mobile: Inline ⓘ neben Zinsteil-% – dynamischer Kreis-Button ── */
    .kc-amort-info-btn-inline {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #eff6ff;
        border: 1.5px solid #93c5fd;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        color: #3b82f6;
        font-size: 0.64rem;
        cursor: pointer;
        padding: 0;
        margin-left: 5px;
        vertical-align: middle;
        line-height: 1;
        flex-shrink: 0;
        transition: all 0.18s ease;
        -webkit-tap-highlight-color: transparent;
        animation: kcInfoPulse 2.5s ease-out 0.6s 2;
    }
    .kc-amort-info-btn-inline:active {
        background: #dbeafe;
        border-color: #3b82f6;
        transform: scale(1.18);
    }
}

/* ── Desktop: ⓘ neben "Zinsen" im Tabellen-Header ── */
.kc-amort-info-btn-th {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #93c5fd;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0 0 0 4px;
    vertical-align: middle;
    line-height: 1;
    transition: color 0.2s ease, transform 0.15s ease;
}
.kc-amort-info-btn-th:hover {
    color: #3b82f6;
    transform: scale(1.15);
}
.kc-amort-info-btn-th:active {
    color: #1d4ed8;
}

/* =====================================================================
   AMORT INFO MODAL – SVG Diagramm + Tips + Dynamische Buttons
   ===================================================================== */

/* Modal-Content etwas breiter für Diagramm */
.kc-amort-modal-content {
    max-width: 440px !important;
}

/* SVG Diagramm-Container */
.kc-amort-diagram {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px 10px 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.kc-amort-svg {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 8px;
}

/* Diagramm-Legende */
.kc-diag-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    color: #64748b;
    justify-content: center;
}
.kc-diag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.kc-diag-dot--blue { background: #3b82f6; }
.kc-diag-dot--gold { background: #f59e0b; }

/* Tip-Karten */
.kc-amort-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.kc-amort-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
}
.kc-amort-tip-icon {
    font-size: 1.1rem;
    line-height: 1.4;
    flex-shrink: 0;
}
.kc-amort-tip p {
    font-size: 0.82rem;
    line-height: 1.5;
    color: #475569;
    margin: 0;
}

/* ── Dynamische Info-Buttons (Desktop + Mobile) ── */

/* Puls-Keyframe */
@keyframes kcInfoPulse {
    0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    70%  { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
    100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

/* Desktop: ⓘ im Zinsen-Header */
.kc-amort-info-btn-th {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border: 1.5px solid #93c5fd;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: #3b82f6;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0;
    vertical-align: middle;
    margin-left: 5px;
    transition: all 0.2s ease;
    animation: kcInfoPulse 2.5s ease-out 1s 2;  /* 2x pulsieren nach Laden */
}
.kc-amort-info-btn-th:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: scale(1.18);
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.kc-amort-info-btn-th:active {
    transform: scale(0.95);
}

/* Mobile: ⓘ inline im Zinsteil-Detail */
.kc-amort-info-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #93c5fd;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0 0 0 5px;
    vertical-align: middle;
    line-height: 1;
    transition: color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.kc-amort-info-btn-inline:active {
    color: #3b82f6;
    transform: scale(1.2);
}

/* =====================================================================
   MOBILE: Inline Amort-Info-Karte (kein dunkler Hintergrund!)
   ===================================================================== */
@media (max-width: 767px) {
    .kc-amort-inline-card {
        background: #fff;
        border-radius: 14px;
        border: 1px solid #e0ebff;
        box-shadow: 0 6px 24px rgba(59, 130, 246, 0.12), 0 2px 8px rgba(0,0,0,0.06);
        padding: 14px 14px 12px;
        margin-top: 10px;
        position: relative;
        max-height: 400px;
        overflow: hidden;
        opacity: 1;
        transition: opacity 0.2s ease, max-height 0.25s ease;
    }

    /* Close-Button oben rechts */
    .kc-aic-close {
        position: absolute;
        top: 8px;
        right: 10px;
        background: none;
        border: none;
        font-size: 1.1rem;
        color: #94a3b8;
        cursor: pointer;
        line-height: 1;
        padding: 2px 6px;
        transition: color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .kc-aic-close:active { color: #475569; }

    /* Titel */
    .kc-aic-title {
        font-size: 0.85rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 6px;
        padding-right: 24px;
    }

    /* Intro-Text */
    .kc-aic-intro {
        font-size: 0.76rem;
        color: #64748b;
        margin-bottom: 10px;
        line-height: 1.45;
    }

    /* Erklärungs-Reihen */
    .kc-aic-row {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 10px;
        background: #f8fafc;
        border-radius: 10px;
        margin-bottom: 6px;
        border: 1px solid #f1f5f9;
    }
    .kc-aic-row:last-child { margin-bottom: 0; }

    .kc-aic-icon {
        font-size: 1rem;
        line-height: 1.3;
        flex-shrink: 0;
    }

    .kc-aic-row div {
        font-size: 0.76rem;
        line-height: 1.45;
        color: #475569;
    }
    .kc-aic-row strong {
        color: #1e293b;
        display: block;
        margin-bottom: 1px;
    }
    .kc-aic-row span {
        color: #64748b;
    }
}

/* =====================================================================
   DESKTOP: Karten-Stil für Rückzahlungsübersicht (wie Mobile)
   ===================================================================== */

/* Container wie Mobile-Version aber für alle Grössen */
#kcMobileAmortizationList {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.kc-amort-row {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.kc-amort-row:last-child { border-bottom: none; }
.kc-amort-row:hover { background: #fafcff; }
.kc-amort-row:active { background: #f0f6ff; }

/* ── Hauptzeile: GLOBAL – Flex für alle Geräte ── */
.kc-amort-row-main {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    padding: 13px 14px;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
/* Linke Spalte: Rate-Nr + Fällig-Datum übereinander – GLOBAL */
.kc-amort-month-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px;
    flex: 0 0 auto;
}
/* Rechte Spalte: CHF + Rest rechtsbündig – GLOBAL */
.kc-amort-right {
    flex: 1 !important;
    text-align: right !important;
    padding-right: 4px;  /* Kleiner Puffer zum Chevron */
    min-width: 0;        /* flex shrink erlauben */
}
/* Betrag gross */
.kc-amort-payment {
    font-size: 0.97rem;
    font-weight: 700;
    color: #1e293b;
    display: block;
    white-space: nowrap;   /* Nie umbrechen */
}
/* Restschuld klein */
.kc-amort-balance {
    font-size: 0.72rem;
    color: #94a3b8;
    display: block;
    white-space: nowrap;   /* Nie umbrechen */
}
/* Pfeil-Chevron – dezent blau, dynamisch */
.kc-amort-chevron {
    font-size: 1.2rem;
    color: #3b82f6;
    flex-shrink: 0;
    margin-left: 6px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                color 0.2s ease,
                text-shadow 0.2s ease;
    opacity: 0.75;
}
.kc-amort-row:hover .kc-amort-chevron {
    color: #2563eb;
    opacity: 1;
    text-shadow: 0 0 8px rgba(59,130,246,0.35);
    transform: translateX(3px);   /* Leichtes Hervorspringen */
}
.kc-amort-row--open .kc-amort-chevron {
    transform: rotate(90deg);
    color: #2563eb;
    opacity: 1;
    text-shadow: 0 0 10px rgba(59,130,246,0.4);
}


@media (min-width: 768px) {
    .kc-amort-row-main {
        padding: 14px 20px;
        gap: 16px;
    }
    .kc-amort-month {
        font-size: 0.88rem;
        font-weight: 700;
        color: #f59e0b !important;   /* Orange-Gelb wie Zinsteil */
        min-width: 68px;
    }
    .kc-amort-payment {
        font-size: 1.05rem;
        font-weight: 700;
        color: #1e293b;
    }
    .kc-amort-balance {
        font-size: 0.78rem;
        color: #94a3b8;
        margin-top: 2px;
    }
    .kc-amort-chevron {
        font-size: 1.4rem;
        /* Farbe von global geerbt: #3b82f6 */
    }
    /* Desktop: Detail-Bereich breiter */
    .kc-detail-inner {
        padding: 12px 20px 16px 20px;
        flex-direction: row;
        gap: 24px;
    }
    .kc-detail-row {
        flex: 1;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .kc-detail-label {
        font-size: 0.8rem;
        min-width: unset;
    }
    .kc-detail-right { width: 100%; }
    .kc-detail-bar { height: 6px; }
    .kc-detail-amount { font-size: 0.9rem; }
}

/* ── Info-Button Ratenplan: als lesbarer Pill-Button (KEIN Kreis) ── */
.kc-amort-info-btn-th {
    width: auto !important;
    height: auto !important;
    border-radius: 20px !important;
    padding: 5px 12px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    white-space: nowrap !important;
    background: #dbeafe !important;
    border: 1.5px solid #3b82f6 !important;
    color: #2563eb !important;
    gap: 5px;
    animation: none !important;
}
.kc-amort-info-btn-th:hover {
    background: #bfdbfe !important;
    border-color: #1d4ed8 !important;
    color: #1d4ed8 !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(59,130,246,0.25) !important;
}
/* Icon im Pill-Button: inline (kein block!) */
.kc-amort-info-btn-th i,
.kc-amort-info-btn-th .fas {
    display: inline;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: auto;
    text-align: unset;
}
/* Icon im runden Inline-Button: block für Zentrierung */
.kc-amort-info-btn-inline i,
.kc-amort-info-btn-inline .fas {
    display: block;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
}

/* Stärkere Akzentfarbe Mobile-Inline-Button */
@media (max-width: 767px) {
    .kc-amort-info-btn-inline {
        background: #dbeafe !important;
        border-color: #3b82f6 !important;
        color: #2563eb !important;
    }
    .kc-amort-info-btn-inline:active {
        background: #bfdbfe !important;
        border-color: #1d4ed8 !important;
        color: #1d4ed8 !important;
    }
}
/* Desktop version des inline buttons */
@media (min-width: 768px) {
    .kc-amort-info-btn-inline {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: #dbeafe;
        border: 1.5px solid #3b82f6;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        color: #2563eb;
        font-size: 0.7rem;
        cursor: pointer;
        padding: 0;
        margin-left: 6px;
        vertical-align: middle;
        line-height: 1;
        flex-shrink: 0;
        transition: all 0.18s ease;
    }
    .kc-amort-info-btn-inline:hover {
        background: #bfdbfe;
        color: #1d4ed8;
        transform: scale(1.12);
    }
}

/* =====================================================================
   DESKTOP: Rückzahlungsübersicht – Zentrierung + Mobile-Stil 1:1
   ===================================================================== */

/* Amort-Karte auf Desktop zentrieren + max-width */
@media (min-width: 768px) {
    #kcAmortizationCard #kcMobileAmortizationList {
        max-width: 640px;
        margin: 0 auto;
    }

    /* Desktop: Detail-Bereich VERTIKAL wie Mobile (nicht side-by-side) */
    .kc-detail-inner {
        flex-direction: column !important;
        padding: 12px 20px 16px 20px;
        gap: 12px;
    }

    /* Desktop: Detail-Row identisch mit Mobile */
    .kc-detail-row {
        flex-direction: row !important;
        align-items: center;
        gap: 12px;
        flex: unset !important;
    }

    /* Desktop: Balken etwas dicker + Label breiter */
    .kc-detail-label {
        min-width: 76px !important;
        font-size: 0.82rem !important;
    }
    .kc-detail-bar { height: 7px !important; }
    .kc-detail-amount { font-size: 0.88rem !important; }

    /* Desktop: Raten-Hauptzeile mehr Luft */
    .kc-amort-row-main {
        padding: 15px 22px;
    }
    .kc-amort-month {
        min-width: 72px;
        font-size: 0.9rem;
        color: #f59e0b !important;   /* Orange-Gelb */
        font-weight: 700 !important;
    }
    .kc-amort-payment {
        font-size: 1.05rem;
    }
    .kc-amort-balance {
        font-size: 0.8rem;
    }

    /* Desktop: "Rate öffnen" Cursor + hover-Highlight auf der Hauptzeile */
    .kc-amort-row-main {
        cursor: pointer;
        transition: background 0.15s ease;
        border-radius: 4px;
    }

    /* Hintergrundfarbe des gesamten #kcMobileAmortizationList auf Desktop */
    #kcMobileAmortizationList {
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    }

    /* Trennlinie zwischen Raten auf Desktop */
    .kc-amort-row {
        border-bottom: 1px solid #f0f4f8;
    }
    .kc-amort-row:last-child { border-bottom: none; }

    /* Chevron auf Desktop: stärkere Farbe */
    .kc-amort-chevron {
        font-size: 1.4rem !important;
        color: #60a5fa !important;
    }
    .kc-amort-row--open .kc-amort-chevron {
        transform: rotate(90deg);
        color: #2563eb !important;
    }
}

/* =====================================================================
   RÜCKZAHLUNGSÜBERSICHT: Titel zentriert + Fälligkeitsdatum-Styling
   ===================================================================== */

/* Punkt 1: Titel zentrieren */
#kcAmortizationCard > div > h2 {
    text-align: center;
    width: 100%;
}

/* Punkt 4: Fälligkeitsdatum in geschlossener Rate */
.kc-amort-due {
    font-size: 0.68rem;
    color: #60a5fa;
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

@media (min-width: 768px) {
    .kc-amort-due {
        font-size: 0.72rem;
        color: #3b82f6;
    }
}

/* Fälligkeitsdatum ausblenden wenn die Rate geöffnet ist */
.kc-amort-row--open .kc-amort-due {
    display: none;
}

/* =====================================================================
   DESKTOP: Rückzahlungsübersicht – Mobile-Look, volle Breite (FINAL)
   ===================================================================== */
@media (min-width: 768px) {

    /* Container: volle Breite nutzen, kein max-width */
    #kcAmortizationCard #kcMobileAmortizationList {
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 14px !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.07) !important;
        overflow: hidden !important;
    }

    /* ── Hauptzeile: horizontal, volle Breite – wie Mobile ── */
    .kc-amort-row-main {
        display: flex !important;
        align-items: center !important;
        padding: 17px 28px !important;
        gap: 0 !important;
        cursor: pointer;
        transition: background 0.15s ease;
    }
    .kc-amort-row:hover .kc-amort-row-main {
        background: #f8fafc;
    }

    /* Links: Rate-Nr (+ ev. Fällig-Datum darunter) */
    .kc-amort-month {
        flex: 0 0 auto !important;
        min-width: 70px !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        color: #64748b !important;
    }

    /* Rechts: Betrag gross + Rest klein + Fällig blau */
    .kc-amort-right {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0 !important;
    }
    .kc-amort-payment {
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        text-align: right;
    }
    .kc-amort-balance {
        font-size: 0.76rem !important;
        color: #94a3b8 !important;
        margin-top: 1px;
        text-align: right;
    }
    .kc-amort-due {
        font-size: 0.71rem !important;
        color: #60a5fa !important;
        margin-top: 1px;
        text-align: right;
        letter-spacing: 0.01em;
    }

    /* Chevron: ganz rechts */
    .kc-amort-chevron {
        flex: 0 0 auto !important;
        margin-left: 18px !important;
        font-size: 1.4rem !important;
        color: #93c5fd !important;
        transition: transform 0.22s ease, color 0.15s ease;
    }
    .kc-amort-row--open .kc-amort-chevron {
        transform: rotate(90deg);
        color: #3b82f6 !important;
    }

    /* Trennlinie */
    .kc-amort-row {
        border-bottom: 1px solid #f1f5f9 !important;
    }
    .kc-amort-row:last-child { border-bottom: none !important; }

    /* ── Detail-Bereich: VERTIKAL wie Mobile ── */
    .kc-detail-inner {
        flex-direction: column !important;
        padding: 8px 28px 18px 28px !important;
        gap: 10px !important;
    }
    .kc-detail-row {
        flex-direction: row !important;
        align-items: center !important;
        flex: unset !important;
        gap: 12px;
    }
    .kc-detail-label {
        min-width: 80px !important;
        font-size: 0.82rem !important;
    }
    .kc-detail-right { flex: 1; }
    .kc-detail-bar { height: 7px !important; }
    .kc-detail-amount { font-size: 0.88rem !important; margin-top: 3px; }
}

/* =====================================================================
   kc-amort-month-wrap: Rate-Nr + Fällig links – Mobile & Desktop
   ===================================================================== */

/* Wrapper für Rate-Nummer + Fällig (linke Spalte) */
.kc-amort-month-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 0 0 auto;
}

/* Mobile: min-width kleiner */
@media (max-width: 767px) {
    .kc-amort-month-wrap {
        min-width: 80px;
    }
    .kc-amort-due {
        font-size: 0.66rem;
        color: #1e293b;        /* Schwarz/Dunkelgrau */
        font-weight: 400;
        white-space: nowrap;
    }
}

/* Desktop: etwas breiter */
@media (min-width: 768px) {
    .kc-amort-month-wrap {
        min-width: 110px;
    }
    .kc-amort-due {
        font-size: 0.7rem !important;
        color: #1e293b !important;     /* Schwarz/Dunkelgrau */
        font-weight: 400;
        white-space: nowrap;
        text-align: left !important;
    }
}

/* Fällig-Datum ausblenden wenn Rate geöffnet */
.kc-amort-row--open .kc-amort-due {
    display: none;
}

/* =====================================================================
   DETAIL-BARS: Global (Mobile + Desktop) – Tilgung/Zinsteil Grafik
   ===================================================================== */

/* Detail-Bereich aufklappen */
.kc-amort-row--open .kc-amort-detail {
    max-height: none;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Kombinierter Balken ── */
.kc-combined-bar-wrap {
    padding: 12px 14px 14px;
    border-top: 1px solid #e2e8f0;
}

/* Animation: Balken von links nach rechts einfahren */
@keyframes kcBarReveal {
    from {
        transform: scaleX(0);
        opacity: 0.4;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* Prozente über dem Balken */
.kc-combined-pct-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}
.kc-pct-gold {
    font-size: 0.68rem;
    font-weight: 600;
    color: #f59e0b;
}
.kc-pct-blue {
    font-size: 0.68rem;
    font-weight: 600;
    color: #3b82f6;
}

/* Der Balken selbst: flex, nebeneinander */
.kc-combined-bar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
    margin-top: 0;
    margin-bottom: 10px;           /* Abstand zu den Labels darunter */
    gap: 0;
    transform-origin: left center;
    animation: kcBarReveal 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.kc-combined-fill {
    height: 100%;
    transition: width 0.45s ease;
    flex-shrink: 0;
}
.kc-combined-fill--gold { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kc-combined-fill--blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* Labels: links Zinsteil, rechts Tilgung – ÜBER dem Balken */
.kc-combined-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    /* kein margin-bottom: Balken kommt darunter via margin-top */
}

.kc-combined-label-left,
.kc-combined-label-right {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    color: #475569;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.kc-clabel-text {
    font-weight: 600;
    color: #1e293b;
}

.kc-clabel-val {
    font-weight: 700;
    color: #1e293b;
}


/* Wrapper innerer Inhalt */
.kc-detail-inner {
    padding: 10px 16px 16px 16px;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

/* Eine Zeile Tilgung oder Zinsteil */
.kc-detail-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
}

/* Label: Punkt + Name */
.kc-detail-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    min-width: 72px;
    flex-shrink: 0;
}

/* Rechte Seite: Bar + Betrag */
.kc-detail-right {
    flex: 1;
    min-width: 0;
}

/* Farbpunkt */
.kc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.kc-dot--blue { background: #3b82f6; }
.kc-dot--gold { background: #f59e0b; }

/* Fortschrittsbalken-Spur */
.kc-detail-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    width: 100%;
}

/* Gefüllter Anteil */
.kc-detail-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.kc-detail-fill--blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.kc-detail-fill--gold { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* Betrag + % unter dem Balken */
.kc-detail-amount {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.kc-detail-pct {
    font-weight: 400;
    color: #64748b;
    font-size: 0.78rem;
}

/* Desktop: etwas mehr Padding */
@media (min-width: 768px) {
    .kc-detail-inner {
        padding: 12px 28px 18px 28px !important;
        gap: 12px;
    }
    .kc-detail-bar { height: 7px !important; }
    .kc-detail-label { min-width: 82px; }
    .kc-amort-row--open .kc-amort-detail {
        max-height: none;
    }
}

/* =====================================================================
   FIX: kc-amort-detail Basis-State GLOBAL (max-height: 0 für Desktop)
   ===================================================================== */
.kc-amort-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Geöffnet: max-height freigeben (override) */
.kc-amort-row--open .kc-amort-detail {
    max-height: none;
}

/* =====================================================================
   DESKTOP: Inline-Info-Karte im Ratenplan (kein Modal, kein Overlay)
   ===================================================================== */
@media (min-width: 768px) {
    .kc-amort-inline-card {
        background: #fff;
        border-radius: 14px;
        border: 1px solid #e0ebff;
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.14), 0 2px 10px rgba(0,0,0,0.07);
        padding: 18px 20px 16px;
        margin-top: 12px;
        position: relative;
        opacity: 1;
        transition: opacity 0.2s ease, max-height 0.25s ease;
        overflow: hidden;
    }

    /* Schliessen-Button */
    .kc-amort-inline-card .kc-aic-close {
        position: absolute;
        top: 10px;
        right: 14px;
        background: none;
        border: none;
        font-size: 1.1rem;
        color: #94a3b8;
        cursor: pointer;
        padding: 2px 6px;
        transition: color 0.15s ease;
        line-height: 1;
    }
    .kc-amort-inline-card .kc-aic-close:hover { color: #475569; }

    /* Titel */
    .kc-amort-inline-card .kc-aic-title {
        font-size: 0.92rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 6px;
        padding-right: 28px;
    }

    /* Intro */
    .kc-amort-inline-card .kc-aic-intro {
        font-size: 0.79rem;
        color: #64748b;
        margin-bottom: 12px;
        line-height: 1.5;
    }

    /* Erklärungszeilen */
    .kc-amort-inline-card .kc-aic-row {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
        background: #f8fafc;
        border-radius: 10px;
        margin-bottom: 8px;
        border: 1px solid #f1f5f9;
    }
    .kc-amort-inline-card .kc-aic-row:last-child { margin-bottom: 0; }
    .kc-amort-inline-card .kc-aic-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.4; }
    .kc-amort-inline-card .kc-aic-row div { font-size: 0.79rem; line-height: 1.5; color: #475569; }
    .kc-amort-inline-card .kc-aic-row strong { display: block; margin-bottom: 2px; }
    .kc-amort-inline-card .kc-aic-row span { color: #64748b; }
}

/* =====================================================================
   DESKTOP: Geöffnete Rate – verbessertes Layout der Detail-Ansicht
   ===================================================================== */
@media (min-width: 768px) {
    /* Detail-Bereich: mehr Padding, klarer getrennt */
    .kc-detail-inner {
        padding: 16px 32px 20px 32px !important;
        gap: 14px !important;
        background: linear-gradient(180deg, #f8fafc 0%, #fafbff 100%) !important;
        border-top: 1.5px solid #e0e7ff !important;
    }

    /* Label: grösser, klarer */
    .kc-detail-label {
        min-width: 90px !important;
        font-size: 0.84rem !important;
        font-weight: 700 !important;
        color: #334155 !important;
        gap: 8px;
    }

    /* Dot etwas grösser */
    .kc-detail-label .kc-dot {
        width: 10px;
        height: 10px;
    }

    /* Balken dicker auf Desktop */
    .kc-detail-bar {
        height: 9px !important;
        border-radius: 99px;
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
    }

    /* Betrag: grösser, mehr Abstand zum Balken */
    .kc-detail-amount {
        font-size: 0.95rem !important;
        margin-top: 5px !important;
        letter-spacing: -0.01em;
    }
    .kc-detail-pct {
        font-size: 0.82rem !important;
    }

    /* Inline-Karte: mehr padding, schönere Ränder */
    .kc-amort-inline-card {
        margin-top: 14px !important;
        padding: 20px 24px 18px !important;
        border-radius: 16px !important;
    }
    .kc-amort-inline-card .kc-aic-title {
        font-size: 0.95rem !important;
    }
    .kc-amort-inline-card .kc-aic-row {
        padding: 12px 14px !important;
        gap: 12px !important;
    }
}

/* =====================================================================
   SMART TIP & MAX-HEIGHT FIX – Mobile + Desktop
   ===================================================================== */

/* Smart Tip: Vorteil-Nachricht in der Info-Karte */
.kc-aic-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: #1e40af;
    line-height: 1.5;
}
.kc-aic-tip-icon {
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1.4;
}
.kc-aic-tip strong {
    color: #1e3a8a;
    font-weight: 700;
    display: inline;
}

@media (min-width: 768px) {
    .kc-aic-tip {
        font-size: 0.82rem;
        padding: 13px 16px;
        margin-top: 12px;
    }

    /* Detail-Section: keine CSS max-height Beschränkung auf Desktop
       JS steuert die Höhe dynamisch via element.style.maxHeight */
    .kc-amort-row--open .kc-amort-detail {
        max-height: none !important; /* JS übernimmt via style.maxHeight */
    }
}

/* =====================================================================
   INFO-BOX CTA: Dezenter "Offerte anfragen" Button – Mobile + Desktop
   ===================================================================== */
.kc-aic-cta-wrap {
    margin-top: 12px;
    text-align: center;
}

.kc-aic-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff !important;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.kc-aic-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff !important;
    text-decoration: none;
}

.kc-aic-cta-btn i {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}
.kc-aic-cta-btn:hover i {
    transform: translateX(3px);
}

@media (min-width: 768px) {
    .kc-aic-cta-btn {
        font-size: 0.8rem;
        padding: 10px 24px;
    }
}

/* =====================================================================
   FIX 1: CTA-Button Text immer lesbar (auch nach Klick / :visited)
   ===================================================================== */
#calculateBtn,
#calculateBtn:link,
#calculateBtn:visited,
#calculateBtn:active {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
    background: transparent !important;
    text-decoration: none !important;
}
#calculateBtn:hover,
#calculateBtn:focus {
    color: #1d4ed8 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

/* =====================================================================
   FIX 2: ⓘ Info-Button – korrekte Zentrierung (Shadow + Icon mittig)
   ===================================================================== */
.kc-amort-info-btn-inline {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    /* Kein extra padding – Icon bleibt mittig */
    padding: 0 !important;
    /* Gleiche Grösse oben/unten */
    width: 20px !important;
    height: 20px !important;
    /* Shadow zentriert: spread-radius gleich auf allen Seiten */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    /* Kein asymmetrischer margin-bottom */
    margin-left: 5px !important;
    margin-bottom: 0 !important;
    position: relative;
    top: -1px; /* optische Ausrichtung mit Texthöhe */
}

/* =====================================================================
   FIX 3: Mobile Info-Karte scrollbar + mehr sichtbarer Inhalt
   ===================================================================== */
@media (max-width: 767px) {
    .kc-amort-inline-card {
        max-height: 70vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        /* Scrollbar dezent */
        scrollbar-width: thin;
        scrollbar-color: #93c5fd transparent;
    }
    /* max-height des Detail-Bereichs beim Öffnen der Info-Karte grosszügig */
    .kc-amort-row--open .kc-amort-detail {
        max-height: 85vh !important;
    }
}
