.chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    font-family: "Inter", Arial, sans-serif;
}

.chatbot,
.chatbot *,
.chatbot *::before,
.chatbot *::after {
    box-sizing: border-box;
}

.chatbot--open .chatbot__launcher {
    display: none;
}

.chatbot__visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chatbot__launcher {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--color-action, #13806a);
    color: #fff;
    box-shadow: 0 14px 34px rgba(22, 26, 29, 0.24);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.chatbot__launcher:hover,
.chatbot__launcher:focus-visible {
    background: var(--color-action-hover, #0f6e59);
    transform: translateY(-1px);
}

.chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 66px;
    display: grid;
    grid-template-rows: auto minmax(150px, 1fr) auto auto;
    width: min(390px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 110px));
    overflow: hidden;
    border: 1px solid var(--color-line, #dbe3e0);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(22, 26, 29, 0.25);
}

.chatbot__panel[hidden] {
    display: none;
}

.chatbot__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 16px;
    background: linear-gradient(135deg, #116d5a, #28b998);
    color: #fff;
}

.chatbot__title {
    min-width: 0;
}

.chatbot__brand-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-height: 28px;
    line-height: 24px;
    color: rgba(255, 255, 255, 0.94);
    white-space: nowrap;
}

.chatbot__brand-logo {
    display: block;
    flex: 0 0 auto;
    height: 24px;
    width: auto;
    margin: 0;
    object-fit: contain;
}

.chatbot__assistant-label {
    display: block;
    margin: 3px 0 0;
    font-family: "Quicksand", "Inter", Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: -0.015em;
}

.chatbot__subtitle {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    line-height: 1.35;
    opacity: 0.86;
}

.chatbot__close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font: 400 1.5rem/1 sans-serif;
    cursor: pointer;
}

.chatbot__messages {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px;
    background: #f7fbfa;
}

.chatbot__entry {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0 0 10px;
}

.chatbot__entry .chatbot__message {
    margin: 0;
}

.chatbot__avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 5px;
    border: 1px solid var(--color-line, #dbe3e0);
    border-radius: 50%;
    /* Logo wordmark is white — needs a dark fill to stay visible. */
    background: #116d5a;
    object-fit: contain;
}

.chatbot__message {
    width: fit-content;
    max-width: 88%;
    margin: 0 0 10px;
    padding: 11px 13px;
    border-radius: 14px;
    color: var(--color-ink, #161a1d);
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
}

.chatbot__message--assistant {
    border: 1px solid var(--color-line, #dbe3e0);
    border-bottom-left-radius: 4px;
    background: #fff;
}

.chatbot__message--user {
    margin-left: auto;
    border-bottom-right-radius: 4px;
    background: #dff5ef;
}

.chatbot__message--status {
    color: var(--color-ink-soft, #4b565c);
    font-style: italic;
}

.chatbot__message a {
    color: var(--color-primary-dark, #15866d);
    font-weight: 700;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.chatbot__cars {
    display: grid;
    gap: 10px;
    max-width: 100%;
    margin-top: 12px;
}

.chatbot__car {
    overflow: hidden;
    border: 1px solid var(--color-line, #dbe3e0);
    border-radius: 13px;
    background: #fff;
}

.chatbot__car img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 118px;
    object-fit: cover;
}

.chatbot__car-body {
    padding: 12px;
}

.chatbot__car h3 {
    margin: 0 0 5px;
    font-size: 0.95rem;
}

.chatbot__car p {
    margin: 3px 0;
    color: var(--color-ink-soft, #4b565c);
    font-size: 0.76rem;
}

.chatbot__car a {
    display: inline-flex;
    margin-top: 9px;
    padding: 8px 11px;
    border-radius: 8px;
    background: var(--color-action, #13806a);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
}

.chatbot__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px 14px 8px;
    background: #fff;
}

.chatbot__form textarea {
    min-height: 44px;
    max-height: 104px;
    resize: vertical;
    padding: 10px 11px;
    border: 1px solid var(--color-line, #dbe3e0);
    border-radius: 10px;
    color: var(--color-ink, #161a1d);
    /* 16px minimum: anything smaller triggers iOS Safari's auto-zoom on focus. */
    font: 400 1rem/1.4 "Inter", Arial, sans-serif;
}

.chatbot__form button {
    align-self: end;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: var(--color-action, #13806a);
    color: #fff;
    font: 800 0.8rem/1 "Inter", Arial, sans-serif;
    cursor: pointer;
}

.chatbot__form button:disabled,
.chatbot__form textarea:disabled {
    cursor: wait;
    opacity: 0.65;
}

.chatbot__privacy {
    margin: 0;
    padding: 4px 14px 13px;
    background: #fff;
    color: var(--color-ink-soft, #4b565c);
    font-size: 0.65rem;
    line-height: 1.4;
}

.chatbot__privacy a {
    color: var(--color-primary-dark, #15866d);
}

@media (max-width: 540px) {
    .chatbot {
        right: 16px;
        bottom: 16px;
    }

    /* Full-screen chat: header pinned top, input pinned bottom, only the
       messages row scrolls. JS keeps height/transform in sync with the
       visual viewport so the keyboard compresses the chat instead of
       pushing it off screen. */
    .chatbot__panel {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        bottom: auto;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .chatbot__launcher {
        min-height: 50px;
        padding: 0 16px;
    }
}
