.sidebar-chat-trigger {
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sidebar-chat-trigger .qr-code-img {
    display: block;
}

.sidebar-chat-cta {
    position: absolute;
    left: 50%;
    bottom: 7px;
    transform: translateX(-50%);
    width: 72px;
    min-width: 72px;
    height: 22px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)) padding-box,
        linear-gradient(120deg, rgba(255,255,255,0.25), rgba(255,255,255,0.25)) border-box;
    color: #12372a;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    box-sizing: border-box;
}

.sidebar-chat-trigger.has-new-message .sidebar-chat-cta {
    border: 2px solid transparent;
    line-height: 18px;
    background:
        linear-gradient(rgba(255, 250, 235, 0.92), rgba(255, 250, 235, 0.92)) padding-box,
        linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.65) 0%,
            rgba(255, 196, 55, 1) 28%,
            rgba(255, 244, 190, 1) 48%,
            rgba(218, 150, 28, 0.95) 68%,
            rgba(255, 255, 255, 0.65) 100%
        ) border-box;
    background-size: 100% 100%, 240% 100%;
    animation: chatLabelGoldBorder 7s ease-in-out infinite;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 205, 80, 0.28),
        0 0 20px rgba(255, 190, 50, 0.42);
        
}

@keyframes chatLabelGoldBorder {
    0% {
        background-position: 0 0, 0% 50%;
    }

    50% {
        background-position: 0 0, 100% 50%;
    }

    100% {
        background-position: 0 0, 0% 50%;
    }
}

/* Browse Map full chat block */

.sidebar-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #1f7a4d;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
    z-index: 3;
}

/* Chat reset */
#tradelChatPanel,
#tradelChatPanel * {
    box-sizing: border-box;
}

#tradelChatPanel {
    position: fixed;
    z-index: 10050;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.3;
}

#tradelChatPanel.is-open {
    pointer-events: none;
    opacity: 1;
}

#tradelChatPanel button,
#tradelChatPanel input {
    font: inherit;
}

.tc-shell {
    position: fixed;
    left: 96px;
    bottom: 24px;
    width: min(760px, calc(100vw - 120px));
    height: min(600px, calc(100dvh - 88px));
    max-height: calc(100dvh - 88px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 26px;
    border: 1px solid rgba(18, 55, 42, 0.08);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transform: translateX(-16px) scale(0.98);
    transition: transform 0.2s ease;
}

#tradelChatPanel.is-open .tc-shell {
    transform: translateX(0) scale(1);
}

.tc-drag {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 18px;
    border: 0;
    background: transparent;
    cursor: ns-resize;
    z-index: 10;
}

.tc-drag span {
    display: block;
    width: 42px;
    height: 5px;
    margin: 6px auto 0;
    border-radius: 999px;
    background: rgba(18, 55, 42, 0.22);
}

.tc-header {
    height: 74px;
    flex: 0 0 74px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(18, 55, 42, 0.08);
    background: linear-gradient(135deg, rgba(31, 122, 77, 0.08), #fff);
}

.tc-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #1f7a4d;
}

.tc-header h2 {
    margin: 2px 0 0;
    font-size: 22px;
    color: #12372a;
}

.tc-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(18, 55, 42, 0.08);
    color: #12372a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.tc-main {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.tc-inbox {
    min-height: 0;
    border-right: 1px solid rgba(18, 55, 42, 0.08);
    background: #fbfdfb;
    display: flex;
    flex-direction: column;
}

.tc-search-wrap {
    padding: 14px;
    flex: 0 0 auto;
}

.tc-search {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(18, 55, 42, 0.12);
    border-radius: 999px;
    padding: 0 14px;
    outline: none;
    color: #12372a;
    background: #fff;
}

.tc-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px 10px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(31, 122, 77, 0.35) transparent;
}

.tc-list::-webkit-scrollbar {
    width: 6px;
}

.tc-list::-webkit-scrollbar-thumb {
    background: rgba(31, 122, 77, 0.35);
    border-radius: 999px;
}

.tc-item {
    width: 100%;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 0;
    border-radius: 18px;
    padding: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.tc-item:hover,
.tc-item.is-active {
    background: #fff;
    box-shadow: 0 10px 28px rgba(18, 55, 42, 0.08);
}

.tc-item-img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(18, 55, 42, 0.08);
}

.tc-item-main {
    min-width: 0;
}

.tc-item-main strong,
.tc-item-main small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-item-main strong {
    color: #12372a;
    font-size: 14px;
}

.tc-item-main small {
    margin-top: 3px;
    color: rgba(18, 55, 42, 0.62);
    font-size: 12px;
}

.tc-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #1f7a4d;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.tc-detail {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: #fff;
    overflow: hidden;
}

.tc-empty {
    height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 28px 16px;
    color: rgba(18, 55, 42, 0.62);
}

.tc-empty-icon {
    font-size: 34px;
    margin-bottom: 10px;
}

.tc-empty h3 {
    margin: 0 0 6px;
    color: #12372a;
}

.tc-thread {
    position: absolute;
    inset: 0;
    display: none;
}

.tc-detail.has-thread .tc-empty {
    display: none;
}

.tc-detail.has-thread .tc-thread {
    display: block;
}

.tc-thread-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 74px;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(18, 55, 42, 0.08);
    background: #fff;
    z-index: 2;
}

.tc-back {
    display: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(31, 122, 77, 0.1);
    color: #12372a;
    font-size: 26px;
    cursor: pointer;
}

.tc-listing-img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(18, 55, 42, 0.08);
}

.tc-thread-title {
    min-width: 0;
}

.tc-thread-title h3 {
    margin: 0;
    font-size: 15px;
    color: #12372a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-thread-title a {
    font-size: 12px;
    color: #1f7a4d;
    text-decoration: none;
    font-weight: 700;
}

.tc-messages {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    bottom: 66px;
    overflow-y: auto;
    padding: 16px;
    background:
        radial-gradient(circle at top left, rgba(31, 122, 77, 0.06), transparent 30%),
        #f7faf7;
}

.tc-message-img {
    cursor: zoom-in;
    transition: transform 0.18s ease, max-height 0.18s ease;
}

.tc-message-img.is-zoomed {
    max-height: 420px;
    transform: scale(1.04);
    cursor: zoom-out;
    z-index: 2;
    position: relative;
}

.tc-form {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 66px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px;
    border-top: 1px solid rgba(18, 55, 42, 0.08);
    background: #fff;
    z-index: 3;
}

.tc-attach {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(31, 122, 77, 0.1);
    color: #1f7a4d;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
}

.tc-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    border: 1px solid rgba(18, 55, 42, 0.12);
    border-radius: 999px;
    padding: 0 14px;
    outline: none;
    color: #12372a;
    background: #fff;
}

.tc-send {
    height: 42px;
    flex: 0 0 auto;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #1f7a4d;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.tc-image-state {
    position: absolute;
    left: 12px;
    bottom: 72px;
    max-width: calc(100% - 24px);
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0,0,0,0.12);
    font-size: 12px;
    color: #12372a;
    display: none;
    z-index: 4;
}

.tc-image-state.is-visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-image-state button {
    border: 0;
    background: rgba(18, 55, 42, 0.08);
    border-radius: 999px;
    cursor: pointer;
}

.tc-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.tc-row.is-me {
    flex-direction: row-reverse;
}

.tc-avatar-btn {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

.tc-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    object-fit: cover;
    background: rgba(18, 55, 42, 0.08);
}

.tc-bubble {
    max-width: 76%;
    padding: 10px 12px;
    border-radius: 18px;
    background: #fff;
    color: #12372a;
    box-shadow: 0 8px 24px rgba(18, 55, 42, 0.06);
    font-size: 14px;
}

.tc-row.is-me .tc-bubble {
    background: rgba(31, 122, 77, 0.14);
}

.tc-bubble img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 14px;
    object-fit: cover;
    margin-bottom: 6px;
}

.tc-time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: rgba(18, 55, 42, 0.5);
}

.tc-profile {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: none;
    padding: 18px;
    background:
        radial-gradient(circle at top left, rgba(31, 122, 77, 0.08), transparent 32%),
        #fff;
}

.tc-profile.is-open {
    display: block;
}

.tc-profile-back {
    border: 0;
    background: rgba(31, 122, 77, 0.1);
    color: #12372a;
    border-radius: 999px;
    padding: 5px 12px;
    font-weight: 700;
    cursor: pointer;
}

.tc-profile-card {
    margin: 40px auto 0;
    max-width: 280px;
    text-align: center;
    gap: 5px;
}

.tc-profile-avatar {
    width: 104px;
    height: 104px;
    display: block;
    margin: 0 auto;
    border-radius: 32px;
    object-fit: cover;
    background: rgba(18, 55, 42, 0.08);
    box-shadow: 0 16px 42px rgba(18, 55, 42, 0.14);
}

.tc-profile-card h3 {
    margin: 16px 0 6px;
    color: #12372a;
    font-size: 22px;
}

.tc-profile-meta {
    margin: 0;
    color: rgba(18, 55, 42, 0.65);
    font-size: 14px;
}

.tc-supporter {
    display: inline-flex;
    margin-top: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(31, 122, 77, 0.12);
    color: #1f7a4d;
    font-size: 12px;
    font-weight: 800;
}

.tc-supporter[hidden] {
    display: none;
}

#tradelChatPanel .tc-shell {
    width: min(760px, calc(100vw - 120px));
    height: min(600px, calc(100dvh - 88px));
    max-height: calc(100dvh - 88px);
    display: flex;
    flex-direction: column;
}

#tradelChatPanel .tc-main {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

#tradelChatPanel .tc-inbox {
    width: 280px;
    min-width: 0;
    min-height: 0;
}

#tradelChatPanel .tc-detail {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

#tradelChatPanel .tc-thread {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#tradelChatPanel .tc-thread-header {
    width: 100%;
}

#tradelChatPanel .tc-messages {
    left: 0;
    right: 0;
    width: 100%;
}

#tradelChatPanel .tc-form {
    left: 0;
    right: 0;
    width: 100%;
}

#tradelChatPanel .tc-listing-img,
#tradelChatPanel .tc-item-img,
#tradelChatPanel .tc-avatar,
#tradelChatPanel .tc-profile-avatar,
#tradelChatPanel .tc-bubble img {
    max-width: none;
}
/*--
html.tc-chat-lock,
body.tc-chat-lock {
    overflow: hidden;
    overscroll-behavior: none;
}
--*/

#tradelChatPanel .tc-shell {
    pointer-events: none;
    overscroll-behavior: contain;
}

#tradelChatPanel.is-open .tc-shell {
    pointer-events: auto;
}

#tradelChatPanel .tc-list,
#tradelChatPanel .tc-messages {
    overscroll-behavior: contain;
}

#tradelChatPanel .tc-drag {
    touch-action: none;
    user-select: none;
}


#tradelChatPanel h2,
#tradelChatPanel h3,
#tradelChatPanel p {
    margin: 0;
    padding: 0;
    line-height: 1.25;
}

#tradelChatPanel img {
    padding: 0;
    margin: 0;
}

#tradelChatPanel .tc-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#tradelChatPanel .tc-profile-avatar {
    display: block;
    margin: 0 auto;
    align-self: center;
}
/* Responsive */
@media (max-width: 768px) {

    #tradelChatPanel.has-active-chat .tc-inbox {
        display: none;
    }

    #tradelChatPanel.has-active-chat .tc-detail {
        display: block;
    }

    #tradelChatPanel .tc-shell {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 92vh;
        border-radius: 26px 26px 0 0;
    }

    #tradelChatPanel .tc-main {
        grid-template-columns: 1fr;
    }

    #tradelChatPanel .tc-inbox {
        width: 100%;
    }

    #tradelChatPanel .tc-detail {
        display: none;
    }

    #tradelChatPanel.has-active-chat .tc-inbox {
        display: none;
    }

    #tradelChatPanel.has-active-chat .tc-detail {
        display: block;
    }

    #tradelChatPanel .tc-back {
        display: grid;
        place-items: center;
    }
}
