#chatbot-box {
            width: 380px !important;
            max-width: 90vw;
            height: 550px !important;
            display: flex;
            flex-direction: column;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            background: #fff;
            position: fixed;
            bottom: 120px;
            right: 20px;
            z-index: 999999;
        }
        
        .kramm-chat-header {
            background: #2c3e50;
            color: #ffffff;
            padding: 12px 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: bold;
            font-size: 14px;
        }

        .kramm-chat-title {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .kramm-online-dot {
            width: 8px;
            height: 8px;
            background-color: #10b981;
            border-radius: 50%;
            display: inline-block;
        }

        .kramm-chat-close {
            cursor: pointer;
            font-size: 18px;
            line-height: 1;
        }

        .kramm-chat-buttons {
            display: flex;
            gap: 8px;
            padding: 8px 12px;
            background-color: #f1f5f8;
            border-bottom: 1px solid #e1e8ed;
        }

        .kramm-btn-action {
            flex: 1;
            padding: 6px 10px;
            background-color: #ffffff;
            border: 1px solid #ccd1d9;
            border-radius: 4px;
            font-size: 11px;
            font-weight: bold;
            color: #434a54;
            cursor: pointer;
            text-align: center;
            text-decoration: none;
            transition: background-color 0.2s;
        }

        .kramm-btn-action:hover {
            background-color: #e6e9ed;
        }
        
        #chatbot-messages {
            flex: 1;
            overflow-y: auto;
            padding: 15px;
            background: #fdfdfd;
        }

        /* Облачки сообщений */
        .chat-msg {
            max-width: 85%;
            margin-bottom: 12px;
            padding: 10px 14px;
            border-radius: 12px;
            font-size: 13px;
            line-height: 1.4;
            word-wrap: break-word;
            white-space: pre-wrap;
        }
        .chat-msg-user {
            margin-left: auto;
            background: #007bff;
            color: #fff;
            border-bottom-right-radius: 4px;
        }
        .chat-msg-bot {
            margin-right: auto;
            background: #eef2f7;
            color: #1a1a1a;
            border-bottom-left-radius: 4px;
        }
        .chat-msg-error {
            margin-right: auto;
            background: #fee2e2;
            color: #991b1b;
            border-bottom-left-radius: 4px;
        }
        .chat-msg-loading {
            margin-right: auto;
            background: #f1f5f9;
            color: #64748b;
            font-style: italic;
        }
        
        #chatbot-form {
            padding: 10px;
            display: flex;
            gap: 8px;
            border-top: 1px solid #eee;
            background: #fff;
        }
        
        #chatbot-form textarea {
            flex: 1;
            height: 40px;
            resize: none;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        
        #chatbot-form button {
            padding: 0 15px;
            background: #007bff;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        
        #chatbot-open-btn {
            position: fixed;
            /* Stack above the PWA install button and auction alerts. */
            bottom: 272px;
            right: 20px;
            z-index: 90;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 64px;
            height: 64px;
            padding: 0;
            overflow: visible;
            background: #fff;
            color: #17212b;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 3px 12px rgba(0,0,0,0.24);
            transition: bottom .15s ease, transform .18s ease, box-shadow .18s ease;
        }

        #chatbot-open-btn img {
            display: block;
            width: 72px;
            height: 72px;
            border-radius: 50%;
            object-fit: cover;
        }

        #chatbot-open-btn:hover,
        #chatbot-open-btn:focus-visible {
            transform: scale(1.06);
            box-shadow: 0 5px 16px rgba(0,0,0,0.3);
        }

        /* Keep scroll-to-top just above the assistant button. */
        #scroll-to-top {
            right: 20px !important;
            bottom: 352px !important;
            width: 64px !important;
            height: 64px !important;
            padding: 0 !important;
            border: 1px solid rgba(0,0,0,0.08);
            border-radius: 14px !important;
            box-sizing: border-box;
            line-height: 64px;
            box-shadow: 0 3px 12px rgba(0,0,0,0.24);
        }

        #scroll-to-top svg {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 24px !important;
            height: 32px !important;
            margin: 0 !important;
            transform: translate(-50%, -50%);
        }

        #scroll-to-top:hover {
            height: 64px !important;
            border-radius: 14px !important;
            box-shadow: 0 5px 16px rgba(0,0,0,0.3);
        }

        #chatbot-open-btn::after {
            content: attr(data-tooltip);
            position: absolute;
            right: calc(100% + 12px);
            top: 50%;
            transform: translate(4px, -50%);
            padding: 9px 12px;
            border-radius: 7px;
            background: #17212b;
            color: #fff;
            font: 600 14px/1.2 Arial, sans-serif;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            visibility: hidden;
            transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
        }

        #chatbot-open-btn::before {
            content: "";
            position: absolute;
            right: calc(100% + 6px);
            top: 50%;
            transform: translate(4px, -50%);
            border: 6px solid transparent;
            border-left-color: #17212b;
            pointer-events: none;
            opacity: 0;
            visibility: hidden;
            transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
        }

        #chatbot-open-btn:hover::after,
        #chatbot-open-btn:focus-visible::after,
        #chatbot-open-btn:hover::before,
        #chatbot-open-btn:focus-visible::before {
            transform: translate(0, -50%);
            opacity: 1;
            visibility: visible;
        }
