.sw-chatbot {
    --chatbot-primary: #6ac3d9;
    --chatbot-accent: #ff648e;
    --chatbot-text: #000;
    --chatbot-bg: #fff;
    --chatbot-muted: #fafafa;
    --chatbot-border: #000;
    --chatbot-radius: 20px;
    --chatbot-shadow: 6px 6px 0 #000;
    --chatbot-shadow-hover: 10px 10px 0 #000;
    --chatbot-font: 'Inter', system-ui, -apple-system, sans-serif;
    --chatbot-heading-font: 'Barlow', var(--chatbot-font);
    --chatbot-z: 9999;
    font-family: var(--chatbot-font);
    color: var(--chatbot-text);
}

.sw-chatbot--floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: var(--chatbot-z);
}

.sw-chatbot__launcher {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--chatbot-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0 #000;
    padding: 0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    animation: sw-chatbot-launcher-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sw-chatbot__launcher:hover {
    box-shadow: 7px 7px 0 #000;
    transform: translate(-2px, -2px);
}

.sw-chatbot__launcher:hover img {
    animation: sw-chatbot-wiggle 0.5s ease-in-out;
}

.sw-chatbot__launcher img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.sw-chatbot__panel {
    display: flex;
    flex-direction: column;
    background: var(--chatbot-bg);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow);
    overflow: hidden;
    border: 2px solid var(--chatbot-border);
    animation: sw-chatbot-panel-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sw-chatbot--floating .sw-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 640px;
    max-height: calc(100vh - 110px);
    transform-origin: bottom right;
}

.sw-chatbot--inline .sw-chatbot__panel {
    width: 100%;
    height: var(--chatbot-inline-height, 600px);
    transform-origin: top center;
}

.sw-chatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--chatbot-text);
    color: #fff;
    font-family: var(--chatbot-heading-font);
    font-weight: 700;
    font-size: 17px;
    border-bottom: 3px solid var(--chatbot-accent);
}

.sw-chatbot__header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sw-chatbot__close,
.sw-chatbot__clear {
    background: transparent;
    border: none;
    color: #fff;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.sw-chatbot__close {
    font-size: 22px;
}

.sw-chatbot__clear {
    font-size: 17px;
    opacity: 0.85;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.sw-chatbot__clear:hover {
    opacity: 1;
    transform: rotate(-45deg);
}

.sw-chatbot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chatbot-muted);
}

.sw-chatbot__bubble {
    max-width: 85%;
    padding: 11px 15px;
    border-radius: 16px;
    border: 1.5px solid var(--chatbot-border);
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 3px 3px 0 #000;
    animation: sw-chatbot-bubble-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sw-chatbot__bubble a {
    color: inherit;
    text-decoration: underline;
}

.sw-chatbot__bubble--assistant {
    align-self: flex-start;
    background: #fff;
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
    transform-origin: bottom left;
}

.sw-chatbot__bubble--user {
    align-self: flex-end;
    background: var(--chatbot-text);
    color: #fff;
    border-bottom-right-radius: 4px;
    transform-origin: bottom right;
}

.sw-chatbot__typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 11px 15px;
    background: #fff;
    border: 1.5px solid var(--chatbot-border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 3px 3px 0 #000;
    transform-origin: bottom left;
    animation: sw-chatbot-bubble-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sw-chatbot__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chatbot-accent);
    opacity: 0.5;
    animation: sw-chatbot-typing 1s infinite ease-in-out;
}

.sw-chatbot__typing span:nth-child(2) { animation-delay: 0.15s; }
.sw-chatbot__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sw-chatbot-typing {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.sw-chatbot__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 14px;
    background: var(--chatbot-muted);
}

.sw-chatbot__suggestions .sw-chatbot__chip {
    animation: sw-chatbot-fade-in 0.4s ease-out both;
}

.sw-chatbot__suggestions .sw-chatbot__chip:nth-child(2) { animation-delay: 0.06s; }
.sw-chatbot__suggestions .sw-chatbot__chip:nth-child(3) { animation-delay: 0.12s; }
.sw-chatbot__suggestions .sw-chatbot__chip:nth-child(4) { animation-delay: 0.18s; }

.sw-chatbot__chip {
    border: 1.5px solid var(--chatbot-border);
    color: var(--chatbot-text);
    background: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sw-chatbot__chip:hover {
    background: var(--chatbot-text);
    color: #fff;
    box-shadow: 3px 3px 0 #000;
    transform: translate(-1px, -1px);
}

.sw-chatbot__contact-offer {
    margin: 0 18px 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid var(--chatbot-accent);
    border-radius: 14px;
    box-shadow: 3px 3px 0 var(--chatbot-accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    animation: sw-chatbot-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sw-chatbot__contact-offer span {
    font-size: 13px;
    font-weight: 600;
}

.sw-chatbot__chip--accent {
    border-color: var(--chatbot-accent);
    background: var(--chatbot-accent);
    color: #fff;
    box-shadow: 2px 2px 0 #000;
    flex-shrink: 0;
}

.sw-chatbot__chip--accent:hover {
    background: #fff;
    color: var(--chatbot-accent);
}

.sw-chatbot__footer {
    border-top: 2px solid var(--chatbot-border);
    background: #fff;
}

.sw-chatbot__input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
}

.sw-chatbot__input {
    flex: 1;
    border: 1.5px solid var(--chatbot-border);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: box-shadow 0.15s ease;
}

.sw-chatbot__input:focus {
    box-shadow: 2px 2px 0 #000;
}

.sw-chatbot__send {
    background: var(--chatbot-text);
    color: #fff;
    border: 1.5px solid var(--chatbot-border);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sw-chatbot__send:hover:not(:disabled) {
    background: #fff;
    color: var(--chatbot-text);
}

.sw-chatbot__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sw-chatbot__gdpr {
    font-size: 11px;
    color: #767676;
    padding: 0 18px 12px;
}

.sw-chatbot__contact-form {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    background: #fff;
    animation: sw-chatbot-fade-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sw-chatbot__contact-form h4 {
    margin: 0 0 4px;
    font-family: var(--chatbot-heading-font);
    font-weight: 700;
    font-size: 16px;
}

.sw-chatbot__field {
    border: 1.5px solid var(--chatbot-border);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: box-shadow 0.15s ease;
}

.sw-chatbot__field:focus {
    outline: none;
    box-shadow: 2px 2px 0 #000;
}

.sw-chatbot__field-error {
    color: var(--chatbot-accent);
    font-size: 12px;
    font-weight: 600;
}

.sw-chatbot__contact-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.sw-chatbot__contact-actions button {
    flex: 1;
    border-radius: 999px;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--chatbot-border);
    background: #fff;
    color: var(--chatbot-text);
    transition: background 0.15s ease, color 0.15s ease;
}

.sw-chatbot__contact-actions button:hover {
    background: var(--chatbot-muted);
}

.sw-chatbot__contact-actions button[type="submit"] {
    background: var(--chatbot-text);
    color: #fff;
}

.sw-chatbot__contact-actions button[type="submit"]:hover {
    background: #fff;
    color: var(--chatbot-text);
}

.sw-chatbot__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sw-chatbot-block {
    font-family: var(--chatbot-font, 'Inter', system-ui, sans-serif);
}

.sw-chatbot-block h2 {
    font-family: var(--chatbot-heading-font, 'Barlow', sans-serif);
    margin-bottom: 16px;
}

.sw-chatbot-editor-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--chatbot-inline-height, 600px);
    border: 2px dashed #000;
    border-radius: var(--chatbot-radius, 20px);
    color: #767676;
    background: #fafafa;
}

@media (max-width: 640px) {
    .sw-chatbot--floating .sw-chatbot__panel {
        position: fixed;
        inset: 0;
        right: auto;
        bottom: auto;
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        border-width: 0;
        box-shadow: none;
    }
}

/* --- Subtle entrance animations --- */

@keyframes sw-chatbot-launcher-in {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes sw-chatbot-wiggle {
    0%, 100% { transform: rotate(0); }
    30%      { transform: rotate(-8deg); }
    65%      { transform: rotate(6deg); }
}

@keyframes sw-chatbot-panel-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sw-chatbot-bubble-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sw-chatbot-fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sw-chatbot-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Respect users who prefer reduced motion — disable all decorative motion. */
@media (prefers-reduced-motion: reduce) {
    .sw-chatbot *,
    .sw-chatbot-block * {
        animation: none !important;
        transition: none !important;
    }
}
