.ws-assistant {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 120;
    font-family: 'Outfit', sans-serif;
}

.ws-assistant [hidden] {
    display: none !important;
}

.ws-assistant-fab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #25d366, #0fbb8a);
    color: #fff;
    box-shadow: 0 24px 48px rgba(18, 71, 52, 0.24);
    cursor: pointer;
    font-weight: 700;
}

.ws-assistant.is-closed .ws-assistant-fab {
    animation: wsAssistantWiggle 2.6s ease-in-out infinite;
}

.ws-assistant-fab i {
    font-size: 1.45rem;
}

.ws-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(420px, calc(100vw - 24px));
    max-height: min(78vh, 760px);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(245,250,247,.98));
    border: 1px solid rgba(19, 50, 74, 0.10);
    box-shadow: 0 28px 80px rgba(17, 56, 87, 0.18);
}

.ws-assistant-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 16px;
    background: linear-gradient(135deg, #25d366, #10a57f);
    color: #fff;
}

.ws-assistant-head strong,
.ws-assistant-head small {
    display: block;
}

.ws-assistant-head small {
    opacity: .86;
    margin-top: 4px;
}

.ws-assistant-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-assistant-restart,
.ws-assistant-close {
    border: 0;
    border-radius: 12px;
    background: rgba(255,255,255,.16);
    color: #fff;
    cursor: pointer;
}

.ws-assistant-restart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    font-weight: 700;
}

.ws-assistant-close {
    width: 38px;
    height: 38px;
}

.ws-assistant-body {
    display: grid;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
}

.ws-assistant-messages {
    display: grid;
    gap: 10px;
}

.ws-assistant-bubble {
    max-width: 92%;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: .95rem;
    line-height: 1.6;
}

.ws-assistant-bubble.incoming {
    background: #edf7f2;
    color: #17324a;
    border: 1px solid rgba(19, 50, 74, 0.07);
}

.ws-assistant-bubble.outgoing {
    margin-left: auto;
    background: #17324a;
    color: #fff;
}

.ws-assistant-edit {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.86);
    font-size: .78rem;
    text-decoration: underline;
    cursor: pointer;
}

@keyframes wsAssistantWiggle {
    0%, 82%, 100% { transform: translateX(0) rotate(0deg); }
    86% { transform: translateX(-2px) rotate(-4deg); }
    90% { transform: translateX(3px) rotate(4deg); }
    94% { transform: translateX(-2px) rotate(-3deg); }
    98% { transform: translateX(2px) rotate(2deg); }
}

.ws-assistant-stage {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(19, 50, 74, 0.08);
}

.ws-assistant-composer {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(19, 50, 74, 0.08);
}

.ws-assistant-label,
.ws-assistant-input span {
    color: #17324a;
    font-size: .92rem;
    font-weight: 700;
}

.ws-assistant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ws-assistant-options:empty {
    display: none;
}

.ws-assistant-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 999px;
    border: 1px solid rgba(19, 50, 74, 0.10);
    background: #f7fafc;
    color: #17324a;
    cursor: pointer;
}

.ws-assistant-option i {
    opacity: 0;
    transform: scale(.7);
    transition: .18s ease;
    color: #0e8257;
}

.ws-assistant-option.is-selected {
    background: rgba(37, 211, 102, 0.14);
    border-color: rgba(37, 211, 102, 0.4);
    color: #0e8257;
}

.ws-assistant-option.is-selected i {
    opacity: 1;
    transform: scale(1);
}

.ws-assistant-selected {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.16);
}

.ws-assistant-selected-label {
    color: #17324a;
    font-size: .88rem;
    font-weight: 700;
}

.ws-assistant-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ws-assistant-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 124, 130, 0.16);
    background: #fff;
    color: #17324a;
    font-size: .9rem;
}

.ws-assistant-selected-tag button {
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 999px;
    background: rgba(19, 50, 74, 0.08);
    color: #17324a;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.ws-assistant-inline-action {
    display: grid;
}

.ws-assistant-inline-action .secondary-button {
    justify-self: start;
}

.ws-assistant-review {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(23, 50, 74, 0.04);
    border: 1px solid rgba(19, 50, 74, 0.08);
}

.ws-assistant-review strong {
    color: #17324a;
}

.ws-assistant-review-grid {
    display: grid;
    gap: 10px;
}

.ws-assistant-review-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(19, 50, 74, 0.08);
}

.ws-assistant-review-row span {
    color: #5b7288;
    font-size: .82rem;
    font-weight: 600;
}

.ws-assistant-review-row strong {
    font-size: .95rem;
    line-height: 1.5;
}

.ws-assistant-input {
    display: grid;
    gap: 8px;
}

.ws-assistant-input input,
.ws-assistant-input textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(19, 50, 74, 0.10);
    background: #fff;
    color: #17324a;
    padding: 13px 14px;
}

.ws-assistant-actions,
.ws-assistant-form-grid {
    display: grid;
    gap: 12px;
}

.ws-assistant .primary-button,
.ws-assistant .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.ws-assistant .primary-button {
    border: 0;
    background: linear-gradient(135deg, #17324a, #0f7c82);
    color: #fff;
}

.ws-assistant .secondary-button {
    border: 1px solid rgba(19, 50, 74, 0.10);
    background: #fff;
    color: #17324a;
}

.ws-assistant-form-grid {
    grid-template-columns: 1fr 1fr;
}

.ws-assistant-result {
    padding: 14px;
    border-radius: 18px;
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.18);
    color: #17324a;
    line-height: 1.7;
}

.ws-assistant-result strong {
    color: #17324a;
}

@media (max-width: 780px) {
    .ws-assistant {
        right: 12px;
        left: 12px;
        bottom: 14px;
    }

    .ws-assistant-fab {
        margin-left: auto;
    }

    .ws-assistant-panel {
        width: min(100%, 100vw - 24px);
        right: 0;
        left: auto;
        bottom: 72px;
    }

    .ws-assistant-restart span {
        display: none;
    }

    .ws-assistant-restart {
        width: 38px;
        justify-content: center;
        padding: 0;
    }

    .ws-assistant-form-grid {
        grid-template-columns: 1fr;
    }
}
