.topbar {
    position: sticky;
    top: 12px;
    z-index: 50;
    container-type: inline-size;
    margin: 12px 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
}

.topbar-inner {
    min-height: 74px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        radial-gradient(circle at 72% 0%, color-mix(in srgb, var(--accent, #dc2626) 18%, transparent), transparent 32%),
        linear-gradient(135deg, rgba(8, 10, 24, 0.96), rgba(7, 11, 28, 0.9));
    backdrop-filter: blur(18px);
    box-shadow:
        0 22px 50px -32px rgba(0, 0, 0, 0.95),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand {
    position: relative;
    z-index: 2;
    color: #f8fafc;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.14);
}

.brand img {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.actions {
    gap: 12px;
}

.pill-btn,
.nav-btn,
.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 10px 17px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
        rgba(12, 16, 34, 0.72);
    color: #eef2ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 14px 28px -22px rgba(0, 0, 0, 0.95);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.02em;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.pill-btn:hover,
.nav-btn:hover,
.lang-btn:hover,
.pill-btn.is-active,
.nav-btn.is-active {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent, #dc2626) 70%, #ffffff);
    background:
        radial-gradient(circle at 40% 0%, color-mix(in srgb, var(--accent, #dc2626) 24%, transparent), transparent 62%),
        rgba(18, 24, 48, 0.82);
    color: #fff;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--accent, #dc2626) 18%, transparent),
        0 16px 30px -20px color-mix(in srgb, var(--accent, #dc2626) 68%, transparent);
}

.pill-btn::before,
.nav-btn::before,
.lang-btn::before {
    content: attr(data-icon);
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    color: color-mix(in srgb, var(--accent, #dc2626) 76%, #ffffff);
    font-size: 16px;
    line-height: 1;
}

.menu-toggle {
    position: relative;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: 10px;
    border: 1px solid color-mix(in srgb, var(--accent, #dc2626) 58%, rgba(255, 255, 255, 0.16));
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent, #dc2626) 34%, transparent), transparent 68%),
        rgba(14, 18, 38, 0.88);
    color: #fff;
    box-shadow: 0 0 28px -12px color-mix(in srgb, var(--accent, #dc2626) 80%, transparent);
    cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
    content: "";
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle {
    flex-direction: column;
    gap: 5px;
}

.topbar.is-open .menu-toggle span {
    opacity: 0;
}

.topbar.is-open .menu-toggle::before {
    transform: translateY(7px) rotate(45deg);
}

.topbar.is-open .menu-toggle::after {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 760px) {
    .topbar {
        top: 10px;
        margin: 10px 0;
    }

    .topbar-inner {
        position: relative;
        display: grid !important;
        grid-template-columns: minmax(0, 70%) minmax(68px, 30%);
        align-items: center !important;
        gap: 0;
        min-height: 0 !important;
        padding: 0 6px 0 0 !important;
        overflow: visible;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .brand {
        justify-content: flex-start;
        min-width: 0;
        min-height: 64px;
        padding: 0 0 0 18px;
    }

    .brand span {
        display: inline !important;
        white-space: nowrap;
    }

    .brand img {
        width: 28px;
        height: 28px;
    }

    .menu-toggle {
        display: inline-flex;
        justify-self: end;
        margin-right: 0;
    }

    .actions {
        position: absolute;
        top: 64px;
        right: 6px;
        z-index: 1;
        display: grid !important;
        width: max-content;
        min-width: 148px;
        max-width: calc(100% - 18px);
        max-height: 0;
        padding: 0 12px;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        border-radius: 0 0 16px 16px;
        background:
            linear-gradient(180deg, rgba(7, 11, 28, 0.48), rgba(5, 8, 20, 0.28));
        backdrop-filter: blur(18px);
        box-shadow: none;
        transform: translateY(-8px);
        transition: max-height 260ms ease, padding 260ms ease, opacity 180ms ease, transform 220ms ease, visibility 0ms linear 260ms;
    }

    .topbar.is-open .actions {
        max-height: 330px;
        padding: 4px 12px 12px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition-delay: 0ms;
    }

    .pill-btn,
    .nav-btn,
    .lang-btn {
        width: 100%;
        justify-content: flex-start;
        min-height: 57px;
        padding: 0 8px;
        border: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 0;
        background: rgba(255, 255, 255, 0.01);
        box-shadow: none;
        font-size: 15px;
    }

    .pill-btn:hover,
    .nav-btn:hover,
    .lang-btn:hover,
    .pill-btn.is-active,
    .nav-btn.is-active {
        transform: none;
        background: transparent;
        box-shadow: none;
    }

    .pill-btn::after,
    .nav-btn::after,
    .lang-btn::after {
        content: "›";
        margin-left: auto;
        color: rgba(255, 255, 255, 0.72);
        font-size: 24px;
        line-height: 1;
    }
}

@container (max-width: 760px) {
    .topbar-inner {
        position: relative;
        display: grid !important;
        grid-template-columns: minmax(0, 70%) minmax(68px, 30%);
        align-items: center !important;
        gap: 0;
        min-height: 0 !important;
        padding: 0 6px 0 0 !important;
        overflow: visible;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .brand {
        justify-content: flex-start;
        min-width: 0;
        min-height: 64px;
        padding: 0 0 0 18px;
    }

    .brand span {
        display: inline !important;
        white-space: nowrap;
    }

    .brand img {
        width: 28px;
        height: 28px;
    }

    .menu-toggle {
        display: inline-flex;
        justify-self: end;
        margin-right: 0;
    }

    .actions {
        position: absolute;
        top: 64px;
        right: 6px;
        z-index: 1;
        display: grid !important;
        width: max-content;
        min-width: 148px;
        max-width: calc(100% - 18px);
        max-height: 0;
        padding: 0 12px;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        border-radius: 0 0 16px 16px;
        background:
            linear-gradient(180deg, rgba(7, 11, 28, 0.48), rgba(5, 8, 20, 0.28));
        backdrop-filter: blur(18px);
        box-shadow: none;
        transform: translateY(-8px);
        transition: max-height 260ms ease, padding 260ms ease, opacity 180ms ease, transform 220ms ease, visibility 0ms linear 260ms;
    }

    .topbar.is-open .actions {
        max-height: 330px;
        padding: 4px 12px 12px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition-delay: 0ms;
    }

    .pill-btn,
    .nav-btn,
    .lang-btn {
        width: 100%;
        justify-content: flex-start;
        min-height: 57px;
        padding: 0 8px;
        border: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 0;
        background: rgba(255, 255, 255, 0.01);
        box-shadow: none;
        font-size: 15px;
    }

    .pill-btn:hover,
    .nav-btn:hover,
    .lang-btn:hover,
    .pill-btn.is-active,
    .nav-btn.is-active {
        transform: none;
        background: transparent;
        box-shadow: none;
    }

    .pill-btn::after,
    .nav-btn::after,
    .lang-btn::after {
        content: "›";
        margin-left: auto;
        color: rgba(255, 255, 255, 0.72);
        font-size: 24px;
        line-height: 1;
    }
}
