.participants-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 8px;
    border: 1px solid #ffffff12;
    border-radius: 14px;
    background: #1f202a;
}

.participants-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3px 6px;
    color: #e4e5eb;
    font-size: 12px;
}

.participants-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #444859;
    border-radius: 6px;
    background: #343746;
    color: #bfc2cf;
    cursor: pointer;
}

.participants-toggle:hover,
.participants-toggle:focus-visible {
    background: #45495b;
    color: #fff;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 4px;
    border-radius: 9px;
    color: #e8e9ee;
}

.participant-item:hover {
    background: #2c2f3b;
}

.participant-profile {
    display: flex;
    flex: 1;
    align-self: stretch;
    align-items: center;
    min-width: 0;
    gap: 9px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.participant-profile:focus-visible {
    outline: 2px solid #a9a4ff;
    outline-offset: 3px;
}

.participant-profile:disabled {
    cursor: default;
}

.participants-collapsed .participants-panel {
    padding: 6px 3px;
}

.participants-collapsed .participants-header {
    justify-content: center;
    padding: 0 0 6px;
}

.participants-collapsed .participants-header strong,
.participants-collapsed .participant-details,
.participants-collapsed .participant-controls:not([popover], .is-controls-popover) {
    display: none;
}

.participants-collapsed .participants-list {
    display: flex;
    max-height: none;
}

.participants-collapsed .participant-item {
    justify-content: center;
    padding: 3px;
}

.participants-collapsed .participant-profile {
    justify-content: center;
    min-height: 34px;
}

.participant-controls[popover]:not(:popover-open) {
    display: none;
}

.participant-controls:is(:popover-open, .is-controls-popover) {
    position: fixed;
    z-index: 6;
    inset: var(--participant-controls-top) auto auto var(--participant-controls-left);
    margin: 0;
    padding: 5px;
    transform: translateY(-50%);
    border: 1px solid #444859;
    border-radius: 9px;
    background: #2c2f3b;
    box-shadow: 0 6px 20px #10111980;
}

.participant-controls:is(:popover-open, .is-controls-popover) .participant-action {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.participant-item.is-speaking {
    box-shadow: inset 0 0 0 1px #4ed29a;
}

.participant-item.is-speaking .participant-details strong {
    color: #71e6ae;
}

.participant-item.is-speaking .microphone-action,
.participant-item.is-speaking .remote-audio-action {
    box-shadow: 0 0 0 1px #4ed29a;
}

.participant-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #665bef;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.participant-details {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.participant-details strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-details small {
    color: #8e92a1;
    font-size: 10px;
}

.participant-microphone {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
}

.participant-microphone.muted {
    color: #ec7186;
}

.participant-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.participant-action {
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #343746;
    color: #aeb1bd;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

.participant-microphone img,
.microphone-action img,
.remote-audio-action img {
    width: 18px;
    height: 23px;
    margin: auto;
    object-fit: contain;
}

.participant-action:hover {
    background: #45495b;
    color: #fff;
}

.participant-action:disabled {
    cursor: not-allowed;
    opacity: .38;
}

.microphone-action {
    background: transparent;
    border-radius: 50%;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.screen-share-action {
    color: #aeb1c2;
    font-size: 13px;
}

.screen-share-action.active,
.camera-action.active {
    background: #5d55ee;
    color: #fff;
}

.remote-audio-action {
    background: transparent;
    border-radius: 50%;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.kick-action {
    background: transparent;
    color: #ec7186;
}

.kick-action:hover,
.kick-action:focus-visible {
    background: rgba(236, 113, 134, 0.16);
    color: #ff9aaa;
}

.microphone-action:hover,
.remote-audio-action:hover,
.remote-audio-action:focus-visible,
.microphone-action:focus-visible {
    background: #343746;
}

.call-main {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.call-tabs {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid #ffffff12;
    border-radius: 10px;
    background: #1f202a;
}

.call-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 7px;
    padding: 8px 12px;
    background: transparent;
    color: #9296a6;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.call-tab span:first-child {
    color: #aeb1bd;
    font-size: 15px;
}
.call-tab.active {
    background: #343746;
    color: #fff;
}
.call-tab:hover:not(:disabled) {
    color: #fff;
}
.call-tab:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}
.call-tab-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #737789;
    opacity: 0.5;
}
.call-tab.has-transmission .call-tab-status {
    background: #4ed29a;
    opacity: 1;
    animation: connection-pulse 1.8s ease-out infinite;
}

.call-main:not(.transmission-open) .video-grid {
    display: none;
}
.call-main.transmission-open .chat-panel {
    display: none;
}
.call-main.transmission-open .video-grid {
    display: grid;
    flex: 1 1 auto;
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    align-content: stretch;
    grid-auto-rows: minmax(140px, 1fr);
}

.call-main.transmission-open .video-frame {
    height: 100%;
    aspect-ratio: auto;
    min-height: 0;
}

.call-main.transmission-open .video-frame video {
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.video-maximized .call-tabs,
.video-maximized #screenAudioStatus {
    display: none;
}

.video-maximized :is(#enableRoomAudio, #cameraStatus):not([hidden]) {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: calc(var(--room-content-inset) + var(--room-sidebar-width) + 10px);
    max-width: calc(100% - var(--room-content-inset) - var(--room-sidebar-width) - 70px);
    padding: 7px 9px;
    border-radius: 7px;
    background: #1d1f2bea;
}

.video-maximized .video-grid.has-focused-video {
    --stage-thumbnail-width: 72px;
    position: absolute;
    inset: 0;
    height: auto;
    grid-template-columns: var(--stage-thumbnail-width) minmax(0, 1fr) var(--stage-thumbnail-width);
    grid-auto-flow: row dense;
    grid-auto-rows: max-content;
    align-content: center;
    gap: 8px;
    padding: 54px 12px 58px calc(var(--room-content-inset) + var(--room-sidebar-width) + 8px);
    overflow: hidden;
    background: #11121a;
}

.video-maximized .video-grid.stage-thumbnails-top {
    align-content: start;
}

.video-maximized .video-grid .video-frame.is-focused {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 0;
}

.video-maximized .video-frame.is-focused video {
    background: #11121a;
}

.video-maximized .video-grid .video-frame:not(.is-focused) {
    z-index: 1;
    grid-column: 3;
    height: auto;
    aspect-ratio: 16 / 9;
    border-color: #ffffff38;
    border-radius: 9px;
}

.video-maximized .video-grid .video-frame.stage-left:not(.is-focused) {
    grid-column: 1;
}

.video-maximized .video-frame:not(.is-focused) video {
    object-fit: cover;
}

.video-maximized .video-frame:not(.is-focused) :is(.video-frame-footer, .video-flip-button),
.video-maximized .video-frame.is-focused .video-label {
    display: none;
}

.video-maximized .video-frame.is-focused .video-flip-button {
    left: calc(var(--room-content-inset) + var(--room-sidebar-width) + 8px);
}

.call-status-hidden {
    display: none;
}

.chat-panel {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ffffff12;
    border-radius: 14px;
    background: #2c2f3b;
}

.chat-header {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #ffffff12;
}

.chat-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.chat-channel-icon {
    color: #aeb1bd;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.chat-channel-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-toggle strong {
    color: #f1f1f4;
    font-size: 13px;
}
.chat-toggle small {
    color: #9296a6;
    font-size: 11px;
}
.chat-chevron {
    margin-left: auto;
    color: #9296a6;
    font-size: 18px;
    transition: transform 0.16s ease;
}

.chat-toggle:hover {
    background: #ffffff08;
}
.chat-toggle[aria-expanded='true'] .chat-chevron {
    transform: rotate(180deg);
}

.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 18px;
}

.system-message {
    align-self: center;
    color: #8e92a1;
    font-size: 11px;
}

.chat-day-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 4px;
    color: #8e92a1;
    font-size: 10px;
}

.chat-day-separator::before,
.chat-day-separator::after {
    flex: 1;
    height: 1px;
    background: #ffffff12;
    content: '';
}

.chat-message {
    display: flex;
    align-self: flex-start;
    flex-direction: column;
    gap: 3px;
    max-width: 80%;
    padding: 8px 11px;
    border-radius: 9px;
    background: #353846;
}

.chat-message.own-message {
    align-self: flex-end;
    background: #5d55ee;
}

.chat-message strong {
    color: #aaa5ff;
    font-size: 11px;
}
.chat-message span {
    color: #e8e9ee;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}
.chat-message.own-message strong,
.chat-message.own-message span {
    color: #fff;
}

.chat-message-time {
    align-self: flex-end;
    color: #9296a6;
    font-size: 10px;
    line-height: 1;
}

.chat-message.own-message .chat-message-time {
    color: #dedcff;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #ffffff12;
}

.chat-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 8px;
    outline: 0;
    padding: 11px 12px;
    background: #20212b;
    color: #f1f1f4;
    font-size: 12px;
}

.chat-form button {
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
