﻿/* ========================================
   CHAT WIDGET - User Area
   ======================================== */

/* --- Entrance & Attention Animations -------------------- */
@keyframes chat-slide-in {
    from { transform: translateX(120px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
@keyframes chat-pulse {
    0%,100% { box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
    50%      { box-shadow: 0 0 0 10px rgba(255,94,20,0.15), 0 4px 16px rgba(0,0,0,0.25); }
}

/* Chat Toggle Button */
.chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--icon-bg,--color-primary, #ff5e14);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px var(--icon-border, rgba(0,0,0,0.25));
    cursor: pointer;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.3s, background 0.3s;
}
    .chat-toggle-btn:hover {
        color: var(--icon-hover-color);
        transform: scale(1.08);
        background: var(--icon-hover-bg,--color-secondary, #152332);
    }
/* ????? ?: ???? ?? ???? */
.chat-toggle-btn.chat-btn-entering {
    display: flex;
    animation: chat-slide-in 0.55s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
/* ????? ?: ???? */
.chat-toggle-btn.chat-btn-visible {
    display: flex;
    animation: none;
}
/* ????? ?: ????? infinite */
.chat-toggle-btn.chat-btn-visible.chat-btn-pulse {
    animation: chat-pulse 2.2s ease-in-out infinite;
}

.chat-toggle-btn .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #fff;
}

/* --- Label Bubble ?????? ?????? --------------------------- */
@keyframes label-pop-in {
    0%   { opacity: 0; transform: translateY(10px) scale(0.85); }
    60%  { opacity: 1; transform: translateY(-3px) scale(1.05); }
    80%  { transform: translateY(1px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes label-pop-out {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(8px) scale(0.88); }
}
.chat-label-bubble {
    position: fixed;
    bottom: 92px;
    right: 12px;
    background: var(--icon-bg,--color-primary, #1976d2);
    color: var(--icon-color);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9997;
    box-shadow: 0 3px 12px rgba(0,0,0,0.22);
    opacity: 0;
    visibility: hidden;
}
.chat-label-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 20px;
    border-width: 7px 7px 0;
    border-style: solid;
    border-color: var(--color-primary, #1976d2) transparent transparent;
}
.chat-label-bubble.label-show {
    visibility: visible;
    animation: label-pop-in 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.chat-label-bubble.label-hide {
    visibility: visible;
    animation: label-pop-out 0.35s ease forwards;
}

/* --- Label ???????? ?????? -------------------------------- */
.chat-label-tooltip {
    position: fixed;
    bottom: 92px;
    right: 10px;
    background: var(--color-primary, #ff5e14);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9997;
    box-shadow: 0 2px 8px rgba(255,94,20,0.35);
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}
.chat-label-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 22px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--color-primary, #ff5e14) transparent transparent;
}
.chat-label-tooltip.label-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Chat Box Container */
.chat-box {
    position: fixed;
    bottom: 1rem;
    right: 6rem;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
}
.chat-box.open {
    display: flex;
    animation: chatSlideUp 0.3s ease;
}
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat Header */
.chat-header {
    background: var(--color-primary, #ff5e14);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}
.chat-header-title {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-header-actions {
    display: flex;
    gap: 8px;
}
.chat-header-actions button {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    padding: 4px;
}
.chat-header-actions button:hover {
    opacity: 1;
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    position: relative; /* ???? ????? ???? ??? ?????????? */
}
    .chat-body.chat-body-faq {
        padding: 1rem;
        overflow: hidden;
    }

/* Welcome Screen (when FAQ disabled or empty) */
.chat-welcome-screen .chat-welcome-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 20px;
}
.chat-welcome-screen .chat-welcome-hero .chat-faq-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
    margin-bottom: 14px;
}
.chat-welcome-screen .chat-welcome-hero h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #222;
}
.chat-welcome-screen .chat-welcome-hero p {
    font-size: 13px;
    color: #777;
    margin: 0;
    line-height: 1.7;
}

/* FAQ Screen - full layout */
.chat-faq-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* FAQ Header */
.chat-faq-header {
    text-align: center;
    padding: 18px 16px 12px;
    background: linear-gradient(135deg, var(--rgba-primary-1, rgba(255,94,20,0.08)), #f5f5f5);
    flex-shrink: 0;
}
.chat-faq-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--icon-bg, rgba(255,94,20,0.12));
    color: var(--icon-color, var(--color-primary, #ff5e14));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 8px;
}
.chat-faq-header h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #222;
}
.chat-faq-header p {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* FAQ Scrollable area */
.chat-faq-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    min-height: 0;
}

/* FAQ Empty state */
.chat-faq-empty {
    text-align: center;
    padding: 30px 0;
    color: #aaa;
}
.chat-faq-empty i {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}
.chat-faq-empty p {
    font-size: 13px;
    margin: 0;
}

/* FAQ Fixed footer */
.chat-faq-footer {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    background: #fff;
    border-top: 1px solid #eee;
}
.chat-faq-footer-text {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin: 0 0 8px;
}
.chat-faq-footer-text i {
    color: var(--icon-color, var(--color-primary, #ff5e14));
}

/* FAQ Screen */
.chat-faq-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.chat-faq-list li {
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid #e8e8e8;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-faq-list li:hover {
    background: #f0f7ff;
    border-color: var(--color-primary, #ff5e14);
}
.chat-faq-list li i {
    color: var(--icon-color, var(--color-primary, #ff5e14));
    font-size: 12px;
    flex-shrink: 0;
}
.chat-faq-list li span {
    flex: 1;
}
.chat-faq-arrow {
    font-size: 10px !important;
    color: #bbb !important;
    transition: transform 0.2s;
}
.chat-faq-list li:hover .chat-faq-arrow {
    color: var(--icon-color, var(--color-primary, #ff5e14)) !important;
    transform: translateX(-3px);
}

/* FAQ Detail */
.chat-faq-detail {
    padding: 0;
}
.chat-faq-detail .faq-q {
    background: var(--rgba-primary-1, rgba(255,94,20,0.1));
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-primary, #000);
}
.chat-faq-detail .faq-a {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.8;
    border: 1px solid #eee;
    color: #444;
}

/* Start Chat Button */
.chat-start-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--color-primary, #ff5e14);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s;
}
.chat-start-btn:hover {
    background: var(--color-secondary, #152332);
}

/* Auth Screen */
.chat-auth-screen {
    text-align: center;
    padding: 12px 0;
}
.chat-auth-screen p {
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}
.chat-auth-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.chat-auth-btns button {
    flex: 1;
    padding: 10px 8px;
    border-radius: 10px;
    border: 2px solid var(--color-primary, #ff5e14);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.chat-auth-btns .btn-chat-login {
    background: var(--color-primary, #ff5e14);
    color: #fff;
}
.chat-auth-btns .btn-chat-guest {
    background: #fff;
    color: var(--color-primary, #ff5e14);
}
.chat-auth-btns .btn-chat-login:hover {
    opacity: 0.9;
}
.chat-auth-btns .btn-chat-guest:hover {
    background: var(--rgba-primary-1, rgba(255,94,20,0.1));
}

/* Form Inputs */
.chat-form-group {
    margin-bottom: 12px;
    text-align: right;
}
.chat-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
.chat-form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    direction: ltr;
    text-align: right;
}
.chat-form-group input:focus {
    outline: none;
    border-color: var(--color-primary, #ff5e14);
}
.chat-form-submit {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: var(--color-primary, #ff5e14);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 6px;
}
.chat-form-error {
    color: #e53935;
    font-size: 12px;
    margin-top: 4px;
}
.chat-back-btn {
    background: none;
    border: none;
    color: var(--color-primary, #ff5e14);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ----------------------------------------
   Floating Welcome Tip (Telegram-style)
   - ???? ???? ?? ????? ????? ? ?? ????????
   - ??? ???? ???? ????? ??? ???? ??????? ???????
   - ?? ????? ???? ?????? ???? JS ??? ????
----------------------------------------*/
.chat-welcome-tip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 40px);
    max-width: 300px;
    z-index: 5;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px 14px 30px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-size: 12px;
    color: #555;
    opacity: 0.85;
    animation: chatTipFade 0.35s ease;
}
@keyframes chatTipFade {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to   { opacity: 0.85; transform: translate(-50%, -50%); }
}
.chat-welcome-tip .chat-tip-icon {
    color: #f0ad4e;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}
.chat-welcome-tip .chat-tip-content {
    flex: 1;
    min-width: 0;
}
.chat-welcome-tip span {
    font-weight: 700;
    font-size: 13px;
    color: #333;
    display: block;
    margin-bottom: 2px;
}
.chat-welcome-tip small {
    line-height: 1.5;
    color: #777;
}
.chat-welcome-tip small b {
    background: #e8e8e8;
    padding: 0 4px;
    border-radius: 3px;
    font-family: monospace;
}
.chat-tip-close {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}
.chat-tip-close:hover { background: rgba(0, 0, 0, 0.12); color: #222; }

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
}
.chat-msg {
    display: flex;
    max-width: 85%;
    word-wrap: break-word;
}
.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chat-msg.admin {
    align-self: flex-start;
}
.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    position: relative;
}
.chat-msg.user .chat-msg-bubble {
    background: var(--color-primary, #ff5e14);
    color: #fff;
    border-bottom-left-radius: 4px;
}
.chat-msg.admin .chat-msg-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e8e8e8;
    border-bottom-right-radius: 4px;
}
.chat-msg-time {
    font-size: 10px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    opacity: 0.7;
}
.chat-msg.user .chat-msg-time {
    color: rgba(255,255,255,0.8);
}
.seen-check { color: #53bdeb; }
.unseen-check { opacity: 0.5; }

/* Product Mention */
.chat-product-mention {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 12px;
    margin-top: 6px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255,255,255,0.3);
    overflow: hidden;
}
.chat-product-mention-img {
    width: 100%;
    display: block;
    max-height: 200px;
    object-fit: cover;
}
.chat-product-mention-name {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
}
.chat-msg.admin .chat-product-mention {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
.chat-product-mention:hover {
    opacity: 0.85;
}

/* File in message */
.chat-msg-file img {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 6px;
    cursor: pointer;
}
.chat-msg-file a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    text-decoration: none;
}
.chat-msg.user .chat-msg-file a { color: rgba(255,255,255,0.9); }
.chat-msg.admin .chat-msg-file a { color: var(--color-primary, #ff5e14); }

/* Chat Input */
.chat-input-area {
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}
.chat-input-row textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    resize: none;
    max-height: 80px;
    min-height: 38px;
    height: auto;
    line-height: 1.4;
    font-family: inherit;
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-word;
}
.chat-input-row textarea:focus {
    outline: none;
    border-color: var(--color-primary, #ff5e14);
}
.chat-input-actions {
    display: flex;
    gap: 2px;
}
.chat-input-actions button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    color: #888;
    border-radius: 50%;
}
.chat-input-actions button:hover {
    color: var(--color-primary, #ff5e14);
    background: #f5f5f5;
}
.chat-send-btn {
    background: var(--color-primary, #ff5e14) !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    flex-shrink: 0;
}
.chat-send-btn:hover {
    opacity: 0.85;
    background: var(--color-primary, #ff5e14) !important;
    color: #fff !important;
}

/* Mention Hint Bar */
@keyframes chat-hint-in {
    from { opacity: 0; transform: translateY(6px); max-height: 0; }
    to   { opacity: 1; transform: translateY(0);  max-height: 40px; }
}
@keyframes chat-hint-out {
    from { opacity: 1; transform: translateY(0);  max-height: 40px; }
    to   { opacity: 0; transform: translateY(4px); max-height: 0; }
}
.chat-mention-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: linear-gradient(135deg, rgba(255,94,20,0.08), rgba(255,94,20,0.04));
    border: 1px solid rgba(255,94,20,0.18);
    border-radius: 8px;
    font-size: 12px;
    color: #555;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    animation: none;
}
.chat-mention-hint.hint-show {
    pointer-events: auto;
    animation: chat-hint-in 0.32s cubic-bezier(0.34,1.4,0.64,1) forwards;
}
.chat-mention-hint.hint-hide {
    animation: chat-hint-out 0.22s ease forwards;
}
.chat-mention-hint-icon {
    color: var(--color-primary, #ff5e14);
    font-size: 13px;
    flex-shrink: 0;
}
.chat-mention-hint b {
    background: rgba(255,94,20,0.12);
    color: var(--color-primary, #ff5e14);
    padding: 0 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}
@media (max-width: 600px) {
    .chat-mention-hint { font-size: 11px; }
}

/* Product Mention Dropdown */
.chat-mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    z-index: 10;
    display: none;
}
.chat-mention-dropdown.open {
    display: block;
}
.chat-mention-dropdown .mention-search {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}
.chat-mention-dropdown .mention-search input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
}
.chat-mention-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f5f5f5;
}
.chat-mention-item:hover {
    background: #f0f7ff;
}
.chat-mention-item i {
    color: var(--color-primary, #ff5e14);
}
.chat-mention-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* File Preview */
.chat-file-preview {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 12px;
}
.chat-file-preview.show {
    display: flex;
}
.chat-file-preview .remove-file {
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    font-size: 14px;
}

/* Product Mention Button - for product pages */
.btn-chat-mention {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--color-primary, #ff5e14);
    padding: 4px;
    transition: all 0.2s;
}
.btn-chat-mention:hover {
    opacity: 0.8;
}

/* Product List Chat Button */
.card-chat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary, #ff5e14);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.card-chat-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

/* ----------------------------------------
   Mobile Backdrop
   ---------------------------------------- */
.chat-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.chat-mobile-backdrop.active {
    display: block;
    opacity: 1;
}

/* ----------------------------------------
   Mobile Drag Handle
   ---------------------------------------- */
.chat-drag-handle {
    display: none;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
    flex-shrink: 0;
}
.chat-drag-handle span {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    display: block;
}

/* Responsive */
@media (max-width: 991px) {
    .chat-toggle-btn    { bottom: 40px; }
    .chat-label-tooltip { bottom: 148px; left: 0; right: auto; }
    .chat-box           { bottom: 150px; }
}

@media (max-width: 600px) {
    .chat-toggle-btn {
        bottom: 80px;
        right: 16px;
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
    .chat-label-bubble  { bottom: 145px; right: 10px; }
    .chat-label-tooltip { bottom: 82px; left: 0; right: auto; font-size: 11px; }
    .chat-drag-handle   { display: flex; }
    .chat-box {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 85dvh;
        max-height: 85dvh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
        transform: translateY(100%);
        display: flex !important;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 9998;
    }
    .chat-box.open {
        transform: translateY(0);
        animation: none;
    }
    body.chat-sheet-open {
        overflow: hidden;
        touch-action: none;
    }
}
