/* BDStall chatbot widget (moved out of views/components/chatbot.php, owner 2026-11-30). */
/* Chatbot Container */
#chatbot-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Read by a screen reader, never drawn. */
.bot-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

#chat-jump-latest {
    align-self: center;
    flex: 0 0 auto;
    margin: 0 0 6px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--green-dark, #0E7A38);
    border-radius: 999px;
    background: #fff;
    color: var(--green-dark, #0E7A38);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(33, 29, 26, 0.12);
    cursor: pointer;
}

#chat-jump-latest:hover {
    background: var(--green-dark, #0E7A38);
    color: #fff;
}

#chatbot-launcher {
    position: fixed;
    top: 50%;
    right: 24px;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #ecf2ec;
    box-shadow: 0 0 0 2px var(--green-dark, #0E7A38), 0 12px 28px rgba(14, 122, 56, 0.28);
    cursor: pointer;
    pointer-events: auto;
    transform: translateY(-50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

#chatbot-launcher:hover {
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 15px 34px rgba(14, 122, 56, 0.36);
}

/* The assistant's face, cropped from the support illustration (assets/frontend/img/chatbot-assistant.webp). */
#chatbot-launcher .launcher-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* "Online" dot, bottom right of the avatar. */
#chatbot-launcher .launcher-online {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #22c55e;
}

/* "Chat with us" slides out to the left on hover or keyboard focus. */
#chatbot-launcher .launcher-label {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(33, 29, 26, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translate(8px, -50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#chatbot-launcher:hover .launcher-label,
#chatbot-launcher:focus-visible .launcher-label {
    opacity: 1;
    transform: translate(0, -50%);
}

#chatbot-launcher:focus-visible {
    outline: 3px solid var(--green-dark, #0E7A38);
    outline-offset: 3px;
}

/* Chat Window */
#chat-window {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    height: min(540px, calc(100vh - 40px));
    background: #fbf7f1;
    border: 1px solid #eee6dc;
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(33, 29, 26, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
#chat-header {
    background: var(--green-dark, #0E7A38);
    color: white;
    padding: 9px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: #ecf2ec;
    object-fit: cover;
}

.header-info .header-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.minimize-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 18px;
    background: #fbf7f1;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.message {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    /* The launcher's face, so the button a customer pressed and the replies it produces carry the same mark. */
    background: #ecf2ec;
    padding: 0;
    box-shadow: 0 0 0 1.5px var(--green-dark, #0E7A38);
    overflow: hidden;
}

.message-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
}

.message-bubble {
    background: white;
    padding: 14px 18px;
    border: 1px solid #e8ddd1;
    border-radius: 20px 20px 20px 5px;
    box-shadow: none;
    display: inline-block;
    max-width: 85%;
}

/* The AI's response can contain literal \n line breaks (e.g. one item per line) -
   preserve them instead of collapsing to a single line, but still wrap long text.
   overflow-wrap handles long unbroken tokens (e.g. a product URL) that have no
   spaces to wrap at - without it they overflow past the bubble's own edge. */
.message-bubble p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: break-word;
    word-break: break-word;
}

.bot-message .message-bubble {
    border-bottom-left-radius: 4px;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-message .message-bubble {
    background: var(--green-dark, #0E7A38);
    color: white;
    border-color: var(--green-dark, #0E7A38);
    border-radius: 20px 20px 5px 20px;
}

/* Always on its own line under the reply, with the same gap after a bubble, a button, a card, a list or the thumbs:
   as an inline-block it sat on the SAME line as an inline button, touching it. */
.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    display: block;
}

/* Typing Indicator */
/* Sits below the message list, not inside it: it needs the list's own side padding, or the avatar hugs the left edge until the reply arrives. */
#typing-indicator {
    flex: 0 0 auto;
    padding: 0 16px 14px;
    background: #fbf7f1;
}

#typing-indicator .message {
    margin-bottom: 0;
}

.typing-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6AB802;
    animation: typing 1.4s infinite;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
#chat-input-container {
    background: #fbf7f1;
    border-top: 1px solid #eee5db;
    padding: 12px 14px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1.5px solid var(--green-dark, #0E7A38);
    border-radius: 30px;
    padding: 4px 5px 4px 15px;
}

#chat-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    min-width: 0;
    height: 38px;
    font-size: 14px;
    color: #333;
}

#chat-input::placeholder {
    color: #999;
}

#send-btn {
    background: var(--green-dark, #0E7A38);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(8, 125, 62, 0.25);
}

#send-btn:active {
    transform: scale(0.95);
}

/* Bot Feedback (yes/no) */
.bot-feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    transition: opacity 0.25s ease;
}

.bot-feedback.hiding {
    opacity: 0;
}

.bot-feedback-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 2px 9px;
    font-size: 12px;
    line-height: 1.6;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}

.bot-feedback-btn:hover:not([disabled]) {
    background: #f3f4f6;
}

.bot-feedback-btn[disabled] {
    cursor: default;
    opacity: 0.6;
}

.bot-feedback-btn.selected.positive {
    background: #eafbe0;
    border-color: #bbf7d0;
    color: #15803d;
    opacity: 1;
}

.bot-feedback-btn.selected.negative {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
    opacity: 1;
}

/* Bot Link Buttons */
.bot-link-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    max-width: 85%;
}

.bot-link-btn {
    display: inline-block;
    background: white;
    border: 1px solid #6AB802;
    color: #6AB802;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.bot-link-btn:hover {
    background: #6AB802;
    color: white;
}

.bot-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    max-width: 100%;
}

/* Scales down inside a narrow bubble instead of forcing the panel wider,
   and keeps its box before the file loads so the bubble does not jump. */
.bot-product-hero {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    margin: 8px 0;
    border: 1px solid #e3e6e8;
    border-radius: 8px;
    background: #fff;
}

.bot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.bot-quick-reply {
    border: 1px solid #6AB802;
    color: #437b00;
    background: #fff;
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    min-height: 36px;
    cursor: pointer;
}

.bot-quick-reply:hover { background: #6AB802; color: #fff; }

.bot-product-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.bot-product-thumb {
    /* Fixed BOX, not just fixed attributes: a 404 renders alt text, which
       is inline content and wraps, pushing the row apart. */
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    min-width: 52px;
    object-fit: contain;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    color: transparent;
    border: 1px solid #e3e6e8;
    border-radius: 8px;
    background: #fff;
}

/* min-width:0 lets a long title wrap instead of forcing the row wider than
   the bubble, which is what produces horizontal scroll on a 320px screen. */
.bot-product-text {
    min-width: 0;
    flex: 1 1 auto;
}

.bot-product-title {
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bot-product-price {
    font-size: 12px;
    color: #5b6b7a;
    margin-top: 2px;
}

.bot-product-price-now {
    font-weight: 600;
    color: #1f7a3e;
}

.bot-product-price-was {
    margin-left: 6px;
    text-decoration: line-through;
    color: #9aa5b1;
}

.bot-product-discount-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #fdeceb;
    color: #c0392b;
    font-size: 11px;
    font-weight: 600;
}

/* One block per product: photo, text, then its own buttons. */
.bot-product-action-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: 1px solid #e3e6e8;
    border-radius: 10px;
    background: #fff;
}

/* The buttons share one row and split it evenly, so the actions line up
   down the list instead of each row starting at its own offset. */
.bot-product-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Equal shares of the row, so every product's buttons line up down the
   list instead of each pair sizing to its own label. */
.bot-product-buttons .bot-product-action { flex: 1 1 0; min-width: 120px; }

/* A category link is a way OUT of the list, not one of its choices. */
.bot-product-action-group.is-aside {
    border-style: dashed;
    background: transparent;
}

.is-aside .bot-product-title { color: #5b6b7a; }

.bot-product-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #6AB802;
    border-radius: 8px;
    background: white;
    color: #437b00;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.bot-product-action:hover { background: #6AB802; color: white; }

.bot-product-action--select {
    background: #6AB802;
    color: white;
}

.bot-product-action--select:hover { background: #4f9200; }

.bot-product-action.is-disabled {
    border-color: #d8dde5;
    background: #f3f5f8;
    color: #7b8794;
    cursor: not-allowed;
}

/* Components: the card-and-chip layout, in BDStall's colours. */
.bot-card {
    max-width: 300px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
    margin: 4px 0;
}
.bot-card-hero {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f3f4f6;
}
.bot-card-body { padding: 12px 14px 14px; }
.bot-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
    margin: 0 0 6px;
}
.bot-card-price {
    font-size: 19px;
    font-weight: 800;
    color: var(--green-dark, #0E7A38);
    margin: 0 0 10px;
    letter-spacing: -0.2px;
}
.bot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.bot-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 11.5px;
    line-height: 1.3;
}
.bot-chip b { font-weight: 600; color: #111827; }
/* As wide as its label on a phone (owner, 2026-10-05: "the CTA button is too big"). On desktop the button is as wide as the
   text bubble above it (owner, 2026-11-01): see .has-cta below. 44px tall stays: the project's minimum touch target. */
.bot-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    margin: 6px 0 2px;
    border-radius: 8px;
    background: var(--green-dark, #0E7A38);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    max-width: 100%;
}
.bot-primary-btn:hover { background: #0b6330; color: #fff; text-decoration: none; }
/* Desktop: an outline button in the widget's link-button colours (.bot-link-btn), not a solid
   green block (owner, 2026-10-05). */
@media (min-width: 768px) {
    .bot-primary-btn {
        background: #fff;
        color: #6AB802;
        border: 1px solid #6AB802;
        font-weight: 500;
        transition: all 0.2s;
    }
    .bot-primary-btn:hover { background: #6AB802; color: #fff; }
    /* A reply with a button: the column is as wide as its widest part (the text bubble, usually) and the button fills it. */
    .message-content.has-cta {
        display: grid;
        grid-template-columns: minmax(0, max-content);
        flex: 0 1 auto;
        max-width: 85%;
        justify-items: stretch;
    }
    .message-content.has-cta > .message-bubble { display: block; max-width: none; }
    .message-content.has-cta > .bot-primary-btn { display: flex; }
    .message-content.has-cta > .bot-link-buttons { max-width: none; }
    .message-content.has-cta > .bot-link-buttons .bot-link-btn { text-align: center; }
}
.bot-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    margin-top: 6px;
    border: 1.5px solid var(--green-dark, #0E7A38);
    border-radius: 8px;
    color: var(--green-dark, #0E7A38);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    background: #fff;
}
.bot-secondary-btn:hover { background: #ecf7f0; text-decoration: none; }
.bot-choices { display: flex; flex-direction: column; gap: 8px; max-width: 300px; margin: 4px 0; }
.message-sender-label { font-size: 11px; font-weight: 700; color: #0D6E36; margin: 0 0 3px 2px; letter-spacing: 0.02em; }
.bot-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}
.bot-choice:hover { border-color: var(--green-dark, #0E7A38); background: #f6fbf8; }
.bot-choice-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #f3f4f6; flex-shrink: 0; }
.bot-choice-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bot-choice-title { font-size: 12.5px; font-weight: 600; color: #111827; line-height: 1.35; }
.bot-choice-price { font-size: 13px; font-weight: 800; color: var(--green-dark, #0E7A38); }
.bot-choice-tag { align-self: flex-start; font-size: 11px; font-weight: 600; color: #92400E; background: #FEF3C7; border-radius: 999px; padding: 1px 8px; }

/* Measured by the CARD, not the screen. The panel is 350px wide on a
   desktop too, so a viewport breakpoint never fires where the squeeze
   actually happens - inside a 220px bubble on a 1440px monitor. */
.bot-compare {
    container-type: inline-size;
    max-width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    margin: 4px 0;
}
/* Stacked is the DEFAULT, so a browser without container queries gets the
   layout that is readable at any width rather than the one that is only
   readable at a width this panel never has. */
.bot-compare-items { display: grid; grid-template-columns: 1fr; gap: 12px; }
.bot-compare-item { min-width: 0; display: flex; gap: 10px; align-items: flex-start; }
.bot-compare-item img { width: 84px; flex: 0 0 84px; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: #f3f4f6; }
.bot-compare-item-body { flex: 1 1 auto; min-width: 0; }
.bot-compare-title { font-size: 12.5px; font-weight: 600; color: #111827; line-height: 1.3; margin: 0 0 2px; }
.bot-compare-price { font-size: 15px; font-weight: 800; color: var(--green-dark, #0E7A38); }
/* Fixed layout, so the declared column widths hold and a long spec value
   wraps inside its cell instead of stretching the table past the bubble. */
.bot-compare-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.bot-compare-table th, .bot-compare-table td { padding: 6px 4px; border-top: 1px solid #f1f5f9; vertical-align: top; text-align: left; }
.bot-compare-table th { width: 30%; color: #6b7280; font-weight: 600; }
.bot-compare-table td { color: #111827; width: 35%; overflow-wrap: anywhere; }
/* The head names each column, so the table still says which product is
   which once the two cards above it are no longer side by side. */
.bot-compare-table thead th {
    color: #111827;
    font-weight: 700;
    border-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bot-compare-table thead th:first-child { width: 30%; }
.bot-compare-table thead th + th { width: 35%; }

/* Side by side only once each column can hold ~140px: two 90px columns
   turn a product title into two words a line. Today the panel is narrower
   than this everywhere, so this is the layout a wider chat surface would
   get, not a breakpoint anyone crosses by rotating a phone. */
@container (min-width: 300px) {
    .bot-compare-items { grid-template-columns: 1fr 1fr; gap: 10px; }
    .bot-compare-item { display: block; }
    .bot-compare-item img { width: 100%; flex: none; aspect-ratio: 4 / 3; }
    .bot-compare-title { margin-top: 6px; }
}

/* Mobile: an almost full-height card, matching the clean reference layout. */
@media (max-width: 767px) {
    #chatbot-launcher {
        display: none;
    }

    #chat-window {
        top: auto;
        right: auto;
        bottom: calc(69px + env(safe-area-inset-bottom));
        left: 12px;
        width: min(calc(100vw - 24px), 380px);
        height: min(70vh, 460px);
        height: min(70dvh, 460px);
        max-height: calc(100dvh - 92px - env(safe-area-inset-bottom));
        border-radius: 20px;
    }

    /* The assistant's face (same crop as the desktop launcher) with a green ring and an online dot. */
    /* Same 22px box as the other tab icons, so the labels line up. */
    #tab-support .mob-support-icon {
        position: relative;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: #ecf2ec;
        box-shadow: 0 0 0 1.5px var(--green-dark, #0E7A38);
    }

    #tab-support .mob-support-avatar {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }

    #tab-support .mob-support-online {
        position: absolute;
        right: -3px;
        bottom: -3px;
        width: 9px;
        height: 9px;
        border: 1.5px solid #fff;
        border-radius: 50%;
        background: #22c55e;
    }

    #tab-support[aria-expanded="true"] {
        color: var(--green-dark, #0E7A38);
    }

    #chat-header {
        padding: 9px 17px;
    }

    .header-info .header-title {
        font-size: 15px;
    }

    #chat-input-container {
        padding: 12px;
    }

    .input-wrapper {
        padding: 4px 5px 4px 16px;
    }

    #send-btn {
        width: 40px;
        height: 40px;
    }

    #chat-messages {
        padding: 14px 16px 18px;
    }

    .message {
        gap: 8px;
        margin-bottom: 16px;
    }

    .message-avatar {
        width: 34px;
        height: 34px;
        padding: 0;
    }

    .message-bubble {
        padding: 12px 15px;
        max-width: 92%;
    }

    .message-bubble p {
        font-size: 15px;
    }

    .message-time {
        font-size: 11px;
    }
}

/* A finger is not a mouse pointer. Every control the customer presses is at
   least 44px on a touch screen (CLAUDE.md). Last in the sheet so it wins
   over the narrow-screen sizes above. */
@media (pointer: coarse) {
    .bot-quick-reply,
    .bot-product-action,
    .bot-secondary-btn,
    .bot-feedback-btn,
    #chat-jump-latest {
        min-height: 44px;
    }

    .bot-feedback-btn {
        padding: 2px 14px;
    }

    #chat-input {
        height: 44px;
    }

    #send-btn {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }

    .minimize-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Motion can be a symptom trigger, not a taste. When the visitor has asked
   their system for less of it, the widget still moves - it just arrives
   instead of animating. The typing dots keep a static shape so the wait is
   still legible without them pulsing. */
@media (prefers-reduced-motion: reduce) {

    #chat-window,
    .message {
        animation: none !important;
    }

    .bot-feedback,
    #chatbot-launcher,
    #chatbot-launcher:hover,
    #chatbot-launcher .launcher-label,
    #send-btn,
    #send-btn:hover,
    #send-btn:active,
    .bot-feedback-btn,
    .minimize-btn {
        transition: none !important;
    }

    #chatbot-launcher:hover {
        transform: translateY(-50%);
    }

    #send-btn:hover {
        transform: none;
    }

    .typing-bubble span {
        animation: none !important;
        opacity: 0.55;
    }
}
