/*
 * Keramika Outlet FreeScout launcher
 * Test release 1.0.0
 */

#fsw-btn {
    box-sizing: border-box !important;
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    min-height: 62px !important;
    right: 20px !important;
    bottom: 20px !important;
    padding: 17px !important;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.24),
        0 3px 8px rgba(0, 0, 0, 0.16);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
    isolation: isolate;
}

#fsw-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.28),
        0 5px 12px rgba(0, 0, 0, 0.18);
}

#fsw-btn:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

#fsw-btn > img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    display: block;
}

/*
 * Hide the official 10×10 orange dot.
 */
#fsw-btn-new {
    display: none !important;
}

#ko-fsw-label {
    position: absolute;
    top: 50%;
    right: 76px;
    transform: translateY(-50%);
    min-height: 42px;
    padding: 0 17px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    border: 1px solid rgba(224, 65, 65, 0.22);
    border-radius: 999px;
    background: #ffffff;
    color: #242424;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.14),
        0 2px 5px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    user-select: none;
}

#ko-fsw-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 25px;
    padding: 0 6px;
    border: 3px solid #e04141;
    border-radius: 999px;
    background: #ffffff;
    color: #d82f2f;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-sizing: border-box;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.26);
}

#fsw-btn.ko-fsw-has-unread #ko-fsw-badge {
    display: flex;
}

#fsw-btn.ko-fsw-attention {
    animation:
        ko-fsw-launcher-bounce
        700ms
        cubic-bezier(0.18, 0.89, 0.32, 1.28)
        2;
}

#fsw-btn.ko-fsw-attention::before,
#fsw-btn.ko-fsw-attention::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -4px;
    border: 3px solid rgba(224, 65, 65, 0.65);
    border-radius: 50%;
    pointer-events: none;
    animation:
        ko-fsw-attention-ring
        1400ms
        ease-out
        3;
}

#fsw-btn.ko-fsw-attention::after {
    animation-delay: 350ms;
}

#ko-fsw-toast {
    position: fixed;
    right: 20px;
    bottom: 98px;
    z-index: 1100;
    width: min(330px, calc(100vw - 40px));
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 42px 15px 16px;
    border: 1px solid rgba(224, 65, 65, 0.2);
    border-left: 5px solid #e04141;
    border-radius: 13px;
    background: #ffffff;
    color: #242424;
    box-shadow:
        0 14px 38px rgba(0, 0, 0, 0.2),
        0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.98);
    transition:
        opacity 180ms ease,
        visibility 180ms ease,
        transform 220ms ease;
}

#ko-fsw-toast.ko-fsw-toast-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ko-fsw-toast-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ko-fsw-toast-title {
    color: #1f1f1f;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.ko-fsw-toast-body {
    color: #565656;
    font-size: 14px;
    line-height: 1.4;
}

.ko-fsw-toast-close {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #777777;
    font-size: 23px;
    font-weight: 400;
    line-height: 28px;
    cursor: pointer;
}

.ko-fsw-toast-close:hover,
.ko-fsw-toast-close:focus-visible {
    background: #f1f1f1;
    color: #222222;
}

#fsw-iframe {
    width: min(390px, calc(100vw - 32px)) !important;
    height: min(640px, calc(100vh - 32px)) !important;
    max-height: calc(100vh - 32px) !important;
}

@keyframes ko-fsw-launcher-bounce {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    32% {
        transform: translateY(-9px) scale(1.06);
    }

    58% {
        transform: translateY(2px) scale(0.98);
    }

    78% {
        transform: translateY(-3px) scale(1.02);
    }
}

@keyframes ko-fsw-attention-ring {
    0% {
        opacity: 0.72;
        transform: scale(0.84);
    }

    100% {
        opacity: 0;
        transform: scale(1.55);
    }
}

@media (max-width: 767px) {
    #fsw-btn {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        right: 16px !important;
        bottom: max(
            16px,
            env(safe-area-inset-bottom)
        ) !important;
        padding: 15px !important;
    }

    #fsw-btn > img {
        width: 26px !important;
        height: 26px !important;
    }

    #ko-fsw-label {
        display: none;
    }

    #ko-fsw-toast {
        left: 16px;
        right: 16px;
        bottom: calc(
            84px
            + env(safe-area-inset-bottom)
        );
        width: auto;
    }

    #fsw-iframe {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #fsw-btn,
    #ko-fsw-toast {
        transition: none !important;
    }

    #fsw-btn.ko-fsw-attention,
    #fsw-btn.ko-fsw-attention::before,
    #fsw-btn.ko-fsw-attention::after {
        animation: none !important;
    }
}

/* Desktop image viewer promoted from the chat iframe to the page viewport. */
body.ko-fsw-image-modal-open {
    overflow: hidden !important;
}

.ko-fsw-image-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 24px;
    background: rgba(18, 29, 39, 0.88);
}

.ko-fsw-image-modal-dialog {
    display: flex;
    flex-direction: column;
    width: auto;
    max-width: min(94vw, 1400px);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.ko-fsw-image-modal-header,
.ko-fsw-image-modal-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 11px 14px;
}

.ko-fsw-image-modal-header {
    justify-content: space-between;
    border-bottom: 1px solid #e5e8eb;
}

.ko-fsw-image-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid #e5e8eb;
}

.ko-fsw-image-modal-title {
    max-width: calc(100vw - 160px);
    overflow: hidden;
    color: #334552;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ko-fsw-image-modal-close {
    flex: 0 0 auto;
    margin-left: 18px;
    padding: 0 3px;
    border: 0;
    background: transparent;
    color: #687784;
    font-size: 31px;
    line-height: 26px;
    cursor: pointer;
}

.ko-fsw-image-modal-close:focus-visible,
.ko-fsw-image-modal-download:focus-visible {
    outline: 3px solid #147bc1;
    outline-offset: 2px;
}

.ko-fsw-image-modal-viewport {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    min-height: 220px;
    overflow: auto;
    background: #101820;
}

.ko-fsw-image-modal-viewport img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 145px);
    object-fit: contain;
}

.ko-fsw-image-modal-download {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid #b9c2ca;
    border-radius: 4px;
    background: #ffffff;
    color: #334552;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.ko-fsw-image-modal-download:hover {
    background: #f4f6f8;
    color: #1d2b35;
    text-decoration: none;
}

@media (max-width: 767px) {
    .ko-fsw-image-modal {
        display: none !important;
    }
}

/* Recoverable widget loading state for uncached and privacy-mode loads. */
.ko-fsw-loading-overlay {
    position: fixed;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    padding: 24px;
    background: #ffffff;
    color: #334552;
    box-shadow: rgba(0, 0, 0, 0.2) 0 0 0.428571rem 0;
}

.ko-fsw-loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 280px;
    text-align: center;
}

.ko-fsw-loading-spinner {
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    border: 3px solid #dce3e8;
    border-top-color: #e54141;
    border-radius: 50%;
    animation: ko-fsw-loading-spin 800ms linear infinite;
}

.ko-fsw-loading-message {
    margin: 0;
    color: #334552;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.ko-fsw-loading-retry {
    display: none;
    margin-top: 16px;
    padding: 8px 15px;
    border: 1px solid #147bc1;
    border-radius: 5px;
    background: #147bc1;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.ko-fsw-loading-error .ko-fsw-loading-spinner {
    display: none;
}

.ko-fsw-loading-error .ko-fsw-loading-retry {
    display: inline-flex;
}

.ko-fsw-loading-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #687784;
    font-size: 28px;
    line-height: 32px;
    cursor: pointer;
}

.ko-fsw-loading-close:hover,
.ko-fsw-loading-close:focus-visible {
    background: #f0f3f5;
    color: #1f2e38;
}

@keyframes ko-fsw-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767px) {
    .ko-fsw-loading-overlay {
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding:
            max(24px, env(safe-area-inset-top))
            24px
            max(24px, env(safe-area-inset-bottom));
        border-radius: 0 !important;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ko-fsw-loading-spinner {
        animation-duration: 1600ms;
    }
}
