.ce-voice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #4d86d1;
    cursor: pointer;
    vertical-align: middle;
    transition: color 0.15s, opacity 0.15s;
}

.ce-voice-btn .ce-voice-icon {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.ce-voice-btn:hover {
    color: #6a38de;
    opacity: 0.9;
}

.ce-voice-wrap {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-direction: row-reverse;
}

.ce-voice-btn-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.ce-voice-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border-radius: 50%;
    border: 2px solid #dc3545;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.88);
}

.ce-voice-wrap.ce-recording .ce-voice-ring {
    opacity: 0.35;
    animation: none;
}

.ce-voice-rec-wave {
    display: none;
    align-items: center;
    gap: 1px;
    width: 72px;
    height: 18px;
    flex-shrink: 0;
}

.ce-voice-rec-wave:not(.disp-n) {
    display: inline-flex;
}

.ce-voice-rec-bar {
    flex: 1 1 0;
    min-width: 2px;
    max-width: 3px;
    border-radius: 1px;
    background: #dc3545;
    align-self: center;
    opacity: 0.85;
    transition: height 0.06s linear;
}

.ce-voice-wrap.ce-recording .ce-voice-btn {
    color: #dc3545;
    position: relative;
}

.ce-voice-rec-time {
    display: none;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    color: #dc3545;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: none;
    min-width: 34px;
    text-align: right;
}

.ce-voice-wrap.ce-recording .ce-voice-rec-time {
    display: inline-block;
}

#chat {
    position: relative;
}

#chat > .popover.ce-chat-sticker-popover {
    width: 290px;
    max-width: 290px !important;
    box-sizing: border-box;
}

#chat > .popover .popover-content,
#chat > .popover .popover-body,
.popover.ce-chat-sticker-popover .popover-content,
.popover.ce-chat-sticker-popover .popover-body {
    min-width: 0;
    max-width: none;
    width: 100%;
    max-height: none !important;
    overflow: hidden;
    box-sizing: border-box;
}

.ce-sticker-viewport {
    width: 100%;
    height: 300px;
    max-height: 300px;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 0 6px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.ce-sticker-viewport .smiles_box.disp-n {
    display: none !important;
}

.ce-sticker-viewport .smiles_box.disp-b {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0;
    max-height: none;
    overflow: visible;
    box-sizing: border-box;
}

.ce-sticker-viewport .smiles_box.disp-b::after {
    content: "";
    display: table;
    clear: both;
}

.ce-sticker-viewport .smiles_box .smile {
    float: left;
    margin: 7px;
    width: 25px;
    height: 25px;
    cursor: pointer;
}

.ce-sticker-viewport .smiles_box .sticker {
    float: left;
    margin: 6px;
    width: 65px;
    height: 65px;
    object-fit: contain;
    cursor: pointer;
}

.ce-sticker-viewport .ce-stickers-area {
    display: none;
    width: 100%;
}

.ce-sticker-viewport .ce-stickers-area.ce-area-visible {
    display: block;
}

.ce-sticker-viewport .ce-stickers-area .ce-stickers-box.disp-b {
    min-height: 0;
}

.ce-stickers-area .ce-stickers-box {
    display: block;
    width: 100% !important;
    min-height: 0;
    overflow: visible;
    box-sizing: border-box;
}

.ce-stickers-area .ce-stickers-box::after {
    content: "";
    display: table;
    clear: both;
}

.ce-stickers-area .ce-stickers-box.disp-n {
    display: none !important;
}

.ce-stickers-extra {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

#chat .popover .smiles_panel,
#chat .popover .popover-content .smiles_panel,
#chat .popover .popover-body .smiles_panel {
    width: 100% !important;
    margin: 5px 0 4px;
    padding: 0 15px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

#chat .popover .owl-carousel.smiles_panel .owl-stage-outer {
    position: relative;
    z-index: 2;
    width: calc(100% - 41px) !important;
    max-width: calc(100% - 41px) !important;
    margin-left: 20.5px !important;
}

#chat .popover .owl-carousel.smiles_panel .owl-nav {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 15px;
    box-sizing: border-box;
    z-index: 1;
    height: 40px;
    line-height: 1;
    pointer-events: none;
}

#chat .popover .owl-carousel.smiles_panel .owl-nav button {
    width: 18px;
    height: 40px;
    pointer-events: auto;
}

#chat .popover .owl-carousel.smiles_panel .owl-nav button.owl-prev {
    float: left;
}

#chat .popover .owl-carousel.smiles_panel .owl-nav button.owl-next {
    float: right;
}

#chat .popover .smiles_panel .smilebtn {
    position: relative;
    z-index: 3;
    cursor: pointer;
    pointer-events: auto;
}

.ce-stickers-tabs-bottom {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 15px 4px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.ce-stickers-tabs-bottom .ce-sticker-tab {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.75;
    background: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.ce-stickers-tabs-bottom .ce-sticker-tab.active,
.ce-stickers-tabs-bottom .ce-sticker-tab:hover {
    opacity: 1;
    border-color: #5181b8;
    background: rgba(81, 129, 184, 0.2);
}

.ce-stickers-tabs-bottom .ce-sticker-tab img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
}

.ce-sticker-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 4px;
    float: left;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.1s;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.ce-sticker-item[data-type="image"] {
    object-fit: contain;
}

.ce-sticker-item:hover,
.ce-lottie-item:hover {
    transform: scale(1.05);
}

.ce-lottie-item {
    display: inline-flex;
    width: 64px;
    height: 64px;
    margin: 4px;
    float: left;
    cursor: pointer;
    overflow: hidden;
    border-radius: 6px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

.ce-lottie-thumb {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 6px;
    pointer-events: none;
}

.ce-lottie-thumb.ce-tab-icon {
    width: 28px;
    height: 28px;
}

.ce-lottie-poster-slot {
    width: 64px;
    height: 64px;
    display: inline-block;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}

.ce-sticker-tab .ce-lottie-poster-slot {
    width: 28px;
    height: 28px;
}

.ce-lottie-preview-active {
    display: inline-block;
    overflow: hidden;
    border-radius: 6px;
    vertical-align: middle;
}

.ce-lottie-item .ce-lottie-preview-active {
    width: 64px;
    height: 64px;
}

.ce-sticker-tab .ce-lottie-preview-active {
    width: 28px;
    height: 28px;
}

.ce-tab-icon {
    width: 28px !important;
    height: 28px !important;
    display: block;
}

/* Размер стикеров в ленте чата (не в окне выбора) */
#chat_messages .g_sticker,
#chat_messages img.g_sticker {
    width: auto;
    max-width: 128px;
    height: auto;
    max-height: 128px;
    vertical-align: middle;
}

#chat_messages .ce-lottie-sticker {
    display: inline-block;
    width: 128px;
    height: 128px;
    max-width: 128px;
    max-height: 128px;
    vertical-align: middle;
    overflow: hidden;
}

.ce-lottie-sticker {
    vertical-align: middle;
}

.ce-lottie-sticker svg,
.ce-lottie-preview-active svg,
.ce-lottie-poster-slot svg,
.ce-lottie-item svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Голосовое сообщение */
.ce-voice-msg {
    --ce-voice-bg: rgba(77, 134, 209, 0.14);
    --ce-voice-accent: #4d86d1;
    --ce-voice-icon: #ffffff;
    --ce-voice-bar-dim: rgba(77, 134, 209, 0.32);
    --ce-voice-time: #4d86d1;
    --ce-voice-border: rgba(77, 134, 209, 0.22);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    width: 260px;
    max-width: 100%;
    min-height: 50px;
    padding: 8px 12px 6px 8px;
    border-radius: 12px;
    background: var(--ce-voice-bg);
    border: 1px solid var(--ce-voice-border);
    vertical-align: middle;
}

#ochat #chat .ce-voice-msg,
#chat.playhard .ce-voice-msg {
    --ce-voice-bg: rgba(255, 255, 255, 0.14);
    --ce-voice-accent: #0c66ff;
    --ce-voice-icon: #ffffff;
    --ce-voice-bar-dim: rgba(255, 255, 255, 0.28);
    --ce-voice-time: rgba(255, 255, 255, 0.78);
    --ce-voice-border: rgba(255, 255, 255, 0.08);
}

#ochat #chat #chat_messages .message .text .ce-voice-msg {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.06);
}

.ce-voice-msg-audio {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.ce-voice-msg-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ce-voice-accent);
    color: var(--ce-voice-icon);
    cursor: pointer;
    transition: transform 0.1s, filter 0.15s;
}

.ce-voice-msg-btn:hover {
    filter: brightness(1.06);
}

.ce-voice-msg-btn:active {
    transform: scale(0.96);
}

.ce-voice-msg-icon {
    display: block;
    pointer-events: none;
}

.ce-voice-msg-icon-play {
    margin-left: 2px;
}

.ce-voice-msg.playing .ce-voice-msg-icon-play {
    display: none;
}

.ce-voice-msg:not(.playing) .ce-voice-msg-icon-pause {
    display: none;
}

.ce-voice-msg-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 2px;
}

.ce-voice-msg-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 24px;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.ce-voice-msg-bar {
    flex: 1 1 0;
    min-width: 2px;
    max-width: 4px;
    border-radius: 2px;
    background: var(--ce-voice-bar-dim);
    align-self: center;
    transition: background 0.12s ease;
}

.ce-voice-msg-bar.is-played {
    background: var(--ce-voice-accent);
}

.ce-voice-msg-time {
    font-size: 12px;
    line-height: 1.1;
    color: var(--ce-voice-time);
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.ce-voice-msg.ce-voice-msg-pending .ce-voice-msg-time {
    opacity: 0.65;
}

.ce-voice-msg.ce-voice-msg-pending .ce-voice-msg-bar {
    opacity: 0.5;
}

.smile_input {
    position: relative;
}

#chat .input-group .smile_input .ce-voice-wrap {
    position: absolute;
    z-index: 2;
}

#chat .input-group .smile_input #smile_btn {
    z-index: 2;
}

/* standart */
#chat .input-group .smile_input .ce-voice-btn {
    color: #4d86d1;
}

#ochat #chat .input-group .smile_input .ce-voice-btn,
#chat.playhard .input-group .smile_input .ce-voice-btn {
    color: #0c66ff;
}

#ochat #chat .input-group .smile_input .ce-voice-rec-time,
#chat .input-group .smile_input .ce-voice-rec-time {
    color: #dc3545;
}

#ochat #chat .input-group .smile_input .ce-voice-rec-bar {
    background: #0c66ff;
}

/* playhard / тёмный чат */
#ochat #chat .input-group .smile_input #smile_btn::after,
#chat.playhard .input-group .smile_input #smile_btn::after {
    color: #ffffff;
}
