.tigr-chat,
.tigr-chat * {
    box-sizing: border-box;
}

.tigr-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: Arial, sans-serif;
    color: #1f2933;
    pointer-events: none;
}

.tigr-chat--cart-open {
    display: none;
}

.tigr-chat button,
.tigr-chat textarea {
    appearance: none;
    font-family: inherit;
    letter-spacing: 0;
    text-transform: none !important;
}

.tigr-chat__toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto !important;
    min-width: 0 !important;
    height: 50px !important;
    min-height: 50px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 0 22px !important;
    background: #ee3024 !important;
    color: #fff !important;
    box-shadow: 0 16px 38px rgba(238, 48, 36, 0.34), 0 6px 18px rgba(15, 23, 42, 0.2) !important;
    cursor: pointer;
    outline: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    pointer-events: auto;
}

.tigr-chat__toggle:hover {
    background: #da2b20 !important;
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(238, 48, 36, 0.4), 0 8px 24px rgba(15, 23, 42, 0.24) !important;
}

.tigr-chat__toggle:focus-visible {
    box-shadow: 0 0 0 4px rgba(238, 48, 36, 0.18), 0 16px 38px rgba(238, 48, 36, 0.34) !important;
}

.tigr-chat__toggle-text {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

html body a.scrollToTop.button-show {
    bottom: 90px;
}

.tigr-chat__panel {
    position: relative;
    display: none;
    width: 380px;
    min-width: 340px;
    max-width: calc(100vw - 32px);
    height: 570px;
    min-height: 420px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    resize: both;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    pointer-events: auto;
}

.tigr-chat__resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    touch-action: none;
}

.tigr-chat__resize-handle::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 8px;
    height: 8px;
    border-top: 2px solid #a7afb9;
    border-left: 2px solid #a7afb9;
    opacity: 0.75;
}

.tigr-chat--resizing,
.tigr-chat--resizing * {
    cursor: nwse-resize;
    user-select: none;
}

.tigr-chat--open .tigr-chat__panel {
    display: flex;
    flex-direction: column;
}

.tigr-chat--open .tigr-chat__toggle {
    display: none !important;
}

.tigr-chat__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    min-height: 82px;
    padding: 16px 14px 16px 18px;
    border-bottom: 1px solid #edf0f4;
    background: #fff;
    color: #1f2933;
}

.tigr-chat__logo {
    display: block;
    width: 230px;
    max-width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
}

.tigr-chat__expand,
.tigr-chat__close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    padding: 0 !important;
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    cursor: pointer;
}

.tigr-chat__expand {
    position: relative;
}

.tigr-chat__expand::before,
.tigr-chat__expand::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
}

.tigr-chat__expand::before {
    top: 9px;
    right: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.tigr-chat__expand::after {
    bottom: 9px;
    left: 9px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
}

.tigr-chat--expanded .tigr-chat__expand::before {
    top: 11px;
    right: 11px;
    border: 0;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
}

.tigr-chat--expanded .tigr-chat__expand::after {
    bottom: 11px;
    left: 11px;
    border: 0;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.tigr-chat__expand:hover,
.tigr-chat__close:hover {
    background: #e8eaee !important;
    color: #111827 !important;
}

.tigr-chat--open.tigr-chat--expanded {
    inset: 16px;
}

.tigr-chat--expanded .tigr-chat__panel {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    min-height: 0;
    max-height: none;
    resize: none;
}

.tigr-chat--expanded .tigr-chat__resize-handle {
    display: none;
}

.tigr-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #f7f8fa 0%, #f2f4f7 100%);
    scrollbar-width: thin;
    scrollbar-color: #cbd1da transparent;
}

.tigr-chat__message {
    width: fit-content;
    max-width: 88%;
    margin: 0 0 10px;
    border-radius: 16px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    word-break: break-word;
}

.tigr-chat__message a {
    color: #ee3024;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tigr-chat__message--bot {
    margin-right: auto;
    border-bottom-left-radius: 5px;
    background: #fff;
    color: #1f2933;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.tigr-chat__message--user {
    margin-left: auto;
    border-bottom-right-radius: 5px;
    background: #ee3024;
    color: #fff;
    box-shadow: 0 8px 18px rgba(238, 48, 36, 0.22);
}

.tigr-chat__message--user a {
    color: #fff;
}

.tigr-chat__message--loading {
    color: #6b7280;
}

.tigr-chat__prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 12px;
}

.tigr-chat__prompt {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-height: 34px !important;
    margin: 0 !important;
    border: 1px solid #edf0f4 !important;
    border-radius: 999px !important;
    padding: 8px 12px !important;
    background: #fff !important;
    color: #374151 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    white-space: nowrap;
    cursor: pointer;
}

.tigr-chat__prompt:hover {
    border-color: rgba(238, 48, 36, 0.35) !important;
    color: #ee3024 !important;
    transform: translateY(-1px);
}

.tigr-chat__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: end;
    gap: 9px;
    padding: 12px;
    border-top: 1px solid #edf0f4;
    background: #fff;
}

.tigr-chat__input {
    display: block !important;
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 104px !important;
    margin: 0 !important;
    border: 1px solid #d8dde5 !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #111827 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    overflow-y: hidden !important;
    resize: none !important;
    outline: none !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tigr-chat__input::-webkit-scrollbar {
    display: none;
}

.tigr-chat__input:focus {
    border-color: #ee3024 !important;
    box-shadow: 0 0 0 3px rgba(238, 48, 36, 0.1) !important;
}

.tigr-chat__input:disabled {
    background: #f9fafb !important;
    color: #8b95a1 !important;
}

.tigr-chat__submit {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #f43a2f 0%, #df241a 100%) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(238, 48, 36, 0.3) !important;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tigr-chat__submit::before {
    content: "";
    position: absolute;
    width: 15px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transform: translateX(-1px);
}

.tigr-chat__submit::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: translateX(4px) rotate(45deg);
}

.tigr-chat__submit:hover {
    background: linear-gradient(135deg, #ff4a3f 0%, #d91f16 100%) !important;
    box-shadow: 0 12px 26px rgba(238, 48, 36, 0.36) !important;
    transform: translateY(-1px);
}

.tigr-chat__submit:focus-visible {
    box-shadow: 0 0 0 4px rgba(238, 48, 36, 0.16), 0 10px 22px rgba(238, 48, 36, 0.3) !important;
}

.tigr-chat__submit:disabled {
    cursor: wait;
    opacity: 0.62;
    transform: none;
}

.tigr-chat__submit-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .tigr-chat {
        right: 16px;
        bottom: 76px;
    }

    html body a.scrollToTop.button-show {
        bottom: 146px;
    }
}

@media (max-width: 520px) {
    .tigr-chat {
        right: 10px;
        bottom: 74px;
        left: auto;
        width: auto;
        max-width: calc(100vw - 20px);
    }

    .tigr-chat--open {
        left: 10px;
        width: auto;
    }

    .tigr-chat__toggle {
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 18px !important;
    }

    .tigr-chat__panel {
        width: 100%;
        min-width: 0;
        height: min(610px, calc(100vh - 84px));
        min-height: 0;
        max-width: none;
        resize: none;
        border-radius: 16px;
    }

    .tigr-chat__resize-handle {
        display: none;
    }

    .tigr-chat--open.tigr-chat--expanded {
        inset: 0;
        max-width: none;
    }

    .tigr-chat--expanded .tigr-chat__panel {
        border: 0;
        border-radius: 0;
    }

    html body a.scrollToTop.button-show {
        bottom: 138px;
    }

    .tigr-chat__header {
        grid-template-columns: minmax(0, 1fr) auto auto;
        min-height: 74px;
        padding: 12px;
    }

    .tigr-chat__logo {
        width: 210px;
        max-height: 42px;
    }

    .tigr-chat__messages {
        padding: 12px;
    }

    .tigr-chat__message {
        max-width: 92%;
        font-size: 13px;
    }

    .tigr-chat__prompts {
        gap: 7px;
    }

    .tigr-chat__prompt {
        min-height: 32px !important;
        padding: 7px 10px !important;
        font-size: 12px !important;
    }

    .tigr-chat__form {
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 8px;
        padding: 10px;
    }

    .tigr-chat__input,
    .tigr-chat__submit {
        height: 44px !important;
        min-height: 44px !important;
    }

    .tigr-chat__input {
        border-radius: 13px !important;
    }

    .tigr-chat__submit {
        width: 44px !important;
        border-radius: 999px !important;
    }
}
