#gilassistant-widget,
#gilassistant-widget * {
    box-sizing: border-box;
}

#gilassistant-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Launcher */
#gilassistant-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999998;

    display: flex;
    align-items: center;
    gap: 9px;

    height: 56px;
    padding: 0 20px;

    border: 0;
    border-radius: 30px;

    background: #111111;
    color: #ffffff;

    box-shadow: 0 8px 28px rgba(0,0,0,.24);
    cursor: pointer;

    font-size: 14px;
    font-weight: 700;

    transition: transform .2s ease, box-shadow .2s ease;
}

#gilassistant-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0,0,0,.30);
}

.gilassistant-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 50%;
    background: #7547ed;
    color: #ffffff;

    font-size: 17px;
}

/* Chat window */
#gilassistant-window {
    position: fixed;
    right: 22px;
    bottom: 90px;
    z-index: 999999;

    display: flex;
    flex-direction: column;

    width: 380px;
    height: 560px;
    max-height: calc(100vh - 120px);

    overflow: hidden;

    background: #ffffff;
    border: 1px solid #e9e9ee;
    border-radius: 20px;

    box-shadow: 0 18px 60px rgba(0,0,0,.20);

    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;
}

#gilassistant-window.gilassistant-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(15px) scale(.97);
}

/* Header */
.gilassistant-header {
    min-height: 76px;
    padding: 14px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #111111;
    color: #ffffff;
}

.gilassistant-header-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.gilassistant-avatar {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: linear-gradient(135deg, #7547ed, #9568f5);
    color: #ffffff;

    font-size: 20px;
    font-weight: 800;
}

.gilassistant-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.gilassistant-status {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-top: 5px;

    color: #d7d7dc;
    font-size: 11px;
}

.gilassistant-status-dot {
    width: 7px;
    height: 7px;

    display: inline-block;

    border-radius: 50%;
    background: #35d07f;
}

#gilassistant-close {
    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.08);
    color: #ffffff;

    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

/* Messages */
.gilassistant-messages {
    flex: 1;

    padding: 20px 16px;

    overflow-y: auto;

    background: #f7f7fa;
}

.gilassistant-message {
    display: flex;
    width: 100%;
    margin-bottom: 14px;
}

.gilassistant-assistant {
    justify-content: flex-start;
}

.gilassistant-user {
    justify-content: flex-end;
}

.gilassistant-message-bubble {
    max-width: 82%;

    padding: 12px 14px;

    border-radius: 16px;

    font-size: 14px;
    line-height: 1.55;

    /* Preserve Gemini's paragraphs and lists. */
    white-space: pre-wrap;

    /* Prevent long URLs/words from breaking mobile layout. */
    overflow-wrap: anywhere;
    word-break: normal;
}

.gilassistant-assistant .gilassistant-message-bubble {
    background: #ffffff;
    color: #222222;

    border: 1px solid #e8e8ee;
    border-bottom-left-radius: 5px;

    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.gilassistant-user .gilassistant-message-bubble {
    background: #7547ed;
    color: #ffffff;

    border-bottom-right-radius: 5px;
}

/* Input */
.gilassistant-input-area {
    display: flex;
    align-items: flex-end;
    gap: 9px;

    padding: 12px;

    background: #ffffff;
    border-top: 1px solid #ededf2;
}

#gilassistant-input {
    flex: 1;

    min-height: 44px;
    max-height: 110px;

    padding: 11px 13px;

    resize: none;

    border: 1px solid #dedee6;
    border-radius: 14px;

    outline: none;

    background: #f8f8fa;
    color: #222222;

    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
}

#gilassistant-input:focus {
    border-color: #7547ed;
    background: #ffffff;
}

#gilassistant-send {
    width: 44px;
    height: 44px;

    flex-shrink: 0;

    border: 0;
    border-radius: 14px;

    background: #7547ed;
    color: #ffffff;

    cursor: pointer;

    font-size: 20px;
    font-weight: 700;
}

#gilassistant-send:hover {
    background: #6335dc;
}

/* Footer */
.gilassistant-footer {
    padding: 0 12px 10px;

    background: #ffffff;
    color: #9a9aa2;

    text-align: center;
    font-size: 10px;
}

/* Mobile */
@media (max-width: 575px) {

    #gilassistant-launcher {
        right: 14px;
        bottom: 14px;

        width: 56px;
        padding: 0;

        justify-content: center;
    }

    .gilassistant-launcher-text {
        display: none;
    }

    #gilassistant-window {
        right: 10px;
        bottom: 80px;

        width: calc(100% - 20px);
        height: min(600px, calc(100vh - 100px));

        border-radius: 18px;
    }
}

/* Gil Assistant - Human Support Ticket Button */
.gilassistant-ticket-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 11px 16px;
    border-radius: 10px;
    background: #6d28d9;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: transform .15s ease, opacity .15s ease;
}

.gilassistant-ticket-button:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    opacity: .92;
    transform: translateY(-1px);
}

.gilassistant-ticket-button:focus {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Fix support ticket button layout */
.gilassistant-assistant {
    flex-direction: column;
    align-items: flex-start;
}

.gilassistant-assistant .gilassistant-ticket-button {
    display: flex;
    width: auto;
    max-width: 100%;
    margin-top: 10px;
    padding: 11px 18px;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Gil Assistant sales button */
.gilassistant-order-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    margin-top: 10px;
    padding: 11px 18px;
    border-radius: 10px;
    background: #16a34a;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    box-sizing: border-box;
    transition: transform .15s ease, opacity .15s ease;
}

.gilassistant-order-button:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    opacity: .92;
    transform: translateY(-1px);
}

.gilassistant-order-button:focus {
    color: #ffffff !important;
    text-decoration: none !important;
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Header action buttons: New Chat + Close */
.gilassistant-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

#gilassistant-new-chat {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.08);
    color: #ffffff;

    cursor: pointer;
    font-size: 22px;
    line-height: 1;

    transition: background .15s ease, transform .15s ease;
}

#gilassistant-new-chat:hover {
    background: rgba(255,255,255,.16);
    transform: rotate(20deg);
}

#gilassistant-new-chat:disabled {
    opacity: .45;
    cursor: default;
    transform: none;
}


.gilassistant-welcome-bubble {
    white-space: normal;
}
