@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   Discord Theme Tokens + Shared Base
============================================================ */
:root {
    color-scheme: dark;

    --discord-bg-0: #05070c;
    --discord-bg-1: #0a0d14;
    --discord-bg-2: #0f131d;
    --discord-bg-3: #151b27;
    --discord-bg-4: #1b2230;

    --discord-surface-0: rgba(14, 18, 27, 0.92);
    --discord-surface-1: rgba(22, 28, 40, 0.92);
    --discord-surface-2: rgba(28, 35, 49, 0.92);

    --discord-border-soft: rgba(225, 233, 255, 0.1);
    --discord-border-strong: rgba(225, 233, 255, 0.2);

    --discord-text-main: #eef2ff;
    --discord-text-soft: #b9c1da;
    --discord-text-faint: #8e97b3;

    --discord-accent: #5a6ff0;
    --discord-accent-hover: #6d7ff2;
    --discord-success: #3fb97e;
    --discord-warning: #f7be5c;
    --discord-danger: #e45464;

    --discord-shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.34);
    --discord-shadow-hard: 0 20px 50px rgba(0, 0, 0, 0.5);

    /* variables consumed by existing client.css */
    --navbar-bg: rgba(14, 18, 27, 0.84);
    --body-bg:
        radial-gradient(circle at 15% -10%, rgba(90, 111, 240, 0.18), transparent 34%),
        radial-gradient(circle at 84% 0%, rgba(58, 188, 125, 0.1), transparent 26%),
        linear-gradient(180deg, #0d111a 0%, #080b12 100%);
    --border: 1px solid var(--discord-border-soft);
    --dd-color: var(--discord-text-main);
    --msger-bg: linear-gradient(180deg, #171d2a 0%, #0f141f 100%);
    --msger-private-bg: linear-gradient(180deg, #161d29 0%, #0d121d 100%);
    --wb-bg: linear-gradient(180deg, #171d2a 0%, #0f141f 100%);
    --select-bg: #141a25;
    --box-shadow: var(--discord-shadow-soft);
    --left-msg-bg: rgba(46, 56, 75, 0.62);
    --right-msg-bg: linear-gradient(135deg, #5567e8, #4959d8);
    --private-msg-bg: rgba(86, 103, 232, 0.5);
    --hover-color: #f4f7ff;
    --btn-bar-bg-color: #dce3ff;
    --btn-bar-color: #0b1020;
    --btns-bg-color: #202838;
    --tab-btn-active: rgba(90, 111, 240, 0.26);
    --elem-border-color: 1px solid var(--discord-border-soft);
    --volume-up: 0px 8px 16px 0px rgba(145, 255, 192, 0.7);
}

body.discord-embedded-layout #myAvatarControls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

body.discord-embedded-layout #myAvatarUploadBtn,
body.discord-embedded-layout #myAvatarRemoveBtn,
body.discord-embedded-layout #myAccountLogoutBtn {
    border-radius: 10px !important;
}

html,
body {
    background: var(--body-bg) !important;
    color: var(--discord-text-main);
}

body,
input,
textarea,
select,
button,
.form-input,
.search-input,
.cr-input,
.msger-input,
.tabcontent,
#mySettings,
#loadingDiv,
#loginForm,
#joinRoomForm,
.container,
.cta-inner,
.cr-card,
.room-card {
    font-family: 'Space Grotesk', 'Manrope', 'Montserrat', sans-serif !important;
}

button {
    border: 0;
    box-shadow: none;
}

.fa,
.fa-solid,
.fa-regular,
.fas,
.far {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
}

.fab,
.fa-brands {
    font-family: 'Font Awesome 6 Brands' !important;
    font-weight: 400 !important;
}

a {
    color: #cdd5ff;
}

a:hover {
    color: #ffffff;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 22%, rgba(84, 103, 224, 0.12), transparent 30%),
        radial-gradient(circle at 90% -5%, rgba(61, 181, 125, 0.08), transparent 20%);
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

button,
.button,
.search-btn,
.refresh-btn,
.join-btn,
.cr-copy,
.cr-input-action,
#activeRoomsBtn,
.buttons {
    border-radius: 12px !important;
    border: 1px solid var(--discord-border-soft) !important;
    background: linear-gradient(135deg, rgba(90, 111, 240, 0.92), rgba(76, 91, 219, 0.92)) !important;
    color: #f8faff !important;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

button:hover,
.button:hover,
.search-btn:hover,
.refresh-btn:hover,
.join-btn:hover,
.cr-copy:hover,
.cr-input-action:hover,
#activeRoomsBtn:hover,
.buttons:hover {
    background: linear-gradient(135deg, rgba(107, 127, 246, 0.96), rgba(90, 106, 238, 0.96)) !important;
    border-color: var(--discord-border-strong) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(86, 102, 220, 0.34) !important;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(90, 111, 240, 0.62) !important;
    outline-offset: 2px;
}

input,
select,
textarea,
.form-input,
.search-input,
.cr-input,
#mySettings select,
.init-user select,
.swal2-input,
.swal2-select {
    border: 1px solid var(--discord-border-soft) !important;
    border-radius: 12px !important;
    background: rgba(16, 21, 31, 0.92) !important;
    color: var(--discord-text-main) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input::placeholder,
textarea::placeholder,
.form-input::placeholder,
.search-input::placeholder,
.cr-input::placeholder {
    color: var(--discord-text-faint) !important;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.search-input:focus,
.cr-input:focus,
#mySettings select:focus,
.init-user select:focus {
    border-color: rgba(90, 111, 240, 0.7) !important;
    box-shadow:
        0 0 0 3px rgba(90, 111, 240, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.container,
.cta-inner,
#loginForm,
#joinRoomForm,
.cr-card,
.room-card,
#loadingDiv,
#aboutDiv,
#mySettings,
#whiteboard,
#sendFileDiv,
#receiveFileDiv,
#videoUrlCont,
#videoAudioUrlCont,
#participantsDiv,
#captionDraggable,
.swal2-popup {
    background: linear-gradient(180deg, rgba(22, 28, 40, 0.95) 0%, rgba(12, 16, 24, 0.98) 100%) !important;
    border: 1px solid var(--discord-border-soft) !important;
    box-shadow: var(--discord-shadow-soft) !important;
    color: var(--discord-text-main) !important;
    backdrop-filter: blur(12px);
}

.site-header,
.site-footer,
.navbar,
.whiteboard-header,
.msger-header,
.msger-private-header,
#mySettingsHeader,
#videoUrlHeader,
#videoAudioUrlHeader,
#captionHeader {
    background: rgba(9, 12, 20, 0.9) !important;
    border-color: var(--discord-border-soft) !important;
}

.site-header,
.site-footer,
.cta-inner,
.container,
.cr-card,
.room-card,
#loginForm,
#joinRoomForm {
    border-radius: 16px !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.hero-title,
.cr-title,
.room-title {
    color: var(--discord-text-main) !important;
}

p,
label,
small,
span,
li,
.empty,
.peer-label,
.cr-hint,
#appDescription,
#newCallRoomDescription,
#qrText,
#myCurrentSessionTime {
    color: var(--discord-text-soft) !important;
}

#leaveRoomBtn,
.fa-phone-slash,
#sendAbortBtn,
#receiveAbortBtn {
    background: linear-gradient(135deg, #e45464, #d64554) !important;
    color: #fff !important;
}

#receiveHideBtn {
    background: rgba(70, 79, 98, 0.75) !important;
}

.swal2-title,
.swal2-html-container,
.swal2-validation-message {
    color: var(--discord-text-main) !important;
}

.swal2-confirm {
    background: var(--discord-accent) !important;
}

.swal2-cancel {
    background: #495063 !important;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0d111a;
}

::-webkit-scrollbar-thumb {
    background: #313a4f;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #46516d;
}

/* ============================================================
   Client Layout - Discord DM Full Width
============================================================ */
body.discord-embedded-layout {
    --discord-topbar-h: 0px;
    --discord-stage-h: clamp(236px, 34vh, 380px);
    --discord-controls-h: clamp(56px, 7vh, 74px);
    --discord-chat-pad-x: clamp(12px, 1.4vw, 24px);

    background: #05070c !important;
    overflow: hidden;
}

body.discord-embedded-layout::before,
body.discord-embedded-layout::after {
    display: none !important;
}

body.discord-embedded-layout #webRTCSeo {
    display: none !important;
}

/* Top bar */
body.discord-embedded-layout #discordAppTopbar {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--discord-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 clamp(12px, 1.5vw, 24px);
    background: rgba(6, 8, 14, 0.98);
    border-bottom: 1px solid var(--discord-border-soft);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 30;
}

body.discord-embedded-layout .discord-app-topbar-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

body.discord-embedded-layout .discord-app-topbar-left i {
    color: var(--discord-text-faint);
    font-size: 0.95rem;
}

body.discord-embedded-layout #discordAppTitle {
    color: var(--discord-text-main);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.discord-embedded-layout .discord-app-topbar-right {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

body.discord-embedded-layout .discord-app-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body.discord-embedded-layout .discord-app-action {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--discord-text-faint);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
}

body.discord-embedded-layout .discord-app-search-wrap {
    min-width: min(340px, 44vw);
    max-width: min(420px, 52vw);
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(10, 13, 20, 0.95);
    border: 1px solid var(--discord-border-soft);
}

body.discord-embedded-layout .discord-app-search-wrap i {
    color: var(--discord-text-faint);
    font-size: 0.75rem;
}

body.discord-embedded-layout #discordAppSearch {
    width: 100%;
    height: 100%;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    color: var(--discord-text-main) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 0.82rem;
}

body.discord-embedded-layout #discordAppSearch:focus {
    box-shadow: none !important;
}

/* Stage area */
body.discord-embedded-layout #videoPinMediaContainer,
body.discord-embedded-layout #videoMediaContainer {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    overflow: hidden !important;
}

body.discord-embedded-layout #videoMediaContainer {
    top: var(--discord-topbar-h) !important;
    height: var(--discord-stage-h) !important;
    padding: clamp(16px, 1.8vw, 26px) clamp(12px, 1.6vw, 24px) 16px !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(47, 62, 135, 0.2), transparent 52%),
        linear-gradient(180deg, #04060a 0%, #070a11 100%) !important;
    align-content: center !important;
    align-items: center !important;
    justify-content: center !important;
    place-content: center !important;
    justify-items: center !important;
    z-index: 3 !important;
}

body.discord-embedded-layout #discordStageResizer {
    position: fixed;
    left: 50%;
    top: calc(var(--discord-topbar-h) + var(--discord-stage-h) - 4px);
    width: clamp(140px, 22vw, 240px);
    height: 8px;
    transform: translateX(-50%);
    border-radius: 999px;
    border: 1px solid rgba(188, 206, 255, 0.28);
    background: linear-gradient(180deg, rgba(93, 113, 244, 0.44), rgba(58, 71, 148, 0.36));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    cursor: ns-resize;
    z-index: 12;
    transition: opacity 140ms ease;
    opacity: 0.85;
}

body.discord-embedded-layout #discordStageResizer:hover {
    opacity: 1;
}

body.discord-embedded-layout.discord-stage-resizing {
    cursor: ns-resize;
    user-select: none;
}

body.discord-embedded-layout #videoPinMediaContainer {
    display: none !important;
}

body.discord-embedded-layout .Camera,
body.discord-embedded-layout .Screen {
    position: relative;
    border-radius: 18px !important;
    border: 1px solid rgba(172, 188, 236, 0.14) !important;
    background: linear-gradient(135deg, #171d2b 0%, #0d111b 100%) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
}

body.discord-embedded-layout .Screen {
    background: linear-gradient(135deg, #0e1321 0%, #06090f 100%) !important;
}

body.discord-embedded-layout .Camera video,
body.discord-embedded-layout .Screen video {
    border-radius: 18px;
}

body.discord-embedded-layout .videoAvatarImage {
    border-radius: 999px !important;
    width: clamp(88px, 8.5vw, 142px) !important;
    height: clamp(88px, 8.5vw, 142px) !important;
    border: 3px solid rgba(220, 228, 255, 0.3);
    box-shadow: 0 0 0 6px rgba(13, 17, 27, 0.65);
}

body.discord-embedded-layout .videoPeerName,
body.discord-embedded-layout .discord-peer-badge {
    position: absolute !important;
    bottom: 12px !important;
    left: 12px !important;
    right: auto !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    background: rgba(7, 10, 17, 0.86) !important;
    border: 1px solid var(--discord-border-soft) !important;
    border-radius: 999px !important;
    color: var(--discord-text-main) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    max-width: calc(100% - 24px);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    z-index: 10 !important;
}

/* Tile context actions */
body.discord-embedded-layout .Camera > .navbar,
body.discord-embedded-layout .Screen > .navbar {
    display: none !important;
    position: absolute !important;
    top: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: calc(100% - 20px);
    padding: 8px 10px !important;
    border-radius: 12px !important;
    border: 1px solid var(--discord-border-soft) !important;
    background: rgba(7, 10, 17, 0.94) !important;
    box-shadow: var(--discord-shadow-hard) !important;
    gap: 6px !important;
    justify-content: center !important;
    z-index: 16 !important;
}

body.discord-embedded-layout .discord-context-menu-open > .navbar.context-menu-visible {
    display: flex !important;
}

body.discord-embedded-layout #discordContextMenu {
    position: fixed;
    min-width: 200px;
    max-width: min(280px, calc(100vw - 16px));
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(191, 205, 242, 0.25);
    background: linear-gradient(180deg, rgba(16, 22, 36, 0.97), rgba(10, 14, 24, 0.97));
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
    z-index: 120;
}

body.discord-embedded-layout #discordContextMenu.hidden {
    display: none !important;
}

body.discord-embedded-layout .discord-context-menu-item {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--discord-text-main);
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0 10px;
    text-align: left;
}

body.discord-embedded-layout .discord-context-menu-item i {
    width: 16px;
    text-align: center;
    color: #b9c5eb;
}

body.discord-embedded-layout .discord-context-menu-item:hover:not(:disabled) {
    background: rgba(88, 109, 236, 0.88);
    color: #fff;
}

body.discord-embedded-layout .discord-context-menu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.discord-embedded-layout .discord-context-menu-separator {
    height: 1px;
    margin: 6px 2px;
    background: rgba(188, 204, 242, 0.16);
}

body.discord-embedded-layout .discord-context-menu-range {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 2px;
}

body.discord-embedded-layout .discord-context-menu-range-label {
    display: block;
    font-size: 0.75rem;
    color: #b9c5eb;
    margin-bottom: 6px;
}

body.discord-embedded-layout .discord-context-menu-range-row {
    display: grid;
    grid-template-columns: 16px minmax(90px, 1fr) 40px;
    align-items: center;
    gap: 8px;
}

body.discord-embedded-layout .discord-context-menu-range-row i {
    color: #d7e0ff;
    font-size: 0.85rem;
}

body.discord-embedded-layout .discord-context-menu-range-row input[type='range'] {
    width: 100%;
    accent-color: var(--discord-accent);
}

body.discord-embedded-layout .discord-context-menu-range-value {
    font-size: 0.76rem;
    color: #d7e0ff;
    text-align: right;
}

body.discord-embedded-layout .navbar button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    min-height: 34px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 9px !important;
    border: 1px solid rgba(225, 233, 255, 0.14) !important;
    background: rgba(26, 33, 48, 0.95) !important;
    color: var(--discord-text-main) !important;
    font-size: 0.9rem !important;
}

body.discord-embedded-layout .navbar button:hover {
    background: rgba(90, 111, 240, 0.9) !important;
    transform: translateY(-1px);
}

body.discord-embedded-layout .navbar button.media-muted {
    color: var(--discord-danger) !important;
    opacity: 0.75;
}

body.discord-embedded-layout .navbar .screen-audio-slider {
    width: 96px !important;
    height: 8px !important;
    margin: 0 4px !important;
    cursor: pointer;
    accent-color: var(--discord-accent);
}

body.discord-embedded-layout .navbar button.screen-audio-none {
    color: var(--discord-text-faint) !important;
    opacity: 0.55;
}

/* Stage controls in 2 levels */
body.discord-embedded-layout #bottomButtons {
    position: fixed !important;
    top: calc(var(--discord-topbar-h) + var(--discord-stage-h) + 8px) !important;
    left: 50% !important;
    bottom: auto !important;
    width: auto !important;
    min-height: var(--discord-controls-h) !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 6px 4px !important;
    border-radius: 18px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: 18 !important;
    overflow: visible !important;
    animation: pixelchat-controls-fade-in 180ms ease-out;
}

body.discord-embedded-layout #bottomButtons::before {
    display: none !important;
}

body.discord-embedded-layout #bottomButtons .controls-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(225, 233, 255, 0.15);
    background: linear-gradient(180deg, rgba(19, 23, 32, 0.98) 0%, rgba(12, 16, 24, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.discord-embedded-layout #bottomButtons .split-btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0;
    position: relative;
}

body.discord-embedded-layout #bottomButtons button,
body.discord-embedded-layout #bottomButtons .device-dropdown-toggle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 9px !important;
    border: none !important;
    background: transparent !important;
    color: var(--discord-text-main) !important;
    box-shadow: none !important;
    font-size: 0.98rem !important;
    padding: 0 !important;
    position: relative;
    transition:
        transform 120ms ease,
        background-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

body.discord-embedded-layout #bottomButtons .device-dropdown-toggle {
    width: 28px !important;
    min-width: 28px !important;
    border-radius: 0 9px 9px 0 !important;
}

body.discord-embedded-layout #bottomButtons .split-btn > button:first-child {
    border-radius: 9px 0 0 9px !important;
}

body.discord-embedded-layout #bottomButtons button:hover,
body.discord-embedded-layout #bottomButtons button:focus-visible,
body.discord-embedded-layout #bottomButtons .device-dropdown-toggle:hover {
    transform: translateY(-1px);
    background: rgba(76, 87, 106, 0.42) !important;
    box-shadow: inset 0 0 0 1px rgba(225, 233, 255, 0.16) !important;
}

body.discord-embedded-layout #bottomButtons button:active,
body.discord-embedded-layout #bottomButtons .device-dropdown-toggle:active {
    transform: translateY(0);
}

body.discord-embedded-layout #bottomButtons #chatRoomBtn {
    display: none !important;
}

body.discord-embedded-layout #bottomButtons #leaveRoomBtn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
    color: #ffeef1 !important;
    border: 1px solid rgba(229, 122, 132, 0.48) !important;
    background-color: #be4f5c !important;
    background-image: linear-gradient(135deg, #c45a67, #b24653) !important;
    box-shadow: 0 8px 18px rgba(178, 70, 83, 0.28) !important;
}

body.discord-embedded-layout #bottomButtons #leaveRoomBtn:hover,
body.discord-embedded-layout #bottomButtons #leaveRoomBtn:focus-visible {
    background-color: #c35b68 !important;
    background-image: linear-gradient(135deg, #cd6672, #bc4d5a) !important;
    box-shadow: 0 10px 20px rgba(188, 77, 90, 0.36) !important;
}

body.discord-embedded-layout #bottomButtons #leaveRoomBtn:active {
    background-color: #aa3f4d !important;
    background-image: linear-gradient(135deg, #b64b58, #a93d4a) !important;
}

body.discord-embedded-layout #audioSplit,
body.discord-embedded-layout #videoSplit {
    position: relative;
}

body.discord-embedded-layout #videoSplit {
    margin-left: 4px;
}

body.discord-embedded-layout #audioSplit::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: rgba(225, 233, 255, 0.14);
}

@keyframes pixelchat-controls-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, 8px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

body.discord-embedded-layout #participantsCountBadge {
    background: var(--discord-danger) !important;
    color: #fff !important;
    border: 2px solid #090d14;
    min-width: 17px;
    height: 17px;
}

body.discord-embedded-layout #bottomButtons #audioDropdown,
body.discord-embedded-layout #bottomButtons #videoDropdown,
body.discord-embedded-layout #bottomButtons #settingsExtraDropdown {
    position: relative !important;
}

body.discord-embedded-layout #bottomButtons #audioDropdown.hidden,
body.discord-embedded-layout #bottomButtons #videoDropdown.hidden {
    display: inline-flex !important;
}

body.discord-embedded-layout #bottomButtons #audioToggle,
body.discord-embedded-layout #bottomButtons #videoToggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.discord-embedded-layout #bottomButtons #audioMenu,
body.discord-embedded-layout #bottomButtons #videoMenu,
body.discord-embedded-layout #bottomButtons #settingsExtraMenu {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    bottom: calc(100% + 10px) !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    min-width: 250px !important;
    max-width: min(360px, 78vw) !important;
    padding: 8px !important;
    border-radius: 14px !important;
    border: 1px solid var(--discord-border-soft) !important;
    background: rgba(10, 13, 21, 0.98) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55) !important;
    z-index: 34 !important;
}

body.discord-embedded-layout #bottomButtons #audioMenu button,
body.discord-embedded-layout #bottomButtons #videoMenu button,
body.discord-embedded-layout #bottomButtons #settingsExtraMenu button,
body.discord-embedded-layout .dropdown-menu-custom button,
body.discord-embedded-layout .whiteboard-dropdown-menu button {
    width: 100% !important;
    min-height: 40px !important;
    height: auto !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    justify-content: flex-start !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--discord-text-main) !important;
    font-size: 0.86rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.discord-embedded-layout #bottomButtons #audioMenu button:hover,
body.discord-embedded-layout #bottomButtons #videoMenu button:hover,
body.discord-embedded-layout #bottomButtons #settingsExtraMenu button:hover,
body.discord-embedded-layout .dropdown-menu-custom button:hover,
body.discord-embedded-layout .whiteboard-dropdown-menu button:hover {
    background: rgba(90, 111, 240, 0.2) !important;
    border-color: rgba(90, 111, 240, 0.28) !important;
    transform: none;
    box-shadow: none !important;
}

body.discord-embedded-layout #bottomButtons #settingsExtraMenu button i,
body.discord-embedded-layout #bottomButtons #audioMenu button i,
body.discord-embedded-layout #bottomButtons #videoMenu button i {
    width: 18px;
    min-width: 18px;
    text-align: center;
    margin-right: 8px;
}

/* Chat timeline area */
body.discord-embedded-layout #msgerDraggable {
    position: fixed !important;
    display: block !important;
    top: calc(var(--discord-topbar-h) + var(--discord-stage-h) + var(--discord-controls-h) + 16px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    border: none !important;
    border-top: 1px solid var(--discord-border-soft) !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    z-index: 12 !important;
}

body.discord-embedded-layout #msger {
    position: relative !important;
    inset: auto !important;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-columns: minmax(0, 1fr);
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(180deg, #0b0f17 0%, #090d14 100%) !important;
    border: none !important;
}

body.discord-embedded-layout #msgerHeader {
    min-height: 46px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px;
    padding: 8px var(--discord-chat-pad-x) !important;
    border-bottom: 1px solid rgba(225, 233, 255, 0.08) !important;
    background: rgba(11, 15, 24, 0.92) !important;
    cursor: default !important;
}

body.discord-embedded-layout #msgerHeader::before {
    display: none !important;
}

body.discord-embedded-layout #msgerHeader .msger-header-title {
    color: var(--discord-text-main) !important;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.discord-embedded-layout #msgerHeader .msger-header-options {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.discord-embedded-layout #msgerHeader .msger-header-options button,
body.discord-embedded-layout #msgerHeader .dropdown-toggle-custom {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0 !important;
    border-radius: 10px !important;
    border: 1px solid var(--discord-border-soft) !important;
    background: rgba(31, 39, 56, 0.9) !important;
    color: var(--discord-text-main) !important;
}

body.discord-embedded-layout #msgerMaxBtn,
body.discord-embedded-layout #msgerMinBtn,
body.discord-embedded-layout #msgerTogglePin,
body.discord-embedded-layout #msgerClose {
    display: none !important;
}

body.discord-embedded-layout #msgerChat {
    background: transparent !important;
    padding: 8px 0 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
}

body.discord-embedded-layout #msgerEmptyNotice {
    display: none !important;
    width: min(520px, 92%);
    margin: 30px auto 10px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(18, 24, 34, 0.64);
    border: 1px solid var(--discord-border-soft);
    pointer-events: none;
}

body.discord-embedded-layout .empty-chat-img {
    width: 82px;
    opacity: 0.5;
}

body.discord-embedded-layout .empty-chat-title {
    color: var(--discord-text-main) !important;
    margin-top: 8px;
}

body.discord-embedded-layout .empty-chat-desc {
    color: var(--discord-text-soft) !important;
    max-width: 520px;
}

body.discord-embedded-layout .msg {
    width: 100%;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px;
    margin: 0 !important;
    padding: 10px var(--discord-chat-pad-x) !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    transition: background-color 0.14s ease;
}

body.discord-embedded-layout .msg:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

body.discord-embedded-layout .msg-img,
body.discord-embedded-layout .peer-img {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #5a6ff0, #4f60db) !important;
    border: 2px solid rgba(219, 228, 255, 0.24) !important;
    box-shadow: none !important;
}

body.discord-embedded-layout .msg-bubble,
body.discord-embedded-layout .private-msg-bubble {
    width: auto !important;
    max-width: min(920px, calc(100vw - 92px));
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.discord-embedded-layout .msg-info {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 10px;
    margin: 0 0 4px !important;
}

body.discord-embedded-layout .msg-info-name {
    color: var(--discord-text-main) !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
}

body.discord-embedded-layout .msg-info-time {
    color: var(--discord-text-faint) !important;
    font-size: 0.74rem !important;
}

body.discord-embedded-layout .msg-text {
    color: #d9e0f7 !important;
    font-size: 0.9rem;
    line-height: 1.5;
    display: block !important;
    background: rgba(19, 25, 36, 0.56);
    border: 1px solid rgba(225, 233, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
}

body.discord-embedded-layout .right-msg .msg-text {
    background: rgba(48, 60, 109, 0.46);
    border-color: rgba(107, 127, 246, 0.26);
}

body.discord-embedded-layout .right-msg {
    justify-content: flex-end !important;
    flex-direction: row-reverse !important;
    padding-left: var(--discord-chat-pad-x) !important;
    padding-right: var(--discord-chat-pad-x) !important;
}

body.discord-embedded-layout .right-msg .msg-img {
    margin-left: 10px;
    margin-right: 0;
}

body.discord-embedded-layout .right-msg .msg-bubble,
body.discord-embedded-layout .right-msg .private-msg-bubble {
    max-width: min(920px, calc(100vw - 128px));
}

body.discord-embedded-layout .msg-text hr {
    border: 0;
    border-top: 1px solid rgba(225, 233, 255, 0.08);
    margin: 8px 0;
}

body.discord-embedded-layout .msg-text button {
    display: none !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    margin-right: 6px;
    border-radius: 9px !important;
    border: 1px solid rgba(225, 233, 255, 0.12) !important;
    background: rgba(43, 53, 73, 0.92) !important;
    color: var(--discord-text-main) !important;
    padding: 0 !important;
}

body.discord-embedded-layout .msg:hover .msg-text button {
    display: inline-flex !important;
}

body.discord-embedded-layout .msg-text button:hover {
    background: rgba(90, 111, 240, 0.86) !important;
    transform: none;
}

body.discord-embedded-layout .msg-text code {
    background: rgba(0, 0, 0, 0.35) !important;
    color: #f5f8ff !important;
    border-radius: 5px !important;
    padding: 2px 5px !important;
    font-family: 'JetBrains Mono', 'Consolas', monospace !important;
}

body.discord-embedded-layout .msg-text pre {
    background: rgba(0, 0, 0, 0.36) !important;
    color: #f3f6ff !important;
    border-left: 3px solid var(--discord-accent) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
}

body.discord-embedded-layout .msg-text blockquote {
    color: var(--discord-text-soft) !important;
    border-left: 3px solid var(--discord-accent) !important;
    margin-left: 0 !important;
    padding-left: 10px !important;
}

body.discord-embedded-layout .message-reactions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 8px !important;
}

body.discord-embedded-layout .reaction-bubble {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
    padding: 3px 8px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(102, 121, 235, 0.36) !important;
    background: rgba(90, 111, 240, 0.18) !important;
    color: var(--discord-text-main) !important;
}

body.discord-embedded-layout .reaction-bubble.owned {
    border-color: rgba(122, 140, 255, 0.62) !important;
    background: rgba(107, 127, 246, 0.28) !important;
}

body.discord-embedded-layout .reaction-count {
    color: var(--discord-text-soft) !important;
}

body.discord-embedded-layout .msger-inputarea,
body.discord-embedded-layout .msger-input-buttons {
    background: transparent !important;
}

body.discord-embedded-layout .msger-inputarea {
    padding: 0 var(--discord-chat-pad-x) 8px !important;
}

body.discord-embedded-layout .msger-input {
    min-height: 44px !important;
    height: 44px !important;
    width: 100% !important;
    border-radius: 12px !important;
    border: 1px solid rgba(225, 233, 255, 0.12) !important;
    background: rgba(15, 20, 31, 0.96) !important;
    color: var(--discord-text-main) !important;
    font-size: 0.9rem !important;
    padding: 11px 14px !important;
    box-shadow: none !important;
}

body.discord-embedded-layout .msger-input:focus {
    border-color: rgba(90, 111, 240, 0.68) !important;
    box-shadow: 0 0 0 3px rgba(90, 111, 240, 0.14) !important;
}

body.discord-embedded-layout .msger-input-buttons {
    padding: 0 var(--discord-chat-pad-x) 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

body.discord-embedded-layout .msger-input-buttons button {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(225, 233, 255, 0.12) !important;
    background: rgba(30, 38, 54, 0.94) !important;
    color: var(--discord-text-main) !important;
    padding: 0 !important;
}

body.discord-embedded-layout .msger-input-buttons button:hover {
    background: rgba(90, 111, 240, 0.92) !important;
    transform: translateY(-1px);
}

body.discord-embedded-layout #msgerSendBtn {
    margin-left: auto !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 11px !important;
    background: linear-gradient(135deg, #5a6ff0, #4a5bd5) !important;
    color: #fff !important;
}

/* Participants panel */
body.discord-embedded-layout #msgerCP {
    position: fixed !important;
    top: calc(var(--discord-topbar-h) + 8px) !important;
    right: 12px !important;
    left: auto !important;
    width: min(360px, calc(100vw - 24px)) !important;
    height: min(640px, calc(100vh - (var(--discord-topbar-h) + 16px))) !important;
    border-radius: 16px !important;
    border: 1px solid var(--discord-border-soft) !important;
    background: linear-gradient(180deg, rgba(14, 19, 28, 0.97) 0%, rgba(10, 14, 21, 0.98) 100%) !important;
    box-shadow: var(--discord-shadow-hard) !important;
    z-index: 28 !important;
}

body.discord-embedded-layout #msgerCPSec {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
}

body.discord-embedded-layout #msgerCPHeader {
    min-height: 50px !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid rgba(225, 233, 255, 0.08) !important;
    background: rgba(8, 12, 18, 0.92) !important;
    cursor: default !important;
}

body.discord-embedded-layout #msgerCPChat {
    padding: 0 !important;
    background: transparent !important;
}

body.discord-embedded-layout .search-container {
    padding: 10px 12px 0;
}

body.discord-embedded-layout #searchPeerBarName {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 10px !important;
    background: rgba(17, 22, 32, 0.95) !important;
    border: 1px solid rgba(225, 233, 255, 0.1) !important;
    color: var(--discord-text-main) !important;
}

body.discord-embedded-layout #msgerCPList {
    padding: 8px 12px 12px !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
}

body.discord-embedded-layout .msger-peer-inputarea,
body.discord-embedded-layout .participant-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
    padding: 9px 10px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(225, 233, 255, 0.08) !important;
    background: rgba(22, 28, 40, 0.74) !important;
}

body.discord-embedded-layout .msger-peer-inputarea:hover,
body.discord-embedded-layout .participant-item:hover {
    background: rgba(90, 111, 240, 0.15) !important;
    border-color: rgba(90, 111, 240, 0.3) !important;
}

body.discord-embedded-layout .msger-peer-inputwrap {
    min-width: 0;
    width: 100%;
}

body.discord-embedded-layout .msger-peer-inputwrap .msger-input {
    min-height: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    padding: 7px 10px !important;
}

body.discord-embedded-layout .msger-peer-inputwrap .dropdown-menu-custom {
    width: 30px !important;
}

body.discord-embedded-layout .dropdown-menu-custom-list {
    border-radius: 10px !important;
    border: 1px solid rgba(225, 233, 255, 0.1) !important;
    background: rgba(8, 12, 19, 0.98) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55) !important;
}

/* Discord enhancements classes */
body.discord-embedded-layout .discord-status-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 3px solid #0a0e16;
    z-index: 12;
    background: var(--discord-success);
}

body.discord-embedded-layout .discord-status-indicator.status-online,
body.discord-embedded-layout .participant-avatar.online::after {
    background: var(--discord-success);
}

body.discord-embedded-layout .discord-status-indicator.status-away,
body.discord-embedded-layout .participant-avatar.away::after {
    background: var(--discord-warning);
}

body.discord-embedded-layout .discord-status-indicator.status-dnd,
body.discord-embedded-layout .participant-avatar.dnd::after,
body.discord-embedded-layout .participant-avatar.muted::after {
    background: var(--discord-danger);
}

body.discord-embedded-layout .discord-status-indicator.status-offline,
body.discord-embedded-layout .participant-avatar.offline::after {
    background: #707a96;
}

body.discord-embedded-layout .participant-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #5a6ff0, #4d60d8) !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 0.76rem !important;
    position: relative !important;
    overflow: hidden !important;
}

body.discord-embedded-layout .participant-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

body.discord-embedded-layout .participant-avatar::after {
    content: '';
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid #0d111a;
    background: var(--discord-success);
}

body.discord-embedded-layout .participant-status {
    color: var(--discord-text-faint) !important;
    font-size: 0.74rem !important;
}

body.discord-embedded-layout .participant-status.speaking,
body.discord-embedded-layout .participant-status.online {
    color: #89dcb2 !important;
}

body.discord-embedded-layout .participant-status.muted,
body.discord-embedded-layout .participant-status.dnd {
    color: #ff8c98 !important;
}

body.discord-embedded-layout .Camera.speaking,
body.discord-embedded-layout .Screen.speaking {
    box-shadow:
        0 0 0 2px rgba(86, 103, 232, 0.6),
        0 16px 30px rgba(0, 0, 0, 0.4) !important;
}

/* Keep overlays above layout */
body.discord-embedded-layout #loadingDiv,
body.discord-embedded-layout #mySettings,
body.discord-embedded-layout #captionDraggable,
body.discord-embedded-layout #whiteboard,
body.discord-embedded-layout #sendFileDiv,
body.discord-embedded-layout #receiveFileDiv,
body.discord-embedded-layout #videoUrlCont,
body.discord-embedded-layout #videoAudioUrlCont,
body.discord-embedded-layout #qrRoomPopupContainer {
    z-index: 60 !important;
}

/* Responsive */
@media (max-width: 1200px) {
    body.discord-embedded-layout {
        --discord-stage-h: clamp(214px, 30vh, 320px);
    }

    body.discord-embedded-layout .discord-app-search-wrap {
        min-width: min(270px, 40vw);
    }

    body.discord-embedded-layout #msgerCP {
        width: min(320px, calc(100vw - 24px)) !important;
    }
}

@media (max-width: 980px) {
    body.discord-embedded-layout {
        --discord-topbar-h: 0px;
        --discord-stage-h: clamp(200px, 28vh, 300px);
        --discord-controls-h: 60px;
    }

    body.discord-embedded-layout .discord-app-topbar-actions {
        display: none;
    }

    body.discord-embedded-layout .discord-app-search-wrap {
        min-width: min(220px, 46vw);
        max-width: min(300px, 60vw);
    }

    body.discord-embedded-layout #discordStageResizer {
        display: none;
    }

    body.discord-embedded-layout #bottomButtons {
        gap: 6px !important;
        padding: 6px 8px !important;
    }

    body.discord-embedded-layout #bottomButtons .controls-cluster {
        padding: 3px;
        border-radius: 11px;
    }

    body.discord-embedded-layout #bottomButtons button {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 10px !important;
        font-size: 0.9rem !important;
    }

    body.discord-embedded-layout #bottomButtons .device-dropdown-toggle {
        width: 26px !important;
        min-width: 26px !important;
        height: 38px !important;
        min-height: 38px !important;
    }

    body.discord-embedded-layout #leaveRoomBtn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    body.discord-embedded-layout #bottomButtons #audioMenu,
    body.discord-embedded-layout #bottomButtons #videoMenu,
    body.discord-embedded-layout #bottomButtons #settingsExtraMenu {
        min-width: 230px !important;
        max-width: min(300px, calc(100vw - 20px)) !important;
    }
}

@media (max-width: 760px) {
    body.discord-embedded-layout {
        --discord-topbar-h: 0px;
        --discord-stage-h: clamp(182px, 30vh, 260px);
        --discord-controls-h: 56px;
    }

    body.discord-embedded-layout #discordAppTopbar {
        padding: 0 10px;
        gap: 8px;
    }

    body.discord-embedded-layout #discordAppTitle {
        font-size: 0.85rem;
    }

    body.discord-embedded-layout .discord-app-search-wrap {
        min-width: 146px;
        max-width: 46vw;
        height: 30px;
    }

    body.discord-embedded-layout #bottomButtons {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        transform: none !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        scrollbar-width: none;
    }

    body.discord-embedded-layout #bottomButtons .controls-cluster {
        padding: 2px;
    }

    body.discord-embedded-layout #bottomButtons::-webkit-scrollbar {
        display: none;
    }

    body.discord-embedded-layout #bottomButtons #audioMenu,
    body.discord-embedded-layout #bottomButtons #videoMenu,
    body.discord-embedded-layout #bottomButtons #settingsExtraMenu {
        left: 0 !important;
        right: auto !important;
        transform: none !important;
    }

    body.discord-embedded-layout #msgerHeader {
        padding: 8px 10px !important;
    }

    body.discord-embedded-layout #msgerHeader .msger-header-options button,
    body.discord-embedded-layout #msgerHeader .dropdown-toggle-custom {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
    }

    body.discord-embedded-layout .msg {
        padding: 9px 10px !important;
        gap: 10px;
    }

    body.discord-embedded-layout .msg-img,
    body.discord-embedded-layout .peer-img {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
    }

    body.discord-embedded-layout .msg-text {
        max-width: calc(100vw - 70px);
    }

    body.discord-embedded-layout #msgerCP {
        top: calc(var(--discord-topbar-h) + 6px) !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        height: min(560px, calc(100vh - (var(--discord-topbar-h) + 12px))) !important;
    }
}
