.top-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line, #dbe4ef);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
}

.top-nav .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
}

.top-nav .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: 0;
}

.top-nav .brand-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-600, var(--blue, #2563eb)), var(--indigo, #4f46e5));
    color: #fff;
    font-size: 21px;
    font-weight: 950;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

.top-nav .brand strong,
.top-nav .brand small {
    display: block;
}

.top-nav .brand strong {
    color: var(--text, #0f172a);
    font-size: 20px;
    line-height: 1.1;
}

.top-nav .brand small {
    color: var(--blue-600, var(--blue, #2563eb));
    font-size: 12px;
    font-weight: 800;
}

.top-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    color: #475569;
    font-size: 14px;
    font-weight: 800;
}

.top-nav .nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
    color: var(--blue-600, var(--blue, #2563eb));
}

.top-nav .nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.top-nav .nav-dot.blue { background: var(--blue-600, var(--blue, #2563eb)); }
.top-nav .nav-dot.green { background: var(--emerald, #059669); }
.top-nav .nav-dot.purple { background: var(--purple, #8b5cf6); }
.top-nav .nav-dot.cyan { background: #0891b2; }
.top-nav .nav-dot.amber { background: var(--amber, #d97706); }

.top-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-nav .signin {
    border: 0;
    background: transparent;
    color: #334155;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.top-nav .claim {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--blue-600, var(--blue, #2563eb)), var(--indigo, #4f46e5));
    color: #fff;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.22);
}

.top-nav .mobile-link-row {
    display: none;
}

.top-nav .account-menu-wrap {
    position: relative;
}

.top-nav .account-chip {
    display: inline-grid;
    grid-template-columns: 38px minmax(0, auto) 12px;
    align-items: center;
    column-gap: 10px;
    min-height: 48px;
    border: 1px solid #c7dcff;
    border-radius: 999px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, rgba(37, 99, 235, 0.55), rgba(5, 150, 105, 0.42)) border-box;
    color: var(--text, #0f172a);
    padding: 5px 12px 5px 5px;
    font-family: inherit;
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.18);
    cursor: pointer;
}

.top-nav .account-chip:hover,
.top-nav .account-chip[aria-expanded="true"] {
    border-color: transparent;
    box-shadow: 0 18px 46px rgba(37, 99, 235, 0.25);
}

.top-nav .account-chip span,
.top-nav .account-menu-head > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--blue-600, var(--blue, #2563eb)), var(--emerald, #059669));
    color: #fff;
    font-size: 12px;
    font-weight: 950;
}

.top-nav .account-chip strong {
    overflow: hidden;
    max-width: 150px;
    color: var(--text, #0f172a);
    font-size: 14px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-nav .account-chip i {
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
}

.top-nav .account-chip[aria-expanded="true"] i {
    transform: rotate(225deg) translate(-1px, -1px);
}

.top-nav .account-menu-card {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 80;
    width: min(360px, calc(100vw - 32px));
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    padding: 18px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(16px);
}

.top-nav .account-menu-card[hidden] {
    display: none;
}

.top-nav .account-menu-card::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 28px;
    width: 14px;
    height: 14px;
    border-top: 1px solid #bfdbfe;
    border-left: 1px solid #bfdbfe;
    background: rgba(255, 255, 255, 0.96);
    transform: rotate(45deg);
}

.top-nav .account-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line, #dbe4ef);
}

.top-nav .account-menu-head strong {
    display: block;
    color: var(--text, #0f172a);
    font-size: 18px;
    line-height: 1.2;
}

.top-nav .account-menu-head small {
    display: inline-flex;
    margin-top: 5px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--blue-600, var(--blue, #2563eb));
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 950;
}

.top-nav .account-menu-row {
    display: grid;
    gap: 6px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line, #dbe4ef);
}

.top-nav .account-menu-row small {
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.top-nav .account-menu-row strong {
    overflow-wrap: anywhere;
    color: var(--text, #0f172a);
    font-size: 14px;
}

.top-nav .account-menu-actions {
    display: grid;
    gap: 10px;
    padding-top: 16px;
}

.top-nav .account-primary-action,
.top-nav .account-menu-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 950;
    text-decoration: none;
}

.top-nav .account-primary-action {
    background: linear-gradient(90deg, var(--blue-600, var(--blue, #2563eb)), var(--emerald, #059669));
    color: #fff;
}

.top-nav .account-menu-actions button {
    width: 100%;
    border: 1px solid var(--line, #dbe4ef);
    background: #fff;
    color: var(--text, #0f172a);
    cursor: pointer;
    font-family: inherit;
}

.top-nav .nav-logout-form {
    margin: 0;
}

@media (max-width: 1100px) {
    .top-nav .nav-links {
        display: none;
    }

    .top-nav .nav-inner {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .top-nav .mobile-link-row {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 0 0 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .top-nav .mobile-link-row::-webkit-scrollbar {
        display: none;
    }

    .top-nav .mobile-link-row a {
        flex: 0 0 auto;
        border: 1px solid var(--line, #dbe4ef);
        border-radius: 999px;
        background: #fff;
        color: #475569;
        padding: 9px 12px;
        font-size: 12px;
        font-weight: 900;
        text-decoration: none;
    }

    .top-nav .mobile-link-row a.active {
        border-color: #bfdbfe;
        background: #eff6ff;
        color: var(--blue-600, var(--blue, #2563eb));
    }
}

@media (max-width: 720px) {
    .top-nav {
        overflow: visible;
    }

    .top-nav .container {
        width: min(100% - 20px, 1280px);
    }

    .top-nav .nav-inner {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        min-height: auto;
        padding: 10px 0 8px;
        gap: 10px;
    }

    .top-nav .brand {
        min-width: 0;
        gap: 9px;
    }

    .top-nav .brand-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 18px;
    }

    .top-nav .brand strong {
        font-size: 18px;
    }

    .top-nav .brand small {
        font-size: 11px;
        white-space: nowrap;
    }

    .top-nav .nav-actions {
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        align-self: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .top-nav .signin,
    .top-nav .claim {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 0 11px;
        font-size: 12px;
    }

    .top-nav .account-menu-wrap {
        flex: 0 1 auto;
        margin-left: auto;
        min-width: 0;
    }

    .top-nav .account-chip {
        width: auto;
        max-width: min(220px, 48vw);
        min-width: 0;
        grid-template-columns: 34px minmax(0, 1fr) 10px;
        min-height: 44px;
        column-gap: 8px;
        padding: 5px 9px 5px 5px;
    }

    .top-nav .account-chip span {
        width: 34px;
        height: 34px;
    }

    .top-nav .account-chip strong {
        max-width: none;
        min-width: 0;
        font-size: 13px;
    }

    .top-nav .account-menu-card {
        position: fixed;
        top: 66px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 86px);
        overflow: auto;
        border-radius: 14px;
    }

    .top-nav .account-menu-card::before {
        display: none;
    }

    .top-nav .nav-logout-form .signin {
        width: 100%;
    }

    .top-nav .mobile-link-row {
        width: min(100% - 20px, 1280px);
        gap: 8px;
        padding: 2px 0 10px;
    }

    .top-nav .mobile-link-row a {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        border-radius: 999px;
        padding: 8px 12px;
        white-space: nowrap;
    }
}

@media (max-width: 420px) {
    .top-nav .brand {
        gap: 8px;
    }

    .top-nav .brand-icon {
        width: 36px;
        height: 36px;
    }

    .top-nav .brand strong {
        font-size: 17px;
    }

    .top-nav .brand small {
        font-size: 10px;
    }

    .top-nav .account-chip {
        max-width: 46vw;
        grid-template-columns: 32px minmax(0, 1fr) 10px;
        min-height: 42px;
    }

    .top-nav .account-chip span {
        width: 32px;
        height: 32px;
    }

    .top-nav .account-chip strong {
        font-size: 12px;
    }

    .top-nav .account-menu-card {
        top: 64px;
        left: 10px;
        right: 10px;
        padding: 16px;
    }
}

@media (max-width: 340px) {
    .top-nav .brand small {
        display: none;
    }

    .top-nav .account-chip strong {
        display: none;
    }

    .top-nav .account-chip {
        max-width: none;
        grid-template-columns: 32px 10px;
    }
}
