/* Floating panel module.
   Shared shell for Messenger, Radio, homepage audio toggle and Greenie footer lift. */

.messenger-panel-overlay,
.radio-panel-overlay {
    align-items: flex-end;
    background: rgba(8, 26, 16, 0.26);
    display: none;
    inset: 0;
    justify-content: flex-end;
    padding: 18px;
    position: fixed;
    z-index: 4345;
}

.messenger-panel-overlay {
    z-index: 4350;
}

.messenger-panel-overlay.is-open,
.radio-panel-overlay.is-open {
    display: flex;
}

.messenger-panel,
.radio-panel {
    background: rgba(9, 34, 21, 0.96);
    border: 1px solid rgba(115, 255, 171, 0.32);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.40);
    color: #f0fff5;
    display: flex;
    flex-direction: column;
    height: min(var(--floating-panel-height, 620px), calc(100vh - 40px));
    overflow: hidden;
    width: min(var(--floating-panel-width, 420px), calc(100vw - 24px));
}

@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
    .messenger-panel,
    .radio-panel {
        -webkit-backdrop-filter: blur(14px) saturate(130%);
        backdrop-filter: blur(14px) saturate(130%);
    }
}

.radio-panel {
    --floating-panel-height: 560px;
    --floating-panel-width: 390px;
}

.messenger-panel__header,
.radio-panel__header {
    align-items: center;
    background: linear-gradient(135deg, rgba(33, 180, 91, 0.96), rgba(18, 116, 61, 0.96));
    color: #ffffff;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
}

.radio-panel__header {
    background: linear-gradient(135deg, rgba(33, 180, 91, 0.96), rgba(16, 96, 72, 0.96));
}

.messenger-panel__title,
.radio-panel__title {
    align-items: center;
    display: inline-flex;
    font-size: 0.98rem;
    font-weight: 800;
    gap: 8px;
    line-height: 1.15;
    margin: 0;
}

.messenger-panel__close,
.radio-panel__close {
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 34px;
}

.messenger-panel__frame,
.radio-panel__frame {
    background: #ffffff;
    border: 0;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.page-index .vb-audio-toggle,
body[data-page="index"] .vb-audio-toggle {
    bottom: auto;
    left: max(16px, calc((100vw - 1140px) / 2 + 16px));
    max-width: calc(100vw - 32px);
    position: absolute;
    right: auto;
    top: max(160px, calc(var(--hero-height, 360px) + 18px));
    z-index: 18;
}

#helper-bot-button {
    bottom: var(--greenie-bottom-offset, 20px) !important;
    right: 18px !important;
    transition: bottom 180ms ease;
}

#helper-bot-panel {
    bottom: calc(var(--greenie-bottom-offset, 20px) + 132px) !important;
    right: 18px !important;
    transition: bottom 180ms ease;
}

@media (max-width: 768px) {
    .messenger-panel-overlay,
    .radio-panel-overlay {
        align-items: stretch;
        padding: 10px;
    }

    .messenger-panel,
    .radio-panel {
        border-radius: 14px;
        height: calc(100vh - 20px);
        width: 100%;
    }

    .page-index .vb-audio-toggle,
    body[data-page="index"] .vb-audio-toggle {
        left: 12px;
        max-width: calc(100vw - 24px);
        top: 112px;
    }

    #helper-bot-button {
        bottom: var(--greenie-bottom-offset, 16px) !important;
        height: 92px !important;
        right: 10px !important;
        width: 92px !important;
    }

    #helper-bot-panel {
        bottom: calc(var(--greenie-bottom-offset, 16px) + 104px) !important;
        max-height: min(440px, calc(100vh - 132px)) !important;
        right: 10px !important;
        width: min(340px, calc(100vw - 20px)) !important;
    }
}
