/* floating widget container */
.floating-iframe-wrapper {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 620px;
    height: 640px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
}

.floating-iframe-header {
    height: 36px;
    background: linear-gradient(90deg, #f7f7f7, #eef2f5);
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 8px;
    border-bottom: 1px solid #e6e6e6;
}

.floating-iframe-title {
    flex: 1;
    font-size: 13px;
    color: #333;
    user-select: none;
}

.floating-iframe-controls button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
}

.floating-iframe-body {
    flex: 1;
    min-height: 0;
    /* allow proper flex children sizing */
}

.floating-iframe-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* minimized state */
.floating-iframe-wrapper.minimized {
    height: 44px;
    width: 260px;
}

.floating-iframe-wrapper.minimized .floating-iframe-body {
    display: none;
}

/* Responsive: on small screens show the widget as a bottom sheet full width */
@media (max-width: 768px) {
    .floating-iframe-wrapper {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: auto;
        max-height: 90vh; /* don't cover entire screen */
        border-radius: 8px 8px 0 0;
        margin: 0;
        box-shadow: 0 -8px 24px rgba(0,0,0,0.2);
        z-index: 99999;
    }

    .floating-iframe-wrapper .floating-iframe-body {
        display: block;
        height: calc(90vh - 44px); /* header height = 44px */
        min-height: 200px;
    }

    /* Override inline min-height on the iframe for mobile */
    #omniShareIframe {
        min-height: calc(90vh - 44px) !important;
        height: 100% !important;
    }

    .floating-iframe-wrapper.minimized {
        width: 100%;
        height: 44px;
        border-radius: 8px 8px 0 0;
    }

    .floating-iframe-header {
        height: 44px;
    }
}