:root {
    --sa-top: env(safe-area-inset-top);
    --sa-right: env(safe-area-inset-right);
    --sa-bottom: env(safe-area-inset-bottom);
    --sa-left: env(safe-area-inset-left);
}

html, body {
    height: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: max(0px, var(--sa-top));
    padding-bottom: max(0px, var(--sa-bottom));
    padding-left: max(0px, var(--sa-left));
    padding-right: max(0px, var(--sa-right));
    overflow-x: hidden; /* keine horizontale Scrollbar auf kleinen Screens */
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Touch-Optimierungen */
.tap-target {
    min-height: 44px;
    padding: .6rem .9rem;
}

/* Bilder standardmäßig responsiv und lazy */
img {
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    filter: blur(0);
}

/* Dark-Mode freundliche Card/Hintergründe */
[data-bs-theme="dark"] body {
    background-color: #0b0f14;
    color: #e7edf3;
}

[data-bs-theme="dark"] .card {
    background-color: #0f141a;
    border-color: #1b2733;
}

[data-bs-theme="dark"] .navbar {
    background-color: #0f141a !important;
}

#scenario-switcher .btn {
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#scenario-upload-label input[type="file"] {
    display: none;
}

#scenario-switcher .scenario-icon svg {
    width: 1rem;
    height: 1rem;
}

#scenario-switcher .scenario-label {
    white-space: nowrap;
}

@media (max-width: 576px) {
    #scenario-switcher .scenario-icon + .scenario-label {
        display: none;
    }

    #scenario-switcher .scenario-icon svg {
        width: 1rem;
        height: 1rem;
    }

    #scenario-switcher .btn {
        justify-content: center;
    }
}

.budget-menu-item {
    position: relative;
}

.budget-menu-toggle {
    text-transform: none;
}

.budget-menu-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 260px;
    z-index: 1020;
    display: none;
}

.budget-menu-panel.is-open {
    display: block;
}

@media (max-width: 768px) {
    .budget-menu-item {
        width: 100%;
    }

    .budget-menu-panel {
        position: static;
        width: 100%;
    }
}

.mobile-only {
    display: none;
}

.not-mobile {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .not-mobile {
        display: none;
    }
}

.splash-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
}

.splash-overlay.is-visible {
    display: flex;
}

.splash-content {
    position: relative;
    width: min(90vw, 640px);
    min-height: clamp(360px, 60vh, 520px);
    border-radius: 0.5rem;
    overflow: hidden;
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 2.5rem);
    padding: clamp(1.75rem, 5vw, 3rem);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
}

.splash-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/beraten.jpg") center / cover no-repeat;
    transform: scale(1.02);
    filter: brightness(0.85);
}

.splash-content > * {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .splash-overlay::before {
        background-image: url("../img/beraten-mobile.jpg");
    }
}

.splash-title {
    font-size: clamp(2.5rem, 5vw, 3.25rem);
    font-weight: 700;
    margin: 0;
}

.splash-hint {
    font-size: clamp(1.05rem, 3.5vw, 1.2rem);
    line-height: 1.6;
    max-width: 40ch;
    text-wrap: balance;
    margin: 0;
}

.splash-close {
    align-self: center;
    min-width: 160px;
    opacity: 0.85;
}

#profile_package {
    background-color: #5f6163;
    color: white;
}

select#profile_lifestyle {
    background-color: #2e9a00;
    color: white;
}

.alert-success {
    background-color: #2e9a00;
}

input.form-control {
    background-color: #6e6f71;
    color: white;
}

input.form-control option {
    background-color: #d0d0d0;
}