#allai-fc-composer,
#allai-fc-composer * {
    box-sizing: border-box;
}

#allai-fc-composer {
    --allai-fc-accent: #6c4cff;
    --allai-fc-accent-dark: #5134df;
    --allai-fc-heading: #17151e;
    --allai-fc-muted: #7a7683;
    --allai-fc-soft-surface: #f6f5f8;
    --allai-fc-translate-x: 50%;

    position: fixed;
    z-index: 9999;
    right: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    width: min(820px, calc(100% - 40px));
    transform: translateX(var(--allai-fc-translate-x));
    font-family: Inter, Tajawal, "Segoe UI", Arial, sans-serif;
    animation: allai-fc-composer-in 550ms ease-out both;
}

#allai-fc-composer .allai-fc-composer__form {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 6px;
    align-items: center;
    gap: 7px;
    overflow: visible;
    border: 3px solid var(--allai-fc-accent);
    border-radius: 32px;
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(108, 76, 255, 0.12),
        0 16px 34px rgba(32, 25, 54, 0.14),
        0 4px 10px rgba(32, 25, 54, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

#allai-fc-composer .allai-fc-composer__form:focus-within {
    border-color: var(--allai-fc-accent);
    box-shadow:
        0 0 0 4px rgba(108, 76, 255, 0.15),
        0 18px 38px rgba(32, 25, 54, 0.16),
        0 5px 12px rgba(32, 25, 54, 0.09);
    transform: translateY(-1px);
}

#allai-fc-composer .allai-fc-composer__model {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 150px;
    width: 150px;
    height: 42px;
    min-width: 0;
    align-items: center;
    overflow: visible;
    border: 1px solid rgba(23, 21, 30, 0.055);
    border-radius: 999px;
    background: var(--allai-fc-soft-surface);
    color: var(--allai-fc-heading);
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

#allai-fc-composer .allai-fc-composer__model:hover {
    border-color: rgba(108, 76, 255, 0.16);
    background: #f3f1f8;
}

#allai-fc-composer .allai-fc-composer__model:focus-within {
    border-color: rgba(108, 76, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(108, 76, 255, 0.07);
}

#allai-fc-composer .allai-fc-composer__model-icon {
    position: absolute;
    z-index: 2;
    left: 9px;
    width: 13px;
    height: 13px;
    fill: var(--allai-fc-accent);
    pointer-events: none;
}

#allai-fc-composer .allai-fc-composer__model-trigger {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 27px 0 29px;
    overflow: hidden;
    border: 0;
    border-radius: inherit;
    outline: 0;
    background: transparent;
    color: var(--allai-fc-heading);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

#allai-fc-composer .allai-fc-composer__model-trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(108, 76, 255, 0.1);
}

#allai-fc-composer .allai-fc-composer__model-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#allai-fc-composer .allai-fc-composer__model-chevron {
    position: absolute;
    z-index: 2;
    right: 8px;
    width: 12px;
    height: 12px;
    fill: none;
    stroke: #777380;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition: transform 160ms ease;
}

#allai-fc-composer .allai-fc-composer__model.allai-fc-is-open .allai-fc-composer__model-chevron {
    transform: rotate(180deg);
}

#allai-fc-composer .allai-fc-composer__model-menu {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 10px);
    left: 0;
    display: grid;
    width: 220px;
    max-height: min(300px, calc(100vh - 100px));
    padding: 7px;
    gap: 3px;
    overflow-y: auto;
    border: 1px solid rgba(23, 21, 30, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.985);
    box-shadow:
        0 20px 50px rgba(32, 25, 54, 0.16),
        0 6px 18px rgba(32, 25, 54, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: allai-fc-menu-in 150ms ease-out;
}

#allai-fc-composer .allai-fc-composer__model-menu[hidden] {
    display: none;
}

#allai-fc-composer .allai-fc-composer__model-option {
    display: flex;
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 0 10px;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 10px;
    outline: 0;
    background: transparent;
    color: #302d37;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition:
        background-color 140ms ease,
        color 140ms ease;
}

#allai-fc-composer .allai-fc-composer__model-option::before {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: radial-gradient(
        circle,
        var(--allai-fc-accent) 0 3px,
        #f1efff 3.5px 100%
    );
    content: "";
}

#allai-fc-composer .allai-fc-composer__model-option::after {
    flex: 0 0 7px;
    width: 7px;
    height: 11px;
    margin-right: 4px;
    margin-left: auto;
    border-right: 2px solid var(--allai-fc-accent);
    border-bottom: 2px solid var(--allai-fc-accent);
    content: "";
    opacity: 0;
    transform: rotate(45deg) scale(0.7);
    transition:
        opacity 140ms ease,
        transform 140ms ease;
}

#allai-fc-composer .allai-fc-composer__model-option:hover,
#allai-fc-composer .allai-fc-composer__model-option:focus-visible {
    background: #f6f4ff;
    color: var(--allai-fc-accent-dark);
}

#allai-fc-composer .allai-fc-composer__model-option:disabled,
#allai-fc-composer .allai-fc-composer__model-option[aria-disabled="true"] {
    color: #aaa6b2;
    cursor: not-allowed;
}

#allai-fc-composer .allai-fc-composer__model-option:disabled:hover,
#allai-fc-composer .allai-fc-composer__model-option:disabled:focus-visible,
#allai-fc-composer .allai-fc-composer__model-option[aria-disabled="true"]:hover,
#allai-fc-composer .allai-fc-composer__model-option[aria-disabled="true"]:focus-visible {
    background: transparent;
    color: #aaa6b2;
}

#allai-fc-composer .allai-fc-composer__model-option[aria-selected="true"] {
    background: #efecff;
    color: var(--allai-fc-accent-dark);
}

#allai-fc-composer .allai-fc-composer__model-option[aria-selected="true"]::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

#allai-fc-composer .allai-fc-composer__field {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    align-items: center;
}

#allai-fc-composer .allai-fc-composer__textarea {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 42px;
    min-height: 42px;
    max-height: 160px;
    margin: 0;
    padding: 10px 3px;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    box-shadow: none;
    color: var(--allai-fc-heading);
    font: inherit;
    font-size: 15px;
    font-weight: 450;
    line-height: 22px;
    caret-color: var(--allai-fc-accent);
    scrollbar-width: thin;
}

#allai-fc-composer .allai-fc-composer__textarea:focus {
    border: 0;
    outline: 0;
    box-shadow: none;
}

#allai-fc-composer .allai-fc-composer__placeholder {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 3px;
    left: 3px;
    overflow: hidden;
    transform: translateY(-50%);
    color: var(--allai-fc-muted);
    font-size: 15px;
    font-weight: 450;
    line-height: 22px;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 1;
    transition: opacity 110ms ease;
}

#allai-fc-composer .allai-fc-composer__placeholder::after {
    display: inline-block;
    width: 1.5px;
    height: 1em;
    margin-inline-start: 3px;
    vertical-align: -0.12em;
    background: var(--allai-fc-accent);
    content: "";
    animation: allai-fc-caret-blink 850ms steps(1) infinite;
}

#allai-fc-composer .allai-fc-composer__placeholder.allai-fc-is-hidden {
    opacity: 0;
}

#allai-fc-composer .allai-fc-composer__submit {
    position: relative;
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    outline: 0;
    background: linear-gradient(
        135deg,
        var(--allai-fc-accent),
        var(--allai-fc-accent-dark)
    );
    box-shadow:
        0 7px 16px rgba(108, 76, 255, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
    color: #fff;
    cursor: pointer;
    transition:
        transform 170ms ease,
        box-shadow 170ms ease,
        opacity 170ms ease;
}

#allai-fc-composer .allai-fc-composer__submit::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2),
        transparent 55%
    );
    content: "";
    pointer-events: none;
}

#allai-fc-composer .allai-fc-composer__submit:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 21px rgba(108, 76, 255, 0.31),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#allai-fc-composer .allai-fc-composer__submit:active {
    transform: scale(0.95);
}

#allai-fc-composer .allai-fc-composer__submit:focus-visible {
    outline: 3px solid rgba(108, 76, 255, 0.2);
    outline-offset: 3px;
}

#allai-fc-composer .allai-fc-composer__submit:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

#allai-fc-composer .allai-fc-composer__submit-icon {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes allai-fc-composer-in {
    from {
        opacity: 0.88;
        transform: translateX(var(--allai-fc-translate-x)) translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateX(var(--allai-fc-translate-x)) translateY(0);
    }
}

@keyframes allai-fc-caret-blink {
    0%,
    48% {
        opacity: 1;
    }

    49%,
    100% {
        opacity: 0;
    }
}

@keyframes allai-fc-menu-in {
    from {
        opacity: 0;
        transform: translateY(5px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 767px) {
    #allai-fc-composer {
        --allai-fc-translate-x: 0%;

        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 24px);
    }

    #allai-fc-composer .allai-fc-composer__form {
        gap: 6px;
        border-width: 2px;
        border-radius: 30px;
    }

    #allai-fc-composer .allai-fc-composer__model {
        flex-basis: 118px;
        width: 118px;
        height: 40px;
    }

    #allai-fc-composer .allai-fc-composer__model-icon {
        left: 8px;
        width: 12px;
        height: 12px;
    }

    #allai-fc-composer .allai-fc-composer__model-trigger {
        padding: 0 22px 0 25px;
        font-size: 11px;
    }

    #allai-fc-composer .allai-fc-composer__model-chevron {
        right: 7px;
        width: 11px;
        height: 11px;
    }

    #allai-fc-composer .allai-fc-composer__model-menu {
        width: min(220px, calc(100vw - 24px));
    }

    #allai-fc-composer .allai-fc-composer__textarea {
        max-height: 130px;
        font-size: 16px;
    }

    #allai-fc-composer .allai-fc-composer__placeholder {
        font-size: 14px;
    }

    #allai-fc-composer .allai-fc-composer__submit {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #allai-fc-composer,
    #allai-fc-composer *,
    #allai-fc-composer *::before,
    #allai-fc-composer *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
