.floaro-public-assistant,
.floaro-public-assistant * {
    box-sizing: border-box;
}

.floaro-public-assistant {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.floaro-public-assistant[hidden] {
    display: none;
}

.floaro-assistant-launcher {
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 21px;
    background: linear-gradient(135deg, #0f766e, #22c55e);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 22px 55px rgba(15, 118, 110, .38);
    transition: transform .2s, box-shadow .2s;
    touch-action: manipulation;
}

.floaro-assistant-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 26px 65px rgba(15, 118, 110, .46);
}

.floaro-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 80px;
    width: 390px;
    height: 590px;
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 32px 90px rgba(15, 23, 42, .3);
}

.floaro-assistant-panel[hidden] {
    display: none;
}

.floaro-assistant-header {
    padding: 17px 18px;
    background: linear-gradient(135deg, #063b36, #0f766e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

.floaro-assistant-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.floaro-assistant-brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.floaro-assistant-brand small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, .76);
    font-size: 11px;
}

.floaro-assistant-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
    font-size: 19px;
}

.floaro-assistant-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    touch-action: manipulation;
}

.floaro-assistant-chat {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    background: #f7faf9;
    display: flex;
    flex-direction: column;
    gap: 11px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.floaro-assistant-message {
    max-width: 88%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 13px;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .04);
}

.floaro-assistant-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #0f766e, #22c55e);
    border: 0;
    color: #fff;
}

.floaro-assistant-message.loading {
    color: #64748b;
}

.floaro-assistant-prompts,
.floaro-assistant-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.floaro-assistant-actions {
    margin-top: 9px;
}

.floaro-assistant-prompts button,
.floaro-assistant-actions button {
    border: 1px solid #ccecdf;
    background: #effcf7;
    color: #0f766e;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    text-align: left;
    touch-action: manipulation;
}

.floaro-assistant-prompts button:hover,
.floaro-assistant-actions button:hover {
    background: #dcfce7;
}

.floaro-assistant-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex: 0 0 auto;
}

.floaro-assistant-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    color: #0f172a;
    background: #fff;
    outline: none;
}

.floaro-assistant-input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.floaro-assistant-send {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #22c55e);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex: 0 0 auto;
    touch-action: manipulation;
}

.floaro-assistant-send:disabled,
.floaro-assistant-input:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.floaro-assistant-note {
    font-size: 10px;
    line-height: 1.3;
    color: #94a3b8;
    text-align: center;
    padding: 0 10px 9px;
    background: #fff;
    flex: 0 0 auto;
}

@media (max-width: 520px) {
    html.floaro-assistant-open,
    body.floaro-assistant-open {
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    .floaro-public-assistant {
        right: calc(env(safe-area-inset-right) + 12px);
        bottom: calc(env(safe-area-inset-bottom) + 12px);
    }

    .floaro-assistant-launcher {
        width: 57px;
        height: 57px;
        border-radius: 18px;
    }

    .floaro-assistant-panel {
        position: fixed;
        top: calc(var(--floaro-viewport-top, 0px) + env(safe-area-inset-top) + 8px);
        right: calc(env(safe-area-inset-right) + 8px);
        bottom: auto;
        left: calc(env(safe-area-inset-left) + 8px);
        width: auto;
        height: calc(var(--floaro-viewport-height, 100vh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
        max-width: none;
        max-height: none;
        border-radius: 18px;
    }

    .floaro-assistant-header {
        padding: 13px 14px;
    }

    .floaro-assistant-chat {
        padding: 14px;
        gap: 9px;
    }

    .floaro-assistant-message {
        max-width: 92%;
        font-size: 15px;
    }

    .floaro-assistant-prompts button,
    .floaro-assistant-actions button {
        font-size: 13px;
        line-height: 1.35;
    }

    .floaro-assistant-footer {
        padding: 9px 10px;
    }

    .floaro-assistant-input {
        height: 46px;
        font-size: 16px !important;
    }

    .floaro-assistant-send {
        width: 46px;
        height: 46px;
    }

    .floaro-assistant-note {
        padding-bottom: calc(env(safe-area-inset-bottom) + 7px);
    }
}

@media (max-width: 520px) and (max-height: 520px) {
    .floaro-assistant-header {
        padding: 9px 12px;
    }

    .floaro-assistant-mark {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .floaro-assistant-brand small,
    .floaro-assistant-note {
        display: none;
    }

    .floaro-assistant-chat {
        padding: 10px 12px;
    }

    .floaro-assistant-footer {
        padding: 7px 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .floaro-assistant-launcher {
        transition: none;
    }
}
