.site-header {
    position: sticky;
    top: 14px;
    z-index: 100;

    width: min(1690px, calc(100% - 28px));
    margin: 14px auto 0;


    --wbs-head-edge: rgba(222,230,250,.25);
    --wbs-head-inner-edge: rgba(222,230,250,.17);
    --wbs-head-inner: rgba(255,255,255,.035);
    --wbs-head-hover: rgba(255,255,255,.07);
    --wbs-head-sheen: rgba(255,255,255,.065);
    --wbs-head-inset: rgba(255,255,255,.13);
    --wbs-head-shadow: rgba(0,0,0,.32);
    --wbs-head-blur: 18px;

}


[data-theme="light"] .site-header {
    --wbs-head-edge: rgba(82,97,120,.23);
    --wbs-head-inner-edge: rgba(82,97,120,.19);
    --wbs-head-inner: rgba(221,227,235,.48);
    --wbs-head-hover: rgba(211,219,229,.65);
    --wbs-head-sheen: rgba(255,255,255,.42);
    --wbs-head-inset: rgba(255,255,255,.8);
    --wbs-head-shadow: rgba(41,57,90,.13);
    --wbs-head-blur: 20px;
    --wbs-owners-surface-share: 65%;
    --wbs-owners-underlay: #f4f6fb;
}

.header-shell {
    position: relative;

    border: 1px solid var(--wbs-head-edge);
    border-radius: 24px;

    background: linear-gradient(155deg,var(--wbs-head-sheen),transparent 58%),var(--surface);

    box-shadow: 0 14px 40px var(--wbs-head-shadow),inset 0 1px 0 var(--wbs-head-inset),inset 0 -1px 0 var(--wbs-head-inner-edge);

    backdrop-filter: blur(var(--wbs-head-blur)) saturate(135%);
    -webkit-backdrop-filter: blur(var(--wbs-head-blur)) saturate(135%);

    overflow: visible;
}

.header-top {
    min-width: 0;
    min-height: 76px;
    padding: 12px 14px;

    display: grid;
    grid-template-columns:
        minmax(210px, 260px)
        minmax(300px, 1fr)
        auto;

    align-items: center;
    gap: 18px;
}

.brand {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 11px;

    color: var(--text);
    text-decoration: none;
}

.profile-menu button.profile-logout {
    width: 100%;
    margin: 0;

    font: inherit;
    text-align: left;

    color: var(--text);
    background: transparent;

    cursor: pointer;
}

.brand-mark {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: grid;
    place-items: center;

    color: var(--accent);

    border: 1px solid var(--line-soft);
    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--accent) 22%, transparent),
            color-mix(in srgb, var(--surface) 92%, transparent)
        );

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 8px 25px rgba(0,0,0,.12);
}

.brand-mark svg {
    width: 26px;
    height: 26px;
}

.brand-copy {
    min-width: 0;
    display: grid;
}

.brand-copy strong {
    overflow: hidden;

    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.brand-copy small {
    margin-top: 5px;

    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
}

.header-search {
    height: 46px;

    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 10px;

    padding: 0 12px;

    color: var(--text-muted);

    border: 1px solid var(--wbs-head-inner-edge);
    border-radius: 15px;

    background: var(--wbs-head-inner);

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;


    box-shadow: inset 0 1px 0 var(--wbs-head-inset);

}

.header-search:focus-within {
    border-color: var(--focus);

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--focus) 14%,
            transparent
        );
}

.header-search svg {
    width: 19px;
    height: 19px;
}

.header-search input {
    width: 100%;
    min-width: 0;

    color: var(--text);

    border: 0;
    outline: 0;
    background: transparent;
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search kbd {
    min-width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    color: var(--text-muted);
    font-size: 11px;

    border: 1px solid var(--line-soft);
    border-radius: 7px;

    background: var(--control-surface);
}

.header-actions {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
}

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

.add-server-button,
.header-icon-button,
.profile-button,
.mobile-menu-toggle {
    height: 44px;

    border: 1px solid var(--wbs-head-inner-edge);
    border-radius: 13px;

    color: var(--text);
    background: var(--wbs-head-inner);

    text-decoration: none;

    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease,
        box-shadow 140ms ease;


    box-shadow: inset 0 1px 0 var(--wbs-head-inset);

}

.add-server-button:hover,
.header-icon-button:hover,
.profile-button:hover,
.mobile-menu-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--wbs-head-edge);


    background: var(--wbs-head-hover);

}

.add-server-button {
    padding: 0 15px;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--active-text);

    border-color: var(--active-line);
    background: var(--active);
}

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

.header-icon-button,
.mobile-menu-toggle {
    width: 44px;
    padding: 0;

    display: grid;
    place-items: center;
}

.header-icon-button svg,
.mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
}

.header-popover-anchor {
    position: relative;
    flex: 0 0 auto;
}

.owners-menu-anchor {
    position: relative;
}

.profile-button {
    max-width: 180px;
    padding: 0 11px 0 7px;

    display: flex;
    align-items: center;
    gap: 9px;
}

.profile-avatar {
    width: 31px;
    height: 31px;

    flex: 0 0 31px;

    display: grid;
    place-items: center;

    color: #fff;
    font-size: 14px;
    font-weight: 700;

    border-radius: 10px;

    background:
        linear-gradient(
            145deg,
            #7867ff,
            #974dff
        );
}

.profile-name {
    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-chevron,
.owners-chevron {
    width: 15px;
    height: 15px;

    transition: transform 160ms ease;
}

.profile-button[aria-expanded="true"] .profile-chevron,
.owners-toggle[aria-expanded="true"] .owners-chevron {
    transform: rotate(180deg);
}


.site-header :is(a,button,summary):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.header-bottom {
    min-height: 48px;
    padding: 0 14px;

    border-top: 1px solid var(--wbs-head-inner-edge);
}

.main-navigation {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 4px 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--wbs-head-inner-edge);
    border-radius: 12px;
    background: var(--wbs-head-inner);
    box-shadow: inset 0 1px 0 var(--wbs-head-inset);
    transition: background 150ms ease,
                color 150ms ease,
                border-color 150ms ease,
                box-shadow 150ms ease;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--text);
    border-color: var(--wbs-head-edge);
    background: var(--wbs-head-hover);
    box-shadow: inset 0 1px 0 var(--wbs-head-inset),
                0 4px 14px var(--wbs-head-shadow);
}

.nav-item:is(.is-active, [aria-current="page"], [aria-expanded="true"]) {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 58%, var(--wbs-head-inner-edge));
    background: color-mix(in srgb, var(--accent) 18%, var(--wbs-head-inner));
    box-shadow: inset 0 1px 0 var(--wbs-head-inset);
}

.nav-item.is-active::after {
    display: none;
}

.owners-toggle {
    cursor: pointer;
}

.header-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    z-index: 130;

    padding: 8px;

    color: var(--text);

    border: 1px solid var(--wbs-head-edge);
    border-radius: 17px;

    background: linear-gradient(155deg,var(--wbs-head-sheen),transparent 58%),var(--surface);

    box-shadow: 0 14px 40px var(--wbs-head-shadow),inset 0 1px 0 var(--wbs-head-inset),inset 0 -1px 0 var(--wbs-head-inner-edge);

    backdrop-filter: blur(var(--wbs-head-blur)) saturate(135%);
    -webkit-backdrop-filter: blur(var(--wbs-head-blur)) saturate(135%);
}

.header-popover[hidden] {
    display: none;
}

.popover-title {
    display: block;
    padding: 8px 9px 10px;

    color: var(--text-muted);
    font-size: 11px;
}

.theme-menu {
    background: linear-gradient(155deg,var(--wbs-head-sheen),transparent 58%),var(--surface);

    width: 176px;
}

.theme-options {
    display: grid;
    gap: 4px;
}

.theme-options button {
    min-height: 40px;
    padding: 0 10px;

    display: flex;
    align-items: center;
    gap: 9px;

    color: var(--text);

    border: 1px solid transparent;
    border-radius: 10px;

    background: transparent;
}

.theme-options button:hover,
.theme-options button[aria-pressed="true"] {
    border-color: var(--line-soft);
    background: var(--control-surface);
}


.theme-menu {
    width: 186px;
    padding: 7px;

    border-radius: 15px;
}

.theme-menu .popover-title {
    padding: 5px 8px 7px;

    font-size: 10px;
    letter-spacing: .04em;
}

.theme-options {
    gap: 2px;
}

.theme-options button {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;

    display: grid;
    grid-template-columns: 23px 1fr;
    align-items: center;
    gap: 8px;

    text-align: left;

    border-radius: 9px;
}

.theme-options button:hover {
    background:
        color-mix(
            in srgb,
            var(--control-surface) 78%,
            transparent
        );
}

.theme-options button[aria-pressed="true"] {
    border-color:
        color-mix(
            in srgb,
            var(--accent) 42%,
            var(--line-soft)
        );

    background:
        color-mix(
            in srgb,
            var(--active) 38%,
            var(--control-surface)
        );
}

.theme-option-symbol {
    width: 19px;
    height: 19px;

    overflow: visible;
}


.theme-option-symbol-light {
    color: #e2a923;
}

.theme-option-symbol-dark {
    color: #a7afff;
}

.theme-popover-anchor {
    position: relative !important;
}

.theme-popover-anchor .theme-menu {
    position: absolute;

    top: calc(100% + 7px);
    right: 0;
    left: auto;
    bottom: auto;

    z-index: 220;
}

/* WBS Liquid Glass V3.1 — profile menu */
.profile-menu {
    --profile-edge: rgba(222,230,250,.25);
    --profile-inner-edge: rgba(222,230,250,.17);
    --profile-inner: rgba(255,255,255,.035);
    --profile-hover: rgba(255,255,255,.07);
    --profile-sheen: rgba(255,255,255,.065);
    --profile-inset: rgba(255,255,255,.13);
    --profile-shadow: rgba(0,0,0,.32);
    --profile-blur: 18px;

    width: 244px;
    padding: 9px;
    box-sizing: border-box;
}

[data-theme="light"] .profile-menu {
    --profile-edge: rgba(82,97,120,.23);
    --profile-inner-edge: rgba(82,97,120,.19);
    --profile-inner: rgba(221,227,235,.48);
    --profile-hover: rgba(211,219,229,.65);
    --profile-sheen: rgba(255,255,255,.42);
    --profile-inset: rgba(255,255,255,.8);
    --profile-shadow: rgba(41,57,90,.13);
    --profile-blur: 20px;
}

.header-popover.profile-menu {
    border: 1px solid var(--profile-edge);
    border-radius: 18px;

    background:
        linear-gradient(
            155deg,
            var(--profile-sheen),
            transparent 58%
        ),
        var(--surface);

    box-shadow:
        0 14px 40px var(--profile-shadow),
        inset 0 1px 0 var(--profile-inset),
        inset 0 -1px 0 var(--profile-inner-edge);

    backdrop-filter:
        blur(var(--profile-blur)) saturate(135%);
    -webkit-backdrop-filter:
        blur(var(--profile-blur)) saturate(135%);
}

@supports not ((backdrop-filter: blur(1px)) or
               (-webkit-backdrop-filter: blur(1px))) {
    .header-popover.profile-menu {
        background: var(--popover-bg);
    }
}

/* Invisible pointer bridge between trigger and menu. */
@media (hover: hover) and (pointer: fine) {
    .profile-menu::before {
        content: "";
        position: absolute;
        top: -10px;
        left: 0;
        right: 0;
        height: 10px;
        background: transparent;
        pointer-events: auto;
    }
}

.profile-menu::after {
    content: "";
    position: absolute;
    inset: 0 20px auto;
    height: 1px;
    background: linear-gradient(
        90deg, transparent,
        var(--profile-inset), transparent
    );
    pointer-events: none;
}

.profile-menu a,
.profile-menu button.profile-logout {
    min-height: 44px;
    padding: 0 11px;
    margin: 0 0 4px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    gap: 12px;

    color: var(--text);
    font-size: 13px;
    text-decoration: none;

    border-radius: 11px;
    border: 1px solid var(--profile-inner-edge);
    background: var(--profile-inner);
    box-shadow: inset 0 1px 0 var(--profile-inset);
    cursor: pointer;
}

.profile-menu a:hover,
.profile-menu button.profile-logout:hover,
.profile-menu a:focus-visible,
.profile-menu button.profile-logout:focus-visible {
    border-color: var(--profile-edge);
    background: var(--profile-hover);
}

.profile-menu a:focus-visible,
.profile-menu button.profile-logout:focus-visible {
    outline: 2px solid var(--wbs-nav-neon-violet);
    outline-offset: 2px;
}

.profile-menu a svg,
.profile-menu button.profile-logout svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}



.popover-divider {
    height: 1px;
    margin: 6px 5px;

    background: var(--line-soft);
}

.profile-menu .profile-logout:hover {
    color: var(--wbs-nav-neon-rose);
}



/* WBS Liquid Glass V3.1 — Owners dropdown */
.owners-menu {
    left: 0;
    right: auto;
    width: 322px;
    max-width: calc(100vw - 24px);
    padding: 10px;
}

.header-popover.owners-menu {
    border: 1px solid var(--wbs-head-edge);
    border-radius: 19px;

    background:
        linear-gradient(
            155deg,
            var(--wbs-head-sheen),
            transparent 65%
        ),
        color-mix(
            in srgb,
            var(--surface) var(--wbs-owners-surface-share, 78%),
            var(--wbs-owners-underlay, transparent)
        );

    box-shadow:
        0 18px 48px var(--wbs-head-shadow),
        inset 0 1px 0 var(--wbs-head-inset),
        inset 0 -1px 0 var(--wbs-head-inner-edge);

    backdrop-filter: blur(20px) saturate(135%);
    -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.owners-menu a {
    min-height: 62px;
    padding: 9px 10px;
    margin: 0 0 5px;

    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 11px;

    color: var(--text);
    text-decoration: none;

    background: var(--wbs-head-inner);
    border: 1px solid var(--wbs-head-inner-edge);
    border-radius: 12px;

    box-shadow:
        inset 0 1px 0 var(--wbs-head-inset);

    transition:
        background 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.owners-menu a:last-child {
    margin-bottom: 0;
}

.owners-menu a:hover {
    background: var(--wbs-head-hover);
    border-color: var(--wbs-head-edge);

    box-shadow:
        inset 0 1px 0 var(--wbs-head-inset),
        0 5px 16px var(--wbs-head-shadow);

    transform: translateY(-1px);
}

.owners-menu a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-color: var(--wbs-head-edge);
    background: var(--wbs-head-hover);
}

.owners-menu a > svg {
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    justify-self: center;
    align-self: center;
    border: 0;
    background: transparent;
    box-shadow: none;
}


.owners-menu a span {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.owners-menu strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.owners-menu small {
    margin: 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.4;
}

@supports not ((backdrop-filter: blur(1px)) or
               (-webkit-backdrop-filter: blur(1px))) {
    .header-popover.owners-menu {
        background: var(--popover-bg);
    }
}


.mobile-menu-toggle {
    display: none;
}

.menu-close-icon {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-open-icon {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-close-icon {
    display: block;
}

@media (max-width: 1180px) {
    .header-top {
        grid-template-columns:
            minmax(180px, 220px)
            1fr
            auto;
    }

    .brand-copy small {
        display: none;
    }

    .nav-item {
        padding-inline: 8px;
        font-size: 12px;
    }

    .nav-item svg {
        width: 16px;
        height: 16px;
    }

    .add-server-button span {
        display: none;
    }

    .add-server-button {
        width: 44px;
        padding: 0;

        justify-content: center;
    }
}

@media (max-width: 1180px) {
    .site-header {
        top: 8px;

        width: min(
            calc(100% - 16px),
            760px
        );

        margin-top: 8px;
    }

    .header-shell {
        border-radius: 19px;
    }

    .header-top {
        padding: 10px;

        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .header-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .header-search {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .profile-name,
    .profile-chevron {
        display: none;
    }

    .profile-button {
        width: 44px;
        padding: 0;

        justify-content: center;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
    }

    .mobile-menu-toggle {
        display: grid;
    }

    .header-bottom {
        display: none;

        padding: 6px 10px 10px;
    }

    .header-bottom.is-open {
        display: block;
    }

    .main-navigation {
        display: grid;
        justify-content: stretch;
        gap: 3px;
    }

    .nav-item {
        min-height: 43px;
        padding: 0 10px;

        justify-content: flex-start;

        border-radius: 10px;
    }



    .owners-menu-anchor {
        position: static;
    }

    .owners-menu {
        position: static;

        width: 100%;
        margin-top: 5px;

        box-shadow: none;
    }
}

@media (max-width: 580px) {
    .header-actions {
        gap: 4px;
    }

    .site-header {
        width: calc(100% - 10px);
        margin-top: 5px;
    }

    .brand {
        gap: 7px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;

        flex-basis: 34px;

        border-radius: 10px;
    }

    .brand-mark svg {
        width: 22px;
        height: 22px;
    }

    .brand-copy {
        max-width: none;
        overflow: visible;
    }

    .brand-copy strong {
        overflow: visible;

        font-size: 15px;
        line-height: 1;

        white-space: nowrap;
        text-overflow: clip;
    }

    .header-icon-button,
    .mobile-menu-toggle,
    .add-server-button,
    .profile-button {
        width: 38px;
        height: 38px;
    }

    .profile-avatar {
        width: 28px;
        height: 28px;

        flex-basis: 28px;

        border-radius: 8px;
    }

    [data-telegram-bot-placeholder] {
        display: none;
    }

    .header-actions {
        gap: 5px;
    }

    .header-search kbd {
        display: none;
    }

    .header-popover-anchor {
        position: static;
    }

    .profile-menu {
        position: absolute;

        top: calc(100% + 8px);
        right: 8px;
        left: auto;
        bottom: auto;

        width: min(250px, calc(100vw - 26px));

        border-radius: 18px;
    }

    .theme-popover-anchor .theme-menu {
        top: calc(100% + 6px);
        right: 0;

        width: 186px;
    }

    .owners-menu {
        position: static;

        inset: auto;

        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header *,
    .site-header *::before,
    .site-header *::after {
        transition-duration: .01ms !important;
    }
}


@media (max-width: 410px) {
    .header-top {
        padding-inline: 7px;
    }

    .header-actions {
        gap: 3px;
    }

    .brand {
        gap: 6px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;

        flex-basis: 32px;
    }

    .brand-copy strong {
        font-size: 14px;
    }

    .header-icon-button,
    .mobile-menu-toggle,
    .add-server-button,
    .profile-button {
        width: 36px;
        height: 36px;
    }

    .profile-avatar {
        width: 27px;
        height: 27px;

        flex-basis: 27px;
    }
}


/* =========================================================
   Monitoring V2 — Menu V1 final
   ========================================================= */

.menu-panel {
    border-color:
        color-mix(
            in srgb,
            var(--line) 82%,
            transparent
        );

    background: var(--popover-bg);

    box-shadow:
        0 20px 55px rgba(0, 0, 0, .30),
        inset 0 1px 0 rgba(255,255,255,.055);
}




















@media (max-width: 1180px) {
    .main-navigation {
        width: 100%;
    }

    .header-bottom.is-open {
        max-height: min(72vh, 620px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .main-navigation .nav-item {
        width: 100%;
        min-height: 44px;

        justify-content: flex-start;

        border-radius: 10px;
    }

    .main-navigation .nav-item.is-active::after {
        top: 8px;
        bottom: 8px;
        left: 0;

        width: 2px;
        height: auto;

        right: auto;
    }

    .owners-menu-anchor {
        width: 100%;
    }

    .owners-toggle {
        width: 100%;
    }

    .owners-menu-anchor .owners-menu {
        position: static;

        width: 100%;
        margin-top: 4px;

        border-radius: 12px;

        box-shadow:
            inset 0 1px 0 rgba(255,255,255,.04);
    }
}

@media (max-width: 580px) {
    .profile-menu {
        width: min(244px, calc(100vw - 22px));
    }

    .owners-menu a {
        min-height: 54px;
    }
}


/* Monitoring V2 — Logo + mobile search marquee */

.brand-mark {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    padding: 0;

    border: 0;
    border-radius: 12px;

    background: transparent;

    box-shadow: none;
}

.brand-logo-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    filter:
        drop-shadow(
            0 4px 12px
            rgba(93, 89, 255, .22)
        );
}

.header-search {
    position: relative;
}

.header-search > svg {
    grid-column: 1;
    grid-row: 1;
}

.header-search input {
    grid-column: 2;
    grid-row: 1;

    position: relative;
    z-index: 2;
}

.header-search kbd {
    grid-column: 3;
    grid-row: 1;
}

.header-search-marquee {
    display: none;
}

@keyframes wbsMobileSearchMarquee {
    0%,
    14% {
        transform: translateX(0);
    }

    86%,
    100% {
        transform:
            translateX(
                var(--search-marquee-distance, 0px)
            );
    }
}

@media (max-width: 580px) {
    .brand-mark {
        width: 38px;
        height: 38px;

        flex-basis: 38px;

        border-radius: 10px;
    }
}

@media (max-width: 410px) {
    .brand-mark {
        width: 35px;
        height: 35px;

        flex-basis: 35px;
    }

    .header-search-marquee {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-search-marquee-text {
        animation: none !important;
        transform: none !important;
    }
}


/* Search marquee based on real text overflow */

.header-search.is-marquee-active input::placeholder {
    color: transparent;
}

.header-search-marquee {
    grid-column: 2;
    grid-row: 1;

    font: inherit;

    position: relative;
    z-index: 1;

    min-width: 0;
    width: 100%;

    display: block;
    overflow: hidden;

    color: var(--text-muted);

    font-size: 14px;
    line-height: 1;

    white-space: nowrap;
    pointer-events: none;

    opacity: 0;

    transition: opacity 140ms ease;
}

.header-search-marquee.is-visible {
    opacity: 1;
}

.header-search-marquee-text {
    display: inline-block;
    width: max-content;

    will-change: transform;
}

.header-search-marquee.is-moving
.header-search-marquee-text {
    animation:
        wbsMobileSearchMarquee
        8.5s
        ease-in-out
        infinite
        alternate;
}

@media (max-width: 410px) {
    .header-search-marquee {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-search-marquee-text {
        animation: none !important;
        transform: none !important;
    }
}


/* WBS-WORDMARK-SPLIT-V1 */

html[data-theme="dark"] .wbs-wordmark-main {
    color: #e1e5ee;
}

html[data-theme="dark"] .wbs-wordmark-studio {
    color: #9b7cff;

    text-shadow:
        0 0 16px rgba(126, 92, 255, .28);
}

html[data-theme="light"] .wbs-wordmark-main {
    color: #303747;
}

html[data-theme="light"] .wbs-wordmark-studio {
    color: #7257dd;
}

/* WBS mobile wordmark layout */
@media (max-width:480px) {
    .site-header .header-top {
        display:grid;
        grid-template-columns:minmax(0,1fr);
        grid-template-rows:auto auto auto;
        grid-template-areas:"brand" "search" "actions";
        gap:8px;
        padding:10px;
    }
    .site-header .header-top > .brand {
        grid-area:brand;
        justify-self:center;
        max-width:100%;
        min-width:0;
    }
    .site-header .brand-copy {
        display:grid;
        min-width:0;
    }
    .site-header .brand-copy strong {
        display:block;
        font-size:clamp(16px,4.5vw,20px);
        white-space:nowrap;
        overflow:visible;
        text-overflow:clip;
    }
    .site-header .brand-copy strong span {
        font-size:inherit;
    }
    .site-header .header-top > .header-search {
        grid-area:search;
        width:100%;
        min-width:0;
    }
    .site-header .header-top > .header-actions {
        grid-area:actions;
        display:flex;
        flex-wrap:wrap;
        justify-content:center;
        gap:6px;
        width:100%;
        min-width:0;
    }
    .site-header .header-actions :is(
        .add-server-button,.header-icon-button,
        .profile-button,.mobile-menu-toggle
    ) {
        min-height:44px;
    }
}

/* WBS Neon Outline V1: palette for converted header icons only. */
.site-header {
    --wbs-nav-neon-violet: #b29aff;
    --wbs-nav-neon-blue: #77c9ff;
    --wbs-nav-neon-mint: #66e3b0;
    --wbs-nav-neon-gold: #ffce84;
    --wbs-nav-neon-rose: #fa91b2;
    --wbs-nav-neon-slate: #bac7dc;
}
html[data-theme="light"] .site-header {
    --wbs-nav-neon-violet: #7655c6;
    --wbs-nav-neon-blue: #247bb9;
    --wbs-nav-neon-mint: #16835d;
    --wbs-nav-neon-gold: #946014;
    --wbs-nav-neon-rose: #b63762;
    --wbs-nav-neon-slate: #62728a;
}


/* WBS Moderation Live V1 */
.wbs-mod-badge {
    flex:none;min-width:20px;padding:3px 6px;border-radius:99px;
    background:#b52245;color:#fff;font-size:11px;font-weight:700;
    line-height:1.3;text-align:center;font-variant-numeric:tabular-nums;
}
.profile-button[data-wbs-mod-url] {
    position:relative;
    overflow:visible;
}
.profile-button>.wbs-mod-badge {
    position:absolute;
    top:-7px;
    right:-7px;
    z-index:2;
    min-width:21px;
    min-height:21px;
    box-sizing:border-box;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:2px 5px;
    border:2px solid var(--popover-bg,#171b24);
    pointer-events:none;
}
#profile-menu .wbs-mod-badge {margin-inline-start:auto}
.wbs-mod-badge[hidden],.wbs-mod-toast[hidden] {display:none!important}
.wbs-mod-toast {
    position:fixed;bottom:20px;right:20px;z-index:5000;
    display:grid;gap:10px;width:min(360px,calc(100% - 32px));
    padding:16px;border-radius:16px;color:var(--text);
    border:1px solid rgba(222,230,250,.25);
    background:linear-gradient(155deg,rgba(255,255,255,.065),transparent 58%),var(--surface);
    backdrop-filter:blur(var(--blur)) saturate(135%);
    -webkit-backdrop-filter:blur(var(--blur)) saturate(135%);
    box-shadow:0 14px 40px rgba(0,0,0,.32),inset 0 1px 0 rgba(255,255,255,.13);
}
html[data-theme="light"] .wbs-mod-toast {
    border-color:rgba(82,97,120,.23);
    background:linear-gradient(155deg,rgba(255,255,255,.42),transparent 58%),var(--surface);
    box-shadow:0 14px 40px rgba(41,57,90,.13),inset 0 1px 0 rgba(255,255,255,.8);
}
.wbs-mod-toast-head {display:flex;align-items:center;gap:9px}
.wbs-mod-toast-head strong {flex:1;font-size:14px}
.wbs-mod-toast svg {width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.wbs-mod-toast-head>svg {color:var(--wbs-nav-neon-gold,#ffce84)}
.wbs-mod-toast p {margin:0;font-size:13px;color:var(--text-muted);line-height:1.5}
.wbs-mod-toast a,.wbs-mod-toast button {
    display:inline-flex;align-items:center;justify-content:center;
    min-height:44px;border-radius:10px;border:1px solid var(--active-line);
    background:var(--active);color:var(--active-text);
    font:inherit;text-decoration:none;cursor:pointer;padding:9px 12px;
}
.wbs-mod-toast :focus-visible {outline:2px solid var(--wbs-nav-neon-blue,#77c9ff);outline-offset:3px}
@supports not (backdrop-filter:blur(1px)) {
    .wbs-mod-toast {background:var(--popover-bg,var(--surface))}
}
@media(max-width:600px) {
    .wbs-mod-toast {right:16px;bottom:16px}
}
