/* ================================================
   Minijob-Freibetrag Rechner v2
   Mobile-first
   ================================================ */

.mj_container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 28px 24px;
    max-width: 640px;
    margin: 0 auto 30px;
    font-family: inherit;
    box-sizing: border-box;
}

/* ── SEGMENTED CONTROL ── */
.mj_gruppe_block {
    margin-bottom: 0;
}

.mj_gruppe_label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    margin-bottom: 10px;
}

.mj_segment_group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 20px;
}

.mj_segment_group input[type="radio"] {
    display: none;
}

.mj_segment_group label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    border-right: 1.5px solid #d0d0d0;
    transition: background 0.15s, color 0.15s;
    line-height: 1.3;
    user-select: none;
}

.mj_segment_group label:last-of-type {
    border-right: none;
}

.mj_segment_group input[type="radio"]:checked + label {
    background: #cb0000;
    color: #fff;
    font-weight: 700;
}

.mj_segment_group label:hover {
    background: #ebebeb;
    color: #1a1a1a;
}

.mj_segment_group input[type="radio"]:checked + label:hover {
    background: #a80000;
    color: #fff;
}

/* ── SUB-BLÖCKE ── */
.mj_sub_block {
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 10px;
    animation: mj_fadein 0.2s ease;
}

@keyframes mj_fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mj_checkbox_label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    color: #1a1a1a;
}

.mj_checkbox_label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #cb0000;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── TRENNLINIE ── */
.mj_divider {
    display: none;
}

/* ── INPUT-GRUPPE ── */
.mj_input_group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mj_input_group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    text-align: center;
}

.mj_input_row {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
}

.mj_input {
    flex: 1 !important;
    min-width: 0 !important;
    height: 44px !important;
    padding: 0 14px !important;
    border: 1.5px solid #d0d0d0 !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    color: #1a1a1a !important;
    background: #fafafa !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s !important;
    box-sizing: border-box !important;
}

.mj_input:focus {
    border-color: #cb0000 !important;
    background: #fff !important;
}

.mj_button {
    height: 44px !important;
    padding: 0 22px !important;
    background: #cb0000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    line-height: 1 !important;
}

.mj_button:hover,
.mj_button:focus {
    background: #a80000 !important;
}

/* ── ERGEBNIS ── */
.mj_result {
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin-top 0.3s ease;
}

.mj_result--visible {
    margin-top: 24px;
    max-height: 800px;
}

/* ── KACHELN ── */
.mj_cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.mj_card {
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.mj_card--green { background: #f0faf4; border-color: #86efac; }
.mj_card--red   { background: #fef2f2; border-color: #fca5a5; }

.mj_card_label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
    margin: 0 0 6px;
    padding: 0;
    border: none;
    background: none;
}

.mj_card--green .mj_card_label { color: #15803d; }
.mj_card--red   .mj_card_label { color: #b91c1c; }

.mj_card_value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.mj_card--green .mj_card_value { color: #15803d; }
.mj_card--red   .mj_card_value { color: #b91c1c; }

/* ── TOGGLE ── */
.mj_breakdown_toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    user-select: none;
    transition: background 0.15s;
    margin: 0;
}

.mj_breakdown_toggle:hover { background: #ebebeb; }

.mj_breakdown_toggle[aria-expanded="true"] {
    border-radius: 8px 8px 0 0 !important;
}

.mj_toggle_icon {
    font-size: 0.75rem;
    color: #888;
    transition: transform 0.2s;
    display: inline-block;
}

/* ── AUFSCHLÜSSELUNG ── */
.mj_breakdown_wrap {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.mj_breakdown,
.mj_table {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.mj_breakdown li,
.mj_table li {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 9px 14px !important;
    margin: 0 !important;
    font-size: 0.88rem !important;
    border-bottom: 1px solid #efefef !important;
    gap: 8px;
    box-sizing: border-box;
    background: #fff;
}

.mj_breakdown li:last-child,
.mj_table li:last-child { border-bottom: none !important; }

.mj_breakdown li span:first-child,
.mj_table li span:first-child { color: #444; flex: 1; margin: 0; padding: 0; }

.mj_breakdown li span:last-child,
.mj_table li span:last-child { text-align: right; white-space: nowrap; color: #1a1a1a; margin: 0; padding: 0; }

.mj_table { border-top: 2px solid #e0e0e0 !important; }
.mj_total { background: #f9f9f9 !important; }
.mj_total span { color: #1a1a1a !important; }
.mj_beforeTotal { border-bottom: 2px solid #d0d0d0 !important; }

/* ── HINWEISE ── */
.mj_hint {
    font-size: 0.85rem;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0;
    line-height: 1.5;
}

.mj_hint--green {
    color: #15803d;
    background: #f0faf4;
    border: 1px solid #86efac;
}

.mj_error {
    color: #b91c1c;
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
}

/* ── MOBILE ── */
@media (max-width: 520px) {
    .mj_container {
        padding: 18px 20px;
        border: none;
        border-top: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
        border-radius: 0;
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        max-width: none;
    }

    /* Segmente als Buttons untereinander */
    .mj_segment_group {
        grid-template-columns: 1fr;
        border-radius: 8px;
    }

    .mj_segment_group label {
        border-right: none !important;
        border-bottom: 1.5px solid #d0d0d0;
        padding: 13px 16px;
        font-size: 0.92rem;
        justify-content: flex-start;
    }

    .mj_segment_group label:last-of-type {
        border-bottom: none;
    }

    /* Input und Button nebeneinander, größer */
    .mj_input_row { flex-direction: row !important; }

    .mj_input {
        height: 52px !important;
        font-size: 1.1rem !important;
    }

    .mj_button {
        height: 52px !important;
        font-size: 1rem !important;
        width: auto !important;
        flex-shrink: 0 !important;
    }

    /* Kacheln */
    .mj_cards { grid-template-columns: 1fr; gap: 8px; }

    .mj_card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 12px 14px !important;
    }

    .mj_card_label { margin-bottom: 0; font-size: 0.75rem; }
    .mj_card_value { font-size: 1.05rem; }

    /* Aufschlüsselung – nebeneinander bleiben */
    .mj_breakdown li,
    .mj_table li {
        font-size: 0.82rem !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .mj_breakdown li span:last-child,
    .mj_table li span:last-child { text-align: right; }
}

.mj_container {
    margin-left: auto !important;
    margin-right: auto !important;
}