:root {
    --body-bg-color: #7dd8ff;
    --chat-bg-color: #fff;
    --font-size: 16px;
    --font-color: black;
    --font-color-muted: black;
    --standard-padding: 15px 15px;
    --standard-radius: 13px;
}

@media (min-width: 768px) {
    .chat-box {
        right: 15px;
    }
}

@media (max-width: 768px) {
    .chat-box {
        left: 50%;
        transform: translateX(-50%);
    }
}

.support-header {
    display: flex;
    align-items: center;
    justify-content: left;
}

.support-header img {
    width: 40px;
    height: 40px;
    color: transparent;
}

.support-header span {
    font-size: 24px;
    margin-left: 15px;
    font-weight: 600;
}

.chat-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 450px;
    position: fixed;
    z-index: 99999999999;
    background-color: var(--chat-bg-color);
    height: 100%;
    max-height: 650px;
    flex-direction: column;
    border-radius: var(--standard-radius);
    border: 1px solid #00000042;
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.3);
    color: var(--font-color);
    font-family: 'Roboto', sans-serif;
    font-size: var(--font-size);
    bottom: 15px;
}
.chat-box > .chat-box-header {
    width: 100%;
    padding: var(--standard-padding);
    border-bottom: solid 1px #cfcfcf;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-box > .chat-box-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
}
#chat_messages {

    width: 100%;
    padding: 0 10px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 400px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE и Edge */
}

#chat_messages::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.support-message {
    width: 90%;
    padding: var(--standard-padding);
    margin: 2px 0;
    border-radius: var(--standard-radius);
    transition: height 0.3s ease-in-out;
    font-size: 14px;
}

.message.hide {
    height: 0;
}

.support-profile {
    margin: 2px 0;
    transition: height 0.3s ease-in-out;
}

.support-profile.hide {
    height: 0;
}

.support-profile img {
    display: inline-block;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    border-radius: 50%;
}

.support-my-profile {
    color: var(--font-color-muted);
    align-self: flex-end;
}

.support-other-profile {
    color: var(--font-color-muted);
}

.support__my-message {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: right;
}

.support__support-message {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
}

.support__my-message .support-message {
    color: black;
    background-color: #e2e2e2;
    align-self: flex-end;
    text-align: left;
}

.support__support-message .support-message {
    color: #fff;
    background-color: #000000db;
    text-align: left;
}

#typing {
    color: var(--font-color-muted);
    width: 100%;
    height: 0;
    padding: 0 15px;
    overflow: hidden;
    box-sizing: border-box;
    opacity: 0;
    transition: 0.3s height ease-in-out, 0.3s opacity ease-in-out;
}
#typing.active {
    height: 80px;
    opacity: 1;
}
#typing span:not(.n) {
    background-color: var(--font-color-muted);
    width: 10px;
    height: 10px;
    margin-top: 20px;
    display: inline-block;
    border-radius: 50%;
}

.chat-box > .chat-box-footer {
    width: 100%;
    padding: var(--standard-padding);
    border-top: solid 1px #cfcfcf;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#chat_input {
    color: var(--font-color);
    font-family: 'Raleway', sans-serif;
    font-size: var(--font-size);
    background-color: #d2d2d2;
    width: 100%;
    height: 80px;
    max-height: 120px;
    padding: 10px 15px;
    resize: none;
    border: none;
    border-radius: var(--standard-radius);
    transition: 0.3s background-color;
    overflow: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE и Edge */
}

#support_link_photo {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;;
}

#support_link_photo svg {
    width: 25px;
    height: 25px;
}

#chat_input::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
#chat_input:focus {
    background-color: #efefef;
    outline: none; /* Убираем стандартный контур, если необходимо */
}

#support_send {
    background: none;
    border: none;
    margin-left: 10px;
    padding: 5px;
    cursor: pointer;
    border-radius: 50%;
}

@keyframes typing {
    0% { transform: translateY(0px); }
    33.3333% { transform: translateY(-5px); }
    66.6667% { transform: translateY(5px); }
    100% { transform: translateY(0px); }
}

.chat_send button::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

.chat_send {
    outline: none;
    border: none;
    text-align: center;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-family: 'Roboto', 'sans-serif';
    display: flex;
    width: 90%;
    height: 40px;
    border-radius: 10px;
}

.support-date {
    font-size: 14px;
    color: darkkgray;
    margin-top: 2px;
    margin-bottom: 5px;
}

.support__link-photo-wrapper {
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    font-size: 10px;
    text-align: center;
    margin-right: 10px;
    height: 100%;
    width: 60px;
    gap: 5px;
    color: #3a393f;
}

@media (min-width: 768px) {
    .support-button {
        z-index: 99999999;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-weight: 500;
        font-family: 'Roboto', 'sans-serif';
        font-size: 16px;
        color: white;
        border-radius: 20px;
        background: black none;
        border: none;
        position: fixed;
        right: 15px;
        bottom: 15px;
        width: fit-content;
        height: 50px;
        cursor: pointer;
    }

    .support-button img {
        margin-right: 10px;
    }

    .support-button p {
        display: flex;
    }
}

@media (max-width: 768px) {
    .support-button {
        z-index: 99999999;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        border-radius: 20px;
        background: black none;
        border: none;
        position: fixed;
        right: 15px;
        bottom: 15px;
        width: 50px;
        height: 50px;
        cursor: pointer;
    }

    .support-button p {
        display: none;
    }
}

@media (max-width: 550px) {
    .chat-box {
        width: 95%;
    }
}

.support-message-img {
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-message-img img {
    width: 100%;
    height: 100%;
}

#support_send.send-disabled svg path {
    fill: currentColor;
}

.support-unviewed {
    color: #fff;
    background: #d0303a;
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    animation: blink 1s infinite;
    position: absolute;
    top: 80%;
    right: 5%;
    transform: translate(50%, -50%);
}

@media (max-width: 768px) {
    .support-unviewed > span {
        line-height: 20px;
    }
}

@keyframes blink {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* ============================================================
   Modern live support refresh.
   This hardens the composer against light-theme bleed, adds the
   animated online presence, and makes the shared transcript read
   consistently on both /support and the floating widget.
   ============================================================ */
@keyframes support-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(24, 224, 102, .42); transform: scale(1); }
    70% { box-shadow: 0 0 0 10px rgba(24, 224, 102, 0); transform: scale(1.06); }
    100% { box-shadow: 0 0 0 0 rgba(24, 224, 102, 0); transform: scale(1); }
}

@keyframes support-panel-in {
    from { opacity: 0; transform: translateY(18px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.support-chat .chat-box {
    background: #0B1017;
    border: 1px solid #1E2632;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .58), 0 0 0 1px rgba(24, 187, 89, .08);
    overflow: hidden;
}

.support-chat .chat-box.open {
    animation: support-panel-in .22s cubic-bezier(.2, .8, .2, 1);
}

.support-chat .chat-box > .chat-box-header {
    padding: 14px 16px;
    background:
        radial-gradient(180px 120px at 18% 0%, rgba(24, 187, 89, .20), transparent 66%),
        linear-gradient(180deg, rgba(24, 187, 89, .10), rgba(24, 187, 89, 0));
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.support-chat .support-header {
    position: relative;
    min-width: 0;
}

.support-chat .support-header img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1A2330;
    box-shadow: 0 0 0 3px rgba(24, 187, 89, .13);
}

.support-chat .support-header::after {
    content: "";
    position: absolute;
    left: 27px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #18E066;
    border: 2px solid #0B1017;
    animation: support-live-pulse 1.8s ease-out infinite;
}

.support-chat .support-header span {
    font-size: 17px;
    font-weight: 800;
    margin-left: 12px;
    color: #EAECEF;
}

.support-chat #support-hide {
    width: 28px !important;
    height: 28px !important;
    padding: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
    cursor: pointer;
    opacity: .8;
}

.support-chat #support-hide:hover {
    background: rgba(255, 255, 255, .09);
    opacity: 1;
}

.support-chat .chat-box > .chat-box-body {
    padding: 12px 10px;
    background: #0B1017;
}

.support-chat #chat_messages {
    padding: 0 6px;
    gap: 2px;
}

.support-chat .support-day {
    display: flex;
    justify-content: center;
    margin: 12px 0 8px;
}

.support-chat .support-day span {
    font-size: 11px;
    font-weight: 700;
    color: #858C97;
    background: rgba(255, 255, 255, .06);
    border-radius: 999px;
    padding: 4px 12px;
}

.support-chat .support-profile {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    color: #657082;
    margin: 8px 2px 3px;
}

.support-chat .support__my-message .support-profile { justify-content: flex-end; }
.support-chat .support-time { color: #657082; font-weight: 500; }

.support-chat .support-message {
    width: auto;
    max-width: 82%;
    padding: 10px 13px;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.45;
    border-radius: 16px;
}

.support-chat .support__my-message .support-message {
    background: linear-gradient(150deg, #18BB59, #12A54E);
    color: #05130A;
    font-weight: 500;
    border-bottom-right-radius: 5px;
}

.support-chat .support__support-message .support-message {
    background: #141B24;
    color: #EAECEF;
    border: 1px solid rgba(255, 255, 255, .06);
    border-bottom-left-radius: 5px;
}

.support-chat .support-message-text {
    color: inherit;
    white-space: pre-line;
}

.support-chat .support-message-img img {
    border-radius: 10px;
}

.support-chat .chat-box > .chat-box-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    align-items: flex-end;
    gap: 6px;
    background: #0B1017;
}

.support-chat .support__link-photo-wrapper {
    width: auto;
    height: auto;
    margin-right: 0;
    color: #858C97;
}

.support-chat #support_link_photo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #858C97;
    cursor: pointer;
}

.support-chat #support_link_photo:hover {
    color: #EAECEF;
    background: rgba(255, 255, 255, .05);
}

.support-chat #chat_input {
    height: 40px;
    min-height: 40px;
    max-height: 110px;
    padding: 10px 14px;
    background: #0C121A !important;
    color: #EAECEF !important;
    -webkit-text-fill-color: #EAECEF;
    caret-color: #18BB59;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.support-chat #chat_input::placeholder {
    color: #6D7685;
    -webkit-text-fill-color: #6D7685;
}

.support-chat #chat_input:focus {
    background: #0C121A !important;
    border-color: rgba(24, 187, 89, .58);
    box-shadow: 0 0 0 3px rgba(24, 187, 89, .10);
    outline: none;
}

.support-chat #support_send {
    width: 40px;
    height: 40px;
    margin-left: 0;
    padding: 0;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #18BB59;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(24, 187, 89, .24);
}

.support-chat #support_send svg {
    width: 20px;
    height: 20px;
}

.support-chat #support_send svg path {
    fill: #05130A;
}

.support-chat #support_send.send-disabled,
.support-chat #support_send:disabled {
    background: #1A2530;
    box-shadow: none;
}

.support-chat #support_send.send-disabled svg path,
.support-chat #support_send:disabled svg path {
    fill: #5B6472;
}

.support-chat .support-button {
    background: #18BB59;
    color: #05130A;
    box-shadow: 0 12px 30px rgba(24, 187, 89, .35);
    animation: support-live-pulse 2.6s ease-out infinite;
}

.support-chat .support-button p {
    color: #05130A;
    font-weight: 700;
}

.support-chat .support-unviewed {
    animation: none;
    background: #EB4536;
    border: 2px solid #070B11;
}

@media (max-width: 550px) {
    .support-chat .chat-box {
        width: calc(100% - 24px);
        max-height: calc(100vh - 104px - env(safe-area-inset-bottom, 0px));
    }
}

/* Refinements after visual QA: stronger controls, a half-screen widget, and a richer surface. */
.support-chat .chat-box {
    height: clamp(360px, 52vh, 560px);
    max-height: calc(100vh - 112px - env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(380px 260px at 82% 0%, rgba(24, 187, 89, .18), transparent 68%),
        radial-gradient(300px 220px at 10% 100%, rgba(24, 187, 89, .08), transparent 62%),
        linear-gradient(180deg, #0D141C 0%, #070B11 100%);
}

.support-chat .chat-box > .chat-box-header {
    min-height: 72px;
    background:
        radial-gradient(260px 150px at 12% 0%, rgba(24, 187, 89, .22), transparent 70%),
        linear-gradient(180deg, rgba(10, 31, 22, .96), rgba(8, 14, 20, .92));
}

.support-chat .chat-box > .chat-box-body,
.support-chat #chat_messages {
    background:
        radial-gradient(420px 320px at 100% 0%, rgba(24, 187, 89, .10), transparent 58%),
        linear-gradient(180deg, rgba(11, 16, 23, .92), #070B11 100%);
}

.support-chat .support-header img {
    width: 42px;
    height: 42px;
}

.support-chat .support-header::after {
    left: 32px;
    bottom: 0;
}

.support-chat .support-header span {
    font-size: 18px;
}

.support-chat #support-hide {
    width: 42px !important;
    height: 42px !important;
    padding: 12px;
    background: rgba(24, 187, 89, .13);
    border: 1px solid rgba(24, 187, 89, .24);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 10px 24px rgba(0, 0, 0, .28);
    opacity: 1;
}

.support-chat #support-hide:hover {
    background: rgba(24, 187, 89, .22);
    border-color: rgba(24, 187, 89, .42);
}

.support-chat .chat-box > .chat-box-footer {
    background:
        linear-gradient(180deg, rgba(7, 11, 17, .64), rgba(7, 11, 17, .98)),
        radial-gradient(280px 120px at 100% 100%, rgba(24, 187, 89, .12), transparent 70%);
}

.support-chat #support_link_photo {
    width: 40px;
    height: 40px;
    background: #111A23;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
    color: #18BB59;
}

.support-chat #support_link_photo:hover {
    color: #20CA63;
    background: rgba(24, 187, 89, .12);
    border-color: rgba(24, 187, 89, .32);
}

.support-chat #support_link_photo svg {
    width: 19px;
    height: 19px;
}

@media (max-width: 550px) {
    .support-chat .chat-box {
        height: min(52vh, 520px);
        min-height: 340px;
    }
}
