/* Standalone PWA sharing surfaces. */

html.skinbg-standalone #skinbg-pwa-install,
html.skinbg-share-standalone #skinbg-pwa-install {
    display: none !important;
}

.skinbg-floating-share {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 54px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 26px;
    padding: 5px 8px;
    border: 1px solid rgba(13, 95, 122, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: #0D5F7A;
    box-shadow: 0 4px 14px rgba(18, 48, 68, 0.05);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.015em;
    opacity: 0.42;
    transition: opacity 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

html.skinbg-share-standalone .skinbg-floating-share,
html.skinbg-standalone .skinbg-floating-share {
    display: inline-flex;
}

.skinbg-floating-share:hover,
.skinbg-floating-share:focus-visible {
    opacity: 0.96;
    border-color: rgba(13, 95, 122, 0.18);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(18, 48, 68, 0.1);
    transform: translateY(-1px);
}

.skinbg-floating-share:active {
    opacity: 1;
    transform: translateY(0) scale(0.97);
}

.skinbg-floating-share:focus-visible,
.ai-message-share:focus-visible {
    outline: 3px solid rgba(2, 132, 199, 0.3);
    outline-offset: 3px;
}

.skinbg-floating-share__icon,
.ai-message-share__icon,
[data-skinbg-share-icon] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.skinbg-floating-share__icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
}

.skinbg-floating-share__label {
    display: inline-block;
    white-space: nowrap;
}

.skinbg-share-symbol,
.skinbg-share-check-icon {
    display: block;
    width: 100%;
    height: 100%;
}

.skinbg-floating-share.is-success {
    opacity: 0.9;
    border-color: rgba(22, 163, 74, 0.16);
    background: rgba(240, 253, 244, 0.9);
    color: #15803D;
}

html.skinbg-assistant-open .skinbg-floating-share,
html.skinbg-assistant-keyboard-active .skinbg-floating-share,
body.skinbg-menu-open .skinbg-floating-share,
body.customize-preview .skinbg-floating-share {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skinbg-share-toast {
    position: fixed;
    top: calc(max(76px, env(safe-area-inset-top) + 64px));
    right: max(14px, env(safe-area-inset-right));
    z-index: 10020;
    max-width: min(280px, calc(100vw - 28px));
    padding: 9px 13px;
    border: 1px solid rgba(13, 95, 122, 0.14);
    border-radius: 999px;
    background: rgba(18, 48, 68, 0.96);
    color: #fff;
    box-shadow: 0 12px 30px rgba(18, 48, 68, 0.2);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 700;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.skinbg-share-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.skinbg-share-toast[hidden] {
    display: none !important;
}

.ai-message-share-row {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin: 5px 0 2px;
    padding-left: 2px;
}

.ai-message-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(13, 95, 122, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: rgba(18, 48, 68, 0.72);
    box-shadow: 0 4px 12px rgba(18, 48, 68, 0.05);
    cursor: pointer;
    font-size: 10.5px;
    line-height: 1;
    font-weight: 700;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.ai-message-share:hover {
    border-color: rgba(13, 95, 122, 0.24);
    background: #fff;
    color: #0D5F7A;
    transform: translateY(-1px);
}

.ai-message-share:active {
    transform: translateY(0) scale(0.98);
}

.ai-message-share__icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.ai-message-share.is-success {
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(22, 163, 74, 0.08);
    color: #15803D;
}

@media (max-width: 767px) {
    .skinbg-floating-share {
        right: max(10px, env(safe-area-inset-right));
        bottom: calc(max(10px, env(safe-area-inset-bottom)) + 52px);
        min-height: 24px;
        padding: 4px 7px;
        font-size: 9.5px;
    }

    .skinbg-floating-share__icon {
        width: 12px;
        height: 12px;
        flex-basis: 12px;
    }

    .skinbg-share-toast {
        top: calc(max(68px, env(safe-area-inset-top) + 58px));
        right: max(10px, env(safe-area-inset-right));
        max-width: calc(100vw - 20px);
        font-size: 11.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skinbg-floating-share,
    .ai-message-share,
    .skinbg-share-toast {
        transition: none;
    }
}
