/* ============================================================
   KSHATRIYA EXIM - AI Customer Assistant Widget
   Version: 1.0.0
   Palette: beige/cream + orange accents (site theme)
   ============================================================ */

/* IMPORTANT: the widget elements (.ksbot-fab, .ksbot-window, ...) are
   appended to document.body by chatbot.js — they are NOT children of
   #ksbot-root. All design tokens are therefore declared on :root so
   the custom properties cascade to the whole widget. */
:root {
    --kb-green: #F36B21;
    --kb-green-dark: #D9540A;
    --kb-green-soft: #FF8A47;
    --kb-orange: #F36B21;
    --kb-orange-deep: #D9540A;
    --kb-gold: #F6B700;
    --kb-graphite: #2D2D2D;
    --kb-cream: #F5F0E8;
    --kb-cream-2: #EDE6D8;
    --kb-white: #FFFCF7;
    --kb-gray: #8A7A6A;
    --kb-line: rgba(180, 160, 130, 0.28);
    --kb-beige: #F0E8DA;
    --kb-beige-dark: #E6D9C5;
    --kb-beige-light: #FAF5ED;
    --kb-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#ksbot-root {
    font-family: var(--kb-font);
    color: var(--kb-graphite);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

/* Widget-level reset (applies because fab/bubble/window are on <body>) */
.ksbot-window, .ksbot-bubble, .ksbot-fab,
.ksbot-window *, .ksbot-bubble *, .ksbot-fab * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Font + cursor only. Do NOT reset backgrounds/borders here — that would
   override the styled buttons (.ksbot-send, .ksbot-btn, ...) because this
   selector has higher specificity than their class rules. */
.ksbot-window button, .ksbot-bubble button, .ksbot-fab {
    font-family: var(--kb-font);
    cursor: pointer;
}

.ksbot-window svg, .ksbot-bubble svg { display: block; }

/* Shield the chat form from the site's global input styles (style.css
   `input:not(...)` / `textarea`) which otherwise stretch/re-border the
   input bar and force a 120px min-height on textareas. */
#ksbot-root .ksbot-input__field {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: 96px;
    margin: 0;
    padding: 11px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    resize: none;
    overflow-y: auto;
    color: var(--kb-graphite);
    font-family: var(--kb-font);
    font-size: 13.5px;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}
#ksbot-root .ksbot-input__field:focus { outline: none; box-shadow: none; }
#ksbot-root .ksbot-input__field::placeholder { color: var(--kb-gray); opacity: 0.8; }

#ksbot-root .ksbot-form__field input,
#ksbot-root .ksbot-form__field select,
#ksbot-root .ksbot-form__field textarea {
    width: 100%;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid rgba(180, 160, 130, 0.3);
    border-radius: 10px;
    background: var(--kb-beige);
    box-shadow: none;
    outline: none;
    color: var(--kb-graphite);
    font-family: var(--kb-font);
    font-size: 13px;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#ksbot-root .ksbot-form__field input:focus,
#ksbot-root .ksbot-form__field select:focus,
#ksbot-root .ksbot-form__field textarea:focus {
    border-color: var(--kb-orange);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.12);
}

/* ============================================================
   FLOATING BUTTON
   ============================================================ */
.ksbot-fab {
    position: fixed;
    right: 24px;
    bottom: 100px;               /* column: WhatsApp (24+56) + 20px gap */
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--kb-orange) 0%, var(--kb-orange-deep) 100%);
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(232, 93, 4, 0.35),
                0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 9998;
    animation: ksbot-fab-in 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background 0.28s ease;
}

@keyframes ksbot-fab-in {
    from { opacity: 0; transform: scale(0.3) translateY(24px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ksbot-fab svg,
.ksbot-fab .ksbot-avatar {
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 2;
    border-radius: 50%;
}

.ksbot-fab:active { transform: scale(0.96); }

.ksbot-fab:hover:not(.ksbot-fab--open) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(232, 93, 4, 0.45), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ksbot-fab--open {
    background: linear-gradient(135deg, var(--kb-orange) 0%, var(--kb-orange-deep) 100%);
    box-shadow: 0 8px 20px rgba(232, 93, 4, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Static ring — no animation, keeps the logo rock-stable */
.ksbot-fab__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.ksbot-fab:focus-visible {
    outline: 3px solid rgba(243, 107, 33, 0.6);
    outline-offset: 3px;
}

/* ============================================================
   "ASK ME" BUBBLE
   ============================================================ */
.ksbot-bubble {
    position: fixed;
    right: 12px;
    bottom: 174px;
    width: 286px;
    max-width: calc(100vw - 32px);
    background: var(--kb-white);
    border: 1px solid var(--kb-line);
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 14px 16px 14px 46px;
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.32s;
}

.ksbot-bubble--show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ksbot-bubble__dot {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--kb-orange);
    box-shadow: 0 0 0 0 rgba(245, 124, 0, 0.5);
    animation: ksbot-dot 1.8s ease-out infinite;
}

@keyframes ksbot-dot {
    0%   { box-shadow: 0 0 0 0 rgba(245, 124, 0, 0.5); }
    70%  { box-shadow: 0 0 0 7px rgba(245, 124, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 124, 0, 0); }
}

.ksbot-bubble__text {
    font-size: 13px;
    color: var(--kb-graphite);
    line-height: 1.5;
    padding-right: 18px;
}

.ksbot-bubble__text strong { color: var(--kb-orange); }

.ksbot-bubble__cta {
    margin-top: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--kb-orange) 0%, var(--kb-orange-deep) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(232, 93, 4, 0.32);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ksbot-bubble__cta:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(232, 93, 4, 0.4); }

.ksbot-bubble__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--kb-gray);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ksbot-bubble__close:hover { background: rgba(245, 124, 0, 0.1); color: var(--kb-orange); transform: rotate(90deg); }
.ksbot-bubble__close:focus-visible { outline: 2px solid rgba(245, 124, 0, 0.5); outline-offset: 2px; }

.ksbot-bubble__arrow {
    position: absolute;
    bottom: -9px;
    right: 34px;
    width: 16px;
    height: 16px;
    background: inherit;
    border-right: 1px solid var(--kb-line);
    border-bottom: 1px solid var(--kb-line);
    transform: rotate(45deg);
    border-radius: 2px;
}

/* ============================================================
   CHAT WINDOW
   ============================================================ */
.ksbot-window {
    position: fixed;
    right: 24px;
    bottom: 100px;
    top: auto;
    width: 400px;
height: 600px;
    /* Keep below the fixed navbar (top 12px + 96px tall = ~108px).
       100px bottom offset leaves at most 192px clearance from the top,
       so the window never slides under the nav panel. */
    max-height: calc(100dvh - 196px);
    display: flex;
    flex-direction: column;
    background: var(--kb-white);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--kb-line);
    z-index: 989;
    opacity: 0;
    visibility: hidden;
    transform: translateY(26px) scale(0.92);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.3s;
}

.ksbot-window--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ---------------- header ---------------- */
.ksbot-window__head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(150deg, var(--kb-orange) 0%, var(--kb-orange-deep) 100%);
    border-bottom: none;
}

.ksbot-window__avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.ksbot-window__avatar svg { width: 24px; height: 24px; }

.ksbot-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    display: block;
    background: var(--kb-beige);
    padding: 2px;
    box-sizing: border-box;
}

.ksbot-window__meta { flex: 1; min-width: 0; }

.ksbot-window__title {
    font-weight: 800;
    font-size: 14.5px;
    letter-spacing: 0.01em;
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ksbot-window__status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    margin-top: 1px;
}

.ksbot-window__status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34D399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
    animation: ksbot-status-pulse 2s ease-out infinite;
}

@keyframes ksbot-status-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    70%  { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.ksbot-head-btn {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.92);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ksbot-head-btn svg { width: 14px; height: 14px; }

.ksbot-head-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.ksbot-head-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }
.ksbot-head-btn--close:hover { transform: rotate(90deg); }

/* ---------------- messages ---------------- */
.ksbot-window__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 14px 10px;
    background: var(--kb-beige);
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 160, 130, 0.35) transparent;
}

.ksbot-window__body::-webkit-scrollbar { width: 6px; }
.ksbot-window__body::-webkit-scrollbar-track { background: transparent; }
.ksbot-window__body::-webkit-scrollbar-thumb { background: rgba(180, 160, 130, 0.35); border-radius: 20px; }

.ksbot-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    animation: ksbot-msg-in 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes ksbot-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ksbot-msg__avatar {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--kb-beige-dark);
    color: var(--kb-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    overflow: hidden;
}

.ksbot-msg__avatar svg { width: 17px; height: 17px; }

.ksbot-msg__bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--kb-graphite);
}

.ksbot-msg--ai .ksbot-msg__bubble {
    background: var(--kb-white);
    border: 1px solid rgba(180, 160, 130, 0.2);
    border-top-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    line-height: 1.65;
}

.ksbot-msg--ai .ksbot-msg__bubble br { content: ''; display: block; margin: 4px 0; }
.ksbot-msg--ai .ksbot-msg__bubble br + br { margin: 6px 0; }

.ksbot-msg--user {
    flex-direction: row-reverse;
}

.ksbot-msg--user .ksbot-msg__bubble {
    background: linear-gradient(135deg, #F5EDE0 0%, #EBE0CF 100%);
    color: var(--kb-graphite);
    border: 1px solid rgba(180, 160, 130, 0.3);
    border-top-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ksbot-msg__meta {
    font-size: 10.5px;
    color: var(--kb-gray);
    margin-top: 4px;
}

.ksbot-msg--user .ksbot-msg__meta { text-align: right; }

/* ---------------- action buttons in messages ---------------- */
.ksbot-msg__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ksbot-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ksbot-btn:hover { transform: translateY(-2px); }

.ksbot-btn:focus-visible { outline: 2px solid rgba(245, 124, 0, 0.5); outline-offset: 2px; }

.ksbot-btn--primary {
    background: linear-gradient(135deg, var(--kb-orange) 0%, var(--kb-orange-deep) 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(232, 93, 4, 0.32);
}

.ksbot-btn--primary:hover { box-shadow: 0 12px 26px rgba(232, 93, 4, 0.42); }

.ksbot-btn--wa {
    background: linear-gradient(135deg, #2BDC6F 0%, #1DA851 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(29, 168, 81, 0.3);
}

.ksbot-btn--ghost {
    background: rgba(245, 124, 0, 0.06);
    color: var(--kb-orange);
    border: 1px solid rgba(245, 124, 0, 0.25);
}

.ksbot-btn--chip {
    background: var(--kb-white);
    color: var(--kb-orange);
    border: 1px solid rgba(245, 124, 0, 0.3);
    font-weight: 600;
}

.ksbot-btn--chip:hover { background: var(--kb-orange); color: #fff; }

/* ---------------- quick questions ---------------- */
.ksbot-quick {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    padding: 2px 14px 12px;
    background: var(--kb-beige);
    border-top: 1px solid var(--kb-line);
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 160, 130, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
}

.ksbot-quick::-webkit-scrollbar { height: 4px; }
.ksbot-quick::-webkit-scrollbar-track { background: transparent; }
.ksbot-quick::-webkit-scrollbar-thumb { background: rgba(180, 160, 130, 0.3); border-radius: 20px; }

.ksbot-quick__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border-radius: 999px;
    background: var(--kb-white);
    border: 1px solid rgba(180, 160, 130, 0.3);
    color: var(--kb-graphite);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.ksbot-quick__btn span { font-size: 14px; }

.ksbot-quick__btn:hover {
    border-color: var(--kb-orange);
    background: var(--kb-orange);
    color: #fff;
    transform: translateY(-2px);
}

.ksbot-quick__btn:focus-visible { outline: 2px solid rgba(245, 124, 0, 0.5); outline-offset: 2px; }

/* ---------------- typing indicator ---------------- */
.ksbot-typing {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ksbot-typing__dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ksbot-typing__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kb-orange);
    animation: ksbot-blink 1.2s ease-in-out infinite;
}

.ksbot-typing__dot:nth-child(2) { animation-delay: 0.15s; }
.ksbot-typing__dot:nth-child(3) { animation-delay: 0.3s; }

.ksbot-typing__label {
    font-size: 11.5px;
    color: var(--kb-gray);
    margin-top: 2px;
}

@keyframes ksbot-blink {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* ---------------- quote form ---------------- */
.ksbot-form {
    max-width: 92%;
    width: 320px;
    background: var(--kb-white);
    border: 1px solid rgba(180, 160, 130, 0.2);
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ksbot-form__title {
    font-weight: 800;
    font-size: 13.5px;
    color: var(--kb-orange);
    margin-bottom: 2px;
}

.ksbot-form__sub {
    font-size: 11.5px;
    color: var(--kb-gray);
    margin-bottom: 12px;
}

.ksbot-form__field { margin-bottom: 10px; }

.ksbot-form__field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--kb-gray);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ksbot-form__field label em { color: var(--kb-orange-deep); font-style: normal; }

.ksbot-form__field input,
.ksbot-form__field select,
.ksbot-form__field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid rgba(180, 160, 130, 0.3);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--kb-graphite);
    background: var(--kb-beige);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ksbot-form__field textarea { resize: vertical; min-height: 52px; }

.ksbot-form__field input:focus,
.ksbot-form__field select:focus,
.ksbot-form__field textarea:focus {
    outline: none;
    border-color: var(--kb-orange);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.12);
}

.ksbot-form__field.is-error input,
.ksbot-form__field.is-error textarea {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.ksbot-form__error {
    font-size: 11px;
    color: #DC2626;
    margin-top: 3px;
    display: none;
}

.ksbot-form__field.is-error .ksbot-form__error { display: block; }

.ksbot-form__submit {
    width: 100%;
    padding: 11px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--kb-orange) 0%, var(--kb-orange-deep) 100%);
    color: #fff;
    font-weight: 800;
    font-size: 13.5px;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(232, 93, 4, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ksbot-form__submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(232, 93, 4, 0.42); }
.ksbot-form__submit:disabled { opacity: 0.55; cursor: not-allowed; }
.ksbot-form__submit:focus-visible { outline: 2px solid rgba(245, 124, 0, 0.5); outline-offset: 2px; }

.ksbot-form__status {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 10px;
    padding: 9px 11px;
    display: none;
}

.ksbot-form__status--ok { display: block; background: rgba(52, 211, 153, 0.12); color: #065F46; }
.ksbot-form__status--err { display: block; background: rgba(239, 68, 68, 0.1); color: #B91C1C; }

.ksbot-form__wa-hint {
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--kb-gray);
    text-align: center;
}

/* ---------------- input bar ---------------- */
.ksbot-window__foot {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    background: var(--kb-white);
    border-top: 1px solid var(--kb-line);
}

.ksbot-input {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    background: var(--kb-white);
    border: 1.5px solid rgba(243, 107, 33, 0.4);
    border-radius: 999px;
    padding: 4px 6px 4px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ksbot-input:focus-within {
    border-color: var(--kb-orange);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.15);
}

.ksbot-input__field {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 11px 0;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--kb-graphite);
}

.ksbot-input__field:focus { outline: none; }
.ksbot-input__field::placeholder { color: var(--kb-gray); opacity: 0.8; }

.ksbot-send {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--kb-orange) 0%, var(--kb-orange-deep) 100%);
    color: #fff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.38);
}

.ksbot-send:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 6px 16px rgba(232, 93, 4, 0.5); }
.ksbot-send:active:not(:disabled) { transform: scale(0.9); }
.ksbot-send:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.ksbot-send:focus-visible { outline: 2px solid rgba(245, 124, 0, 0.5); outline-offset: 2px; }

.ksbot-send svg { width: 17px; height: 17px; margin-left: 1px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Tablet / small laptop: shrink window and let quick buttons wrap. */
@media (min-width: 768px) and (max-width: 1100px) {
    .ksbot-window {
        width: 360px;
        height: 580px;
    }
    .ksbot-quick {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .ksbot-quick__btn { margin-bottom: 0; }
}

@media (max-width: 767px) {
    .ksbot-fab {
        right: 14px;
        bottom: 84px;               /* column: WhatsApp (16+54) + 14px gap */
        width: 56px;
        height: 56px;
    }
    .ksbot-fab svg,
    .ksbot-fab .ksbot-avatar { width: 36px; height: 36px; }

    .ksbot-bubble {
        right: 8px;
        bottom: 154px;
        width: 268px;
    }

    .ksbot-window {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        height: calc(100dvh - 112px);   /* keep clear of the mobile nav bar */
        max-height: none;
        border-radius: 20px;
    }

    /* Mobile: raise the column when a scroll-to-top control is present */
    .ks-footer__totop ~ #ksbot-root .ksbot-fab,
    .scrollToTop ~ #ksbot-root .ksbot-fab {
        bottom: 144px;   /* 78 (WhatsApp) + 54 (WhatsApp h) + 12 gap */
    }
    .ks-footer__totop ~ #ksbot-root .ksbot-bubble,
    .scrollToTop ~ #ksbot-root .ksbot-bubble {
        bottom: 212px;   /* 144 (fab) + 56 (fab h) + 12 gap */
    }
    .ks-footer__totop ~ #ksbot-root .ksbot-window,
    .scrollToTop ~ #ksbot-root .ksbot-window {
        bottom: 144px;   /* aligns with the raised chatbot FAB */
    }

    .ksbot-msg__bubble { max-width: 88%; }
    .ksbot-form { max-width: 96%; width: 100%; }
}

/* ============================================================
   FLOATING BUTTON STACK (public storefront)
   When a scroll-to-top control is present (guests use
   .ks-footer__totop, legacy storefront pages use .scrollToTop),
   the chatbot column moves ABOVE the WhatsApp FAB so all three
   float in a clean column: Chatbot → WhatsApp → Scroll-to-top.
   ============================================================ */
.ks-footer__totop ~ #ksbot-root .ksbot-fab,
.scrollToTop ~ #ksbot-root .ksbot-fab {
    bottom: 182px;   /* 110 (WhatsApp) + 56 (WhatsApp h) + 16 gap */
}

.ks-footer__totop ~ #ksbot-root .ksbot-bubble,
.scrollToTop ~ #ksbot-root .ksbot-bubble {
    bottom: 256px;   /* 182 (fab) + 62 (fab h) + 12 gap */
}

.ks-footer__totop ~ #ksbot-root .ksbot-window,
.scrollToTop ~ #ksbot-root .ksbot-window {
    bottom: 182px;   /* aligns with the raised chatbot FAB */
}

/* ============================================================
   ACCESSIBILITY / MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .ksbot-fab { animation: none; }
    .ksbot-fab__ring,
    .ksbot-bubble__dot,
    .ksbot-window__status i,
    .ksbot-typing__dot {
        animation: none;
    }
    .ksbot-fab, .ksbot-bubble, .ksbot-window,
    .ksbot-msg, .ksbot-btn, .ksbot-quick__btn,
    .ksbot-form__submit, .ksbot-send {
        transition: none;
    }
}
