.discord-drawer {
    position: fixed;
    z-index: 1050;
    top: 50%;
    right: 0;
    width: min(340px, calc(100vw - 56px));
    transform: translate(calc(100% - 1px), -50%);
    transition: transform .32s ease;
    font-family: 'Outfit', sans-serif;
}

.discord-drawer.is-open { transform: translate(0, -50%); }

.discord-drawer:not(.is-open):not(:hover):not(:focus-within) {
    animation: discord-drawer-peek 8s ease-in-out 2.5s infinite;
}

@keyframes discord-drawer-peek {
    0%, 30%, 46%, 100% { transform: translate(calc(100% - 1px), -50%); }
    35%, 41% { transform: translate(calc(100% - 13px), -50%); }
}

.discord-drawer-tab {
    position: absolute;
    top: 50%;
    left: -48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 48px;
    height: 142px;
    padding: .7rem .3rem;
    border: 1px solid #3976b6;
    border-radius: 13px 0 0 13px;
    background: linear-gradient(180deg, #1d568f, #123b69);
    color: #c8def9;
    box-shadow: -7px 4px 24px rgba(5, 25, 56, .3);
    font-size: .79rem;
    font-weight: 800;
    letter-spacing: .08em;
    cursor: pointer;
    transform: translateY(-50%);
}

.discord-drawer-tab:focus-visible, .discord-drawer-close:focus-visible, .discord-drawer-join:focus-visible { outline: 3px solid #9bd3ff; outline-offset: 3px; }
.discord-drawer-tab .bi { font-size: 1.5rem; line-height: 1; transform: rotate(90deg); }
.discord-drawer-tab span { writing-mode: vertical-rl; transition: color .2s ease, text-shadow .2s ease; }
.discord-drawer-tab:hover span, .discord-drawer-tab:focus-visible span { color: #fff; text-shadow: 0 0 8px rgba(189, 224, 255, .75); }

.discord-drawer-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100svh - 24px);
    padding: 19px;
    border: 1px solid rgba(153, 178, 255, .14);
    border-radius: 13px 0 0 13px;
    background: #292b38;
    color: #f2f3fb;
    box-shadow: -14px 12px 40px rgba(0, 0, 0, .35);
}

.discord-drawer-heading, .discord-drawer-heading-title, .discord-drawer-counts, .discord-drawer-join { display: flex; align-items: center; }
.discord-drawer-heading { justify-content: space-between; gap: .5rem; }
.discord-drawer-heading-title { gap: .65rem; min-width: 0; }
.discord-drawer-heading-title > .bi { color: #7289ff; font-size: 1.25rem; }
.discord-drawer-heading h2 { overflow: hidden; margin: 0; color: #fff; font-size: 1.05rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.discord-drawer-close { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #abb3d0; cursor: pointer; }
.discord-drawer-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.discord-drawer-counts { flex-wrap: wrap; gap: .35rem 1rem; padding: .35rem 0 13px 27px; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #bec4da; font-size: .79rem; }
.discord-drawer-counts strong { color: #f2f3fb; font-weight: 600; }
.discord-drawer-counts .bi { color: #7289ff; }
.discord-drawer-online-dot { display: inline-block; width: 9px; height: 9px; margin-right: .1rem; border-radius: 50%; background: #45d88e; box-shadow: 0 0 8px rgba(69, 216, 142, .6); }
.discord-drawer-members { min-height: 160px; max-height: min(310px, 38svh); overflow-y: auto; padding: 12px 2px; scrollbar-color: #6972bd transparent; scrollbar-width: thin; }
.discord-drawer-member { display: flex; align-items: center; gap: .65rem; min-height: 39px; padding: .3rem 0; color: #d8daef; font-size: .88rem; }
.discord-drawer-avatar { position: relative; display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #555d7d; color: #fff; font-size: .8rem; font-weight: 700; }
.discord-drawer-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.discord-drawer-avatar::after { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2px solid #292b38; border-radius: 50%; background: #43d890; content: ''; }
.discord-drawer-avatar.is-idle::after { background: #f4bd57; }
.discord-drawer-avatar.is-dnd::after { background: #f15f72; }
.discord-drawer-member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-drawer-message { margin: .6rem 0; color: #adb4cf; font-size: .83rem; line-height: 1.5; }
.discord-drawer-join { justify-content: center; gap: .5rem; min-height: 44px; margin-top: 2px; padding: .65rem .7rem; border-radius: 6px; background: #41456a; color: #91a1ff; font-size: .86rem; font-weight: 700; text-align: center; text-decoration: none; }
.discord-drawer-join:hover { background: #505681; color: #fff; }

@media (max-width: 575.98px) {
    .discord-drawer-tab { left: -43px; width: 43px; height: 124px; }
    .discord-drawer-panel { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .discord-drawer { animation: none !important; transition: none; }
    .discord-drawer-tab span { transition: none; }
}
