.chat-launcher {
    position: fixed;
    right: calc(180px + 18px);
    bottom: 88px;
    z-index: 45;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(255, 225, 120, 0.55);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(50, 6, 24, 0.94) 0%, rgba(14, 60, 70, 0.94) 100%);
    color: #fff4b8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 18px rgba(105, 215, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.chat-launcher:hover,
.chat-launcher:focus-visible {
    transform: translateY(-2px);
    border-color: #ffe978;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38), 0 0 20px rgba(255, 233, 120, 0.24);
}

.chat-launcher__icon {
    font-size: 26px;
    line-height: 1;
}

.chat-launcher__badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ffce2e;
    color: #340000;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.chat-shell {
    position: fixed;
    right: calc(180px + 18px);
    top: calc(var(--italonet-desktop-header-h, 120px) + 12px);
    bottom: calc(var(--italonet-desktop-bottom-ui, 120px) + 12px);
    z-index: 44;
    width: min(640px, calc(100vw - 250px));
    max-height: none;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    border: 1px solid rgba(255, 225, 120, 0.35);
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(11, 11, 22, 0.96) 0%, rgba(20, 8, 34, 0.96) 100%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 0 28px rgba(76, 0, 130, 0.22);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-shell.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-shell__users {
    background: linear-gradient(180deg, rgba(6, 42, 28, 0.96) 0%, rgba(16, 21, 57, 0.96) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-users__header {
    padding: 16px 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-users__title,
.chat-main__title {
    margin: 0;
    color: #fff3af;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.chat-users__count,
.chat-main__subtitle {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.chat-users__list {
    list-style: none;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.chat-user {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.chat-user__avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(180deg, rgba(176, 56, 0, 0.92) 0%, rgba(78, 0, 124, 0.92) 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.chat-user__name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-user__meta {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}

.chat-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
}

.chat-main__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-main__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-action,
.chat-close,
.chat-send,
.chat-emoji-toggle {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff5cb;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.chat-action,
.chat-close {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
}

.chat-action.is-active {
    background: rgba(255, 212, 88, 0.18);
    border-color: rgba(255, 212, 88, 0.46);
    color: #ffe978;
}

.chat-close {
    width: 36px;
    height: 36px;
    line-height: 1;
}

.chat-action:hover,
.chat-action:focus-visible,
.chat-close:hover,
.chat-close:focus-visible,
.chat-send:hover,
.chat-send:focus-visible,
.chat-emoji-toggle:hover,
.chat-emoji-toggle:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.chat-main__messages {
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.chat-message {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.chat-message__avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(180deg, rgba(0, 92, 117, 0.94) 0%, rgba(95, 0, 115, 0.94) 100%);
}

.chat-message__bubble {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    min-width: 0;
}

.chat-message__meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.chat-message__author {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.chat-message__time {
    color: rgba(255,255,255,0.55);
    font-size: 11px;
}

.chat-message__text,
.chat-message__translation {
    margin: 0;
    line-height: 1.45;
    word-break: break-word;
}

.chat-message__text {
    color: #f6f0d0;
    font-size: 14px;
}

.chat-message__translation {
    margin-top: 8px;
    color: #9bd9ff;
    font-size: 12px;
    display: none;
}

.chat-shell[data-translate-enabled="true"] .chat-message__translation {
    display: block;
}

.chat-main__footer {
    position: relative;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 8, 18, 0.72);
}

.chat-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 52px;
    gap: 10px;
    align-items: center;
}

.chat-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    color: #fff6d1;
    padding: 11px 14px;
    box-sizing: border-box;
    font: inherit;
}

.chat-input::placeholder {
    color: rgba(255,255,255,0.44);
}

.chat-emoji-toggle,
.chat-send {
    height: 44px;
    padding: 0;
    font-size: 18px;
    font-weight: 700;
}

.chat-send {
    font-size: 13px;
    letter-spacing: 0.04em;
}

.chat-emoji-panel {
    position: absolute;
    right: 76px;
    bottom: 72px;
    width: min(320px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(7, 11, 24, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
    display: none;
}

.chat-emoji-panel.is-open {
    display: block;
}

.chat-emoji-panel__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.chat-emoji {
    height: 36px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.chat-emoji:hover,
.chat-emoji:focus-visible {
    background: rgba(255, 233, 120, 0.12);
    border-color: rgba(255, 233, 120, 0.28);
}

@media (max-width: 768px) {
    .chat-launcher {
        right: 14px;
        bottom: 92px;
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    .chat-shell {
        left: 10px;
        right: 10px;
        top: 86px;
        bottom: 132px;
        width: auto;
        height: auto;
        grid-template-columns: 1fr;
    }

    .chat-shell__users {
        display: none;
    }

    .chat-main__header {
        padding: 14px;
    }

    .chat-main__messages {
        padding: 14px;
    }

    .chat-main__footer {
        padding: 12px 14px 14px;
    }

    .chat-emoji-panel {
        right: 14px;
        left: 14px;
        width: auto;
        bottom: 70px;
    }
}