/* Handy-Layout: bis 700px */
@media (max-width: 700px) {

    /* Variablen */
    :root {
        --page-padding: 8px;
        --menu-left: 76px;
        --menu-top: 18px;
    }

    /* Gemeinsames Seitenlayout */
    body {
        padding-left: var(--page-padding);
        padding-right: var(--page-padding);
        max-width: 100vw;
        overflow-x: hidden;
    }

    main {
        padding-top: 10px;
    }

    body.gefahr-page main,
    body.stromausfall-page main,
    .index-page main {
        padding-top: 120px;
    }

    main h1 {
        margin-top: 0;
        font-size: 1.9rem;
    }

    .desktop-left-right {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .desktop-left-right>div:first-child {
        margin-top: 0;
    }

    .main-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin-top: 12px;
    }

    .footer {
        width: 100%;
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        font-size: 0.85rem;
        padding: 8px 10px;
        gap: 6px;
    }

    /* Navigation und Kopfbereich */
    .site-header-spacer,
    .index-page .header-spacer {
        height: 110px;
    }

    .Logo {
        width: 60px;
        top: 10px;
        left: 12px;
    }

    .menu-button {
        font-size: 16px;
    }

    .link {
        left: calc(var(--menu-left) + 80px);
    }

    .topnav {
        left: var(--menu-left);
        top: calc(var(--menu-top) + var(--menu-dropdown-offset));
        width: fit-content;
        max-width: calc(100vw - var(--menu-left) - 150px);
        box-sizing: border-box;
    }

    .social-icons {
        top: 10px;
        bottom: auto;
        right: 8px;
        z-index: 1201;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
    }

    .social-icons a {
        margin-right: 0;
    }

    .social-icon {
        width: 18px;
        height: 18px;
    }

    /* Chat-Popup */
    .chatbot-popup {
        left: auto !important;
        right: var(--page-padding) !important;
        bottom: max(78px, calc(16px + env(safe-area-inset-bottom))) !important;
        width: 70vw !important;
        max-width: 70vw !important;
        height: 65vh !important;
        font-size: 0.8rem !important;
    }

    .chatbot-header {
        height: 18px;
        padding: 1px 4px;
    }

    .chatbot-close {
        font-size: 14px;
        padding: 1px 4px;
    }

    .chatbot-badge {
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
    }
}

/* Schmale Desktop-Fenster: Desktop-Chatverhalten beibehalten */
@media (max-width: 700px) and (hover: hover) and (pointer: fine) {
    .chatbot-popup {
        right: 30px !important;
        bottom: 90px !important;
        left: auto !important;
        width: 70vw !important;
        max-width: 70vw !important;
        height: 65vh !important;
        font-size: initial !important;
    }
}

/* Kleine Handys und kompakte Breiten: bis 600px */
@media (max-width: 600px) {

    /* Gemeinsames Seitenlayout */
    body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .desktop-left-right {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-image {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    /* Navigation und Kopfbereich */
    #logout-button {
        top: 40px;
        right: 8px;
        padding: 5px 12px;
        font-size: 0.8em;
    }

    .topnav a {
        display: block;
        padding: 10px 0;
    }

}

/* Kleine Handys: bis 520px */
@media (max-width: 520px) {

    /* Variablen */
    :root {
        --menu-left: 74px;
    }

    /* Gemeinsames Seitenlayout */
    body.gefahr-page main,
    body.stromausfall-page main,
    .index-page main {
        padding-top: 140px;
    }

    main h1 {
        font-size: 1.7rem;
        line-height: 1.1;
    }

    .desktop-left-right {
        flex-direction: column;
    }

    /* Navigation und Kopfbereich */
    .site-header-spacer,
    .index-page .header-spacer {
        height: 100px;
    }

    .menu-button {
        gap: 6px;
    }

    .chatbot-header {
        min-height: 36px;
        padding: 5px 7px;
    }

    .chatbot-header-actions {
        gap: 5px;
    }

    .chatbot-header-button,
    .chatbot-close {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .form-container {
        gap: 6px;
        width: 100%;
        max-width: none;
        padding: 8px 7px;
    }

    #chatbot-input {
        height: 38px;
        padding: 0 9px 0 42px;
        font-size: 16px;
    }

    .chatbot-input-shell.has-text #chatbot-input {
        padding: 0 9px;
    }

    .chatbot-input-poll-button,
    .chatbot-input-emoji,
    .whatsapp-send-btn {
        width: 34px;
        height: 34px;
    }

    .chatbot-input-poll-button {
        left: 4px;
        font-size: 21px;
    }

    .whatsapp-send-btn img {
        width: 20px;
        height: 20px;
    }
}

/* Sehr kleine Handys: bis 420px */
@media (max-width: 420px) {

    /* Variablen */
    :root {
        --menu-left: 72px;
    }

    /* Gemeinsames Seitenlayout */
    body.gefahr-page main,
    body.stromausfall-page main,
    .index-page main {
        padding-top: 155px;
    }

    main h1 {
        font-size: 1.55rem;
    }

    /* Navigation und Kopfbereich */
    .site-header-spacer,
    .index-page .header-spacer {
        height: 95px;
    }

    .Logo {
        width: 53px;
    }
}