.mcPlayer {
    margin: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 18px;
    background: var(--bg-white-panel, #fff);
    border: 1px solid var(--border-light, #ddd);
    min-width: 280px;
    max-width: 440px;
    color: var(--text-primary, #333);
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 1px 2px var(--shadow-color, rgba(0,0,0,.08));
    vertical-align: middle;
}

.mcPlayer--video {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    max-width: 520px;
    border-radius: 12px;
}

.mcPlayer__el { display: none; }

.mcPlayer--video > .mcPlayer__el {
    display: block;
    width: 100%;
    max-height: 400px;
    background: #000;
}

.mcPlayer--video .mcPlayer__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-white-panel, #fff);
    border-top: 1px solid var(--border-light, #ddd);
}

.mcPlayer__btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-primary, #333) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    flex: 0 0 auto;
    transition: background-color .15s ease;
    text-shadow: none !important;
}

.mcPlayer__btn:hover {
    background: var(--badge-color, #ff8839);
    opacity: .8;
    outline: none;
}

.mcPlayer__btn i { font-size: 15px; line-height: 1; margin-left: 5px; }
.mcPlayer__btn i:hover { cursor: pointer; }

.mcPlayer__play { background: var(--badge-color, #ff8839); color: #fff !important; }
.mcPlayer__play:hover { background: var(--badge-color, #ff8839); opacity: .9; }
.mcPlayer__play i { font-size: 14px; margin-left: 6px; }

.mcPlayer__track {
    flex: 1 1 auto;
    height: 6px;
    background: var(--scrollbar-track, rgba(0,0,0,.08));
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    min-width: 24px;
}

.mcPlayer__fill {
    height: 100%;
    background: var(--badge-color, #ff8839);
    border-radius: 3px;
    width: 0;
    transition: width .12s linear;
    pointer-events: none;
}

.mcPlayer__time {
    color: var(--text-secondary, #777);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    min-width: 78px;
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

.mcPlayer__speed {
    width: auto;
    min-width: 34px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
}

.mcPlayer__volumeWrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.mcPlayer__volumePanel {
    position: absolute;
    bottom: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 88px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: var(--bg-white-panel, #fff);
    padding: 8px 0;
    border-radius: 6px;
    box-shadow: 0 2px 6px var(--shadow-color, rgba(0,0,0,.2));
}

.mcPlayer__volumeWrap--bottom .mcPlayer__volumePanel {
    top: calc(100% - 1px);
    bottom: auto;
}

.mcPlayer__volumeWrap--left .mcPlayer__volumePanel,
.mcPlayer__volumeWrap--right .mcPlayer__volumePanel {
    top: 50%;
    bottom: auto;
    width: 88px;
    height: 28px;
    padding: 0 8px;
    transform: translateY(-50%);
}

.mcPlayer__volumeWrap--left .mcPlayer__volumePanel {
    left: auto;
    right: calc(100% - 1px);
}

.mcPlayer__volumeWrap--right .mcPlayer__volumePanel {
    left: calc(100% - 1px);
}

.mcPlayer--volume-bottom.mcPlayer--video,
.mcPlayer--volume-left.mcPlayer--video,
.mcPlayer--volume-right.mcPlayer--video {
    overflow: visible;
}

.mcPlayer__volumeSlider {
    width: 72px;
    height: 18px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transform: rotate(-90deg);
    transform-origin: center;
}

.mcPlayer__volumeWrap--left .mcPlayer__volumeSlider,
.mcPlayer__volumeWrap--right .mcPlayer__volumeSlider {
    transform: none;
}

.mcPlayer__volumeWrap:hover .mcPlayer__volumePanel,
.mcPlayer__volumeWrap:focus-within .mcPlayer__volumePanel,
.mcPlayer__volumeWrap[data-open="1"] .mcPlayer__volumePanel {
    display: flex;
}

.mcPlayer__volumeSlider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border-light, #ddd);
}

.mcPlayer__volumeSlider::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border-light, #ddd);
}

.mcPlayer__volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--upload-progress, #ff8839);
    margin-top: -5px;
    cursor: pointer;
}

.mcPlayer__volumeSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: var(--upload-progress, #ff8839);
    cursor: pointer;
}

.mcPlayer__flag {
    color: var(--text-secondary, #777);
    margin-left: 2px;
    font-size: 14px;
}

.mcPlayer__flag[hidden] { display: none; }

.mcPlayer[data-state-playing="1"] .mcPlayer__play { box-shadow: 0 0 0 3px rgba(255, 136, 57, .2); }

.mcPlayer--compact {
    display: flex;
    margin: 4px 0;
    gap: 6px;
    padding: 4px 6px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
}

.mcPlayer--compact.mcPlayer--video {
    padding: 4px 6px;
}

.mcPlayer--compact.mcPlayer--video > .mcPlayer__el {
    display: none;
}

.mcPlayer--compact.mcPlayer--video .mcPlayer__bar {
    padding: 0;
    border-top: none;
    background: transparent;
    min-width: 0;
}

.mcPlayer--compact .mcPlayer__btn {
    width: 26px;
    height: 26px;
}

.mcPlayer--compact .mcPlayer__track {
    min-width: 36px;
}

.mcPlayer--compact .mcPlayer__time {
    min-width: 66px;
    font-size: 10px;
}

.mcAudioMessageModal .webix_win_body,
.mcAudioMessageModal .webix_win_content {
    overflow: visible;
}

.mcAudioMessageModal audio {
    width: 100%;
}

body.dark .mcPlayer {
    background: var(--bg-white-panel);
    border-color: var(--border-light);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

body.dark .mcPlayer--video .mcPlayer__bar {
    background: var(--bg-white-panel);
    border-top-color: var(--border-light);
}

body.dark .mcPlayer--compact.mcPlayer--video .mcPlayer__bar {
    background: transparent;
}

body.dark .mcPlayer__btn {
    color: var(--text-primary) !important;
}

body.dark .mcPlayer__btn:hover {
    background: var(--badge-color);
    opacity: .8;
}

body.dark .mcPlayer__track {
    background: var(--scrollbar-track);
}

body.dark .mcPlayer__time,
body.dark .mcPlayer__flag {
    color: var(--text-secondary);
}

body.dark .mcPlayer__volumePanel {
    background: var(--bg-white-panel);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}

body.dark .mcPlayer__volumeSlider::-webkit-slider-runnable-track {
    background: #9fb2c8;
}

body.dark .mcPlayer__volumeSlider::-moz-range-track {
    background: #9fb2c8;
}

body.dark .mcPlayer__volumeSlider::-webkit-slider-thumb {
    background: #dbeafe;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}

body.dark .mcPlayer__volumeSlider::-moz-range-thumb {
    background: #dbeafe;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}
