:root {
    --bg: #131d32;
    --bg-elevated: #1a2842;
    --bg-card: #223353;
    --bg-hover: #2c4270;
    --line: #4e678e;
    --txt: #f2f7ff;
    --txt-soft: #afc2e1;
    --brand: #2eb3c5;
    --ok: #2dc770;
    --danger: #e15b64;
    --radius: 14px;
}

.theme-sunrise {
    --bg: #261b14;
    --bg-elevated: #35261d;
    --bg-card: #3f2d22;
    --bg-hover: #513729;
    --line: #6d4a35;
    --txt: #f8efe6;
    --txt-soft: #d6bda8;
    --brand: #eb7f48;
}

.theme-forest {
    --bg: #101f19;
    --bg-elevated: #132920;
    --bg-card: #1b3429;
    --bg-hover: #244436;
    --line: #335947;
    --txt: #edf7f2;
    --txt-soft: #a9cabd;
    --brand: #2fa36b;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Avenir Next", "Poppins", "Segoe UI", sans-serif;
    color: var(--txt);
    background:
        radial-gradient(900px 520px at -10% -8%, rgba(67, 198, 255, 0.35), transparent 62%),
        radial-gradient(780px 450px at 100% 2%, rgba(255, 146, 189, 0.28), transparent 62%),
        linear-gradient(155deg, #101a2e 0%, #15253f 42%, #1a3150 100%);
}

.app-shell {
    animation: appFadeIn 320ms ease-out;
}

.dev-version-badge {
    position: fixed;
    right: 0.9rem;
    bottom: 0.9rem;
    z-index: 120;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #dbe8ff;
    background: rgba(9, 15, 28, 0.74);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

@keyframes appFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

a {
    color: #9cb0ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-page {
    max-width: 1040px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.profile-peek-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.self-profile-trigger {
    border: 0;
    background: transparent;
    color: #e9f0ff;
    font: inherit;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.self-profile-trigger:hover {
    color: #b9dcff;
}

.profile-edit-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.2rem;
    padding-top: 0.75rem;
    display: grid;
    gap: 0.55rem;
}

.profile-edit-panel h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #dbe7ff;
}

.profile-edit-panel .field {
    display: grid;
    gap: 0.3rem;
}

.profile-edit-panel .field label {
    font-size: 0.76rem;
    color: #9eaccb;
}

.profile-edit-panel input,
.profile-edit-panel textarea,
.profile-edit-panel select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(139, 165, 219, 0.32);
    background: rgba(8, 13, 24, 0.6);
    color: #edf4ff;
    padding: 0.52rem 0.62rem;
}

.profile-edit-panel input[type="color"] {
    min-height: 42px;
    padding: 0.22rem;
}

.profile-edit-panel textarea {
    resize: vertical;
}

.profile-edit-panel .check-inline {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.78rem;
    color: #9fb0d4;
}

.profile-edit-actions {
    margin-top: 0.15rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
}

.profile-design-grid,
.profile-social-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-design-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-social-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero {
    background: linear-gradient(145deg, #2f3645 0%, #252a35 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.hero h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
}

.hero p {
    margin: 0;
    color: var(--txt-soft);
}

.quick-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-kpis {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.hero-kpis div {
    border: 1px solid rgba(136, 155, 208, 0.28);
    background: rgba(27, 36, 55, 0.55);
    border-radius: 12px;
    padding: 0.6rem;
    display: grid;
    gap: 0.1rem;
}

.hero-kpis strong {
    font-size: 0.92rem;
}

.hero-kpis small {
    color: #aeb9cf;
}

.landing-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.landing-card {
    border: 1px solid rgba(136, 155, 208, 0.25);
    border-radius: 14px;
    background: rgba(22, 30, 45, 0.66);
    padding: 0.9rem;
}

.landing-card h2 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.landing-card p {
    margin: 0;
    color: #a8b4cd;
}

.landing-banner {
    margin-top: 1rem;
    border: 1px solid rgba(143, 169, 231, 0.3);
    border-radius: 16px;
    background: linear-gradient(120deg, rgba(62, 89, 178, 0.28), rgba(22, 33, 52, 0.9));
    padding: 1rem;
}

.landing-banner h2 {
    margin: 0 0 0.4rem;
}

.landing-banner p {
    margin: 0 0 0.8rem;
    color: #c6d2eb;
}

.landing-fun-page {
    position: relative;
}

.landing-fun-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 18%, rgba(96, 214, 255, 0.18), transparent 28%),
        radial-gradient(circle at 92% 10%, rgba(255, 167, 197, 0.14), transparent 34%),
        radial-gradient(circle at 45% 85%, rgba(255, 214, 122, 0.11), transparent 34%);
}

.landing-fun-hero,
.landing-fun-grid .landing-card,
.landing-fun-banner {
    backdrop-filter: blur(16px) saturate(1.25);
}

.landing-pill {
    display: inline-block;
    margin-bottom: 0.45rem;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    border: 1px solid rgba(191, 226, 255, 0.48);
    background: rgba(56, 99, 149, 0.36);
    color: #def2ff;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.landing-fun-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-fun-grid .landing-card {
    border: 1px solid rgba(174, 204, 255, 0.26);
    background: linear-gradient(155deg, rgba(30, 48, 79, 0.62), rgba(16, 28, 48, 0.56));
    box-shadow: 0 16px 30px rgba(2, 10, 24, 0.3);
}

.landing-fun-banner {
    background: linear-gradient(130deg, rgba(57, 112, 149, 0.46), rgba(25, 38, 65, 0.72));
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.14s ease;
}

.btn-primary {
    background: var(--brand);
    color: #09282d;
}

.btn-secondary {
    background: #444f64;
    color: #fff;
}

.btn-ghost {
    background: rgba(177, 205, 245, 0.12);
    color: #d7e6ff;
    border: 1px solid rgba(172, 202, 247, 0.32);
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    text-decoration: none;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.2rem;
}

.auth-wrap-fancy {
    grid-template-columns: minmax(280px, 430px) minmax(320px, 460px);
    gap: 1rem;
    align-items: stretch;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(140deg, rgba(88, 101, 242, 0.28), rgba(20, 24, 35, 0.9));
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.auth-visual h2 {
    margin: 0;
    font-size: 1.9rem;
}

.auth-visual p {
    margin: 0.5rem 0 0;
    color: var(--txt-soft);
}

.auth-points {
    margin: 0.8rem 0 0;
    padding-left: 1rem;
    color: #ccd6ea;
    display: grid;
    gap: 0.25rem;
}

.pulse-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    animation: orbFloat 6s ease-in-out infinite;
}

.orb-a,
.orb-c {
    width: 180px;
    height: 180px;
    left: -35px;
    top: 20px;
    background: rgba(133, 155, 255, 0.4);
}

.orb-b,
.orb-d {
    width: 150px;
    height: 150px;
    right: -24px;
    top: 60px;
    background: rgba(94, 240, 157, 0.3);
    animation-delay: -1.8s;
}

@keyframes orbFloat {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-16px) scale(1.06);
    }
}

.auth-card-fancy {
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.35);
}

.auth-card {
    width: min(450px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
}

.auth-card h1 {
    margin-top: 0;
}

.field {
    margin-bottom: 0.9rem;
}

.field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: var(--txt-soft);
}

.field input {
    width: 100%;
    padding: 0.7rem 0.8rem;
    background: #1f2430;
    border: 1px solid #3b4455;
    border-radius: 10px;
    color: var(--txt);
}

.field select {
    width: 100%;
    padding: 0.7rem 0.8rem;
    background: #1f2430;
    border: 1px solid #3b4455;
    border-radius: 10px;
    color: var(--txt);
}

.flash {
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    margin-bottom: 0.7rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.flash-error {
    background: rgba(225, 91, 100, 0.16);
    border: 1px solid rgba(225, 91, 100, 0.5);
}

.flash-success {
    background: rgba(45, 199, 112, 0.16);
    border: 1px solid rgba(45, 199, 112, 0.5);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.workspace-shell {
    display: grid;
    grid-template-columns: 250px 300px 1fr;
    gap: 0.9rem;
}

.workspace-servers,
.workspace-channels,
.workspace-main {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
}

.workspace-servers h3,
.workspace-channels h3,
.workspace-main h2 {
    margin-top: 0;
}

.workspace-server-item,
.workspace-channel-item {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    color: var(--txt);
    margin-bottom: 0.25rem;
}

.channel-manage-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.25rem;
}

.inline-popover .compact-form {
    right: 0;
    left: auto;
}

.workspace-server-item:hover,
.workspace-channel-item:hover,
.workspace-server-item.is-active {
    background: var(--bg-hover);
    text-decoration: none;
}

.workspace-empty {
    display: block;
    color: var(--txt-soft);
    margin-bottom: 0.6rem;
}

.workspace-channel-item.is-active {
    background: var(--bg-hover);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
}

.stat-card strong {
    display: block;
    font-size: 1.4rem;
}

.discord-layout {
    display: grid;
    grid-template-columns: 72px 260px 1fr 320px;
    min-height: 100vh;
}

.guild-strip {
    background: #171a21;
    border-right: 1px solid #11141a;
    padding: 0.8rem 0.55rem;
}

.guild-pill {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.guild-pill.is-active {
    border-radius: 12px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.36) inset;
}

.channel-sidebar {
    background: #20242d;
    border-right: 1px solid #1a1d23;
    padding: 1rem;
}

.channel-title {
    margin: 0;
    font-size: 1rem;
}

.channel-sub {
    margin: 0.35rem 0 1rem;
    color: var(--txt-soft);
    font-size: 0.85rem;
}

.chat-main {
    background: #313740;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.chat-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #272c37;
    font-weight: 700;
}

.chat-header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}

.chat-header-main-left {
    display: grid;
    gap: 0.18rem;
}

.channel-topic-line {
    color: #b8cae7;
    font-weight: 500;
}

.channel-meta-line {
    color: #8fa7cf;
    font-size: 0.74rem;
}

.channel-topic-popover {
    margin-top: 0.2rem;
}

.channel-topic-popover summary {
    width: fit-content;
}

.channel-topic-popover textarea {
    width: 100%;
    padding: 0.62rem 0.75rem;
    background: #1f2430;
    border: 1px solid #3b4455;
    border-radius: 10px;
    color: var(--txt);
    resize: vertical;
    min-height: 72px;
}

.chat-header-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header-icon-btn {
    border: 1px solid rgba(124, 149, 198, 0.3);
    border-radius: 9px;
    background: rgba(15, 26, 44, 0.62);
    color: #d6e6ff;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.chat-header-icon-btn[data-chat-target="notifCenterButton"] {
    width: auto;
    min-width: 42px;
    padding: 0 0.45rem;
    font-size: 0.78rem;
}

.chat-header-icon-btn[data-chat-target="notifCenterButton"].has-unread {
    border-color: rgba(246, 196, 106, 0.65);
    box-shadow: 0 0 0 1px rgba(246, 196, 106, 0.25) inset;
}

.chat-header-icon-btn.is-active {
    border-color: rgba(137, 223, 170, 0.55);
    box-shadow: 0 0 0 1px rgba(126, 230, 165, 0.28) inset;
}

.chat-search-count {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    color: #d8e4f8;
    border: 1px solid rgba(129, 157, 207, 0.28);
    background: rgba(12, 22, 39, 0.64);
}

.chat-live-stats {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    color: #d8e4f8;
    border: 1px solid rgba(129, 157, 207, 0.28);
    background: rgba(12, 22, 39, 0.64);
}

.chat-e2ee-badge {
    padding: 0.14rem 0.44rem;
    border-radius: 999px;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(196, 215, 244, 0.58);
    border: 1px solid rgba(131, 157, 213, 0.18);
    background: rgba(12, 22, 39, 0.28);
    user-select: none;
    pointer-events: none;
}

.chat-search-input {
    width: min(340px, 42vw);
    border: 1px solid rgba(131, 157, 213, 0.3);
    background: rgba(11, 19, 34, 0.72);
    border-radius: 10px;
    color: #dce8fb;
    padding: 0.5rem 0.62rem;
}

@media (max-width: 880px) {
    .chat-header-main {
        flex-direction: column;
    }

    .chat-header-tools {
        width: 100%;
        flex-wrap: wrap;
    }

    .chat-search-input {
        width: 100%;
    }
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.pinned-message-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.6rem;
    margin: 0.5rem 1rem 0;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(140, 167, 217, 0.3);
    border-radius: 11px;
    background: rgba(15, 24, 38, 0.72);
}

.pinned-message-bar strong {
    font-size: 0.8rem;
    color: #dbe8ff;
}

.pinned-message-link {
    border: 0;
    background: transparent;
    color: #ccdcf7;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0;
}

.pinned-message-link:hover {
    color: #f1f6ff;
}

.chat-log {
    scrollbar-width: none;
}

.chat-log::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.chat-jump-new {
    position: sticky;
    bottom: 0.7rem;
    margin: 0 1rem 0.2rem auto;
    z-index: 2;
    border: 1px solid rgba(124, 160, 231, 0.42);
    border-radius: 999px;
    background: rgba(22, 44, 83, 0.88);
    color: #ddecff;
    padding: 0.38rem 0.72rem;
    cursor: pointer;
}

.message {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 0.35rem 0.62rem;
    padding: 0.5rem 0.4rem;
    border-radius: 8px;
}

.message:hover {
    background: rgba(255, 255, 255, 0.04);
}

.message.is-highlighted {
    background: rgba(99, 152, 247, 0.2);
    box-shadow: 0 0 0 1px rgba(120, 171, 255, 0.55) inset;
}

.message.is-grouped {
    grid-template-columns: 42px 1fr;
    padding-top: 0.12rem;
}

.message.is-grouped .message-avatar {
    visibility: hidden;
}

.message.is-grouped .message-meta {
    display: none;
}

.message.is-grouped .message-main {
    margin-top: -0.05rem;
}

.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(160deg, #2c4878, #1f3152);
    border: 1px solid rgba(146, 176, 230, 0.35);
    color: #e8f2ff;
    display: grid;
    place-items: center;
    font-weight: 700;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-main {
    display: grid;
    gap: 0.2rem;
}

.message-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.message-meta small,
.message small {
    color: var(--txt-soft);
    font-size: 0.74rem;
}

.message [data-message-content] {
    white-space: pre-wrap;
}

.chat-link {
    color: #69a8ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-link:hover {
    color: #8bc0ff;
}

.quick-switcher {
    position: fixed;
    inset: 0;
    z-index: 140;
}

.quick-switcher-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 18, 0.6);
    backdrop-filter: blur(2px);
}

.quick-switcher-dialog {
    position: relative;
    margin: 10vh auto 0;
    width: min(640px, 92vw);
    border: 1px solid rgba(127, 158, 215, 0.34);
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(28, 41, 66, 0.97), rgba(13, 20, 34, 0.97));
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.45);
    padding: 0.7rem;
    display: grid;
    gap: 0.55rem;
}

.quick-switcher-dialog header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.quick-switcher-dialog header small {
    color: #9ab0d5;
}

.quick-switcher-dialog input {
    width: 100%;
    border: 1px solid rgba(118, 149, 206, 0.34);
    border-radius: 10px;
    padding: 0.66rem 0.72rem;
    background: rgba(8, 15, 26, 0.85);
    color: #e2edff;
}

.quick-switcher-list {
    max-height: min(56vh, 420px);
    overflow: auto;
    display: grid;
    gap: 0.3rem;
}

.quick-switcher-item {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(109, 138, 193, 0.24);
    border-radius: 10px;
    background: rgba(20, 31, 52, 0.7);
    color: #deebff;
    padding: 0.5rem 0.62rem;
    display: grid;
    gap: 0.15rem;
    cursor: pointer;
}

.quick-switcher-item small {
    color: #a0b5d8;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.quick-switcher-item:hover,
.quick-switcher-item.is-selected {
    background: rgba(55, 88, 151, 0.62);
    border-color: rgba(144, 176, 239, 0.45);
}

.message-embed,
.message-attachment {
    margin-top: 0.4rem;
    border: 1px solid #38435b;
    border-radius: 10px;
    background: #1b2230;
    padding: 0.45rem;
}

.message-embed iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
    background: #000;
}

.youtube-card {
    width: min(100%, 360px);
    display: grid;
    gap: 0.4rem;
    text-decoration: none;
    color: #d7e2f5;
}

.youtube-card img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.youtube-card span {
    font-size: 0.8rem;
    color: #98accf;
}

.message-attachment img,
.message-attachment video {
    width: min(100%, 520px);
    border-radius: 8px;
    display: block;
}

.message-attachment-warning {
    margin-top: 0.32rem;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(223, 169, 93, 0.38);
    background: rgba(79, 56, 24, 0.35);
    color: #e8cb9b;
}

.message-attachment audio {
    width: min(100%, 520px);
    display: block;
}

.typing-indicator {
    color: var(--txt-soft);
    font-size: 0.83rem;
    padding: 0 1rem 0.25rem;
}

.typing-indicator[hidden] {
    display: none !important;
}

.typing-indicator:empty {
    display: none;
}

.message-context-menu {
    position: fixed;
    z-index: 131;
    min-width: 190px;
    display: grid;
    padding: 0.35rem;
    gap: 0.2rem;
    border-radius: 10px;
    border: 1px solid rgba(130, 156, 210, 0.34);
    background: rgba(13, 20, 34, 0.97);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.message-context-menu[hidden] {
    display: none !important;
}

.message-context-menu button {
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 0.42rem 0.52rem;
    color: #dce7fa;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
}

.message-context-menu button span {
    display: inline-block;
    width: 1.1rem;
    opacity: 0.95;
}

.message-context-menu button:hover {
    background: rgba(101, 138, 206, 0.22);
}

.message-context-menu .menu-separator {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(131, 158, 211, 0.24);
    margin: 0.15rem 0;
}

.message-inline-editor {
    margin-top: 0.3rem;
    border: 1px solid rgba(116, 147, 206, 0.35);
    border-radius: 11px;
    background: rgba(13, 22, 39, 0.82);
    padding: 0.4rem;
    display: grid;
    gap: 0.35rem;
}

.message-inline-editor textarea {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    border: 1px solid rgba(117, 148, 206, 0.32);
    border-radius: 9px;
    background: rgba(9, 15, 27, 0.85);
    color: #deebff;
    padding: 0.5rem;
    font: inherit;
}

.message-inline-editor-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.message-inline-editor-actions small {
    color: #9eb4d9;
    font-size: 0.72rem;
}

.message-edited-badge {
    color: #9fb7de;
}

.message-day-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.6rem 0 0.35rem;
}

.message-day-separator span {
    border: 1px solid rgba(140, 165, 214, 0.26);
    border-radius: 999px;
    padding: 0.14rem 0.58rem;
    font-size: 0.73rem;
    color: #96adcf;
    background: rgba(12, 20, 35, 0.75);
}

.composer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem;
    border-top: 1px solid #272c37;
    background: #252b36;
    border-radius: 12px;
    margin: 0.55rem;
}

.composer input {
    flex: 1;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: var(--txt);
    padding: 0.75rem 0.5rem;
}

.composer-plus {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid #4a5777;
    background: #2e3a56;
    color: #dbe3f4;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
}

.composer-plus.is-recording {
    background: linear-gradient(180deg, #9b2028, #7c1b22);
    border-color: #d66972;
    color: #fff1f2;
    animation: voicePulse 900ms ease-in-out infinite;
}

.voice-note-hud {
    margin: 0 1rem 0.45rem;
    border: 1px solid rgba(114, 145, 203, 0.24);
    border-radius: 10px;
    padding: 0.2rem 0.45rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.35rem;
    align-items: center;
    background: rgba(14, 22, 37, 0.52);
    font-size: 0.85rem;
}

.voice-note-hud[hidden] {
    display: none !important;
}

.voice-note-hud canvas {
    width: 100%;
    height: 20px;
    border-radius: 8px;
    background: rgba(6, 12, 22, 0.8);
}

.voice-player {
    border: 1px solid rgba(113, 138, 187, 0.28);
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(20, 31, 52, 0.84), rgba(13, 23, 40, 0.82));
    padding: 0.5rem;
}

.voice-player audio {
    display: none;
}

.voice-player-ui {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
}

.voice-player-btn {
    border: 1px solid #4f648f;
    background: #1f355f;
    color: #e6eefc;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    cursor: pointer;
}

.voice-player-progress {
    width: 100%;
}

.voice-player-time {
    color: #aeb9cf;
    font-size: 0.78rem;
}

@keyframes voicePulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.composer-file-label {
    min-width: 140px;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
    color: #aeb8cc;
}

.media-panel {
    background: #282e39;
    border-left: 1px solid #1c212b;
    padding: 0.9rem;
}

.media-panel h2 {
    margin: 0.2rem 0 0.8rem;
    font-size: 1rem;
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.media-video,
.media-remote {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.5rem;
}

.media-remote {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.remote-tile {
    border: 1px solid #36405a;
    border-radius: 10px;
    overflow: hidden;
    background: #101522;
    display: grid;
}

.remote-tile.is-screen-share {
    border-color: #86b3ff;
    box-shadow: 0 0 0 1px rgba(134, 179, 255, 0.3) inset;
}

.remote-tile video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.remote-label {
    padding: 0.3rem 0.45rem;
    color: #c9d1e0;
    font-size: 0.75rem;
}

.member-list {
    display: grid;
    gap: 0.4rem;
}

.member-row {
    display: grid;
    position: relative;
    overflow: hidden;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "dot name"
        ". voice";
    column-gap: 0.55rem;
    row-gap: 0.1rem;
    align-items: center;
    background: #141d31;
    border-radius: 12px;
    padding: 0.38rem 0.5rem;
    border: 1px solid rgba(120, 145, 198, 0.22);
    box-shadow: 0 8px 18px rgba(5, 10, 20, 0.22);
}

.member-row > * {
    position: relative;
    z-index: 1;
}

.member-row.has-profile-banner {
    padding-top: 0.68rem;
    border: 1px solid rgba(133, 160, 220, 0.28);
    background: #131c2f;
    background-image:
        linear-gradient(180deg, rgba(10, 18, 32, 0.16), rgba(10, 18, 32, 0.5)),
        var(--member-row-banner);
    background-size: 100% 18px, cover;
    background-position: 0 0, center top;
    background-repeat: no-repeat;
}

.member-name-btn {
    background: #0f1728;
    border: none;
    color: var(--member-name-color, inherit);
    text-align: left;
    padding: 0.16rem 0.24rem;
    cursor: pointer;
    font: inherit;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "avatar badge"
        ". mood";
    column-gap: 0.35rem;
    row-gap: 0.14rem;
    align-items: center;
    grid-area: name;
    min-width: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(128, 156, 215, 0.3);
}

.member-row.has-profile-banner .member-name-btn {
    background: rgba(10, 16, 28, 0.9);
}

.member-name-label {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--member-name-color, #dfe9ff);
}

.member-avatar-mini {
    grid-area: avatar;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid rgba(18, 27, 43, 0.88);
    background: rgba(43, 56, 87, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    overflow: hidden;
    color: #ecf2ff;
}

.member-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.member-name-badge {
    grid-area: badge;
    display: inline-flex;
    align-items: baseline;
    gap: 0.32rem;
    padding: 0.15rem 0.33rem;
    border-radius: 9px;
    background: rgba(17, 26, 44, 0.72);
    border: 1px solid rgba(137, 160, 210, 0.24);
    min-width: 0;
    max-width: clamp(120px, 40vw, 240px);
}

.member-name-tag {
    color: var(--member-tag-color, rgba(192, 213, 255, 0.95));
    font-size: 0.74rem;
    font-weight: 600;
}

.member-mood {
    grid-area: mood;
    color: #d2def7;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 148px;
    opacity: 0.95;
}

.member-name-btn.profile-font-sans {
    font-family: "Avenir Next", "Poppins", "Segoe UI", sans-serif;
}

.member-name-btn.profile-font-serif {
    font-family: "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
}

.member-name-btn.profile-font-mono {
    font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}

.member-name-btn.profile-font-display {
    font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
    letter-spacing: 0.015em;
}

.member-name-btn.profile-font-rounded {
    font-family: "Nunito", "Avenir Next", "Segoe UI", sans-serif;
}

.member-name-btn.profile-font-classic {
    font-family: "Garamond", "Palatino", "Times New Roman", serif;
}

.member-name-btn.profile-font-tech {
    font-family: "Consolas", "JetBrains Mono", monospace;
}

.member-name-btn.profile-font-strong {
    font-family: "Impact", "Arial Black", "Segoe UI", sans-serif;
    letter-spacing: 0.01em;
}

.member-name-btn:hover {
    color: var(--member-name-color, inherit);
    text-decoration: none;
    filter: brightness(1.05);
}

.member-name-btn:focus,
.member-name-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.profile-dm-bubble {
    border-radius: 999px;
    border: 1px solid rgba(198, 229, 255, 0.35);
    background:
        linear-gradient(180deg, rgba(241, 250, 255, 0.9), rgba(213, 233, 255, 0.86)),
        linear-gradient(140deg, rgba(126, 212, 255, 0.3), rgba(174, 206, 255, 0.32));
    color: #16324f;
    font-weight: 700;
    padding: 0.55rem 1rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.68),
        0 8px 18px rgba(66, 129, 201, 0.28);
}

.profile-dm-bubble:hover {
    text-decoration: none;
    filter: brightness(1.04);
}

.member-dot {
    grid-area: dot;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(8, 12, 20, 0.95);
}

small[data-member-status-label-for] {
    display: none;
}

small[data-member-voice-for] {
    grid-area: voice;
    justify-self: start;
    color: #b6c7ea;
    font-size: 0.68rem;
}

small[data-member-voice-for]:empty {
    display: none;
}

.member-dot.is-online {
    background: var(--ok);
}

.member-dot.is-idle {
    background: #f3b55f;
}

.member-dot.is-dnd {
    background: #f06a75;
}

.member-dot.is-offline {
    background: #6f7788;
}

.workspace-channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #c2c9d6;
}

.workspace-channel-item:hover {
    color: #fff;
}

.channel-context-menu {
    position: fixed;
    z-index: 130;
    min-width: 170px;
    display: grid;
    padding: 0.35rem;
    gap: 0.2rem;
    border-radius: 10px;
    border: 1px solid rgba(130, 156, 210, 0.34);
    background: rgba(13, 20, 34, 0.97);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.channel-context-menu[hidden] {
    display: none !important;
}

.channel-context-menu button {
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 0.42rem 0.52rem;
    color: #dce7fa;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
}

.channel-context-menu button:hover {
    background: rgba(101, 138, 206, 0.22);
}

.voice-channel-block {
    border-radius: 9px;
    margin-bottom: 0.2rem;
}

.voice-channel-block.is-active {
    background: rgba(255, 255, 255, 0.05);
}

.voice-connected-list {
    display: grid;
    gap: 0.18rem;
    padding: 0 0.3rem 0.35rem 1.8rem;
}

.voice-connected-item {
    color: #aeb7c8;
    font-size: 0.82rem;
    line-height: 1.2;
}

.voice-muted-badge {
    margin-left: 0.4rem;
    padding: 0.12rem 0.36rem;
    border-radius: 999px;
    border: 1px solid rgba(225, 91, 100, 0.45);
    background: rgba(225, 91, 100, 0.16);
    color: #ffb1b9;
    font-size: 0.68rem;
}

.voice-connected-item.is-self {
    color: #dce3f3;
    gap: 0.4rem;
    font-weight: 600;
}

.composer-error {
    padding: 0 1rem 0.7rem;
    color: #ff9aa3;
    font-size: 0.82rem;
}

.composer-error:empty {
    display: none;
}

.reply-preview {
    margin: 0.3rem 1rem 0;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid #394660;
    background: rgba(16, 22, 35, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: #d2d9e6;
    font-size: 0.82rem;
}

.reply-preview[hidden] {
    display: none !important;
}

.emoji-panel {
    margin: 0.45rem 1rem 0;
    padding: 0.35rem;
    border: 1px solid #33405d;
    border-radius: 10px;
    background: rgba(12, 18, 31, 0.92);
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.emoji-panel button {
    background: #1f2a44;
    border: 1px solid #304061;
    border-radius: 8px;
    padding: 0.28rem 0.45rem;
    cursor: pointer;
}

.message-reply {
    color: #aab5cb;
}

.message-author-btn {
    font-size: 0.98rem;
    font-weight: 700;
    color: #eaf3ff;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.message-author-btn:hover {
    color: #ffffff;
    text-decoration: underline;
}

.message-bot-badge {
    margin-left: 0.4rem;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(131, 210, 255, 0.55);
    background: rgba(56, 134, 186, 0.28);
    color: #d9f2ff;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    padding: 0.08rem 0.42rem;
    vertical-align: middle;
}

.message.is-bot-message {
    border-left: 2px solid rgba(123, 198, 255, 0.45);
}

.voice-status {
    color: var(--txt-soft);
    font-size: 0.82rem;
    margin: 0 0 0.7rem;
}

.composer-plus:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
}

.voice-dock {
    background: #111722;
    border: 1px solid #2b3550;
    border-radius: 10px;
    padding: 0.55rem;
}

.voice-dock.is-idle {
    opacity: 0.8;
}

.voice-dock-head {
    display: grid;
    gap: 0.12rem;
    margin-bottom: 0.45rem;
}

.voice-dock-head strong {
    font-size: 0.78rem;
}

.voice-dock-head small {
    color: var(--txt-soft);
    font-size: 0.72rem;
}

.voice-conn-quality {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.16rem;
    width: fit-content;
}

.voice-conn-quality span {
    display: inline-block;
    width: 4px;
    border-radius: 999px;
    background: rgba(157, 173, 199, 0.42);
}

.voice-conn-quality span:nth-child(1) { height: 6px; }
.voice-conn-quality span:nth-child(2) { height: 9px; }
.voice-conn-quality span:nth-child(3) { height: 12px; }
.voice-conn-quality span:nth-child(4) { height: 15px; }

.voice-conn-quality em {
    margin-left: 0.28rem;
    font-style: normal;
    font-size: 0.66rem;
    color: #9fb1d0;
}

.voice-conn-quality.is-green span {
    background: rgba(95, 235, 158, 0.9);
}

.voice-conn-quality.is-orange span {
    background: rgba(243, 186, 96, 0.9);
}

.voice-conn-quality.is-red span {
    background: rgba(239, 111, 111, 0.9);
}

.voice-conn-quality.is-gray span {
    background: rgba(157, 173, 199, 0.42);
}

.voice-dock-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.32rem;
}

.voice-dock-actions-secondary {
    margin-top: 0.35rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.voice-dock-actions .btn {
    padding: 0.42rem 0.35rem;
    font-size: 0.72rem;
    border-radius: 8px;
}

.remote-audio-sink {
    display: none;
}

.discord-layout {
    background: linear-gradient(180deg, #11151d 0%, #10141d 100%);
}

.guild-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    background: color-mix(in srgb, var(--bg) 82%, #000 18%);
}

.guild-create {
    margin-top: auto;
    position: relative;
}

.guild-pill-add {
    background: #202b43;
    border: 1px solid #33415f;
}

.compact-form-guild {
    width: 170px;
    right: -180px;
    top: 0;
}

.guild-pill {
    margin-bottom: 0;
    background: #273149;
    transition: border-radius 0.15s ease, background 0.15s ease;
}

.guild-pill-friends {
    background: linear-gradient(160deg, #1f8a56, #1f6d9e);
    border: 1px solid rgba(151, 238, 195, 0.45);
}

.guild-pill-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.guild-pill:hover,
.guild-pill.is-active {
    background: var(--brand);
}

.channel-sidebar {
    background: color-mix(in srgb, var(--bg-elevated) 78%, #000 22%);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(122, 146, 196, 0.22);
    box-shadow: inset -1px 0 0 rgba(5, 9, 18, 0.55);
}

.channel-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(141, 184, 255, 0.08) 0%, rgba(141, 184, 255, 0) 26%);
}

.chat-main {
    background: color-mix(in srgb, var(--bg-card) 80%, #111 20%);
    position: relative;
}

.screen-stage {
    position: relative;
    z-index: 5;
    margin: 0.8rem 1rem 0;
    padding: 0.55rem;
    border: 1px solid #394566;
    border-radius: 12px;
    background: rgba(9, 14, 24, 0.92);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
    animation: stageIn 220ms ease-out;
}

@keyframes stageIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.screen-stage[hidden] {
    display: none;
}

.screen-stage video {
    width: 100%;
    height: min(58vh, 560px);
    object-fit: contain;
    background: #000;
    border-radius: 10px;
}

.screen-stage.is-expanded video {
    height: min(76vh, 820px);
}

.screen-stage-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.55rem;
}

.media-panel {
    background: color-mix(in srgb, var(--bg-elevated) 76%, #000 24%);
}

.media-video.is-empty {
    display: none;
}

.sidebar-userbar {
    margin-top: 0.55rem;
    border-top: 1px solid #2a3040;
    padding-top: 0.7rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    align-items: center;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #3f4c67;
    display: grid;
    place-items: center;
    font-weight: 700;
    overflow: hidden;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-avatar.is-speaking {
    box-shadow: 0 0 0 3px rgba(45, 199, 112, 0.45);
}

.sidebar-user-meta {
    display: grid;
    gap: 0.1rem;
}

.sidebar-user-meta strong {
    font-size: 0.86rem;
}

.sidebar-user-meta strong.is-speaking,
[data-speaking-user-id].is-speaking {
    color: #5ef09d;
    text-shadow: 0 0 12px rgba(94, 240, 157, 0.35);
}

.sidebar-user-meta small {
    font-size: 0.72rem;
    color: var(--txt-soft);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(120, 143, 188, 0.22);
}

.channel-group-head {
    margin-top: 0.2rem;
    padding: 0.35rem 0.4rem;
    border-radius: 10px;
    background: rgba(10, 17, 30, 0.35);
    border: 1px solid rgba(110, 136, 188, 0.2);
}

.channel-category {
    margin-top: 0.25rem;
    padding: 0.28rem;
    border-radius: 10px;
    background: rgba(8, 14, 25, 0.22);
    border: 1px solid rgba(95, 121, 170, 0.12);
}

.channel-category-title {
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #aebfdf;
}

.channel-category-title:hover {
    color: #d6e5ff;
}

.channel-category-menu-btn {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1px solid rgba(122, 148, 197, 0.35);
    background: rgba(36, 53, 82, 0.72);
    color: #d8e4fb;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.channel-category-menu-btn:hover {
    background: rgba(60, 84, 128, 0.82);
}

.workspace-channel-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.2rem 1.8rem 1.8rem;
    align-items: center;
    column-gap: 0.15rem;
    border-radius: 9px;
    padding: 0.32rem 0.45rem;
}

.workspace-channel-item:hover {
    background: rgba(76, 106, 166, 0.2);
}

.channel-category.is-collapsed .workspace-channel-item,
.channel-category.is-collapsed .voice-channel-block,
.channel-category.is-collapsed .workspace-empty {
    display: none;
}

.channel-category.is-collapsed .channel-category-title::before {
    content: "▸ ";
    color: #8ea7d1;
}

.channel-category:not(.is-collapsed) .channel-category-title::before {
    content: "▾ ";
    color: #8ea7d1;
}

.sidebar-top-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mini-action,
.compact-popover > summary {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #283146;
    color: #d7deeb;
    display: grid;
    place-items: center;
    border: 1px solid #36415a;
    padding: 0;
    appearance: none;
    cursor: pointer;
    list-style: none;
}

.mini-action:hover,
.compact-popover > summary:hover {
    text-decoration: none;
    background: #374464;
}

.compact-popover {
    position: relative;
}

.compact-popover[open] {
    z-index: 2;
}

.compact-popover[open] > summary {
    background: #44567d;
}

.compact-popover > summary::-webkit-details-marker {
    display: none;
}

.compact-popover .compact-form {
    width: 170px;
    position: absolute;
    top: 28px;
    right: 0;
    background: #111722;
    border: 1px solid #2f3a51;
    border-radius: 10px;
    padding: 0.45rem;
    margin-bottom: 0.4rem;
    display: grid;
    gap: 0.3rem;
}

.compact-popover .compact-form + .compact-form {
    top: 124px;
}

.compact-popover .compact-form + .compact-form + .compact-form {
    top: 220px;
}

.compact-popover .compact-form + .compact-form + .compact-form + .compact-form {
    top: 316px;
}

.compact-form input {
    width: 100%;
    background: #1d2432;
    border: 1px solid #323e58;
    color: #e8edf8;
    border-radius: 8px;
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
}

.compact-form .btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
}

.channel-group-head {
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.channel-tools {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem;
    margin: 0.5rem 0 0.6rem;
}

.channel-fav-btn {
    justify-self: center;
    color: #9db3da;
    font-size: 0.95rem;
    cursor: pointer;
}

.channel-mute-btn {
    justify-self: center;
    color: #9db3da;
    font-size: 0.9rem;
    cursor: pointer;
}

.channel-mute-btn.is-muted {
    color: #efb973;
}

.workspace-channel-item.is-muted-channel {
    opacity: 0.75;
}

.channel-name-slot {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-count-slot {
    text-align: center;
    color: #c2cfe5;
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
}

.channel-fav-btn.is-active {
    color: #ffd56a;
}

.channel-group-head .channel-sub {
    margin: 0;
}

.channel-category {
    margin: 0.35rem 0 0.5rem;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(108, 128, 174, 0.16);
    background: rgba(19, 28, 46, 0.35);
}

.channel-category-title {
    margin: 0 0 0.3rem;
    color: #96a5c5;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-channel-draggable] {
    cursor: grab;
}

[data-channel-draggable]:active {
    cursor: grabbing;
}

video {
    width: 100%;
    background: #000;
    border-radius: 10px;
}

@media (max-width: 1100px) {
    .discord-layout {
        grid-template-columns: 72px 220px 1fr;
    }

    .media-panel {
        display: none;
    }

    .friends-hub {
        grid-template-columns: 1fr;
    }

    .friends-hub-col {
        min-width: 0;
    }
}

@media (max-width: 800px) {
    .discord-layout {
        grid-template-columns: 1fr;
        min-height: 100dvh;
    }

    .guild-strip {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #11141a;
        padding: 0.55rem;
    }

    .guild-create {
        margin-top: 0;
        margin-left: auto;
    }

    .guild-pill {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .guild-pill-friends {
        border-radius: 10px;
    }

    .channel-sidebar {
        border-right: none;
        border-bottom: 1px solid #1a1d23;
        padding: 0.75rem;
        max-height: 40vh;
        overflow: auto;
    }

    .chat-main {
        min-height: 54vh;
    }

    .composer {
        position: sticky;
        bottom: 0;
        background: #313742;
        z-index: 4;
    }

    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }

    .workspace-shell {
        grid-template-columns: 1fr;
    }

    .voice-dock-actions {
        grid-template-columns: 1fr 1fr;
    }

    .screen-stage {
        padding: 0.55rem;
    }

    .screen-stage video {
        height: calc(100% - 2.5rem);
    }

    .friends-form {
        grid-template-columns: 1fr;
    }

    .friends-hub {
        padding: 0.65rem;
        gap: 0.65rem;
    }

    .friends-hub-col {
        padding: 0.62rem;
    }

    .friend-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .voice-note-hud {
        grid-template-columns: 1fr;
    }
}

.settings-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.2rem;
}

.settings-card {
    width: min(940px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.settings-card h1 {
    margin: 0 0 1rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.settings-form {
    background: #202633;
    border: 1px solid #2e3647;
    border-radius: 12px;
    padding: 0.85rem;
}

.settings-form h2 {
    margin: 0 0 0.8rem;
    font-size: 1rem;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-avatar-preview {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.45rem;
}

.settings-avatar-preview img {
    width: 74px;
    height: 74px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid #3b445b;
}

.avatar-remove {
    font-size: 0.82rem;
    color: var(--txt-soft);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

@media (max-width: 760px) {
    .hero-kpis,
    .landing-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .auth-wrap-fancy {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 180px;
    }
}

/* 2026 refresh: clean glass layout overrides */
.discord-layout {
    grid-template-columns: 84px 250px 1fr 250px;
    gap: 0;
    height: 100dvh;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(8, 12, 22, 0.85), rgba(14, 20, 34, 0.9));
}

.member-panel-right {
    border-left: 1px solid rgba(159, 181, 255, 0.12);
    background: rgba(12, 18, 31, 0.5);
    backdrop-filter: blur(18px) saturate(122%);
    padding: 0.85rem 0.7rem;
    overflow: auto;
}

.member-panel-right h3 {
    margin: 0.2rem 0 0.6rem;
    font-size: 0.9rem;
    color: #d7dff0;
}

.guild-strip {
    padding: 1rem 0.75rem;
    gap: 0.8rem;
    background: rgba(8, 12, 24, 0.58);
    backdrop-filter: blur(18px) saturate(120%);
    border-right: 1px solid rgba(159, 181, 255, 0.14);
}

.guild-pill {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(58, 95, 210, 0.28);
}

.guild-pill:hover,
.guild-pill.is-active {
    transform: translateY(-1px);
}

.channel-sidebar {
    background: rgba(12, 18, 31, 0.52);
    backdrop-filter: blur(20px) saturate(122%);
    border-right: 1px solid rgba(159, 181, 255, 0.12);
    padding: 0.9rem 0.8rem;
}

.sidebar-top,
.channel-group-head {
    margin-bottom: 0.55rem;
}

.workspace-channel-item {
    border-radius: 12px;
    margin-bottom: 0.3rem;
    padding: 0.52rem 0.64rem;
}

.chat-main {
    min-height: 0;
    overflow: hidden;
    background: rgba(28, 36, 52, 0.56);
    backdrop-filter: blur(18px) saturate(122%);
}

.chat-log {
    min-height: 0;
    padding: 0.75rem 1rem;
}

.voice-inline-panel {
    position: fixed;
    right: 1rem;
    bottom: 6.2rem;
    width: min(360px, calc(100vw - 2rem));
    margin: 0;
    z-index: 26;
    border: 1px solid rgba(138, 163, 230, 0.28);
    background: rgba(10, 16, 28, 0.9);
    border-radius: 14px;
    padding: 0.55rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    touch-action: none;
    resize: both;
    overflow: auto;
    min-width: 300px;
    min-height: 180px;
    max-width: min(86vw, 820px);
    max-height: min(80vh, 760px);
}

.voice-inline-panel[hidden] {
    display: none !important;
}

.voice-inline-panel h2 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #d6e1ff;
    cursor: move;
    user-select: none;
}

.voice-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    cursor: move;
    user-select: none;
}

.voice-inline-head-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.voice-inline-head-actions .btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
}

.voice-inline-panel.is-expanded {
    width: min(72vw, 940px);
    max-height: min(86vh, 840px);
}

.voice-inline-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    align-items: start;
}

.media-video,
.media-remote {
    margin-top: 0;
}

.media-video video,
.remote-tile video,
.screen-stage video {
    max-width: 100%;
    max-height: min(46vh, 420px);
}

.media-remote {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    max-height: 240px;
    overflow: auto;
}

.screen-stage {
    position: fixed;
    left: max(86px, 12vw);
    right: 390px;
    bottom: 1rem;
    margin: 0;
    z-index: 25;
    background: rgba(7, 12, 22, 0.92);
    touch-action: none;
    resize: both;
    overflow: auto;
    min-width: 340px;
    min-height: 220px;
    max-width: calc(100vw - 96px);
    max-height: calc(100vh - 16px);
}

.screen-stage video {
    height: min(44vh, 380px);
    min-height: 180px;
}

.screen-stage.is-expanded video {
    height: min(74vh, 760px);
}

.screen-stage-toolbar {
    cursor: move;
    user-select: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

.screen-stage-actions {
    display: inline-flex;
    gap: 0.35rem;
}

.screen-stage-actions .btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
}

.voice-dock-head {
    display: grid;
}

.voice-dock-head [data-webrtc-target="deafenStatus"] {
    color: #a0afc9;
}

.voice-dock-actions .btn {
    white-space: nowrap;
    font-weight: 700;
    background: linear-gradient(180deg, #536589, #445575);
    border: 1px solid #667ca4;
    min-width: 42px;
    width: 42px;
    height: 40px;
    padding: 0;
    font-size: 1.1rem;
}

.voice-dock-actions .btn:disabled {
    opacity: 0.48;
}

.status-popover {
    position: relative;
}

.status-popover[open] {
    z-index: 3;
}

.status-popover > summary {
    list-style: none;
}

.status-popover > summary::-webkit-details-marker {
    display: none;
}

.status-menu {
    position: absolute;
    bottom: 44px;
    left: 0;
    width: 140px;
    border: 1px solid rgba(126, 147, 197, 0.3);
    border-radius: 10px;
    background: rgba(12, 18, 30, 0.98);
    padding: 0.25rem;
    display: grid;
    gap: 0.2rem;
}

.status-menu button {
    width: 100%;
    border: 1px solid #334260;
    background: #202b43;
    color: #d5deee;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    text-align: left;
    cursor: pointer;
}

.status-menu button:hover {
    background: #2d3b5c;
}

.friends-sidebar {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.friends-sidebar-list {
    display: grid;
    gap: 0.28rem;
}

.friend-sidebar-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.45rem;
    border-radius: 10px;
    border: 1px solid rgba(120, 148, 206, 0.26);
    background: linear-gradient(160deg, rgba(37, 53, 82, 0.48), rgba(19, 30, 52, 0.42));
    backdrop-filter: blur(14px) saturate(128%);
    color: #dbe4f6;
    text-decoration: none;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.friend-sidebar-row.is-form {
    margin: 0;
}

.friend-sidebar-row:hover {
    background: linear-gradient(160deg, rgba(58, 83, 129, 0.56), rgba(29, 44, 75, 0.52));
    border-color: rgba(173, 202, 255, 0.44);
    transform: translateY(-1px) scale(1.01);
}

.friend-sidebar-row small {
    color: #a6b4cf;
    font-size: 0.72rem;
}

.friend-sidebar-row .btn {
    padding: 0.24rem 0.45rem;
    font-size: 0.7rem;
}

.friends-hub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    padding: 0.8rem 1rem 1rem;
    overflow: auto;
    animation: friendHubIn 320ms ease-out;
}

@keyframes friendHubIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.friends-hub-col {
    background: linear-gradient(180deg, rgba(22, 34, 58, 0.42), rgba(15, 24, 40, 0.58));
    border: 1px solid rgba(167, 193, 247, 0.24);
    backdrop-filter: blur(18px) saturate(130%);
    border-radius: 14px;
    padding: 0.75rem;
    display: grid;
    align-content: start;
    gap: 0.55rem;
    box-shadow: 0 18px 36px rgba(0, 8, 24, 0.34);
}

.friends-hub-col h2 {
    margin: 0;
    font-size: 0.92rem;
    color: #dae4fa;
}

.friends-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.friends-form input {
    border-radius: 10px;
    border: 1px solid #334769;
    background: #1a2438;
    color: #e5ebf8;
    padding: 0.55rem 0.65rem;
}

.friends-form .btn {
    justify-self: start;
}

.friends-list {
    display: grid;
    gap: 0.35rem;
}

.friend-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(120, 146, 198, 0.22);
    background: linear-gradient(165deg, rgba(42, 58, 86, 0.58), rgba(25, 36, 57, 0.46));
    backdrop-filter: blur(12px) saturate(125%);
    padding: 0.5rem 0.6rem;
    transition: transform 180ms ease, border-color 180ms ease;
}

.friend-row:hover {
    transform: translateY(-1px);
    border-color: rgba(176, 203, 255, 0.42);
}

.screen-stage-toolbar {
    cursor: default;
    user-select: none;
}

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 5, 12, 0.62);
    backdrop-filter: blur(3px);
}

.settings-modal-dialog {
    position: relative;
    width: min(980px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    margin: 1rem auto;
    border: 1px solid rgba(146, 171, 228, 0.28);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(17, 25, 40, 0.95), rgba(20, 31, 49, 0.95));
    overflow: auto;
    box-shadow: 0 28px 58px rgba(0, 0, 0, 0.5);
}

.settings-modal-dialog-wide {
    width: min(1280px, calc(100vw - 2rem));
}

.settings-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: rgba(10, 16, 29, 0.92);
    border-bottom: 1px solid rgba(122, 144, 194, 0.25);
}

.settings-modal-head h2 {
    margin: 0;
    font-size: 1.08rem;
}

.settings-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.85rem;
}

.account-settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0.9rem;
    padding: 0.85rem;
}

.account-settings-sidebar {
    border: 1px solid rgba(126, 149, 196, 0.24);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(22, 31, 50, 0.76), rgba(13, 20, 33, 0.74));
    padding: 0.72rem;
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.account-settings-profile {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem;
    align-items: center;
}

.account-settings-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #2f3d5f;
    font-weight: 700;
}

.account-settings-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-settings-profile small {
    color: #9fb1d2;
    font-size: 0.72rem;
}

.account-settings-nav {
    display: grid;
    gap: 0.35rem;
}

.account-settings-nav button {
    appearance: none;
    border: 1px solid rgba(150, 180, 228, 0.26);
    border-radius: 14px;
    padding: 0.5rem 0.62rem;
    color: #dff0ff;
    background: linear-gradient(180deg, rgba(184, 212, 255, 0.16), rgba(118, 156, 212, 0.12));
    text-align: left;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 120ms ease, border-color 140ms ease, background 160ms ease;
}

.account-settings-nav button:hover {
    border-color: rgba(199, 224, 255, 0.45);
    background: linear-gradient(180deg, rgba(204, 228, 255, 0.22), rgba(127, 167, 224, 0.18));
    transform: translateY(-1px);
}

.account-settings-nav button.is-active {
    border-color: rgba(225, 242, 255, 0.62);
    color: #ffffff;
    background: linear-gradient(180deg, rgba(228, 240, 255, 0.4), rgba(122, 175, 246, 0.34));
    box-shadow: 0 12px 24px rgba(49, 118, 205, 0.24);
}

.account-settings-content {
    display: grid;
    gap: 0.7rem;
    align-content: start;
}

.account-tab-panel {
    display: none;
    border: 1px solid rgba(197, 219, 248, 0.26);
    border-radius: 16px;
    background: linear-gradient(170deg, rgba(188, 214, 246, 0.16), rgba(83, 116, 169, 0.14));
    backdrop-filter: blur(22px) saturate(135%);
    padding: 0.72rem;
    gap: 0.65rem;
}

.account-tab-panel.is-active {
    display: grid;
    border-color: rgba(224, 238, 255, 0.42);
    box-shadow: 0 20px 38px rgba(15, 28, 55, 0.28);
}

.account-tab-panel[hidden] {
    display: none !important;
}

.account-overview-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.account-overview-kpis article {
    border: 1px solid rgba(192, 217, 250, 0.26);
    border-radius: 12px;
    background: rgba(232, 243, 255, 0.1);
    padding: 0.52rem;
    display: grid;
    gap: 0.2rem;
}

.account-overview-kpis small {
    color: #c8d9ee;
}

.bot-token-form {
    display: grid;
    gap: 0.55rem;
}

.bot-token-scopes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.bot-token-scopes label {
    border: 1px solid rgba(189, 214, 246, 0.27);
    border-radius: 999px;
    background: rgba(216, 233, 255, 0.11);
    padding: 0.26rem 0.56rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
}

.bot-token-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.bot-token-output {
    margin: 0;
    border: 1px solid rgba(182, 209, 243, 0.32);
    border-radius: 12px;
    background: rgba(12, 23, 44, 0.62);
    padding: 0.65rem;
    color: #e8f3ff;
    font-size: 0.77rem;
    overflow: auto;
}

.bot-token-list {
    display: grid;
    gap: 0.55rem;
}

.bot-token-item {
    border: 1px solid rgba(182, 210, 248, 0.25);
    border-radius: 12px;
    background: rgba(214, 234, 255, 0.09);
    padding: 0.55rem;
    display: grid;
    gap: 0.25rem;
}

.bot-token-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

.bot-token-badge {
    border: 1px solid rgba(255, 184, 184, 0.45);
    border-radius: 999px;
    padding: 0.08rem 0.4rem;
    color: #ffd4d4;
    background: rgba(144, 37, 37, 0.28);
    font-size: 0.7rem;
}

.account-settings-nav a {
    border: 1px solid rgba(120, 146, 198, 0.2);
    border-radius: 10px;
    padding: 0.45rem 0.56rem;
    color: #d4e2fa;
    background: rgba(18, 29, 49, 0.62);
    text-decoration: none;
}

.account-settings-nav a:hover {
    background: rgba(48, 70, 110, 0.55);
}

.account-settings-content {
    display: grid;
    gap: 0.7rem;
    align-content: start;
}

.account-section-accordion {
    border: 1px solid rgba(130, 157, 210, 0.24);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(20, 29, 46, 0.82), rgba(14, 20, 33, 0.76));
    overflow: hidden;
}

.account-section-accordion > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 0.8rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(120, 146, 198, 0.2);
    background: rgba(18, 27, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-section-accordion > summary::-webkit-details-marker {
    display: none;
}

.account-section-accordion > summary::after {
    content: '▸';
    opacity: 0.9;
    transition: transform 140ms ease;
}

.account-section-accordion[open] > summary::after {
    transform: rotate(90deg);
}

.account-section-inner {
    border: 0;
    border-radius: 0;
    background: transparent;
    margin: 0;
}

.account-section-card {
    border: 1px solid rgba(130, 157, 210, 0.24);
    background: linear-gradient(180deg, rgba(20, 29, 46, 0.82), rgba(14, 20, 33, 0.76));
}

.api-doc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 0.55rem 0;
}

.api-doc-grid h4 {
    margin: 0 0 0.35rem;
    font-size: 0.84rem;
    color: #dce8ff;
}

.api-doc-grid ul {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.2rem;
}

.api-doc-code {
    margin: 0.4rem 0;
    border: 1px solid rgba(122, 150, 207, 0.28);
    border-radius: 10px;
    background: rgba(9, 14, 24, 0.88);
    color: #dbe6fb;
    padding: 0.62rem;
    overflow: auto;
    font-size: 0.78rem;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .account-settings-layout {
        grid-template-columns: 1fr;
    }

    .account-settings-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-overview-kpis,
    .bot-token-row {
        grid-template-columns: 1fr;
    }
}

.compact-settings-form {
    margin: 0;
}

.compact-settings-form h3 {
    margin: 0 0 0.7rem;
}

.perm-admin-panel {
    grid-column: 1 / -1;
}

.perm-settings-grid {
    grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
}

.perm-channel-panel {
    grid-column: 1 / -1;
}

.perm-role-create-form {
    display: grid;
    gap: 0.6rem;
}

.perm-role-list {
    margin-top: 0.7rem;
    display: grid;
    gap: 0.45rem;
}

.perm-role-card {
    border: 1px solid rgba(123, 147, 195, 0.22);
    border-radius: 10px;
    background: rgba(176, 205, 245, 0.08);
    overflow: hidden;
}

.perm-role-card > summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem;
    cursor: pointer;
}

.perm-role-card > summary::-webkit-details-marker {
    display: none;
}

.perm-role-card > summary small {
    display: block;
    color: #97accc;
    margin-top: 0.2rem;
}

.perm-role-update-form {
    border-top: 1px solid rgba(123, 147, 195, 0.2);
    padding: 0.55rem;
    display: grid;
    gap: 0.6rem;
}

.perm-role-delete-form {
    padding: 0 0.55rem 0.55rem;
}

.perm-role-list h4 {
    margin: 0;
    font-size: 0.78rem;
    color: #b8cdee;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.perm-role-item {
    display: flex;
    justify-content: space-between;
    gap: 0.55rem;
    border: 1px solid rgba(123, 147, 195, 0.22);
    border-radius: 10px;
    background: rgba(176, 205, 245, 0.08);
    padding: 0.5rem;
}

.perm-role-item small {
    display: block;
    color: #97accc;
    margin-top: 0.2rem;
}

.perm-inline-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.perm-member-grid {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.45rem;
}

.perm-member-card {
    border: 1px solid rgba(128, 153, 204, 0.24);
    border-radius: 12px;
    background: rgba(11, 18, 30, 0.56);
    overflow: hidden;
}

.perm-member-card > summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.72rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(115, 143, 192, 0.2);
}

.perm-member-head-main {
    display: grid;
    gap: 0.08rem;
}

.perm-member-head-main small {
    color: #8ea6cf;
    font-size: 0.72rem;
}

.perm-role-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.28rem;
}

.perm-role-chip {
    border: 1px solid rgba(149, 177, 228, 0.33);
    border-radius: 999px;
    padding: 0.09rem 0.45rem;
    background: rgba(176, 202, 244, 0.12);
    color: #dbe9ff;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.perm-role-chip.is-owner {
    border-color: rgba(255, 215, 122, 0.5);
    background: rgba(214, 154, 43, 0.2);
    color: #ffe6a4;
}

.perm-member-card > summary::-webkit-details-marker {
    display: none;
}

.perm-member-card > summary small {
    color: #9bb0d4;
}

.perm-member-form {
    padding: 0.68rem;
    display: grid;
    gap: 0.62rem;
}

.perm-check-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.perm-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.perm-group-block {
    border: 1px solid rgba(121, 147, 194, 0.2);
    border-radius: 10px;
    background: rgba(26, 40, 67, 0.36);
    padding: 0.45rem;
    display: grid;
    gap: 0.42rem;
}

.perm-group-block h4 {
    margin: 0;
    font-size: 0.78rem;
    color: #b8ccee;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.perm-channel-grid {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.perm-channel-card {
    border: 1px solid rgba(126, 151, 200, 0.24);
    border-radius: 12px;
    background: rgba(10, 16, 28, 0.56);
    overflow: hidden;
}

.perm-channel-card > summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.62rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(109, 135, 182, 0.2);
}

.perm-channel-card > summary::-webkit-details-marker {
    display: none;
}

.perm-overwrite-form {
    padding: 0.7rem;
    display: grid;
    gap: 0.55rem;
    border-bottom: 1px solid rgba(109, 135, 182, 0.2);
}

.perm-overwrite-head {
    display: grid;
    gap: 0.25rem;
}

.perm-overwrite-target-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.perm-overwrite-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.perm-overwrite-columns h4,
.perm-overwrite-list h4,
.perm-access-matrix h4 {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    color: #b8cdee;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.perm-overwrite-list,
.perm-access-matrix {
    padding: 0.65rem 0.7rem;
}

.perm-overwrite-item {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    border: 1px solid rgba(123, 147, 195, 0.22);
    border-radius: 10px;
    background: rgba(176, 205, 245, 0.08);
    padding: 0.45rem;
    margin-bottom: 0.4rem;
}

.perm-overwrite-item > summary {
    list-style: none;
    cursor: pointer;
}

.perm-overwrite-item > summary::-webkit-details-marker {
    display: none;
}

.perm-overwrite-item > summary small {
    display: block;
    color: #97accc;
}

.perm-overwrite-form-inline {
    border-top: 1px solid rgba(109, 135, 182, 0.2);
    margin-top: 0.45rem;
}

.perm-inline-actions {
    display: flex;
    justify-content: flex-end;
}

.perm-overwrite-item small {
    display: block;
    color: #97accc;
}

.perm-access-head,
.perm-access-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 62px 62px 62px 72px;
    gap: 0.35rem;
    align-items: center;
}

.perm-access-head {
    font-size: 0.72rem;
    color: #91a8cb;
    margin-bottom: 0.28rem;
}

.perm-access-row {
    border-top: 1px solid rgba(122, 145, 190, 0.15);
    padding: 0.28rem 0;
    font-size: 0.79rem;
}

.perm-dot {
    border-radius: 999px;
    text-align: center;
    padding: 0.12rem 0.22rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.perm-dot.is-on {
    border: 1px solid rgba(90, 216, 160, 0.45);
    color: #c6ffe6;
    background: rgba(43, 149, 102, 0.26);
}

.perm-dot.is-off {
    border: 1px solid rgba(218, 108, 108, 0.4);
    color: #ffd3d3;
    background: rgba(148, 59, 59, 0.24);
}

.perm-check-grid label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(128, 157, 211, 0.22);
    border-radius: 10px;
    background: rgba(217, 233, 255, 0.08);
    padding: 0.36rem 0.48rem;
    font-size: 0.78rem;
}

.perm-inline-chips label {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    border: 1px solid rgba(128, 157, 211, 0.22);
    border-radius: 999px;
    background: rgba(217, 233, 255, 0.08);
    padding: 0.26rem 0.5rem;
    font-size: 0.75rem;
}

.perm-multi-select {
    width: 100%;
    min-height: 7rem;
    border: 1px solid rgba(126, 151, 200, 0.35);
    border-radius: 10px;
    background: rgba(11, 18, 30, 0.72);
    color: #dbe9ff;
    padding: 0.4rem;
}

.perm-multi-select option {
    padding: 0.2rem 0.35rem;
}

@media (max-width: 880px) {
    .settings-modal-dialog-wide {
        width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .perm-settings-grid,
    .perm-group-grid,
    .perm-check-grid {
        grid-template-columns: 1fr;
    }

    .perm-overwrite-target-grid,
    .perm-overwrite-columns {
        grid-template-columns: 1fr;
    }

    .perm-access-head,
    .perm-access-row {
        grid-template-columns: minmax(120px, 1fr) 52px 52px 52px 58px;
    }

    .perm-role-item,
    .perm-overwrite-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .perm-inline-actions {
        justify-content: stretch;
    }

    .perm-inline-actions .btn {
        width: 100%;
    }
}

.composer {
    margin: 0.65rem 1rem 0.9rem;
    border: 1px solid rgba(136, 161, 224, 0.18);
    border-radius: 15px;
    background: rgba(19, 27, 42, 0.7);
}

.composer input::placeholder {
    color: #8e9ab4;
}

.voice-connected-item.is-speaking,
[data-speaking-user-id].is-speaking {
    color: #66f2a8;
    text-shadow: 0 0 12px rgba(102, 242, 168, 0.34);
}

.channel-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.compact-popover-inline summary {
    padding: 0.15rem 0.45rem;
    min-width: 2rem;
    text-align: center;
}

.voice-user-volume {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.voice-user-volume input[type="range"] {
    width: 100%;
}

.voice-user-volume small {
    color: #96a5c5;
    min-width: 2.7rem;
    text-align: right;
}

@media (max-width: 1180px) {
    .voice-inline-grid {
        grid-template-columns: 1fr;
    }

    .screen-stage {
        left: 1rem;
        right: 1rem;
        bottom: 14.6rem;
    }

    .screen-stage video {
        height: min(38vh, 340px);
    }

    .voice-inline-panel {
        right: 1rem;
        bottom: 6.8rem;
        width: min(440px, calc(100vw - 2rem));
    }

    .member-panel-right {
        display: none;
    }

    .settings-modal-grid {
        grid-template-columns: 1fr;
    }

    .account-settings-layout {
        grid-template-columns: 1fr;
    }

    .api-doc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .voice-inline-panel {
        left: 0.65rem;
        right: 0.65rem;
        width: auto;
        bottom: 5.4rem;
    }

    .screen-stage {
        left: 0.65rem;
        right: 0.65rem;
        bottom: 15.2rem;
    }

    .voice-dock-actions {
        grid-template-columns: 1fr 1fr;
    }

    .voice-dock-actions .btn {
        width: 100%;
    }
}

.mfa-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 15% 20%, rgba(58, 180, 255, 0.32), transparent 45%),
        radial-gradient(circle at 85% 18%, rgba(255, 113, 157, 0.28), transparent 45%),
        radial-gradient(circle at 50% 92%, rgba(255, 204, 112, 0.22), transparent 45%),
        linear-gradient(140deg, #07162b 0%, #0f1d38 45%, #122146 100%);
    overflow: hidden;
}

.mfa-bg-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mfa-bg-blobs span {
    position: absolute;
    width: 38vmax;
    height: 38vmax;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.4;
    animation: mfaBlobFloat 12s ease-in-out infinite;
}

.mfa-bg-blobs span:nth-child(1) {
    top: -10vmax;
    left: -8vmax;
    background: radial-gradient(circle, rgba(73, 196, 255, 0.9) 0%, rgba(73, 196, 255, 0.05) 65%);
}

.mfa-bg-blobs span:nth-child(2) {
    top: 8vmax;
    right: -10vmax;
    background: radial-gradient(circle, rgba(255, 142, 187, 0.8) 0%, rgba(255, 142, 187, 0.05) 65%);
    animation-delay: -4s;
}

.mfa-bg-blobs span:nth-child(3) {
    bottom: -14vmax;
    left: 28%;
    background: radial-gradient(circle, rgba(255, 213, 122, 0.78) 0%, rgba(255, 213, 122, 0.05) 65%);
    animation-delay: -8s;
}

.mfa-card {
    position: relative;
    z-index: 1;
    width: min(96vw, 430px);
    border-radius: 22px;
    padding: 1.4rem;
    color: #e7efff;
    background: linear-gradient(160deg, rgba(23, 44, 83, 0.76), rgba(18, 30, 56, 0.58));
    border: 1px solid rgba(215, 236, 255, 0.3);
    box-shadow: 0 30px 70px rgba(3, 8, 18, 0.55);
    backdrop-filter: blur(18px) saturate(1.3);
}

.mfa-card h1 {
    margin: 0 0 0.55rem;
    letter-spacing: 0.01em;
}

.mfa-card > p {
    margin: 0 0 1rem;
    color: rgba(223, 235, 255, 0.86);
}

.mfa-form {
    display: grid;
    gap: 0.9rem;
}

.mfa-card .field {
    display: grid;
    gap: 0.45rem;
}

.mfa-card .field label {
    font-size: 0.92rem;
    color: rgba(232, 242, 255, 0.9);
}

.mfa-card .field input {
    border-radius: 14px;
    border: 1px solid rgba(214, 233, 255, 0.32);
    background: rgba(9, 17, 34, 0.55);
    color: #f5f9ff;
    padding: 0.9rem 1rem;
    font-size: 1.15rem;
    letter-spacing: 0.18em;
    text-align: center;
}

.mfa-card .field input::placeholder {
    color: rgba(217, 231, 255, 0.42);
}

.mfa-card .field input:focus {
    outline: none;
    border-color: rgba(119, 205, 255, 0.86);
    box-shadow: 0 0 0 3px rgba(72, 181, 255, 0.25);
}

.mfa-card .btn {
    width: 100%;
}

.mfa-card a {
    color: #bddcff;
}

@keyframes mfaBlobFloat {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -18px, 0) scale(1.06);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@media (max-width: 640px) {
    .mfa-card {
        padding: 1.15rem;
        border-radius: 18px;
    }
}

.profile-peek {
    position: fixed;
    inset: 0;
    z-index: 170;
    pointer-events: none;
}

.profile-peek[hidden] {
    display: none !important;
}

.profile-peek.is-visible {
    pointer-events: auto;
}

.profile-peek-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(6, 8, 14, 0.62);
    backdrop-filter: blur(6px);
}

.profile-peek-card {
    position: absolute;
    z-index: 2;
    width: min(520px, calc(100vw - 1.5rem));
    max-height: calc(100vh - 1.25rem);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        radial-gradient(circle at 92% 8%, rgba(141, 225, 179, 0.18), transparent 45%),
        linear-gradient(180deg, #1f2636 0%, #171d2a 100%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    pointer-events: auto;
}

.profile-peek-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.profile-social-link {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(132, 168, 240, 0.38);
    background: rgba(47, 74, 130, 0.28);
    color: #dceaff;
    padding: 0.24rem 0.7rem;
    font-size: 0.78rem;
}

.profile-social-link:hover {
    text-decoration: none;
    filter: brightness(1.08);
}

.profile-owner-link {
    border-style: dashed;
}

.profile-owner-meta {
    display: flex;
    align-items: center;
}

.profile-owner-inline {
    border: 1px solid rgba(124, 153, 214, 0.35);
    border-radius: 999px;
    background: rgba(33, 53, 91, 0.52);
    color: #dce8ff;
    padding: 0.22rem 0.58rem;
    font-size: 0.76rem;
    cursor: pointer;
}

.profile-owner-inline:hover {
    filter: brightness(1.08);
}

.profile-peek-card.is-opening {
    animation: profilePeekIn 170ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes profilePeekIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-peek-head {
    position: relative;
    display: grid;
    gap: 0.6rem;
    border-radius: 14px;
    padding: 0.9rem;
    background:
        linear-gradient(130deg, rgba(92, 174, 255, 0.26), rgba(104, 245, 186, 0.2)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04) 12px, transparent 12px, transparent 24px);
}

.profile-peek-head.has-banner {
    background-image:
        linear-gradient(130deg, rgba(10, 19, 33, 0.22), rgba(10, 19, 33, 0.42)),
        var(--profile-head-banner);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.profile-peek-identity {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.profile-peek-banner {
    display: none !important;
}

.profile-user-tag {
    display: inline-flex;
    margin-top: 0.12rem;
    font-size: 0.76rem;
    color: #9bb0d8;
}

.profile-mood {
    margin-top: 0.24rem;
    display: block;
    font-size: 0.84rem;
    color: #cfe2ff;
    opacity: 0.9;
}

.profile-peek-avatar {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    border: 3px solid #171d2a;
    background: #2a334a;
    color: #ecf3ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    font-weight: 800;
    text-transform: uppercase;
    overflow: hidden;
    flex: 0 0 auto;
}

.profile-peek-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-peek-head h3 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

.profile-peek-head small {
    margin: 0.15rem 0 0;
    display: block;
    color: #a8b2cc;
    font-size: 0.94rem;
}

.profile-peek-about,
.profile-peek-interests {
    background: rgba(9, 12, 20, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.75rem 0.8rem;
    display: grid;
    gap: 0.55rem;
}

.profile-peek-about h4,
.profile-peek-interests h4 {
    margin: 0;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #7f8cab;
}

.profile-peek-about p {
    margin: 0;
    color: #d5ddef;
    line-height: 1.45;
}

.profile-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.profile-chip-list small {
    color: #9ba6c2;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    border: 1px solid rgba(116, 205, 168, 0.45);
    background: rgba(116, 205, 168, 0.14);
    color: #d6ffec;
    font-size: 0.79rem;
    white-space: nowrap;
}

.profile-chip-bot {
    border-color: rgba(141, 214, 255, 0.55);
    background: rgba(96, 156, 212, 0.18);
    color: #e2f3ff;
}

@media (max-width: 600px) {
    .profile-design-grid,
    .profile-social-grid {
        grid-template-columns: 1fr;
    }

    .profile-peek-card {
        border-radius: 16px;
        padding: 0.8rem;
        max-height: calc(100vh - 0.9rem);
    }

    .profile-peek-head {
        padding: 0.75rem;
    }

    .profile-peek-avatar {
        width: 66px;
        height: 66px;
        border-radius: 18px;
    }
}

.discord-layout.is-focus-members-hidden {
    grid-template-columns: 84px 250px 1fr;
}

.discord-layout.is-focus-members-hidden .member-panel-right {
    display: none;
}

.discord-layout.is-compact-chat .chat-log {
    padding: 0.5rem 0.65rem;
}

.discord-layout.is-compact-chat .message {
    grid-template-columns: 30px 1fr;
    gap: 0.2rem 0.48rem;
    padding: 0.26rem 0.3rem;
}

.discord-layout.is-compact-chat .message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.7rem;
}

.discord-layout.is-compact-chat .message-main {
    gap: 0.06rem;
}

.discord-layout.hide-message-meta .message-meta small {
    display: none;
}

.chat-header-icon-btn[data-chat-target="markReadButton"] {
    color: #dbf5e8;
}

.chat-header-icon-btn[data-chat-target="clearDraftButton"] {
    color: #ffd9d9;
}

/* Admin light workspace */
.admin-page {
    max-width: 1360px;
    padding: 1rem 1rem 1.6rem;
    margin: 0 auto;
    font-family: "Avenir Next", "Manrope", "Segoe UI", sans-serif;
}

.admin-page .hero.admin-hero {
    background: #f6f8fc;
    border: 1px solid #dde4f2;
    border-radius: 14px;
    padding: 1rem;
    color: #1f2b3d;
    box-shadow: 0 12px 34px rgba(35, 59, 95, 0.08);
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.admin-topbar h1 {
    margin: 0;
    color: #16253b;
    font-size: 1.5rem;
}

.admin-topbar p {
    margin: 0.2rem 0 0;
    color: #4c5f7d;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.75rem 0 0.8rem;
}

.admin-nav .btn {
    border-radius: 10px;
    border: 1px solid #d6dff1;
    background: #ffffff;
    color: #244067;
}

.admin-nav .btn.btn-primary {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #ffffff;
}

.admin-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.62rem;
}

.admin-kpis .stat-card {
    background: #ffffff;
    border: 1px solid #dbe4f4;
    border-radius: 12px;
    color: #263a5a;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.72rem;
    margin-top: 0.72rem;
}

.admin-card {
    border: 1px solid #d9e2f1;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.76rem;
}

.admin-card h3 {
    margin: 0 0 0.55rem;
    color: #1c2e4c;
}

.admin-filter-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr auto auto;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.admin-filter-grid-3 {
    grid-template-columns: 1.6fr 1fr auto auto;
}

.admin-filter-grid input,
.admin-filter-grid select {
    border: 1px solid #ccd7ea;
    border-radius: 10px;
    background: #ffffff;
    color: #1f314d;
}

.admin-table-wrap {
    overflow: auto;
    border: 1px solid #dbe4f3;
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: #243a5a;
    background: #ffffff;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #e8edf7;
    text-align: left;
    padding: 0.5rem 0.55rem;
    vertical-align: top;
}

.admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5fc;
    color: #1a2e4f;
}

.admin-table tbody tr:nth-child(even) {
    background: #fbfcff;
}

.admin-table small {
    color: #5d7191;
}

.admin-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.3rem;
}

.admin-mini-list {
    display: grid;
    gap: 0.4rem;
}

.admin-mini-list small {
    display: block;
    color: #536a8d;
}

@media (max-width: 980px) {
    .admin-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-filter-grid,
    .admin-filter-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* iOS glass override for admin */
.admin-page {
    --admin-bg-1: rgba(11, 18, 32, 0.8);
    --admin-bg-2: rgba(20, 33, 56, 0.72);
    --admin-border: rgba(172, 200, 244, 0.28);
    --admin-soft: #9db1d5;
    --admin-text: #e9f1ff;
    --admin-accent: #8bc2ff;
    color: var(--admin-text);
}

.admin-page .hero.admin-hero {
    background:
        radial-gradient(1200px 500px at 0% -10%, rgba(97, 156, 247, 0.2), transparent),
        radial-gradient(900px 420px at 100% -25%, rgba(78, 203, 208, 0.16), transparent),
        linear-gradient(155deg, var(--admin-bg-1), var(--admin-bg-2));
    border: 1px solid var(--admin-border);
    box-shadow: 0 28px 60px rgba(4, 10, 22, 0.42);
    backdrop-filter: blur(18px) saturate(125%);
}

.admin-topbar h1,
.admin-card h3,
.admin-table,
.admin-table thead th {
    color: var(--admin-text);
}

.admin-topbar p,
.admin-mini-list small,
.admin-table small {
    color: var(--admin-soft);
}

.admin-nav .btn,
.admin-filter-grid input,
.admin-filter-grid select,
.admin-inline-form select {
    border: 1px solid var(--admin-border);
    background: rgba(173, 209, 255, 0.1);
    color: var(--admin-text);
    backdrop-filter: blur(10px) saturate(120%);
}

.admin-nav .btn.btn-primary {
    border-color: rgba(189, 225, 255, 0.72);
    background: linear-gradient(180deg, rgba(126, 197, 255, 0.45), rgba(90, 145, 241, 0.4));
    color: #ffffff;
}

.admin-kpis .stat-card,
.admin-card,
.admin-table-wrap {
    border: 1px solid var(--admin-border);
    background: rgba(162, 201, 255, 0.08);
    backdrop-filter: blur(14px) saturate(122%);
}

.admin-table {
    background: transparent;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(172, 200, 244, 0.2);
}

.admin-table thead th {
    background: rgba(64, 94, 144, 0.44);
}

.admin-table tbody tr:nth-child(even) {
    background: rgba(153, 191, 249, 0.06);
}

.admin-page .btn.btn-secondary,
.admin-page .btn.btn-ghost {
    background: rgba(171, 205, 248, 0.12);
    border-color: var(--admin-border);
    color: var(--admin-text);
}

.admin-page .btn.btn-secondary:hover,
.admin-page .btn.btn-ghost:hover {
    background: rgba(171, 205, 248, 0.2);
}

.audio-settings-grid {
    grid-template-columns: 1.15fr 0.85fr;
}

.audio-settings-card {
    border: 1px solid rgba(154, 182, 229, 0.25);
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(167, 203, 255, 0.12), rgba(86, 118, 173, 0.11));
    backdrop-filter: blur(13px) saturate(120%);
}

.audio-inline-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.audio-inline-kpis article {
    border: 1px solid rgba(161, 192, 238, 0.26);
    border-radius: 10px;
    background: rgba(182, 213, 255, 0.08);
    padding: 0.42rem;
    display: grid;
    gap: 0.15rem;
}

.audio-inline-kpis strong {
    font-size: 0.96rem;
    color: #ecf5ff;
}

.audio-inline-kpis small {
    color: #abc3e7;
}

.field-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.audio-presets {
    margin-top: 0.7rem;
    border-top: 1px dashed rgba(164, 194, 238, 0.25);
    padding-top: 0.55rem;
}

.audio-presets small {
    color: #a8c1e5;
}

.audio-presets > div {
    margin-top: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.audio-presets span {
    border: 1px solid rgba(166, 197, 239, 0.3);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    background: rgba(177, 209, 251, 0.1);
    font-size: 0.74rem;
    color: #dbeaff;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0.85rem;
    width: min(1400px, calc(100vw - 2rem));
    margin: 0 auto;
}

.admin-sidebar {
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: rgba(145, 187, 249, 0.1);
    backdrop-filter: blur(16px) saturate(120%);
    padding: 0.72rem;
    display: grid;
    align-content: start;
    gap: 0.6rem;
    height: fit-content;
    position: sticky;
    top: 0.9rem;
}

.admin-sidebar-head h1 {
    margin: 0;
    font-size: 1.05rem;
}

.admin-sidebar-head p {
    margin: 0.2rem 0 0;
    color: var(--admin-soft);
    font-size: 0.78rem;
}

.admin-nav {
    flex-direction: column;
    margin: 0;
}

.admin-main {
    min-width: 0;
}

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .audio-settings-grid,
    .field-grid-2,
    .audio-inline-kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .pinned-message-bar {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .chat-live-stats {
        width: 100%;
        text-align: center;
    }
}
