:root {
    color-scheme: dark;
    --bg: #1e1f22;
    --bg-soft: #2b2d31;
    --panel: #2b2d31;
    --panel-solid: #313338;
    --panel-2: #383a40;
    --panel-3: #404249;
    --text: #f2f3f5;
    --muted: #a6a9b0;
    --soft: #dbdee1;
    --line: rgba(255, 255, 255, .09);
    --brand: #6366f1;
    --brand-hot: #ec4899;
    --cyan: #22d3ee;
    --green: #22c55e;
    --blue: #3b82f6;
    --amber: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 28px 90px rgba(0, 0, 0, .42);
    --shadow-soft: 0 14px 42px rgba(0, 0, 0, .22);
    --surface-glass: rgba(255, 255, 255, .055);
    --surface-hover: rgba(99, 102, 241, .14);
    --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
}

body.ui-large { font-size: 16px; }
body.ui-xlarge { font-size: 17px; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(99, 102, 241, .28), transparent 38%),
        radial-gradient(circle at 76% 8%, rgba(34, 211, 238, .30), transparent 34%),
        radial-gradient(circle at 18% 80%, rgba(236, 72, 153, .24), transparent 34%);
}

/* Public landing pages get their own light-blue -> dark-blue palette, scoped so the
   in-app experience (which never renders a `main.landing`) keeps its original colors. */
body:has(main.landing) {
    --brand: #38bdf8;
    --brand-hot: #0284c7;
    --cyan: #7dd3fc;
}

body:has(main.landing)::before {
    background:
        linear-gradient(120deg, rgba(56, 189, 248, .26), transparent 38%),
        radial-gradient(circle at 76% 8%, rgba(2, 132, 199, .32), transparent 34%),
        radial-gradient(circle at 18% 80%, rgba(125, 211, 252, .22), transparent 34%);
}

body:has(main.landing) .primary-button {
    background: linear-gradient(135deg, #7dd3fc, #38bdf8 52%, #0369a1);
    box-shadow: 0 18px 36px rgba(2, 132, 199, .32);
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; }

.lucide {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex: 0 0 auto;
}

.spin-icon {
    animation: distalk-spin 0.9s linear infinite;
}
@keyframes distalk-spin {
    to { transform: rotate(360deg); }
}

/* Echte Marken-Logos (Twitch/YouTube/TikTok) - Lucide hat keine Brand-Icons, daher als
   gefüllte Inline-SVGs statt Stroke-Icons wie .lucide. */
.brand-icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    flex: 0 0 auto;
}

.icon-button .lucide,
.server-pill .lucide,
.send-button .lucide {
    width: 19px;
    height: 19px;
}

.channel-row span .lucide,
#channelType .lucide,
.feature-icon .lucide,
.mascot-tags .lucide,
.event-detail-meta-item .lucide,
.profile-row .lucide,
.tile-icons .lucide,
.module-icon .lucide,
.module-add-icon .lucide {
    width: 1em;
    height: 1em;
    vertical-align: -0.14em;
}

.lucide-inline {
    display: inline-block;
    vertical-align: -0.14em;
}
.avatar, .avatar-wrap, .server-mini-icon, .invite-preview-icon,
.discover-icon {
    -webkit-user-select: none;
    user-select: none;
}

::selection {
    background: rgba(99, 102, 241, .42);
    color: white;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .38) transparent;
}

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

*::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .28);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, .44);
    background-clip: padding-box;
}

button,
.server-pill,
.channel-row,
.friend-card,
.icon-button {
    touch-action: manipulation;
}

button,
input,
select,
textarea,
.channel-row,
.message,
.admin-user-row,
.discover-card,
.modal-card {
    min-width: 0;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button {
    user-select: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(34, 211, 238, .72);
    outline-offset: 2px;
}

.landing {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.landing::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 800px 500px at 10% 20%, rgba(56, 189, 248, .16), transparent),
        radial-gradient(ellipse 600px 400px at 90% 30%, rgba(3, 105, 161, .16), transparent),
        radial-gradient(ellipse 500px 500px at 50% 80%, rgba(125, 211, 252, .09), transparent);
    animation: landingAmbient 20s ease-in-out infinite alternate;
}

.system-page {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 24px clamp(18px, 5vw, 76px) 58px;
}

.system-card {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    align-self: center;
    justify-self: center;
    display: grid;
    gap: 18px;
    padding: clamp(28px, 5vw, 54px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    background:
        radial-gradient(circle at 18% 8%, rgba(56, 189, 248, .28), transparent 38%),
        radial-gradient(circle at 88% 18%, rgba(2, 132, 199, .20), transparent 34%),
        rgba(43, 45, 55, .82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.system-card h1 {
    margin: 0;
    max-width: 680px;
    font-size: clamp(2.4rem, 8vw, 5.8rem);
    line-height: .94;
    letter-spacing: 0;
}

.system-card p {
    max-width: 620px;
    margin: 0;
    color: var(--soft);
    font-size: 1.02rem;
    line-height: 1.65;
}

.system-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.system-code {
    width: fit-content;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: var(--muted);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.error-card::after {
    content: "404";
    position: absolute;
    right: clamp(18px, 4vw, 42px);
    bottom: clamp(18px, 4vw, 34px);
    color: rgba(255, 255, 255, .06);
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 950;
    line-height: .8;
    pointer-events: none;
}

@keyframes landingAmbient {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 20px) scale(1.05); }
    66% { transform: translate(20px, -10px) scale(0.95); }
    100% { transform: translate(-10px, 30px) scale(1.02); }
}

.hero {
    position: relative;
    z-index: 1;
    min-height: 82vh;
    padding: 24px clamp(18px, 5vw, 76px) 58px;
}

.hero-copy {
    animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) both;
}

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

.landing-feature-grid {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 50px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) .15s both;
}

.landing-about {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100% - 32px));
    margin: 0 auto 50px;
    text-align: center;
    display: grid;
    gap: 12px;
    animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) .2s both;
}

.landing-about p:last-child {
    color: var(--muted);
    line-height: 1.6;
}

.landing-faq {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100% - 32px));
    margin: 0 auto 60px;
    animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) .3s both;
}

.landing-faq h2 {
    margin: 4px 0 20px;
}

.landing-faq-list {
    display: grid;
    gap: 10px;
}

.landing-faq-item {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .035);
    padding: 16px 20px;
}

.about-team {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100% - 32px));
    margin: 0 auto 60px;
    animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) .3s both;
}

.about-team h2 {
    margin: 4px 0 20px;
}

.about-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.team-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .035);
    padding: 24px 20px;
    text-align: center;
    display: grid;
    gap: 8px;
    justify-items: center;
}

.team-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--brand), var(--brand-hot));
    color: white;
    font-weight: 950;
    font-size: 22px;
}

.team-card-role {
    color: var(--brand-hot);
    font-size: 13px;
    font-weight: 700;
}

.team-card p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
    margin: 4px 0 0;
}

.landing-faq-item summary {
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.landing-faq-item summary::-webkit-details-marker {
    display: none;
}

.landing-faq-item summary::after {
    content: '+';
    float: right;
    color: var(--muted);
}

.landing-faq-item[open] summary::after {
    content: '\2212';
}

.landing-faq-item p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-panel {
    animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) .3s both;
}

.topbar, .hero-grid, .auth-panel {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.topbar {
    position: relative;
    z-index: 30;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    pointer-events: auto;
}

.topbar-actions {
    position: relative;
    z-index: 31;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-actions a,
.topbar-actions button,
.topbar .brand {
    position: relative;
    z-index: 32;
    pointer-events: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 900;
    text-decoration: none;
}

.brand span, .brand-logo, .server-pill {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--brand), var(--brand-hot));
    color: white;
    font-weight: 950;
    box-shadow: 0 14px 32px rgba(99, 102, 241, .32);
}

.brand span {
    animation: brandPulse 3s ease-in-out infinite;
}

.brand-logo {
    object-fit: cover;
    animation: brandPulse 3s ease-in-out infinite;
}

@keyframes brandPulse {
    0%, 100% { box-shadow: 0 14px 32px rgba(99, 102, 241, .32); }
    50% { box-shadow: 0 14px 48px rgba(99, 102, 241, .55), 0 0 80px rgba(99, 102, 241, .15); }
}

.server-pill.has-unread::before,
.server-pill.has-ping::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, .5);
    z-index: 1;
    transition: height .16s ease, border-radius .16s ease;
}

/* Wie bei Discord: der Punkt wird beim Drüberhovern schon mal etwas dicker/länglicher, bevor der
   Server aktiv ausgewählt wird - kleines Signal, dass da eine Nachricht wartet. */
.server-pill:hover:not(.active).has-unread::before,
.server-pill:hover:not(.active).has-ping::before {
    height: 22px;
    border-radius: 6px;
}

.server-pill.active.has-unread::before,
.server-pill.active.has-ping::before {
    top: auto;
    bottom: -18px;
    transform: none;
}

.server-pill.has-ping::before {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .22), 0 0 8px rgba(239, 68, 68, .5);
}

.ghost-link {
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    color: var(--soft);
    text-decoration: none;
    font-weight: 800;
    transition: all .2s ease;
    backdrop-filter: blur(4px);
}

.ghost-link:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .20);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .20);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 548px);
    gap: clamp(28px, 5vw, 66px);
    align-items: center;
    padding-top: clamp(54px, 9vh, 92px);
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1 {
    margin: 0;
    max-width: 680px;
    font-size: clamp(58px, 9vw, 118px);
    /* Knapp unter 1 statt z.B. .88 - sonst werden Unterlängen (j, g, p, q, y) in der
       zweiten Zeile eines mehrzeiligen Headlines abgeschnitten (sah z.B. bei "jedem" wie "iedem" aus). */
    line-height: 1.02;
    padding-bottom: 0.08em;
    background: linear-gradient(135deg, #fff 40%, var(--brand) 55%, var(--brand-hot) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2, h3 { margin: 0; }

.hero-copy p:not(.eyebrow) {
    max-width: 640px;
    margin: 22px 0 0;
    color: var(--soft);
    font-size: 18px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.hero-actions .primary-button {
    position: relative;
    overflow: hidden;
}

.hero-actions .primary-button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.12) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform .6s ease;
}

.hero-actions .primary-button:hover::after {
    transform: translateX(100%);
}

.hero-actions .secondary-button {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12);
    backdrop-filter: blur(4px);
}

.hero-actions .secondary-button:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .22);
}

.landing-feature-grid article {
    min-height: 160px;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 28px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .035);
    backdrop-filter: blur(8px);
    transition: all .3s cubic-bezier(.22, 1, .36, 1);
    position: relative;
    overflow: hidden;
}

.landing-feature-grid article::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(56, 189, 248, .35), transparent 50%, rgba(2, 132, 199, .18));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity .4s ease;
}

.landing-feature-grid article:hover::before {
    opacity: 1;
}

.landing-feature-grid article:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .10);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30);
}

.landing-feature-grid strong {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-feature-grid strong .feature-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(56, 189, 248, .24), rgba(2, 132, 199, .16));
    font-size: 16px;
    font-weight: 700;
    color: var(--soft);
}

.landing-feature-grid span {
    color: var(--soft);
    line-height: 1.7;
}

.mascot-section {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 50px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    padding: 32px clamp(24px, 4vw, 48px);
    backdrop-filter: blur(8px);
    animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) .25s both;
}

.mascot-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: center;
}

.mascot-image-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(56, 189, 248, .28);
    box-shadow: 0 0 40px rgba(2, 132, 199, .18);
    flex-shrink: 0;
    transition: transform .3s ease, box-shadow .3s ease;
}

.mascot-image-wrapper:hover {
    transform: scale(1.03);
    box-shadow: 0 0 60px rgba(2, 132, 199, .28);
}

.mascot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mascot-text h2 {
    font-size: clamp(28px, 4vw, 42px);
    margin: 4px 0 16px;
    background: linear-gradient(135deg, #fff 40%, var(--brand) 70%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mascot-text p {
    color: var(--soft);
    line-height: 1.75;
    font-size: 16px;
    max-width: 560px;
    margin: 0;
}

.mascot-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.mascot-tags span {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    color: var(--soft);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .mascot-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .mascot-image-wrapper {
        margin: 0 auto;
        width: 150px;
        height: 150px;
    }
    .mascot-text p {
        max-width: 100%;
    }
    .mascot-tags {
        justify-content: center;
    }
}

.primary-button, .secondary-button, .danger-button, .send-button {
    min-height: 44px;
    border-radius: var(--radius);
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-weight: 900;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, filter .16s ease;
}

.compact {
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
}

.primary-button {
    background: linear-gradient(135deg, var(--brand), #8b5cf6 52%, var(--brand-hot));
    box-shadow: 0 18px 36px rgba(99, 102, 241, .28);
}

.secondary-button {
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--line);
}

.danger-button { background: linear-gradient(135deg, var(--danger), #fb7185); }
.send-button { background: linear-gradient(135deg, var(--brand), #7c3aed); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover, .send-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}
.secondary-button:hover {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .12);
}
.primary-button:active, .secondary-button:active, .danger-button:active, .send-button:active, .icon-button:active {
    transform: translateY(0);
}
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.send-button:disabled,
.icon-button:disabled {
    opacity: .48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.preview-window {
    min-height: 456px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 76px 180px 1fr;
    background: rgba(12, 15, 25, .86);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .42), 0 0 0 1px rgba(56, 189, 248, .12);
    backdrop-filter: blur(18px);
    animation: previewFloat 6s ease-in-out infinite;
}

@keyframes previewFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.preview-sidebar {
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(6, 8, 14, .72);
}

.preview-server-pill {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 950;
    font-size: 17px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
    background: linear-gradient(145deg, #29324d, #151b2c);
}

.preview-server-pill.active {
    border-radius: 14px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .18);
}

.preview-server-pill.add {
    background: rgba(255, 255, 255, .06);
    color: var(--muted);
    box-shadow: none;
    border: 1px dashed rgba(255, 255, 255, .18);
}

.preview-server-pill.add svg { width: 18px; height: 18px; }

.preview-channels, .preview-chat {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-channels {
    background: rgba(18, 22, 35, .9);
    color: var(--muted);
}

.preview-channels b { color: white; margin-bottom: 6px; }

.preview-category {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .35);
    margin: 8px 0 -2px;
}

.preview-channels span {
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: var(--radius);
}

.preview-channels span svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.preview-channels span.active { background: rgba(255, 255, 255, .08); color: white; }
.preview-channels span.active svg { opacity: 1; }

.preview-chat {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .03), transparent),
        rgba(13, 16, 27, .92);
}

.preview-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.preview-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 950;
    font-size: 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.preview-message-body { min-width: 0; }

.preview-message-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.preview-message-head strong { color: white; font-size: 13.5px; }
.preview-message-head time { color: var(--muted); font-size: 11px; }

.preview-message-body p {
    margin: 2px 0 0;
    color: var(--soft, #dbdee1);
    font-size: 13.5px;
    line-height: 1.4;
}

.preview-call {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.preview-call-tile {
    min-height: 74px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(56, 189, 248, .18), rgba(2, 132, 199, .1));
    border: 1px solid var(--line);
}

.preview-call-tile .preview-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.preview-voice-status {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: rgba(34, 197, 94, .13);
    color: #9af7bc;
    border: 1px solid rgba(34, 197, 94, .24);
    font-size: 13px;
}

.preview-voice-status svg { width: 15px; height: 15px; }

.auth-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 20px clamp(18px, 5vw, 76px) 76px;
}

.auth-card {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 32px;
    background: rgba(17, 21, 34, .60);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .26);
    backdrop-filter: blur(16px);
    transition: all .3s cubic-bezier(.22, 1, .36, 1);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--brand-hot), var(--cyan));
    opacity: 0;
    transition: opacity .4s ease;
}

.auth-card:hover::before {
    opacity: 1;
}

.auth-card:hover {
    transform: translateY(-2px);
    background: rgba(17, 21, 34, .75);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
}

.auth-card h2 {
    font-size: 24px;
    margin-top: 6px;
}

.form-stack {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.form-stack input {
    transition: all .2s ease;
}

.form-stack input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.form-stack .primary-button,
.form-stack .secondary-button {
    margin-top: 4px;
}

.invite-landing {
    display: grid;
    align-content: start;
    min-height: 100vh;
    padding: 24px clamp(16px, 5vw, 76px);
}

.invite-preview-card {
    width: min(720px, 100%);
    margin: clamp(34px, 8vh, 82px) auto;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(43, 45, 49, .92);
    box-shadow: var(--shadow);
}

.invite-preview-banner {
    min-height: 210px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--server-banner), #fff 12%), var(--server-banner)),
        var(--server-banner);
    background-size: cover;
    background-position: center;
}

.invite-preview-body {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 28px;
}

.invite-preview-icon {
    width: 86px;
    height: 86px;
    margin-top: -70px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: var(--radius);
    border: 6px solid var(--panel);
    color: white;
    font-size: 28px;
    font-weight: 950;
}

.invite-preview-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.invite-preview-body h1 {
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1;
}

.invite-preview-body p {
    max-width: 620px;
    color: var(--soft);
    line-height: 1.6;
}

.legal-page {
    padding: 24px clamp(18px, 5vw, 76px) 80px;
}

.legal-card {
    width: min(860px, 100%);
    margin: 46px auto 0;
    display: grid;
    gap: 16px;
    padding: clamp(22px, 4vw, 40px);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .07);
    box-shadow: var(--shadow);
}

.legal-card > * {
    /* Grid-Kinder haben standardmäßig min-width:auto - dadurch ignoriert die Grid-Spaltenbreite
       "overflow-wrap: break-word" komplett und richtet sich stattdessen nach der ungebrochenen
       Breite des längsten Wortes (z.B. lange deutsche Komposita wie
       "Datenschutzaufsichtsbehörde"). Das war der eigentliche Grund, warum der Text trotz
       overflow-wrap weiterhin über den Rand hinaus ging - nicht der Text selbst war das Problem,
       sondern dass die Karte sich dafür breiter als der Bildschirm gemacht hat.
    */
    min-width: 0;
}

.legal-card h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 68px);
}

.legal-card p {
    margin: 0 0 4px;
    color: var(--soft);
    line-height: 1.65;
}

.legal-card p.legal-heading {
    margin-top: 22px;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 800;
}

.legal-card p.legal-heading:first-child {
    margin-top: 0;
}

.topbar-link {
    gap: 8px;
}

.public-topbar {
    min-height: 72px;
    height: auto;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .045)),
        rgba(12, 16, 28, .68);
    box-shadow: 0 18px 54px rgba(0, 0, 0, .22);
    backdrop-filter: blur(18px);
}

.public-brand {
    min-width: max-content;
    padding-right: 8px;
}

.public-brand .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    animation: none;
    box-shadow: 0 14px 34px rgba(99, 102, 241, .28);
}

.public-brand span {
    width: auto;
    height: auto;
    display: inline;
    border-radius: 0;
    background: none;
    color: var(--text);
    box-shadow: none;
    animation: none;
}

.public-nav-links {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .045);
}

.public-nav-links a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 999px;
    color: var(--soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.public-nav-links a:hover,
.public-nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, .10);
}

.public-nav-links a.active {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .3);
}

.public-topbar .topbar-actions {
    flex-wrap: nowrap;
}

.public-topbar .primary-button,
.public-topbar .secondary-button {
    min-height: 40px;
    border-radius: 999px;
    padding-inline: 16px;
}

.public-topbar .secondary-button {
    background: rgba(255, 255, 255, .055);
}

.hero,
.legal-page,
.changelog-page,
.support-page,
.system-page,
.invite-landing {
    isolation: isolate;
}

.hero-grid {
    padding-top: clamp(46px, 8vh, 78px);
}

.hero-copy h1,
.support-hero h1,
.changelog-hero h1,
.legal-card h1,
.system-card h1 {
    letter-spacing: 0;
}

.hero-copy p:not(.eyebrow),
.support-hero p:not(.eyebrow),
.changelog-hero p:not(.eyebrow) {
    color: rgba(226, 232, 240, .84);
}

.hero-copy {
    position: relative;
    padding: clamp(18px, 3vw, 26px) 0;
}

.hero-copy::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cyan), var(--brand), var(--brand-hot));
    opacity: .82;
}

.preview-window,
.landing-feature-grid article,
.mascot-section,
.legal-card,
.changelog-card,
.support-card,
.support-hero-card,
.system-card,
.invite-preview-card {
    border-color: rgba(255, 255, 255, .11);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .082), rgba(255, 255, 255, .038)),
        rgba(15, 19, 32, .68);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .26);
}

.landing-feature-grid article,
.mascot-section,
.legal-card,
.changelog-card,
.support-card,
.support-hero-card {
    border-radius: 14px;
}

.landing-feature-grid article:hover {
    transform: translateY(-2px);
}

.legal-card {
    width: min(920px, 100%);
    gap: 12px;
    padding: clamp(26px, 4vw, 46px);
    /* Lange deutsche Komposita (z.B. "Datenschutzaufsichtsbehörde") oder unbrechbare Strings wie
       Pfadangaben können sonst auf schmalen Handy-Breiten breiter als der Container werden - da
       .landing weiter oben overflow:hidden hat, würde das den Text am rechten Rand einfach
       abschneiden, statt umzubrechen. */
    overflow-wrap: break-word;
}

.legal-card .eyebrow {
    width: fit-content;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(34, 211, 238, .10);
    border: 1px solid rgba(34, 211, 238, .18);
}

.legal-card p:empty {
    display: none;
}

.changelog-hero,
.support-hero {
    padding: clamp(24px, 4vw, 36px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .09);
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 211, 238, .12), transparent 34%),
        linear-gradient(135deg, rgba(99, 102, 241, .105), rgba(236, 72, 153, .055)),
        rgba(255, 255, 255, .035);
}

.changelog-timeline {
    margin-top: 24px;
}

.support-hero-card::after,
.support-ticket-panel .support-card-head::after {
    color: rgba(226, 232, 240, .78);
}

.support-console {
    margin-top: 20px;
}

.support-ticket-list-item {
    border-radius: 12px;
}

.support-chat-panel {
    border-radius: 16px;
}

.landing-footer {
    width: min(1180px, calc(100% - 36px));
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: rgba(12, 16, 28, .48);
    backdrop-filter: blur(14px);
}

.landing-footer::before {
    content: none;
}

.landing-footer a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
}

.landing-footer a:hover {
    background: rgba(255, 255, 255, .08);
}

.changelog-page,
.history-page,
.downloads-page,
.about-page {
    padding: 24px clamp(18px, 5vw, 76px) 80px;
}

.changelog-hero,
.changelog-timeline,
.download-section,
.download-divider {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    margin-inline: auto;
}

.changelog-hero {
    margin-top: 46px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 28px;
}

.changelog-hero h1 {
    font-size: clamp(42px, 7vw, 82px);
}

.changelog-hero p:not(.eyebrow) {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--soft);
    font-size: 17px;
    line-height: 1.7;
}

.download-section {
    padding-bottom: 32px;
}

.download-section h2 {
    margin: 0 0 18px;
    font-size: 22px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-canary-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(240, 178, 50, .16);
    border: 1px solid rgba(240, 178, 50, .4);
    color: #f0b232;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.download-section-note {
    max-width: 680px;
    margin: -8px 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.download-divider {
    height: 1px;
    margin-block: 8px 32px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent);
    border: 0;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.download-card {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .1);
    background:
        radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand), transparent 84%), transparent 40%),
        rgba(255, 255, 255, .04);
    box-shadow: var(--shadow-soft);
}

.download-card.is-disabled {
    opacity: .74;
}

.download-card.is-canary {
    border-color: rgba(240, 178, 50, .35);
    background:
        radial-gradient(circle at 20% 0%, rgba(240, 178, 50, .16), transparent 40%),
        rgba(255, 255, 255, .04);
}

.download-card.is-canary .download-os-icon {
    color: #f0b232;
}

.download-os-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    color: var(--brand);
}

.download-os-icon svg {
    width: 24px;
    height: 24px;
}

.download-card-body {
    display: grid;
    gap: 3px;
}

.download-card-body strong {
    font-size: 19px;
    color: var(--text);
}

.download-card-body small {
    color: var(--muted);
}

.download-card .primary-button,
.download-card .secondary-button {
    width: 100%;
    justify-content: center;
}

.download-card .secondary-button[disabled] {
    cursor: not-allowed;
    opacity: .8;
}

@media (max-width: 640px) {
    .download-grid {
        grid-template-columns: 1fr;
    }
}

.changelog-timeline {
    display: grid;
    gap: 18px;
    padding-left: 28px;
}

.changelog-timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: linear-gradient(180deg, rgba(3, 105, 161, .75), rgba(56, 189, 248, .4), rgba(125, 211, 252, .2));
}

.changelog-entry {
    position: relative;
}

.changelog-marker {
    position: absolute;
    left: -28px;
    top: 28px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--panel-solid);
    border: 3px solid var(--brand);
    box-shadow: 0 0 0 6px rgba(56, 189, 248, .14);
}

.changelog-entry.is-latest .changelog-marker {
    border-color: var(--cyan);
    box-shadow: 0 0 0 6px rgba(125, 211, 252, .16), 0 0 28px rgba(56, 189, 248, .3);
}

.changelog-card {
    display: grid;
    gap: 14px;
    padding: clamp(22px, 3vw, 30px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .055);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.changelog-entry.is-latest .changelog-card {
    border-color: rgba(125, 211, 252, .28);
    background: linear-gradient(135deg, rgba(125, 211, 252, .11), rgba(3, 105, 161, .09)), rgba(255, 255, 255, .055);
}

.changelog-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.changelog-version {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(99, 102, 241, .18);
    border: 1px solid rgba(99, 102, 241, .28);
    color: white;
    font-size: 13px;
    font-weight: 900;
}

.changelog-entry-head time {
    color: var(--cyan);
    font-size: 13px;
    font-weight: 900;
}

.changelog-card h2 {
    font-size: clamp(22px, 3vw, 30px);
}

.changelog-card p {
    margin: 0;
    color: var(--soft);
    line-height: 1.65;
}

.changelog-card ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.changelog-card li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: var(--soft);
    line-height: 1.5;
}

.changelog-card li .lucide {
    margin-top: 2px;
    color: var(--green);
}

.support-page {
    padding: 24px clamp(18px, 5vw, 76px) 80px;
}

.support-hero,
.support-layout {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    margin-inline: auto;
}

.support-hero {
    margin-top: 46px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 24px;
    align-items: end;
}

.support-hero h1 {
    max-width: 760px;
    font-size: clamp(42px, 7vw, 82px);
}

.support-hero p:not(.eyebrow) {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--soft);
    font-size: 17px;
    line-height: 1.7;
}

.support-hero-card,
.support-card {
    border: 1px solid rgba(255, 255, 255, .10);
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 211, 238, .12), transparent 34%),
        linear-gradient(135deg, rgba(99, 102, 241, .10), rgba(236, 72, 153, .08)),
        rgba(255, 255, 255, .055);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.support-hero-card {
    display: grid;
    gap: 10px;
    padding: 22px;
    border-radius: 12px;
}

.support-hero-card span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(56, 189, 248, .22);
    color: var(--cyan);
}

.support-hero-card small,
.support-card-head p {
    color: var(--soft);
    line-height: 1.55;
}

.support-hero-card small {
    display: none;
}

.support-hero-card::after {
    content: "Offene Tickets landen direkt beim Team. Antworten und Anhänge bleiben sauber im Verlauf.";
    color: var(--soft);
    line-height: 1.55;
}

.support-ticket-panel .support-card-head p {
    display: none;
}

.support-ticket-panel .support-card-head::after {
    content: "Deine Tickets werden automatisch hier angezeigt. Gelöschte oder nicht mehr vorhandene Tickets verschwinden von selbst.";
    color: var(--soft);
    line-height: 1.55;
}

.support-layout {
    margin-top: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 18px;
    align-items: start;
}

.support-card {
    display: grid;
    gap: 14px;
    padding: clamp(20px, 3vw, 28px);
    border-radius: 12px;
}

.support-card-head {
    display: grid;
    gap: 6px;
}

.support-card-head h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
}

.support-form label,
.support-reply-form,
.support-lookup-form {
    display: grid;
    gap: 8px;
}

.support-grid-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.support-form textarea,
.support-reply-form textarea {
    min-height: 148px;
}

.support-file-label small {
    color: var(--muted);
}

.support-saved-list,
.support-ticket-view,
.support-thread {
    display: grid;
    gap: 10px;
}

.support-saved-list {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .10);
}

.support-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.support-list-head div {
    display: grid;
    gap: 2px;
}

.support-list-head strong {
    font-size: 15px;
}

.support-list-head small {
    color: var(--muted);
}

.support-list-head > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--cyan);
    background: rgba(34, 211, 238, .10);
}

.support-ticket-list-item {
    width: 100%;
    padding: 12px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-areas:
        "icon title status"
        "icon meta status";
    gap: 4px 12px;
    align-items: center;
    text-align: left;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .10), rgba(34, 211, 238, .06)),
        rgba(255, 255, 255, .06);
    color: var(--text);
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.support-ticket-list-item:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 211, 238, .28);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .16), rgba(34, 211, 238, .10)),
        rgba(255, 255, 255, .075);
}

.support-ticket-list-item.active {
    border-color: rgba(34, 211, 238, .42);
    background:
        linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(99, 102, 241, .14)),
        rgba(255, 255, 255, .08);
    box-shadow: inset 3px 0 0 rgba(34, 211, 238, .8);
}

.support-ticket-list-item > span {
    grid-area: icon;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(99, 102, 241, .18);
    color: var(--cyan);
}

.support-ticket-list-item strong {
    grid-area: title;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-ticket-list-item small {
    grid-area: meta;
    color: var(--muted);
}

.support-ticket-list-item em,
.support-status-pill {
    grid-area: status;
    justify-self: end;
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, .12);
    border: 1px solid rgba(34, 211, 238, .22);
    color: var(--cyan);
    font-size: 12px;
    font-style: normal;
    font-weight: 950;
}

.support-ticket-list-item.closed em,
.support-status-pill.closed {
    background: rgba(148, 163, 184, .12);
    border-color: rgba(148, 163, 184, .18);
    color: var(--muted);
}

.support-empty-state,
.support-loading-row {
    display: grid;
    gap: 5px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
}

.support-empty-state strong {
    color: var(--text);
}

.support-ticket-open {
    display: grid;
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    background:
        radial-gradient(circle at 8% 0%, rgba(34, 211, 238, .08), transparent 34%),
        rgba(0, 0, 0, .12);
}

.support-ticket-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(34, 211, 238, .16);
    background: linear-gradient(135deg, rgba(34, 211, 238, .08), rgba(99, 102, 241, .08));
}

.support-ticket-title div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.support-ticket-title span,
.support-ticket-title small {
    color: var(--muted);
}

.support-ticket-title strong {
    font-size: clamp(18px, 2.4vw, 24px);
    line-height: 1.15;
}

.support-ticket-title small {
    display: block;
}

.support-detail-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
}

.support-detail-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.support-detail-heading > span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(99, 102, 241, .18);
    color: var(--cyan);
}

.support-detail-heading div {
    display: grid;
    gap: 2px;
}

.support-detail-heading small {
    color: var(--muted);
}

.support-thread-message {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .055);
}

.support-thread-message.staff {
    border-color: rgba(34, 211, 238, .22);
    background: rgba(34, 211, 238, .075);
}

.support-thread-message.system {
    border-color: rgba(34, 197, 94, .22);
    background: rgba(34, 197, 94, .075);
}

.support-thread-message > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.support-thread-message p {
    margin: 0;
    color: var(--soft);
    white-space: pre-wrap;
    line-height: 1.6;
}

.support-upload-drop {
    min-height: 46px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: var(--radius);
    border: 1px dashed rgba(34, 211, 238, .28);
    background: rgba(34, 211, 238, .055);
    color: var(--soft);
    font-weight: 850;
    cursor: pointer;
}

.support-upload-drop input {
    display: none;
}

.support-reply-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.support-admin-row.is-closed {
    opacity: .72;
}

.support-ticket-card {
    width: min(820px, calc(100vw - 28px));
}

.support-ticket-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .045);
    color: var(--soft);
}

.support-ticket-meta span {
    overflow-wrap: anywhere;
}

.support-ticket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.support-console {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.support-ticket-panel,
.support-chat-panel {
    min-height: min(760px, calc(100vh - 220px));
}

.support-ticket-panel {
    align-content: start;
    position: sticky;
    top: 18px;
}

.support-chat-panel {
    padding: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 0%, rgba(34, 211, 238, .10), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .035)),
        rgba(0, 0, 0, .14);
}

.support-chat-panel .support-ticket-view {
    min-height: 100%;
}

.support-create-drawer {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(0, 0, 0, .13);
    overflow: hidden;
}

.support-create-drawer summary {
    min-height: 50px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-weight: 950;
}

.support-create-drawer summary::-webkit-details-marker {
    display: none;
}

.support-create-drawer summary span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.support-create-drawer[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.support-create-drawer[open] summary > .lucide:last-child {
    transform: rotate(180deg);
}

.support-create-drawer .support-form {
    padding: 14px;
}

.support-login-required {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 10px;
    padding: 24px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(0, 0, 0, .13);
}

.support-login-required > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(99, 102, 241, .22);
    color: var(--cyan);
}

.support-login-required p {
    margin: 0;
    color: var(--soft);
    font-size: 13px;
    line-height: 1.5;
}

.support-login-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.support-ticket-panel .support-grid-fields {
    grid-template-columns: 1fr;
}

.support-ticket-panel .support-form textarea {
    min-height: 110px;
}

.support-ticket-panel .support-form .primary-button {
    width: 100%;
}

.support-chat-empty {
    min-height: min(760px, calc(100vh - 220px));
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 32px;
    text-align: center;
    color: var(--muted);
}

.support-chat-empty > span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--cyan);
    background: rgba(34, 211, 238, .12);
    border: 1px solid rgba(34, 211, 238, .22);
}

.support-chat-empty strong {
    color: var(--text);
    font-size: 22px;
}

.support-chat-empty p {
    max-width: 380px;
    margin: 0;
    line-height: 1.6;
}

.support-ticket-open {
    min-height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    gap: 0;
}

.support-chat-header {
    position: sticky;
    top: 0;
    z-index: 2;
    border-width: 0 0 1px;
    border-radius: 0;
    padding: 18px 20px;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, .13), rgba(99, 102, 241, .13)),
        rgba(12, 16, 28, .78);
    backdrop-filter: blur(14px);
}

.support-chat-header strong {
    font-size: clamp(20px, 2.4vw, 28px);
}

.support-ticket-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.support-ticket-facts span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--soft);
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    font-weight: 850;
}

.support-ticket-open > .support-detail-section,
.support-ticket-open > .support-reply-form,
.support-ticket-open > .empty-state {
    margin: 16px 20px;
}

.support-thread {
    gap: 14px;
}

.support-thread-message {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    padding: 0;
    border: 0;
    background: transparent;
}

.support-thread-message.staff,
.support-thread-message.system {
    border: 0;
    background: transparent;
}

.support-thread-message > .support-message-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    justify-content: center;
    align-content: center;
    gap: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-hot));
    font-size: 13px;
    font-weight: 950;
}

.support-thread-message.staff > .support-message-avatar {
    background: linear-gradient(135deg, #06b6d4, #6366f1);
}

.support-thread-message.system > .support-message-avatar {
    background: linear-gradient(135deg, #22c55e, #0f766e);
}

.support-message-bubble {
    display: grid;
    gap: 9px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(255, 255, 255, .055);
}

.support-thread-message.staff .support-message-bubble {
    border-color: rgba(34, 211, 238, .24);
    background: rgba(34, 211, 238, .075);
}

.support-thread-message.system .support-message-bubble {
    border-color: rgba(34, 197, 94, .22);
    background: rgba(34, 197, 94, .075);
}

.support-message-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.support-message-head > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.support-message-head em {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(34, 211, 238, .12);
    border: 1px solid rgba(34, 211, 238, .20);
    font-size: 11px;
    font-style: normal;
    font-weight: 950;
}

.support-message-head small {
    color: var(--muted);
    white-space: nowrap;
}

.landing-footer {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 22px 0 34px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    -webkit-user-select: none;
    user-select: none;
}

.landing-footer *,
.landing-footer img,
.landing-footer a {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.landing-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, .3), rgba(236, 72, 153, .2), transparent);
}

.landing-footer div,
.landing-footer nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.landing-footer strong {
    color: var(--text);
    background: linear-gradient(135deg, var(--brand), var(--brand-hot));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-footer a {
    color: var(--soft);
    text-decoration: none;
    font-weight: 800;
    transition: color .2s ease;
}

.landing-footer a:hover {
    color: var(--text);
}

.landing-footer {
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: rgba(12, 16, 28, .48);
    backdrop-filter: blur(14px);
}

.landing-footer::before {
    content: none;
}

.landing-footer a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
}

.landing-footer a:hover {
    background: rgba(255, 255, 255, .08);
}

.landing-footer-social {
    gap: 8px !important;
}

.landing-footer-social a {
    width: 36px;
    height: 36px;
    min-height: 0;
    padding: 0 !important;
    justify-content: center;
    color: var(--soft);
}

.landing-footer-social a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .1);
}

.landing-footer-social svg {
    width: 17px;
    height: 17px;
}

@media (max-width: 920px) {
    .public-topbar {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .public-nav-links {
        grid-column: 1 / -1;
        justify-content: start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .public-nav-links::-webkit-scrollbar {
        display: none;
    }
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(13, 16, 27, .82);
    color: var(--text);
    outline: none;
    padding: 13px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15), inset 0 1px 0 rgba(255, 255, 255, .035);
    background: rgba(13, 16, 27, .95);
}

input:hover, select:hover, textarea:hover {
    background: rgba(18, 22, 35, .9);
    border-color: rgba(255, 255, 255, .14);
}

input::placeholder,
textarea::placeholder {
    color: rgba(166, 169, 176, .72);
}

input[readonly] {
    color: var(--soft);
    background: rgba(255, 255, 255, .045);
    cursor: default;
}

input[type="range"] {
    accent-color: var(--brand);
    min-height: 38px;
    padding-inline: 0;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(99, 102, 241, .7);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}

textarea { min-height: 94px; resize: vertical; }

.app-shell {
    position: relative;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-columns: 72px clamp(248px, 22vw, 300px) minmax(0, 1fr);
    overflow: hidden;
    background: #313338;
}

.app-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 24% 18%, rgba(99, 102, 241, .34), transparent 36%),
        radial-gradient(circle at 82% 72%, rgba(236, 72, 153, .24), transparent 38%),
        rgba(18, 20, 28, .96);
    transition: opacity .24s ease, visibility .24s ease;
}

.app-loading-screen.is-done {
    opacity: 0;
    visibility: hidden;
}

.app-loading-card {
    width: min(360px, 100%);
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(43, 45, 55, .82);
    box-shadow: var(--shadow);
    text-align: center;
    backdrop-filter: blur(20px);
}

.app-loading-card img {
    width: 58px;
    height: 58px;
    border-radius: 18px;
}

.app-loading-card h1 {
    margin: 4px 0 0;
    font-size: 1.25rem;
}

.app-loading-card p {
    margin: 0;
    color: var(--soft);
    line-height: 1.5;
}

.app-loading-spinner {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, .16);
    border-top-color: var(--cyan);
    animation: appLoadingSpin .82s linear infinite;
}

.app-loading-screen.is-error .app-loading-spinner {
    border-top-color: var(--danger);
    animation-duration: 1.25s;
}

@keyframes appLoadingSpin {
    to { transform: rotate(360deg); }
}

.server-rail {
    background: #1e1f22;
    border-right: 1px solid rgba(0, 0, 0, .25);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.server-list {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.server-list::-webkit-scrollbar {
    display: none;
    width: 0;
}

.server-rail-divider {
    flex: 0 0 auto;
    width: 32px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    margin-left: 24px;
}

.server-rail-divider.bottom {
    margin-top: auto;
}

.server-pill {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 0;
    padding: 0;
    overflow: visible;
    position: relative;
    border-radius: 16px;
    outline: 1px solid rgba(255, 255, 255, .08);
    outline-offset: -1px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 8px 20px rgba(0, 0, 0, .2);
    transition: border-radius .16s ease, transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.server-pill:hover, .server-pill.active {
    border-radius: 18px;
    transform: translateY(-1px);
    filter: brightness(1.12);
    outline: 1px solid rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 12px 26px rgba(0, 0, 0, .26);
}

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

.server-pill-call-badge {
    position: absolute;
    right: 6px;
    bottom: 5px;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--green);
    color: #06210f;
    border: 2px solid var(--bg, #1e1f22);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
    z-index: 1;
}

.server-pill-call-badge svg {
    width: 10px;
    height: 10px;
    stroke-width: 3;
}

.server-pill-voice-badge {
    position: absolute;
    right: 6px;
    top: 5px;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    border: 2px solid var(--bg, #1e1f22);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
    z-index: 1;
}

.server-pill-voice-badge svg {
    width: 10px;
    height: 10px;
    stroke-width: 3;
}

.server-pill.add {
    background: linear-gradient(145deg, #16a34a, #15803d);
    color: #ddffe9;
    font-size: 24px;
}

.server-pill.join {
    background: linear-gradient(145deg, #26324d, #1a2032);
    color: #dce5ff;
    font-size: 18px;
}

.channel-panel {
    background: #2b2d31;
    border-right: 1px solid rgba(0, 0, 0, .22);
    display: grid;
    grid-template-rows: 64px minmax(0, 1fr) auto auto;
    backdrop-filter: blur(18px);
}

.channel-panel header, .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .22);
}

.channel-panel header {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.mini-actions {
    display: flex;
    gap: 6px;
    min-width: 0;
    flex: 0 0 auto;
}

#serverName, #channelName {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#serverName {
    display: block;
}

#serverName .verified-badge,
#channelName .verified-badge {
    vertical-align: -3px;
}

#serverName .verified-badge {
    margin-left: 6px;
}

.verified-badge {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    font-size: 11px;
    font-weight: 950;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .22);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(88, 101, 242, .18);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #dfe3ff;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .01em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.user-badge.official { background: linear-gradient(135deg, #5865f2, #22d3ee); border-color: transparent; color: white; }
.user-badge.team { background: rgba(34, 197, 94, .2); color: #9af7bc; }
.user-badge.gold { background: rgba(245, 158, 11, .22); color: #ffe0a3; }
.user-badge.blue { background: rgba(59, 130, 246, .22); color: #bfdbfe; }
.user-badge.green { background: rgba(34, 197, 94, .2); color: #bbf7d0; }
.user-badge.pink { background: rgba(236, 72, 153, .2); color: #fbcfe8; }
.user-badge.purple { background: rgba(168, 85, 247, .22); color: #e9d5ff; }
.user-badge.cyan { background: rgba(6, 182, 212, .2); color: #cffafe; }
.user-badge.bot { background: #5865f2; border-color: transparent; color: white; }
.user-badge.webhook { background: rgba(34, 211, 238, .2); border-color: transparent; color: #a5f3fc; }

.user-badge.self-badge {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .12);
    color: var(--soft);
    text-transform: none;
    letter-spacing: 0;
    font-size: 11.5px;
    font-weight: 800;
}

.user-badge.self-badge svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    color: #a5b4fc;
}

.self-badge-emoji {
    font-size: 12px;
    line-height: 1;
}

.badge-toggle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.badge-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    color: var(--soft);
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.badge-toggle span,
.badge-toggle .self-badge-emoji {
    font-size: 15px;
    line-height: 1;
}

.badge-toggle svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: #a5b4fc;
    transition: color .16s ease;
}

.badge-toggle:hover {
    border-color: rgba(99, 102, 241, .32);
    background: rgba(99, 102, 241, .11);
    transform: translateY(-1px);
}

.badge-toggle.active {
    border-color: rgba(99, 102, 241, .55);
    background: rgba(99, 102, 241, .2);
    color: var(--text);
}

.badge-toggle.active svg {
    color: #c7d2fe;
}

.inline-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.timeout-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: var(--danger);
    vertical-align: middle;
}

.timeout-badge svg {
    width: 14px;
    height: 14px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(20, 24, 39, .38);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.profile-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    justify-self: start;
    margin: 2px 0 8px;
    padding: 3px 9px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .07);
    color: var(--soft);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .02em;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.profile-tag-chip:hover {
    border-color: rgba(99, 102, 241, .5);
    background: rgba(99, 102, 241, .16);
    color: var(--text);
}

.profile-tag-chip .tag-emoji {
    font-size: 13px;
    line-height: 1;
}

.friend-card .inline-badges {
    justify-content: center;
    margin-left: 0;
}

.chat-header {
    background: #313338;
    backdrop-filter: blur(18px);
}

.chat-header > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.chat-header > div:first-child > strong {
    min-width: 0;
}

.mobile-channel-toggle {
    display: none;
    flex: 0 0 auto;
}

#channelType {
    color: var(--cyan);
    font-weight: 900;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    border: 1px solid transparent;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.icon-button:hover, .icon-button.active {
    color: white;
    background: rgba(99, 102, 241, .18);
    border-color: rgba(99, 102, 241, .28);
    transform: translateY(-1px);
}

/* Kleine Signature-Animationen für Mikrofon/Kopfhörer/Einstellungen im User-Strip - spielen kurz
   beim Hover ab (nur aufs SVG-Icon, nicht auf den Button selbst, damit sie sich nicht mit dessen
   eigenem translateY-Hover-Effekt oben in die Quere kommen). */
@keyframes iconWiggle {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(-14deg); }
    70% { transform: rotate(14deg); }
}

@keyframes iconSpinPeek {
    0%, 100% { transform: rotate(0deg); }
    60% { transform: rotate(90deg); }
}

#quickMuteButton:hover svg,
#quickDeafenButton:hover svg,
[data-mobile-mute]:hover svg,
[data-mobile-deafen]:hover svg {
    animation: iconWiggle .4s ease;
}

#settingsButton:hover svg,
[data-mobile-settings]:hover svg,
#panelServerSettingsButton:hover svg {
    animation: iconSpinPeek .4s ease;
}

/* Mute / Deafen active state – red with diagonal strikethrough */
#muteButton.active,
#quickMuteButton.active,
[data-call-mute].active {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, .15) !important;
    border-color: rgba(239, 68, 68, .3) !important;
    position: relative;
    transform: none;
}
#muteButton.active::after,
#quickMuteButton.active::after,
[data-call-mute].active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top left, transparent 47%, var(--danger) 47%, var(--danger) 53%, transparent 53%);
    pointer-events: none;
    border-radius: var(--radius);
}

#deafenButton.active,
#quickDeafenButton.active,
[data-call-deafen].active {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, .15) !important;
    border-color: rgba(239, 68, 68, .3) !important;
    position: relative;
    transform: none;
}
#deafenButton.active::after,
#quickDeafenButton.active::after,
[data-call-deafen].active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top left, transparent 47%, var(--danger) 47%, var(--danger) 53%, transparent 53%);
    pointer-events: none;
    border-radius: var(--radius);
}

/* Call-stage mute/deafen use [data-call-mute]/[data-call-deafen], already covered above */

/* Mobile user strip mute/deafen */
[data-mobile-mute].active,
[data-mobile-deafen].active {
    color: var(--danger) !important;
    position: relative;
}
[data-mobile-mute].active::after,
[data-mobile-deafen].active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top left, transparent 47%, var(--danger) 47%, var(--danger) 53%, transparent 53%);
    pointer-events: none;
    border-radius: var(--radius);
}

.channel-list {
    overflow: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.channel-search {
    height: 44px;
    margin-bottom: 12px;
    background: #1e1f22;
    border-color: rgba(255, 255, 255, .05);
    font-weight: 800;
}

.server-mini-profile {
    margin: 0 0 14px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .045);
}

.server-mini-banner {
    min-height: 76px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--server-banner), #fff 13%), var(--server-banner)),
        var(--server-banner);
    background-size: cover;
    background-position: center;
}

.server-mini-meta {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
}

.server-mini-meta > div {
    min-width: 0;
    overflow: hidden;
}

.server-mini-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: var(--radius);
    color: white !important;
    font-size: 13px;
    font-weight: 950;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13);
}

.server-mini-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-mini-meta strong,
.server-mini-meta small {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-mini-meta small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.server-mini-tags,
.invite-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 10px;
}

.server-mini-tags span,
.invite-tags span {
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(99, 102, 241, .16);
    color: #cfd5ff;
    font-size: 11px;
    font-weight: 850;
}

.server-mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 10px 10px;
}

.server-mini-actions button {
    flex: 0 0 auto;
}

.category-title {
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    margin: 16px 8px 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}
.category-collapse-icon {
    display: inline-flex;
    flex: 0 0 auto;
}
.category-collapse-icon svg {
    width: 12px;
    height: 12px;
    transition: transform .14s ease;
}
.category-title.collapsed .category-collapse-icon svg {
    transform: rotate(-90deg);
}
.category-channels {
    min-height: 10px;
}
.category-channels.is-collapsed .channel-row:not(.active) {
    display: none;
}
.category-channels.is-collapsed .voice-presence {
    display: none;
}
.category-add {
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.category-add:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .08);
}

/* --- Event Detail View --- */
.event-detail {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 24px;
}
.event-detail-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 28px;
}
.event-detail-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 10px 12px;
    background: rgba(255,255,255,.06);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.1);
}
.event-detail-day {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}
.event-detail-month {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.event-detail-info {
    flex: 1;
    min-width: 0;
}
.event-detail-info h1 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
}
.event-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.event-detail-meta-item {
    font-size: 13px;
    color: var(--muted);
}
.event-detail-meta-item a {
    color: var(--brand);
    text-decoration: none;
}
.event-detail-meta-item a:hover {
    text-decoration: underline;
}
.event-detail-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.event-detail-body {
    margin-bottom: 28px;
    padding: 20px;
    background: rgba(255,255,255,.03);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.06);
}
.event-detail-body h3 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.event-detail-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--soft);
    white-space: pre-wrap;
}
.event-detail-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- Events List Dialog --- */
.events-list-dialog {
    width: min(480px, calc(100vw - 22px));
}

.events-list-card {
    max-height: calc(100dvh - 22px);
}

.events-list-body {
    display: grid;
    gap: 8px;
    padding: 16px;
    overflow: auto;
}

.event-list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.event-list-row:hover {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .16);
}

.event-list-row.is-past {
    opacity: .5;
}

.event-list-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 46px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, .06);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
}

.event-list-date span {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}

.event-list-date small {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

.event-list-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.event-list-info strong {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-list-info small {
    font-size: 12px;
    color: var(--muted);
}

.event-form-body {
    padding: 0 16px 8px;
}

/* --- Timeout Dialog --- */
.timeout-dialog {
    width: min(480px, calc(100vw - 22px));
}

.timeout-dialog-body {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.timeout-duration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.timeout-preset {
    justify-content: center;
}

.timeout-preset.active {
    background: rgba(99, 102, 241, .28);
    border-color: rgba(99, 102, 241, .5);
    color: var(--text);
}

.timeout-custom-field,
.timeout-dialog-body label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--soft);
}

.timeout-dialog-body textarea,
.timeout-dialog-body input {
    width: 100%;
}

/* --- Channel Type Toggle --- */
.channel-type-toggle {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.channel-type-option {
    flex: 1;
    justify-content: center;
}

.channel-type-option.active {
    background: rgba(99, 102, 241, .28);
    border-color: rgba(99, 102, 241, .5);
    color: var(--text);
}

.channel-subtype-group {
    padding: 0 16px 12px;
}

.channel-subtype-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.channel-subtype-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.channel-subtype-option {
    flex: 1 1 auto;
    justify-content: center;
}

.channel-subtype-option.active {
    background: rgba(99, 102, 241, .28);
    border-color: rgba(99, 102, 241, .5);
    color: var(--text);
}

.channel-subtype-hint {
    margin: 0 16px 14px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* ── Developer Portal ─────────────────────────────────────────────── */

.devportal-board {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px;
}
.devportal-hero {
    margin-bottom: 24px;
}
.devportal-hero .eyebrow {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.devportal-hero h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
}
.devportal-hero p {
    color: var(--text-muted);
    margin: 0 0 12px;
}
.devportal-app-grid {
    display: grid;
    gap: 12px;
}
.devportal-app-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(24,25,31,.72);
}
.devportal-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    background-size: cover !important;
}
.devportal-app-info {
    flex: 1;
    min-width: 0;
}
.devportal-app-info h4 {
    margin: 0;
    font-size: 1rem;
}
.devportal-app-info small {
    color: var(--text-muted);
    font-size: .8rem;
}
.devportal-app-info p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.devportal-app-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: .8rem;
    color: var(--text-muted);
}
.devportal-app-actions {
    flex-shrink: 0;
}
.devportal-app-detail {
    max-width: 700px;
}
.devportal-detail-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.devportal-detail-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    background-size: cover !important;
}
.devportal-detail-info h2 {
    margin: 0;
    font-size: 1.3rem;
}
.devportal-detail-info p {
    margin: 2px 0;
    color: var(--text-muted);
}
.devportal-detail-id {
    font-size: .8rem;
    color: var(--text-muted);
    font-family: monospace;
}
.devportal-detail-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.devportal-detail-section h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}
.danger-zone {
    border-bottom: none !important;
    padding: 16px;
    border-radius: var(--radius);
    background: rgba(240,93,94,.08);
    border: 1px solid rgba(240,93,94,.2);
}
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feature-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,.15);
    border-radius: var(--radius);
}
.feature-row div {
    flex: 1;
    min-width: 0;
}
.feature-row strong {
    display: block;
    font-size: .9rem;
}
.feature-row small {
    color: var(--text-muted);
    font-size: .8rem;
}
.feature-add-details {
    margin-top: 8px;
}
.feature-add-details summary {
    cursor: pointer;
    color: var(--accent);
    font-size: .9rem;
    padding: 4px 0;
}
.server-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.server-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,.15);
    border-radius: var(--radius);
}
.add-server-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.bot-invite-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(0,0,0,.2);
    color: inherit;
    font-size: .9rem;
}
.checkbox-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    cursor: pointer;
}
.bot-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    background: #5865f2;
    color: #fff;
    vertical-align: middle;
}

.channel-row {
    width: 100%;
    min-height: 44px;
    border-radius: var(--radius);
    padding: 0 11px;
    color: #b5bac1;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    min-width: 0;
    border: 1px solid transparent;
    position: relative;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.channel-row.has-unread::before,
.channel-row.has-ping::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.channel-row-item {
    position: relative;
}

.channel-invite-hover-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    opacity: 0;
    pointer-events: none;
    background: rgba(30, 31, 34, .92);
    transition: opacity .12s ease;
}

/* .icon-button:hover setzt sonst transform: translateY(-1px) und ersetzt damit
   komplett die vertikale Zentrierung hier - Button springt beim Hover nach unten. */
.channel-invite-hover-button:hover {
    transform: translateY(-50%);
}

.channel-row-item:hover .channel-invite-hover-button,
.channel-invite-hover-button:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: none) {
    .channel-invite-hover-button {
        opacity: 1;
        pointer-events: auto;
    }
}

.friend-hide-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    opacity: 0;
    pointer-events: none;
    background: rgba(30, 31, 34, .92);
    transition: opacity .12s ease, background .12s ease, color .12s ease;
}

.friend-hide-button:hover {
    transform: translateY(-50%);
    background: #f23f43;
    color: white;
}

.channel-row-item:hover .friend-hide-button,
.friend-hide-button:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: none) {
    .friend-hide-button {
        opacity: 1;
        pointer-events: auto;
    }
}

.channel-row.has-ping::before {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

.channel-row em {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(34, 197, 94, .16);
    color: #9af7bc;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.voice-presence {
    display: grid;
    gap: 6px;
    margin: 4px 0 8px 28px;
}

.voice-presence > div {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    color: var(--muted);
}

.voice-presence .avatar,
.voice-presence .avatar-wrap {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.voice-presence .status-dot {
    width: 10px;
    height: 10px;
    border-width: 2px;
}

.voice-presence small {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vp-row-body {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.vp-row-body small {
    width: 100%;
}

.vp-icons {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.voice-presence-bot {
    color: var(--soft) !important;
}

.voice-bot-badge,
.call-bot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: linear-gradient(135deg, #5865f2, #22d3ee);
    color: white;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.voice-bot-badge {
    padding: 3px 5px;
    flex: 0 0 auto;
}

.channel-row:hover, .channel-row.active {
    background: #3f4248;
    color: white;
    border-color: rgba(255, 255, 255, .07);
}

.channel-row:hover {
    transform: translateX(1px);
}

.channel-row.has-unread {
    color: var(--text);
    font-weight: 850;
}

.channel-row.has-row-bg {
    position: relative;
    overflow: hidden;
}

.channel-row.has-row-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--row-bg);
    background-size: cover;
    background-position: center;
    opacity: .95;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0, 0, 0, .65) 62%, black 82%);
    mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0, 0, 0, .65) 62%, black 82%);
    pointer-events: none;
}

.channel-row.has-row-bg > * {
    position: relative;
    z-index: 1;
}

.friend-row strong {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-row.is-blocked {
    min-height: 62px;
    flex-wrap: wrap;
    row-gap: 2px;
    border-color: rgba(239, 68, 68, .24);
    background: rgba(239, 68, 68, .07);
}

.friend-row .blocked-inline {
    flex: 1 0 calc(100% - 58px);
    margin-left: 49px;
    margin-top: -8px;
    color: #fca5a5;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.25;
}

.channel-row[data-group] {
    min-height: 58px;
    flex-wrap: wrap;
    row-gap: 2px;
}

.group-member-count {
    flex: 1 0 calc(100% - 54px);
    margin-left: 45px;
    margin-top: -8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.unread-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}

.unread-dot.ping {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

.friend-row.has-unread .avatar-wrap::before,
.friend-row.has-unread .group-avatar::before,
.friend-card.has-unread .avatar-wrap::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}

.friend-row.has-ping .avatar-wrap::before,
.friend-row.has-ping .group-avatar::before,
.friend-card.has-ping .avatar-wrap::before {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

.channel-row[draggable="true"] {
    cursor: grab;
}

.channel-row.dragging {
    opacity: .52;
    outline: 1px solid rgba(99, 102, 241, .5);
}

.category-title[draggable="true"] {
    cursor: grab;
    border-radius: var(--radius);
}

.category-title.dragging {
    opacity: .52;
    outline: 1px solid rgba(99, 102, 241, .5);
}

[data-drag-user][draggable="true"] {
    cursor: grab;
}

[data-drag-user].dragging {
    opacity: .52;
    outline: 1px solid rgba(99, 102, 241, .5);
}

.channel-row.member-drop-target {
    background: rgba(99, 102, 241, .22);
    outline: 2px dashed rgba(99, 102, 241, .6);
    outline-offset: -2px;
}

.voice-presence-draggable {
    border-radius: 6px;
}

.channel-row .avatar-wrap,
.channel-row .avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.channel-row span {
    color: var(--cyan);
    font-weight: 900;
}

.group-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, #5865f2, #22c55e);
    color: white !important;
    font-size: 12px;
    font-weight: 950;
    overflow: hidden;
}

.group-avatar.has-image {
    background: rgba(255, 255, 255, .06);
}

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

.voice-card {
    margin: 12px;
    padding: 13px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(34, 197, 94, .13), rgba(99, 102, 241, .1));
    border: 1px solid rgba(255, 255, 255, .1);
}

.voice-card.is-hidden {
    display: none;
}

.voice-card span { font-weight: 850; }
.voice-card small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.voice-card.mini-call-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    background:
        radial-gradient(circle at 16% 0%, rgba(99, 102, 241, .16), transparent 46%),
        linear-gradient(145deg, rgba(31, 41, 55, .86), rgba(17, 24, 39, .82));
    border-color: rgba(99, 102, 241, .24);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
}

.mini-call-head {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-call-ping {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .16);
    color: var(--green);
    cursor: default;
}

.mini-call-ping svg {
    width: 14px;
    height: 14px;
}

.mini-call-info {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
    cursor: pointer;
    border-radius: 6px;
}

.mini-call-info:hover strong {
    text-decoration: underline;
}

.mini-call-info strong,
.mini-call-info small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-call-info small {
    color: var(--muted);
    font-weight: 700;
}

.mini-call-head .icon-button.danger {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    color: var(--danger);
    background: rgba(239, 68, 68, .12);
}

.mini-call-head .icon-button.danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.mini-call-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-call-actions .icon-button {
    width: 32px;
    height: 32px;
}

.mini-call-share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 32px;
    padding: 0 8px;
    border-radius: var(--radius);
    background: rgba(99, 102, 241, .12);
    border: 1px solid rgba(99, 102, 241, .24);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.mini-call-share-row[disabled] {
    cursor: default;
}

.mini-call-share-row svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    color: var(--cyan);
}

.mini-call-share-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-call-media {
    position: relative;
    min-height: 108px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: #0b1020;
}

.mini-call-media[hidden] {
    display: none;
}

.mini-call-video {
    width: 100%;
    height: 100%;
    min-height: 108px;
    display: block;
    object-fit: cover;
}

.mini-call-people {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.mini-call-person {
    width: 34px;
    height: 34px;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .08);
}

.mini-call-person.speaking {
    box-shadow: 0 0 0 2px var(--green), 0 0 0 6px rgba(34, 197, 94, .18);
}

.mini-call-person.soundboard-playing {
    box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px rgba(59, 130, 246, .22);
}

.mini-call-person .avatar,
.mini-call-person .avatar-wrap {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 12px;
}

.mini-call-person .status-dot {
    display: none;
}

.user-strip {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 32px 32px 32px;
    gap: 7px;
    align-items: center;
    padding: 12px;
    margin: 0 10px 10px;
    background: rgba(30, 31, 36, .58);
    border: 1px solid rgba(0, 0, 0, .24);
    border-radius: 16px;
}

.user-strip::before {
    content: "";
    position: absolute;
    inset: -24px;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(10, 11, 16, .3), rgba(10, 11, 16, .5)),
        var(--custom-bg-image, none) center / cover no-repeat,
        var(--app-bg-paint, #232428);
    filter: blur(18px) saturate(1.25);
    transform: scale(1.12);
}

#selfAvatar {
    border-radius: 50%;
}

.user-strip .icon-button {
    border-radius: 50%;
}

.self-profile-button {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-align: left;
}

.self-profile-button:hover {
    background: rgba(255, 255, 255, .075);
}

.self-name-button {
    display: grid;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.mobile-user-strip {
    display: none;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    font-weight: 950;
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
    overflow: hidden;
}

.avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
}

/* Runde Profilbilder: Direktnachrichten-Liste, Chat-Nachrichten, Mitgliederliste */
.friend-row .avatar,
.message .avatar,
.member .avatar {
    border-radius: 50%;
}

#mentionAutocomplete .avatar-wrap,
#mentionAutocomplete .avatar {
    width: 28px;
    height: 28px;
}

.avatar img,
#selfAvatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.status-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 3px solid #111827;
    background: #6b7280;
}

.status-dot.online, .mini-dot.online, .status-text.online { background: var(--green); }
.status-dot.idle, .mini-dot.idle, .status-text.idle { background: var(--amber); }
.status-dot.dnd, .mini-dot.dnd, .status-text.dnd { background: var(--danger); }
.status-dot.offline, .mini-dot.offline, .status-text.offline { background: #6b7280; }

.status-dot.is-mobile {
    width: 19px;
    height: 23px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    background: #111827;
}

.status-dot.is-mobile svg {
    width: 16px;
    height: 20px;
    display: block;
}

.status-dot.is-mobile.online svg { color: var(--green); }
.status-dot.is-mobile.idle svg { color: var(--amber); }
.status-dot.is-mobile.dnd svg { color: var(--danger); }
.status-dot.is-mobile.offline svg { color: #9aa1ac; }

.mini-dot, .status-text {
    display: inline-block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status-text {
    margin-right: 7px;
}

.status-bubble-floating {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateY(-50%);
    z-index: 9200;
    margin-top: 0 !important;
    pointer-events: none;
}

.status-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    margin-top: 6px;
}

.status-bubble-dot {
    display: block;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #fff;
}

.status-bubble-dot:nth-child(1) { width: 4px; height: 4px; }
.status-bubble-dot:nth-child(2) { width: 6px; height: 6px; }
.status-bubble-dot:nth-child(3) { width: 8px; height: 8px; }

.status-bubble-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 160px;
    padding: 8px 13px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    font-size: 12px;
    font-weight: 700;
    color: #1e1f22;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .24);
}

.status-bubble-emoji {
    font-size: 14px;
    line-height: 1;
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 1px;
}

.status-bubble-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.status-bubble.compact {
    margin-top: 4px;
    gap: 3px;
}

.status-bubble.compact .status-bubble-dot:nth-child(1) { width: 3px; height: 3px; }
.status-bubble.compact .status-bubble-dot:nth-child(2) { width: 5px; height: 5px; }

.status-bubble.compact .status-bubble-tag {
    max-width: 190px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    box-shadow: none;
}

.status-bubble-tag.custom-color {
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.user-strip strong, .member strong {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-strip small, .member small { color: var(--muted); }

.chat-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 64px minmax(0, 1fr);
    overflow: hidden;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
}

.header-actions > * {
    flex: 0 0 auto;
}

.header-actions #muteButton,
.header-actions #deafenButton,
.header-actions #cameraButton,
.header-actions #screenButton,
.header-actions #leaveVoiceButton {
    display: none !important;
}

.search-input {
    width: clamp(120px, 16vw, 220px);
    min-height: 38px;
    padding: 0 12px;
    background: rgba(255, 255, 255, .055);
}

.content-grid {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) clamp(280px, 24vw, 360px);
    overflow: hidden;
    align-items: stretch;
}

.message-area {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, auto) minmax(0, 1fr) minmax(68px, auto);
    max-width: 1120px;
    width: 100%;
    justify-self: center;
    overflow: hidden;
    align-self: stretch;
}

.messages {
    display: block;
    visibility: visible;
    overflow: auto;
    padding: clamp(14px, 2vw, 24px);
    min-height: 0;
    height: 100%;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.messages:empty::before {
    content: "Chat wird geladen ...";
    display: grid;
    place-items: center;
    min-height: 160px;
    color: var(--muted);
}

.message {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
    padding: 9px 0;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

.message:hover {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .04);
}

.message.pinned {
    background: rgba(245, 158, 11, .07);
}

.message.deleted {
    opacity: .66;
}

.deleted-message-body {
    color: var(--muted);
    font-style: italic;
}

.system-message {
    grid-template-columns: 34px minmax(0, 1fr);
    margin: 8px 0;
    padding: 12px;
    border: 1px solid rgba(99, 102, 241, .2);
    background: rgba(99, 102, 241, .1);
}

.render-error-message {
    border-color: rgba(248, 113, 113, .26);
    background: rgba(248, 113, 113, .1);
}

.system-message > div:first-child {
    display: grid;
    place-items: center;
    color: var(--cyan);
}

.system-message p {
    margin: 4px 0;
    color: var(--soft);
    white-space: pre-wrap;
}

.message-body {
    color: #e6eaf5;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Kleine Zitat-Vorschau der Originalnachricht über einer Antwort, mit einem nach unten zeigenden
   Pfeil-Symbol davor - klickbar, um zur Originalnachricht zu springen (falls noch geladen). */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12.5px;
    min-width: 0;
    cursor: pointer;
}

.reply-preview:hover {
    color: var(--soft);
}

.reply-preview .lucide {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    transform: scaleX(-1);
}

.reply-preview .avatar-wrap,
.reply-preview .avatar {
    width: 16px;
    height: 16px;
}

.reply-preview .status-dot {
    display: none;
}

.reply-preview-author {
    flex: 0 0 auto;
    color: var(--soft);
    font-weight: 800;
}

.reply-preview-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-preview-missing {
    cursor: default;
    font-style: italic;
}

.reply-preview-missing:hover {
    color: var(--muted);
}

@keyframes distalk-message-highlight {
    0%, 100% { background: transparent; }
    30% { background: rgba(99, 102, 241, .22); }
}

.message-highlight {
    animation: distalk-message-highlight 1.6s ease;
}

.message-body a,
.system-message a {
    color: #8fb2ff;
    font-weight: 850;
    text-decoration: none;
}

.message-body a:hover,
.system-message a:hover {
    text-decoration: underline;
}

.message-body h1,
.message-body h2,
.message-body h3 {
    margin: 8px 0 4px;
    padding: 0;
    font-weight: 700;
    line-height: 1.3;
}
.message-body h1 { font-size: 1.4em; }
.message-body h2 { font-size: 1.2em; }
.message-body h3 { font-size: 1.1em; }
.message-body strong { font-weight: 700; }
.message-body em { font-style: italic; }
.message-body u { text-decoration: underline; }
.message-body del { text-decoration: line-through; opacity: .8; }
.message-body code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .32);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
}

.mention-chip {
    min-height: 24px;
    margin: 0 2px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(88, 101, 242, .22);
    color: #cfd5ff;
    font: inherit;
    font-weight: 900;
    vertical-align: baseline;
}

.mention-chip:hover {
    background: rgba(88, 101, 242, .36);
    color: white;
}

.custom-emoji {
    width: 22px;
    height: 22px;
    margin: -4px 1px;
    object-fit: contain;
    vertical-align: middle;
}

.mention-chip.mention-everyone {
    background: rgba(240, 178, 50, .22);
    color: #f0d266;
}

.mention-chip.mention-everyone:hover {
    background: rgba(240, 178, 50, .36);
    color: white;
}

.mention-chip.mention-here {
    background: rgba(50, 210, 120, .22);
    color: #66f0a0;
}

.mention-chip.mention-here:hover {
    background: rgba(50, 210, 120, .36);
    color: white;
}

.mention-chip.role-mention-chip {
    color: #fff;
}

.mention-chip.role-mention-chip:hover {
    filter: brightness(1.12);
}

.mention-chip.time-mention-chip {
    display: inline-grid;
    align-items: center;
    background: rgba(34, 211, 238, .16);
    color: #a5f3fc;
}

.mention-chip.time-mention-chip:hover {
    background: rgba(34, 211, 238, .26);
    color: white;
}

.invite-message-card {
    width: min(520px, 100%);
    margin-top: 10px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(28, 31, 42, .72);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .24);
    backdrop-filter: blur(18px);
}

.invite-message-banner {
    height: 126px;
    background-size: cover;
    background-position: center;
}

.invite-message-body {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 16px;
}

.invite-message-icon {
    width: 66px;
    height: 66px;
    margin-top: -50px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 18px;
    border: 5px solid rgba(28, 31, 42, .95);
    color: white;
    font-size: 21px;
    font-weight: 950;
}

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

.invite-message-body h4 {
    margin: 0;
    color: white;
    font-size: 21px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.verified-mark {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #3ba55d;
    color: white;
    font-size: 12px;
    vertical-align: 2px;
}

.invite-message-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.invite-message-tags span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #d5daf0;
    font-size: 12px;
    font-weight: 850;
}

.invite-message-body p {
    margin: 0;
    color: var(--soft);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.invite-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    min-width: 0;
}

.invite-message-actions .primary-button {
    flex: 1 1 170px;
    min-width: min(170px, 100%);
    background: linear-gradient(135deg, #248046, #3ba55d);
    box-shadow: 0 14px 26px rgba(35, 165, 90, .24);
}

.webhook-embed {
    --webhook-embed-color: #5865f2;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    width: min(480px, 100%);
    max-width: 100%;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--webhook-embed-color);
    background: rgba(255, 255, 255, .045);
    box-shadow: var(--shadow-soft);
}

.webhook-embed-main {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 6px;
}

.webhook-embed-author {
    color: var(--soft);
    font-size: 12.5px;
    font-weight: 800;
}

.webhook-embed-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
    line-height: 1.35;
}

.webhook-embed-title a {
    color: inherit;
    text-decoration: none;
}

.webhook-embed-title a:hover {
    text-decoration: underline;
}

.webhook-embed-description {
    color: var(--soft);
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.webhook-embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 2px;
}

.webhook-embed-field {
    min-width: 0;
    flex: 1 1 100%;
    display: grid;
    gap: 2px;
}

.webhook-embed-field.inline {
    flex: 1 1 140px;
}

.webhook-embed-field strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
}

.webhook-embed-field span {
    color: var(--soft);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.webhook-embed-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 4px;
}

.webhook-embed-footer {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
}

.webhook-embed-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.attachments {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.attachment {
    width: min(420px, 100%);
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.attachment img,
.attachment video {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: rgba(0, 0, 0, .28);
}

.attachment audio {
    width: 100%;
    min-width: 0;
    padding: 10px;
}

.voice-attachment {
    padding: 10px;
    display: grid;
    gap: 8px;
    background: linear-gradient(135deg, rgba(34, 197, 94, .14), rgba(99, 102, 241, .1));
}

.voice-attachment strong {
    color: var(--text);
}

.voice-attachment audio {
    width: 100%;
    min-width: 0;
    padding: 0;
}

.voice-attachment a {
    padding: 0;
    color: #b7c2ff;
    font-size: 12px;
    font-weight: 850;
}

.attachment span,
.attachment a {
    display: block;
    padding: 9px 11px;
    color: var(--soft);
    overflow-wrap: anywhere;
}

.file-attachment {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    min-height: 54px;
    padding: 0;
    text-decoration: none;
}

.file-attachment strong {
    display: grid;
    place-items: center;
    height: 100%;
    background: rgba(99, 102, 241, .18);
}

.file-attachment span {
    color: var(--text);
}

.meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta time {
    color: var(--muted);
    font-size: 12px;
}

.meta small {
    color: var(--muted);
    font-size: 12px;
}

.pin-label {
    color: #ffd166;
}

.forwarded-label {
    font-style: italic;
}

.message-actions, .message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
    min-width: 0;
}

.message-actions {
    opacity: 0;
    transition: opacity .16s ease;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-actions button, .reaction {
    max-width: 100%;
    min-height: 26px;
    border-radius: var(--radius);
    padding: 0 8px;
    background: rgba(255, 255, 255, .06);
    color: var(--muted);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
}

.message-actions button:hover, .reaction:hover, .reaction.active {
    background: rgba(99, 102, 241, .18);
    color: white;
}

.pin-board {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, .22);
    background: linear-gradient(rgba(245, 158, 11, .1), rgba(245, 158, 11, .1)), var(--bg, #1e1f22);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .3);
}

.pin-board strong {
    color: #ffd166;
}

.pin-board-entry {
    display: grid;
    gap: 4px;
}

.pin-board-toggle {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.pin-board-toggle:hover {
    text-decoration: underline;
}

.pin-board-item {
    color: var(--soft);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.pin-board-item.expanded {
    display: block;
    overflow: visible;
}

.pin-board-item h1,
.pin-board-item h2,
.pin-board-item h3 {
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: 800;
}

.pin-board-item strong { font-weight: 700; }
.pin-board-item em { font-style: italic; }
.pin-board-item u { text-decoration: underline; }
.pin-board-item del { text-decoration: line-through; opacity: .8; }
.pin-board-item code {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .32);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
}

.incoming-call {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, auto);
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(34, 197, 94, .28);
    background: rgba(34, 197, 94, .11);
}

.incoming-call small {
    display: block;
    margin-top: 2px;
    color: var(--soft);
}

.composer {
    position: sticky;
    z-index: 8;
    bottom: 0;
    align-self: end;
    margin: 8px 16px 16px;
    width: auto;
    max-width: calc(100% - 32px);
    min-height: 52px;
    height: auto;
    max-height: 168px;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 42px 42px 42px 42px minmax(0, 1fr) 94px;
    gap: 10px;
    align-items: end;
    padding: 7px;
    border-radius: var(--radius);
    background: rgba(42, 45, 54, .96);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 18px 54px rgba(0, 0, 0, .24);
    backdrop-filter: blur(16px);
    overflow: hidden;
}

#voiceMessageButton.recording {
    background: rgba(239, 68, 68, .22);
    color: white;
    border-color: rgba(239, 68, 68, .42);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.timeout-banner {
    position: absolute;
    z-index: 8;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 8px 16px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: rgba(42, 45, 54, .96);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 18px 54px rgba(0, 0, 0, .24);
    backdrop-filter: blur(16px);
}

.timeout-banner-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ed4245;
    color: white;
}

.timeout-banner-icon .lucide {
    width: 19px;
    height: 19px;
}

.timeout-banner-body {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 3px;
}

.timeout-banner-body strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
}

.timeout-banner-desc {
    color: var(--soft);
    font-size: 12.5px;
    line-height: 1.5;
}

.timeout-banner-more {
    color: #8fb2ff;
    font: inherit;
    font-weight: 800;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.timeout-banner-more:hover {
    text-decoration: underline;
}

.timeout-banner-countdown {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.composer input,
.composer textarea {
    min-height: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.composer textarea {
    height: auto;
    max-height: 122px;
    resize: none;
    overflow-y: auto;
    padding: 8px 0;
    line-height: 1.4;
    font-family: inherit;
    white-space: pre-wrap;
    align-self: center;
}

.composer:focus-within {
    border-color: rgba(99, 102, 241, .42);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1), 0 18px 54px rgba(0, 0, 0, .24);
}

.composer.composer-disabled {
    opacity: .82;
    background: rgba(255, 255, 255, .045);
}

.composer.composer-disabled input,
.composer.composer-disabled textarea {
    color: var(--muted);
}

.composer-autocomplete {
    position: fixed;
    z-index: 9300;
    max-height: min(280px, 42vh);
    overflow: auto;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(48, 50, 58, .98);
    box-shadow: 0 18px 58px rgba(0, 0, 0, .38);
    backdrop-filter: blur(18px);
}

.composer-autocomplete[hidden] {
    display: none !important;
}

.composer-ac-section {
    padding: 7px 6px 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.composer-autocomplete .cmd-ac-item {
    min-height: 44px;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
}

.composer-autocomplete .cmd-ac-item + .cmd-ac-item {
    margin-top: 2px;
}

.composer-autocomplete .cmd-ac-item:hover,
.composer-autocomplete .cmd-ac-active {
    background: rgba(99, 102, 241, .18);
}

.composer-autocomplete .cmd-ac-item strong,
.composer-autocomplete .cmd-ac-item small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-autocomplete .cmd-ac-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.mention-ac-symbol {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(99, 102, 241, .20);
    color: #d9ddff;
    font-weight: 950;
}

.mention-ac-time .mention-ac-symbol {
    background: rgba(34, 211, 238, .16);
    color: #a5f3fc;
}

.mention-ac-role-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.message-area > .composer {
    overflow: visible;
}

.blocked-user-notice {
    margin: 10px 18px 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, .28);
    background: rgba(239, 68, 68, .1);
    color: #fecaca;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.4;
}

.profile-friend-request {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(34, 197, 94, .28);
    background: rgba(34, 197, 94, .1);
}

.profile-friend-request.pending {
    border-color: rgba(245, 158, 11, .28);
    background: rgba(245, 158, 11, .09);
}

.profile-friend-request p {
    margin: 0;
    color: var(--soft);
}

.right-panel {
    min-width: 0;
    min-height: 0;
    border-left: 1px solid var(--line);
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand-hot), transparent 78%), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--brand), transparent 90%), transparent 260px),
        rgba(43, 45, 49, var(--bg-alpha, .82));
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
}

.profile-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: 184px minmax(0, auto) auto;
    align-content: start;
    overflow: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding-bottom: 18px;
    scroll-padding-bottom: 18px;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand), transparent 76%), transparent 38%),
        linear-gradient(180deg, color-mix(in srgb, var(--brand-hot), transparent 90%), transparent 180px),
        rgba(43, 45, 49, var(--bg-alpha, .80));
}

.profile-banner {
    position: relative;
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 255, 255, .28), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--banner), #fff 28%), color-mix(in srgb, var(--banner), var(--brand-hot) 24%)),
        var(--banner);
    background-size: cover;
    background-position: center;
}

.profile-buttons {
    position: absolute;
    right: 14px;
    top: 14px;
    max-width: calc(100% - 28px);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    overflow: hidden;
}

.profile-buttons .icon-button {
    flex: 0 0 38px;
}

.profile-card {
    position: relative;
    margin: -54px 16px 16px;
    padding: 72px 18px 18px;
    border-radius: var(--radius);
    background: #313338;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: var(--shadow-soft), 0 1px 0 rgba(255, 255, 255, .04) inset;
    min-width: 0;
    display: grid;
    gap: 10px;
    align-self: start;
    height: auto;
    min-height: max-content;
    overflow: visible;
}

.profile-card-identity,
.profile-card-content {
    display: contents;
}

.profile-card.gradient-profile {
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .18), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--profile-a), #fff 18%), color-mix(in srgb, var(--profile-b), var(--brand-hot) 18%)),
        #313338;
    border: 1px solid rgba(255, 255, 255, .12);
}

.profile-card.gradient-profile section,
.profile-card.gradient-profile .profile-row,
.profile-card.gradient-profile .profile-status-line {
    background: rgba(255, 255, 255, .09);
    backdrop-filter: blur(12px);
}

.profile-avatar {
    position: absolute;
    left: 18px;
    top: -44px;
}

.profile-avatar .avatar,
.profile-avatar .avatar-wrap {
    width: 88px;
    height: 88px;
    font-size: 28px;
    border-radius: 50%;
}

.profile-avatar .status-dot {
    width: 20px;
    height: 20px;
    border-width: 4px;
}

.profile-card h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.08;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: anywhere;
}

.profile-sub {
    color: var(--soft);
    line-height: 1.45;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.profile-status-line {
    width: fit-content;
    max-width: 100%;
    min-height: 30px;
    margin-top: 10px;
    padding: 0 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--line);
    color: var(--soft);
}

.profile-status-line strong {
    font-size: 13px;
}

.profile-social-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.profile-social-link {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--line);
    color: var(--soft);
}

.profile-social-link:hover {
    background: rgba(99, 102, 241, .18);
    color: var(--text);
    border-color: rgba(99, 102, 241, .4);
}

.profile-social-link .lucide,
.profile-social-link .brand-icon {
    width: 17px;
    height: 17px;
}

.profile-spotify-now-playing {
    display: grid;
    gap: 10px;
}

.spotify-now-playing-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1db954;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.spotify-now-playing-head .lucide {
    width: 15px;
    height: 15px;
}

.spotify-now-playing-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spotify-now-playing-body img,
.spotify-now-playing-fallback {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
}

.spotify-now-playing-fallback {
    display: grid;
    place-items: center;
    background: rgba(29, 185, 84, .18);
    color: #1db954;
}

.spotify-now-playing-info {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 4px;
}

.spotify-now-playing-info strong {
    margin: 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-now-playing-info strong a {
    color: inherit;
    text-decoration: none;
}

.spotify-now-playing-info strong a:hover {
    text-decoration: underline;
}

.spotify-now-playing-info small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-progress {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
    margin-top: 2px;
}

.spotify-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #1db954;
}

.spotify-progress-times {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}

.social-link-fields {
    display: grid;
    gap: 8px;
}

.social-link-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-link-field .lucide,
.social-link-field .brand-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.social-link-field input {
    flex: 1 1 auto;
}

.spotify-connect-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#spotifyConnectStatus {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

#spotifyConnectStatus.is-connected {
    color: #1db954;
}

.profile-card section {
    margin-top: 8px;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .065);
    border: 1px solid rgba(255, 255, 255, .07);
}

.profile-card section strong {
    display: block;
    margin-bottom: 8px;
}

.profile-card section p {
    margin: 0;
    color: var(--soft);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.profile-action-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    min-width: 0;
}

.profile-bio {
    min-height: 112px;
}

.profile-bio p {
    overflow-wrap: anywhere;
}

.bio-link {
    color: var(--brand-hot, #5865f2);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bio-link:hover {
    color: var(--cyan, #22d3ee);
}

.link-warning-url {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    color: var(--soft);
    font-size: 13px;
    word-break: break-all;
}

.profile-facts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    background: rgba(255, 255, 255, .045) !important;
}

.profile-facts div {
    display: grid;
    gap: 3px;
}

.profile-facts span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.profile-facts strong {
    margin: 0 !important;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.profile-row {
    width: 100%;
    min-height: 50px;
    margin-top: 0;
    padding: 0 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .065);
    border: 1px solid rgba(255, 255, 255, .065);
    color: var(--text);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    font-weight: 900;
    text-align: left;
    overflow: hidden;
}

.profile-row {
    overflow-wrap: anywhere;
}

.profile-row > span {
    flex: 0 0 auto;
}

.profile-row:hover {
    background: rgba(99, 102, 241, .15);
    border-color: rgba(99, 102, 241, .24);
}

.profile-row.active {
    background: rgba(88, 101, 242, .22);
    border: 1px solid rgba(88, 101, 242, .36);
}

.profile-row.active span {
    transform: rotate(90deg);
}

.profile-details {
    display: none;
    gap: 10px;
    margin-top: 10px;
    max-width: 100%;
    min-width: 0;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(15, 17, 23, .28);
    border: 1px solid var(--line);
}

.profile-details.show {
    display: grid;
}

.modal.user-profile-popover {
    width: min(620px, calc(100% - 32px));
    max-height: calc(100dvh - 28px);
    background: transparent;
}

@media (max-width: 640px) {
    .modal.user-profile-popover {
        width: min(380px, calc(100% - 24px));
    }
}

.user-profile-popover-inner {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    max-height: calc(100dvh - 28px);
    border-radius: var(--radius);
    background: rgba(20, 24, 39, .96);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.user-profile-popover-scroll {
    position: relative;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.profile-voice-section {
    margin: 8px 10px 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    display: grid;
    gap: 6px;
    font-size: 12px;
}

.profile-voice-section strong {
    font-size: 12px;
}

.profile-voice-section .secondary-button.compact {
    font-size: 12px;
    min-height: 34px;
    height: 34px;
    padding: 0 12px;
}

.user-profile-popover-composer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .15);
}

.user-profile-popover-composer input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    font-size: 14px;
    padding: 0 12px;
    border-radius: 999px;
}

.user-profile-popover-composer .icon-button {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
}

.other-profile-card {
    position: relative;
}

.profile-view-close {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
}

.profile-view-close svg {
    width: 15px;
    height: 15px;
}

.modal.self-profile-menu-dialog {
    width: min(560px, calc(100% - 32px));
    background: transparent;
}

@media (max-width: 640px) {
    .modal.self-profile-menu-dialog {
        width: min(380px, calc(100% - 32px));
    }
}

.self-profile-menu-card {
    position: relative;
    display: grid;
    background: rgba(17, 21, 34, .96);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.self-profile-menu-card.gradient-profile {
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .18), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--profile-a), #fff 18%), color-mix(in srgb, var(--profile-b), var(--brand-hot) 18%)),
        rgba(17, 21, 34, .96);
    border-color: rgba(255, 255, 255, .12);
}

.self-profile-menu-card.gradient-profile .profile-row,
.self-profile-menu-card.gradient-profile .self-profile-menu-bio,
.self-profile-menu-card.gradient-profile .self-profile-menu-call,
.self-profile-menu-card.gradient-profile .profile-badges {
    background: rgba(255, 255, 255, .09);
    backdrop-filter: blur(12px);
}

@media (min-width: 641px) {
    .self-profile-menu-card {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "banner banner"
            "head rows"
            "badges rows"
            "status rows"
            "bio rows"
            "call rows";
    }

    .self-profile-menu-card .profile-banner {
        grid-area: banner;
    }

    .self-profile-menu-card .self-profile-menu-head {
        grid-area: head;
        align-self: start;
    }

    .self-profile-menu-card .self-profile-menu-badges {
        grid-area: badges;
        align-self: start;
    }

    .self-profile-menu-card .self-profile-menu-status {
        grid-area: status;
        align-self: start;
    }

    .self-profile-menu-card .self-profile-menu-bio {
        grid-area: bio;
        align-self: start;
    }

    .self-profile-menu-card .self-profile-menu-call {
        grid-area: call;
        align-self: start;
    }

    .self-profile-menu-card .self-profile-menu-rows {
        grid-area: rows;
        align-self: start;
        padding-top: 16px;
        border-left: 1px solid rgba(255, 255, 255, .08);
    }
}

.self-profile-menu-card .profile-banner {
    height: 100px;
}

.self-profile-menu-head {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 0 18px 18px;
    margin-top: -32px;
}

.self-profile-menu-head .profile-avatar {
    position: static;
    left: auto;
    top: auto;
}

.self-profile-menu-head .avatar,
.self-profile-menu-head .avatar-wrap {
    width: 72px;
    height: 72px;
}

.self-profile-menu-head .avatar {
    border: 4px solid rgba(17, 21, 34, .96);
}

.self-profile-menu-identity {
    min-width: 0;
    padding-bottom: 4px;
    transform: translateY(6px);
}

.self-profile-menu-head strong {
    display: block;
    font-size: 18px;
    color: var(--text);
    overflow-wrap: anywhere;
}

.self-profile-menu-head small {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
}

.self-profile-menu-badges {
    margin: 0 16px 14px;
}

.self-profile-menu-bio {
    display: grid;
    gap: 6px;
    margin: 0 16px 16px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
}

.self-profile-menu-bio > strong {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
}

.self-profile-menu-call {
    display: grid;
    gap: 10px;
    margin: 0 16px 16px;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(99, 102, 241, .1);
    border: 1px solid rgba(99, 102, 241, .28);
}

.self-profile-menu-call-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
}

.self-profile-menu-call-head svg {
    width: 14px;
    height: 14px;
}

.self-profile-menu-call-body {
    display: flex;
    align-items: center;
    gap: 8px;
}

.self-profile-menu-call-body strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.self-profile-menu-call-avatar {
    flex: 0 0 auto;
    margin-left: -10px;
}

.self-profile-menu-call-avatar:first-child {
    margin-left: 0;
}

.self-profile-menu-call-avatar .avatar,
.self-profile-menu-call-avatar .avatar-wrap {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(20, 24, 39, .96);
}

.self-profile-menu-bio-text {
    margin: 0;
    color: var(--soft);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.self-profile-menu-bio-text.expanded {
    display: block;
    overflow: visible;
}

.self-profile-menu-bio-toggle {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.self-profile-menu-bio-toggle:hover {
    text-decoration: underline;
}

.self-profile-menu-rows {
    display: grid;
    gap: 8px;
    padding: 0 16px 16px;
}

.self-profile-menu-rows .profile-row,
.self-profile-menu-status .profile-row {
    min-height: 48px;
}

.self-profile-menu-status {
    display: grid;
    padding: 0 16px 16px;
}

.profile-row.static-row {
    cursor: default;
}

.profile-row.static-row:hover {
    background: rgba(255, 255, 255, .065);
    border-color: rgba(255, 255, 255, .065);
}

.self-profile-menu-rows .secondary-button,
.self-profile-menu-rows .danger-button {
    width: 100%;
    justify-content: flex-start;
}

.self-profile-status-picker {
    display: grid;
    gap: 4px;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.self-profile-status-picker > small {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    padding: 0 4px 4px;
}

.self-status-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    text-align: left;
}

.self-status-option:hover {
    background: rgba(255, 255, 255, .06);
}

.self-status-option.active {
    background: rgba(99, 102, 241, .16);
}

.self-status-option svg {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--brand);
}

.self-profile-account-picker {
    display: grid;
    gap: 6px;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.self-account-row {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
}

.self-account-row.active {
    background: rgba(99, 102, 241, .14);
}

.self-account-switch {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.self-account-switch:not(:disabled):hover {
    background: rgba(255, 255, 255, .06);
}

.self-account-switch:disabled {
    cursor: default;
}

.self-account-switch .avatar-wrap {
    width: 30px;
    height: 30px;
}

.self-account-switch .status-dot {
    display: none;
}

.self-account-switch span {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.self-account-switch strong {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.self-account-switch small {
    color: var(--muted);
    font-size: 11.5px;
}

.self-account-switch em {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-style: normal;
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
}

.self-account-switch em svg {
    width: 13px;
    height: 13px;
}

.self-account-remove {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
}

.self-account-add {
    margin-top: 2px;
    justify-content: center;
}

.profile-details > strong {
    color: var(--text);
    font-size: 13px;
}

.profile-detail-row {
    width: 100%;
    min-height: 54px;
    border-radius: var(--radius);
    padding: 9px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    text-align: left;
    border: 1px solid rgba(255, 255, 255, .07);
}

.profile-detail-row:hover {
    background: rgba(99, 102, 241, .2);
    border-color: rgba(99, 102, 241, .35);
}

.profile-detail-row > span:last-child {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.profile-detail-row strong,
.profile-detail-row small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-detail-row small {
    color: var(--muted);
    font-size: 12px;
}

.profile-details p {
    margin: 0;
    padding: 8px 2px;
    color: var(--muted);
}

.server-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset;
}

.server-dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(99, 102, 241, .24);
    border-radius: var(--radius);
    background: rgba(99, 102, 241, .1);
}

.group-head .group-avatar {
    width: 48px;
    height: 48px;
    font-size: 15px;
}

.group-head-info {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.group-head-actions {
    grid-column: 1 / -1;
}

.group-head strong {
    font-size: 18px;
}

.group-head span {
    color: var(--soft);
    overflow-wrap: anywhere;
}

.full-profile {
    align-self: end;
    min-height: 52px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: transparent;
    color: var(--soft);
    font-weight: 900;
}

.home-profile {
    margin: 16px;
    padding: 18px;
}

.video-stage {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 11px;
    padding: 12px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.video-stage .call-focus,
.video-stage .call-grid {
    grid-row: 1;
}

.video-stage .stage-panel {
    grid-row: 2;
}

.video-stage .call-stage-controls {
    grid-row: 3;
}

.content-grid.call-focus-mode {
    grid-template-columns: minmax(0, 1fr);
}

.content-grid.call-focus-mode .right-panel {
    display: none;
}

.content-grid.hide-members {
    grid-template-columns: minmax(0, 1fr);
}

.content-grid.hide-members .right-panel {
    display: none;
}

.content-grid.in-call {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
}

.content-grid.in-call .right-panel {
    display: none;
}

.content-grid.in-call .message-area {
    grid-template-rows: minmax(0, 1fr) !important;
    max-width: none;
    padding-bottom: 0 !important;
}

.content-grid.in-call .message-area > .messages,
.content-grid.in-call .message-area > .composer {
    display: none !important;
}

.content-grid.in-call .video-stage.center-stage {
    min-height: 0;
    max-height: none;
    height: 100%;
    margin: 0;
    padding: 16px;
    border-radius: 0;
    border: 0;
    border-bottom: 0;
}

.content-grid.in-call .call-stage-controls {
    justify-self: center;
    padding: 8px 14px;
    margin-bottom: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.chat-panel.in-call-fullscreen .chat-header #messageSearch,
.chat-panel.in-call-fullscreen .chat-header #addFriendButton,
.chat-panel.in-call-fullscreen .chat-header #headerInviteButton,
.chat-panel.in-call-fullscreen .chat-header #headerServerSettingsButton {
    display: none !important;
}

.call-chat-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    width: clamp(320px, 27vw, 400px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand-hot), transparent 78%), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--brand), transparent 90%), transparent 260px),
        rgba(43, 45, 49, var(--bg-alpha, .82));
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 24px rgba(0, 0, 0, .35);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.call-chat-panel .composer {
    margin: 8px;
    max-width: calc(100% - 16px);
    grid-template-columns: 36px 36px 36px 36px minmax(0, 1fr) 60px;
    gap: 6px;
}

.call-chat-panel .composer .icon-button {
    width: 36px;
    height: 36px;
}

.call-chat-panel .composer .send-button span {
    display: none;
}

.call-chat-panel[hidden] {
    display: none;
}

.call-chat-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.call-chat-panel-head strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
}

.call-chat-panel-body {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
}

.call-chat-panel-body .messages {
    min-height: 0;
    overflow: auto;
}

@media (max-width: 760px) {
    .call-chat-panel {
        width: 100%;
    }
}

.call-stage-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 2px 10px;
}

.call-stage-head strong {
    display: block;
}

.call-stage-head small {
    color: var(--muted);
}

.call-stage-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stream-volume {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.stream-volume input {
    width: 92px;
    min-height: 0;
    padding: 0;
    accent-color: var(--cyan);
}

.call-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(max(160px, calc((100% - 24px) / 3)), 1fr));
    align-content: start;
    gap: 12px;
    overflow: auto;
    overscroll-behavior: contain;
}

.stage-tile-section-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
}

.stage-tile-section-head:first-child {
    padding-top: 0;
}

.stage-tile-section-head span {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    color: var(--brand);
}

.stage-tile-section-head small {
    margin-left: auto;
    color: var(--soft);
}

.call-stage-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 4px;
}

.call-stage-controls .icon-button {
    width: 42px;
    height: 42px;
}

.call-stage-controls .icon-button.danger {
    color: var(--danger);
    background: rgba(239, 68, 68, .12);
}

.call-stage-controls .icon-button.danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.stage-panel {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(99, 102, 241, .08);
    border: 1px solid rgba(99, 102, 241, .2);
}

.stage-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-panel-head span {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--brand);
}

.stage-panel-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.stage-panel-head small {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--muted);
}

.stage-request-list {
    display: grid;
    gap: 6px;
    max-height: 140px;
    overflow: auto;
}

.stage-request-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
}

.stage-request-row span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-focus {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
}

.call-focus[hidden] {
    display: none;
}

.call-focus-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.call-focus-head strong {
    display: block;
}

.call-focus-head small {
    color: var(--muted);
}

.call-focus-view {
    min-height: 0;
    display: grid;
}

.video-stage.has-focused-tile {
    height: 100%;
    max-height: none;
    grid-template-rows: minmax(0, 1fr) auto auto auto;
}

.video-stage.has-focused-tile .call-focus {
    grid-row: 1;
    min-height: 0;
}

.video-stage.has-focused-tile .call-grid {
    display: grid;
    grid-row: 2;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(128px, 168px);
    height: 92px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior: contain;
}

.video-stage.has-focused-tile .call-grid .video-tile {
    min-height: 0;
    height: 92px;
}

.video-stage.has-focused-tile .call-grid .stage-tile-section-head {
    display: none;
}

.video-stage.has-focused-tile .stage-panel {
    grid-row: 3;
}

.video-stage.has-focused-tile .call-stage-controls {
    grid-row: 4;
}

.center-stage {
    min-height: clamp(150px, 24vh, 240px);
    max-height: 34vh;
    margin: 16px 16px 0;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .16), transparent 42%),
        rgba(255, 255, 255, .045);
}

.center-stage.has-focused-tile {
    min-height: clamp(320px, 58vh, 620px);
    height: auto;
    max-height: 70vh;
    margin: 8px 12px 0;
}

.video-tile {
    position: relative;
    min-height: 134px;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(145deg, #090b12, #151b2c);
    border: 1px solid var(--line);
}

.video-tile.avatar-tile {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
}

.video-tile.avatar-tile .tile-avatar,
.video-tile.avatar-tile .tile-name {
    display: block;
    position: relative;
    z-index: 1;
}

.video-tile.avatar-tile video {
    display: none !important;
}

.video-tile.speaking {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
}

.video-tile.soundboard-playing {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .28);
}

.video-tile.bot-tile {
    border-color: rgba(88, 101, 242, .42);
    background:
        radial-gradient(circle at 50% 18%, rgba(34, 211, 238, .16), transparent 36%),
        linear-gradient(145deg, #090b12, #151b2c);
}

.video-tile.bot-tile.speaking {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .22), 0 14px 38px rgba(88, 101, 242, .2);
}

.video-tile.screen-tile {
    grid-column: span 2;
    min-height: 180px;
    border-color: rgba(99, 102, 241, .45);
}

.video-tile.focused {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-color: rgba(34, 211, 238, .65);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.tile-avatar .avatar,
.tile-avatar .avatar-wrap {
    width: 70px;
    height: 70px;
    font-size: 24px;
    border-radius: 50%;
}

.tile-name {
    color: var(--soft);
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: calc(100% - 18px);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-bot-badge {
    padding: 4px 6px;
    flex: 0 0 auto;
}

.tile-icons {
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-size: 16px;
    line-height: 1;
    display: flex;
    gap: 3px;
    pointer-events: none;
}
.ti-mute { color: #ef4444; }
.ti-deaf { color: #ef4444; }

.video-tile:not(.avatar-tile) .tile-name {
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 2;
    max-width: calc(100% - 20px);
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 12px;
    color: #fff;
    pointer-events: none;
}

.vp-icon {
    font-size: 13px;
    line-height: 1;
    color: var(--danger);
}

.vp-icon.vp-on {
    color: var(--green);
}

.vp-icon svg {
    width: 12px;
    height: 12px;
    display: block;
}

.hidden-audio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-tile.focused video,
.video-tile.screen-tile video {
    object-fit: contain;
    background: #05070d;
}

.server-info {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, .22);
    background: rgba(99, 102, 241, .09);
}

.server-info strong {
    color: white;
}

.server-info p {
    margin: 0;
    color: var(--soft);
    line-height: 1.55;
    white-space: pre-wrap;
}

.video-tile span {
    position: absolute;
    left: 9px;
    bottom: 9px;
    border-radius: var(--radius);
    padding: 5px 8px;
    background: rgba(0, 0, 0, .62);
    font-size: 12px;
}

.empty-stage {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 166px;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: var(--radius);
}

.voice-center-copy {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 220px;
    text-align: center;
    color: var(--soft);
}

.voice-center-copy h2 {
    color: var(--text);
    font-size: clamp(28px, 4vw, 48px);
}

.compact-voice-chat {
    min-height: 156px;
    margin-bottom: 10px;
    border: 1px solid rgba(88, 101, 242, .18);
    border-radius: var(--radius);
    background: rgba(88, 101, 242, .08);
    padding: 18px;
}

.compact-voice-chat h2 {
    font-size: clamp(22px, 3vw, 34px);
}

.compact-voice-chat small {
    color: var(--muted);
    font-weight: 850;
}

.voice-chat-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0 auto 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(35, 165, 90, .14);
    color: #86efac;
    font-size: 12px;
    font-weight: 950;
}

.members {
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

.members h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.home-board {
    min-height: 100%;
    display: grid;
    align-content: start;
    gap: 18px;
}

.admin-board {
    display: grid;
    gap: 18px;
}

.admin-page {
    display: grid;
    gap: 18px;
}

.admin-board section {
    display: grid;
    gap: 12px;
}

.admin-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-section-head h3 {
    margin-bottom: 4px;
}

.admin-hero {
    padding: clamp(20px, 4vw, 30px);
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, .26);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .18), transparent 48%),
        rgba(255, 255, 255, .045);
}

.admin-hero h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 42px);
}

.admin-hero p {
    color: var(--soft);
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-announce-form {
    display: grid;
    gap: 10px;
}

.admin-ip-ban-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-ip-ban-form input {
    flex: 1 1 180px;
    min-width: 0;
}

.notes-board {
    display: grid;
    gap: 18px;
    min-height: 100%;
    align-content: start;
}

.notes-editor {
    align-content: stretch;
    height: 100%;
}

.notes-hero {
    padding: clamp(20px, 4vw, 30px);
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, .26);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .18), transparent 48%),
        rgba(255, 255, 255, .045);
    display: grid;
    gap: 12px;
    max-width: 480px;
}

.notes-hero h2 {
    margin: 0;
    font-size: clamp(22px, 3.4vw, 30px);
}

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

.notes-hero .settings-fields {
    margin-top: 6px;
}

.notes-editor form {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    height: 100%;
    min-height: 0;
}

.note-title-input {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .22);
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    outline: none;
}

.note-title-input:focus {
    border-color: var(--brand);
}

.note-body-input {
    width: 100%;
    min-height: 240px;
    height: 100%;
    resize: none;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .18);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    font-family: inherit;
}

.note-body-input:focus {
    border-color: var(--brand);
}

.notes-editor footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.notes-editor footer small {
    color: var(--muted);
}

.admin-announce-form textarea {
    min-height: 118px;
}

.muted-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.report-card textarea {
    min-height: 132px;
}

.report-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.report-reasons button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    font-weight: 850;
}

.report-reasons button:hover {
    border-color: rgba(99, 102, 241, .34);
    background: rgba(99, 102, 241, .18);
}

.admin-card,
.admin-user-row {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand), transparent 88%), color-mix(in srgb, var(--brand-hot), transparent 94%)),
        rgba(255, 255, 255, .062);
    box-shadow: var(--shadow-soft);
}

.admin-server-bans {
    margin-top: -4px;
    padding: 0 14px 14px;
}

.admin-server-bans summary {
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .24);
    color: var(--soft);
    font-weight: 800;
    list-style: none;
}

.admin-server-bans summary::-webkit-details-marker {
    display: none;
}

.admin-ban-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.admin-ban-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--line);
}

.admin-ban-row .avatar,
.admin-ban-row .avatar-wrap {
    width: 32px;
    height: 32px;
}

.audit-row {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .045);
}

.audit-row small {
    color: var(--muted);
}

.friend-picker-list {
    max-height: min(54vh, 520px);
    overflow: auto;
    display: grid;
    gap: 8px;
}

.friend-pick-row {
    display: grid !important;
    grid-template-columns: 22px 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
}

.friend-pick-row input {
    width: 18px;
    height: 18px;
}

.friend-pick-row strong,
.friend-pick-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-pick-row small {
    color: var(--muted);
}

.action-card {
    width: min(560px, calc(100vw - 28px));
}

.action-dialog {
    width: min(620px, calc(100% - 32px));
}

.action-dialog .action-card {
    width: 100%;
    margin-inline: auto;
}

.move-member-dialog {
    width: min(420px, calc(100% - 32px));
}

.add-account-dialog {
    width: min(420px, calc(100% - 32px));
}

.add-account-fields {
    grid-template-columns: 1fr;
    padding: 16px;
}

.move-member-channel-list {
    display: grid;
    gap: 8px;
    padding: 4px 24px 8px;
    max-height: min(360px, 50vh);
    overflow-y: auto;
}

.move-member-channel-row {
    width: 100%;
    justify-content: flex-start;
}

.friend-add-card {
    width: min(620px, calc(100vw - 24px));
}

.friend-add-body {
    display: grid;
    gap: 14px;
    padding: 16px;
    background:
        radial-gradient(circle at 16% 0%, rgba(34, 211, 238, .10), transparent 34%),
        radial-gradient(circle at 92% 12%, rgba(236, 72, 153, .10), transparent 28%);
}

.friend-add-hero {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, .24);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(34, 211, 238, .08)),
        rgba(255, 255, 255, .045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.friend-add-hero > span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand), var(--brand-hot));
    color: white;
    box-shadow: 0 16px 34px rgba(99, 102, 241, .24);
}

.friend-add-hero .lucide {
    width: 27px;
    height: 27px;
}

.friend-add-hero strong {
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 950;
}

.friend-add-hero p {
    margin: 5px 0 0;
    color: var(--soft);
    line-height: 1.45;
}

.friend-add-field {
    display: grid;
    gap: 8px;
}

.friend-add-field > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.friend-add-field > div {
    min-height: 52px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .13);
    background: rgba(12, 15, 25, .48);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.friend-add-field > div:focus-within {
    border-color: rgba(99, 102, 241, .58);
    background: rgba(12, 15, 25, .66);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}

.friend-add-field .lucide {
    color: var(--muted);
}

.friend-add-field input {
    min-height: 50px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    outline: none;
}

.friend-add-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-add-tips span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--soft);
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    font-weight: 850;
}

.friend-add-tips .lucide {
    width: 15px;
    height: 15px;
    color: var(--cyan);
}

.action-hero {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, .24);
    background: rgba(99, 102, 241, .12);
}

.action-hero > div {
    display: grid;
    gap: 10px;
}

.action-hero > span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand), var(--brand-hot));
    color: white;
    font-size: 22px;
    font-weight: 950;
}

.action-hero strong,
.action-hero p {
    display: block;
    margin: 0;
}

#groupIconPreview {
    border-radius: 50%;
    overflow: hidden;
}

#groupIconPreview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.action-hero p {
    margin-top: 4px;
    color: var(--soft);
    line-height: 1.45;
}

.action-hero.danger-hero {
    border-color: rgba(239, 68, 68, .3);
    background: rgba(239, 68, 68, .12);
}

.action-hero.danger-hero > span {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.privacy-danger-box {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, .28);
    background: rgba(239, 68, 68, .1);
}

.privacy-danger-box strong {
    color: var(--text);
    font-size: 15px;
}

.privacy-danger-box p {
    margin: 0;
    color: var(--soft);
    line-height: 1.5;
}

.privacy-danger-box .privacy-note {
    color: #fca5a5;
    font-weight: 800;
}

.privacy-danger-box button {
    width: fit-content;
}

.twofa-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.twofa-method-button {
    justify-content: flex-start;
    padding: 14px 16px;
}

.twofa-active-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(34, 197, 94, .3);
    background: rgba(34, 197, 94, .08);
}

.twofa-active-box strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
}

.twofa-active-box small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.twofa-active-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.twofa-body {
    display: grid;
    gap: 14px;
    padding: 4px 24px 20px;
}

.twofa-body p {
    margin: 0;
    color: var(--soft);
    line-height: 1.55;
}

.twofa-qr-box {
    display: flex;
    justify-content: center;
    padding: 16px;
    border-radius: var(--radius);
    background: #ffffff;
}

.twofa-qr-box svg {
    width: 200px;
    height: 200px;
}

.twofa-secret-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel-2);
}

.twofa-secret-box code {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 1px;
    color: var(--text);
    word-break: break-all;
}

.twofa-secret-box .twofa-uri {
    font-size: 12px;
    letter-spacing: 0;
}

.twofa-uri-details {
    color: var(--muted);
    font-size: 13px;
}

.twofa-uri-details summary {
    cursor: pointer;
    color: var(--accent, var(--brand));
    font-weight: 700;
}

.twofa-uri-details .twofa-secret-box {
    margin-top: 10px;
}

.twofa-code-input input {
    width: 100%;
    text-align: center;
    font-size: 28px;
    letter-spacing: 10px;
    font-weight: 800;
    padding: 14px;
}

.twofa-hint {
    font-size: 12.5px;
    color: var(--muted);
}

.twofa-error {
    margin: 0;
    color: #fca5a5;
    font-weight: 700;
}

.twofa-backup-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.twofa-backup-codes code {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel-2);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text);
}

.device-session-list {
    display: grid;
    gap: 10px;
    margin-bottom: 4px;
}

.device-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel-2);
}

.device-session-row.is-current {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .08);
}

.device-session-info {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.device-session-info strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: 14px;
}

.device-session-info small {
    color: var(--muted);
    font-size: 12.5px;
}

.device-session-badge {
    font-size: 11px;
    font-weight: 800;
    color: #4ade80;
    background: rgba(34, 197, 94, .16);
    border-radius: 999px;
    padding: 2px 8px;
}

.device-session-empty {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    padding: 4px 2px;
}

.server-create-card {
    width: min(560px, calc(100vw - 28px));
}

.server-wizard-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 18px 0;
}

.server-wizard-dot {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.server-wizard-dot.active {
    border-color: rgba(99, 102, 241, .55);
    background: rgba(99, 102, 241, .22);
    color: var(--text);
}

.server-wizard-dot.done {
    border-color: rgba(34, 197, 94, .5);
    background: rgba(34, 197, 94, .18);
    color: #86efac;
}

.server-wizard-panel {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.server-wizard-panel[hidden] {
    display: none !important;
}

.wizard-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.server-wizard-panel h3 {
    margin: 0;
}

.wizard-sub {
    margin: -6px 0 4px;
    color: var(--soft);
}

.server-wizard-icon-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.server-wizard-icon-preview {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: white;
    font-weight: 950;
    font-size: 20px;
}

.server-wizard-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-wizard-icon-fields {
    display: grid;
    gap: 8px;
}

.server-wizard-invite-preview {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    color: var(--soft);
    font-size: 13px;
    word-break: break-all;
}

.server-wizard-invite-preview span {
    color: var(--text);
    font-weight: 800;
}

.server-create-card footer {
    justify-content: space-between;
}

.wizard-footer-left,
.wizard-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.template-card {
    position: relative;
    min-height: 142px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    display: grid;
    align-content: start;
    gap: 8px;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.template-card:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, .32);
    background: rgba(99, 102, 241, .11);
}

.template-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.template-card > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .08);
}

.template-card small {
    color: var(--muted);
    line-height: 1.35;
}

.template-card.active {
    border-color: rgba(99, 102, 241, .55);
    background: rgba(99, 102, 241, .16);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.template-card.locked {
    cursor: default;
    min-height: auto;
}

.template-card.locked:hover {
    transform: none;
}

.server-template-list {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.server-template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
}

.server-template-row strong {
    display: block;
}

.server-sound-roles-picker {
    display: grid;
    gap: 6px;
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
}

.sound-trim-editor {
    display: grid;
    gap: 8px;
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
}

.sound-trim-canvas-wrap {
    position: relative;
    width: 100%;
}

.sound-trim-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 72px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .25);
}

.sound-trim-window {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40px;
    border-radius: 6px;
    border: 2px solid var(--brand);
    background: rgba(99, 102, 241, .18);
    cursor: grab;
    touch-action: none;
}

.sound-trim-window:active {
    cursor: grabbing;
}

.sound-trim-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: ew-resize;
    touch-action: none;
}

.sound-trim-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 20px;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    background: rgba(255, 255, 255, .8);
}

.sound-trim-handle[data-trim-handle="left"] {
    left: -5px;
}

.sound-trim-handle[data-trim-handle="right"] {
    right: -5px;
}

.sound-trim-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-trim-controls small {
    color: var(--muted);
}

.sound-role-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-left: 4px;
}

.server-sound-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
}

.server-sound-upload-row small {
    color: var(--muted);
}

.server-sound-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.server-sound-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
}

.server-sound-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(99, 102, 241, .18);
    color: var(--brand);
}

.server-sound-info {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.server-sound-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-sound-info small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-emoji-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.server-emoji-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
}

.server-emoji-thumb {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, .06);
}

.server-emoji-info {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.server-emoji-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}

.server-emoji-broken-hint {
    flex-shrink: 0;
    max-width: 32px;
    color: var(--danger);
    font-size: 9px;
    line-height: 1.25;
    word-break: break-all;
}

.server-template-row small {
    color: var(--muted);
}

.group-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.admin-card p,
.admin-card small,
.admin-user-row small {
    color: var(--soft);
}

.admin-card blockquote {
    margin: 0;
    padding: 10px;
    border-left: 3px solid var(--brand);
    background: rgba(0, 0, 0, .16);
    color: var(--text);
    overflow-wrap: anywhere;
}

.official-chat-lock {
    align-self: end;
    margin: 10px 18px 18px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(88, 101, 242, .12);
    color: var(--soft);
    font-size: 13px;
    font-weight: 800;
}

.admin-user-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
}

.admin-update-log-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    box-shadow: var(--shadow-soft);
}

.admin-update-log-row strong {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-update-log-row strong span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, .18);
    border: 1px solid rgba(99, 102, 241, .26);
    font-size: 12px;
}

.admin-update-log-row p {
    margin: 8px 0 0;
    color: var(--soft);
    line-height: 1.5;
}

.admin-update-log-row ul {
    display: grid;
    gap: 5px;
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
}

.admin-user-detail-body {
    display: grid;
    gap: 18px;
    padding: 16px;
}

.admin-user-detail-body section {
    display: grid;
    gap: 10px;
}

.admin-user-detail-list {
    display: grid;
    gap: 8px;
}

.admin-user-detail-list article {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
}

.admin-user-detail-row-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.admin-user-detail-row-head .quick-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-user-detail-status {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .045);
}

.admin-user-detail-status.is-active {
    border-color: rgba(237, 66, 69, .45);
    background: rgba(237, 66, 69, .11);
}

.note-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-user-detail-list p {
    margin: 0;
    color: var(--soft);
    line-height: 1.45;
}

.admin-user-detail-list small,
.admin-user-detail-card header p {
    margin: 0;
    color: var(--muted);
}

.admin-user-detail-body textarea {
    min-height: 110px;
    margin-top: 6px;
}

.update-log-form textarea[name="summary"] {
    min-height: 92px;
}

.update-log-form textarea[name="items"] {
    min-height: 150px;
}

.admin-server-row {
    grid-template-columns: 40px minmax(220px, 1fr) minmax(360px, auto);
}

.admin-server-row .quick-actions {
    justify-content: end;
    margin: 0;
}

.bot-mini-icon {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #5865f2; flex-shrink: 0; font-size: 18px;
}
.admin-bot-row {
    grid-template-columns: 40px minmax(220px, 1fr) minmax(360px, auto);
}
.admin-bot-row .quick-actions {
    justify-content: end;
    margin: 0;
}
.tag-input-row {
    display: flex; flex-direction: column;
}
.tag-input-row input {
    width: 100%;
}

.settings-fields label small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.bot-discover-banner {
    background: linear-gradient(135deg, #5865f2, #eb459e) !important;
}
.discover-category {
    margin-top: 8px;
}
.discover-category-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
}
.discover-category-head h4 {
    font-size: .9rem; font-weight: 600; margin: 0;
    color: var(--text-normal);
}
.discover-category-head > span {
    font-size: .75rem; color: var(--text-muted);
    background: rgba(255,255,255,.06);
    padding: 0 8px; border-radius: 10px;
    line-height: 20px;
}

.discover-board {
    display: grid;
    gap: 18px;
}

.discover-hero,
.discover-section {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
}

.discover-hero {
    display: grid;
    gap: 10px;
    padding: clamp(18px, 4vw, 30px);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .18), transparent 52%),
        rgba(255, 255, 255, .045);
}

.discover-hero h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
}

.discover-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--soft);
    line-height: 1.5;
}

.discover-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.discover-search-row span {
    color: var(--muted);
    font-weight: 850;
}

.discover-section {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.discover-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.discover-section-head h3 {
    margin: 0;
    font-size: 18px;
}

.discover-section-head p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.4;
}

.discover-section-head > span {
    min-width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(99, 102, 241, .16);
    color: #dce2ff;
    font-weight: 950;
}

.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.discover-card {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--brand), transparent 88%), color-mix(in srgb, var(--brand-hot), transparent 94%)),
        rgba(24, 25, 31, .62);
    box-shadow: var(--shadow-soft);
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.discover-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, .3);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--brand), transparent 82%), color-mix(in srgb, var(--brand-hot), transparent 90%)),
        rgba(32, 35, 46, .72);
}

.discover-banner {
    position: relative;
    min-height: 104px;
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 255, 255, .24), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--server-banner), #fff 26%), color-mix(in srgb, var(--server-banner), var(--brand-hot) 22%)),
        var(--server-banner);
    background-size: cover;
    background-position: center;
}

.discover-icon {
    position: absolute;
    left: 14px;
    bottom: -22px;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: var(--radius);
    border: 4px solid #1f2026;
    color: white;
    font-weight: 950;
}

.discover-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discover-body {
    display: grid;
    gap: 10px;
    padding: 30px 14px 14px;
}

.discover-body h4 {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 16px;
}

.discover-body p {
    min-height: 42px;
    margin: 0;
    color: var(--soft);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.discover-meta,
.discover-tags,
.discover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.discover-meta span,
.discover-tags span {
    border-radius: 999px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, .065);
    color: var(--soft);
    font-size: 12px;
    font-weight: 850;
}

.discover-tags span {
    background: rgba(99, 102, 241, .16);
    color: #d7dcff;
}

.discover-actions {
    margin-top: 2px;
}

.cover-board {
    display: grid;
    gap: 18px;
}

.cover-hero {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
}

.cover-banner {
    min-height: clamp(150px, 25vh, 260px);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--server-banner), #fff 12%), var(--server-banner)),
        var(--server-banner);
    background-size: cover;
    background-position: center;
}

.cover-body {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.cover-body .server-mini-icon {
    margin-top: -48px;
    width: 78px;
    height: 78px;
    border: 5px solid var(--panel-solid);
}

.cover-body h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(28px, 4vw, 46px);
}

.cover-body p,
.cover-grid p {
    color: var(--soft);
    line-height: 1.6;
}

.cover-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.cover-grid article {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
}

.cover-list-title {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.cover-row {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    text-align: left;
}

.cover-row:hover {
    background: rgba(99, 102, 241, .16);
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-toggle {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    min-height: 76px;
    transition: border-color .16s ease, background .16s ease;
}

.permission-toggle:hover {
    border-color: rgba(99, 102, 241, .32);
    background: rgba(99, 102, 241, .1);
}

.permission-toggle input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.permission-toggle strong,
.permission-toggle small {
    display: block;
}

.permission-toggle small {
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.4;
}

.home-board > section:first-child {
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .18), transparent 44%),
        rgba(255, 255, 255, .045);
    box-shadow: var(--shadow-soft);
}

.home-board h2 {
    max-width: 760px;
    font-size: clamp(26px, 4vw, 44px);
    line-height: 1.04;
}

.home-board p:not(.eyebrow) {
    max-width: 680px;
    color: var(--soft);
    line-height: 1.65;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.request-list {
    display: grid;
    gap: 10px;
}

.request-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, .24);
    background: rgba(99, 102, 241, .12);
    box-shadow: var(--shadow-soft);
}

.request-row.muted {
    border-color: var(--line);
    background: rgba(255, 255, 255, .045);
}

.request-row small {
    color: var(--muted);
}

.request-row.group-invite-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.group-invite-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.group-invite-members {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
}

.group-invite-member {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: calc(var(--radius) - 4px);
    background: rgba(255, 255, 255, .045);
}

.group-invite-member strong,
.group-invite-member small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-invite-member small {
    color: var(--muted);
}

.pin-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--amber);
    margin-right: 4px;
    vertical-align: middle;
}

.pin-indicator svg {
    width: 13px;
    height: 13px;
}

.pin-indicator.card-pin {
    position: absolute;
    top: 10px;
    right: 10px;
    margin-right: 0;
}

.friend-card {
    position: relative;
    min-height: 126px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    text-align: left;
    display: grid;
    align-content: start;
    gap: 8px;
    box-shadow: var(--shadow-soft);
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.friend-card:hover {
    background: rgba(99, 102, 241, .16);
    border-color: rgba(99, 102, 241, .28);
    transform: translateY(-1px);
}

.friend-card .avatar {
    width: 44px;
    height: 44px;
}

.friend-card .avatar-wrap {
    width: 44px;
    height: 44px;
}

.friend-card small {
    color: var(--muted);
    display: flex;
    align-items: center;
}

.friend-card strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.friend-card.has-unread {
    border-color: rgba(34, 197, 94, .28);
    background: rgba(34, 197, 94, .08);
}

.friend-card.has-ping {
    border-color: rgba(239, 68, 68, .32);
    background: rgba(239, 68, 68, .08);
}

.friend-card.is-blocked {
    border-color: rgba(239, 68, 68, .28);
    background: rgba(239, 68, 68, .09);
}

.friend-card-blocked-note {
    display: block;
    color: #fca5a5;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stats-row div {
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    box-shadow: var(--shadow-soft);
}

.stats-row strong {
    display: block;
    font-size: 28px;
}

.stats-row span {
    color: var(--muted);
    font-size: 13px;
}

.empty-state, .empty-list {
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: var(--radius);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 120px;
    padding: 18px;
}

.empty-state-blocked {
    border-color: rgba(239, 68, 68, .2);
    color: var(--danger);
}

.empty-list {
    margin: 8px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.45;
}

.member {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
}

.member:hover {
    background: rgba(255, 255, 255, .045);
}

.member.has-row-bg {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.member.has-row-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--row-bg);
    background-size: cover;
    background-position: center;
    opacity: .95;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0, 0, 0, .65) 62%, black 82%);
    mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, rgba(0, 0, 0, .65) 62%, black 82%);
    pointer-events: none;
}

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

.role-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 5px;
    padding: 3px 7px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--role), transparent 78%);
    color: var(--role);
    font-size: 11px;
    font-weight: 900;
}

.member-role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.role-list {
    display: grid;
    gap: 8px;
}

.server-member-role-list {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.audit-log-list {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.member-role-row {
    min-height: 58px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--line);
}

.server-profile-locked input:disabled,
.server-profile-locked select:disabled,
.server-profile-locked textarea:disabled,
.server-roles-locked input:disabled {
    opacity: .68;
    cursor: not-allowed;
}

.member-role-row strong,
.member-role-row small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-role-row small {
    color: var(--muted);
}

.role-pill-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    max-width: 220px;
}

.role-pill {
    max-width: 150px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--role-bg);
    color: #fff;
    font-size: 12px;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-admin-list {
    display: grid;
    gap: 8px;
}

.channel-admin-row {
    min-height: 44px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--line);
}

.channel-settings-dialog {
    width: min(1180px, calc(100vw - 22px));
}

.channel-settings-card {
    max-height: calc(100dvh - 22px);
}

.channel-settings-body {
    display: grid;
    grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr);
    gap: 14px;
    padding: 16px;
    overflow: auto;
}

.channel-permission-note {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--soft);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.4;
}

.channel-permission-table {
    display: grid;
    gap: 8px;
    min-width: 780px;
}

.channel-permission-head,
.channel-permission-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) repeat(8, minmax(118px, .8fr));
    gap: 8px;
    align-items: center;
}

.channel-permission-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.channel-permission-row {
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--line);
}

.channel-permission-role {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-webhook-list {
    display: grid;
    gap: 8px;
}

.channel-webhook-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--line);
}

.channel-webhook-row .quick-actions {
    margin-top: 0;
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 8px;
}

.channel-webhook-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: rgba(88, 101, 242, .22);
    color: #dfe3ff;
    overflow: hidden;
}

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

.channel-webhook-info {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 4px;
}

.channel-webhook-info strong {
    color: var(--text);
    font-size: 13.5px;
}

.channel-webhook-url {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--soft);
    background: rgba(0, 0, 0, .22);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
}

.channel-webhook-create {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.channel-webhook-create input[type="text"] {
    flex: 1 1 180px;
    min-width: 0;
}

.channel-webhook-file-label {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    padding: 0;
    cursor: pointer;
}

.channel-permission-role span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.channel-permission-role strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-permission-row select {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
}

.channel-admin-row span {
    color: var(--cyan);
    font-weight: 950;
    text-align: center;
}

.channel-admin-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-row {
    min-height: 42px;
    display: grid;
    grid-template-columns: 16px 14px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--line);
}

.role-row.dragging {
    opacity: .52;
    outline: 1px solid rgba(99, 102, 241, .5);
}

.role-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--muted);
    cursor: grab;
}

.role-drag-handle svg {
    width: 14px;
    height: 14px;
}

.role-drag-handle-spacer {
    width: 16px;
    height: 16px;
}

.role-editor-card {
    width: min(900px, calc(100vw - 28px));
}

.role-row .role-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.role-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.role-row-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-row small {
    color: var(--muted);
}

.role-row [data-role-edit] {
    flex: 0 0 auto;
    white-space: nowrap;
}

.role-choice-list,
.badge-grid {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.role-choice,
.badge-choice {
    min-height: 54px;
    display: grid;
    grid-template-columns: 22px 18px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.role-choice:hover,
.badge-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, .3);
    background: rgba(99, 102, 241, .11);
}

.badge-choice {
    grid-template-columns: 22px minmax(0, 1fr);
}

.role-choice:has(input:checked),
.badge-choice:has(input:checked) {
    border-color: rgba(88, 101, 242, .55);
    background: rgba(88, 101, 242, .16);
}

.role-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.role-choice strong,
.role-choice small {
    display: block;
}

.role-choice small {
    color: var(--muted);
}

.role-assign-card {
    max-width: 520px;
}

.role-assign-user {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    margin: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .055);
}

.role-assign-user strong,
.role-assign-user small {
    display: block;
    min-width: 0;
}

.role-assign-user small {
    color: var(--muted);
    line-height: 1.35;
}

.badge-choice span {
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
}

.badge-choice.official span { background: linear-gradient(135deg, #5865f2, #22d3ee); color: white; }
.badge-choice.team span { background: rgba(34, 197, 94, .2); color: #9af7bc; }
.badge-choice.gold span { background: rgba(245, 158, 11, .22); color: #ffe0a3; }
.badge-choice.blue span { background: rgba(59, 130, 246, .22); color: #bfdbfe; }
.badge-choice.green span { background: rgba(34, 197, 94, .2); color: #bbf7d0; }
.badge-choice.pink span { background: rgba(236, 72, 153, .2); color: #fbcfe8; }
.badge-choice.purple span { background: rgba(168, 85, 247, .22); color: #e9d5ff; }
.badge-choice.cyan span { background: rgba(6, 182, 212, .2); color: #cffafe; }

.context-menu {
    position: fixed;
    z-index: 50;
    width: min(260px, calc(100vw - 20px));
    max-height: min(430px, calc(100dvh - 20px));
    display: none;
    padding: 7px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(20, 24, 39, .94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    overflow: auto;
    overscroll-behavior: contain;
}

.context-menu.show {
    display: grid;
    gap: 4px;
}

.context-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border-radius: var(--radius);
    padding: 8px 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.context-menu button svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.context-menu button:hover {
    background: rgba(99, 102, 241, .2);
}

.context-menu-disabled-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 10px;
    color: var(--muted);
    cursor: default;
}

.context-menu-disabled-hint svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.context-menu hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
}

.context-menu-slider {
    display: grid;
    gap: 6px;
    padding: 8px 10px 10px;
}

.context-menu-slider-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--soft);
    font-size: 12px;
    font-weight: 800;
}

.context-menu-slider-label strong {
    color: var(--text);
}

.context-menu-slider input[type="range"] {
    width: 100%;
    accent-color: var(--brand);
}

.home-self {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.home-self .avatar,
.home-self .avatar-wrap {
    width: 48px;
    height: 48px;
}

.home-dashboard {
    gap: 14px;
}

.home-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.home-metrics div {
    min-width: 0;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .06);
}

.home-metrics strong {
    display: block;
    font-size: 22px;
    line-height: 1;
}

.home-metrics span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-alert {
    min-height: 44px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 11px;
    border-radius: var(--radius);
    border: 1px solid rgba(245, 158, 11, .24);
    background: rgba(245, 158, 11, .12);
    color: var(--text);
    text-align: left;
}

.home-alert strong {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(245, 158, 11, .22);
    color: #ffd166;
}

.home-alert span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-panel-section {
    display: grid;
    gap: 10px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.home-action-grid button {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    text-align: left;
}

.home-action-grid button:hover,
.home-online-list button:hover {
    background: rgba(99, 102, 241, .18);
}

.home-action-grid span {
    width: 20px;
    color: var(--cyan);
    text-align: center;
    font-weight: 950;
}

.home-online-list {
    display: grid;
    gap: 6px;
}

.home-online-list button {
    min-width: 0;
    min-height: 44px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 6px 8px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .045);
    color: var(--text);
    text-align: left;
}

.home-online-list .avatar,
.home-online-list .avatar-wrap {
    width: 34px;
    height: 34px;
    font-size: 12px;
}

.home-online-list b,
.home-online-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-online-list small {
    color: var(--muted);
    font-size: 12px;
}

.home-online-list p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.danger-row {
    color: #fecaca;
}

.suspended-screen {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(39, 17, 35, .94)),
        var(--bg);
}

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

.suspended-card {
    width: min(560px, 100%);
    display: grid;
    gap: 14px;
    padding: clamp(22px, 4vw, 34px);
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, .28);
    background: rgba(17, 21, 34, .96);
    box-shadow: var(--shadow);
}

.suspended-card h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
}

.suspended-card p {
    margin: 0;
    color: var(--soft);
    line-height: 1.55;
}

.suspended-card small {
    color: var(--muted);
}

.is-suspended .app-shell,
.is-suspended .modal,
.is-suspended .context-menu {
    pointer-events: none;
    filter: blur(2px);
}

.email-verify-card {
    border-color: rgba(99, 102, 241, .32);
}

.email-verify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.is-email-unverified .app-shell,
.is-email-unverified .modal,
.is-email-unverified .context-menu {
    pointer-events: none;
    filter: blur(2px);
}

.compact-mode .channel-row {
    min-height: 32px;
}

.compact-mode .message {
    padding: 5px 0;
}

.compact-mode .member {
    padding: 5px 0;
}

.modal {
    width: min(1080px, calc(100% - 32px));
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 28px);
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    overflow: hidden;
}

body.has-modal-open {
    overflow: hidden;
}

body.modal-fallback-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(8px);
}

dialog.modal[open],
dialog.modal.modal-open {
    position: fixed;
    inset: 0;
    margin: auto;
    z-index: 9001;
    /* Der Dialog selbst ist bis zu 1080px breit und wird per inset:0+margin:auto mittig
       positioniert - schmalere Karten darin (z.B. .server-create-card bei 560px) waren aber ohne
       das hier nur linksbündig im großen Dialog-Rahmen, statt selbst mittig zu sitzen. WICHTIG:
       das gehört hier in die [open]-Regel und NICHT in die allgemeine .modal-Regel oben - sonst
       überschreibt eine ganz normale Autoren-Regel (auch ohne höhere Spezifität) die
       User-Agent-Vorgabe "dialog:not([open]) { display:none }", und JEDER geschlossene Dialog
       (Servereinstellungen, Event erstellen, ...) würde permanent sichtbar im Seitenfluss stehen,
       statt wirklich ausgeblendet zu sein.
    */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal::backdrop { background: rgba(0, 0, 0, .72); }

.modal-card {
    max-height: calc(100dvh - 28px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 180px),
        rgba(17, 21, 34, .96);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.modal-card > :not(header):not(footer) {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.modal-card h2 {
    margin: 0;
}

.modal-card header, .modal-card footer {
    position: sticky;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
    backdrop-filter: blur(16px);
}

.modal-card header {
    top: 0;
}

.modal-card header h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-card footer {
    bottom: 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.image-crop-dialog {
    width: min(760px, calc(100% - 24px));
}

.image-crop-card {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.image-crop-layout {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.image-crop-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 8 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    background:
        linear-gradient(45deg, rgba(255,255,255,.055) 25%, transparent 25% 50%, rgba(255,255,255,.055) 50% 75%, transparent 75%),
        rgba(13, 16, 27, .92);
    background-size: 22px 22px;
}

.image-crop-stage.is-round {
    width: min(420px, 100%);
    aspect-ratio: 1;
    justify-self: center;
}

.image-crop-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.image-crop-canvas:active {
    cursor: grabbing;
}

.image-crop-frame {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(255, 255, 255, .96);
    border-radius: 8px;
    box-shadow:
        inset 0 0 0 999px rgba(0, 0, 0, .08),
        0 0 0 1px rgba(0, 0, 0, .34);
    pointer-events: none;
}

.image-crop-stage.is-round .image-crop-frame {
    border-radius: 999px;
}

.image-crop-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.image-crop-controls label {
    display: grid;
    gap: 8px;
    color: var(--soft);
    font-weight: 850;
}

.settings-layout {
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    overflow: auto;
}

.settings-preview {
    min-width: 0;
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100%;
    padding: 16px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, .035);
}

.settings-preview-title {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
}

.settings-preview-title span {
    color: var(--text);
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
}

.settings-preview-title small {
    color: var(--muted);
    font-weight: 800;
}

.settings-preview-title small.unsaved {
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .14);
    color: #ffd166;
    border: 1px solid rgba(245, 158, 11, .24);
}

.settings-preview-banner {
    min-height: 94px;
    border-radius: var(--radius) var(--radius) 0 0;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .26), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--banner), #fff 28%), color-mix(in srgb, var(--banner), var(--brand-hot) 24%)),
        var(--banner);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--line);
    border-bottom: 0;
}

.settings-preview-card {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 48px 14px 14px;
    border-radius: 0 0 var(--radius) var(--radius);
    background: #313338;
    border: 1px solid var(--line);
}

.settings-preview-card.gradient-profile {
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .18), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--profile-a), #fff 18%), color-mix(in srgb, var(--profile-b), var(--brand-hot) 18%)),
        #313338;
}

.settings-preview-avatar {
    position: absolute;
    left: 14px;
    top: -30px;
}

.settings-preview-avatar .avatar,
.settings-preview-avatar .avatar-wrap {
    width: 62px;
    height: 62px;
    border-radius: 50%;
}

.settings-preview-card > strong {
    font-size: 20px;
}

.settings-preview-card > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 850;
}

.settings-preview-card p {
    margin: 0;
    color: var(--soft);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* ── Live-Profil-Editor (Einstellungen -> Profil) ─────────────────────────── */
.live-profile-card {
    position: relative;
}

.live-profile-banner {
    display: block;
    width: 100%;
    min-height: 110px;
    border-radius: var(--radius) var(--radius) 0 0;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .26), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--banner, #202744), #fff 28%), color-mix(in srgb, var(--banner, #202744), var(--brand-hot) 24%)),
        var(--banner, #202744);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--line);
    border-bottom: 0;
    cursor: pointer;
    padding: 0;
}

.live-profile-banner-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.live-profile-mini-action {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: white;
    padding: 0;
    cursor: pointer;
}

.live-profile-mini-action:hover { background: rgba(0, 0, 0, .68); }
.live-profile-mini-action.danger:hover { background: #f23f43; }
.live-profile-mini-action .lucide { width: 14px; height: 14px; }

.live-profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.live-profile-avatar-actions .live-profile-mini-action {
    background: rgba(255, 255, 255, .07);
    color: var(--text);
}

.live-profile-avatar-actions .live-profile-mini-action:hover { background: rgba(255, 255, 255, .14); }

.live-profile-popover {
    position: absolute;
    z-index: 30;
    display: grid;
    gap: 10px;
    width: 250px;
    max-width: calc(100vw - 48px);
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(24, 26, 34, .98);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.live-profile-popover.banner-popover,
.live-profile-popover.theme-popover {
    top: 42px;
    right: 0;
}

.live-profile-popover.avatar-popover {
    top: -6px;
    left: calc(100% + 10px);
}

.live-profile-status-row-wrap {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin-top: 4px;
}

.live-profile-status-row-wrap .live-profile-status-row {
    margin-top: 0;
}

.status-bubble-color-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border: 2px solid #313338;
}

.status-bubble-color-btn .lucide {
    width: 11px;
    height: 11px;
}

.live-profile-popover.status-popover {
    top: -6px;
    left: calc(100% + 10px);
}

.live-profile-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.live-profile-popover-head strong {
    font-size: 13px;
}

.live-profile-rowbg-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
}

.live-profile-rowbg-chip:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--text);
}

.live-profile-rowbg-chip .lucide { width: 13px; height: 13px; }

.live-profile-card.gradient-profile .live-profile-body {
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .12), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--profile-a, #313338), #fff 18%), color-mix(in srgb, var(--profile-b, #202744), var(--brand-hot) 18%)),
        #313338;
}

.live-edit-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    color: white;
    font-weight: 850;
    font-size: 13px;
    background: rgba(0, 0, 0, .32);
    opacity: 0;
    transition: opacity .15s ease;
    border-radius: inherit;
}

.live-profile-banner:hover .live-edit-hint {
    opacity: 1;
}

.live-profile-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 16px;
    border-radius: 0 0 var(--radius) var(--radius);
    background: #313338;
    border: 1px solid var(--line);
    border-top: 0;
}

.live-profile-avatar-row {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    width: 100%;
    margin-top: -44px;
}

.live-profile-avatar-btn-lg {
    position: relative;
    flex: 0 0 auto;
    display: block;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    padding: 0;
    background: transparent;
    border: 4px solid #313338;
    cursor: pointer;
}

.live-profile-avatar-btn-lg .avatar,
.live-profile-avatar-btn-lg .avatar-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.live-profile-avatar-btn-lg .live-edit-hint {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    font-size: 11px;
    gap: 4px;
}

.live-profile-avatar-btn-lg:hover .live-edit-hint {
    opacity: 1;
}

.live-profile-avatar-actions {
    margin-bottom: 6px;
}

.live-profile-status-pill {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid transparent;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 700;
}

.live-profile-status-pill:hover {
    background: rgba(255, 255, 255, .1);
    border-color: var(--line);
}

.live-profile-status-pill .lucide {
    width: 13px;
    height: 13px;
    color: var(--muted);
}

.live-profile-status-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
}

.live-profile-status-dot.online { background: #23a55a; }
.live-profile-status-dot.idle { background: #f0b232; }
.live-profile-status-dot.dnd { background: #f23f43; }
.live-profile-status-dot.offline, .live-profile-status-dot.invisible { background: #80848e; }

.live-profile-identity {
    min-width: 0;
    display: grid;
    gap: 2px;
    align-content: start;
}

.live-profile-name-row {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.live-profile-field {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.live-profile-name-row .live-profile-field {
    flex: 0 1 auto;
}

.live-profile-field-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-left: 6px;
}

.live-profile-field-label .lucide {
    width: 11px;
    height: 11px;
}

.live-profile-name-input {
    min-width: 0;
    width: 100%;
    font-size: 18px;
    font-weight: 900;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    padding: 3px 6px;
}

.live-profile-username-input {
    width: 100%;
    max-width: 100%;
    font-size: 13px;
    font-weight: 800;
    color: var(--soft);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 2px 6px;
}

.live-profile-name-input:hover,
.live-profile-username-input:hover,
.live-profile-bio:hover {
    border-color: var(--line);
    background: rgba(255, 255, 255, .04);
}

.live-profile-name-input:focus,
.live-profile-username-input:focus,
.live-profile-bio:focus {
    outline: none;
    border-color: rgba(99, 102, 241, .5);
    background: rgba(255, 255, 255, .06);
}

.live-profile-color-btn,
.live-profile-color-clear {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
}

.live-profile-color-btn:hover,
.live-profile-color-clear:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--text);
}

.live-profile-color-btn .lucide,
.live-profile-color-clear .lucide {
    width: 14px;
    height: 14px;
}

.visually-hidden-color-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.live-profile-username-hint {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 2px;
}

.live-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 20px;
    cursor: pointer;
    border-radius: var(--radius);
}

.live-profile-badges:hover {
    background: rgba(255, 255, 255, .04);
}

.live-profile-badges:empty::after {
    content: '+ Abzeichen hinzufügen';
    color: var(--muted);
    font-size: 11.5px;
    font-style: italic;
    padding: 2px 4px;
}

.live-profile-status-row {
    margin-top: 4px;
    cursor: text;
}

.live-profile-status-tag {
    transition: box-shadow .15s ease;
}

.live-profile-status-tag:focus-within,
.live-profile-status-tag:hover {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .45), 0 6px 16px rgba(0, 0, 0, .24);
}

.live-profile-status-emoji {
    width: 22px;
    flex: 0 0 auto;
    text-align: center;
    background: transparent;
    border: 0;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    padding: 0;
}

.live-profile-status-text {
    min-width: 40px;
    flex: 1 1 auto;
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    background: transparent;
    border: 0;
    padding: 0;
}

.live-profile-bio {
    grid-column: 1 / -1;
    min-height: 52px;
    resize: vertical;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--soft);
    line-height: 1.45;
    padding: 6px;
    font: inherit;
    width: 100%;
}

.status-picker-popover {
    position: fixed;
    z-index: 9400;
    display: grid;
    gap: 2px;
    padding: 6px;
    min-width: 190px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(20, 24, 39, .98);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.status-picker-popover button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.status-picker-popover button:hover {
    background: rgba(255, 255, 255, .08);
}

.status-picker-popover .mini-dot {
    flex: 0 0 auto;
}

.settings-grid {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    align-content: start;
    overflow: auto;
}

.server-settings-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
    overflow: auto;
}

.server-emoji-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.server-emoji-presets button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.server-emoji-presets button:hover {
    border-color: rgba(99, 102, 241, .34);
    background: rgba(99, 102, 241, .18);
}

.settings-section {
    min-width: 0;
    display: grid;
    gap: 13px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.settings-section h3 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
}

.settings-hint {
    margin: -6px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.settings-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.settings-section input,
.settings-section select,
.settings-section textarea,
.settings-fields input,
.settings-fields select,
.settings-fields textarea {
    width: 100%;
    max-width: 100%;
}

.settings-fields.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mic-preview {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
}

.mic-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.mic-preview-head span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: var(--text);
}

.mic-preview-head svg {
    width: 15px;
    height: 15px;
    color: var(--brand);
}

.mic-preview-head small {
    color: var(--muted);
}

.mic-preview-meter {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.mic-preview-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green), var(--cyan));
    transition: width .06s linear;
    border-radius: 999px;
}

.mic-preview-meter-threshold {
    position: absolute;
    top: -3px;
    bottom: -3px;
    left: 20%;
    width: 2px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}

.status-message-editor {
    display: grid;
    grid-template-columns: 56px 38px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.status-emoji-input {
    text-align: center;
}

.status-emoji-input[readonly],
#serverTagEmoji[readonly] {
    cursor: pointer;
    background: rgba(255, 255, 255, .045);
}

.status-emoji-input[readonly]:hover,
#serverTagEmoji[readonly]:hover {
    background: rgba(99, 102, 241, .11);
}

.emoji-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: center;
}

.emoji-trigger {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    color: var(--soft);
}

.emoji-trigger:hover {
    border-color: rgba(99, 102, 241, .32);
    background: rgba(99, 102, 241, .11);
    color: var(--text);
}

#emojiPickerButton.icon-button {
    color: var(--soft);
}

.emoji-picker {
    position: fixed;
    z-index: 9300;
    width: min(320px, calc(100vw - 24px));
    height: 360px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(20, 24, 39, .96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.emoji-picker-search {
    flex: 0 0 auto;
    padding: 8px 8px 0;
}

.emoji-picker-search input {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    font-size: 13px;
}

.emoji-picker-search input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, .5);
}

.emoji-picker-tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 2px;
    padding: 6px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.emoji-picker-tabs button {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: transparent;
    color: var(--soft);
}

.emoji-picker-tabs button svg {
    width: 16px;
    height: 16px;
}

.emoji-picker-tabs button:hover {
    background: rgba(255, 255, 255, .07);
    color: var(--text);
}

.emoji-picker-tabs button.active {
    background: rgba(99, 102, 241, .22);
    color: var(--text);
}

.emoji-picker-tab-custom {
    border-radius: 50%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
}

.emoji-picker-tab-custom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.emoji-picker-tab-divider {
    flex: 0 0 auto;
    width: 1px;
    align-self: stretch;
    margin: 4px 2px;
    background: var(--line);
}

.emoji-picker-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 2px;
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.emoji-picker-item {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.emoji-picker-item:hover {
    background: rgba(99, 102, 241, .22);
    transform: scale(1.12);
}

.emoji-picker-item-custom img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.emoji-picker-empty {
    grid-column: 1 / -1;
    padding: 24px 8px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.gif-picker-button span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}

.gif-picker {
    height: 440px;
}

.gif-picker-categories {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    padding: 8px 8px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.gif-picker-categories::-webkit-scrollbar {
    display: none;
}

.gif-category-pill {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--soft);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.gif-category-pill:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
}

.gif-category-pill.active {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

.gif-picker-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 100px;
    gap: 6px;
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    align-content: start;
}

.gif-picker-item {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, .04);
    padding: 0;
    border: 1px solid transparent;
}

.gif-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gif-picker-item:hover {
    border-color: rgba(99, 102, 241, .5);
    transform: scale(1.03);
}

.gif-picker-loading {
    grid-column: 1 / -1;
    padding: 24px 8px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* Pflicht-Attribution laut GIPHY-API-Nutzungsbedingungen - klein, aber immer sichtbar am unteren
   Rand des Pickers. */
.gif-picker-attribution {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 8px;
    border-top: 1px solid var(--line);
    background: rgba(0, 0, 0, .22);
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.gif-picker-attribution .giphy-wordmark {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;
    background: linear-gradient(90deg, #00ff99, #00ccff 35%, #a855f7 70%, #ff5cad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.soundboard-panel {
    position: fixed;
    z-index: 9300;
    width: min(460px, calc(100vw - 24px));
    max-height: min(520px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(20, 24, 39, .96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.soundboard-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.soundboard-panel-head span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: var(--brand);
}

.soundboard-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.soundboard-group-head {
    grid-column: 1 / -1;
    padding: 4px 2px 0;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.soundboard-item.is-locked {
    opacity: .58;
}

.soundboard-item.is-locked .soundboard-play-btn {
    cursor: not-allowed;
}

.soundboard-item {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    overflow: hidden;
}

.soundboard-item.is-pinned {
    border-color: rgba(240, 178, 50, .5);
    background: rgba(240, 178, 50, .08);
}

.soundboard-play-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    min-width: 0;
}

.soundboard-play-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soundboard-play-btn:hover {
    background: rgba(99, 102, 241, .22);
}

.soundboard-pin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    flex-shrink: 0;
    border: 0;
    border-left: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.soundboard-pin-btn:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
}

.soundboard-pin-btn.active {
    color: #f0b232;
}

.soundboard-empty {
    grid-column: 1 / -1;
    padding: 24px 8px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.status-emoji-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.status-emoji-presets button {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s ease, transform .15s ease;
}

.status-emoji-presets button:hover {
    background: rgba(255, 255, 255, .1);
    transform: translateY(-1px);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.theme-grid .theme-card {
    display: grid;
    gap: 6px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius);
    padding: 6px 4px 8px;
    border: 2px solid transparent;
    transition: border-color .15s, background .15s;
}

.theme-grid .theme-card:hover {
    background: var(--surface-hover);
}

.theme-grid .theme-card:has(input:checked) {
    border-color: var(--brand);
    background: rgba(99, 102, 241, .08);
}

.theme-grid input {
    display: none;
}

.theme-grid .theme-swatch {
    display: block;
    width: 100%;
    height: 36px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.theme-grid .theme-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    min-width: 0;
}

input[type="file"] {
    padding: 10px;
    border-style: dashed;
    background: rgba(255, 255, 255, .04);
}

.gradient-presets {
    display: grid;
    grid-template-columns: repeat(6, minmax(28px, 1fr));
    gap: 8px;
}

.gradient-presets button {
    min-height: 34px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .16);
    background: linear-gradient(135deg, var(--a), var(--b));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
    transition: transform .16s ease, border-color .16s ease, filter .16s ease;
}

.gradient-presets button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .36);
    filter: brightness(1.08);
}

.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; }
.check input { width: auto; }

.style-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    width: fit-content;
    max-width: 100%;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
}

.style-switch button {
    padding: 7px 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--soft);
    font-size: 12.5px;
    font-weight: 850;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease;
}

.style-switch button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .07);
}

.style-switch button.active {
    background: rgba(99, 102, 241, .28);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .4);
}

.style-dependent {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .025);
}

.settings-subgroup {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.settings-subgroup:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.settings-subgroup h4 {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.app-shell,
.channel-panel,
.channel-panel header,
.chat-header,
.chat-header > div:first-child,
.chat-panel,
.content-grid,
.message-area,
.messages,
.right-panel,
.profile-panel,
.modal-card,
.settings-grid,
.server-settings-grid,
.server-create-layout,
.discover-grid,
.cover-grid,
.admin-board,
.home-board {
    min-width: 0;
    min-height: 0;
}

.message > div,
.message .meta,
.message-body,
.system-message p,
.profile-card,
.profile-details,
.profile-detail-row,
.profile-row,
.settings-section,
.admin-card,
.admin-user-row,
.discover-card,
.server-mini-profile,
.server-mini-meta,
.server-mini-meta > div,
.invite-message-card,
.request-row,
.friend-card,
.channel-row,
.member,
.home-alert,
.home-action-grid button {
    min-width: 0;
}

.message-body,
.system-message p,
.profile-sub,
.profile-card p,
.profile-row,
.channel-row strong,
.friend-row strong,
.member strong,
.admin-card,
.admin-user-row,
.discover-card p,
.cover-body p,
.cover-grid p,
.server-info p,
.home-alert span {
    overflow-wrap: anywhere;
}

.quick-actions,
.discover-actions,
.server-mini-actions,
.invite-message-actions,
.group-head-actions,
.call-stage-actions,
.report-reasons,
.home-action-grid {
    max-width: 100%;
}

.quick-actions > *,
.discover-actions > *,
.server-mini-actions > *,
.invite-message-actions > *,
.group-head-actions > *,
.call-stage-actions > *,
.report-reasons > * {
    min-width: 0;
}

.messages {
    overflow-anchor: auto;
}

.profile-card img,
.discover-card img,
.server-mini-profile img {
    object-fit: cover;
}

/* DisTalk interface rebuild */
.app-shell {
    grid-template-columns: 96px clamp(284px, 24vw, 344px) minmax(0, 1fr);
    background:
        radial-gradient(circle at 16% 10%, color-mix(in srgb, var(--brand), transparent 55%), transparent 32%),
        radial-gradient(circle at 86% 20%, color-mix(in srgb, var(--cyan), transparent 62%), transparent 34%),
        radial-gradient(circle at 55% 95%, color-mix(in srgb, var(--brand-hot), transparent 66%), transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--brand), #20232c 78%), color-mix(in srgb, var(--brand-hot), #1c1f27 82%));
}

.server-rail {
    padding: 14px 10px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--brand), transparent 84%), transparent 44%),
        rgba(18, 20, 27, var(--bg-alpha, .86));
    border-right: 1px solid rgba(255, 255, 255, .065);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .28);
}

.server-list {
    width: 100%;
    align-items: center;
    padding-block: 2px;
}

.server-pill {
    width: 52px;
    height: 52px;
    margin-left: 24px;
    padding: 0;
    overflow: visible;
    position: relative;
    border-radius: 18px;
    border: 0;
    outline: 1px solid rgba(255, 255, 255, .08);
    outline-offset: -1px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
}

.server-pill:hover,
.server-pill.active {
    border-radius: 14px;
    outline-color: rgba(255, 255, 255, .18);
}

.server-pill.active::after {
    content: "";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 40px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, .55);
    z-index: 1;
}

/* Server-Ordner (Gruppen mehrerer Server, per Drag-and-Drop erstellt - siehe groupServersIntoFolder()) */
.server-folder-pill {
    display: grid;
    place-items: center;
}

.server-folder-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    width: 30px;
    height: 30px;
}

.server-folder-grid img,
.server-folder-grid span {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    object-fit: cover;
    display: grid;
    place-items: center;
    font-size: 8px;
    font-weight: 900;
    color: white;
    overflow: hidden;
}

.server-folder-group {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 6px 0;
    margin-left: 24px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--folder-color, #5865f2), transparent 88%);
}

.server-folder-group .server-pill,
.server-folder-group .server-folder-header {
    margin-left: 0;
    justify-self: center;
}

.server-folder-header {
    width: 34px;
    height: 22px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: white;
    opacity: .9;
}

.server-folder-header svg {
    width: 14px;
    height: 14px;
}

.server-folder-edit {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    top: -4px;
    right: -4px;
}

.server-folder-group:hover .server-folder-edit {
    display: grid;
}

.server-pill.drop-group-target {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.server-folder-member-list {
    display: grid;
    gap: 6px;
}

.server-folder-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
}

.server-folder-member-row strong {
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-folder-member-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: white;
    font-size: 10px;
    font-weight: 900;
    overflow: hidden;
}

.server-folder-member-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-panel {
    background:
        radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--brand), transparent 74%), transparent 32%),
        linear-gradient(180deg, color-mix(in srgb, var(--brand-hot), transparent 88%), transparent 210px),
        rgba(38, 40, 47, var(--bg-alpha, .82));
    border-right: 1px solid rgba(255, 255, 255, .075);
}


.channel-panel header,
.chat-header {
    min-height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, .075);
}

.channel-panel header {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--brand), transparent 82%), transparent 72%),
        rgba(31, 33, 40, var(--bg-alpha, .72));
}

.chat-header {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--brand), transparent 78%), color-mix(in srgb, var(--brand-hot), transparent 88%)),
        rgba(45, 48, 57, var(--bg-alpha, .76));
    box-shadow: 0 1px 0 rgba(255, 255, 255, .045);
}

.mini-actions,
.header-actions {
    flex-wrap: nowrap;
}

.channel-list {
    padding: 14px 12px 18px;
}

.channel-search {
    height: 42px;
    border-radius: 10px;
    background: rgba(15, 17, 23, .76);
}

.category-title {
    margin: 18px 8px 8px;
    letter-spacing: .04em;
}

.channel-row {
    min-height: 42px;
    border-radius: 10px;
    padding: 0 10px;
}

.channel-row:hover,
.channel-row.active {
    background: rgba(255, 255, 255, .075);
    border-color: rgba(255, 255, 255, .08);
}

.channel-row.active {
    box-shadow: inset 3px 0 0 var(--brand);
}

.server-mini-profile,
.profile-card,
.admin-card,
.admin-user-row,
.discover-card,
.cover-hero,
.cover-grid article,
.settings-section,
.invite-message-card,
.friend-card,
.request-row {
    border-color: rgba(255, 255, 255, .105);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand), transparent 91%), color-mix(in srgb, var(--brand-hot), transparent 94%)),
        rgba(255, 255, 255, .062);
    box-shadow: var(--shadow-soft);
}

.content-grid {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 25vw, 380px);
    background:
        radial-gradient(circle at 24% 0%, color-mix(in srgb, var(--brand), transparent 80%), transparent 32%),
        radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--cyan), transparent 86%), transparent 34%),
        rgba(34, 36, 43, .46);
}

.message-area {
    max-width: none;
    background:
        radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--brand), transparent 76%), transparent 34%),
        radial-gradient(circle at 88% 16%, color-mix(in srgb, var(--brand-hot), transparent 82%), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 260px),
        rgba(43, 45, 54, var(--bg-alpha-msg, .44));
}

.messages {
    padding: clamp(18px, 2.4vw, 30px);
}

.message {
    padding: 10px 8px;
}

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

.composer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    margin: 0 18px 0;
    max-width: calc(100% - 36px);
    min-height: 56px;
    height: 56px;
    max-height: 56px;
    grid-template-columns: 42px 42px 42px 42px minmax(0, 1fr) minmax(78px, 96px);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--brand), transparent 88%), color-mix(in srgb, var(--brand-hot), transparent 92%)),
        rgba(31, 34, 43, var(--bg-alpha, .82));
    border-color: rgba(255, 255, 255, .12);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.right-panel {
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand-hot), transparent 78%), transparent 42%),
        linear-gradient(180deg, color-mix(in srgb, var(--brand), transparent 88%), transparent 200px),
        rgba(39, 41, 49, var(--bg-alpha, .80));
}

.profile-panel {
    grid-template-rows: 170px minmax(0, auto) auto;
    align-content: start;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--brand), transparent 92%), transparent 220px),
        transparent;
}

.profile-card {
    margin-inline: 14px;
    border-radius: 14px;
}

.profile-row,
.profile-detail-row,
.home-action-grid button,
.permission-toggle,
.role-row,
.member-role-row,
.cover-row {
    border-radius: 10px;
}

.member-role-section {
    display: grid;
    gap: 4px;
}

.member-role-title {
    padding: 12px 10px 4px;
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-muted);
}

.member-role-title-offline {
    color: #4d5058;
}

.role-badge {
    color: #fff;
}

.tile-icons .ti {
    position: relative;
    display: inline-grid;
    place-items: center;
}

.tile-icons .ti::after {
    content: "";
    position: absolute;
    width: 130%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(-35deg);
}

.home-board,
.admin-board,
.discover-board,
.cover-board {
    width: min(1180px, 100%);
    margin-inline: auto;
}

.home-board > section:first-child,
.admin-hero,
.discover-hero {
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, .18), transparent 44%),
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .035));
}

#settingsDialog,
#serverSettingsDialog {
    width: min(1240px, calc(100vw - 20px));
}

.user-settings-card {
    background:
        linear-gradient(180deg, rgba(99, 102, 241, .08), transparent 230px),
        rgba(17, 21, 34, .96);
}

.user-settings-head {
    background:
        linear-gradient(90deg, rgba(99, 102, 241, .18), rgba(34, 211, 238, .08)),
        rgba(17, 21, 34, .86);
}

.user-settings-layout {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    background: rgba(255, 255, 255, .018);
}

.user-settings-layout .settings-sidebar {
    gap: 16px;
    background:
        linear-gradient(180deg, rgba(34, 211, 238, .10), transparent 210px),
        rgba(255, 255, 255, .035);
}

.user-settings-layout .settings-nav a {
    gap: 10px;
    min-height: 44px;
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .06);
}

.user-settings-layout .settings-nav a .lucide {
    width: 17px;
    height: 17px;
    color: var(--cyan);
}

.user-settings-layout .settings-nav a.active {
    color: var(--text);
    background: rgba(99, 102, 241, .22);
    border-color: rgba(99, 102, 241, .4);
}

.user-settings-layout .settings-nav a.active .lucide {
    color: var(--text);
}

.user-settings-layout > .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
    align-content: start;
}

.user-settings-layout > .settings-grid > [hidden] {
    display: none !important;
}

.user-settings-layout > .settings-grid > .settings-preview {
    position: static;
    min-height: auto;
    max-width: 340px;
    padding: 0;
    border-right: 0;
    background: transparent;
}

.user-settings-card .settings-section {
    align-content: start;
    border-color: rgba(255, 255, 255, .11);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .032));
}

.user-settings-card .settings-section h3 {
    font-size: 16px;
}

.user-settings-card .settings-section h3::before {
    content: none;
}

.user-settings-card .settings-section h3 .lucide {
    width: 18px;
    height: 18px;
    color: var(--cyan);
}

.user-settings-card .settings-fields {
    gap: 13px;
}

.user-settings-card input,
.user-settings-card select,
.user-settings-card textarea {
    min-height: 42px;
    border-color: rgba(255, 255, 255, .1);
    background: rgba(13, 16, 26, .42);
}

.user-settings-card textarea {
    min-height: 104px;
    resize: vertical;
}

.user-settings-card input[type="range"] {
    min-height: 34px;
    accent-color: var(--brand);
    background: transparent;
}

.user-settings-card .check {
    min-height: 42px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(255, 255, 255, .04);
}

.user-settings-card .theme-grid {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.user-settings-card .theme-card {
    min-height: 82px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .035);
}

.user-settings-card .theme-grid .theme-swatch {
    height: 42px;
}

.user-settings-footer {
    justify-content: flex-end;
    background: rgba(17, 21, 34, .86);
}

.user-settings-footer #settingsLogoutButton {
    margin-right: auto;
}

.user-settings-footer button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-settings-footer .lucide {
    width: 16px;
    height: 16px;
}

.settings-sidebar {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(99, 102, 241, .1), transparent 210px),
        rgba(255, 255, 255, .03);
}

.settings-sidebar .settings-preview {
    position: sticky;
    top: 0;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.settings-nav {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 8px;
}

.settings-nav a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border-radius: 10px;
    color: var(--soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
    border: 1px solid transparent;
}

.settings-nav a:hover,
.settings-nav a:focus-visible {
    color: var(--text);
    background: rgba(99, 102, 241, .14);
    border-color: rgba(99, 102, 241, .22);
}

.settings-nav a.active {
    color: var(--text);
    background: rgba(99, 102, 241, .22);
    border-color: rgba(99, 102, 241, .4);
}

.settings-nav a.active .lucide {
    color: var(--text);
}

.settings-grid {
    gap: 16px;
    padding: 18px;
}

.settings-section {
    border-radius: 14px;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .035));
}

.settings-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.settings-section h3::before {
    content: "";
    width: 7px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--cyan), var(--brand));
}

.settings-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-section-head h3 {
    margin: 0;
}

.settings-fields {
    gap: 14px;
}

.server-settings-grid {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(300px, .75fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: start;
}

/* Höher spezifisch als ".modal-card > :not(header):not(footer) { overflow: auto }" -
   nur die einzelne Sektion soll scrollen, nicht das ganze Grid samt Nav. */
.modal-card > .server-settings-grid {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.server-settings-card {
    background:
        linear-gradient(180deg, rgba(34, 211, 238, .07), transparent 220px),
        rgba(17, 21, 34, .96);
}

.modal-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.server-settings-head {
    background:
        linear-gradient(90deg, rgba(99, 102, 241, .16), rgba(34, 211, 238, .08)),
        rgba(17, 21, 34, .86);
}

.server-settings-body {
    gap: 18px;
    padding: 18px;
    background: rgba(255, 255, 255, .018);
}

.server-settings-grid > .wide {
    grid-column: 2 / -1;
}

.server-settings-sidebar {
    grid-row: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .105);
    background:
        linear-gradient(135deg, rgba(34, 211, 238, .12), transparent 52%),
        rgba(255, 255, 255, .05);
    box-shadow: var(--shadow-soft);
}

.server-settings-sidebar > span {
    display: none;
}

.server-settings-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.server-settings-icon-preview {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-weight: 950;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 32px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.server-settings-identity div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.server-settings-identity strong {
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-settings-identity small {
    color: var(--soft);
    font-size: 13px;
    font-weight: 850;
}

.server-settings-banner-preview {
    height: 86px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: linear-gradient(135deg, #202744, rgba(99, 102, 241, .22));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.server-settings-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.server-settings-stats span {
    display: grid;
    gap: 2px;
    min-height: 58px;
    align-content: center;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .09);
}

.server-settings-stats strong {
    font-size: 17px;
    line-height: 1;
}

.server-settings-stats small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.server-settings-sidebar .settings-nav {
    margin-top: 2px;
}

.server-settings-sidebar .settings-nav a {
    gap: 10px;
    justify-content: flex-start;
    min-height: 42px;
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .06);
}

.server-settings-sidebar .settings-nav a .lucide {
    width: 17px;
    height: 17px;
    color: var(--cyan);
}

.server-settings-grid .settings-section {
    align-self: start;
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    border-color: rgba(255, 255, 255, .11);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .032));
}

.server-settings-grid .settings-section h3 {
    font-size: 16px;
}

.server-settings-grid .settings-fields {
    gap: 12px;
}

.server-settings-grid input,
.server-settings-grid select,
.server-settings-grid textarea {
    min-height: 42px;
    border-color: rgba(255, 255, 255, .1);
    background: rgba(13, 16, 26, .42);
}

.server-settings-grid textarea {
    min-height: 112px;
    resize: vertical;
}

.server-settings-footer {
    justify-content: space-between;
}

.server-settings-footer-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.server-settings-footer button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.server-settings-footer .lucide {
    width: 16px;
    height: 16px;
}

.modal-card {
    border-radius: 16px;
}

.modal-card header {
    min-height: 62px;
}

.modal-card footer {
    background: rgba(17, 21, 34, .82);
}

.toast {
    position: fixed;
    z-index: 20;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%) translateY(18px);
    max-width: min(520px, calc(100% - 28px));
    padding: 12px 16px;
    border-radius: var(--radius);
    background: rgba(25, 31, 48, .96);
    border: 1px solid var(--line);
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
    box-shadow: var(--shadow);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.desktop-update-banner {
    position: fixed;
    z-index: 9400;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, .4);
    background: rgba(20, 24, 39, .97);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    animation: desktop-update-banner-in .25s ease;
}

@keyframes desktop-update-banner-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.desktop-update-banner-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(99, 102, 241, .18);
    color: var(--brand);
}

.desktop-update-banner-icon svg {
    width: 18px;
    height: 18px;
}

.desktop-update-banner-body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.desktop-update-banner-body strong {
    color: var(--text);
    font-size: 14px;
}

.desktop-update-banner-body small {
    color: var(--muted);
}

.desktop-update-banner .primary-button.compact {
    flex: 0 0 auto;
    white-space: nowrap;
}

.desktop-update-banner .icon-button {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
}

@media (max-width: 640px) {
    .desktop-update-banner {
        left: 12px;
        right: 12px;
        top: 12px;
        max-width: none;
        flex-wrap: wrap;
    }
}

body.light {
    color-scheme: light;
    --bg: #f5f7fb;
    --bg-soft: #eef2f8;
    --panel: rgba(255, 255, 255, .92);
    --panel-solid: #ffffff;
    --panel-2: #edf1f8;
    --panel-3: #e1e7f2;
    --text: #121722;
    --muted: #626b7c;
    --soft: #394254;
    --line: rgba(18, 23, 34, .12);
}

body.light .app-shell { background: linear-gradient(135deg, #eef2f8, #ffffff); }
body.light .server-rail { background: rgba(236, 240, 248, .92); }
body.light .channel-panel, body.light .right-panel, body.light .chat-header { background: rgba(255, 255, 255, .82); }
body.light input, body.light select, body.light textarea { background: rgba(255, 255, 255, .9); }
body.light .composer { background: rgba(237, 241, 248, .96); }
body.light .modal-card { background: rgba(255, 255, 255, .96); }
body.light .profile-panel { background: #f1f4fa; }
body.light .profile-card,
body.light .profile-card section,
body.light .profile-row {
    background: rgba(255, 255, 255, .82);
}
body.light .settings-sidebar,
body.light .server-settings-sidebar,
body.light .settings-section,
body.light .admin-card,
body.light .admin-user-row,
body.light .admin-update-log-row,
body.light .discover-card,
body.light .server-mini-profile {
    background: rgba(255, 255, 255, .78);
}
body.light .context-menu {
    background: rgba(255, 255, 255, .94);
}

/* --- Accent Themes (dark, gradient-based) --- */

/* Emerald */
body.theme-emerald {
    --brand: #10b981;
    --brand-hot: #14b8a6;
    --bg: #151e1a;
    --bg-soft: #1d2822;
    --panel: #1d2822;
    --panel-solid: #232e28;
    --panel-2: #29352e;
    --panel-3: #303c35;
}

/* Amber */
body.theme-amber {
    --brand: #f59e0b;
    --brand-hot: #f43f5e;
    --bg: #1e1b14;
    --bg-soft: #2a2620;
    --panel: #2a2620;
    --panel-solid: #312c26;
    --panel-2: #38332d;
    --panel-3: #3f3a34;
}

/* Sky */
body.theme-sky {
    --brand: #0ea5e9;
    --brand-hot: #8b5cf6;
    --bg: #14191e;
    --bg-soft: #1b232b;
    --panel: #1b232b;
    --panel-solid: #222a32;
    --panel-2: #29323a;
    --panel-3: #303a42;
}

/* Lime */
body.theme-lime {
    --brand: #84cc16;
    --brand-hot: #06b6d4;
    --bg: #181e14;
    --bg-soft: #21291e;
    --panel: #21291e;
    --panel-solid: #283024;
    --panel-2: #2f382b;
    --panel-3: #364032;
}

/* Pink */
body.theme-pink {
    --brand: #ec4899;
    --brand-hot: #f97316;
    --bg: #1e141a;
    --bg-soft: #2b1d25;
    --panel: #2b1d25;
    --panel-solid: #32242c;
    --panel-2: #392b33;
    --panel-3: #41323a;
}

/* Teal */
body.theme-teal {
    --brand: #14b8a6;
    --brand-hot: #3b82f6;
    --bg: #141c1e;
    --bg-soft: #1b2629;
    --panel: #1b2629;
    --panel-solid: #222d30;
    --panel-2: #293438;
    --panel-3: #303b3f;
}

/* Rose */
body.theme-rose {
    --brand: #f43f5e;
    --brand-hot: #dc2626;
    --bg: #1e1415;
    --bg-soft: #2b1d1f;
    --panel: #2b1d1f;
    --panel-solid: #322426;
    --panel-2: #392b2d;
    --panel-3: #413234;
}

/* Violet */
body.theme-violet {
    --brand: #a855f7;
    --brand-hot: #6366f1;
    --bg: #18141e;
    --bg-soft: #221d2b;
    --panel: #221d2b;
    --panel-solid: #292432;
    --panel-2: #302b39;
    --panel-3: #373241;
}

/* Slate */
body.theme-slate {
    --brand: #64748b;
    --brand-hot: #475569;
    --bg: #17181b;
    --bg-soft: #202226;
    --panel: #202226;
    --panel-solid: #27292d;
    --panel-2: #2e3035;
    --panel-3: #35373c;
}

/* Galaxy */
body.theme-galaxy {
    --brand: #7c3aed;
    --brand-hot: #db2777;
    --cyan: #06b6d4;
    --bg: #140a24;
    --bg-soft: #211131;
    --panel: #211131;
    --panel-solid: #2a193c;
    --panel-2: #342047;
    --panel-3: #3f2854;
}

/* Aurora */
body.theme-aurora {
    --brand: #22c55e;
    --brand-hot: #8b5cf6;
    --cyan: #06b6d4;
    --bg: #071c1d;
    --bg-soft: #0e292b;
    --panel: #0e292b;
    --panel-solid: #153235;
    --panel-2: #1c3b40;
    --panel-3: #25464b;
}

/* Sunset */
body.theme-sunset {
    --brand: #f97316;
    --brand-hot: #ec4899;
    --cyan: #a78bfa;
    --bg: #21100d;
    --bg-soft: #30171a;
    --panel: #30171a;
    --panel-solid: #3b1f24;
    --panel-2: #46272e;
    --panel-3: #522f39;
}

/* Cyber */
body.theme-cyber {
    --brand: #22d3ee;
    --brand-hot: #f0abfc;
    --cyan: #6366f1;
    --bg: #07131f;
    --bg-soft: #0d1c2d;
    --panel: #0d1c2d;
    --panel-solid: #14263a;
    --panel-2: #1b3047;
    --panel-3: #253b55;
}

/* --- Light-theme overrides for accent themes --- */
body.light.theme-emerald { --brand: #059669; --brand-hot: #0d9488; }
body.light.theme-amber { --brand: #d97706; --brand-hot: #e11d48; }
body.light.theme-sky { --brand: #0284c7; --brand-hot: #7c3aed; }
body.light.theme-lime { --brand: #65a30d; --brand-hot: #0891b2; }
body.light.theme-pink { --brand: #db2777; --brand-hot: #ea580c; }
body.light.theme-teal { --brand: #0d9488; --brand-hot: #2563eb; }
body.light.theme-rose { --brand: #e11d48; --brand-hot: #b91c1c; }
body.light.theme-violet { --brand: #9333ea; --brand-hot: #4f46e5; }
body.light.theme-slate { --brand: #475569; --brand-hot: #334155; }
body.light.theme-galaxy { --brand: #7c3aed; --brand-hot: #db2777; }
body.light.theme-aurora { --brand: #16a34a; --brand-hot: #7c3aed; }
body.light.theme-sunset { --brand: #ea580c; --brand-hot: #db2777; }
body.light.theme-cyber { --brand: #0891b2; --brand-hot: #c026d3; }

/* --- Background Patterns --- */

/* --- Auth Modals --- */
.auth-modal {
    width: min(440px, calc(100% - 32px));
}
.auth-modal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 32px 40px 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 180px),
        rgba(17, 21, 34, .96);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    position: relative;
}
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.auth-modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .08);
}
.auth-modal-header {
    text-align: center;
    margin-bottom: 20px;
}
.auth-modal-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin-bottom: 12px;
}
.auth-modal-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}
.auth-modal-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}
.auth-modal-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-modal-form .cf-turnstile {
    display: flex;
    justify-content: center;
}
/* Turnstile läuft mit data-execution="execute" - die eigentliche Prüfung (der Iframe drin) startet
   erst beim Absenden. Cloudflares Skript legt aber schon vorher unsichtbaren Inhalt in .cf-turnstile
   ab, daher funktioniert :empty hier nicht zuverlässig als Auslöser - stattdessen deckt dieser
   Platzhalter das Widget optisch ab, bis app.js beim Absenden die Klasse "is-active" setzt. */
.turnstile-wrap {
    position: relative;
    min-height: 65px;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.turnstile-placeholder {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--soft);
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 4px;
    pointer-events: none;
}
.turnstile-placeholder .lucide {
    width: 18px;
    height: 18px;
    color: var(--brand);
    flex: 0 0 auto;
}
.turnstile-wrap.is-active .turnstile-placeholder {
    display: none;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.auth-field input {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 4px;
    background: rgba(0, 0, 0, .28);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color .15s;
}
.auth-field input::placeholder {
    color: rgba(255, 255, 255, .2);
}
.auth-field input:focus {
    border-color: var(--brand);
}
.auth-field small {
    font-size: 11px;
    color: var(--muted);
}
.auth-modal-form .primary-button {
    margin-top: 4px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
}
.auth-modal-switch {
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--muted);
}
.auth-modal-switch a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}
.auth-modal-switch a:hover {
    text-decoration: underline;
}

.auth-reset-box {
    width: 100%;
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.auth-check-email-panel {
    width: 100%;
    display: grid;
    justify-items: center;
}

.auth-check-email-panel .auth-modal-header p {
    margin-top: 6px;
}

.auth-check-email-actions {
    width: 100%;
    display: grid;
    gap: 10px;
}

.auth-text-button {
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
}

.auth-text-button:hover {
    text-decoration: underline;
}

.auth-reset-request {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
}

.auth-reset-request[hidden] {
    display: none;
}

@media (max-width: 1120px) {
    .content-grid { grid-template-columns: minmax(0, 1fr); }
    .right-panel { display: none; }
    .cover-grid { grid-template-columns: 1fr; }
    .admin-server-row { grid-template-columns: 40px minmax(0, 1fr); }
    .admin-server-row .quick-actions { grid-column: 1 / -1; justify-content: start; }
    .server-settings-grid {
        grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
    }
    .server-settings-grid > .wide {
        grid-column: 2;
    }
}

@media (max-width: 1040px) {
    .hero-grid, .auth-panel, .landing-feature-grid { grid-template-columns: 1fr; }
    .preview-window { max-width: 520px; }
}
@media (max-width: 600px) {
    .preview-window { max-width: 100%; }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 84px minmax(220px, 280px) minmax(0, 1fr);
    }
    .search-input {
        display: none;
    }
    .header-actions .secondary-button:not(#addFriendButton),
    .header-actions #headerServerSettingsButton {
        display: none !important;
    }
    .chat-header > div:first-child {
        flex: 1 1 auto;
    }
    .header-actions {
        flex: 0 0 auto;
    }
}

@media (max-width: 760px) {
    .hero { padding-inline: 16px; }
    .hero-grid { padding-top: 38px; }
    .changelog-page,
    .history-page,
    .about-page {
        padding-inline: 16px;
    }
    .support-page {
        padding-inline: 16px;
    }
    .support-hero,
    .support-layout,
    .support-grid-fields,
    .support-ticket-meta {
        grid-template-columns: 1fr;
    }
    .support-console {
        grid-template-columns: 1fr;
    }
    .support-ticket-panel {
        position: static;
        min-height: auto;
    }
    .support-chat-panel,
    .support-chat-empty {
        min-height: 420px;
    }
    .support-ticket-open > .support-detail-section,
    .support-ticket-open > .support-reply-form,
    .support-ticket-open > .empty-state {
        margin: 12px;
    }
    .support-ticket-facts {
        padding-inline: 12px;
    }
    .support-thread-message {
        grid-template-columns: 34px minmax(0, 1fr);
    }
    .support-thread-message > .support-message-avatar {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
    .support-message-head {
        align-items: start;
        flex-direction: column;
        gap: 6px;
    }
    .support-hero {
        align-items: start;
        margin-top: 34px;
    }
    .support-ticket-actions {
        justify-content: stretch;
    }
    .support-ticket-actions button {
        width: 100%;
    }
    .support-ticket-list-item {
        grid-template-columns: 40px minmax(0, 1fr);
        grid-template-areas:
            "icon title"
            "icon meta"
            "icon status";
    }
    .support-ticket-list-item em,
    .support-status-pill {
        justify-self: start;
    }
    .support-saved-list {
        padding: 10px;
    }
    .support-ticket-title {
        align-items: start;
        flex-direction: column;
    }
    .support-reply-actions {
        justify-content: stretch;
    }
    .support-reply-actions button {
        width: 100%;
    }
    .changelog-hero {
        align-items: start;
        flex-direction: column;
        margin-top: 34px;
    }
    .preview-window {
        grid-template-columns: 58px 126px 1fr;
        min-height: 340px;
    }
    .preview-channels, .preview-chat { padding: 14px; }
    .preview-call { grid-template-columns: 1fr; }
    .preview-call-tile { min-height: 58px; }
    .auth-panel { grid-template-columns: 1fr; padding-inline: 16px; }
    .app-shell {
        grid-template-columns: 62px minmax(0, 1fr);
        height: 100dvh;
        min-height: 100dvh;
    }
    .server-rail { padding-inline: 8px; gap: 8px; }
    .channel-panel {
        position: fixed;
        z-index: 60;
        left: 62px;
        top: 0;
        bottom: 0;
        width: min(320px, calc(100vw - 70px));
        max-width: calc(100vw - 62px);
        height: 100%;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        border-radius: 0;
        border: 0;
        border-right: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 8px 0 32px rgba(0, 0, 0, .35);
        transform: translateX(-100vw);
        transition: transform .2s cubic-bezier(.22, 1, .36, 1), visibility .2s;
        will-change: transform;
        overflow: hidden;
        visibility: hidden;
        pointer-events: none;
    }
    .channel-panel .user-strip {
        display: none;
    }
    body.mobile-channels-open .channel-panel {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
    body.mobile-channels-open .app-shell::after {
        content: "";
        position: fixed;
        z-index: 55;
        inset: 0;
        left: 62px;
        background: rgba(0, 0, 0, .45);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        pointer-events: auto;
    }
    .chat-panel {
        grid-column: 2;
        min-width: 0;
        width: 100%;
    }
    .mobile-channel-toggle { display: inline-grid; }
    .chat-header {
        padding-inline: 10px;
        min-height: 58px;
    }
    .header-actions { gap: 4px; }
    .header-actions {
        max-width: 46vw;
        justify-content: flex-end;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .header-actions::-webkit-scrollbar { display: none; }
    .chat-header .icon-button,
    .chat-header .compact {
        width: 34px;
        min-width: 34px;
        height: 34px;
        padding-inline: 0;
    }
    .danger-button { padding-inline: 10px; }
    .messages {
        display: block;
        padding: 16px;
        min-height: 0;
        max-width: 100%;
    }
    .message-area {
        min-height: 0;
        grid-template-rows: minmax(0, auto) minmax(0, 1fr) minmax(62px, auto);
    }
    .composer {
        grid-template-columns: 38px 38px 38px 38px minmax(0, 1fr) 44px;
        margin: 10px 10px calc(82px + env(safe-area-inset-bottom));
        max-width: calc(100% - 20px);
        height: 52px;
        max-height: 52px;
    }
    .timeout-banner {
        left: 8px;
        right: 8px;
        margin: 0;
        border-radius: 14px;
        flex-wrap: wrap;
    }
    .timeout-banner-countdown {
        flex-basis: 100%;
        text-align: right;
    }
    .send-button {
        grid-column: auto;
        min-width: 0;
        padding: 0;
        font-size: 0;
    }
    .send-button::before {
        content: none;
    }
    .send-button .lucide {
        width: 18px;
        height: 18px;
    }
    .modal { width: min(100% - 16px, 1080px); }
    .modal-card {
        max-height: calc(100dvh - 16px);
    }
    .modal-card > :not(header):not(footer) {
        max-width: 100%;
    }
    .modal-card header,
    .modal-card footer {
        padding: 12px;
    }
    .settings-layout { grid-template-columns: 1fr; }
    .user-settings-layout {
        grid-template-columns: 1fr;
    }
    .settings-sidebar {
        position: static;
        grid-template-rows: auto auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .settings-preview {
        position: static;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .settings-sidebar .settings-preview {
        border-bottom: 0;
    }
    .settings-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .settings-nav::-webkit-scrollbar { display: none; }
    .settings-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .user-settings-layout > .settings-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }
    .user-settings-card .theme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .user-settings-footer {
        align-items: stretch;
    }
    .user-settings-footer button {
        flex: 1 1 140px;
        justify-content: center;
    }
    .settings-grid,
    .server-settings-grid,
    .server-create-layout,
    .settings-fields,
    .settings-fields.three,
    .permission-grid {
        grid-template-columns: 1fr;
    }
    .modal-card > .server-settings-grid {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .server-settings-sidebar,
    .server-settings-grid .settings-section {
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .theme-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .server-settings-grid > .wide,
    .server-settings-sidebar {
        grid-column: 1;
        grid-row: auto;
    }
    .server-settings-sidebar {
        position: static;
    }
    .server-settings-body {
        padding: 12px;
        gap: 12px;
    }
    .server-settings-identity {
        grid-template-columns: 46px minmax(0, 1fr);
    }
    .server-settings-icon-preview {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }
    .server-settings-banner-preview {
        height: 64px;
    }
    .server-settings-stats {
        grid-template-columns: repeat(3, minmax(74px, 1fr));
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .server-settings-footer {
        align-items: stretch;
    }
    .server-settings-footer,
    .server-settings-footer-group {
        justify-content: stretch;
    }
    .server-settings-footer button,
    .server-settings-footer-group {
        width: 100%;
    }
    .server-settings-footer button {
        justify-content: center;
    }
    .friend-add-body {
        padding: 12px;
    }
    .friend-add-hero {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 12px;
    }
    .friend-add-hero > span {
        width: 48px;
        height: 48px;
        border-radius: 13px;
    }
    .friend-add-hero strong {
        font-size: 16px;
    }
    .friend-add-tips {
        display: grid;
        grid-template-columns: 1fr;
    }
    .member-role-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }
    .member-role-row .role-pill,
    .member-role-row button {
        grid-column: 2;
        justify-self: start;
    }
    .channel-admin-row {
        grid-template-columns: 24px minmax(0, 1fr);
    }
    .channel-admin-row button {
        grid-column: 2;
        justify-self: start;
        width: 100%;
    }
    .channel-settings-body {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .channel-permission-table {
        min-width: 720px;
        overflow-x: auto;
    }
    .video-tile.screen-tile { grid-column: span 1; }
    .incoming-call,
    .request-row,
    .admin-user-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }
    .admin-update-log-row {
        grid-template-columns: 1fr;
    }
    .incoming-call .quick-actions,
    .request-row .quick-actions,
    .admin-user-row .quick-actions,
    .admin-update-log-row .quick-actions {
        grid-column: 1 / -1;
        justify-content: start;
    }
    .mobile-user-strip {
        position: fixed;
        isolation: isolate;
        overflow: hidden;
        z-index: 30;
        left: 70px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        min-height: 58px;
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) 34px 34px 34px;
        gap: 6px;
        align-items: center;
        padding: 8px;
        border-radius: var(--radius);
        border: 1px solid rgba(255, 255, 255, .12);
        background: rgba(30, 31, 36, .62);
        box-shadow: var(--shadow);
    }

    .mobile-user-strip::before {
        content: "";
        position: absolute;
        inset: -24px;
        z-index: -1;
        background:
            linear-gradient(180deg, rgba(10, 11, 16, .3), rgba(10, 11, 16, .5)),
            var(--custom-bg-image, none) center / cover no-repeat,
            var(--app-bg-paint, #232428);
        filter: blur(18px) saturate(1.25);
        transform: scale(1.12);
    }
    .mobile-user-strip strong,
    .mobile-user-strip small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-user-strip small { color: var(--muted); }
    .mobile-user-strip .icon-button {
        width: 34px;
        height: 34px;
    }
    .messages { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
    .profile-buttons {
        right: 10px;
        top: 10px;
        gap: 6px;
    }
    .profile-buttons .icon-button {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }
    .channel-panel header {
        padding: 0 12px;
        min-height: 56px;
        overflow: hidden;
    }
    .channel-panel header strong {
        max-width: 50%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 1;
    }
    .mini-actions {
        flex-shrink: 0;
    }
    .mini-actions .icon-button {
        width: 32px;
        height: 32px;
    }
    .channel-list {
        padding: 8px;
    }
}

.incoming-call-dock {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(520px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    background: rgba(24, 25, 39, .96);
    box-shadow: 0 18px 44px rgba(0,0,0,.38);
}

.incoming-call-dock .avatar {
    flex: 0 0 auto;
}

.incoming-call-dock > div {
    min-width: 0;
    flex: 1;
}

.incoming-call-dock strong,
.incoming-call-dock small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .incoming-call-dock {
        left: 12px;
        right: 12px;
        bottom: max(84px, env(safe-area-inset-bottom));
        transform: none;
        width: auto;
        flex-wrap: wrap;
    }

    .incoming-call-dock > div {
        flex-basis: calc(100% - 56px);
    }

    .incoming-call-dock button {
        flex: 1 1 130px;
    }
}

.server-ping-tooltip {
    position: fixed;
    z-index: 9500;
    transform: translateY(-50%);
    width: max-content;
    max-width: 260px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(24, 25, 39, .98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .4);
    pointer-events: none;
}

.server-ping-tooltip-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    color: var(--text);
    font-weight: 900;
}

.server-ping-tooltip-list {
    display: grid;
    gap: 4px;
}

.server-ping-tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 800;
}

.server-ping-tooltip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-ping-tooltip-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 700;
}

.server-ping-tooltip-call-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.server-ping-tooltip-call-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--brand);
}

.server-ping-tooltip-avatars {
    display: flex;
    align-items: center;
}

.server-ping-tooltip-avatars .avatar-wrap {
    width: 22px;
    height: 22px;
    margin-left: -6px;
}

.server-ping-tooltip-avatars .avatar-wrap:first-child {
    margin-left: 0;
}

.server-ping-tooltip-avatars .avatar {
    width: 22px;
    height: 22px;
    font-size: 9px;
    border: 2px solid rgba(24, 25, 39, .98);
}

.server-ping-tooltip-avatars .status-dot {
    display: none;
}

.server-ping-tooltip-more {
    margin-left: 2px;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .12);
    color: var(--text);
    font-size: 10px;
    font-weight: 900;
}

.system-notice-dock {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 9000;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 24px));
}

.system-notice-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(99, 102, 241, .28);
    border-radius: 8px;
    background: rgba(24, 25, 39, .96);
    box-shadow: 0 18px 44px rgba(0,0,0,.38);
    animation: system-notice-in .18s ease-out;
}

.system-notice-body p {
    margin: 4px 0;
    color: var(--soft);
}

.system-notice-visibility {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.system-notice-visibility svg {
    width: 14px;
    height: 14px;
}

.system-notice-card .secondary-button {
    grid-column: 1 / -1;
}

@keyframes system-notice-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .system-notice-dock {
        left: 12px;
        right: 12px;
        bottom: max(84px, env(safe-area-inset-bottom));
        transform: none;
        width: auto;
    }
}

.electron-picker-dialog {
    width: min(100% - 28px, 980px);
}

.electron-picker-card {
    max-height: min(760px, calc(100dvh - 32px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.electron-picker-card header {
    align-items: start;
}

.electron-picker-card header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.electron-picker-tools {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}

.electron-picker-tabs {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
}

.electron-picker-tabs button,
.electron-picker-audio {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    color: var(--soft);
    background: transparent;
    font-weight: 850;
}

.electron-picker-tabs button.active {
    color: var(--text);
    background: rgba(255, 255, 255, .12);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset;
}

.electron-picker-search {
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    padding: 0 13px;
    color: var(--text);
    background: rgba(16, 18, 27, .45);
    outline: none;
}

.electron-picker-search:focus {
    border-color: rgba(88, 101, 242, .55);
}

.electron-picker-audio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .055);
    white-space: nowrap;
}

.electron-source-grid {
    min-height: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    padding: 18px;
}

.electron-source-card {
    min-width: 0;
    display: grid;
    grid-template-rows: 132px auto;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.electron-source-card:hover,
.electron-source-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(88, 101, 242, .65);
    background: rgba(88, 101, 242, .14);
    outline: none;
}

.electron-source-preview {
    display: grid;
    place-items: center;
    min-width: 0;
    background: radial-gradient(circle at 50% 0, rgba(255,255,255,.12), rgba(15,17,23,.62));
}

.electron-source-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.electron-source-fallback {
    font-size: 42px;
    color: var(--muted);
}

.electron-source-meta {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px;
}

.electron-source-meta img,
.electron-source-meta em {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .09);
    color: var(--soft);
    font-style: normal;
    font-weight: 900;
}

.electron-source-meta strong,
.electron-source-meta small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.electron-source-meta small,
.electron-picker-hint {
    color: var(--muted);
    font-size: 12px;
}

.electron-source-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: 8px;
}

@media (max-width: 720px) {
    .electron-picker-tools {
        grid-template-columns: 1fr;
    }

    .electron-picker-tabs {
        grid-auto-flow: row;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .electron-source-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px), (max-height: 860px) {
    .profile-panel {
        grid-template-rows: 142px minmax(0, auto) auto !important;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .profile-card {
        margin-bottom: 0;
        padding-bottom: 24px;
    }

    .profile-row {
        min-height: 48px;
    }
}

@media (max-width: 520px) {
    .app-shell {
        grid-template-columns: 52px minmax(0, 1fr);
    }
    .server-rail {
        padding: 10px 5px;
        gap: 7px;
    }
    .channel-panel {
        left: 52px;
        width: min(300px, calc(100vw - 58px));
        max-width: calc(100vw - 52px);
        grid-template-rows: auto minmax(0, 1fr);
    }
    .channel-panel header {
        min-height: 52px;
        padding: 0 10px;
    }
    body.mobile-channels-open .app-shell::after {
        left: 52px;
    }
    .server-pill {
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
    }
    .server-rail .server-pill {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }
    .server-rail .server-pill:hover,
    .server-rail .server-pill.active {
        border-radius: 16px;
    }
    .server-list {
        gap: 6px;
    }
    .server-rail {
        gap: 6px;
    }
    .brand span, .brand-logo {
        width: 42px;
        height: 42px;
    }
    .chat-panel {
        min-width: 0;
        width: 100%;
    }
    .chat-header {
        min-height: 56px;
        gap: 6px;
    }
    #channelName,
    #serverName {
        max-width: 52vw;
    }
    .composer {
        grid-template-columns: 36px 36px 36px 36px minmax(0, 1fr) 40px;
        gap: 7px;
        margin-inline: 8px;
        max-width: calc(100% - 16px);
    }
    .composer input {
        font-size: 16px;
        min-width: 0;
    }
    .message {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 9px;
    }
    .message-area,
    .content-grid,
    .messages {
        min-width: 0;
        max-width: 100vw;
    }
    .modal-card footer button {
        flex: 1 1 140px;
    }
    .stats-row,
    .cover-grid {
        grid-template-columns: 1fr;
    }
    .context-menu {
        width: min(280px, calc(100vw - 16px));
    }
    .quick-actions,
    .discover-actions,
    .report-reasons {
        gap: 7px;
    }
    .quick-actions button,
    .discover-actions button,
    .report-reasons button {
        flex: 1 1 128px;
    }
    .profile-card {
        margin-inline: 10px;
        padding-inline: 14px;
    }
    .profile-row,
    .profile-detail-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .invite-message-actions .primary-button,
    .invite-message-actions button {
        flex-basis: 100%;
    }
}

@media (hover: none) {
    .message-actions {
        opacity: 1;
    }

    .template-card:hover,
    .discover-card:hover,
    .friend-card:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Background variants – classes added by JS, highest priority */
body.bg-dots { --bg-alpha: .12; --bg-alpha-msg: .06; }
body.bg-stripes { --bg-alpha: .12; --bg-alpha-msg: .06; }
body.bg-grid { --bg-alpha: .12; --bg-alpha-msg: .06; }
body.bg-carbon { --bg-alpha: .12; --bg-alpha-msg: .06; }
body.bg-crosshatch { --bg-alpha: .12; --bg-alpha-msg: .06; }
body.bg-midnight { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-warm { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-ocean { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-royal { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-nebula { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-aurora { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-sunset { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-forest { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-candy { --bg-alpha: .08; --bg-alpha-msg: .04; }
body.bg-dots .app-shell { background: radial-gradient(circle at 18% 8%, rgba(99,102,241,.38), transparent 34%), repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.13) 0, rgba(255,255,255,.13) 1px, transparent 1px, transparent 18px), #262a36; }
body.bg-stripes .app-shell { background: radial-gradient(circle at 84% 12%, rgba(236,72,153,.34), transparent 34%), repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,.09) 10px, rgba(255,255,255,.09) 12px), #252936; }
body.bg-grid .app-shell { background: radial-gradient(circle at 12% 12%, rgba(34,211,238,.30), transparent 34%), repeating-linear-gradient(90deg, transparent, transparent 22px, rgba(255,255,255,.09) 22px, rgba(255,255,255,.09) 24px), repeating-linear-gradient(0deg, transparent, transparent 22px, rgba(255,255,255,.08) 22px, rgba(255,255,255,.08) 24px), #252a36; }
body.bg-carbon .app-shell { background: radial-gradient(circle at 76% 18%, rgba(99,102,241,.28), transparent 36%), repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.32) 3px, rgba(0,0,0,.32) 5px), repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255,255,255,.06) 3px, rgba(255,255,255,.06) 5px), #12141c; }
body.bg-crosshatch .app-shell { background: radial-gradient(circle at 16% 16%, rgba(236,72,153,.28), transparent 34%), repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,255,255,.08) 6px, rgba(255,255,255,.08) 8px), repeating-linear-gradient(-45deg, transparent, transparent 6px, rgba(255,255,255,.07) 6px, rgba(255,255,255,.07) 8px), #272b38; }
body.bg-midnight .app-shell { background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.62) 0%, rgba(52,54,94,.96) 42%, #202436 100%); }
body.bg-warm .app-shell { background: radial-gradient(ellipse at 50% 0%, rgba(236,72,153,.58) 0%, rgba(80,42,68,.96) 44%, #332634 100%); }
body.bg-ocean .app-shell { background: radial-gradient(ellipse at 50% 100%, rgba(20,184,166,.58) 0%, rgba(31,68,78,.96) 46%, #23333f 100%); }
body.bg-royal .app-shell { background: radial-gradient(ellipse at 26% 18%, rgba(157,78,221,.72) 0%, transparent 54%), radial-gradient(ellipse at 72% 76%, rgba(96,165,250,.38) 0%, transparent 58%), linear-gradient(135deg, #24104f 0%, #341a75 48%, #10194c 100%); }
body.bg-nebula .app-shell { background: radial-gradient(circle at 24% 20%, rgba(236,72,153,.62), transparent 42%), radial-gradient(circle at 82% 72%, rgba(34,211,238,.48), transparent 44%), radial-gradient(circle at 58% 32%, rgba(124,58,237,.50), transparent 48%), linear-gradient(135deg, #160b2f, #26124d 52%, #071b38); }
body.bg-aurora .app-shell { background: radial-gradient(ellipse at 30% 18%, rgba(34,197,94,.56), transparent 44%), radial-gradient(ellipse at 72% 22%, rgba(6,182,212,.52), transparent 46%), radial-gradient(ellipse at 62% 82%, rgba(139,92,246,.46), transparent 52%), linear-gradient(135deg, #052e2b, #0f172a 56%, #1e1b4b); }
body.bg-sunset .app-shell { background: radial-gradient(ellipse at 22% 18%, rgba(249,115,22,.64), transparent 44%), radial-gradient(ellipse at 76% 28%, rgba(236,72,153,.54), transparent 46%), linear-gradient(135deg, #431407, #831843 48%, #312e81); }
body.bg-forest .app-shell { background: radial-gradient(ellipse at 24% 18%, rgba(34,197,94,.50), transparent 42%), radial-gradient(ellipse at 82% 72%, rgba(20,184,166,.38), transparent 46%), linear-gradient(135deg, #052e16, #14532d 48%, #0f3b3f); }
body.bg-candy .app-shell { background: radial-gradient(ellipse at 20% 20%, rgba(244,114,182,.58), transparent 42%), radial-gradient(ellipse at 78% 22%, rgba(34,211,238,.44), transparent 48%), linear-gradient(135deg, #831843, #5b21b6 48%, #0e7490); }

.app-shell.has-custom-background {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: rgba(23, 25, 31, .42) !important;
}

.app-shell.has-custom-background::before {
    content: "";
    position: absolute;
    inset: -28px;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(12, 14, 20, .28), rgba(12, 14, 20, .58)),
        var(--custom-bg-image) center / cover no-repeat;
    filter: blur(16px);
    transform: scale(1.04);
}

/* ── Mobile Keyboard Handling ─────────────────────────────────── */
body.keyboard-open .composer {
    margin-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
body.keyboard-open .mobile-user-strip {
    display: none !important;
}

@media (max-width: 760px) {
    body.keyboard-open .messages {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }
}

/* ── iOS Input & Select Styling ───────────────────────────────── */
input,
select,
textarea,
button {
    -webkit-appearance: none;
    appearance: none;
    border-radius: var(--radius);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a6a9b0' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

input[type="radio"] {
    -webkit-appearance: auto;
    appearance: auto;
}

input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    background: rgba(13, 16, 27, .82);
    box-shadow: none;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background: var(--brand);
    border-color: var(--brand);
}

input[type="checkbox"]:checked::after {
    content: "";
    width: 5px;
    height: 9px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .3);
}

input[type="color"] {
    -webkit-appearance: auto;
    appearance: auto;
    min-height: 44px;
    padding: 4px;
}

input[type="range"] {
    -webkit-appearance: auto;
    appearance: auto;
}

/* ── Larger Touch Targets on Mobile ───────────────────────────── */
@media (max-width: 760px) {
    .channel-row {
        min-height: 48px;
        padding: 0 14px;
    }

    .member {
        min-height: 52px;
        padding: 6px 0;
    }

    .channel-row,
    .member,
    .friend-card,
    .icon-button,
    .primary-button,
    .secondary-button,
    .danger-button,
    .send-button,
    .profile-row,
    .cover-row,
    .discover-card,
    .template-card {
        cursor: default;
    }

    .profile-row {
        min-height: 54px;
    }

    .self-profile-button {
        min-height: 42px;
        padding: 4px;
    }

    #serverList .server-pill {
        width: 46px;
        height: 46px;
    }

    .server-rail {
        padding-top: 16px;
        gap: 12px;
    }

    .channel-search {
        height: 48px;
        font-size: 16px;
    }
}

/* ── Modal Improvements for Small Screens ─────────────────────── */
@media (max-width: 480px) {
    .auth-modal {
        width: calc(100% - 16px);
    }

    .auth-modal-card {
        padding: 24px 20px 20px;
    }

    .auth-modal-header h2 {
        font-size: 20px;
    }

    .auth-field input {
        font-size: 16px;
        padding: 12px;
    }

    .modal {
        width: calc(100% - 8px);
    }

    .modal-card {
        max-height: calc(100dvh - 8px);
        border-radius: 10px;
    }

    .settings-nav a {
        padding: 10px 14px;
        font-size: 13px;
    }

    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .theme-card {
        min-height: 70px;
    }

    .gradient-presets {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Composer Sticky Bottom (Keyboard-Aware) ──────────────────── */
@media (max-width: 760px) {
    .message-area {
        grid-template-rows: minmax(0, auto) minmax(0, 1fr) auto;
        position: relative;
    }

    .composer {
        position: relative;
        bottom: auto;
        align-self: end;
        margin: 10px 10px calc(82px + env(safe-area-inset-bottom, 16px));
        height: auto;
        min-height: 52px;
        max-height: none;
        width: auto;
        max-width: calc(100% - 20px);
    }

    .composer input[type="text"],
    .composer input:not([type="file"]):not([type="checkbox"]):not([type="radio"]) {
        font-size: 16px;
    }

    #messageInput {
        font-size: 16px;
    }
}

/* ── Safe Area Insets for Notched Phones ──────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .app-shell {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .server-rail {
        padding-top: max(12px, env(safe-area-inset-top, 0px));
    }

    @media (max-width: 760px) {
        .mobile-user-strip {
            bottom: calc(10px + env(safe-area-inset-bottom, 16px));
        }

        .chat-header {
            padding-top: max(0px, env(safe-area-inset-top, 0px));
        }

        .composer {
            margin-bottom: calc(82px + env(safe-area-inset-bottom, 16px));
        }
    }
}

/* ── Prevent Pull-to-Refresh Glitch on Mobile ─────────────────── */
html {
    overscroll-behavior: none;
}

body {
    overscroll-behavior: none;
}

.message-area,
.messages {
    overscroll-behavior: contain;
}

/* ── Smooth Scrolling iOS Fix ─────────────────────────────────── */
.messages,
.channel-list,
.member,
.server-list,
.settings-grid,
.discover-grid {
    -webkit-overflow-scrolling: touch;
}

/* ── Better Video Tiles on Mobile ─────────────────────────────── */
@media (max-width: 760px) {
    .video-tile {
        min-height: 120px;
    }

    .video-tile.screen-tile {
        min-height: 160px;
    }

    .call-focus-view .video-tile.focused {
        min-height: 0;
    }

    .call-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .call-stage-head {
        flex-wrap: wrap;
    }

    .call-stage-actions {
        width: 100%;
        justify-content: center;
    }

    .center-stage {
        margin: 10px 10px 0;
        min-height: clamp(120px, 20vh, 200px);
        max-height: 28vh;
    }

    .center-stage.has-focused-tile {
        min-height: clamp(240px, 46dvh, 420px);
        max-height: 58dvh;
    }

    .video-stage.has-focused-tile .call-grid {
        grid-auto-columns: minmax(96px, 128px);
        height: 74px;
    }

    .video-stage.has-focused-tile .call-grid .video-tile {
        height: 74px;
    }
}

@media (max-width: 480px) {
    .call-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Landing Page Mobile Polish ───────────────────────────────── */
@media (max-width: 480px) {
    .hero {
        min-height: 70vh;
        padding: 16px 12px 40px;
    }

    h1 {
        font-size: clamp(36px, 12vw, 58px);
    }

    .hero-copy p:not(.eyebrow) {
        font-size: 16px;
    }

    .landing-feature-grid {
        width: calc(100% - 24px);
        gap: 12px;
    }

    .landing-feature-grid article {
        min-height: 130px;
        padding: 20px 16px;
    }

    .mascot-section {
        width: calc(100% - 24px);
        padding: 24px 16px;
    }

    .mascot-image-wrapper {
        width: 120px;
        height: 120px;
    }

    .preview-window {
        min-height: 280px;
        grid-template-columns: 44px 100px 1fr;
    }

    .preview-sidebar {
        padding: 12px 8px;
        gap: 8px;
    }

    .preview-sidebar span {
        width: 32px;
        height: 32px;
    }

    .preview-channels,
    .preview-chat {
        padding: 10px;
        gap: 8px;
    }

    .preview-channels b {
        font-size: 11px;
    }

    .preview-channels span {
        min-height: 26px;
        font-size: 11px;
    }

    .preview-message-body p {
        font-size: 11.5px;
    }

    .preview-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .invite-preview-banner {
        min-height: 140px;
    }

    .invite-preview-body {
        padding: 18px;
    }

    .invite-preview-icon {
        width: 66px;
        height: 66px;
        margin-top: -54px;
        font-size: 22px;
    }

    .landing-footer {
        width: calc(100% - 24px);
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 18px 0 28px;
    }

    .landing-footer nav {
        justify-content: center;
    }

    .topbar {
        min-height: 56px;
        height: auto;
        align-items: flex-start;
    }

    .topbar-actions {
        gap: 8px;
        justify-content: flex-end;
    }

    .topbar-actions button,
    .topbar-actions a {
        font-size: 13px;
        padding: 0 12px;
        min-height: 38px;
    }

    .topbar-link {
        order: 3;
        width: 100%;
    }

    .brand {
        font-size: 17px;
        gap: 8px;
    }

    .brand span,
    .brand-logo {
        width: 36px;
        height: 36px;
    }
}

/* ── Prevent Text Size Adjust on Orientation Change (iOS) ─────── */
body {
    -webkit-text-size-adjust: 100%;
}

/* ── Fix for sticky hover states on mobile ────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .channel-row:hover,
    .member:hover,
    .server-pill:hover,
    .friend-card:hover,
    .discover-card:hover,
    .landing-feature-grid article:hover,
    .mascot-image-wrapper:hover {
        transform: none;
        background: inherit;
        border-color: inherit;
        box-shadow: inherit;
    }

    .channel-row:active,
    .member:active,
    .friend-card:active,
    .discover-card:active {
        background: rgba(99, 102, 241, .12);
    }

    .primary-button:active,
    .secondary-button:active,
    .danger-button:active {
        transform: translateY(0);
        filter: brightness(.92);
    }

    .icon-button:active {
        background: rgba(99, 102, 241, .22);
        color: white;
    }

    .message-actions button:active,
    .reaction:active {
        background: rgba(99, 102, 241, .24);
        color: white;
    }
}

#cmdAutocomplete .cmd-ac-item:hover,
#cmdAutocomplete .cmd-ac-active,
#mentionAutocomplete .cmd-ac-item:hover,
#mentionAutocomplete .cmd-ac-active {
    background: rgba(99, 102, 241, .18);
}

/* Mobile app shell refresh */
@media (max-width: 760px) {
    :root {
        --mobile-rail-height: 70px;
        --mobile-account-height: 58px;
        --mobile-gap: 8px;
    }

    html {
        width: 100%;
    }

    /* Nur die App (fester Viewport, eigene Scroll-Container) sperrt den Seiten-Scroll -
       die Landingpage/öffentlichen Seiten brauchen normales Body-Scrolling. */
    body.is-app-shell {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    body::before {
        display: none;
    }

    .app-shell {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr);
        width: 100%;
        height: 100svh;
        height: 100dvh;
        min-height: 0;
        padding: 0 !important;
        overflow: hidden;
    }

    .chat-panel {
        grid-column: 1 !important;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        height: 100%;
        grid-template-rows: auto minmax(0, 1fr);
        padding-bottom: calc(var(--mobile-rail-height) + env(safe-area-inset-bottom, 0px));
    }

    /* Die Desktop-Regel setzt hier padding-bottom:0, dadurch rutschen die Call-Buttons
       (Mute/Kamera/Auflegen usw.) unter die feste mobile Server-Leiste. */
    .content-grid.in-call .message-area {
        padding-bottom: calc(var(--mobile-rail-height) + env(safe-area-inset-bottom, 0px)) !important;
    }

    .chat-header {
        min-height: calc(58px + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) 10px 0;
        gap: 8px;
        background: rgba(49, 51, 56, .98);
    }

    .chat-header > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    #channelType {
        display: none;
    }

    #channelName {
        max-width: none;
        min-width: 0;
        font-size: 15px;
        line-height: 1.2;
    }

    .mobile-channel-toggle {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        display: inline-grid;
    }

    .header-actions {
        max-width: 46vw;
        gap: 6px;
        justify-content: flex-end;
        overflow: hidden;
    }

    .chat-header .icon-button,
    .chat-header .compact {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
    }

    #addFriendButton {
        max-width: 44px;
        overflow: hidden;
        padding-inline: 0;
        justify-content: center;
    }

    /* font-size:0 wuerde auch das Icon auf 0 schrumpfen, da .lucide in 1em skaliert -
       stattdessen nur das Textlabel ausblenden. */
    #addFriendButton span {
        display: none;
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .message-area {
        max-width: none;
        grid-template-rows: minmax(0, auto) minmax(0, 1fr) auto;
    }

    .messages {
        padding: 12px 10px;
        padding-bottom: calc(12px + var(--mobile-account-height));
        max-width: 100%;
    }

    .message {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px;
        padding: 10px 4px;
    }

    .message .avatar,
    .message .avatar-wrap {
        width: 36px;
        height: 36px;
    }

    .message-actions {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .message-actions::-webkit-scrollbar {
        display: none;
    }

    .message-actions button,
    .reaction {
        min-height: 36px;
        flex: 0 0 auto;
    }

    .composer {
        grid-template-columns: 42px 42px 42px 42px minmax(0, 1fr) 44px !important;
        gap: 7px;
        min-height: 56px;
        margin: 0 8px calc(var(--mobile-account-height) + 8px) !important;
        max-width: calc(100% - 16px);
        padding: 7px;
        border-radius: 14px 14px 0 0;
        background: rgba(35, 36, 40, .98);
    }

    .composer .icon-button,
    .composer .send-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
    }

    .composer input {
        min-height: 42px;
        height: 42px;
        font-size: 16px;
    }

    .send-button::before {
        content: none;
    }
    .send-button .lucide {
        width: 18px;
        height: 18px;
    }

    .server-rail {
        position: fixed;
        z-index: 70;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--mobile-rail-height) + env(safe-area-inset-bottom, 0px));
        min-height: 0;
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) 48px 48px 48px;
        align-items: center;
        gap: 6px;
        padding: 8px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)) !important;
        overflow: hidden;
        border-top: 1px solid rgba(255, 255, 255, .12);
        border-right: 0;
        background: rgba(30, 31, 34, .98);
        box-shadow: 0 -18px 44px rgba(0, 0, 0, .34);
    }

    .server-list {
        width: 100%;
        min-width: 0;
        height: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 7px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        padding: 0 2px;
    }

    #newServerButton,
    #joinServerButton,
    #coverButton {
        margin-top: 0;
    }

    .server-rail-divider {
        display: none;
    }

    .server-pill,
    #serverList .server-pill,
    .server-rail .server-pill {
        width: 46px !important;
        height: 46px !important;
        margin-left: 0 !important;
        border-radius: 16px;
        scroll-snap-align: center;
    }

    .server-pill.active::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: -6px;
        width: 28px;
        height: 5px;
        border-radius: 999px;
        background: #fff;
        box-shadow: 0 0 8px rgba(255, 255, 255, .55);
        transform: translateX(-50%);
    }

    .server-pill.has-unread::before,
    .server-pill.has-ping::before {
        left: auto;
        top: -3px;
        right: -3px;
        width: 12px;
        height: 12px;
        transform: none;
    }

    .server-pill.active.has-unread::before,
    .server-pill.active.has-ping::before {
        top: -3px;
        bottom: auto;
    }

    .channel-panel {
        left: 0 !important;
        top: 0;
        bottom: calc(var(--mobile-rail-height) + env(safe-area-inset-bottom, 0px));
        width: min(360px, 100vw) !important;
        max-width: 100vw !important;
        height: auto;
        grid-template-rows: auto minmax(0, 1fr) auto;
        transform: translateX(-105%);
        border-right: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 18px 0 48px rgba(0, 0, 0, .42);
        background: rgba(43, 45, 49, .99);
    }

    .channel-panel header {
        min-height: calc(58px + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) 12px 0;
    }

    .channel-panel header strong {
        max-width: none;
        font-size: 15px;
    }

    body.mobile-channels-open .app-shell::after {
        z-index: 55;
        inset: 0 0 calc(var(--mobile-rail-height) + env(safe-area-inset-bottom, 0px)) 0 !important;
        left: 0 !important;
        background: rgba(0, 0, 0, .54);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .channel-list {
        padding: 10px;
    }

    .channel-search {
        position: sticky;
        top: 0;
        z-index: 1;
        height: 46px;
        margin-bottom: 10px;
        background: #1e1f22;
    }

    .channel-row {
        min-height: 52px;
        padding: 0 12px;
        gap: 10px;
    }

    .channel-row .avatar-wrap,
    .channel-row .avatar,
    .group-avatar {
        width: 40px;
        height: 40px;
    }

    .category-title {
        margin-top: 18px;
        margin-bottom: 8px;
    }

    .mobile-user-strip {
        z-index: 45;
        left: 8px;
        right: 8px;
        bottom: calc(var(--mobile-rail-height) + 8px + env(safe-area-inset-bottom, 0px));
        min-height: var(--mobile-account-height);
        grid-template-columns: 40px minmax(0, 1fr) 40px 40px 40px;
        border-radius: 14px;
        background: rgba(35, 36, 40, .98);
    }

    .mobile-user-strip .icon-button {
        width: 40px;
        height: 40px;
    }

body.keyboard-open .composer {
    margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
}

    body.keyboard-open .chat-panel {
        padding-bottom: 0;
    }

    body.keyboard-open .server-rail {
        transform: translateY(110%);
    }

    body.keyboard-open .messages {
        padding-bottom: 12px;
    }

    body.keyboard-open .channel-panel {
        bottom: 0;
    }

    .home-board {
        gap: 12px;
    }

    .home-board > section:first-child {
        padding: 18px;
    }

    .home-board h2 {
        font-size: 24px;
        line-height: 1.12;
    }

    .home-board p:not(.eyebrow) {
        line-height: 1.5;
    }

    .quick-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .quick-actions button {
        width: 100%;
        min-height: 44px;
        padding-inline: 10px;
    }

    .stats-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .stats-row div {
        padding: 12px 10px;
    }

    .stats-row strong {
        font-size: 22px;
    }

    .friend-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .friend-card {
        min-height: 74px;
        grid-template-columns: 48px minmax(0, 1fr);
        align-items: center;
        gap: 6px 12px;
        padding: 12px;
    }

    .friend-card .avatar-wrap,
    .friend-card .avatar {
        grid-row: span 2;
        width: 48px;
        height: 48px;
    }

    .friend-card strong,
    .friend-card small,
    .friend-card .inline-badges {
        min-width: 0;
        justify-content: flex-start;
    }

    .request-row,
    .incoming-call {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .request-row .primary-button,
    .incoming-call .primary-button {
        grid-column: 1 / -1;
        min-height: 42px;
    }

    .profile-card {
        margin-inline: 0;
        border-radius: 0;
        border-inline: 0;
    }

    .profile-panel {
        grid-template-rows: 142px minmax(0, auto) auto;
    }

    .profile-buttons {
        top: 8px;
        right: 8px;
    }

    .modal {
        width: min(100% - 12px, 1080px);
    }

    .modal-card {
        max-height: calc(100svh - 12px);
        max-height: calc(100dvh - 12px);
    }
}

@media (max-width: 420px) {
    .quick-actions,
    .stats-row {
        grid-template-columns: 1fr;
    }

    .header-actions {
        max-width: 40vw;
    }
}

/* Final composer anchoring: der Composer schwebt wie die Profilleiste unten links - abgerundet,
   mit Luft an den Seiten und unten, statt flach an den Kanten anzudocken. */
.message-area {
    position: relative !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    padding-bottom: 66px !important;
}

.message-area > .messages {
    min-height: 0 !important;
    padding-bottom: 14px !important;
}

.message-area > .composer {
    position: absolute !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, .24) !important;
    transform: none !important;
}

@media (max-width: 760px) {
    .message-area {
        padding-bottom: calc(56px + var(--mobile-account-height) + 8px) !important;
    }

    .message-area > .composer {
        bottom: calc(var(--mobile-account-height) + 8px) !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        border-radius: 14px 14px 0 0 !important;
        border: 1px solid rgba(255, 255, 255, .12) !important;
        border-bottom: 0 !important;
    }

    .message-area > .timeout-banner {
        bottom: calc(var(--mobile-account-height) + 8px) !important;
    }
}

/* ── Multi-line Composer (authoritative, wins over earlier breakpoint rules) ── */
.composer {
    height: auto;
    min-height: 52px;
    /* Eine frühere, ungescopte Regel setzt hier fälschlich eine fixe max-height von 56px - ohne
       diese Zeile könnte der Composer bei mehrzeiligen Nachrichten nie wachsen und alles (inkl.
       der Icons unten) würde in die viel zu kleine Box gequetscht werden. */
    max-height: 224px;
    align-items: center;
}

#messageInput {
    height: auto;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
    padding-top: 8px;
    padding-bottom: 8px;
    font-family: inherit;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    width: 100%;
    display: block;
    color: inherit;
    align-self: center;
}
