.khayal-chat-widget {
    font-family: Cairo, Tahoma, sans-serif;
    direction: rtl;
    --widget-ink: #102c3b;
    --widget-gold: #e7c777;
}
.khayal-chat-launcher {
    position: fixed;
    bottom: max(22px, env(safe-area-inset-bottom));
    left: 24px;
    z-index: 1400;
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--widget-ink);
    font: inherit;
    transition: transform 0.3s cubic-bezier(0.2, 0.75, 0.3, 1);
}
.khayal-chat-launcher:hover {
    transform: translateY(-4px);
}
.khayal-chat-label {
    display: grid;
    text-align: right;
    background: #fff;
    padding: 10px 17px;
    border: 1px solid #e7e8e2;
    border-radius: 15px 15px 4px 15px;
    box-shadow: 0 6px 25px #102c3b12;
    line-height: 1.6;
}
.khayal-chat-label strong {
    font-size: 13px;
    font-weight: 800;
}
.khayal-chat-label > span {
    font-size: 10px;
    color: #53666e;
}
.khayal-chat-bubble {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    position: relative;
    background: var(--widget-ink);
    color: white;
    border: 1px solid #ffffff40;
    border-radius: 50% 50% 17px 50%;
    box-shadow: 0 8px 28px #102c3b35;
    animation:
        khayal-bubble-arrive 0.65s cubic-bezier(0.2, 0.75, 0.3, 1) both,
        khayal-bubble-float 3.8s ease-in-out 0.7s 3;
}
.khayal-chat-bubble svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.khayal-chat-spark {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    background: var(--widget-gold);
    border-radius: 50%;
    color: var(--widget-ink);
    font-size: 16px;
    border: 2px solid white;
}
.khayal-chat-launcher[aria-expanded="true"] .khayal-chat-label {
    display: none;
}
.khayal-chat-launcher[aria-expanded="true"] .khayal-chat-bubble {
    animation: none;
}
.khayal-chat-panel {
    position: fixed;
    left: 24px;
    bottom: 100px;
    z-index: 1500;
    width: min(420px, calc(100vw - 48px));
    height: min(730px, calc(100dvh - 125px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f7f5ef;
    border: 1px solid #dce3dd;
    border-radius: 20px;
    box-shadow: 0 20px 90px #102c3b35;
    animation: khayal-panel-open 0.25s cubic-bezier(0.2, 0.75, 0.3, 1);
    isolation: isolate;
}
.khayal-chat-panel[hidden] {
    display: none !important;
}
.khayal-chat-toolbar {
    height: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: #fff;
    color: var(--widget-ink);
    border-bottom: 1px solid #e3e7e1;
    font-size: 10px;
    font-weight: 700;
}
.khayal-chat-toolbar > div {
    display: flex;
    align-items: center;
    gap: 6px;
}
.khayal-chat-toolbar button,
.khayal-chat-toolbar a {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    border-radius: 7px;
}
.khayal-chat-toolbar button:hover,
.khayal-chat-toolbar a:hover {
    background: #ecefe8;
}
.khayal-chat-toolbar svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.khayal-chat-frame {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: 0;
    background: #efeae2;
}
.khayal-chat-widget button:focus-visible,
.khayal-chat-widget a:focus-visible {
    outline: 3px solid #b97709;
    outline-offset: 4px;
}
.khayal-chat-widget.is-page-hidden .khayal-chat-bubble {
    animation-play-state: paused;
}
@keyframes khayal-bubble-arrive {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes khayal-bubble-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}
@keyframes khayal-panel-open {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@media (max-width: 600px) {
    .khayal-chat-launcher {
        left: 16px;
        bottom: max(16px, env(safe-area-inset-bottom));
        gap: 9px;
    }
    .khayal-chat-bubble {
        width: 56px;
        height: 56px;
    }
    .khayal-chat-label {
        padding: 8px 13px;
    }
    .khayal-chat-label strong {
        font-size: 12px;
    }
    .khayal-chat-label > span {
        font-size: 9px;
    }
    .khayal-chat-panel {
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        top: max(8px, env(safe-area-inset-top));
        width: auto;
        height: auto;
        border-radius: 16px;
    }
    .khayal-chat-widget.is-open .khayal-chat-launcher {
        visibility: hidden;
    }
}
@media (prefers-reduced-motion: reduce) {
    .khayal-chat-widget * {
        animation: none !important;
        transition: none !important;
    }
}
