.message-avatar {
    position: absolute;
    inset-block-start: .6rem;
    inset-inline-start: .6rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(180,100,110,.35);
}
.message-avatar, .server-self-avatar {
    display: inline-grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    color: #f9e1e8;
    flex-shrink: 0;
    font: 700 12px system-ui, sans-serif;
}
.message-avatar { position: absolute; }
.message-avatar img, .server-self-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#messagesList .msg, #messagesList .chat-message { position: relative; padding-inline-start: 34px; }
#friendsList .dialog-row { border-radius: 7px; width: 100%; padding: .2rem .55rem; }
#friendsList .dialog-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: .55rem; }
.friends-nav { display: block; width: 100%; text-align: left; margin-bottom: .65rem; }
#profilePreview .profile-banner { height: clamp(125px,24vw,195px); }
.profile-badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.profile-badge { border: 1px solid rgba(239,178,191,.22); padding: .14rem .45rem; border-radius: .35rem; font-size: .8rem; color: #f9e1e8; }
.profile-badge[data-kind="staff"] { background: #4a243a; }
.profile-badge[data-kind="age"] { background: #35253e; }
.me-card .settings-gear { margin-inline-start: auto; padding: .2rem .45rem; }
.server-picker-actions { display: flex; justify-content: space-between; padding-top: .6rem; }
.voice-roster { margin: .15rem 0 .55rem .7rem; padding: 0; list-style: none; font-size: .85rem; }
.voice-roster li { display: flex; align-items: center; gap: .35rem; padding: .15rem 0; overflow-wrap: anywhere; }
.role-chip { margin-inline-start: auto; font-size: .72rem; overflow-wrap: anywhere; }
.disvibe-notices { position: fixed; top: .75rem; right: .75rem; z-index: 90; width: min(23rem, calc(100vw - 1.5rem)); }
.disvibe-notices:empty { display: none; }
.disvibe-notices details { background: #22151c; border: 1px solid #65414e; padding: .6rem .8rem; border-radius: 9px; color: #fff; box-shadow: 0 8px 22px #0007; }
.disvibe-notices summary { cursor: pointer; }
.notice-list { max-height: min(42vh, 18rem); overflow-y: auto; }
.notice-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding-block: .45rem; }
.notice-row strong { width: 100%; font-size: .88rem; overflow-wrap: anywhere; }
.notice-row a { color: #ffd9e6; }
.notice-row button { color: #fff; background: #552637; padding: .2rem .45rem; border: 1px solid #824559; border-radius: .3rem; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
    button, a, .dialog-row, .activity-row { transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease; }
    dialog[open], .disvibe-notices details { animation: disvibe-enter 130ms ease-out; }
    @keyframes disvibe-enter { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
.server-self-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #563039; }
.voice-disabled-icon { position: relative; opacity: .78; }
.voice-disabled-icon::after { content: ""; position: absolute; top: 49%; left: 0; right: 0; border-top: 2px solid #ff7086; transform: rotate(-44deg); }
.server-shares:not([hidden]) { display: flex; gap: .5rem; overflow: auto; max-height: 28vh; padding: .5rem 1rem; }
.server-shares video { max-width: 100%; max-height: 100%; min-width: 0; background: #0b080a; border-radius: .4rem; }
#roleForm { display: grid; gap: .4rem; margin-block: .8rem; }
#serverVoiceTools:not([hidden]) { display: flex; flex-wrap: wrap; gap: .3rem; }
#serverVoiceTools button[aria-pressed="true"] { background: #562737; }

:has(> .message-avatar) {
    box-sizing: border-box;
    min-block-size: calc(28px + 1.2rem);
    padding-inline-start: calc(28px + 1.2rem);
}


#shareScreen::before, #serverShare::before {
    content: "";
    display: inline-block;
    inline-size: 21px;
    block-size: 21px;
    margin-inline-end: .35rem;
    vertical-align: middle;
    background-color: currentColor;
    --monitor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='2' y='3.5' width='20' height='13.5' rx='2'/%3E%3Cpath d='M12 17v4m-4 0h8'/%3E%3C/svg%3E");
    -webkit-mask: var(--monitor-icon) center / contain no-repeat;
    mask: var(--monitor-icon) center / contain no-repeat;
}

.message-reactions:not(:empty) {
    flex-wrap: wrap;
    margin-block-start: .3rem;
    max-inline-size: 100%;
}

.voice-roster li:has(> .voice-roster-avatar) {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-block-size: 0;
    padding-inline-start: 0;
}
.voice-roster .voice-roster-avatar {
    position: relative;
    inset: auto;
    inline-size: 20px;
    block-size: 20px;
}

.voice-overlay {
    position: fixed;
    inset: auto 1rem 1rem auto;
    width: min(42rem, calc(100vw - 2rem));
    max-height: min(36rem, calc(100vh - 2rem));
    margin: 0;
    padding: .9rem;
    overflow: auto;
    color: #f9e1e8;
    background: #22141d;
    border: 1px solid #814758;
    border-radius: .8rem;
    box-shadow: 0 12px 36px #0008;
    box-sizing: border-box;
    z-index: 100;
}
.voice-overlay > header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-block-end: .75rem;
}
.voice-overlay h2 { margin: 0; font-size: 1rem; }
.voice-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: .65rem;
}
.voice-tile {
    min-width: 0;
    background: #30202a;
    border: 1px solid #5e384a;
    border-radius: .55rem;
    overflow: hidden;
}
.voice-tile-media {
    display: grid;
    aspect-ratio: 16 / 9;
    place-items: center;
    padding: 0;
    background: #180f16;
}
.voice-tile-media video {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    min-block-size: 0;
    object-fit: contain;
}
.voice-tile-media .voice-tile-avatar {
    position: relative;
    inset: auto;
    inline-size: 56px;
    block-size: 56px;
    font-size: 1rem;
}
.voice-tile-media [hidden] { display: none; }
.voice-tile-name {
    display: block;
    padding: .4rem .6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(#muteVoice, #deafenVoice, #shareScreen, #serverMute, #serverDeafen, #serverShare) {
    position: relative;
    min-inline-size: 2.5rem;
    min-block-size: 2.5rem;
    padding: .4rem;
    font-size: 0;
}
:is(#muteVoice, #deafenVoice, #serverMute, #serverDeafen)::before {
    content: "";
    display: inline-block;
    width: 21px;
    height: 21px;
    vertical-align: middle;
    background: currentColor;
    -webkit-mask: var(--control-icon) center / contain no-repeat;
    mask: var(--control-icon) center / contain no-repeat;
}
:is(#muteVoice, #serverMute) { --control-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10v1a7 7 0 0 0 14 0v-1M12 18v4m-4 0h8'/%3E%3C/svg%3E"); }
:is(#deafenVoice, #serverDeafen) { --control-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 15v-3a9 9 0 0 1 18 0v3M3 13h4v8H5a2 2 0 0 1-2-2zm18 0h-4v8h2a2 2 0 0 0 2-2z'/%3E%3C/svg%3E"); }
#shareScreen::before, #serverShare::before { margin-inline-end: 0; }
:is(#muteVoice, #deafenVoice, #serverMute, #serverDeafen)[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    inset: calc(50% - 1px) auto auto calc(50% - 13px);
    width: 26px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -1px #22141d;
    transform: rotate(-45deg);
    pointer-events: none;
}
:is(#shareScreen, #serverShare)[aria-pressed="true"] { background: #562737; }

#contactCard {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(35rem, calc(100vw - 2rem));
    max-width: none;
    max-height: calc(100vh - 2rem);
    box-sizing: border-box;
    padding: 3.25rem 1.5rem 1.5rem;
    overflow: auto;
}
#closeContactCard {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
}
.message-edited:not([hidden]) {
    display: block;
    margin-block-start: .25rem;
    text-align: end;
    font-size: .7rem;
    opacity: .65;
}
.message-reactions:not(:empty) { margin-block-start: .3rem; }

.server-preview-form:not([hidden]) {
    display: grid;
    justify-items: start;
    gap: .55rem;
    margin-block: 1.1rem;
}
.server-preview-form textarea {
    width: min(100%, 32rem);
    padding: .6rem;
    box-sizing: border-box;
    color: inherit;
    background: #22141d;
    border: 1px solid #814758;
    border-radius: .45rem;
    resize: vertical;
    font: inherit;
}
.server-preview-form img {
    width: min(100%, 32rem);
    max-height: 10rem;
    object-fit: cover;
    border-radius: .45rem;
}
.message-deleted :is(.msg-body, p:not(:first-of-type)) { opacity: .68; font-style: italic; }
.message-invite-link { color: #ffb8d2; text-decoration: underline; overflow-wrap: anywhere; }

.message-continued[data-message-author-id] { min-block-size: 0; padding-block: .25rem; }
.message-continued [hidden] { display: none !important; }

[data-message-author-id] { padding-inline-start: calc(28px + 1.55rem); }
.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .6rem;
    margin-block-start: .25rem;
    font-size: .7rem;
}
.message-meta .message-sent-at { opacity: .68; margin: 0; white-space: nowrap; }
.message-meta .message-edited { margin: 0 0 0 auto; }
.member-sidebar { overflow-x: auto; }
.member-sidebar :is(h2, h3, p, span, button, li) {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}
#serverName {
    flex: 1 1 auto;
    min-inline-size: 0;
    padding: .55rem .68rem;
    resize: none;
    box-sizing: border-box;
    color: inherit;
    background: #22141d;
    border: 1px solid #814758;
    border-radius: .5rem;
    font: inherit;
    white-space: pre-wrap;
    hyphens: auto;
    overflow-wrap: break-word;
}
#managedName, #chatHeader { hyphens: auto; overflow-wrap: break-word; }
.voice-overlay > header { cursor: move; touch-action: none; user-select: none; }

.disvibe-suggestions:not([hidden]) {
    display: grid;
    max-height: 20rem;
    overflow-y: auto;
    gap: .3rem;
    margin-block: .45rem;
    padding: .35rem;
    border: 1px solid #814758;
    border-radius: .55rem;
    background: #22141d;
}
.suggestion-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem;
    border: 0;
    border-radius: .4rem;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}
.suggestion-option:is(:hover, :focus-visible) { background: #492637; }
.suggestion-option small { display: block; opacity: .72; }
.suggestion-avatar {
    position: relative;
    display: grid;
    place-items: center;
    inline-size: 36px;
    block-size: 36px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    background: #63374a;
}
.suggestion-avatar img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }


#messageToastStack {
    position: fixed;
    z-index: 160;
    inset: auto 1rem 1rem auto;
    display: grid;
    gap: .55rem;
    width: min(22rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.message-toast {
    position: relative;
    color: #f9e1e8;
    background: #291822;
    border: 1px solid #814758;
    border-radius: .6rem;
    box-shadow: 0 8px 20px #0007;
    animation: message-toast-in .25s ease-out;
}
.message-toast-body {
    display: grid;
    gap: .5rem;
    width: 100%;
    padding: .7rem .85rem .8rem;
    text-align: start;
    color: inherit;
    border: 0;
    border-radius: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.message-toast-body:hover { background: #ffffff08; }
.message-toast-title { padding-inline: 1.6rem; text-align: center; font-weight: 700; }
.message-toast-bell { position: absolute; inset: .68rem auto auto .75rem; color: #e3a8bd; }
.message-toast-user { display: flex; gap: .55rem; align-items: center; overflow-wrap: anywhere; }
.message-toast-avatar {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    overflow: hidden;
    background: #63374a;
    font-weight: 700;
}
.message-toast-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.message-toast-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: #e1c2ce;
}
.message-toast-close {
    position: absolute;
    inset: .45rem .45rem auto auto;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid #814758;
    border-radius: 50%;
    color: inherit;
    background: #482838;
    cursor: pointer;
}
@keyframes message-toast-in { from { opacity: 0; transform: translateY(.35rem); } }
@media (prefers-reduced-motion: reduce) { .message-toast { animation: none; } }

.message-mentioned::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: rgba(177, 222, 255, .20);
    box-shadow: inset 2px 0 rgba(161, 218, 255, .55);
    opacity: 1;
    animation: mention-appear .25s ease-out;
    transition: opacity .55s ease-out;
}
.message-mentioned.mention-seen::after { opacity: 0; }
@keyframes mention-appear { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .message-mentioned::after { animation: none; transition: none; }
}

#incoming-call-card {
    position: fixed;
    z-index: 1200;
    top: 50%;
    left: 50%;
    width: min(17rem, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    padding: clamp(1rem, 5vw, 1.75rem);
    display: grid;
    gap: 1.25rem;
    overflow: auto;
    border: 1px solid var(--border, #543347);
    border-radius: 1.15rem;
    background: var(--surface, var(--panel, #201820));
    color: var(--text, #fff0f6);
    box-shadow: 0 16px 48px #0009;
    animation: incoming-call-appear .2s ease-out;
}
@keyframes incoming-call-appear {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); }
}
.incoming-call-person {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: .4rem;
    text-align: center;
}
#incoming-call-name {
    max-width: 100%;
    font-size: clamp(1.05rem, 4.4vw, 1.28rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
#incoming-call-description { color: var(--muted, #c3aebd); font-size: .86rem; }
.incoming-call-avatar {
    display: grid;
    width: clamp(4.25rem, 20vmin, 5.6rem);
    aspect-ratio: 1;
    margin-block-end: .45rem;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--border, #79556b);
    border-radius: 50%;
    background: var(--chip, #593244);
    color: inherit;
    font-size: 1.7rem;
    font-weight: 700;
}
.incoming-call-avatar img { width: 100%; height: 100%; object-fit: cover; }
.incoming-call-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; }
.incoming-call-actions button {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 1px solid #ffffff24;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease;
}
.incoming-call-actions svg { width: 1.35rem; height: 1.35rem; }
.incoming-call-actions .answer { background-color: #2c804f; }
.incoming-call-actions .decline { background-color: #9f2b50; }
.incoming-call-actions .answer:is(:hover, :focus-visible) {
    background-color: #30955b;
    box-shadow: 0 0 14px #a5df7450;
}
.incoming-call-actions .decline:is(:hover, :focus-visible) {
    background-color: #b93a5d;
    box-shadow: 0 0 14px #d34f7250;
}
.incoming-call-actions button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    #incoming-call-card { animation: none; }
    .incoming-call-actions button { transition: none; }
}

#voiceChannels .voice-roster li > span[role="img"] { font-size: .68rem; line-height: 1; }
:is(.voice-tile-avatar, .voice-roster-avatar, .call-people [data-voice-speaker]).is-speaking::after,
#myAvatar[data-voice-speaker].is-speaking > .avatar-button > .avatar::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid #f2cd53;
    border-radius: inherit;
    pointer-events: none;
}
.voice-overlay header .voice-overlay-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.voice-tile-media { position: relative; }
.voice-tile-media .voice-fullscreen {
    position: absolute;
    right: .4rem;
    bottom: .4rem;
    background: #17131ac9;
    color: #fff;
}
.voice-tile-media video:fullscreen { width: 100%; height: 100%; object-fit: contain; background: #000; }
.member-row .message-avatar { position: relative; inset: auto; width: 1.6rem; height: 1.6rem; flex: 0 0 1.6rem; }
.member-row .message-avatar img { width: 100%; height: 100%; }
:is(#serverMute, #serverDeafen).profile-voice-control { width: 1.8rem; height: 1.8rem; padding: 0; flex: 0 0 auto; }
.profile-voice-control[aria-pressed="true"] { background: #562737; }
.voice-shortcut-row { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; }
.voice-shortcut-row > span { flex: 1; }
.voice-shortcuts > summary { cursor: pointer; }
.voice-shortcut-help { font-size: .85rem; }

body:has(#serverMembers) > .main-area { min-inline-size: 0; }
@media (min-width: 761px) {
    body:has(#serverMembers) > .main-area { margin-inline-start: .45rem; }
}
#messageForm input[type="file"][hidden] { display: none; }
#addMessageAttachment { flex: 0 0 auto; }
.message-file-download {
    display: block;
    margin-block: .35rem;
    padding: .4rem .65rem;
    color: var(--text, #fff);
    background: var(--field, #251b27);
    border: 1px solid var(--border, #654555);
    border-radius: .45rem;
    cursor: pointer;
}
.message-avatar[role="button"] { cursor: pointer; }
.message-avatar[role="button"]:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
#disvibe-mini-profile {
    position: fixed;
    width: min(340px, calc(100% - 2rem));
    padding: 0;
    border: 1px solid var(--border, #654555);
    border-radius: .85rem;
    color: var(--text, #fff);
    background: var(--surface, #251b27);
    box-shadow: 0 12px 40px #0008;
    overflow: auto;
}
#disvibe-mini-profile::backdrop { background: #0005; }
.mini-profile-banner:not([hidden]) { width: 100%; height: 108px; object-fit: cover; display: block; }
.mini-profile-content { padding: 1rem; display: grid; gap: .4rem; overflow-wrap: anywhere; }
.mini-profile-content p { white-space: pre-wrap; margin: .25rem 0 0; }
.mini-profile-content .message-avatar { position: relative; inset: auto; width: 54px; height: 54px; }
.mini-profile-close {
    position: absolute;
    top: .45rem;
    right: .45rem;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 50%;
    background: #211722dc;
    color: #fff;
    cursor: pointer;
}
.disvibe-voice-dock:not([hidden]) {
    position: fixed;
    z-index: 1090;
    inset-block-start: 4rem;
    inset-inline-end: .7rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    max-width: calc(100% - 1.4rem);
    padding: .45rem .6rem;
    color: var(--text, #fff);
    background: var(--surface, #251b27);
    border: 1px solid var(--border, #654555);
    border-radius: .65rem;
    box-shadow: 0 8px 25px #0005;
    font-size: .82rem;
}
#authScreen[hidden] { display: none !important; }
body:has(#serverMembers) #messagesList { padding-inline-start: 6.8rem; }
body:has(#serverMembers) #messagesList .chat-message { position: relative; }
#messagesList .channel-hover-time {
    position: absolute;
    top: .6rem;
    inset-inline-end: calc(100% + .4rem);
    width: 6rem;
    color: var(--muted);
    text-align: end;
    font-size: .68rem;
    line-height: 1.15;
    opacity: 0;
    pointer-events: none;
}
#messagesList .chat-message:is(:hover, :focus-within) .channel-hover-time { opacity: 1; }
#messagesList .channel-heading-time { margin-inline-start: .45rem; color: var(--muted); font-size: .72rem; }
@media (max-width: 560px) {
    body:has(#serverMembers) #messagesList { padding-inline-start: 4.7rem; }
    #messagesList .channel-hover-time { width: 4rem; font-size: .63rem; }
}
.voice-channel-open #messagesList, .voice-channel-open #messageForm { display: none; }
.voice-channel-view.voice-overlay[open] {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    box-sizing: border-box;
}
.voice-channel-view > header .voice-overlay-actions { display: none; }
.voice-channel-view > .voice-tiles { flex: 1; min-height: 0; overflow: auto; }
.voice-channel-view .voice-tile video { cursor: zoom-in; }
.voice-stage-expanded .voice-tile:not(.voice-tile-expanded) { display: none; }
.voice-stage-expanded > .voice-tiles { display: flex; }
.voice-stage-expanded .voice-tile-expanded { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.voice-stage-expanded .voice-tile-expanded .voice-tile-media { flex: 1; min-height: 0; aspect-ratio: auto; }
.voice-stage-expanded .voice-tile-expanded video { width: 100%; height: 100%; object-fit: contain; cursor: zoom-out; }
.channel-voice-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; padding: .5rem; }
.channel-voice-controls button[aria-pressed="true"] { background: #562737; }
.voice-channel-view:not(.voice-stage-expanded) .voice-back-to-tiles { display: none; }
.voice-stage-expanded .channel-voice-controls {
    position: absolute;
    inset: auto 0 .5rem;
    width: fit-content;
    max-width: calc(100% - 1rem);
    margin-inline: auto;
    background: var(--surface, #211722);
    border-radius: .65rem;
    transition: opacity .2s ease;
}
.voice-controls-hidden .channel-voice-controls { opacity: 0; pointer-events: none; }
.voice-floating-preview.voice-overlay[open] {
    width: min(15rem, calc(100vw - 2rem));
    z-index: 1400;
    padding: .35rem;
}
.voice-floating-preview header { cursor: grab; font-size: .75rem; }
.voice-floating-preview button { display: block; border: 0; background: transparent; padding: 0; width: 100%; cursor: zoom-in; }
.voice-floating-preview video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.voice-roster-hangup { margin-inline-start: auto; padding: 0; border: 0; color: #fa6174; background: transparent; cursor: pointer; }
.voice-roster-hangup svg { display: block; width: 17px; height: 17px; }
.disvibe-app-view:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1350;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--bg, #080508);
}
#messagesList > [data-message-author-id] {
    --message-content-inset: 1.825rem;
    padding-inline-start: var(--message-content-inset);
}
#messagesList > [data-message-author-id] > .message-avatar:not([hidden]) + :is(.msg-header, p) {
    margin-inline-start: var(--message-content-inset);
    min-block-size: 28px;
}
body:has(#serverMembers) > .main-area {
    min-height: 0;
    max-height: 100dvh;
    overflow: hidden;
}
body:has(#serverMembers) #messagesList {
    min-height: 0;
    flex: 1 1 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}
@media (min-width: 761px) {
    body:has(#serverMembers) { height: 100dvh; min-height: 0; overflow: hidden; }
}
#serverPreviewImage:not([hidden]) {
    display: block;
    width: min(100%, 960px);
    height: auto;
    aspect-ratio: 960 / 540;
    object-fit: cover;
}
#profileSidebar .profile-banner { width: min(100%, 260px); height: auto; aspect-ratio: 260 / 104; }
#profilePreview .profile-banner { width: min(100%, 1100px); height: auto; aspect-ratio: 1100 / 440; }
#disvibe-mini-profile { width: min(600px, calc(100% - 2rem)); }
#disvibe-mini-profile .mini-profile-banner:not([hidden]) { height: auto; aspect-ratio: 600 / 240; }
:is(#serverMute, #serverDeafen, #muteVoice, #deafenVoice).profile-voice-control {
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    flex: 0 0 auto;
}
#contactCard { width: min(600px, calc(100% - 2rem)); max-width: none; box-sizing: border-box; }
#contactCard .profile-banner { width: 100%; height: auto; aspect-ratio: 600 / 240; }
.profile-badges:has(.profile-badge-icon) { display: grid; grid-template-columns: repeat(3, 22px); gap: .35rem; }
.profile-badge-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
}
.profile-badge-icon svg { display: block; width: 22px; height: 22px; }
.profile-badge-icon:is(:focus-visible, [aria-pressed="true"]) { outline: 1px solid currentColor; outline-offset: 2px; }
.profile-badge-description { font-size: .78rem; white-space: normal; margin: .25rem 0; }
.profile-member-since { display: grid; gap: .18rem; margin-block: .5rem; }
.profile-member-since > span { color: var(--muted, #b5a9b0); font-size: .8rem; }
.profile-member-since > time { color: var(--text, #fff3f7); font-size: .9rem; font-weight: 600; }
#profilePage:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
}
#profilePage > .settings-back { justify-self: start; }
#profileHeading { margin-block: clamp(.3rem, 1dvh, .65rem); }
#profilePage #settingsStatus:empty { margin: 0; min-block-size: 0; }
#profilePage > .settings-content { min-inline-size: 0; container-type: inline-size; }
#profilePage > .nav-actions { gap: .45rem; margin-block: .75rem 1rem; }
#profilePage > .nav-actions [data-settings] { text-align: start; }
#profilePage .settings-content > :is(form, section, #profilePreview):not([hidden]) {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    border: 1px solid var(--border, #654555);
    border-radius: .8rem;
    padding: clamp(.45rem, min(1.6vw, 2dvh), 1.1rem);
    margin-block-end: .7rem;
    background: var(--surface, #211722);
}
@media (min-width: 64rem) and (min-height: 38rem) {
    #profilePage:not([hidden]) {
        grid-template-columns: var(--settings-navigation-width) minmax(0, 1fr);
        column-gap: clamp(.5rem, 1.5vw, 1.25rem);
    }
    #profilePage > :is(.settings-back, #profileHeading) { grid-column: 1 / -1; }
    #profilePage > .nav-actions {
        grid-area: 3 / 1;
        align-self: start;
        max-block-size: calc(100dvh - 7rem);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: sticky;
        inset-block-start: 0;
        margin-block-start: 0;
        overflow: auto;
    }
    #profilePage > .settings-content { grid-area: 3 / 2; }
}
:is(#profileForm, #managedSettings, #channelSettings) label[for]::before {
    content: "";
    display: inline-block;
    width: .82rem;
    height: .82rem;
    margin-inline-end: .45rem;
    vertical-align: -.05rem;
    background-color: #a6a5ae;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M19 4l1 1a2 2 0 010 3L9 19l-5 1 1-5L16 4a2 2 0 013 0Z'/%3E%3Cpath d='M14 6l4 4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.disvibe-voice-dock button {
    font: inherit;
    color: inherit;
    background: var(--field, #251b27);
    border: 1px solid var(--border, #654555);
    border-radius: .35rem;
    padding: .3rem .45rem;
    cursor: pointer;
}

:is(#messagesList, #personalizationPreview) :is(.msg, .chat-message) .msg-body {
    font-size: var(--message-font-size, 15px);
}
:is(#messagesList, #personalizationPreview) > :is(.msg, .chat-message) {
    margin-block: 0;
}
:is(#messagesList, #personalizationPreview) > :is(.msg, .chat-message) + :is(.msg, .chat-message) {
    margin-block-start: var(--message-spacing, 6px);
}
.settings-chat-preview { margin-block-start: 1.25rem; min-width: 0; }
.settings-chat-preview h4 { margin: 0 0 .55rem; color: var(--muted); font-size: .85rem; }
.settings-preview-messages {
    padding: clamp(.7rem, 3vw, 1.1rem);
    border: 1px solid var(--border);
    border-radius: .8rem;
    background: var(--app-bg, var(--surface, #1a1118));
}
.settings-preview-messages .msg { display: flex; align-items: start; gap: .6rem; min-width: 0; }
.settings-preview-avatar {
    display: grid; place-items: center; flex: 0 0 1.85rem; aspect-ratio: 1;
    border-radius: 50%; background: #642946; color: #ffdeee; font-size: .8rem; font-weight: 700;
}
.settings-preview-avatar-alt { background: #3e406a; color: #e2e4ff; }
.settings-preview-content { min-width: 0; }
.settings-preview-name { display: flex; align-items: baseline; gap: .5rem; font-size: .8rem; font-weight: 700; }
.settings-preview-name time { color: var(--muted); font-size: .7rem; font-weight: 400; }
.settings-preview-content .msg-body { margin: .12rem 0 0; line-height: 1.45; overflow-wrap: anywhere; }


/* Account controls keep their size while the nickname takes the remaining space. */
:is(#dialogSidebar, .sidebar:has(#serverSelfAvatar)) .me-card {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(3px, .5vw, 7px);
    padding: 7px;
    inline-size: 100%;
    min-width: 0;
    max-width: 100%;
}
.me-card > :is(#myAvatar, #serverSelfAvatar) {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
}
.me-card > :has(> #meName) { flex: 1 1 0; min-width: 0; }
.me-card :is(#meName, #meTag, #myStatus) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
:is(#dialogSidebar, .sidebar:has(#serverSelfAvatar)) .me-card :is(button, .settings-gear) {
    box-sizing: border-box;
    display: inline-grid;
    place-items: center;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
}
.me-card :is(button, .settings-gear) svg { width: 15px; height: 15px; }

.call-network {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    margin-block-start: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface, #1b2130);
    color: var(--call-signal, var(--muted, #9aaacd));
    font-variant-numeric: tabular-nums;
}
#dialogSidebar .call-network + .me-card { margin-block-start: 5px; }
.call-network summary {
    padding: 5px 7px;
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    cursor: pointer;
    list-style: none;
    font-size: .72rem;
    line-height: 1.2;
}
.call-network summary::-webkit-details-marker { display: none; }
.call-network summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: inherit; }
.call-network summary svg { width: 17px; height: 17px; }
.call-network[data-connected] summary svg { animation: call-network-pulse 2s ease-in-out infinite; }
.call-network-quality { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-network-ping { font-weight: 700; white-space: nowrap; }
.call-network-panel {
    position: absolute;
    z-index: 7;
    inset-inline: 0;
    inset-block-end: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 5px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface, #1b2130);
    color: var(--text, #f2f4fa);
    box-shadow: 0 10px 28px #0007;
    font-size: .72rem;
}
.call-network:not([open]) .call-network-panel { display: none; }
.call-network-panel canvas { display: block; width: 100%; grid-column: 1 / -1; }
.call-network-panel small { grid-column: 1 / -1; color: var(--muted, #9aaacd); }
.call-network-range { color: var(--call-signal, var(--muted, #9aaacd)); white-space: nowrap; }
.call-elapsed { margin-inline-start: .65rem; font-variant-numeric: tabular-nums; }
@keyframes call-network-pulse { 50% { opacity: .52; } }
@media (prefers-reduced-motion: reduce) { .call-network[data-connected] summary svg { animation: none; } }

#myAvatar, #myAvatar .avatar-button, .me-card .server-self-avatar { border-radius: 50%; }
#myAvatar .avatar-button { border: 0; box-shadow: none; background: transparent; }
#myAvatar .avatar-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.call-network-graph { position: relative; grid-column: 1 / -1; }
.call-network-tooltip {
    position: absolute; z-index: 1; transform: translate(-50%, calc(-100% - 5px));
    padding: .15rem .4rem; border-radius: .35rem; background: #17121d; color: #fff;
    font-size: .75rem; white-space: nowrap; pointer-events: none;
}

#logoutDm { margin-block-start: 1rem; }
.logout-confirmation {
    width: min(28rem, calc(100% - 2rem)); padding: 1.35rem;
    background: var(--panel, #21141e); color: var(--text, #fff3f6);
    border: 1px solid #713247; border-radius: .9rem; box-shadow: 0 16px 45px #0008;
}
.logout-confirmation::backdrop { background: #09050ac2; }
.logout-confirmation h2 { margin: 0 0 1.2rem; font-size: 1.12rem; }
.logout-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: .65rem; }
#logoutError:empty { display: none; }
#logoutDm {
    color: #fff1f3;
    border-color: #9b3046;
    background-color: #350c17;
    background-image: linear-gradient(110deg, transparent 32%, #ff45632b 50%, transparent 68%),
        linear-gradient(145deg, #49111f, #2e0a13);
    background-size: 220% 100%, 100% 100%;
    background-position: 100% 50%, center;
    box-shadow: 0 0 .55rem #ee294733;
    transition: background-position .4s ease, border-color .2s ease, box-shadow .2s ease;
}
#logoutDm:is(:hover, :focus-visible) {
    border-color: #d64a62;
    background-position: 0 50%, center;
    box-shadow: 0 0 .8rem #ee294750;
}
@media (prefers-reduced-motion: reduce) {
    #logoutDm { transition: none; }
}
#confirmLogout { background: #48202d; color: #fff1f3; border-color: #f2627b; box-shadow: 0 0 .55rem #ec345949; }
.logout-actions [type="submit"] { background: #23391e; color: #f2ffe9; border-color: #a9ed75; box-shadow: 0 0 .55rem #a9ed7542; }
#confirmLogout:hover { background: #692b3d; }
.logout-actions [type="submit"]:hover { background: #38512a; }

.remember-device { display: flex; align-items: center; gap: .5rem; margin-block: .75rem; font-size: .88rem; }
.remember-device[hidden], #showRememberedAccounts[hidden] { display: none; }
.remember-device input { flex: none; inline-size: 1rem; block-size: 1rem; accent-color: #f26691; }
.remembered-accounts {
    box-sizing: border-box; width: min(31rem, calc(100% - 2rem)); padding: 1.25rem;
    overflow-x: hidden; color: #fff3f7; background: #20121f; border: 1px solid #ff6ba2;
    border-radius: 1rem; box-shadow: 0 0 1.5rem #ff529965, inset 0 0 1rem #ff52992c;
}
.remembered-accounts::backdrop { background: #0a060dd1; }
.remembered-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.remembered-header h2 { margin: 0; font-size: 1.12rem; }
.remembered-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr)); gap: .5rem; margin-block: 1rem; }
.remembered-account {
    display: grid; justify-items: center; gap: .55rem; min-width: 0; padding: .55rem .15rem .2rem;
    color: inherit; background: transparent; border: 0; border-radius: .6rem; cursor: pointer;
}
.remembered-account:focus-visible { outline: 2px solid #ff97be; outline-offset: 2px; }
.remembered-avatar {
    display: grid; place-items: center; position: relative; inline-size: 2.9rem; block-size: 2.9rem;
    overflow: hidden; border-radius: 50%; background: #69314e; font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease;
}
.remembered-avatar img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.remembered-name { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity .18s ease; }
.remembered-account:is(:hover, :focus-visible) .remembered-avatar { transform: scale(1.1); box-shadow: 0 0 .65rem #ff71a899; }
.remembered-account:is(:hover, :focus-visible) .remembered-name { opacity: 1; }
#rememberedStatus:empty { display: none; }
@media (hover: none) { .remembered-name { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .remembered-avatar, .remembered-name { transition: none; } }


.official-invite {
    box-sizing: border-box; width: min(33rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem);
    padding: 1.2rem; border: 1px solid #a65277; border-radius: 1rem;
    color: var(--text, #fff3f7); background: var(--panel, #21141e); box-shadow: 0 0 2rem #e65f9a45;
}
.official-invite::backdrop { background: #110810c9; }
.official-invite h2 { margin: 0 0 .9rem; font-size: 1.18rem; }
.official-invite-banner, .official-invite-icon { position: relative; overflow: hidden; display: grid; place-items: center; }
.official-invite-banner {
    min-height: 7rem; aspect-ratio: 16 / 6; border-radius: .7rem; color: #ffe3f1; font-size: clamp(1.6rem, 7vw, 3rem); font-weight: 850;
    background: radial-gradient(ellipse at 19% 90%, #b44d773e, transparent 52%),
        repeating-linear-gradient(135deg, #fff0 0 28px, #ffaed719 28px 29px), linear-gradient(125deg, #391c42, #783655 55%, #2e1a3b);
}
.official-invite-banner span { text-shadow: 0 0 1rem #f695c7b0; }
.official-invite-banner img, .official-invite-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.official-invite-identity { display: flex; align-items: center; gap: .65rem; margin-block: .9rem .5rem; }
.official-invite-identity h3 { margin: 0; font-size: 1.15rem; }
.official-invite-icon { width: 2.8rem; height: 2.8rem; border-radius: .75rem; color: #fff2fa; font-weight: 850;
    border: 1px solid #ec9abb; background: linear-gradient(145deg, #ad527f, #49265d); }
.official-invite-description { margin: .5rem 0; overflow-wrap: anywhere; color: var(--muted, #d8bccd); }
.official-invite-question { margin: 1rem 0 .75rem; font-weight: 700; }
.official-invite-status:empty { display: none; }
.official-invite-status { color: #ff9cae; }
.official-invite-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem; }
.official-invite-actions button, .cookie-consent-actions button {
    padding: .58rem .85rem; border: 1px solid; border-radius: .6rem; font: inherit; font-weight: 700; cursor: pointer;
}
.official-invite-actions button:disabled { opacity: .65; cursor: wait; }
.official-invite-join { color: #edffe7; background: #234b27; border-color: #79fc83; box-shadow: 0 0 .8rem #65fa7569; }
.official-invite-join:hover:not(:disabled) { background: #316a34; }
.official-invite-decline { color: #fff0f2; background: #59202e; border-color: #ff596e; box-shadow: 0 0 .8rem #ff4d6866; }
.official-invite-decline:hover:not(:disabled) { background: #792c3c; }

.cookie-consent {
    box-sizing: border-box; position: fixed; z-index: 9999; inset-inline-start: 50%;
    inset-block-end: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; width: min(52rem, calc(100% - 1.5rem));
    padding: .85rem 2.2rem .85rem 1rem; border: 1px solid var(--border, #754459); border-radius: .8rem;
    background: #251721; color: #fff1f7; box-shadow: 0 .5rem 1.8rem #0008;
}
.cookie-consent-copy { flex: 1 1 15rem; }
.cookie-consent-copy p { margin: .25rem 0 0; font-size: .84rem; color: #e0c7d5; }
.cookie-consent-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.cookie-consent-actions button { color: #fff0f7; background: #48253b; border-color: #ae698a; font-size: .84rem; }
.cookie-consent-actions button + button { background: #301e2d; border-color: #8b617a; }
.cookie-consent-close {
    position: absolute; inset-block-start: .32rem; inset-inline-end: .38rem; width: 1.6rem; height: 1.6rem;
    padding: 0; border: 0; background: transparent; color: #fff; opacity: .23; font-size: 1.3rem; cursor: pointer;
}
.cookie-consent-close:is(:hover, :focus-visible) { opacity: .85; }

:root { --disvibe-particle-color: #ff5476; }
:root:has(> body[data-theme="black"]) { --disvibe-particle-color: #a1a6b0; }
:root:has(> body[data-theme="wine"]) { --disvibe-particle-color: #e264a1; }
:root:has(> body[data-theme="ember"]) { --disvibe-particle-color: #ff784d; }

:where(html, *) {
    scrollbar-width: thin;
    scrollbar-color: var(--disvibe-particle-color, #a35472) transparent;
}
#authScreen, #authScreen * { scrollbar-width: none; }
#authScreen::-webkit-scrollbar, #authScreen *::-webkit-scrollbar { display: none; }
.message-video { display: block; width: min(100%, 34rem); max-height: 50vh; margin-block-start: .4rem; border-radius: .6rem; background: #121018; }
.message-tombstone { margin: .35rem .65rem; color: var(--muted, #b2a5ae); opacity: .66; font-style: italic; font-size: .85rem; }

:is(.auth-code-dialog, .image-crop-dialog, .attachment-picker, .voice-context-menu) {
    box-sizing: border-box; width: min(29rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem);
    padding: 1.1rem; color: var(--text, #fff3f6); background: var(--panel, #241722);
    border: 1px solid var(--border, #75425c); border-radius: .9rem; box-shadow: 0 14px 48px #0b050bd1;
}
:is(.auth-code-dialog, .image-crop-dialog, .attachment-picker)::backdrop { background: #0c060dc4; }
:is(.image-crop-dialog, .attachment-picker) h2 { margin: 0 0 .8rem; font-size: 1.1rem; }
.attachment-picker[open] { display: grid; gap: .48rem; }
:is(.attachment-picker, .image-crop-actions, .voice-context-menu) button {
    padding: .5rem .7rem; border: 1px solid var(--border, #805070); border-radius: .55rem; color: inherit;
    background: var(--surface, #3e2738); cursor: pointer; font: inherit; text-align: start;
}
:is(.attachment-picker, .image-crop-actions, .voice-context-menu) button:hover { filter: brightness(1.14); }
.auth-code-heading { display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-items: start; gap: .8rem; margin-block-end: .9rem; }
.auth-code-heading h2 { margin: 0; font-size: 1.1rem; }
.auth-code-heading p { margin: .4rem 0 0; color: var(--muted, #dbbdce); overflow-wrap: anywhere; line-height: 1.45; }
.auth-code-icon { position: relative; display: block; width: 3rem; height: 3rem; border-radius: .7rem; background: #4b233e; font-size: 0; }
.auth-code-icon::before, .auth-code-icon::after { content: ''; position: absolute; inset: .55rem; }
.auth-code-icon::before { background: #ffd7eb; clip-path: polygon(13% 45%, 50% 7%, 87% 45%, 87% 80%, 13% 80%); }
.auth-code-icon::after { background: #e972a4; clip-path: polygon(0 43%, 50% 74%, 100% 43%, 100% 92%, 0 92%); }
.auth-code-dialog > label { display: block; margin-block-end: .35rem; }
#registrationEmailCode { box-sizing: border-box; width: 100%; text-align: center; font: 700 1.4rem ui-monospace, monospace; letter-spacing: .45em; }
.auth-code-status { margin: .55rem 0; color: #ff9bad; }
.auth-code-status:empty { display: none; }
.auth-code-actions, .image-crop-actions { margin-block-start: .8rem; display: flex; justify-content: space-between; align-items: center; gap: .65rem; flex-wrap: wrap; }
.auth-code-actions .auth-submit { width: auto; margin: 0; }
.image-crop-dialog canvas { display: block; width: min(100%, 29rem); max-height: 40dvh; object-fit: contain; border-radius: .65rem; touch-action: none; cursor: grab; background: #160d16; }
.image-crop-dialog canvas:active { cursor: grabbing; }
.image-crop-dialog p { font-size: .85rem; color: var(--muted, #dbbdce); }
.image-crop-controls { display: grid; gap: .4rem; }
.image-crop-controls label, .voice-context-menu label { display: grid; gap: .35rem; font-size: .85rem; }
:is(.image-crop-controls, .voice-context-menu, #callPanel, .voice-channel-view) input[type="range"] { width: 100%; accent-color: var(--accent, #eb76a7); }
.voice-context-menu { position: fixed; inset: auto; margin: 0; width: min(16rem, calc(100% - 1rem)); }
.voice-context-menu[open] { display: grid; gap: .6rem; }
.voice-context-menu::backdrop { background: transparent; }
#profileSidebar .avatar-button, :is(.voice-card-avatar, .voice-roster-avatar, .call-people [data-voice-speaker]) { cursor: pointer; }

@media (prefers-reduced-motion: no-preference) {
    dialog[open] { animation: disvibe-dialog-in .16s cubic-bezier(.2, .7, .25, 1) both; }
    dialog[open]::backdrop { animation: disvibe-backdrop-in .14s ease-out both; }
    :is(#profileSidebar, #dialogSidebar, .disvibe-notices, #callPanel):not([hidden]) { animation: disvibe-dialog-in .16s ease-out both; }
    @keyframes disvibe-dialog-in { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
    @keyframes disvibe-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
}

:where(html, *)::-webkit-scrollbar { width: .48rem; height: .48rem; }
:where(html, *)::-webkit-scrollbar-thumb {
    border-radius: 999px; background: var(--disvibe-particle-color, #a35472);
}
:where(html, *)::-webkit-scrollbar-track { background: transparent; }

body:has(> .disvibe-page-scene), #callPanel:has(> .disvibe-neon-scene) { isolation: isolate; }
#callPanel:has(> .disvibe-neon-scene) { position: relative; }
.disvibe-neon-scene {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: -1; color: var(--disvibe-particle-color); pointer-events: none;
}
body > .disvibe-page-scene { position: fixed; opacity: .72; }
body:has(> .disvibe-app-view:not([hidden])) > .disvibe-page-scene { display: none; }
body:has(> .disvibe-page-scene) #authScreen { backdrop-filter: none; }
#callPanel:not([hidden]) {
    box-sizing: border-box; display: flex; align-items: stretch; justify-content: flex-start;
    min-block-size: min(13.5rem, 32dvh); max-block-size: min(46dvh, 32rem);
    margin: .55rem .65rem; padding: .75rem .8rem 0; border: 1px solid var(--border, #663049);
    border-radius: 1rem; overflow: auto;
    background: radial-gradient(ellipse at 54% 0%, color-mix(in srgb, var(--accent, #ff76ad) 19%, transparent), transparent 66%),
        linear-gradient(155deg, var(--surface, #301c2b), var(--app-bg, #161019));
}
#callPanel:has(.share-tile:not([hidden])) { max-block-size: min(64dvh, 44rem); }
#callPanel #callPeople { display: flex; flex: 1 0 auto; justify-content: center; flex-wrap: wrap; gap: .7rem; padding-block: .3rem; }
#callPanel .dm-call-person {
    position: relative; display: grid; align-content: center; justify-items: center; row-gap: .3rem;
    min-inline-size: 5.3rem; max-inline-size: 10rem; min-block-size: 5.3rem; padding: .5rem .65rem;
    color: var(--text, #fef2f8); background: color-mix(in srgb, var(--surface, #40243a) 33%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent, #ff76ad) 32%, transparent);
    border-radius: 1.35rem; text-align: center; overflow-wrap: anywhere;
}
#callPanel .dm-call-person .avatar { border-radius: 50%; }
.dm-mute-indicator {
    position: absolute; inset-block-start: .3rem; inset-inline-end: .3rem;
    width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #53263b; color: #ffc2d1;
    border: 1px solid #c6748c; pointer-events: none;
}
.dm-mute-indicator::before {
    content: ""; position: absolute; inset: .18rem; background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 9V5a3 3 0 0 1 6 0v6M5 10v2a7 7 0 0 0 12 5m-5 2v3m-3 0h6M3 3l18 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dm-mute-indicator[data-kind="audio"]::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12a8 8 0 0 1 16 0v6h-4v-5h4M4 12v6h4v-5H4M3 3l18 18'/%3E%3C/svg%3E");
}
#callPanel #voiceStatus { align-self: center; }
#callPanel .call-actions {
    position: sticky; inset-block-end: 0; z-index: 2; align-self: stretch;
    justify-content: center; flex-wrap: wrap; gap: .4rem; margin-block-start: auto;
    padding: .45rem; border-top: 1px solid var(--border, #663049);
    background: color-mix(in srgb, var(--surface, #2e1a2b) 84%, transparent);
    backdrop-filter: blur(8px); border-radius: .65rem .65rem 0 0;
}
#callPanel #shareStack {
    align-self: center; box-sizing: border-box; width: min(100%, 58rem); padding: .45rem;
    border: 1px solid var(--border, #643049); border-radius: .8rem;
    background: color-mix(in srgb, var(--surface, #332030) 42%, transparent);
}
#callPanel .share-tile { background: color-mix(in srgb, var(--surface, #332030) 72%, transparent); }
#callPanel .share-tile figcaption { background: var(--surface, #332030); }

#devicesSettings:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: clamp(.45rem, 1.6vw, .85rem);
}
.devices-controls { display: grid; gap: .45rem; min-width: 0; }
.devices-controls > .back-btn { justify-self: start; }
.reduction-pane {
    --reduction-accent: var(--accent, #f37bab); min-width: 0; padding: .85rem; scroll-margin-top: 1rem;
    border: 1px solid var(--border, #774966); border-radius: .85rem; background: var(--surface, #261723);
}
.reduction-heading, .reduction-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.reduction-heading h3, .reduction-description { margin: 0; }
.reduction-description { margin-block-start: .28rem; color: var(--muted, #d0aebf); font-size: .86rem; }
.reduction-spectrum { margin-block: .8rem; padding: .25rem; background: #160f19; border: 1px solid var(--border, #694052); border-radius: .6rem; }
.reduction-spectrum canvas {
    display: block;
    inline-size: 100%;
    block-size: auto;
    max-block-size: min(25dvh, 11rem);
    object-fit: contain;
}
.reduction-footer output { color: var(--reduction-accent); font: 600 .86rem ui-monospace, monospace; }
.reduction-status { margin-block: .45rem 0; color: var(--muted, #d0aebf); font-size: .82rem; }
.reduction-status:empty { display: none; }
.reduction-switch { position: relative; display: inline-grid; width: 2.45rem; height: 1.4rem; cursor: pointer; }
.reduction-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.reduction-switch span { border-radius: 999px; border: 1px solid #95768a; background: #372939; transition: background .15s ease; pointer-events: none; }
.reduction-switch span::before {
    content: ""; display: block; width: .97rem; height: .97rem; margin: .135rem; border-radius: 50%;
    background: #fff1f9; transition: transform .15s ease;
}
.reduction-switch input:checked + span { background: var(--reduction-accent); border-color: var(--reduction-accent); }
.reduction-switch input:checked + span::before { transform: translateX(1rem); }
.reduction-switch input:focus-visible + span { outline: 2px solid var(--reduction-accent); outline-offset: 3px; }
.reduction-switch input:disabled + span { opacity: .55; }
.me-card .reduction-indicator {
    position: relative; flex: 0 0 25px; width: 25px; height: 25px; display: grid; place-items: center;
    color: #948793; border-radius: .38rem; text-decoration: none; outline-offset: 2px;
}
.reduction-indicator[data-enabled="true"] { color: var(--accent, #f36d99); }
.reduction-indicator [role="tooltip"] {
    position: absolute; inset-inline-end: 0; inset-block-end: calc(100% + .4rem); z-index: 30;
    padding: .28rem .5rem; border: 1px solid var(--accent, #f36d99); border-radius: .4rem;
    color: var(--text, #fff2fa); background: var(--surface, #261622); white-space: nowrap; font-size: .75rem;
    opacity: 0; transform: translateY(3px); pointer-events: none; transition: opacity .14s ease, transform .14s ease;
}
.reduction-indicator:is(:hover, :focus-visible) [role="tooltip"] { opacity: 1; transform: translateY(0); box-shadow: 0 0 13px var(--accent, #f36d99); }
@media (prefers-reduced-motion: no-preference) {
    .reduction-indicator[data-enabled="true"] svg { animation: reduction-indicator-glow 3.2s ease-in-out infinite; }
    .reduction-indicator:is(:hover, :focus-visible) [role="tooltip"] { animation: reduction-tooltip-glow 2.4s ease-in-out infinite; }
    @keyframes reduction-indicator-glow { 0%, 100% { filter: drop-shadow(0 0 5px currentColor); } 50% { filter: brightness(.36); } }
    @keyframes reduction-tooltip-glow { 50% { box-shadow: 0 0 4px var(--accent, #f36d99); } }
}
@container (min-width: 33rem) {
    #devicesSettings:not([hidden]) { grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); }
    #devicesSettings > .devices-controls { grid-area: 1 / 1; }
    #devicesSettings > .reduction-pane { grid-area: 1 / 2; }
}

#hotkeysSettings:not([hidden]) { padding: clamp(.75rem, 2vw, 1.2rem); }
.hotkey-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .65rem; margin-block-end: .75rem; }
.hotkey-heading h3, .hotkey-action h4 { margin: 0; }
.hotkey-heading p { margin: .35rem 0 0; color: var(--muted, #d0aebf); font-size: .87rem; }
.hotkey-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .7rem; }
.hotkey-action { display: grid; gap: .6rem; align-content: start; padding: .75rem; border: 1px solid var(--border, #613c54);
    border-radius: .75rem; background: color-mix(in srgb, var(--surface, #2f1b2b) 85%, transparent); }
.hotkey-patterns { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.hotkey-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding: .3rem .4rem;
    border: 1px solid var(--border, #69465e); border-radius: .45rem; background: var(--app-bg, #1b121c); }
.hotkey-chip kbd { font: 600 .8rem ui-monospace, monospace; overflow-wrap: anywhere; }
.hotkey-remove { border: 0; border-radius: .25rem; padding: 0 .25rem; color: inherit; background: transparent; cursor: pointer; font-size: 1rem; }
.hotkey-remove:is(:hover, :focus-visible) { background: var(--border, #69465e); }
.hotkey-empty, .hotkey-status { color: var(--muted, #d0aebf); font-size: .83rem; }
.hotkey-status:not(:empty) { margin-block-start: .7rem; }
.hotkey-status:empty { display: none; }

.hotkey-heading-actions, .hotkey-editor-record, .hotkey-editor-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
}
#hotkeysSettings .hotkey-add {
    color: var(--text, #fff2fa);
    border-color: var(--accent, #ec7ca5);
    background: color-mix(in srgb, var(--accent, #ec7ca5) 19%, var(--surface, #291b2b));
}
.hotkey-pattern-editor:not([hidden]) {
    display: grid;
    gap: .7rem;
    margin-block: .7rem;
    padding: .8rem;
    border: 1px solid color-mix(in srgb, var(--accent, #ec7ca5) 52%, var(--border, #68435b));
    border-radius: .75rem;
    background: color-mix(in srgb, var(--surface, #302033) 92%, transparent);
}
.hotkey-pattern-editor h4 { margin: 0; }
.hotkey-editor-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: .55rem;
}
.hotkey-editor-fields label {
    display: grid;
    gap: .3rem;
    min-width: 0;
    color: var(--muted, #ccabbc);
    font-size: .85rem;
}
.hotkey-editor-fields select { width: 100%; min-width: 0; }
.hotkey-editor-record kbd {
    flex: 1 1 10rem;
    padding: .4rem .55rem;
    border: 1px solid var(--border, #69465e);
    border-radius: .45rem;
    background: var(--surface, #302033);
    overflow-wrap: anywhere;
}

#chatArea #messageForm[hidden] { display: none; }
#serverMembers .member-row { margin-block: .42rem; }

#messagesList {
    --chat-bubble-accent: var(--accent, #dc3153);
    --chat-bubble-neutral: #1c1217;
    --chat-bubble-spacing: var(--message-spacing, 6px);
    row-gap: 0;
}
body[data-theme="black"] #messagesList { --chat-bubble-accent: #a1a6b0; --chat-bubble-neutral: #171719; }
body[data-theme="wine"] #messagesList { --chat-bubble-accent: #d94383; --chat-bubble-neutral: #221220; }
body[data-theme="ember"] #messagesList { --chat-bubble-accent: #fa6539; --chat-bubble-neutral: #221610; }
#messagesList > :is(.msg, .chat-message) {
    --chat-bubble-fill: color-mix(in srgb, var(--chat-bubble-accent) 5%, var(--chat-bubble-neutral));
    --chat-bubble-bg: var(--chat-bubble-fill);
    --chat-bubble-border: color-mix(in srgb, var(--chat-bubble-accent) 18%, var(--chat-bubble-neutral));
    box-sizing: border-box;
    width: fit-content;
    max-width: min(100%, 48rem);
    margin-block: 0;
    border: 1px solid var(--chat-bubble-border);
    border-radius: .3rem .9rem .9rem;
    box-shadow: none;
    background: var(--chat-bubble-bg);
}
#messagesList > :is(.msg.mine, .chat-message.mine) {
    --chat-bubble-fill: color-mix(in srgb, var(--chat-bubble-accent) 30%, #10070c);
    --chat-bubble-dark: color-mix(in srgb, var(--chat-bubble-accent) 14%, #10070c);
    --chat-bubble-bg: linear-gradient(135deg, var(--chat-bubble-fill), var(--chat-bubble-dark));
    --chat-bubble-border: color-mix(in srgb, var(--chat-bubble-accent) 58%, var(--chat-bubble-neutral));
    border-radius: .9rem .3rem .9rem .9rem;
}
#messagesList > .chat-message { padding-block: .54rem; padding-inline-end: .85rem; }
#messagesList > :is(.msg, .chat-message).message-continued { padding-block: .4rem; }
#messagesList > .msg.message-continued > .msg-header { display: none; }
#messagesList > .msg > .msg-time { display: block; margin-block-start: .3rem; }
#messagesList > :is(.msg, .chat-message) + :is(.msg, .chat-message) {
    margin-block-start: var(--chat-bubble-spacing);
}
#messagesList > :is(.msg, .chat-message) + .message-author-changed {
    margin-block-start: calc(var(--chat-bubble-spacing) + 3px);
}
#messagesList > .is-mentioned { background: color-mix(in srgb, #81c5ff 22%, var(--chat-bubble-fill)); }

:is(#profilePage, #managedSettings) {
    --settings-navigation-width: clamp(10rem, 17vw, 14rem);
    box-sizing: border-box;
    inline-size: min(100%, 78rem);
    min-inline-size: 0;
    min-block-size: 0;
    max-block-size: min(100%, 100dvh);
    margin-inline: auto;
    padding-inline: clamp(.45rem, 2vw, 1.6rem);
    padding-block: clamp(.4rem, 2dvh, 1.35rem);
    overflow: auto;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
}
:is(#profilePage, #managedSettings, #channelSettings) :is(form, section, input, textarea, select) {
    box-sizing: border-box;
    min-inline-size: 0;
    max-inline-size: 100%;
}
:is(#profilePage, #managedSettings) :is(.nav-actions, .settings-card) button { white-space: normal; }
#profilePage #profilePreview {
    box-sizing: border-box;
    max-inline-size: min(100%, 36rem);
    overflow-wrap: anywhere;
}
#managedSettings section { max-inline-size: min(100%, 52rem); }
#channelSettings { box-sizing: border-box; max-inline-size: calc(100% - 1rem); max-block-size: calc(100dvh - 1rem); overflow: auto; }
@media (max-width: 64rem), (max-height: 38rem) {
    #profilePage > .nav-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
        float: none;
        inline-size: 100%;
        max-block-size: none;
        position: static;
        overflow: visible;
    }
    #profilePage > .nav-actions > button { min-width: 0; }

}

.dv-photo-viewer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    box-sizing: border-box;
    margin: 0;
    border: 0;
    padding: clamp(.85rem, 3vw, 2.5rem);
    background: transparent;
    color: var(--text, #fff3f7);
}
.dv-photo-viewer[open] { display: grid; place-items: center; }
.dv-photo-viewer::backdrop { background: rgb(10 7 12 / 88%); }
.dv-photo-viewer[open] { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.dv-photo-viewer img {
    width: min(100%, calc((100dvh - 2 * clamp(.85rem, 3vw, 2.5rem)) * var(--dv-photo-ratio, 1)));
    max-height: 100%; object-fit: contain; border-radius: .35rem;
}
@media (prefers-reduced-motion: no-preference) {
    .dv-photo-viewer[open]::backdrop { animation: dv-photo-backdrop .35s ease-out; }
    @keyframes dv-photo-backdrop { from { background: transparent; } }
}
.dv-photo-viewer button { position: absolute; inset: 1rem 1rem auto auto; z-index: 1; }
.dv-zoom-image { cursor: zoom-in; }

.image-crop-dialog canvas[hidden] { display: none; }
.dv-crop-stage { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; overflow: hidden; touch-action: none; }
.image-crop-dialog .dv-crop-stage > canvas {
    display: block; width: auto; height: auto; max-width: 100%; max-height: min(35dvh, 340px);
    margin: 0; border: 0; border-radius: 0; pointer-events: none;
}
.dv-crop-guide {
    position: absolute; box-sizing: border-box; border: 2px solid var(--accent, #ec7ca5);
    box-shadow: 0 0 0 200vw rgb(8 5 11 / 60%); cursor: grab;
}
.dv-crop-guide:active { cursor: grabbing; }
.dv-crop-previews { display: flex; flex-wrap: wrap; align-items: end; justify-content: center; gap: .7rem; }
.dv-crop-previews figure { margin: 0; width: min-content; text-align: center; font-size: .78rem; color: var(--muted, #d0aebf); }
.image-crop-dialog .dv-crop-previews canvas { display: block; height: auto; max-width: min(100%, 33vw); aspect-ratio: 1; border-radius: 50%; margin: 0 auto .25rem; }

.dv-preview-title { margin: 0 0 .6rem; font-size: .86rem; color: var(--muted, #cdaaba); }
.dv-account-dialog {
    box-sizing: border-box;
    width: min(36rem, calc(100% - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    padding: clamp(.8rem, 3vw, 1.35rem);
    border: 1px solid var(--border, #68435b);
    border-radius: .95rem;
    background: var(--panel, #231821);
    color: var(--text, #fff3f7);
    overflow: auto;
    color-scheme: dark;
}
.dv-account-dialog::backdrop { background: rgb(12 7 15 / 72%); }
.dv-account-dialog-heading, .dv-account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.dv-account-dialog-heading { justify-content: space-between; margin-block-end: .65rem; }
.dv-account-dialog-heading h2 { margin: 0; font-size: 1.25rem; }
.dv-account-dialog p { color: var(--muted, #cdaaba); overflow-wrap: anywhere; }
.dv-account-dialog p:empty { display: none; }
.dv-danger { color: #ff9dad; }
.dv-session-list { display: grid; gap: .4rem; list-style: none; padding: 0; margin-block: .7rem; }
.dv-session-list > li {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .55rem;
    padding: .6rem; border: 1px solid var(--border, #68435b); border-radius: .55rem;
}
.dv-session-list small { display: block; margin-top: .2rem; color: var(--muted, #cdaaba); }
#accountPasswordForm, #passwordFields { display: grid; gap: .66rem; }
#passwordFields label { display: grid; gap: .3rem; }
#passwordFields input {
    width: 100%; min-width: 0; box-sizing: border-box; padding: .55rem .7rem; border-radius: .55rem;
    border: 1px solid var(--border, #68435b); color: inherit; background: var(--app-bg, #1b121c);
}
#passwordFields input[name="code"] { letter-spacing: .45em; font: 700 1.2rem ui-monospace, monospace; letter-spacing: .45em; }
#accountPasswordForm > button { justify-self: start; }

@supports (zoom: 1) {
    #profilePage {
        zoom: var(--dv-settings-scale, 1);
        width: min(calc(100% / var(--dv-settings-scale, 1)), 78rem);
        max-block-size: calc(100% / var(--dv-settings-scale, 1));
    }
}

#messagesList .call-history-notice {
    margin: .35rem 0;
    color: var(--muted, #a9a2aa);
    font-size: .8rem;
    overflow-wrap: anywhere;
}
#messagesList .call-history-notice time { white-space: nowrap; }

:is(.avatar, .message-avatar, .server-self-avatar, .voice-roster-avatar, .voice-tile-avatar,
    .suggestion-avatar, .message-toast-avatar, .incoming-call-avatar, .remembered-avatar) {
    box-sizing: border-box;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 50%;
}
:is(.avatar, .message-avatar, .server-self-avatar, .voice-roster-avatar, .voice-tile-avatar,
    .suggestion-avatar, .message-toast-avatar, .incoming-call-avatar, .remembered-avatar) > img {
    object-fit: cover;
    border-radius: inherit;
}
